Socket
Socket
Sign inDemoInstall

ng-table

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-table - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

src/shared/assign-partial-deep.d.ts

4

bundles/ng-table.min.js

@@ -1,3 +0,3 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("angular")):"function"==typeof define&&define.amd?define(["angular"],e):"object"==typeof exports?exports["ng-table"]=e(require("angular")):t["ng-table"]=e(t.angular)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=51)}([function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var a=n(0),i=n(3),s=n(37),o=n(7),l=n(10),u=n(9),c=n(8),p=a.module("ngTable-core",[]).provider("ngTableDefaultGetData",i.NgTableDefaultGetDataProvider).factory("ngTableDefaultGetGroups",s.ngTableDefaultGetGroups).value("ngTableDefaults",o.ngTableDefaults).service("ngTableEventsChannel",c.NgTableEventsChannel).service("ngTableSettings",l.NgTableSettings).run(u.NgTableParams.init);e.ngTableCoreModule=p,p.value("NgTableParams",u.NgTableParams);var g=n(7);e.IDefaults=g.IDefaults,r(n(8));var f=n(10);e.ISettings=f.ISettings,r(n(9)),r(n(3)),r(n(36)),r(n(39)),r(n(40)),r(n(41))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var a=n(0),i=n(13),s=n(14),o=n(15),l=n(16);e.NgTableController=l.NgTableController;var u=n(17),c=n(18);e.NgTableFilterConfigProvider=c.NgTableFilterConfigProvider,e.NgTableFilterConfig=c.NgTableFilterConfig;var p=n(19),g=n(20),f=n(21),h=n(22),m=n(23),d=n(24),b=n(25),v=n(26);n(43),n(45),n(44),n(46),n(49),n(48);var $=a.module("ngTable-browser",[]).directive("ngTable",i.ngTable).service("ngTableColumn",s.NgTableColumn).directive("ngTableColumnsBinding",o.ngTableColumnsBinding).controller("ngTableController",l.NgTableController).directive("ngTableDynamic",u.ngTableDynamic).provider("ngTableFilterConfig",c.NgTableFilterConfigProvider).directive("ngTableFilterRow",p.ngTableFilterRow).controller("ngTableFilterRowController",g.NgTableFilterRowController).directive("ngTableGroupRow",f.ngTableGroupRow).controller("ngTableGroupRowController",h.NgTableGroupRowController).directive("ngTablePagination",m.ngTablePagination).directive("ngTableSelectFilterDs",d.ngTableSelectFilterDs).directive("ngTableSorterRow",b.ngTableSorterRow).controller("ngTableSorterRowController",v.NgTableSorterRowController);e.ngTableBrowserModule=$,r(n(27))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(28)),r(n(29)),r(n(30)),r(n(31)),r(n(32))},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict";e.ngTableDefaults={params:{},settings:{}}},function(t,e,n){"use strict";var r=n(0),a=function(){function t(t){this.$rootScope=t;var e=this;e=this.addTableParamsEvent("afterCreated",e),e=this.addTableParamsEvent("afterReloadData",e),e=this.addTableParamsEvent("datasetChanged",e),e=this.addTableParamsEvent("pagesChanged",e),e=this.addTableParamsEvent("afterDataFiltered",e),e=this.addTableParamsEvent("afterDataSorted",e)}return t.prototype.addTableParamsEvent=function(t,e){var n=t.charAt(0).toUpperCase()+t.substring(1),a=(i={},i["on"+n]=this.createEventSubscriptionFn(t),i["publish"+n]=this.createPublishEventFn(t),i);return r.extend(e,a);var i},t.prototype.createPublishEventFn=function(t){var e=this;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];(a=e.$rootScope).$broadcast.apply(a,["ngTable:"+t].concat(n));var a}},t.prototype.createEventSubscriptionFn=function(t){function e(t){return t?n(t)?t:function(e){return e===t}:function(t){return!0}}function n(t){return"function"==typeof t}function r(t){return t&&"function"==typeof t.$new}var a=this;return function(n,i,s){var o,l=a.$rootScope;return r(i)?(l=i,o=e(s)):o=e(i),l.$on("ngTable:"+t,function(t,e){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];if(!e.isNullInstance){var i=[e].concat(r);o.apply(this,i)&&n.apply(this,i)}})}},t.$inject=["$rootScope"],t}();e.NgTableEventsChannel=a},function(t,e,n){"use strict";function r(t){return!isNaN(parseFloat(t))&&isFinite(t)}var a=n(0),i=n(11),s=function(){function t(e,n){var r=this;this.data=[],this.defaultSettings=t.ngTableSettings.createDefaults(),this.isCommittedDataset=!1,this.initialEvents=[],this._params={page:1,count:10,filter:{},sorting:{},group:{}},this._settings=this.defaultSettings,"boolean"==typeof e&&(this.isNullInstance=!0),this.reloadPages=function(){var e;return function(){var n=e,i=r.generatePagesArray(r.page(),r.total(),r.count());a.equals(n,i)||(e=i,t.ngTableEventsChannel.publishPagesChanged(r,i,n))}}(),a.extend(this._params,t.ngTableDefaults.params),this.settings(n),this.parameters(e,!0),t.ngTableEventsChannel.publishAfterCreated(this),a.forEach(this.initialEvents,function(t){t()}),this.initialEvents=null}return t.prototype.count=function(t){return void 0!==t?this.parameters({count:t,page:1}):this._params.count},t.prototype.filter=function(t){if(null!=t&&"object"==typeof t)return this.parameters({filter:t,page:1});if(t===!0){for(var e=Object.keys(this._params.filter),n={},r=0;r<e.length;r++){var a=this._params.filter[e[r]];null!=a&&""!==a&&(n[e[r]]=a)}return n}return this._params.filter},t.prototype.generatePagesArray=function(t,e,n,r){arguments.length||(t=this.page(),e=this.total(),n=this.count());var a,i,s,o;r=r&&r<6?6:r;var l=[];if(o=Math.ceil(e/n),o>1){l.push({type:"prev",number:Math.max(1,t-1),active:t>1}),l.push({type:"first",number:1,active:t>1,current:1===t}),i=Math.round((this._settings.paginationMaxBlocks-this._settings.paginationMinBlocks)/2),s=Math.max(2,t-i),a=Math.min(o-1,t+2*i-(t-s)),s=Math.max(2,s-(2*i-(a-s)));for(var u=s;u<=a;)u===s&&2!==u||u===a&&u!==o-1?l.push({type:"more",active:!1}):l.push({type:"page",number:u,active:t!==u,current:t===u}),u++;l.push({type:"last",number:o,active:t!==o,current:t===o}),l.push({type:"next",number:Math.min(o,t+1),active:t<o})}return l},t.prototype.group=function(t,e){if(void 0===t)return this._params.group;var n={page:1};return i.isGroupingFun(t)&&void 0!==e?(t.sortDirection=e,n.group=t):"string"==typeof t&&void 0!==e?n.group=(r={},r[t]=e,r):n.group=t,this.parameters(n),this;var r},t.prototype.hasErrorState=function(){return!(!this.errParamsMemento||!a.equals(this.errParamsMemento,this.createComparableParams()))},t.prototype.hasFilter=function(){return Object.keys(this.filter(!0)).length>0},t.prototype.hasFilterChanges=function(){var t=this.prevParamsMemento&&this.prevParamsMemento.params.filter;return!a.equals(this._params.filter,t)||this.hasGlobalSearchFieldChanges()},t.prototype.hasGroup=function(t,e){return null==t?i.isGroupingFun(this._params.group)||Object.keys(this._params.group).length>0:i.isGroupingFun(t)?null==e?this._params.group===t:this._params.group===t&&t.sortDirection===e:null==e?Object.keys(this._params.group).indexOf(t)!==-1:this._params.group[t]===e},t.prototype.isDataReloadRequired=function(){return!this.isCommittedDataset||!a.equals(this.createComparableParams(),this.prevParamsMemento)||this.hasGlobalSearchFieldChanges()},t.prototype.isSortBy=function(t,e){return void 0!==e?void 0!==this._params.sorting[t]&&this._params.sorting[t]==e:void 0!==this._params.sorting[t]},t.prototype.orderBy=function(){return i.convertSortToOrderBy(this._params.sorting)},t.prototype.page=function(t){return void 0!==t?this.parameters({page:t}):this._params.page},t.prototype.parameters=function(t,e){if(e=e||!1,void 0!==typeof t){for(var n in t){var i=t[n];if(e&&n.indexOf("[")>=0){for(var s=n.split(/\[(.*)\]/).reverse(),o="",l=0,u=s.length;l<u;l++){var c=s[l];if(""!==c){var p=i;i={},i[o=c]=r(p)?parseFloat(p):p}}"sorting"===o&&(this._params[o]={}),this._params[o]=a.extend(this._params[o]||{},i[o])}else"group"===n?this._params[n]=this.parseGroup(t[n]):this._params[n]=r(t[n])?parseFloat(t[n]):t[n]}return this.log("ngTable: set parameters",this._params),this}return this._params},t.prototype.reload=function(){var e=this,n=null;if(this._settings.$loading=!0,this.prevParamsMemento=a.copy(this.createComparableParams()),this.isCommittedDataset=!0,this.hasGroup())n=this.runInterceptorPipeline(t.$q.when(this._settings.getGroups(this)));else{var r=this._settings.getData;n=this.runInterceptorPipeline(t.$q.when(r(this)))}this.log("ngTable: reload data");var i=this.data;return n.then(function(n){return e._settings.$loading=!1,e.errParamsMemento=null,e.data=n,t.ngTableEventsChannel.publishAfterReloadData(e,n,i),e.reloadPages(),n}).catch(function(n){return e.errParamsMemento=e.prevParamsMemento,t.$q.reject(n)})},t.prototype.settings=function(e){var n=this;if(a.isDefined(e)){var r=t.ngTableSettings.merge(this._settings,e),i=this._settings.dataset;this._settings=r;var s=e.hasOwnProperty("dataset")&&e.dataset!=i;if(s){this.isCommittedDataset&&this.page(1),this.isCommittedDataset=!1;var o=function(){t.ngTableEventsChannel.publishDatasetChanged(n,e.dataset,i)};this.initialEvents?this.initialEvents.push(o):o()}return this.log("ngTable: set settings",this._settings),this}return this._settings},t.prototype.sorting=function(t,e){return"string"==typeof t?(this.parameters({sorting:(n={},n[t]=e,n)}),this):void 0!==t?this.parameters({sorting:t}):this._params.sorting;var n},t.prototype.total=function(t){return void 0!==t?this.settings({total:t}):this._settings.total},t.prototype.url=function(t){function e(t,e){n(i)?i.push(e+"="+encodeURIComponent(t)):i[e]=encodeURIComponent(t)}function n(e){return t}function r(t,e){return"group"===e||void 0!==typeof t&&""!==t}t=t||!1;var i=t?[]:{};for(var s in this._params)if(this._params.hasOwnProperty(s)){var o=this._params[s],l=encodeURIComponent(s);if("object"==typeof o){for(var u in o)if(r(o[u],s)){var c=l+"["+encodeURIComponent(u)+"]";e(o[u],c)}}else!a.isFunction(o)&&r(o,s)&&e(o,l)}return i},t.prototype.createComparableParams=function(){var t=this._params.group;return{params:this._params,groupSortDirection:i.isGroupingFun(t)?t.sortDirection:void 0}},t.prototype.hasGlobalSearchFieldChanges=function(){var t=this._params.filter&&this._params.filter.$,e=this.prevParamsMemento&&this.prevParamsMemento.params.filter&&this.prevParamsMemento.params.filter.$;return!a.equals(t,e)},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];this._settings.debugMode&&t.$log.debug&&(r=t.$log).debug.apply(r,e);var r},t.prototype.parseGroup=function(t){var e=this._settings.groupOptions&&this._settings.groupOptions.defaultSort;if(t){if(i.isGroupingFun(t))return null==t.sortDirection&&(t.sortDirection=e),t;if("object"==typeof t){for(var n in t)null==t[n]&&(t[n]=e);return t}return r={},r[t]=e,r}return t;var r},t.prototype.runInterceptorPipeline=function(e){var n=this,r=this._settings.interceptors||[];return r.reduce(function(e,r){var a=r.response&&r.response.bind(r)||t.$q.when,i=r.responseError&&r.responseError.bind(r)||t.$q.reject;return e.then(function(t){return a(t,n)},function(t){return i(t,n)})},e)},t.init=function(e,n,r,a,i){t.$q=e,t.$log=n,t.ngTableDefaults=r,t.ngTableEventsChannel=a,t.ngTableSettings=i},t}();e.NgTableParams=s,s.init.$inject=["$q","$log","ngTableDefaults","ngTableEventsChannel","ngTableSettings"]},function(t,e,n){"use strict";var r=n(0),a=function(){function t(t,e,n){var r=this;this.ngTableDefaults=t,this.ngTableDefaultGetData=e,this.ngTableDefaultGetGroups=n,this.defaults={$loading:!1,dataset:null,total:0,defaultSort:"desc",counts:[10,25,50,100],filterOptions:{filterComparator:void 0,filterDelay:500,filterDelayThreshold:1e4,filterFilterName:void 0,filterFn:void 0,filterLayout:"stack"},getData:function(t){return r.ngTableDefaultGetData(t.settings().dataset,t)},getGroups:this.ngTableDefaultGetGroups,groupOptions:{defaultSort:"asc",isExpanded:!0},interceptors:[],paginationMaxBlocks:11,paginationMinBlocks:5,sortingIndicator:"span"}}return t.prototype.createDefaults=function(){return this.merge(this.defaults,this.ngTableDefaults.settings)},t.prototype.merge=function(t,e){e=r.extend({},e),e.filterOptions&&(e.filterOptions=r.extend({},t.filterOptions||{},e.filterOptions)),e.groupOptions&&(e.groupOptions=r.extend({},t.groupOptions||{},e.groupOptions)),r.isArray(e.dataset)&&(e.total=e.dataset.length);var n=r.extend({},t,e);return r.isArray(e.dataset)&&this.optimizeFilterDelay(n),r.extend({},t,e)},t.prototype.optimizeFilterDelay=function(t){t.filterOptions.filterDelay===this.defaults.filterOptions.filterDelay&&t.total<=t.filterOptions.filterDelayThreshold&&t.getData===this.defaults.getData&&(t.filterOptions.filterDelay=0)},t.$inject=["ngTableDefaults","ngTableDefaultGetData","ngTableDefaultGetGroups"],t}();e.NgTableSettings=a},function(t,e){"use strict";function n(t){var e=[];for(var n in t)e.push(("asc"===t[n]?"+":"-")+n);return e}function r(t){return"function"==typeof t}e.convertSortToOrderBy=n,e.isGroupingFun=r},,function(t,e,n){"use strict";function r(t,e){return{restrict:"A",priority:1001,scope:!0,controller:"ngTableController",compile:function(t){var n,r,i=[],s=0,o=[];if(a.forEach(t.find("tr"),function(t){o.push(a.element(t))}),n=o.filter(function(t){return!t.hasClass("ng-table-group")})[0],r=o.filter(function(t){return t.hasClass("ng-table-group")})[0],n)return a.forEach(n.find("td"),function(t){var n=a.element(t);if(!n.attr("ignore-cell")||"true"!==n.attr("ignore-cell")){var o=function(t){return n.attr("x-data-"+t)||n.attr("data-"+t)||n.attr(t)},l=function(t,e){n.attr("x-data-"+t)?n.attr("x-data-"+t,e):n.attr("data"+t)?n.attr("data"+t,e):n.attr(t,e)},u=function(t){var n=o(t);if(n){var r,a=function(t){return void 0!==r?r:e(n)(t)};return a.assign=function(t,a){var i=e(n);i.assign?i.assign(t.$parent,a):r=a},a}},c=o("title-alt")||o("title");c&&n.attr("data-title-text","{{"+c+"}}"),i.push({id:s++,title:u("title"),titleAlt:u("title-alt"),headerTitle:u("header-title"),sortable:u("sortable"),class:u("header-class"),filter:u("filter"),groupable:u("groupable"),headerTemplateURL:u("header"),filterData:u("filter-data"),show:n.attr("ng-if")?u("ng-if"):void 0}),(r||n.attr("ng-if"))&&l("ng-if","$columns["+(i.length-1)+"].show(this)")}}),function(t,e,n,r){t.$columns=i=r.buildColumns(i),r.setupBindingsToInternalScope(n.ngTable),r.loadFilterData(i),r.compileDirectiveTemplates()}}}}var a=n(0);r.$inject=["$q","$parse"],e.ngTable=r},function(t,e,n){"use strict";function r(t){return null!=t&&a.isFunction(t.$new)}var a=n(0),i=function(){function t(){}return t.prototype.buildColumn=function(t,e,n){var i=Object.create(t),s=this.createDefaults(),o=function(o){if(void 0===i[o]&&(i[o]=s[o]),!a.isFunction(i[o])){var l=function e(){return 1!==arguments.length||r(arguments[0])?t[o]:void e.assign(null,arguments[0])};l.assign=function(e,n){t[o]=n},i[o]=l}var u=i[o];if(i[o]=function(){if(1!==arguments.length||r(arguments[0])){var s=arguments[0]||e,o=Object.create(s);return a.extend(o,{$column:i,$columns:n}),u.call(t,o)}u.assign(e,arguments[0])},u.assign)i[o].assign=u.assign;else{var c,p=i[o],l=function t(){return 1!==arguments.length||r(arguments[0])?void 0!=c?c:p.apply(i,arguments):void t.assign(null,arguments[0])};l.assign=function(t,e){c=e},i[o]=l}};for(var l in s)o(l);return i},t.prototype.createDefaults=function(){return{class:this.createGetterSetter(""),filter:this.createGetterSetter(!1),groupable:this.createGetterSetter(!1),filterData:a.noop,headerTemplateURL:this.createGetterSetter(!1),headerTitle:this.createGetterSetter(""),sortable:this.createGetterSetter(!1),show:this.createGetterSetter(!0),title:this.createGetterSetter(""),titleAlt:this.createGetterSetter("")}},t.prototype.createGetterSetter=function(t){var e=t,n=function t(){return 1!==arguments.length||r(arguments[0])?e:void t.assign(null,arguments[0])};return n.assign=function(t,n){e=n},n},t.$inject=[],t}();e.NgTableColumn=i},function(t,e){"use strict";function n(t){function e(e,n,r){var a=t(r.ngTableColumnsBinding).assign;a&&e.$watch("$columns",function(t){var n=(t||[]).slice(0);a(e,n)})}var n={restrict:"A",link:e};return n}n.$inject=["$parse"],e.ngTableColumnsBinding=n},function(t,e,n){"use strict";var r=n(0),a=n(1),i=function(){function t(t,e,n,r,i,s,o,l,u){this.$scope=t,this.$parse=n,this.$compile=r,this.$attrs=i,this.$element=s,this.$document=o,this.ngTableColumn=l,this.ngTableEventsChannel=u;t.$filterRow={disabled:!1},t.$loading=!1,t.hasOwnProperty("params")||(t.params=new a.NgTableParams(!0)),this.delayFilter=function(){var t;return function(n,r){e.cancel(t),t=e(n,r)}}(),this.$scope.$watch("params",function(t,e){t!==e&&t&&t.reload()},!1),this.subscribeToTableEvents()}return Object.defineProperty(t.prototype,"hasVisibleFilterColumn",{get:function(){var t=this;return!!this.$scope.$columns&&this.some(this.$scope.$columns,function(e){return e.show(t.$scope)&&!!e.filter(t.$scope)})},enumerable:!0,configurable:!0}),t.prototype.onDataReloadStatusChange=function(t){if(t&&!this.$scope.params.hasErrorState()){var e=this.$scope.params,n=e.settings().filterOptions;if(e.hasFilterChanges()){var r=function(){e.page(1),e.reload()};n.filterDelay?this.delayFilter(r,n.filterDelay):r()}else e.reload()}},t.prototype.compileDirectiveTemplates=function(){if(!this.$element.hasClass("ng-table")){this.$scope.templates={header:this.$attrs.templateHeader?this.$attrs.templateHeader:"ng-table/header.html",pagination:this.$attrs.templatePagination?this.$attrs.templatePagination:"ng-table/pager.html"},this.$element.addClass("ng-table");var t=null,e=!1;r.forEach(this.$element.children(),function(t){"THEAD"===t.tagName&&(e=!0)}),e||(t=r.element('<thead ng-include="templates.header"></thead>',this.$document),this.$element.prepend(t));var n=r.element('<div ng-table-pagination="params" template-url="templates.pagination"></div>',this.$document);this.$element.after(n),t&&this.$compile(t)(this.$scope),this.$compile(n)(this.$scope)}},t.prototype.loadFilterData=function(t){function e(t){return t&&"object"==typeof t&&"function"==typeof t.then}var n=this;r.forEach(t,function(t){var a=t.filterData(n.$scope);return a?e(a)?(delete t.filterData,a.then(function(e){r.isArray(e)||r.isFunction(e)||r.isObject(e)||(e=[]),t.data=e})):t.data=a:void delete t.filterData})},t.prototype.buildColumns=function(t){var e=this,n=[];return(t||[]).forEach(function(t){n.push(e.ngTableColumn.buildColumn(t,e.$scope,n))}),n},t.prototype.parseNgTableDynamicExpr=function(t){if(!t||t.indexOf(" with ")>-1){var e=t.split(/\s+with\s+/);return{tableParams:e[0],columns:e[1]}}throw new Error("Parse error (expected example: ng-table-dynamic='tableParams with cols')")},t.prototype.setupBindingsToInternalScope=function(t){var e=this;this.$scope.$watch(t,function(t){void 0!==t&&(e.$scope.params=t)},!1),this.setupFilterRowBindingsToInternalScope(),this.setupGroupRowBindingsToInternalScope()},t.prototype.setupFilterRowBindingsToInternalScope=function(){var t=this;this.$attrs.showFilter?this.$scope.$parent.$watch(this.$attrs.showFilter,function(e){t.$scope.show_filter=e}):this.$scope.$watch(function(){return t.hasVisibleFilterColumn},function(e){t.$scope.show_filter=e}),this.$attrs.disableFilter&&this.$scope.$parent.$watch(this.$attrs.disableFilter,function(e){t.$scope.$filterRow.disabled=e})},t.prototype.setupGroupRowBindingsToInternalScope=function(){var t=this;if(this.$scope.$groupRow={show:!1},this.$attrs.showGroup){var e=this.$parse(this.$attrs.showGroup);this.$scope.$parent.$watch(e,function(e){t.$scope.$groupRow.show=e}),e.assign&&this.$scope.$watch("$groupRow.show",function(n){e.assign(t.$scope.$parent,n)})}else this.$scope.$watch("params.hasGroup()",function(e){t.$scope.$groupRow.show=e})},t.prototype.getVisibleColumns=function(){var t=this;return(this.$scope.$columns||[]).filter(function(e){return e.show(t.$scope)})},t.prototype.subscribeToTableEvents=function(){var t=this;this.$scope.$watch("params.isDataReloadRequired()",function(e){t.onDataReloadStatusChange(e)}),this.ngTableEventsChannel.onAfterReloadData(function(e,n){var r=t.getVisibleColumns();e.hasGroup()?(t.$scope.$groups=n||[],t.$scope.$groups.visibleColumnCount=r.length):(t.$scope.$data=n||[],t.$scope.$data.visibleColumnCount=r.length)},this.$scope,function(e){return t.$scope.params===e}),this.ngTableEventsChannel.onPagesChanged(function(e,n){t.$scope.pages=n},this.$scope,function(e){return t.$scope.params===e})},t.prototype.some=function(t,e){for(var n=!1,r=0;r<t.length;r++){var a=t[r];if(e(a)){n=!0;break}}return n},t.$inject=["$scope","$timeout","$parse","$compile","$attrs","$element","$document","ngTableColumn","ngTableEventsChannel"],t}();e.NgTableController=i},function(t,e,n){"use strict";function r(){return{restrict:"A",priority:1001,scope:!0,controller:"ngTableController",compile:function(t){var e;if(a.forEach(t.find("tr"),function(t){t=a.element(t),t.hasClass("ng-table-group")||e||(e=t)}),e)return a.forEach(e.find("td"),function(t){var e=a.element(t),n=function(t){return e.attr("x-data-"+t)||e.attr("data-"+t)||e.attr(t)},r=n("title");r||e.attr("data-title-text","{{$columns[$index].titleAlt(this) || $columns[$index].title(this)}}");var i=e.attr("ng-if");i||e.attr("ng-if","$columns[$index].show(this)")}),function(t,e,n,r){var a=r.parseNgTableDynamicExpr(n.ngTableDynamic);r.setupBindingsToInternalScope(a.tableParams),r.compileDirectiveTemplates(),t.$watchCollection(a.columns,function(e){t.$columns=r.buildColumns(e),r.loadFilterData(t.$columns)})}}}}var a=n(0);r.$inject=[],e.ngTableDynamic=r},function(t,e,n){"use strict";var r=n(0),a=function(){function t(t){var e=this;this.defaultConfig={defaultBaseUrl:"ng-table/filters/",defaultExt:".html",aliasUrls:{}},this.$get=function(){return t.instantiate(i,{config:r.copy(e.config)})},this.$get.$inject=[],this.resetConfigs()}return t.prototype.resetConfigs=function(){this.config=this.defaultConfig},t.prototype.setConfig=function(t){var e=r.extend({},this.config,t);e.aliasUrls=r.extend({},this.config.aliasUrls,t.aliasUrls),this.config=e},t.$inject=["$injector"],t}();e.NgTableFilterConfigProvider=a;var i=function(){function t(t){this.config=t}return t.prototype.getUrlForAlias=function(t,e){return this.config.aliasUrls[t]||this.config.defaultBaseUrl+t+this.config.defaultExt},t.prototype.getTemplateUrl=function(t,e){var n;return n="string"!=typeof t?t.id:t,n.indexOf("/")!==-1?n:this.getUrlForAlias(n,e)},t.$inject=["config"],t}();e.NgTableFilterConfig=i},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:a,scope:!0,controller:"ngTableFilterRowController",controllerAs:"$ctrl"};return t}var a=n(42);r.$inject=[],e.ngTableFilterRow=r},function(t,e){"use strict";var n=function(){function t(t,e){this.config=e,t.getFilterPlaceholderValue=this.getFilterPlaceholderValue.bind(this)}return t.prototype.getFilterCellCss=function(t,e){if("horizontal"!==e)return"s12";var n=Object.keys(t).length,r=parseInt((12/n).toString(),10);return"s"+r},t.prototype.getFilterPlaceholderValue=function(t,e){return"string"==typeof t?"":t.placeholder},t.$inject=["$scope","ngTableFilterConfig"],t}();e.NgTableFilterRowController=n},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:a,scope:!0,controller:"ngTableGroupRowController",controllerAs:"$ctrl"};return t}var a=n(47);r.$inject=[],e.ngTableGroupRow=r},function(t,e){"use strict";var n=function(){function t(t){var e=this;this.$scope=t,this.groupFns=[],t.$watch("params.group()",function(t){e.setGroup(t)},!0)}return t.prototype.getGroupables=function(){var t=this,e=this.$scope.$columns.filter(function(e){return!!e.groupable(t.$scope)});return this.groupFns.concat(e)},t.prototype.getGroupTitle=function(t){return this.isGroupingFunc(t)?t.title:t.title(this.$scope)},t.prototype.getVisibleColumns=function(){var t=this;return this.$scope.$columns.filter(function(e){return e.show(t.$scope)})},t.prototype.groupBy=function(t){this.isSelectedGroup(t)?this.changeSortDirection():this.isGroupingFunc(t)?this.$scope.params.group(t):this.$scope.params.group(t.groupable(this.$scope))},t.prototype.isSelectedGroup=function(t){return this.isGroupingFunc(t)?t===this.$scope.$selGroup:t.groupable(this.$scope)===this.$scope.$selGroup},t.prototype.toggleDetail=function(){return this.$scope.params.settings().groupOptions.isExpanded=!this.$scope.params.settings().groupOptions.isExpanded,this.$scope.params.reload()},t.prototype.changeSortDirection=function(){var t;t=this.$scope.params.hasGroup(this.$scope.$selGroup,"asc")?"desc":this.$scope.params.hasGroup(this.$scope.$selGroup,"desc")?"":"asc",this.$scope.params.group(this.$scope.$selGroup,t)},t.prototype.findGroupColumn=function(t){var e=this;return this.$scope.$columns.filter(function(n){return n.groupable(e.$scope)===t})[0]},t.prototype.isGroupingFunc=function(t){return"function"==typeof t},t.prototype.setGroup=function(t){var e=this.findGroupColumn(this.$scope.$selGroup);if(e&&e.show.assign&&e.show.assign(this.$scope,!0),this.isGroupingFunc(t))this.groupFns=[t],this.$scope.$selGroup=t,this.$scope.$selGroupTitle=t.title;else{var n=Object.keys(t||{})[0],r=this.findGroupColumn(n);r&&(this.$scope.$selGroupTitle=r.title(this.$scope),this.$scope.$selGroup=n,r.show.assign&&r.show.assign(this.$scope,!1))}},t.$inject=["$scope"],t}();e.NgTableGroupRowController=n},function(t,e,n){"use strict";function r(t,e,n){return{restrict:"A",scope:{params:"=ngTablePagination",templateUrl:"="},replace:!1,link:function(r,i){n.onAfterReloadData(function(t){r.pages=t.generatePagesArray()},r,function(t){return t===r.params}),r.$watch("templateUrl",function(n){if(void 0!==n){var s=a.element('<div ng-include="templateUrl"></div>',e);i.append(s),t(s)(r)}})}}}var a=n(0);r.$inject=["$compile","$document","ngTableEventsChannel"],e.ngTablePagination=r},function(t,e){"use strict";function n(){var t={restrict:"A",controller:r};return t}n.$inject=[],e.ngTableSelectFilterDs=n;var r=function(){function t(t,e,n,r){var a=this;this.$scope=t,this.$attrs=n,this.$q=r,this.$column=e(n.ngTableSelectFilterDs)(t),t.$watch(function(){return a.$column&&a.$column.data},function(){a.bindDataSource()})}return t.prototype.bindDataSource=function(){var t=this;this.getSelectListData(this.$column).then(function(e){e&&!t.hasEmptyOption(e)&&e.unshift({id:"",title:""}),e=e||[],t.$scope.$selectData=e})},t.prototype.hasEmptyOption=function(t){for(var e,n=0;n<t.length;n++){var r=t[n];if(r&&""===r.id){e=!0;break}}return e},t.prototype.getSelectListData=function(t){var e=t.data;return e instanceof Array?this.$q.when(e):this.$q.when(e&&e())},t.$inject=["$scope","$parse","$attrs","$q"],t}();e.NgTableSelectFilterDsController=r},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:a,scope:!0,controller:"ngTableSorterRowController",controllerAs:"$ctrl"};return t}var a=n(50);r.$inject=[],e.ngTableSorterRow=r},function(t,e){"use strict";var n=function(){function t(t){this.$scope=t}return t.prototype.sortBy=function(t,e){var n=t.sortable&&t.sortable();if(n&&"string"==typeof n){var r=this.$scope.params.settings().defaultSort,a="asc"===r?"desc":"asc",i=this.$scope.params.sorting()&&this.$scope.params.sorting()[n]&&this.$scope.params.sorting()[n]===r,s=e.ctrlKey||e.metaKey?this.$scope.params.sorting():{};s[n]=i?a:r,this.$scope.params.parameters({sorting:s})}},t.$inject=["$scope"],t}();e.NgTableSorterRowController=n},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e,n){"use strict";var r=n(0),a=function(){function t(){function t(t,n){function a(n){var a=n.settings().filterOptions;return r.isFunction(a.filterFn)?a.filterFn:t(a.filterFilterName||e.filterFilterName)}function i(n){return t(e.sortingFilterName)}function s(t,e){if(!e.hasFilter())return t;var n=e.filter(!0),r=Object.keys(n),i=r.reduce(function(t,e){return t=c(t,n[e],e)},{}),s=a(e);return s.call(e,t,i,e.settings().filterOptions.filterComparator)}function o(t,e){var n=t.slice((e.page()-1)*e.count(),e.page()*e.count());return e.total(t.length),n}function l(t,e){var n=e.orderBy(),r=i(e);return n.length?r(t,n):t}function u(t,e){if(null==t)return[];var a=r.extend({},p,e.settings().dataOptions),i=a.applyFilter?s(t,e):t;n.publishAfterDataFiltered(e,i);var u=a.applySort?l(i,e):i;return n.publishAfterDataSorted(e,u),a.applyPaging?o(u,e):u}function c(t,e,n){var r=n.split("."),a=t,i=r[r.length-1],s=a,o=r.slice(0,r.length-1);return o.forEach(function(t){s.hasOwnProperty(t)||(s[t]={}),s=s[t]}),s[i]=e,a}var p={applyFilter:!0,applySort:!0,applyPaging:!0};return u.applyPaging=o,u.getFilterFn=a,u.getOrderByFn=i,u}this.filterFilterName="filter",this.sortingFilterName="orderBy";var e=this;this.$get=t,t.$inject=["$filter","ngTableEventsChannel"]}return t}();e.NgTableDefaultGetDataProvider=a},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(33)),r(n(34)),r(n(35))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(4)),r(n(6)),r(n(5)),r(n(38))},function(t,e,n){"use strict";function r(t,e){function n(n){var r,o=n.group(),l=void 0;if(s.isGroupingFun(o))r=o,l=o.sortDirection;else{var u=Object.keys(o)[0];l=o[u],r=function(t){return a(t,u)}}var c=n.settings(),p=c.dataOptions;c.dataOptions={applyPaging:!1};var g=c.getData,f=t.when(g(n));return f.then(function(t){var a={};i.forEach(t,function(t){var e=r(t);a[e]=a[e]||{data:[],$hideRows:!c.groupOptions.isExpanded,value:e},a[e].data.push(t)});var o=[];for(var u in a)o.push(a[u]);if(l){var p=e.getOrderByFn(),g=s.convertSortToOrderBy({value:l});o=p(o,g)}return e.applyPaging(o,n)}).finally(function(){c.dataOptions=p})}return n}function a(t,e){var n;if(n="string"==typeof e?e.split("."):e,void 0!==t){if(0===n.length)return t;if(null!==t)return a(t[n[0]],n.slice(1))}}var i=n(0),s=n(11);r.$inject=["$q","ngTableDefaultGetData"],e.ngTableDefaultGetGroups=r},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(4)),r(n(6)),r(n(5))},function(t,e){"use strict"},function(t,e){"use strict"},function(t,e,n){var r="ng-table/filterRow.html",a='<tr ng-show=show_filter class=ng-table-filters> <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)}}" ng-class="params.settings().filterOptions.filterLayout === \'horizontal\' ? \'filter-horizontal\' : \'\'"> <div ng-repeat="(name, filter) in $column.filter(this)" ng-include=$ctrl.config.getTemplateUrl(filter) class=filter-cell ng-class="[$ctrl.getFilterCellCss($column.filter(this), params.settings().filterOptions.filterLayout), $last ? \'last\' : \'\']"> </div> </th> </tr> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/number.html",a='<input type=number name={{name}} ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/select-multiple.html",a='<select ng-options="data.id as data.title for data in $column.data" ng-disabled=$filterRow.disabled multiple=multiple ng-multiple=true ng-model=params.filter()[name] class="filter filter-select-multiple form-control" name={{name}}> </select> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/select.html",a='<select ng-options="data.id as data.title for data in $selectData" ng-table-select-filter-ds=$column ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="filter filter-select form-control" name={{name}}> <option style=display:none value=""></option> </select> ',i=n(0);i.module("ng").run(["$templateCache",function(t){
t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/text.html",a='<input type=text name={{name}} ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/groupRow.html",a='<tr ng-if=params.hasGroup() ng-show=$groupRow.show class=ng-table-group-header> <th colspan={{$ctrl.getVisibleColumns().length}} class=sortable ng-class="{\n \'sort-asc\': params.hasGroup($selGroup, \'asc\'),\n \'sort-desc\':params.hasGroup($selGroup, \'desc\')\n }"> <a href="" ng-click="isSelectorOpen = !isSelectorOpen" class=ng-table-group-selector> <strong class=sort-indicator>{{$selGroupTitle}}</strong> <button class="btn btn-default btn-xs ng-table-group-close" ng-click="$groupRow.show = false; $event.preventDefault(); $event.stopPropagation();"> <span class="glyphicon glyphicon-remove"></span> </button> <button class="btn btn-default btn-xs ng-table-group-toggle" ng-click="$ctrl.toggleDetail(); $event.preventDefault(); $event.stopPropagation();"> <span class=glyphicon ng-class="{\n \'glyphicon-resize-small\': params.settings().groupOptions.isExpanded,\n \'glyphicon-resize-full\': !params.settings().groupOptions.isExpanded\n }"></span> </button> </a> <div class=list-group ng-if=isSelectorOpen> <a href="" class=list-group-item ng-repeat="group in $ctrl.getGroupables()" ng-click=$ctrl.groupBy(group)> <strong>{{ $ctrl.getGroupTitle(group)}}</strong> <strong ng-class="$ctrl.isSelectedGroup(group) && \'sort-indicator\'"></strong> </a> </div> </th> </tr> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/header.html",a="<ng-table-group-row></ng-table-group-row> <ng-table-sorter-row></ng-table-sorter-row> <ng-table-filter-row></ng-table-filter-row> ",i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/pager.html",a='<div class="ng-cloak ng-table-pager" ng-if=params.data.length> <div ng-if=params.settings().counts.length class="ng-table-counts btn-group pull-right"> <button ng-repeat="count in params.settings().counts" type=button ng-class="{\'active\':params.count() == count}" ng-click=params.count(count) class="btn btn-default"> <span ng-bind=count></span> </button> </div> <ul ng-if=pages.length class="pagination ng-table-pagination"> <li class=page-item ng-class="{\'disabled\': !page.active && !page.current, \'active\': page.current}" ng-repeat="page in pages" ng-switch=page.type> <a class=page-link ng-switch-when=prev ng-click=params.page(page.number) href="">&laquo;</a> <a class=page-link ng-switch-when=first ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=page ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=more ng-click=params.page(page.number) href="">&#8230;</a> <a class=page-link ng-switch-when=last ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=next ng-click=params.page(page.number) href="">&raquo;</a> </li> </ul> </div> ',i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){var r="ng-table/sorterRow.html",a="<tr class=ng-table-sort-header> <th title={{$column.headerTitle(this)}} ng-repeat=\"$column in $columns\" 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 }\" ng-click=\"$ctrl.sortBy($column, $event)\" ng-if=$column.show(this) ng-init=\"template = $column.headerTemplateURL(this)\" class=\"header {{$column.class(this)}}\"> <div ng-if=!template class=ng-table-header ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'div'}\"> <span ng-bind=$column.title(this) ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'span'}\"></span> </div> <div ng-if=template ng-include=template></div> </th> </tr> ",i=n(0);i.module("ng").run(["$templateCache",function(t){t.put(r,a)}]),t.exports=r},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var a=n(0),i=n(1),s=n(2),o=a.module("ngTable",[i.ngTableCoreModule.name,s.ngTableBrowserModule.name]);e.ngTableModule=o,r(n(1)),r(n(2))}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("angular")):"function"==typeof define&&define.amd?define(["angular"],e):"object"==typeof exports?exports["ng-table"]=e(require("angular")):t["ng-table"]=e(t.angular)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=44)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(3)),a=n(8),s=n(32),o=n(11),l=n(10),u=n(9);n.d(e,"d",function(){return u.a}),n.d(e,"c",function(){return o.a}),n.d(e,"a",function(){return l.a}),n.d(e,"e",function(){return l.b}),n.d(e,"f",function(){return i.a}),n.d(e,"g",function(){return i.b});var c=n(6);n.d(e,"h",function(){return c.a});var p=n(31);n.d(e,"i",function(){return p.a}),n.d(e,"b",function(){return f});var f=r.module("ngTable-core",[]).provider("ngTableDefaultGetData",i.b).factory("ngTableDefaultGetGroups",a.b).value("ngTableDefaults",s.a).service("ngTableEventsChannel",u.a).run(o.a.init).run(l.a.init);f.value("NgTableParams",l.a)},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(14)),a=n(15),s=n(16),o=n(17),l=n(18),u=n(5),c=n(19),p=n(20),f=n(21),h=n(22),g=n(23),d=n(24),m=n(25),v=n(26),$=n(36),b=(n.n($),n(38)),y=(n.n(b),n(37)),w=(n.n(y),n(39)),T=(n.n(w),n(42)),C=(n.n(T),n(41));n.n(C);n.d(e,"b",function(){return o.a}),n.d(e,"c",function(){return u.b}),n.d(e,"d",function(){return u.a}),n.d(e,"e",function(){return u.c}),n.d(e,"a",function(){return D});var D=r.module("ngTable-browser",[]).directive("ngTable",i.a).service("ngTableColumn",a.a).directive("ngTableColumnsBinding",s.a).controller("ngTableController",o.a).directive("ngTableDynamic",l.a).provider("ngTableFilterConfig",u.a).directive("ngTableFilterRow",c.a).controller("ngTableFilterRowController",p.a).directive("ngTableGroupRow",f.a).controller("ngTableGroupRowController",h.a).directive("ngTablePagination",g.a).directive("ngTableSelectFilterDs",d.a).directive("ngTableSorterRow",m.a).controller("ngTableSorterRowController",v.a)},function(t,e,n){"use strict";var r=n(27);n.d(e,"a",function(){return r.a});var i=n(28);n.d(e,"b",function(){return i.a})},function(t,e,n){"use strict";var r=n(33);n.d(e,"b",function(){return r.a});var i=n(34);n.d(e,"a",function(){return i.a})},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(4));n.d(e,"b",function(){return a}),n.d(e,"a",function(){return s}),n.d(e,"c",function(){return o});var a=function(){function t(){this.defaultBaseUrl="ng-table/filters/",this.defaultExt=".html",this.aliasUrls={}}return t}(),s=function(){function t(t){var e=this;this.$get=function(){return t.instantiate(o,{config:r.copy(e.config)})},this.$get.$inject=[],this.resetConfigs()}return t.prototype.resetConfigs=function(){this.config=new a},t.prototype.setConfig=function(t){this.config=n.i(i.b)(r.copy(this.config),t)},t}();s.$inject=["$injector"];var o=function(){function t(t){this.config=t}return t.prototype.getUrlForAlias=function(t,e){return this.config.aliasUrls[t]||this.config.defaultBaseUrl+t+this.config.defaultExt},t.prototype.getTemplateUrl=function(t,e){var n;return n="string"!=typeof t?t.id:t,n.indexOf("/")!==-1?n:this.getUrlForAlias(n,e)},t}();o.$inject=["config"]},function(t,e,n){"use strict";var r=n(29);n.d(e,"a",function(){return r.a})},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){this.defaultSort="asc",this.isExpanded=!0}return t}()},function(t,e,n){"use strict";var r=n(7);n.d(e,"a",function(){return r.a});var i=n(30);n.d(e,"b",function(){return i.a})},function(t,e,n){"use strict";var r=n(0);n.n(r);n.d(e,"a",function(){return i});var i=function(){function t(t){this.$rootScope=t;var e=this;e=this.addTableParamsEvent("afterCreated",e),e=this.addTableParamsEvent("afterReloadData",e),e=this.addTableParamsEvent("datasetChanged",e),e=this.addTableParamsEvent("pagesChanged",e),e=this.addTableParamsEvent("afterDataFiltered",e),e=this.addTableParamsEvent("afterDataSorted",e)}return t.prototype.addTableParamsEvent=function(t,e){var n=t.charAt(0).toUpperCase()+t.substring(1),i=(a={},a["on"+n]=this.createEventSubscriptionFn(t),a["publish"+n]=this.createPublishEventFn(t),a);return r.extend(e,i);var a},t.prototype.createPublishEventFn=function(t){var e=this;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(i=e.$rootScope).$broadcast.apply(i,["ngTable:"+t].concat(n));var i}},t.prototype.createEventSubscriptionFn=function(t){function e(t){return void 0===t&&(t=function(){return!0}),n(t)?t:function(e){return e===t}}function n(t){return"function"==typeof t}function r(t){return t&&"function"==typeof t.$new}var i=this;return function(n,a,s){var o,l=i.$rootScope;return r(a)?(l=a,o=e(s)):o=e(a),l.$on("ngTable:"+t,function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!e.isNullInstance){var a=[e].concat(r);o.apply(this,a)&&n.apply(this,a)}})}},t}();i.$inject=["$rootScope"]},function(t,e,n){"use strict";function r(t){return!isNaN(parseFloat(t))&&isFinite(t)}var i=n(0),a=(n.n(i),n(12)),s=n(4),o=n(11);n.d(e,"b",function(){return l}),n.d(e,"a",function(){return u});var l=function(){function t(){this.page=1,this.count=10,this.filter={},this.sorting={},this.group={}}return t}(),u=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={});var r=this;this.data=[],this.defaultSettings=o.a.createWithOverrides(),this.isCommittedDataset=!1,this.initialEvents=[],this._params=new l,this._settings=this.defaultSettings,"boolean"==typeof t&&(this.isNullInstance=!0),this.reloadPages=function(){var t;return function(){var e=t,n=r.generatePagesArray(r.page(),r.total(),r.count());i.equals(e,n)||(t=n,r.ngTableEventsChannel.publishPagesChanged(r,n,e))}}(),n.i(s.b)(this._params,this.ngTableDefaults.params),this.settings(e),this.parameters(t,!0),this.ngTableEventsChannel.publishAfterCreated(this),i.forEach(this.initialEvents,function(t){t()}),this.initialEvents=null}return t.prototype.count=function(t){return void 0!==t?this.parameters({count:t,page:1}):this._params.count},t.prototype.filter=function(t){if(null!=t&&"object"==typeof t)return this.parameters({filter:t,page:1});if(t===!0){for(var e=Object.keys(this._params.filter),n={},r=0;r<e.length;r++){var i=this._params.filter[e[r]];null!=i&&""!==i&&(n[e[r]]=i)}return n}return this._params.filter},t.prototype.generatePagesArray=function(t,e,n,r){arguments.length||(t=this.page(),e=this.total(),n=this.count());var i,a,s,o;r=r&&r<6?6:r;var l=[];if(o=Math.ceil(e/n),o>1){l.push({type:"prev",number:Math.max(1,t-1),active:t>1}),l.push({type:"first",number:1,active:t>1,current:1===t}),a=Math.round((this._settings.paginationMaxBlocks-this._settings.paginationMinBlocks)/2),s=Math.max(2,t-a),i=Math.min(o-1,t+2*a-(t-s)),s=Math.max(2,s-(2*a-(i-s)));for(var u=s;u<=i;)u===s&&2!==u||u===i&&u!==o-1?l.push({type:"more",active:!1}):l.push({type:"page",number:u,active:t!==u,current:t===u}),u++;l.push({type:"last",number:o,active:t!==o,current:t===o}),l.push({type:"next",number:Math.min(o,t+1),active:t<o})}return l},t.prototype.group=function(t,e){if(void 0===t)return this._params.group;var r={page:1};return n.i(a.a)(t)&&void 0!==e?(t.sortDirection=e,r.group=t):"string"==typeof t&&void 0!==e?r.group=(i={},i[t]=e,i):r.group=t,this.parameters(r),this;var i},t.prototype.hasErrorState=function(){return!(!this.errParamsMemento||!i.equals(this.errParamsMemento,this.createComparableParams()))},t.prototype.hasFilter=function(){return Object.keys(this.filter(!0)).length>0},t.prototype.hasFilterChanges=function(){var t=this.prevParamsMemento&&this.prevParamsMemento.params.filter;return!i.equals(this._params.filter,t)||this.hasGlobalSearchFieldChanges()},t.prototype.hasGroup=function(t,e){return null==t?n.i(a.a)(this._params.group)||Object.keys(this._params.group).length>0:n.i(a.a)(t)?null==e?this._params.group===t:this._params.group===t&&t.sortDirection===e:null==e?Object.keys(this._params.group).indexOf(t)!==-1:this._params.group[t]===e},t.prototype.isDataReloadRequired=function(){return!this.isCommittedDataset||!i.equals(this.createComparableParams(),this.prevParamsMemento)||this.hasGlobalSearchFieldChanges()},t.prototype.isSortBy=function(t,e){return void 0!==e?void 0!==this._params.sorting[t]&&this._params.sorting[t]==e:void 0!==this._params.sorting[t]},t.prototype.orderBy=function(){return n.i(a.b)(this._params.sorting)},t.prototype.page=function(t){return void 0!==t?this.parameters({page:t}):this._params.page},t.prototype.parameters=function(t,e){if(void 0===t)return this._params;e=e||!1;for(var n in t){var a=t[n];if(e&&n.indexOf("[")>=0){for(var s=n.split(/\[(.*)\]/).reverse(),o="",l=0,u=s.length;l<u;l++){var c=s[l];if(""!==c){var p=a;a={},a[o=c]=r(p)?parseFloat(p):p}}"sorting"===o&&(this._params[o]={}),this._params[o]=i.extend(this._params[o]||{},a[o])}else void 0===t[n]||("group"===n?this._params[n]=this.parseGroup(t[n]):this._params[n]=r(t[n])?parseFloat(t[n]):t[n])}return this.log("ngTable: set parameters",this._params),this},t.prototype.reload=function(){var t,e=this;if(this._settings.$loading=!0,this.prevParamsMemento=i.copy(this.createComparableParams()),this.isCommittedDataset=!0,this.hasGroup())t=this.runInterceptorPipeline(this.$q.when(this._settings.getGroups(this)));else{var n=this._settings.getData;t=this.runInterceptorPipeline(this.$q.when(n(this)))}this.log("ngTable: reload data");var r=this.data;return t.then(function(t){return e._settings.$loading=!1,e.errParamsMemento=null,e.data=t,e.ngTableEventsChannel.publishAfterReloadData(e,t,r),e.reloadPages(),t}).catch(function(t){return e.errParamsMemento=e.prevParamsMemento,e.$q.reject(t)})},t.prototype.settings=function(t){var e=this;if(void 0===t)return this._settings;var n=o.a.merge(this._settings,t),r=this._settings.dataset;this._settings=n;var i=t.hasOwnProperty("dataset")&&t.dataset!=r;if(i){this.isCommittedDataset&&this.page(1),this.isCommittedDataset=!1;var a=function(){e.ngTableEventsChannel.publishDatasetChanged(e,t.dataset,r)};this.initialEvents?this.initialEvents.push(a):a()}return this.log("ngTable: set settings",this._settings),this},t.prototype.sorting=function(t,e){return"string"==typeof t?(this.parameters({sorting:(n={},n[t]=e||this.settings().defaultSort,n)}),this):void 0!==t?this.parameters({sorting:t}):this._params.sorting;var n},t.prototype.total=function(t){return void 0!==t?this.settings({total:t}):this._settings.total},t.prototype.url=function(t){function e(t,e){n(a)?a.push(e+"="+encodeURIComponent(t)):a[e]=encodeURIComponent(t)}function n(e){return t}function r(t,e){return"group"===e||void 0!==typeof t&&""!==t}void 0===t&&(t=!1);var a=t?[]:{};for(var s in this._params)if(this._params.hasOwnProperty(s)){var o=this._params[s],l=encodeURIComponent(s);if("object"==typeof o){for(var u in o)if(r(o[u],s)){var c=l+"["+encodeURIComponent(u)+"]";e(o[u],c)}}else!i.isFunction(o)&&r(o,s)&&e(o,l)}return a},t.prototype.createComparableParams=function(){var t=this._params.group;return{params:this._params,groupSortDirection:n.i(a.a)(t)?t.sortDirection:void 0}},t.prototype.hasGlobalSearchFieldChanges=function(){var t=this._params.filter&&this._params.filter.$,e=this.prevParamsMemento&&this.prevParamsMemento.params.filter&&this.prevParamsMemento.params.filter.$;return!i.equals(t,e)},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._settings.debugMode&&this.$log.debug&&(n=this.$log).debug.apply(n,t);var n},t.prototype.parseGroup=function(t){var e=this._settings.groupOptions.defaultSort;if(t){if(n.i(a.a)(t))return null==t.sortDirection&&(t.sortDirection=e),t;if("object"==typeof t){for(var r in t)null==t[r]&&(t[r]=e);return t}return i={},i[t]=e,i}return t;var i},t.prototype.runInterceptorPipeline=function(t){var e=this;return this._settings.interceptors.reduce(function(t,n){var r=n.response&&n.response.bind(n)||e.$q.when,i=n.responseError&&n.responseError.bind(n)||e.$q.reject;return t.then(function(t){return r(t,e)},function(t){return i(t,e)})},t)},t.init=function(e,n,r,a){i.extend(t.prototype,{$q:e,$log:n,ngTableDefaults:r,ngTableEventsChannel:a})},t}();u.init.$inject=["$q","$log","ngTableDefaults","ngTableEventsChannel"]},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(4)),a=n(3),s=n(6),o=n(8);n.d(e,"a",function(){return l});var l=function(){function t(){this.$loading=!1,this.counts=[10,25,50,100],this.dataset=void 0,this.dataOptions=new a.a,this.debugMode=!1,this.total=0,this.defaultSort="desc",this.filterOptions=new s.a,this.getData=t.defaultGetData,this.getGroups=t.defaultGetGroups,this.groupOptions=new o.a,this.interceptors=new Array,this.paginationMaxBlocks=11,this.paginationMinBlocks=5,this.sortingIndicator="span",n.i(i.a)(t)}return t.createWithOverrides=function(){return n.i(i.a)(t),t.merge(t.instance,t.ngTableDefaults.settings||{})},t.merge=function(e,a){n.i(i.a)(t);var s=["dataset"],o=n.i(i.b)(r.copy(e),a,function(t){return s.indexOf(t)!==-1},function(t,e,n){if("dataset"===n)return e});return a.dataset&&(o.total=a.dataset.length,t.optimizeFilterDelay(o)),o},t.optimizeFilterDelay=function(e){e.filterOptions.filterDelay===t.instance.filterOptions.filterDelay&&e.total<=e.filterOptions.filterDelayThreshold&&e.getData===t.instance.getData&&(e.filterOptions.filterDelay=0)},t.init=function(e,n,r){t.defaultGetData=function(t){return e(t.settings().dataset,t)},t.defaultGetGroups=n,t.ngTableDefaults=r,t.isInitialized=!0,t.instance=new t},t}();l.isInitialized=!1,l.init.$inject=["ngTableDefaultGetData","ngTableDefaultGetGroups","ngTableDefaults"]},function(t,e,n){"use strict";function r(t){var e=[];for(var n in t)e.push(("asc"===t[n]?"+":"-")+n);return e}function i(t){return"function"==typeof t}e.b=r,e.a=i},,function(t,e,n){"use strict";function r(t,e){return{restrict:"A",priority:1001,scope:!0,controller:"ngTableController",compile:function(t){var n,r,a=[],s=0,o=[];if(i.forEach(t.find("tr"),function(t){o.push(i.element(t))}),n=o.filter(function(t){return!t.hasClass("ng-table-group")})[0],r=o.filter(function(t){return t.hasClass("ng-table-group")})[0],n)return i.forEach(n.find("td"),function(t){var n=i.element(t);if(!n.attr("ignore-cell")||"true"!==n.attr("ignore-cell")){var o=function(t){return n.attr("x-data-"+t)||n.attr("data-"+t)||n.attr(t)},l=function(t,e){n.attr("x-data-"+t)?n.attr("x-data-"+t,e):n.attr("data"+t)?n.attr("data"+t,e):n.attr(t,e)},u=function(t){var n=o(t);if(n){var r,i=function(t){return void 0!==r?r:e(n)(t)};return i.assign=function(t,i){var a=e(n);a.assign?a.assign(t.$parent,i):r=i},i}},c=o("title-alt")||o("title");c&&n.attr("data-title-text","{{"+c+"}}"),a.push({id:s++,title:u("title"),titleAlt:u("title-alt"),headerTitle:u("header-title"),sortable:u("sortable"),class:u("header-class"),filter:u("filter"),groupable:u("groupable"),headerTemplateURL:u("header"),filterData:u("filter-data"),show:n.attr("ng-if")?u("ng-if"):void 0}),(r||n.attr("ng-if"))&&l("ng-if","$columns["+(a.length-1)+"].show(this)")}}),function(t,e,n,r){var i=t.$columns=r.buildColumns(a);r.setupBindingsToInternalScope(n.ngTable),r.loadFilterData(i),r.compileDirectiveTemplates()}}}}var i=n(0);n.n(i);e.a=r,r.$inject=["$q","$parse"]},function(t,e,n){"use strict";function r(t){return null!=t&&i.isFunction(t.$new)}var i=n(0);n.n(i);n.d(e,"a",function(){return a});var a=function(){function t(){}return t.prototype.buildColumn=function(t,e,n){var a=Object.create(t),s=this.createDefaults(),o=function(o){if(void 0===a[o]&&(a[o]=s[o]),!i.isFunction(a[o])){var l=function e(){return 1!==arguments.length||r(arguments[0])?t[o]:void e.assign(null,arguments[0])};l.assign=function(e,n){t[o]=n},a[o]=l}var u=a[o];if(a[o]=function(){if(1!==arguments.length||r(arguments[0])){var s=arguments[0]||e,o=Object.create(s);return i.extend(o,{$column:a,$columns:n}),u.call(t,o)}u.assign(e,arguments[0])},u.assign)a[o].assign=u.assign;else{var c,p=a[o],l=function t(){return 1!==arguments.length||r(arguments[0])?void 0!=c?c:p.apply(a,arguments):void t.assign(null,arguments[0])};l.assign=function(t,e){c=e},a[o]=l}};for(var l in s)o(l);return a},t.prototype.createDefaults=function(){return{class:this.createGetterSetter(""),filter:this.createGetterSetter(!1),groupable:this.createGetterSetter(!1),filterData:i.noop,headerTemplateURL:this.createGetterSetter(!1),headerTitle:this.createGetterSetter(""),sortable:this.createGetterSetter(!1),show:this.createGetterSetter(!0),title:this.createGetterSetter(""),titleAlt:this.createGetterSetter("")}},t.prototype.createGetterSetter=function(t){var e=t,n=function t(){return 1!==arguments.length||r(arguments[0])?e:void t.assign(null,arguments[0])};return n.assign=function(t,n){e=n},n},t}();a.$inject=[]},function(t,e,n){"use strict";function r(t){function e(e,n,r){var i=t(r.ngTableColumnsBinding).assign;i&&e.$watch("$columns",function(t){var n=(t||[]).slice(0);i(e,n)})}var n={restrict:"A",link:e};return n}e.a=r,r.$inject=["$parse"]},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(1));n.d(e,"a",function(){return a});var a=function(){function t(t,e,n,r,a,s,o,l,u){this.$scope=t,this.$parse=n,this.$compile=r,this.$attrs=a,this.$element=s,this.$document=o,this.ngTableColumn=l,this.ngTableEventsChannel=u;t.$filterRow={disabled:!1},t.$loading=!1,t.hasOwnProperty("params")||(t.params=new i.a(!0)),this.delayFilter=function(){var t;return function(n,r){e.cancel(t),t=e(n,r)}}(),this.$scope.$watch("params",function(t,e){t!==e&&t&&t.reload()},!1),this.subscribeToTableEvents()}return Object.defineProperty(t.prototype,"hasVisibleFilterColumn",{get:function(){var t=this;return!!this.$scope.$columns&&this.some(this.$scope.$columns,function(e){return e.show(t.$scope)&&!!e.filter(t.$scope)})},enumerable:!0,configurable:!0}),t.prototype.onDataReloadStatusChange=function(t){if(t&&!this.$scope.params.hasErrorState()){var e=this.$scope.params,n=e.settings().filterOptions;if(e.hasFilterChanges()){var r=function(){e.page(1),e.reload()};n.filterDelay?this.delayFilter(r,n.filterDelay):r()}else e.reload()}},t.prototype.compileDirectiveTemplates=function(){if(!this.$element.hasClass("ng-table")){this.$scope.templates={header:this.$attrs.templateHeader?this.$attrs.templateHeader:"ng-table/header.html",pagination:this.$attrs.templatePagination?this.$attrs.templatePagination:"ng-table/pager.html"},this.$element.addClass("ng-table");var t=void 0,e=!1;r.forEach(this.$element.children(),function(t){"THEAD"===t.tagName&&(e=!0)}),e||(t=r.element('<thead ng-include="templates.header"></thead>',this.$document),this.$element.prepend(t));var n=r.element('<div ng-table-pagination="params" template-url="templates.pagination"></div>',this.$document);this.$element.after(n),t&&this.$compile(t)(this.$scope),this.$compile(n)(this.$scope)}},t.prototype.loadFilterData=function(t){function e(t){return t&&"object"==typeof t&&"function"==typeof t.then}var n=this;r.forEach(t,function(t){var i=t.filterData(n.$scope);return i?e(i)?(delete t.filterData,i.then(function(e){r.isArray(e)||r.isFunction(e)||r.isObject(e)||(e=[]),t.data=e})):t.data=i:void delete t.filterData})},t.prototype.buildColumns=function(t){var e=this,n=[];return(t||[]).forEach(function(t){n.push(e.ngTableColumn.buildColumn(t,e.$scope,n))}),n},t.prototype.parseNgTableDynamicExpr=function(t){if(!t||t.indexOf(" with ")>-1){var e=t.split(/\s+with\s+/);return{tableParams:e[0],columns:e[1]}}throw new Error("Parse error (expected example: ng-table-dynamic='tableParams with cols')")},t.prototype.setupBindingsToInternalScope=function(t){var e=this;this.$scope.$watch(t,function(t){void 0!==t&&(e.$scope.params=t)},!1),this.setupFilterRowBindingsToInternalScope(),this.setupGroupRowBindingsToInternalScope()},t.prototype.setupFilterRowBindingsToInternalScope=function(){var t=this;this.$attrs.showFilter?this.$scope.$parent.$watch(this.$attrs.showFilter,function(e){t.$scope.show_filter=e}):this.$scope.$watch(function(){return t.hasVisibleFilterColumn},function(e){t.$scope.show_filter=e}),this.$attrs.disableFilter&&this.$scope.$parent.$watch(this.$attrs.disableFilter,function(e){t.$scope.$filterRow.disabled=e})},t.prototype.setupGroupRowBindingsToInternalScope=function(){var t=this;if(this.$scope.$groupRow={show:!1},this.$attrs.showGroup){var e=this.$parse(this.$attrs.showGroup);this.$scope.$parent.$watch(e,function(e){t.$scope.$groupRow.show=e}),e.assign&&this.$scope.$watch("$groupRow.show",function(n){e.assign(t.$scope.$parent,n)})}else this.$scope.$watch("params.hasGroup()",function(e){t.$scope.$groupRow.show=e})},t.prototype.getVisibleColumns=function(){var t=this;return(this.$scope.$columns||[]).filter(function(e){return e.show(t.$scope)})},t.prototype.subscribeToTableEvents=function(){var t=this;this.$scope.$watch("params.isDataReloadRequired()",function(e){t.onDataReloadStatusChange(e)}),this.ngTableEventsChannel.onAfterReloadData(function(e,n){var r=t.getVisibleColumns();e.hasGroup()?(t.$scope.$groups=n||[],t.$scope.$groups.visibleColumnCount=r.length):(t.$scope.$data=n||[],t.$scope.$data.visibleColumnCount=r.length)},this.$scope,function(e){return t.$scope.params===e}),this.ngTableEventsChannel.onPagesChanged(function(e,n){t.$scope.pages=n},this.$scope,function(e){return t.$scope.params===e})},t.prototype.some=function(t,e){for(var n=!1,r=0;r<t.length;r++){var i=t[r];if(e(i)){n=!0;break}}return n},t}();a.$inject=["$scope","$timeout","$parse","$compile","$attrs","$element","$document","ngTableColumn","ngTableEventsChannel"]},function(t,e,n){"use strict";function r(t){return Array.prototype.slice.call(t)}function i(){return{restrict:"A",priority:1001,scope:!0,controller:"ngTableController",compile:function(t){var e=r(t[0].getElementsByTagName("tr")),n=e.filter(function(t){return!a.element(t).hasClass("ng-table-group")})[0];if(n)return r(n.getElementsByTagName("td")).forEach(function(t){var e=a.element(t),n=function(t){return e.attr("x-data-"+t)||e.attr("data-"+t)||e.attr(t)},r=n("title");r||e.attr("data-title-text","{{$columns[$index].titleAlt(this) || $columns[$index].title(this)}}");var i=e.attr("ng-if");i||e.attr("ng-if","$columns[$index].show(this)")}),function(t,e,n,r){var i=r.parseNgTableDynamicExpr(n.ngTableDynamic);r.setupBindingsToInternalScope(i.tableParams),r.compileDirectiveTemplates(),t.$watchCollection(i.columns,function(e){t.$columns=r.buildColumns(e),r.loadFilterData(t.$columns)})}}}}var a=n(0);n.n(a);e.a=i,i.$inject=[]},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:i,scope:!0,controller:"ngTableFilterRowController",controllerAs:"$ctrl"};return t}e.a=r;var i=n(35);r.$inject=[]},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t,e){this.config=e,t.getFilterPlaceholderValue=this.getFilterPlaceholderValue.bind(this)}return t.prototype.getFilterCellCss=function(t,e){if("horizontal"!==e)return"s12";var n=Object.keys(t).length,r=parseInt((12/n).toString(),10);return"s"+r},t.prototype.getFilterPlaceholderValue=function(t,e){return"string"==typeof t?"":t.placeholder},t}();r.$inject=["$scope","ngTableFilterConfig"]},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:i,scope:!0,controller:"ngTableGroupRowController",controllerAs:"$ctrl"};return t}e.a=r;var i=n(40);r.$inject=[]},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){var e=this;this.$scope=t,this.groupFns=[],t.$watch("params.group()",function(t){e.setGroup(t)},!0)}return t.prototype.getGroupables=function(){var t=this,e=this.$scope.$columns.filter(function(e){return!!e.groupable(t.$scope)});return this.groupFns.concat(e)},t.prototype.getGroupTitle=function(t){return this.isGroupingFunc(t)?t.title:t.title(this.$scope)},t.prototype.getVisibleColumns=function(){var t=this;return this.$scope.$columns.filter(function(e){return e.show(t.$scope)})},t.prototype.groupBy=function(t){this.isSelectedGroup(t)?this.changeSortDirection():this.isGroupingFunc(t)?this.$scope.params.group(t):this.$scope.params.group(t.groupable(this.$scope))},t.prototype.isSelectedGroup=function(t){return this.isGroupingFunc(t)?t===this.$scope.$selGroup:t.groupable(this.$scope)===this.$scope.$selGroup},t.prototype.toggleDetail=function(){return this.$scope.params.settings().groupOptions.isExpanded=!this.$scope.params.settings().groupOptions.isExpanded,this.$scope.params.reload()},t.prototype.changeSortDirection=function(){var t;t=this.$scope.params.hasGroup(this.$scope.$selGroup,"asc")?"desc":this.$scope.params.hasGroup(this.$scope.$selGroup,"desc")?"":"asc",this.$scope.params.group(this.$scope.$selGroup,t)},t.prototype.findGroupColumn=function(t){var e=this;return this.$scope.$columns.filter(function(n){return n.groupable(e.$scope)===t})[0]},t.prototype.isGroupingFunc=function(t){return"function"==typeof t},t.prototype.setGroup=function(t){var e=this.findGroupColumn(this.$scope.$selGroup);if(e&&e.show.assign&&e.show.assign(this.$scope,!0),this.isGroupingFunc(t))this.groupFns=[t],this.$scope.$selGroup=t,this.$scope.$selGroupTitle=t.title||"";else{var n=Object.keys(t||{})[0],r=this.findGroupColumn(n);r&&(this.$scope.$selGroupTitle=r.title(this.$scope),this.$scope.$selGroup=n,r.show.assign&&r.show.assign(this.$scope,!1))}},t}();r.$inject=["$scope"]},function(t,e,n){"use strict";function r(t,e,n){return{restrict:"A",scope:{params:"=ngTablePagination",templateUrl:"="},replace:!1,link:function(r,a){n.onAfterReloadData(function(t){r.pages=t.generatePagesArray()},r,function(t){return t===r.params}),r.$watch("templateUrl",function(n){if(void 0!==n){var s=i.element('<div ng-include="templateUrl"></div>',e);a.append(s),t(s)(r)}})}}}var i=n(0);n.n(i);e.a=r,r.$inject=["$compile","$document","ngTableEventsChannel"]},function(t,e,n){"use strict";function r(){var t={restrict:"A",controller:i};return t}n.d(e,"a",function(){return r}),r.$inject=[];var i=function(){function t(t,e,n,r){var i=this;this.$scope=t,this.$attrs=n,this.$q=r,this.$column=e(n.ngTableSelectFilterDs)(t),t.$watch(function(){return i.$column&&i.$column.data},function(){i.bindDataSource()})}return t.prototype.bindDataSource=function(){var t=this;this.getSelectListData(this.$column).then(function(e){e&&!t.hasEmptyOption(e)&&e.unshift({id:"",title:""}),e=e||[],t.$scope.$selectData=e})},t.prototype.hasEmptyOption=function(t){for(var e=!1,n=0;n<t.length;n++){var r=t[n];if(r&&""===r.id){e=!0;break}}return e},t.prototype.getSelectListData=function(t){var e,n=t.data;return e="function"==typeof n?n():n,this.$q.when(e)},t}();i.$inject=["$scope","$parse","$attrs","$q"]},function(t,e,n){"use strict";function r(){var t={restrict:"E",replace:!0,templateUrl:i,scope:!0,controller:"ngTableSorterRowController",controllerAs:"$ctrl"};return t}e.a=r;var i=n(43);r.$inject=[]},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){this.$scope=t}return t.prototype.sortBy=function(t,e){var n=t.sortable&&t.sortable();if(n&&"string"==typeof n){var r=this.$scope.params.settings().defaultSort,i="asc"===r?"desc":"asc",a=this.$scope.params.sorting()&&this.$scope.params.sorting()[n]&&this.$scope.params.sorting()[n]===r,s=e.ctrlKey||e.metaKey?this.$scope.params.sorting():{};s[n]=a?i:r,this.$scope.params.parameters({sorting:s})}},t}();r.$inject=["$scope"]},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){this.applyFilter=!0,this.applyPaging=!0,this.applySort=!0}return t}()},function(t,e,n){"use strict";var r=n(0);n.n(r);n.d(e,"a",function(){return i});var i=function(){function t(){function t(t,n){function i(n){var i=n.settings().filterOptions;return r.isFunction(i.filterFn)?i.filterFn:t(i.filterFilterName||e.filterFilterName)}function a(n){return t(e.sortingFilterName)}function s(t,e){if(!e.hasFilter())return t;var n=e.filter(!0),r=Object.keys(n),a=r.reduce(function(t,e){return t=c(t,n[e],e)},{}),s=i(e);return s.call(e,t,a,e.settings().filterOptions.filterComparator)}function o(t,e){var n=t.slice((e.page()-1)*e.count(),e.page()*e.count());return e.total(t.length),n}function l(t,e){var n=e.orderBy(),r=a(e);return n.length?r(t,n):t}function u(t,e){if(null==t)return[];var r=e.settings().dataOptions,i=r.applyFilter?s(t,e):t;n.publishAfterDataFiltered(e,i);var a=r.applySort?l(i,e):i;return n.publishAfterDataSorted(e,a),r.applyPaging?o(a,e):a}function c(t,e,n){var r=n.split("."),i=t,a=r[r.length-1],s=i,o=r.slice(0,r.length-1);return o.forEach(function(t){s.hasOwnProperty(t)||(s[t]={}),s=s[t]}),s[a]=e,i}return u.applyPaging=o,u.getFilterFn=i,u.getOrderByFn=a,u}this.filterFilterName="filter",this.sortingFilterName="orderBy";var e=this;this.$get=t,t.$inject=["$filter","ngTableEventsChannel"]}return t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){this.filterComparator=void 0,this.filterDelay=500,this.filterDelayThreshold=1e4,this.filterFilterName=void 0,this.filterFn=void 0,this.filterLayout="stack"}return t}()},function(t,e,n){"use strict";function r(t,e){function r(r){var o,l,u=r.group();if(n.i(s.a)(u))o=u,l=u.sortDirection;else{var c=Object.keys(u)[0];l=u[c],o=function(t){return i(t,c)}}var p=r.settings(),f=p.dataOptions;p.dataOptions=a.extend({},f,{applyPaging:!1});var h=p.getData,g=t.when(h(r));return g.then(function(t){var i={};a.forEach(t,function(t){var e=o(t);i[e]=i[e]||{data:[],$hideRows:!p.groupOptions.isExpanded,value:e},i[e].data.push(t)});var u=[];for(var c in i)u.push(i[c]);if(l){var f=e.getOrderByFn(),h=n.i(s.b)({value:l});u=f(u,h)}return e.applyPaging(u,r)}).finally(function(){p.dataOptions=f})}return r}function i(t,e){var n;if(n="string"==typeof e?e.split("."):e,void 0!==t){if(0===n.length)return t;if(null!==t)return i(t[n[0]],n.slice(1))}}var a=n(0),s=(n.n(a),n(12));e.a=r,r.$inject=["$q","ngTableDefaultGetData"]},function(t,e,n){"use strict";var r=n(7);n.d(e,"a",function(){return r.a})},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={params:{},settings:{}}},function(t,e,n){"use strict";function r(t,e,n,a){void 0===n&&(n=function(){return!1}),void 0===a&&(a=function(){});for(var s=Object.keys(e),o=0,l=s;o<l.length;o++){var u=l[o],c=e[u];if(void 0!==c){var p=t[u],f=a(p,c,u);void 0!==f?t[u]=f:i.isArray(c)?t[u]=c.slice():i.isObject(c)?t[u]=r(p,c):t[u]=c}else n(u,t)&&(t[u]=c)}return t}var i=n(0);n.n(i);e.a=r},function(t,e,n){"use strict";function r(t){if(!t.isInitialized)throw new Error("Class used before initialized. Hint: it is only safe to use this class after all run blocks (ng 1) / app initializers (ng 2) have executed.")}e.a=r},function(t,e,n){var r="ng-table/filterRow.html",i='<tr ng-show=show_filter class=ng-table-filters> <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)}}" ng-class="params.settings().filterOptions.filterLayout === \'horizontal\' ? \'filter-horizontal\' : \'\'"> <div ng-repeat="(name, filter) in $column.filter(this)" ng-include=$ctrl.config.getTemplateUrl(filter) class=filter-cell ng-class="[$ctrl.getFilterCellCss($column.filter(this), params.settings().filterOptions.filterLayout), $last ? \'last\' : \'\']"> </div> </th> </tr> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/number.html",i='<input type=number name={{name}} ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/select-multiple.html",i='<select ng-options="data.id as data.title for data in $column.data" ng-disabled=$filterRow.disabled multiple=multiple ng-multiple=true ng-model=params.filter()[name] class="filter filter-select-multiple form-control" name={{name}}> </select> ',a=n(0);
a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/select.html",i='<select ng-options="data.id as data.title for data in $selectData" ng-table-select-filter-ds=$column ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="filter filter-select form-control" name={{name}}> <option style=display:none value=""></option> </select> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/filters/text.html",i='<input type=text name={{name}} ng-disabled=$filterRow.disabled ng-model=params.filter()[name] class="input-filter form-control" placeholder="{{getFilterPlaceholderValue(filter, name)}}"/> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/groupRow.html",i='<tr ng-if=params.hasGroup() ng-show=$groupRow.show class=ng-table-group-header> <th colspan={{$ctrl.getVisibleColumns().length}} class=sortable ng-class="{\n \'sort-asc\': params.hasGroup($selGroup, \'asc\'),\n \'sort-desc\':params.hasGroup($selGroup, \'desc\')\n }"> <a href="" ng-click="isSelectorOpen = !isSelectorOpen" class=ng-table-group-selector> <strong class=sort-indicator>{{$selGroupTitle}}</strong> <button class="btn btn-default btn-xs ng-table-group-close" ng-click="$groupRow.show = false; $event.preventDefault(); $event.stopPropagation();"> <span class="glyphicon glyphicon-remove"></span> </button> <button class="btn btn-default btn-xs ng-table-group-toggle" ng-click="$ctrl.toggleDetail(); $event.preventDefault(); $event.stopPropagation();"> <span class=glyphicon ng-class="{\n \'glyphicon-resize-small\': params.settings().groupOptions.isExpanded,\n \'glyphicon-resize-full\': !params.settings().groupOptions.isExpanded\n }"></span> </button> </a> <div class=list-group ng-if=isSelectorOpen> <a href="" class=list-group-item ng-repeat="group in $ctrl.getGroupables()" ng-click=$ctrl.groupBy(group)> <strong>{{ $ctrl.getGroupTitle(group)}}</strong> <strong ng-class="$ctrl.isSelectedGroup(group) && \'sort-indicator\'"></strong> </a> </div> </th> </tr> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/header.html",i="<ng-table-group-row></ng-table-group-row> <ng-table-sorter-row></ng-table-sorter-row> <ng-table-filter-row></ng-table-filter-row> ",a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/pager.html",i='<div class="ng-cloak ng-table-pager" ng-if=params.data.length> <div ng-if=params.settings().counts.length class="ng-table-counts btn-group pull-right"> <button ng-repeat="count in params.settings().counts" type=button ng-class="{\'active\':params.count() == count}" ng-click=params.count(count) class="btn btn-default"> <span ng-bind=count></span> </button> </div> <ul ng-if=pages.length class="pagination ng-table-pagination"> <li class=page-item ng-class="{\'disabled\': !page.active && !page.current, \'active\': page.current}" ng-repeat="page in pages" ng-switch=page.type> <a class=page-link ng-switch-when=prev ng-click=params.page(page.number) href="">&laquo;</a> <a class=page-link ng-switch-when=first ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=page ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=more ng-click=params.page(page.number) href="">&#8230;</a> <a class=page-link ng-switch-when=last ng-click=params.page(page.number) href=""><span ng-bind=page.number></span></a> <a class=page-link ng-switch-when=next ng-click=params.page(page.number) href="">&raquo;</a> </li> </ul> </div> ',a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){var r="ng-table/sorterRow.html",i="<tr class=ng-table-sort-header> <th title={{$column.headerTitle(this)}} ng-repeat=\"$column in $columns\" 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 }\" ng-click=\"$ctrl.sortBy($column, $event)\" ng-if=$column.show(this) ng-init=\"template = $column.headerTemplateURL(this)\" class=\"header {{$column.class(this)}}\"> <div ng-if=!template class=ng-table-header ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'div'}\"> <span ng-bind=$column.title(this) ng-class=\"{'sort-indicator': params.settings().sortingIndicator == 'span'}\"></span> </div> <div ng-if=template ng-include=template></div> </th> </tr> ",a=n(0);a.module("ng").run(["$templateCache",function(t){t.put(r,i)}]),t.exports=r},function(t,e,n){"use strict";var r=n(0),i=(n.n(r),n(1)),a=n(2);Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"ngTableCoreModule",function(){return i.b}),n.d(e,"Settings",function(){return i.c}),n.d(e,"NgTableEventsChannel",function(){return i.d}),n.d(e,"ParamValues",function(){return i.e}),n.d(e,"NgTableParams",function(){return i.a}),n.d(e,"DataSettings",function(){return i.f}),n.d(e,"NgTableDefaultGetDataProvider",function(){return i.g}),n.d(e,"FilterSettings",function(){return i.h}),n.d(e,"GroupSettings",function(){return i.i}),n.d(e,"NgTableController",function(){return a.b}),n.d(e,"ngTableBrowserModule",function(){return a.a}),n.d(e,"FilterConfigValues",function(){return a.c}),n.d(e,"NgTableFilterConfigProvider",function(){return a.d}),n.d(e,"NgTableFilterConfig",function(){return a.e}),n.d(e,"ngTableModule",function(){return s});var s=r.module("ngTable",[i.b.name,a.a.name])}])});
//# sourceMappingURL=ng-table.min.js.map

@@ -45,2 +45,7 @@ CONTRIBUTING

To lauch this tool we use `npm run cm`.
To lauch this tool we use `npm run cm`.
## Releasing
See the [releasing](RELEASING.md) guidelines.
{
"name": "ng-table",
"version": "3.0.1",
"version": "3.1.0",
"author": "Vitalii Savchuk <esvit666@gmail.com>",

@@ -20,3 +20,3 @@ "license": "BSD",

"publishConfig": {
"tag": "latest"
"tag": "next"
},

@@ -27,4 +27,4 @@ "devDependencies": {

"@types/jasmine": "^2.2.33",
"@types/karma-jasmine": "0.0.27",
"@types/lodash": "^4.14.34",
"@types/karma-jasmine": "0.0.28",
"@types/lodash": "^4.14.43",
"angular": "^1.5.8",

@@ -34,5 +34,5 @@ "angular-mocks": "^1.5.8",

"angular1-template-loader": "^0.1.0",
"awesome-typescript-loader": "^2.2.4",
"awesome-typescript-loader": "^3.0.0-beta.9",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-loader": "^6.2.10",
"babel-preset-es2015": "^6.13.2",

@@ -56,4 +56,4 @@ "babel-preset-es2016": "^6.11.3",

"istanbul": "^0.4.4",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "^2.3.4",
"istanbul-instrumenter-loader": "^1.1.0",
"jasmine-core": "git+https://github.com/jasmine/jasmine.git#be6ff8b24cba355246df93d00d74a64de9e580ad",
"jasmine-spec-reporter": "^2.7.0",

@@ -64,3 +64,3 @@ "karma": "1.1.2",

"karma-firefox-launcher": "1.0.0",
"karma-jasmine": "1.0.2",
"karma-jasmine": "^1.1.0",
"karma-jasmine-diff-reporter": "^0.6.3",

@@ -71,3 +71,3 @@ "karma-phantomjs-launcher": "1.0.1",

"linklocal": "git+https://github.com/theoy/linklocal.git#3f939171c3c925f2af831d78a3f2fbf9caa3002e",
"lodash": "~3.7.0",
"lodash": "^4.17.2",
"ngtemplate-loader": "git+https://github.com/wearymonkey/ngtemplate-loader.git#63e3461d8b1298de913e3528766068260915ae1f",

@@ -81,3 +81,3 @@ "node-sass": "^3.8.0",

"resolve-url-loader": "^1.6.0",
"sass-loader": "^4.0.0",
"sass-loader": "^4.1.0",
"semantic-release": "^4.3.5",

@@ -90,9 +90,9 @@ "shx": "^0.1.4",

"typedoc": "^0.5.0",
"typescript": "2.0.3",
"typescript": "^2.1.4",
"url-loader": "^0.5.7",
"validate-commit-msg": "^2.8.2",
"webpack": "git+https://github.com/webpack/webpack.git#fbb8920f2ec8366659bb04de7c2c044a308a0925",
"webpack-dev-server": "^2.1.0-beta.9",
"webpack-merge": "^0.14.1",
"webpack-validator": "^2.2.9"
"webpack": "^2.1.0-beta.28",
"webpack-dev-server": "^2.2.0-rc.0",
"webpack-merge": "^1.1.1",
"webpack-validator": "^2.3.0"
},

@@ -110,3 +110,3 @@ "scripts": {

"clean:all": "run-p clean clean:demo-apps",
"clean": "shx rm -rf bundles out demo-site/api-docs *.d.ts *.js.map src/**/*.js src/**/*.js.map src/**/*.d.ts test/**/*.spec.js test/**/*.spec.js.map test/**/*.spec.d.ts",
"clean": "shx rm -rf bundles out demo-site/api-docs index.{js,js.map,d.ts} src/**/*.{js,js.map,d.ts} test/specs/**/*.{js,js.map,d.ts} test/util/**/*.{js,js.map,d.ts}",
"cm": "git add -A && git-cz",

@@ -113,0 +113,0 @@ "commitmsg": "validate-commit-msg",

@@ -29,3 +29,5 @@ Table + AngularJS

**Bower**: NO LONGER SUPPORTED
## Getting started

@@ -32,0 +34,0 @@

@@ -11,2 +11,20 @@ RELEASING

### NPM dist-tags
By default this new package version will be published with a [dist-tag](https://docs.npmjs.com/cli/dist-tag#purpose) of `next`
Implications:
* To install this version: `npm install ng-table@next --save`
* To make this version available via `npm install ng-table --save`, a dist-tag of `latest` must be manually added (see steps below)
#### Adding the `latest` dist-tag
1. Open a command line
2. Change directory: `cd path/to/ng-table`
3. Login: `npm adduser`
4. Add dist-tag: `npm dist-tag add ng-table@n.n.n latest`
* where `n.n.n` is the version of the package that you now want to make the latest
## Documentation

@@ -13,0 +31,0 @@

/// <reference types="angular" />
import * as angular from 'angular';
import { NgTableController } from './ngTableController';
import { NgTableFilterConfigProvider, NgTableFilterConfig } from './ngTableFilterConfig';
import './filters/number.html';

@@ -13,2 +12,3 @@ import './filters/select.html';

export * from './public-interfaces';
export { NgTableController, NgTableFilterConfigProvider, NgTableFilterConfig, ngTableBrowserModule };
export { NgTableController, ngTableBrowserModule };
export * from './ngTableFilterConfig';

@@ -7,3 +7,3 @@ import * as angular from 'angular';

import { ngTableDynamic } from './ngTableDynamic.directive';
import { NgTableFilterConfigProvider, NgTableFilterConfig } from './ngTableFilterConfig';
import { NgTableFilterConfigProvider } from './ngTableFilterConfig';
import { ngTableFilterRow } from './ngTableFilterRow.directive';

@@ -38,4 +38,4 @@ import { NgTableFilterRowController } from './ngTableFilterRowController';

.controller('ngTableSorterRowController', NgTableSorterRowController);
export * from './public-interfaces';
export { NgTableController, NgTableFilterConfigProvider, NgTableFilterConfig, ngTableBrowserModule };
export { NgTableController, ngTableBrowserModule };
export * from './ngTableFilterConfig';
//# sourceMappingURL=index.js.map

@@ -29,3 +29,3 @@ import * as ng1 from 'angular';

compile: function (element) {
var columns = [], i = 0, dataRow, groupRow;
var compiledColumns = [], i = 0, dataRow, groupRow;
var rows = [];

@@ -90,3 +90,3 @@ ng1.forEach(element.find('tr'), function (tr) {

// a corresponding "safe" default
columns.push({
compiledColumns.push({
id: i++,

@@ -109,7 +109,7 @@ title: parsedAttribute('title'),

// currently only ngTableGroupRow directive needs to change visibility
setAttrValue('ng-if', '$columns[' + (columns.length - 1) + '].show(this)');
setAttrValue('ng-if', '$columns[' + (compiledColumns.length - 1) + '].show(this)');
}
});
return function (scope, element, attrs, controller) {
scope.$columns = columns = controller.buildColumns(columns);
var columns = scope.$columns = controller.buildColumns(compiledColumns);
controller.setupBindingsToInternalScope(attrs.ngTable);

@@ -116,0 +116,0 @@ controller.loadFilterData(columns);

@@ -10,3 +10,3 @@ /// <reference types="angular" />

import { IScope } from 'angular';
import { IColumnDef, IDynamicTableColDef } from './public-interfaces';
import { ColumnDef, ColumnDefPartial, DynamicTableColDef } from './public-interfaces';
/**

@@ -16,3 +16,3 @@ * @private

*/
export declare class NgTableColumn<TCol extends IColumnDef | IDynamicTableColDef> {
export declare class NgTableColumn<TCol extends ColumnDefPartial | DynamicTableColDef> {
static $inject: string[];

@@ -27,5 +27,5 @@ /**

*/
buildColumn(column: TCol, defaultScope: IScope, columns: IColumnDef[]): IColumnDef;
buildColumn(column: TCol, defaultScope: IScope, columns: ColumnDef[]): ColumnDef;
private createDefaults();
private createGetterSetter(initialValue);
}

@@ -19,3 +19,3 @@ /**

*/
export var NgTableColumn = (function () {
var NgTableColumn = (function () {
function NgTableColumn() {

@@ -35,3 +35,3 @@ }

var defaults = this.createDefaults();
var _loop_1 = function(prop) {
var _loop_1 = function (prop) {
if (extendedCol[prop] === undefined) {

@@ -128,5 +128,6 @@ extendedCol[prop] = defaults[prop];

};
NgTableColumn.$inject = [];
return NgTableColumn;
}());
export { NgTableColumn };
NgTableColumn.$inject = [];
//# sourceMappingURL=ngTableColumn.js.map

@@ -11,4 +11,4 @@ /// <reference types="angular" />

import { IAttributes, IAugmentedJQuery, ICompileService, IDocumentService, IParseService, IScope, ITimeoutService } from 'angular';
import { DataResults, GroupedDataResults, NgTableParams, NgTableEventsChannel, IPageButton } from '../core';
import { IColumnDef, IDynamicTableColDef, ITableInputAttributes } from './public-interfaces';
import { DataResults, GroupedDataResults, NgTableParams, NgTableEventsChannel, PageButton } from '../core';
import { ColumnDef, ColumnDefPartial, DynamicTableColDef, TableHtmlAttributes } from './public-interfaces';
import { NgTableColumn } from './ngTableColumn';

@@ -18,4 +18,4 @@ /**

*/
export interface ITableScope<T> extends IScope {
$columns: IColumnDef[];
export interface TableScope<T> extends IScope {
$columns: ColumnDef[];
$loading: boolean;

@@ -31,3 +31,3 @@ $filterRow: {

show_filter: boolean;
pages: IPageButton[];
pages: PageButton[];
templates: {

@@ -42,3 +42,3 @@ header: string;

*/
export declare class NgTableController<TParams, TCol extends IColumnDef | IDynamicTableColDef> {
export declare class NgTableController<TParams, TCol extends ColumnDefPartial | DynamicTableColDef> {
private $scope;

@@ -55,7 +55,7 @@ private $parse;

private readonly hasVisibleFilterColumn;
constructor($scope: ITableScope<TParams>, $timeout: ITimeoutService, $parse: IParseService, $compile: ICompileService, $attrs: IAttributes & ITableInputAttributes, $element: IAugmentedJQuery, $document: IDocumentService, ngTableColumn: NgTableColumn<TCol>, ngTableEventsChannel: NgTableEventsChannel);
constructor($scope: TableScope<TParams>, $timeout: ITimeoutService, $parse: IParseService, $compile: ICompileService, $attrs: IAttributes & TableHtmlAttributes, $element: IAugmentedJQuery, $document: IDocumentService, ngTableColumn: NgTableColumn<TCol>, ngTableEventsChannel: NgTableEventsChannel);
private onDataReloadStatusChange(newStatus);
compileDirectiveTemplates(): void;
loadFilterData($columns: IColumnDef[]): void;
buildColumns(columns: TCol[]): IColumnDef[];
loadFilterData($columns: ColumnDef[]): void;
buildColumns(columns: TCol[]): ColumnDef[];
parseNgTableDynamicExpr(attr: string): {

@@ -62,0 +62,0 @@ tableParams: string;

@@ -13,3 +13,3 @@ /**

*/
export var NgTableController = (function () {
var NgTableController = (function () {
function NgTableController($scope, $timeout, $parse, $compile, $attrs, $element, $document, ngTableColumn, ngTableEventsChannel) {

@@ -93,3 +93,3 @@ this.$scope = $scope;

this.$element.addClass('ng-table');
var headerTemplate = null;
var headerTemplate = void 0;
// $element.find('> thead').length === 0 doesn't work on jqlite

@@ -253,7 +253,8 @@ var theadFound_1 = false;

};
NgTableController.$inject = [
'$scope', '$timeout', '$parse', '$compile', '$attrs', '$element', '$document', 'ngTableColumn', 'ngTableEventsChannel'
];
return NgTableController;
}());
export { NgTableController };
NgTableController.$inject = [
'$scope', '$timeout', '$parse', '$compile', '$attrs', '$element', '$document', 'ngTableColumn', 'ngTableEventsChannel'
];
//# sourceMappingURL=ngTableController.js.map

@@ -9,2 +9,5 @@ /**

import * as ng1 from 'angular';
function toArray(arr) {
return Array.prototype.slice.call(arr);
}
ngTableDynamic.$inject = [];

@@ -32,15 +35,9 @@ /**

compile: function (tElement) {
var row;
// IE 8 fix :not(.ng-table-group) selector
ng1.forEach(tElement.find('tr'), function (tr) {
tr = ng1.element(tr);
if (!tr.hasClass('ng-table-group') && !row) {
row = tr;
}
});
if (!row) {
var tRows = toArray(tElement[0].getElementsByTagName('tr'));
var tRow = tRows.filter(function (tr) { return !ng1.element(tr).hasClass('ng-table-group'); })[0];
if (!tRow) {
return undefined;
}
ng1.forEach(row.find('td'), function (item) {
var el = ng1.element(item);
toArray(tRow.getElementsByTagName('td')).forEach(function (tCell) {
var el = ng1.element(tCell);
var getAttrValue = function (attr) {

@@ -47,0 +44,0 @@ return el.attr('x-data-' + attr) || el.attr('data-' + attr) || el.attr(attr);

/// <reference types="angular" />
import { IServiceProvider, auto } from 'angular';
import { IFilterConfigValues, IFilterTemplateDef } from './public-interfaces';
import { FilterTemplateDef } from './public-interfaces';
/**
* Configuration values that determine the behaviour of the `ngTableFilterConfig` service
*/
export declare class FilterConfigValues {
/**
* The default base url to use when deriving the url for a filter template given just an alias name
*/
defaultBaseUrl: string;
/**
* The extension to use when deriving the url of a filter template when given just an alias name
*/
defaultExt: string;
/**
* A map of alias names and their corrosponding urls. A lookup against this map will be used
* to find the url matching an alias name.
* If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}`
*/
aliasUrls: {
[name: string]: string;
};
}
export declare type FilterConfigValuesPartial = Partial<FilterConfigValues>;
/**
* The angular provider used to configure the behaviour of the `NgTableFilterConfig` service.

@@ -11,3 +33,2 @@ */

private config;
private defaultConfig;
constructor($injector: auto.IInjectorService);

@@ -21,3 +42,3 @@ /**

*/
setConfig(customConfig: IFilterConfigValues): void;
setConfig(customConfig: FilterConfigValuesPartial): void;
}

@@ -32,3 +53,3 @@ /**

*/
readonly config: IFilterConfigValues;
readonly config: FilterConfigValues;
static $inject: string[];

@@ -39,3 +60,3 @@ constructor(

*/
config: IFilterConfigValues);
config: FilterConfigValues);
/**

@@ -47,5 +68,5 @@ * Return the url of the html filter template registered with the alias supplied

* Return the url of the html filter template for the supplied definition and key.
* For more information see the documentation for {@link IFilterTemplateMap}
* For more information see the documentation for {@link FilterTemplateMap}
*/
getTemplateUrl(filterDef: string | IFilterTemplateDef, filterKey?: string): string;
getTemplateUrl(filterDef: string | FilterTemplateDef, filterKey?: string): string;
}

@@ -9,13 +9,32 @@ /**

import * as ng1 from 'angular';
import { assignPartialDeep } from '../shared';
/**
* Configuration values that determine the behaviour of the `ngTableFilterConfig` service
*/
var FilterConfigValues = (function () {
function FilterConfigValues() {
/**
* The default base url to use when deriving the url for a filter template given just an alias name
*/
this.defaultBaseUrl = 'ng-table/filters/';
/**
* The extension to use when deriving the url of a filter template when given just an alias name
*/
this.defaultExt = '.html';
/**
* A map of alias names and their corrosponding urls. A lookup against this map will be used
* to find the url matching an alias name.
* If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}`
*/
this.aliasUrls = {};
}
return FilterConfigValues;
}());
export { FilterConfigValues };
/**
* The angular provider used to configure the behaviour of the `NgTableFilterConfig` service.
*/
export var NgTableFilterConfigProvider = (function () {
var NgTableFilterConfigProvider = (function () {
function NgTableFilterConfigProvider($injector) {
var _this = this;
this.defaultConfig = {
defaultBaseUrl: 'ng-table/filters/',
defaultExt: '.html',
aliasUrls: {}
};
this.$get = function () {

@@ -31,3 +50,3 @@ return $injector.instantiate(NgTableFilterConfig, { config: ng1.copy(_this.config) });

NgTableFilterConfigProvider.prototype.resetConfigs = function () {
this.config = this.defaultConfig;
this.config = new FilterConfigValues();
};

@@ -38,9 +57,8 @@ /**

NgTableFilterConfigProvider.prototype.setConfig = function (customConfig) {
var mergeConfig = ng1.extend({}, this.config, customConfig);
mergeConfig.aliasUrls = ng1.extend({}, this.config.aliasUrls, customConfig.aliasUrls);
this.config = mergeConfig;
this.config = assignPartialDeep(ng1.copy(this.config), customConfig);
};
NgTableFilterConfigProvider.$inject = ['$injector'];
return NgTableFilterConfigProvider;
}());
export { NgTableFilterConfigProvider };
NgTableFilterConfigProvider.$inject = ['$injector'];
/**

@@ -50,3 +68,3 @@ * Exposes configuration values and methods used to return the location of the html

*/
export var NgTableFilterConfig = (function () {
var NgTableFilterConfig = (function () {
function NgTableFilterConfig(

@@ -67,3 +85,3 @@ /**

* Return the url of the html filter template for the supplied definition and key.
* For more information see the documentation for {@link IFilterTemplateMap}
* For more information see the documentation for {@link FilterTemplateMap}
*/

@@ -83,5 +101,6 @@ NgTableFilterConfig.prototype.getTemplateUrl = function (filterDef, filterKey) {

};
NgTableFilterConfig.$inject = ['config'];
return NgTableFilterConfig;
}());
export { NgTableFilterConfig };
NgTableFilterConfig.$inject = ['config'];
//# sourceMappingURL=ngTableFilterConfig.js.map

@@ -10,3 +10,3 @@ /// <reference types="angular" />

import { IScope } from 'angular';
import { IFilterTemplateDef, IFilterTemplateDefMap } from './public-interfaces';
import { FilterTemplateDef, FilterTemplateDefMap } from './public-interfaces';
import { NgTableFilterConfig } from './ngTableFilterConfig';

@@ -16,4 +16,4 @@ /**

*/
export interface IScopeExtensions {
getFilterPlaceholderValue(filterDef: string | IFilterTemplateDef, filterKey?: string): string;
export interface ScopeExtensions {
getFilterPlaceholderValue(filterDef: string | FilterTemplateDef, filterKey?: string): string;
}

@@ -26,5 +26,5 @@ /**

config: NgTableFilterConfig;
constructor($scope: IScope & IScopeExtensions, ngTableFilterConfig: NgTableFilterConfig);
getFilterCellCss(filter: IFilterTemplateDefMap, layout: string): string;
getFilterPlaceholderValue(filterDef: string | IFilterTemplateDef, filterKey?: string): string;
constructor($scope: IScope & ScopeExtensions, ngTableFilterConfig: NgTableFilterConfig);
getFilterCellCss(filter: FilterTemplateDefMap, layout: string): string;
getFilterPlaceholderValue(filterDef: string | FilterTemplateDef, filterKey?: string): string;
}

@@ -11,3 +11,3 @@ /**

*/
export var NgTableFilterRowController = (function () {
var NgTableFilterRowController = (function () {
function NgTableFilterRowController($scope, ngTableFilterConfig) {

@@ -37,5 +37,6 @@ this.config = ngTableFilterConfig;

};
NgTableFilterRowController.$inject = ['$scope', 'ngTableFilterConfig'];
return NgTableFilterRowController;
}());
export { NgTableFilterRowController };
NgTableFilterRowController.$inject = ['$scope', 'ngTableFilterConfig'];
//# sourceMappingURL=ngTableFilterRowController.js.map

@@ -10,10 +10,10 @@ /// <reference types="angular" />

import { IPromise } from 'angular';
import { DataResult, IGroupingFunc } from '../core';
import { IColumnDef } from './public-interfaces';
import { ITableScope } from './ngTableController';
import { DataResult, GroupingFunc } from '../core';
import { ColumnDef } from './public-interfaces';
import { TableScope } from './ngTableController';
/**
* @private
*/
export interface IScopeExtensions<T> {
$selGroup: IGroupingFunc<any> | string;
export interface ScopeExtensions<T> {
$selGroup: GroupingFunc<any> | string;
$selGroupTitle: string;

@@ -28,9 +28,9 @@ }

private groupFns;
constructor($scope: ITableScope<T> & IScopeExtensions<T>);
getGroupables(): (IGroupingFunc<any> | IColumnDef)[];
getGroupTitle(group: IGroupingFunc<any> | IColumnDef): string;
getVisibleColumns(): IColumnDef[];
groupBy(group: IGroupingFunc<any> | IColumnDef): void;
isSelectedGroup(group: IGroupingFunc<any> | IColumnDef): boolean;
toggleDetail(): IPromise<DataResult[]>;
constructor($scope: TableScope<T> & ScopeExtensions<T>);
getGroupables(): (GroupingFunc<any> | ColumnDef)[];
getGroupTitle(group: GroupingFunc<any> | ColumnDef): string | undefined;
getVisibleColumns(): ColumnDef[];
groupBy(group: GroupingFunc<any> | ColumnDef): void;
isSelectedGroup(group: GroupingFunc<any> | ColumnDef): boolean;
toggleDetail(): IPromise<DataResult<T>[]>;
private changeSortDirection();

@@ -37,0 +37,0 @@ private findGroupColumn(groupKey);

@@ -11,3 +11,3 @@ /**

*/
export var NgTableGroupRowController = (function () {
var NgTableGroupRowController = (function () {
function NgTableGroupRowController($scope) {

@@ -89,3 +89,3 @@ var _this = this;

this.$scope.$selGroup = grouping;
this.$scope.$selGroupTitle = grouping.title;
this.$scope.$selGroupTitle = grouping.title || '';
}

@@ -105,5 +105,6 @@ else {

};
NgTableGroupRowController.$inject = ['$scope'];
return NgTableGroupRowController;
}());
export { NgTableGroupRowController };
NgTableGroupRowController.$inject = ['$scope'];
//# sourceMappingURL=ngTableGroupRowController.js.map

@@ -9,8 +9,8 @@ /// <reference types="angular" />

*/
import * as ng1 from 'angular';
import { IColumnDef, ISelectOption } from './public-interfaces';
import { IAttributes, IDirective, IParseService, IQService, IScope } from 'angular';
import { ColumnDef, SelectOption } from './public-interfaces';
/**
* @private
*/
export interface IInputAttributes extends ng1.IAttributes {
export interface InputAttributes extends IAttributes {
ngTableSelectFilterDs: string;

@@ -21,4 +21,4 @@ }

*/
export interface IScopeExtensions {
$selectData: ISelectOption[];
export interface ScopeExtensions {
$selectData: SelectOption[];
}

@@ -33,3 +33,3 @@ /**

*/
declare function ngTableSelectFilterDs(): ng1.IDirective;
declare function ngTableSelectFilterDs(): IDirective;
/**

@@ -43,4 +43,4 @@ * @private

static $inject: string[];
$column: IColumnDef;
constructor($scope: ng1.IScope & IScopeExtensions, $parse: ng1.IParseService, $attrs: IInputAttributes, $q: ng1.IQService);
$column: ColumnDef;
constructor($scope: IScope & ScopeExtensions, $parse: IParseService, $attrs: InputAttributes, $q: IQService);
private bindDataSource();

@@ -47,0 +47,0 @@ private hasEmptyOption(data);

@@ -29,3 +29,3 @@ /**

*/
export var NgTableSelectFilterDsController = (function () {
var NgTableSelectFilterDsController = (function () {
function NgTableSelectFilterDsController($scope, $parse, $attrs, $q) {

@@ -50,3 +50,3 @@ var _this = this;

NgTableSelectFilterDsController.prototype.hasEmptyOption = function (data) {
var isMatch;
var isMatch = false;
for (var i = 0; i < data.length; i++) {

@@ -63,13 +63,16 @@ var item = data[i];

var dataInput = $column.data;
if (dataInput instanceof Array) {
return this.$q.when(dataInput);
var result;
if (typeof dataInput === 'function') {
result = dataInput();
}
else {
return this.$q.when(dataInput && dataInput());
result = dataInput;
}
return this.$q.when(result);
};
NgTableSelectFilterDsController.$inject = ['$scope', '$parse', '$attrs', '$q'];
return NgTableSelectFilterDsController;
}());
export { NgTableSelectFilterDsController };
NgTableSelectFilterDsController.$inject = ['$scope', '$parse', '$attrs', '$q'];
export { ngTableSelectFilterDs };
//# sourceMappingURL=ngTableSelectFilterDs.directive.js.map

@@ -10,4 +10,4 @@ /// <reference types="angular" />

import { IAngularEvent } from 'angular';
import { IColumnDef } from './public-interfaces';
import { ITableScope } from './ngTableController';
import { ColumnDef } from './public-interfaces';
import { TableScope } from './ngTableController';
/**

@@ -26,4 +26,4 @@ * @private

static $inject: string[];
constructor($scope: ITableScope<T>);
sortBy($column: IColumnDef, event: IAugmentedMouseEvent): void;
constructor($scope: TableScope<T>);
sortBy($column: ColumnDef, event: IAugmentedMouseEvent): void;
}
/**
* Controller for the {@link ngTableSorterRow ngTableSorterRow} directive
*/
export var NgTableSorterRowController = (function () {
var NgTableSorterRowController = (function () {
function NgTableSorterRowController($scope) {

@@ -24,5 +24,6 @@ this.$scope = $scope;

};
NgTableSorterRowController.$inject = ['$scope'];
return NgTableSorterRowController;
}());
export { NgTableSorterRowController };
NgTableSorterRowController.$inject = ['$scope'];
//# sourceMappingURL=ngTableSorterRowController.js.map

@@ -7,10 +7,14 @@ /// <reference types="angular" />

export declare type ColumnFieldContext = IScope & {
$column?: IColumnDef;
$columns: IColumnDef[];
$column: ColumnDef;
$columns: ColumnDef[];
};
export declare type ColumnFieldContextPartial = IScope & {
$column?: ColumnDef;
$columns: ColumnDef[];
};
/**
* Signature of a getter/setter on a {@link IColumnDef} instance
*/
export interface IColumnField<T> {
(context?: ColumnFieldContext): T;
export interface ColumnField<T> {
(context?: ColumnFieldContextPartial): T;
(value: T): void;

@@ -32,3 +36,3 @@ assign($scope: IScope, value: T): void;

*/
export interface IColumnDef {
export interface ColumnDef {
/**

@@ -39,3 +43,3 @@ * Custom CSS class that should be added to the `th` tag(s) of this column in the table header

*/
class: IColumnField<string>;
class: ColumnField<string>;
/**

@@ -53,3 +57,3 @@ * The `ISelectOption`s that can be used in a html filter template for this colums.

*/
filter: IColumnField<IFilterTemplateDefMap>;
filter: ColumnField<FilterTemplateDefMap>;
/**

@@ -60,3 +64,3 @@ * Supplies the `ISelectOption`s that can be used in a html filter template for this colums.

*/
filterData: IColumnField<IPromise<SelectData> | SelectData>;
filterData: ColumnField<IPromise<SelectData> | SelectData>;
/**

@@ -66,3 +70,3 @@ * The name of the data row field that will be used to group on, or false when this column

*/
groupable: IColumnField<string | boolean>;
groupable: ColumnField<string | boolean>;
/**

@@ -73,7 +77,7 @@ * The url of a custom html template that should be used to render a table header for this column

*/
headerTemplateURL: IColumnField<string | boolean>;
headerTemplateURL: ColumnField<string | boolean>;
/**
* The text that should be used as a tooltip for this column in the table header
*/
headerTitle: IColumnField<string>;
headerTitle: ColumnField<string>;
/**

@@ -84,3 +88,3 @@ * Determines whether this column should be displayed in the table

*/
show: IColumnField<boolean>;
show: ColumnField<boolean>;
/**

@@ -90,7 +94,7 @@ * The name of the data row field that will be used to sort on, or false when this column

*/
sortable: IColumnField<string | boolean>;
sortable: ColumnField<string | boolean>;
/**
* The title of this column that should be displayed in the table header
*/
title: IColumnField<string>;
title: ColumnField<string>;
/**

@@ -100,10 +104,11 @@ * An alternate column title. Typically this can be used for responsive table layouts

*/
titleAlt: IColumnField<string>;
titleAlt: ColumnField<string>;
}
export declare type DynamicTableColField<T> = IDynamicTableColFieldFunc<T> | T;
export declare type ColumnDefPartial = Partial<ColumnDef>;
export declare type DynamicTableColField<T> = DynamicTableColFieldFunc<T> | T;
/**
* Signature of a getter/setter on a {@link IDynamicTableColDef} instance
*/
export interface IDynamicTableColFieldFunc<T> {
(context: ColumnFieldContext): T;
export interface DynamicTableColFieldFunc<T> {
(context: ColumnFieldContextPartial): T;
}

@@ -113,3 +118,3 @@ /**

*/
export interface IDynamicTableColDef {
export interface DynamicTableColDef {
/**

@@ -123,3 +128,3 @@ * Custom CSS class that should be added to the `th` tag(s) of this column in the table header

*/
filter?: DynamicTableColField<IFilterTemplateDefMap>;
filter?: DynamicTableColField<FilterTemplateDefMap>;
/**

@@ -164,24 +169,2 @@ * Supplies the `ISelectOption`s that can be used in a html filter template for this colums.

/**
* Configuration values that determine the behaviour of the `ngTableFilterConfig` service
*/
export interface IFilterConfigValues {
/**
* The default base url to use when deriving the url for a filter template given just an alias name
* Defaults to 'ng-table/filters/'
*/
defaultBaseUrl?: string;
/**
* The extension to use when deriving the url of a filter template when given just an alias name
*/
defaultExt?: string;
/**
* A map of alias names and their corrosponding urls. A lookup against this map will be used
* to find the url matching an alias name.
* If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}`
*/
aliasUrls?: {
[name: string]: string;
};
}
/**
* A key value-pair map where the key is the name of a field in a data row and the value is the definition

@@ -204,4 +187,4 @@ * for the template used to render a filter cell in the header of a html table.

*/
export interface IFilterTemplateDefMap {
[name: string]: string | IFilterTemplateDef;
export interface FilterTemplateDefMap {
[name: string]: string | FilterTemplateDef;
}

@@ -211,3 +194,3 @@ /**

*/
export interface IFilterTemplateDef {
export interface FilterTemplateDef {
/**

@@ -222,7 +205,7 @@ * A url to a html template or an alias to a url registered using the {@link ngTableFilterConfigProvider}

}
export declare type SelectData = ISelectOption[] | ISelectDataFunc;
export declare type SelectData = SelectOption[] | SelectDataFunc;
/**
* An object to be rendered as a html select option
*/
export interface ISelectOption {
export interface SelectOption {
id: string | number;

@@ -234,12 +217,10 @@ title: string;

*/
export interface ISelectDataFunc {
(): ISelectOption[] | IPromise<ISelectOption[]>;
export interface SelectDataFunc {
(): SelectOption[] | IPromise<SelectOption[]> | undefined;
}
/**
* The definition of the html attributes accepted by the {@link ngTable ngTable} and {@link ngTableDynamic} directives
* The definition of the html attributes accepted by both the {@link ngTable ngTable} and {@link ngTableDynamic} directives
*/
export interface ITableInputAttributes extends IAttributes {
export interface TableHtmlAttributes extends IAttributes {
disableFilter?: string;
ngTable?: string;
ngTableDynamic?: string;
showFilter?: string;

@@ -250,1 +231,13 @@ showGroup?: string;

}
/**
* The definition of the html attributes accepted by the {@link ngTable} directive
*/
export interface DeclarativeTableHtmlAttributes extends TableHtmlAttributes {
ngTable: string;
}
/**
* The definition of the html attributes accepted by the {@link ngTableDynamic} directive
*/
export interface DynamicTableHtmlAttributes extends TableHtmlAttributes {
ngTableDynamic: string;
}

@@ -1,5 +0,6 @@

export interface IDataSettings {
applyFilter?: boolean;
applyPaging?: boolean;
applySort?: boolean;
export declare type DataSettingsPartial = Partial<DataSettings>;
export declare class DataSettings {
applyFilter: boolean;
applyPaging: boolean;
applySort: boolean;
}

@@ -0,1 +1,10 @@

var DataSettings = (function () {
function DataSettings() {
this.applyFilter = true;
this.applyPaging = true;
this.applySort = true;
}
return DataSettings;
}());
export { DataSettings };
//# sourceMappingURL=dataSettings.js.map

@@ -9,7 +9,7 @@ /// <reference types="angular" />

*/
export interface IGetDataFunc<T> {
export interface GetDataFunc<T> {
(params: NgTableParams<T>): T[] | IPromise<T[]>;
}
/**
* Variation of the {@link IGetDataFunc} function signature that allows for flexibility for
* Variation of the {@link GetDataFunc} function signature that allows for flexibility for
* the shape of the return value.

@@ -19,4 +19,4 @@ * Typcially you will use this function signature when you want to configure {@link NgTableParams}

*/
export interface IInterceptableGetDataFunc<T> {
export interface InterceptableGetDataFunc<T> {
<TResult>(params: NgTableParams<T>): TResult;
}
export * from './dataSettings';
export * from './getData';
export * from './interceptor';
export * from './ngTableDefaultGetData';
export * from './results';
//# sourceMappingURL=index.js.map

@@ -6,5 +6,5 @@ import { NgTableParams } from '../ngTableParams';

*/
export interface IInterceptor<T> {
export interface Interceptor<T> {
response?: <TData>(data: TData, params: NgTableParams<T>) => TData;
responseError?: (reason: any, params: NgTableParams<T>) => any;
}
/// <reference types="angular" />
import { IFilterOrderBy, IFilterService, IServiceProvider } from 'angular';
import { IFilterFunc } from '../filtering';
import { FilterFunc } from '../filtering';
import { NgTableParams } from '../ngTableParams';

@@ -14,4 +14,4 @@ import { NgTableEventsChannel } from '../ngTableEventsChannel';

*/
export interface IDefaultGetData<T> {
(data: T[], params: NgTableParams<T>): T[];
export interface DefaultGetData<T> {
(data: T[] | undefined, params: NgTableParams<T>): T[];
/**

@@ -27,3 +27,3 @@ * Convenience function that this service will use to apply paging to the data rows.

*/
getFilterFn(params: NgTableParams<T>): IFilterFunc<T>;
getFilterFn(params: NgTableParams<T>): FilterFunc<T>;
/**

@@ -35,3 +35,3 @@ * Returns a reference to the function that this service will use to sort data rows

/**
* Implementation of the {@link IDefaultGetDataProvider} interface
* Implementation of the {@link DefaultGetDataProvider} interface
*/

@@ -51,4 +51,4 @@ export declare class NgTableDefaultGetDataProvider implements IServiceProvider {

sortingFilterName: string;
$get: ($filter: IFilterService, ngTableEventsChannel: NgTableEventsChannel) => IDefaultGetData<any>;
$get: ($filter: IFilterService, ngTableEventsChannel: NgTableEventsChannel) => DefaultGetData<any>;
constructor();
}

@@ -10,5 +10,5 @@ /**

/**
* Implementation of the {@link IDefaultGetDataProvider} interface
* Implementation of the {@link DefaultGetDataProvider} interface
*/
export var NgTableDefaultGetDataProvider = (function () {
var NgTableDefaultGetDataProvider = (function () {
function NgTableDefaultGetDataProvider() {

@@ -31,3 +31,2 @@ /**

function ngTableDefaultGetData($filter, ngTableEventsChannel) {
var defaultDataOptions = { applyFilter: true, applySort: true, applyPaging: true };
getData.applyPaging = applyPaging;

@@ -76,3 +75,3 @@ getData.getFilterFn = getFilterFn;

}
var options = ng1.extend({}, defaultDataOptions, params.settings().dataOptions);
var options = params.settings().dataOptions;
var fData = options.applyFilter ? applyFilter(data, params) : data;

@@ -105,2 +104,3 @@ ngTableEventsChannel.publishAfterDataFiltered(params, fData);

}());
export { NgTableDefaultGetDataProvider };
//# sourceMappingURL=ngTableDefaultGetData.js.map

@@ -1,3 +0,3 @@

export declare type DataResult<T> = T | IDataRowGroup<T>;
export interface IDataRowGroup<T> {
export declare type DataResult<T> = T | DataRowGroup<T>;
export interface DataRowGroup<T> {
data: T[];

@@ -18,4 +18,4 @@ $hideRows: boolean;

*/
export declare type GroupedDataResults<T> = IDataRowGroup<T>[] & {
export declare type GroupedDataResults<T> = DataRowGroup<T>[] & {
visibleColumnCount: number;
};

@@ -1,7 +0,7 @@

export declare type FilterComparator<T> = boolean | IFilterComparatorFunc<T>;
export declare type FilterComparator<T> = boolean | FilterComparatorFunc<T>;
/**
* Signature of a function to compare two data values for equality
*/
export interface IFilterComparatorFunc<T> {
export interface FilterComparatorFunc<T> {
(actual: T, expected: T): boolean;
}

@@ -5,3 +5,3 @@ import { FilterComparator } from './filterComparator';

*/
export interface IFilterValues {
export interface FilterValues {
[name: string]: any;

@@ -12,4 +12,4 @@ }

*/
export interface IFilterFunc<T> {
(data: T[], filter: IFilterValues, filterComparator: FilterComparator<T>): T[];
export interface FilterFunc<T> {
(data: T[], filter: FilterValues, filterComparator: FilterComparator<T>): T[];
}
import { FilterComparator } from './filterComparator';
import { IFilterFunc } from './filterFunc';
import { FilterFunc } from './filterFunc';
export declare type FilterLayout = 'stack' | 'horizontal';
export interface IFilterSettings<T> {
export declare type FilterSettingsPartial<T> = Partial<FilterSettings<T>>;
export declare class FilterSettings<T> {
/**

@@ -11,4 +12,4 @@ * Use this to determine how items are matched against the filter values.

* Defaults to `undefined` which will result in a case insensitive susbstring match when
* `IDefaultGetData` service is supplying the implementation for the
* `ISettings.getData` function
* `DefaultGetData` service is supplying the implementation for the
* `Settings.getData` function
*/

@@ -18,26 +19,24 @@ filterComparator?: FilterComparator<T>;

* A duration to wait for the user to stop typing before applying the filter.
* - Defaults to 0 for small managed inmemory arrays ie where a `ISettings.dataset` argument is
* supplied to `NgTableParams.settings`.
* - Defaults to 500 milliseconds otherwise.
* Note: this delay will NOT be applied when *small* managed inmemory arrays are supplied as a
* `SettingsPartial.dataset` argument to `NgTableParams.settings`.
*/
filterDelay?: number;
filterDelay: number;
/**
* The number of elements up to which a managed inmemory array is considered small. Defaults to 10000.
* The number of elements up to which a managed inmemory array is considered small
*/
filterDelayThreshold?: number;
filterDelayThreshold: number | null;
/**
* Overrides `IDefaultGetDataProvider.filterFilterName`.
* Overrides `DefaultGetDataProvider.filterFilterName`.
* The value supplied should be the name of the angular `$filter` service that will be selected to perform
* the actual filter logic.
* Defaults to 'filter'.
*/
filterFilterName?: string;
/**
* Tells `IDefaultGetData` to use this function supplied to perform the filtering instead of selecting an angular $filter.
* Tells `DefaultGetData` to use this function supplied to perform the filtering instead of selecting an angular $filter.
*/
filterFn?: IFilterFunc<T>;
filterFn?: FilterFunc<T>;
/**
* The layout to use when multiple html templates are to rendered in a single table header column.
*/
filterLayout?: FilterLayout;
filterLayout: FilterLayout;
}

@@ -0,1 +1,41 @@

var FilterSettings = (function () {
function FilterSettings() {
/**
* Use this to determine how items are matched against the filter values.
* This setting is identical to the `comparator` parameter supported by the angular
* `$filter` filter service
*
* Defaults to `undefined` which will result in a case insensitive susbstring match when
* `DefaultGetData` service is supplying the implementation for the
* `Settings.getData` function
*/
this.filterComparator = undefined; // look for a substring match in case insensitive way
/**
* A duration to wait for the user to stop typing before applying the filter.
* Note: this delay will NOT be applied when *small* managed inmemory arrays are supplied as a
* `SettingsPartial.dataset` argument to `NgTableParams.settings`.
*/
this.filterDelay = 500;
/**
* The number of elements up to which a managed inmemory array is considered small
*/
this.filterDelayThreshold = 10000;
/**
* Overrides `DefaultGetDataProvider.filterFilterName`.
* The value supplied should be the name of the angular `$filter` service that will be selected to perform
* the actual filter logic.
*/
this.filterFilterName = undefined;
/**
* Tells `DefaultGetData` to use this function supplied to perform the filtering instead of selecting an angular $filter.
*/
this.filterFn = undefined;
/**
* The layout to use when multiple html templates are to rendered in a single table header column.
*/
this.filterLayout = 'stack';
}
return FilterSettings;
}());
export { FilterSettings };
//# sourceMappingURL=filterSettings.js.map

@@ -1,4 +0,2 @@

export * from './filterComparator';
export * from './filterFunc';
export * from './filterSettings';
//# sourceMappingURL=index.js.map
/// <reference types="angular" />
import { IPromise } from 'angular';
import { NgTableParams } from '../ngTableParams';
import { IDataRowGroup } from '../data';
import { DataRowGroup } from '../data';
/**

@@ -10,4 +10,4 @@ * Signature of a function that will called whenever {@link NgTableParams} requires to group

*/
export interface IGetGroupFunc<T> {
(params: NgTableParams<T>): IDataRowGroup<T>[] | IPromise<IDataRowGroup<T>[]>;
export interface GetGroupFunc<T> {
(params: NgTableParams<T>): DataRowGroup<T>[] | IPromise<DataRowGroup<T>[]>;
}

@@ -1,4 +0,4 @@

import { SortDirection } from '../sorting';
export declare type Grouping<T> = IGroupValues | IGroupingFunc<T>;
export declare type GroupSort = SortDirection | '';
import { GroupSort } from './groupSettings';
export declare type Grouping<T> = GroupValues | GroupingFunc<T>;
export declare type GroupingPartial<T> = GroupValuesPartial | GroupingFunc<T>;
/**

@@ -8,6 +8,6 @@ * Signature of a function that should return the name of the group

*/
export interface IGroupingFunc<T> {
export interface GroupingFunc<T> {
(item: T): string;
/**
* leave undefined to let the value of `ISettings.groupOptions.defaultSort` apply
* leave undefined to let the value of `Settings.groupOptions.defaultSort` apply
*/

@@ -20,4 +20,5 @@ sortDirection?: GroupSort;

*/
export interface IGroupValues {
export interface GroupValues {
[name: string]: GroupSort;
}
export declare type GroupValuesPartial = Partial<GroupValues>;
import { SortDirection } from '../sorting';
export declare type GroupSort = SortDirection | '';
export declare type GroupSettingsPartial = Partial<GroupSettings>;
/**
* Configuration that determines the data row grouping behaviour of a table
*/
export interface IGroupSettings {
export declare class GroupSettings {
/**

@@ -10,7 +12,7 @@ * The default sort direction that will be used whenever a group is supplied that

*/
defaultSort?: SortDirection;
defaultSort: SortDirection;
/**
* Determines whether groups should be displayed expanded to show their items. Defaults to true
*/
isExpanded?: boolean;
isExpanded: boolean;
}

@@ -0,1 +1,19 @@

/**
* Configuration that determines the data row grouping behaviour of a table
*/
var GroupSettings = (function () {
function GroupSettings() {
/**
* The default sort direction that will be used whenever a group is supplied that
* does not define its own sort direction
*/
this.defaultSort = 'asc';
/**
* Determines whether groups should be displayed expanded to show their items. Defaults to true
*/
this.isExpanded = true;
}
return GroupSettings;
}());
export { GroupSettings };
//# sourceMappingURL=groupSettings.js.map

@@ -1,5 +0,3 @@

export * from './getGroup';
export * from './groupingFunc';
export * from './groupSettings';
export * from './ngTableDefaultGetGroups';
//# sourceMappingURL=index.js.map
/// <reference types="angular" />
import { IQService } from 'angular';
import { IDataRowGroup, IDefaultGetData } from '../data';
import { IGetGroupFunc } from './';
import { DataRowGroup, DefaultGetData } from '../data';
import { GetGroupFunc } from './';
/**
* Implementation of the {@link IDefaultGetData IDefaultGetData} interface
* Implementation of the {@link DefaultGetData} interface
*
* @ngdoc service
*/
export declare function ngTableDefaultGetGroups<T>($q: IQService, ngTableDefaultGetData: IDefaultGetData<IDataRowGroup<T>>): IGetGroupFunc<T>;
export declare function ngTableDefaultGetGroups<T>($q: IQService, ngTableDefaultGetData: DefaultGetData<DataRowGroup<T>>): GetGroupFunc<T>;

@@ -5,3 +5,3 @@ import * as ng1 from 'angular';

/**
* Implementation of the {@link IDefaultGetData IDefaultGetData} interface
* Implementation of the {@link DefaultGetData} interface
*

@@ -15,3 +15,3 @@ * @ngdoc service

var groupFn;
var sortDirection = undefined;
var sortDirection;
if (isGroupingFun(group)) {

@@ -31,3 +31,3 @@ groupFn = group;

var originalDataOptions = settings.dataOptions;
settings.dataOptions = { applyPaging: false };
settings.dataOptions = ng1.extend({}, originalDataOptions, { applyPaging: false });
var getData = settings.getData;

@@ -34,0 +34,0 @@ var gotData = $q.when(getData(params));

@@ -1,4 +0,2 @@

export * from './getGroup';
export * from './groupingFunc';
export * from './groupSettings';
//# sourceMappingURL=publicExports.js.map
/// <reference types="angular" />
import * as angular from 'angular';
import { SettingsPartial, Settings } from './ngTableSettings';
declare const ngTableCoreModule: angular.IModule;
export { ngTableCoreModule };
export { IDefaults } from './ngTableDefaults';
export { Defaults } from './ngTableDefaults';
export * from './ngTableEventsChannel';
export { ISettings } from './ngTableSettings';
export { SettingsPartial, Settings };
export * from './ngTableParams';

@@ -9,0 +10,0 @@ export * from './data';

@@ -5,3 +5,3 @@ import * as angular from 'angular';

import { ngTableDefaults } from './ngTableDefaults';
import { NgTableSettings } from './ngTableSettings';
import { Settings } from './ngTableSettings';
import { NgTableParams } from './ngTableParams';

@@ -14,3 +14,3 @@ import { NgTableEventsChannel } from './ngTableEventsChannel';

.service('ngTableEventsChannel', NgTableEventsChannel)
.service('ngTableSettings', NgTableSettings)
.run(Settings.init)
.run(NgTableParams.init);

@@ -22,2 +22,3 @@ // note: if you are using ES6 or typescript prefer:

export * from './ngTableEventsChannel';
export { Settings };
export * from './ngTableParams';

@@ -27,4 +28,2 @@ export * from './data';

export * from './grouping/publicExports';
export * from './paging';
export * from './sorting';
//# sourceMappingURL=index.js.map

@@ -8,4 +8,4 @@ /**

*/
import { IParamValues } from './ngTableParams';
import { ISettings } from './ngTableSettings';
import { ParamValuesPartial } from './ngTableParams';
import { SettingsPartial } from './ngTableSettings';
/**

@@ -15,5 +15,5 @@ * An angular value object that allow for overriding of the initial default values used when constructing

*/
export interface IDefaults {
params?: IParamValues<any>;
settings?: ISettings<any>;
export interface Defaults {
params?: ParamValuesPartial<any>;
settings?: SettingsPartial<any>;
}

@@ -23,2 +23,2 @@ /**

*/
export declare let ngTableDefaults: IDefaults;
export declare let ngTableDefaults: Defaults;

@@ -12,3 +12,3 @@ /// <reference types="angular" />

import { DataResult } from './data';
import { IPageButton } from './paging';
import { PageButton } from './paging';
import { NgTableParams } from './ngTableParams';

@@ -18,7 +18,7 @@ /**

*/
export declare type EventSelector<T> = NgTableParams<T> | IEventSelectorFunc;
export declare type EventSelector<T> = NgTableParams<T> | EventSelectorFunc;
/**
* Signature of the event hander that is registered to receive the *afterCreated* event
*/
export interface IAfterCreatedListener {
export interface AfterCreatedListener {
(publisher: NgTableParams<any>): any;

@@ -29,3 +29,3 @@ }

*/
export interface IAfterReloadDataListener<T> {
export interface AfterReloadDataListener<T> {
(publisher: NgTableParams<T>, newData: DataResult<T>[], oldData: DataResult<T>[]): any;

@@ -36,3 +36,3 @@ }

*/
export interface IDatasetChangedListener<T> {
export interface DatasetChangedListener<T> {
(publisher: NgTableParams<T>, newDataset: T[], oldDataset: T[]): any;

@@ -44,3 +44,3 @@ }

*/
export interface IEventSelectorFunc {
export interface EventSelectorFunc {
(publisher: NgTableParams<any>): boolean;

@@ -51,4 +51,4 @@ }

*/
export interface IPagesChangedListener {
(publisher: NgTableParams<any>, newPages: IPageButton[], oldPages: IPageButton[]): any;
export interface PagesChangedListener {
(publisher: NgTableParams<any>, newPages: PageButton[], oldPages: PageButton[]): any;
}

@@ -58,3 +58,3 @@ /**

*/
export interface IAfterDataFilteredListener<T> {
export interface AfterDataFilteredListener<T> {
(publisher: NgTableParams<T>, newData: DataResult<T>[]): any;

@@ -65,3 +65,3 @@ }

*/
export interface IAfterDataSortedListener<T> {
export interface AfterDataSortedListener<T> {
(publisher: NgTableParams<T>, newData: DataResult<T>[]): any;

@@ -73,3 +73,3 @@ }

*/
export interface IUnregistrationFunc {
export interface UnregistrationFunc {
(): void;

@@ -84,3 +84,3 @@ }

* * afterReloadData - raised when the {@link NgTableParams} `reload` method has finished loading new data
* * datasetChanged - raised when {@link ISettings} `dataset` receives a new data array
* * datasetChanged - raised when {@link Settings} `dataset` receives a new data array
* * pagesChanged - raised when a new pages array has been generated

@@ -99,3 +99,3 @@ */

*/
onAfterCreated(listener: IAfterCreatedListener, scope: IScope, eventFilter?: IEventSelectorFunc): IUnregistrationFunc;
onAfterCreated(listener: AfterCreatedListener, scope: IScope, eventFilter?: EventSelectorFunc): UnregistrationFunc;
/**

@@ -109,3 +109,3 @@ * Subscribe to receive notification whenever a new `NgTableParams` instance has finished being constructed.

*/
onAfterCreated(listener: IAfterCreatedListener, eventFilter?: IEventSelectorFunc): IUnregistrationFunc;
onAfterCreated(listener: AfterCreatedListener, eventFilter?: EventSelectorFunc): UnregistrationFunc;
/**

@@ -121,3 +121,3 @@ * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed

*/
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterReloadData<T>(listener: AfterReloadDataListener<T>, scope: IScope, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -131,3 +131,3 @@ * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed

*/
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterReloadData<T>(listener: AfterReloadDataListener<T>, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -143,3 +143,3 @@ * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.

*/
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onDatasetChanged<T>(listener: DatasetChangedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -153,3 +153,3 @@ * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.

*/
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onDatasetChanged<T>(listener: DatasetChangedListener<T>, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -165,3 +165,3 @@ * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change

*/
onPagesChanged<T>(listener: IPagesChangedListener, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onPagesChanged<T>(listener: PagesChangedListener, scope: IScope, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -175,3 +175,3 @@ * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change

*/
onPagesChanged<T>(listener: IPagesChangedListener, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onPagesChanged<T>(listener: PagesChangedListener, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -183,6 +183,6 @@ * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data

* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `DefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataFiltered<T>(listener: AfterDataFilteredListener<T>, scope: IScope, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -193,6 +193,6 @@ * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data

* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `DefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataFiltered<T>(listener: AfterDataFilteredListener<T>, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -204,6 +204,6 @@ * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data

* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `DefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataSorted<T>(listener: AfterDataSortedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): UnregistrationFunc;
/**

@@ -214,10 +214,10 @@ * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data

* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `DefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataSorted<T>(listener: AfterDataSortedListener<T>, eventFilter?: EventSelector<T>): UnregistrationFunc;
publishAfterCreated<T>(publisher: NgTableParams<T>): void;
publishAfterReloadData<T>(publisher: NgTableParams<T>, newData: T[], oldData: T[]): void;
publishDatasetChanged<T>(publisher: NgTableParams<T>, newDataset: T[], oldDataset: T[]): void;
publishPagesChanged<T>(publisher: NgTableParams<T>, newPages: IPageButton[], oldPages: IPageButton[]): void;
publishDatasetChanged<T>(publisher: NgTableParams<T>, newDataset: T[] | undefined, oldDataset: T[] | undefined): void;
publishPagesChanged<T>(publisher: NgTableParams<T>, newPages: PageButton[], oldPages: PageButton[]): void;
publishAfterDataFiltered<T>(publisher: NgTableParams<T>, newData: T[]): void;

@@ -224,0 +224,0 @@ publishAfterDataSorted<T>(params: NgTableParams<T>, newData: T[]): void;

@@ -9,3 +9,3 @@ /**

import * as ng1 from 'angular';
export var NgTableEventsChannel = (function () {
var NgTableEventsChannel = (function () {
function NgTableEventsChannel($rootScope) {

@@ -26,4 +26,3 @@ this.$rootScope = $rootScope;

_a['publish' + fnName] = this.createPublishEventFn(eventName),
_a
);
_a);
return ng1.extend(target, event);

@@ -37,3 +36,3 @@ var _a;

for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}

@@ -71,6 +70,4 @@ (_a = _this.$rootScope).$broadcast.apply(_a, ['ngTable:' + eventName].concat(args));

function createEventSelectorFn(eventSelector) {
if (!eventSelector) {
return function (publisher) { return true; };
}
else if (isEventSelectorFunc(eventSelector)) {
if (eventSelector === void 0) { eventSelector = function () { return true; }; }
if (isEventSelectorFunc(eventSelector)) {
return eventSelector;

@@ -90,5 +87,6 @@ }

};
NgTableEventsChannel.$inject = ['$rootScope'];
return NgTableEventsChannel;
}());
export { NgTableEventsChannel };
NgTableEventsChannel.$inject = ['$rootScope'];
//# sourceMappingURL=ngTableEventsChannel.js.map
/// <reference types="angular" />
/// <reference types="angular-mocks" />
/**
* ngTable: Table + Angular JS
*
* @author Vitalii Savchuk <esvit666@gmail.com>
* @url https://github.com/esvit/ng-table/
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
import * as ng1 from 'angular';
import { IPromise } from 'angular';
import { IDefaults } from './ngTableDefaults';
import { ILogService, IPromise, IQService } from 'angular';
import { Defaults } from './ngTableDefaults';
import { NgTableEventsChannel } from './ngTableEventsChannel';
import { NgTableSettings, ISettings } from './ngTableSettings';
import { SettingsPartial, Settings } from './ngTableSettings';
import { DataResult } from './data';
import { IFilterValues } from './filtering';
import { Grouping, IGroupingFunc, GroupSort, IGroupValues } from './grouping';
import { ISortingValues } from './sorting';
import { IPageButton } from './paging';
import { FilterValues } from './filtering';
import { Grouping, GroupingPartial, GroupValuesPartial, GroupingFunc, GroupSort } from './grouping';
import { SortingValues } from './sorting';
import { PageButton } from './paging';
/**

@@ -26,2 +18,5 @@ * @private

}
export declare type ParamValuesPartial<T> = Partial<Pick<ParamValues<T>, 'page' | 'count' | 'filter' | 'sorting'>> & {
group?: string | GroupingPartial<T>;
};
/**

@@ -31,23 +26,23 @@ * The runtime values for {@link NgTableParams} that determine the set of data rows and

*/
export interface IParamValues<T> {
export declare class ParamValues<T> {
/**
* The index of the "slice" of data rows, starting at 1, to be displayed by the table.
*/
page?: number;
page: number;
/**
* The number of data rows per page
*/
count?: number;
count: number;
/**
* The filter that should be applied to restrict the set of data rows
*/
filter?: IFilterValues;
filter: FilterValues;
/**
* The sort order that should be applied to the data rows.
*/
sorting?: ISortingValues;
sorting: SortingValues;
/**
* The grouping that should be applied to the data rows
*/
group?: string | Grouping<T>;
group: string | Grouping<T>;
}

@@ -68,6 +63,10 @@ /**

private initialEvents;
private ngTableDefaults;
private ngTableEventsChannel;
private prevParamsMemento;
private _params;
private _settings;
constructor(baseParameters?: IParamValues<T> | boolean, baseSettings?: ISettings<T>);
private $q;
private $log;
constructor(baseParameters?: ParamValuesPartial<T> | boolean, baseSettings?: SettingsPartial<T>);
/**

@@ -87,3 +86,3 @@ * Returns the number of data rows per page

*/
filter(trim?: boolean): IFilterValues;
filter(trim?: boolean): FilterValues;
/**

@@ -93,3 +92,3 @@ * Sets filter values to the `filter` supplied; any existing filter will be removed

*/
filter(filter: IFilterValues): this;
filter(filter: FilterValues): this;
/**

@@ -104,3 +103,3 @@ * Generate array of pages.

*/
generatePagesArray(currentPage?: number, totalItems?: number, pageSize?: number, maxBlocks?: number): IPageButton[];
generatePagesArray(currentPage?: number, totalItems?: number, pageSize?: number, maxBlocks?: number): PageButton[];
/**

@@ -114,3 +113,3 @@ * Returns the current grouping used to group the data rows

*/
group(group: IGroupValues): this;
group(group: GroupValuesPartial): this;
/**

@@ -126,3 +125,3 @@ * Sets grouping to the `field` and `sortDirection` supplied; any existing grouping will be removed

*/
group(group: IGroupingFunc<T> | string, sortDirection?: GroupSort): this;
group(group: GroupingFunc<T> | string, sortDirection?: GroupSort): this;
/**

@@ -151,3 +150,3 @@ * Returns true when an attempt to `reload` the current `parameter` values have resulted in a failure.

*/
hasGroup(group: string | IGroupingFunc<T>, sortDirection?: string): boolean;
hasGroup(group: string | GroupingFunc<T>, sortDirection?: string): boolean;
/**

@@ -182,7 +181,7 @@ * Return true when a change to this instance should require the `reload` method

page(page: number): this;
parameters(): IParamValues<T>;
parameters(): ParamValues<T>;
/**
* Set new parameters
*/
parameters(newParameters?: IParamValues<T> | {
parameters(newParameters?: ParamValuesPartial<T> | {
[name: string]: string;

@@ -197,3 +196,3 @@ }, parseParamsFromUrl?: boolean): this;

*/
settings(): ISettings<T>;
settings(): Settings<T>;
/**

@@ -204,3 +203,3 @@ * Sets the settings for the table; new setting values will be merged with the existing settings.

*/
settings(newSettings: ISettings<T>): this;
settings(newSettings: SettingsPartial<T>): this;
/**

@@ -210,3 +209,3 @@ * Returns the current sorting used to order the data rows.

*/
sorting(): ISortingValues;
sorting(): SortingValues;
/**

@@ -216,7 +215,7 @@ * Sets sorting values to the `sorting` supplied; any existing sorting will be removed.

*/
sorting(sorting: ISortingValues): this;
sorting(sorting: SortingValues): this;
/**
* Sets sorting to the `field` and `direction` supplied; any existing sorting will be removed
*/
sorting(field: string, direction: string): this;
sorting(field: string, direction?: string): this;
/**

@@ -254,8 +253,3 @@ * Returns the count of the data rows that match the current `filter`

private runInterceptorPipeline(fetchedData);
private static $q;
private static $log;
private static ngTableDefaults;
private static ngTableEventsChannel;
private static ngTableSettings;
static init($q: ng1.IQService, $log: ng1.ILogService, ngTableDefaults: IDefaults, ngTableEventsChannel: NgTableEventsChannel, ngTableSettings: NgTableSettings): void;
static init($q: IQService, $log: ILogService, ngTableDefaults: Defaults, ngTableEventsChannel: NgTableEventsChannel): void;
}

@@ -10,3 +10,35 @@ /**

import { convertSortToOrderBy, isGroupingFun } from './util';
import { assignPartialDeep } from '../shared';
import { Settings } from './ngTableSettings';
/**
* The runtime values for {@link NgTableParams} that determine the set of data rows and
* how they are to be displayed in a table
*/
var ParamValues = (function () {
function ParamValues() {
/**
* The index of the "slice" of data rows, starting at 1, to be displayed by the table.
*/
this.page = 1;
/**
* The number of data rows per page
*/
this.count = 10;
/**
* The filter that should be applied to restrict the set of data rows
*/
this.filter = {};
/**
* The sort order that should be applied to the data rows.
*/
this.sorting = {};
/**
* The grouping that should be applied to the data rows
*/
this.group = {};
}
return ParamValues;
}());
export { ParamValues };
/**
* @private

@@ -20,4 +52,6 @@ */

*/
export var NgTableParams = (function () {
var NgTableParams = (function () {
function NgTableParams(baseParameters, baseSettings) {
if (baseParameters === void 0) { baseParameters = {}; }
if (baseSettings === void 0) { baseSettings = {}; }
var _this = this;

@@ -28,12 +62,6 @@ /**

this.data = [];
this.defaultSettings = NgTableParams.ngTableSettings.createDefaults();
this.defaultSettings = Settings.createWithOverrides();
this.isCommittedDataset = false;
this.initialEvents = [];
this._params = {
page: 1,
count: 10,
filter: {},
sorting: {},
group: {}
};
this._params = new ParamValues();
this._settings = this.defaultSettings;

@@ -52,10 +80,10 @@ // the ngTableController "needs" to create a dummy/null instance and it's important to know whether an instance

currentPages = newPages;
NgTableParams.ngTableEventsChannel.publishPagesChanged(_this, newPages, oldPages);
_this.ngTableEventsChannel.publishPagesChanged(_this, newPages, oldPages);
}
};
})();
ng1.extend(this._params, NgTableParams.ngTableDefaults.params);
assignPartialDeep(this._params, this.ngTableDefaults.params);
this.settings(baseSettings);
this.parameters(baseParameters, true);
NgTableParams.ngTableEventsChannel.publishAfterCreated(this);
this.ngTableEventsChannel.publishAfterCreated(this);
// run events during construction after the initial create event. That way a consumer

@@ -268,35 +296,38 @@ // can subscribe to all events for a table without "dropping" an event

NgTableParams.prototype.parameters = function (newParameters, parseParamsFromUrl) {
if (newParameters === undefined) {
return this._params;
}
// todo: move parsing of url like parameters into a seperate method
parseParamsFromUrl = parseParamsFromUrl || false;
if (typeof newParameters !== undefined) {
for (var key in newParameters) {
var value = newParameters[key];
if (parseParamsFromUrl && key.indexOf('[') >= 0) {
var keys = key.split(/\[(.*)\]/).reverse();
var lastKey = '';
for (var i = 0, len = keys.length; i < len; i++) {
var name_1 = keys[i];
if (name_1 !== '') {
var v = value;
value = {};
value[lastKey = name_1] = (isNumber(v) ? parseFloat(v) : v);
}
for (var key in newParameters) {
var value = newParameters[key];
if (parseParamsFromUrl && key.indexOf('[') >= 0) {
var keys = key.split(/\[(.*)\]/).reverse();
var lastKey = '';
for (var i = 0, len = keys.length; i < len; i++) {
var name_1 = keys[i];
if (name_1 !== '') {
var v = value;
value = {};
value[lastKey = name_1] = (isNumber(v) ? parseFloat(v) : v);
}
if (lastKey === 'sorting') {
this._params[lastKey] = {};
}
this._params[lastKey] = ng1.extend(this._params[lastKey] || {}, value[lastKey]);
}
if (lastKey === 'sorting') {
this._params[lastKey] = {};
}
this._params[lastKey] = ng1.extend(this._params[lastKey] || {}, value[lastKey]);
}
else {
if (newParameters[key] === undefined) {
}
else if (key === 'group') {
this._params[key] = this.parseGroup(newParameters[key]);
}
else {
if (key === 'group') {
this._params[key] = this.parseGroup(newParameters[key]);
}
else {
this._params[key] = (isNumber(newParameters[key]) ? parseFloat(newParameters[key]) : newParameters[key]);
}
this._params[key] = (isNumber(newParameters[key]) ? parseFloat(newParameters[key]) : newParameters[key]);
}
}
this.log('ngTable: set parameters', this._params);
return this;
}
return this._params;
this.log('ngTable: set parameters', this._params);
return this;
};

@@ -308,3 +339,3 @@ /**

var _this = this;
var pData = null;
var pData;
this._settings.$loading = true;

@@ -314,7 +345,7 @@ this.prevParamsMemento = ng1.copy(this.createComparableParams());

if (this.hasGroup()) {
pData = this.runInterceptorPipeline(NgTableParams.$q.when(this._settings.getGroups(this)));
pData = this.runInterceptorPipeline(this.$q.when(this._settings.getGroups(this)));
}
else {
var fn = this._settings.getData;
pData = this.runInterceptorPipeline(NgTableParams.$q.when(fn(this)));
pData = this.runInterceptorPipeline(this.$q.when(fn(this)));
}

@@ -329,3 +360,3 @@ this.log('ngTable: reload data');

// subscribers can always set a filter to only receive the event when data !== oldData
NgTableParams.ngTableEventsChannel.publishAfterReloadData(_this, data, oldData);
_this.ngTableEventsChannel.publishAfterReloadData(_this, data, oldData);
_this.reloadPages();

@@ -336,3 +367,3 @@ return data;

// "rethrow"
return NgTableParams.$q.reject(reason);
return _this.$q.reject(reason);
});

@@ -342,27 +373,27 @@ };

var _this = this;
if (ng1.isDefined(newSettings)) {
var settings = NgTableParams.ngTableSettings.merge(this._settings, newSettings);
var originalDataset_1 = this._settings.dataset;
this._settings = settings;
// note: using != as want null and undefined to be treated the same
var hasDatasetChanged = newSettings.hasOwnProperty('dataset') && (newSettings.dataset != originalDataset_1);
if (hasDatasetChanged) {
if (this.isCommittedDataset) {
this.page(1); // reset page as a new dataset has been supplied
}
this.isCommittedDataset = false;
var fireEvent = function () {
NgTableParams.ngTableEventsChannel.publishDatasetChanged(_this, newSettings.dataset, originalDataset_1);
};
if (this.initialEvents) {
this.initialEvents.push(fireEvent);
}
else {
fireEvent();
}
if (newSettings === undefined) {
return this._settings;
}
var settings = Settings.merge(this._settings, newSettings);
var originalDataset = this._settings.dataset;
this._settings = settings;
// note: using != as want null and undefined to be treated the same
var hasDatasetChanged = newSettings.hasOwnProperty('dataset') && (newSettings.dataset != originalDataset);
if (hasDatasetChanged) {
if (this.isCommittedDataset) {
this.page(1); // reset page as a new dataset has been supplied
}
this.log('ngTable: set settings', this._settings);
return this;
this.isCommittedDataset = false;
var fireEvent = function () {
_this.ngTableEventsChannel.publishDatasetChanged(_this, newSettings.dataset, originalDataset);
};
if (this.initialEvents) {
this.initialEvents.push(fireEvent);
}
else {
fireEvent();
}
}
return this._settings;
this.log('ngTable: set settings', this._settings);
return this;
};

@@ -372,3 +403,3 @@ NgTableParams.prototype.sorting = function (sorting, direction) {

this.parameters({
'sorting': (_a = {}, _a[sorting] = direction, _a)
'sorting': (_a = {}, _a[sorting] = direction || this.settings().defaultSort, _a)
});

@@ -393,4 +424,3 @@ return this;

NgTableParams.prototype.url = function (asString) {
// this function is an example of Typescript gone bad!!
asString = asString || false;
if (asString === void 0) { asString = false; }
var pairs = (asString ? [] : {});

@@ -444,6 +474,6 @@ for (var key in this._params) {

for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}
if (this._settings.debugMode && NgTableParams.$log.debug) {
(_a = NgTableParams.$log).debug.apply(_a, args);
if (this._settings.debugMode && this.$log.debug) {
(_a = this.$log).debug.apply(_a, args);
}

@@ -453,3 +483,3 @@ var _a;

NgTableParams.prototype.parseGroup = function (group) {
var defaultSort = this._settings.groupOptions && this._settings.groupOptions.defaultSort;
var defaultSort = this._settings.groupOptions.defaultSort;
if (!group) {

@@ -473,6 +503,5 @@ return group;

else {
return (_a = {},
return _a = {},
_a[group] = defaultSort,
_a
);
_a;
}

@@ -483,6 +512,5 @@ var _a;

var _this = this;
var interceptors = this._settings.interceptors || [];
return interceptors.reduce(function (result, interceptor) {
var thenFn = (interceptor.response && interceptor.response.bind(interceptor)) || NgTableParams.$q.when;
var rejectFn = (interceptor.responseError && interceptor.responseError.bind(interceptor)) || NgTableParams.$q.reject;
return this._settings.interceptors.reduce(function (result, interceptor) {
var thenFn = (interceptor.response && interceptor.response.bind(interceptor)) || _this.$q.when;
var rejectFn = (interceptor.responseError && interceptor.responseError.bind(interceptor)) || _this.$q.reject;
return result.then(function (data) {

@@ -495,12 +523,11 @@ return thenFn(data, _this);

};
NgTableParams.init = function ($q, $log, ngTableDefaults, ngTableEventsChannel, ngTableSettings) {
NgTableParams.$q = $q;
NgTableParams.$log = $log;
NgTableParams.ngTableDefaults = ngTableDefaults;
NgTableParams.ngTableEventsChannel = ngTableEventsChannel;
NgTableParams.ngTableSettings = ngTableSettings;
NgTableParams.init = function ($q, $log, ngTableDefaults, ngTableEventsChannel) {
ng1.extend(NgTableParams.prototype, {
$q: $q, $log: $log, ngTableDefaults: ngTableDefaults, ngTableEventsChannel: ngTableEventsChannel
});
};
return NgTableParams;
}());
NgTableParams.init.$inject = ['$q', '$log', 'ngTableDefaults', 'ngTableEventsChannel', 'ngTableSettings'];
export { NgTableParams };
NgTableParams.init.$inject = ['$q', '$log', 'ngTableDefaults', 'ngTableEventsChannel'];
//# sourceMappingURL=ngTableParams.js.map

@@ -1,5 +0,5 @@

import { IDefaults } from './ngTableDefaults';
import { IDataSettings, IDefaultGetData, IGetDataFunc, IInterceptor, IInterceptableGetDataFunc } from './data';
import { IFilterSettings } from './filtering';
import { IGetGroupFunc, IGroupSettings } from './grouping';
import { Defaults } from './ngTableDefaults';
import { DataSettingsPartial, DataSettings, DefaultGetData, GetDataFunc, Interceptor, InterceptableGetDataFunc } from './data';
import { FilterSettingsPartial, FilterSettings } from './filtering';
import { GetGroupFunc, GroupSettingsPartial, GroupSettings } from './grouping';
import { SortDirection } from './sorting';

@@ -9,8 +9,14 @@ /**

*/
export interface ISettings<T> {
export declare class Settings<T> {
constructor();
/**
* Returns true whenever a call to `getData` is in progress
*/
$loading?: boolean;
$loading: boolean;
/**
* The page size buttons that should be displayed. Each value defined in the array
* determines the possible values that can be supplied to {@link NgTableParams} `page`
*/
counts: number[];
/**
* An array that contains all the data rows that table should manage.

@@ -21,4 +27,4 @@ * The `gateData` function will be used to manage the data rows

dataset?: T[];
dataOptions?: IDataSettings;
debugMode?: boolean;
dataOptions: DataSettings;
debugMode: boolean;
/**

@@ -28,3 +34,3 @@ * The total number of data rows before paging has been applied.

*/
total?: number;
total: number;
/**

@@ -34,53 +40,48 @@ * The default sort direction that will be used whenever a sorting is supplied that

*/
defaultSort?: SortDirection;
filterOptions?: IFilterSettings<T>;
groupOptions?: IGroupSettings;
defaultSort: SortDirection;
filterOptions: FilterSettings<T>;
/**
* The page size buttons that should be displayed. Each value defined in the array
* determines the possible values that can be supplied to {@link NgTableParams} `page`
* The function that will be used fetch data rows. Leave undefined to let the {@link IDefaultGetData}
* service provide a default implementation that will work with the `dataset` array you supply.
*
* Typically you will supply a custom function when you need to execute filtering, paging and sorting
* on the server
*/
counts?: number[];
getData: GetDataFunc<T> | InterceptableGetDataFunc<T>;
/**
* The function that will be used group data rows according to the groupings returned by {@link NgTableParams} `group`
*/
getGroups: GetGroupFunc<T>;
groupOptions: GroupSettings;
/**
* The collection of interceptors that should apply to the results of a call to
* the `getData` function before the data rows are displayed in the table
*/
interceptors?: IInterceptor<T>[];
interceptors: Interceptor<T>[];
/**
* Configuration for the template that will display the page size buttons
*/
paginationMaxBlocks?: number;
paginationMaxBlocks: number;
/**
* Configuration for the template that will display the page size buttons
*/
paginationMinBlocks?: number;
paginationMinBlocks: number;
/**
* The html tag that will be used to display the sorting indicator in the table header
*/
sortingIndicator?: string;
/**
* The function that will be used fetch data rows. Leave undefined to let the {@link IDefaultGetData}
* service provide a default implementation that will work with the `dataset` array you supply.
*
* Typically you will supply a custom function when you need to execute filtering, paging and sorting
* on the server
*/
getData?: IGetDataFunc<T> | IInterceptableGetDataFunc<T>;
/**
* The function that will be used group data rows according to the groupings returned by {@link NgTableParams} `group`
*/
getGroups?: IGetGroupFunc<T>;
sortingIndicator: string;
static isInitialized: boolean;
private static defaultGetData;
private static defaultGetGroups;
private static ngTableDefaults;
private static instance;
static createWithOverrides<T>(): Settings<T>;
static merge<T>(existing: Settings<T>, newSettings: SettingsPartial<T>): Settings<T>;
private static optimizeFilterDelay<T>(settings);
static init(ngTableDefaultGetData: DefaultGetData<any>, ngTableDefaultGetGroups: GetGroupFunc<any>, ngTableDefaults: Defaults): void;
}
/**
* @private
*/
export declare class NgTableSettings {
private ngTableDefaults;
private ngTableDefaultGetData;
private ngTableDefaultGetGroups;
static $inject: string[];
private defaults;
constructor(ngTableDefaults: IDefaults, ngTableDefaultGetData: IDefaultGetData<any>, ngTableDefaultGetGroups: IGetGroupFunc<any>);
createDefaults<T>(): ISettings<T>;
merge<T>(existing: ISettings<T>, newSettings: ISettings<T>): ISettings<T>;
private optimizeFilterDelay<T>(settings);
}
export declare type SettingsPartial<T> = Partial<Pick<Settings<T>, '$loading' | 'counts' | 'dataset' | 'debugMode' | 'total' | 'defaultSort' | 'getData' | 'getGroups' | 'interceptors' | 'paginationMaxBlocks' | 'paginationMinBlocks' | 'sortingIndicator'>> & {
dataOptions?: DataSettingsPartial;
filterOptions?: FilterSettingsPartial<T>;
groupOptions?: GroupSettingsPartial;
};
import * as ng1 from 'angular';
import { assignPartialDeep, checkClassInit } from '../shared';
import { DataSettings } from './data';
import { FilterSettings } from './filtering';
import { GroupSettings } from './grouping';
/**
* @private
* Configuration settings for {@link NgTableParams}
*/
export var NgTableSettings = (function () {
function NgTableSettings(ngTableDefaults, ngTableDefaultGetData, ngTableDefaultGetGroups) {
var _this = this;
this.ngTableDefaults = ngTableDefaults;
this.ngTableDefaultGetData = ngTableDefaultGetData;
this.ngTableDefaultGetGroups = ngTableDefaultGetGroups;
this.defaults = {
$loading: false,
dataset: null,
total: 0,
defaultSort: 'desc',
counts: [10, 25, 50, 100],
filterOptions: {
filterComparator: undefined,
filterDelay: 500,
filterDelayThreshold: 10000,
filterFilterName: undefined,
filterFn: undefined,
filterLayout: 'stack'
},
getData: function (params) {
return _this.ngTableDefaultGetData(params.settings().dataset, params);
},
getGroups: this.ngTableDefaultGetGroups,
groupOptions: {
defaultSort: 'asc',
isExpanded: true
},
interceptors: [],
paginationMaxBlocks: 11,
paginationMinBlocks: 5,
sortingIndicator: 'span'
};
var Settings = (function () {
function Settings() {
/**
* Returns true whenever a call to `getData` is in progress
*/
this.$loading = false;
/**
* The page size buttons that should be displayed. Each value defined in the array
* determines the possible values that can be supplied to {@link NgTableParams} `page`
*/
this.counts = [10, 25, 50, 100];
/**
* An array that contains all the data rows that table should manage.
* The `gateData` function will be used to manage the data rows
* that ultimately will be displayed.
*/
this.dataset = undefined;
this.dataOptions = new DataSettings();
this.debugMode = false;
/**
* The total number of data rows before paging has been applied.
* Typically you will not need to supply this yourself
*/
this.total = 0;
/**
* The default sort direction that will be used whenever a sorting is supplied that
* does not define its own sort direction
*/
this.defaultSort = 'desc';
this.filterOptions = new FilterSettings();
/**
* The function that will be used fetch data rows. Leave undefined to let the {@link IDefaultGetData}
* service provide a default implementation that will work with the `dataset` array you supply.
*
* Typically you will supply a custom function when you need to execute filtering, paging and sorting
* on the server
*/
this.getData = Settings.defaultGetData;
/**
* The function that will be used group data rows according to the groupings returned by {@link NgTableParams} `group`
*/
this.getGroups = Settings.defaultGetGroups;
this.groupOptions = new GroupSettings();
/**
* The collection of interceptors that should apply to the results of a call to
* the `getData` function before the data rows are displayed in the table
*/
this.interceptors = new Array();
/**
* Configuration for the template that will display the page size buttons
*/
this.paginationMaxBlocks = 11;
/**
* Configuration for the template that will display the page size buttons
*/
this.paginationMinBlocks = 5;
/**
* The html tag that will be used to display the sorting indicator in the table header
*/
this.sortingIndicator = 'span';
checkClassInit(Settings);
}
NgTableSettings.prototype.createDefaults = function () {
return this.merge(this.defaults, this.ngTableDefaults.settings);
Settings.createWithOverrides = function () {
checkClassInit(Settings);
return Settings.merge(Settings.instance, Settings.ngTableDefaults.settings || {});
};
NgTableSettings.prototype.merge = function (existing, newSettings) {
newSettings = ng1.extend({}, newSettings);
if (newSettings.filterOptions) {
newSettings.filterOptions = ng1.extend({}, existing.filterOptions || {}, newSettings.filterOptions);
Settings.merge = function (existing, newSettings) {
checkClassInit(Settings);
var optionalPropNames = ['dataset'];
var results = assignPartialDeep(ng1.copy(existing), newSettings, function (key) { return optionalPropNames.indexOf(key) !== -1; }, function (destValue, srcValue, key) {
// copy *reference* to dataset
if (key === 'dataset') {
return srcValue;
}
return undefined;
});
if (newSettings.dataset) {
results.total = newSettings.dataset.length;
Settings.optimizeFilterDelay(results);
}
if (newSettings.groupOptions) {
newSettings.groupOptions = ng1.extend({}, existing.groupOptions || {}, newSettings.groupOptions);
}
if (ng1.isArray(newSettings.dataset)) {
//auto-set the total from passed in dataset
newSettings.total = newSettings.dataset.length;
}
var results = ng1.extend({}, existing, newSettings);
if (ng1.isArray(newSettings.dataset)) {
this.optimizeFilterDelay(results);
}
return ng1.extend({}, existing, newSettings);
return results;
};
NgTableSettings.prototype.optimizeFilterDelay = function (settings) {
Settings.optimizeFilterDelay = function (settings) {
// don't debounce by default filter input when working with small synchronous datasets
if (settings.filterOptions.filterDelay === this.defaults.filterOptions.filterDelay &&
if (settings.filterOptions.filterDelay === Settings.instance.filterOptions.filterDelay &&
settings.total <= settings.filterOptions.filterDelayThreshold &&
settings.getData === this.defaults.getData) {
settings.getData === Settings.instance.getData) {
settings.filterOptions.filterDelay = 0;
}
};
NgTableSettings.$inject = ['ngTableDefaults', 'ngTableDefaultGetData', 'ngTableDefaultGetGroups'];
return NgTableSettings;
Settings.init = function (ngTableDefaultGetData, ngTableDefaultGetGroups, ngTableDefaults) {
Settings.defaultGetData = function (params) {
return ngTableDefaultGetData(params.settings().dataset, params);
};
Settings.defaultGetGroups = ngTableDefaultGetGroups;
Settings.ngTableDefaults = ngTableDefaults;
Settings.isInitialized = true;
Settings.instance = new Settings();
};
return Settings;
}());
export { Settings };
Settings.isInitialized = false;
Settings.init.$inject = ['ngTableDefaultGetData', 'ngTableDefaultGetGroups', 'ngTableDefaults'];
//# sourceMappingURL=ngTableSettings.js.map
/**
* Definition of the buttons rendered by the data row pager directive
*/
export interface IPageButton {
export interface PageButton {
type: string;

@@ -6,0 +6,0 @@ number?: number;

export declare type SortDirection = 'asc' | 'desc';
/**
* Map of the names of fields on a data row and the corrosponding sort direction;
* Set the value of a key to undefined to let value of {@link ISettings} `defaultSort` apply
* Set the value of a key to undefined to let value of {@link Settings} `defaultSort` apply
*/
export interface ISortingValues {
export interface SortingValues {
[name: string]: SortDirection;
}

@@ -1,10 +0,10 @@

import { Grouping, IGroupingFunc } from './grouping';
import { ISortingValues } from './sorting';
import { GroupingPartial, GroupingFunc } from './grouping';
import { SortingValues } from './sorting';
/**
* @private
*/
export declare function convertSortToOrderBy(sorting: ISortingValues): string[];
export declare function convertSortToOrderBy(sorting: SortingValues): string[];
/**
* @private
*/
export declare function isGroupingFun(val: string | Grouping<any>): val is IGroupingFunc<any>;
export declare function isGroupingFun(val: string | GroupingPartial<any>): val is GroupingFunc<any>;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc