UNPKG

109 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory(require("angular"));
4 else if(typeof define === 'function' && define.amd)
5 define(["angular"], factory);
6 else if(typeof exports === 'object')
7 exports["ng-table"] = factory(require("angular"));
8 else
9 root["ng-table"] = factory(root["angular"]);
10})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId])
20/******/ return installedModules[moduleId].exports;
21/******/
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // identity function for calling harmory imports with the correct context
47/******/ __webpack_require__.i = function(value) { return value; };
48/******/
49/******/ // define getter function for harmory exports
50/******/ __webpack_require__.d = function(exports, name, getter) {
51/******/ if(!__webpack_require__.o(exports, name)) {
52/******/ Object.defineProperty(exports, name, {
53/******/ configurable: false,
54/******/ enumerable: true,
55/******/ get: getter
56/******/ });
57/******/ }
58/******/ };
59/******/
60/******/ // getDefaultExport function for compatibility with non-harmony modules
61/******/ __webpack_require__.n = function(module) {
62/******/ var getter = module && module.__esModule ?
63/******/ function getDefault() { return module['default']; } :
64/******/ function getModuleExports() { return module; };
65/******/ __webpack_require__.d(getter, 'a', getter);
66/******/ return getter;
67/******/ };
68/******/
69/******/ // Object.prototype.hasOwnProperty.call
70/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
71/******/
72/******/ // __webpack_public_path__
73/******/ __webpack_require__.p = "";
74/******/
75/******/ // Load entry module and return exports
76/******/ return __webpack_require__(__webpack_require__.s = 51);
77/******/ })
78/************************************************************************/
79/******/ ([
80/* 0 */
81/* unknown exports provided */
82/* all exports used */
83/*!**************************!*\
84 !*** external "angular" ***!
85 \**************************/
86/***/ function(module, exports) {
87
88module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
89
90/***/ },
91/* 1 */
92/* unknown exports provided */
93/* all exports used */
94/*!***************************!*\
95 !*** ./src/core/index.ts ***!
96 \***************************/
97/***/ function(module, exports, __webpack_require__) {
98
99"use strict";
100"use strict";
101function __export(m) {
102 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
103}
104var angular = __webpack_require__(/*! angular */ 0);
105var data_1 = __webpack_require__(/*! ./data */ 3);
106var grouping_1 = __webpack_require__(/*! ./grouping */ 37);
107var ngTableDefaults_1 = __webpack_require__(/*! ./ngTableDefaults */ 7);
108var ngTableSettings_1 = __webpack_require__(/*! ./ngTableSettings */ 10);
109var ngTableParams_1 = __webpack_require__(/*! ./ngTableParams */ 9);
110var ngTableEventsChannel_1 = __webpack_require__(/*! ./ngTableEventsChannel */ 8);
111var ngTableCoreModule = angular.module('ngTable-core', [])
112 .provider('ngTableDefaultGetData', data_1.NgTableDefaultGetDataProvider)
113 .factory('ngTableDefaultGetGroups', grouping_1.ngTableDefaultGetGroups)
114 .value('ngTableDefaults', ngTableDefaults_1.ngTableDefaults)
115 .service('ngTableEventsChannel', ngTableEventsChannel_1.NgTableEventsChannel)
116 .service('ngTableSettings', ngTableSettings_1.NgTableSettings)
117 .run(ngTableParams_1.NgTableParams.init);
118exports.ngTableCoreModule = ngTableCoreModule;
119// note: if you are using ES6 or typescript prefer:
120// import { NgTableParams } from 'ng-table';
121ngTableCoreModule.value('NgTableParams', ngTableParams_1.NgTableParams);
122var ngTableDefaults_2 = __webpack_require__(/*! ./ngTableDefaults */ 7);
123exports.IDefaults = ngTableDefaults_2.IDefaults;
124__export(__webpack_require__(/*! ./ngTableEventsChannel */ 8));
125var ngTableSettings_2 = __webpack_require__(/*! ./ngTableSettings */ 10);
126exports.ISettings = ngTableSettings_2.ISettings;
127__export(__webpack_require__(/*! ./ngTableParams */ 9));
128__export(__webpack_require__(/*! ./data */ 3));
129__export(__webpack_require__(/*! ./filtering */ 36));
130__export(__webpack_require__(/*! ./grouping/publicExports */ 39));
131__export(__webpack_require__(/*! ./paging */ 40));
132__export(__webpack_require__(/*! ./sorting */ 41));
133
134
135/***/ },
136/* 2 */
137/* unknown exports provided */
138/* all exports used */
139/*!******************************!*\
140 !*** ./src/browser/index.ts ***!
141 \******************************/
142/***/ function(module, exports, __webpack_require__) {
143
144"use strict";
145"use strict";
146function __export(m) {
147 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
148}
149var angular = __webpack_require__(/*! angular */ 0);
150var ngTable_directive_1 = __webpack_require__(/*! ./ngTable.directive */ 13);
151var ngTableColumn_1 = __webpack_require__(/*! ./ngTableColumn */ 14);
152var ngTableColumnsBinding_directive_1 = __webpack_require__(/*! ./ngTableColumnsBinding.directive */ 15);
153var ngTableController_1 = __webpack_require__(/*! ./ngTableController */ 16);
154exports.NgTableController = ngTableController_1.NgTableController;
155var ngTableDynamic_directive_1 = __webpack_require__(/*! ./ngTableDynamic.directive */ 17);
156var ngTableFilterConfig_1 = __webpack_require__(/*! ./ngTableFilterConfig */ 18);
157exports.NgTableFilterConfigProvider = ngTableFilterConfig_1.NgTableFilterConfigProvider;
158exports.NgTableFilterConfig = ngTableFilterConfig_1.NgTableFilterConfig;
159var ngTableFilterRow_directive_1 = __webpack_require__(/*! ./ngTableFilterRow.directive */ 19);
160var ngTableFilterRowController_1 = __webpack_require__(/*! ./ngTableFilterRowController */ 20);
161var ngTableGroupRow_directive_1 = __webpack_require__(/*! ./ngTableGroupRow.directive */ 21);
162var ngTableGroupRowController_1 = __webpack_require__(/*! ./ngTableGroupRowController */ 22);
163var ngTablePagination_directive_1 = __webpack_require__(/*! ./ngTablePagination.directive */ 23);
164var ngTableSelectFilterDs_directive_1 = __webpack_require__(/*! ./ngTableSelectFilterDs.directive */ 24);
165var ngTableSorterRow_directive_1 = __webpack_require__(/*! ./ngTableSorterRow.directive */ 25);
166var ngTableSorterRowController_1 = __webpack_require__(/*! ./ngTableSorterRowController */ 26);
167__webpack_require__(/*! ./filters/number.html */ 43);
168__webpack_require__(/*! ./filters/select.html */ 45);
169__webpack_require__(/*! ./filters/select-multiple.html */ 44);
170__webpack_require__(/*! ./filters/text.html */ 46);
171__webpack_require__(/*! ./pager.html */ 49);
172__webpack_require__(/*! ./header.html */ 48);
173var ngTableBrowserModule = angular.module('ngTable-browser', [])
174 .directive('ngTable', ngTable_directive_1.ngTable)
175 .service('ngTableColumn', ngTableColumn_1.NgTableColumn)
176 .directive('ngTableColumnsBinding', ngTableColumnsBinding_directive_1.ngTableColumnsBinding)
177 .controller('ngTableController', ngTableController_1.NgTableController)
178 .directive('ngTableDynamic', ngTableDynamic_directive_1.ngTableDynamic)
179 .provider('ngTableFilterConfig', ngTableFilterConfig_1.NgTableFilterConfigProvider)
180 .directive('ngTableFilterRow', ngTableFilterRow_directive_1.ngTableFilterRow)
181 .controller('ngTableFilterRowController', ngTableFilterRowController_1.NgTableFilterRowController)
182 .directive('ngTableGroupRow', ngTableGroupRow_directive_1.ngTableGroupRow)
183 .controller('ngTableGroupRowController', ngTableGroupRowController_1.NgTableGroupRowController)
184 .directive('ngTablePagination', ngTablePagination_directive_1.ngTablePagination)
185 .directive('ngTableSelectFilterDs', ngTableSelectFilterDs_directive_1.ngTableSelectFilterDs)
186 .directive('ngTableSorterRow', ngTableSorterRow_directive_1.ngTableSorterRow)
187 .controller('ngTableSorterRowController', ngTableSorterRowController_1.NgTableSorterRowController);
188exports.ngTableBrowserModule = ngTableBrowserModule;
189__export(__webpack_require__(/*! ./public-interfaces */ 27));
190
191
192/***/ },
193/* 3 */
194/* unknown exports provided */
195/* all exports used */
196/*!********************************!*\
197 !*** ./src/core/data/index.ts ***!
198 \********************************/
199/***/ function(module, exports, __webpack_require__) {
200
201"use strict";
202"use strict";
203function __export(m) {
204 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
205}
206__export(__webpack_require__(/*! ./dataSettings */ 28));
207__export(__webpack_require__(/*! ./getData */ 29));
208__export(__webpack_require__(/*! ./interceptor */ 30));
209__export(__webpack_require__(/*! ./ngTableDefaultGetData */ 31));
210__export(__webpack_require__(/*! ./results */ 32));
211
212
213/***/ },
214/* 4 */
215/* unknown exports provided */
216/* all exports used */
217/*!***************************************!*\
218 !*** ./src/core/grouping/getGroup.ts ***!
219 \***************************************/
220/***/ function(module, exports) {
221
222"use strict";
223"use strict";
224
225
226/***/ },
227/* 5 */
228/* unknown exports provided */
229/* all exports used */
230/*!********************************************!*\
231 !*** ./src/core/grouping/groupSettings.ts ***!
232 \********************************************/
233/***/ function(module, exports) {
234
235"use strict";
236"use strict";
237
238
239/***/ },
240/* 6 */
241/* unknown exports provided */
242/* all exports used */
243/*!*******************************************!*\
244 !*** ./src/core/grouping/groupingFunc.ts ***!
245 \*******************************************/
246/***/ function(module, exports) {
247
248"use strict";
249"use strict";
250
251
252/***/ },
253/* 7 */
254/* unknown exports provided */
255/* all exports used */
256/*!*************************************!*\
257 !*** ./src/core/ngTableDefaults.ts ***!
258 \*************************************/
259/***/ function(module, exports) {
260
261"use strict";
262/**
263 * ngTable: Table + Angular JS
264 *
265 * @author Vitalii Savchuk <esvit666@gmail.com>
266 * @url https://github.com/esvit/ng-table/
267 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
268 */
269"use strict";
270/**
271 * Default values for ngTable
272 */
273exports.ngTableDefaults = {
274 params: {},
275 settings: {}
276};
277
278
279/***/ },
280/* 8 */
281/* unknown exports provided */
282/* all exports used */
283/*!******************************************!*\
284 !*** ./src/core/ngTableEventsChannel.ts ***!
285 \******************************************/
286/***/ function(module, exports, __webpack_require__) {
287
288"use strict";
289/**
290 * ngTable: Table + Angular JS
291 *
292 * @author Vitalii Savchuk <esvit666@gmail.com>
293 * @url https://github.com/esvit/ng-table/
294 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
295 */
296"use strict";
297var ng1 = __webpack_require__(/*! angular */ 0);
298var NgTableEventsChannel = (function () {
299 function NgTableEventsChannel($rootScope) {
300 this.$rootScope = $rootScope;
301 var events = this;
302 events = this.addTableParamsEvent('afterCreated', events);
303 events = this.addTableParamsEvent('afterReloadData', events);
304 events = this.addTableParamsEvent('datasetChanged', events);
305 events = this.addTableParamsEvent('pagesChanged', events);
306 events = this.addTableParamsEvent('afterDataFiltered', events);
307 events = this.addTableParamsEvent('afterDataSorted', events);
308 }
309 NgTableEventsChannel.prototype.addTableParamsEvent = function (eventName, target) {
310 var fnName = eventName.charAt(0).toUpperCase() + eventName.substring(1);
311 var event = (_a = {},
312 _a['on' + fnName] = this.createEventSubscriptionFn(eventName),
313 _a['publish' + fnName] = this.createPublishEventFn(eventName),
314 _a
315 );
316 return ng1.extend(target, event);
317 var _a;
318 };
319 NgTableEventsChannel.prototype.createPublishEventFn = function (eventName) {
320 var _this = this;
321 return function () {
322 var args = [];
323 for (var _i = 0; _i < arguments.length; _i++) {
324 args[_i - 0] = arguments[_i];
325 }
326 (_a = _this.$rootScope).$broadcast.apply(_a, ['ngTable:' + eventName].concat(args));
327 var _a;
328 };
329 };
330 NgTableEventsChannel.prototype.createEventSubscriptionFn = function (eventName) {
331 var _this = this;
332 return function (handler, eventSelectorOrScope, eventSelector) {
333 var actualEvtSelector;
334 var scope = _this.$rootScope;
335 if (isScopeLike(eventSelectorOrScope)) {
336 scope = eventSelectorOrScope;
337 actualEvtSelector = createEventSelectorFn(eventSelector);
338 }
339 else {
340 actualEvtSelector = createEventSelectorFn(eventSelectorOrScope);
341 }
342 return scope.$on('ngTable:' + eventName, function (event, params) {
343 var eventArgs = [];
344 for (var _i = 2; _i < arguments.length; _i++) {
345 eventArgs[_i - 2] = arguments[_i];
346 }
347 // don't send events published by the internal NgTableParams created by ngTableController
348 if (params.isNullInstance)
349 return;
350 var fnArgs = [params].concat(eventArgs);
351 if (actualEvtSelector.apply(this, fnArgs)) {
352 handler.apply(this, fnArgs);
353 }
354 });
355 };
356 function createEventSelectorFn(eventSelector) {
357 if (!eventSelector) {
358 return function (publisher) { return true; };
359 }
360 else if (isEventSelectorFunc(eventSelector)) {
361 return eventSelector;
362 }
363 else {
364 // shorthand for subscriber to only receive events from a specific publisher instance
365 return function (publisher) { return publisher === eventSelector; };
366 }
367 }
368 function isEventSelectorFunc(val) {
369 return typeof val === 'function';
370 }
371 function isScopeLike(val) {
372 return val && typeof val.$new === 'function';
373 }
374 };
375 NgTableEventsChannel.$inject = ['$rootScope'];
376 return NgTableEventsChannel;
377}());
378exports.NgTableEventsChannel = NgTableEventsChannel;
379
380
381/***/ },
382/* 9 */
383/* unknown exports provided */
384/* all exports used */
385/*!***********************************!*\
386 !*** ./src/core/ngTableParams.ts ***!
387 \***********************************/
388/***/ function(module, exports, __webpack_require__) {
389
390"use strict";
391/**
392 * ngTable: Table + Angular JS
393 *
394 * @author Vitalii Savchuk <esvit666@gmail.com>
395 * @url https://github.com/esvit/ng-table/
396 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
397 */
398"use strict";
399var ng1 = __webpack_require__(/*! angular */ 0);
400var util_1 = __webpack_require__(/*! ./util */ 11);
401/**
402 * @private
403 */
404function isNumber(n) {
405 return !isNaN(parseFloat(n)) && isFinite(n);
406}
407/**
408 * Parameters manager for an ngTable directive
409 */
410var NgTableParams = (function () {
411 function NgTableParams(baseParameters, baseSettings) {
412 var _this = this;
413 /**
414 * The page of data rows currently being displayed in the table
415 */
416 this.data = [];
417 this.defaultSettings = NgTableParams.ngTableSettings.createDefaults();
418 this.isCommittedDataset = false;
419 this.initialEvents = [];
420 this._params = {
421 page: 1,
422 count: 10,
423 filter: {},
424 sorting: {},
425 group: {}
426 };
427 this._settings = this.defaultSettings;
428 // the ngTableController "needs" to create a dummy/null instance and it's important to know whether an instance
429 // is one of these
430 if (typeof baseParameters === "boolean") {
431 this.isNullInstance = true;
432 }
433 this.reloadPages = (function () {
434 var currentPages;
435 return function () {
436 var oldPages = currentPages;
437 var newPages = _this.generatePagesArray(_this.page(), _this.total(), _this.count());
438 if (!ng1.equals(oldPages, newPages)) {
439 currentPages = newPages;
440 NgTableParams.ngTableEventsChannel.publishPagesChanged(_this, newPages, oldPages);
441 }
442 };
443 })();
444 ng1.extend(this._params, NgTableParams.ngTableDefaults.params);
445 this.settings(baseSettings);
446 this.parameters(baseParameters, true);
447 NgTableParams.ngTableEventsChannel.publishAfterCreated(this);
448 // run events during construction after the initial create event. That way a consumer
449 // can subscribe to all events for a table without "dropping" an event
450 ng1.forEach(this.initialEvents, function (event) {
451 event();
452 });
453 this.initialEvents = null;
454 }
455 NgTableParams.prototype.count = function (count) {
456 // reset to first page because can be blank page
457 return count !== undefined ? this.parameters({
458 'count': count,
459 'page': 1
460 }) : this._params.count;
461 };
462 NgTableParams.prototype.filter = function (filter) {
463 if (filter != null && typeof filter === 'object') {
464 return this.parameters({
465 'filter': filter,
466 'page': 1
467 });
468 }
469 else if (filter === true) {
470 var keys = Object.keys(this._params.filter);
471 var significantFilter = {};
472 for (var i = 0; i < keys.length; i++) {
473 var filterValue = this._params.filter[keys[i]];
474 if (filterValue != null && filterValue !== '') {
475 significantFilter[keys[i]] = filterValue;
476 }
477 }
478 return significantFilter;
479 }
480 else {
481 return this._params.filter;
482 }
483 };
484 /**
485 * Generate array of pages.
486 * When no arguments supplied, the current parameter state of this `NgTableParams` instance will be used
487 * @param currentPage Which page must be active
488 * @param totalItems Total quantity of items
489 * @param pageSize Quantity of items on page
490 * @param maxBlocks Quantity of blocks for pagination
491 * @returns Array of pages
492 */
493 NgTableParams.prototype.generatePagesArray = function (currentPage, totalItems, pageSize, maxBlocks) {
494 if (!arguments.length) {
495 currentPage = this.page();
496 totalItems = this.total();
497 pageSize = this.count();
498 }
499 var maxPage, maxPivotPages, minPage, numPages;
500 maxBlocks = maxBlocks && maxBlocks < 6 ? 6 : maxBlocks;
501 var pages = [];
502 numPages = Math.ceil(totalItems / pageSize);
503 if (numPages > 1) {
504 pages.push({
505 type: 'prev',
506 number: Math.max(1, currentPage - 1),
507 active: currentPage > 1
508 });
509 pages.push({
510 type: 'first',
511 number: 1,
512 active: currentPage > 1,
513 current: currentPage === 1
514 });
515 maxPivotPages = Math.round((this._settings.paginationMaxBlocks - this._settings.paginationMinBlocks) / 2);
516 minPage = Math.max(2, currentPage - maxPivotPages);
517 maxPage = Math.min(numPages - 1, currentPage + maxPivotPages * 2 - (currentPage - minPage));
518 minPage = Math.max(2, minPage - (maxPivotPages * 2 - (maxPage - minPage)));
519 var i = minPage;
520 while (i <= maxPage) {
521 if ((i === minPage && i !== 2) || (i === maxPage && i !== numPages - 1)) {
522 pages.push({
523 type: 'more',
524 active: false
525 });
526 }
527 else {
528 pages.push({
529 type: 'page',
530 number: i,
531 active: currentPage !== i,
532 current: currentPage === i
533 });
534 }
535 i++;
536 }
537 pages.push({
538 type: 'last',
539 number: numPages,
540 active: currentPage !== numPages,
541 current: currentPage === numPages
542 });
543 pages.push({
544 type: 'next',
545 number: Math.min(numPages, currentPage + 1),
546 active: currentPage < numPages
547 });
548 }
549 return pages;
550 };
551 NgTableParams.prototype.group = function (group, sortDirection) {
552 if (group === undefined) {
553 return this._params.group;
554 }
555 var newParameters = {
556 page: 1
557 };
558 if (util_1.isGroupingFun(group) && sortDirection !== undefined) {
559 group.sortDirection = sortDirection;
560 newParameters.group = group;
561 }
562 else if (typeof group === 'string' && sortDirection !== undefined) {
563 newParameters.group = (_a = {}, _a[group] = sortDirection, _a);
564 }
565 else {
566 newParameters.group = group;
567 }
568 this.parameters(newParameters);
569 return this;
570 var _a;
571 };
572 /**
573 * Returns true when an attempt to `reload` the current `parameter` values have resulted in a failure.
574 * This method will continue to return true until the `reload` is successfully called or when the
575 * `parameter` values have changed
576 */
577 NgTableParams.prototype.hasErrorState = function () {
578 return !!(this.errParamsMemento && ng1.equals(this.errParamsMemento, this.createComparableParams()));
579 };
580 /**
581 * Returns true if `filter` has significant filter value(s) (any value except null, undefined, or empty string),
582 * otherwise false
583 */
584 NgTableParams.prototype.hasFilter = function () {
585 return Object.keys(this.filter(true)).length > 0;
586 };
587 /**
588 * Return true when a change to `filters` require the `reload` method
589 * to be run so as to ensure the data presented to the user reflects these filters
590 */
591 NgTableParams.prototype.hasFilterChanges = function () {
592 var previousFilter = (this.prevParamsMemento && this.prevParamsMemento.params.filter);
593 return !ng1.equals((this._params.filter), previousFilter) || this.hasGlobalSearchFieldChanges();
594 };
595 NgTableParams.prototype.hasGroup = function (group, sortDirection) {
596 if (group == null) {
597 return util_1.isGroupingFun(this._params.group) || Object.keys(this._params.group).length > 0;
598 }
599 if (util_1.isGroupingFun(group)) {
600 if (sortDirection == null) {
601 return this._params.group === group;
602 }
603 else {
604 return this._params.group === group && group.sortDirection === sortDirection;
605 }
606 }
607 else {
608 if (sortDirection == null) {
609 return Object.keys(this._params.group).indexOf(group) !== -1;
610 }
611 else {
612 return this._params.group[group] === sortDirection;
613 }
614 }
615 };
616 /**
617 * Return true when a change to this instance should require the `reload` method
618 * to be run so as to ensure the data rows presented to the user reflects the current state.
619 *
620 * Note that this method will return false when the `reload` method has run but fails. In this case
621 * `hasErrorState` will return true.
622 *
623 * The built-in `ngTable` directives will watch for when this function returns true and will then call
624 * the `reload` method to load its data rows
625 */
626 NgTableParams.prototype.isDataReloadRequired = function () {
627 // note: using != as want to treat null and undefined the same
628 return !this.isCommittedDataset || !ng1.equals(this.createComparableParams(), this.prevParamsMemento)
629 || this.hasGlobalSearchFieldChanges();
630 };
631 /**
632 * Returns true if sorting by the field supplied. Where direction supplied
633 * the field must also be sorted by that direction to return true
634 */
635 NgTableParams.prototype.isSortBy = function (field, direction) {
636 if (direction !== undefined) {
637 return this._params.sorting[field] !== undefined && this._params.sorting[field] == direction;
638 }
639 else {
640 return this._params.sorting[field] !== undefined;
641 }
642 };
643 /**
644 * Returns sorting values in a format that can be consumed by the angular `$orderBy` filter service
645 */
646 NgTableParams.prototype.orderBy = function () {
647 return util_1.convertSortToOrderBy(this._params.sorting);
648 };
649 NgTableParams.prototype.page = function (page) {
650 return page !== undefined ? this.parameters({
651 'page': page
652 }) : this._params.page;
653 };
654 NgTableParams.prototype.parameters = function (newParameters, parseParamsFromUrl) {
655 parseParamsFromUrl = parseParamsFromUrl || false;
656 if (typeof newParameters !== undefined) {
657 for (var key in newParameters) {
658 var value = newParameters[key];
659 if (parseParamsFromUrl && key.indexOf('[') >= 0) {
660 var keys = key.split(/\[(.*)\]/).reverse();
661 var lastKey = '';
662 for (var i = 0, len = keys.length; i < len; i++) {
663 var name = keys[i];
664 if (name !== '') {
665 var v = value;
666 value = {};
667 value[lastKey = name] = (isNumber(v) ? parseFloat(v) : v);
668 }
669 }
670 if (lastKey === 'sorting') {
671 this._params[lastKey] = {};
672 }
673 this._params[lastKey] = ng1.extend(this._params[lastKey] || {}, value[lastKey]);
674 }
675 else {
676 if (key === 'group') {
677 this._params[key] = this.parseGroup(newParameters[key]);
678 }
679 else {
680 this._params[key] = (isNumber(newParameters[key]) ? parseFloat(newParameters[key]) : newParameters[key]);
681 }
682 }
683 }
684 this.log('ngTable: set parameters', this._params);
685 return this;
686 }
687 return this._params;
688 };
689 /**
690 * Trigger a reload of the data rows
691 */
692 NgTableParams.prototype.reload = function () {
693 var _this = this;
694 var pData = null;
695 this._settings.$loading = true;
696 this.prevParamsMemento = ng1.copy(this.createComparableParams());
697 this.isCommittedDataset = true;
698 if (this.hasGroup()) {
699 pData = this.runInterceptorPipeline(NgTableParams.$q.when(this._settings.getGroups(this)));
700 }
701 else {
702 var fn = this._settings.getData;
703 pData = this.runInterceptorPipeline(NgTableParams.$q.when(fn(this)));
704 }
705 this.log('ngTable: reload data');
706 var oldData = this.data;
707 return pData.then(function (data) {
708 _this._settings.$loading = false;
709 _this.errParamsMemento = null;
710 _this.data = data;
711 // note: I think it makes sense to publish this event even when data === oldData
712 // subscribers can always set a filter to only receive the event when data !== oldData
713 NgTableParams.ngTableEventsChannel.publishAfterReloadData(_this, data, oldData);
714 _this.reloadPages();
715 return data;
716 }).catch(function (reason) {
717 _this.errParamsMemento = _this.prevParamsMemento;
718 // "rethrow"
719 return NgTableParams.$q.reject(reason);
720 });
721 };
722 NgTableParams.prototype.settings = function (newSettings) {
723 var _this = this;
724 if (ng1.isDefined(newSettings)) {
725 var settings = NgTableParams.ngTableSettings.merge(this._settings, newSettings);
726 var originalDataset_1 = this._settings.dataset;
727 this._settings = settings;
728 // note: using != as want null and undefined to be treated the same
729 var hasDatasetChanged = newSettings.hasOwnProperty('dataset') && (newSettings.dataset != originalDataset_1);
730 if (hasDatasetChanged) {
731 if (this.isCommittedDataset) {
732 this.page(1); // reset page as a new dataset has been supplied
733 }
734 this.isCommittedDataset = false;
735 var fireEvent = function () {
736 NgTableParams.ngTableEventsChannel.publishDatasetChanged(_this, newSettings.dataset, originalDataset_1);
737 };
738 if (this.initialEvents) {
739 this.initialEvents.push(fireEvent);
740 }
741 else {
742 fireEvent();
743 }
744 }
745 this.log('ngTable: set settings', this._settings);
746 return this;
747 }
748 return this._settings;
749 };
750 NgTableParams.prototype.sorting = function (sorting, direction) {
751 if (typeof sorting === 'string') {
752 this.parameters({
753 'sorting': (_a = {}, _a[sorting] = direction, _a)
754 });
755 return this;
756 }
757 return sorting !== undefined ? this.parameters({
758 'sorting': sorting
759 }) : this._params.sorting;
760 var _a;
761 };
762 NgTableParams.prototype.total = function (total) {
763 return total !== undefined ? this.settings({
764 'total': total
765 }) : this._settings.total;
766 };
767 /**
768 * Returns the current parameter values uri-encoded. Set `asString` to
769 * true for the parameters to be returned as an array of strings of the form 'paramName=value'
770 * otherwise parameters returned as a key-value object
771 */
772 NgTableParams.prototype.url = function (asString) {
773 // this function is an example of Typescript gone bad!!
774 asString = asString || false;
775 var pairs = (asString ? [] : {});
776 for (var key in this._params) {
777 if (this._params.hasOwnProperty(key)) {
778 var item = this._params[key], name = encodeURIComponent(key);
779 if (typeof item === "object") {
780 for (var subkey in item) {
781 if (isSignificantValue(item[subkey], key)) {
782 var pname = name + "[" + encodeURIComponent(subkey) + "]";
783 collectValue(item[subkey], pname);
784 }
785 }
786 }
787 else if (!ng1.isFunction(item) && isSignificantValue(item, key)) {
788 collectValue(item, name);
789 }
790 }
791 }
792 return pairs;
793 function collectValue(value, key) {
794 if (isArray(pairs)) {
795 pairs.push(key + "=" + encodeURIComponent(value));
796 }
797 else {
798 pairs[key] = encodeURIComponent(value);
799 }
800 }
801 function isArray(pairs) {
802 return asString;
803 }
804 function isSignificantValue(value, key) {
805 return key === "group" ? true : typeof value !== undefined && value !== "";
806 }
807 };
808 NgTableParams.prototype.createComparableParams = function () {
809 var group = this._params.group;
810 return {
811 params: this._params,
812 groupSortDirection: util_1.isGroupingFun(group) ? group.sortDirection : undefined
813 };
814 };
815 NgTableParams.prototype.hasGlobalSearchFieldChanges = function () {
816 var currentVal = (this._params.filter && this._params.filter['$']);
817 var previousVal = (this.prevParamsMemento && this.prevParamsMemento.params.filter && this.prevParamsMemento.params.filter['$']);
818 return !ng1.equals(currentVal, previousVal);
819 };
820 NgTableParams.prototype.log = function () {
821 var args = [];
822 for (var _i = 0; _i < arguments.length; _i++) {
823 args[_i - 0] = arguments[_i];
824 }
825 if (this._settings.debugMode && NgTableParams.$log.debug) {
826 (_a = NgTableParams.$log).debug.apply(_a, args);
827 }
828 var _a;
829 };
830 NgTableParams.prototype.parseGroup = function (group) {
831 var defaultSort = this._settings.groupOptions && this._settings.groupOptions.defaultSort;
832 if (!group) {
833 return group;
834 }
835 else if (util_1.isGroupingFun(group)) {
836 if (group.sortDirection == null) {
837 group.sortDirection = defaultSort;
838 }
839 return group;
840 }
841 else if (typeof group === 'object') {
842 for (var key in group) {
843 if (group[key] == null) {
844 group[key] = defaultSort;
845 }
846 }
847 return group;
848 }
849 else {
850 return (_a = {},
851 _a[group] = defaultSort,
852 _a
853 );
854 }
855 var _a;
856 };
857 NgTableParams.prototype.runInterceptorPipeline = function (fetchedData) {
858 var _this = this;
859 var interceptors = this._settings.interceptors || [];
860 return interceptors.reduce(function (result, interceptor) {
861 var thenFn = (interceptor.response && interceptor.response.bind(interceptor)) || NgTableParams.$q.when;
862 var rejectFn = (interceptor.responseError && interceptor.responseError.bind(interceptor)) || NgTableParams.$q.reject;
863 return result.then(function (data) {
864 return thenFn(data, _this);
865 }, function (reason) {
866 return rejectFn(reason, _this);
867 });
868 }, fetchedData);
869 };
870 NgTableParams.init = function ($q, $log, ngTableDefaults, ngTableEventsChannel, ngTableSettings) {
871 NgTableParams.$q = $q;
872 NgTableParams.$log = $log;
873 NgTableParams.ngTableDefaults = ngTableDefaults;
874 NgTableParams.ngTableEventsChannel = ngTableEventsChannel;
875 NgTableParams.ngTableSettings = ngTableSettings;
876 };
877 return NgTableParams;
878}());
879exports.NgTableParams = NgTableParams;
880NgTableParams.init.$inject = ['$q', '$log', 'ngTableDefaults', 'ngTableEventsChannel', 'ngTableSettings'];
881
882
883/***/ },
884/* 10 */
885/* unknown exports provided */
886/* all exports used */
887/*!*************************************!*\
888 !*** ./src/core/ngTableSettings.ts ***!
889 \*************************************/
890/***/ function(module, exports, __webpack_require__) {
891
892"use strict";
893"use strict";
894var ng1 = __webpack_require__(/*! angular */ 0);
895/**
896 * @private
897 */
898var NgTableSettings = (function () {
899 function NgTableSettings(ngTableDefaults, ngTableDefaultGetData, ngTableDefaultGetGroups) {
900 var _this = this;
901 this.ngTableDefaults = ngTableDefaults;
902 this.ngTableDefaultGetData = ngTableDefaultGetData;
903 this.ngTableDefaultGetGroups = ngTableDefaultGetGroups;
904 this.defaults = {
905 $loading: false,
906 dataset: null,
907 total: 0,
908 defaultSort: 'desc',
909 counts: [10, 25, 50, 100],
910 filterOptions: {
911 filterComparator: undefined,
912 filterDelay: 500,
913 filterDelayThreshold: 10000,
914 filterFilterName: undefined,
915 filterFn: undefined,
916 filterLayout: 'stack'
917 },
918 getData: function (params) {
919 return _this.ngTableDefaultGetData(params.settings().dataset, params);
920 },
921 getGroups: this.ngTableDefaultGetGroups,
922 groupOptions: {
923 defaultSort: 'asc',
924 isExpanded: true
925 },
926 interceptors: [],
927 paginationMaxBlocks: 11,
928 paginationMinBlocks: 5,
929 sortingIndicator: 'span'
930 };
931 }
932 NgTableSettings.prototype.createDefaults = function () {
933 return this.merge(this.defaults, this.ngTableDefaults.settings);
934 };
935 NgTableSettings.prototype.merge = function (existing, newSettings) {
936 newSettings = ng1.extend({}, newSettings);
937 if (newSettings.filterOptions) {
938 newSettings.filterOptions = ng1.extend({}, existing.filterOptions || {}, newSettings.filterOptions);
939 }
940 if (newSettings.groupOptions) {
941 newSettings.groupOptions = ng1.extend({}, existing.groupOptions || {}, newSettings.groupOptions);
942 }
943 if (ng1.isArray(newSettings.dataset)) {
944 //auto-set the total from passed in dataset
945 newSettings.total = newSettings.dataset.length;
946 }
947 var results = ng1.extend({}, existing, newSettings);
948 if (ng1.isArray(newSettings.dataset)) {
949 this.optimizeFilterDelay(results);
950 }
951 return ng1.extend({}, existing, newSettings);
952 };
953 NgTableSettings.prototype.optimizeFilterDelay = function (settings) {
954 // don't debounce by default filter input when working with small synchronous datasets
955 if (settings.filterOptions.filterDelay === this.defaults.filterOptions.filterDelay &&
956 settings.total <= settings.filterOptions.filterDelayThreshold &&
957 settings.getData === this.defaults.getData) {
958 settings.filterOptions.filterDelay = 0;
959 }
960 };
961 NgTableSettings.$inject = ['ngTableDefaults', 'ngTableDefaultGetData', 'ngTableDefaultGetGroups'];
962 return NgTableSettings;
963}());
964exports.NgTableSettings = NgTableSettings;
965
966
967/***/ },
968/* 11 */
969/* unknown exports provided */
970/* all exports used */
971/*!**************************!*\
972 !*** ./src/core/util.ts ***!
973 \**************************/
974/***/ function(module, exports) {
975
976"use strict";
977"use strict";
978/**
979 * @private
980 */
981function convertSortToOrderBy(sorting) {
982 var result = [];
983 for (var column in sorting) {
984 result.push((sorting[column] === "asc" ? "+" : "-") + column);
985 }
986 return result;
987}
988exports.convertSortToOrderBy = convertSortToOrderBy;
989/**
990 * @private
991 */
992function isGroupingFun(val) {
993 return typeof val === 'function';
994}
995exports.isGroupingFun = isGroupingFun;
996
997
998/***/ },
999/* 12 */,
1000/* 13 */
1001/* unknown exports provided */
1002/* all exports used */
1003/*!******************************************!*\
1004 !*** ./src/browser/ngTable.directive.ts ***!
1005 \******************************************/
1006/***/ function(module, exports, __webpack_require__) {
1007
1008"use strict";
1009"use strict";
1010var ng1 = __webpack_require__(/*! angular */ 0);
1011ngTable.$inject = ['$q', '$parse'];
1012/**
1013 * Directive that instantiates {@link NgTableController NgTableController}.
1014 * @ngdoc directive
1015 * @name ngTable
1016 * @example
1017 *
1018 * ```html
1019 * <table ng-table="$ctrl.tableParams" show-filter="true" class="table table-bordered">
1020 * <tr ng-repeat="user in $data">
1021 * <td data-title="'Name'" sortable="'name'" filter="{ 'name': 'text' }">
1022 * {{user.name}}
1023 * </td>
1024 * <td data-title="'Age'" sortable="'age'" filter="{ 'age': 'text' }">
1025 * {{user.age}}
1026 * </td>
1027 * </tr>
1028 * </table>
1029 * ```
1030 */
1031function ngTable($q, $parse) {
1032 return {
1033 restrict: 'A',
1034 priority: 1001,
1035 scope: true,
1036 controller: 'ngTableController',
1037 compile: function (element) {
1038 var columns = [], i = 0, dataRow, groupRow;
1039 var rows = [];
1040 ng1.forEach(element.find('tr'), function (tr) {
1041 rows.push(ng1.element(tr));
1042 });
1043 dataRow = rows.filter(function (tr) { return !tr.hasClass('ng-table-group'); })[0];
1044 groupRow = rows.filter(function (tr) { return tr.hasClass('ng-table-group'); })[0];
1045 if (!dataRow) {
1046 return undefined;
1047 }
1048 ng1.forEach(dataRow.find('td'), function (item) {
1049 var el = ng1.element(item);
1050 if (el.attr('ignore-cell') && 'true' === el.attr('ignore-cell')) {
1051 return;
1052 }
1053 var getAttrValue = function (attr) {
1054 return el.attr('x-data-' + attr) || el.attr('data-' + attr) || el.attr(attr);
1055 };
1056 var setAttrValue = function (attr, value) {
1057 if (el.attr('x-data-' + attr)) {
1058 el.attr('x-data-' + attr, value);
1059 }
1060 else if (el.attr('data' + attr)) {
1061 el.attr('data' + attr, value);
1062 }
1063 else {
1064 el.attr(attr, value);
1065 }
1066 };
1067 var parsedAttribute = function (attr) {
1068 var expr = getAttrValue(attr);
1069 if (!expr) {
1070 return undefined;
1071 }
1072 var localValue;
1073 var getter = function (context) {
1074 if (localValue !== undefined) {
1075 return localValue;
1076 }
1077 return $parse(expr)(context);
1078 };
1079 getter.assign = function ($scope, value) {
1080 var parsedExpr = $parse(expr);
1081 if (parsedExpr.assign) {
1082 // we should be writing back to the parent scope as this is where the expression
1083 // came from
1084 parsedExpr.assign($scope.$parent, value);
1085 }
1086 else {
1087 localValue = value;
1088 }
1089 };
1090 return getter;
1091 };
1092 var titleExpr = getAttrValue('title-alt') || getAttrValue('title');
1093 if (titleExpr) {
1094 el.attr('data-title-text', '{{' + titleExpr + '}}'); // this used in responsive table
1095 }
1096 // NOTE TO MAINTAINERS: if you add extra fields to a $column be sure to extend ngTableColumn with
1097 // a corresponding "safe" default
1098 columns.push({
1099 id: i++,
1100 title: parsedAttribute('title'),
1101 titleAlt: parsedAttribute('title-alt'),
1102 headerTitle: parsedAttribute('header-title'),
1103 sortable: parsedAttribute('sortable'),
1104 'class': parsedAttribute('header-class'),
1105 filter: parsedAttribute('filter'),
1106 groupable: parsedAttribute('groupable'),
1107 headerTemplateURL: parsedAttribute('header'),
1108 filterData: parsedAttribute('filter-data'),
1109 show: el.attr("ng-if") ? parsedAttribute('ng-if') : undefined
1110 });
1111 if (groupRow || el.attr("ng-if")) {
1112 // change ng-if to bind to our column definition which we know will be writable
1113 // because this will potentially increase the $watch count, only do so if we already have an
1114 // ng-if or when we definitely need to change visibility of the columns.
1115 // currently only ngTableGroupRow directive needs to change visibility
1116 setAttrValue('ng-if', '$columns[' + (columns.length - 1) + '].show(this)');
1117 }
1118 });
1119 return function (scope, element, attrs, controller) {
1120 scope.$columns = columns = controller.buildColumns(columns);
1121 controller.setupBindingsToInternalScope(attrs.ngTable);
1122 controller.loadFilterData(columns);
1123 controller.compileDirectiveTemplates();
1124 };
1125 }
1126 };
1127}
1128exports.ngTable = ngTable;
1129
1130
1131/***/ },
1132/* 14 */
1133/* unknown exports provided */
1134/* all exports used */
1135/*!**************************************!*\
1136 !*** ./src/browser/ngTableColumn.ts ***!
1137 \**************************************/
1138/***/ function(module, exports, __webpack_require__) {
1139
1140"use strict";
1141/**
1142 * ngTable: Table + Angular JS
1143 *
1144 * @author Vitalii Savchuk <esvit666@gmail.com>
1145 * @url https://github.com/esvit/ng-table/
1146 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1147 */
1148"use strict";
1149var ng1 = __webpack_require__(/*! angular */ 0);
1150/**
1151 * @private
1152 */
1153function isScopeLike(object) {
1154 return object != null && ng1.isFunction(object.$new);
1155}
1156/**
1157 * @private
1158 * Service to construct a $column definition used by {@link ngTable ngTable} directive
1159 */
1160var NgTableColumn = (function () {
1161 function NgTableColumn() {
1162 }
1163 /**
1164 * Creates a $column for use within a header template
1165 *
1166 * @param column the initial definition for $column to build
1167 * @param defaultScope the $scope to supply to the $column getter methods when not supplied by caller
1168 * @param columns a reference to the $columns array to make available on the context supplied to the
1169 * $column getter methods
1170 */
1171 NgTableColumn.prototype.buildColumn = function (column, defaultScope, columns) {
1172 // note: we're not modifying the original column object. This helps to avoid unintended side affects
1173 var extendedCol = Object.create(column);
1174 var defaults = this.createDefaults();
1175 var _loop_1 = function(prop) {
1176 if (extendedCol[prop] === undefined) {
1177 extendedCol[prop] = defaults[prop];
1178 }
1179 if (!ng1.isFunction(extendedCol[prop])) {
1180 // wrap raw field values with "getter" functions
1181 // - this is to ensure consistency with how ngTable.compile builds columns
1182 // - note that the original column object is being "proxied"; this is important
1183 // as it ensure that any changes to the original object will be returned by the "getter"
1184 var getterSetter = function getterSetter() {
1185 if (arguments.length === 1 && !isScopeLike(arguments[0])) {
1186 getterSetter.assign(null, arguments[0]);
1187 }
1188 else {
1189 return column[prop];
1190 }
1191 };
1192 getterSetter.assign = function ($scope, value) {
1193 column[prop] = value;
1194 };
1195 extendedCol[prop] = getterSetter;
1196 }
1197 // satisfy the arguments expected by the function returned by parsedAttribute in the ngTable directive
1198 var getterFn = extendedCol[prop];
1199 extendedCol[prop] = function () {
1200 if (arguments.length === 1 && !isScopeLike(arguments[0])) {
1201 getterFn.assign(defaultScope, arguments[0]);
1202 }
1203 else {
1204 var scope = arguments[0] || defaultScope;
1205 var context = Object.create(scope);
1206 ng1.extend(context, {
1207 $column: extendedCol,
1208 $columns: columns
1209 });
1210 return getterFn.call(column, context);
1211 }
1212 };
1213 if (getterFn.assign) {
1214 extendedCol[prop].assign = getterFn.assign;
1215 }
1216 else {
1217 var wrappedGetterFn_1 = extendedCol[prop];
1218 var localValue_1;
1219 var getterSetter = function getterSetter() {
1220 if (arguments.length === 1 && !isScopeLike(arguments[0])) {
1221 getterSetter.assign(null, arguments[0]);
1222 }
1223 else {
1224 return localValue_1 != undefined ? localValue_1 : wrappedGetterFn_1.apply(extendedCol, arguments);
1225 }
1226 };
1227 getterSetter.assign = function ($scope, value) {
1228 localValue_1 = value;
1229 };
1230 extendedCol[prop] = getterSetter;
1231 }
1232 };
1233 for (var prop in defaults) {
1234 _loop_1(prop);
1235 }
1236 return extendedCol;
1237 };
1238 NgTableColumn.prototype.createDefaults = function () {
1239 return {
1240 'class': this.createGetterSetter(''),
1241 filter: this.createGetterSetter(false),
1242 groupable: this.createGetterSetter(false),
1243 filterData: ng1.noop,
1244 headerTemplateURL: this.createGetterSetter(false),
1245 headerTitle: this.createGetterSetter(''),
1246 sortable: this.createGetterSetter(false),
1247 show: this.createGetterSetter(true),
1248 title: this.createGetterSetter(''),
1249 titleAlt: this.createGetterSetter('')
1250 };
1251 };
1252 NgTableColumn.prototype.createGetterSetter = function (initialValue) {
1253 var value = initialValue;
1254 var getterSetter = function getterSetter() {
1255 if (arguments.length === 1 && !isScopeLike(arguments[0])) {
1256 getterSetter.assign(null, arguments[0]);
1257 }
1258 else {
1259 return value;
1260 }
1261 };
1262 getterSetter.assign = function ($scope, newValue) {
1263 value = newValue;
1264 };
1265 return getterSetter;
1266 };
1267 NgTableColumn.$inject = [];
1268 return NgTableColumn;
1269}());
1270exports.NgTableColumn = NgTableColumn;
1271
1272
1273/***/ },
1274/* 15 */
1275/* unknown exports provided */
1276/* all exports used */
1277/*!********************************************************!*\
1278 !*** ./src/browser/ngTableColumnsBinding.directive.ts ***!
1279 \********************************************************/
1280/***/ function(module, exports) {
1281
1282"use strict";
1283/**
1284 * ngTable: Table + Angular JS
1285 *
1286 * @author Vitalii Savchuk <esvit666@gmail.com>
1287 * @url https://github.com/esvit/ng-table/
1288 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1289 */
1290"use strict";
1291ngTableColumnsBinding.$inject = ["$parse"];
1292/**
1293 * One-way data binds the $columns array generated by ngTable/ngTableDynamic to the specified
1294 * expression.
1295 * This allows the $columns array created for the table to be accessed outside of the html table
1296 * markup.
1297 *
1298 * @ngdoc directive
1299 *
1300 * @example
1301 * ```html
1302 * <table ng-table="$ctrl.tableParams" class="table" ng-table-columns-binding="$ctlr.tableColumns">
1303 * ```
1304 */
1305function ngTableColumnsBinding($parse) {
1306 var directive = {
1307 restrict: 'A',
1308 link: linkFn
1309 };
1310 return directive;
1311 function linkFn($scope, $element, $attrs) {
1312 var setter = $parse($attrs.ngTableColumnsBinding).assign;
1313 if (setter) {
1314 $scope.$watch('$columns', function (newColumns) {
1315 var shallowClone = (newColumns || []).slice(0);
1316 setter($scope, shallowClone);
1317 });
1318 }
1319 }
1320}
1321exports.ngTableColumnsBinding = ngTableColumnsBinding;
1322
1323
1324/***/ },
1325/* 16 */
1326/* unknown exports provided */
1327/* all exports used */
1328/*!******************************************!*\
1329 !*** ./src/browser/ngTableController.ts ***!
1330 \******************************************/
1331/***/ function(module, exports, __webpack_require__) {
1332
1333"use strict";
1334/**
1335 * ngTable: Table + Angular JS
1336 *
1337 * @author Vitalii Savchuk <esvit666@gmail.com>
1338 * @url https://github.com/esvit/ng-table/
1339 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1340 */
1341"use strict";
1342var ng1 = __webpack_require__(/*! angular */ 0);
1343var core_1 = __webpack_require__(/*! ../core */ 1);
1344/**
1345 * The controller for the {@link ngTable ngTable} and {@link ngTableDynamic ngTableDynamic} directives
1346 */
1347var NgTableController = (function () {
1348 function NgTableController($scope, $timeout, $parse, $compile, $attrs, $element, $document, ngTableColumn, ngTableEventsChannel) {
1349 this.$scope = $scope;
1350 this.$parse = $parse;
1351 this.$compile = $compile;
1352 this.$attrs = $attrs;
1353 this.$element = $element;
1354 this.$document = $document;
1355 this.ngTableColumn = ngTableColumn;
1356 this.ngTableEventsChannel = ngTableEventsChannel;
1357 var isFirstTimeLoad = true;
1358 $scope.$filterRow = { disabled: false };
1359 $scope.$loading = false;
1360 // until such times as the directive uses an isolated scope, we need to ensure that the check for
1361 // the params field only consults the "own properties" of the $scope. This is to avoid seeing the params
1362 // field on a $scope higher up in the prototype chain
1363 if (!$scope.hasOwnProperty("params")) {
1364 $scope.params = new core_1.NgTableParams(true);
1365 }
1366 this.delayFilter = (function () {
1367 var timer;
1368 return function (callback, ms) {
1369 $timeout.cancel(timer);
1370 timer = $timeout(callback, ms);
1371 };
1372 })();
1373 // watch for when a new NgTableParams is bound to the scope
1374 // CRITICAL: the watch must be for reference and NOT value equality; this is because NgTableParams maintains
1375 // the current data page as a field. Checking this for value equality would be terrible for performance
1376 // and potentially cause an error if the items in that array has circular references
1377 this.$scope.$watch('params', function (newParams, oldParams) {
1378 if (newParams === oldParams || !newParams) {
1379 return;
1380 }
1381 newParams.reload();
1382 }, false);
1383 this.subscribeToTableEvents();
1384 }
1385 Object.defineProperty(NgTableController.prototype, "hasVisibleFilterColumn", {
1386 get: function () {
1387 var _this = this;
1388 if (!this.$scope.$columns)
1389 return false;
1390 return this.some(this.$scope.$columns, function ($column) {
1391 return $column.show(_this.$scope) && !!$column.filter(_this.$scope);
1392 });
1393 },
1394 enumerable: true,
1395 configurable: true
1396 });
1397 NgTableController.prototype.onDataReloadStatusChange = function (newStatus /*, oldStatus*/) {
1398 if (!newStatus || this.$scope.params.hasErrorState()) {
1399 return;
1400 }
1401 var currentParams = this.$scope.params;
1402 var filterOptions = currentParams.settings().filterOptions;
1403 if (currentParams.hasFilterChanges()) {
1404 var applyFilter = function () {
1405 currentParams.page(1);
1406 currentParams.reload();
1407 };
1408 if (filterOptions.filterDelay) {
1409 this.delayFilter(applyFilter, filterOptions.filterDelay);
1410 }
1411 else {
1412 applyFilter();
1413 }
1414 }
1415 else {
1416 currentParams.reload();
1417 }
1418 };
1419 NgTableController.prototype.compileDirectiveTemplates = function () {
1420 if (!this.$element.hasClass('ng-table')) {
1421 this.$scope.templates = {
1422 header: (this.$attrs.templateHeader ? this.$attrs.templateHeader : 'ng-table/header.html'),
1423 pagination: (this.$attrs.templatePagination ? this.$attrs.templatePagination : 'ng-table/pager.html')
1424 };
1425 this.$element.addClass('ng-table');
1426 var headerTemplate = null;
1427 // $element.find('> thead').length === 0 doesn't work on jqlite
1428 var theadFound_1 = false;
1429 ng1.forEach(this.$element.children(), function (e) {
1430 if (e.tagName === 'THEAD') {
1431 theadFound_1 = true;
1432 }
1433 });
1434 if (!theadFound_1) {
1435 headerTemplate = ng1.element('<thead ng-include="templates.header"></thead>', this.$document);
1436 this.$element.prepend(headerTemplate);
1437 }
1438 var paginationTemplate = ng1.element('<div ng-table-pagination="params" template-url="templates.pagination"></div>', this.$document);
1439 this.$element.after(paginationTemplate);
1440 if (headerTemplate) {
1441 this.$compile(headerTemplate)(this.$scope);
1442 }
1443 this.$compile(paginationTemplate)(this.$scope);
1444 }
1445 };
1446 NgTableController.prototype.loadFilterData = function ($columns) {
1447 var _this = this;
1448 ng1.forEach($columns, function ($column) {
1449 var result = $column.filterData(_this.$scope);
1450 if (!result) {
1451 delete $column.filterData;
1452 return undefined;
1453 }
1454 if (isPromiseLike(result)) {
1455 delete $column.filterData;
1456 return result.then(function (data) {
1457 // our deferred can eventually return arrays, functions and objects
1458 if (!ng1.isArray(data) && !ng1.isFunction(data) && !ng1.isObject(data)) {
1459 // if none of the above was found - we just want an empty array
1460 data = [];
1461 }
1462 $column.data = data;
1463 });
1464 }
1465 else {
1466 return $column.data = result;
1467 }
1468 });
1469 function isPromiseLike(val) {
1470 return val && typeof val === 'object' && typeof val.then === 'function';
1471 }
1472 };
1473 NgTableController.prototype.buildColumns = function (columns) {
1474 var _this = this;
1475 // todo: use strictNullChecks and remove guard clause
1476 var result = [];
1477 (columns || []).forEach(function (col) {
1478 result.push(_this.ngTableColumn.buildColumn(col, _this.$scope, result));
1479 });
1480 return result;
1481 };
1482 NgTableController.prototype.parseNgTableDynamicExpr = function (attr) {
1483 if (!attr || attr.indexOf(" with ") > -1) {
1484 var parts = attr.split(/\s+with\s+/);
1485 return {
1486 tableParams: parts[0],
1487 columns: parts[1]
1488 };
1489 }
1490 else {
1491 throw new Error('Parse error (expected example: ng-table-dynamic=\'tableParams with cols\')');
1492 }
1493 };
1494 NgTableController.prototype.setupBindingsToInternalScope = function (tableParamsExpr) {
1495 // note: this we're setting up watches to simulate angular's isolated scope bindings
1496 var _this = this;
1497 // note: is REALLY important to watch for a change to the ngTableParams *reference* rather than
1498 // $watch for value equivalence. This is because ngTableParams references the current page of data as
1499 // a field and it's important not to watch this
1500 this.$scope.$watch(tableParamsExpr, function (params) {
1501 if (params === undefined) {
1502 return;
1503 }
1504 _this.$scope.params = params;
1505 }, false);
1506 this.setupFilterRowBindingsToInternalScope();
1507 this.setupGroupRowBindingsToInternalScope();
1508 };
1509 NgTableController.prototype.setupFilterRowBindingsToInternalScope = function () {
1510 var _this = this;
1511 if (this.$attrs.showFilter) {
1512 this.$scope.$parent.$watch(this.$attrs.showFilter, function (value) {
1513 _this.$scope.show_filter = value;
1514 });
1515 }
1516 else {
1517 this.$scope.$watch(function () { return _this.hasVisibleFilterColumn; }, function (value) {
1518 _this.$scope.show_filter = value;
1519 });
1520 }
1521 if (this.$attrs.disableFilter) {
1522 this.$scope.$parent.$watch(this.$attrs.disableFilter, function (value) {
1523 _this.$scope.$filterRow.disabled = value;
1524 });
1525 }
1526 };
1527 NgTableController.prototype.setupGroupRowBindingsToInternalScope = function () {
1528 var _this = this;
1529 this.$scope.$groupRow = { show: false };
1530 if (this.$attrs.showGroup) {
1531 var showGroupGetter_1 = this.$parse(this.$attrs.showGroup);
1532 this.$scope.$parent.$watch(showGroupGetter_1, function (value) {
1533 _this.$scope.$groupRow.show = value;
1534 });
1535 if (showGroupGetter_1.assign) {
1536 // setup two-way databinding thus allowing ngTableGrowRow to assign to the showGroup expression
1537 this.$scope.$watch('$groupRow.show', function (value) {
1538 showGroupGetter_1.assign(_this.$scope.$parent, value);
1539 });
1540 }
1541 }
1542 else {
1543 this.$scope.$watch('params.hasGroup()', function (newValue) {
1544 _this.$scope.$groupRow.show = newValue;
1545 });
1546 }
1547 };
1548 NgTableController.prototype.getVisibleColumns = function () {
1549 var _this = this;
1550 return (this.$scope.$columns || []).filter(function (c) {
1551 return c.show(_this.$scope);
1552 });
1553 };
1554 NgTableController.prototype.subscribeToTableEvents = function () {
1555 var _this = this;
1556 this.$scope.$watch('params.isDataReloadRequired()', function (newStatus /*, oldStatus*/) {
1557 _this.onDataReloadStatusChange(newStatus);
1558 });
1559 this.ngTableEventsChannel.onAfterReloadData(function (params, newDatapage) {
1560 var visibleColumns = _this.getVisibleColumns();
1561 if (params.hasGroup()) {
1562 _this.$scope.$groups = (newDatapage || []);
1563 _this.$scope.$groups.visibleColumnCount = visibleColumns.length;
1564 }
1565 else {
1566 _this.$scope.$data = (newDatapage || []);
1567 _this.$scope.$data.visibleColumnCount = visibleColumns.length;
1568 }
1569 }, this.$scope, function (publisher) { return _this.$scope.params === publisher; });
1570 this.ngTableEventsChannel.onPagesChanged(function (params, newPages) {
1571 _this.$scope.pages = newPages;
1572 }, this.$scope, function (publisher) { return _this.$scope.params === publisher; });
1573 };
1574 NgTableController.prototype.some = function (array, predicate) {
1575 var found = false;
1576 for (var i = 0; i < array.length; i++) {
1577 var obj = array[i];
1578 if (predicate(obj)) {
1579 found = true;
1580 break;
1581 }
1582 }
1583 return found;
1584 };
1585 NgTableController.$inject = [
1586 '$scope', '$timeout', '$parse', '$compile', '$attrs', '$element', '$document', 'ngTableColumn', 'ngTableEventsChannel'
1587 ];
1588 return NgTableController;
1589}());
1590exports.NgTableController = NgTableController;
1591
1592
1593/***/ },
1594/* 17 */
1595/* unknown exports provided */
1596/* all exports used */
1597/*!*************************************************!*\
1598 !*** ./src/browser/ngTableDynamic.directive.ts ***!
1599 \*************************************************/
1600/***/ function(module, exports, __webpack_require__) {
1601
1602"use strict";
1603/**
1604 * ngTable: Table + Angular JS
1605 *
1606 * @author Vitalii Savchuk <esvit666@gmail.com>
1607 * @url https://github.com/esvit/ng-table/
1608 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1609 */
1610"use strict";
1611var ng1 = __webpack_require__(/*! angular */ 0);
1612ngTableDynamic.$inject = [];
1613/**
1614 * A dynamic version of the {@link ngTable ngTable} directive that accepts a dynamic list of columns
1615 * definitions to render
1616 * @ngdoc directive
1617 *
1618 * @example
1619 * ```html
1620 * <table ng-table-dynamic="$ctrl.tableParams with $ctrl.cols" class="table">
1621 * <tr ng-repeat="row in $data">
1622 * <td ng-repeat="col in $columns">{{row[col.field]}}</td>
1623 * </tr>
1624 * </table>
1625 * ```
1626 */
1627function ngTableDynamic() {
1628 return {
1629 restrict: 'A',
1630 priority: 1001,
1631 scope: true,
1632 controller: 'ngTableController',
1633 compile: function (tElement) {
1634 var row;
1635 // IE 8 fix :not(.ng-table-group) selector
1636 ng1.forEach(tElement.find('tr'), function (tr) {
1637 tr = ng1.element(tr);
1638 if (!tr.hasClass('ng-table-group') && !row) {
1639 row = tr;
1640 }
1641 });
1642 if (!row) {
1643 return undefined;
1644 }
1645 ng1.forEach(row.find('td'), function (item) {
1646 var el = ng1.element(item);
1647 var getAttrValue = function (attr) {
1648 return el.attr('x-data-' + attr) || el.attr('data-' + attr) || el.attr(attr);
1649 };
1650 // this used in responsive table
1651 var titleExpr = getAttrValue('title');
1652 if (!titleExpr) {
1653 el.attr('data-title-text', '{{$columns[$index].titleAlt(this) || $columns[$index].title(this)}}');
1654 }
1655 var showExpr = el.attr('ng-if');
1656 if (!showExpr) {
1657 el.attr('ng-if', '$columns[$index].show(this)');
1658 }
1659 });
1660 return function (scope, element, attrs, controller) {
1661 var expr = controller.parseNgTableDynamicExpr(attrs.ngTableDynamic);
1662 controller.setupBindingsToInternalScope(expr.tableParams);
1663 controller.compileDirectiveTemplates();
1664 scope.$watchCollection(expr.columns, function (newCols /*, oldCols*/) {
1665 scope.$columns = controller.buildColumns(newCols);
1666 controller.loadFilterData(scope.$columns);
1667 });
1668 };
1669 }
1670 };
1671}
1672exports.ngTableDynamic = ngTableDynamic;
1673
1674
1675/***/ },
1676/* 18 */
1677/* unknown exports provided */
1678/* all exports used */
1679/*!********************************************!*\
1680 !*** ./src/browser/ngTableFilterConfig.ts ***!
1681 \********************************************/
1682/***/ function(module, exports, __webpack_require__) {
1683
1684"use strict";
1685/**
1686 * ngTable: Table + Angular JS
1687 *
1688 * @author Vitalii Savchuk <esvit666@gmail.com>
1689 * @url https://github.com/esvit/ng-table/
1690 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1691 */
1692"use strict";
1693var ng1 = __webpack_require__(/*! angular */ 0);
1694/**
1695 * The angular provider used to configure the behaviour of the `NgTableFilterConfig` service.
1696 */
1697var NgTableFilterConfigProvider = (function () {
1698 function NgTableFilterConfigProvider($injector) {
1699 var _this = this;
1700 this.defaultConfig = {
1701 defaultBaseUrl: 'ng-table/filters/',
1702 defaultExt: '.html',
1703 aliasUrls: {}
1704 };
1705 this.$get = function () {
1706 return $injector.instantiate(NgTableFilterConfig, { config: ng1.copy(_this.config) });
1707 };
1708 this.$get.$inject = [];
1709 this.resetConfigs();
1710 }
1711 /**
1712 * Reset back to factory defaults the config values that `NgTableFilterConfig` service will use
1713 */
1714 NgTableFilterConfigProvider.prototype.resetConfigs = function () {
1715 this.config = this.defaultConfig;
1716 };
1717 /**
1718 * Set the config values used by `NgTableFilterConfig` service
1719 */
1720 NgTableFilterConfigProvider.prototype.setConfig = function (customConfig) {
1721 var mergeConfig = ng1.extend({}, this.config, customConfig);
1722 mergeConfig.aliasUrls = ng1.extend({}, this.config.aliasUrls, customConfig.aliasUrls);
1723 this.config = mergeConfig;
1724 };
1725 NgTableFilterConfigProvider.$inject = ['$injector'];
1726 return NgTableFilterConfigProvider;
1727}());
1728exports.NgTableFilterConfigProvider = NgTableFilterConfigProvider;
1729/**
1730 * Exposes configuration values and methods used to return the location of the html
1731 * templates used to render the filter row of an ng-table directive
1732 */
1733var NgTableFilterConfig = (function () {
1734 function NgTableFilterConfig(
1735 /**
1736 * Readonly copy of the final values used to configure the service.
1737 */
1738 config) {
1739 this.config = config;
1740 }
1741 /**
1742 * Return the url of the html filter template registered with the alias supplied
1743 */
1744 NgTableFilterConfig.prototype.getUrlForAlias = function (aliasName, filterKey) {
1745 return this.config.aliasUrls[aliasName] || this.config.defaultBaseUrl + aliasName + this.config.defaultExt;
1746 };
1747 /**
1748 * Return the url of the html filter template for the supplied definition and key.
1749 * For more information see the documentation for {@link IFilterTemplateMap}
1750 */
1751 NgTableFilterConfig.prototype.getTemplateUrl = function (filterDef, filterKey) {
1752 var filterName;
1753 if (typeof filterDef !== 'string') {
1754 filterName = filterDef.id;
1755 }
1756 else {
1757 filterName = filterDef;
1758 }
1759 if (filterName.indexOf('/') !== -1) {
1760 return filterName;
1761 }
1762 return this.getUrlForAlias(filterName, filterKey);
1763 };
1764 NgTableFilterConfig.$inject = ['config'];
1765 return NgTableFilterConfig;
1766}());
1767exports.NgTableFilterConfig = NgTableFilterConfig;
1768
1769
1770/***/ },
1771/* 19 */
1772/* unknown exports provided */
1773/* all exports used */
1774/*!***************************************************!*\
1775 !*** ./src/browser/ngTableFilterRow.directive.ts ***!
1776 \***************************************************/
1777/***/ function(module, exports, __webpack_require__) {
1778
1779"use strict";
1780/**
1781 * ngTable: Table + Angular JS
1782 *
1783 * @author Vitalii Savchuk <esvit666@gmail.com>
1784 * @url https://github.com/esvit/ng-table/
1785 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1786 */
1787"use strict";
1788var templateUrl = __webpack_require__(/*! ./filterRow.html */ 42);
1789ngTableFilterRow.$inject = [];
1790/**
1791 * directive that renders the filter header row for a table
1792 * @ngdoc directive
1793 * @example
1794 * ```html
1795 * <ng-table-filter-row></ng-table-filter-row>
1796 * ```
1797 */
1798function ngTableFilterRow() {
1799 var directive = {
1800 restrict: 'E',
1801 replace: true,
1802 templateUrl: templateUrl,
1803 scope: true,
1804 controller: 'ngTableFilterRowController',
1805 controllerAs: '$ctrl'
1806 };
1807 return directive;
1808}
1809exports.ngTableFilterRow = ngTableFilterRow;
1810
1811
1812/***/ },
1813/* 20 */
1814/* unknown exports provided */
1815/* all exports used */
1816/*!***************************************************!*\
1817 !*** ./src/browser/ngTableFilterRowController.ts ***!
1818 \***************************************************/
1819/***/ function(module, exports) {
1820
1821"use strict";
1822/**
1823 * ngTable: Table + Angular JS
1824 *
1825 * @author Vitalii Savchuk <esvit666@gmail.com>
1826 * @url https://github.com/esvit/ng-table/
1827 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1828 */
1829"use strict";
1830/**
1831 * Controller for the {@link ngTableFilterRow ngTableFilterRow} directive
1832 */
1833var NgTableFilterRowController = (function () {
1834 function NgTableFilterRowController($scope, ngTableFilterConfig) {
1835 this.config = ngTableFilterConfig;
1836 // todo: stop doing this. Why?
1837 // * scope inheritance makes it hard to know how supplies functions
1838 // * scope is not a concept in angular 2
1839 // make function available to filter templates
1840 $scope.getFilterPlaceholderValue = this.getFilterPlaceholderValue.bind(this);
1841 }
1842 NgTableFilterRowController.prototype.getFilterCellCss = function (filter, layout) {
1843 if (layout !== 'horizontal') {
1844 return 's12';
1845 }
1846 var size = Object.keys(filter).length;
1847 var width = parseInt((12 / size).toString(), 10);
1848 return 's' + width;
1849 };
1850 NgTableFilterRowController.prototype.getFilterPlaceholderValue = function (filterDef, filterKey) {
1851 if (typeof filterDef === 'string') {
1852 return '';
1853 }
1854 else {
1855 return filterDef.placeholder;
1856 }
1857 };
1858 NgTableFilterRowController.$inject = ['$scope', 'ngTableFilterConfig'];
1859 return NgTableFilterRowController;
1860}());
1861exports.NgTableFilterRowController = NgTableFilterRowController;
1862
1863
1864/***/ },
1865/* 21 */
1866/* unknown exports provided */
1867/* all exports used */
1868/*!**************************************************!*\
1869 !*** ./src/browser/ngTableGroupRow.directive.ts ***!
1870 \**************************************************/
1871/***/ function(module, exports, __webpack_require__) {
1872
1873"use strict";
1874/**
1875 * ngTable: Table + Angular JS
1876 *
1877 * @author Vitalii Savchuk <esvit666@gmail.com>
1878 * @url https://github.com/esvit/ng-table/
1879 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1880 */
1881"use strict";
1882var templateUrl = __webpack_require__(/*! ./groupRow.html */ 47);
1883ngTableGroupRow.$inject = [];
1884/**
1885 * directive that renders the group header row for a table
1886 * @ngdoc directive
1887 * @example
1888 * ```html
1889 * <ng-table-group-row></ng-table-group-row>
1890 * ```
1891 */
1892function ngTableGroupRow() {
1893 var directive = {
1894 restrict: 'E',
1895 replace: true,
1896 templateUrl: templateUrl,
1897 scope: true,
1898 controller: 'ngTableGroupRowController',
1899 controllerAs: '$ctrl'
1900 };
1901 return directive;
1902}
1903exports.ngTableGroupRow = ngTableGroupRow;
1904
1905
1906/***/ },
1907/* 22 */
1908/* unknown exports provided */
1909/* all exports used */
1910/*!**************************************************!*\
1911 !*** ./src/browser/ngTableGroupRowController.ts ***!
1912 \**************************************************/
1913/***/ function(module, exports) {
1914
1915"use strict";
1916/**
1917 * ngTable: Table + Angular JS
1918 *
1919 * @author Vitalii Savchuk <esvit666@gmail.com>
1920 * @url https://github.com/esvit/ng-table/
1921 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
1922 */
1923"use strict";
1924/**
1925 * Controller for the {@link ngTableGroupRow ngTableGroupRow} directive
1926 */
1927var NgTableGroupRowController = (function () {
1928 function NgTableGroupRowController($scope) {
1929 var _this = this;
1930 this.$scope = $scope;
1931 this.groupFns = [];
1932 $scope.$watch('params.group()', function (newGrouping) {
1933 _this.setGroup(newGrouping);
1934 }, true);
1935 }
1936 NgTableGroupRowController.prototype.getGroupables = function () {
1937 var _this = this;
1938 var groupableCols = this.$scope.$columns.filter(function ($column) { return !!$column.groupable(_this.$scope); });
1939 return this.groupFns.concat(groupableCols);
1940 };
1941 NgTableGroupRowController.prototype.getGroupTitle = function (group) {
1942 return this.isGroupingFunc(group) ? group.title : group.title(this.$scope);
1943 };
1944 NgTableGroupRowController.prototype.getVisibleColumns = function () {
1945 var _this = this;
1946 return this.$scope.$columns.filter(function ($column) { return $column.show(_this.$scope); });
1947 };
1948 NgTableGroupRowController.prototype.groupBy = function (group) {
1949 if (this.isSelectedGroup(group)) {
1950 this.changeSortDirection();
1951 }
1952 else {
1953 if (this.isGroupingFunc(group)) {
1954 this.$scope.params.group(group);
1955 }
1956 else {
1957 // it's OK, we know that groupable will return a string
1958 // this is guaranteed by getGroupables returning only
1959 // columns that return (truthy) strings
1960 this.$scope.params.group(group.groupable(this.$scope));
1961 }
1962 }
1963 };
1964 NgTableGroupRowController.prototype.isSelectedGroup = function (group) {
1965 if (this.isGroupingFunc(group)) {
1966 return group === this.$scope.$selGroup;
1967 }
1968 else {
1969 return group.groupable(this.$scope) === this.$scope.$selGroup;
1970 }
1971 };
1972 NgTableGroupRowController.prototype.toggleDetail = function () {
1973 this.$scope.params.settings().groupOptions.isExpanded = !this.$scope.params.settings().groupOptions.isExpanded;
1974 return this.$scope.params.reload();
1975 };
1976 NgTableGroupRowController.prototype.changeSortDirection = function () {
1977 var newDirection;
1978 if (this.$scope.params.hasGroup(this.$scope.$selGroup, 'asc')) {
1979 newDirection = 'desc';
1980 }
1981 else if (this.$scope.params.hasGroup(this.$scope.$selGroup, 'desc')) {
1982 newDirection = '';
1983 }
1984 else {
1985 newDirection = 'asc';
1986 }
1987 this.$scope.params.group(this.$scope.$selGroup, newDirection);
1988 };
1989 NgTableGroupRowController.prototype.findGroupColumn = function (groupKey) {
1990 var _this = this;
1991 return this.$scope.$columns.filter(function ($column) { return $column.groupable(_this.$scope) === groupKey; })[0];
1992 };
1993 NgTableGroupRowController.prototype.isGroupingFunc = function (val) {
1994 return typeof val === 'function';
1995 };
1996 NgTableGroupRowController.prototype.setGroup = function (grouping) {
1997 var existingGroupCol = this.findGroupColumn(this.$scope.$selGroup);
1998 if (existingGroupCol && existingGroupCol.show.assign) {
1999 existingGroupCol.show.assign(this.$scope, true);
2000 }
2001 if (this.isGroupingFunc(grouping)) {
2002 this.groupFns = [grouping];
2003 this.$scope.$selGroup = grouping;
2004 this.$scope.$selGroupTitle = grouping.title;
2005 }
2006 else {
2007 // note: currently only one group is implemented
2008 var groupKey = Object.keys(grouping || {})[0];
2009 var groupedColumn = this.findGroupColumn(groupKey);
2010 if (groupedColumn) {
2011 this.$scope.$selGroupTitle = groupedColumn.title(this.$scope);
2012 this.$scope.$selGroup = groupKey;
2013 if (groupedColumn.show.assign) {
2014 groupedColumn.show.assign(this.$scope, false);
2015 }
2016 }
2017 }
2018 };
2019 NgTableGroupRowController.$inject = ['$scope'];
2020 return NgTableGroupRowController;
2021}());
2022exports.NgTableGroupRowController = NgTableGroupRowController;
2023
2024
2025/***/ },
2026/* 23 */
2027/* unknown exports provided */
2028/* all exports used */
2029/*!****************************************************!*\
2030 !*** ./src/browser/ngTablePagination.directive.ts ***!
2031 \****************************************************/
2032/***/ function(module, exports, __webpack_require__) {
2033
2034"use strict";
2035/**
2036 * ngTable: Table + Angular JS
2037 *
2038 * @author Vitalii Savchuk <esvit666@gmail.com>
2039 * @url https://github.com/esvit/ng-table/
2040 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
2041 */
2042"use strict";
2043var ng1 = __webpack_require__(/*! angular */ 0);
2044ngTablePagination.$inject = ['$compile', '$document', 'ngTableEventsChannel'];
2045/**
2046 * Directive that renders the table pagination controls
2047 * @ngdoc directive
2048 */
2049function ngTablePagination($compile, $document, ngTableEventsChannel) {
2050 return {
2051 restrict: 'A',
2052 scope: {
2053 'params': '=ngTablePagination',
2054 'templateUrl': '='
2055 },
2056 replace: false,
2057 link: function (scope, element /*, attrs*/) {
2058 ngTableEventsChannel.onAfterReloadData(function (pubParams) {
2059 scope.pages = pubParams.generatePagesArray();
2060 }, scope, function (pubParams) {
2061 return pubParams === scope.params;
2062 });
2063 scope.$watch('templateUrl', function (templateUrl) {
2064 if (templateUrl === undefined) {
2065 return;
2066 }
2067 var template = ng1.element('<div ng-include="templateUrl"></div>', $document);
2068 element.append(template);
2069 $compile(template)(scope);
2070 });
2071 }
2072 };
2073}
2074exports.ngTablePagination = ngTablePagination;
2075
2076
2077/***/ },
2078/* 24 */
2079/* unknown exports provided */
2080/* all exports used */
2081/*!********************************************************!*\
2082 !*** ./src/browser/ngTableSelectFilterDs.directive.ts ***!
2083 \********************************************************/
2084/***/ function(module, exports) {
2085
2086"use strict";
2087/**
2088 * ngTable: Table + Angular JS
2089 *
2090 * @author Vitalii Savchuk <esvit666@gmail.com>
2091 * @url https://github.com/esvit/ng-table/
2092 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
2093 */
2094"use strict";
2095ngTableSelectFilterDs.$inject = [];
2096/**
2097 * Takes the array returned by $column.filterData and makes it available as `$selectData` on the `$scope`.
2098 *
2099 * The resulting `$selectData` array will contain an extra item that is suitable to represent the user
2100 * "deselecting" an item from a `<select>` tag
2101 *
2102 * This directive is is focused on providing a datasource to an `ngOptions` directive
2103 */
2104function ngTableSelectFilterDs() {
2105 // note: not using isolated or child scope "by design"
2106 // this is to allow this directive to be combined with other directives that do
2107 var directive = {
2108 restrict: 'A',
2109 controller: NgTableSelectFilterDsController
2110 };
2111 return directive;
2112}
2113exports.ngTableSelectFilterDs = ngTableSelectFilterDs;
2114/**
2115 * @private
2116 */
2117var NgTableSelectFilterDsController = (function () {
2118 function NgTableSelectFilterDsController($scope, $parse, $attrs, $q) {
2119 var _this = this;
2120 this.$scope = $scope;
2121 this.$attrs = $attrs;
2122 this.$q = $q;
2123 this.$column = $parse($attrs.ngTableSelectFilterDs)($scope);
2124 $scope.$watch(function () { return _this.$column && _this.$column.data; }, function () { _this.bindDataSource(); });
2125 }
2126 NgTableSelectFilterDsController.prototype.bindDataSource = function () {
2127 var _this = this;
2128 this.getSelectListData(this.$column).then(function (data) {
2129 if (data && !_this.hasEmptyOption(data)) {
2130 data.unshift({ id: '', title: '' });
2131 }
2132 data = data || [];
2133 _this.$scope.$selectData = data;
2134 });
2135 };
2136 NgTableSelectFilterDsController.prototype.hasEmptyOption = function (data) {
2137 var isMatch;
2138 for (var i = 0; i < data.length; i++) {
2139 var item = data[i];
2140 if (item && item.id === '') {
2141 isMatch = true;
2142 break;
2143 }
2144 }
2145 return isMatch;
2146 };
2147 NgTableSelectFilterDsController.prototype.getSelectListData = function ($column) {
2148 var dataInput = $column.data;
2149 if (dataInput instanceof Array) {
2150 return this.$q.when(dataInput);
2151 }
2152 else {
2153 return this.$q.when(dataInput && dataInput());
2154 }
2155 };
2156 NgTableSelectFilterDsController.$inject = ['$scope', '$parse', '$attrs', '$q'];
2157 return NgTableSelectFilterDsController;
2158}());
2159exports.NgTableSelectFilterDsController = NgTableSelectFilterDsController;
2160
2161
2162/***/ },
2163/* 25 */
2164/* unknown exports provided */
2165/* all exports used */
2166/*!***************************************************!*\
2167 !*** ./src/browser/ngTableSorterRow.directive.ts ***!
2168 \***************************************************/
2169/***/ function(module, exports, __webpack_require__) {
2170
2171"use strict";
2172/**
2173 * ngTable: Table + Angular JS
2174 *
2175 * @author Vitalii Savchuk <esvit666@gmail.com>
2176 * @url https://github.com/esvit/ng-table/
2177 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
2178 */
2179"use strict";
2180var templateUrl = __webpack_require__(/*! ./sorterRow.html */ 50);
2181ngTableSorterRow.$inject = [];
2182/**
2183 * directive that renders the sorting header row for a table
2184 * @ngdoc directive
2185 * @example
2186 * ```html
2187 * <ng-table-sorter-row></ng-table-sorter-row>
2188 * ```
2189 */
2190function ngTableSorterRow() {
2191 var directive = {
2192 restrict: 'E',
2193 replace: true,
2194 templateUrl: templateUrl,
2195 scope: true,
2196 controller: 'ngTableSorterRowController',
2197 controllerAs: '$ctrl'
2198 };
2199 return directive;
2200}
2201exports.ngTableSorterRow = ngTableSorterRow;
2202
2203
2204/***/ },
2205/* 26 */
2206/* unknown exports provided */
2207/* all exports used */
2208/*!***************************************************!*\
2209 !*** ./src/browser/ngTableSorterRowController.ts ***!
2210 \***************************************************/
2211/***/ function(module, exports) {
2212
2213"use strict";
2214"use strict";
2215/**
2216 * Controller for the {@link ngTableSorterRow ngTableSorterRow} directive
2217 */
2218var NgTableSorterRowController = (function () {
2219 function NgTableSorterRowController($scope) {
2220 this.$scope = $scope;
2221 }
2222 NgTableSorterRowController.prototype.sortBy = function ($column, event) {
2223 var parsedSortable = $column.sortable && $column.sortable();
2224 if (!parsedSortable || typeof parsedSortable !== 'string') {
2225 return;
2226 }
2227 else {
2228 var defaultSort = this.$scope.params.settings().defaultSort;
2229 var inverseSort = (defaultSort === 'asc' ? 'desc' : 'asc');
2230 var sorting = this.$scope.params.sorting() && this.$scope.params.sorting()[parsedSortable] && (this.$scope.params.sorting()[parsedSortable] === defaultSort);
2231 var sortingParams = (event.ctrlKey || event.metaKey) ? this.$scope.params.sorting() : {};
2232 sortingParams[parsedSortable] = (sorting ? inverseSort : defaultSort);
2233 this.$scope.params.parameters({
2234 sorting: sortingParams
2235 });
2236 }
2237 };
2238 NgTableSorterRowController.$inject = ['$scope'];
2239 return NgTableSorterRowController;
2240}());
2241exports.NgTableSorterRowController = NgTableSorterRowController;
2242
2243
2244/***/ },
2245/* 27 */
2246/* unknown exports provided */
2247/* all exports used */
2248/*!******************************************!*\
2249 !*** ./src/browser/public-interfaces.ts ***!
2250 \******************************************/
2251/***/ function(module, exports) {
2252
2253"use strict";
2254"use strict";
2255
2256
2257/***/ },
2258/* 28 */
2259/* unknown exports provided */
2260/* all exports used */
2261/*!***************************************!*\
2262 !*** ./src/core/data/dataSettings.ts ***!
2263 \***************************************/
2264/***/ function(module, exports) {
2265
2266"use strict";
2267"use strict";
2268
2269
2270/***/ },
2271/* 29 */
2272/* unknown exports provided */
2273/* all exports used */
2274/*!**********************************!*\
2275 !*** ./src/core/data/getData.ts ***!
2276 \**********************************/
2277/***/ function(module, exports) {
2278
2279"use strict";
2280"use strict";
2281
2282
2283/***/ },
2284/* 30 */
2285/* unknown exports provided */
2286/* all exports used */
2287/*!**************************************!*\
2288 !*** ./src/core/data/interceptor.ts ***!
2289 \**************************************/
2290/***/ function(module, exports) {
2291
2292"use strict";
2293"use strict";
2294
2295
2296/***/ },
2297/* 31 */
2298/* unknown exports provided */
2299/* all exports used */
2300/*!************************************************!*\
2301 !*** ./src/core/data/ngTableDefaultGetData.ts ***!
2302 \************************************************/
2303/***/ function(module, exports, __webpack_require__) {
2304
2305"use strict";
2306/**
2307 * ngTable: Table + Angular JS
2308 *
2309 * @author Vitalii Savchuk <esvit666@gmail.com>
2310 * @url https://github.com/esvit/ng-table/
2311 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
2312 */
2313"use strict";
2314var ng1 = __webpack_require__(/*! angular */ 0);
2315/**
2316 * Implementation of the {@link IDefaultGetDataProvider} interface
2317 */
2318var NgTableDefaultGetDataProvider = (function () {
2319 function NgTableDefaultGetDataProvider() {
2320 /**
2321 * The name of a angular filter that knows how to apply the values returned by
2322 * `NgTableParams.filter()` to restrict an array of data.
2323 * (defaults to the angular `filter` filter service)
2324 */
2325 this.filterFilterName = 'filter';
2326 /**
2327 * The name of a angular filter that knows how to apply the values returned by
2328 * `NgTableParams.orderBy()` to sort an array of data.
2329 * (defaults to the angular `orderBy` filter service)
2330 */
2331 this.sortingFilterName = 'orderBy';
2332 var provider = this;
2333 this.$get = ngTableDefaultGetData;
2334 ngTableDefaultGetData.$inject = ['$filter', 'ngTableEventsChannel'];
2335 function ngTableDefaultGetData($filter, ngTableEventsChannel) {
2336 var defaultDataOptions = { applyFilter: true, applySort: true, applyPaging: true };
2337 getData.applyPaging = applyPaging;
2338 getData.getFilterFn = getFilterFn;
2339 getData.getOrderByFn = getOrderByFn;
2340 return getData;
2341 function getFilterFn(params) {
2342 var filterOptions = params.settings().filterOptions;
2343 if (ng1.isFunction(filterOptions.filterFn)) {
2344 return filterOptions.filterFn;
2345 }
2346 else {
2347 return $filter(filterOptions.filterFilterName || provider.filterFilterName);
2348 }
2349 }
2350 function getOrderByFn(params) {
2351 return $filter(provider.sortingFilterName);
2352 }
2353 function applyFilter(data, params) {
2354 if (!params.hasFilter()) {
2355 return data;
2356 }
2357 var filter = params.filter(true);
2358 var filterKeys = Object.keys(filter);
2359 var parsedFilter = filterKeys.reduce(function (result, key) {
2360 result = setPath(result, filter[key], key);
2361 return result;
2362 }, {});
2363 var filterFn = getFilterFn(params);
2364 return filterFn.call(params, data, parsedFilter, params.settings().filterOptions.filterComparator);
2365 }
2366 function applyPaging(data, params) {
2367 var pagedData = data.slice((params.page() - 1) * params.count(), params.page() * params.count());
2368 params.total(data.length); // set total for recalc pagination
2369 return pagedData;
2370 }
2371 function applySort(data, params) {
2372 var orderBy = params.orderBy();
2373 var orderByFn = getOrderByFn(params);
2374 return orderBy.length ? orderByFn(data, orderBy) : data;
2375 }
2376 function getData(data, params) {
2377 if (data == null) {
2378 return [];
2379 }
2380 var options = ng1.extend({}, defaultDataOptions, params.settings().dataOptions);
2381 var fData = options.applyFilter ? applyFilter(data, params) : data;
2382 ngTableEventsChannel.publishAfterDataFiltered(params, fData);
2383 var orderedData = options.applySort ? applySort(fData, params) : fData;
2384 ngTableEventsChannel.publishAfterDataSorted(params, orderedData);
2385 return options.applyPaging ? applyPaging(orderedData, params) : orderedData;
2386 }
2387 // Sets the value at any depth in a nested object based on the path
2388 // note: adapted from: underscore-contrib#setPath
2389 function setPath(obj, value, path) {
2390 var keys = path.split('.');
2391 var ret = obj;
2392 var lastKey = keys[keys.length - 1];
2393 var target = ret;
2394 var parentPathKeys = keys.slice(0, keys.length - 1);
2395 parentPathKeys.forEach(function (key) {
2396 if (!target.hasOwnProperty(key)) {
2397 target[key] = {};
2398 }
2399 target = target[key];
2400 });
2401 target[lastKey] = value;
2402 return ret;
2403 }
2404 }
2405 }
2406 return NgTableDefaultGetDataProvider;
2407}());
2408exports.NgTableDefaultGetDataProvider = NgTableDefaultGetDataProvider;
2409
2410
2411/***/ },
2412/* 32 */
2413/* unknown exports provided */
2414/* all exports used */
2415/*!**********************************!*\
2416 !*** ./src/core/data/results.ts ***!
2417 \**********************************/
2418/***/ function(module, exports) {
2419
2420"use strict";
2421"use strict";
2422
2423
2424/***/ },
2425/* 33 */
2426/* unknown exports provided */
2427/* all exports used */
2428/*!************************************************!*\
2429 !*** ./src/core/filtering/filterComparator.ts ***!
2430 \************************************************/
2431/***/ function(module, exports) {
2432
2433"use strict";
2434"use strict";
2435
2436
2437/***/ },
2438/* 34 */
2439/* unknown exports provided */
2440/* all exports used */
2441/*!******************************************!*\
2442 !*** ./src/core/filtering/filterFunc.ts ***!
2443 \******************************************/
2444/***/ function(module, exports) {
2445
2446"use strict";
2447"use strict";
2448
2449
2450/***/ },
2451/* 35 */
2452/* unknown exports provided */
2453/* all exports used */
2454/*!**********************************************!*\
2455 !*** ./src/core/filtering/filterSettings.ts ***!
2456 \**********************************************/
2457/***/ function(module, exports) {
2458
2459"use strict";
2460"use strict";
2461
2462
2463/***/ },
2464/* 36 */
2465/* unknown exports provided */
2466/* all exports used */
2467/*!*************************************!*\
2468 !*** ./src/core/filtering/index.ts ***!
2469 \*************************************/
2470/***/ function(module, exports, __webpack_require__) {
2471
2472"use strict";
2473"use strict";
2474function __export(m) {
2475 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
2476}
2477__export(__webpack_require__(/*! ./filterComparator */ 33));
2478__export(__webpack_require__(/*! ./filterFunc */ 34));
2479__export(__webpack_require__(/*! ./filterSettings */ 35));
2480
2481
2482/***/ },
2483/* 37 */
2484/* unknown exports provided */
2485/* all exports used */
2486/*!************************************!*\
2487 !*** ./src/core/grouping/index.ts ***!
2488 \************************************/
2489/***/ function(module, exports, __webpack_require__) {
2490
2491"use strict";
2492"use strict";
2493function __export(m) {
2494 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
2495}
2496__export(__webpack_require__(/*! ./getGroup */ 4));
2497__export(__webpack_require__(/*! ./groupingFunc */ 6));
2498__export(__webpack_require__(/*! ./groupSettings */ 5));
2499__export(__webpack_require__(/*! ./ngTableDefaultGetGroups */ 38));
2500
2501
2502/***/ },
2503/* 38 */
2504/* unknown exports provided */
2505/* all exports used */
2506/*!******************************************************!*\
2507 !*** ./src/core/grouping/ngTableDefaultGetGroups.ts ***!
2508 \******************************************************/
2509/***/ function(module, exports, __webpack_require__) {
2510
2511"use strict";
2512"use strict";
2513var ng1 = __webpack_require__(/*! angular */ 0);
2514var util_1 = __webpack_require__(/*! ../util */ 11);
2515ngTableDefaultGetGroups.$inject = ['$q', 'ngTableDefaultGetData'];
2516/**
2517 * Implementation of the {@link IDefaultGetData IDefaultGetData} interface
2518 *
2519 * @ngdoc service
2520 */
2521function ngTableDefaultGetGroups($q, ngTableDefaultGetData) {
2522 return getGroups;
2523 function getGroups(params) {
2524 var group = params.group();
2525 var groupFn;
2526 var sortDirection = undefined;
2527 if (util_1.isGroupingFun(group)) {
2528 groupFn = group;
2529 sortDirection = group.sortDirection;
2530 }
2531 else {
2532 // currently support for only one group implemented
2533 var groupField_1 = Object.keys(group)[0];
2534 sortDirection = group[groupField_1];
2535 groupFn = function (item) {
2536 return getPath(item, groupField_1);
2537 };
2538 }
2539 var settings = params.settings();
2540 var originalDataOptions = settings.dataOptions;
2541 settings.dataOptions = { applyPaging: false };
2542 var getData = settings.getData;
2543 var gotData = $q.when(getData(params));
2544 return gotData.then(function (data) {
2545 var groups = {};
2546 ng1.forEach(data, function (item) {
2547 var groupName = groupFn(item);
2548 groups[groupName] = groups[groupName] || {
2549 data: [],
2550 $hideRows: !settings.groupOptions.isExpanded,
2551 value: groupName
2552 };
2553 groups[groupName].data.push(item);
2554 });
2555 var result = [];
2556 for (var i in groups) {
2557 result.push(groups[i]);
2558 }
2559 if (sortDirection) {
2560 var orderByFn = ngTableDefaultGetData.getOrderByFn();
2561 var orderBy = util_1.convertSortToOrderBy({
2562 value: sortDirection
2563 });
2564 result = orderByFn(result, orderBy);
2565 }
2566 return ngTableDefaultGetData.applyPaging(result, params);
2567 }).finally(function () {
2568 // restore the real options
2569 settings.dataOptions = originalDataOptions;
2570 });
2571 }
2572}
2573exports.ngTableDefaultGetGroups = ngTableDefaultGetGroups;
2574/**
2575 * @private
2576 */
2577function getPath(obj, ks) {
2578 // origianl source https://github.com/documentcloud/underscore-contrib
2579 var keys;
2580 if (typeof ks === "string") {
2581 keys = ks.split(".");
2582 }
2583 else {
2584 keys = ks;
2585 }
2586 // If we have reached an undefined property
2587 // then stop executing and return undefined
2588 if (obj === undefined)
2589 return void 0;
2590 // If the path array has no more elements, we've reached
2591 // the intended property and return its value
2592 if (keys.length === 0)
2593 return obj;
2594 // If we still have elements in the path array and the current
2595 // value is null, stop executing and return undefined
2596 if (obj === null)
2597 return void 0;
2598 return getPath(obj[keys[0]], keys.slice(1));
2599}
2600
2601
2602/***/ },
2603/* 39 */
2604/* unknown exports provided */
2605/* all exports used */
2606/*!********************************************!*\
2607 !*** ./src/core/grouping/publicExports.ts ***!
2608 \********************************************/
2609/***/ function(module, exports, __webpack_require__) {
2610
2611"use strict";
2612"use strict";
2613function __export(m) {
2614 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
2615}
2616__export(__webpack_require__(/*! ./getGroup */ 4));
2617__export(__webpack_require__(/*! ./groupingFunc */ 6));
2618__export(__webpack_require__(/*! ./groupSettings */ 5));
2619
2620
2621/***/ },
2622/* 40 */
2623/* unknown exports provided */
2624/* all exports used */
2625/*!**********************************!*\
2626 !*** ./src/core/paging/index.ts ***!
2627 \**********************************/
2628/***/ function(module, exports) {
2629
2630"use strict";
2631"use strict";
2632
2633
2634/***/ },
2635/* 41 */
2636/* unknown exports provided */
2637/* all exports used */
2638/*!***********************************!*\
2639 !*** ./src/core/sorting/index.ts ***!
2640 \***********************************/
2641/***/ function(module, exports) {
2642
2643"use strict";
2644"use strict";
2645
2646
2647/***/ },
2648/* 42 */
2649/* unknown exports provided */
2650/* all exports used */
2651/*!************************************!*\
2652 !*** ./src/browser/filterRow.html ***!
2653 \************************************/
2654/***/ function(module, exports, __webpack_require__) {
2655
2656var path = 'ng-table/filterRow.html';
2657var html = "<tr ng-show=\"show_filter\" class=\"ng-table-filters\">\n <th data-title-text=\"{{$column.titleAlt(this) || $column.title(this)}}\" ng-repeat=\"$column in $columns\" ng-if=\"$column.show(this)\" class=\"filter {{$column.class(this)}}\"\n ng-class=\"params.settings().filterOptions.filterLayout === 'horizontal' ? 'filter-horizontal' : ''\">\n <div ng-repeat=\"(name, filter) in $column.filter(this)\" ng-include=\"$ctrl.config.getTemplateUrl(filter)\" class=\"filter-cell\"\n ng-class=\"[$ctrl.getFilterCellCss($column.filter(this), params.settings().filterOptions.filterLayout), $last ? 'last' : '']\">\n </div>\n </th>\n</tr>\n";
2658var angular = __webpack_require__(/*! angular */ 0);
2659angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2660module.exports = path;
2661
2662/***/ },
2663/* 43 */
2664/* unknown exports provided */
2665/* all exports used */
2666/*!*****************************************!*\
2667 !*** ./src/browser/filters/number.html ***!
2668 \*****************************************/
2669/***/ function(module, exports, __webpack_require__) {
2670
2671var path = 'ng-table/filters/number.html';
2672var html = "<input type=\"number\" name=\"{{name}}\" ng-disabled=\"$filterRow.disabled\" ng-model=\"params.filter()[name]\" class=\"input-filter form-control\"\n placeholder=\"{{getFilterPlaceholderValue(filter, name)}}\"/>\n";
2673var angular = __webpack_require__(/*! angular */ 0);
2674angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2675module.exports = path;
2676
2677/***/ },
2678/* 44 */
2679/* unknown exports provided */
2680/* all exports used */
2681/*!**************************************************!*\
2682 !*** ./src/browser/filters/select-multiple.html ***!
2683 \**************************************************/
2684/***/ function(module, exports, __webpack_require__) {
2685
2686var path = 'ng-table/filters/select-multiple.html';
2687var html = "<select ng-options=\"data.id as data.title for data in $column.data\"\n ng-disabled=\"$filterRow.disabled\"\n multiple ng-multiple=\"true\"\n ng-model=\"params.filter()[name]\"\n class=\"filter filter-select-multiple form-control\" name=\"{{name}}\">\n</select>\n";
2688var angular = __webpack_require__(/*! angular */ 0);
2689angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2690module.exports = path;
2691
2692/***/ },
2693/* 45 */
2694/* unknown exports provided */
2695/* all exports used */
2696/*!*****************************************!*\
2697 !*** ./src/browser/filters/select.html ***!
2698 \*****************************************/
2699/***/ function(module, exports, __webpack_require__) {
2700
2701var path = 'ng-table/filters/select.html';
2702var html = "<select ng-options=\"data.id as data.title for data in $selectData\"\n ng-table-select-filter-ds=\"$column\"\n ng-disabled=\"$filterRow.disabled\"\n ng-model=\"params.filter()[name]\"\n class=\"filter filter-select form-control\" name=\"{{name}}\">\n <option style=\"display:none\" value=\"\"></option>\n</select>\n";
2703var angular = __webpack_require__(/*! angular */ 0);
2704angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2705module.exports = path;
2706
2707/***/ },
2708/* 46 */
2709/* unknown exports provided */
2710/* all exports used */
2711/*!***************************************!*\
2712 !*** ./src/browser/filters/text.html ***!
2713 \***************************************/
2714/***/ function(module, exports, __webpack_require__) {
2715
2716var path = 'ng-table/filters/text.html';
2717var html = "<input type=\"text\" name=\"{{name}}\" ng-disabled=\"$filterRow.disabled\" ng-model=\"params.filter()[name]\" class=\"input-filter form-control\"\n placeholder=\"{{getFilterPlaceholderValue(filter, name)}}\"/>\n";
2718var angular = __webpack_require__(/*! angular */ 0);
2719angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2720module.exports = path;
2721
2722/***/ },
2723/* 47 */
2724/* unknown exports provided */
2725/* all exports used */
2726/*!***********************************!*\
2727 !*** ./src/browser/groupRow.html ***!
2728 \***********************************/
2729/***/ function(module, exports, __webpack_require__) {
2730
2731var path = 'ng-table/groupRow.html';
2732var html = "<tr ng-if=\"params.hasGroup()\" ng-show=\"$groupRow.show\" class=\"ng-table-group-header\">\n <th colspan=\"{{$ctrl.getVisibleColumns().length}}\" class=\"sortable\" ng-class=\"{\n 'sort-asc': params.hasGroup($selGroup, 'asc'),\n 'sort-desc':params.hasGroup($selGroup, 'desc')\n }\">\n <a href=\"\" ng-click=\"isSelectorOpen = !isSelectorOpen\" class=\"ng-table-group-selector\">\n <strong class=\"sort-indicator\">{{$selGroupTitle}}</strong>\n <button class=\"btn btn-default btn-xs ng-table-group-close\"\n ng-click=\"$groupRow.show = false; $event.preventDefault(); $event.stopPropagation();\">\n <span class=\"glyphicon glyphicon-remove\"></span>\n </button>\n <button class=\"btn btn-default btn-xs ng-table-group-toggle\"\n ng-click=\"$ctrl.toggleDetail(); $event.preventDefault(); $event.stopPropagation();\">\n <span class=\"glyphicon\" ng-class=\"{\n 'glyphicon-resize-small': params.settings().groupOptions.isExpanded,\n 'glyphicon-resize-full': !params.settings().groupOptions.isExpanded\n }\"></span>\n </button>\n </a>\n <div class=\"list-group\" ng-if=\"isSelectorOpen\">\n <a href=\"\" class=\"list-group-item\" ng-repeat=\"group in $ctrl.getGroupables()\" ng-click=\"$ctrl.groupBy(group)\">\n <strong>{{ $ctrl.getGroupTitle(group)}}</strong>\n <strong ng-class=\"$ctrl.isSelectedGroup(group) && 'sort-indicator'\"></strong>\n </a>\n </div>\n </th>\n</tr>\n";
2733var angular = __webpack_require__(/*! angular */ 0);
2734angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2735module.exports = path;
2736
2737/***/ },
2738/* 48 */
2739/* unknown exports provided */
2740/* all exports used */
2741/*!*********************************!*\
2742 !*** ./src/browser/header.html ***!
2743 \*********************************/
2744/***/ function(module, exports, __webpack_require__) {
2745
2746var path = 'ng-table/header.html';
2747var html = "<ng-table-group-row></ng-table-group-row>\n<ng-table-sorter-row></ng-table-sorter-row>\n<ng-table-filter-row></ng-table-filter-row>\n";
2748var angular = __webpack_require__(/*! angular */ 0);
2749angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2750module.exports = path;
2751
2752/***/ },
2753/* 49 */
2754/* unknown exports provided */
2755/* all exports used */
2756/*!********************************!*\
2757 !*** ./src/browser/pager.html ***!
2758 \********************************/
2759/***/ function(module, exports, __webpack_require__) {
2760
2761var path = 'ng-table/pager.html';
2762var html = "<div class=\"ng-cloak ng-table-pager\" ng-if=\"params.data.length\">\n <div ng-if=\"params.settings().counts.length\" class=\"ng-table-counts btn-group pull-right\">\n <button ng-repeat=\"count in params.settings().counts\" type=\"button\"\n ng-class=\"{'active':params.count() == count}\"\n ng-click=\"params.count(count)\" class=\"btn btn-default\">\n <span ng-bind=\"count\"></span>\n </button>\n </div>\n <ul ng-if=\"pages.length\" class=\"pagination ng-table-pagination\">\n <li class=\"page-item\" ng-class=\"{'disabled': !page.active && !page.current, 'active': page.current}\" ng-repeat=\"page in pages\" ng-switch=\"page.type\">\n <a class=\"page-link\" ng-switch-when=\"prev\" ng-click=\"params.page(page.number)\" href=\"\">&laquo;</a>\n <a class=\"page-link\" ng-switch-when=\"first\" ng-click=\"params.page(page.number)\" href=\"\"><span ng-bind=\"page.number\"></span></a>\n <a class=\"page-link\" ng-switch-when=\"page\" ng-click=\"params.page(page.number)\" href=\"\"><span ng-bind=\"page.number\"></span></a>\n <a class=\"page-link\" ng-switch-when=\"more\" ng-click=\"params.page(page.number)\" href=\"\">&#8230;</a>\n <a class=\"page-link\" ng-switch-when=\"last\" ng-click=\"params.page(page.number)\" href=\"\"><span ng-bind=\"page.number\"></span></a>\n <a class=\"page-link\" ng-switch-when=\"next\" ng-click=\"params.page(page.number)\" href=\"\">&raquo;</a>\n </li>\n </ul>\n</div>\n";
2763var angular = __webpack_require__(/*! angular */ 0);
2764angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2765module.exports = path;
2766
2767/***/ },
2768/* 50 */
2769/* unknown exports provided */
2770/* all exports used */
2771/*!************************************!*\
2772 !*** ./src/browser/sorterRow.html ***!
2773 \************************************/
2774/***/ function(module, exports, __webpack_require__) {
2775
2776var path = 'ng-table/sorterRow.html';
2777var html = "<tr class=\"ng-table-sort-header\">\n <th title=\"{{$column.headerTitle(this)}}\"\n ng-repeat=\"$column in $columns\"\n ng-class=\"{\n 'sortable': $column.sortable(this),\n 'sort-asc': params.sorting()[$column.sortable(this)]=='asc',\n 'sort-desc': params.sorting()[$column.sortable(this)]=='desc'\n }\"\n ng-click=\"$ctrl.sortBy($column, $event)\"\n ng-if=\"$column.show(this)\"\n ng-init=\"template = $column.headerTemplateURL(this)\"\n class=\"header {{$column.class(this)}}\">\n <div ng-if=\"!template\" class=\"ng-table-header\" ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'div'}\">\n <span ng-bind=\"$column.title(this)\" ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'span'}\"></span>\n </div>\n <div ng-if=\"template\" ng-include=\"template\"></div>\n </th>\n</tr>\n";
2778var angular = __webpack_require__(/*! angular */ 0);
2779angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
2780module.exports = path;
2781
2782/***/ },
2783/* 51 */
2784/* unknown exports provided */
2785/* all exports used */
2786/*!******************!*\
2787 !*** ./index.ts ***!
2788 \******************/
2789/***/ function(module, exports, __webpack_require__) {
2790
2791"use strict";
2792"use strict";
2793function __export(m) {
2794 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
2795}
2796var ng1 = __webpack_require__(/*! angular */ 0);
2797var core_1 = __webpack_require__(/*! ./src/core */ 1);
2798var browser_1 = __webpack_require__(/*! ./src/browser */ 2);
2799var ngTableModule = ng1.module('ngTable', [core_1.ngTableCoreModule.name, browser_1.ngTableBrowserModule.name]);
2800exports.ngTableModule = ngTableModule;
2801__export(__webpack_require__(/*! ./src/core */ 1));
2802__export(__webpack_require__(/*! ./src/browser */ 2));
2803
2804
2805/***/ }
2806/******/ ]);
2807});
2808//# sourceMappingURL=ng-table.js.map
\No newline at end of file