-
Notifications
You must be signed in to change notification settings - Fork 9
/
ng-table.js
2974 lines (2761 loc) · 131 KB
/
ng-table.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
define(["angular"], factory);
else if(typeof exports === 'object')
exports["ng-table"] = factory(require("angular"));
else
root["ng-table"] = factory(root["angular"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 44);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/* unknown exports provided */
/* all exports used */
/*!**************************!*\
!*** external "angular" ***!
\**************************/
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
/***/ },
/* 1 */
/* exports provided: ngTableCoreModule, Settings, NgTableEventsChannel, ParamValues, NgTableParams, DataSettings, NgTableDefaultGetDataProvider, FilterSettings, GroupSettings */
/* exports used: NgTableParams, ngTableCoreModule, Settings, NgTableEventsChannel, ParamValues, DataSettings, NgTableDefaultGetDataProvider, FilterSettings, GroupSettings */
/*!***************************!*\
!*** ./src/core/index.ts ***!
\***************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(/*! angular */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data__ = __webpack_require__(/*! ./data */ 3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grouping__ = __webpack_require__(/*! ./grouping */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngTableDefaults__ = __webpack_require__(/*! ./ngTableDefaults */ 32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngTableSettings__ = __webpack_require__(/*! ./ngTableSettings */ 11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ngTableParams__ = __webpack_require__(/*! ./ngTableParams */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ngTableEventsChannel__ = __webpack_require__(/*! ./ngTableEventsChannel */ 9);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "d", function() { return __WEBPACK_IMPORTED_MODULE_6__ngTableEventsChannel__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(exports, "c", function() { return __WEBPACK_IMPORTED_MODULE_4__ngTableSettings__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "a", function() { return __WEBPACK_IMPORTED_MODULE_5__ngTableParams__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "e", function() { return __WEBPACK_IMPORTED_MODULE_5__ngTableParams__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__data__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "g", function() { return __WEBPACK_IMPORTED_MODULE_1__data__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__filtering__ = __webpack_require__(/*! ./filtering */ 6);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "h", function() { return __WEBPACK_IMPORTED_MODULE_7__filtering__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__grouping_publicExports__ = __webpack_require__(/*! ./grouping/publicExports */ 31);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "i", function() { return __WEBPACK_IMPORTED_MODULE_8__grouping_publicExports__["a"]; });
/* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return ngTableCoreModule; });
var ngTableCoreModule = __WEBPACK_IMPORTED_MODULE_0_angular__["module"]('ngTable-core', [])
.provider('ngTableDefaultGetData', __WEBPACK_IMPORTED_MODULE_1__data__["b" /* NgTableDefaultGetDataProvider */])
.factory('ngTableDefaultGetGroups', __WEBPACK_IMPORTED_MODULE_2__grouping__["b" /* ngTableDefaultGetGroups */])
.value('ngTableDefaults', __WEBPACK_IMPORTED_MODULE_3__ngTableDefaults__["a" /* ngTableDefaults */])
.service('ngTableEventsChannel', __WEBPACK_IMPORTED_MODULE_6__ngTableEventsChannel__["a" /* NgTableEventsChannel */])
.run(__WEBPACK_IMPORTED_MODULE_4__ngTableSettings__["a" /* Settings */].init)
.run(__WEBPACK_IMPORTED_MODULE_5__ngTableParams__["a" /* NgTableParams */].init);
// note: if you are using ES6 or typescript prefer:
// import { NgTableParams } from 'ng-table';
ngTableCoreModule.value('NgTableParams', __WEBPACK_IMPORTED_MODULE_5__ngTableParams__["a" /* NgTableParams */]);
/***/ },
/* 2 */
/* exports provided: NgTableController, ngTableBrowserModule, FilterConfigValues, NgTableFilterConfigProvider, NgTableFilterConfig */
/* exports used: ngTableBrowserModule, NgTableController, FilterConfigValues, NgTableFilterConfigProvider, NgTableFilterConfig */
/*!******************************!*\
!*** ./src/browser/index.ts ***!
\******************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(/*! angular */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngTable_directive__ = __webpack_require__(/*! ./ngTable.directive */ 14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngTableColumn__ = __webpack_require__(/*! ./ngTableColumn */ 15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngTableColumnsBinding_directive__ = __webpack_require__(/*! ./ngTableColumnsBinding.directive */ 16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngTableController__ = __webpack_require__(/*! ./ngTableController */ 17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ngTableDynamic_directive__ = __webpack_require__(/*! ./ngTableDynamic.directive */ 18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ngTableFilterConfig__ = __webpack_require__(/*! ./ngTableFilterConfig */ 5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ngTableFilterRow_directive__ = __webpack_require__(/*! ./ngTableFilterRow.directive */ 19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ngTableFilterRowController__ = __webpack_require__(/*! ./ngTableFilterRowController */ 20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ngTableGroupRow_directive__ = __webpack_require__(/*! ./ngTableGroupRow.directive */ 21);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ngTableGroupRowController__ = __webpack_require__(/*! ./ngTableGroupRowController */ 22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ngTablePagination_directive__ = __webpack_require__(/*! ./ngTablePagination.directive */ 23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__ngTableSelectFilterDs_directive__ = __webpack_require__(/*! ./ngTableSelectFilterDs.directive */ 24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__ngTableSorterRow_directive__ = __webpack_require__(/*! ./ngTableSorterRow.directive */ 25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__ngTableSorterRowController__ = __webpack_require__(/*! ./ngTableSorterRowController */ 26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__filters_number_html__ = __webpack_require__(/*! ./filters/number.html */ 36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__filters_number_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15__filters_number_html__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__filters_select_html__ = __webpack_require__(/*! ./filters/select.html */ 38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__filters_select_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16__filters_select_html__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__filters_select_multiple_html__ = __webpack_require__(/*! ./filters/select-multiple.html */ 37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__filters_select_multiple_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17__filters_select_multiple_html__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__filters_text_html__ = __webpack_require__(/*! ./filters/text.html */ 39);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__filters_text_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18__filters_text_html__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__pager_html__ = __webpack_require__(/*! ./pager.html */ 42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__pager_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19__pager_html__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__header_html__ = __webpack_require__(/*! ./header.html */ 41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__header_html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20__header_html__);
/* harmony reexport (binding) */ __webpack_require__.d(exports, "b", function() { return __WEBPACK_IMPORTED_MODULE_4__ngTableController__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "c", function() { return __WEBPACK_IMPORTED_MODULE_6__ngTableFilterConfig__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "d", function() { return __WEBPACK_IMPORTED_MODULE_6__ngTableFilterConfig__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "e", function() { return __WEBPACK_IMPORTED_MODULE_6__ngTableFilterConfig__["c"]; });
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return ngTableBrowserModule; });
var ngTableBrowserModule = __WEBPACK_IMPORTED_MODULE_0_angular__["module"]('ngTable-browser', [])
.directive('ngTable', __WEBPACK_IMPORTED_MODULE_1__ngTable_directive__["a" /* ngTable */])
.service('ngTableColumn', __WEBPACK_IMPORTED_MODULE_2__ngTableColumn__["a" /* NgTableColumn */])
.directive('ngTableColumnsBinding', __WEBPACK_IMPORTED_MODULE_3__ngTableColumnsBinding_directive__["a" /* ngTableColumnsBinding */])
.controller('ngTableController', __WEBPACK_IMPORTED_MODULE_4__ngTableController__["a" /* NgTableController */])
.directive('ngTableDynamic', __WEBPACK_IMPORTED_MODULE_5__ngTableDynamic_directive__["a" /* ngTableDynamic */])
.provider('ngTableFilterConfig', __WEBPACK_IMPORTED_MODULE_6__ngTableFilterConfig__["a" /* NgTableFilterConfigProvider */])
.directive('ngTableFilterRow', __WEBPACK_IMPORTED_MODULE_7__ngTableFilterRow_directive__["a" /* ngTableFilterRow */])
.controller('ngTableFilterRowController', __WEBPACK_IMPORTED_MODULE_8__ngTableFilterRowController__["a" /* NgTableFilterRowController */])
.directive('ngTableGroupRow', __WEBPACK_IMPORTED_MODULE_9__ngTableGroupRow_directive__["a" /* ngTableGroupRow */])
.controller('ngTableGroupRowController', __WEBPACK_IMPORTED_MODULE_10__ngTableGroupRowController__["a" /* NgTableGroupRowController */])
.directive('ngTablePagination', __WEBPACK_IMPORTED_MODULE_11__ngTablePagination_directive__["a" /* ngTablePagination */])
.directive('ngTableSelectFilterDs', __WEBPACK_IMPORTED_MODULE_12__ngTableSelectFilterDs_directive__["a" /* ngTableSelectFilterDs */])
.directive('ngTableSorterRow', __WEBPACK_IMPORTED_MODULE_13__ngTableSorterRow_directive__["a" /* ngTableSorterRow */])
.controller('ngTableSorterRowController', __WEBPACK_IMPORTED_MODULE_14__ngTableSorterRowController__["a" /* NgTableSorterRowController */]);
/***/ },
/* 3 */
/* exports provided: DataSettings, NgTableDefaultGetDataProvider */
/* exports used: DataSettings, NgTableDefaultGetDataProvider */
/*!********************************!*\
!*** ./src/core/data/index.ts ***!
\********************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dataSettings__ = __webpack_require__(/*! ./dataSettings */ 27);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__dataSettings__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngTableDefaultGetData__ = __webpack_require__(/*! ./ngTableDefaultGetData */ 28);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__ngTableDefaultGetData__["a"]; });
/***/ },
/* 4 */
/* exports provided: assignPartialDeep, checkClassInit */
/* exports used: checkClassInit, assignPartialDeep */
/*!*****************************!*\
!*** ./src/shared/index.ts ***!
\*****************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assign_partial_deep__ = __webpack_require__(/*! ./assign-partial-deep */ 33);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__assign_partial_deep__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__check_class_init__ = __webpack_require__(/*! ./check-class-init */ 34);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__check_class_init__["a"]; });
/***/ },
/* 5 */
/* exports provided: FilterConfigValues, NgTableFilterConfigProvider, NgTableFilterConfig */
/* exports used: NgTableFilterConfigProvider, FilterConfigValues, NgTableFilterConfig */
/*!********************************************!*\
!*** ./src/browser/ngTableFilterConfig.ts ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(/*! angular */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shared__ = __webpack_require__(/*! ../shared */ 4);
/* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return FilterConfigValues; });
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NgTableFilterConfigProvider; });
/* harmony export (binding) */ __webpack_require__.d(exports, "c", function() { return NgTableFilterConfig; });
/**
* ngTable: Table + Angular JS
*
* @author Vitalii Savchuk <[email protected]>
* @url https://github.com/esvit/ng-table/
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
/**
* Configuration values that determine the behaviour of the `ngTableFilterConfig` service
*/
var FilterConfigValues = (function () {
function FilterConfigValues() {
/**
* The default base url to use when deriving the url for a filter template given just an alias name
*/
this.defaultBaseUrl = 'ng-table/filters/';
/**
* The extension to use when deriving the url of a filter template when given just an alias name
*/
this.defaultExt = '.html';
/**
* A map of alias names and their corrosponding urls. A lookup against this map will be used
* to find the url matching an alias name.
* If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}`
*/
this.aliasUrls = {};
}
return FilterConfigValues;
}());
/**
* The angular provider used to configure the behaviour of the `NgTableFilterConfig` service.
*/
var NgTableFilterConfigProvider = (function () {
function NgTableFilterConfigProvider($injector) {
var _this = this;
this.$get = function () {
return $injector.instantiate(NgTableFilterConfig, { config: __WEBPACK_IMPORTED_MODULE_0_angular__["copy"](_this.config) });
};
this.$get.$inject = [];
this.resetConfigs();
}
/**
* Reset back to factory defaults the config values that `NgTableFilterConfig` service will use
*/
NgTableFilterConfigProvider.prototype.resetConfigs = function () {
this.config = new FilterConfigValues();
};
/**
* Set the config values used by `NgTableFilterConfig` service
*/
NgTableFilterConfigProvider.prototype.setConfig = function (customConfig) {
this.config = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__shared__["b" /* assignPartialDeep */])(__WEBPACK_IMPORTED_MODULE_0_angular__["copy"](this.config), customConfig);
};
return NgTableFilterConfigProvider;
}());
NgTableFilterConfigProvider.$inject = ['$injector'];
/**
* Exposes configuration values and methods used to return the location of the html
* templates used to render the filter row of an ng-table directive
*/
var NgTableFilterConfig = (function () {
function NgTableFilterConfig(
/**
* Readonly copy of the final values used to configure the service.
*/
config) {
this.config = config;
}
/**
* Return the url of the html filter template registered with the alias supplied
*/
NgTableFilterConfig.prototype.getUrlForAlias = function (aliasName, filterKey) {
return this.config.aliasUrls[aliasName] || this.config.defaultBaseUrl + aliasName + this.config.defaultExt;
};
/**
* Return the url of the html filter template for the supplied definition and key.
* For more information see the documentation for {@link FilterTemplateMap}
*/
NgTableFilterConfig.prototype.getTemplateUrl = function (filterDef, filterKey) {
var filterName;
if (typeof filterDef !== 'string') {
filterName = filterDef.id;
}
else {
filterName = filterDef;
}
if (filterName.indexOf('/') !== -1) {
return filterName;
}
return this.getUrlForAlias(filterName, filterKey);
};
return NgTableFilterConfig;
}());
NgTableFilterConfig.$inject = ['config'];
/***/ },
/* 6 */
/* exports provided: FilterSettings */
/* exports used: FilterSettings */
/*!*************************************!*\
!*** ./src/core/filtering/index.ts ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filterSettings__ = __webpack_require__(/*! ./filterSettings */ 29);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__filterSettings__["a"]; });
/***/ },
/* 7 */
/* exports provided: GroupSettings */
/* exports used: GroupSettings */
/*!********************************************!*\
!*** ./src/core/grouping/groupSettings.ts ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return GroupSettings; });
/**
* Configuration that determines the data row grouping behaviour of a table
*/
var GroupSettings = (function () {
function GroupSettings() {
/**
* The default sort direction that will be used whenever a group is supplied that
* does not define its own sort direction
*/
this.defaultSort = 'asc';
/**
* Determines whether groups should be displayed expanded to show their items. Defaults to true
*/
this.isExpanded = true;
}
return GroupSettings;
}());
/***/ },
/* 8 */
/* exports provided: GroupSettings, ngTableDefaultGetGroups */
/* exports used: GroupSettings, ngTableDefaultGetGroups */
/*!************************************!*\
!*** ./src/core/grouping/index.ts ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__groupSettings__ = __webpack_require__(/*! ./groupSettings */ 7);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__groupSettings__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngTableDefaultGetGroups__ = __webpack_require__(/*! ./ngTableDefaultGetGroups */ 30);
/* harmony namespace reexport (by used) */ __webpack_require__.d(exports, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__ngTableDefaultGetGroups__["a"]; });
/***/ },
/* 9 */
/* exports provided: NgTableEventsChannel */
/* exports used: NgTableEventsChannel */
/*!******************************************!*\
!*** ./src/core/ngTableEventsChannel.ts ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(/*! angular */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NgTableEventsChannel; });
/**
* ngTable: Table + Angular JS
*
* @author Vitalii Savchuk <[email protected]>
* @url https://github.com/esvit/ng-table/
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
var NgTableEventsChannel = (function () {
function NgTableEventsChannel($rootScope) {
this.$rootScope = $rootScope;
var events = this;
events = this.addTableParamsEvent('afterCreated', events);
events = this.addTableParamsEvent('afterReloadData', events);
events = this.addTableParamsEvent('datasetChanged', events);
events = this.addTableParamsEvent('pagesChanged', events);
events = this.addTableParamsEvent('afterDataFiltered', events);
events = this.addTableParamsEvent('afterDataSorted', events);
}
NgTableEventsChannel.prototype.addTableParamsEvent = function (eventName, target) {
var fnName = eventName.charAt(0).toUpperCase() + eventName.substring(1);
var event = (_a = {},
_a['on' + fnName] = this.createEventSubscriptionFn(eventName),
_a['publish' + fnName] = this.createPublishEventFn(eventName),
_a);
return __WEBPACK_IMPORTED_MODULE_0_angular__["extend"](target, event);
var _a;
};
NgTableEventsChannel.prototype.createPublishEventFn = function (eventName) {
var _this = this;
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
(_a = _this.$rootScope).$broadcast.apply(_a, ['ngTable:' + eventName].concat(args));
var _a;
};
};
NgTableEventsChannel.prototype.createEventSubscriptionFn = function (eventName) {
var _this = this;
return function (handler, eventSelectorOrScope, eventSelector) {
var actualEvtSelector;
var scope = _this.$rootScope;
if (isScopeLike(eventSelectorOrScope)) {
scope = eventSelectorOrScope;
actualEvtSelector = createEventSelectorFn(eventSelector);
}
else {
actualEvtSelector = createEventSelectorFn(eventSelectorOrScope);
}
return scope.$on('ngTable:' + eventName, function (event, params) {
var eventArgs = [];
for (var _i = 2; _i < arguments.length; _i++) {
eventArgs[_i - 2] = arguments[_i];
}
// don't send events published by the internal NgTableParams created by ngTableController
if (params.isNullInstance)
return;
var fnArgs = [params].concat(eventArgs);
if (actualEvtSelector.apply(this, fnArgs)) {
handler.apply(this, fnArgs);
}
});
};
function createEventSelectorFn(eventSelector) {
if (eventSelector === void 0) { eventSelector = function () { return true; }; }
if (isEventSelectorFunc(eventSelector)) {
return eventSelector;
}
else {
// shorthand for subscriber to only receive events from a specific publisher instance
return function (publisher) { return publisher === eventSelector; };
}
}
function isEventSelectorFunc(val) {
return typeof val === 'function';
}
function isScopeLike(val) {
return val && typeof val.$new === 'function';
}
};
return NgTableEventsChannel;
}());
NgTableEventsChannel.$inject = ['$rootScope'];
/***/ },
/* 10 */
/* exports provided: ParamValues, NgTableParams */
/* exports used: NgTableParams, ParamValues */
/*!***********************************!*\
!*** ./src/core/ngTableParams.ts ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(/*! angular */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(/*! ./util */ 12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shared__ = __webpack_require__(/*! ../shared */ 4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngTableSettings__ = __webpack_require__(/*! ./ngTableSettings */ 11);
/* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return ParamValues; });
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NgTableParams; });
/**
* ngTable: Table + Angular JS
*
* @author Vitalii Savchuk <[email protected]>
* @url https://github.com/esvit/ng-table/
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
/**
* The runtime values for {@link NgTableParams} that determine the set of data rows and
* how they are to be displayed in a table
*/
var ParamValues = (function () {
function ParamValues() {
/**
* The index of the "slice" of data rows, starting at 1, to be displayed by the table.
*/
this.page = 1;
/**
* The number of data rows per page
*/
this.count = 10;
/**
* The filter that should be applied to restrict the set of data rows
*/
this.filter = {};
/**
* The sort order that should be applied to the data rows.
*/
this.sorting = {};
/**
* The grouping that should be applied to the data rows
*/
this.group = {};
}
return ParamValues;
}());
/**
* @private
*/
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
/**
* Parameters manager for an ngTable directive
*/
var NgTableParams = (function () {
function NgTableParams(baseParameters, baseSettings) {
if (baseParameters === void 0) { baseParameters = {}; }
if (baseSettings === void 0) { baseSettings = {}; }
var _this = this;
/**
* The page of data rows currently being displayed in the table
*/
this.data = [];
this.defaultSettings = __WEBPACK_IMPORTED_MODULE_3__ngTableSettings__["a" /* Settings */].createWithOverrides();
this.isCommittedDataset = false;
this.initialEvents = [];
this._params = new ParamValues();
this._settings = this.defaultSettings;
// the ngTableController "needs" to create a dummy/null instance and it's important to know whether an instance
// is one of these
if (typeof baseParameters === "boolean") {
this.isNullInstance = true;
}
this.reloadPages = (function () {
var currentPages;
return function () {
var oldPages = currentPages;
var newPages = _this.generatePagesArray(_this.page(), _this.total(), _this.count());
if (!__WEBPACK_IMPORTED_MODULE_0_angular__["equals"](oldPages, newPages)) {
currentPages = newPages;
_this.ngTableEventsChannel.publishPagesChanged(_this, newPages, oldPages);
}
};
})();
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__shared__["b" /* assignPartialDeep */])(this._params, this.ngTableDefaults.params);
this.settings(baseSettings);
this.parameters(baseParameters, true);
this.ngTableEventsChannel.publishAfterCreated(this);
// run events during construction after the initial create event. That way a consumer
// can subscribe to all events for a table without "dropping" an event
__WEBPACK_IMPORTED_MODULE_0_angular__["forEach"](this.initialEvents, function (event) {
event();
});
this.initialEvents = null;
}
NgTableParams.prototype.count = function (count) {
// reset to first page because can be blank page
return count !== undefined ? this.parameters({
'count': count,
'page': 1
}) : this._params.count;
};
NgTableParams.prototype.filter = function (filter) {
if (filter != null && typeof filter === 'object') {
return this.parameters({
'filter': filter,
'page': 1
});
}
else if (filter === true) {
var keys = Object.keys(this._params.filter);
var significantFilter = {};
for (var i = 0; i < keys.length; i++) {
var filterValue = this._params.filter[keys[i]];
if (filterValue != null && filterValue !== '') {
significantFilter[keys[i]] = filterValue;
}
}
return significantFilter;
}
else {
return this._params.filter;
}
};
/**
* Generate array of pages.
* When no arguments supplied, the current parameter state of this `NgTableParams` instance will be used
* @param currentPage Which page must be active
* @param totalItems Total quantity of items
* @param pageSize Quantity of items on page
* @param maxBlocks Quantity of blocks for pagination
* @returns Array of pages
*/
NgTableParams.prototype.generatePagesArray = function (currentPage, totalItems, pageSize, maxBlocks) {
if (!arguments.length) {
currentPage = this.page();
totalItems = this.total();
pageSize = this.count();
}
var maxPage, maxPivotPages, minPage, numPages;
maxBlocks = maxBlocks && maxBlocks < 6 ? 6 : maxBlocks;
var pages = [];
numPages = Math.ceil(totalItems / pageSize);
if (numPages > 1) {
pages.push({
type: 'prev',
number: Math.max(1, currentPage - 1),
active: currentPage > 1
});
pages.push({
type: 'first',
number: 1,
active: currentPage > 1,
current: currentPage === 1
});
maxPivotPages = Math.round((this._settings.paginationMaxBlocks - this._settings.paginationMinBlocks) / 2);
minPage = Math.max(2, currentPage - maxPivotPages);
maxPage = Math.min(numPages - 1, currentPage + maxPivotPages * 2 - (currentPage - minPage));
minPage = Math.max(2, minPage - (maxPivotPages * 2 - (maxPage - minPage)));
var i = minPage;
while (i <= maxPage) {
if ((i === minPage && i !== 2) || (i === maxPage && i !== numPages - 1)) {
pages.push({
type: 'more',
active: false
});
}
else {
pages.push({
type: 'page',
number: i,
active: currentPage !== i,
current: currentPage === i
});
}
i++;
}
pages.push({
type: 'last',
number: numPages,
active: currentPage !== numPages,
current: currentPage === numPages
});
pages.push({
type: 'next',
number: Math.min(numPages, currentPage + 1),
active: currentPage < numPages
});
}
return pages;
};
NgTableParams.prototype.group = function (group, sortDirection) {
if (group === undefined) {
return this._params.group;
}
var newParameters = {
page: 1
};
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["a" /* isGroupingFun */])(group) && sortDirection !== undefined) {
group.sortDirection = sortDirection;
newParameters.group = group;
}
else if (typeof group === 'string' && sortDirection !== undefined) {
newParameters.group = (_a = {}, _a[group] = sortDirection, _a);
}
else {
newParameters.group = group;
}
this.parameters(newParameters);
return this;
var _a;
};
/**
* Returns true when an attempt to `reload` the current `parameter` values have resulted in a failure.
* This method will continue to return true until the `reload` is successfully called or when the
* `parameter` values have changed
*/
NgTableParams.prototype.hasErrorState = function () {
return !!(this.errParamsMemento && __WEBPACK_IMPORTED_MODULE_0_angular__["equals"](this.errParamsMemento, this.createComparableParams()));
};
/**
* Returns true if `filter` has significant filter value(s) (any value except null, undefined, or empty string),
* otherwise false
*/
NgTableParams.prototype.hasFilter = function () {
return Object.keys(this.filter(true)).length > 0;
};
/**
* Return true when a change to `filters` require the `reload` method
* to be run so as to ensure the data presented to the user reflects these filters
*/
NgTableParams.prototype.hasFilterChanges = function () {
var previousFilter = (this.prevParamsMemento && this.prevParamsMemento.params.filter);
return !__WEBPACK_IMPORTED_MODULE_0_angular__["equals"]((this._params.filter), previousFilter) || this.hasGlobalSearchFieldChanges();
};
NgTableParams.prototype.hasGroup = function (group, sortDirection) {
if (group == null) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["a" /* isGroupingFun */])(this._params.group) || Object.keys(this._params.group).length > 0;
}
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["a" /* isGroupingFun */])(group)) {
if (sortDirection == null) {
return this._params.group === group;
}
else {
return this._params.group === group && group.sortDirection === sortDirection;
}
}
else {
if (sortDirection == null) {
return Object.keys(this._params.group).indexOf(group) !== -1;
}
else {
return this._params.group[group] === sortDirection;
}
}
};
/**
* Return true when a change to this instance should require the `reload` method
* to be run so as to ensure the data rows presented to the user reflects the current state.
*
* Note that this method will return false when the `reload` method has run but fails. In this case
* `hasErrorState` will return true.
*
* The built-in `ngTable` directives will watch for when this function returns true and will then call
* the `reload` method to load its data rows
*/
NgTableParams.prototype.isDataReloadRequired = function () {
// note: using != as want to treat null and undefined the same
return !this.isCommittedDataset || !__WEBPACK_IMPORTED_MODULE_0_angular__["equals"](this.createComparableParams(), this.prevParamsMemento)
|| this.hasGlobalSearchFieldChanges();
};
/**
* Returns true if sorting by the field supplied. Where direction supplied
* the field must also be sorted by that direction to return true
*/
NgTableParams.prototype.isSortBy = function (field, direction) {
if (direction !== undefined) {
return this._params.sorting[field] !== undefined && this._params.sorting[field] == direction;
}
else {
return this._params.sorting[field] !== undefined;
}
};
/**
* Returns sorting values in a format that can be consumed by the angular `$orderBy` filter service
*/
NgTableParams.prototype.orderBy = function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["b" /* convertSortToOrderBy */])(this._params.sorting);
};
NgTableParams.prototype.page = function (page) {
return page !== undefined ? this.parameters({
'page': page
}) : this._params.page;
};
NgTableParams.prototype.parameters = function (newParameters, parseParamsFromUrl) {
if (newParameters === undefined) {
return this._params;
}
// todo: move parsing of url like parameters into a seperate method
parseParamsFromUrl = parseParamsFromUrl || false;
for (var key in newParameters) {
var value = newParameters[key];
if (parseParamsFromUrl && key.indexOf('[') >= 0) {
var keys = key.split(/\[(.*)\]/).reverse();
var lastKey = '';
for (var i = 0, len = keys.length; i < len; i++) {
var name_1 = keys[i];
if (name_1 !== '') {
var v = value;
value = {};
value[lastKey = name_1] = (isNumber(v) ? parseFloat(v) : v);
}
}
if (lastKey === 'sorting') {
this._params[lastKey] = {};
}
this._params[lastKey] = __WEBPACK_IMPORTED_MODULE_0_angular__["extend"](this._params[lastKey] || {}, value[lastKey]);
}
else {
if (newParameters[key] === undefined) {
}
else if (key === 'group') {
this._params[key] = this.parseGroup(newParameters[key]);
}
else {
this._params[key] = (isNumber(newParameters[key]) ? parseFloat(newParameters[key]) : newParameters[key]);
}
}
}
this.log('ngTable: set parameters', this._params);
return this;
};
/**
* Trigger a reload of the data rows
*/
NgTableParams.prototype.reload = function () {
var _this = this;
var pData;
this._settings.$loading = true;
this.prevParamsMemento = __WEBPACK_IMPORTED_MODULE_0_angular__["copy"](this.createComparableParams());
this.isCommittedDataset = true;
if (this.hasGroup()) {
pData = this.runInterceptorPipeline(this.$q.when(this._settings.getGroups(this)));
}
else {
var fn = this._settings.getData;
pData = this.runInterceptorPipeline(this.$q.when(fn(this)));
}
this.log('ngTable: reload data');
var oldData = this.data;
return pData.then(function (data) {
_this._settings.$loading = false;
_this.errParamsMemento = null;
_this.data = data;
// note: I think it makes sense to publish this event even when data === oldData
// subscribers can always set a filter to only receive the event when data !== oldData
_this.ngTableEventsChannel.publishAfterReloadData(_this, data, oldData);
_this.reloadPages();
return data;
}).catch(function (reason) {
_this.errParamsMemento = _this.prevParamsMemento;
// "rethrow"
return _this.$q.reject(reason);
});
};
NgTableParams.prototype.settings = function (newSettings) {
var _this = this;
if (newSettings === undefined) {
return this._settings;
}
var settings = __WEBPACK_IMPORTED_MODULE_3__ngTableSettings__["a" /* Settings */].merge(this._settings, newSettings);
var originalDataset = this._settings.dataset;
this._settings = settings;
// note: using != as want null and undefined to be treated the same
var hasDatasetChanged = newSettings.hasOwnProperty('dataset') && (newSettings.dataset != originalDataset);
if (hasDatasetChanged) {
if (this.isCommittedDataset) {
this.page(1); // reset page as a new dataset has been supplied
}
this.isCommittedDataset = false;
var fireEvent = function () {
_this.ngTableEventsChannel.publishDatasetChanged(_this, newSettings.dataset, originalDataset);
};
if (this.initialEvents) {
this.initialEvents.push(fireEvent);
}
else {
fireEvent();
}
}
this.log('ngTable: set settings', this._settings);
return this;
};
NgTableParams.prototype.sorting = function (sorting, direction) {
if (typeof sorting === 'string') {
this.parameters({
'sorting': (_a = {}, _a[sorting] = direction || this.settings().defaultSort, _a)
});
return this;
}
return sorting !== undefined ? this.parameters({
'sorting': sorting
}) : this._params.sorting;
var _a;
};
NgTableParams.prototype.total = function (total) {
return total !== undefined ? this.settings({
'total': total
}) : this._settings.total;
};
/**
* Returns the current parameter values uri-encoded. Set `asString` to
* true for the parameters to be returned as an array of strings of the form 'paramName=value'
* otherwise parameters returned as a key-value object
*/
NgTableParams.prototype.url = function (asString) {
if (asString === void 0) { asString = false; }
var pairs = (asString ? [] : {});
for (var key in this._params) {
if (this._params.hasOwnProperty(key)) {
var item = this._params[key], name_2 = encodeURIComponent(key);
if (typeof item === "object") {
for (var subkey in item) {
if (isSignificantValue(item[subkey], key)) {
var pname = name_2 + "[" + encodeURIComponent(subkey) + "]";
collectValue(item[subkey], pname);
}
}
}
else if (!__WEBPACK_IMPORTED_MODULE_0_angular__["isFunction"](item) && isSignificantValue(item, key)) {
collectValue(item, name_2);
}
}
}
return pairs;
function collectValue(value, key) {
if (isArray(pairs)) {
pairs.push(key + "=" + encodeURIComponent(value));
}
else {
pairs[key] = encodeURIComponent(value);
}