@igo2/common 20.0.0 → 20.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action/index.d.ts +22 -22
- package/clickout/index.d.ts +2 -2
- package/collapsible/index.d.ts +6 -10
- package/color/index.d.ts +3 -4
- package/context-menu/index.d.ts +9 -9
- package/datepicker/index.d.ts +65 -0
- package/drag-drop/index.d.ts +21 -23
- package/dynamic-component/index.d.ts +7 -7
- package/entity/index.d.ts +45 -48
- package/fesm2022/igo2-common-action.mjs +60 -97
- package/fesm2022/igo2-common-action.mjs.map +1 -1
- package/fesm2022/igo2-common-backdrop.mjs +7 -7
- package/fesm2022/igo2-common-backdrop.mjs.map +1 -1
- package/fesm2022/igo2-common-badge.mjs +7 -7
- package/fesm2022/igo2-common-badge.mjs.map +1 -1
- package/fesm2022/igo2-common-clickout.mjs +10 -12
- package/fesm2022/igo2-common-clickout.mjs.map +1 -1
- package/fesm2022/igo2-common-clone.mjs +7 -7
- package/fesm2022/igo2-common-collapsible.mjs +18 -39
- package/fesm2022/igo2-common-collapsible.mjs.map +1 -1
- package/fesm2022/igo2-common-color.mjs +14 -18
- package/fesm2022/igo2-common-color.mjs.map +1 -1
- package/fesm2022/igo2-common-confirm-dialog.mjs +10 -10
- package/fesm2022/igo2-common-context-menu.mjs +22 -31
- package/fesm2022/igo2-common-context-menu.mjs.map +1 -1
- package/fesm2022/igo2-common-custom-html.mjs +10 -10
- package/fesm2022/igo2-common-custom-html.mjs.map +1 -1
- package/fesm2022/igo2-common-datepicker.mjs +316 -0
- package/fesm2022/igo2-common-datepicker.mjs.map +1 -0
- package/fesm2022/igo2-common-dom.mjs +7 -7
- package/fesm2022/igo2-common-drag-drop.mjs +59 -75
- package/fesm2022/igo2-common-drag-drop.mjs.map +1 -1
- package/fesm2022/igo2-common-dynamic-component.mjs +34 -52
- package/fesm2022/igo2-common-dynamic-component.mjs.map +1 -1
- package/fesm2022/igo2-common-entity.mjs +154 -206
- package/fesm2022/igo2-common-entity.mjs.map +1 -1
- package/fesm2022/igo2-common-flexible.mjs +13 -16
- package/fesm2022/igo2-common-flexible.mjs.map +1 -1
- package/fesm2022/igo2-common-form.mjs +120 -174
- package/fesm2022/igo2-common-form.mjs.map +1 -1
- package/fesm2022/igo2-common-home-button.mjs +11 -12
- package/fesm2022/igo2-common-home-button.mjs.map +1 -1
- package/fesm2022/igo2-common-icon.mjs +18 -24
- package/fesm2022/igo2-common-icon.mjs.map +1 -1
- package/fesm2022/igo2-common-image.mjs +16 -20
- package/fesm2022/igo2-common-image.mjs.map +1 -1
- package/fesm2022/igo2-common-interactive-tour.mjs +28 -33
- package/fesm2022/igo2-common-interactive-tour.mjs.map +1 -1
- package/fesm2022/igo2-common-json-dialog.mjs +11 -11
- package/fesm2022/igo2-common-json-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-keyvalue.mjs +7 -7
- package/fesm2022/igo2-common-list.mjs +49 -66
- package/fesm2022/igo2-common-list.mjs.map +1 -1
- package/fesm2022/igo2-common-panel.mjs +15 -28
- package/fesm2022/igo2-common-panel.mjs.map +1 -1
- package/fesm2022/igo2-common-resizable-bar.mjs +25 -32
- package/fesm2022/igo2-common-resizable-bar.mjs.map +1 -1
- package/fesm2022/igo2-common-select-value-dialog.mjs +10 -10
- package/fesm2022/igo2-common-sidenav.mjs +7 -7
- package/fesm2022/igo2-common-sidenav.mjs.map +1 -1
- package/fesm2022/igo2-common-spinner.mjs +11 -11
- package/fesm2022/igo2-common-spinner.mjs.map +1 -1
- package/fesm2022/igo2-common-stop-propagation.mjs +10 -10
- package/fesm2022/igo2-common-stop-propagation.mjs.map +1 -1
- package/fesm2022/igo2-common-table.mjs +57 -87
- package/fesm2022/igo2-common-table.mjs.map +1 -1
- package/fesm2022/igo2-common-timepicker.mjs +105 -0
- package/fesm2022/igo2-common-timepicker.mjs.map +1 -0
- package/fesm2022/igo2-common-tool.mjs +29 -35
- package/fesm2022/igo2-common-tool.mjs.map +1 -1
- package/fesm2022/igo2-common-widget.mjs +27 -36
- package/fesm2022/igo2-common-widget.mjs.map +1 -1
- package/fesm2022/igo2-common-workspace.mjs +34 -44
- package/fesm2022/igo2-common-workspace.mjs.map +1 -1
- package/flexible/index.d.ts +2 -2
- package/form/index.d.ts +31 -33
- package/home-button/index.d.ts +1 -2
- package/icon/index.d.ts +4 -5
- package/image/index.d.ts +3 -3
- package/interactive-tour/index.d.ts +5 -5
- package/list/index.d.ts +23 -23
- package/package.json +11 -3
- package/panel/index.d.ts +4 -6
- package/resizable-bar/index.d.ts +11 -13
- package/table/index.d.ts +13 -19
- package/timepicker/index.d.ts +33 -0
- package/tool/index.d.ts +4 -4
- package/widget/index.d.ts +9 -9
- package/workspace/index.d.ts +7 -8
|
@@ -3,7 +3,7 @@ import { ReplaySubject, BehaviorSubject, combineLatest, of, Observable } from 'r
|
|
|
3
3
|
import { uuid, ObjectUtils, StringUtils } from '@igo2/utils';
|
|
4
4
|
import { map, skip, debounceTime, catchError, tap } from 'rxjs/operators';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, ChangeDetectorRef,
|
|
6
|
+
import { inject, ChangeDetectorRef, input, output, ChangeDetectionStrategy, Component, NgModule, viewChild, Renderer2, ElementRef, HostListener, Input, Directive } from '@angular/core';
|
|
7
7
|
import { AsyncPipe, NgClass, NgStyle } from '@angular/common';
|
|
8
8
|
import { MatOptionModule, ErrorStateMatcher, DateAdapter, MatNativeDateModule } from '@angular/material/core';
|
|
9
9
|
import * as i1 from '@angular/material/form-field';
|
|
@@ -27,7 +27,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
27
27
|
import * as i9 from '@angular/material/input';
|
|
28
28
|
import { MatInputModule } from '@angular/material/input';
|
|
29
29
|
import * as i1$1 from '@angular/material/paginator';
|
|
30
|
-
import {
|
|
30
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
31
31
|
import * as i10 from '@angular/material/sort';
|
|
32
32
|
import { MatSortModule } from '@angular/material/sort';
|
|
33
33
|
import * as i11 from '@angular/material/table';
|
|
@@ -1701,47 +1701,47 @@ class EntitySelectorComponent {
|
|
|
1701
1701
|
/**
|
|
1702
1702
|
* Entity store
|
|
1703
1703
|
*/
|
|
1704
|
-
store;
|
|
1704
|
+
store = input(undefined, ...(ngDevMode ? [{ debugName: "store" }] : []));
|
|
1705
1705
|
/**
|
|
1706
1706
|
* Title accessor
|
|
1707
1707
|
*/
|
|
1708
|
-
titleAccessor = getEntityTitle;
|
|
1708
|
+
titleAccessor = input(getEntityTitle, ...(ngDevMode ? [{ debugName: "titleAccessor" }] : []));
|
|
1709
1709
|
/**
|
|
1710
1710
|
* Text to display when nothing is selected
|
|
1711
1711
|
*/
|
|
1712
|
-
emptyText = undefined;
|
|
1712
|
+
emptyText = input(undefined, ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
|
|
1713
1713
|
/**
|
|
1714
1714
|
* Wheter selecting many entities is allowed
|
|
1715
1715
|
*/
|
|
1716
|
-
multi = false;
|
|
1716
|
+
multi = input(false, ...(ngDevMode ? [{ debugName: "multi" }] : []));
|
|
1717
1717
|
/**
|
|
1718
1718
|
* Text to display for the select all option
|
|
1719
1719
|
*/
|
|
1720
|
-
multiAllText = 'All';
|
|
1720
|
+
multiAllText = input('All', ...(ngDevMode ? [{ debugName: "multiAllText" }] : []));
|
|
1721
1721
|
/**
|
|
1722
1722
|
* Text to display for the select none option
|
|
1723
1723
|
*/
|
|
1724
|
-
multiNoneText = 'None';
|
|
1724
|
+
multiNoneText = input('None', ...(ngDevMode ? [{ debugName: "multiNoneText" }] : []));
|
|
1725
1725
|
/**
|
|
1726
1726
|
* Field placeholder
|
|
1727
1727
|
*/
|
|
1728
|
-
placeholder;
|
|
1728
|
+
placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1729
1729
|
/**
|
|
1730
1730
|
* Wheter the selector is disabled or not
|
|
1731
1731
|
*/
|
|
1732
|
-
disabled = false;
|
|
1732
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1733
1733
|
/**
|
|
1734
1734
|
* Event emitted when the selection changes
|
|
1735
1735
|
*/
|
|
1736
|
-
selectedChange =
|
|
1736
|
+
selectedChange = output();
|
|
1737
1737
|
/**
|
|
1738
1738
|
* Create a store watcher and subscribe to the selected entity
|
|
1739
1739
|
* @internal
|
|
1740
1740
|
*/
|
|
1741
1741
|
ngOnInit() {
|
|
1742
|
-
this.watcher = new EntityStoreWatcher(this.store, this.cdRef);
|
|
1743
|
-
this.selected$$ = this.store
|
|
1744
|
-
.manyBy$((record) => record.state.selected === true)
|
|
1742
|
+
this.watcher = new EntityStoreWatcher(this.store(), this.cdRef);
|
|
1743
|
+
this.selected$$ = this.store()
|
|
1744
|
+
.stateView.manyBy$((record) => record.state.selected === true)
|
|
1745
1745
|
.subscribe((records) => {
|
|
1746
1746
|
const entities = records.map((record) => record.entity);
|
|
1747
1747
|
this.onSelectFromStore(entities);
|
|
@@ -1763,26 +1763,27 @@ class EntitySelectorComponent {
|
|
|
1763
1763
|
const values = event.value instanceof Array ? event.value : [event.value];
|
|
1764
1764
|
const multiSelect = values.find((_value) => _value === this.multiSelectValue);
|
|
1765
1765
|
let entities = values.filter((_value) => _value !== this.multiSelectValue);
|
|
1766
|
+
const store = this.store();
|
|
1766
1767
|
if (multiSelect !== undefined) {
|
|
1767
|
-
if (entities.length ===
|
|
1768
|
+
if (entities.length === store.count) {
|
|
1768
1769
|
entities = [];
|
|
1769
1770
|
}
|
|
1770
|
-
else if (entities.length <
|
|
1771
|
-
entities =
|
|
1771
|
+
else if (entities.length < store.count) {
|
|
1772
|
+
entities = store.all();
|
|
1772
1773
|
}
|
|
1773
1774
|
}
|
|
1774
1775
|
entities = entities.filter((entity) => entity !== this.emptyValue);
|
|
1775
1776
|
if (entities.length === 0) {
|
|
1776
|
-
|
|
1777
|
+
store.state.updateAll({ selected: false });
|
|
1777
1778
|
}
|
|
1778
1779
|
else {
|
|
1779
|
-
|
|
1780
|
+
store.state.updateMany(entities, { selected: true }, true);
|
|
1780
1781
|
}
|
|
1781
|
-
const value = this.multi ? entities : event.value;
|
|
1782
|
+
const value = this.multi() ? entities : event.value;
|
|
1782
1783
|
this.selectedChange.emit({ selected: true, value });
|
|
1783
1784
|
}
|
|
1784
1785
|
onSelectFromStore(entities) {
|
|
1785
|
-
if (this.multi === true) {
|
|
1786
|
+
if (this.multi() === true) {
|
|
1786
1787
|
this.selected$.next(entities);
|
|
1787
1788
|
}
|
|
1788
1789
|
else {
|
|
@@ -1792,50 +1793,35 @@ class EntitySelectorComponent {
|
|
|
1792
1793
|
this.updateMultiToggleWithEntities(entities);
|
|
1793
1794
|
}
|
|
1794
1795
|
updateMultiToggleWithEntities(entities) {
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1796
|
+
const store = this.store();
|
|
1797
|
+
const multiNoneText = this.multiNoneText();
|
|
1798
|
+
const multiAllText = this.multiAllText();
|
|
1799
|
+
if (entities.length === store.count &&
|
|
1800
|
+
this.multiText$.value !== multiNoneText) {
|
|
1801
|
+
this.multiText$.next(multiNoneText);
|
|
1798
1802
|
}
|
|
1799
|
-
else if (entities.length <
|
|
1800
|
-
this.multiText$.value !==
|
|
1801
|
-
this.multiText$.next(
|
|
1803
|
+
else if (entities.length < store.count &&
|
|
1804
|
+
this.multiText$.value !== multiAllText) {
|
|
1805
|
+
this.multiText$.next(multiAllText);
|
|
1802
1806
|
}
|
|
1803
1807
|
}
|
|
1804
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1805
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1808
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntitySelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1809
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", 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 });
|
|
1806
1810
|
}
|
|
1807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntitySelectorComponent, decorators: [{
|
|
1808
1812
|
type: Component,
|
|
1809
|
-
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"] }]
|
|
1810
|
-
}], propDecorators: { store: [{
|
|
1811
|
-
type: Input
|
|
1812
|
-
}], titleAccessor: [{
|
|
1813
|
-
type: Input
|
|
1814
|
-
}], emptyText: [{
|
|
1815
|
-
type: Input
|
|
1816
|
-
}], multi: [{
|
|
1817
|
-
type: Input
|
|
1818
|
-
}], multiAllText: [{
|
|
1819
|
-
type: Input
|
|
1820
|
-
}], multiNoneText: [{
|
|
1821
|
-
type: Input
|
|
1822
|
-
}], placeholder: [{
|
|
1823
|
-
type: Input
|
|
1824
|
-
}], disabled: [{
|
|
1825
|
-
type: Input
|
|
1826
|
-
}], selectedChange: [{
|
|
1827
|
-
type: Output
|
|
1828
|
-
}] } });
|
|
1813
|
+
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"] }]
|
|
1814
|
+
}], 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"] }] } });
|
|
1829
1815
|
|
|
1830
1816
|
/**
|
|
1831
1817
|
* @deprecated import the EntitySelectorComponent directly
|
|
1832
1818
|
*/
|
|
1833
1819
|
class IgoEntitySelectorModule {
|
|
1834
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1835
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
1836
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
1820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntitySelectorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1821
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: IgoEntitySelectorModule, imports: [EntitySelectorComponent], exports: [EntitySelectorComponent] });
|
|
1822
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntitySelectorModule, imports: [EntitySelectorComponent] });
|
|
1837
1823
|
}
|
|
1838
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntitySelectorModule, decorators: [{
|
|
1839
1825
|
type: NgModule,
|
|
1840
1826
|
args: [{
|
|
1841
1827
|
imports: [EntitySelectorComponent],
|
|
@@ -1855,83 +1841,80 @@ class EntityTablePaginatorComponent {
|
|
|
1855
1841
|
count$$;
|
|
1856
1842
|
entitySortChange$$;
|
|
1857
1843
|
paginationLabelTranslation$$ = [];
|
|
1858
|
-
entitySortChange$ = new BehaviorSubject(false);
|
|
1844
|
+
entitySortChange$ = input(new BehaviorSubject(false), ...(ngDevMode ? [{ debugName: "entitySortChange$" }] : []));
|
|
1859
1845
|
/**
|
|
1860
1846
|
* Entity store
|
|
1861
1847
|
*/
|
|
1862
|
-
store;
|
|
1848
|
+
store = input(undefined, ...(ngDevMode ? [{ debugName: "store" }] : []));
|
|
1863
1849
|
/**
|
|
1864
1850
|
* Paginator options
|
|
1865
1851
|
*/
|
|
1866
|
-
paginatorOptions;
|
|
1867
|
-
/**
|
|
1868
|
-
* Event emitted when the paginator changes the page size or page index.
|
|
1869
|
-
*/
|
|
1870
|
-
page;
|
|
1852
|
+
paginatorOptions = input(undefined, ...(ngDevMode ? [{ debugName: "paginatorOptions" }] : []));
|
|
1871
1853
|
length = 0;
|
|
1872
1854
|
/**
|
|
1873
1855
|
* Paginator emitted.
|
|
1874
1856
|
*/
|
|
1875
|
-
paginatorChange =
|
|
1876
|
-
paginator;
|
|
1857
|
+
paginatorChange = output();
|
|
1858
|
+
paginator = viewChild(MatPaginator, ...(ngDevMode ? [{ debugName: "paginator" }] : []));
|
|
1877
1859
|
ngOnChanges() {
|
|
1878
1860
|
this.unsubscribeAll();
|
|
1879
|
-
this.count$$ = this.store.stateView.count$.subscribe((count) => {
|
|
1861
|
+
this.count$$ = this.store().stateView.count$.subscribe((count) => {
|
|
1880
1862
|
this.length = count;
|
|
1881
1863
|
this.emitPaginator();
|
|
1882
1864
|
});
|
|
1883
|
-
this.entitySortChange$$ = this.entitySortChange
|
|
1884
|
-
|
|
1885
|
-
|
|
1865
|
+
this.entitySortChange$$ = this.entitySortChange$().subscribe(() => {
|
|
1866
|
+
const paginator = this.paginator();
|
|
1867
|
+
if (paginator) {
|
|
1868
|
+
paginator.firstPage();
|
|
1886
1869
|
}
|
|
1887
1870
|
});
|
|
1888
1871
|
this.initPaginatorOptions();
|
|
1889
1872
|
this.translateLabels();
|
|
1890
1873
|
}
|
|
1891
1874
|
initPaginatorOptions() {
|
|
1892
|
-
this.disabled = this.paginatorOptions?.disabled || this.disabled;
|
|
1893
|
-
this.pageIndex = this.paginatorOptions?.pageIndex || this.pageIndex;
|
|
1894
|
-
this.pageSize = this.paginatorOptions?.pageSize || this.pageSize;
|
|
1875
|
+
this.disabled = this.paginatorOptions()?.disabled || this.disabled;
|
|
1876
|
+
this.pageIndex = this.paginatorOptions()?.pageIndex || this.pageIndex;
|
|
1877
|
+
this.pageSize = this.paginatorOptions()?.pageSize || this.pageSize;
|
|
1895
1878
|
this.pageSizeOptions =
|
|
1896
|
-
this.paginatorOptions?.pageSizeOptions || this.pageSizeOptions;
|
|
1879
|
+
this.paginatorOptions()?.pageSizeOptions || this.pageSizeOptions;
|
|
1897
1880
|
if (this.mediaService.isMobile()) {
|
|
1898
1881
|
this.showFirstLastButtons = false;
|
|
1899
1882
|
this.hidePageSize = true;
|
|
1900
1883
|
}
|
|
1901
1884
|
else {
|
|
1902
1885
|
this.showFirstLastButtons =
|
|
1903
|
-
this.paginatorOptions?.showFirstLastButtons ||
|
|
1886
|
+
this.paginatorOptions()?.showFirstLastButtons ||
|
|
1904
1887
|
this.showFirstLastButtons;
|
|
1905
1888
|
this.hidePageSize =
|
|
1906
|
-
this.paginatorOptions?.hidePageSize || this.hidePageSize;
|
|
1889
|
+
this.paginatorOptions()?.hidePageSize || this.hidePageSize;
|
|
1907
1890
|
}
|
|
1908
1891
|
}
|
|
1909
1892
|
translateLabels() {
|
|
1910
1893
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
1911
1894
|
.get('igo.common.paginator.firstPageLabel')
|
|
1912
1895
|
.subscribe((label) => {
|
|
1913
|
-
this.paginator._intl.firstPageLabel = label;
|
|
1896
|
+
this.paginator()._intl.firstPageLabel = label;
|
|
1914
1897
|
}));
|
|
1915
|
-
this.paginator._intl.getRangeLabel = this.rangeLabel;
|
|
1898
|
+
this.paginator()._intl.getRangeLabel = this.rangeLabel;
|
|
1916
1899
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
1917
1900
|
.get('igo.common.paginator.itemsPerPageLabel')
|
|
1918
1901
|
.subscribe((label) => {
|
|
1919
|
-
this.paginator._intl.itemsPerPageLabel = label;
|
|
1902
|
+
this.paginator()._intl.itemsPerPageLabel = label;
|
|
1920
1903
|
}));
|
|
1921
1904
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
1922
1905
|
.get('igo.common.paginator.lastPageLabel')
|
|
1923
1906
|
.subscribe((label) => {
|
|
1924
|
-
this.paginator._intl.lastPageLabel = label;
|
|
1907
|
+
this.paginator()._intl.lastPageLabel = label;
|
|
1925
1908
|
}));
|
|
1926
1909
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
1927
1910
|
.get('igo.common.paginator.nextPageLabel')
|
|
1928
1911
|
.subscribe((label) => {
|
|
1929
|
-
this.paginator._intl.nextPageLabel = label;
|
|
1912
|
+
this.paginator()._intl.nextPageLabel = label;
|
|
1930
1913
|
}));
|
|
1931
1914
|
this.paginationLabelTranslation$$.push(this.languageService.translate
|
|
1932
1915
|
.get('igo.common.paginator.previousPageLabel')
|
|
1933
1916
|
.subscribe((label) => {
|
|
1934
|
-
this.paginator._intl.previousPageLabel = label;
|
|
1917
|
+
this.paginator()._intl.previousPageLabel = label;
|
|
1935
1918
|
}));
|
|
1936
1919
|
}
|
|
1937
1920
|
rangeLabel = (page, pageSize, length) => {
|
|
@@ -1964,28 +1947,15 @@ class EntityTablePaginatorComponent {
|
|
|
1964
1947
|
this.unsubscribeAll();
|
|
1965
1948
|
}
|
|
1966
1949
|
emitPaginator() {
|
|
1967
|
-
this.paginatorChange.emit(this.paginator);
|
|
1950
|
+
this.paginatorChange.emit(this.paginator());
|
|
1968
1951
|
}
|
|
1969
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1970
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1952
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTablePaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1953
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.6", 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 });
|
|
1971
1954
|
}
|
|
1972
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTablePaginatorComponent, decorators: [{
|
|
1973
1956
|
type: Component,
|
|
1974
|
-
args: [{ selector: 'igo-entity-table-paginator', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatPaginatorModule], 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
|
|
1975
|
-
}], propDecorators: { entitySortChange$: [{
|
|
1976
|
-
type: Input
|
|
1977
|
-
}], store: [{
|
|
1978
|
-
type: Input
|
|
1979
|
-
}], paginatorOptions: [{
|
|
1980
|
-
type: Input
|
|
1981
|
-
}], page: [{
|
|
1982
|
-
type: Output
|
|
1983
|
-
}], paginatorChange: [{
|
|
1984
|
-
type: Output
|
|
1985
|
-
}], paginator: [{
|
|
1986
|
-
type: ViewChild,
|
|
1987
|
-
args: [MatPaginator, { static: true }]
|
|
1988
|
-
}] } });
|
|
1957
|
+
args: [{ selector: 'igo-entity-table-paginator', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatPaginatorModule], 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"] }]
|
|
1958
|
+
}], propDecorators: { entitySortChange$: [{ type: i0.Input, args: [{ isSignal: true, alias: "entitySortChange$", required: false }] }], store: [{ type: i0.Input, args: [{ isSignal: true, alias: "store", required: false }] }], paginatorOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorOptions", required: false }] }], paginatorChange: [{ type: i0.Output, args: ["paginatorChange"] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }] } });
|
|
1989
1959
|
|
|
1990
1960
|
/**
|
|
1991
1961
|
* Directive that handles an entity table row click and selection.
|
|
@@ -2004,20 +1974,20 @@ class EntityTableRowDirective {
|
|
|
2004
1974
|
/**
|
|
2005
1975
|
* Whether a row supports selection
|
|
2006
1976
|
*/
|
|
2007
|
-
selection = false;
|
|
1977
|
+
selection = input(false, ...(ngDevMode ? [{ debugName: "selection" }] : []));
|
|
2008
1978
|
/**
|
|
2009
1979
|
* Whether clicking a row should select it (if selection is true)
|
|
2010
1980
|
*/
|
|
2011
|
-
selectOnClick = true;
|
|
1981
|
+
selectOnClick = input(true, ...(ngDevMode ? [{ debugName: "selectOnClick" }] : []));
|
|
2012
1982
|
/**
|
|
2013
1983
|
* Whether the selected row should be highlighted
|
|
2014
1984
|
*/
|
|
2015
|
-
highlightSelection = true;
|
|
1985
|
+
highlightSelection = input(true, ...(ngDevMode ? [{ debugName: "highlightSelection" }] : []));
|
|
2016
1986
|
/**
|
|
2017
1987
|
* Whether a row is selected
|
|
2018
1988
|
*/
|
|
2019
1989
|
set selected(value) {
|
|
2020
|
-
if (this.selection === false) {
|
|
1990
|
+
if (this.selection() === false) {
|
|
2021
1991
|
return;
|
|
2022
1992
|
}
|
|
2023
1993
|
if (value === this._selected) {
|
|
@@ -2033,17 +2003,17 @@ class EntityTableRowDirective {
|
|
|
2033
2003
|
/**
|
|
2034
2004
|
* Scroll behavior on selection
|
|
2035
2005
|
*/
|
|
2036
|
-
scrollBehavior = EntityTableScrollBehavior.Auto;
|
|
2006
|
+
scrollBehavior = input(EntityTableScrollBehavior.Auto, ...(ngDevMode ? [{ debugName: "scrollBehavior" }] : []));
|
|
2037
2007
|
/**
|
|
2038
2008
|
* Event emitted when a row is selected
|
|
2039
2009
|
*/
|
|
2040
|
-
select =
|
|
2010
|
+
select = output();
|
|
2041
2011
|
/**
|
|
2042
2012
|
* When a row is clicked, select it if it's supported
|
|
2043
2013
|
* @ignore
|
|
2044
2014
|
*/
|
|
2045
2015
|
onClick() {
|
|
2046
|
-
if (this.selection === false || this.selectOnClick === false) {
|
|
2016
|
+
if (this.selection() === false || this.selectOnClick() === false) {
|
|
2047
2017
|
return;
|
|
2048
2018
|
}
|
|
2049
2019
|
this.toggleSelected(true);
|
|
@@ -2057,7 +2027,7 @@ class EntityTableRowDirective {
|
|
|
2057
2027
|
this._selected = selected;
|
|
2058
2028
|
if (selected === true) {
|
|
2059
2029
|
this.addCls(EntityTableRowDirective.selectedCls);
|
|
2060
|
-
if (this.highlightSelection === true) {
|
|
2030
|
+
if (this.highlightSelection() === true) {
|
|
2061
2031
|
this.addCls(EntityTableRowDirective.highlightedCls);
|
|
2062
2032
|
}
|
|
2063
2033
|
}
|
|
@@ -2091,28 +2061,18 @@ class EntityTableRowDirective {
|
|
|
2091
2061
|
removeCls(cls) {
|
|
2092
2062
|
this.renderer.removeClass(this.el.nativeElement, cls);
|
|
2093
2063
|
}
|
|
2094
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2095
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2064
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2065
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.6", type: EntityTableRowDirective, isStandalone: true, selector: "[igoEntityTableRow]", inputs: { selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, selectOnClick: { classPropertyName: "selectOnClick", publicName: "selectOnClick", isSignal: true, isRequired: false, transformFunction: null }, highlightSelection: { classPropertyName: "highlightSelection", publicName: "highlightSelection", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
2096
2066
|
}
|
|
2097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTableRowDirective, decorators: [{
|
|
2098
2068
|
type: Directive,
|
|
2099
2069
|
args: [{
|
|
2100
2070
|
selector: '[igoEntityTableRow]',
|
|
2101
2071
|
standalone: true
|
|
2102
2072
|
}]
|
|
2103
|
-
}], propDecorators: { selection: [{
|
|
2104
|
-
type: Input
|
|
2105
|
-
}], selectOnClick: [{
|
|
2106
|
-
type: Input
|
|
2107
|
-
}], highlightSelection: [{
|
|
2108
|
-
type: Input
|
|
2109
|
-
}], selected: [{
|
|
2110
|
-
type: Input
|
|
2111
|
-
}], scrollBehavior: [{
|
|
2073
|
+
}], propDecorators: { selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], selectOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnClick", required: false }] }], highlightSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightSelection", required: false }] }], selected: [{
|
|
2112
2074
|
type: Input
|
|
2113
|
-
}], select: [{
|
|
2114
|
-
type: Output
|
|
2115
|
-
}], onClick: [{
|
|
2075
|
+
}], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], onClick: [{
|
|
2116
2076
|
type: HostListener,
|
|
2117
2077
|
args: ['click']
|
|
2118
2078
|
}] } });
|
|
@@ -2162,7 +2122,7 @@ class EntityTableComponent {
|
|
|
2162
2122
|
/**
|
|
2163
2123
|
* Entity store
|
|
2164
2124
|
*/
|
|
2165
|
-
store;
|
|
2125
|
+
store = input(undefined, ...(ngDevMode ? [{ debugName: "store" }] : []));
|
|
2166
2126
|
/**
|
|
2167
2127
|
* Table paginator
|
|
2168
2128
|
*/
|
|
@@ -2177,42 +2137,42 @@ class EntityTableComponent {
|
|
|
2177
2137
|
/**
|
|
2178
2138
|
* Table template
|
|
2179
2139
|
*/
|
|
2180
|
-
template;
|
|
2140
|
+
template = input(undefined, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
2181
2141
|
/**
|
|
2182
2142
|
* Scroll behavior on selection
|
|
2183
2143
|
*/
|
|
2184
|
-
scrollBehavior = EntityTableScrollBehavior.Auto;
|
|
2144
|
+
scrollBehavior = input(EntityTableScrollBehavior.Auto, ...(ngDevMode ? [{ debugName: "scrollBehavior" }] : []));
|
|
2185
2145
|
/**
|
|
2186
2146
|
* Whether nulls should be first when sorting
|
|
2187
2147
|
*/
|
|
2188
|
-
sortNullsFirst = false;
|
|
2148
|
+
sortNullsFirst = input(false, ...(ngDevMode ? [{ debugName: "sortNullsFirst" }] : []));
|
|
2189
2149
|
/**
|
|
2190
2150
|
* Show the table paginator or not. False by default.
|
|
2191
2151
|
*/
|
|
2192
|
-
withPaginator = false;
|
|
2152
|
+
withPaginator = input(false, ...(ngDevMode ? [{ debugName: "withPaginator" }] : []));
|
|
2193
2153
|
/**
|
|
2194
2154
|
* Paginator options
|
|
2195
2155
|
*/
|
|
2196
|
-
paginatorOptions;
|
|
2156
|
+
paginatorOptions = input(undefined, ...(ngDevMode ? [{ debugName: "paginatorOptions" }] : []));
|
|
2197
2157
|
/**
|
|
2198
2158
|
* Event emitted when an entity (row) is clicked
|
|
2199
2159
|
*/
|
|
2200
|
-
entityClick =
|
|
2160
|
+
entityClick = output();
|
|
2201
2161
|
/**
|
|
2202
2162
|
* Event emitted when an entity (row) is selected
|
|
2203
2163
|
*/
|
|
2204
|
-
entitySelectChange =
|
|
2164
|
+
entitySelectChange = output();
|
|
2205
2165
|
/**
|
|
2206
2166
|
* Event emitted when the table sort is changed.
|
|
2207
2167
|
*/
|
|
2208
|
-
entitySortChange =
|
|
2168
|
+
entitySortChange = output();
|
|
2209
2169
|
/**
|
|
2210
2170
|
* Table headers
|
|
2211
2171
|
* @internal
|
|
2212
2172
|
*/
|
|
2213
2173
|
get headers() {
|
|
2214
|
-
let columns = this.template
|
|
2215
|
-
.filter((column) => column.visible !== false)
|
|
2174
|
+
let columns = this.template()
|
|
2175
|
+
.columns.filter((column) => column.visible !== false)
|
|
2216
2176
|
.map((column) => column.name);
|
|
2217
2177
|
if (this.selectionCheckbox === true) {
|
|
2218
2178
|
columns = ['selectionCheckbox'].concat(columns);
|
|
@@ -2229,33 +2189,33 @@ class EntityTableComponent {
|
|
|
2229
2189
|
* @internal
|
|
2230
2190
|
*/
|
|
2231
2191
|
get selection() {
|
|
2232
|
-
return this.template.selection || false;
|
|
2192
|
+
return this.template().selection || false;
|
|
2233
2193
|
}
|
|
2234
2194
|
/**
|
|
2235
2195
|
* Whether a selection checkbox should be displayed
|
|
2236
2196
|
* @internal
|
|
2237
2197
|
*/
|
|
2238
2198
|
get selectionCheckbox() {
|
|
2239
|
-
return this.template.selectionCheckbox || false;
|
|
2199
|
+
return this.template().selectionCheckbox || false;
|
|
2240
2200
|
}
|
|
2241
2201
|
/**
|
|
2242
2202
|
* Whether selection many entities should eb supported
|
|
2243
2203
|
* @internal
|
|
2244
2204
|
*/
|
|
2245
2205
|
get selectMany() {
|
|
2246
|
-
return this.template.selectMany || false;
|
|
2206
|
+
return this.template().selectMany || false;
|
|
2247
2207
|
}
|
|
2248
2208
|
/**
|
|
2249
2209
|
* Whether selection many entities should eb supported
|
|
2250
2210
|
* @internal
|
|
2251
2211
|
*/
|
|
2252
2212
|
get fixedHeader() {
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
: this.template.fixedHeader;
|
|
2213
|
+
const template = this.template();
|
|
2214
|
+
return template.fixedHeader === undefined ? true : template.fixedHeader;
|
|
2256
2215
|
}
|
|
2257
2216
|
get tableHeight() {
|
|
2258
|
-
|
|
2217
|
+
const template = this.template();
|
|
2218
|
+
return template.tableHeight ? template.tableHeight : 'auto';
|
|
2259
2219
|
}
|
|
2260
2220
|
constructor() {
|
|
2261
2221
|
this.dateAdapter.setLocale('fr-CA');
|
|
@@ -2267,7 +2227,9 @@ class EntityTableComponent {
|
|
|
2267
2227
|
ngOnInit() {
|
|
2268
2228
|
this.handleDatasource();
|
|
2269
2229
|
this.dataSource.paginator = this.paginator;
|
|
2270
|
-
this.store
|
|
2230
|
+
this.store()
|
|
2231
|
+
.state.change$.pipe(debounceTime(100))
|
|
2232
|
+
.subscribe(() => {
|
|
2271
2233
|
this.handleDatasource();
|
|
2272
2234
|
this.refresh();
|
|
2273
2235
|
});
|
|
@@ -2325,7 +2287,7 @@ class EntityTableComponent {
|
|
|
2325
2287
|
*/
|
|
2326
2288
|
enableEdit(record) {
|
|
2327
2289
|
const item = record.entity.properties || record.entity;
|
|
2328
|
-
this.template.columns.forEach((column) => {
|
|
2290
|
+
this.template().columns.forEach((column) => {
|
|
2329
2291
|
column.title =
|
|
2330
2292
|
column.validation?.mandatory && !column.title.includes('*')
|
|
2331
2293
|
? column.title + ' *'
|
|
@@ -2414,12 +2376,12 @@ class EntityTableComponent {
|
|
|
2414
2376
|
}
|
|
2415
2377
|
handleDatasource() {
|
|
2416
2378
|
this.unsubscribeStore();
|
|
2417
|
-
this.selection$$ = this.store
|
|
2418
|
-
.manyBy$((record) => record.state.selected === true)
|
|
2379
|
+
this.selection$$ = this.store()
|
|
2380
|
+
.stateView.manyBy$((record) => record.state.selected === true)
|
|
2419
2381
|
.subscribe((records) => {
|
|
2420
2382
|
const firstSelected = records[0];
|
|
2421
|
-
const firstSelectedStateviewPosition = this.store
|
|
2422
|
-
.all()
|
|
2383
|
+
const firstSelectedStateviewPosition = this.store()
|
|
2384
|
+
.stateView.all()
|
|
2423
2385
|
.indexOf(firstSelected);
|
|
2424
2386
|
const pageMax = this.paginator
|
|
2425
2387
|
? this.paginator.pageSize * (this.paginator.pageIndex + 1)
|
|
@@ -2433,14 +2395,16 @@ class EntityTableComponent {
|
|
|
2433
2395
|
}
|
|
2434
2396
|
this.selectionState$.next(this.computeSelectionState(records));
|
|
2435
2397
|
});
|
|
2436
|
-
this.dataSource$$ = this.store
|
|
2398
|
+
this.dataSource$$ = this.store()
|
|
2399
|
+
.stateView.all$()
|
|
2400
|
+
.subscribe((all) => {
|
|
2437
2401
|
if (all[0]) {
|
|
2438
2402
|
this.enableEdit(all[0]);
|
|
2439
2403
|
}
|
|
2440
2404
|
this.dataSource.data = all.map((record) => {
|
|
2441
2405
|
return {
|
|
2442
2406
|
record,
|
|
2443
|
-
cellData: this.template.columns.reduce((cellData, column) => {
|
|
2407
|
+
cellData: this.template().columns.reduce((cellData, column) => {
|
|
2444
2408
|
const value = this.getValue(record, column);
|
|
2445
2409
|
cellData[column.name] = {
|
|
2446
2410
|
class: this.getCellClass(record, column),
|
|
@@ -2497,18 +2461,18 @@ class EntityTableComponent {
|
|
|
2497
2461
|
*/
|
|
2498
2462
|
onSort(event) {
|
|
2499
2463
|
const direction = event.direction;
|
|
2500
|
-
const column = this.template.columns.find((c) => c.name === event.active);
|
|
2464
|
+
const column = this.template().columns.find((c) => c.name === event.active);
|
|
2501
2465
|
if (direction === 'asc' || direction === 'desc') {
|
|
2502
|
-
this.store.stateView.sort({
|
|
2466
|
+
this.store().stateView.sort({
|
|
2503
2467
|
valueAccessor: (record) => this.getValue(record, column),
|
|
2504
2468
|
direction,
|
|
2505
|
-
nullsFirst: this.sortNullsFirst
|
|
2469
|
+
nullsFirst: this.sortNullsFirst()
|
|
2506
2470
|
});
|
|
2507
2471
|
this.entitySortChange.emit({ column, direction });
|
|
2508
2472
|
this.entitySortChange$.next(true);
|
|
2509
2473
|
}
|
|
2510
2474
|
else {
|
|
2511
|
-
this.store.stateView.sort(undefined);
|
|
2475
|
+
this.store().stateView.sort(undefined);
|
|
2512
2476
|
}
|
|
2513
2477
|
}
|
|
2514
2478
|
/**
|
|
@@ -2517,7 +2481,7 @@ class EntityTableComponent {
|
|
|
2517
2481
|
* @internal
|
|
2518
2482
|
*/
|
|
2519
2483
|
onRowClick(record) {
|
|
2520
|
-
this.lastRecordCheckedKey = this.store.stateView.getKey(record);
|
|
2484
|
+
this.lastRecordCheckedKey = this.store().stateView.getKey(record);
|
|
2521
2485
|
this.entityClick.emit(record.entity);
|
|
2522
2486
|
}
|
|
2523
2487
|
/**
|
|
@@ -2532,7 +2496,7 @@ class EntityTableComponent {
|
|
|
2532
2496
|
return;
|
|
2533
2497
|
}
|
|
2534
2498
|
const entity = record.entity;
|
|
2535
|
-
this.store.state.update(entity, { selected: true }, true);
|
|
2499
|
+
this.store().state.update(entity, { selected: true }, true);
|
|
2536
2500
|
this.entitySelectChange.emit({ added: [entity] });
|
|
2537
2501
|
}
|
|
2538
2502
|
/**
|
|
@@ -2544,9 +2508,9 @@ class EntityTableComponent {
|
|
|
2544
2508
|
if (this.selection === false) {
|
|
2545
2509
|
return;
|
|
2546
2510
|
}
|
|
2547
|
-
const entities = this.store.view.all();
|
|
2511
|
+
const entities = this.store().view.all();
|
|
2548
2512
|
this.entitySelectChange.emit({ added: [entities] });
|
|
2549
|
-
this.store.state.updateMany(entities, { selected: toggle });
|
|
2513
|
+
this.store().state.updateMany(entities, { selected: toggle });
|
|
2550
2514
|
}
|
|
2551
2515
|
/**
|
|
2552
2516
|
* When an entity is toggled, select or unselect it in the store. On select,
|
|
@@ -2561,11 +2525,11 @@ class EntityTableComponent {
|
|
|
2561
2525
|
}
|
|
2562
2526
|
const entity = record.entity;
|
|
2563
2527
|
const exclusive = toggle === true && !this.selectMany;
|
|
2564
|
-
this.store.state.update(entity, { selected: toggle }, exclusive);
|
|
2528
|
+
this.store().state.update(entity, { selected: toggle }, exclusive);
|
|
2565
2529
|
if (toggle === true) {
|
|
2566
2530
|
this.entitySelectChange.emit({ added: [entity] });
|
|
2567
2531
|
}
|
|
2568
|
-
this.lastRecordCheckedKey = this.store.stateView.getKey(record);
|
|
2532
|
+
this.lastRecordCheckedKey = this.store().stateView.getKey(record);
|
|
2569
2533
|
}
|
|
2570
2534
|
/**
|
|
2571
2535
|
* When an entity is toggled, select or unselect it in the store. On select,
|
|
@@ -2590,18 +2554,18 @@ class EntityTableComponent {
|
|
|
2590
2554
|
window.getSelection().removeAllRanges();
|
|
2591
2555
|
window.getSelection().addRange(range);
|
|
2592
2556
|
event.stopImmediatePropagation();
|
|
2593
|
-
const records = this.store.stateView.all();
|
|
2557
|
+
const records = this.store().stateView.all();
|
|
2594
2558
|
const recordIndex = records.indexOf(record);
|
|
2595
|
-
const lastRecordChecked = this.store.stateView.get(this.lastRecordCheckedKey);
|
|
2559
|
+
const lastRecordChecked = this.store().stateView.get(this.lastRecordCheckedKey);
|
|
2596
2560
|
const lastRecordIndex = records.indexOf(lastRecordChecked);
|
|
2597
2561
|
const indexes = [recordIndex, lastRecordIndex];
|
|
2598
2562
|
const selectRecords = records.slice(Math.min(...indexes), Math.max(...indexes) + 1);
|
|
2599
2563
|
const entities = selectRecords.map((_record) => _record.entity);
|
|
2600
|
-
this.store.state.updateMany(entities, { selected: toggle });
|
|
2564
|
+
this.store().state.updateMany(entities, { selected: toggle });
|
|
2601
2565
|
if (toggle === true) {
|
|
2602
2566
|
this.entitySelectChange.emit({ added: entities });
|
|
2603
2567
|
}
|
|
2604
|
-
this.lastRecordCheckedKey = this.store.stateView.getKey(record);
|
|
2568
|
+
this.lastRecordCheckedKey = this.store().stateView.getKey(record);
|
|
2605
2569
|
}
|
|
2606
2570
|
/**
|
|
2607
2571
|
* Compute the selection state
|
|
@@ -2613,7 +2577,7 @@ class EntityTableComponent {
|
|
|
2613
2577
|
const selectionCount = selectedRecords.length;
|
|
2614
2578
|
return selectionCount === 0
|
|
2615
2579
|
? states.None
|
|
2616
|
-
: selectionCount === this.store.stateView.count
|
|
2580
|
+
: selectionCount === this.store().stateView.count
|
|
2617
2581
|
? states.All
|
|
2618
2582
|
: states.Some;
|
|
2619
2583
|
}
|
|
@@ -2626,7 +2590,8 @@ class EntityTableComponent {
|
|
|
2626
2590
|
columnIsSortable(column) {
|
|
2627
2591
|
let sortable = column.sort;
|
|
2628
2592
|
if (sortable === undefined) {
|
|
2629
|
-
|
|
2593
|
+
const template = this.template();
|
|
2594
|
+
sortable = template.sort === undefined ? false : template.sort;
|
|
2630
2595
|
}
|
|
2631
2596
|
return sortable;
|
|
2632
2597
|
}
|
|
@@ -2670,10 +2635,11 @@ class EntityTableComponent {
|
|
|
2670
2635
|
if (column.valueAccessor !== undefined) {
|
|
2671
2636
|
return column.valueAccessor(entity, record);
|
|
2672
2637
|
}
|
|
2673
|
-
|
|
2674
|
-
|
|
2638
|
+
const template = this.template();
|
|
2639
|
+
if (template.valueAccessor !== undefined) {
|
|
2640
|
+
return template.valueAccessor(entity, column.name, record);
|
|
2675
2641
|
}
|
|
2676
|
-
value = this.store.getProperty(entity, column.name);
|
|
2642
|
+
value = this.store().getProperty(entity, column.name);
|
|
2677
2643
|
if (column.type === 'boolean') {
|
|
2678
2644
|
if (value === undefined || value === null || value === '') {
|
|
2679
2645
|
value = false;
|
|
@@ -2814,7 +2780,7 @@ class EntityTableComponent {
|
|
|
2814
2780
|
* @internal
|
|
2815
2781
|
*/
|
|
2816
2782
|
getHeaderClass() {
|
|
2817
|
-
const func = this.template.headerClassFunc;
|
|
2783
|
+
const func = this.template().headerClassFunc;
|
|
2818
2784
|
if (func instanceof Function) {
|
|
2819
2785
|
return func();
|
|
2820
2786
|
}
|
|
@@ -2828,7 +2794,7 @@ class EntityTableComponent {
|
|
|
2828
2794
|
*/
|
|
2829
2795
|
getRowClass(record) {
|
|
2830
2796
|
const entity = record.entity;
|
|
2831
|
-
const func = this.template.rowClassFunc;
|
|
2797
|
+
const func = this.template().rowClassFunc;
|
|
2832
2798
|
if (func instanceof Function) {
|
|
2833
2799
|
return func(entity, record);
|
|
2834
2800
|
}
|
|
@@ -2844,7 +2810,7 @@ class EntityTableComponent {
|
|
|
2844
2810
|
getCellClass(record, column) {
|
|
2845
2811
|
const entity = record.entity;
|
|
2846
2812
|
const cls = {};
|
|
2847
|
-
const tableFunc = this.template.cellClassFunc;
|
|
2813
|
+
const tableFunc = this.template().cellClassFunc;
|
|
2848
2814
|
if (tableFunc instanceof Function) {
|
|
2849
2815
|
Object.assign(cls, tableFunc(entity, column, record));
|
|
2850
2816
|
}
|
|
@@ -2875,14 +2841,14 @@ class EntityTableComponent {
|
|
|
2875
2841
|
}
|
|
2876
2842
|
return column;
|
|
2877
2843
|
}
|
|
2878
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2879
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2844
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2845
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", 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: [
|
|
2880
2846
|
{ provide: MatFormFieldControl, useExisting: EntityTableComponent },
|
|
2881
2847
|
provideMomentDateAdapter()
|
|
2882
|
-
], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-container\" [ngStyle]=\"{ 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 </mat-checkbox>\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 </mat-checkbox>\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\n matSuffix\n [for]=\"picker\"\n ></mat-datepicker-toggle>\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></mat-datepicker>\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 ></mat-checkbox>\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 <mat-option\n *ngFor=\"let option of column.domainValues\"\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\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 <mat-option\n *ngFor=\"\n let option of filteredOptions[column.name] | async\n \"\n [value]=\"option.id\"\n >\n {{ option.value }}\n </mat-option>\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 </igo-entity-table-paginator>\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: ["page", "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],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
|
|
2848
|
+
], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-container\" [ngStyle]=\"{ 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 <mat-option\n *ngFor=\"let option of column.domainValues\"\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\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 <mat-option\n *ngFor=\"\n let option of filteredOptions[column.name] | async\n \"\n [value]=\"option.id\"\n >\n {{ option.value }}\n </mat-option>\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],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
|
|
2883
2849
|
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: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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 });
|
|
2884
2850
|
}
|
|
2885
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: EntityTableComponent, decorators: [{
|
|
2886
2852
|
type: Component,
|
|
2887
2853
|
args: [{ selector: 'igo-entity-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2888
2854
|
{ provide: MatFormFieldControl, useExisting: EntityTableComponent },
|
|
@@ -2913,38 +2879,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
2913
2879
|
SecureImagePipe,
|
|
2914
2880
|
StopPropagationDirective,
|
|
2915
2881
|
IgoLanguageModule
|
|
2916
|
-
], template: "<div class=\"table-container\" [ngStyle]=\"{ 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 </mat-checkbox>\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 </mat-checkbox>\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\n matSuffix\n [for]=\"picker\"\n ></mat-datepicker-toggle>\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></mat-datepicker>\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 ></mat-checkbox>\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 <mat-option\n *ngFor=\"let option of column.domainValues\"\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\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 <mat-option\n *ngFor=\"\n let option of filteredOptions[column.name] | async\n \"\n [value]=\"option.id\"\n >\n {{ option.value }}\n </mat-option>\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 </igo-entity-table-paginator>\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"] }]
|
|
2917
|
-
}], ctorParameters: () => [], propDecorators: { store: [{
|
|
2918
|
-
type: Input
|
|
2919
|
-
}], paginator: [{
|
|
2920
|
-
type: Input
|
|
2921
|
-
}], template: [{
|
|
2922
|
-
type: Input
|
|
2923
|
-
}], scrollBehavior: [{
|
|
2882
|
+
], template: "<div class=\"table-container\" [ngStyle]=\"{ 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 <mat-option\n *ngFor=\"let option of column.domainValues\"\n [value]=\"option.id\"\n [disabled]=\"option.disabled\"\n >\n {{ option.value }}\n </mat-option>\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 <mat-option\n *ngFor=\"\n let option of filteredOptions[column.name] | async\n \"\n [value]=\"option.id\"\n >\n {{ option.value }}\n </mat-option>\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"] }]
|
|
2883
|
+
}], ctorParameters: () => [], propDecorators: { store: [{ type: i0.Input, args: [{ isSignal: true, alias: "store", required: false }] }], paginator: [{
|
|
2924
2884
|
type: Input
|
|
2925
|
-
}], sortNullsFirst: [{
|
|
2926
|
-
type: Input
|
|
2927
|
-
}], withPaginator: [{
|
|
2928
|
-
type: Input
|
|
2929
|
-
}], paginatorOptions: [{
|
|
2930
|
-
type: Input
|
|
2931
|
-
}], entityClick: [{
|
|
2932
|
-
type: Output
|
|
2933
|
-
}], entitySelectChange: [{
|
|
2934
|
-
type: Output
|
|
2935
|
-
}], entitySortChange: [{
|
|
2936
|
-
type: Output
|
|
2937
|
-
}] } });
|
|
2885
|
+
}], 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"] }] } });
|
|
2938
2886
|
|
|
2939
2887
|
/**
|
|
2940
2888
|
* @deprecated import the EntityTableComponent directly
|
|
2941
2889
|
*/
|
|
2942
2890
|
class IgoEntityTableModule {
|
|
2943
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2944
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
2945
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
2891
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2892
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTableModule, imports: [EntityTableComponent], exports: [EntityTableComponent] });
|
|
2893
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTableModule, imports: [EntityTableComponent] });
|
|
2946
2894
|
}
|
|
2947
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTableModule, decorators: [{
|
|
2948
2896
|
type: NgModule,
|
|
2949
2897
|
args: [{
|
|
2950
2898
|
imports: [EntityTableComponent],
|
|
@@ -2956,11 +2904,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
2956
2904
|
* @deprecated import the EntityTablePaginatorComponent directly
|
|
2957
2905
|
*/
|
|
2958
2906
|
class IgoEntityTablePaginatorModule {
|
|
2959
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2960
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
2961
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
2907
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTablePaginatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2908
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTablePaginatorModule, imports: [EntityTablePaginatorComponent], exports: [EntityTablePaginatorComponent] });
|
|
2909
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTablePaginatorModule, imports: [EntityTablePaginatorComponent] });
|
|
2962
2910
|
}
|
|
2963
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityTablePaginatorModule, decorators: [{
|
|
2964
2912
|
type: NgModule,
|
|
2965
2913
|
args: [{
|
|
2966
2914
|
imports: [EntityTablePaginatorComponent],
|
|
@@ -2977,15 +2925,15 @@ const ENTITY_DIRECTIVES = [
|
|
|
2977
2925
|
* @deprecated import the components directly or ENTITY_DIRECTIVES for every components/directives
|
|
2978
2926
|
*/
|
|
2979
2927
|
class IgoEntityModule {
|
|
2980
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2981
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
2928
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2929
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityModule, imports: [EntitySelectorComponent,
|
|
2982
2930
|
EntityTableComponent,
|
|
2983
2931
|
EntityTablePaginatorComponent], exports: [EntitySelectorComponent,
|
|
2984
2932
|
EntityTableComponent,
|
|
2985
2933
|
EntityTablePaginatorComponent] });
|
|
2986
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
2934
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityModule, imports: [ENTITY_DIRECTIVES] });
|
|
2987
2935
|
}
|
|
2988
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoEntityModule, decorators: [{
|
|
2989
2937
|
type: NgModule,
|
|
2990
2938
|
args: [{
|
|
2991
2939
|
imports: [...ENTITY_DIRECTIVES],
|