-
Notifications
You must be signed in to change notification settings - Fork 9
/
ng-table.min.js
3 lines (3 loc) · 37.1 KB
/
ng-table.min.js
1
2
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 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="">«</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="">…</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="">»</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