novo-elements 5.7.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/bundles/novo-elements.umd.js +298 -215
  2. package/bundles/novo-elements.umd.js.map +1 -1
  3. package/bundles/novo-elements.umd.min.js +1 -1
  4. package/bundles/novo-elements.umd.min.js.map +1 -1
  5. package/elements/data-table/cell-headers/data-table-checkbox-header-cell.component.d.ts +5 -1
  6. package/elements/data-table/cells/data-table-checkbox-cell.component.d.ts +3 -0
  7. package/elements/data-table/data-table-clear-button.component.d.ts +2 -0
  8. package/elements/data-table/data-table.component.d.ts +3 -1
  9. package/elements/data-table/data-table.component.scss +3 -0
  10. package/elements/data-table/interfaces.d.ts +3 -0
  11. package/elements/data-table/state/data-table-state.service.d.ts +6 -2
  12. package/esm2015/elements/data-table/cell-headers/data-table-checkbox-header-cell.component.js +26 -6
  13. package/esm2015/elements/data-table/cells/data-table-checkbox-cell.component.js +16 -5
  14. package/esm2015/elements/data-table/data-table-clear-button.component.js +9 -1
  15. package/esm2015/elements/data-table/data-table.component.js +8 -3
  16. package/esm2015/elements/data-table/data-table.source.js +5 -2
  17. package/esm2015/elements/data-table/interfaces.js +1 -1
  18. package/esm2015/elements/data-table/pagination/data-table-pagination.component.js +4 -1
  19. package/esm2015/elements/data-table/sort-filter/sort-filter.directive.js +3 -1
  20. package/esm2015/elements/data-table/state/data-table-state.service.js +31 -7
  21. package/esm2015/index.js +1 -1
  22. package/esm2015/services/novo-label-service.js +2 -1
  23. package/fesm2015/novo-elements.js +290 -214
  24. package/fesm2015/novo-elements.js.map +1 -1
  25. package/index.d.ts +1 -1
  26. package/novo-elements.metadata.json +1 -1
  27. package/package.json +1 -1
  28. package/services/novo-label-service.d.ts +1 -0
@@ -3128,6 +3128,7 @@
3128
3128
  this.clearAllNormalCase = 'Clear All';
3129
3129
  this.clearSort = 'Clear Sort';
3130
3130
  this.clearFilter = 'Clear Filter';
3131
+ this.clearSelected = 'Clear Selected';
3131
3132
  this.today = 'Today';
3132
3133
  this.now = 'Now';
3133
3134
  this.isRequired = 'is required';
@@ -6997,6 +6998,7 @@
6997
6998
  this.expandedRows = new Set();
6998
6999
  this.isForceRefresh = false;
6999
7000
  this.updates = new core.EventEmitter();
7001
+ this.retainSelected = false;
7000
7002
  }
7001
7003
  Object.defineProperty(DataTableState.prototype, "userFiltered", {
7002
7004
  get: function () {
@@ -7027,9 +7029,12 @@
7027
7029
  this.filter = undefined;
7028
7030
  }
7029
7031
  this.page = 0;
7030
- this.selectedRows.clear();
7031
- this.resetSource.next();
7032
+ if (!this.retainSelected) {
7033
+ this.selectedRows.clear();
7034
+ this.resetSource.next();
7035
+ }
7032
7036
  this.onSortFilterChange();
7037
+ this.retainSelected = false;
7033
7038
  if (fireUpdate) {
7034
7039
  this.updates.emit({
7035
7040
  sort: this.sort,
@@ -7042,8 +7047,8 @@
7042
7047
  if (fireUpdate === void 0) { fireUpdate = true; }
7043
7048
  this.sort = undefined;
7044
7049
  this.page = 0;
7045
- this.selectedRows.clear();
7046
- this.resetSource.next();
7050
+ this.checkRetainment('sort');
7051
+ this.reset(fireUpdate, true);
7047
7052
  this.onSortFilterChange();
7048
7053
  if (fireUpdate) {
7049
7054
  this.updates.emit({
@@ -7058,8 +7063,8 @@
7058
7063
  this.filter = undefined;
7059
7064
  this.globalSearch = undefined;
7060
7065
  this.page = 0;
7061
- this.selectedRows.clear();
7062
- this.resetSource.next();
7066
+ this.checkRetainment('filter');
7067
+ this.reset(fireUpdate, true);
7063
7068
  this.onSortFilterChange();
7064
7069
  if (fireUpdate) {
7065
7070
  this.updates.emit({
@@ -7069,6 +7074,20 @@
7069
7074
  });
7070
7075
  }
7071
7076
  };
7077
+ DataTableState.prototype.clearSelected = function (fireUpdate) {
7078
+ if (fireUpdate === void 0) { fireUpdate = true; }
7079
+ this.globalSearch = undefined;
7080
+ this.page = 0;
7081
+ this.reset(fireUpdate, true);
7082
+ this.onSelectionChange();
7083
+ if (fireUpdate) {
7084
+ this.updates.emit({
7085
+ sort: this.sort,
7086
+ filter: this.filter,
7087
+ globalSearch: this.globalSearch,
7088
+ });
7089
+ }
7090
+ };
7072
7091
  DataTableState.prototype.onSelectionChange = function () {
7073
7092
  this.selectionSource.next();
7074
7093
  };
@@ -7076,9 +7095,12 @@
7076
7095
  this.expandSource.next(targetId);
7077
7096
  };
7078
7097
  DataTableState.prototype.onPaginationChange = function (isPageSizeChange, pageSize) {
7098
+ this.checkRetainment('page');
7079
7099
  this.paginationSource.next({ isPageSizeChange: isPageSizeChange, pageSize: pageSize });
7080
7100
  };
7081
7101
  DataTableState.prototype.onSortFilterChange = function () {
7102
+ this.checkRetainment('sort');
7103
+ this.checkRetainment('filter');
7082
7104
  this.sortFilterSource.next({
7083
7105
  sort: this.sort,
7084
7106
  filter: this.filter,
@@ -7102,6 +7124,10 @@
7102
7124
  }
7103
7125
  }
7104
7126
  };
7127
+ DataTableState.prototype.checkRetainment = function (caller) {
7128
+ var _a;
7129
+ this.retainSelected = ((_a = this.selectionOptions) === null || _a === void 0 ? void 0 : _a.some(function (option) { return option.label === caller; })) || this.retainSelected;
7130
+ };
7105
7131
  return DataTableState;
7106
7132
  }());
7107
7133
  DataTableState.decorators = [
@@ -7113,6 +7139,7 @@
7113
7139
  this.state = state;
7114
7140
  this.ref = ref;
7115
7141
  this.labels = labels;
7142
+ this.selectedClear = new core.EventEmitter();
7116
7143
  this.sortClear = new core.EventEmitter();
7117
7144
  this.filterClear = new core.EventEmitter();
7118
7145
  this.allClear = new core.EventEmitter();
@@ -7125,9 +7152,14 @@
7125
7152
  this.state.clearFilter();
7126
7153
  this.filterClear.emit(true);
7127
7154
  };
7155
+ NovoDataTableClearButton.prototype.clearSelected = function () {
7156
+ this.state.clearSelected();
7157
+ this.selectedClear.emit(true);
7158
+ };
7128
7159
  NovoDataTableClearButton.prototype.clearAll = function () {
7129
7160
  this.state.reset();
7130
7161
  this.allClear.emit(true);
7162
+ this.selectedClear.emit(true);
7131
7163
  this.sortClear.emit(true);
7132
7164
  this.filterClear.emit(true);
7133
7165
  };
@@ -7136,7 +7168,7 @@
7136
7168
  NovoDataTableClearButton.decorators = [
7137
7169
  { type: core.Component, args: [{
7138
7170
  selector: 'novo-data-table-clear-button',
7139
- template: "\n <novo-dropdown side=\"bottom-right\" class=\"novo-data-table-clear-button\" data-automation-id=\"novo-data-table-clear-dropdown\">\n <button type=\"button\" theme=\"primary\" color=\"negative\" icon=\"collapse\" data-automation-id=\"novo-data-table-clear-dropdown-btn\">{{ labels.clear }}</button>\n <list>\n <item *ngIf=\"state.sort\" (click)=\"clearSort()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-sort\">{{ labels.clearSort }}</item>\n <item *ngIf=\"state.filter\" (click)=\"clearFilter()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-filter\">{{ labels.clearFilter }}</item>\n <item *ngIf=\"state.sort && state.filter\" (click)=\"clearAll()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-all\">{{ labels.clearAllNormalCase }}</item>\n </list>\n </novo-dropdown>\n ",
7171
+ template: "\n <novo-dropdown side=\"bottom-right\" class=\"novo-data-table-clear-button\" data-automation-id=\"novo-data-table-clear-dropdown\">\n <button type=\"button\" theme=\"primary\" color=\"negative\" icon=\"collapse\" data-automation-id=\"novo-data-table-clear-dropdown-btn\">{{ labels.clear }}</button>\n <list>\n <item *ngIf=\"state.selected.length > 0\" (click)=\"clearSelected()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-selected\">{{ labels.clearSelected }}</item>\n <item *ngIf=\"state.sort\" (click)=\"clearSort()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-sort\">{{ labels.clearSort }}</item>\n <item *ngIf=\"state.filter\" (click)=\"clearFilter()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-filter\">{{ labels.clearFilter }}</item>\n <item *ngIf=\"state.sort && state.filter\" (click)=\"clearAll()\" data-automation-id=\"novo-data-table-clear-dropdown-clear-all\">{{ labels.clearAllNormalCase }}</item>\n </list>\n </novo-dropdown>\n ",
7140
7172
  changeDetection: core.ChangeDetectionStrategy.OnPush
7141
7173
  },] }
7142
7174
  ];
@@ -7146,6 +7178,7 @@
7146
7178
  { type: NovoLabelService }
7147
7179
  ]; };
7148
7180
  NovoDataTableClearButton.propDecorators = {
7181
+ selectedClear: [{ type: core.Output }],
7149
7182
  sortClear: [{ type: core.Output }],
7150
7183
  filterClear: [{ type: core.Output }],
7151
7184
  allClear: [{ type: core.Output }]
@@ -7200,7 +7233,10 @@
7200
7233
  _this.current = data.results.length;
7201
7234
  _this.data = data.results;
7202
7235
  // Clear selection
7203
- _this.state.selectedRows.clear();
7236
+ if (!_this.state.retainSelected) {
7237
+ _this.state.selectedRows.clear();
7238
+ }
7239
+ _this.state.retainSelected = false;
7204
7240
  _this.state.onSelectionChange();
7205
7241
  // Mark changes
7206
7242
  setTimeout(function () {
@@ -7572,6 +7608,7 @@
7572
7608
  }
7573
7609
  }
7574
7610
  this.state.filter = filter;
7611
+ this.state.checkRetainment('filter');
7575
7612
  this.state.reset(false, true);
7576
7613
  this.state.updates.next({ filter: filter, sort: this.state.sort });
7577
7614
  this.state.onSortFilterChange();
@@ -7579,6 +7616,7 @@
7579
7616
  NovoDataTableSortFilter.prototype.sort = function (id, value, transform) {
7580
7617
  var sort = { id: id, value: value, transform: transform };
7581
7618
  this.state.sort = sort;
7619
+ this.state.checkRetainment('sort');
7582
7620
  this.state.reset(false, true);
7583
7621
  this.state.updates.next({ sort: sort, filter: this.state.filter });
7584
7622
  this.state.onSortFilterChange();
@@ -7991,6 +8029,7 @@
7991
8029
  this.trackByFn = function (index, item) { return item.id; };
7992
8030
  this.templates = {};
7993
8031
  this.fixedHeader = false;
8032
+ this.maxSelected = undefined;
7994
8033
  this._hideGlobalSearch = true;
7995
8034
  this.preferencesChanged = new core.EventEmitter();
7996
8035
  this.loading = true;
@@ -8214,6 +8253,7 @@
8214
8253
  };
8215
8254
  NovoDataTable.prototype.ngAfterContentInit = function () {
8216
8255
  var _this = this;
8256
+ var _a;
8217
8257
  if (this.displayedColumns && this.displayedColumns.length) {
8218
8258
  this.expandable = this.displayedColumns.includes('expand');
8219
8259
  }
@@ -8243,6 +8283,7 @@
8243
8283
  }
8244
8284
  this.state.page = this.paginationOptions ? this.paginationOptions.page : undefined;
8245
8285
  this.state.pageSize = this.paginationOptions ? this.paginationOptions.pageSize : undefined;
8286
+ this.state.selectionOptions = (_a = this.selectionOptions) !== null && _a !== void 0 ? _a : undefined;
8246
8287
  // Scrolling inside table
8247
8288
  this.novoDataTableContainer.nativeElement.addEventListener('scroll', this.scrollListenerHandler);
8248
8289
  this.initialized = true;
@@ -8417,11 +8458,11 @@
8417
8458
  this.ref.markForCheck();
8418
8459
  };
8419
8460
  NovoDataTable.prototype.performInteractions = function (event) {
8420
- var e_1, _a;
8461
+ var e_1, _b;
8421
8462
  if (this.listInteractions) {
8422
8463
  try {
8423
- for (var _b = __values(this.columns), _c = _b.next(); !_c.done; _c = _b.next()) {
8424
- var column = _c.value;
8464
+ for (var _c = __values(this.columns), _d = _c.next(); !_d.done; _d = _c.next()) {
8465
+ var column = _d.value;
8425
8466
  var allListColumnInteractions = this.listInteractions[column.id];
8426
8467
  var listColumnInteraction = allListColumnInteractions && allListColumnInteractions.find(function (int) { return int.event.includes(event); });
8427
8468
  if (listColumnInteraction) {
@@ -8432,7 +8473,7 @@
8432
8473
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
8433
8474
  finally {
8434
8475
  try {
8435
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8476
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
8436
8477
  }
8437
8478
  finally { if (e_1) throw e_1.error; }
8438
8479
  }
@@ -8450,7 +8491,7 @@
8450
8491
  animations.transition('void <=> *', animations.animate('70ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
8451
8492
  ]),
8452
8493
  ],
8453
- template: "\n <header\n *ngIf=\"(!(dataSource?.totallyEmpty && !state.userFiltered) && !loading) || forceShowHeader\"\n [class.empty]=\"hideGlobalSearch && !paginationOptions && !templates['customActions']\"\n >\n <ng-container *ngTemplateOutlet=\"templates['customHeader']\"></ng-container>\n <novo-search\n alwaysOpen=\"true\"\n (searchChanged)=\"onSearchChange($event)\"\n [(ngModel)]=\"state.globalSearch\"\n *ngIf=\"!hideGlobalSearch\"\n [placeholder]=\"searchOptions?.placeholder\"\n [hint]=\"searchOptions?.tooltip\"\n >\n </novo-search>\n <novo-data-table-pagination\n *ngIf=\"paginationOptions\"\n [theme]=\"paginationOptions.theme\"\n [length]=\"dataSource?.currentTotal\"\n [page]=\"paginationOptions.page\"\n [pageSize]=\"paginationOptions.pageSize\"\n [pageSizeOptions]=\"paginationOptions.pageSizeOptions\"\n [dataFeatureId]=\"paginatorDataFeatureId\"\n >\n </novo-data-table-pagination>\n <div class=\"novo-data-table-actions\" *ngIf=\"templates['customActions']\">\n <ng-container *ngTemplateOutlet=\"templates['customActions']\"></ng-container>\n </div>\n </header>\n <div class=\"novo-data-table-loading-mask\" *ngIf=\"dataSource?.loading || loading\" data-automation-id=\"novo-data-table-loading\">\n <novo-loading></novo-loading>\n </div>\n <div class=\"novo-data-table-outside-container\" [ngClass]=\"{ 'novo-data-table-outside-container-fixed': fixedHeader }\">\n <div class=\"novo-data-table-custom-filter\" *ngIf=\"customFilter\">\n <ng-container *ngTemplateOutlet=\"templates['customFilter']\"></ng-container>\n </div>\n <div\n #novoDataTableContainer\n class=\"novo-data-table-container\"\n [ngClass]=\"{ 'novo-data-table-container-fixed': fixedHeader }\"\n [class.empty-user-filtered]=\"dataSource?.currentlyEmpty && state.userFiltered\"\n [class.empty]=\"dataSource?.totallyEmpty && !dataSource?.loading && !loading && !state.userFiltered && !dataSource.pristine\"\n >\n <cdk-table\n *ngIf=\"columns?.length > 0 && columnsLoaded && dataSource\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"trackByFn\"\n novoDataTableSortFilter\n [class.expandable]=\"expandable\"\n [class.empty]=\"dataSource?.currentlyEmpty && state.userFiltered\"\n [hidden]=\"dataSource?.totallyEmpty && !state.userFiltered\"\n >\n <ng-container cdkColumnDef=\"selection\">\n <novo-data-table-checkbox-header-cell *cdkHeaderCellDef></novo-data-table-checkbox-header-cell>\n <novo-data-table-checkbox-cell *cdkCellDef=\"let row; let i = index\" [row]=\"row\"></novo-data-table-checkbox-cell>\n </ng-container>\n <ng-container cdkColumnDef=\"expand\">\n <novo-data-table-expand-header-cell *cdkHeaderCellDef></novo-data-table-expand-header-cell>\n <novo-data-table-expand-cell *cdkCellDef=\"let row; let i = index\" [row]=\"row\"></novo-data-table-expand-cell>\n </ng-container>\n <ng-container *ngFor=\"let column of columns; trackBy: trackColumnsBy\" [cdkColumnDef]=\"column.id\">\n <novo-data-table-header-cell\n *cdkHeaderCellDef\n [column]=\"column\"\n [filterTemplate]=\"templates['column-filter-' + column.id]\"\n [novo-data-table-cell-config]=\"column\"\n [resized]=\"resized\"\n [defaultSort]=\"defaultSort\"\n [allowMultipleFilters]=\"allowMultipleFilters\"\n [class.empty]=\"column?.type === 'action' && !column?.label\"\n [class.button-header-cell]=\"column?.type === 'expand' || (column?.type === 'action' && !column?.action?.options)\"\n [class.dropdown-header-cell]=\"column?.type === 'action' && column?.action?.options\"\n [class.fixed-header]=\"fixedHeader\"\n ></novo-data-table-header-cell>\n <novo-data-table-cell\n *cdkCellDef=\"let row\"\n [resized]=\"resized\"\n [column]=\"column\"\n [row]=\"row\"\n [template]=\"columnToTemplate[column.id]\"\n [class.empty]=\"column?.type === 'action' && !column?.label\"\n [class.button-cell]=\"column?.type === 'expand' || (column?.type === 'action' && !column?.action?.options)\"\n [class.dropdown-cell]=\"column?.type === 'action' && column?.action?.options\"\n ></novo-data-table-cell>\n </ng-container>\n <novo-data-table-header-row\n *cdkHeaderRowDef=\"displayedColumns\"\n [fixedHeader]=\"fixedHeader\"\n data-automation-id=\"novo-data-table-header-row\"\n ></novo-data-table-header-row>\n <novo-data-table-row\n *cdkRowDef=\"let row; columns: displayedColumns\"\n [ngClass]=\"{ active: row[rowIdentifier] == activeRowIdentifier }\"\n [novoDataTableExpand]=\"detailRowTemplate\"\n [row]=\"row\"\n [id]=\"name + '-' + row[rowIdentifier]\"\n [dataAutomationId]=\"row[rowIdentifier]\"\n ></novo-data-table-row>\n </cdk-table>\n <div class=\"novo-data-table-footer\" *ngIf=\"templates['footer']\">\n <ng-container *ngTemplateOutlet=\"templates['footer']; context: { $implicit: columns, data: dataSource.data }\"></ng-container>\n </div>\n <div\n class=\"novo-data-table-no-results-container\"\n [style.left.px]=\"scrollLeft\"\n *ngIf=\"dataSource?.currentlyEmpty && state.userFiltered && !dataSource?.loading && !loading && !dataSource.pristine\"\n >\n <div class=\"novo-data-table-empty-message\">\n <ng-container *ngTemplateOutlet=\"templates['noResultsMessage'] || templates['defaultNoResultsMessage']\"></ng-container>\n </div>\n </div>\n </div>\n <div\n class=\"novo-data-table-empty-container\"\n *ngIf=\"dataSource?.totallyEmpty && !dataSource?.loading && !loading && !state.userFiltered && !dataSource.pristine\"\n >\n <div class=\"novo-data-table-empty-message\">\n <ng-container *ngTemplateOutlet=\"templates['emptyMessage'] || templates['defaultNoResultsMessage']\"></ng-container>\n </div>\n </div>\n </div>\n <!-- DEFAULT CELL TEMPLATE -->\n <ng-template novoTemplate=\"textCellTemplate\" let-row let-col=\"col\">\n <span [style.width.px]=\"col?.width\" [style.min-width.px]=\"col?.width\" [style.max-width.px]=\"col?.width\">{{\n row[col.id] | dataTableInterpolate: col\n }}</span>\n </ng-template>\n <ng-template novoTemplate=\"dateCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableDateRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"datetimeCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableDateTimeRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"timeCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableTimeRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"currencyCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableCurrencyRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"bigdecimalCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableBigDecimalRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"numberCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableNumberRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"percentCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableNumberRenderer: col:true }}</span>\n </ng-template>\n <ng-template novoTemplate=\"linkCellTemplate\" let-row let-col=\"col\">\n <a\n [attr.data-feature-id]=\"col?.attributes?.dataFeatureId\"\n (click)=\"col.handlers?.click({ originalEvent: $event, row: row })\"\n [style.width.px]=\"col?.width\"\n [style.min-width.px]=\"col?.width\"\n [style.max-width.px]=\"col?.width\"\n >{{ row[col.id] | dataTableInterpolate: col }}</a\n >\n </ng-template>\n <ng-template novoTemplate=\"telCellTemplate\" let-row let-col=\"col\">\n <a href=\"tel:{{ row[col.id] | dataTableInterpolate: col }}\" [target]=\"col?.attributes?.target\">{{\n row[col.id] | dataTableInterpolate: col\n }}</a>\n </ng-template>\n <ng-template novoTemplate=\"mailtoCellTemplate\" let-row let-col=\"col\">\n <a href=\"mailto:{{ row[col.id] | dataTableInterpolate: col }}\" [target]=\"col?.attributes?.target\">{{\n row[col.id] | dataTableInterpolate: col\n }}</a>\n </ng-template>\n <ng-template novoTemplate=\"buttonCellTemplate\" let-row let-col=\"col\">\n <p [tooltip]=\"col?.action?.tooltip\" tooltipPosition=\"right\" [attr.data-feature-id]=\"col?.attributes?.dataFeatureId\">\n <i\n class=\"bhi-{{ col?.action?.icon }} data-table-icon\"\n (click)=\"col.handlers?.click({ originalEvent: $event, row: row })\"\n [class.disabled]=\"isDisabled(col, row)\"\n ></i>\n </p>\n </ng-template>\n <ng-template novoTemplate=\"dropdownCellTemplate\" let-row let-col=\"col\">\n <novo-dropdown parentScrollSelector=\".novo-data-table-container\" containerClass=\"novo-data-table-dropdown\">\n <button type=\"button\" theme=\"dialogue\" [icon]=\"col.action.icon\" inverse>{{ col.label }}</button>\n <list>\n <item\n *ngFor=\"let option of col?.action?.options\"\n (action)=\"option.handlers.click({ originalEvent: $event?.originalEvent, row: row })\"\n [disabled]=\"isDisabled(option, row)\"\n >\n <span [attr.data-automation-id]=\"option.label\">{{ option.label }}</span>\n </item>\n </list>\n </novo-dropdown>\n </ng-template>\n <ng-template novoTemplate=\"defaultNoResultsMessage\">\n <h4><i class=\"bhi-search-question\"></i> {{ labels.noMatchingRecordsMessage }}</h4>\n </ng-template>\n <ng-template novoTemplate=\"defaultEmptyMessage\">\n <h4><i class=\"bhi-search-question\"></i> {{ labels.emptyTableMessage }}</h4>\n </ng-template>\n <ng-template novoTemplate=\"expandedRow\"> You did not provide an \"expandedRow\" template! </ng-template>\n <ng-template #detailRowTemplate let-row>\n <div class=\"novo-data-table-detail-row\" [@expand] style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"templates['expandedRow']; context: { $implicit: row }\"></ng-container>\n </div>\n </ng-template>\n <!-- CUSTOM CELLS PASSED IN -->\n <ng-content></ng-content>\n ",
8494
+ template: "\n <header\n *ngIf=\"(!(dataSource?.totallyEmpty && !state.userFiltered) && !loading) || forceShowHeader\"\n [class.empty]=\"hideGlobalSearch && !paginationOptions && !templates['customActions']\"\n >\n <ng-container *ngTemplateOutlet=\"templates['customHeader']\"></ng-container>\n <novo-search\n alwaysOpen=\"true\"\n (searchChanged)=\"onSearchChange($event)\"\n [(ngModel)]=\"state.globalSearch\"\n *ngIf=\"!hideGlobalSearch\"\n [placeholder]=\"searchOptions?.placeholder\"\n [hint]=\"searchOptions?.tooltip\"\n >\n </novo-search>\n <novo-data-table-pagination\n *ngIf=\"paginationOptions\"\n [theme]=\"paginationOptions.theme\"\n [length]=\"dataSource?.currentTotal\"\n [page]=\"paginationOptions.page\"\n [pageSize]=\"paginationOptions.pageSize\"\n [pageSizeOptions]=\"paginationOptions.pageSizeOptions\"\n [dataFeatureId]=\"paginatorDataFeatureId\"\n >\n </novo-data-table-pagination>\n <div class=\"novo-data-table-actions\" *ngIf=\"templates['customActions']\">\n <ng-container *ngTemplateOutlet=\"templates['customActions']\"></ng-container>\n </div>\n </header>\n <div class=\"novo-data-table-loading-mask\" *ngIf=\"dataSource?.loading || loading\" data-automation-id=\"novo-data-table-loading\">\n <novo-loading></novo-loading>\n </div>\n <div class=\"novo-data-table-outside-container\" [ngClass]=\"{ 'novo-data-table-outside-container-fixed': fixedHeader }\">\n <div class=\"novo-data-table-custom-filter\" *ngIf=\"customFilter\">\n <ng-container *ngTemplateOutlet=\"templates['customFilter']\"></ng-container>\n </div>\n <div\n #novoDataTableContainer\n class=\"novo-data-table-container\"\n [ngClass]=\"{ 'novo-data-table-container-fixed': fixedHeader }\"\n [class.empty-user-filtered]=\"dataSource?.currentlyEmpty && state.userFiltered\"\n [class.empty]=\"dataSource?.totallyEmpty && !dataSource?.loading && !loading && !state.userFiltered && !dataSource.pristine\"\n >\n <cdk-table\n *ngIf=\"columns?.length > 0 && columnsLoaded && dataSource\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"trackByFn\"\n novoDataTableSortFilter\n [class.expandable]=\"expandable\"\n [class.empty]=\"dataSource?.currentlyEmpty && state.userFiltered\"\n [hidden]=\"dataSource?.totallyEmpty && !state.userFiltered\"\n >\n <ng-container cdkColumnDef=\"selection\">\n <novo-data-table-checkbox-header-cell *cdkHeaderCellDef [maxSelected]=\"maxSelected\"></novo-data-table-checkbox-header-cell>\n <novo-data-table-checkbox-cell *cdkCellDef=\"let row; let i = index\" [row]=\"row\" [maxSelected]=\"maxSelected\"></novo-data-table-checkbox-cell>\n </ng-container>\n <ng-container cdkColumnDef=\"expand\">\n <novo-data-table-expand-header-cell *cdkHeaderCellDef></novo-data-table-expand-header-cell>\n <novo-data-table-expand-cell *cdkCellDef=\"let row; let i = index\" [row]=\"row\"></novo-data-table-expand-cell>\n </ng-container>\n <ng-container *ngFor=\"let column of columns; trackBy: trackColumnsBy\" [cdkColumnDef]=\"column.id\">\n <novo-data-table-header-cell\n *cdkHeaderCellDef\n [column]=\"column\"\n [filterTemplate]=\"templates['column-filter-' + column.id]\"\n [novo-data-table-cell-config]=\"column\"\n [resized]=\"resized\"\n [defaultSort]=\"defaultSort\"\n [allowMultipleFilters]=\"allowMultipleFilters\"\n [class.empty]=\"column?.type === 'action' && !column?.label\"\n [class.button-header-cell]=\"column?.type === 'expand' || (column?.type === 'action' && !column?.action?.options)\"\n [class.dropdown-header-cell]=\"column?.type === 'action' && column?.action?.options\"\n [class.fixed-header]=\"fixedHeader\"\n ></novo-data-table-header-cell>\n <novo-data-table-cell\n *cdkCellDef=\"let row\"\n [resized]=\"resized\"\n [column]=\"column\"\n [row]=\"row\"\n [template]=\"columnToTemplate[column.id]\"\n [class.empty]=\"column?.type === 'action' && !column?.label\"\n [class.button-cell]=\"column?.type === 'expand' || (column?.type === 'action' && !column?.action?.options)\"\n [class.dropdown-cell]=\"column?.type === 'action' && column?.action?.options\"\n ></novo-data-table-cell>\n </ng-container>\n <novo-data-table-header-row\n *cdkHeaderRowDef=\"displayedColumns\"\n [fixedHeader]=\"fixedHeader\"\n data-automation-id=\"novo-data-table-header-row\"\n ></novo-data-table-header-row>\n <novo-data-table-row\n *cdkRowDef=\"let row; columns: displayedColumns\"\n [ngClass]=\"{ active: row[rowIdentifier] == activeRowIdentifier }\"\n [novoDataTableExpand]=\"detailRowTemplate\"\n [row]=\"row\"\n [id]=\"name + '-' + row[rowIdentifier]\"\n [dataAutomationId]=\"row[rowIdentifier]\"\n ></novo-data-table-row>\n </cdk-table>\n <div class=\"novo-data-table-footer\" *ngIf=\"templates['footer']\">\n <ng-container *ngTemplateOutlet=\"templates['footer']; context: { $implicit: columns, data: dataSource.data }\"></ng-container>\n </div>\n <div\n class=\"novo-data-table-no-results-container\"\n [style.left.px]=\"scrollLeft\"\n *ngIf=\"dataSource?.currentlyEmpty && state.userFiltered && !dataSource?.loading && !loading && !dataSource.pristine\"\n >\n <div class=\"novo-data-table-empty-message\">\n <ng-container *ngTemplateOutlet=\"templates['noResultsMessage'] || templates['defaultNoResultsMessage']\"></ng-container>\n </div>\n </div>\n </div>\n <div\n class=\"novo-data-table-empty-container\"\n *ngIf=\"dataSource?.totallyEmpty && !dataSource?.loading && !loading && !state.userFiltered && !dataSource.pristine\"\n >\n <div class=\"novo-data-table-empty-message\">\n <ng-container *ngTemplateOutlet=\"templates['emptyMessage'] || templates['defaultNoResultsMessage']\"></ng-container>\n </div>\n </div>\n </div>\n <!-- DEFAULT CELL TEMPLATE -->\n <ng-template novoTemplate=\"textCellTemplate\" let-row let-col=\"col\">\n <span [style.width.px]=\"col?.width\" [style.min-width.px]=\"col?.width\" [style.max-width.px]=\"col?.width\">{{\n row[col.id] | dataTableInterpolate: col\n }}</span>\n </ng-template>\n <ng-template novoTemplate=\"dateCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableDateRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"datetimeCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableDateTimeRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"timeCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableTimeRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"currencyCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableCurrencyRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"bigdecimalCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableBigDecimalRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"numberCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableNumberRenderer: col }}</span>\n </ng-template>\n <ng-template novoTemplate=\"percentCellTemplate\" let-row let-col=\"col\">\n <span>{{ row[col.id] | dataTableInterpolate: col | dataTableNumberRenderer: col:true }}</span>\n </ng-template>\n <ng-template novoTemplate=\"linkCellTemplate\" let-row let-col=\"col\">\n <a\n [attr.data-feature-id]=\"col?.attributes?.dataFeatureId\"\n (click)=\"col.handlers?.click({ originalEvent: $event, row: row })\"\n [style.width.px]=\"col?.width\"\n [style.min-width.px]=\"col?.width\"\n [style.max-width.px]=\"col?.width\"\n >{{ row[col.id] | dataTableInterpolate: col }}</a\n >\n </ng-template>\n <ng-template novoTemplate=\"telCellTemplate\" let-row let-col=\"col\">\n <a href=\"tel:{{ row[col.id] | dataTableInterpolate: col }}\" [target]=\"col?.attributes?.target\">{{\n row[col.id] | dataTableInterpolate: col\n }}</a>\n </ng-template>\n <ng-template novoTemplate=\"mailtoCellTemplate\" let-row let-col=\"col\">\n <a href=\"mailto:{{ row[col.id] | dataTableInterpolate: col }}\" [target]=\"col?.attributes?.target\">{{\n row[col.id] | dataTableInterpolate: col\n }}</a>\n </ng-template>\n <ng-template novoTemplate=\"buttonCellTemplate\" let-row let-col=\"col\">\n <p [tooltip]=\"col?.action?.tooltip\" tooltipPosition=\"right\" [attr.data-feature-id]=\"col?.attributes?.dataFeatureId\">\n <i\n class=\"bhi-{{ col?.action?.icon }} data-table-icon\"\n (click)=\"col.handlers?.click({ originalEvent: $event, row: row })\"\n [class.disabled]=\"isDisabled(col, row)\"\n ></i>\n </p>\n </ng-template>\n <ng-template novoTemplate=\"dropdownCellTemplate\" let-row let-col=\"col\">\n <novo-dropdown parentScrollSelector=\".novo-data-table-container\" containerClass=\"novo-data-table-dropdown\">\n <button type=\"button\" theme=\"dialogue\" [icon]=\"col.action.icon\" inverse>{{ col.label }}</button>\n <list>\n <item\n *ngFor=\"let option of col?.action?.options\"\n (action)=\"option.handlers.click({ originalEvent: $event?.originalEvent, row: row })\"\n [disabled]=\"isDisabled(option, row)\"\n >\n <span [attr.data-automation-id]=\"option.label\">{{ option.label }}</span>\n </item>\n </list>\n </novo-dropdown>\n </ng-template>\n <ng-template novoTemplate=\"defaultNoResultsMessage\">\n <h4><i class=\"bhi-search-question\"></i> {{ labels.noMatchingRecordsMessage }}</h4>\n </ng-template>\n <ng-template novoTemplate=\"defaultEmptyMessage\">\n <h4><i class=\"bhi-search-question\"></i> {{ labels.emptyTableMessage }}</h4>\n </ng-template>\n <ng-template novoTemplate=\"expandedRow\"> You did not provide an \"expandedRow\" template! </ng-template>\n <ng-template #detailRowTemplate let-row>\n <div class=\"novo-data-table-detail-row\" [@expand] style=\"overflow: hidden\">\n <ng-container *ngTemplateOutlet=\"templates['expandedRow']; context: { $implicit: row }\"></ng-container>\n </div>\n </ng-template>\n <!-- CUSTOM CELLS PASSED IN -->\n <ng-content></ng-content>\n ",
8454
8495
  changeDetection: core.ChangeDetectionStrategy.OnPush,
8455
8496
  providers: [DataTableState]
8456
8497
  },] }
@@ -8470,6 +8511,7 @@
8470
8511
  displayedColumns: [{ type: core.Input }],
8471
8512
  paginationOptions: [{ type: core.Input }],
8472
8513
  searchOptions: [{ type: core.Input }],
8514
+ selectionOptions: [{ type: core.Input }],
8473
8515
  defaultSort: [{ type: core.Input }],
8474
8516
  name: [{ type: core.Input }],
8475
8517
  allowMultipleFilters: [{ type: core.Input }],
@@ -8479,6 +8521,7 @@
8479
8521
  templates: [{ type: core.Input }],
8480
8522
  fixedHeader: [{ type: core.Input }],
8481
8523
  paginatorDataFeatureId: [{ type: core.Input }],
8524
+ maxSelected: [{ type: core.Input }],
8482
8525
  dataTableService: [{ type: core.Input }],
8483
8526
  rows: [{ type: core.Input }],
8484
8527
  outsideFilter: [{ type: core.Input }],
@@ -28668,6 +28711,7 @@
28668
28711
  _this.dataTable = dataTable;
28669
28712
  _this.ref = ref;
28670
28713
  _this.role = 'gridcell';
28714
+ _this.maxSelected = undefined;
28671
28715
  _this.checked = false;
28672
28716
  renderer.setAttribute(elementRef.nativeElement, 'data-automation-id', "novo-checkbox-column-" + columnDef.cssClassFriendlyName);
28673
28717
  renderer.addClass(elementRef.nativeElement, "novo-checkbox-column-" + columnDef.cssClassFriendlyName);
@@ -28682,11 +28726,23 @@
28682
28726
  });
28683
28727
  return _this;
28684
28728
  }
28729
+ Object.defineProperty(NovoDataTableCheckboxCell.prototype, "isAtLimit", {
28730
+ get: function () {
28731
+ return this.maxSelected && this.dataTable.state.selectedRows.size >= this.maxSelected && !this.checked;
28732
+ },
28733
+ enumerable: false,
28734
+ configurable: true
28735
+ });
28685
28736
  NovoDataTableCheckboxCell.prototype.ngOnInit = function () {
28686
28737
  this.checked = this.dataTable.isSelected(this.row);
28687
28738
  };
28688
28739
  NovoDataTableCheckboxCell.prototype.onClick = function () {
28689
- this.dataTable.selectRow(this.row);
28740
+ if (!this.isAtLimit) {
28741
+ this.dataTable.selectRow(this.row);
28742
+ }
28743
+ };
28744
+ NovoDataTableCheckboxCell.prototype.getTooltip = function () {
28745
+ return (this.isAtLimit) ? 'More than ' + this.maxSelected + ' items are not able to be selected at one time' : '';
28690
28746
  };
28691
28747
  NovoDataTableCheckboxCell.prototype.ngOnDestroy = function () {
28692
28748
  if (this.selectionSubscription) {
@@ -28701,7 +28757,7 @@
28701
28757
  NovoDataTableCheckboxCell.decorators = [
28702
28758
  { type: core.Component, args: [{
28703
28759
  selector: 'novo-data-table-checkbox-cell',
28704
- template: "\n <div class=\"data-table-checkbox\" (click)=\"onClick()\">\n <input type=\"checkbox\" [checked]=\"checked\">\n <label>\n <i [class.bhi-checkbox-empty]=\"!checked\"\n [class.bhi-checkbox-filled]=\"checked\"></i>\n </label>\n </div>\n ",
28760
+ template: "\n <div class=\"data-table-checkbox\" (click)=\"onClick()\" [tooltip]=\"getTooltip()\" tooltipPosition=\"right\">\n <input type=\"checkbox\" [checked]=\"checked\">\n <label>\n <i [class.bhi-checkbox-disabled]=\"isAtLimit\"\n [class.bhi-checkbox-empty]=\"!checked\"\n [class.bhi-checkbox-filled]=\"checked\"></i>\n </label>\n </div>\n ",
28705
28761
  changeDetection: core.ChangeDetectionStrategy.OnPush
28706
28762
  },] }
28707
28763
  ];
@@ -28714,7 +28770,8 @@
28714
28770
  ]; };
28715
28771
  NovoDataTableCheckboxCell.propDecorators = {
28716
28772
  role: [{ type: core.HostBinding, args: ['attr.role',] }],
28717
- row: [{ type: core.Input }]
28773
+ row: [{ type: core.Input }],
28774
+ maxSelected: [{ type: core.Input }]
28718
28775
  };
28719
28776
 
28720
28777
  var NovoDataTableExpandCell = /** @class */ (function (_super) {
@@ -28860,13 +28917,210 @@
28860
28917
  role: [{ type: core.HostBinding, args: ['attr.role',] }]
28861
28918
  };
28862
28919
 
28920
+ // NG2
28921
+ var NovoToastElement = /** @class */ (function () {
28922
+ function NovoToastElement(sanitizer) {
28923
+ this.sanitizer = sanitizer;
28924
+ this.theme = 'danger';
28925
+ this.icon = 'caution';
28926
+ this.hasDialogue = false;
28927
+ this.isCloseable = false;
28928
+ this.closed = new core.EventEmitter();
28929
+ this.show = false;
28930
+ this.animate = false;
28931
+ this.parent = null;
28932
+ this.launched = false;
28933
+ }
28934
+ Object.defineProperty(NovoToastElement.prototype, "message", {
28935
+ set: function (m) {
28936
+ this._message = this.sanitizer.bypassSecurityTrustHtml(m);
28937
+ },
28938
+ enumerable: false,
28939
+ configurable: true
28940
+ });
28941
+ NovoToastElement.prototype.ngOnInit = function () {
28942
+ if (!this.launched) {
28943
+ // clear position and time
28944
+ this.position = null;
28945
+ this.time = null;
28946
+ // set icon and styling
28947
+ this.iconClass = "bhi-" + this.icon;
28948
+ this.alertTheme = this.theme + " toast-container embedded";
28949
+ if (this.hasDialogue) {
28950
+ this.alertTheme += ' dialogue';
28951
+ }
28952
+ }
28953
+ };
28954
+ NovoToastElement.prototype.ngOnChanges = function (changes) {
28955
+ // set icon and styling
28956
+ this.iconClass = "bhi-" + this.icon;
28957
+ this.alertTheme = this.theme + " toast-container embedded";
28958
+ if (this.hasDialogue) {
28959
+ this.alertTheme += ' dialogue';
28960
+ }
28961
+ };
28962
+ NovoToastElement.prototype.clickHandler = function (event) {
28963
+ if (!this.isCloseable) {
28964
+ if (event) {
28965
+ event.stopPropagation();
28966
+ event.preventDefault();
28967
+ }
28968
+ if (this.parent) {
28969
+ this.parent.hide(this);
28970
+ }
28971
+ else {
28972
+ this.closed.emit({ closed: true });
28973
+ }
28974
+ }
28975
+ };
28976
+ NovoToastElement.prototype.close = function (event) {
28977
+ if (event) {
28978
+ event.stopPropagation();
28979
+ event.preventDefault();
28980
+ }
28981
+ if (this.parent) {
28982
+ this.parent.hide(this);
28983
+ }
28984
+ else {
28985
+ this.closed.emit({ closed: true });
28986
+ }
28987
+ };
28988
+ return NovoToastElement;
28989
+ }());
28990
+ NovoToastElement.decorators = [
28991
+ { type: core.Component, args: [{
28992
+ selector: 'novo-toast',
28993
+ host: {
28994
+ '[class]': 'alertTheme',
28995
+ '[class.show]': 'show',
28996
+ '[class.animate]': 'animate',
28997
+ '[class.embedded]': 'embedded',
28998
+ '(click)': '!isCloseable && clickHandler($event)',
28999
+ },
29000
+ template: "\n <div class=\"toast-icon\">\n <i [ngClass]=\"iconClass\"></i>\n </div>\n <div class=\"toast-content\">\n <h5 *ngIf=\"title\">{{title}}</h5>\n <p *ngIf=\"_message\" [class.message-only]=\"!title\" [innerHtml]=\"_message\"></p>\n <div *ngIf=\"link\" class=\"link-generated\">\n <input type=\"text\" [value]=\"link\" onfocus=\"this.select();\"/>\n </div>\n <div class=\"dialogue\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"close-icon\" *ngIf=\"isCloseable\" (click)=\"close($event)\">\n <i class=\"bhi-times\"></i>\n </div>\n "
29001
+ },] }
29002
+ ];
29003
+ NovoToastElement.ctorParameters = function () { return [
29004
+ { type: platformBrowser.DomSanitizer }
29005
+ ]; };
29006
+ NovoToastElement.propDecorators = {
29007
+ theme: [{ type: core.Input }],
29008
+ icon: [{ type: core.Input }],
29009
+ title: [{ type: core.Input }],
29010
+ hasDialogue: [{ type: core.Input }],
29011
+ link: [{ type: core.Input }],
29012
+ isCloseable: [{ type: core.Input }],
29013
+ message: [{ type: core.Input }],
29014
+ closed: [{ type: core.Output }]
29015
+ };
29016
+
29017
+ // NG2
29018
+ var NovoToastService = /** @class */ (function () {
29019
+ function NovoToastService(componentUtils) {
29020
+ this.componentUtils = componentUtils;
29021
+ this.references = [];
29022
+ this.icons = { default: 'bell', success: 'check', info: 'info', warning: 'warning', danger: 'remove' };
29023
+ this.defaults = { hideDelay: 3500, position: 'growlTopRight', theme: 'default' };
29024
+ }
29025
+ Object.defineProperty(NovoToastService.prototype, "parentViewContainer", {
29026
+ set: function (view) {
29027
+ this._parentViewContainer = view;
29028
+ },
29029
+ enumerable: false,
29030
+ configurable: true
29031
+ });
29032
+ NovoToastService.prototype.alert = function (options, toastElement) {
29033
+ var _this = this;
29034
+ if (toastElement === void 0) { toastElement = NovoToastElement; }
29035
+ return new Promise(function (resolve) {
29036
+ if (!_this._parentViewContainer) {
29037
+ console.error('No parent view container specified for the ToastService. Set it inside your main application. \nthis.toastService.parentViewContainer = view (ViewContainerRef)');
29038
+ return;
29039
+ }
29040
+ var toast = _this.componentUtils.append(toastElement, _this._parentViewContainer);
29041
+ _this.references.push(toast);
29042
+ _this.handleAlert(toast.instance, options);
29043
+ resolve(toast);
29044
+ });
29045
+ };
29046
+ NovoToastService.prototype.isVisible = function (toast) {
29047
+ return toast.show;
29048
+ };
29049
+ NovoToastService.prototype.hide = function (toast) {
29050
+ var _this = this;
29051
+ toast.animate = false;
29052
+ setTimeout(function () {
29053
+ toast.show = false;
29054
+ var REF = _this.references.filter(function (x) { return x.instance === toast; })[0];
29055
+ if (REF) {
29056
+ _this.references.splice(_this.references.indexOf(REF), 1);
29057
+ REF.destroy();
29058
+ }
29059
+ }, 300);
29060
+ };
29061
+ NovoToastService.prototype.handleAlert = function (toast, options) {
29062
+ var _this = this;
29063
+ this.setToastOnSession(toast, options);
29064
+ setTimeout(function () {
29065
+ _this.show(toast);
29066
+ }, 20);
29067
+ if (!toast.isCloseable) {
29068
+ this.toastTimer(toast);
29069
+ }
29070
+ };
29071
+ NovoToastService.prototype.setToastOnSession = function (toast, opts) {
29072
+ var OPTIONS = typeof opts === 'object' ? opts : {};
29073
+ toast.parent = this;
29074
+ toast.title = OPTIONS.title || '';
29075
+ toast.message = OPTIONS.message || '';
29076
+ toast.hideDelay = OPTIONS.hideDelay || this.defaults.hideDelay;
29077
+ toast.link = OPTIONS.link || '';
29078
+ toast.isCloseable = OPTIONS.isCloseable || false;
29079
+ var CUSTOM_CLASS = OPTIONS.customClass || '';
29080
+ var ALERT_STYLE = OPTIONS.theme || this.defaults.theme;
29081
+ var ALERT_POSITION = OPTIONS.position || this.defaults.position;
29082
+ var ALERT_ICON = OPTIONS.icon || this.icons.default;
29083
+ toast.iconClass = "bhi-" + ALERT_ICON;
29084
+ toast.launched = true;
29085
+ toast.alertTheme = ALERT_STYLE + " " + ALERT_POSITION + " " + CUSTOM_CLASS + " toast-container launched";
29086
+ };
29087
+ NovoToastService.prototype.show = function (toast) {
29088
+ toast.show = true;
29089
+ setTimeout(addClass, 25);
29090
+ /**
29091
+ * Adds animate class to be called after a timeout
29092
+ **/
29093
+ function addClass() {
29094
+ toast.animate = true;
29095
+ }
29096
+ };
29097
+ NovoToastService.prototype.toastTimer = function (toast) {
29098
+ var _this = this;
29099
+ if (toast.hideDelay < 0) {
29100
+ return;
29101
+ }
29102
+ setTimeout(function () {
29103
+ _this.hide(toast);
29104
+ }, toast.hideDelay);
29105
+ };
29106
+ return NovoToastService;
29107
+ }());
29108
+ NovoToastService.decorators = [
29109
+ { type: core.Injectable }
29110
+ ];
29111
+ NovoToastService.ctorParameters = function () { return [
29112
+ { type: ComponentUtils }
29113
+ ]; };
29114
+
28863
29115
  var NovoDataTableCheckboxHeaderCell = /** @class */ (function (_super) {
28864
29116
  __extends(NovoDataTableCheckboxHeaderCell, _super);
28865
- function NovoDataTableCheckboxHeaderCell(columnDef, elementRef, renderer, dataTable, ref) {
29117
+ function NovoDataTableCheckboxHeaderCell(columnDef, elementRef, renderer, dataTable, ref, toaster) {
28866
29118
  var _this = _super.call(this, columnDef, elementRef) || this;
28867
29119
  _this.dataTable = dataTable;
28868
29120
  _this.ref = ref;
29121
+ _this.toaster = toaster;
28869
29122
  _this.role = 'columnheader';
29123
+ _this.maxSelected = undefined;
28870
29124
  _this.checked = false;
28871
29125
  renderer.setAttribute(elementRef.nativeElement, 'data-automation-id', "novo-checkbox-column-header-" + columnDef.cssClassFriendlyName);
28872
29126
  renderer.addClass(elementRef.nativeElement, "novo-checkbox-column-" + columnDef.cssClassFriendlyName);
@@ -28879,6 +29133,8 @@
28879
29133
  if (event.isPageSizeChange) {
28880
29134
  _this.checked = false;
28881
29135
  _this.dataTable.selectRows(false);
29136
+ _this.dataTable.state.checkRetainment('pageSize');
29137
+ _this.dataTable.state.reset(false, true);
28882
29138
  }
28883
29139
  else {
28884
29140
  _this.checked = _this.dataTable.allCurrentRowsSelected();
@@ -28891,6 +29147,13 @@
28891
29147
  });
28892
29148
  return _this;
28893
29149
  }
29150
+ Object.defineProperty(NovoDataTableCheckboxHeaderCell.prototype, "isAtLimit", {
29151
+ get: function () {
29152
+ return this.maxSelected && this.dataTable.state.selectedRows.size + this.dataTable.dataSource.data.length > this.maxSelected && !this.checked;
29153
+ },
29154
+ enumerable: false,
29155
+ configurable: true
29156
+ });
28894
29157
  NovoDataTableCheckboxHeaderCell.prototype.ngOnDestroy = function () {
28895
29158
  if (this.selectionSubscription) {
28896
29159
  this.selectionSubscription.unsubscribe();
@@ -28903,7 +29166,17 @@
28903
29166
  }
28904
29167
  };
28905
29168
  NovoDataTableCheckboxHeaderCell.prototype.onClick = function () {
28906
- this.dataTable.selectRows(!this.checked);
29169
+ if (this.isAtLimit) {
29170
+ this.toaster.alert({
29171
+ theme: 'danger',
29172
+ position: 'fixedTop',
29173
+ message: 'Error, more than 500 items are not able to be selected at one time',
29174
+ icon: 'caution',
29175
+ });
29176
+ }
29177
+ else {
29178
+ this.dataTable.selectRows(!this.checked);
29179
+ }
28907
29180
  };
28908
29181
  return NovoDataTableCheckboxHeaderCell;
28909
29182
  }(table.CdkHeaderCell));
@@ -28919,10 +29192,12 @@
28919
29192
  { type: core.ElementRef },
28920
29193
  { type: core.Renderer2 },
28921
29194
  { type: NovoDataTable },
28922
- { type: core.ChangeDetectorRef }
29195
+ { type: core.ChangeDetectorRef },
29196
+ { type: NovoToastService }
28923
29197
  ]; };
28924
29198
  NovoDataTableCheckboxHeaderCell.propDecorators = {
28925
- role: [{ type: core.HostBinding, args: ['attr.role',] }]
29199
+ role: [{ type: core.HostBinding, args: ['attr.role',] }],
29200
+ maxSelected: [{ type: core.Input }]
28926
29201
  };
28927
29202
 
28928
29203
  var NovoDataTableHeaderCell = /** @class */ (function (_super) {
@@ -29038,10 +29313,12 @@
29038
29313
  this.resetSubscription.unsubscribe();
29039
29314
  };
29040
29315
  NovoDataTablePagination.prototype.selectPage = function (page) {
29316
+ this.state.checkRetainment('page');
29041
29317
  this.page = page;
29042
29318
  this.emitPageEvent();
29043
29319
  };
29044
29320
  NovoDataTablePagination.prototype.nextPage = function () {
29321
+ this.state.checkRetainment('page');
29045
29322
  if (!this.hasNextPage()) {
29046
29323
  return;
29047
29324
  }
@@ -29050,6 +29327,7 @@
29050
29327
  this.emitPageEvent();
29051
29328
  };
29052
29329
  NovoDataTablePagination.prototype.previousPage = function () {
29330
+ this.state.checkRetainment('page');
29053
29331
  if (!this.hasPreviousPage()) {
29054
29332
  return;
29055
29333
  }
@@ -32240,201 +32518,6 @@
32240
32518
  { type: ComponentUtils }
32241
32519
  ]; };
32242
32520
 
32243
- // NG2
32244
- var NovoToastElement = /** @class */ (function () {
32245
- function NovoToastElement(sanitizer) {
32246
- this.sanitizer = sanitizer;
32247
- this.theme = 'danger';
32248
- this.icon = 'caution';
32249
- this.hasDialogue = false;
32250
- this.isCloseable = false;
32251
- this.closed = new core.EventEmitter();
32252
- this.show = false;
32253
- this.animate = false;
32254
- this.parent = null;
32255
- this.launched = false;
32256
- }
32257
- Object.defineProperty(NovoToastElement.prototype, "message", {
32258
- set: function (m) {
32259
- this._message = this.sanitizer.bypassSecurityTrustHtml(m);
32260
- },
32261
- enumerable: false,
32262
- configurable: true
32263
- });
32264
- NovoToastElement.prototype.ngOnInit = function () {
32265
- if (!this.launched) {
32266
- // clear position and time
32267
- this.position = null;
32268
- this.time = null;
32269
- // set icon and styling
32270
- this.iconClass = "bhi-" + this.icon;
32271
- this.alertTheme = this.theme + " toast-container embedded";
32272
- if (this.hasDialogue) {
32273
- this.alertTheme += ' dialogue';
32274
- }
32275
- }
32276
- };
32277
- NovoToastElement.prototype.ngOnChanges = function (changes) {
32278
- // set icon and styling
32279
- this.iconClass = "bhi-" + this.icon;
32280
- this.alertTheme = this.theme + " toast-container embedded";
32281
- if (this.hasDialogue) {
32282
- this.alertTheme += ' dialogue';
32283
- }
32284
- };
32285
- NovoToastElement.prototype.clickHandler = function (event) {
32286
- if (!this.isCloseable) {
32287
- if (event) {
32288
- event.stopPropagation();
32289
- event.preventDefault();
32290
- }
32291
- if (this.parent) {
32292
- this.parent.hide(this);
32293
- }
32294
- else {
32295
- this.closed.emit({ closed: true });
32296
- }
32297
- }
32298
- };
32299
- NovoToastElement.prototype.close = function (event) {
32300
- if (event) {
32301
- event.stopPropagation();
32302
- event.preventDefault();
32303
- }
32304
- if (this.parent) {
32305
- this.parent.hide(this);
32306
- }
32307
- else {
32308
- this.closed.emit({ closed: true });
32309
- }
32310
- };
32311
- return NovoToastElement;
32312
- }());
32313
- NovoToastElement.decorators = [
32314
- { type: core.Component, args: [{
32315
- selector: 'novo-toast',
32316
- host: {
32317
- '[class]': 'alertTheme',
32318
- '[class.show]': 'show',
32319
- '[class.animate]': 'animate',
32320
- '[class.embedded]': 'embedded',
32321
- '(click)': '!isCloseable && clickHandler($event)',
32322
- },
32323
- template: "\n <div class=\"toast-icon\">\n <i [ngClass]=\"iconClass\"></i>\n </div>\n <div class=\"toast-content\">\n <h5 *ngIf=\"title\">{{title}}</h5>\n <p *ngIf=\"_message\" [class.message-only]=\"!title\" [innerHtml]=\"_message\"></p>\n <div *ngIf=\"link\" class=\"link-generated\">\n <input type=\"text\" [value]=\"link\" onfocus=\"this.select();\"/>\n </div>\n <div class=\"dialogue\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"close-icon\" *ngIf=\"isCloseable\" (click)=\"close($event)\">\n <i class=\"bhi-times\"></i>\n </div>\n "
32324
- },] }
32325
- ];
32326
- NovoToastElement.ctorParameters = function () { return [
32327
- { type: platformBrowser.DomSanitizer }
32328
- ]; };
32329
- NovoToastElement.propDecorators = {
32330
- theme: [{ type: core.Input }],
32331
- icon: [{ type: core.Input }],
32332
- title: [{ type: core.Input }],
32333
- hasDialogue: [{ type: core.Input }],
32334
- link: [{ type: core.Input }],
32335
- isCloseable: [{ type: core.Input }],
32336
- message: [{ type: core.Input }],
32337
- closed: [{ type: core.Output }]
32338
- };
32339
-
32340
- // NG2
32341
- var NovoToastService = /** @class */ (function () {
32342
- function NovoToastService(componentUtils) {
32343
- this.componentUtils = componentUtils;
32344
- this.references = [];
32345
- this.icons = { default: 'bell', success: 'check', info: 'info', warning: 'warning', danger: 'remove' };
32346
- this.defaults = { hideDelay: 3500, position: 'growlTopRight', theme: 'default' };
32347
- }
32348
- Object.defineProperty(NovoToastService.prototype, "parentViewContainer", {
32349
- set: function (view) {
32350
- this._parentViewContainer = view;
32351
- },
32352
- enumerable: false,
32353
- configurable: true
32354
- });
32355
- NovoToastService.prototype.alert = function (options, toastElement) {
32356
- var _this = this;
32357
- if (toastElement === void 0) { toastElement = NovoToastElement; }
32358
- return new Promise(function (resolve) {
32359
- if (!_this._parentViewContainer) {
32360
- console.error('No parent view container specified for the ToastService. Set it inside your main application. \nthis.toastService.parentViewContainer = view (ViewContainerRef)');
32361
- return;
32362
- }
32363
- var toast = _this.componentUtils.append(toastElement, _this._parentViewContainer);
32364
- _this.references.push(toast);
32365
- _this.handleAlert(toast.instance, options);
32366
- resolve(toast);
32367
- });
32368
- };
32369
- NovoToastService.prototype.isVisible = function (toast) {
32370
- return toast.show;
32371
- };
32372
- NovoToastService.prototype.hide = function (toast) {
32373
- var _this = this;
32374
- toast.animate = false;
32375
- setTimeout(function () {
32376
- toast.show = false;
32377
- var REF = _this.references.filter(function (x) { return x.instance === toast; })[0];
32378
- if (REF) {
32379
- _this.references.splice(_this.references.indexOf(REF), 1);
32380
- REF.destroy();
32381
- }
32382
- }, 300);
32383
- };
32384
- NovoToastService.prototype.handleAlert = function (toast, options) {
32385
- var _this = this;
32386
- this.setToastOnSession(toast, options);
32387
- setTimeout(function () {
32388
- _this.show(toast);
32389
- }, 20);
32390
- if (!toast.isCloseable) {
32391
- this.toastTimer(toast);
32392
- }
32393
- };
32394
- NovoToastService.prototype.setToastOnSession = function (toast, opts) {
32395
- var OPTIONS = typeof opts === 'object' ? opts : {};
32396
- toast.parent = this;
32397
- toast.title = OPTIONS.title || '';
32398
- toast.message = OPTIONS.message || '';
32399
- toast.hideDelay = OPTIONS.hideDelay || this.defaults.hideDelay;
32400
- toast.link = OPTIONS.link || '';
32401
- toast.isCloseable = OPTIONS.isCloseable || false;
32402
- var CUSTOM_CLASS = OPTIONS.customClass || '';
32403
- var ALERT_STYLE = OPTIONS.theme || this.defaults.theme;
32404
- var ALERT_POSITION = OPTIONS.position || this.defaults.position;
32405
- var ALERT_ICON = OPTIONS.icon || this.icons.default;
32406
- toast.iconClass = "bhi-" + ALERT_ICON;
32407
- toast.launched = true;
32408
- toast.alertTheme = ALERT_STYLE + " " + ALERT_POSITION + " " + CUSTOM_CLASS + " toast-container launched";
32409
- };
32410
- NovoToastService.prototype.show = function (toast) {
32411
- toast.show = true;
32412
- setTimeout(addClass, 25);
32413
- /**
32414
- * Adds animate class to be called after a timeout
32415
- **/
32416
- function addClass() {
32417
- toast.animate = true;
32418
- }
32419
- };
32420
- NovoToastService.prototype.toastTimer = function (toast) {
32421
- var _this = this;
32422
- if (toast.hideDelay < 0) {
32423
- return;
32424
- }
32425
- setTimeout(function () {
32426
- _this.hide(toast);
32427
- }, toast.hideDelay);
32428
- };
32429
- return NovoToastService;
32430
- }());
32431
- NovoToastService.decorators = [
32432
- { type: core.Injectable }
32433
- ];
32434
- NovoToastService.ctorParameters = function () { return [
32435
- { type: ComponentUtils }
32436
- ]; };
32437
-
32438
32521
  // NG2
32439
32522
  var ControlConfirmModal = /** @class */ (function () {
32440
32523
  function ControlConfirmModal(modalRef, params, labels) {