{"version":3,"file":"vendors-node_modules_au-table_dist_commonjs_index_js.d152cf98c45d962fa693.bundle.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC1bA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5BA;AACA;AACA;AACA","sources":["webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/au-table-pagination.js","webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/au-table-select.js","webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/au-table-sort.js","webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/au-table.js","webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/index.js","webpack://HRMSPortal/./node_modules/au-table/dist/commonjs/au-table-pagination.html"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AutPaginationCustomElement = undefined;\n\nvar _dec, _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;\n\nvar _aureliaFramework = require('aurelia-framework');\n\nfunction _initDefineProp(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\nfunction _initializerWarningHelper(descriptor, context) {\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n}\n\nvar AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (_class = function () {\n function AutPaginationCustomElement() {\n _classCallCheck(this, AutPaginationCustomElement);\n\n _initDefineProp(this, 'currentPage', _descriptor, this);\n\n _initDefineProp(this, 'pageSize', _descriptor2, this);\n\n _initDefineProp(this, 'totalItems', _descriptor3, this);\n\n _initDefineProp(this, 'hideSinglePage', _descriptor4, this);\n\n _initDefineProp(this, 'paginationSize', _descriptor5, this);\n\n _initDefineProp(this, 'boundaryLinks', _descriptor6, this);\n\n _initDefineProp(this, 'firstText', _descriptor7, this);\n\n _initDefineProp(this, 'lastText', _descriptor8, this);\n\n _initDefineProp(this, 'directionLinks', _descriptor9, this);\n\n _initDefineProp(this, 'previousText', _descriptor10, this);\n\n _initDefineProp(this, 'nextText', _descriptor11, this);\n\n this.totalPages = 1;\n this.displayPages = [];\n }\n\n AutPaginationCustomElement.prototype.bind = function bind() {\n if (this.currentPage === undefined || this.currentPage === null || this.currentPage < 1) {\n this.currentPage = 1;\n }\n\n if (this.pageSize === undefined || this.pageSize === null || this.pageSize < 1) {\n this.pageSize = 5;\n }\n };\n\n AutPaginationCustomElement.prototype.totalItemsChanged = function totalItemsChanged() {\n this.currentPage = 1;\n this.calculatePages();\n };\n\n AutPaginationCustomElement.prototype.pageSizeChanged = function pageSizeChanged() {\n this.currentPage = 1;\n this.calculatePages();\n };\n\n AutPaginationCustomElement.prototype.currentPageChanged = function currentPageChanged() {\n this.calculatePages();\n };\n\n AutPaginationCustomElement.prototype.calculatePages = function calculatePages() {\n if (this.pageSize === 0) {\n this.totalPages = 1;\n } else {\n this.totalPages = this.totalItems <= this.pageSize ? 1 : Math.ceil(this.totalItems / this.pageSize);\n }\n\n if (isNaN(this.paginationSize) || this.paginationSize <= 0) {\n this.displayAllPages();\n } else {\n this.limitVisiblePages();\n }\n };\n\n AutPaginationCustomElement.prototype.displayAllPages = function displayAllPages() {\n var displayPages = [];\n\n for (var i = 1; i <= this.totalPages; i++) {\n displayPages.push({\n title: i.toString(),\n value: i\n });\n }\n this.displayPages = displayPages;\n };\n\n AutPaginationCustomElement.prototype.limitVisiblePages = function limitVisiblePages() {\n var displayPages = [];\n\n var totalTiers = Math.ceil(this.totalPages / this.paginationSize);\n\n var activeTier = Math.ceil(this.currentPage / this.paginationSize);\n\n var start = (activeTier - 1) * this.paginationSize + 1;\n var end = start + this.paginationSize;\n\n if (activeTier > 1) {\n displayPages.push({\n title: '...',\n value: start - 1\n });\n }\n\n for (var i = start; i < end; i++) {\n if (i > this.totalPages) {\n break;\n }\n\n displayPages.push({\n title: i.toString(),\n value: i\n });\n }\n\n if (activeTier < totalTiers) {\n displayPages.push({\n title: '...',\n value: end\n });\n }\n\n this.displayPages = displayPages;\n };\n\n AutPaginationCustomElement.prototype.selectPage = function selectPage(page) {\n if (page < 1 || page > this.totalPages || page === this.currentPage) {\n return;\n }\n\n this.currentPage = page;\n };\n\n AutPaginationCustomElement.prototype.nextPage = function nextPage() {\n if (this.currentPage < this.totalPages) {\n this.currentPage++;\n }\n };\n\n AutPaginationCustomElement.prototype.previousPage = function previousPage() {\n if (this.currentPage > 1) {\n this.currentPage--;\n }\n };\n\n AutPaginationCustomElement.prototype.firstPage = function firstPage() {\n this.currentPage = 1;\n };\n\n AutPaginationCustomElement.prototype.lastPage = function lastPage() {\n this.currentPage = this.totalPages;\n };\n\n return AutPaginationCustomElement;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'currentPage', [_dec], {\n enumerable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'pageSize', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'totalItems', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'hideSinglePage', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return true;\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, 'paginationSize', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, 'boundaryLinks', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, 'firstText', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return 'First';\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, 'lastText', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return 'Last';\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, 'directionLinks', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return true;\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, 'previousText', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return '<';\n }\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, 'nextText', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return '>';\n }\n})), _class));","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AutSelectCustomAttribute = undefined;\n\nvar _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;\n\nvar _aureliaFramework = require('aurelia-framework');\n\nvar _auTable = require('./au-table');\n\nfunction _initDefineProp(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\nfunction _initializerWarningHelper(descriptor, context) {\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n}\n\nvar AutSelectCustomAttribute = exports.AutSelectCustomAttribute = (_dec = (0, _aureliaFramework.inject)(_auTable.AureliaTableCustomAttribute, Element, _aureliaFramework.BindingEngine), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec(_class = (_class2 = function () {\n function AutSelectCustomAttribute(auTable, element, bindingEngine) {\n var _this = this;\n\n _classCallCheck(this, AutSelectCustomAttribute);\n\n _initDefineProp(this, 'row', _descriptor, this);\n\n _initDefineProp(this, 'mode', _descriptor2, this);\n\n _initDefineProp(this, 'selectedClass', _descriptor3, this);\n\n _initDefineProp(this, 'custom', _descriptor4, this);\n\n this.auTable = auTable;\n this.element = element;\n this.bindingEngine = bindingEngine;\n\n this.rowSelectedListener = function (event) {\n _this.handleRowSelected(event);\n };\n }\n\n AutSelectCustomAttribute.prototype.attached = function attached() {\n var _this2 = this;\n\n if (!this.custom) {\n this.element.style.cursor = 'pointer';\n this.element.addEventListener('click', this.rowSelectedListener);\n }\n\n this.selectedSubscription = this.bindingEngine.propertyObserver(this.row, '$isSelected').subscribe(function () {\n return _this2.isSelectedChanged();\n });\n\n this.setClass();\n };\n\n AutSelectCustomAttribute.prototype.detached = function detached() {\n if (!this.custom) {\n this.element.removeEventListener('click', this.rowSelectedListener);\n }\n\n this.selectedSubscription.dispose();\n };\n\n AutSelectCustomAttribute.prototype.setClass = function setClass() {\n if (this.row.$isSelected) {\n this.element.classList.add(this.selectedClass);\n } else {\n this.element.classList.remove(this.selectedClass);\n }\n };\n\n AutSelectCustomAttribute.prototype.handleRowSelected = function handleRowSelected(event) {\n var source = event.target || event.srcElement;\n if (source.tagName.toLowerCase() !== 'td') {\n return;\n }\n this.row.$isSelected = this.row.$isSelected ? false : true;\n };\n\n AutSelectCustomAttribute.prototype.dispatchSelectedEvent = function dispatchSelectedEvent() {\n var selectedEvent = void 0;\n if (window.CustomEvent) {\n selectedEvent = new CustomEvent('select', {\n detail: { row: this.row },\n bubbles: true\n });\n } else {\n selectedEvent = document.createEvent('CustomEvent');\n selectedEvent.initCustomEvent('select', true, true, {\n detail: { row: this.row }\n });\n }\n this.element.dispatchEvent(selectedEvent);\n };\n\n AutSelectCustomAttribute.prototype.isSelectedChanged = function isSelectedChanged() {\n this.setClass();\n\n if (this.row.$isSelected) {\n if (this.mode === 'single') {\n this.deselectAll();\n }\n\n this.dispatchSelectedEvent();\n }\n };\n\n AutSelectCustomAttribute.prototype.deselectAll = function deselectAll() {\n var _this3 = this;\n\n this.auTable.data.forEach(function (item) {\n if (item !== _this3.row) {\n item.$isSelected = false;\n }\n });\n };\n\n return AutSelectCustomAttribute;\n}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'row', [_dec2], {\n enumerable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'mode', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return 'single';\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'selectedClass', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return 'aut-row-selected';\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'custom', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: function initializer() {\n return false;\n }\n})), _class2)) || _class);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AutSortCustomAttribute = undefined;\n\nvar _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3;\n\nvar _aureliaFramework = require('aurelia-framework');\n\nvar _auTable = require('./au-table');\n\nfunction _initDefineProp(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\nfunction _initializerWarningHelper(descriptor, context) {\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n}\n\nvar AutSortCustomAttribute = exports.AutSortCustomAttribute = (_dec = (0, _aureliaFramework.inject)(_auTable.AureliaTableCustomAttribute, Element), _dec(_class = (_class2 = function () {\n function AutSortCustomAttribute(auTable, element) {\n var _this = this;\n\n _classCallCheck(this, AutSortCustomAttribute);\n\n _initDefineProp(this, 'key', _descriptor, this);\n\n _initDefineProp(this, 'custom', _descriptor2, this);\n\n _initDefineProp(this, 'default', _descriptor3, this);\n\n this.order = 0;\n this.orderClasses = ['aut-desc', 'aut-sortable', 'aut-asc'];\n this.ignoreEvent = false;\n\n this.auTable = auTable;\n this.element = element;\n\n this.rowSelectedListener = function () {\n _this.handleHeaderClicked();\n };\n\n this.sortChangedListener = function () {\n _this.handleSortChanged();\n };\n }\n\n AutSortCustomAttribute.prototype.handleSortChanged = function handleSortChanged() {\n if (!this.ignoreEvent) {\n this.order = 0;\n this.setClass();\n } else {\n this.ignoreEvent = false;\n }\n };\n\n AutSortCustomAttribute.prototype.attached = function attached() {\n if (this.key || this.custom) {\n this.element.style.cursor = 'pointer';\n this.element.classList.add('aut-sort');\n\n this.element.addEventListener('click', this.rowSelectedListener);\n this.auTable.addSortChangedListener(this.sortChangedListener);\n\n this.handleDefault();\n this.setClass();\n }\n };\n\n AutSortCustomAttribute.prototype.detached = function detached() {\n this.element.removeEventListener('click', this.rowSelectedListener);\n this.auTable.removeSortChangedListener(this.sortChangedListener);\n };\n\n AutSortCustomAttribute.prototype.handleDefault = function handleDefault() {\n if (this.default) {\n this.order = this.default === 'desc' ? -1 : 1;\n this.doSort();\n }\n };\n\n AutSortCustomAttribute.prototype.doSort = function doSort() {\n this.ignoreEvent = true;\n this.auTable.sortChanged(this.key, this.custom, this.order);\n };\n\n AutSortCustomAttribute.prototype.setClass = function setClass() {\n var _this2 = this;\n\n this.orderClasses.forEach(function (next) {\n return _this2.element.classList.remove(next);\n });\n this.element.classList.add(this.orderClasses[this.order + 1]);\n };\n\n AutSortCustomAttribute.prototype.handleHeaderClicked = function handleHeaderClicked() {\n this.order = this.order === 0 || this.order === -1 ? this.order + 1 : -1;\n this.setClass();\n this.doSort();\n };\n\n return AutSortCustomAttribute;\n}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'key', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'custom', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'default', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n})), _class2)) || _class);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AureliaTableCustomAttribute = undefined;\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;\n\nvar _aureliaFramework = require('aurelia-framework');\n\nfunction _initDefineProp(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\nfunction _initializerWarningHelper(descriptor, context) {\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n}\n\nvar AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec3 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec4 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec5 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec(_class = (_class2 = function () {\n function AureliaTableCustomAttribute(bindingEngine) {\n _classCallCheck(this, AureliaTableCustomAttribute);\n\n _initDefineProp(this, 'data', _descriptor, this);\n\n _initDefineProp(this, 'displayData', _descriptor2, this);\n\n _initDefineProp(this, 'filters', _descriptor3, this);\n\n _initDefineProp(this, 'currentPage', _descriptor4, this);\n\n _initDefineProp(this, 'pageSize', _descriptor5, this);\n\n _initDefineProp(this, 'totalItems', _descriptor6, this);\n\n _initDefineProp(this, 'api', _descriptor7, this);\n\n this.isAttached = false;\n this.sortChangedListeners = [];\n this.beforePagination = [];\n this.filterObservers = [];\n\n this.bindingEngine = bindingEngine;\n }\n\n AureliaTableCustomAttribute.prototype.bind = function bind() {\n var _this = this;\n\n if (Array.isArray(this.data)) {\n this.dataObserver = this.bindingEngine.collectionObserver(this.data).subscribe(function () {\n return _this.applyPlugins();\n });\n }\n\n if (Array.isArray(this.filters)) {\n for (var _iterator = this.filters, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var filter = _ref;\n\n var observer = this.bindingEngine.propertyObserver(filter, 'value').subscribe(function () {\n return _this.filterChanged();\n });\n this.filterObservers.push(observer);\n }\n }\n\n this.api = {\n revealItem: function revealItem(item) {\n return _this.revealItem(item);\n }\n };\n };\n\n AureliaTableCustomAttribute.prototype.attached = function attached() {\n this.isAttached = true;\n this.applyPlugins();\n };\n\n AureliaTableCustomAttribute.prototype.detached = function detached() {\n if (this.dataObserver) {\n this.dataObserver.dispose();\n }\n\n for (var _iterator2 = this.filterObservers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray2) {\n if (_i2 >= _iterator2.length) break;\n _ref2 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) break;\n _ref2 = _i2.value;\n }\n\n var observer = _ref2;\n\n observer.dispose();\n }\n };\n\n AureliaTableCustomAttribute.prototype.filterChanged = function filterChanged() {\n if (this.hasPagination()) {\n this.currentPage = 1;\n }\n this.applyPlugins();\n };\n\n AureliaTableCustomAttribute.prototype.currentPageChanged = function currentPageChanged() {\n this.applyPlugins();\n };\n\n AureliaTableCustomAttribute.prototype.pageSizeChanged = function pageSizeChanged() {\n this.applyPlugins();\n };\n\n AureliaTableCustomAttribute.prototype.getDataCopy = function getDataCopy() {\n return [].concat(this.data);\n };\n\n AureliaTableCustomAttribute.prototype.applyPlugins = function applyPlugins() {\n if (!this.isAttached || !this.data) {\n return;\n }\n\n var localData = this.getDataCopy();\n\n if (this.hasFilter()) {\n localData = this.doFilter(localData);\n }\n\n if ((this.sortKey || this.customSort) && this.sortOrder !== 0) {\n this.doSort(localData);\n }\n\n this.totalItems = localData.length;\n\n if (this.hasPagination()) {\n this.beforePagination = [].concat(localData);\n localData = this.doPaginate(localData);\n }\n\n this.displayData = localData;\n };\n\n AureliaTableCustomAttribute.prototype.doFilter = function doFilter(toFilter) {\n var filteredData = [];\n\n for (var _iterator3 = toFilter, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray3) {\n if (_i3 >= _iterator3.length) break;\n _ref3 = _iterator3[_i3++];\n } else {\n _i3 = _iterator3.next();\n if (_i3.done) break;\n _ref3 = _i3.value;\n }\n\n var item = _ref3;\n\n var passed = true;\n\n for (var _iterator4 = this.filters, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {\n var _ref4;\n\n if (_isArray4) {\n if (_i4 >= _iterator4.length) break;\n _ref4 = _iterator4[_i4++];\n } else {\n _i4 = _iterator4.next();\n if (_i4.done) break;\n _ref4 = _i4.value;\n }\n\n var filter = _ref4;\n\n if (!this.passFilter(item, filter)) {\n passed = false;\n break;\n }\n }\n\n if (passed) {\n filteredData.push(item);\n }\n }\n\n return filteredData;\n };\n\n AureliaTableCustomAttribute.prototype.passFilter = function passFilter(item, filter) {\n if (typeof filter.custom === 'function' && !filter.custom(filter.value, item)) {\n return false;\n }\n\n if (filter.value === null || filter.value === undefined || !Array.isArray(filter.keys)) {\n return true;\n }\n\n for (var _iterator5 = filter.keys, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {\n var _ref5;\n\n if (_isArray5) {\n if (_i5 >= _iterator5.length) break;\n _ref5 = _iterator5[_i5++];\n } else {\n _i5 = _iterator5.next();\n if (_i5.done) break;\n _ref5 = _i5.value;\n }\n\n var key = _ref5;\n\n var value = this.getPropertyValue(item, key);\n\n if (value !== null && value !== undefined) {\n value = value.toString().toLowerCase();\n\n if (value.indexOf(filter.value.toString().toLowerCase()) > -1) {\n return true;\n }\n }\n }\n return false;\n };\n\n AureliaTableCustomAttribute.prototype.doSort = function doSort(toSort) {\n var _this2 = this;\n\n toSort.sort(function (a, b) {\n if (typeof _this2.customSort === 'function') {\n return _this2.customSort(a, b, _this2.sortOrder);\n }\n\n var val1 = void 0;\n var val2 = void 0;\n\n if (typeof _this2.sortKey === 'function') {\n val1 = _this2.sortKey(a, _this2.sortOrder);\n val2 = _this2.sortKey(b, _this2.sortOrder);\n } else {\n val1 = _this2.getPropertyValue(a, _this2.sortKey);\n val2 = _this2.getPropertyValue(b, _this2.sortKey);\n }\n\n if (val1 === null || val1 === undefined) val1 = '';\n if (val2 === null || val2 === undefined) val2 = '';\n\n if (_this2.isNumeric(val1) && _this2.isNumeric(val2)) {\n return (val1 - val2) * _this2.sortOrder;\n }\n\n var str1 = val1.toString();\n var str2 = val2.toString();\n\n return str1.localeCompare(str2) * _this2.sortOrder;\n });\n };\n\n AureliaTableCustomAttribute.prototype.getPropertyValue = function getPropertyValue(object, keyPath) {\n keyPath = keyPath.replace(/\\[(\\w+)\\]/g, '.$1');\n keyPath = keyPath.replace(/^\\./, '');\n var a = keyPath.split('.');\n for (var i = 0, n = a.length; i < n; ++i) {\n var k = a[i];\n if (k in object) {\n object = object[k];\n } else {\n return;\n }\n }\n return object;\n };\n\n AureliaTableCustomAttribute.prototype.isNumeric = function isNumeric(toCheck) {\n return !isNaN(parseFloat(toCheck)) && isFinite(toCheck);\n };\n\n AureliaTableCustomAttribute.prototype.doPaginate = function doPaginate(toPaginate) {\n if (toPaginate.length <= this.pageSize) {\n return toPaginate;\n }\n\n var start = (this.currentPage - 1) * this.pageSize;\n\n var end = start + this.pageSize;\n\n return toPaginate.slice(start, end);\n };\n\n AureliaTableCustomAttribute.prototype.hasFilter = function hasFilter() {\n return Array.isArray(this.filters) && this.filters.length > 0;\n };\n\n AureliaTableCustomAttribute.prototype.hasPagination = function hasPagination() {\n return this.currentPage > 0 && this.pageSize > 0;\n };\n\n AureliaTableCustomAttribute.prototype.dataChanged = function dataChanged() {\n var _this3 = this;\n\n if (this.dataObserver) {\n this.dataObserver.dispose();\n }\n\n this.dataObserver = this.bindingEngine.collectionObserver(this.data).subscribe(function () {\n return _this3.applyPlugins();\n });\n\n this.applyPlugins();\n };\n\n AureliaTableCustomAttribute.prototype.sortChanged = function sortChanged(key, custom, order) {\n this.sortKey = key;\n this.customSort = custom;\n this.sortOrder = order;\n this.applyPlugins();\n this.emitSortChanged();\n };\n\n AureliaTableCustomAttribute.prototype.addSortChangedListener = function addSortChangedListener(callback) {\n this.sortChangedListeners.push(callback);\n };\n\n AureliaTableCustomAttribute.prototype.removeSortChangedListener = function removeSortChangedListener(callback) {\n this.removeListener(callback, this.sortChangedListeners);\n };\n\n AureliaTableCustomAttribute.prototype.emitSortChanged = function emitSortChanged() {\n for (var _iterator6 = this.sortChangedListeners, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {\n var _ref6;\n\n if (_isArray6) {\n if (_i6 >= _iterator6.length) break;\n _ref6 = _iterator6[_i6++];\n } else {\n _i6 = _iterator6.next();\n if (_i6.done) break;\n _ref6 = _i6.value;\n }\n\n var listener = _ref6;\n\n listener();\n }\n };\n\n AureliaTableCustomAttribute.prototype.removeListener = function removeListener(callback, listeners) {\n var index = listeners.indexOf(callback);\n\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n\n AureliaTableCustomAttribute.prototype.revealItem = function revealItem(item) {\n if (!this.hasPagination()) {\n return true;\n }\n\n var index = this.beforePagination.indexOf(item);\n\n if (index === -1) {\n return false;\n }\n\n this.currentPage = Math.ceil((index + 1) / this.pageSize);\n\n return true;\n };\n\n return AureliaTableCustomAttribute;\n}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'data', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'displayData', [_dec2], {\n enumerable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'filters', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'currentPage', [_dec3], {\n enumerable: true,\n initializer: null\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'pageSize', [_aureliaFramework.bindable], {\n enumerable: true,\n initializer: null\n}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'totalItems', [_dec4], {\n enumerable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'api', [_dec5], {\n enumerable: true,\n initializer: null\n})), _class2)) || _class);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AutSortCustomAttribute = exports.AutSelectCustomAttribute = exports.AutPaginationCustomElement = exports.AureliaTableCustomAttribute = undefined;\nexports.configure = configure;\n\nvar _aureliaPal = require('aurelia-pal');\n\nvar _auTable = require('./au-table');\n\nvar _auTablePagination = require('./au-table-pagination');\n\nvar _auTableSelect = require('./au-table-select');\n\nvar _auTableSort = require('./au-table-sort');\n\nfunction configure(config) {\n config.globalResources(_aureliaPal.PLATFORM.moduleName('./au-table'));\n config.globalResources(_aureliaPal.PLATFORM.moduleName('./au-table-pagination'));\n config.globalResources(_aureliaPal.PLATFORM.moduleName('./au-table-select'));\n config.globalResources(_aureliaPal.PLATFORM.moduleName('./au-table-sort'));\n}\n\nexports.AureliaTableCustomAttribute = _auTable.AureliaTableCustomAttribute;\nexports.AutPaginationCustomElement = _auTablePagination.AutPaginationCustomElement;\nexports.AutSelectCustomAttribute = _auTableSelect.AutSelectCustomAttribute;\nexports.AutSortCustomAttribute = _auTableSort.AutSortCustomAttribute;","// Module\nvar code = \"\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}