@dmlibs/dm-cmps 0.0.4 → 0.1.0

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.
@@ -1,34 +1,41 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, input, booleanAttribute, model, computed, output, effect, Component, Injectable, numberAttribute } from '@angular/core';
2
+ import { signal, input, booleanAttribute, model, computed, output, effect, Component, Injectable, numberAttribute, Input, Directive, HostListener } from '@angular/core';
3
3
  import { toObservable } from '@angular/core/rxjs-interop';
4
4
  import { Subject, Subscription, switchMap, debounceTime, distinctUntilChanged } from 'rxjs';
5
- import * as i1 from '@angular/material/form-field';
6
- import { MatFormFieldModule, MatSuffix } from '@angular/material/form-field';
7
- import * as i2 from '@angular/material/select';
5
+ import * as i2 from '@angular/material/form-field';
6
+ import { MatFormFieldModule } from '@angular/material/form-field';
7
+ import * as i5 from '@angular/material/select';
8
8
  import { MatSelectModule } from '@angular/material/select';
9
- import * as i3 from '@angular/common';
9
+ import * as i10 from '@angular/common';
10
10
  import { CommonModule } from '@angular/common';
11
- import * as i4 from '@angular/forms';
12
- import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
13
- import * as i5 from '@angular/material/input';
11
+ import * as i1 from '@angular/forms';
12
+ import { FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
13
+ import * as i6 from '@angular/material/input';
14
14
  import { MatInputModule } from '@angular/material/input';
15
- import * as i6 from '@angular/material/checkbox';
15
+ import * as i3 from '@angular/material/checkbox';
16
16
  import { MatCheckboxModule } from '@angular/material/checkbox';
17
17
  import { MatIcon } from '@angular/material/icon';
18
18
  import * as i7 from '@angular/material/button';
19
19
  import { MatButtonModule } from '@angular/material/button';
20
20
  import * as i2$1 from '@angular/material/tooltip';
21
21
  import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
22
- import * as i1$1 from '@angular/material/menu';
22
+ import * as i9 from '@angular/material/menu';
23
23
  import { MatMenuModule } from '@angular/material/menu';
24
24
  import * as i3$1 from '@angular/material/slider';
25
25
  import { MatSliderModule } from '@angular/material/slider';
26
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
27
+ import * as i1$1 from '@angular/material/progress-bar';
28
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
29
+ import { A11yModule } from '@angular/cdk/a11y';
30
+ import { moveItemInArray, CdkDragHandle, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
31
+ import * as i5$1 from '@angular/cdk/scrolling';
26
32
 
27
33
  class DmCmpsDataSource {
28
34
  data;
29
35
  filteredData;
30
36
  _resultData;
31
37
  result = signal([], ...(ngDevMode ? [{ debugName: "result" }] : []));
38
+ resultVersion = signal(0, ...(ngDevMode ? [{ debugName: "resultVersion" }] : []));
32
39
  paginationEnabled = false;
33
40
  currentPageIndex = 0;
34
41
  pageSize = 10;
@@ -66,7 +73,8 @@ class DmCmpsDataSource {
66
73
  }
67
74
  return match(filter);
68
75
  };
69
- filterByObject = null;
76
+ isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
77
+ objectToFilterBy = null;
70
78
  fieldsToSearchIn = [];
71
79
  sortMap = [];
72
80
  sortFn = null;
@@ -92,20 +100,11 @@ class DmCmpsDataSource {
92
100
  this.searchTerm = term;
93
101
  this.applySearch();
94
102
  }));
95
- // this.searchTerms$
96
- // .pipe(
97
- // debounceTime(this.searchDebounceTime),
98
- // distinctUntilChanged((p, c) => p === c && c != '')
99
- // )
100
- // .subscribe((term) => {
101
- // this.searchTerm = term;
102
- // this.applySearch();
103
- // });
104
- }
105
- updateResultData() {
103
+ }
104
+ async updateResultData() {
106
105
  this.applySorting();
107
- this.applySearch();
108
- this.updateResultSignal();
106
+ await this.applySearch();
107
+ await this.updateResultSignal();
109
108
  }
110
109
  disconnect() {
111
110
  this.subscription.unsubscribe();
@@ -137,9 +136,13 @@ class DmCmpsDataSource {
137
136
  this.pageSize = pageSize;
138
137
  this.updateResultSignal();
139
138
  }
139
+ getPageSize() {
140
+ return this.pageSize;
141
+ }
140
142
  disablePagination() {
141
143
  this.currentPageIndex = 0;
142
144
  this.paginationEnabled = false;
145
+ this.setAutoPaginationAboveItemsCount(-1);
143
146
  this.updateResultSignal();
144
147
  }
145
148
  nextPage() {
@@ -189,6 +192,22 @@ class DmCmpsDataSource {
189
192
  }
190
193
  return Math.ceil(this._resultData.length / this.pageSize);
191
194
  }
195
+ getFirstItemIndexInPage() {
196
+ return this.currentPageIndex * this.pageSize;
197
+ }
198
+ getLastItemIndexInPage() {
199
+ const lastIndex = (this.currentPageIndex + 1) * this.pageSize - 1;
200
+ return lastIndex >= this._resultData.length ? this._resultData.length - 1 : lastIndex;
201
+ }
202
+ getTotalResultElementsCount() {
203
+ return this._resultData.length;
204
+ }
205
+ isPaginationEnabled() {
206
+ return (this.pageSize > 0 &&
207
+ (this.paginationEnabled ||
208
+ (this.autoPaginationAboveItemsCount > 0 &&
209
+ this._resultData.length > this.autoPaginationAboveItemsCount)));
210
+ }
192
211
  setSearchDebounceTime(milliseconds) {
193
212
  this.searchDebounceTime.set(milliseconds);
194
213
  }
@@ -196,18 +215,24 @@ class DmCmpsDataSource {
196
215
  this.data = [...newData];
197
216
  this.applyObjectFilter();
198
217
  }
199
- updateResultSignal() {
200
- const res = (() => {
201
- if (this.pageSize > 0 &&
202
- (this.paginationEnabled ||
203
- (this.autoPaginationAboveItemsCount > 0 &&
204
- this._resultData.length > this.autoPaginationAboveItemsCount))) {
205
- const startIndex = this.currentPageIndex * this.pageSize;
206
- return this._resultData.slice(startIndex, startIndex + this.pageSize);
207
- }
208
- return this._resultData;
209
- })();
210
- this.result.set(res);
218
+ getDatasource() {
219
+ return this.data;
220
+ }
221
+ getResultData() {
222
+ return this._resultData;
223
+ }
224
+ async updateResultSignal() {
225
+ return new Promise((resolve) => {
226
+ const res = (() => {
227
+ if (this.isPaginationEnabled()) {
228
+ const startIndex = this.currentPageIndex * this.pageSize;
229
+ return this._resultData.slice(startIndex, startIndex + this.pageSize);
230
+ }
231
+ return this._resultData;
232
+ })();
233
+ this.result.set(res);
234
+ resolve();
235
+ });
211
236
  }
212
237
  // get resultData(): T[] {
213
238
  // if (
@@ -222,17 +247,23 @@ class DmCmpsDataSource {
222
247
  // return this.filteredData;
223
248
  // }
224
249
  search(filterTerm) {
250
+ this.isLoading.set(true);
225
251
  this.searchTerms$.next(filterTerm);
226
252
  }
227
- applySearch() {
228
- if (!this.searchTerm) {
229
- this._resultData = [...this.filteredData];
230
- }
231
- else {
232
- this.currentPageIndex = 0;
233
- this._resultData = this.filteredData.filter((item) => this.filterPredicate(item, this.searchTerm));
234
- }
235
- this.updateResultSignal();
253
+ async applySearch() {
254
+ return new Promise(async (resolve) => {
255
+ if (!this.searchTerm) {
256
+ this._resultData = [...this.filteredData];
257
+ }
258
+ else {
259
+ this.currentPageIndex = 0;
260
+ this._resultData = this.filteredData.filter((item) => this.filterPredicate(item, this.searchTerm));
261
+ }
262
+ await this.updateResultSignal();
263
+ this.resultVersion.update((v) => v + 1);
264
+ this.isLoading.set(false);
265
+ resolve();
266
+ });
236
267
  }
237
268
  setFilterPredicate(predicate) {
238
269
  this.filterPredicate = predicate;
@@ -326,16 +357,19 @@ class DmCmpsDataSource {
326
357
  this.applyObjectFilter();
327
358
  }
328
359
  setFilterByObjectFields(filterObj) {
329
- this.filterByObject = filterObj;
360
+ this.objectToFilterBy = filterObj;
330
361
  this.applyObjectFilter();
331
362
  }
363
+ getObjectToFilterBy() {
364
+ return this.objectToFilterBy;
365
+ }
332
366
  applyObjectFilter() {
333
- if (!this.filterByObject) {
367
+ if (!this.objectToFilterBy) {
334
368
  this.filteredData = [...this.data];
335
369
  }
336
370
  else {
337
371
  this.filteredData = this.data.filter((item) => {
338
- for (const [key, value] of Object.entries(this.filterByObject)) {
372
+ for (const [key, value] of Object.entries(this.objectToFilterBy)) {
339
373
  if (item[key] !== value) {
340
374
  return false;
341
375
  }
@@ -586,22 +620,21 @@ class DmMatSelect {
586
620
  }
587
621
  }
588
622
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmMatSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
589
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DmMatSelect, isStandalone: true, selector: "dm-mat-select", inputs: { formFieldClass: { classPropertyName: "formFieldClass", publicName: "formFieldClass", isSignal: true, isRequired: false, transformFunction: null }, wrapperClass: { classPropertyName: "wrapperClass", publicName: "wrapperClass", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, selectAllEnabled: { classPropertyName: "selectAllEnabled", publicName: "selectAllEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectAllLabel: { classPropertyName: "selectAllLabel", publicName: "selectAllLabel", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionValueKey: { classPropertyName: "optionValueKey", publicName: "optionValueKey", isSignal: true, isRequired: false, transformFunction: null }, optionLabelKey: { classPropertyName: "optionLabelKey", publicName: "optionLabelKey", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyOption: { classPropertyName: "emptyOption", publicName: "emptyOption", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionLabel: { classPropertyName: "emptyOptionLabel", publicName: "emptyOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionValue: { classPropertyName: "emptyOptionValue", publicName: "emptyOptionValue", isSignal: true, isRequired: false, transformFunction: null }, optionNameFormat: { classPropertyName: "optionNameFormat", publicName: "optionNameFormat", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, searchSectionBackgroundColor: { classPropertyName: "searchSectionBackgroundColor", publicName: "searchSectionBackgroundColor", isSignal: true, isRequired: false, transformFunction: null }, sortBySelectedOnTop: { classPropertyName: "sortBySelectedOnTop", publicName: "sortBySelectedOnTop", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, noDataLabel: { classPropertyName: "noDataLabel", publicName: "noDataLabel", isSignal: true, isRequired: false, transformFunction: null }, clearSearchAfterSelect: { classPropertyName: "clearSearchAfterSelect", publicName: "clearSearchAfterSelect", isSignal: true, isRequired: false, transformFunction: null }, clearSearchButtonTooltip: { classPropertyName: "clearSearchButtonTooltip", publicName: "clearSearchButtonTooltip", isSignal: true, isRequired: false, transformFunction: null }, focusSearchInputOnPanelOpen: { classPropertyName: "focusSearchInputOnPanelOpen", publicName: "focusSearchInputOnPanelOpen", isSignal: true, isRequired: false, transformFunction: null }, filterPredicate: { classPropertyName: "filterPredicate", publicName: "filterPredicate", isSignal: true, isRequired: false, transformFunction: null }, propertiesToSkipInSearch: { classPropertyName: "propertiesToSkipInSearch", publicName: "propertiesToSkipInSearch", isSignal: true, isRequired: false, transformFunction: null }, filterText: { classPropertyName: "filterText", publicName: "filterText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", selectionChange: "selectionChange", filterText: "filterTextChange" }, ngImport: i0, template: "<div class=\"dm-mat-select-wrapper\" [class]=\"wrapperClass()\">\n <mat-form-field [appearance]=\"appearance()\" [class]=\"formFieldClass()\" style=\"width: 100%\">\n <mat-label>{{ label() }}</mat-label>\n <mat-select\n [multiple]=\"multiple()\"\n [formControl]=\"control()\"\n (selectionChange)=\"selectionChangeHandler($event)\"\n [disabled]=\"disabled()\"\n [panelWidth]=\"panelWidth()\"\n [panelClass]=\"panelClass()\"\n (opened)=\"onPanelOpened()\"\n >\n <div\n class=\"search-section\"\n [ngStyle]=\"{\n 'background-color': 'none'\n }\"\n >\n @if (searchable()) {\n <mat-form-field>\n <input\n id=\"dm-mat-select-search-input\"\n matInput\n [placeholder]=\"searchPlaceholder()\"\n [(ngModel)]=\"filterText\"\n (keyup)=\"applyFilter($event)\"\n (keyDown.Space)=\"$event.stopPropagation()\"\n />\n @if (filterText()) {\n <button\n mat-icon-button\n matSuffix\n (click)=\"resetSearch()\"\n [matTooltip]=\"clearSearchButtonTooltip() || ''\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @if (selectAllEnabled() && multiple()) {\n <mat-checkbox [checked]=\"checkIfAllSelected()\" (change)=\"selectAllChange($event)\">{{\n selectAllLabel()\n }}</mat-checkbox>\n }\n </div>\n @if (emptyOption()) {\n <mat-option\n [value]=\"emptyOptionValue()\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, emptyOptionValue())\"\n >{{ emptyOptionLabel() }}</mat-option\n >\n } @for (option of datasource().result(); track simpleArray() ? option :\n option[this.optionValueKey()]) {\n <mat-option\n [value]=\"simpleArray() ? option : option[optionValueKey()]\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, option)\"\n >{{\n optionNameFormat()\n ? option.__dmMatSelectFormattedName\n : simpleArray()\n ? option\n : option[optionLabelKey()]\n }}</mat-option\n >\n } @if (datasource().result().length === 0) {\n <mat-option disabled>{{ noDataLabel() }}</mat-option>\n }\n </mat-select>\n\n @if (icon(); as icon) {\n <span matSuffix>\n @if (isBootstrapIcon()) {\n <span [innerHTML]=\"icon\"></span> } @else {\n <mat-icon matSuffix>{{ icon }}</mat-icon>\n }\n </span>\n }\n\n <span matSuffix>\n <ng-content select=\"[dm-mat-select-suffix]\"></ng-content>\n </span>\n\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n</div>\n", styles: [".dm-mat-select-wrapper{width:100%;position:relative}.dm-mat-select-wrapper .search-section{display:flex;flex-direction:column;position:sticky;top:0;z-index:1;background-color:var(--dm-mat-select-search-section-bg-color, #faf9fd)}.dm-mat-select-wrapper .search-section ::ng-deep mat-form-field>.mat-mdc-form-field-subscript-wrapper{display:none}.dm-mat-select-wrapper ::ng-deep mat-form-field>.mat-mdc-text-field-wrapper>.mat-mdc-form-field-flex>.mat-mdc-form-field-icon-suffix{padding:0 4px 0 8px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
623
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DmMatSelect, isStandalone: true, selector: "dm-mat-select", inputs: { formFieldClass: { classPropertyName: "formFieldClass", publicName: "formFieldClass", isSignal: true, isRequired: false, transformFunction: null }, wrapperClass: { classPropertyName: "wrapperClass", publicName: "wrapperClass", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, selectAllEnabled: { classPropertyName: "selectAllEnabled", publicName: "selectAllEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectAllLabel: { classPropertyName: "selectAllLabel", publicName: "selectAllLabel", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionValueKey: { classPropertyName: "optionValueKey", publicName: "optionValueKey", isSignal: true, isRequired: false, transformFunction: null }, optionLabelKey: { classPropertyName: "optionLabelKey", publicName: "optionLabelKey", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyOption: { classPropertyName: "emptyOption", publicName: "emptyOption", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionLabel: { classPropertyName: "emptyOptionLabel", publicName: "emptyOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionValue: { classPropertyName: "emptyOptionValue", publicName: "emptyOptionValue", isSignal: true, isRequired: false, transformFunction: null }, optionNameFormat: { classPropertyName: "optionNameFormat", publicName: "optionNameFormat", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, searchSectionBackgroundColor: { classPropertyName: "searchSectionBackgroundColor", publicName: "searchSectionBackgroundColor", isSignal: true, isRequired: false, transformFunction: null }, sortBySelectedOnTop: { classPropertyName: "sortBySelectedOnTop", publicName: "sortBySelectedOnTop", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, noDataLabel: { classPropertyName: "noDataLabel", publicName: "noDataLabel", isSignal: true, isRequired: false, transformFunction: null }, clearSearchAfterSelect: { classPropertyName: "clearSearchAfterSelect", publicName: "clearSearchAfterSelect", isSignal: true, isRequired: false, transformFunction: null }, clearSearchButtonTooltip: { classPropertyName: "clearSearchButtonTooltip", publicName: "clearSearchButtonTooltip", isSignal: true, isRequired: false, transformFunction: null }, focusSearchInputOnPanelOpen: { classPropertyName: "focusSearchInputOnPanelOpen", publicName: "focusSearchInputOnPanelOpen", isSignal: true, isRequired: false, transformFunction: null }, filterPredicate: { classPropertyName: "filterPredicate", publicName: "filterPredicate", isSignal: true, isRequired: false, transformFunction: null }, propertiesToSkipInSearch: { classPropertyName: "propertiesToSkipInSearch", publicName: "propertiesToSkipInSearch", isSignal: true, isRequired: false, transformFunction: null }, filterText: { classPropertyName: "filterText", publicName: "filterText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", selectionChange: "selectionChange", filterText: "filterTextChange" }, ngImport: i0, template: "<div class=\"dm-mat-select-wrapper\" [class]=\"wrapperClass()\">\n <mat-form-field [appearance]=\"appearance()\" [class]=\"formFieldClass()\" style=\"width: 100%\">\n <mat-label>{{ label() }}</mat-label>\n <mat-select\n [multiple]=\"multiple()\"\n [formControl]=\"control()\"\n (selectionChange)=\"selectionChangeHandler($event)\"\n [disabled]=\"disabled()\"\n [panelWidth]=\"panelWidth()\"\n [panelClass]=\"panelClass()\"\n (opened)=\"onPanelOpened()\"\n >\n <div\n class=\"search-section\"\n [ngStyle]=\"{\n 'background-color': 'none'\n }\"\n >\n @if (searchable()) {\n <mat-form-field>\n <input\n id=\"dm-mat-select-search-input\"\n matInput\n [placeholder]=\"searchPlaceholder()\"\n [(ngModel)]=\"filterText\"\n (keyup)=\"applyFilter($event)\"\n (keyDown.Space)=\"$event.stopPropagation()\"\n />\n @if (filterText()) {\n <button\n mat-icon-button\n matSuffix\n (click)=\"resetSearch()\"\n [matTooltip]=\"clearSearchButtonTooltip() || ''\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @if (selectAllEnabled() && multiple()) {\n <mat-checkbox [checked]=\"checkIfAllSelected()\" (change)=\"selectAllChange($event)\">{{\n selectAllLabel()\n }}</mat-checkbox>\n }\n </div>\n @if (emptyOption()) {\n <mat-option\n [value]=\"emptyOptionValue()\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, emptyOptionValue())\"\n >{{ emptyOptionLabel() }}</mat-option\n >\n } @for (option of datasource().result(); track simpleArray() ? option :\n option[this.optionValueKey()]) {\n <mat-option\n [value]=\"simpleArray() ? option : option[optionValueKey()]\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, option)\"\n >{{\n optionNameFormat()\n ? option.__dmMatSelectFormattedName\n : simpleArray()\n ? option\n : option[optionLabelKey()]\n }}</mat-option\n >\n } @if (datasource().result().length === 0) {\n <mat-option disabled>{{ noDataLabel() }}</mat-option>\n }\n </mat-select>\n\n @if (icon(); as icon) {\n <span matSuffix>\n @if (isBootstrapIcon()) {\n <span [innerHTML]=\"icon\"></span> } @else {\n <mat-icon matSuffix>{{ icon }}</mat-icon>\n }\n </span>\n }\n\n <span matSuffix>\n <ng-content select=\"[dm-mat-select-suffix]\"></ng-content>\n </span>\n\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n</div>\n", styles: [".dm-mat-select-wrapper{width:100%;position:relative}.dm-mat-select-wrapper .search-section{display:flex;flex-direction:column;position:sticky;top:0;z-index:1;background-color:var(--dm-mat-select-search-section-bg-color, #faf9fd)}.dm-mat-select-wrapper .search-section ::ng-deep mat-form-field>.mat-mdc-form-field-subscript-wrapper{display:none}.dm-mat-select-wrapper ::ng-deep mat-form-field>.mat-mdc-text-field-wrapper>.mat-mdc-form-field-flex>.mat-mdc-form-field-icon-suffix{padding:0 4px 0 8px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
590
624
  }
591
625
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmMatSelect, decorators: [{
592
626
  type: Component,
593
627
  args: [{ selector: 'dm-mat-select', standalone: true, imports: [
628
+ ReactiveFormsModule,
594
629
  MatFormFieldModule,
630
+ MatCheckboxModule,
631
+ MatButtonModule,
595
632
  MatSelectModule,
633
+ MatInputModule,
596
634
  CommonModule,
597
635
  FormsModule,
598
- ReactiveFormsModule,
599
- MatInputModule,
600
- MatCheckboxModule,
601
- MatIcon,
602
- MatButtonModule,
603
636
  MatTooltip,
604
- MatSuffix,
637
+ MatIcon,
605
638
  ], template: "<div class=\"dm-mat-select-wrapper\" [class]=\"wrapperClass()\">\n <mat-form-field [appearance]=\"appearance()\" [class]=\"formFieldClass()\" style=\"width: 100%\">\n <mat-label>{{ label() }}</mat-label>\n <mat-select\n [multiple]=\"multiple()\"\n [formControl]=\"control()\"\n (selectionChange)=\"selectionChangeHandler($event)\"\n [disabled]=\"disabled()\"\n [panelWidth]=\"panelWidth()\"\n [panelClass]=\"panelClass()\"\n (opened)=\"onPanelOpened()\"\n >\n <div\n class=\"search-section\"\n [ngStyle]=\"{\n 'background-color': 'none'\n }\"\n >\n @if (searchable()) {\n <mat-form-field>\n <input\n id=\"dm-mat-select-search-input\"\n matInput\n [placeholder]=\"searchPlaceholder()\"\n [(ngModel)]=\"filterText\"\n (keyup)=\"applyFilter($event)\"\n (keyDown.Space)=\"$event.stopPropagation()\"\n />\n @if (filterText()) {\n <button\n mat-icon-button\n matSuffix\n (click)=\"resetSearch()\"\n [matTooltip]=\"clearSearchButtonTooltip() || ''\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @if (selectAllEnabled() && multiple()) {\n <mat-checkbox [checked]=\"checkIfAllSelected()\" (change)=\"selectAllChange($event)\">{{\n selectAllLabel()\n }}</mat-checkbox>\n }\n </div>\n @if (emptyOption()) {\n <mat-option\n [value]=\"emptyOptionValue()\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, emptyOptionValue())\"\n >{{ emptyOptionLabel() }}</mat-option\n >\n } @for (option of datasource().result(); track simpleArray() ? option :\n option[this.optionValueKey()]) {\n <mat-option\n [value]=\"simpleArray() ? option : option[optionValueKey()]\"\n (onSelectionChange)=\"onSelectionChangeHandler($event, option)\"\n >{{\n optionNameFormat()\n ? option.__dmMatSelectFormattedName\n : simpleArray()\n ? option\n : option[optionLabelKey()]\n }}</mat-option\n >\n } @if (datasource().result().length === 0) {\n <mat-option disabled>{{ noDataLabel() }}</mat-option>\n }\n </mat-select>\n\n @if (icon(); as icon) {\n <span matSuffix>\n @if (isBootstrapIcon()) {\n <span [innerHTML]=\"icon\"></span> } @else {\n <mat-icon matSuffix>{{ icon }}</mat-icon>\n }\n </span>\n }\n\n <span matSuffix>\n <ng-content select=\"[dm-mat-select-suffix]\"></ng-content>\n </span>\n\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n</div>\n", styles: [".dm-mat-select-wrapper{width:100%;position:relative}.dm-mat-select-wrapper .search-section{display:flex;flex-direction:column;position:sticky;top:0;z-index:1;background-color:var(--dm-mat-select-search-section-bg-color, #faf9fd)}.dm-mat-select-wrapper .search-section ::ng-deep mat-form-field>.mat-mdc-form-field-subscript-wrapper{display:none}.dm-mat-select-wrapper ::ng-deep mat-form-field>.mat-mdc-text-field-wrapper>.mat-mdc-form-field-flex>.mat-mdc-form-field-icon-suffix{padding:0 4px 0 8px}\n"] }]
606
639
  }], ctorParameters: () => [], propDecorators: { formFieldClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "formFieldClass", required: false }] }], wrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapperClass", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], selectAllEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllEnabled", required: false }] }], selectAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllLabel", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionValueKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValueKey", required: false }] }], optionLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabelKey", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyOption", required: false }] }], emptyOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyOptionLabel", required: false }] }], emptyOptionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyOptionValue", required: false }] }], optionNameFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionNameFormat", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], searchSectionBackgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchSectionBackgroundColor", required: false }] }], sortBySelectedOnTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBySelectedOnTop", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], noDataLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noDataLabel", required: false }] }], clearSearchAfterSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearSearchAfterSelect", required: false }] }], clearSearchButtonTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearSearchButtonTooltip", required: false }] }], focusSearchInputOnPanelOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusSearchInputOnPanelOpen", required: false }] }], filterPredicate: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPredicate", required: false }] }], propertiesToSkipInSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesToSkipInSearch", required: false }] }], filterText: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterText", required: false }] }, { type: i0.Output, args: ["filterTextChange"] }] } });
607
640
 
@@ -712,7 +745,7 @@ class DmColorPicker {
712
745
  registerOnChange(fn) { }
713
746
  registerOnTouched(fn) { }
714
747
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmColorPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
715
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DmColorPicker, isStandalone: true, selector: "dm-color-picker", inputs: { colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, customColor: { classPropertyName: "customColor", publicName: "customColor", isSignal: true, isRequired: false, transformFunction: null }, opacitySlider: { classPropertyName: "opacitySlider", publicName: "opacitySlider", isSignal: true, isRequired: false, transformFunction: null }, opacitySliderLabel: { classPropertyName: "opacitySliderLabel", publicName: "opacitySliderLabel", isSignal: true, isRequired: false, transformFunction: null }, customColorTooltip: { classPropertyName: "customColorTooltip", publicName: "customColorTooltip", isSignal: true, isRequired: false, transformFunction: null }, wrapperClass: { classPropertyName: "wrapperClass", publicName: "wrapperClass", isSignal: true, isRequired: false, transformFunction: null }, wrapperStyle: { classPropertyName: "wrapperStyle", publicName: "wrapperStyle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onColorChange: "onColorChange", value: "valueChange" }, ngImport: i0, template: "<div class=\"dm-color-picker-wrapper\" [class]=\"wrapperClass()\" [style]=\"wrapperStyle()\">\n <div\n class=\"dm-color-picker\"\n [matMenuTriggerFor]=\"colorPicker\"\n [style.background-color]=\"selectedColor()\"\n [matTooltip]=\"tooltip()\"\n [matTooltipPosition]=\"tooltipPosition()\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n [style.border-radius]=\"radius()\"\n ></div>\n @if (opacitySlider()){\n <div class=\"dm-color-picker-slider-wrapper\">\n {{ opacitySliderLabel() }}\n <mat-slider min=\"0\" max=\"100\" step=\"1\" discrete [displayWith]=\"formatLabel\">\n <input\n matSliderThumb\n [value]=\"getOpacity()\"\n (input)=\"onOpacityChange($event)\"\n #slider\n (change)=\"updateSelectedColor()\"\n />\n </mat-slider>\n </div>\n }\n</div>\n\n<mat-menu #colorPicker=\"matMenu\">\n <div class=\"dm-color-picker-menu\">\n @for (color of colors(); track color.color){\n <div\n (click)=\"onColorSelected(color.color)\"\n class=\"dm-color-div\"\n [matTooltip]=\"color.tooltip || ''\"\n matTooltipPosition=\"above\"\n [style.background-color]=\"color.color\"\n ></div>\n } @if (customColor()){<input\n (click)=\"$event.stopPropagation()\"\n [matTooltip]=\"customColorTooltip()\"\n [matTooltipPosition]=\"tooltipPosition()\"\n [value]=\"selectedColor()\"\n type=\"color\"\n class=\"pointer\"\n (change)=\"_onColorChange($event)\"\n />}\n </div>\n</mat-menu>\n", styles: [".dm-color-picker-wrapper{display:flex;flex-direction:column;align-items:start;width:fit-content}.dm-color-picker-wrapper .dm-color-picker{cursor:pointer;padding:3px;box-shadow:0 0 2.5px 1px #00000080}.dm-color-picker-wrapper .dm-color-picker-slider-wrapper{display:flex;align-items:center;gap:5px}.dm-color-picker-menu{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;height:100%}.dm-color-picker-menu .dm-color-div{width:30px;height:30px;border-radius:50%;margin:5px;cursor:pointer;box-shadow:0 0 2.5px 1px #00000080}.dm-color-picker-menu .dm-color-div:hover{box-shadow:0 0 5px 2px #00000080}.pointer{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i3$1.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i3$1.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }] });
748
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DmColorPicker, isStandalone: true, selector: "dm-color-picker", inputs: { colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, customColor: { classPropertyName: "customColor", publicName: "customColor", isSignal: true, isRequired: false, transformFunction: null }, opacitySlider: { classPropertyName: "opacitySlider", publicName: "opacitySlider", isSignal: true, isRequired: false, transformFunction: null }, opacitySliderLabel: { classPropertyName: "opacitySliderLabel", publicName: "opacitySliderLabel", isSignal: true, isRequired: false, transformFunction: null }, customColorTooltip: { classPropertyName: "customColorTooltip", publicName: "customColorTooltip", isSignal: true, isRequired: false, transformFunction: null }, wrapperClass: { classPropertyName: "wrapperClass", publicName: "wrapperClass", isSignal: true, isRequired: false, transformFunction: null }, wrapperStyle: { classPropertyName: "wrapperStyle", publicName: "wrapperStyle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onColorChange: "onColorChange", value: "valueChange" }, ngImport: i0, template: "<div class=\"dm-color-picker-wrapper\" [class]=\"wrapperClass()\" [style]=\"wrapperStyle()\">\n <div\n class=\"dm-color-picker\"\n [matMenuTriggerFor]=\"colorPicker\"\n [style.background-color]=\"selectedColor()\"\n [matTooltip]=\"tooltip()\"\n [matTooltipPosition]=\"tooltipPosition()\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n [style.border-radius]=\"radius()\"\n ></div>\n @if (opacitySlider()){\n <div class=\"dm-color-picker-slider-wrapper\">\n {{ opacitySliderLabel() }}\n <mat-slider min=\"0\" max=\"100\" step=\"1\" discrete [displayWith]=\"formatLabel\">\n <input\n matSliderThumb\n [value]=\"getOpacity()\"\n (input)=\"onOpacityChange($event)\"\n #slider\n (change)=\"updateSelectedColor()\"\n />\n </mat-slider>\n </div>\n }\n</div>\n\n<mat-menu #colorPicker=\"matMenu\">\n <div class=\"dm-color-picker-menu\">\n @for (color of colors(); track color.color){\n <div\n (click)=\"onColorSelected(color.color)\"\n class=\"dm-color-div\"\n [matTooltip]=\"color.tooltip || ''\"\n matTooltipPosition=\"above\"\n [style.background-color]=\"color.color\"\n ></div>\n } @if (customColor()){<input\n (click)=\"$event.stopPropagation()\"\n [matTooltip]=\"customColorTooltip()\"\n [matTooltipPosition]=\"tooltipPosition()\"\n [value]=\"selectedColor()\"\n type=\"color\"\n class=\"pointer\"\n (change)=\"_onColorChange($event)\"\n />}\n </div>\n</mat-menu>\n", styles: [".dm-color-picker-wrapper{display:flex;flex-direction:column;align-items:start;width:fit-content}.dm-color-picker-wrapper .dm-color-picker{cursor:pointer;padding:3px;box-shadow:0 0 2.5px 1px #00000080}.dm-color-picker-wrapper .dm-color-picker-slider-wrapper{display:flex;align-items:center;gap:5px}.dm-color-picker-menu{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;height:100%}.dm-color-picker-menu .dm-color-div{width:30px;height:30px;border-radius:50%;margin:5px;cursor:pointer;box-shadow:0 0 2.5px 1px #00000080}.dm-color-picker-menu .dm-color-div:hover{box-shadow:0 0 5px 2px #00000080}.pointer{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i3$1.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i3$1.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }] });
716
749
  }
717
750
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmColorPicker, decorators: [{
718
751
  type: Component,
@@ -848,9 +881,1242 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
848
881
  args: [{ selector: 'dm-spinner', standalone: true, imports: [CommonModule], template: "@if ( (_spinnerService.visibility$() && (_spinnerService.spinnerToShow$() == name())) ||\n(_spinnerService.spinnerTasks$().size > 0 && name() == 'dm-spinner')) {\n\n<div class=\"dm-spinner-wrapper\">\n <div class=\"dm-spinner-inner-wrapper\">\n @switch (type()) { @case ('flower') {\n <div class=\"dm-spinner-flower\"></div>\n } @case ('rounded') {\n <div class=\"dm-spinner-rounded\"></div>\n } @case ('gif') {\n <img class=\"dm-spinner-gif\" [src]=\"gifSrc()\" [width]=\"size()\" [height]=\"'auto'\" />\n } }\n <div class=\"dm-spinner-text\" [style.font-size.px]=\"fontSize()\">\n {{ spinnerText() }}\n </div>\n </div>\n</div>\n}\n", styles: [":host-context(.loading-active) .dm-spinner-wrapper{pointer-events:none}:host-context(.loading-active) .dm-spinner-wrapper{pointer-events:auto}.dm-spinner-wrapper{position:var(--dm-spinner-position, absolute);top:0;left:0;height:100%;width:100%;background-color:var(--dm-spinner-background-color, rgba(0, 0, 0, .2));z-index:9999999999;-webkit-backdrop-filter:blur(var(--dm-spinner-background-blur, 5px));backdrop-filter:blur(var(--dm-spinner-background-blur, 5px))}.dm-spinner-wrapper .dm-spinner-inner-wrapper{position:relative;width:100%;height:100%;display:block}.dm-spinner-wrapper .dm-spinner-inner-wrapper .dm-spinner-rounded{width:calc(var(--dm-spinner-size, 60) * 1px);position:absolute;height:calc(var(--dm-spinner-size, 60) * 1px);transform-origin:center;top:calc(50% - var(--dm-spinner-size, 60) / 2 * 1px);left:calc(50% - var(--dm-spinner-size, 60) / 2 * 1px);border-top:calc(var(--dm-spinner-border-thikness, 5) * 1px) solid var(--dm-spinner-first-color, #1a4bd6);border-right:calc(var(--dm-spinner-border-thikness, 5) * 1px) solid var(--dm-spinner-second-color, #e6f0fb);border-bottom:calc(var(--dm-spinner-border-thikness, 5) * 1px) solid var(--dm-spinner-first-color, #1a4bd6);border-left:calc(var(--dm-spinner-border-thikness, 5) * 1px) solid var(--dm-spinner-second-color, #e6f0fb);border-radius:50%;animation:spin calc(var(--dm-spinner-speed, 2) * 1s) linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.dm-spinner-wrapper .dm-spinner-inner-wrapper .dm-spinner-flower{width:calc(var(--dm-spinner-shape-size, 25) * 1px);position:absolute;height:calc(var(--dm-spinner-shape-size, 25) * 1px);background-color:none;border-radius:50%;transform-origin:center;top:calc(50% - var(--dm-spinner-shape-size, 25) / 2 * 1px);left:calc(50% - var(--dm-spinner-shape-size, 25) / 2 * 1px);animation:flower calc(var(--dm-spinner-speed, 2) * 1s) linear infinite}@keyframes flower{0%{rotate:0deg;transform:scale(0);box-shadow:calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-first-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-second-color, #e6f0fb),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-thired-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-fourth-color, #e6f0fb)}25%{rotate:180deg;transform:scale(1);box-shadow:calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 var(--dm-spinner-fourth-color, #e6f0fb),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 var(--dm-spinner-thired-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 var(--dm-spinner-first-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 var(--dm-spinner-second-color, #e6f0fb)}50%{rotate:360deg;transform:scale(1);box-shadow:0 0 0 var(--dm-spinner-first-color, #1a4bd6),0 0 0 var(--dm-spinner-second-color, #e6f0fb),0 0 0 var(--dm-spinner-thired-color, #1a4bd6),0 0 0 var(--dm-spinner-fourth-color, #e6f0fb)}75%{rotate:540deg;transform:scale(1);box-shadow:calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 var(--dm-spinner-second-color, #e6f0fb),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 var(--dm-spinner-fourth-color, #e6f0fb),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 var(--dm-spinner-first-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 var(--dm-spinner-thired-color, #1a4bd6)}to{rotate:720deg;transform:scale(0);box-shadow:calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-first-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * 1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-second-color, #e6f0fb),calc(var(--dm-spinner-size, 60) / 2 * -1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-thired-color, #1a4bd6),calc(var(--dm-spinner-size, 60) / 2 * 1px) calc(var(--dm-spinner-size, 60) / 2 * -1px) 0 calc(var(--dm-spinner-size, 60) / 2 * 1px) var(--dm-spinner-fourth-color, #e6f0fb)}}.dm-spinner-wrapper .dm-spinner-inner-wrapper .dm-spinner-gif{width:calc(var(--dm-spinner-size, 60) * 1px);position:absolute;height:calc(var(--dm-spinner-size, 60) * 1px);transform-origin:center;top:calc(50% - var(--dm-spinner-size, 60) / 2 * 1px);left:calc(50% - var(--dm-spinner-size, 60) / 2 * 1px);background-size:cover}.dm-spinner-wrapper .dm-spinner-inner-wrapper .dm-spinner-text{position:relative;display:flow-root;top:calc(50% + var(--dm-spinner-size, 60) * 1px / 2 + 5px + var(--dm-spinner-font-size, 20) * 1px / 2 + var(--dm-spinner-text-position-y-offset, 0px) * 1px);margin:0 auto;color:var(--dm-spinner-text-color, #000);text-align:center;font-weight:700}\n"] }]
849
882
  }], ctorParameters: () => [{ type: DmSpinnerService }, { type: i0.Renderer2 }], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], gifSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "gifSrc", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shapeSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "shapeSize", required: false }] }], speed: [{ type: i0.Input, args: [{ isSignal: true, alias: "speed", required: false }] }], borderThikness: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderThikness", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], fontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontSize", required: false }] }], textPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "textPosition", required: false }] }], colors: [{ type: i0.Input, args: [{ isSignal: true, alias: "colors", required: false }] }], backgroundBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundBlur", required: false }] }], textPositionYOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "textPositionYOffset", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
850
883
 
884
+ const shouldCacheColumn = (column) => {
885
+ return !!column.valueGetter || !!(column.type == 'date');
886
+ };
887
+ const DM_TABLE_HEADER_BACKGROUND_COLOR_CSS_VAR = '--dm-table-header-background-color';
888
+ const DM_TABLE_HEADER_COLOR_CSS_VAR = '--dm-table-header-color';
889
+
890
+ class DmTableCellHost {
891
+ component = input.required(...(ngDevMode ? [{ debugName: "component" }] : []));
892
+ context = input.required(...(ngDevMode ? [{ debugName: "context" }] : []));
893
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmTableCellHost, deps: [], target: i0.ɵɵFactoryTarget.Component });
894
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: DmTableCellHost, isStandalone: true, selector: "dm-table-cell-host", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container\n *ngComponentOutlet=\"\n component();\n inputs: {\n row: context().row,\n column: context().column,\n }\n \"\n></ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i10.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
895
+ }
896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmTableCellHost, decorators: [{
897
+ type: Component,
898
+ args: [{ selector: 'dm-table-cell-host', standalone: true, imports: [CommonModule], template: "<ng-container\n *ngComponentOutlet=\"\n component();\n inputs: {\n row: context().row,\n column: context().column,\n }\n \"\n></ng-container>\n" }]
899
+ }], propDecorators: { component: [{ type: i0.Input, args: [{ isSignal: true, alias: "component", required: true }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }] } });
900
+
901
+ const daysOfWeek = {
902
+ en: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
903
+ he: ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'],
904
+ ar: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
905
+ };
906
+ Date.prototype.getWeekOfYear = function () {
907
+ const d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()));
908
+ const dayNum = d.getUTCDay() || 7;
909
+ d.setUTCDate(d.getUTCDate() + 4 - dayNum);
910
+ const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
911
+ return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
912
+ };
913
+ Date.prototype.getWeekOfMonth = function () {
914
+ const firstDay = new Date(this.getFullYear(), this.getMonth(), 1).getDay();
915
+ const day = this.getDate();
916
+ return Math.ceil((day + firstDay) / 7);
917
+ };
918
+ Date.prototype.getDayOfYear = function () {
919
+ const start = new Date(this.getFullYear(), 0, 0);
920
+ const diff = this.getTime() - start.getTime();
921
+ const oneDay = 1000 * 60 * 60 * 24;
922
+ return Math.floor(diff / oneDay);
923
+ };
924
+ class DmDateService {
925
+ getDate(date) {
926
+ if (!date)
927
+ return null;
928
+ if (date instanceof Date)
929
+ return date;
930
+ if (typeof date === 'string') {
931
+ if (date == '')
932
+ return null;
933
+ return new Date(date) || null;
934
+ }
935
+ if ('seconds' in date && 'nanoseconds' in date) {
936
+ return new Date(date.seconds * 1000);
937
+ }
938
+ if ('_seconds' in date && '_nanoseconds' in date) {
939
+ return new Date(date._seconds * 1000);
940
+ }
941
+ if (!isNaN(Number(date))) {
942
+ return new Date(1900, 0, +date - 1);
943
+ }
944
+ return null;
945
+ }
946
+ /**
947
+ *
948
+ * @param date the date to transform
949
+ * @param format the format of the date
950
+ * @param lang the language of the date
951
+ * @returns the date as a string
952
+ *
953
+ * @example
954
+ * The format can be any string that contains the following:
955
+ * - 'dd' - the day of the month
956
+ * - 'MM' - the month
957
+ * - 'yyyy' - the year
958
+ * - 'yy' - the year (2 digits)
959
+ * - 'HH' - the hour
960
+ * - 'mm' - the minute
961
+ * - 'ss' - the second
962
+ * - 'SSS' - the millisecond
963
+ * - 'DM_a' - the AM/PM
964
+ * - 'DM_E' - the day of the week
965
+ * - 'DM_Z' - the time zone
966
+ * - 'DM_z' - the time zone offset
967
+ * - 'DM_yw' - the week of the year
968
+ * - 'DM_mw' - the week of the month
969
+ * - 'DM_yd' - the day of the year
970
+ */
971
+ getDateString(date, format = 'dd/MM/yyyy', lang = 'he') {
972
+ if (!date)
973
+ return '';
974
+ const res = this.getDate(date);
975
+ if (!res || !(res instanceof Date) || isNaN(res.getTime()))
976
+ return '';
977
+ // const day = res.getDate().toString().padStart(2, '0');
978
+ // const month = (res.getMonth() + 1).toString().padStart(2, '0');
979
+ // const year = res.getFullYear();
980
+ // const hours = res.getHours().toString().padStart(2, '0');
981
+ // const minutes = res.getMinutes().toString().padStart(2, '0');
982
+ const replacements = {
983
+ dd: res.getDate().toString().padStart(2, '0'),
984
+ MM: (res.getMonth() + 1).toString().padStart(2, '0'),
985
+ yyyy: res.getFullYear().toString(),
986
+ yy: res.getFullYear().toString().slice(-2),
987
+ HH: res.getHours().toString().padStart(2, '0'),
988
+ mm: res.getMinutes().toString().padStart(2, '0'),
989
+ SSS: res.getMilliseconds().toString().padStart(3, '0'),
990
+ ss: res.getSeconds().toString().padStart(2, '0'),
991
+ DD: daysOfWeek[lang][res.getDay()],
992
+ DM_a: res.getHours() < 12 ? 'AM' : 'PM',
993
+ DM_E: res.getDay().toString(),
994
+ DM_Z: res.toTimeString().match(/\(([^)]+)\)/)?.[1] || '',
995
+ DM_z: res.getTimezoneOffset().toString(),
996
+ DM_yw: res.getWeekOfYear().toString(),
997
+ DM_mw: res.getWeekOfMonth().toString(),
998
+ DM_yd: res.getDayOfYear().toString(),
999
+ };
1000
+ // Replace format placeholders with actual values
1001
+ return format.replace(/(dd|MM|yyyy|yy|HH|mm|SSS|ss|DD|DM_a|DM_E|DM_Z|DM_z|DM_yw|DM_mw|DM_yd)/g, (match) => replacements[match] || match);
1002
+ // if (format === 'dd/MM/yyyy') {
1003
+ // return `${day}/${month}/${year}`;
1004
+ // }
1005
+ // if (format === 'yyyy/MM/dd') {
1006
+ // return `${year}/${month}/${day}`;
1007
+ // }
1008
+ // return `${day}/${month}/${year} ${hours}:${minutes}`;
1009
+ }
1010
+ /**
1011
+ *
1012
+ * @param date the date to transform
1013
+ * @param format the format of the date
1014
+ * @param lang the language of the date
1015
+ * @returns the date as a string
1016
+ *
1017
+ * @example
1018
+ * The format can be any string that contains the following:
1019
+ * - 'dd' - the day of the month
1020
+ * - 'MM' - the month
1021
+ * - 'yyyy' - the year
1022
+ * - 'yy' - the year (2 digits)
1023
+ * - 'HH' - the hour
1024
+ * - 'mm' - the minute
1025
+ * - 'ss' - the second
1026
+ * - 'SSS' - the millisecond
1027
+ * - 'DM_a' - the AM/PM
1028
+ * - 'DM_E' - the day of the week
1029
+ * - 'DM_Z' - the time zone
1030
+ * - 'DM_z' - the time zone offset
1031
+ * - 'DM_yw' - the week of the year
1032
+ * - 'DM_mw' - the week of the month
1033
+ * - 'DM_yd' - the day of the year
1034
+ */
1035
+ static getDateString(date, format = 'dd/MM/yyyy', lang = 'he') {
1036
+ if (!date)
1037
+ return '';
1038
+ const res = DmDateService.getDate(date);
1039
+ if (!res || !(res instanceof Date) || isNaN(res.getDate()))
1040
+ return '';
1041
+ const replacements = {
1042
+ dd: res.getDate().toString().padStart(2, '0'),
1043
+ MM: (res.getMonth() + 1).toString().padStart(2, '0'),
1044
+ yyyy: res.getFullYear().toString(),
1045
+ yy: res.getFullYear().toString().slice(-2),
1046
+ HH: res.getHours().toString().padStart(2, '0'),
1047
+ mm: res.getMinutes().toString().padStart(2, '0'),
1048
+ SSS: res.getMilliseconds().toString().padStart(3, '0'),
1049
+ ss: res.getSeconds().toString().padStart(2, '0'),
1050
+ DD: daysOfWeek[lang][res.getDay()],
1051
+ DM_a: res.getHours() < 12 ? 'AM' : 'PM',
1052
+ DM_E: res.getDay().toString(),
1053
+ DM_Z: res.toTimeString().match(/\(([^)]+)\)/)?.[1] || '',
1054
+ DM_z: res.getTimezoneOffset().toString(),
1055
+ DM_yw: res.getWeekOfYear().toString(),
1056
+ DM_mw: res.getWeekOfMonth().toString(),
1057
+ DM_yd: res.getDayOfYear().toString(),
1058
+ };
1059
+ // Replace format placeholders with actual values
1060
+ return format.replace(/(dd|MM|yyyy|yy|HH|mm|SSS|ss|DD|DM_a|DM_E|DM_Z|DM_z|DM_yw|DM_mw|DM_yd)/g, (match) => replacements[match] || match);
1061
+ // const day = res.getDate().toString().padStart(2, '0');
1062
+ // const month = (res.getMonth() + 1).toString().padStart(2, '0');
1063
+ // const year = res.getFullYear();
1064
+ // const hours = res.getHours().toString().padStart(2, '0');
1065
+ // const minutes = res.getMinutes().toString().padStart(2, '0');
1066
+ // if (format === 'dd/MM/yyyy') {
1067
+ // return `${day}/${month}/${year}`;
1068
+ // }
1069
+ // if (format === 'yyyy/MM/dd') {
1070
+ // return `${year}/${month}/${day}`;
1071
+ // }
1072
+ // return `${day}/${month}/${year} ${hours}:${minutes}`;
1073
+ }
1074
+ static getDate(date) {
1075
+ if (!date)
1076
+ return null;
1077
+ if (date instanceof Date)
1078
+ return date;
1079
+ if (typeof date === 'string') {
1080
+ if (date == '')
1081
+ return null;
1082
+ return new Date(date) || null;
1083
+ }
1084
+ if ('_seconds' in date && '_nanoseconds' in date) {
1085
+ return new Date(date._seconds * 1000);
1086
+ }
1087
+ if ('seconds' in date && 'nanoseconds' in date) {
1088
+ return new Date(date.seconds * 1000);
1089
+ }
1090
+ if (!isNaN(Number(date))) {
1091
+ return new Date(1900, 0, +date - 1);
1092
+ }
1093
+ return null;
1094
+ }
1095
+ static getTimeString(date) {
1096
+ if (!date)
1097
+ return '';
1098
+ const res = DmDateService.getDate(date);
1099
+ if (!res || !(res instanceof Date))
1100
+ return '';
1101
+ return `${(res.getHours() < 10 ? '0' : '') + res.getHours()}:${(res.getMinutes() < 10 ? '0' : '') + res.getMinutes()}`;
1102
+ }
1103
+ static now() {
1104
+ return new Date();
1105
+ }
1106
+ now() {
1107
+ return new Date();
1108
+ }
1109
+ getAge(date, fixed = null, result = 'number') {
1110
+ if (!date)
1111
+ return 0;
1112
+ const res = this.getDate(date);
1113
+ if (!res || !(res instanceof Date))
1114
+ return 0;
1115
+ const today = new Date();
1116
+ let age = today.getFullYear() - res.getFullYear();
1117
+ let monthDiff = today.getMonth() - res.getMonth();
1118
+ if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < res.getDate())) {
1119
+ age--;
1120
+ monthDiff += 12;
1121
+ }
1122
+ const ageWithMonths = age + monthDiff / 12;
1123
+ if (result === 'string') {
1124
+ if (fixed || fixed === 0) {
1125
+ return ageWithMonths.toFixed(fixed);
1126
+ }
1127
+ return ageWithMonths;
1128
+ }
1129
+ if (fixed || fixed === 0) {
1130
+ return Number(ageWithMonths.toFixed(fixed));
1131
+ }
1132
+ return ageWithMonths;
1133
+ }
1134
+ static getAge(date, fixed = null, result = 'number') {
1135
+ if (!date)
1136
+ return 0;
1137
+ const res = DmDateService.getDate(date);
1138
+ if (!res || !(res instanceof Date))
1139
+ return 0;
1140
+ const today = new Date();
1141
+ let age = today.getFullYear() - res.getFullYear();
1142
+ let monthDiff = today.getMonth() - res.getMonth();
1143
+ if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < res.getDate())) {
1144
+ age--;
1145
+ monthDiff += 12;
1146
+ }
1147
+ const ageWithMonths = age + monthDiff / 12;
1148
+ if (result === 'string') {
1149
+ if (fixed || fixed === 0) {
1150
+ return ageWithMonths.toFixed(fixed);
1151
+ }
1152
+ return ageWithMonths;
1153
+ }
1154
+ if (fixed || fixed === 0) {
1155
+ return Number(ageWithMonths.toFixed(fixed));
1156
+ }
1157
+ return ageWithMonths;
1158
+ }
1159
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmDateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1160
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmDateService, providedIn: 'root' });
1161
+ }
1162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmDateService, decorators: [{
1163
+ type: Injectable,
1164
+ args: [{
1165
+ providedIn: 'root',
1166
+ }]
1167
+ }] });
1168
+
1169
+ const DEFAULT_PAGINATOR_SETTINGS = {
1170
+ pageSize: 10,
1171
+ pageSizeOptions: [10, 25, 50, 100],
1172
+ numberOfItemsPerPageLabel: 'מספר פריטים בדף',
1173
+ firstPageButtonLabel: 'דף ראשון',
1174
+ lastPageButtonLabel: 'דף אחרון',
1175
+ nextPageButtonLabel: 'הדף הבא',
1176
+ previousPageButtonLabel: 'הדף הקודם',
1177
+ showFirstAndLastPagesButtons: true,
1178
+ };
1179
+ const DEFAULT_TABLE_STYLE = {
1180
+ tableWrapper: {
1181
+ 'max-height': '800px',
1182
+ width: 'calc(100% - 10px)',
1183
+ display: 'block',
1184
+ 'overflow-x': 'auto',
1185
+ padding: '0 5px',
1186
+ },
1187
+ table: {
1188
+ root: {
1189
+ width: '100%',
1190
+ 'border-collapse': 'collapse',
1191
+ 'border-spacing': 0,
1192
+ 'box-shadow': '0px 5px 5px -3px #003, 0 8px 10px 1px #00000024, 0 3px 14px 2px #0000001f',
1193
+ padding: 0,
1194
+ 'font-size': '1rem',
1195
+ 'border-radius': '8px',
1196
+ 'page-break-inside': 'auto',
1197
+ },
1198
+ thead: {
1199
+ root: {
1200
+ 'background-color': '#f5f5f5',
1201
+ },
1202
+ th: {
1203
+ padding: '20px 15px',
1204
+ 'text-align': 'start',
1205
+ 'max-width': 'none',
1206
+ },
1207
+ },
1208
+ tbody: {
1209
+ hovered_row_style: {
1210
+ tr: {
1211
+ 'background-color': '#f5f5f5',
1212
+ },
1213
+ },
1214
+ even_row_style: {
1215
+ tr: {
1216
+ 'background-color': '#ffffff',
1217
+ },
1218
+ },
1219
+ odd_row_style: {
1220
+ tr: {
1221
+ 'background-color': '#fafafa',
1222
+ },
1223
+ },
1224
+ tr: {
1225
+ 'border-bottom': '1px solid #e0e0e0',
1226
+ 'page-break-inside': 'avoid',
1227
+ },
1228
+ td: {
1229
+ padding: '7px 15px',
1230
+ 'text-align': 'start',
1231
+ 'max-width': 'none',
1232
+ 'text-overflow': 'ellipsis',
1233
+ overflow: 'hidden',
1234
+ 'white-space': 'nowrap',
1235
+ },
1236
+ input: {
1237
+ background: 'white',
1238
+ border: '1px solid',
1239
+ 'border-radius': '3px',
1240
+ },
1241
+ },
1242
+ tfoot: {
1243
+ root: {
1244
+ 'background-color': '#f5f5f5',
1245
+ },
1246
+ td: {
1247
+ padding: '20px 15px',
1248
+ 'text-align': 'start',
1249
+ 'max-width': 'none',
1250
+ },
1251
+ },
1252
+ },
1253
+ paginator: {
1254
+ root: {
1255
+ 'background-color': '#f5f5f5',
1256
+ },
1257
+ p: {
1258
+ 'margin-bottom': '0',
1259
+ },
1260
+ },
1261
+ total_row_style: {},
1262
+ scrollbar: {},
1263
+ };
1264
+ const DEFAULT_PRINT_TABLE_BUTTON = {
1265
+ icon: 'print',
1266
+ buttonType: 'icon',
1267
+ tooltip: 'הדפס',
1268
+ color: '#5b81ffff',
1269
+ };
1270
+ const DM_TABLE_EDIT_COLUMNS_VISIBILITY_BUTTON = {
1271
+ icon: 'view_column',
1272
+ buttonType: 'icon',
1273
+ tooltip: 'ערוך תצוגה',
1274
+ color: '#6a6a6a',
1275
+ };
1276
+
1277
+ const buildRow = (item, columns) => {
1278
+ const result = { ...item };
1279
+ const setValue = (field, value) => {
1280
+ Object.defineProperty(result, field, {
1281
+ value: value,
1282
+ writable: false,
1283
+ enumerable: true,
1284
+ });
1285
+ };
1286
+ for (const col of columns) {
1287
+ if (col.type === '$index')
1288
+ continue;
1289
+ if (col.type == 'component')
1290
+ continue;
1291
+ if (!col.field)
1292
+ continue;
1293
+ let value = result[col.field];
1294
+ // handle valueGetter
1295
+ if (col.valueGetter) {
1296
+ value = col.valueGetter(result);
1297
+ }
1298
+ else {
1299
+ switch (col.type) {
1300
+ case 'date':
1301
+ if (col.dateFormat) {
1302
+ value = DmDateService.getDateString(value, col.dateFormat);
1303
+ }
1304
+ else {
1305
+ value = DmDateService.getDateString(value);
1306
+ }
1307
+ break;
1308
+ }
1309
+ }
1310
+ setValue(col.field, value);
1311
+ }
1312
+ return result;
1313
+ };
1314
+ function isPlainObject(value) {
1315
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
1316
+ }
1317
+ function deepMerge(defaults, custom) {
1318
+ if (!isPlainObject(defaults)) {
1319
+ return custom ?? defaults;
1320
+ }
1321
+ const result = { ...defaults };
1322
+ if (!custom) {
1323
+ return result;
1324
+ }
1325
+ for (const key of Object.keys(custom)) {
1326
+ const customValue = custom[key];
1327
+ const defaultValue = defaults[key];
1328
+ if (isPlainObject(defaultValue) && isPlainObject(customValue)) {
1329
+ result[key] = deepMerge(defaultValue, customValue);
1330
+ }
1331
+ else if (customValue !== undefined) {
1332
+ // custom wins on leaf
1333
+ result[key] = customValue;
1334
+ }
1335
+ }
1336
+ return result;
1337
+ }
1338
+
1339
+ class DmTableColumnStateStorage {
1340
+ prefix = 'dm-table:columns';
1341
+ load(tableId) {
1342
+ const raw = localStorage.getItem(`${this.prefix}:${tableId}`);
1343
+ return raw ? JSON.parse(raw) : null;
1344
+ }
1345
+ save(tableId, state) {
1346
+ localStorage.setItem(`${this.prefix}:${tableId}`, JSON.stringify(state));
1347
+ }
1348
+ clear(tableId) {
1349
+ localStorage.removeItem(`${this.prefix}:${tableId}`);
1350
+ }
1351
+ }
1352
+
1353
+ class DmImportantStyleDirective {
1354
+ el;
1355
+ styles;
1356
+ constructor(el) {
1357
+ this.el = el;
1358
+ }
1359
+ ngOnChanges() {
1360
+ if (!this.styles)
1361
+ return;
1362
+ // reset styles
1363
+ this.el.nativeElement.style.cssText = '';
1364
+ Object.entries(this.styles).forEach(([key, value]) => {
1365
+ this.el.nativeElement.style.setProperty(key, value, 'important');
1366
+ });
1367
+ }
1368
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmImportantStyleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1369
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: DmImportantStyleDirective, isStandalone: true, selector: "[dmImportantStyle]", inputs: { styles: ["dmImportantStyle", "styles"] }, usesOnChanges: true, ngImport: i0 });
1370
+ }
1371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmImportantStyleDirective, decorators: [{
1372
+ type: Directive,
1373
+ args: [{
1374
+ selector: '[dmImportantStyle]',
1375
+ standalone: true,
1376
+ }]
1377
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { styles: [{
1378
+ type: Input,
1379
+ args: ['dmImportantStyle']
1380
+ }] } });
1381
+
1382
+ class DmTable {
1383
+ shiftKeyPressed = signal(false, ...(ngDevMode ? [{ debugName: "shiftKeyPressed" }] : []));
1384
+ onShiftKeyDown(event) {
1385
+ this.shiftKeyPressed.set(true);
1386
+ }
1387
+ onShiftKeyUp(event) {
1388
+ this.shiftKeyPressed.set(false);
1389
+ }
1390
+ DEFAULT_PAGINATOR_SETTINGS = DEFAULT_PAGINATOR_SETTINGS;
1391
+ DEFAULT_TABLE_STYLE = DEFAULT_TABLE_STYLE;
1392
+ tableId = input(...(ngDevMode ? [undefined, { debugName: "tableId" }] : []));
1393
+ dataSource = input([], ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
1394
+ columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
1395
+ noDataMessage = input('אין נתונים להצגה', ...(ngDevMode ? [{ debugName: "noDataMessage" }] : []));
1396
+ enableSearch = input(false, { ...(ngDevMode ? { debugName: "enableSearch" } : {}), transform: booleanAttribute });
1397
+ searchPlaceholder = input('חיפוש...', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
1398
+ clearSearchTooltip = input('נקה חיפוש', ...(ngDevMode ? [{ debugName: "clearSearchTooltip" }] : []));
1399
+ searchInputAppearance = input('fill', ...(ngDevMode ? [{ debugName: "searchInputAppearance" }] : []));
1400
+ filterPredicate = input(null, ...(ngDevMode ? [{ debugName: "filterPredicate" }] : []));
1401
+ _filterPredicate = null;
1402
+ actionButtons = input([], ...(ngDevMode ? [{ debugName: "actionButtons" }] : []));
1403
+ enablePrint = input(false, { ...(ngDevMode ? { debugName: "enablePrint" } : {}), transform: booleanAttribute });
1404
+ printButton = input(DEFAULT_PRINT_TABLE_BUTTON, ...(ngDevMode ? [{ debugName: "printButton" }] : []));
1405
+ enablePagination = input(false, { ...(ngDevMode ? { debugName: "enablePagination" } : {}), transform: booleanAttribute });
1406
+ autoPaginationAboveRowsCount = input(100, { ...(ngDevMode ? { debugName: "autoPaginationAboveRowsCount" } : {}), transform: numberAttribute });
1407
+ paginatorSettings = input(DEFAULT_PAGINATOR_SETTINGS, ...(ngDevMode ? [{ debugName: "paginatorSettings" }] : []));
1408
+ enableLoadingOverlay = input(true, { ...(ngDevMode ? { debugName: "enableLoadingOverlay" } : {}), transform: booleanAttribute });
1409
+ enableColumnsDragAndDrop = input(false, { ...(ngDevMode ? { debugName: "enableColumnsDragAndDrop" } : {}), transform: booleanAttribute });
1410
+ enableColumnsDragHandle = input(true, { ...(ngDevMode ? { debugName: "enableColumnsDragHandle" } : {}), transform: booleanAttribute });
1411
+ enableTotalRow = input(false, { ...(ngDevMode ? { debugName: "enableTotalRow" } : {}), transform: booleanAttribute });
1412
+ tableStyle = input(DEFAULT_TABLE_STYLE, ...(ngDevMode ? [{ debugName: "tableStyle" }] : []));
1413
+ tableClasses = input(...(ngDevMode ? [undefined, { debugName: "tableClasses" }] : []));
1414
+ rowStyleFn = input(null, ...(ngDevMode ? [{ debugName: "rowStyleFn" }] : []));
1415
+ editColumnsVisibility = input(false, { ...(ngDevMode ? { debugName: "editColumnsVisibility" } : {}), transform: booleanAttribute });
1416
+ editColumnsVisibilityButton = input(DM_TABLE_EDIT_COLUMNS_VISIBILITY_BUTTON, ...(ngDevMode ? [{ debugName: "editColumnsVisibilityButton" }] : []));
1417
+ editColumnsVisibilitySelectAllLabel = input('הצג את כל העמודות', ...(ngDevMode ? [{ debugName: "editColumnsVisibilitySelectAllLabel" }] : []));
1418
+ columnsSortState = signal([], ...(ngDevMode ? [{ debugName: "columnsSortState" }] : []));
1419
+ mergedTableStyle = computed(() => {
1420
+ const defaults = { ...DEFAULT_TABLE_STYLE };
1421
+ const custom = this.tableStyle() || {};
1422
+ const newStyle = deepMerge(defaults, custom);
1423
+ return newStyle;
1424
+ }, ...(ngDevMode ? [{ debugName: "mergedTableStyle" }] : []));
1425
+ hoveredRowIndex = signal(null, ...(ngDevMode ? [{ debugName: "hoveredRowIndex" }] : []));
1426
+ datasource = signal(new DmCmpsDataSource([]), ...(ngDevMode ? [{ debugName: "datasource" }] : []));
1427
+ runtimeColumns = computed(() => {
1428
+ const cols = this.columns() ?? [];
1429
+ const normalized = this.normalizeColumns(cols);
1430
+ return this.reconcileColumns(normalized);
1431
+ }, ...(ngDevMode ? [{ debugName: "runtimeColumns" }] : []));
1432
+ hoveredColumnHeaderIndex = signal(null, ...(ngDevMode ? [{ debugName: "hoveredColumnHeaderIndex" }] : []));
1433
+ columnStateStorage = new DmTableColumnStateStorage();
1434
+ columnState = signal(null, ...(ngDevMode ? [{ debugName: "columnState" }] : []));
1435
+ visibleRuntimeColumns = computed(() => {
1436
+ const cols = this.runtimeColumns();
1437
+ const state = this.columnState();
1438
+ if (!state || !state.length) {
1439
+ return cols;
1440
+ }
1441
+ console.log('State changed => ', { state });
1442
+ const stateMap = new Map(state.map((s) => [s.id, s]));
1443
+ return cols
1444
+ .map((col, index) => ({
1445
+ col,
1446
+ state: stateMap.get(col.id) ?? {
1447
+ id: col.id,
1448
+ visible: true,
1449
+ order: index,
1450
+ },
1451
+ }))
1452
+ .filter((x) => x.state.visible !== false)
1453
+ .sort((a, b) => a.state.order - b.state.order)
1454
+ .map((x) => x.col);
1455
+ }, ...(ngDevMode ? [{ debugName: "visibleRuntimeColumns" }] : []));
1456
+ visibleColumns = computed(() => {
1457
+ return this.visibleRuntimeColumns().map((col) => col);
1458
+ }, ...(ngDevMode ? [{ debugName: "visibleColumns" }] : []));
1459
+ prevColumns = new Map();
1460
+ rowIdentifierField = input('_id', ...(ngDevMode ? [{ debugName: "rowIdentifierField" }] : []));
1461
+ modifiedRowsIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "modifiedRowsIds" }] : []));
1462
+ searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
1463
+ totalRowValues = computed(() => {
1464
+ const ds = this.datasource();
1465
+ const cols = this.runtimeColumns();
1466
+ const dataVersion = ds.resultVersion(); //this is to make sure we recompute when data changes.. do not remove
1467
+ const map = new Map();
1468
+ for (const col of cols) {
1469
+ if (!col.totalRowValueGetter)
1470
+ continue;
1471
+ try {
1472
+ map.set(col.id, col.totalRowValueGetter(ds));
1473
+ }
1474
+ catch (e) {
1475
+ console.error(`Total row error for column ${col.id}`, e);
1476
+ map.set(col.id, null);
1477
+ }
1478
+ }
1479
+ return map;
1480
+ }, ...(ngDevMode ? [{ debugName: "totalRowValues" }] : []));
1481
+ totalRowStyles = computed(() => {
1482
+ const ds = this.datasource();
1483
+ const cols = this.runtimeColumns();
1484
+ const dataVersion = ds.resultVersion(); //this is to make sure we recompute when data changes.. do not remove
1485
+ const map = new Map();
1486
+ for (const col of cols) {
1487
+ if (!col.totalCellStyle)
1488
+ continue;
1489
+ const totalCellStyle = (typeof col.totalCellStyle === 'function' ? col.totalCellStyle(ds) : col.totalCellStyle) ||
1490
+ {};
1491
+ try {
1492
+ map.set(col.id, totalCellStyle);
1493
+ }
1494
+ catch (e) {
1495
+ console.error(`Total row style error for column ${col.id}`, e);
1496
+ map.set(col.id, {});
1497
+ }
1498
+ }
1499
+ return map;
1500
+ }, ...(ngDevMode ? [{ debugName: "totalRowStyles" }] : []));
1501
+ constructor() {
1502
+ this.runEffects();
1503
+ }
1504
+ runEffects() {
1505
+ effect(() => {
1506
+ const tableStyle = this.mergedTableStyle();
1507
+ document.documentElement.style.setProperty(DM_TABLE_HEADER_BACKGROUND_COLOR_CSS_VAR, this.mergedTableStyle().table?.thead?.root?.['background-color'] ??
1508
+ DM_TABLE_HEADER_BACKGROUND_COLOR_CSS_VAR);
1509
+ document.documentElement.style.setProperty(DM_TABLE_HEADER_COLOR_CSS_VAR, this.mergedTableStyle().table?.thead?.root?.['color'] ?? DM_TABLE_HEADER_COLOR_CSS_VAR);
1510
+ });
1511
+ effect(() => {
1512
+ const tableId = this.tableId();
1513
+ const cols = this.runtimeColumns();
1514
+ let stored = null;
1515
+ if (tableId) {
1516
+ stored = this.columnStateStorage.load(tableId);
1517
+ }
1518
+ // sanitize stored state to remove any columns that no longer exist
1519
+ if (stored) {
1520
+ const colIds = new Set(cols.map((c) => c.id));
1521
+ stored = stored.filter((s) => colIds.has(s.id));
1522
+ console.log('Stored columns sanitized!!!');
1523
+ }
1524
+ this.columnState.set(this.initColumnState(cols, stored));
1525
+ });
1526
+ effect(() => {
1527
+ const id = this.tableId();
1528
+ const state = this.columnState();
1529
+ if (!id || !state)
1530
+ return;
1531
+ this.columnStateStorage.save(id, state);
1532
+ });
1533
+ effect(() => {
1534
+ this._filterPredicate = this.filterPredicate();
1535
+ });
1536
+ effect(() => {
1537
+ const dataSource = this.dataSource();
1538
+ if (this._filterPredicate) {
1539
+ this.datasource().setFilterPredicate(this._filterPredicate);
1540
+ }
1541
+ if (this.enablePagination() || dataSource.length >= this.autoPaginationAboveRowsCount()) {
1542
+ this.datasource().applyPagination(this.paginatorSettings()?.pageSize || DEFAULT_PAGINATOR_SETTINGS.pageSize);
1543
+ }
1544
+ else {
1545
+ this.datasource().disablePagination();
1546
+ }
1547
+ this.datasource().setDatasource(dataSource);
1548
+ this.prevColumns.forEach((col) => delete col.__cache);
1549
+ console.log('data initialized => ', dataSource.length);
1550
+ });
1551
+ effect(() => {
1552
+ const cols = this.runtimeColumns();
1553
+ this.setFilterPredicate();
1554
+ });
1555
+ effect(() => {
1556
+ const sortState = this.columnsSortState();
1557
+ console.log({ sortState });
1558
+ if (!sortState || !sortState.length) {
1559
+ this.datasource().resetSorting();
1560
+ }
1561
+ else {
1562
+ this.datasource().sortByFields(sortState);
1563
+ }
1564
+ });
1565
+ }
1566
+ initColumnState(columns, stored) {
1567
+ // 1. If user has saved state → use it
1568
+ if (stored && stored.length) {
1569
+ return stored;
1570
+ }
1571
+ // 2. Otherwise derive defaults from columns
1572
+ return columns.map((col, index) => ({
1573
+ id: col.id,
1574
+ visible: col.visible ?? true,
1575
+ // width: col.width,
1576
+ order: index,
1577
+ }));
1578
+ }
1579
+ normalizeColumns(cols) {
1580
+ return cols.map((col, index) => ({
1581
+ ...col,
1582
+ id: col.id || `dm_table_col_${col.field ?? col.type}__${index}`,
1583
+ }));
1584
+ }
1585
+ isSameColumnDefinition(a, b) {
1586
+ return (a.field === b.field &&
1587
+ a.type === b.type &&
1588
+ a.valueGetter === b.valueGetter &&
1589
+ a.valueSetter === b.valueSetter &&
1590
+ a.dateFormat === b.dateFormat &&
1591
+ a.component === b.component);
1592
+ }
1593
+ // private diffColumns(prev: Map<string, DmTableRuntimeColumn<T>>, next: DmTableRuntimeColumn<T>[]) {
1594
+ // const added: DmTableRuntimeColumn<T>[] = [];
1595
+ // const removed: string[] = [];
1596
+ // const changed: DmTableRuntimeColumn<T>[] = [];
1597
+ // const nextMap = new Map(next.map((col) => [col.id, col]));
1598
+ // for (const [id, prevCol] of prev) {
1599
+ // const nextCol = nextMap.get(id);
1600
+ // if (!nextCol) {
1601
+ // removed.push(id);
1602
+ // } else {
1603
+ // if (!this.isSameColumnDefinition(prevCol, nextCol)) {
1604
+ // changed.push(nextCol);
1605
+ // }
1606
+ // }
1607
+ // }
1608
+ // for (const [id, nextCol] of nextMap) {
1609
+ // if (!prev.has(id)) {
1610
+ // added.push(nextCol);
1611
+ // }
1612
+ // }
1613
+ // return { added, removed, changed };
1614
+ // }
1615
+ reconcileColumns(next) {
1616
+ const result = [];
1617
+ for (const col of next) {
1618
+ const prevCol = this.prevColumns.get(col.id);
1619
+ if (prevCol && this.isSameColumnDefinition(prevCol, col)) {
1620
+ result.push(prevCol);
1621
+ }
1622
+ else {
1623
+ result.push(col);
1624
+ }
1625
+ }
1626
+ this.prevColumns = new Map(result.map((c) => [c.id, c]));
1627
+ return result;
1628
+ }
1629
+ setFilterPredicate() {
1630
+ if (this._filterPredicate)
1631
+ return;
1632
+ this.datasource().setFilterPredicate((row, filter) => {
1633
+ const filterLower = filter.toLowerCase();
1634
+ for (const col of this.runtimeColumns()) {
1635
+ const cellValue = this.resolveCellValue(row, col);
1636
+ if (cellValue != null && cellValue.toString().toLowerCase().includes(filterLower)) {
1637
+ return true;
1638
+ }
1639
+ }
1640
+ return false;
1641
+ });
1642
+ }
1643
+ createCellContext = (row, column) => ({
1644
+ $implicit: row,
1645
+ row,
1646
+ column: column,
1647
+ });
1648
+ resolveCellValue(row, column) {
1649
+ if (column.type === '$index') {
1650
+ return null;
1651
+ }
1652
+ if (!shouldCacheColumn(column)) {
1653
+ return row[column.field];
1654
+ }
1655
+ if (!column.__cache) {
1656
+ column.__cache = new WeakMap();
1657
+ }
1658
+ const cached = column.__cache.get(row);
1659
+ if (cached !== undefined) {
1660
+ return cached;
1661
+ }
1662
+ let value;
1663
+ if (column.valueGetter) {
1664
+ value = column.valueGetter(row);
1665
+ }
1666
+ else {
1667
+ if (column.type === 'date') {
1668
+ if (column.dateFormat) {
1669
+ value = DmDateService.getDateString(row[column.field], column.dateFormat);
1670
+ }
1671
+ else {
1672
+ value = DmDateService.getDateString(row[column.field]);
1673
+ }
1674
+ }
1675
+ else {
1676
+ value = row[column.field];
1677
+ }
1678
+ }
1679
+ column.__cache.set(row, value);
1680
+ return value;
1681
+ }
1682
+ applySearchFilter(event) {
1683
+ const input = event.target;
1684
+ const filterValue = input.value.trim().toLowerCase();
1685
+ this.datasource().search(filterValue);
1686
+ }
1687
+ resetSearch() {
1688
+ this.searchTerm.set('');
1689
+ this.datasource().search('');
1690
+ }
1691
+ printTable = () => {
1692
+ const resultData = this.datasource().getResultData();
1693
+ console.log('Print table triggered!!', resultData.length);
1694
+ };
1695
+ onPageSizeChange(event, option) {
1696
+ if (event.isUserInput) {
1697
+ this.datasource().setPageSize(option);
1698
+ }
1699
+ }
1700
+ getFooterTdStyle(column) {
1701
+ const totalCellStyle = this.totalRowStyles().get(column.id) || {};
1702
+ const generalStyle = this.mergedTableStyle().table?.tfoot?.td || DEFAULT_TABLE_STYLE.table?.tfoot?.td || {};
1703
+ return {
1704
+ ...generalStyle,
1705
+ ...totalCellStyle,
1706
+ };
1707
+ }
1708
+ getHeaderThStyle(column) {
1709
+ const headerStyle = typeof column.headerStyle === 'function'
1710
+ ? column.headerStyle(this.datasource())
1711
+ : column.headerStyle || {};
1712
+ const generalStyle = this.mergedTableStyle().table?.thead?.th || DEFAULT_TABLE_STYLE.table?.thead?.th || {};
1713
+ return {
1714
+ ...generalStyle,
1715
+ ...headerStyle,
1716
+ };
1717
+ }
1718
+ getHeaderThContentStyle(column) {
1719
+ const headerContentStyle = typeof column.headerContentStyle === 'function'
1720
+ ? column.headerContentStyle(this.datasource())
1721
+ : column.headerContentStyle || {};
1722
+ return {
1723
+ ...headerContentStyle,
1724
+ };
1725
+ }
1726
+ getBodyTdStyle(i, column, row) {
1727
+ const baseStyle = i % 2 === 0
1728
+ ? this.mergedTableStyle().table?.tbody?.even_row_style?.td ?? {}
1729
+ : this.mergedTableStyle().table?.tbody?.odd_row_style?.td ?? {};
1730
+ const rowHoverStyle = this.hoveredRowIndex() === i
1731
+ ? this.mergedTableStyle().table?.tbody?.hovered_row_style?.tr ?? {}
1732
+ : {};
1733
+ const tdHoverStyle = this.hoveredRowIndex() === i
1734
+ ? this.mergedTableStyle().table?.tbody?.hovered_row_style?.td ?? {}
1735
+ : {};
1736
+ const generalCellStyle = this.mergedTableStyle().table?.tbody?.td ?? {};
1737
+ const columnCellStyle = typeof column.cellStyle === 'function' ? column.cellStyle(row) : column.cellStyle || {};
1738
+ return {
1739
+ ...generalCellStyle,
1740
+ ...baseStyle,
1741
+ ...columnCellStyle,
1742
+ ...rowHoverStyle,
1743
+ ...tdHoverStyle,
1744
+ };
1745
+ }
1746
+ getBodyTdContentStyle(i, column, row) {
1747
+ const columnCellContentStyle = typeof column.cellContentStyle === 'function'
1748
+ ? column.cellContentStyle(row)
1749
+ : column.cellContentStyle || {};
1750
+ return {
1751
+ ...columnCellContentStyle,
1752
+ };
1753
+ }
1754
+ getBodyRowStyle(i, row) {
1755
+ const baseStyle = i % 2 === 0
1756
+ ? this.mergedTableStyle().table?.tbody?.even_row_style?.tr ?? {}
1757
+ : this.mergedTableStyle().table?.tbody?.odd_row_style?.tr ?? {};
1758
+ const hoverStyle = this.hoveredRowIndex() === i
1759
+ ? this.mergedTableStyle().table?.tbody?.hovered_row_style?.tr ?? {}
1760
+ : {};
1761
+ const generalRowStyle = this.mergedTableStyle().table?.tbody?.tr ?? {};
1762
+ const rowStyleFn = this.rowStyleFn();
1763
+ const rowStyleFromFn = rowStyleFn ? rowStyleFn(row) : {};
1764
+ return {
1765
+ ...generalRowStyle,
1766
+ ...baseStyle,
1767
+ ...rowStyleFromFn,
1768
+ ...hoverStyle,
1769
+ };
1770
+ }
1771
+ getInputStyle(column) {
1772
+ const inputStyle = this.mergedTableStyle().table?.tbody?.input || {};
1773
+ const colInputStyle = typeof column.inputStyle === 'function'
1774
+ ? column.inputStyle(null)
1775
+ : column.inputStyle || {};
1776
+ return {
1777
+ ...inputStyle,
1778
+ ...colInputStyle,
1779
+ };
1780
+ }
1781
+ headerClickHandler(column, event) {
1782
+ const onHeaderClick = column.onHeaderClick;
1783
+ if (onHeaderClick && typeof onHeaderClick === 'function') {
1784
+ onHeaderClick(this.datasource(), event);
1785
+ }
1786
+ else {
1787
+ this.columnHeaderSortClickHandler(column, event);
1788
+ }
1789
+ }
1790
+ headerDoubleClickHandler(column, event) {
1791
+ const onHeaderDoubleClick = column.onHeaderDoubleClick;
1792
+ if (onHeaderDoubleClick && typeof onHeaderDoubleClick === 'function') {
1793
+ onHeaderDoubleClick(this.datasource(), event);
1794
+ }
1795
+ }
1796
+ headerContextMenuHandler(column, event) {
1797
+ const headerContextMenu = column.headerContextMenu;
1798
+ if (headerContextMenu && typeof headerContextMenu === 'function') {
1799
+ headerContextMenu(this.datasource(), event);
1800
+ }
1801
+ }
1802
+ headerContentClickHandler(column, event) {
1803
+ const onHeaderContentClick = column.onHeaderContentClick;
1804
+ if (onHeaderContentClick && typeof onHeaderContentClick === 'function') {
1805
+ onHeaderContentClick(this.datasource(), event);
1806
+ }
1807
+ else {
1808
+ if (column.onHeaderClick && typeof column.onHeaderClick === 'function') {
1809
+ return;
1810
+ }
1811
+ this.columnHeaderSortClickHandler(column, event);
1812
+ }
1813
+ }
1814
+ headerContentDoubleClickHandler(column, event) {
1815
+ const onHeaderContentDoubleClick = column.onHeaderContentDoubleClick;
1816
+ if (onHeaderContentDoubleClick && typeof onHeaderContentDoubleClick === 'function') {
1817
+ onHeaderContentDoubleClick(this.datasource(), event);
1818
+ }
1819
+ }
1820
+ headerContentContextMenuHandler(column, event) {
1821
+ const headerContentContextMenu = column.headerContentContextMenu;
1822
+ if (headerContentContextMenu && typeof headerContentContextMenu === 'function') {
1823
+ headerContentContextMenu(this.datasource(), event);
1824
+ }
1825
+ }
1826
+ cellClickHandler(row, column, event) {
1827
+ const onCellClick = column.onCellClick;
1828
+ if (onCellClick && typeof onCellClick === 'function') {
1829
+ onCellClick(row, event);
1830
+ }
1831
+ }
1832
+ cellDoubleClickHandler(row, column, event) {
1833
+ const onCellDoubleClick = column.onCellDoubleClick;
1834
+ if (onCellDoubleClick && typeof onCellDoubleClick === 'function') {
1835
+ onCellDoubleClick(row, event);
1836
+ }
1837
+ }
1838
+ cellContextMenuHandler(row, column, event) {
1839
+ const cellContextMenu = column.cellContextMenu;
1840
+ if (cellContextMenu && typeof cellContextMenu === 'function') {
1841
+ cellContextMenu(row, event);
1842
+ }
1843
+ }
1844
+ cellContentClickHandler(row, column, event) {
1845
+ const onCellContentClick = column.onCellContentClick;
1846
+ if (onCellContentClick && typeof onCellContentClick === 'function') {
1847
+ onCellContentClick(row, event);
1848
+ }
1849
+ }
1850
+ cellContentDoubleClickHandler(row, column, event) {
1851
+ const onCellContentDoubleClick = column.onCellContentDoubleClick;
1852
+ if (onCellContentDoubleClick && typeof onCellContentDoubleClick === 'function') {
1853
+ onCellContentDoubleClick(row, event);
1854
+ }
1855
+ }
1856
+ cellContentContextMenuHandler(row, column, event) {
1857
+ const cellContentContextMenu = column.cellContentContextMenu;
1858
+ if (cellContentContextMenu && typeof cellContentContextMenu === 'function') {
1859
+ cellContentContextMenu(row, event);
1860
+ }
1861
+ }
1862
+ getCloseParentMenusFn = (rootTrigger) => {
1863
+ return () => {
1864
+ rootTrigger.closeMenu();
1865
+ };
1866
+ };
1867
+ onColumnDrop(event) {
1868
+ const visible = [...event.container.data]; // copy!
1869
+ moveItemInArray(visible, event.previousIndex, event.currentIndex);
1870
+ const state = [...(this.columnState() ?? [])];
1871
+ const stateMap = new Map(state.map((s) => [s.id, s]));
1872
+ // Rewrite order based on the NEW visible order
1873
+ visible.forEach((col, index) => {
1874
+ const s = stateMap.get(col.id);
1875
+ if (s) {
1876
+ s.order = index;
1877
+ }
1878
+ });
1879
+ this.columnState.set(state);
1880
+ console.log({ state });
1881
+ }
1882
+ isAllColumnsVisible() {
1883
+ const state = this.columnState();
1884
+ if (!state)
1885
+ return true;
1886
+ return state.every((s) => s.visible !== false);
1887
+ }
1888
+ toggleAllColumnsVisibility(event) {
1889
+ const state = [...(this.columnState() ?? [])];
1890
+ if (!state)
1891
+ return;
1892
+ state.forEach((s) => {
1893
+ s.visible = event.checked;
1894
+ });
1895
+ this.columnState.set(state);
1896
+ console.log({ state });
1897
+ }
1898
+ isColumnVisible(column) {
1899
+ const state = this.columnState();
1900
+ if (!state)
1901
+ return true;
1902
+ const colState = state.find((s) => s.id === column.id);
1903
+ if (!colState)
1904
+ return true;
1905
+ return colState.visible !== false;
1906
+ }
1907
+ toggleColumnVisibility(event, column) {
1908
+ const state = [...(this.columnState() ?? [])];
1909
+ if (!state)
1910
+ return;
1911
+ const colState = state.find((s) => s.id === column.id);
1912
+ if (!colState) {
1913
+ console.log('Column state not found for column:', column);
1914
+ const cols = this.runtimeColumns();
1915
+ this.columnState.set(this.initColumnState(cols, null));
1916
+ return;
1917
+ }
1918
+ colState.visible = event.checked;
1919
+ this.columnState.set(state);
1920
+ }
1921
+ isColumnSorted(column) {
1922
+ const sortState = this.columnsSortState();
1923
+ let matchedIndex = -1;
1924
+ const sort = sortState.find((s, index) => {
1925
+ const match = s.id === column.id;
1926
+ if (match) {
1927
+ matchedIndex = index;
1928
+ }
1929
+ return match;
1930
+ });
1931
+ return sort ? { ...sort, index: matchedIndex } : null;
1932
+ }
1933
+ columnHeaderSortClickHandler(column, event) {
1934
+ if (!column.sortable)
1935
+ return;
1936
+ event.stopPropagation();
1937
+ event.preventDefault();
1938
+ console.log('Column header clicked!! => ', { column });
1939
+ let sortState = [...this.columnsSortState()];
1940
+ const existingSortIndex = sortState.findIndex((s) => s.id === column.id);
1941
+ if (existingSortIndex >= 0) {
1942
+ if (this.shiftKeyPressed()) {
1943
+ if (sortState[existingSortIndex].direction === 'asc') {
1944
+ const newSort = {
1945
+ ...sortState[existingSortIndex],
1946
+ direction: 'desc',
1947
+ };
1948
+ sortState[existingSortIndex] = newSort;
1949
+ }
1950
+ else {
1951
+ const newSort = {
1952
+ ...sortState[existingSortIndex],
1953
+ direction: 'asc',
1954
+ };
1955
+ sortState[existingSortIndex] = newSort;
1956
+ }
1957
+ }
1958
+ else {
1959
+ if (sortState[existingSortIndex].direction === 'asc') {
1960
+ const newSort = {
1961
+ ...sortState[existingSortIndex],
1962
+ direction: 'desc',
1963
+ };
1964
+ sortState[existingSortIndex] = newSort;
1965
+ }
1966
+ else {
1967
+ sortState.splice(existingSortIndex, 1);
1968
+ }
1969
+ }
1970
+ }
1971
+ else {
1972
+ const sort = {
1973
+ id: column.id,
1974
+ field: column.field,
1975
+ direction: 'asc',
1976
+ };
1977
+ if (column.sortFn) {
1978
+ sort.sortFn = column.sortFn;
1979
+ }
1980
+ if (this.shiftKeyPressed()) {
1981
+ sortState.push(sort);
1982
+ }
1983
+ else {
1984
+ sortState = [sort];
1985
+ }
1986
+ }
1987
+ this.columnsSortState.set(sortState);
1988
+ }
1989
+ markRowAsModified(row) {
1990
+ console.log('Mark row as modified triggered!!!!!!!!!!!!!!');
1991
+ const identifierField = this.rowIdentifierField();
1992
+ const rowId = row[identifierField];
1993
+ if (rowId == null || rowId === '' || rowId === undefined)
1994
+ return;
1995
+ this.modifiedRowsIds.update((set) => {
1996
+ const next = new Set(set);
1997
+ next.add(rowId);
1998
+ return next;
1999
+ });
2000
+ }
2001
+ getModifiedRows() {
2002
+ const identifierField = this.rowIdentifierField();
2003
+ const modifiedIds = this.modifiedRowsIds();
2004
+ const allData = this.datasource().getDatasource();
2005
+ console.log({ allData });
2006
+ return allData.filter((row) => {
2007
+ const rowId = row[identifierField];
2008
+ return modifiedIds.has(rowId);
2009
+ });
2010
+ }
2011
+ inputCellSelectOptionChangeHandler(row, column, option, event) {
2012
+ if (!event.isUserInput)
2013
+ return;
2014
+ const valueSetter = column.valueSetter;
2015
+ const validator = column.inputValidator;
2016
+ if (validator && typeof validator === 'function') {
2017
+ const isValid = validator(row, option.value);
2018
+ if (!isValid) {
2019
+ const onFaild = column.onInputValidatorFailed;
2020
+ if (onFaild && typeof onFaild === 'function') {
2021
+ onFaild(row, option.value);
2022
+ }
2023
+ console.warn('Input value is not valid:', option.value);
2024
+ return;
2025
+ }
2026
+ }
2027
+ if (valueSetter && typeof valueSetter === 'function') {
2028
+ valueSetter(row, option.value);
2029
+ }
2030
+ else {
2031
+ row[column.field] = option.value;
2032
+ }
2033
+ this.markRowAsModified(row);
2034
+ }
2035
+ inputCellChangeHandler(row, column, event) {
2036
+ const input = event.target;
2037
+ const newValue = input.value;
2038
+ const valueSetter = column.valueSetter;
2039
+ const validator = column.inputValidator;
2040
+ if (validator && typeof validator === 'function') {
2041
+ const isValid = validator(row, newValue);
2042
+ if (!isValid) {
2043
+ const onFaild = column.onInputValidatorFailed;
2044
+ if (onFaild && typeof onFaild === 'function') {
2045
+ onFaild(row, newValue);
2046
+ }
2047
+ console.warn('Input value is not valid:', newValue);
2048
+ input.value = this.resolveCellValue(row, column) ?? '';
2049
+ return;
2050
+ }
2051
+ }
2052
+ if (valueSetter && typeof valueSetter === 'function') {
2053
+ valueSetter(row, newValue);
2054
+ }
2055
+ else {
2056
+ row[column.field] = newValue;
2057
+ }
2058
+ this.markRowAsModified(row);
2059
+ }
2060
+ inputCellCheckboxChangeHandler(row, column, event) {
2061
+ const newValue = event.checked;
2062
+ const valueSetter = column.valueSetter;
2063
+ const validator = column.inputValidator;
2064
+ if (validator && typeof validator === 'function') {
2065
+ const isValid = validator(row, newValue);
2066
+ if (!isValid) {
2067
+ const onFaild = column.onInputValidatorFailed;
2068
+ if (onFaild && typeof onFaild === 'function') {
2069
+ onFaild(row, newValue);
2070
+ }
2071
+ console.warn('Input value is not valid:', newValue);
2072
+ return;
2073
+ }
2074
+ }
2075
+ if (valueSetter && typeof valueSetter === 'function') {
2076
+ valueSetter(row, newValue);
2077
+ }
2078
+ else {
2079
+ row[column.field] = newValue;
2080
+ }
2081
+ this.markRowAsModified(row);
2082
+ }
2083
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
2084
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DmTable, isStandalone: true, selector: "dm-table", inputs: { tableId: { classPropertyName: "tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, noDataMessage: { classPropertyName: "noDataMessage", publicName: "noDataMessage", isSignal: true, isRequired: false, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, clearSearchTooltip: { classPropertyName: "clearSearchTooltip", publicName: "clearSearchTooltip", isSignal: true, isRequired: false, transformFunction: null }, searchInputAppearance: { classPropertyName: "searchInputAppearance", publicName: "searchInputAppearance", isSignal: true, isRequired: false, transformFunction: null }, filterPredicate: { classPropertyName: "filterPredicate", publicName: "filterPredicate", isSignal: true, isRequired: false, transformFunction: null }, actionButtons: { classPropertyName: "actionButtons", publicName: "actionButtons", isSignal: true, isRequired: false, transformFunction: null }, enablePrint: { classPropertyName: "enablePrint", publicName: "enablePrint", isSignal: true, isRequired: false, transformFunction: null }, printButton: { classPropertyName: "printButton", publicName: "printButton", isSignal: true, isRequired: false, transformFunction: null }, enablePagination: { classPropertyName: "enablePagination", publicName: "enablePagination", isSignal: true, isRequired: false, transformFunction: null }, autoPaginationAboveRowsCount: { classPropertyName: "autoPaginationAboveRowsCount", publicName: "autoPaginationAboveRowsCount", isSignal: true, isRequired: false, transformFunction: null }, paginatorSettings: { classPropertyName: "paginatorSettings", publicName: "paginatorSettings", isSignal: true, isRequired: false, transformFunction: null }, enableLoadingOverlay: { classPropertyName: "enableLoadingOverlay", publicName: "enableLoadingOverlay", isSignal: true, isRequired: false, transformFunction: null }, enableColumnsDragAndDrop: { classPropertyName: "enableColumnsDragAndDrop", publicName: "enableColumnsDragAndDrop", isSignal: true, isRequired: false, transformFunction: null }, enableColumnsDragHandle: { classPropertyName: "enableColumnsDragHandle", publicName: "enableColumnsDragHandle", isSignal: true, isRequired: false, transformFunction: null }, enableTotalRow: { classPropertyName: "enableTotalRow", publicName: "enableTotalRow", isSignal: true, isRequired: false, transformFunction: null }, tableStyle: { classPropertyName: "tableStyle", publicName: "tableStyle", isSignal: true, isRequired: false, transformFunction: null }, tableClasses: { classPropertyName: "tableClasses", publicName: "tableClasses", isSignal: true, isRequired: false, transformFunction: null }, rowStyleFn: { classPropertyName: "rowStyleFn", publicName: "rowStyleFn", isSignal: true, isRequired: false, transformFunction: null }, editColumnsVisibility: { classPropertyName: "editColumnsVisibility", publicName: "editColumnsVisibility", isSignal: true, isRequired: false, transformFunction: null }, editColumnsVisibilityButton: { classPropertyName: "editColumnsVisibilityButton", publicName: "editColumnsVisibilityButton", isSignal: true, isRequired: false, transformFunction: null }, editColumnsVisibilitySelectAllLabel: { classPropertyName: "editColumnsVisibilitySelectAllLabel", publicName: "editColumnsVisibilitySelectAllLabel", isSignal: true, isRequired: false, transformFunction: null }, rowIdentifierField: { classPropertyName: "rowIdentifierField", publicName: "rowIdentifierField", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:keydown.shift": "onShiftKeyDown($event)", "window:keyup.shift": "onShiftKeyUp($event)" } }, ngImport: i0, template: "<div id=\"dm-table-component-wrapper\">\n <div class=\"dm-table-top-section\">\n @if (enableSearch()) {\n <mat-form-field [appearance]=\"searchInputAppearance()\" class=\"dm-table-search-form-field\">\n <input\n matInput\n [placeholder]=\"searchPlaceholder()\"\n [(ngModel)]=\"searchTerm\"\n [ngModelOptions]=\"{ standalone: true }\"\n (keyup)=\"datasource().search($event.target.value)\"\n />\n @if (searchTerm()) {\n <button\n matSuffix\n mat-icon-button\n [matTooltip]=\"clearSearchTooltip()\"\n aria-label=\"Clear\"\n (click)=\"resetSearch()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @if (editColumnsVisibility() && editColumnsVisibilityButton()) {\n <ng-container\n *ngTemplateOutlet=\"\n editcolumnVisibilityMenuTrigger;\n context: { $implicit: editColumnsVisibilityButton() }\n \"\n ></ng-container>\n }\n <div class=\"spacer\"></div>\n @if (enablePrint()) {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableActionButton;\n context: { $implicit: printButton(), defaultAction: printTable }\n \"\n ></ng-container>\n } @for (button of actionButtons(); track $index) { @if (!button.showIf ||\n button.showIf(visibleColumns(), datasource())) {\n <ng-container\n *ngTemplateOutlet=\"dmTableActionButton; context: { $implicit: button }\"\n ></ng-container>\n } }\n </div>\n <div\n [ngClass]=\"tableClasses()?.tableWrapper || {}\"\n [dmImportantStyle]=\"mergedTableStyle().tableWrapper || DEFAULT_TABLE_STYLE.tableWrapper || {}\"\n cdkScrollable\n >\n <table\n [ngStyle]=\"\n !tableClasses()?.table?.root\n ? mergedTableStyle().table?.root || DEFAULT_TABLE_STYLE.table?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.root || {}\"\n >\n <thead\n style=\"\n position: sticky !important;\n top: 0 !important;\n z-index: 10 !important;\n box-shadow: 0px 2px 2px 0px #0000006e;\n \"\n [ngStyle]=\"\n !tableClasses()?.table?.thead?.root\n ? mergedTableStyle().table?.thead?.root || DEFAULT_TABLE_STYLE.table?.thead?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.thead?.root || {}\"\n >\n @if (enableLoadingOverlay()) {\n <tr style=\"height: 4px !important; max-height: 4px !important; line-height: 4px !important\">\n <th [attr.colspan]=\"visibleRuntimeColumns().length\" style=\"padding: 0 !important\">\n @if (datasource().isLoading()) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </th>\n </tr>\n }\n <tr\n [ngStyle]=\"\n !tableClasses()?.table?.thead?.tr\n ? mergedTableStyle().table?.thead?.tr || DEFAULT_TABLE_STYLE.table?.thead?.tr || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.thead?.tr || {}\"\n cdkDropList\n [cdkDropListData]=\"visibleRuntimeColumns()\"\n [cdkDropListOrientation]=\"'horizontal'\"\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n [cdkDropListAutoScrollStep]=\"20\"\n >\n @for (column of visibleRuntimeColumns(); let j = $index; track column.id) {\n <th\n cdkDrag\n [cdkDragDisabled]=\"!enableColumnsDragAndDrop()\"\n [ngStyle]=\"getHeaderThStyle(column)\"\n [ngClass]=\"tableClasses()?.table?.thead?.th || {}\"\n (mouseenter)=\"hoveredColumnHeaderIndex.set(j)\"\n (mouseleave)=\"hoveredColumnHeaderIndex.set(null)\"\n (click)=\"headerClickHandler(column, $event)\"\n (dblclick)=\"headerDoubleClickHandler(column, $event)\"\n (contextmenu)=\"headerContextMenuHandler(column, $event)\"\n >\n <div\n class=\"inner-header-cell\"\n [dmImportantStyle]=\"getHeaderThContentStyle(column)\"\n (click)=\"headerContentClickHandler(column, $event)\"\n (dblclick)=\"headerContentDoubleClickHandler(column, $event)\"\n (contextmenu)=\"headerContentContextMenuHandler(column, $event)\"\n >\n <span>\n {{ column.header }}\n </span>\n @if (column.sortable) {\n <span\n (click)=\"columnHeaderSortClickHandler(column, $event)\"\n style=\"display: flex; align-items: center\"\n >\n @if (isColumnSorted(column); as sort) {\n <mat-icon style=\"width: 20px; height: 20px; font-size: 20px\">{{\n sort.direction === 'asc' ? 'arrow_upward' : 'arrow_downward'\n }}</mat-icon>\n @if(columnsSortState().length > 1) { [{{ sort.index + 1 }}] } } @else if\n (hoveredColumnHeaderIndex() == j){\n <mat-icon style=\"opacity: 0.3; width: 20px; height: 20px; font-size: 20px\"\n >arrow_upward</mat-icon\n >\n }\n </span>\n } @if (enableColumnsDragHandle()) {\n\n <div class=\"spacer\"></div>\n <span>\n <ng-container\n *ngTemplateOutlet=\"dmTableHeaderMenuTrigger; context: { $implicit: column }\"\n />\n </span>\n <mat-icon style=\"cursor: move; font-size: 20px\" cdkDragHandle\n >drag_indicator</mat-icon\n >\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody\n [dmImportantStyle]=\"\n !tableClasses()?.table?.tbody?.root\n ? mergedTableStyle().table?.tbody?.root || DEFAULT_TABLE_STYLE.table?.tbody?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.tbody?.root || {}\"\n >\n @for (row of datasource().result(); let i = $index; track i) {\n <tr\n [dmImportantStyle]=\"getBodyRowStyle(i, row)\"\n (mouseenter)=\"hoveredRowIndex.set(i)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n >\n @for (column of visibleRuntimeColumns(); let j = $index; track j) {\n <td\n [dmImportantStyle]=\"getBodyTdStyle(i, column, row)\"\n (click)=\"cellClickHandler(row, column, $event)\"\n (contextmenu)=\"cellContextMenuHandler(row, column, $event)\"\n (dblclick)=\"cellDoubleClickHandler(row, column, $event)\"\n >\n <span\n [dmImportantStyle]=\"getBodyTdContentStyle(i, column, row)\"\n (click)=\"cellContentClickHandler(row, column, $event)\"\n (contextmenu)=\"cellContentContextMenuHandler(row, column, $event)\"\n (dblclick)=\"cellContentDoubleClickHandler(row, column, $event)\"\n >\n @switch (column.type) { @case ('$index') {\n {{ datasource().getFirstItemIndexInPage() + i + 1 }}\n } @case ('component') { @if (column.component) {\n <dm-table-cell-host\n [component]=\"column.component\"\n [context]=\"createCellContext(row, column)\"\n ></dm-table-cell-host>\n } } @case ('tel') {\n <a [href]=\"'tel:' + (column.field ? row[column.field] : '')\">{{\n resolveCellValue(row, column)\n }}</a>\n } @case ('mail') {\n <a [href]=\"'mailto:' + (column.field ? row[column.field] : '')\">{{\n resolveCellValue(row, column)\n }}</a>\n } @case ('link') {\n <a\n [href]=\"column.field ? row[column.field] : ''\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >{{ resolveCellValue(row, column) }}</a\n >\n } @case ('whatsapp') {\n <a\n [href]=\"'https://wa.me/' + (column.field ? row[column.field] : '')\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >{{ resolveCellValue(row, column) }}</a\n >\n } @case ('customHtml') { @if (column.customHtml) {\n <span [innerHTML]=\"column.customHtml\"></span>\n } @else if (column.customCellTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n column.customCellTemplate;\n context: createCellContext(row, column)\n \"\n >\n </ng-container>\n } } @case ('actions') {\n <span style=\"display: flex; align-items: center\">\n @for (button of column.actionsButtons || []; track $index) {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableRowActionButton;\n context: {\n $implicit: button,\n row\n }\n \"\n ></ng-container>\n }\n </span>\n } @case ('input') {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableInputCell;\n context: {\n $implicit: row,\n column: column\n }\n \"\n />\n } @default {\n {{ resolveCellValue(row, column) }}\n } }\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n @if (enableTotalRow()) {\n <tfoot\n style=\"\n position: sticky !important;\n bottom: 0 !important;\n z-index: 10 !important;\n box-shadow: 0px -2px 2px 0px #0000006e;\n \"\n [ngStyle]=\"\n !tableClasses()?.table?.tfoot?.root\n ? mergedTableStyle().table?.tfoot?.root || DEFAULT_TABLE_STYLE.table?.tfoot?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.tfoot?.root || {}\"\n >\n <tr>\n @for (column of visibleRuntimeColumns(); let j = $index; track column.id) {\n <td\n [ngStyle]=\"getFooterTdStyle(column)\"\n [ngClass]=\"tableClasses()?.table?.tfoot?.td || {}\"\n >\n @if (column.totalRowValueType == 'html') {\n <span [innerHTML]=\"totalRowValues().get(column.id) || ''\"></span>\n } @else {\n {{ totalRowValues().get(column.id) || '' }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n @if (datasource().result().length === 0) {\n <div class=\"dm-table-no-data\">\n <span>{{ noDataMessage() }}</span>\n </div>\n } @else { @if (datasource().isPaginationEnabled()) {\n <ng-container [ngTemplateOutlet]=\"paginator\" />\n } }\n</div>\n\n<!-- MARK: Action Button template -->\n<ng-template #dmTableActionButton let-button let-defaultAction=\"defaultAction\">\n @if (button.buttonType === 'icon') {\n <button\n #rootTrigger=\"matMenuTrigger\"\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? tableButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(visibleColumns(), datasource())\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n #rootTrigger=\"matMenuTrigger\"\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? tableButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(visibleColumns(), datasource())\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon class=\"button-icon\" [ngStyle]=\"{ color: button.color ? button.color : undefined }\">{{\n button.icon\n }}</mat-icon>\n }\n <span [ngStyle]=\"{ color: button.color ? button.color : undefined }\">\n {{ button.label }}\n </span>\n </button>\n }\n <!-- @if (button.buttonType === 'icon') {\n <button\n mat-icon-button\n [color]=\"button.color\"\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(datasource())\n : defaultAction\n ? defaultAction()\n : null\n \"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.color ? button.color : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(datasource())\n : defaultAction\n ? defaultAction()\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon\n class=\"button-icon\"\n [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\"\n >{{ button.icon }}</mat-icon\n >\n }\n <span [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\">\n {{ button.label }}\n </span>\n </button>\n } -->\n</ng-template>\n\n<!-- MARK: Action Button root menu -->\n<mat-menu #tableButtonRootMenu=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n tableButtonRecursiveMenu;\n context: { buttons: buttons, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- MARK: Action Button recursive menu -->\n<ng-template #tableButtonRecursiveMenu let-buttons=\"buttons\" let-rootTrigger=\"rootTrigger\">\n @for (button of buttons; track $index) { @if (!button.showIf || button.showIf(visibleColumns(),\n datasource())) { @if (button.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"subMenu\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"button.color ? button.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #subMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n tableButtonRecursiveMenu;\n context: { buttons: button.children, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </mat-menu>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"button.onClick?.(visibleColumns(), datasource(), $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n </button>\n }} }\n</ng-template>\n\n<!-- MARK: Row button root menu -->\n<mat-menu #rowButtonRootMenu=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-row=\"row\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n rowButtonRecursiveMenu;\n context: { buttons: buttons, row: row, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- MARK: Row button recursive menu -->\n<ng-template\n #rowButtonRecursiveMenu\n let-buttons=\"buttons\"\n let-row=\"row\"\n let-rootTrigger=\"rootTrigger\"\n>\n @for (button of buttons; track $index) { @if (button.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"subMenu\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"button.color ? button.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #subMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n rowButtonRecursiveMenu;\n context: { buttons: button.children, row: row, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </mat-menu>\n\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"button.onClick?.(row, $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n </button>\n } }\n</ng-template>\n\n<!-- MARK: Row Action Button template -->\n<ng-template #dmTableRowActionButton let-button let-row=\"row\" let-defaultAction=\"defaultAction\">\n @if (button.buttonType === 'icon') {\n <button\n #rootTrigger=\"matMenuTrigger\"\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? rowButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row)\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? rowButtonRootMenu : null\"\n #rootTrigger=\"matMenuTrigger\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row)\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon class=\"button-icon\" [ngStyle]=\"{ color: button.color ? button.color : undefined }\">{{\n button.icon\n }}</mat-icon>\n }\n <span [ngStyle]=\"{ color: button.color ? button.color : undefined }\">\n {{ button.label }}\n </span>\n </button>\n }\n</ng-template>\n\n<!-- <mat-menu #buttonChildren=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-row=\"row\">\n @for (button of buttons || []; track $index) { @if (button.children && button.children.length >\n 0) {\n <ng-container *ngTemplateOutlet=\"subMenuTrigger; context: { button, row }\"></ng-container>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row, $event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon>{{ button.icon }}</mat-icon>\n }\n <span>{{ button.label }}</span>\n </button>\n } }\n </ng-template>\n</mat-menu>\n\n<ng-template #subMenuTrigger let-button=\"button\" let-row=\"row\">\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"buttonChildren\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row\n }\"\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n >\n @if (button.icon) {\n <mat-icon>{{ button.icon }}</mat-icon>\n }\n <span>{{ button.label }}</span>\n </button>\n</ng-template> -->\n\n<!-- MARK: Paginator template -->\n<ng-template #paginator>\n <div\n class=\"dm-table-paginator-row\"\n [ngStyle]=\"mergedTableStyle().paginator?.root || {}\"\n [ngClass]=\"tableClasses()?.paginator?.root || {}\"\n >\n <p\n class=\"mb-0\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n >\n {{\n paginatorSettings()?.numberOfItemsPerPageLabel ||\n DEFAULT_PAGINATOR_SETTINGS.numberOfItemsPerPageLabel\n }}\n </p>\n\n <div>\n <mat-form-field\n style=\"width: 100px\"\n class=\"dm-paginator-form-field ms-2 me-2\"\n [appearance]=\"'fill'\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_form_field || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_form_field || {}\"\n >\n <mat-select\n [value]=\"datasource().getPageSize()\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_select || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_select || {}\"\n >\n @for (option of (paginatorSettings()?.pageSizeOptions ||\n DEFAULT_PAGINATOR_SETTINGS.pageSizeOptions); track option) {\n <mat-option\n [value]=\"option\"\n (onSelectionChange)=\"onPageSizeChange($event, option)\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_option || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_option || {}\"\n >{{ option }}</mat-option\n >\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n @if (datasource().getPageSize() > 0) {\n <div class=\"dm-table-paginator-page-info\">\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getFirstItemIndexInPage() + 1 }}\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n -\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getLastItemIndexInPage() + 1 }}\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n \u05DE\u05EA\u05D5\u05DA\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getTotalResultElementsCount() }}\n </p>\n </div>\n }\n\n <div>\n @if (paginatorSettings()?.showFirstAndLastPagesButtons ||\n DEFAULT_PAGINATOR_SETTINGS.showFirstAndLastPagesButtons) {\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().firstPage()\"\n [matTooltip]=\"\n paginatorSettings()?.firstPageButtonLabel ||\n DEFAULT_PAGINATOR_SETTINGS.firstPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>keyboard_double_arrow_right</mat-icon>\n </button>\n }\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().firstPage()\"\n [matTooltip]=\"\n paginatorSettings()?.previousPageButtonLabel ||\n DEFAULT_PAGINATOR_SETTINGS.previousPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().nextPage()\"\n [matTooltip]=\"\n paginatorSettings()?.nextPageButtonLabel || DEFAULT_PAGINATOR_SETTINGS.nextPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n @if (paginatorSettings()?.showFirstAndLastPagesButtons ||\n DEFAULT_PAGINATOR_SETTINGS.showFirstAndLastPagesButtons) {\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().lastPage()\"\n [matTooltip]=\"\n paginatorSettings()?.lastPageButtonLabel || DEFAULT_PAGINATOR_SETTINGS.lastPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>keyboard_double_arrow_left</mat-icon>\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- MARK: Edit Columns Visibility Menu Trigger -->\n<ng-template #editcolumnVisibilityMenuTrigger let-button>\n @if (button.buttonType == 'icon') {\n <button\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"columnVisibilityMenu\"\n #rootTrigger=\"matMenuTrigger\"\n >\n <mat-icon [style.color]=\"button.textColor ? button.textColor : undefined\">{{\n button.icon\n }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.color ? button.color : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"columnVisibilityMenu\"\n #rootTrigger=\"matMenuTrigger\"\n >\n @if (button.icon) {\n <mat-icon\n class=\"button-icon\"\n [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\"\n >{{ button.icon }}</mat-icon\n >\n }\n <span [style.color]=\"button.textColor ? button.textColor : undefined\">\n {{ button.label }}\n </span>\n </button>\n }\n</ng-template>\n\n<!-- MARK: Edit Columns Visibility Menu -->\n<mat-menu #columnVisibilityMenu=\"matMenu\">\n <div mat-menu-item disableRipple (click)=\"$event.stopPropagation()\">\n <mat-checkbox\n [checked]=\"isAllColumnsVisible()\"\n (change)=\"toggleAllColumnsVisibility($event)\"\n (click)=\"$event.stopPropagation()\"\n >{{ editColumnsVisibilitySelectAllLabel() }}</mat-checkbox\n >\n </div>\n @for (column of runtimeColumns(); track column.id) {\n <div mat-menu-item disableRipple (click)=\"$event.stopPropagation()\">\n <mat-checkbox\n [checked]=\"isColumnVisible(column)\"\n (change)=\"toggleColumnVisibility($event, column)\"\n (click)=\"$event.stopPropagation()\"\n >{{ column.header }}</mat-checkbox\n >\n </div>\n }\n</mat-menu>\n\n<!-- MARK: Input Cell Template -->\n<ng-template #dmTableInputCell let-row let-column=\"column\">\n @switch (column.inputType) { @case ('select') {\n <mat-select\n [dmImportantStyle]=\"getInputStyle(column)\"\n panelWidth=\"null\"\n [value]=\"resolveCellValue(row, column)\"\n >\n @for (option of column.selectOptions || []; track option.value) {\n <mat-option\n [value]=\"option.value\"\n (onSelectionChange)=\"inputCellSelectOptionChangeHandler(row, column, option, $event)\"\n >{{ option.label }}</mat-option\n >\n }\n </mat-select>\n } @case ('checkbox') {\n <mat-checkbox\n [checked]=\"resolveCellValue(row, column)\"\n (change)=\"inputCellCheckboxChangeHandler(row, column, $event)\"\n ></mat-checkbox>\n } @default {\n <input\n [type]=\"column.inputType || 'text'\"\n [value]=\"resolveCellValue(row, column)\"\n (input)=\"inputCellChangeHandler(row, column, $event)\"\n [dmImportantStyle]=\"getInputStyle(column)\"\n />\n } }\n</ng-template>\n\n<!-- MARK: Header Menu Trigger Template -->\n<ng-template #dmTableHeaderMenuTrigger let-column>\n @if (column?.headerMenuItems?.length) {\n <!-- <button\n mat-icon-button\n (click)=\"$event.stopPropagation()\"\n aria-label=\"Column Menu\"\n >\n </button> -->\n <mat-icon\n #rootTrigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"dmTableHeaderRootMenu\"\n [matMenuTriggerData]=\"{\n menuItems: column.headerMenuItems,\n rootTrigger: rootTrigger\n }\"\n [matTooltip]=\"column.headerMenuTooltip || ''\"\n style=\"font-size: 20px; cursor: pointer; margin-left: 4px; height: 20px\"\n [ngStyle]=\"{\n color: getHeaderThContentStyle(column)?.color || getHeaderThStyle(column)?.color || ''\n }\"\n >menu</mat-icon\n >\n }\n</ng-template>\n\n<mat-menu #dmTableHeaderRootMenu=\"matMenu\">\n <ng-template matMenuContent let-menuItems=\"menuItems\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n dmTableHeaderRecursiveMenu;\n context: { menuItems: menuItems, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<ng-template #dmTableHeaderRecursiveMenu let-menuItems=\"menuItems\" let-rootTrigger=\"rootTrigger\">\n @for (menuItem of menuItems; track $index) { @if (!menuItem.showIf || (menuItem.showIf &&\n menuItem.showIf(datasource()))) {@if (menuItem.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"dmTableHeaderSubMenu\"\n [matMenuTriggerData]=\"{\n menuItems: menuItem.children,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{\n 'background-color': menuItem.backgroundColor ? menuItem.backgroundColor : undefined\n }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (menuItem.icon) {\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{\n menuItem.icon\n }}</mat-icon>\n }\n <span [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{ menuItem.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #dmTableHeaderSubMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n dmTableHeaderRecursiveMenu;\n context: { menuItems: menuItem.children, rootTrigger: rootTrigger }\n \"\n />\n </mat-menu>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"menuItem.tooltip || ''\"\n (click)=\"menuItem.onClick?.(datasource(), $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{\n 'background-color': menuItem.backgroundColor ? menuItem.backgroundColor : undefined\n }\"\n >\n @if (menuItem.icon) {\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{\n menuItem.icon\n }}</mat-icon>\n }\n <span [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{ menuItem.label }}</span>\n </button>\n } }}\n</ng-template>\n", styles: ["#dm-table-component-wrapper{width:100%}#dm-table-component-wrapper ::-webkit-scrollbar{width:var(--dm-cmps-table-scrollbar-width, 7px);height:var(--dm-cmps-table-scrollbar-width, 7px)}#dm-table-component-wrapper ::-webkit-scrollbar-track{background:var(--dm-cmps-table-scrollbar-background-color, #e0e0e0)}#dm-table-component-wrapper ::-webkit-scrollbar-thumb{background:var(--dm-cmps-table-scrollbar-color, #949496);border-radius:6px}#dm-table-component-wrapper ::-webkit-scrollbar-thumb:hover{background:var(--dm-cmps-table-scrollbar-hover-color, #5f5f5f)}#dm-table-component-wrapper .dm-table-top-section{width:calc(100% - 10px);display:flex;align-items:center;padding:0 5px;gap:5px;flex-wrap:wrap}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic{width:100%;border-collapse:collapse;border-spacing:0;box-shadow:0 5px 5px -3px #003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;padding:0;font-size:1rem;border-radius:8px;page-break-inside:auto}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic tr{page-break-inside:avoid}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic th,#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic td{text-align:start;max-width:none}#dm-table-component-wrapper .inner-header-cell{display:flex;align-items:center;gap:5px}#dm-table-component-wrapper .dm-table-no-data{width:98%;margin:10px auto 0;line-height:60px;display:flex;justify-content:center;align-items:center;padding:10px;font-size:1.5rem;font-weight:700;color:#dd2f2f;box-shadow:0 4px 6px #000000d7}#dm-table-component-wrapper .dm-table-paginator-row{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px}#dm-table-component-wrapper .dm-table-paginator-row .dm-table-paginator-page-info{display:flex;align-items:center;gap:5px}:host ::ng-deep .dm-paginator-form-field>.mat-mdc-form-field-bottom-align:before{content:\"\";display:none;height:0px}:host ::ng-deep .dm-table-search-form-field>.mat-mdc-form-field-bottom-align:before{content:\"\";display:none;height:0px}.cdk-drag-preview{border:none;box-sizing:border-box;background-color:var(--dm-table-header-background-color, #f5f5f5);color:var(--dm-table-header-color, #000000);border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview .inner-header-cell{display:flex;align-items:center}.spacer{flex-grow:1}\n"], dependencies: [{ kind: "directive", type: DmImportantStyleDirective, selector: "[dmImportantStyle]", inputs: ["dmImportantStyle"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "directive", type: i5$1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: DmTableCellHost, selector: "dm-table-cell-host", inputs: ["component", "context"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i9.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i9.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }] });
2085
+ }
2086
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DmTable, decorators: [{
2087
+ type: Component,
2088
+ args: [{ selector: 'dm-table', imports: [
2089
+ DmImportantStyleDirective,
2090
+ MatProgressSpinnerModule,
2091
+ MatProgressBarModule,
2092
+ ReactiveFormsModule,
2093
+ MatFormFieldModule,
2094
+ MatCheckboxModule,
2095
+ MatSelectModule,
2096
+ DmTableCellHost,
2097
+ MatButtonModule,
2098
+ MatInputModule,
2099
+ MatMenuModule,
2100
+ CdkDragHandle,
2101
+ CommonModule,
2102
+ FormsModule,
2103
+ CdkDropList,
2104
+ A11yModule,
2105
+ MatTooltip,
2106
+ MatIcon,
2107
+ CdkDrag,
2108
+ ], template: "<div id=\"dm-table-component-wrapper\">\n <div class=\"dm-table-top-section\">\n @if (enableSearch()) {\n <mat-form-field [appearance]=\"searchInputAppearance()\" class=\"dm-table-search-form-field\">\n <input\n matInput\n [placeholder]=\"searchPlaceholder()\"\n [(ngModel)]=\"searchTerm\"\n [ngModelOptions]=\"{ standalone: true }\"\n (keyup)=\"datasource().search($event.target.value)\"\n />\n @if (searchTerm()) {\n <button\n matSuffix\n mat-icon-button\n [matTooltip]=\"clearSearchTooltip()\"\n aria-label=\"Clear\"\n (click)=\"resetSearch()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n } @if (editColumnsVisibility() && editColumnsVisibilityButton()) {\n <ng-container\n *ngTemplateOutlet=\"\n editcolumnVisibilityMenuTrigger;\n context: { $implicit: editColumnsVisibilityButton() }\n \"\n ></ng-container>\n }\n <div class=\"spacer\"></div>\n @if (enablePrint()) {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableActionButton;\n context: { $implicit: printButton(), defaultAction: printTable }\n \"\n ></ng-container>\n } @for (button of actionButtons(); track $index) { @if (!button.showIf ||\n button.showIf(visibleColumns(), datasource())) {\n <ng-container\n *ngTemplateOutlet=\"dmTableActionButton; context: { $implicit: button }\"\n ></ng-container>\n } }\n </div>\n <div\n [ngClass]=\"tableClasses()?.tableWrapper || {}\"\n [dmImportantStyle]=\"mergedTableStyle().tableWrapper || DEFAULT_TABLE_STYLE.tableWrapper || {}\"\n cdkScrollable\n >\n <table\n [ngStyle]=\"\n !tableClasses()?.table?.root\n ? mergedTableStyle().table?.root || DEFAULT_TABLE_STYLE.table?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.root || {}\"\n >\n <thead\n style=\"\n position: sticky !important;\n top: 0 !important;\n z-index: 10 !important;\n box-shadow: 0px 2px 2px 0px #0000006e;\n \"\n [ngStyle]=\"\n !tableClasses()?.table?.thead?.root\n ? mergedTableStyle().table?.thead?.root || DEFAULT_TABLE_STYLE.table?.thead?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.thead?.root || {}\"\n >\n @if (enableLoadingOverlay()) {\n <tr style=\"height: 4px !important; max-height: 4px !important; line-height: 4px !important\">\n <th [attr.colspan]=\"visibleRuntimeColumns().length\" style=\"padding: 0 !important\">\n @if (datasource().isLoading()) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </th>\n </tr>\n }\n <tr\n [ngStyle]=\"\n !tableClasses()?.table?.thead?.tr\n ? mergedTableStyle().table?.thead?.tr || DEFAULT_TABLE_STYLE.table?.thead?.tr || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.thead?.tr || {}\"\n cdkDropList\n [cdkDropListData]=\"visibleRuntimeColumns()\"\n [cdkDropListOrientation]=\"'horizontal'\"\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n [cdkDropListAutoScrollStep]=\"20\"\n >\n @for (column of visibleRuntimeColumns(); let j = $index; track column.id) {\n <th\n cdkDrag\n [cdkDragDisabled]=\"!enableColumnsDragAndDrop()\"\n [ngStyle]=\"getHeaderThStyle(column)\"\n [ngClass]=\"tableClasses()?.table?.thead?.th || {}\"\n (mouseenter)=\"hoveredColumnHeaderIndex.set(j)\"\n (mouseleave)=\"hoveredColumnHeaderIndex.set(null)\"\n (click)=\"headerClickHandler(column, $event)\"\n (dblclick)=\"headerDoubleClickHandler(column, $event)\"\n (contextmenu)=\"headerContextMenuHandler(column, $event)\"\n >\n <div\n class=\"inner-header-cell\"\n [dmImportantStyle]=\"getHeaderThContentStyle(column)\"\n (click)=\"headerContentClickHandler(column, $event)\"\n (dblclick)=\"headerContentDoubleClickHandler(column, $event)\"\n (contextmenu)=\"headerContentContextMenuHandler(column, $event)\"\n >\n <span>\n {{ column.header }}\n </span>\n @if (column.sortable) {\n <span\n (click)=\"columnHeaderSortClickHandler(column, $event)\"\n style=\"display: flex; align-items: center\"\n >\n @if (isColumnSorted(column); as sort) {\n <mat-icon style=\"width: 20px; height: 20px; font-size: 20px\">{{\n sort.direction === 'asc' ? 'arrow_upward' : 'arrow_downward'\n }}</mat-icon>\n @if(columnsSortState().length > 1) { [{{ sort.index + 1 }}] } } @else if\n (hoveredColumnHeaderIndex() == j){\n <mat-icon style=\"opacity: 0.3; width: 20px; height: 20px; font-size: 20px\"\n >arrow_upward</mat-icon\n >\n }\n </span>\n } @if (enableColumnsDragHandle()) {\n\n <div class=\"spacer\"></div>\n <span>\n <ng-container\n *ngTemplateOutlet=\"dmTableHeaderMenuTrigger; context: { $implicit: column }\"\n />\n </span>\n <mat-icon style=\"cursor: move; font-size: 20px\" cdkDragHandle\n >drag_indicator</mat-icon\n >\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody\n [dmImportantStyle]=\"\n !tableClasses()?.table?.tbody?.root\n ? mergedTableStyle().table?.tbody?.root || DEFAULT_TABLE_STYLE.table?.tbody?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.tbody?.root || {}\"\n >\n @for (row of datasource().result(); let i = $index; track i) {\n <tr\n [dmImportantStyle]=\"getBodyRowStyle(i, row)\"\n (mouseenter)=\"hoveredRowIndex.set(i)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n >\n @for (column of visibleRuntimeColumns(); let j = $index; track j) {\n <td\n [dmImportantStyle]=\"getBodyTdStyle(i, column, row)\"\n (click)=\"cellClickHandler(row, column, $event)\"\n (contextmenu)=\"cellContextMenuHandler(row, column, $event)\"\n (dblclick)=\"cellDoubleClickHandler(row, column, $event)\"\n >\n <span\n [dmImportantStyle]=\"getBodyTdContentStyle(i, column, row)\"\n (click)=\"cellContentClickHandler(row, column, $event)\"\n (contextmenu)=\"cellContentContextMenuHandler(row, column, $event)\"\n (dblclick)=\"cellContentDoubleClickHandler(row, column, $event)\"\n >\n @switch (column.type) { @case ('$index') {\n {{ datasource().getFirstItemIndexInPage() + i + 1 }}\n } @case ('component') { @if (column.component) {\n <dm-table-cell-host\n [component]=\"column.component\"\n [context]=\"createCellContext(row, column)\"\n ></dm-table-cell-host>\n } } @case ('tel') {\n <a [href]=\"'tel:' + (column.field ? row[column.field] : '')\">{{\n resolveCellValue(row, column)\n }}</a>\n } @case ('mail') {\n <a [href]=\"'mailto:' + (column.field ? row[column.field] : '')\">{{\n resolveCellValue(row, column)\n }}</a>\n } @case ('link') {\n <a\n [href]=\"column.field ? row[column.field] : ''\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >{{ resolveCellValue(row, column) }}</a\n >\n } @case ('whatsapp') {\n <a\n [href]=\"'https://wa.me/' + (column.field ? row[column.field] : '')\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >{{ resolveCellValue(row, column) }}</a\n >\n } @case ('customHtml') { @if (column.customHtml) {\n <span [innerHTML]=\"column.customHtml\"></span>\n } @else if (column.customCellTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n column.customCellTemplate;\n context: createCellContext(row, column)\n \"\n >\n </ng-container>\n } } @case ('actions') {\n <span style=\"display: flex; align-items: center\">\n @for (button of column.actionsButtons || []; track $index) {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableRowActionButton;\n context: {\n $implicit: button,\n row\n }\n \"\n ></ng-container>\n }\n </span>\n } @case ('input') {\n <ng-container\n *ngTemplateOutlet=\"\n dmTableInputCell;\n context: {\n $implicit: row,\n column: column\n }\n \"\n />\n } @default {\n {{ resolveCellValue(row, column) }}\n } }\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n @if (enableTotalRow()) {\n <tfoot\n style=\"\n position: sticky !important;\n bottom: 0 !important;\n z-index: 10 !important;\n box-shadow: 0px -2px 2px 0px #0000006e;\n \"\n [ngStyle]=\"\n !tableClasses()?.table?.tfoot?.root\n ? mergedTableStyle().table?.tfoot?.root || DEFAULT_TABLE_STYLE.table?.tfoot?.root || {}\n : {}\n \"\n [ngClass]=\"tableClasses()?.table?.tfoot?.root || {}\"\n >\n <tr>\n @for (column of visibleRuntimeColumns(); let j = $index; track column.id) {\n <td\n [ngStyle]=\"getFooterTdStyle(column)\"\n [ngClass]=\"tableClasses()?.table?.tfoot?.td || {}\"\n >\n @if (column.totalRowValueType == 'html') {\n <span [innerHTML]=\"totalRowValues().get(column.id) || ''\"></span>\n } @else {\n {{ totalRowValues().get(column.id) || '' }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n @if (datasource().result().length === 0) {\n <div class=\"dm-table-no-data\">\n <span>{{ noDataMessage() }}</span>\n </div>\n } @else { @if (datasource().isPaginationEnabled()) {\n <ng-container [ngTemplateOutlet]=\"paginator\" />\n } }\n</div>\n\n<!-- MARK: Action Button template -->\n<ng-template #dmTableActionButton let-button let-defaultAction=\"defaultAction\">\n @if (button.buttonType === 'icon') {\n <button\n #rootTrigger=\"matMenuTrigger\"\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? tableButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(visibleColumns(), datasource())\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n #rootTrigger=\"matMenuTrigger\"\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? tableButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(visibleColumns(), datasource())\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon class=\"button-icon\" [ngStyle]=\"{ color: button.color ? button.color : undefined }\">{{\n button.icon\n }}</mat-icon>\n }\n <span [ngStyle]=\"{ color: button.color ? button.color : undefined }\">\n {{ button.label }}\n </span>\n </button>\n }\n <!-- @if (button.buttonType === 'icon') {\n <button\n mat-icon-button\n [color]=\"button.color\"\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(datasource())\n : defaultAction\n ? defaultAction()\n : null\n \"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.color ? button.color : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(datasource())\n : defaultAction\n ? defaultAction()\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon\n class=\"button-icon\"\n [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\"\n >{{ button.icon }}</mat-icon\n >\n }\n <span [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\">\n {{ button.label }}\n </span>\n </button>\n } -->\n</ng-template>\n\n<!-- MARK: Action Button root menu -->\n<mat-menu #tableButtonRootMenu=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n tableButtonRecursiveMenu;\n context: { buttons: buttons, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- MARK: Action Button recursive menu -->\n<ng-template #tableButtonRecursiveMenu let-buttons=\"buttons\" let-rootTrigger=\"rootTrigger\">\n @for (button of buttons; track $index) { @if (!button.showIf || button.showIf(visibleColumns(),\n datasource())) { @if (button.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"subMenu\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"button.color ? button.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #subMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n tableButtonRecursiveMenu;\n context: { buttons: button.children, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </mat-menu>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"button.onClick?.(visibleColumns(), datasource(), $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n </button>\n }} }\n</ng-template>\n\n<!-- MARK: Row button root menu -->\n<mat-menu #rowButtonRootMenu=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-row=\"row\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n rowButtonRecursiveMenu;\n context: { buttons: buttons, row: row, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- MARK: Row button recursive menu -->\n<ng-template\n #rowButtonRecursiveMenu\n let-buttons=\"buttons\"\n let-row=\"row\"\n let-rootTrigger=\"rootTrigger\"\n>\n @for (button of buttons; track $index) { @if (button.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"subMenu\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"button.color ? button.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #subMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n rowButtonRecursiveMenu;\n context: { buttons: button.children, row: row, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </mat-menu>\n\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n (click)=\"button.onClick?.(row, $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n >\n @if (button.icon) {\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n }\n <span [style.color]=\"button.color ? button.color : undefined\">{{ button.label }}</span>\n </button>\n } }\n</ng-template>\n\n<!-- MARK: Row Action Button template -->\n<ng-template #dmTableRowActionButton let-button let-row=\"row\" let-defaultAction=\"defaultAction\">\n @if (button.buttonType === 'icon') {\n <button\n #rootTrigger=\"matMenuTrigger\"\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? rowButtonRootMenu : null\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row)\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n <mat-icon [style.color]=\"button.color ? button.color : undefined\">{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.backgroundColor ? button.backgroundColor : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"button.children && button.children.length > 0 ? rowButtonRootMenu : null\"\n #rootTrigger=\"matMenuTrigger\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row,\n rootTrigger: rootTrigger\n }\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row)\n : defaultAction\n ? defaultAction($event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon class=\"button-icon\" [ngStyle]=\"{ color: button.color ? button.color : undefined }\">{{\n button.icon\n }}</mat-icon>\n }\n <span [ngStyle]=\"{ color: button.color ? button.color : undefined }\">\n {{ button.label }}\n </span>\n </button>\n }\n</ng-template>\n\n<!-- <mat-menu #buttonChildren=\"matMenu\">\n <ng-template matMenuContent let-buttons=\"buttons\" let-row=\"row\">\n @for (button of buttons || []; track $index) { @if (button.children && button.children.length >\n 0) {\n <ng-container *ngTemplateOutlet=\"subMenuTrigger; context: { button, row }\"></ng-container>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n (click)=\"\n button.children && button.children.length > 0\n ? null\n : button.onClick\n ? button.onClick(row, $event)\n : null\n \"\n >\n @if (button.icon) {\n <mat-icon>{{ button.icon }}</mat-icon>\n }\n <span>{{ button.label }}</span>\n </button>\n } }\n </ng-template>\n</mat-menu>\n\n<ng-template #subMenuTrigger let-button=\"button\" let-row=\"row\">\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"buttonChildren\"\n [matMenuTriggerData]=\"{\n buttons: button.children,\n row\n }\"\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n >\n @if (button.icon) {\n <mat-icon>{{ button.icon }}</mat-icon>\n }\n <span>{{ button.label }}</span>\n </button>\n</ng-template> -->\n\n<!-- MARK: Paginator template -->\n<ng-template #paginator>\n <div\n class=\"dm-table-paginator-row\"\n [ngStyle]=\"mergedTableStyle().paginator?.root || {}\"\n [ngClass]=\"tableClasses()?.paginator?.root || {}\"\n >\n <p\n class=\"mb-0\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n >\n {{\n paginatorSettings()?.numberOfItemsPerPageLabel ||\n DEFAULT_PAGINATOR_SETTINGS.numberOfItemsPerPageLabel\n }}\n </p>\n\n <div>\n <mat-form-field\n style=\"width: 100px\"\n class=\"dm-paginator-form-field ms-2 me-2\"\n [appearance]=\"'fill'\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_form_field || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_form_field || {}\"\n >\n <mat-select\n [value]=\"datasource().getPageSize()\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_select || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_select || {}\"\n >\n @for (option of (paginatorSettings()?.pageSizeOptions ||\n DEFAULT_PAGINATOR_SETTINGS.pageSizeOptions); track option) {\n <mat-option\n [value]=\"option\"\n (onSelectionChange)=\"onPageSizeChange($event, option)\"\n [ngStyle]=\"mergedTableStyle().paginator?.mat_option || {}\"\n [ngClass]=\"tableClasses()?.paginator?.mat_option || {}\"\n >{{ option }}</mat-option\n >\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n @if (datasource().getPageSize() > 0) {\n <div class=\"dm-table-paginator-page-info\">\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getFirstItemIndexInPage() + 1 }}\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n -\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getLastItemIndexInPage() + 1 }}\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n \u05DE\u05EA\u05D5\u05DA\n </p>\n\n <p\n [ngClass]=\"tableClasses()?.paginator?.p || {}\"\n [ngStyle]=\"mergedTableStyle().paginator?.p || {}\"\n >\n {{ datasource().getTotalResultElementsCount() }}\n </p>\n </div>\n }\n\n <div>\n @if (paginatorSettings()?.showFirstAndLastPagesButtons ||\n DEFAULT_PAGINATOR_SETTINGS.showFirstAndLastPagesButtons) {\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().firstPage()\"\n [matTooltip]=\"\n paginatorSettings()?.firstPageButtonLabel ||\n DEFAULT_PAGINATOR_SETTINGS.firstPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>keyboard_double_arrow_right</mat-icon>\n </button>\n }\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().firstPage()\"\n [matTooltip]=\"\n paginatorSettings()?.previousPageButtonLabel ||\n DEFAULT_PAGINATOR_SETTINGS.previousPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().nextPage()\"\n [matTooltip]=\"\n paginatorSettings()?.nextPageButtonLabel || DEFAULT_PAGINATOR_SETTINGS.nextPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n @if (paginatorSettings()?.showFirstAndLastPagesButtons ||\n DEFAULT_PAGINATOR_SETTINGS.showFirstAndLastPagesButtons) {\n <button\n [ngStyle]=\"mergedTableStyle().paginator?.button || {}\"\n [ngClass]=\"tableClasses()?.paginator?.button || {}\"\n mat-icon-button\n (click)=\"datasource().lastPage()\"\n [matTooltip]=\"\n paginatorSettings()?.lastPageButtonLabel || DEFAULT_PAGINATOR_SETTINGS.lastPageButtonLabel\n \"\n [matTooltipPosition]=\"'above'\"\n >\n <mat-icon>keyboard_double_arrow_left</mat-icon>\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n<!-- MARK: Edit Columns Visibility Menu Trigger -->\n<ng-template #editcolumnVisibilityMenuTrigger let-button>\n @if (button.buttonType == 'icon') {\n <button\n mat-icon-button\n [matTooltip]=\"button.tooltip || ''\"\n aria-label=\"{{ button.tooltip }}\"\n [matMenuTriggerFor]=\"columnVisibilityMenu\"\n #rootTrigger=\"matMenuTrigger\"\n >\n <mat-icon [style.color]=\"button.textColor ? button.textColor : undefined\">{{\n button.icon\n }}</mat-icon>\n </button>\n } @else {\n <button\n [matButton]=\"button.buttonType || 'filled'\"\n [ngStyle]=\"{ 'background-color': button.color ? button.color : undefined }\"\n aria-label=\"{{ button.label }}\"\n [matTooltip]=\"button.tooltip || ''\"\n [matMenuTriggerFor]=\"columnVisibilityMenu\"\n #rootTrigger=\"matMenuTrigger\"\n >\n @if (button.icon) {\n <mat-icon\n class=\"button-icon\"\n [ngStyle]=\"{ color: button.textColor ? button.textColor : undefined }\"\n >{{ button.icon }}</mat-icon\n >\n }\n <span [style.color]=\"button.textColor ? button.textColor : undefined\">\n {{ button.label }}\n </span>\n </button>\n }\n</ng-template>\n\n<!-- MARK: Edit Columns Visibility Menu -->\n<mat-menu #columnVisibilityMenu=\"matMenu\">\n <div mat-menu-item disableRipple (click)=\"$event.stopPropagation()\">\n <mat-checkbox\n [checked]=\"isAllColumnsVisible()\"\n (change)=\"toggleAllColumnsVisibility($event)\"\n (click)=\"$event.stopPropagation()\"\n >{{ editColumnsVisibilitySelectAllLabel() }}</mat-checkbox\n >\n </div>\n @for (column of runtimeColumns(); track column.id) {\n <div mat-menu-item disableRipple (click)=\"$event.stopPropagation()\">\n <mat-checkbox\n [checked]=\"isColumnVisible(column)\"\n (change)=\"toggleColumnVisibility($event, column)\"\n (click)=\"$event.stopPropagation()\"\n >{{ column.header }}</mat-checkbox\n >\n </div>\n }\n</mat-menu>\n\n<!-- MARK: Input Cell Template -->\n<ng-template #dmTableInputCell let-row let-column=\"column\">\n @switch (column.inputType) { @case ('select') {\n <mat-select\n [dmImportantStyle]=\"getInputStyle(column)\"\n panelWidth=\"null\"\n [value]=\"resolveCellValue(row, column)\"\n >\n @for (option of column.selectOptions || []; track option.value) {\n <mat-option\n [value]=\"option.value\"\n (onSelectionChange)=\"inputCellSelectOptionChangeHandler(row, column, option, $event)\"\n >{{ option.label }}</mat-option\n >\n }\n </mat-select>\n } @case ('checkbox') {\n <mat-checkbox\n [checked]=\"resolveCellValue(row, column)\"\n (change)=\"inputCellCheckboxChangeHandler(row, column, $event)\"\n ></mat-checkbox>\n } @default {\n <input\n [type]=\"column.inputType || 'text'\"\n [value]=\"resolveCellValue(row, column)\"\n (input)=\"inputCellChangeHandler(row, column, $event)\"\n [dmImportantStyle]=\"getInputStyle(column)\"\n />\n } }\n</ng-template>\n\n<!-- MARK: Header Menu Trigger Template -->\n<ng-template #dmTableHeaderMenuTrigger let-column>\n @if (column?.headerMenuItems?.length) {\n <!-- <button\n mat-icon-button\n (click)=\"$event.stopPropagation()\"\n aria-label=\"Column Menu\"\n >\n </button> -->\n <mat-icon\n #rootTrigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"dmTableHeaderRootMenu\"\n [matMenuTriggerData]=\"{\n menuItems: column.headerMenuItems,\n rootTrigger: rootTrigger\n }\"\n [matTooltip]=\"column.headerMenuTooltip || ''\"\n style=\"font-size: 20px; cursor: pointer; margin-left: 4px; height: 20px\"\n [ngStyle]=\"{\n color: getHeaderThContentStyle(column)?.color || getHeaderThStyle(column)?.color || ''\n }\"\n >menu</mat-icon\n >\n }\n</ng-template>\n\n<mat-menu #dmTableHeaderRootMenu=\"matMenu\">\n <ng-template matMenuContent let-menuItems=\"menuItems\" let-rootTrigger=\"rootTrigger\">\n <ng-container\n *ngTemplateOutlet=\"\n dmTableHeaderRecursiveMenu;\n context: { menuItems: menuItems, rootTrigger: rootTrigger }\n \"\n ></ng-container>\n </ng-template>\n</mat-menu>\n\n<ng-template #dmTableHeaderRecursiveMenu let-menuItems=\"menuItems\" let-rootTrigger=\"rootTrigger\">\n @for (menuItem of menuItems; track $index) { @if (!menuItem.showIf || (menuItem.showIf &&\n menuItem.showIf(datasource()))) {@if (menuItem.children?.length) {\n <button\n mat-menu-item\n [matMenuTriggerFor]=\"dmTableHeaderSubMenu\"\n [matMenuTriggerData]=\"{\n menuItems: menuItem.children,\n rootTrigger\n }\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"{\n 'background-color': menuItem.backgroundColor ? menuItem.backgroundColor : undefined\n }\"\n >\n <span style=\"display: flex; align-items: center; width: 100%\">\n @if (menuItem.icon) {\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{\n menuItem.icon\n }}</mat-icon>\n }\n <span [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{ menuItem.label }}</span>\n <span class=\"spacer\"></span>\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\" class=\"submenu-arrow\"\n >chevron_left</mat-icon\n >\n </span>\n </button>\n\n <mat-menu #dmTableHeaderSubMenu=\"matMenu\">\n <ng-container\n *ngTemplateOutlet=\"\n dmTableHeaderRecursiveMenu;\n context: { menuItems: menuItem.children, rootTrigger: rootTrigger }\n \"\n />\n </mat-menu>\n } @else {\n <button\n mat-menu-item\n [matTooltip]=\"menuItem.tooltip || ''\"\n (click)=\"menuItem.onClick?.(datasource(), $event, getCloseParentMenusFn(rootTrigger))\"\n [ngStyle]=\"{\n 'background-color': menuItem.backgroundColor ? menuItem.backgroundColor : undefined\n }\"\n >\n @if (menuItem.icon) {\n <mat-icon [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{\n menuItem.icon\n }}</mat-icon>\n }\n <span [style.color]=\"menuItem.color ? menuItem.color : undefined\">{{ menuItem.label }}</span>\n </button>\n } }}\n</ng-template>\n", styles: ["#dm-table-component-wrapper{width:100%}#dm-table-component-wrapper ::-webkit-scrollbar{width:var(--dm-cmps-table-scrollbar-width, 7px);height:var(--dm-cmps-table-scrollbar-width, 7px)}#dm-table-component-wrapper ::-webkit-scrollbar-track{background:var(--dm-cmps-table-scrollbar-background-color, #e0e0e0)}#dm-table-component-wrapper ::-webkit-scrollbar-thumb{background:var(--dm-cmps-table-scrollbar-color, #949496);border-radius:6px}#dm-table-component-wrapper ::-webkit-scrollbar-thumb:hover{background:var(--dm-cmps-table-scrollbar-hover-color, #5f5f5f)}#dm-table-component-wrapper .dm-table-top-section{width:calc(100% - 10px);display:flex;align-items:center;padding:0 5px;gap:5px;flex-wrap:wrap}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic{width:100%;border-collapse:collapse;border-spacing:0;box-shadow:0 5px 5px -3px #003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;padding:0;font-size:1rem;border-radius:8px;page-break-inside:auto}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic tr{page-break-inside:avoid}#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic th,#dm-table-component-wrapper .dm-table-table-wrapper .dm-table-classic td{text-align:start;max-width:none}#dm-table-component-wrapper .inner-header-cell{display:flex;align-items:center;gap:5px}#dm-table-component-wrapper .dm-table-no-data{width:98%;margin:10px auto 0;line-height:60px;display:flex;justify-content:center;align-items:center;padding:10px;font-size:1.5rem;font-weight:700;color:#dd2f2f;box-shadow:0 4px 6px #000000d7}#dm-table-component-wrapper .dm-table-paginator-row{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px}#dm-table-component-wrapper .dm-table-paginator-row .dm-table-paginator-page-info{display:flex;align-items:center;gap:5px}:host ::ng-deep .dm-paginator-form-field>.mat-mdc-form-field-bottom-align:before{content:\"\";display:none;height:0px}:host ::ng-deep .dm-table-search-form-field>.mat-mdc-form-field-bottom-align:before{content:\"\";display:none;height:0px}.cdk-drag-preview{border:none;box-sizing:border-box;background-color:var(--dm-table-header-background-color, #f5f5f5);color:var(--dm-table-header-color, #000000);border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview .inner-header-cell{display:flex;align-items:center}.spacer{flex-grow:1}\n"] }]
2109
+ }], ctorParameters: () => [], propDecorators: { onShiftKeyDown: [{
2110
+ type: HostListener,
2111
+ args: ['window:keydown.shift', ['$event']]
2112
+ }], onShiftKeyUp: [{
2113
+ type: HostListener,
2114
+ args: ['window:keyup.shift', ['$event']]
2115
+ }], tableId: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableId", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], noDataMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noDataMessage", required: false }] }], enableSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSearch", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], clearSearchTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearSearchTooltip", required: false }] }], searchInputAppearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchInputAppearance", required: false }] }], filterPredicate: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPredicate", required: false }] }], actionButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionButtons", required: false }] }], enablePrint: [{ type: i0.Input, args: [{ isSignal: true, alias: "enablePrint", required: false }] }], printButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "printButton", required: false }] }], enablePagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "enablePagination", required: false }] }], autoPaginationAboveRowsCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoPaginationAboveRowsCount", required: false }] }], paginatorSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorSettings", required: false }] }], enableLoadingOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableLoadingOverlay", required: false }] }], enableColumnsDragAndDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnsDragAndDrop", required: false }] }], enableColumnsDragHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnsDragHandle", required: false }] }], enableTotalRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableTotalRow", required: false }] }], tableStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableStyle", required: false }] }], tableClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClasses", required: false }] }], rowStyleFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowStyleFn", required: false }] }], editColumnsVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "editColumnsVisibility", required: false }] }], editColumnsVisibilityButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "editColumnsVisibilityButton", required: false }] }], editColumnsVisibilitySelectAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "editColumnsVisibilitySelectAllLabel", required: false }] }], rowIdentifierField: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIdentifierField", required: false }] }] } });
2116
+
851
2117
  /**
852
2118
  * Generated bundle index. Do not edit.
853
2119
  */
854
2120
 
855
- export { DmCmpsDataSource, DmColorPicker, DmMatSelect, DmSpinner, DmSpinnerService };
2121
+ export { DmCmpsDataSource, DmColorPicker, DmMatSelect, DmSpinner, DmSpinnerService, DmTable };
856
2122
  //# sourceMappingURL=dmlibs-dm-cmps.mjs.map