@igo2/common 21.0.0-next.1 → 21.0.0-next.3
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.
- package/fesm2022/igo2-common-action.mjs +34 -49
- package/fesm2022/igo2-common-action.mjs.map +1 -1
- package/fesm2022/igo2-common-backdrop.mjs +5 -13
- package/fesm2022/igo2-common-backdrop.mjs.map +1 -1
- package/fesm2022/igo2-common-badge.mjs.map +1 -1
- package/fesm2022/igo2-common-collapsible.mjs +6 -14
- package/fesm2022/igo2-common-collapsible.mjs.map +1 -1
- package/fesm2022/igo2-common-color.mjs.map +1 -1
- package/fesm2022/igo2-common-confirm-dialog.mjs +2 -1
- package/fesm2022/igo2-common-confirm-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-context-menu.mjs +6 -4
- package/fesm2022/igo2-common-context-menu.mjs.map +1 -1
- package/fesm2022/igo2-common-datepicker.mjs +21 -15
- package/fesm2022/igo2-common-datepicker.mjs.map +1 -1
- package/fesm2022/igo2-common-dom.mjs +3 -1
- package/fesm2022/igo2-common-dom.mjs.map +1 -1
- package/fesm2022/igo2-common-drag-drop.mjs +59 -27
- package/fesm2022/igo2-common-drag-drop.mjs.map +1 -1
- package/fesm2022/igo2-common-dynamic-component.mjs +9 -3
- package/fesm2022/igo2-common-dynamic-component.mjs.map +1 -1
- package/fesm2022/igo2-common-entity.mjs +134 -99
- package/fesm2022/igo2-common-entity.mjs.map +1 -1
- package/fesm2022/igo2-common-flexible.mjs +19 -71
- package/fesm2022/igo2-common-flexible.mjs.map +1 -1
- package/fesm2022/igo2-common-form.mjs +46 -45
- package/fesm2022/igo2-common-form.mjs.map +1 -1
- package/fesm2022/igo2-common-icon.mjs +1 -1
- package/fesm2022/igo2-common-icon.mjs.map +1 -1
- package/fesm2022/igo2-common-image.mjs.map +1 -1
- package/fesm2022/igo2-common-interactive-tour.mjs +40 -17
- package/fesm2022/igo2-common-interactive-tour.mjs.map +1 -1
- package/fesm2022/igo2-common-json-dialog.mjs +2 -2
- package/fesm2022/igo2-common-json-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-keyvalue.mjs +3 -1
- package/fesm2022/igo2-common-keyvalue.mjs.map +1 -1
- package/fesm2022/igo2-common-list.mjs +11 -6
- package/fesm2022/igo2-common-list.mjs.map +1 -1
- package/fesm2022/igo2-common-panel.mjs +1 -1
- package/fesm2022/igo2-common-panel.mjs.map +1 -1
- package/fesm2022/igo2-common-resizable-bar.mjs +2 -4
- package/fesm2022/igo2-common-resizable-bar.mjs.map +1 -1
- package/fesm2022/igo2-common-select-value-dialog.mjs +14 -4
- package/fesm2022/igo2-common-select-value-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-sidenav.mjs.map +1 -1
- package/fesm2022/igo2-common-spinner.mjs +1 -1
- package/fesm2022/igo2-common-spinner.mjs.map +1 -1
- package/fesm2022/igo2-common-table.mjs +53 -60
- package/fesm2022/igo2-common-table.mjs.map +1 -1
- package/fesm2022/igo2-common-timepicker.mjs +8 -9
- package/fesm2022/igo2-common-timepicker.mjs.map +1 -1
- package/fesm2022/igo2-common-tool.mjs +19 -16
- package/fesm2022/igo2-common-tool.mjs.map +1 -1
- package/fesm2022/igo2-common-widget.mjs +4 -4
- package/fesm2022/igo2-common-widget.mjs.map +1 -1
- package/fesm2022/igo2-common-workspace.mjs +12 -16
- package/fesm2022/igo2-common-workspace.mjs.map +1 -1
- package/package.json +3 -3
- package/types/igo2-common-action.d.ts +2 -5
- package/types/igo2-common-backdrop.d.ts +2 -4
- package/types/igo2-common-badge.d.ts +4 -4
- package/types/igo2-common-collapsible.d.ts +2 -4
- package/types/igo2-common-confirm-dialog.d.ts +1 -1
- package/types/igo2-common-context-menu.d.ts +2 -2
- package/types/igo2-common-datepicker.d.ts +9 -9
- package/types/igo2-common-drag-drop.d.ts +14 -12
- package/types/igo2-common-dynamic-component.d.ts +3 -3
- package/types/igo2-common-entity.d.ts +61 -57
- package/types/igo2-common-flexible.d.ts +14 -28
- package/types/igo2-common-form.d.ts +24 -24
- package/types/igo2-common-icon.d.ts +1 -1
- package/types/igo2-common-interactive-tour.d.ts +6 -6
- package/types/igo2-common-json-dialog.d.ts +4 -4
- package/types/igo2-common-keyvalue.d.ts +4 -1
- package/types/igo2-common-list.d.ts +7 -7
- package/types/igo2-common-panel.d.ts +1 -1
- package/types/igo2-common-resizable-bar.d.ts +4 -5
- package/types/igo2-common-select-value-dialog.d.ts +2 -2
- package/types/igo2-common-sidenav.d.ts +2 -2
- package/types/igo2-common-spinner.d.ts +1 -1
- package/types/igo2-common-table.d.ts +17 -18
- package/types/igo2-common-timepicker.d.ts +3 -3
- package/types/igo2-common-tool.d.ts +7 -8
- package/types/igo2-common-widget.d.ts +7 -7
- package/types/igo2-common-workspace.d.ts +12 -12
|
@@ -202,11 +202,11 @@ class EntityService {
|
|
|
202
202
|
}
|
|
203
203
|
buildUrl(field) {
|
|
204
204
|
const relation = field.relation;
|
|
205
|
-
if (relation
|
|
205
|
+
if (relation?.url)
|
|
206
206
|
return relation.url;
|
|
207
207
|
const baseUrl = this.configService.getConfig('edition.url');
|
|
208
|
-
if (!relation
|
|
209
|
-
return;
|
|
208
|
+
if (!relation?.table) {
|
|
209
|
+
return undefined;
|
|
210
210
|
}
|
|
211
211
|
return baseUrl ? baseUrl + relation.table : relation.table;
|
|
212
212
|
}
|
|
@@ -216,7 +216,9 @@ class EntityService {
|
|
|
216
216
|
? ObjectUtils.resolve(options, path.list)
|
|
217
217
|
: options;
|
|
218
218
|
return items.map((item) => {
|
|
219
|
-
const id = path?.id
|
|
219
|
+
const id = path?.id
|
|
220
|
+
? ObjectUtils.resolve(item, path.id)
|
|
221
|
+
: item.id;
|
|
220
222
|
const value = path?.value
|
|
221
223
|
? ObjectUtils.resolve(item, path.value)
|
|
222
224
|
: item.value;
|
|
@@ -225,7 +227,7 @@ class EntityService {
|
|
|
225
227
|
}
|
|
226
228
|
getRelationFilterParamName(field, relation) {
|
|
227
229
|
const param = relation.params;
|
|
228
|
-
if (param
|
|
230
|
+
if (param?.field !== field) {
|
|
229
231
|
return field;
|
|
230
232
|
}
|
|
231
233
|
return param?.name ?? field;
|
|
@@ -1161,8 +1163,8 @@ class EntityStoreWatcher {
|
|
|
1161
1163
|
*/
|
|
1162
1164
|
setupObservers() {
|
|
1163
1165
|
this.teardownObservers();
|
|
1164
|
-
this.entities$$ = this.store
|
|
1165
|
-
this.state$$ = this.store
|
|
1166
|
+
this.entities$$ = this.store?.entities$.subscribe(() => this.onEntitiesChange());
|
|
1167
|
+
this.state$$ = this.store?.state.change$
|
|
1166
1168
|
.pipe(skip(1))
|
|
1167
1169
|
.subscribe(() => this.onStateChange());
|
|
1168
1170
|
}
|
|
@@ -1192,7 +1194,9 @@ class EntityStoreWatcher {
|
|
|
1192
1194
|
*/
|
|
1193
1195
|
onStateChange() {
|
|
1194
1196
|
let changesDetected = false;
|
|
1195
|
-
const storeIndex = this.store
|
|
1197
|
+
const storeIndex = this.store?.state.index;
|
|
1198
|
+
if (!storeIndex)
|
|
1199
|
+
return;
|
|
1196
1200
|
const innerIndex = this.innerStateIndex;
|
|
1197
1201
|
if (storeIndex.size !== innerIndex.size) {
|
|
1198
1202
|
changesDetected = this.detectChanges();
|
|
@@ -1209,7 +1213,7 @@ class EntityStoreWatcher {
|
|
|
1209
1213
|
changesDetected = this.detectChanges();
|
|
1210
1214
|
}
|
|
1211
1215
|
}
|
|
1212
|
-
this.innerStateIndex.set(key, Object.assign({}, storeValue));
|
|
1216
|
+
this.innerStateIndex.set(key, Object.assign({}, storeValue || {}));
|
|
1213
1217
|
}
|
|
1214
1218
|
}
|
|
1215
1219
|
/**
|
|
@@ -1298,7 +1302,9 @@ class EntityTransaction {
|
|
|
1298
1302
|
return;
|
|
1299
1303
|
}
|
|
1300
1304
|
else if (existingOperation.type === EntityOperationType.Update) {
|
|
1301
|
-
|
|
1305
|
+
if (existingOperation.previous) {
|
|
1306
|
+
previous = existingOperation.previous;
|
|
1307
|
+
}
|
|
1302
1308
|
}
|
|
1303
1309
|
}
|
|
1304
1310
|
this.doUpdate(previous, current, store, meta);
|
|
@@ -1811,7 +1817,7 @@ class EntitySelectorComponent {
|
|
|
1811
1817
|
/**
|
|
1812
1818
|
* Entity store
|
|
1813
1819
|
*/
|
|
1814
|
-
store = input(
|
|
1820
|
+
store = input(...(ngDevMode ? [undefined, { debugName: "store" }] : /* istanbul ignore next */ []));
|
|
1815
1821
|
/**
|
|
1816
1822
|
* Title accessor
|
|
1817
1823
|
*/
|
|
@@ -1819,7 +1825,7 @@ class EntitySelectorComponent {
|
|
|
1819
1825
|
/**
|
|
1820
1826
|
* Text to display when nothing is selected
|
|
1821
1827
|
*/
|
|
1822
|
-
emptyText = input(
|
|
1828
|
+
emptyText = input(...(ngDevMode ? [undefined, { debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
1823
1829
|
/**
|
|
1824
1830
|
* Wheter selecting many entities is allowed
|
|
1825
1831
|
*/
|
|
@@ -1835,7 +1841,7 @@ class EntitySelectorComponent {
|
|
|
1835
1841
|
/**
|
|
1836
1842
|
* Field placeholder
|
|
1837
1843
|
*/
|
|
1838
|
-
placeholder = input(
|
|
1844
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1839
1845
|
/**
|
|
1840
1846
|
* Wheter the selector is disabled or not
|
|
1841
1847
|
*/
|
|
@@ -1849,13 +1855,16 @@ class EntitySelectorComponent {
|
|
|
1849
1855
|
* @internal
|
|
1850
1856
|
*/
|
|
1851
1857
|
ngOnInit() {
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
.
|
|
1855
|
-
.
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1858
|
+
const store = this.store();
|
|
1859
|
+
if (store) {
|
|
1860
|
+
this.watcher = new EntityStoreWatcher(store, this.cdRef);
|
|
1861
|
+
this.selected$$ = store.stateView
|
|
1862
|
+
.manyBy$((record) => record.state.selected === true)
|
|
1863
|
+
.subscribe((records) => {
|
|
1864
|
+
const entities = records.map((record) => record.entity);
|
|
1865
|
+
this.onSelectFromStore(entities);
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1859
1868
|
}
|
|
1860
1869
|
/**
|
|
1861
1870
|
* Unsubscribe to the selected entity and destroy the store watcher
|
|
@@ -1874,7 +1883,7 @@ class EntitySelectorComponent {
|
|
|
1874
1883
|
const multiSelect = values.find((_value) => _value === this.multiSelectValue);
|
|
1875
1884
|
let entities = values.filter((_value) => _value !== this.multiSelectValue);
|
|
1876
1885
|
const store = this.store();
|
|
1877
|
-
if (multiSelect !== undefined) {
|
|
1886
|
+
if (store && multiSelect !== undefined) {
|
|
1878
1887
|
if (entities.length === store.count) {
|
|
1879
1888
|
entities = [];
|
|
1880
1889
|
}
|
|
@@ -1883,11 +1892,13 @@ class EntitySelectorComponent {
|
|
|
1883
1892
|
}
|
|
1884
1893
|
}
|
|
1885
1894
|
entities = entities.filter((entity) => entity !== this.emptyValue);
|
|
1886
|
-
if (
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1895
|
+
if (store) {
|
|
1896
|
+
if (entities.length === 0) {
|
|
1897
|
+
store.state.updateAll({ selected: false });
|
|
1898
|
+
}
|
|
1899
|
+
else {
|
|
1900
|
+
store.state.updateMany(entities, { selected: true }, true);
|
|
1901
|
+
}
|
|
1891
1902
|
}
|
|
1892
1903
|
const value = this.multi() ? entities : event.value;
|
|
1893
1904
|
this.selectedChange.emit({ selected: true, value });
|
|
@@ -1904,6 +1915,9 @@ class EntitySelectorComponent {
|
|
|
1904
1915
|
}
|
|
1905
1916
|
updateMultiToggleWithEntities(entities) {
|
|
1906
1917
|
const store = this.store();
|
|
1918
|
+
if (!store) {
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1907
1921
|
const multiNoneText = this.multiNoneText();
|
|
1908
1922
|
const multiAllText = this.multiAllText();
|
|
1909
1923
|
if (entities.length === store.count &&
|
|
@@ -1916,11 +1930,11 @@ class EntitySelectorComponent {
|
|
|
1916
1930
|
}
|
|
1917
1931
|
}
|
|
1918
1932
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: EntitySelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1919
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: EntitySelectorComponent, isStandalone: true, selector: "igo-entity-selector", inputs: { store: { classPropertyName: "store", publicName: "store", isSignal: true, isRequired: false, transformFunction: null }, titleAccessor: { classPropertyName: "titleAccessor", publicName: "titleAccessor", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, multiAllText: { classPropertyName: "multiAllText", publicName: "multiAllText", isSignal: true, isRequired: false, transformFunction: null }, multiNoneText: { classPropertyName: "multiNoneText", publicName: "multiNoneText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, ngImport: i0, template: "<mat-form-field class=\"igo-entity-selector\" subscriptSizing=\"dynamic\">\n <mat-select\n [disabled]=\"disabled()\"\n [value]=\"selected$ | async\"\n [multiple]=\"multi()\"\n [placeholder]=\"placeholder()\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @if (emptyText() !== undefined && multi() === false) {\n <mat-option [value]=\"emptyValue\">{{ emptyText() }}</mat-option>\n }\n @if (multi() === true) {\n <mat-option [value]=\"multiSelectValue\">{{\n multiText$ | async\n }}</mat-option>\n }\n @for (record of store()
|
|
1933
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: EntitySelectorComponent, isStandalone: true, selector: "igo-entity-selector", inputs: { store: { classPropertyName: "store", publicName: "store", isSignal: true, isRequired: false, transformFunction: null }, titleAccessor: { classPropertyName: "titleAccessor", publicName: "titleAccessor", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, multiAllText: { classPropertyName: "multiAllText", publicName: "multiAllText", isSignal: true, isRequired: false, transformFunction: null }, multiNoneText: { classPropertyName: "multiNoneText", publicName: "multiNoneText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, ngImport: i0, template: "<mat-form-field class=\"igo-entity-selector\" subscriptSizing=\"dynamic\">\n <mat-select\n [disabled]=\"disabled()\"\n [value]=\"selected$ | async\"\n [multiple]=\"multi()\"\n [placeholder]=\"placeholder() ?? ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @if (emptyText() !== undefined && multi() === false) {\n <mat-option [value]=\"emptyValue\">{{ emptyText() }}</mat-option>\n }\n @if (multi() === true) {\n <mat-option [value]=\"multiSelectValue\">{{\n multiText$ | async\n }}</mat-option>\n }\n @for (record of store()?.stateView?.all$() | async; track record) {\n <mat-option [value]=\"record.entity\">\n {{ titleAccessor()(record.entity) }}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>\n", styles: [":host{--mat-form-field-container-height: 48px;--mat-form-field-container-vertical-padding: 12px}mat-form-field{width:100%}\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: "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: MatOptionModule }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1920
1934
|
}
|
|
1921
1935
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: EntitySelectorComponent, decorators: [{
|
|
1922
1936
|
type: Component,
|
|
1923
|
-
args: [{ selector: 'igo-entity-selector', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatFormFieldModule, MatSelectModule, MatOptionModule, AsyncPipe], template: "<mat-form-field class=\"igo-entity-selector\" subscriptSizing=\"dynamic\">\n <mat-select\n [disabled]=\"disabled()\"\n [value]=\"selected$ | async\"\n [multiple]=\"multi()\"\n [placeholder]=\"placeholder()\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @if (emptyText() !== undefined && multi() === false) {\n <mat-option [value]=\"emptyValue\">{{ emptyText() }}</mat-option>\n }\n @if (multi() === true) {\n <mat-option [value]=\"multiSelectValue\">{{\n multiText$ | async\n }}</mat-option>\n }\n @for (record of store()
|
|
1937
|
+
args: [{ selector: 'igo-entity-selector', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatFormFieldModule, MatSelectModule, MatOptionModule, AsyncPipe], template: "<mat-form-field class=\"igo-entity-selector\" subscriptSizing=\"dynamic\">\n <mat-select\n [disabled]=\"disabled()\"\n [value]=\"selected$ | async\"\n [multiple]=\"multi()\"\n [placeholder]=\"placeholder() ?? ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @if (emptyText() !== undefined && multi() === false) {\n <mat-option [value]=\"emptyValue\">{{ emptyText() }}</mat-option>\n }\n @if (multi() === true) {\n <mat-option [value]=\"multiSelectValue\">{{\n multiText$ | async\n }}</mat-option>\n }\n @for (record of store()?.stateView?.all$() | async; track record) {\n <mat-option [value]=\"record.entity\">\n {{ titleAccessor()(record.entity) }}\n </mat-option>\n }\n </mat-select>\n</mat-form-field>\n", styles: [":host{--mat-form-field-container-height: 48px;--mat-form-field-container-vertical-padding: 12px}mat-form-field{width:100%}\n"] }]
|
|
1924
1938
|
}], propDecorators: { store: [{ type: i0.Input, args: [{ isSignal: true, alias: "store", required: false }] }], titleAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleAccessor", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], multi: [{ type: i0.Input, args: [{ isSignal: true, alias: "multi", required: false }] }], multiAllText: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiAllText", required: false }] }], multiNoneText: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiNoneText", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
1925
1939
|
|
|
1926
1940
|
/**
|
|
@@ -1955,11 +1969,11 @@ class EntityTablePaginatorComponent {
|
|
|
1955
1969
|
/**
|
|
1956
1970
|
* Entity store
|
|
1957
1971
|
*/
|
|
1958
|
-
store = input(
|
|
1972
|
+
store = input(...(ngDevMode ? [undefined, { debugName: "store" }] : /* istanbul ignore next */ []));
|
|
1959
1973
|
/**
|
|
1960
1974
|
* Paginator options
|
|
1961
1975
|
*/
|
|
1962
|
-
paginatorOptions = input(
|
|
1976
|
+
paginatorOptions = input(...(ngDevMode ? [undefined, { debugName: "paginatorOptions" }] : /* istanbul ignore next */ []));
|
|
1963
1977
|
length = 0;
|
|
1964
1978
|
/**
|
|
1965
1979
|
* Paginator emitted.
|
|
@@ -1968,10 +1982,13 @@ class EntityTablePaginatorComponent {
|
|
|
1968
1982
|
paginator = viewChild(MatPaginator, ...(ngDevMode ? [{ debugName: "paginator" }] : /* istanbul ignore next */ []));
|
|
1969
1983
|
ngOnChanges() {
|
|
1970
1984
|
this.unsubscribeAll();
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
this.
|
|
1974
|
-
|
|
1985
|
+
const store = this.store();
|
|
1986
|
+
if (store) {
|
|
1987
|
+
this.count$$ = store.stateView.count$.subscribe((count) => {
|
|
1988
|
+
this.length = count;
|
|
1989
|
+
this.emitPaginator();
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1975
1992
|
this.entitySortChange$$ = this.entitySortChange$().subscribe(() => {
|
|
1976
1993
|
const paginator = this.paginator();
|
|
1977
1994
|
if (paginator) {
|
|
@@ -2003,28 +2020,40 @@ class EntityTablePaginatorComponent {
|
|
|
2003
2020
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
2004
2021
|
.get('igo.common.paginator.firstPageLabel')
|
|
2005
2022
|
.subscribe((label) => {
|
|
2006
|
-
this.paginator()
|
|
2023
|
+
const p = this.paginator();
|
|
2024
|
+
if (p)
|
|
2025
|
+
p._intl.firstPageLabel = label;
|
|
2007
2026
|
}));
|
|
2008
|
-
this.paginator()
|
|
2027
|
+
const p = this.paginator();
|
|
2028
|
+
if (p)
|
|
2029
|
+
p._intl.getRangeLabel = this.rangeLabel;
|
|
2009
2030
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
2010
2031
|
.get('igo.common.paginator.itemsPerPageLabel')
|
|
2011
2032
|
.subscribe((label) => {
|
|
2012
|
-
this.paginator()
|
|
2033
|
+
const p = this.paginator();
|
|
2034
|
+
if (p)
|
|
2035
|
+
p._intl.itemsPerPageLabel = label;
|
|
2013
2036
|
}));
|
|
2014
2037
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
2015
2038
|
.get('igo.common.paginator.lastPageLabel')
|
|
2016
2039
|
.subscribe((label) => {
|
|
2017
|
-
this.paginator()
|
|
2040
|
+
const p = this.paginator();
|
|
2041
|
+
if (p)
|
|
2042
|
+
p._intl.lastPageLabel = label;
|
|
2018
2043
|
}));
|
|
2019
2044
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
2020
2045
|
.get('igo.common.paginator.nextPageLabel')
|
|
2021
2046
|
.subscribe((label) => {
|
|
2022
|
-
this.paginator()
|
|
2047
|
+
const p = this.paginator();
|
|
2048
|
+
if (p)
|
|
2049
|
+
p._intl.nextPageLabel = label;
|
|
2023
2050
|
}));
|
|
2024
2051
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
2025
2052
|
.get('igo.common.paginator.previousPageLabel')
|
|
2026
2053
|
.subscribe((label) => {
|
|
2027
|
-
this.paginator()
|
|
2054
|
+
const p = this.paginator();
|
|
2055
|
+
if (p)
|
|
2056
|
+
p._intl.previousPageLabel = label;
|
|
2028
2057
|
}));
|
|
2029
2058
|
}
|
|
2030
2059
|
rangeLabel = (page, pageSize, length) => {
|
|
@@ -2057,7 +2086,9 @@ class EntityTablePaginatorComponent {
|
|
|
2057
2086
|
this.unsubscribeAll();
|
|
2058
2087
|
}
|
|
2059
2088
|
emitPaginator() {
|
|
2060
|
-
this.
|
|
2089
|
+
const p = this.paginator();
|
|
2090
|
+
if (p)
|
|
2091
|
+
this.paginatorChange.emit(p);
|
|
2061
2092
|
}
|
|
2062
2093
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: EntityTablePaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2063
2094
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: EntityTablePaginatorComponent, isStandalone: true, selector: "igo-entity-table-paginator", inputs: { entitySortChange$: { classPropertyName: "entitySortChange$", publicName: "entitySortChange$", isSignal: true, isRequired: false, transformFunction: null }, store: { classPropertyName: "store", publicName: "store", isSignal: true, isRequired: false, transformFunction: null }, paginatorOptions: { classPropertyName: "paginatorOptions", publicName: "paginatorOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { paginatorChange: "paginatorChange" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<mat-paginator\n [disabled]=\"disabled\"\n [hidePageSize]=\"hidePageSize\"\n [length]=\"length\"\n [pageIndex]=\"pageIndex\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [showFirstLastButtons]=\"showFirstLastButtons\"\n (page)=\"emitPaginator()\"\n/>\n", styles: [":host ::ng-deep .mat-mdc-paginator-container{min-height:unset}\n"], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -2231,7 +2262,7 @@ class EntityTableComponent {
|
|
|
2231
2262
|
/**
|
|
2232
2263
|
* Entity store
|
|
2233
2264
|
*/
|
|
2234
|
-
store = input(
|
|
2265
|
+
store = input(...(ngDevMode ? [undefined, { debugName: "store" }] : /* istanbul ignore next */ []));
|
|
2235
2266
|
/**
|
|
2236
2267
|
* Table paginator
|
|
2237
2268
|
*/
|
|
@@ -2246,7 +2277,7 @@ class EntityTableComponent {
|
|
|
2246
2277
|
/**
|
|
2247
2278
|
* Table template
|
|
2248
2279
|
*/
|
|
2249
|
-
template = input(
|
|
2280
|
+
template = input(...(ngDevMode ? [undefined, { debugName: "template" }] : /* istanbul ignore next */ []));
|
|
2250
2281
|
/**
|
|
2251
2282
|
* Scroll behavior on selection
|
|
2252
2283
|
*/
|
|
@@ -2262,7 +2293,7 @@ class EntityTableComponent {
|
|
|
2262
2293
|
/**
|
|
2263
2294
|
* Paginator options
|
|
2264
2295
|
*/
|
|
2265
|
-
paginatorOptions = input(
|
|
2296
|
+
paginatorOptions = input(...(ngDevMode ? [undefined, { debugName: "paginatorOptions" }] : /* istanbul ignore next */ []));
|
|
2266
2297
|
/**
|
|
2267
2298
|
* Event emitted when an entity (row) is clicked
|
|
2268
2299
|
*/
|
|
@@ -2281,8 +2312,8 @@ class EntityTableComponent {
|
|
|
2281
2312
|
*/
|
|
2282
2313
|
get headers() {
|
|
2283
2314
|
let columns = this.template()
|
|
2284
|
-
|
|
2285
|
-
.map((column) => column.name);
|
|
2315
|
+
?.columns.filter((column) => column.visible !== false)
|
|
2316
|
+
.map((column) => column.name) ?? [];
|
|
2286
2317
|
if (this.selectionCheckbox === true) {
|
|
2287
2318
|
columns = ['selectionCheckbox'].concat(columns);
|
|
2288
2319
|
}
|
|
@@ -2298,21 +2329,21 @@ class EntityTableComponent {
|
|
|
2298
2329
|
* @internal
|
|
2299
2330
|
*/
|
|
2300
2331
|
get selection() {
|
|
2301
|
-
return this.template()
|
|
2332
|
+
return this.template()?.selection || false;
|
|
2302
2333
|
}
|
|
2303
2334
|
/**
|
|
2304
2335
|
* Whether a selection checkbox should be displayed
|
|
2305
2336
|
* @internal
|
|
2306
2337
|
*/
|
|
2307
2338
|
get selectionCheckbox() {
|
|
2308
|
-
return this.template()
|
|
2339
|
+
return this.template()?.selectionCheckbox || false;
|
|
2309
2340
|
}
|
|
2310
2341
|
/**
|
|
2311
2342
|
* Whether selection many entities should eb supported
|
|
2312
2343
|
* @internal
|
|
2313
2344
|
*/
|
|
2314
2345
|
get selectMany() {
|
|
2315
|
-
return this.template()
|
|
2346
|
+
return this.template()?.selectMany || false;
|
|
2316
2347
|
}
|
|
2317
2348
|
/**
|
|
2318
2349
|
* Whether selection many entities should eb supported
|
|
@@ -2320,11 +2351,11 @@ class EntityTableComponent {
|
|
|
2320
2351
|
*/
|
|
2321
2352
|
get fixedHeader() {
|
|
2322
2353
|
const template = this.template();
|
|
2323
|
-
return template
|
|
2354
|
+
return template?.fixedHeader === undefined ? true : template.fixedHeader;
|
|
2324
2355
|
}
|
|
2325
2356
|
get tableHeight() {
|
|
2326
2357
|
const template = this.template();
|
|
2327
|
-
return template
|
|
2358
|
+
return template?.tableHeight ? template.tableHeight : 'auto';
|
|
2328
2359
|
}
|
|
2329
2360
|
constructor() {
|
|
2330
2361
|
this.dateAdapter.setLocale('fr-CA');
|
|
@@ -2337,7 +2368,7 @@ class EntityTableComponent {
|
|
|
2337
2368
|
this.handleDatasource();
|
|
2338
2369
|
this.dataSource.paginator = this.paginator;
|
|
2339
2370
|
this.store()
|
|
2340
|
-
|
|
2371
|
+
?.state.change$.pipe(debounceTime(100))
|
|
2341
2372
|
.subscribe(() => {
|
|
2342
2373
|
this.handleDatasource();
|
|
2343
2374
|
this.refresh();
|
|
@@ -2357,7 +2388,7 @@ class EntityTableComponent {
|
|
|
2357
2388
|
*/
|
|
2358
2389
|
onValueChange(column, record, event) {
|
|
2359
2390
|
const key = this.getColumnKeyWithoutPropertiesTag(column);
|
|
2360
|
-
record.entity.properties[key] = event.target
|
|
2391
|
+
record.entity.properties[key] = event.target?.value;
|
|
2361
2392
|
}
|
|
2362
2393
|
/**
|
|
2363
2394
|
* Process boolean value change (edition)
|
|
@@ -2396,7 +2427,7 @@ class EntityTableComponent {
|
|
|
2396
2427
|
*/
|
|
2397
2428
|
enableEdit(record) {
|
|
2398
2429
|
const item = record.entity.properties || record.entity;
|
|
2399
|
-
this.template()
|
|
2430
|
+
this.template()?.columns.forEach((column) => {
|
|
2400
2431
|
column.title =
|
|
2401
2432
|
column.validation?.mandatory && !column.title.includes('*')
|
|
2402
2433
|
? column.title + ' *'
|
|
@@ -2427,7 +2458,7 @@ class EntityTableComponent {
|
|
|
2427
2458
|
this.filteredOptions[column.name] = new Observable();
|
|
2428
2459
|
this.filteredOptions[column.name] = this.formGroup.controls[column.name].valueChanges.pipe(map$1((value) => {
|
|
2429
2460
|
if (value?.length) {
|
|
2430
|
-
return column.domainValues?.filter((option) => {
|
|
2461
|
+
return (column.domainValues?.filter((option) => {
|
|
2431
2462
|
const filterNormalized = value
|
|
2432
2463
|
? value
|
|
2433
2464
|
.toLowerCase()
|
|
@@ -2439,11 +2470,12 @@ class EntityTableComponent {
|
|
|
2439
2470
|
.normalize('NFD')
|
|
2440
2471
|
.replace(/[\u0300-\u036f]/g, '');
|
|
2441
2472
|
return featureNameNormalized.includes(filterNormalized);
|
|
2442
|
-
});
|
|
2473
|
+
}) ?? []);
|
|
2443
2474
|
}
|
|
2475
|
+
return [];
|
|
2444
2476
|
}));
|
|
2445
2477
|
let formControlValue = item[key];
|
|
2446
|
-
column.domainValues
|
|
2478
|
+
column.domainValues?.forEach((option) => {
|
|
2447
2479
|
if (typeof formControlValue === 'string' &&
|
|
2448
2480
|
StringUtils.isValidNumber(formControlValue) &&
|
|
2449
2481
|
!StringUtils.isOctalNumber(formControlValue)) {
|
|
@@ -2486,17 +2518,18 @@ class EntityTableComponent {
|
|
|
2486
2518
|
handleDatasource() {
|
|
2487
2519
|
this.unsubscribeStore();
|
|
2488
2520
|
this.selection$$ = this.store()
|
|
2489
|
-
|
|
2521
|
+
?.stateView.manyBy$((record) => record.state.selected === true)
|
|
2490
2522
|
.subscribe((records) => {
|
|
2491
2523
|
const firstSelected = records[0];
|
|
2492
2524
|
const firstSelectedStateviewPosition = this.store()
|
|
2493
|
-
|
|
2525
|
+
?.stateView.all()
|
|
2494
2526
|
.indexOf(firstSelected);
|
|
2495
2527
|
const pageMax = this.paginator
|
|
2496
2528
|
? this.paginator.pageSize * (this.paginator.pageIndex + 1)
|
|
2497
2529
|
: 0;
|
|
2498
2530
|
const pageMin = this.paginator ? pageMax - this.paginator.pageSize : 0;
|
|
2499
2531
|
if (this.paginator &&
|
|
2532
|
+
firstSelectedStateviewPosition !== undefined &&
|
|
2500
2533
|
(firstSelectedStateviewPosition < pageMin ||
|
|
2501
2534
|
firstSelectedStateviewPosition >= pageMax)) {
|
|
2502
2535
|
const pageToReach = Math.floor(firstSelectedStateviewPosition / this.paginator.pageSize);
|
|
@@ -2505,7 +2538,7 @@ class EntityTableComponent {
|
|
|
2505
2538
|
this.selectionState$.next(this.computeSelectionState(records));
|
|
2506
2539
|
});
|
|
2507
2540
|
this.dataSource$$ = this.store()
|
|
2508
|
-
|
|
2541
|
+
?.stateView.all$()
|
|
2509
2542
|
.subscribe((all) => {
|
|
2510
2543
|
if (all[0]) {
|
|
2511
2544
|
this.enableEdit(all[0]);
|
|
@@ -2513,7 +2546,7 @@ class EntityTableComponent {
|
|
|
2513
2546
|
this.dataSource.data = all.map((record) => {
|
|
2514
2547
|
return {
|
|
2515
2548
|
record,
|
|
2516
|
-
cellData: this.template()
|
|
2549
|
+
cellData: (this.template()?.columns.reduce((cellData, column) => {
|
|
2517
2550
|
const value = this.getValue(record, column);
|
|
2518
2551
|
cellData[column.name] = {
|
|
2519
2552
|
class: this.getCellClass(record, column),
|
|
@@ -2522,7 +2555,7 @@ class EntityTableComponent {
|
|
|
2522
2555
|
isImg: this.isImg(value)
|
|
2523
2556
|
};
|
|
2524
2557
|
return cellData;
|
|
2525
|
-
}, {})
|
|
2558
|
+
}, {}) ?? {})
|
|
2526
2559
|
};
|
|
2527
2560
|
});
|
|
2528
2561
|
});
|
|
@@ -2570,9 +2603,9 @@ class EntityTableComponent {
|
|
|
2570
2603
|
*/
|
|
2571
2604
|
onSort(event) {
|
|
2572
2605
|
const direction = event.direction;
|
|
2573
|
-
const column = this.template()
|
|
2574
|
-
if (direction === 'asc' || direction === 'desc') {
|
|
2575
|
-
this.store()
|
|
2606
|
+
const column = this.template()?.columns.find((c) => c.name === event.active);
|
|
2607
|
+
if (column && (direction === 'asc' || direction === 'desc')) {
|
|
2608
|
+
this.store()?.stateView.sort({
|
|
2576
2609
|
valueAccessor: (record) => this.getValue(record, column),
|
|
2577
2610
|
direction,
|
|
2578
2611
|
nullsFirst: this.sortNullsFirst()
|
|
@@ -2581,7 +2614,7 @@ class EntityTableComponent {
|
|
|
2581
2614
|
this.entitySortChange$.next(true);
|
|
2582
2615
|
}
|
|
2583
2616
|
else {
|
|
2584
|
-
this.store()
|
|
2617
|
+
this.store()?.stateView.sort(undefined);
|
|
2585
2618
|
}
|
|
2586
2619
|
}
|
|
2587
2620
|
/**
|
|
@@ -2590,7 +2623,7 @@ class EntityTableComponent {
|
|
|
2590
2623
|
* @internal
|
|
2591
2624
|
*/
|
|
2592
2625
|
onRowClick(record) {
|
|
2593
|
-
this.lastRecordCheckedKey = this.store()
|
|
2626
|
+
this.lastRecordCheckedKey = this.store()?.stateView.getKey(record);
|
|
2594
2627
|
this.entityClick.emit(record.entity);
|
|
2595
2628
|
}
|
|
2596
2629
|
/**
|
|
@@ -2605,7 +2638,7 @@ class EntityTableComponent {
|
|
|
2605
2638
|
return;
|
|
2606
2639
|
}
|
|
2607
2640
|
const entity = record.entity;
|
|
2608
|
-
this.store()
|
|
2641
|
+
this.store()?.state.update(entity, { selected: true }, true);
|
|
2609
2642
|
this.entitySelectChange.emit({ added: [entity] });
|
|
2610
2643
|
}
|
|
2611
2644
|
/**
|
|
@@ -2617,9 +2650,11 @@ class EntityTableComponent {
|
|
|
2617
2650
|
if (this.selection === false) {
|
|
2618
2651
|
return;
|
|
2619
2652
|
}
|
|
2620
|
-
const entities = this.store()
|
|
2653
|
+
const entities = this.store()?.view.all();
|
|
2654
|
+
if (entities === undefined)
|
|
2655
|
+
return;
|
|
2621
2656
|
this.entitySelectChange.emit({ added: [entities] });
|
|
2622
|
-
this.store()
|
|
2657
|
+
this.store()?.state.updateMany(entities, { selected: toggle });
|
|
2623
2658
|
}
|
|
2624
2659
|
/**
|
|
2625
2660
|
* When an entity is toggled, select or unselect it in the store. On select,
|
|
@@ -2634,11 +2669,11 @@ class EntityTableComponent {
|
|
|
2634
2669
|
}
|
|
2635
2670
|
const entity = record.entity;
|
|
2636
2671
|
const exclusive = toggle === true && !this.selectMany;
|
|
2637
|
-
this.store()
|
|
2672
|
+
this.store()?.state.update(entity, { selected: toggle }, exclusive);
|
|
2638
2673
|
if (toggle === true) {
|
|
2639
2674
|
this.entitySelectChange.emit({ added: [entity] });
|
|
2640
2675
|
}
|
|
2641
|
-
this.lastRecordCheckedKey = this.store()
|
|
2676
|
+
this.lastRecordCheckedKey = this.store()?.stateView.getKey(record);
|
|
2642
2677
|
}
|
|
2643
2678
|
/**
|
|
2644
2679
|
* When an entity is toggled, select or unselect it in the store. On select,
|
|
@@ -2660,21 +2695,25 @@ class EntityTableComponent {
|
|
|
2660
2695
|
// See https://github.com/angular/components/issues/6232
|
|
2661
2696
|
const range = window.document.createRange();
|
|
2662
2697
|
range.selectNode(event.target);
|
|
2663
|
-
window.getSelection()
|
|
2664
|
-
window.getSelection()
|
|
2698
|
+
window.getSelection()?.removeAllRanges();
|
|
2699
|
+
window.getSelection()?.addRange(range);
|
|
2665
2700
|
event.stopImmediatePropagation();
|
|
2666
|
-
const records = this.store()
|
|
2701
|
+
const records = this.store()?.stateView.all();
|
|
2702
|
+
if (!records)
|
|
2703
|
+
return;
|
|
2667
2704
|
const recordIndex = records.indexOf(record);
|
|
2668
|
-
const lastRecordChecked = this.store()
|
|
2669
|
-
const lastRecordIndex =
|
|
2705
|
+
const lastRecordChecked = this.store()?.stateView.get(this.lastRecordCheckedKey);
|
|
2706
|
+
const lastRecordIndex = lastRecordChecked
|
|
2707
|
+
? records.indexOf(lastRecordChecked)
|
|
2708
|
+
: -1;
|
|
2670
2709
|
const indexes = [recordIndex, lastRecordIndex];
|
|
2671
2710
|
const selectRecords = records.slice(Math.min(...indexes), Math.max(...indexes) + 1);
|
|
2672
2711
|
const entities = selectRecords.map((_record) => _record.entity);
|
|
2673
|
-
this.store()
|
|
2712
|
+
this.store()?.state.updateMany(entities, { selected: toggle });
|
|
2674
2713
|
if (toggle === true) {
|
|
2675
2714
|
this.entitySelectChange.emit({ added: entities });
|
|
2676
2715
|
}
|
|
2677
|
-
this.lastRecordCheckedKey = this.store()
|
|
2716
|
+
this.lastRecordCheckedKey = this.store()?.stateView.getKey(record);
|
|
2678
2717
|
}
|
|
2679
2718
|
/**
|
|
2680
2719
|
* Compute the selection state
|
|
@@ -2686,7 +2725,7 @@ class EntityTableComponent {
|
|
|
2686
2725
|
const selectionCount = selectedRecords.length;
|
|
2687
2726
|
return selectionCount === 0
|
|
2688
2727
|
? states.None
|
|
2689
|
-
: selectionCount === this.store()
|
|
2728
|
+
: selectionCount === this.store()?.stateView.count
|
|
2690
2729
|
? states.All
|
|
2691
2730
|
: states.Some;
|
|
2692
2731
|
}
|
|
@@ -2700,7 +2739,7 @@ class EntityTableComponent {
|
|
|
2700
2739
|
let sortable = column.sort;
|
|
2701
2740
|
if (sortable === undefined) {
|
|
2702
2741
|
const template = this.template();
|
|
2703
|
-
sortable = template
|
|
2742
|
+
sortable = template?.sort === undefined ? false : template.sort;
|
|
2704
2743
|
}
|
|
2705
2744
|
return sortable;
|
|
2706
2745
|
}
|
|
@@ -2716,20 +2755,15 @@ class EntityTableComponent {
|
|
|
2716
2755
|
}
|
|
2717
2756
|
isImg(value) {
|
|
2718
2757
|
if (this.isUrl(value)) {
|
|
2719
|
-
return (['jpg', 'png', 'gif'].indexOf(value.split('.').pop()
|
|
2720
|
-
-1);
|
|
2721
|
-
}
|
|
2722
|
-
else {
|
|
2723
|
-
return false;
|
|
2758
|
+
return (['jpg', 'png', 'gif'].indexOf(value.split('.').pop()?.toLowerCase() ?? '') !== -1);
|
|
2724
2759
|
}
|
|
2760
|
+
return false;
|
|
2725
2761
|
}
|
|
2726
2762
|
isUrl(value) {
|
|
2727
2763
|
if (typeof value === 'string') {
|
|
2728
2764
|
return (value.slice(0, 8) === 'https://' || value.slice(0, 7) === 'http://');
|
|
2729
2765
|
}
|
|
2730
|
-
|
|
2731
|
-
return false;
|
|
2732
|
-
}
|
|
2766
|
+
return false;
|
|
2733
2767
|
}
|
|
2734
2768
|
/**
|
|
2735
2769
|
* Method to access an entity's values
|
|
@@ -2745,10 +2779,10 @@ class EntityTableComponent {
|
|
|
2745
2779
|
return column.valueAccessor(entity, record);
|
|
2746
2780
|
}
|
|
2747
2781
|
const template = this.template();
|
|
2748
|
-
if (template
|
|
2782
|
+
if (template?.valueAccessor !== undefined) {
|
|
2749
2783
|
return template.valueAccessor(entity, column.name, record);
|
|
2750
2784
|
}
|
|
2751
|
-
value = this.store()
|
|
2785
|
+
value = this.store()?.getProperty(entity, column.name);
|
|
2752
2786
|
if (column.type === 'boolean') {
|
|
2753
2787
|
if (value === undefined || value === null || value === '') {
|
|
2754
2788
|
value = false;
|
|
@@ -2773,7 +2807,7 @@ class EntityTableComponent {
|
|
|
2773
2807
|
if (column.multiple) {
|
|
2774
2808
|
let list_id;
|
|
2775
2809
|
typeof value === 'string'
|
|
2776
|
-
? (list_id = value.match(/[\w.-]+/g).map(Number))
|
|
2810
|
+
? (list_id = (value.match(/[\w.-]+/g) ?? []).map(Number))
|
|
2777
2811
|
: (list_id = value);
|
|
2778
2812
|
const list_option = [];
|
|
2779
2813
|
column.domainValues.forEach((option) => {
|
|
@@ -2856,9 +2890,10 @@ class EntityTableComponent {
|
|
|
2856
2890
|
* @internal
|
|
2857
2891
|
*/
|
|
2858
2892
|
getValidationAttributeValue(column, validationType) {
|
|
2893
|
+
const validation = column.validation;
|
|
2859
2894
|
if (column.validation !== undefined &&
|
|
2860
|
-
|
|
2861
|
-
return
|
|
2895
|
+
validation[validationType] !== undefined) {
|
|
2896
|
+
return validation[validationType];
|
|
2862
2897
|
}
|
|
2863
2898
|
else {
|
|
2864
2899
|
return false;
|
|
@@ -2895,7 +2930,7 @@ class EntityTableComponent {
|
|
|
2895
2930
|
* @internal
|
|
2896
2931
|
*/
|
|
2897
2932
|
getHeaderClass() {
|
|
2898
|
-
const func = this.template()
|
|
2933
|
+
const func = this.template()?.headerClassFunc;
|
|
2899
2934
|
if (func instanceof Function) {
|
|
2900
2935
|
return func();
|
|
2901
2936
|
}
|
|
@@ -2909,7 +2944,7 @@ class EntityTableComponent {
|
|
|
2909
2944
|
*/
|
|
2910
2945
|
getRowClass(record) {
|
|
2911
2946
|
const entity = record.entity;
|
|
2912
|
-
const func = this.template()
|
|
2947
|
+
const func = this.template()?.rowClassFunc;
|
|
2913
2948
|
if (func instanceof Function) {
|
|
2914
2949
|
return func(entity, record);
|
|
2915
2950
|
}
|
|
@@ -2925,7 +2960,7 @@ class EntityTableComponent {
|
|
|
2925
2960
|
getCellClass(record, column) {
|
|
2926
2961
|
const entity = record.entity;
|
|
2927
2962
|
const cls = {};
|
|
2928
|
-
const tableFunc = this.template()
|
|
2963
|
+
const tableFunc = this.template()?.cellClassFunc;
|
|
2929
2964
|
if (tableFunc instanceof Function) {
|
|
2930
2965
|
Object.assign(cls, tableFunc(entity, column, record));
|
|
2931
2966
|
}
|
|
@@ -2960,7 +2995,7 @@ class EntityTableComponent {
|
|
|
2960
2995
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: EntityTableComponent, isStandalone: true, selector: "igo-entity-table", inputs: { store: { classPropertyName: "store", publicName: "store", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: false, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, sortNullsFirst: { classPropertyName: "sortNullsFirst", publicName: "sortNullsFirst", isSignal: true, isRequired: false, transformFunction: null }, withPaginator: { classPropertyName: "withPaginator", publicName: "withPaginator", isSignal: true, isRequired: false, transformFunction: null }, paginatorOptions: { classPropertyName: "paginatorOptions", publicName: "paginatorOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { entityClick: "entityClick", entitySelectChange: "entitySelectChange", entitySortChange: "entitySortChange" }, providers: [
|
|
2961
2996
|
{ provide: MatFormFieldControl, useExisting: EntityTableComponent },
|
|
2962
2997
|
provideMomentDateAdapter()
|
|
2963
|
-
], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-container\" [style.height]=\"tableHeight\">\n <table\n id=\"currentWorkspaceTable\"\n mat-table\n matSort\n [ngClass]=\"getTableClass()\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"getTrackByFunction()\"\n (matSortChange)=\"onSort($event)\"\n >\n <ng-container matColumnDef=\"selectionCheckbox\" class=\"mat-cell-checkbox\">\n <th mat-header-cell *matHeaderCellDef>\n @if (selectMany) {\n @let selectionState = selectionState$ | async;\n @if (selectionState) {\n <mat-checkbox\n (change)=\"onToggleRows($event.checked)\"\n [checked]=\"selectionState === entityTableSelectionState.All\"\n [indeterminate]=\"\n selectionState === entityTableSelectionState.Some\n \"\n />\n }\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox\n (mousedown)=\"$event.shiftKey ? $event.preventDefault() : null\"\n (click)=\"\n $event.shiftKey\n ? onShiftToggleRow(!rowIsSelected(row.record), row.record, $event)\n : $event.stopPropagation()\n \"\n (change)=\"onToggleRow($event.checked, row.record)\"\n [checked]=\"rowIsSelected(row.record)\"\n />\n </td>\n </ng-container>\n\n @for (column of template().columns; track column) {\n <ng-container [matColumnDef]=\"column.name\">\n @if (columnIsSortable(column)) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n } @else {\n <th\n mat-header-cell\n *matHeaderCellDef\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n }\n\n @let columnRenderer = getColumnRenderer(column);\n @if (columnRenderer) {\n @switch (columnRenderer) {\n @case (entityTableColumnRenderer.HTML) {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"row.cellData[column.name].value\"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{ 'igo.geo.targetHtmlUrl' | translate }} </span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.UnsanitizedHTML) {\n <ng-container *matCellDef=\"let row\">\n @if (isEdition(row.record)) {\n <td\n mat-cell\n class=\"mat-cell-text edition\"\n [formGroup]=\"formGroup\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @switch (column.type) {\n @case ('date') {\n <div class=\"date-picker\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\" />\n <input\n matInput\n [matDatepicker]=\"picker\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (dateChange)=\"\n onDateChange(column.name, row.record, $event)\n \"\n />\n <mat-datepicker #picker />\n </div>\n }\n @case ('time') {\n <input\n matInput\n type=\"time\"\n [formControlName]=\"column.name\"\n step=\"900\"\n (focus)=\"column.onFocus($event)\"\n (keypress)=\"column.onChange($event)\"\n (blur)=\"column.onBlur($event)\"\n />\n }\n @case ('number') {\n <input\n matInput\n type=\"number\"\n class=\"class_number_edition\"\n [formControlName]=\"column.name\"\n step=\"{{ column.step }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n min=\"{{\n getValidationAttributeValue(column, 'minValue')\n }}\"\n max=\"{{\n getValidationAttributeValue(column, 'maxValue')\n }}\"\n />\n }\n @case ('boolean') {\n <mat-checkbox\n [formControlName]=\"column.name\"\n [checked]=\"row.cellData[column.name].value\"\n (change)=\"\n onBooleanValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n />\n }\n @case ('list') {\n <mat-select\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n [formControlName]=\"column.name\"\n [multiple]=\"column.multiple\"\n (selectionChange)=\"\n onSelectValueChange(column.name, row.record, $event)\n \"\n [value]=\"row.cellData[column.name].value\"\n >\n @for (\n option of $any(column).domainValues;\n track option\n ) {\n <mat-option\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\n }\n </mat-select>\n }\n @case ('autocomplete') {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n [matAutocomplete]=\"auto\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"\n onAutocompleteValueChange(\n column,\n row.record,\n $event\n )\n \"\n panelWidth=\"430px\"\n >\n @for (\n option of filteredOptions[column.name] | async;\n track option\n ) {\n <mat-option [value]=\"option.id\">\n {{ option.value }}\n </mat-option>\n }\n </mat-autocomplete>\n }\n @default {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n />\n }\n }\n </td>\n } @else {\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"\n row.cellData[column.name].value | sanitizeHtml\n \"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n ><span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n >\n </a>\n </td>\n }\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.Icon) {\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @if (column.onClick) {\n <mat-icon (click)=\"column.onClick($event)\">{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n } @else {\n <mat-icon>{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n }\n </td>\n }\n @case (entityTableColumnRenderer.ButtonGroup) {\n <ng-container *matCellDef=\"let row\">\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @for (\n button of row.cellData[column.name].value;\n track button\n ) {\n @if (\n isEdition(row.record) === button.editMode ||\n button.editMode === undefined\n ) {\n <span>\n @if (button.style === 'mat-icon-button') {\n <button\n igoStopPropagation\n mat-icon-button\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n igoStopPropagation\n mat-mini-fab\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n }\n </span>\n }\n }\n </td>\n </ng-container>\n }\n @default {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n {{ row.cellData[column.name].value }}\n </td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{\n 'igo.common.entity-table.targetHtmlUrl' | translate\n }}</span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n }\n }\n </ng-container>\n }\n\n <tr\n mat-header-row\n *matHeaderRowDef=\"headers; sticky: fixedHeader\"\n [ngClass]=\"getHeaderClass()\"\n ></tr>\n <tr\n mat-row\n igoEntityTableRow\n *matRowDef=\"let row; columns: headers\"\n [scrollBehavior]=\"scrollBehavior()\"\n [ngClass]=\"getRowClass(row.record)\"\n [selection]=\"selection\"\n [selected]=\"rowIsSelected(row.record)\"\n (select)=\"onRowSelect(row.record)\"\n (click)=\"onRowClick(row.record)\"\n ></tr>\n </table>\n @if (withPaginator()) {\n <igo-entity-table-paginator\n [store]=\"store()\"\n [paginatorOptions]=\"paginatorOptions()\"\n [entitySortChange$]=\"entitySortChange$\"\n (paginatorChange)=\"paginatorChange($event)\"\n />\n }\n</div>\n", styles: [":host{width:100%;height:100%;display:block;--mat-table-header-container-height: 52px}:host.table-compact tr.mat-mdc-header-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:36px}:host.table-compact tr.mat-mdc-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:28px}.table-container{display:flex;flex-direction:column;height:100%;overflow:auto;flex:1 1 auto}.mat-cell-text{overflow:hidden;word-wrap:break-word}table.igo-entity-table-with-selection tr:hover{-moz-box-shadow:2px 0px 2px 0px #dddddd;-webkit-box-shadow:2px 0px 2px 0px #dddddd;-o-box-shadow:2px 0px 2px 0px #dddddd;box-shadow:2px 0 2px #ddd;cursor:pointer}table button{margin:7px}.class_hidden{visibility:hidden}.class_display_none{display:none}.class_boolean,.class_icon,.class_number{text-align:center;padding-right:35px!important}.class_string,.class_text,.class_number_edition{text-align:left}td.edition{background:#a6a6a633}input{border-bottom:1px solid darkgrey}table.igo-entity-table-with-selection tr.igo-entity-table-row-highlighted{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"], dependencies: [{ kind: "component", type: EntityTablePaginatorComponent, selector: "igo-entity-table-paginator", inputs: ["entitySortChange$", "store", "paginatorOptions"], outputs: ["paginatorChange"] }, { kind: "directive", type: EntityTableRowDirective, selector: "[igoEntityTableRow]", inputs: ["selection", "selectOnClick", "highlightSelection", "selected", "scrollBehavior"], outputs: ["select"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: ImageErrorDirective, selector: "[igoImageError]", inputs: ["errorImageUrl", "hideError"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.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: MatDatepickerModule }, { kind: "component", type: i6.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i6.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i6.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i9.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: MatNativeDateModule }, { kind: "ngmodule", type: // For the DateAdapter provider
|
|
2998
|
+
], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-container\" [style.height]=\"tableHeight\">\n <table\n id=\"currentWorkspaceTable\"\n mat-table\n matSort\n [ngClass]=\"getTableClass()\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"getTrackByFunction()\"\n (matSortChange)=\"onSort($event)\"\n >\n <ng-container matColumnDef=\"selectionCheckbox\" class=\"mat-cell-checkbox\">\n <th mat-header-cell *matHeaderCellDef>\n @if (selectMany) {\n @let selectionState = selectionState$ | async;\n @if (selectionState) {\n <mat-checkbox\n (change)=\"onToggleRows($event.checked)\"\n [checked]=\"selectionState === entityTableSelectionState.All\"\n [indeterminate]=\"\n selectionState === entityTableSelectionState.Some\n \"\n />\n }\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox\n (mousedown)=\"$event.shiftKey ? $event.preventDefault() : null\"\n (click)=\"\n $event.shiftKey\n ? onShiftToggleRow(!rowIsSelected(row.record), row.record, $event)\n : $event.stopPropagation()\n \"\n (change)=\"onToggleRow($event.checked, row.record)\"\n [checked]=\"rowIsSelected(row.record)\"\n />\n </td>\n </ng-container>\n\n @let template = this.template();\n @if (template) {\n @for (column of template.columns; track column) {\n <ng-container [matColumnDef]=\"column.name\">\n @if (columnIsSortable(column)) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n } @else {\n <th\n mat-header-cell\n *matHeaderCellDef\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n }\n\n @let columnRenderer = getColumnRenderer(column);\n @if (columnRenderer) {\n @switch (columnRenderer) {\n @case (entityTableColumnRenderer.HTML) {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"row.cellData[column.name].value\"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n </a>\n </td>\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.UnsanitizedHTML) {\n <ng-container *matCellDef=\"let row\">\n @if (isEdition(row.record)) {\n <td\n mat-cell\n class=\"mat-cell-text edition\"\n [formGroup]=\"formGroup\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @switch (column.type) {\n @case ('date') {\n <div class=\"date-picker\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\" />\n <input\n matInput\n [matDatepicker]=\"picker\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (dateChange)=\"\n onDateChange(column.name, row.record, $event)\n \"\n />\n <mat-datepicker #picker />\n </div>\n }\n @case ('time') {\n <input\n matInput\n type=\"time\"\n [formControlName]=\"column.name\"\n step=\"900\"\n (focus)=\"column?.onFocus($event)\"\n (keypress)=\"column?.onChange($event)\"\n (blur)=\"column?.onBlur($event)\"\n />\n }\n @case ('number') {\n <input\n matInput\n type=\"number\"\n class=\"class_number_edition\"\n [formControlName]=\"column.name\"\n step=\"{{ column.step }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n min=\"{{\n getValidationAttributeValue(column, 'minValue')\n }}\"\n max=\"{{\n getValidationAttributeValue(column, 'maxValue')\n }}\"\n />\n }\n @case ('boolean') {\n <mat-checkbox\n [formControlName]=\"column.name\"\n [checked]=\"row.cellData[column.name].value\"\n (change)=\"\n onBooleanValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n />\n }\n @case ('list') {\n <mat-select\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n [formControlName]=\"column.name\"\n [multiple]=\"column.multiple\"\n (selectionChange)=\"\n onSelectValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n [value]=\"row.cellData[column.name].value\"\n >\n @for (\n option of $any(column).domainValues;\n track option\n ) {\n <mat-option\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\n }\n </mat-select>\n }\n @case ('autocomplete') {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n [matAutocomplete]=\"auto\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"\n onAutocompleteValueChange(\n column,\n row.record,\n $event\n )\n \"\n panelWidth=\"430px\"\n >\n @for (\n option of filteredOptions[column.name] | async;\n track option\n ) {\n <mat-option [value]=\"option.id\">\n {{ option.value }}\n </mat-option>\n }\n </mat-autocomplete>\n }\n @default {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n />\n }\n }\n </td>\n } @else {\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"\n row.cellData[column.name].value | sanitizeHtml\n \"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n ><span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n >\n </a>\n </td>\n }\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.Icon) {\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @if (column.onClick) {\n <mat-icon (click)=\"column.onClick($event)\">{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n } @else {\n <mat-icon>{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n }\n </td>\n }\n @case (entityTableColumnRenderer.ButtonGroup) {\n <ng-container *matCellDef=\"let row\">\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @for (\n button of row.cellData[column.name].value;\n track button\n ) {\n @if (\n isEdition(row.record) === button.editMode ||\n button.editMode === undefined\n ) {\n <span>\n @if (button.style === 'mat-icon-button') {\n <button\n igoStopPropagation\n mat-icon-button\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n igoStopPropagation\n mat-mini-fab\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n }\n </span>\n }\n }\n </td>\n </ng-container>\n }\n @default {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n {{ row.cellData[column.name].value }}\n </td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{\n 'igo.common.entity-table.targetHtmlUrl' | translate\n }}</span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n }\n }\n </ng-container>\n }\n }\n\n <tr\n mat-header-row\n *matHeaderRowDef=\"headers; sticky: fixedHeader\"\n [ngClass]=\"getHeaderClass()\"\n ></tr>\n <tr\n mat-row\n igoEntityTableRow\n *matRowDef=\"let row; columns: headers\"\n [scrollBehavior]=\"scrollBehavior()\"\n [ngClass]=\"getRowClass(row.record)\"\n [selection]=\"selection\"\n [selected]=\"rowIsSelected(row.record)\"\n (select)=\"onRowSelect(row.record)\"\n (click)=\"onRowClick(row.record)\"\n ></tr>\n </table>\n @if (withPaginator()) {\n <igo-entity-table-paginator\n [store]=\"store()\"\n [paginatorOptions]=\"paginatorOptions()\"\n [entitySortChange$]=\"entitySortChange$\"\n (paginatorChange)=\"paginatorChange($event)\"\n />\n }\n</div>\n", styles: [":host{width:100%;height:100%;display:block;--mat-table-header-container-height: 52px}:host.table-compact tr.mat-mdc-header-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:36px}:host.table-compact tr.mat-mdc-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:28px}.table-container{display:flex;flex-direction:column;height:100%;overflow:auto;flex:1 1 auto}.mat-cell-text{overflow:hidden;word-wrap:break-word}table.igo-entity-table-with-selection tr:hover{-moz-box-shadow:2px 0px 2px 0px #dddddd;-webkit-box-shadow:2px 0px 2px 0px #dddddd;-o-box-shadow:2px 0px 2px 0px #dddddd;box-shadow:2px 0 2px #ddd;cursor:pointer}table button{margin:7px}.class_hidden{visibility:hidden}.class_display_none{display:none}.class_boolean,.class_icon,.class_number{text-align:center;padding-right:35px!important}.class_string,.class_text,.class_number_edition{text-align:left}td.edition{background:#a6a6a633}input{border-bottom:1px solid darkgrey}table.igo-entity-table-with-selection tr.igo-entity-table-row-highlighted{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"], dependencies: [{ kind: "component", type: EntityTablePaginatorComponent, selector: "igo-entity-table-paginator", inputs: ["entitySortChange$", "store", "paginatorOptions"], outputs: ["paginatorChange"] }, { kind: "directive", type: EntityTableRowDirective, selector: "[igoEntityTableRow]", inputs: ["selection", "selectOnClick", "highlightSelection", "selected", "scrollBehavior"], outputs: ["select"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: ImageErrorDirective, selector: "[igoImageError]", inputs: ["errorImageUrl", "hideError"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.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: MatDatepickerModule }, { kind: "component", type: i6.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i6.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i6.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i9.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: MatNativeDateModule }, { kind: "ngmodule", type: // For the DateAdapter provider
|
|
2964
2999
|
MatOptionModule }, { 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: "ngmodule", type: MatSortModule }, { kind: "directive", type: i10.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i10.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i11.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i12.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: StopPropagationDirective, selector: "[igoStopPropagation]" }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SanitizeHtmlPipe, name: "sanitizeHtml" }, { kind: "pipe", type: SecureImagePipe, name: "secureImage" }, { kind: "pipe", type: i13.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2965
3000
|
}
|
|
2966
3001
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: EntityTableComponent, decorators: [{
|
|
@@ -2993,7 +3028,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
2993
3028
|
SecureImagePipe,
|
|
2994
3029
|
StopPropagationDirective,
|
|
2995
3030
|
IgoLanguageModule
|
|
2996
|
-
], template: "<div class=\"table-container\" [style.height]=\"tableHeight\">\n <table\n id=\"currentWorkspaceTable\"\n mat-table\n matSort\n [ngClass]=\"getTableClass()\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"getTrackByFunction()\"\n (matSortChange)=\"onSort($event)\"\n >\n <ng-container matColumnDef=\"selectionCheckbox\" class=\"mat-cell-checkbox\">\n <th mat-header-cell *matHeaderCellDef>\n @if (selectMany) {\n @let selectionState = selectionState$ | async;\n @if (selectionState) {\n <mat-checkbox\n (change)=\"onToggleRows($event.checked)\"\n [checked]=\"selectionState === entityTableSelectionState.All\"\n [indeterminate]=\"\n selectionState === entityTableSelectionState.Some\n \"\n />\n }\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox\n (mousedown)=\"$event.shiftKey ? $event.preventDefault() : null\"\n (click)=\"\n $event.shiftKey\n ? onShiftToggleRow(!rowIsSelected(row.record), row.record, $event)\n : $event.stopPropagation()\n \"\n (change)=\"onToggleRow($event.checked, row.record)\"\n [checked]=\"rowIsSelected(row.record)\"\n />\n </td>\n </ng-container>\n\n @for (column of template().columns; track column) {\n <ng-container [matColumnDef]=\"column.name\">\n @if (columnIsSortable(column)) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n } @else {\n <th\n mat-header-cell\n *matHeaderCellDef\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n }\n\n @let columnRenderer = getColumnRenderer(column);\n @if (columnRenderer) {\n @switch (columnRenderer) {\n @case (entityTableColumnRenderer.HTML) {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"row.cellData[column.name].value\"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{ 'igo.geo.targetHtmlUrl' | translate }} </span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.UnsanitizedHTML) {\n <ng-container *matCellDef=\"let row\">\n @if (isEdition(row.record)) {\n <td\n mat-cell\n class=\"mat-cell-text edition\"\n [formGroup]=\"formGroup\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @switch (column.type) {\n @case ('date') {\n <div class=\"date-picker\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\" />\n <input\n matInput\n [matDatepicker]=\"picker\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (dateChange)=\"\n onDateChange(column.name, row.record, $event)\n \"\n />\n <mat-datepicker #picker />\n </div>\n }\n @case ('time') {\n <input\n matInput\n type=\"time\"\n [formControlName]=\"column.name\"\n step=\"900\"\n (focus)=\"column.onFocus($event)\"\n (keypress)=\"column.onChange($event)\"\n (blur)=\"column.onBlur($event)\"\n />\n }\n @case ('number') {\n <input\n matInput\n type=\"number\"\n class=\"class_number_edition\"\n [formControlName]=\"column.name\"\n step=\"{{ column.step }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n min=\"{{\n getValidationAttributeValue(column, 'minValue')\n }}\"\n max=\"{{\n getValidationAttributeValue(column, 'maxValue')\n }}\"\n />\n }\n @case ('boolean') {\n <mat-checkbox\n [formControlName]=\"column.name\"\n [checked]=\"row.cellData[column.name].value\"\n (change)=\"\n onBooleanValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n />\n }\n @case ('list') {\n <mat-select\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n [formControlName]=\"column.name\"\n [multiple]=\"column.multiple\"\n (selectionChange)=\"\n onSelectValueChange(column.name, row.record, $event)\n \"\n [value]=\"row.cellData[column.name].value\"\n >\n @for (\n option of $any(column).domainValues;\n track option\n ) {\n <mat-option\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\n }\n </mat-select>\n }\n @case ('autocomplete') {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n [matAutocomplete]=\"auto\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"\n onAutocompleteValueChange(\n column,\n row.record,\n $event\n )\n \"\n panelWidth=\"430px\"\n >\n @for (\n option of filteredOptions[column.name] | async;\n track option\n ) {\n <mat-option [value]=\"option.id\">\n {{ option.value }}\n </mat-option>\n }\n </mat-autocomplete>\n }\n @default {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n />\n }\n }\n </td>\n } @else {\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"\n row.cellData[column.name].value | sanitizeHtml\n \"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n ><span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n >\n </a>\n </td>\n }\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.Icon) {\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @if (column.onClick) {\n <mat-icon (click)=\"column.onClick($event)\">{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n } @else {\n <mat-icon>{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n }\n </td>\n }\n @case (entityTableColumnRenderer.ButtonGroup) {\n <ng-container *matCellDef=\"let row\">\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @for (\n button of row.cellData[column.name].value;\n track button\n ) {\n @if (\n isEdition(row.record) === button.editMode ||\n button.editMode === undefined\n ) {\n <span>\n @if (button.style === 'mat-icon-button') {\n <button\n igoStopPropagation\n mat-icon-button\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n igoStopPropagation\n mat-mini-fab\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n }\n </span>\n }\n }\n </td>\n </ng-container>\n }\n @default {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n {{ row.cellData[column.name].value }}\n </td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{\n 'igo.common.entity-table.targetHtmlUrl' | translate\n }}</span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n }\n }\n </ng-container>\n }\n\n <tr\n mat-header-row\n *matHeaderRowDef=\"headers; sticky: fixedHeader\"\n [ngClass]=\"getHeaderClass()\"\n ></tr>\n <tr\n mat-row\n igoEntityTableRow\n *matRowDef=\"let row; columns: headers\"\n [scrollBehavior]=\"scrollBehavior()\"\n [ngClass]=\"getRowClass(row.record)\"\n [selection]=\"selection\"\n [selected]=\"rowIsSelected(row.record)\"\n (select)=\"onRowSelect(row.record)\"\n (click)=\"onRowClick(row.record)\"\n ></tr>\n </table>\n @if (withPaginator()) {\n <igo-entity-table-paginator\n [store]=\"store()\"\n [paginatorOptions]=\"paginatorOptions()\"\n [entitySortChange$]=\"entitySortChange$\"\n (paginatorChange)=\"paginatorChange($event)\"\n />\n }\n</div>\n", styles: [":host{width:100%;height:100%;display:block;--mat-table-header-container-height: 52px}:host.table-compact tr.mat-mdc-header-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:36px}:host.table-compact tr.mat-mdc-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:28px}.table-container{display:flex;flex-direction:column;height:100%;overflow:auto;flex:1 1 auto}.mat-cell-text{overflow:hidden;word-wrap:break-word}table.igo-entity-table-with-selection tr:hover{-moz-box-shadow:2px 0px 2px 0px #dddddd;-webkit-box-shadow:2px 0px 2px 0px #dddddd;-o-box-shadow:2px 0px 2px 0px #dddddd;box-shadow:2px 0 2px #ddd;cursor:pointer}table button{margin:7px}.class_hidden{visibility:hidden}.class_display_none{display:none}.class_boolean,.class_icon,.class_number{text-align:center;padding-right:35px!important}.class_string,.class_text,.class_number_edition{text-align:left}td.edition{background:#a6a6a633}input{border-bottom:1px solid darkgrey}table.igo-entity-table-with-selection tr.igo-entity-table-row-highlighted{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"] }]
|
|
3031
|
+
], template: "<div class=\"table-container\" [style.height]=\"tableHeight\">\n <table\n id=\"currentWorkspaceTable\"\n mat-table\n matSort\n [ngClass]=\"getTableClass()\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"getTrackByFunction()\"\n (matSortChange)=\"onSort($event)\"\n >\n <ng-container matColumnDef=\"selectionCheckbox\" class=\"mat-cell-checkbox\">\n <th mat-header-cell *matHeaderCellDef>\n @if (selectMany) {\n @let selectionState = selectionState$ | async;\n @if (selectionState) {\n <mat-checkbox\n (change)=\"onToggleRows($event.checked)\"\n [checked]=\"selectionState === entityTableSelectionState.All\"\n [indeterminate]=\"\n selectionState === entityTableSelectionState.Some\n \"\n />\n }\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox\n (mousedown)=\"$event.shiftKey ? $event.preventDefault() : null\"\n (click)=\"\n $event.shiftKey\n ? onShiftToggleRow(!rowIsSelected(row.record), row.record, $event)\n : $event.stopPropagation()\n \"\n (change)=\"onToggleRow($event.checked, row.record)\"\n [checked]=\"rowIsSelected(row.record)\"\n />\n </td>\n </ng-container>\n\n @let template = this.template();\n @if (template) {\n @for (column of template.columns; track column) {\n <ng-container [matColumnDef]=\"column.name\">\n @if (columnIsSortable(column)) {\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n } @else {\n <th\n mat-header-cell\n *matHeaderCellDef\n [matTooltip]=\"column.tooltip ? column.tooltip : undefined\"\n >\n {{ column.title }}\n </th>\n }\n\n @let columnRenderer = getColumnRenderer(column);\n @if (columnRenderer) {\n @switch (columnRenderer) {\n @case (entityTableColumnRenderer.HTML) {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"row.cellData[column.name].value\"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n </a>\n </td>\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.UnsanitizedHTML) {\n <ng-container *matCellDef=\"let row\">\n @if (isEdition(row.record)) {\n <td\n mat-cell\n class=\"mat-cell-text edition\"\n [formGroup]=\"formGroup\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @switch (column.type) {\n @case ('date') {\n <div class=\"date-picker\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\" />\n <input\n matInput\n [matDatepicker]=\"picker\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (dateChange)=\"\n onDateChange(column.name, row.record, $event)\n \"\n />\n <mat-datepicker #picker />\n </div>\n }\n @case ('time') {\n <input\n matInput\n type=\"time\"\n [formControlName]=\"column.name\"\n step=\"900\"\n (focus)=\"column?.onFocus($event)\"\n (keypress)=\"column?.onChange($event)\"\n (blur)=\"column?.onBlur($event)\"\n />\n }\n @case ('number') {\n <input\n matInput\n type=\"number\"\n class=\"class_number_edition\"\n [formControlName]=\"column.name\"\n step=\"{{ column.step }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n min=\"{{\n getValidationAttributeValue(column, 'minValue')\n }}\"\n max=\"{{\n getValidationAttributeValue(column, 'maxValue')\n }}\"\n />\n }\n @case ('boolean') {\n <mat-checkbox\n [formControlName]=\"column.name\"\n [checked]=\"row.cellData[column.name].value\"\n (change)=\"\n onBooleanValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n />\n }\n @case ('list') {\n <mat-select\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n [formControlName]=\"column.name\"\n [multiple]=\"column.multiple\"\n (selectionChange)=\"\n onSelectValueChange(\n column.name,\n row.record,\n $event\n )\n \"\n [value]=\"row.cellData[column.name].value\"\n >\n @for (\n option of $any(column).domainValues;\n track option\n ) {\n <mat-option\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\n }\n </mat-select>\n }\n @case ('autocomplete') {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n [matAutocomplete]=\"auto\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n value=\"{{ row.cellData[column.name].value }}\"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"\n onAutocompleteValueChange(\n column,\n row.record,\n $event\n )\n \"\n panelWidth=\"430px\"\n >\n @for (\n option of filteredOptions[column.name] | async;\n track option\n ) {\n <mat-option [value]=\"option.id\">\n {{ option.value }}\n </mat-option>\n }\n </mat-autocomplete>\n }\n @default {\n <input\n matInput\n type=\"text\"\n [formControlName]=\"column.name\"\n value=\"{{ row.cellData[column.name].value }}\"\n (input)=\"\n onValueChange(column.name, row.record, $event)\n \"\n readonly=\"{{\n getValidationAttributeValue(column, 'readonly')\n }}\"\n required=\"{{\n getValidationAttributeValue(column, 'mandatory')\n }}\"\n />\n }\n }\n </td>\n } @else {\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n [innerHTML]=\"\n row.cellData[column.name].value | sanitizeHtml\n \"\n ></td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n ><span\n >{{ 'igo.geo.targetHtmlUrl' | translate }}\n </span>\n }\n >\n </a>\n </td>\n }\n }\n </ng-container>\n }\n @case (entityTableColumnRenderer.Icon) {\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @if (column.onClick) {\n <mat-icon (click)=\"column.onClick($event)\">{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n } @else {\n <mat-icon>{{\n row.cellData[column.name].value || column.icon\n }}</mat-icon>\n }\n </td>\n }\n @case (entityTableColumnRenderer.ButtonGroup) {\n <ng-container *matCellDef=\"let row\">\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n @for (\n button of row.cellData[column.name].value;\n track button\n ) {\n @if (\n isEdition(row.record) === button.editMode ||\n button.editMode === undefined\n ) {\n <span>\n @if (button.style === 'mat-icon-button') {\n <button\n igoStopPropagation\n mat-icon-button\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n } @else {\n <button\n igoStopPropagation\n mat-mini-fab\n [color]=\"button.color\"\n (mousedown)=\"\n onButtonClick(button.click, row.record)\n \"\n [disabled]=\"button.disabled\"\n >\n <mat-icon>{{ button.icon }}</mat-icon>\n </button>\n }\n </span>\n }\n }\n </td>\n </ng-container>\n }\n @default {\n <ng-container *matCellDef=\"let row\">\n @if (!row.cellData[column.name].isUrl) {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n {{ row.cellData[column.name].value }}\n </td>\n } @else {\n <td\n mat-cell\n class=\"mat-cell-text\"\n [ngClass]=\"row.cellData[column.name].class\"\n >\n <a\n href=\"{{ row.cellData[column.name].value }}\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (row.cellData[column.name].isImg) {\n <img\n igoImageError\n src=\"{{\n row.cellData[column.name].value\n | secureImage\n | async\n }}\"\n width=\"50\"\n heigth=\"auto\"\n />\n } @else {\n <span>{{\n 'igo.common.entity-table.targetHtmlUrl' | translate\n }}</span>\n }\n >\n </a>\n </td>\n }\n </ng-container>\n }\n }\n }\n </ng-container>\n }\n }\n\n <tr\n mat-header-row\n *matHeaderRowDef=\"headers; sticky: fixedHeader\"\n [ngClass]=\"getHeaderClass()\"\n ></tr>\n <tr\n mat-row\n igoEntityTableRow\n *matRowDef=\"let row; columns: headers\"\n [scrollBehavior]=\"scrollBehavior()\"\n [ngClass]=\"getRowClass(row.record)\"\n [selection]=\"selection\"\n [selected]=\"rowIsSelected(row.record)\"\n (select)=\"onRowSelect(row.record)\"\n (click)=\"onRowClick(row.record)\"\n ></tr>\n </table>\n @if (withPaginator()) {\n <igo-entity-table-paginator\n [store]=\"store()\"\n [paginatorOptions]=\"paginatorOptions()\"\n [entitySortChange$]=\"entitySortChange$\"\n (paginatorChange)=\"paginatorChange($event)\"\n />\n }\n</div>\n", styles: [":host{width:100%;height:100%;display:block;--mat-table-header-container-height: 52px}:host.table-compact tr.mat-mdc-header-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:36px}:host.table-compact tr.mat-mdc-row,:host.table-compact ::ng-deep mat-checkbox .mat-ripple{height:28px}.table-container{display:flex;flex-direction:column;height:100%;overflow:auto;flex:1 1 auto}.mat-cell-text{overflow:hidden;word-wrap:break-word}table.igo-entity-table-with-selection tr:hover{-moz-box-shadow:2px 0px 2px 0px #dddddd;-webkit-box-shadow:2px 0px 2px 0px #dddddd;-o-box-shadow:2px 0px 2px 0px #dddddd;box-shadow:2px 0 2px #ddd;cursor:pointer}table button{margin:7px}.class_hidden{visibility:hidden}.class_display_none{display:none}.class_boolean,.class_icon,.class_number{text-align:center;padding-right:35px!important}.class_string,.class_text,.class_number_edition{text-align:left}td.edition{background:#a6a6a633}input{border-bottom:1px solid darkgrey}table.igo-entity-table-with-selection tr.igo-entity-table-row-highlighted{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"] }]
|
|
2997
3032
|
}], ctorParameters: () => [], propDecorators: { store: [{ type: i0.Input, args: [{ isSignal: true, alias: "store", required: false }] }], paginator: [{
|
|
2998
3033
|
type: Input
|
|
2999
3034
|
}], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], sortNullsFirst: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortNullsFirst", required: false }] }], withPaginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "withPaginator", required: false }] }], paginatorOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorOptions", required: false }] }], entityClick: [{ type: i0.Output, args: ["entityClick"] }], entitySelectChange: [{ type: i0.Output, args: ["entitySelectChange"] }], entitySortChange: [{ type: i0.Output, args: ["entitySortChange"] }] } });
|