1 | {"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","ng://@bacali/ng2-smart-table/lib/lib/helpers.ts","ng://@bacali/ng2-smart-table/lib/lib/data-set/cell.ts","ng://@bacali/ng2-smart-table/lib/lib/data-set/row.ts","ng://@bacali/ng2-smart-table/lib/lib/data-set/column.ts","ng://@bacali/ng2-smart-table/lib/lib/data-set/data-set.ts","ng://@bacali/ng2-smart-table/lib/lib/grid.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-edit-mode/edit-cell-default.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-edit-mode/custom-edit.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-edit-mode/default-edit.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-edit-mode/edit-cell.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/default-editor.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/checkbox-editor.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/completer-editor.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/input-editor.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/select-editor.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-editors/textarea-editor.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-view-mode/custom-view.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell-view-mode/view-cell.component.ts","ng://@bacali/ng2-smart-table/lib/components/cell/cell.module.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/data-source.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-default.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/default-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/custom-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-types/default-filter.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-types/checkbox-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-types/completer-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-types/input-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter-types/select-filter.component.ts","ng://@bacali/ng2-smart-table/lib/components/filter/filter.module.ts","ng://@bacali/ng2-smart-table/lib/components/pager/pager.component.ts","ng://@bacali/ng2-smart-table/lib/components/pager/pager.module.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/tbody.component.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/cells/create-cancel.component.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/cells/edit-delete.component.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/cells/custom.component.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/cells/custom-item.component.ts","ng://@bacali/ng2-smart-table/lib/components/tbody/tbody.module.ts","ng://@bacali/ng2-smart-table/lib/components/thead/thead.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/actions.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/actions-title.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/add-button.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/checkbox-select-all.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/column-title.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/cells/title/title.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/rows/thead-filters-row.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/rows/thead-form-row.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/rows/thead-titles-row.component.ts","ng://@bacali/ng2-smart-table/lib/components/thead/thead.module.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/local/local.sorter.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/local/local.filter.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/local/local.pager.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/local/local.data-source.ts","ng://@bacali/ng2-smart-table/lib/ng2-smart-table.component.ts","ng://@bacali/ng2-smart-table/lib/ng2-smart-table.module.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/server/server-source.conf.ts","ng://@bacali/ng2-smart-table/lib/lib/data-source/server/server.data-source.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__decorate","decorators","target","key","desc","c","arguments","length","r","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__metadata","metadataKey","metadataValue","metadata","__read","o","n","m","Symbol","iterator","e","call","ar","next","done","push","value","error","__spread","concat","deepExtend","objects","_i","val","src","slice","forEach","obj","isArray","keys","cloneDeep","Deferred","_this","promise","Promise","resolve","reject","getDeepFromObject","object","name","defaultValue","split","level","k","prepareValue","Cell","row","column","dataSet","newValue","getColumn","getRow","getValue","getValuePrepareFunction","Function","PREPARE","getData","setValue","getId","id","getTitle","title","isEditable","index","isAddable","Row","data","_dataSet","isSelected","isInEditing","cells","process","getCell","find","el","getCells","getIsSelected","getNewData","values","assign","cell","setData","getColumns","createCell","defValue","settings","Column","type","class","width","isSortable","isFilterable","sortDirection","defaultSortDirection","editor","config","component","filter","renderComponent","getOnComponentInitFunction","onComponentInitFunction","getCompareFunction","compareFunction","valuePrepareFunction","getFilterFunction","filterFunction","getConfig","getFilterType","getFilterConfig","prepareType","indexOf","prepareSortDirection","determineType","DataSet","columnSettings","columns","rows","willSelect","createColumns","createNewRow","createRows","getRows","getFirstRow","getLastRow","findRowByData","deselectAll","selectRow","previousIsSelected","selectedRow","multipleSelectRow","selectPreviousRow","selectFirstRow","selectLastRow","willSelectFirstRow","willSelectLastRow","select","newRow","Grid","source","createFormShown","onSelectRowSource","Subject","setSettings","setSource","showActionColumn","position","isCurrentActionsPosition","isActionsVisible","getSetting","isMultiSelectVisible","getNewRow","refresh","getDataSet","prepareSource","onChanged","subscribe","changes","processDataChange","onUpdated","onSelectRow","asObservable","edit","confirmEmitter","deferred","then","newData","skipAdd","prepend","catch","err","emit","confirm","save","skipEdit","update","delete","remove","shouldProcessChange","determineRowToSelect","initialSource","getInitialSort","setSort","setPaging","sortConf","getSelectedRows","selectAllRows","status","CellComponent","inputClass","mode","edited","EventEmitter","onEdited","event","isNew","grid","createConfirm","editConfirm","tslib_1.__decorate","Input","Output","Component","selector","template","EditCellDefault","onStopEditing","onClick","stopPropagation","CustomEditComponent","resolver","_super","tslib_1.__extends","ngOnChanges","customComponent","componentFactory","resolveComponentFactory","dynamicTarget","createComponent","instance","ngOnDestroy","destroy","ViewChild","read","ViewContainerRef","static","ComponentFactoryResolver","DefaultEditComponent","getEditorType","EditCellComponent","DefaultEditor","CheckboxEditorComponent","onChange","trueVal","true","falseVal","false","checked","CompleterEditorComponent","completerService","completerStr","ngOnInit","completer","dataService","local","searchFields","titleField","descriptionField","onEditedCompleter","CompleterService","InputEditorComponent","SelectEditorComponent","TextareaEditorComponent","CustomViewComponent","createCustomComponent","callOnComponentInit","patchInstance","getPatch","rowData","ViewCellComponent","changeDetection","ChangeDetectionStrategy","OnPush","CELL_COMPONENTS","CellModule","NgModule","imports","CommonModule","FormsModule","Ng2CompleterModule","declarations","exports","DataSource","onChangedSource","onAddedSource","onUpdatedSource","onRemovedSource","emitOnChanged","load","onAdded","onRemoved","element","emitOnAdded","append","add","emitOnRemoved","emitOnUpdated","empty","conf","doEmit","setFilter","andOperator","addFilter","fieldConf","page","perPage","setPage","action","getElements","elements","paging","getPaging","getFilter","sort","getSort","FilterDefault","query","onFilter","field","search","FilterComponent","apply","firstChange","dataChangedSub","unsubscribe","dataChanges","filterConf","filters","v","DefaultFilterComponent","CustomFilterComponent","DefaultFilter","delay","changesSubscription","CheckboxFilterComponent","filterActive","inputControl","FormControl","valueChanges","pipe","debounceTime","resetFilter","preventDefault","emitEvent","CompleterFilterComponent","completerContent","map","ev","distinctUntilChanged","inputTextChanged","InputFilterComponent","SelectFilterComponent","skip","NgControl","FILTER_COMPONENTS","FilterModule","ReactiveFormsModule","PagerComponent","perPageSelect","changePage","count","currentPerPage","isPageOutOfBounce","processPageChange","initPages","getLast","shouldShow","paginate","getPage","prev","getPages","pages","Math","ceil","pagesCount","showPagesCount","middleOne","lastOne","floor","onChangePerPage","toLowerCase","PagerModule","Ng2SmartTableTbodyComponent","cancel","custom","userSelectRow","editRowSelect","rowHover","actionColumns","isActionAdd","isActionEdit","isActionDelete","showActionColumnLeft","editInputClass","showActionColumnRight","noDataMessage","TbodyCreateCancelComponent","onSave","onCancelEdit","saveButtonContent","cancelButtonContent","TbodyEditDeleteComponent","onEdit","onDelete","deleteConfirm","editRowButtonContent","deleteRowButtonContent","TbodyCustomComponent","onCustom","TbodyCustomItemComponent","TBODY_COMPONENTS","TBodyModule","Ng2SmartTableTheadComponent","isHideHeader","isHideSubHeader","ActionsComponent","createButtonContent","ActionsTitleComponent","ref","ngAfterViewInit","nativeElement","classList","actionsColumnTitle","ElementRef","AddButtonComponent","addNewButtonContent","onAdd","CheckboxSelectAllComponent","ColumnTitleComponent","TitleComponent","currentDirection","_sort","changeSortDirection","direction","compare","newDirection","TheadFitlersRowComponent","filterInputClass","TheadFormRowComponent","onCreate","addInputClass","TheadTitlesRowComponent","THEAD_COMPONENTS","THeadModule","compareValues","a","LocalSorter","customCompare","dir","filterValues","toString","includes","LocalFilter","customFilter","LocalPager","LocalDataSource","filteredAndSorted","pagingConf","reset","unshift","found","Error","prepareData","getFilteredAndSorted","getAll","silent","currentFieldConf","mergedData_1","elem","pos","arr","Ng2SmartTableComponent","rowSelect","userRowSelect","defaultSettings","selectMode","hideHeader","hideSubHeader","actions","columnTitle","editButtonContent","confirmSave","addButtonContent","confirmCreate","deleteButtonContent","confirmDelete","attr","pager","display","rowClassFunction","isAllSelected","prepareSettings","initGrid","tableId","tableClass","isPagerDisplay","onMultipleSelectRow","onUserSelectRow","emitUserSelectRow","emitSelectRow","onRowHover","onSelectAllRows","$event","resetAllSelector","selectedRows","selected","Ng2SmartTableModule","ServerSourceConf","_a","_b","_c","endPoint","_d","sortFieldKey","_e","sortDirKey","_f","pagerPageKey","_g","pagerLimitKey","_h","filterFieldKey","_j","totalKey","_k","dataKey","SORT_FIELD_KEY","SORT_DIR_KEY","PAGER_PAGE_KEY","PAGER_LIMIT_KEY","FILTER_FIELD_KEY","TOTAL_KEY","DATA_KEY","ServerDataSource","http","lastRequestCount","requestElements","res","extractTotalFromResponse","extractDataFromResponse","toPromise","rawData","body","headers","has","get","httpParams","createRequesParams","params","observe","HttpParams","addSortRequestParams","addFilterRequestParams","addPagerRequestParams","set","toUpperCase","replace"],"mappings":"wrBAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GA0B5E,SAASK,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HlB,EAAvHmB,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIH,EAAkB,OAATE,EAAgBA,EAAOhB,OAAOqB,yBAAyBP,EAAQC,GAAOC,EACrH,GAAuB,iBAAZM,SAAoD,mBAArBA,QAAQC,SAAyBH,EAAIE,QAAQC,SAASV,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIQ,EAAIX,EAAWM,OAAS,EAAGK,GAAK,EAAGA,KAAS1B,EAAIe,EAAWW,MAAIJ,GAAKH,EAAI,EAAInB,EAAEsB,GAAKH,EAAI,EA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KAAK+N,eAAemC,QAAQ,UAAW7P,EAAiB,OAAIA,EAAkB,WAK9GmP,GAGCb,EAAA1hB,UAAA8iB,sBAAV,SAAgCP,GAO9B,OALIziB,KAAKgd,YAAchd,KAAKgd,WAAiB,MAAKhd,KAAKgd,WAAoB,UAEzEyF,GADAA,EAAaA,EAAWQ,IAAIjjB,KAAKiT,KAAK2N,aAAc5gB,KAAKgd,WAAiB,OAClDiG,IAAIjjB,KAAKiT,KAAK6N,cAAe9gB,KAAKgd,WAAoB,UAGzEyF,GAEXb,GA5GsC9E","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { cloneDeep } from 'lodash';\n\n/**\n * Extending object that entered in first argument.\n *\n * Returns extended object or false if have no target object or incorrect type.\n *\n * If you wish to clone source object (without modify it), just use empty new\n * object as first argument, like this:\n * deepExtend({}, yourObj_1, [yourObj_N]);\n */\nexport const deepExtend = function(...objects: Array<any>): any {\n if (arguments.length < 1 || typeof arguments[0] !== 'object') {\n return false;\n }\n\n if (arguments.length < 2) {\n return arguments[0];\n }\n\n const target = arguments[0];\n\n // convert arguments to array and cut off target object\n const args = Array.prototype.slice.call(arguments, 1);\n\n let val, src;\n\n args.forEach((obj: any) => {\n // skip argument if it is array or isn't object\n if (typeof obj !== 'object' || Array.isArray(obj)) {\n return;\n }\n\n Object.keys(obj).forEach(function (key) {\n src = target[key]; // source value\n val = obj[key]; // new value\n\n // recursion prevention\n if (val === target) {\n return;\n\n /**\n * if new value isn't object then just overwrite by new value\n * instead of extending.\n */\n } else if (typeof val !== 'object' || val === null) {\n target[key] = val;\n return;\n\n // just clone arrays (and recursive clone objects inside)\n } else if (Array.isArray(val)) {\n target[key] = cloneDeep(val);\n return;\n\n // overwrite by new value if source isn't object or array\n } else if (typeof src !== 'object' || src === null || Array.isArray(src)) {\n target[key] = deepExtend({}, val);\n return;\n\n // source value and new value is objects both, extending...\n } else {\n target[key] = deepExtend(src, val);\n return;\n }\n });\n });\n\n return target;\n};\n\nexport class Deferred {\n\n promise: Promise<any>;\n\n resolve: any;\n reject: any;\n\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\n\n// getDeepFromObject({result: {data: 1}}, 'result.data', 2); // returns 1\nexport function getDeepFromObject(object = {}, name: string, defaultValue?: any) {\n const keys = name.split('.');\n // clone the object\n let level = deepExtend({}, object);\n keys.forEach((k) => {\n if (level && typeof level[k] !== 'undefined') {\n level = level[k];\n }\n });\n\n return typeof level === 'undefined' ? defaultValue : level;\n}\n","import { Column } from './column';\nimport { DataSet } from './data-set';\nimport { Row } from './row';\n\nexport function prepareValue (value: any) { return value }\n\nexport class Cell {\n\n newValue: any = '';\n protected static PREPARE = prepareValue;\n\n constructor(protected value: any, protected row: Row, protected column: any, protected dataSet: DataSet) {\n this.newValue = value;\n }\n\n getColumn(): Column {\n return this.column;\n }\n\n getRow(): Row {\n return this.row;\n }\n\n getValue(): any {\n const valid = this.column.getValuePrepareFunction() instanceof Function;\n const prepare = valid ? this.column.getValuePrepareFunction() : Cell.PREPARE;\n return prepare.call(null, this.value, this.row.getData(), this);\n }\n\n setValue(value: any): any {\n this.newValue = value;\n }\n\n getId(): string {\n return this.getColumn().id;\n }\n\n getTitle(): string {\n return this.getColumn().title;\n }\n\n isEditable(): boolean {\n if (this.getRow().index === -1) {\n return this.getColumn().isAddable;\n }\n else {\n return this.getColumn().isEditable;\n }\n }\n\n}\n","import { Cell } from './cell';\nimport { Column } from './column';\nimport { DataSet } from './data-set';\n\nexport class Row {\n\n isSelected: boolean = false;\n isInEditing: boolean = false;\n cells: Array<Cell> = [];\n\n\n constructor(public index: number, protected data: any, protected _dataSet: DataSet) {\n this.process();\n }\n\n getCell(column: Column): Cell {\n return this.cells.find(el => el.getColumn() === column);\n }\n\n getCells() {\n return this.cells;\n }\n\n getData(): any {\n return this.data;\n }\n\n getIsSelected(): boolean {\n return this.isSelected;\n }\n\n getNewData(): any {\n const values = Object.assign({}, this.data);\n this.getCells().forEach((cell) => values[cell.getColumn().id] = cell.newValue);\n return values;\n }\n\n setData(data: any): any {\n this.data = data;\n this.process();\n }\n\n process() {\n this.cells = [];\n this._dataSet.getColumns().forEach((column: Column) => {\n const cell = this.createCell(column);\n this.cells.push(cell);\n });\n }\n\n createCell(column: Column): Cell {\n const defValue = (column as any).settings.defaultValue ? (column as any).settings.defaultValue : '';\n const value = typeof this.data[column.id] === 'undefined' ? defValue : this.data[column.id];\n return new Cell(value, this, column, this._dataSet);\n }\n}\n","import { DataSet } from './data-set';\n\nexport class Column {\n\n title: string = '';\n type: string = '';\n class: string = '';\n width: string = '';\n isSortable: boolean = false;\n isEditable: boolean = true;\n isAddable: boolean = true;\n isFilterable: boolean = false;\n sortDirection: string = '';\n defaultSortDirection: string = '';\n editor: { type: string, config: any, component: any } = { type: '', config: {}, component: null };\n filter: { type: string, config: any, component: any } = { type: '', config: {}, component: null };\n renderComponent: any = null;\n compareFunction: Function;\n valuePrepareFunction: Function;\n filterFunction: Function;\n onComponentInitFunction: Function;\n\n constructor(public id: string, protected settings: any, protected dataSet: DataSet) {\n this.process();\n }\n\n getOnComponentInitFunction(): Function {\n return this.onComponentInitFunction;\n }\n\n getCompareFunction(): Function {\n return this.compareFunction;\n }\n\n getValuePrepareFunction(): Function {\n return this.valuePrepareFunction;\n }\n\n getFilterFunction(): Function {\n return this.filterFunction;\n }\n\n getConfig(): any {\n return this.editor && this.editor.config;\n }\n\n getFilterType(): any {\n return this.filter && this.filter.type;\n }\n\n getFilterConfig(): any {\n return this.filter && this.filter.config;\n }\n\n protected process() {\n this.title = this.settings['title'];\n this.class = this.settings['class'];\n this.width = this.settings['width'];\n this.type = this.prepareType();\n this.editor = this.settings['editor'];\n this.filter = this.settings['filter'];\n this.renderComponent = this.settings['renderComponent'];\n\n this.isFilterable = typeof this.settings['filter'] === 'undefined' ? true : !!this.settings['filter'];\n this.defaultSortDirection = ['asc', 'desc']\n .indexOf(this.settings['sortDirection']) !== -1 ? this.settings['sortDirection'] : '';\n this.isSortable = typeof this.settings['sort'] === 'undefined' ? true : !!this.settings['sort'];\n this.isEditable = typeof this.settings['editable'] === 'undefined' ? true : !!this.settings['editable'];\n this.isAddable=typeof this.settings['addable'] === 'undefined' ? true : !!this.settings['addable'];\n this.sortDirection = this.prepareSortDirection();\n\n this.compareFunction = this.settings['compareFunction'];\n this.valuePrepareFunction = this.settings['valuePrepareFunction'];\n this.filterFunction = this.settings['filterFunction'];\n this.onComponentInitFunction = this.settings['onComponentInitFunction'];\n }\n\n prepareType(): string {\n return this.settings['type'] || this.determineType();\n }\n\n prepareSortDirection(): string {\n return this.settings['sort'] === 'desc' ? 'desc' : 'asc';\n }\n\n determineType(): string {\n // TODO: determine type by data\n return 'text';\n }\n}\n","import { Row } from './row';\nimport { Column } from './column';\n\nexport class DataSet {\n\n newRow: Row;\n\n protected data: Array<any> = [];\n protected columns: Array<Column> = [];\n protected rows: Array<Row> = [];\n protected selectedRow: Row;\n protected willSelect: string = 'first';\n\n constructor(data: Array<any> = [], protected columnSettings: Object) {\n this.createColumns(columnSettings);\n this.setData(data);\n\n this.createNewRow();\n }\n\n setData(data: Array<any>) {\n this.data = data;\n this.createRows();\n }\n\n getColumns(): Array<Column> {\n return this.columns;\n }\n\n getRows(): Array<Row> {\n return this.rows;\n }\n\n getFirstRow(): Row {\n return this.rows[0];\n }\n\n getLastRow(): Row {\n return this.rows[this.rows.length - 1];\n }\n\n findRowByData(data: any): Row {\n return this.rows.find((row: Row) => row.getData() === data);\n }\n\n deselectAll() {\n this.rows.forEach((row) => {\n row.isSelected = false;\n });\n }\n\n selectRow(row: Row): Row {\n const previousIsSelected = row.isSelected;\n this.deselectAll();\n\n row.isSelected = !previousIsSelected;\n this.selectedRow = row;\n\n return this.selectedRow;\n }\n\n multipleSelectRow(row: Row): Row {\n row.isSelected = !row.isSelected;\n this.selectedRow = row;\n\n return this.selectedRow;\n }\n\n selectPreviousRow(): Row {\n if (this.rows.length > 0) {\n let index = this.selectedRow ? this.selectedRow.index : 0;\n if (index > this.rows.length - 1) {\n index = this.rows.length - 1;\n }\n this.selectRow(this.rows[index]);\n return this.selectedRow;\n }\n }\n\n selectFirstRow(): Row {\n if (this.rows.length > 0) {\n this.selectRow(this.rows[0]);\n return this.selectedRow;\n }\n }\n\n selectLastRow(): Row {\n if (this.rows.length > 0) {\n this.selectRow(this.rows[this.rows.length - 1]);\n return this.selectedRow;\n }\n }\n\n willSelectFirstRow() {\n this.willSelect = 'first';\n }\n\n willSelectLastRow() {\n this.willSelect = 'last';\n }\n\n select(): Row {\n if (this.getRows().length === 0) {\n return;\n }\n if (this.willSelect) {\n if (this.willSelect === 'first') {\n this.selectFirstRow();\n }\n if (this.willSelect === 'last') {\n this.selectLastRow();\n }\n this.willSelect = '';\n } else {\n this.selectFirstRow();\n }\n\n return this.selectedRow;\n }\n\n createNewRow() {\n this.newRow = new Row(-1, {}, this);\n this.newRow.isInEditing = true;\n }\n\n /**\n * Create columns by mapping from the settings\n * @param settings\n * @private\n */\n createColumns(settings: any) {\n for (const id in settings) {\n if (settings.hasOwnProperty(id)) {\n this.columns.push(new Column(id, settings[id], this));\n }\n }\n }\n\n /**\n * Create rows based on current data prepared in data source\n * @private\n */\n createRows() {\n this.rows = [];\n this.data.forEach((el, index) => {\n this.rows.push(new Row(index, el, this));\n });\n }\n}\n","import { Subject } from 'rxjs';\nimport { Observable } from 'rxjs';\nimport { EventEmitter } from '@angular/core';\n\nimport { Deferred, getDeepFromObject } from './helpers';\nimport { Column } from './data-set/column';\nimport { Row } from './data-set/row';\nimport { DataSet } from './data-set/data-set';\nimport { DataSource } from './data-source/data-source';\n\nexport class Grid {\n\n createFormShown: boolean = false;\n\n source: DataSource;\n settings: any;\n dataSet: DataSet;\n\n onSelectRowSource = new Subject<any>();\n\n constructor(source: DataSource, settings: any) {\n this.setSettings(settings);\n this.setSource(source);\n }\n\n showActionColumn(position: string): boolean {\n return this.isCurrentActionsPosition(position) && this.isActionsVisible();\n }\n\n isCurrentActionsPosition(position: string): boolean {\n return position == this.getSetting('actions.position');\n }\n\n isActionsVisible(): boolean {\n return this.getSetting('actions.add') || this.getSetting('actions.edit') || this.getSetting('actions.delete') || this.getSetting('actions.custom').length;\n }\n\n isMultiSelectVisible(): boolean {\n return this.getSetting('selectMode') === 'multi';\n }\n\n getNewRow(): Row {\n return this.dataSet.newRow;\n }\n\n setSettings(settings: Object) {\n this.settings = settings;\n this.dataSet = new DataSet([], this.getSetting('columns'));\n\n if (this.source) {\n this.source.refresh();\n }\n }\n\n getDataSet(): DataSet {\n return this.dataSet;\n }\n\n setSource(source: DataSource) {\n this.source = this.prepareSource(source);\n\n this.source.onChanged().subscribe((changes: any) => this.processDataChange(changes));\n\n this.source.onUpdated().subscribe((data: any) => {\n const changedRow = this.dataSet.findRowByData(data);\n changedRow.setData(data);\n });\n }\n\n getSetting(name: string, defaultValue?: any): any {\n return getDeepFromObject(this.settings, name, defaultValue);\n }\n\n getColumns(): Array<Column> {\n return this.dataSet.getColumns();\n }\n\n getRows(): Array<Row> {\n return this.dataSet.getRows();\n }\n\n selectRow(row: Row) {\n this.dataSet.selectRow(row);\n }\n\n multipleSelectRow(row: Row) {\n this.dataSet.multipleSelectRow(row);\n }\n\n onSelectRow(): Observable<any> {\n return this.onSelectRowSource.asObservable();\n }\n\n edit(row: Row) {\n row.isInEditing = true;\n }\n\n create(row: Row, confirmEmitter: EventEmitter<any>) {\n\n const deferred = new Deferred();\n deferred.promise.then((newData) => {\n newData = newData ? newData : row.getNewData();\n if (deferred.resolve.skipAdd) {\n this.createFormShown = false;\n } else {\n this.source.prepend(newData).then(() => {\n this.createFormShown = false;\n this.dataSet.createNewRow();\n });\n }\n }).catch((err) => {\n // doing nothing\n });\n\n if (this.getSetting('add.confirmCreate')) {\n confirmEmitter.emit({\n newData: row.getNewData(),\n source: this.source,\n confirm: deferred,\n });\n } else {\n deferred.resolve();\n }\n }\n\n save(row: Row, confirmEmitter: EventEmitter<any>) {\n\n const deferred = new Deferred();\n deferred.promise.then((newData) => {\n newData = newData ? newData : row.getNewData();\n if (deferred.resolve.skipEdit) {\n row.isInEditing = false;\n } else {\n this.source.update(row.getData(), newData).then(() => {\n row.isInEditing = false;\n });\n }\n }).catch((err) => {\n // doing nothing\n });\n\n if (this.getSetting('edit.confirmSave')) {\n confirmEmitter.emit({\n data: row.getData(),\n newData: row.getNewData(),\n source: this.source,\n confirm: deferred,\n });\n } else {\n deferred.resolve();\n }\n }\n\n delete(row: Row, confirmEmitter: EventEmitter<any>) {\n\n const deferred = new Deferred();\n deferred.promise.then(() => {\n this.source.remove(row.getData());\n }).catch((err) => {\n // doing nothing\n });\n\n if (this.getSetting('delete.confirmDelete')) {\n confirmEmitter.emit({\n data: row.getData(),\n source: this.source,\n confirm: deferred,\n });\n } else {\n deferred.resolve();\n }\n }\n\n processDataChange(changes: any) {\n if (this.shouldProcessChange(changes)) {\n this.dataSet.setData(changes['elements']);\n if (this.getSetting('selectMode') !== 'multi') {\n const row = this.determineRowToSelect(changes);\n\n if (row) {\n this.onSelectRowSource.next(row);\n }\n }\n }\n }\n\n shouldProcessChange(changes: any): boolean {\n if (['filter', 'sort', 'page', 'remove', 'refresh', 'load', 'paging'].indexOf(changes['action']) !== -1) {\n return true;\n } else if (['prepend', 'append'].indexOf(changes['action']) !== -1 && !this.getSetting('pager.display')) {\n return true;\n }\n\n return false;\n }\n\n // TODO: move to selectable? Separate directive\n determineRowToSelect(changes: any): Row {\n\n if (['load', 'page', 'filter', 'sort', 'refresh'].indexOf(changes['action']) !== -1) {\n return this.dataSet.select();\n }\n if (changes['action'] === 'remove') {\n if (changes['elements'].length === 0) {\n // we have to store which one to select as the data will be reloaded\n this.dataSet.willSelectLastRow();\n } else {\n return this.dataSet.selectPreviousRow();\n }\n }\n if (changes['action'] === 'append') {\n // we have to store which one to select as the data will be reloaded\n this.dataSet.willSelectLastRow();\n }\n if (changes['action'] === 'add') {\n return this.dataSet.selectFirstRow();\n }\n if (changes['action'] === 'update') {\n return this.dataSet.selectFirstRow();\n }\n if (changes['action'] === 'prepend') {\n // we have to store which one to select as the data will be reloaded\n this.dataSet.willSelectFirstRow();\n }\n return null;\n }\n\n prepareSource(source: any): DataSource {\n const initialSource: any = this.getInitialSort();\n if (initialSource && initialSource['field'] && initialSource['direction']) {\n source.setSort([initialSource], false);\n }\n if (this.getSetting('pager.display') === true) {\n source.setPaging(1, this.getSetting('pager.perPage'), false);\n }\n\n source.refresh();\n return source;\n }\n\n getInitialSort() {\n const sortConf: any = {};\n this.getColumns().forEach((column: Column) => {\n if (column.isSortable && column.defaultSortDirection) {\n sortConf['field'] = column.id;\n sortConf['direction'] = column.defaultSortDirection;\n sortConf['compare'] = column.getCompareFunction();\n }\n });\n return sortConf;\n }\n\n getSelectedRows(): Array<any> {\n return this.dataSet.getRows()\n .filter(r => r.isSelected);\n }\n\n selectAllRows(status: any) {\n this.dataSet.getRows()\n .forEach(r => r.isSelected = status);\n }\n\n getFirstRow(): Row {\n return this.dataSet.getFirstRow();\n }\n\n getLastRow(): Row {\n return this.dataSet.getLastRow();\n }\n\n}\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\n\nimport { Grid } from '../../lib/grid';\nimport { Cell } from '../../lib/data-set/cell';\nimport { Row } from '../../lib/data-set/row';\n\n@Component({\n selector: 'ng2-smart-table-cell',\n template: `\n <table-cell-view-mode *ngIf=\"!isInEditing\" [cell]=\"cell\"></table-cell-view-mode>\n <table-cell-edit-mode *ngIf=\"isInEditing\" [cell]=\"cell\"\n [inputClass]=\"inputClass\"\n (edited)=\"onEdited($event)\">\n </table-cell-edit-mode>\n `,\n})\nexport class CellComponent {\n\n @Input() grid: Grid;\n @Input() row: Row;\n @Input() editConfirm: EventEmitter<any>;\n @Input() createConfirm: EventEmitter<any>;\n @Input() isNew: boolean;\n @Input() cell: Cell;\n @Input() inputClass: string = '';\n @Input() mode: string = 'inline';\n @Input() isInEditing: boolean = false;\n\n @Output() edited = new EventEmitter<any>();\n\n onEdited(event: any) {\n if (this.isNew) {\n this.grid.create(this.grid.getNewRow(), this.createConfirm);\n } else {\n this.grid.save(this.row, this.editConfirm);\n }\n }\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\n\nimport { Cell } from '../../../lib/data-set/cell';\n\nexport class EditCellDefault {\n\n @Input() cell: Cell;\n @Input() inputClass: string = '';\n\n @Output() edited = new EventEmitter<any>();\n\n onEdited(event: any): boolean {\n this.edited.next(event);\n return false;\n }\n\n onStopEditing(): boolean {\n this.cell.getRow().isInEditing = false;\n return false;\n }\n\n onClick(event: any) {\n event.stopPropagation();\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n SimpleChanges,\n OnChanges,\n OnDestroy,\n} from '@angular/core';\n\nimport { EditCellDefault } from './edit-cell-default';\nimport { Cell } from '../../../lib/data-set/cell';\n\n@Component({\n selector: 'table-cell-custom-editor',\n template: `\n <ng-template #dynamicTarget></ng-template>\n `,\n})\nexport class CustomEditComponent extends EditCellDefault implements OnChanges, OnDestroy {\n\n customComponent: any;\n @ViewChild('dynamicTarget', { read: ViewContainerRef, static: true }) dynamicTarget: any;\n\n constructor(private resolver: ComponentFactoryResolver) {\n super();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.cell && !this.customComponent) {\n const componentFactory = this.resolver.resolveComponentFactory(this.cell.getColumn().editor.component);\n this.customComponent = this.dynamicTarget.createComponent(componentFactory);\n\n // set @Inputs and @Outputs of custom component\n this.customComponent.instance.cell = this.cell;\n this.customComponent.instance.inputClass = this.inputClass;\n this.customComponent.instance.onStopEditing.subscribe(() => this.onStopEditing());\n this.customComponent.instance.onEdited.subscribe((event: any) => this.onEdited(event));\n this.customComponent.instance.onClick.subscribe((event: any) => this.onClick(event));\n }\n }\n\n ngOnDestroy() {\n if (this.customComponent) {\n this.customComponent.destroy();\n }\n }\n}\n","import { Component } from '@angular/core';\n\nimport { EditCellDefault } from './edit-cell-default';\nimport { Cell } from '../../../lib/data-set/cell';\n\n@Component({\n selector: 'table-cell-default-editor',\n templateUrl: './default-edit.component.html',\n})\nexport class DefaultEditComponent extends EditCellDefault {\n\n constructor() {\n super();\n }\n\n getEditorType(): string {\n return this.cell.getColumn().editor && this.cell.getColumn().editor.type;\n }\n}\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\n\nimport { Cell } from '../../../lib/data-set/cell';\n\n@Component({\n selector: 'table-cell-edit-mode',\n template: `\n <div [ngSwitch]=\"getEditorType()\">\n <table-cell-custom-editor *ngSwitchCase=\"'custom'\"\n [cell]=\"cell\"\n [inputClass]=\"inputClass\"\n (edited)=\"onEdited($event)\">\n </table-cell-custom-editor>\n <table-cell-default-editor *ngSwitchDefault\n [cell]=\"cell\"\n [inputClass]=\"inputClass\"\n (edited)=\"onEdited($event)\">\n </table-cell-default-editor>\n </div>\n `,\n})\nexport class EditCellComponent {\n\n @Input() cell: Cell;\n @Input() inputClass: string = '';\n\n @Output() edited = new EventEmitter<any>();\n\n onEdited(event: any): boolean {\n this.edited.next(event);\n return false;\n }\n\n getEditorType(): string {\n return this.cell.getColumn().editor && this.cell.getColumn().editor.type;\n }\n}\n","import { Component, Output, EventEmitter, Input } from '@angular/core';\n\nimport { Cell } from '../../../lib/data-set/cell';\n\nexport class DefaultEditor implements Editor {\n @Input() cell: Cell;\n @Input() inputClass: string;\n\n @Output() onStopEditing = new EventEmitter<any>();\n @Output() onEdited = new EventEmitter<any>();\n @Output() onClick = new EventEmitter<any>();\n}\n\nexport interface Editor {\n cell: Cell;\n inputClass: string;\n onStopEditing: EventEmitter<any>;\n onEdited: EventEmitter<any>;\n onClick: EventEmitter<any>;\n}\n","import { Component } from '@angular/core';\n\nimport { DefaultEditor } from './default-editor';\n\n@Component({\n selector: 'checkbox-editor',\n styleUrls: ['./editor.component.scss'],\n template: `\n <input [ngClass]=\"inputClass\"\n type=\"checkbox\"\n class=\"form-control\"\n [name]=\"cell.getId()\"\n [disabled]=\"!cell.isEditable()\"\n [checked]=\"cell.getValue() == (cell.getColumn().getConfig()?.true || true)\"\n (click)=\"onClick.emit($event)\"\n (change)=\"onChange($event)\">\n `,\n})\nexport class CheckboxEditorComponent extends DefaultEditor {\n\n constructor() {\n super();\n }\n\n onChange(event: any) {\n const trueVal = (this.cell.getColumn().getConfig() && this.cell.getColumn().getConfig().true) || true;\n const falseVal = (this.cell.getColumn().getConfig() && this.cell.getColumn().getConfig().false) || false;\n this.cell.newValue = event.target.checked ? trueVal : falseVal;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { CompleterService } from 'ng2-completer';\n\nimport { DefaultEditor } from './default-editor';\n\n@Component({\n selector: 'completer-editor',\n template: `\n <ng2-completer [(ngModel)]=\"completerStr\"\n [dataService]=\"cell.getColumn().getConfig().completer.dataService\"\n [minSearchLength]=\"cell.getColumn().getConfig().completer.minSearchLength || 0\"\n [pause]=\"cell.getColumn().getConfig().completer.pause || 0\"\n [placeholder]=\"cell.getColumn().getConfig().completer.placeholder || 'Start typing...'\"\n (selected)=\"onEditedCompleter($event)\">\n </ng2-completer>\n `,\n})\nexport class CompleterEditorComponent extends DefaultEditor implements OnInit {\n\n completerStr: string = '';\n\n constructor(private completerService: CompleterService) {\n super();\n }\n\n ngOnInit() {\n if (this.cell.getColumn().editor && this.cell.getColumn().editor.type === 'completer') {\n const config = this.cell.getColumn().getConfig().completer;\n config.dataService = this.completerService.local(config.data, config.searchFields, config.titleField);\n config.dataService.descriptionField(config.descriptionField);\n }\n }\n\n onEditedCompleter(event: { title: '' }): boolean {\n this.cell.newValue = event.title;\n return false;\n }\n}\n","import { Component } from '@angular/core';\n\nimport { DefaultEditor } from './default-editor';\n\n@Component({\n selector: 'input-editor',\n styleUrls: ['./editor.component.scss'],\n template: `\n <input [ngClass]=\"inputClass\"\n class=\"form-control\"\n [(ngModel)]=\"cell.newValue\"\n [name]=\"cell.getId()\"\n [placeholder]=\"cell.getTitle()\"\n [disabled]=\"!cell.isEditable()\"\n (click)=\"onClick.emit($event)\"\n (keydown.enter)=\"onEdited.emit($event)\"\n (keydown.esc)=\"onStopEditing.emit()\">\n `,\n})\nexport class InputEditorComponent extends DefaultEditor {\n\n constructor() {\n super();\n }\n}\n","import { Component } from '@angular/core';\n\nimport { DefaultEditor } from './default-editor';\n\n@Component({\n selector: 'select-editor',\n template: `\n <select [ngClass]=\"inputClass\"\n class=\"form-control\"\n [(ngModel)]=\"cell.newValue\"\n [name]=\"cell.getId()\"\n [disabled]=\"!cell.isEditable()\"\n (click)=\"onClick.emit($event)\"\n (keydown.enter)=\"onEdited.emit($event)\"\n (keydown.esc)=\"onStopEditing.emit()\">\n\n <option *ngFor=\"let option of cell.getColumn().getConfig()?.list\" [value]=\"option.value\"\n [selected]=\"option.value === cell.getValue()\">{{ option.title }}\n </option>\n </select>\n `,\n})\nexport class SelectEditorComponent extends DefaultEditor {\n\n constructor() {\n super();\n }\n}\n","import { Component } from '@angular/core';\n\nimport { DefaultEditor } from './default-editor';\n\n@Component({\n selector: 'textarea-editor',\n styleUrls: ['./editor.component.scss'],\n template: `\n <textarea [ngClass]=\"inputClass\"\n class=\"form-control\"\n [(ngModel)]=\"cell.newValue\"\n [name]=\"cell.getId()\"\n [disabled]=\"!cell.isEditable()\"\n [placeholder]=\"cell.getTitle()\"\n (click)=\"onClick.emit($event)\"\n (keydown.enter)=\"onEdited.emit($event)\"\n (keydown.esc)=\"onStopEditing.emit()\">\n </textarea>\n `,\n})\nexport class TextareaEditorComponent extends DefaultEditor {\n\n constructor() {\n super();\n }\n}\n","import {\n Component,\n Input,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n OnInit,\n OnDestroy,\n} from '@angular/core';\n\nimport { Cell } from '../../../lib/data-set/cell';\nimport { ViewCell } from './view-cell';\n\n@Component({\n selector: 'custom-view-component',\n template: `\n <ng-template #dynamicTarget></ng-template>\n `,\n})\nexport class CustomViewComponent implements OnInit, OnDestroy {\n\n customComponent: any;\n @Input() cell: Cell;\n @ViewChild('dynamicTarget', { read: ViewContainerRef, static: true }) dynamicTarget: any;\n\n constructor(private resolver: ComponentFactoryResolver) {\n }\n\n ngOnInit() {\n if (this.cell && !this.customComponent) {\n this.createCustomComponent();\n this.callOnComponentInit();\n this.patchInstance();\n }\n }\n\n ngOnDestroy() {\n if (this.customComponent) {\n this.customComponent.destroy();\n }\n }\n\n protected createCustomComponent() {\n const componentFactory = this.resolver.resolveComponentFactory(this.cell.getColumn().renderComponent);\n this.customComponent = this.dynamicTarget.createComponent(componentFactory);\n }\n\n protected callOnComponentInit() {\n const onComponentInitFunction = this.cell.getColumn().getOnComponentInitFunction();\n onComponentInitFunction && onComponentInitFunction(this.customComponent.instance);\n }\n\n protected patchInstance() {\n Object.assign(this.customComponent.instance, this.getPatch());\n }\n\n protected getPatch(): ViewCell {\n return {\n value: this.cell.getValue(),\n rowData: this.cell.getRow().getData()\n }\n }\n}\n","import {Component, Input, ChangeDetectionStrategy } from '@angular/core';\n\nimport { Cell } from '../../../lib/data-set/cell';\n\n@Component({\n selector: 'table-cell-view-mode',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [ngSwitch]=\"cell.getColumn().type\">\n <custom-view-component *ngSwitchCase=\"'custom'\" [cell]=\"cell\"></custom-view-component>\n <div *ngSwitchCase=\"'html'\" [innerHTML]=\"cell.getValue()\"></div>\n <div *ngSwitchDefault>{{ cell.getValue() }}</div>\n </div>\n `,\n})\nexport class ViewCellComponent {\n\n @Input() cell: Cell;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { Ng2CompleterModule } from 'ng2-completer';\n\nimport { CellComponent } from './cell.component';\nimport { CustomEditComponent } from './cell-edit-mode/custom-edit.component';\nimport { DefaultEditComponent } from './cell-edit-mode/default-edit.component';\nimport { EditCellComponent } from './cell-edit-mode/edit-cell.component';\nimport { CheckboxEditorComponent } from './cell-editors/checkbox-editor.component';\nimport { CompleterEditorComponent } from './cell-editors/completer-editor.component';\nimport { InputEditorComponent } from './cell-editors/input-editor.component';\nimport { SelectEditorComponent } from './cell-editors/select-editor.component';\nimport { TextareaEditorComponent } from './cell-editors/textarea-editor.component';\nimport { CustomViewComponent } from './cell-view-mode/custom-view.component';\nimport { ViewCellComponent } from './cell-view-mode/view-cell.component';\n\nconst CELL_COMPONENTS = [\n CellComponent,\n CustomEditComponent,\n DefaultEditComponent,\n EditCellComponent,\n CheckboxEditorComponent,\n CompleterEditorComponent,\n InputEditorComponent,\n SelectEditorComponent,\n TextareaEditorComponent,\n CustomViewComponent,\n ViewCellComponent,\n];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n Ng2CompleterModule,\n ],\n declarations: [\n ...CELL_COMPONENTS,\n ],\n exports: [\n ...CELL_COMPONENTS,\n ],\n})\nexport class CellModule { }\n","import { Subject } from 'rxjs';\nimport { Observable } from 'rxjs';\n\nexport abstract class DataSource {\n\n protected onChangedSource = new Subject<any>();\n protected onAddedSource = new Subject<any>();\n protected onUpdatedSource = new Subject<any>();\n protected onRemovedSource = new Subject<any>();\n\n abstract getAll(): Promise<any>;\n abstract getElements(): Promise<any>;\n abstract getSort(): any;\n abstract getFilter(): any;\n abstract getPaging(): any;\n abstract count(): number;\n\n refresh() {\n this.emitOnChanged('refresh');\n }\n\n load(data: Array<any>): Promise<any> {\n this.emitOnChanged('load');\n return Promise.resolve();\n }\n\n onChanged(): Observable<any> {\n return this.onChangedSource.asObservable();\n }\n\n onAdded(): Observable<any> {\n return this.onAddedSource.asObservable();\n }\n\n onUpdated(): Observable<any> {\n return this.onUpdatedSource.asObservable();\n }\n\n onRemoved(): Observable<any> {\n return this.onRemovedSource.asObservable();\n }\n\n prepend(element: any): Promise<any> {\n this.emitOnAdded(element);\n this.emitOnChanged('prepend');\n return Promise.resolve();\n }\n\n append(element: any): Promise<any> {\n this.emitOnAdded(element);\n this.emitOnChanged('append');\n return Promise.resolve();\n }\n\n add(element: any): Promise<any> {\n this.emitOnAdded(element);\n this.emitOnChanged('add');\n return Promise.resolve();\n }\n\n remove(element: any): Promise<any> {\n this.emitOnRemoved(element);\n this.emitOnChanged('remove');\n return Promise.resolve();\n }\n\n update(element: any, values: any): Promise<any> {\n this.emitOnUpdated(element);\n this.emitOnChanged('update');\n return Promise.resolve();\n }\n\n empty(): Promise<any> {\n this.emitOnChanged('empty');\n return Promise.resolve();\n }\n\n setSort(conf: Array<any>, doEmit?: boolean) {\n if (doEmit) {\n this.emitOnChanged('sort');\n }\n }\n\n setFilter(conf: Array<any>, andOperator?: boolean, doEmit?: boolean) {\n if (doEmit) {\n this.emitOnChanged('filter');\n }\n }\n\n addFilter(fieldConf: {}, andOperator?: boolean, doEmit?: boolean) {\n if (doEmit) {\n this.emitOnChanged('filter');\n }\n }\n\n setPaging(page: number, perPage: number, doEmit?: boolean) {\n if (doEmit) {\n this.emitOnChanged('paging');\n }\n }\n\n setPage(page: number, doEmit?: boolean) {\n if (doEmit) {\n this.emitOnChanged('page');\n }\n }\n\n protected emitOnRemoved(element: any) {\n this.onRemovedSource.next(element);\n }\n\n protected emitOnUpdated(element: any) {\n this.onUpdatedSource.next(element);\n }\n\n protected emitOnAdded(element: any) {\n this.onAddedSource.next(element);\n }\n\n protected emitOnChanged(action: string) {\n this.getElements().then((elements) => this.onChangedSource.next({\n action: action,\n elements: elements,\n paging: this.getPaging(),\n filter: this.getFilter(),\n sort: this.getSort(),\n }));\n }\n}\n","import { Output, EventEmitter, Input } from '@angular/core';\n\nimport { Column } from '../../lib/data-set/column';\nimport { DataSource } from '../../lib/data-source/data-source';\n\nexport class FilterDefault {\n\n @Input() column: Column;\n @Input() source: DataSource;\n @Input() inputClass: string = '';\n\n @Output() filter = new EventEmitter<any>();\n\n query: string = '';\n\n onFilter(query: string) {\n this.source.addFilter({\n field: this.column.id,\n search: query,\n filter: this.column.getFilterFunction(),\n });\n }\n}\n","import { Component, OnChanges, SimpleChanges } from '@angular/core';\nimport { FilterDefault } from './filter-default';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'ng2-smart-table-filter',\n styleUrls: ['./filter.component.scss'],\n template: `\n <div class=\"ng2-smart-filter\" *ngIf=\"column.isFilterable\" [ngSwitch]=\"column.getFilterType()\">\n <custom-table-filter *ngSwitchCase=\"'custom'\"\n [query]=\"query\"\n [column]=\"column\"\n [source]=\"source\"\n [inputClass]=\"inputClass\"\n (filter)=\"onFilter($event)\">\n </custom-table-filter>\n <default-table-filter *ngSwitchDefault\n [query]=\"query\"\n [column]=\"column\"\n [source]=\"source\"\n [inputClass]=\"inputClass\"\n (filter)=\"onFilter($event)\">\n </default-table-filter>\n </div>\n `,\n})\nexport class FilterComponent extends FilterDefault implements OnChanges {\n query: string = '';\n protected dataChangedSub: Subscription;\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.source) {\n if (!changes.source.firstChange) {\n this.dataChangedSub.unsubscribe();\n }\n this.dataChangedSub = this.source.onChanged().subscribe((dataChanges) => {\n const filterConf = this.source.getFilter();\n if (filterConf && filterConf.filters && filterConf.filters.length === 0) {\n this.query = '';\n\n // add a check for existing filters an set the query if one exists for this column\n // this covers instances where the filter is set by user code while maintaining existing functionality\n } else if (filterConf && filterConf.filters && filterConf.filters.length > 0) {\n filterConf.filters.forEach((k: any, v: any) => {\n if (k.field == this.column.id) {\n this.query = k.search;\n }\n });\n }\n });\n }\n }\n}\n","import {Component, Input} from '@angular/core';\n\nimport {FilterDefault} from \"./filter-default\";\n\n@Component({\n selector: 'default-table-filter',\n template: `\n <ng-container [ngSwitch]=\"column.getFilterType()\">\n <select-filter *ngSwitchCase=\"'list'\"\n [query]=\"query\"\n [ngClass]=\"inputClass\"\n [column]=\"column\"\n (filter)=\"onFilter($event)\">\n </select-filter>\n <checkbox-filter *ngSwitchCase=\"'checkbox'\"\n [query]=\"query\"\n [ngClass]=\"inputClass\"\n [column]=\"column\"\n (filter)=\"onFilter($event)\">\n </checkbox-filter>\n <completer-filter *ngSwitchCase=\"'completer'\"\n [query]=\"query\"\n [ngClass]=\"inputClass\"\n [column]=\"column\"\n (filter)=\"onFilter($event)\">\n </completer-filter>\n <input-filter *ngSwitchDefault\n [query]=\"query\"\n [ngClass]=\"inputClass\"\n [column]=\"column\"\n (filter)=\"onFilter($event)\">\n </input-filter>\n </ng-container>\n `,\n})\nexport class DefaultFilterComponent extends FilterDefault {\n @Input() query: string;\n}\n","import {\n Component,\n ComponentFactoryResolver, Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\n\nimport { FilterDefault } from './filter-default';\n\n@Component({\n selector: 'custom-table-filter',\n template: `<ng-template #dynamicTarget></ng-template>`,\n})\nexport class CustomFilterComponent extends FilterDefault implements OnChanges, OnDestroy {\n @Input() query: string;\n customComponent: any;\n @ViewChild('dynamicTarget', { read: ViewContainerRef, static: true }) dynamicTarget: any;\n\n constructor(private resolver: ComponentFactoryResolver) {\n super();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.column && !this.customComponent) {\n const componentFactory = this.resolver.resolveComponentFactory(this.column.filter.component);\n this.customComponent = this.dynamicTarget.createComponent(componentFactory);\n\n // set @Inputs and @Outputs of custom component\n this.customComponent.instance.query = this.query;\n this.customComponent.instance.column = this.column;\n this.customComponent.instance.source = this.source;\n this.customComponent.instance.inputClass = this.inputClass;\n this.customComponent.instance.filter.subscribe((event: any) => this.onFilter(event));\n }\n if (this.customComponent) {\n this.customComponent.instance.ngOnChanges(changes);\n }\n }\n\n ngOnDestroy() {\n if (this.customComponent) {\n this.customComponent.destroy();\n }\n }\n}\n","import { Input, Output, EventEmitter, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { Column } from '../../../lib/data-set/column';\n\nexport class DefaultFilter implements Filter, OnDestroy {\n\n delay: number = 300;\n changesSubscription: Subscription;\n @Input() query: string;\n @Input() inputClass: string;\n @Input() column: Column;\n @Output() filter = new EventEmitter<string>();\n\n ngOnDestroy() {\n if (this.changesSubscription) {\n this.changesSubscription.unsubscribe();\n }\n }\n\n setFilter() {\n this.filter.emit(this.query);\n }\n}\n\nexport interface Filter {\n\n delay?: number;\n changesSubscription?: Subscription;\n query: string;\n inputClass: string;\n column: Column;\n filter: EventEmitter<string>;\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { DefaultFilter } from './default-filter';\nimport { debounceTime } from 'rxjs/operators';\n\n@Component({\n selector: 'checkbox-filter',\n template: `\n <input type=\"checkbox\" [formControl]=\"inputControl\" [ngClass]=\"inputClass\" class=\"form-control\">\n <a href=\"#\" *ngIf=\"filterActive\"\n (click)=\"resetFilter($event)\">{{column.getFilterConfig()?.resetText || 'reset'}}</a>\n `,\n})\nexport class CheckboxFilterComponent extends DefaultFilter implements OnInit {\n\n filterActive: boolean = false;\n inputControl = new FormControl();\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.changesSubscription = this.inputControl.valueChanges\n .pipe(debounceTime(this.delay))\n .subscribe((checked: boolean) => {\n this.filterActive = true;\n const trueVal = (this.column.getFilterConfig() && this.column.getFilterConfig().true) || true;\n const falseVal = (this.column.getFilterConfig() && this.column.getFilterConfig().false) || false;\n this.query = checked ? trueVal : falseVal;\n this.setFilter();\n });\n }\n\n resetFilter(event: any) {\n event.preventDefault();\n this.query = '';\n this.inputControl.setValue(false, { emitEvent: false });\n this.filterActive = false;\n this.setFilter();\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { CompleterService } from 'ng2-completer';\n\nimport { DefaultFilter } from './default-filter';\nimport { distinctUntilChanged, debounceTime, map } from 'rxjs/operators';\n\n@Component({\n selector: 'completer-filter',\n template: `\n <ng2-completer [(ngModel)]=\"query\"\n (ngModelChange)=\"inputTextChanged($event)\"\n [dataService]=\"column.getFilterConfig().completer.dataService\"\n [minSearchLength]=\"column.getFilterConfig().completer.minSearchLength || 0\"\n [pause]=\"column.getFilterConfig().completer.pause || 0\"\n [placeholder]=\"column.getFilterConfig().completer.placeholder || 'Start typing...'\"\n (selected)=\"completerContent.next($event)\">\n </ng2-completer>\n `,\n})\nexport class CompleterFilterComponent extends DefaultFilter implements OnInit {\n\n completerContent = new Subject<any>();\n\n constructor(private completerService: CompleterService) {\n super();\n }\n\n ngOnInit() {\n const config = this.column.getFilterConfig().completer;\n config.dataService = this.completerService.local(config.data, config.searchFields, config.titleField);\n config.dataService.descriptionField(config.descriptionField);\n\n this.changesSubscription = this.completerContent\n .pipe(\n map((ev: any) => (ev && ev.title) || ev || ''),\n distinctUntilChanged(),\n debounceTime(this.delay)\n )\n .subscribe((search: string) => {\n this.query = search;\n this.setFilter();\n });\n }\n\n inputTextChanged(event: string) {\n // workaround to trigger the search event when the home/end buttons are clicked\n // when this happens the [(ngModel)]=\"query\" is set to \"\" but the (selected) method is not called\n // so here it gets called manually\n if (event === '') {\n this.completerContent.next(event);\n }\n }\n}\n","import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { debounceTime, distinctUntilChanged, skip } from 'rxjs/operators';\n\nimport { DefaultFilter } from './default-filter';\n\n@Component({\n selector: 'input-filter',\n template: `\n <input\n [ngClass]=\"inputClass\"\n [formControl]=\"inputControl\"\n class=\"form-control\"\n type=\"text\"\n placeholder=\"{{ column.title }}\"/>\n `,\n})\nexport class InputFilterComponent extends DefaultFilter implements OnInit, OnChanges {\n\n inputControl = new FormControl();\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n if (this.query) {\n this.inputControl.setValue(this.query);\n }\n this.inputControl.valueChanges\n .pipe(\n distinctUntilChanged(),\n debounceTime(this.delay),\n )\n .subscribe((value: string) => {\n this.query = this.inputControl.value;\n this.setFilter();\n });\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.query) {\n this.inputControl.setValue(this.query);\n }\n }\n}\n","import { Component, OnInit, ViewChild } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { distinctUntilChanged, debounceTime, skip } from 'rxjs/operators';\n\nimport { DefaultFilter } from './default-filter';\n\n@Component({\n selector: 'select-filter',\n template: `\n <select [ngClass]=\"inputClass\"\n class=\"form-control\"\n #inputControl\n [(ngModel)]=\"query\">\n\n <option value=\"\">{{ column.getFilterConfig().selectText }}</option>\n <option *ngFor=\"let option of column.getFilterConfig().list\" [value]=\"option.value\">\n {{ option.title }}\n </option>\n </select>\n `,\n})\nexport class SelectFilterComponent extends DefaultFilter implements OnInit {\n\n @ViewChild('inputControl', { read: NgControl, static: true }) inputControl: NgControl;\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.inputControl.valueChanges\n .pipe(\n skip(1),\n distinctUntilChanged(),\n debounceTime(this.delay)\n )\n .subscribe((value: string) => this.setFilter());\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Ng2CompleterModule } from 'ng2-completer';\n\nimport { FilterComponent } from './filter.component';\nimport { DefaultFilterComponent } from \"./default-filter.component\";\nimport { CustomFilterComponent } from \"./custom-filter.component\";\nimport { CheckboxFilterComponent } from './filter-types/checkbox-filter.component';\nimport { CompleterFilterComponent } from './filter-types/completer-filter.component';\nimport { InputFilterComponent } from './filter-types/input-filter.component';\nimport { SelectFilterComponent } from './filter-types/select-filter.component';\n\nconst FILTER_COMPONENTS = [\n FilterComponent,\n DefaultFilterComponent,\n CustomFilterComponent,\n CheckboxFilterComponent,\n CompleterFilterComponent,\n InputFilterComponent,\n SelectFilterComponent,\n];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n Ng2CompleterModule,\n ],\n declarations: [\n ...FILTER_COMPONENTS,\n ],\n exports: [\n ...FILTER_COMPONENTS,\n ],\n})\nexport class FilterModule { }\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { DataSource } from '../../lib/data-source/data-source';\n\n@Component({\n selector: 'ng2-smart-table-pager',\n styleUrls: ['./pager.component.scss'],\n template: `\n <nav *ngIf=\"shouldShow()\" class=\"ng2-smart-pagination-nav\">\n <ul class=\"ng2-smart-pagination pagination\">\n <li class=\"ng2-smart-page-item page-item\" [ngClass]=\"{disabled: getPage() == 1}\">\n <a class=\"ng2-smart-page-link page-link\" href=\"#\"\n (click)=\"getPage() == 1 ? false : paginate(1)\" aria-label=\"First\">\n <span aria-hidden=\"true\">«</span>\n <span class=\"sr-only\">First</span>\n </a>\n </li>\n <li class=\"ng2-smart-page-item page-item\" [ngClass]=\"{disabled: getPage() == 1}\">\n <a class=\"ng2-smart-page-link page-link page-link-prev\" href=\"#\"\n (click)=\"getPage() == 1 ? false : prev()\" aria-label=\"Prev\">\n <span aria-hidden=\"true\"><</span>\n <span class=\"sr-only\">Prev</span>\n </a>\n </li>\n <li class=\"ng2-smart-page-item page-item\"\n [ngClass]=\"{active: getPage() == page}\" *ngFor=\"let page of getPages()\">\n <span class=\"ng2-smart-page-link page-link\"\n *ngIf=\"getPage() == page\">{{ page }} <span class=\"sr-only\">(current)</span></span>\n <a class=\"ng2-smart-page-link page-link\" href=\"#\"\n (click)=\"paginate(page)\" *ngIf=\"getPage() != page\">{{ page }}</a>\n </li>\n\n <li class=\"ng2-smart-page-item page-item\"\n [ngClass]=\"{disabled: getPage() == getLast()}\">\n <a class=\"ng2-smart-page-link page-link page-link-next\" href=\"#\"\n (click)=\"getPage() == getLast() ? false : next()\" aria-label=\"Next\">\n <span aria-hidden=\"true\">></span>\n <span class=\"sr-only\">Next</span>\n </a>\n </li>\n \n <li class=\"ng2-smart-page-item page-item\"\n [ngClass]=\"{disabled: getPage() == getLast()}\">\n <a class=\"ng2-smart-page-link page-link\" href=\"#\"\n (click)=\"getPage() == getLast() ? false : paginate(getLast())\" aria-label=\"Last\">\n <span aria-hidden=\"true\">»</span>\n <span class=\"sr-only\">Last</span>\n </a>\n </li>\n </ul>\n </nav>\n \n <nav *ngIf=\"perPageSelect && perPageSelect.length > 0\" class=\"ng2-smart-pagination-per-page\">\n <label for=\"per-page\">\n Per Page:\n </label>\n <select (change)=\"onChangePerPage($event)\" [(ngModel)]=\"currentPerPage\" id=\"per-page\">\n <option *ngFor=\"let item of perPageSelect\" [value]=\"item\">{{ item }}</option>\n </select>\n </nav>\n `,\n})\nexport class PagerComponent implements OnChanges {\n\n @Input() source: DataSource;\n @Input() perPageSelect: any[] = [];\n\n @Output() changePage = new EventEmitter<any>();\n\n currentPerPage: any;\n\n protected pages: Array<any>;\n protected page: number;\n protected count: number = 0;\n protected perPage: number;\n\n protected dataChangedSub: Subscription;\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.source) {\n if (!changes.source.firstChange) {\n this.dataChangedSub.unsubscribe();\n }\n this.dataChangedSub = this.source.onChanged().subscribe((dataChanges) => {\n this.page = this.source.getPaging().page;\n this.perPage = this.source.getPaging().perPage;\n this.currentPerPage = this.perPage;\n this.count = this.source.count();\n if (this.isPageOutOfBounce()) {\n this.source.setPage(--this.page);\n }\n\n this.processPageChange(dataChanges);\n this.initPages();\n });\n }\n }\n\n /**\n * We change the page here depending on the action performed against data source\n * if a new element was added to the end of the table - then change the page to the last\n * if a new element was added to the beginning of the table - then to the first page\n * @param changes\n */\n processPageChange(changes: any) {\n if (changes['action'] === 'prepend') {\n this.source.setPage(1);\n }\n if (changes['action'] === 'append') {\n this.source.setPage(this.getLast());\n }\n }\n\n shouldShow(): boolean {\n return this.source.count() > this.perPage;\n }\n\n paginate(page: number): boolean {\n this.source.setPage(page);\n this.page = page;\n this.changePage.emit({ page });\n return false;\n }\n\n next(): boolean {\n return this.paginate(this.getPage() + 1);\n }\n\n prev(): boolean {\n return this.paginate(this.getPage() - 1);\n }\n\n getPage(): number {\n return this.page;\n }\n\n getPages(): Array<any> {\n return this.pages;\n }\n\n getLast(): number {\n return Math.ceil(this.count / this.perPage);\n }\n\n isPageOutOfBounce(): boolean {\n return (this.page * this.perPage) >= (this.count + this.perPage) && this.page > 1;\n }\n\n initPages() {\n const pagesCount = this.getLast();\n let showPagesCount = 4;\n showPagesCount = pagesCount < showPagesCount ? pagesCount : showPagesCount;\n this.pages = [];\n\n if (this.shouldShow()) {\n\n let middleOne = Math.ceil(showPagesCount / 2);\n middleOne = this.page >= middleOne ? this.page : middleOne;\n\n let lastOne = middleOne + Math.floor(showPagesCount / 2);\n lastOne = lastOne >= pagesCount ? pagesCount : lastOne;\n\n const firstOne = lastOne - showPagesCount + 1;\n\n for (let i = firstOne; i <= lastOne; i++) {\n this.pages.push(i);\n }\n }\n }\n\n onChangePerPage(event: any) {\n if (this.currentPerPage) {\n\n if (typeof this.currentPerPage === 'string' && this.currentPerPage.toLowerCase() === 'all') {\n this.source.getPaging().perPage = null;\n } else {\n this.source.getPaging().perPage = this.currentPerPage * 1;\n this.source.refresh();\n }\n this.initPages();\n }\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { PagerComponent } from './pager.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ],\n declarations: [\n PagerComponent,\n ],\n exports: [\n PagerComponent,\n ],\n})\nexport class PagerModule { }\n","import {Component, Input, Output, EventEmitter, } from '@angular/core';\n\nimport { Grid } from '../../lib/grid';\nimport { Row } from '../../lib/data-set/row';\nimport { DataSource } from '../../lib/data-source/data-source';\nimport {Column} from \"../../lib/data-set/column\";\n\n@Component({\n selector: '[ng2-st-tbody]',\n styleUrls: ['./tbody.component.scss'],\n templateUrl: './tbody.component.html',\n})\nexport class Ng2SmartTableTbodyComponent {\n\n @Input() grid: Grid;\n @Input() source: DataSource;\n @Input() deleteConfirm: EventEmitter<any>;\n @Input() editConfirm: EventEmitter<any>;\n @Input() rowClassFunction: Function;\n\n @Output() save = new EventEmitter<any>();\n @Output() cancel = new EventEmitter<any>();\n @Output() edit = new EventEmitter<any>();\n @Output() delete = new EventEmitter<any>();\n @Output() custom = new EventEmitter<any>();\n @Output() edited = new EventEmitter<any>();\n @Output() userSelectRow = new EventEmitter<any>();\n @Output() editRowSelect = new EventEmitter<any>();\n @Output() multipleSelectRow = new EventEmitter<any>();\n @Output() rowHover = new EventEmitter<any>();\n\n isMultiSelectVisible: boolean;\n showActionColumnLeft: boolean;\n showActionColumnRight: boolean;\n mode: string;\n editInputClass: string;\n isActionAdd: boolean;\n isActionEdit: boolean;\n isActionDelete: boolean;\n noDataMessage: boolean;\n\n get tableColumnsCount() {\n const actionColumns = this.isActionAdd || this.isActionEdit || this.isActionDelete ? 1 : 0;\n return this.grid.getColumns().length + actionColumns;\n }\n\n ngOnChanges() {\n this.isMultiSelectVisible = this.grid.isMultiSelectVisible();\n this.showActionColumnLeft = this.grid.showActionColumn('left');\n this.mode = this.grid.getSetting('mode');\n this.editInputClass = this.grid.getSetting('edit.inputClass');\n this.showActionColumnRight = this.grid.showActionColumn('right');\n this.isActionAdd = this.grid.getSetting('actions.add');\n this.isActionEdit = this.grid.getSetting('actions.edit');\n this.isActionDelete = this.grid.getSetting('actions.delete');\n this.noDataMessage = this.grid.getSetting('noDataMessage');\n }\n}\n","import { Component, Input, EventEmitter, OnChanges } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { Row } from '../../../lib/data-set/row';\n\n@Component({\n selector: 'ng2-st-tbody-create-cancel',\n template: `\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-edit-save\"\n [innerHTML]=\"saveButtonContent\" (click)=\"onSave($event)\"></a>\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-edit-cancel\"\n [innerHTML]=\"cancelButtonContent\" (click)=\"onCancelEdit($event)\"></a>\n `,\n})\nexport class TbodyCreateCancelComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() row: Row;\n @Input() editConfirm: EventEmitter<any>;\n\n cancelButtonContent: string;\n saveButtonContent: string;\n\n onSave(event: any) {\n event.preventDefault();\n event.stopPropagation();\n\n this.grid.save(this.row, this.editConfirm);\n }\n\n onCancelEdit(event: any) {\n event.preventDefault();\n event.stopPropagation();\n\n this.row.isInEditing = false;\n }\n\n ngOnChanges() {\n this.saveButtonContent = this.grid.getSetting('edit.saveButtonContent');\n this.cancelButtonContent = this.grid.getSetting('edit.cancelButtonContent')\n }\n}\n","import {Component, Input, Output, EventEmitter, OnChanges, ChangeDetectionStrategy } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { Row } from '../../../lib/data-set/row';\nimport { DataSource } from '../../../lib/data-source/data-source';\n\n@Component({\n selector: 'ng2-st-tbody-edit-delete',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <a href=\"#\" *ngIf=\"isActionEdit\" class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent\" (click)=\"onEdit($event)\"></a>\n <a href=\"#\" *ngIf=\"isActionDelete\" class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent\" (click)=\"onDelete($event)\"></a>\n `,\n})\nexport class TbodyEditDeleteComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() row: Row;\n @Input() source: DataSource;\n @Input() deleteConfirm: EventEmitter<any>;\n @Input() editConfirm: EventEmitter<any>;\n\n @Output() edit = new EventEmitter<any>();\n @Output() delete = new EventEmitter<any>();\n @Output() editRowSelect = new EventEmitter<any>();\n\n isActionEdit: boolean;\n isActionDelete: boolean;\n editRowButtonContent: string;\n deleteRowButtonContent: string;\n\n onEdit(event: any) {\n event.preventDefault();\n event.stopPropagation();\n\n this.editRowSelect.emit(this.row);\n\n if (this.grid.getSetting('mode') === 'external') {\n this.edit.emit({\n data: this.row.getData(),\n source: this.source,\n });\n } else {\n this.grid.edit(this.row);\n }\n }\n\n onDelete(event: any) {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.grid.getSetting('mode') === 'external') {\n this.delete.emit({\n data: this.row.getData(),\n source: this.source,\n });\n } else {\n this.grid.delete(this.row, this.deleteConfirm);\n }\n }\n\n ngOnChanges(){\n this.isActionEdit = this.grid.getSetting('actions.edit');\n this.isActionDelete = this.grid.getSetting('actions.delete');\n this.editRowButtonContent = this.grid.getSetting('edit.editButtonContent');\n this.deleteRowButtonContent = this.grid.getSetting('delete.deleteButtonContent');\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { Row } from '../../../lib/data-set/row';\n\nimport { Grid } from '../../../lib/grid';\n\n@Component({\n selector: 'ng2-st-tbody-custom',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <ng-container *ngFor=\"let action of grid.getSetting('actions.custom')\">\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n *ngIf=\"!action.renderComponent\"\n [innerHTML]=\"action.title\"\n (click)=\"onCustom(action, $event)\"></a>\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n *ngIf=\"action.renderComponent\"\n (click)=\"onCustom(action, $event)\">\n <ng2-st-tbody-custom-item class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n [action]=\"action\"\n [row]=\"row\"></ng2-st-tbody-custom-item>\n </a>\n\n </ng-container>\n `,\n})\nexport class TbodyCustomComponent {\n\n @Input() grid: Grid;\n @Input() row: Row;\n @Input() source: any;\n @Output() custom = new EventEmitter<any>();\n\n onCustom(action: any, event: any) {\n event.preventDefault();\n event.stopPropagation();\n\n this.custom.emit({\n action: action.name,\n data: this.row.getData(),\n source: this.source,\n });\n }\n\n}\n","import { Component, ComponentFactoryResolver, Input, OnInit, ViewChild, ViewContainerRef } from '@angular/core';\nimport { Row } from '../../../lib/data-set/row';\n\n@Component({\n selector: 'ng2-st-tbody-custom-item',\n template: `\n <ng-template #dynamicTarget></ng-template>\n `,\n})\nexport class TbodyCustomItemComponent implements OnInit {\n\n customComponent: any;\n @Input() action: any;\n @Input() row: Row;\n @ViewChild('dynamicTarget', { read: ViewContainerRef, static: true }) dynamicTarget: any;\n\n constructor(private resolver: ComponentFactoryResolver) {\n }\n\n ngOnInit() {\n if (this.action && !this.customComponent) {\n this.createCustomComponent();\n this.patchInstance();\n }\n }\n\n protected createCustomComponent() {\n const componentFactory = this.resolver.resolveComponentFactory(this.action.renderComponent);\n this.customComponent = this.dynamicTarget.createComponent(componentFactory);\n }\n\n protected patchInstance() {\n Object.assign(this.customComponent.instance, this.getPatch());\n }\n\n protected getPatch(): any {\n return {\n action: this.action,\n rowData: this.row.getData(),\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { CellModule } from '../cell/cell.module';\n\nimport { Ng2SmartTableTbodyComponent } from './tbody.component';\nimport { TbodyCreateCancelComponent } from './cells/create-cancel.component';\nimport { TbodyEditDeleteComponent } from './cells/edit-delete.component';\nimport { TbodyCustomComponent } from './cells/custom.component';\nimport { TbodyCustomItemComponent } from './cells/custom-item.component';\n\nconst TBODY_COMPONENTS = [\n TbodyCreateCancelComponent,\n TbodyEditDeleteComponent,\n TbodyCustomComponent,\n TbodyCustomItemComponent,\n Ng2SmartTableTbodyComponent\n];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n CellModule,\n ],\n declarations: [\n ...TBODY_COMPONENTS,\n ],\n exports: [\n ...TBODY_COMPONENTS,\n ],\n})\nexport class TBodyModule { }\n","import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';\n\nimport { Grid } from '../../lib/grid';\nimport { DataSource } from '../../lib/data-source/data-source';\n\n@Component({\n selector: '[ng2-st-thead]',\n templateUrl: './thead.component.html',\n})\nexport class Ng2SmartTableTheadComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() source: DataSource;\n @Input() isAllSelected: boolean;\n @Input() createConfirm: EventEmitter<any>;\n\n @Output() sort = new EventEmitter<any>();\n @Output() selectAllRows = new EventEmitter<any>();\n @Output() create = new EventEmitter<any>();\n @Output() filter = new EventEmitter<any>();\n\n isHideHeader: boolean;\n isHideSubHeader: boolean;\n\n ngOnChanges() {\n this.isHideHeader = this.grid.getSetting('hideHeader');\n this.isHideSubHeader = this.grid.getSetting('hideSubHeader');\n }\n}\n","import {Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\n\n@Component({\n selector: 'ng2-st-actions',\n template: `\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-add-create\"\n [innerHTML]=\"createButtonContent\"\n (click)=\"$event.preventDefault();create.emit($event)\"></a>\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-add-cancel\"\n [innerHTML]=\"cancelButtonContent\"\n (click)=\"$event.preventDefault();grid.createFormShown = false;\"></a>\n `,\n})\nexport class ActionsComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Output() create = new EventEmitter<any>();\n\n createButtonContent: string;\n cancelButtonContent: string;\n\n ngOnChanges() {\n this.createButtonContent = this.grid.getSetting('add.createButtonContent');\n this.cancelButtonContent = this.grid.getSetting('add.cancelButtonContent');\n }\n}\n","import {Component, Input, AfterViewInit, ElementRef, OnChanges} from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\n\n@Component({\n selector: '[ng2-st-actions-title]',\n template: `\n <div class=\"ng2-smart-title\">{{ actionsColumnTitle }}</div>\n `,\n})\nexport class ActionsTitleComponent implements AfterViewInit, OnChanges {\n\n @Input() grid: Grid;\n\n actionsColumnTitle: string;\n\n constructor(private ref: ElementRef) {\n }\n\n ngAfterViewInit() {\n this.ref.nativeElement.classList.add('ng2-smart-actions');\n }\n\n ngOnChanges() {\n this.actionsColumnTitle = this.grid.getSetting('actions.columnTitle');\n }\n}\n","import { Component, Input, Output, EventEmitter, AfterViewInit, ElementRef, OnChanges } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { DataSource } from '../../../lib/data-source/data-source';\n\n@Component({\n selector: '[ng2-st-add-button]',\n template: `\n <a *ngIf=\"isActionAdd\" href=\"#\" class=\"ng2-smart-action ng2-smart-action-add-add\"\n [innerHTML]=\"addNewButtonContent\" (click)=\"onAdd($event)\"></a>\n `,\n})\nexport class AddButtonComponent implements AfterViewInit, OnChanges {\n\n @Input() grid: Grid;\n @Input() source: DataSource;\n @Output() create = new EventEmitter<any>();\n\n isActionAdd: boolean;\n addNewButtonContent: string;\n\n constructor(private ref: ElementRef) {\n }\n\n ngAfterViewInit() {\n this.ref.nativeElement.classList.add('ng2-smart-actions-title', 'ng2-smart-actions-title-add');\n }\n\n ngOnChanges() {\n this.isActionAdd = this.grid.getSetting('actions.add');\n this.addNewButtonContent = this.grid.getSetting('add.addButtonContent');\n }\n\n onAdd(event: any) {\n event.preventDefault();\n event.stopPropagation();\n if (this.grid.getSetting('mode') === 'external') {\n this.create.emit({\n source: this.source,\n });\n } else {\n this.grid.createFormShown = true;\n }\n }\n}\n","import { Component, Input } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { DataSource } from '../../../lib/data-source/data-source';\n\n@Component({\n selector: '[ng2-st-checkbox-select-all]',\n template: `\n <input type=\"checkbox\" [ngModel]=\"isAllSelected\">\n `,\n})\nexport class CheckboxSelectAllComponent {\n\n @Input() grid: Grid;\n @Input() source: DataSource;\n @Input() isAllSelected: boolean;\n}\n","import { Component, Input, Output, EventEmitter } from '@angular/core';\n\nimport { Column } from '../../../lib/data-set/column';\nimport { DataSource } from '../../../lib/data-source/data-source';\n\n@Component({\n selector: 'ng2-st-column-title',\n template: `\n <div class=\"ng2-smart-title\">\n <ng2-smart-table-title [source]=\"source\" [column]=\"column\" (sort)=\"sort.emit($event)\"></ng2-smart-table-title>\n </div>\n `,\n})\nexport class ColumnTitleComponent {\n\n @Input() column: Column;\n @Input() source: DataSource;\n\n @Output() sort = new EventEmitter<any>();\n\n}\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { DataSource } from '../../../../lib/data-source/data-source';\nimport { Column } from '../../../../lib/data-set/column';\n\n@Component({\n selector: 'ng2-smart-table-title',\n styleUrls: ['./title.component.scss'],\n template: `\n <a href=\"#\" *ngIf=\"column.isSortable\"\n (click)=\"_sort($event)\"\n class=\"ng2-smart-sort-link sort\"\n [ngClass]=\"currentDirection\">\n {{ column.title }}\n </a>\n <span class=\"ng2-smart-sort\" *ngIf=\"!column.isSortable\">{{ column.title }}</span>\n `,\n})\nexport class TitleComponent implements OnChanges {\n\n currentDirection = '';\n @Input() column: Column;\n @Input() source: DataSource;\n @Output() sort = new EventEmitter<any>();\n\n protected dataChangedSub: Subscription;\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.source) {\n if (!changes.source.firstChange) {\n this.dataChangedSub.unsubscribe();\n }\n this.dataChangedSub = this.source.onChanged().subscribe((dataChanges) => {\n const sortConf = this.source.getSort();\n\n if (sortConf.length > 0 && sortConf[0]['field'] === this.column.id) {\n this.currentDirection = sortConf[0]['direction'];\n } else {\n this.currentDirection = '';\n }\n\n sortConf.forEach((fieldConf: any) => {\n\n });\n });\n }\n }\n\n _sort(event: any) {\n event.preventDefault();\n this.changeSortDirection();\n this.source.setSort([\n {\n field: this.column.id,\n direction: this.currentDirection,\n compare: this.column.getCompareFunction(),\n },\n ]);\n this.sort.emit(null);\n }\n\n changeSortDirection(): string {\n if (this.currentDirection) {\n const newDirection = this.currentDirection === 'asc' ? 'desc' : 'asc';\n this.currentDirection = newDirection;\n } else {\n this.currentDirection = this.column.sortDirection;\n }\n return this.currentDirection;\n }\n}\n","import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { DataSource } from '../../../lib/data-source/data-source';\nimport { Column } from \"../../../lib/data-set/column\";\n\n@Component({\n selector: '[ng2-st-thead-filters-row]',\n template: `\n <th *ngIf=\"isMultiSelectVisible\"></th>\n <th ng2-st-add-button *ngIf=\"showActionColumnLeft\"\n [grid]=\"grid\"\n (create)=\"create.emit($event)\">\n </th>\n <th *ngFor=\"let column of grid.getColumns()\" class=\"ng2-smart-th {{ column.id }}\">\n <ng2-smart-table-filter [source]=\"source\"\n [column]=\"column\"\n [inputClass]=\"filterInputClass\"\n (filter)=\"filter.emit($event)\">\n </ng2-smart-table-filter>\n </th>\n <th ng2-st-add-button *ngIf=\"showActionColumnRight\"\n [grid]=\"grid\"\n [source]=\"source\"\n (create)=\"create.emit($event)\">\n </th>\n `,\n})\nexport class TheadFitlersRowComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() source: DataSource;\n\n @Output() create = new EventEmitter<any>();\n @Output() filter = new EventEmitter<any>();\n\n isMultiSelectVisible: boolean;\n showActionColumnLeft: boolean;\n showActionColumnRight: boolean;\n filterInputClass: string;\n\n ngOnChanges() {\n this.isMultiSelectVisible = this.grid.isMultiSelectVisible();\n this.showActionColumnLeft = this.grid.showActionColumn('left');\n this.showActionColumnRight = this.grid.showActionColumn('right');\n this.filterInputClass = this.grid.getSetting('filter.inputClass');\n }\n}\n","import { Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { Row } from '../../../lib/data-set/row';\n\n@Component({\n selector: '[ng2-st-thead-form-row]',\n template: `\n <td *ngIf=\"\"></td>\n <td *ngIf=\"showActionColumnLeft\" class=\"ng2-smart-actions\">\n <ng2-st-actions [grid]=\"grid\" (create)=\"onCreate($event)\"></ng2-st-actions>\n </td>\n <td *ngFor=\"let cell of grid.getNewRow().getCells()\">\n <ng2-smart-table-cell [cell]=\"cell\"\n [grid]=\"grid\"\n [isNew]=\"true\"\n [createConfirm]=\"createConfirm\"\n [inputClass]=\"addInputClass\"\n [isInEditing]=\"grid.getNewRow().isInEditing\"\n (edited)=\"onCreate($event)\">\n </ng2-smart-table-cell>\n </td>\n <td *ngIf=\"showActionColumnRight\" class=\"ng2-smart-actions\">\n <ng2-st-actions [grid]=\"grid\" (create)=\"onCreate($event)\"></ng2-st-actions>\n </td>\n `,\n})\nexport class TheadFormRowComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() row: Row;\n @Input() createConfirm: EventEmitter<any>;\n\n @Output() create = new EventEmitter<any>();\n\n isMultiSelectVisible: boolean;\n showActionColumnLeft: boolean;\n showActionColumnRight: boolean;\n addInputClass: string;\n\n onCreate(event: any) {\n event.stopPropagation();\n\n this.grid.create(this.grid.getNewRow(), this.createConfirm);\n }\n\n ngOnChanges(){\n this.isMultiSelectVisible = this.grid.isMultiSelectVisible();\n this.showActionColumnLeft = this.grid.showActionColumn('left');\n this.showActionColumnRight = this.grid.showActionColumn('right');\n this.addInputClass = this.grid.getSetting('add.inputClass');\n }\n}\n","import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core';\n\nimport { Grid } from '../../../lib/grid';\nimport { DataSource } from '../../../lib/data-source/data-source';\nimport { Column } from \"../../../lib/data-set/column\";\n\n@Component({\n selector: '[ng2-st-thead-titles-row]',\n template: `\n <th ng2-st-checkbox-select-all *ngIf=\"isMultiSelectVisible\"\n [grid]=\"grid\"\n [source]=\"source\"\n [isAllSelected]=\"isAllSelected\"\n (click)=\"selectAllRows.emit($event)\">\n </th>\n <th ng2-st-actions-title *ngIf=\"showActionColumnLeft\" [grid]=\"grid\"></th>\n <th *ngFor=\"let column of grid.getColumns()\" class=\"ng2-smart-th {{ column.id }}\" [ngClass]=\"column.class\"\n [style.width]=\"column.width\" >\n <ng2-st-column-title [source]=\"source\" [column]=\"column\" (sort)=\"sort.emit($event)\"></ng2-st-column-title>\n </th>\n <th ng2-st-actions-title *ngIf=\"showActionColumnRight\" [grid]=\"grid\"></th>\n `,\n})\nexport class TheadTitlesRowComponent implements OnChanges {\n\n @Input() grid: Grid;\n @Input() isAllSelected: boolean;\n @Input() source: DataSource;\n\n @Output() sort = new EventEmitter<any>();\n @Output() selectAllRows = new EventEmitter<any>();\n\n isMultiSelectVisible: boolean;\n showActionColumnLeft: boolean;\n showActionColumnRight: boolean;\n\n\n ngOnChanges() {\n this.isMultiSelectVisible = this.grid.isMultiSelectVisible();\n this.showActionColumnLeft = this.grid.showActionColumn('left');\n this.showActionColumnRight = this.grid.showActionColumn('right');\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { FilterModule } from '../filter/filter.module';\nimport { CellModule } from '../cell/cell.module';\n\nimport { Ng2SmartTableTheadComponent } from './thead.component';\nimport { ActionsComponent } from './cells/actions.component';\nimport { ActionsTitleComponent } from './cells/actions-title.component';\nimport { AddButtonComponent } from './cells/add-button.component';\nimport { CheckboxSelectAllComponent } from './cells/checkbox-select-all.component';\nimport { ColumnTitleComponent } from './cells/column-title.component';\nimport { TitleComponent } from './cells/title/title.component';\nimport { TheadFitlersRowComponent } from './rows/thead-filters-row.component';\nimport { TheadFormRowComponent } from './rows/thead-form-row.component';\nimport { TheadTitlesRowComponent } from './rows/thead-titles-row.component';\n\nconst THEAD_COMPONENTS = [\n ActionsComponent,\n ActionsTitleComponent,\n AddButtonComponent,\n CheckboxSelectAllComponent,\n ColumnTitleComponent,\n TitleComponent,\n TheadFitlersRowComponent,\n TheadFormRowComponent,\n TheadTitlesRowComponent,\n Ng2SmartTableTheadComponent,\n];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n FilterModule,\n CellModule,\n ],\n declarations: [\n ...THEAD_COMPONENTS,\n ],\n exports: [\n ...THEAD_COMPONENTS,\n ],\n})\nexport class THeadModule { }\n","export function compareValues(direction: any, a: any, b: any) {\n if (a < b) {\n return -1 * direction;\n }\n if (a > b) {\n return direction;\n }\n return 0;\n}\n\nexport class LocalSorter {\n\n static sort(data: Array<any>, field: string, direction: string, customCompare?: Function): Array<any> {\n\n const dir: number = (direction === 'asc') ? 1 : -1;\n const compare: Function = customCompare ? customCompare : compareValues;\n\n return data.sort((a, b) => {\n return compare.call(null, dir, a[field], b[field]);\n });\n }\n}\n","export function filterValues(value: string, search: string) {\n return value.toString().toLowerCase().includes(search.toString().toLowerCase());\n}\n\nexport class LocalFilter {\n\n static filter(data: Array<any>, field: string, search: string, customFilter?: Function): Array<any> {\n const filter: Function = customFilter ? customFilter : filterValues;\n\n return data.filter((el) => {\n const value = typeof el[field] === 'undefined' || el[field] === null ? '' : el[field];\n return filter.call(null, value, search);\n });\n }\n}\n","export class LocalPager {\n\n static paginate(data: Array<any>, page: number, perPage: number): Array<any> {\n return data.slice(perPage * (page - 1), perPage * page);\n }\n}\n","import { LocalSorter } from './local.sorter';\nimport { LocalFilter } from './local.filter';\nimport { LocalPager } from './local.pager';\nimport { DataSource } from '../data-source';\nimport { deepExtend } from '../../helpers';\n\nexport class LocalDataSource extends DataSource {\n\n protected data: Array<any> = [];\n protected filteredAndSorted: Array<any> = [];\n protected sortConf: Array<any> = [];\n protected filterConf: any = {\n filters: [],\n andOperator: true,\n };\n protected pagingConf: any = {};\n\n constructor(data: Array<any> = []) {\n super();\n\n this.data = data;\n }\n\n load(data: Array<any>): Promise<any> {\n this.data = data;\n\n return super.load(data);\n }\n\n prepend(element: any): Promise<any> {\n this.reset(true);\n\n this.data.unshift(element);\n return super.prepend(element);\n }\n\n append(element: any): Promise<any> {\n this.reset(true);\n\n this.data.push(element);\n return super.append(element);\n }\n\n add(element: any): Promise<any> {\n this.data.push(element);\n\n return super.add(element);\n }\n\n remove(element: any): Promise<any> {\n this.data = this.data.filter(el => el !== element);\n\n return super.remove(element);\n }\n\n update(element: any, values: any): Promise<any> {\n return new Promise((resolve, reject) => {\n this.find(element).then((found) => {\n found = deepExtend(found, values);\n super.update(found, values).then(resolve).catch(reject);\n }).catch(reject);\n });\n }\n\n find(element: any): Promise<any> {\n const found = this.data.find(el => el === element);\n if (found) {\n return Promise.resolve(found);\n }\n\n return Promise.reject(new Error('Element was not found in the dataset'));\n }\n\n getElements(): Promise<any> {\n const data = this.data.slice(0);\n return Promise.resolve(this.prepareData(data));\n }\n\n getFilteredAndSorted(): Promise<any> {\n let data = this.data.slice(0);\n this.prepareData(data);\n return Promise.resolve(this.filteredAndSorted);\n }\n\n getAll(): Promise<any> {\n const data = this.data.slice(0);\n return Promise.resolve(data);\n }\n\n reset(silent = false) {\n if (silent) {\n this.filterConf = {\n filters: [],\n andOperator: true,\n };\n this.sortConf = [];\n this.pagingConf['page'] = 1;\n } else {\n this.setFilter([], true, false);\n this.setSort([], false);\n this.setPage(1);\n }\n }\n\n empty(): Promise<any> {\n this.data = [];\n\n return super.empty();\n }\n\n count(): number {\n return this.filteredAndSorted.length;\n }\n\n /**\n *\n * Array of conf objects\n * [\n * {field: string, direction: asc|desc|null, compare: Function|null},\n * ]\n * @param conf\n * @param doEmit\n * @returns {LocalDataSource}\n */\n setSort(conf: Array<any>, doEmit = true): LocalDataSource {\n if (conf !== null) {\n\n conf.forEach((fieldConf) => {\n if (!fieldConf['field'] || typeof fieldConf['direction'] === 'undefined') {\n throw new Error('Sort configuration object is not valid');\n }\n });\n this.sortConf = conf;\n }\n\n super.setSort(conf, doEmit);\n return this;\n }\n\n /**\n *\n * Array of conf objects\n * [\n * {field: string, search: string, filter: Function|null},\n * ]\n * @param conf\n * @param andOperator\n * @param doEmit\n * @returns {LocalDataSource}\n */\n setFilter(conf: Array<any>, andOperator = true, doEmit = true): LocalDataSource {\n if (conf && conf.length > 0) {\n conf.forEach((fieldConf) => {\n this.addFilter(fieldConf, andOperator, false);\n });\n } else {\n this.filterConf = {\n filters: [],\n andOperator: true,\n };\n }\n this.filterConf.andOperator = andOperator;\n this.pagingConf['page'] = 1;\n\n super.setFilter(conf, andOperator, doEmit);\n return this;\n }\n\n addFilter(fieldConf: any, andOperator = true, doEmit: boolean = true): LocalDataSource {\n if (!fieldConf['field'] || typeof fieldConf['search'] === 'undefined') {\n throw new Error('Filter configuration object is not valid');\n }\n\n let found = false;\n this.filterConf.filters.forEach((currentFieldConf: any, index: any) => {\n if (currentFieldConf['field'] === fieldConf['field']) {\n this.filterConf.filters[index] = fieldConf;\n found = true;\n }\n });\n if (!found) {\n this.filterConf.filters.push(fieldConf);\n }\n this.filterConf.andOperator = andOperator;\n super.addFilter(fieldConf, andOperator, doEmit);\n return this;\n }\n\n setPaging(page: number, perPage: number, doEmit: boolean = true): LocalDataSource {\n this.pagingConf['page'] = page;\n this.pagingConf['perPage'] = perPage;\n\n super.setPaging(page, perPage, doEmit);\n return this;\n }\n\n setPage(page: number, doEmit: boolean = true): LocalDataSource {\n this.pagingConf['page'] = page;\n super.setPage(page, doEmit);\n return this;\n }\n\n getSort(): any {\n return this.sortConf;\n }\n\n getFilter(): any {\n return this.filterConf;\n }\n\n getPaging(): any {\n return this.pagingConf;\n }\n\n protected prepareData(data: Array<any>): Array<any> {\n data = this.filter(data);\n data = this.sort(data);\n this.filteredAndSorted = data.slice(0);\n\n return this.paginate(data);\n }\n\n protected sort(data: Array<any>): Array<any> {\n if (this.sortConf) {\n this.sortConf.forEach((fieldConf) => {\n data = LocalSorter\n .sort(data, fieldConf['field'], fieldConf['direction'], fieldConf['compare']);\n });\n }\n return data;\n }\n\n // TODO: refactor?\n protected filter(data: Array<any>): Array<any> {\n if (this.filterConf.filters) {\n if (this.filterConf.andOperator) {\n this.filterConf.filters.forEach((fieldConf: any) => {\n if (fieldConf['search'].length > 0) {\n data = LocalFilter\n .filter(data, fieldConf['field'], fieldConf['search'], fieldConf['filter']);\n }\n });\n } else {\n let mergedData: any = [];\n this.filterConf.filters.forEach((fieldConf: any) => {\n if (fieldConf['search'].length > 0) {\n mergedData = mergedData.concat(LocalFilter\n .filter(data, fieldConf['field'], fieldConf['search'], fieldConf['filter']));\n }\n });\n // remove non unique items\n data = mergedData.filter((elem: any, pos: any, arr: any) => {\n return arr.indexOf(elem) === pos;\n });\n }\n }\n return data;\n }\n\n protected paginate(data: Array<any>): Array<any> {\n if (this.pagingConf && this.pagingConf['page'] && this.pagingConf['perPage']) {\n data = LocalPager.paginate(data, this.pagingConf['page'], this.pagingConf['perPage']);\n }\n return data;\n }\n}\n","import { Component, Input, Output, SimpleChange, EventEmitter, OnChanges } from '@angular/core';\n\nimport { Grid } from './lib/grid';\nimport { DataSource } from './lib/data-source/data-source';\nimport { Row } from './lib/data-set/row';\nimport { deepExtend } from './lib/helpers';\nimport { LocalDataSource } from './lib/data-source/local/local.data-source';\n\n@Component({\n selector: 'ng2-smart-table',\n styleUrls: ['./ng2-smart-table.component.scss'],\n templateUrl: './ng2-smart-table.component.html',\n})\nexport class Ng2SmartTableComponent implements OnChanges {\n\n @Input() source: any;\n @Input() settings: Object = {};\n\n @Output() rowSelect = new EventEmitter<any>();\n @Output() userRowSelect = new EventEmitter<any>();\n @Output() delete = new EventEmitter<any>();\n @Output() edit = new EventEmitter<any>();\n @Output() create = new EventEmitter<any>();\n @Output() custom = new EventEmitter<any>();\n @Output() deleteConfirm = new EventEmitter<any>();\n @Output() editConfirm = new EventEmitter<any>();\n @Output() createConfirm = new EventEmitter<any>();\n @Output() rowHover: EventEmitter<any> = new EventEmitter<any>();\n\n tableClass: string;\n tableId: string;\n perPageSelect: any;\n isHideHeader: boolean;\n isHideSubHeader: boolean;\n isPagerDisplay: boolean;\n rowClassFunction: Function;\n\n\n grid: Grid;\n defaultSettings: Object = {\n mode: 'inline', // inline|external|click-to-edit\n selectMode: 'single', // single|multi\n hideHeader: false,\n hideSubHeader: false,\n actions: {\n columnTitle: 'Actions',\n add: true,\n edit: true,\n delete: true,\n custom: [],\n position: 'left', // left|right\n },\n filter: {\n inputClass: '',\n },\n edit: {\n inputClass: '',\n editButtonContent: 'Edit',\n saveButtonContent: 'Update',\n cancelButtonContent: 'Cancel',\n confirmSave: false,\n },\n add: {\n inputClass: '',\n addButtonContent: 'Add New',\n createButtonContent: 'Create',\n cancelButtonContent: 'Cancel',\n confirmCreate: false,\n },\n delete: {\n deleteButtonContent: 'Delete',\n confirmDelete: false,\n },\n attr: {\n id: '',\n class: '',\n },\n noDataMessage: 'No data found',\n columns: {},\n pager: {\n display: true,\n perPage: 10,\n },\n rowClassFunction: () => \"\"\n };\n\n isAllSelected: boolean = false;\n\n ngOnChanges(changes: { [propertyName: string]: SimpleChange }) {\n if (this.grid) {\n if (changes['settings']) {\n this.grid.setSettings(this.prepareSettings());\n }\n if (changes['source']) {\n this.source = this.prepareSource();\n this.grid.setSource(this.source);\n }\n } else {\n this.initGrid();\n }\n this.tableId = this.grid.getSetting('attr.id');\n this.tableClass = this.grid.getSetting('attr.class');\n this.isHideHeader = this.grid.getSetting('hideHeader');\n this.isHideSubHeader = this.grid.getSetting('hideSubHeader');\n this.isPagerDisplay = this.grid.getSetting('pager.display');\n this.isPagerDisplay = this.grid.getSetting('pager.display');\n this.perPageSelect = this.grid.getSetting('pager.perPageSelect');\n this.rowClassFunction = this.grid.getSetting('rowClassFunction');\n }\n\n editRowSelect(row: Row) {\n if (this.grid.getSetting('selectMode') === 'multi') {\n this.onMultipleSelectRow(row);\n } else {\n this.onSelectRow(row);\n }\n }\n\n onUserSelectRow(row: Row) {\n if (this.grid.getSetting('selectMode') !== 'multi') {\n this.grid.selectRow(row);\n this.emitUserSelectRow(row);\n this.emitSelectRow(row);\n }\n }\n\n onRowHover(row: Row) {\n this.rowHover.emit(row);\n }\n\n multipleSelectRow(row: Row) {\n this.grid.multipleSelectRow(row);\n this.emitUserSelectRow(row);\n this.emitSelectRow(row);\n }\n\n onSelectAllRows($event: any) {\n this.isAllSelected = !this.isAllSelected;\n this.grid.selectAllRows(this.isAllSelected);\n\n this.emitUserSelectRow(null);\n this.emitSelectRow(null);\n }\n\n onSelectRow(row: Row) {\n this.grid.selectRow(row);\n this.emitSelectRow(row);\n }\n\n onMultipleSelectRow(row: Row) {\n this.emitSelectRow(row);\n }\n\n initGrid() {\n this.source = this.prepareSource();\n this.grid = new Grid(this.source, this.prepareSettings());\n this.grid.onSelectRow().subscribe((row) => this.emitSelectRow(row));\n }\n\n prepareSource(): DataSource {\n if (this.source instanceof DataSource) {\n return this.source;\n } else if (this.source instanceof Array) {\n return new LocalDataSource(this.source);\n }\n\n return new LocalDataSource();\n }\n\n prepareSettings(): Object {\n return deepExtend({}, this.defaultSettings, this.settings);\n }\n\n changePage($event: any) {\n this.resetAllSelector();\n }\n\n sort($event: any) {\n this.resetAllSelector();\n }\n\n filter($event: any) {\n this.resetAllSelector();\n }\n\n private resetAllSelector() {\n this.isAllSelected = false;\n }\n\n private emitUserSelectRow(row: Row) {\n const selectedRows = this.grid.getSelectedRows();\n\n this.userRowSelect.emit({\n data: row ? row.getData() : null,\n isSelected: row ? row.getIsSelected() : null,\n source: this.source,\n selected: selectedRows && selectedRows.length ? selectedRows.map((r: Row) => r.getData()) : [],\n });\n }\n\n private emitSelectRow(row: Row) {\n this.rowSelect.emit({\n data: row ? row.getData() : null,\n isSelected: row ? row.getIsSelected() : null,\n source: this.source,\n });\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { CellModule } from './components/cell/cell.module';\nimport { FilterModule } from './components/filter/filter.module';\nimport { PagerModule } from './components/pager/pager.module';\nimport { TBodyModule } from './components/tbody/tbody.module';\nimport { THeadModule } from './components/thead/thead.module';\n\nimport { Ng2SmartTableComponent } from './ng2-smart-table.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n CellModule,\n FilterModule,\n PagerModule,\n TBodyModule,\n THeadModule,\n ],\n declarations: [\n Ng2SmartTableComponent,\n ],\n exports: [\n Ng2SmartTableComponent,\n ],\n})\nexport class Ng2SmartTableModule {\n}\n","export class ServerSourceConf {\n\n protected static readonly SORT_FIELD_KEY = '_sort';\n protected static readonly SORT_DIR_KEY = '_order';\n protected static readonly PAGER_PAGE_KEY = '_page';\n protected static readonly PAGER_LIMIT_KEY = '_limit';\n protected static readonly FILTER_FIELD_KEY = '#field#_like';\n protected static readonly TOTAL_KEY = 'x-total-count';\n protected static readonly DATA_KEY = '';\n\n endPoint: string;\n\n sortFieldKey: string;\n sortDirKey: string;\n pagerPageKey: string;\n pagerLimitKey: string;\n filterFieldKey: string;\n totalKey: string;\n dataKey: string;\n\n constructor(\n { endPoint = '', sortFieldKey = '', sortDirKey = '',\n pagerPageKey = '', pagerLimitKey = '', filterFieldKey = '', totalKey = '', dataKey = '' } = {}) {\n\n this.endPoint = endPoint ? endPoint : '';\n\n this.sortFieldKey = sortFieldKey ? sortFieldKey : ServerSourceConf.SORT_FIELD_KEY;\n this.sortDirKey = sortDirKey ? sortDirKey : ServerSourceConf.SORT_DIR_KEY;\n this.pagerPageKey = pagerPageKey ? pagerPageKey : ServerSourceConf.PAGER_PAGE_KEY;\n this.pagerLimitKey = pagerLimitKey ? pagerLimitKey : ServerSourceConf.PAGER_LIMIT_KEY;\n this.filterFieldKey = filterFieldKey ? filterFieldKey : ServerSourceConf.FILTER_FIELD_KEY;\n this.totalKey = totalKey ? totalKey : ServerSourceConf.TOTAL_KEY;\n this.dataKey = dataKey ? dataKey : ServerSourceConf.DATA_KEY;\n }\n}\n","import { HttpClient, HttpParams } from '@angular/common/http';\nimport { Observable } from 'rxjs';\n\nimport { LocalDataSource } from '../local/local.data-source';\nimport { ServerSourceConf } from './server-source.conf';\nimport { getDeepFromObject } from '../../helpers';\n\nimport { map } from 'rxjs/operators';\n\nexport class ServerDataSource extends LocalDataSource {\n\n protected conf: ServerSourceConf;\n\n protected lastRequestCount: number = 0;\n\n constructor(protected http: HttpClient, conf: ServerSourceConf | {} = {}) {\n super();\n\n this.conf = new ServerSourceConf(conf);\n\n if (!this.conf.endPoint) {\n throw new Error('At least endPoint must be specified as a configuration of the server data source.');\n }\n }\n\n count(): number {\n return this.lastRequestCount;\n }\n\n getElements(): Promise<any> {\n return this.requestElements()\n .pipe(map(res => {\n this.lastRequestCount = this.extractTotalFromResponse(res);\n this.data = this.extractDataFromResponse(res);\n\n return this.data;\n })).toPromise();\n }\n\n /**\n * Extracts array of data from server response\n * @param res\n * @returns {any}\n */\n protected extractDataFromResponse(res: any): Array<any> {\n const rawData = res.body;\n const data = !!this.conf.dataKey ? getDeepFromObject(rawData, this.conf.dataKey, []) : rawData;\n\n if (data instanceof Array) {\n return data;\n }\n\n throw new Error(`Data must be an array.\n Please check that data extracted from the server response by the key '${this.conf.dataKey}' exists and is array.`);\n }\n\n /**\n * Extracts total rows count from the server response\n * Looks for the count in the heders first, then in the response body\n * @param res\n * @returns {any}\n */\n protected extractTotalFromResponse(res: any): number {\n if (res.headers.has(this.conf.totalKey)) {\n return +res.headers.get(this.conf.totalKey);\n } else {\n const rawData = res.body;\n return getDeepFromObject(rawData, this.conf.totalKey, 0);\n }\n }\n\n protected requestElements(): Observable<any> {\n let httpParams = this.createRequesParams();\n return this.http.get(this.conf.endPoint, { params: httpParams, observe: 'response' });\n }\n\n protected createRequesParams(): HttpParams {\n let httpParams = new HttpParams();\n\n httpParams = this.addSortRequestParams(httpParams);\n httpParams = this.addFilterRequestParams(httpParams);\n return this.addPagerRequestParams(httpParams);\n }\n\n protected addSortRequestParams(httpParams: HttpParams): HttpParams {\n if (this.sortConf) {\n this.sortConf.forEach((fieldConf) => {\n httpParams = httpParams.set(this.conf.sortFieldKey, fieldConf.field);\n httpParams = httpParams.set(this.conf.sortDirKey, fieldConf.direction.toUpperCase());\n });\n }\n\n return httpParams;\n }\n\n protected addFilterRequestParams(httpParams: HttpParams): HttpParams {\n\n if (this.filterConf.filters) {\n this.filterConf.filters.forEach((fieldConf: any) => {\n if (fieldConf['search']) {\n httpParams = httpParams.set(this.conf.filterFieldKey.replace('#field#', fieldConf['field']), fieldConf['search']);\n }\n });\n }\n\n return httpParams;\n }\n\n protected addPagerRequestParams(httpParams: HttpParams): HttpParams {\n\n if (this.pagingConf && this.pagingConf['page'] && this.pagingConf['perPage']) {\n httpParams = httpParams.set(this.conf.pagerPageKey, this.pagingConf['page']);\n httpParams = httpParams.set(this.conf.pagerLimitKey, this.pagingConf['perPage']);\n }\n\n return httpParams;\n }\n}\n"]} |