@rxap/ngx-material-table-select 21.0.1-dev.1 → 22.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/compodoc/changelog.html +46 -0
- package/compodoc/classes/MockWindowRef.html +10 -8
- package/compodoc/components/WindowTestWrapperComponent.html +13 -7
- package/compodoc/dependencies.html +20 -20
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +374 -384
- package/docs/html/classes/ExtractTableSelectColumnMapMixin.html +2 -2
- package/docs/html/classes/ExtractTableSelectDataSourceMixin.html +2 -2
- package/docs/html/classes/ExtractTableSelectToDisplayMixin.html +2 -2
- package/docs/html/classes/ExtractTableSelectToValueMixin.html +2 -2
- package/docs/html/classes/MockWindowRef.html +5 -5
- package/docs/html/classes/OpenTableSelectWindowDirective.html +3 -3
- package/docs/html/classes/OpenTableSelectWindowMethod.html +2 -2
- package/docs/html/classes/TableSelectControlDirective.html +2 -2
- package/docs/html/classes/TableSelectInputComponent.html +20 -20
- package/docs/html/classes/TableSelectWindowComponent.html +2 -2
- package/docs/html/classes/WindowTestWrapperComponent.html +3 -3
- package/docs/html/functions/CreateFilterFormProvider.html +1 -1
- package/docs/html/functions/UseTableSelectColumns.html +1 -1
- package/docs/html/functions/UseTableSelectDataSource.html +1 -1
- package/docs/html/functions/UseTableSelectMethod.html +1 -1
- package/docs/html/functions/UseTableSelectToDisplay.html +1 -1
- package/docs/html/functions/UseTableSelectToValue.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/BooleanColumn.html +2 -2
- package/docs/html/interfaces/DateColumn.html +2 -2
- package/docs/html/interfaces/OpenTableSelectWindowMethodParameters.html +4 -4
- package/docs/html/interfaces/SelectColumn.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/TableSelectColumn.html +1 -1
- package/docs/html/types/TableSelectColumnMap.html +1 -1
- package/docs/html/types/TableSelectToDisplayFunction.html +1 -1
- package/docs/html/types/TableSelectToValueFunction.html +1 -1
- package/docs/html/variables/TABLE_SELECT_COLUMN_MAP.html +1 -1
- package/docs/html/variables/TABLE_SELECT_DATA_SOURCE.html +1 -1
- package/docs/html/variables/TABLE_SELECT_METHOD.html +1 -1
- package/docs/html/variables/TABLE_SELECT_TO_DISPLAY.html +1 -1
- package/docs/html/variables/TABLE_SELECT_TO_VALUE.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ExtractTableSelectColumnMapMixin.md +8 -8
- package/docs/markdown/classes/ExtractTableSelectDataSourceMixin.md +13 -13
- package/docs/markdown/classes/ExtractTableSelectToDisplayMixin.md +8 -8
- package/docs/markdown/classes/ExtractTableSelectToValueMixin.md +8 -8
- package/docs/markdown/classes/MockWindowRef.md +7 -7
- package/docs/markdown/classes/OpenTableSelectWindowDirective.md +44 -44
- package/docs/markdown/classes/OpenTableSelectWindowMethod.md +3 -3
- package/docs/markdown/classes/TableSelectControlDirective.md +36 -36
- package/docs/markdown/classes/TableSelectInputComponent.md +39 -44
- package/docs/markdown/classes/TableSelectWindowComponent.md +12 -12
- package/docs/markdown/classes/WindowTestWrapperComponent.md +9 -9
- package/docs/markdown/functions/CreateFilterFormProvider.md +2 -2
- package/docs/markdown/functions/UseTableSelectColumns.md +2 -2
- package/docs/markdown/functions/UseTableSelectDataSource.md +2 -2
- package/docs/markdown/functions/UseTableSelectMethod.md +2 -2
- package/docs/markdown/functions/UseTableSelectToDisplay.md +2 -2
- package/docs/markdown/functions/UseTableSelectToValue.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/BooleanColumn.md +5 -5
- package/docs/markdown/interfaces/DateColumn.md +6 -6
- package/docs/markdown/interfaces/OpenTableSelectWindowMethodParameters.md +14 -14
- package/docs/markdown/interfaces/SelectColumn.md +5 -5
- package/docs/markdown/type-aliases/TableSelectColumn.md +2 -2
- package/docs/markdown/type-aliases/TableSelectColumnMap.md +2 -2
- package/docs/markdown/type-aliases/TableSelectToDisplayFunction.md +2 -2
- package/docs/markdown/type-aliases/TableSelectToValueFunction.md +2 -2
- package/docs/markdown/variables/TABLE_SELECT_COLUMN_MAP.md +2 -2
- package/docs/markdown/variables/TABLE_SELECT_DATA_SOURCE.md +2 -2
- package/docs/markdown/variables/TABLE_SELECT_METHOD.md +2 -2
- package/docs/markdown/variables/TABLE_SELECT_TO_DISPLAY.md +2 -2
- package/docs/markdown/variables/TABLE_SELECT_TO_VALUE.md +2 -2
- package/docs/wiki/Class.ExtractTableSelectColumnMapMixin.md +7 -7
- package/docs/wiki/Class.ExtractTableSelectDataSourceMixin.md +12 -12
- package/docs/wiki/Class.ExtractTableSelectToDisplayMixin.md +7 -7
- package/docs/wiki/Class.ExtractTableSelectToValueMixin.md +7 -7
- package/docs/wiki/Class.MockWindowRef.md +6 -6
- package/docs/wiki/Class.OpenTableSelectWindowDirective.md +43 -43
- package/docs/wiki/Class.OpenTableSelectWindowMethod.md +2 -2
- package/docs/wiki/Class.TableSelectControlDirective.md +35 -35
- package/docs/wiki/Class.TableSelectInputComponent.md +38 -43
- package/docs/wiki/Class.TableSelectWindowComponent.md +11 -11
- package/docs/wiki/Class.WindowTestWrapperComponent.md +8 -8
- package/docs/wiki/Function.CreateFilterFormProvider.md +1 -1
- package/docs/wiki/Function.UseTableSelectColumns.md +1 -1
- package/docs/wiki/Function.UseTableSelectDataSource.md +1 -1
- package/docs/wiki/Function.UseTableSelectMethod.md +1 -1
- package/docs/wiki/Function.UseTableSelectToDisplay.md +1 -1
- package/docs/wiki/Function.UseTableSelectToValue.md +1 -1
- package/docs/wiki/Interface.BooleanColumn.md +4 -4
- package/docs/wiki/Interface.DateColumn.md +5 -5
- package/docs/wiki/Interface.OpenTableSelectWindowMethodParameters.md +13 -13
- package/docs/wiki/Interface.SelectColumn.md +4 -4
- package/docs/wiki/TypeAlias.TableSelectColumn.md +1 -1
- package/docs/wiki/TypeAlias.TableSelectColumnMap.md +1 -1
- package/docs/wiki/TypeAlias.TableSelectToDisplayFunction.md +1 -1
- package/docs/wiki/TypeAlias.TableSelectToValueFunction.md +1 -1
- package/docs/wiki/Variable.TABLE_SELECT_COLUMN_MAP.md +1 -1
- package/docs/wiki/Variable.TABLE_SELECT_DATA_SOURCE.md +1 -1
- package/docs/wiki/Variable.TABLE_SELECT_METHOD.md +1 -1
- package/docs/wiki/Variable.TABLE_SELECT_TO_DISPLAY.md +1 -1
- package/docs/wiki/Variable.TABLE_SELECT_TO_VALUE.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-ngx-material-table-select.mjs +1520 -769
- package/fesm2022/rxap-ngx-material-table-select.mjs.map +1 -1
- package/package.json +55 -55
- package/types/rxap-ngx-material-table-select.d.ts +334 -252
|
@@ -1,187 +1,542 @@
|
|
|
1
|
-
import { AsyncPipe, KeyValuePipe, NgClass } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import * as i6 from
|
|
5
|
-
import { FormsModule,
|
|
6
|
-
import * as i7 from
|
|
7
|
-
import {
|
|
8
|
-
import * as i4 from
|
|
9
|
-
import {
|
|
10
|
-
import * as i8 from
|
|
11
|
-
import { MatIconModule } from
|
|
12
|
-
import * as i5 from
|
|
13
|
-
import { MatInputModule } from
|
|
14
|
-
import * as i9 from
|
|
15
|
-
import { MatPaginatorModule } from
|
|
16
|
-
import * as i1 from
|
|
17
|
-
import { MatProgressBarModule } from
|
|
18
|
-
import * as i3 from
|
|
19
|
-
import { MatSortModule } from
|
|
20
|
-
import * as i2 from
|
|
21
|
-
import { MatTableModule } from
|
|
22
|
-
import {
|
|
23
|
-
import { FormFieldNoPaddingDirective } from
|
|
24
|
-
import { InputClearButtonDirective } from
|
|
25
|
-
import {
|
|
26
|
-
import { GetFromObjectPipe } from
|
|
27
|
-
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, WindowFooterDirective, WindowService
|
|
28
|
-
import { map, tap
|
|
29
|
-
import * as i1
|
|
30
|
-
import { CdkPortalOutlet, ComponentPortal, PortalModule } from
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { __decorate, __metadata } from
|
|
35
|
-
import { Mixin } from
|
|
36
|
-
import { ExtractDatasourceMixin } from
|
|
37
|
-
import {
|
|
38
|
-
import { GenerateRandomString, coerceArray } from
|
|
39
|
-
import
|
|
40
|
-
import {
|
|
41
|
-
import { takeUntilDestroyed } from
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
], ngImport: i0, template: "@if (tableDataSourceDirective.loading$ | async) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n}\n<div class=\"table-scroll-container mt-4 overflow-x-auto overscroll-auto\">\n <table #tableDataSourceDirective=\"rxapTableDataSource\"\n [id]=\"id ?? 'table-select'\"\n [paginator]=\"paginator\"\n [parameters]=\"data.parameters\"\n mat-table\n matSort\n rxap-filter-header-row\n rxapTableDataSource>\n\n @if (data.multiple) {\n <ng-container matColumnDef=\"select\" [sticky]=\"true\">\n <th *matHeaderCellDef class=\"drop-shadow-2xl\" mat-header-cell rxap-checkbox-header-cell></th>\n <td\n *matCellDef=\"let element\"\n [element]=\"element\"\n class=\"drop-shadow-2xl\"\n mat-cell\n rxap-checkbox-cell\n ></td>\n </ng-container>\n }\n\n @if (hasSomeFilterColumn) {\n @if (data.multiple) {\n <ng-container [matColumnDef]=\"'filter__select'\">\n <th *matHeaderCellDef mat-header-cell></th>\n </ng-container>\n }\n @for (item of data.columns | keyvalue; track item) {\n @if (item.value.filter) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n <mat-form-field rxapNoPadding>\n <mat-label i18n>{{ item.value.label }}</mat-label>\n <input\n [formControlName]=\"item.key\"\n [placeholder]=\"'Enter the ' + item.value.label + ' filter'\"\n matInput\n parentControlContainer\n />\n <button mat-icon-button matSuffix rxapInputClearButton>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n </th>\n </ng-container>\n }\n }\n }\n @if (!item.value.filter) {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>{{ data.showHeader ? '' : item.value.label }}</th>\n </ng-container>\n }\n }\n }\n\n @for (item of data.columns | keyvalue; track item) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [format]=\"item.value['format']\"\n [rxap-date-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [rxap-boolean-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>\n {{ item.value.label }}\n </th>\n <td *matCellDef=\"let element\" mat-cell>\n {{ element | getFromObject:item.key }}\n </td>\n </ng-container>\n }\n }\n }\n\n @if (hasSomeFilterColumn) {\n <tr\n *matHeaderRowDef=\"filterDisplayColumns\"\n class=\"filter-header\"\n mat-header-row\n ></tr>\n }\n\n @if (data.showHeader) {\n <tr\n *matHeaderRowDef=\"displayColumns\"\n mat-header-row\n ></tr>\n }\n\n <tr\n (click)=\"selectRow(element)\"\n *matRowDef=\"let element; columns: displayColumns\"\n [@rowsAnimation]\n class=\"cursor-pointer\"\n mat-row\n ></tr>\n\n </table>\n</div>\n<mat-paginator\n #paginator=\"matPaginator\"\n [pageSizeOptions]=\"[5, 10, 25, 50, 75, 100, 150, 200]\"\n [pageSize]=\"10\"\n></mat-paginator>\n\n<ng-template rxapWindowFooter>\n <div class=\"flex flex-row items-center gap-4\">\n <button (click)=\"close()\" class=\"grow-0\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n @if (data.multiple) {\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button\n type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n }\n @if (!data.multiple) {\n <span class=\"hint\" i18n>Click on a row to select an entry.</span>\n }\n </div>\n</ng-template>\n", styles: [".filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:initial}.filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:0}.hint{font-size:14px;opacity:.5}tr.mat-row{cursor:pointer}tr.mat-row:hover{opacity:.7}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: TableDataSourceDirective, selector: "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", inputs: ["rxapTableDataSource", "dataSource", "paginator", "id", "parameters"], exportAs: ["rxapTableDataSource"] }, { kind: "directive", type: FilterHeaderRowDirective, selector: "table[rxap-filter-header-row]", inputs: ["rxap-filter-header-row"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: CheckboxHeaderCellComponent, selector: "th[rxap-checkbox-header-cell]" }, { kind: "component", type: CheckboxCellComponent, selector: "td[rxap-checkbox-cell]", inputs: ["element"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: ParentControlContainerDirective, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: InputClearButtonDirective, selector: "[rxapInputClearButton]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DateCellComponent, selector: "td[rxap-date-cell]", inputs: ["rxap-date-cell", "format"] }, { kind: "component", type: BooleanCellComponent, selector: "td[rxap-boolean-cell]", inputs: ["rxap-boolean-cell"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i9.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: WindowFooterDirective, selector: "[rxapWindowFooter]" }, { kind: "directive", type: FormFieldNoPaddingDirective, selector: "mat-form-field[rxapNoPadding]" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: GetFromObjectPipe, name: "getFromObject" }], animations: [RowAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
1
|
+
import { AsyncPipe, KeyValuePipe, NgClass } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, ComponentRef, DestroyRef, Directive, INJECTOR, Injectable, Injector, ViewContainerRef, ViewRef, afterNextRender, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, linkedSignal, output, signal, untracked, viewChildren } from "@angular/core";
|
|
4
|
+
import * as i6 from "@angular/forms";
|
|
5
|
+
import { FormsModule, NgControl, ReactiveFormsModule } from "@angular/forms";
|
|
6
|
+
import * as i7 from "@angular/material/button";
|
|
7
|
+
import { MatButton, MatButtonModule } from "@angular/material/button";
|
|
8
|
+
import * as i4 from "@angular/material/form-field";
|
|
9
|
+
import { MatFormField, MatFormFieldControl, MatFormFieldModule } from "@angular/material/form-field";
|
|
10
|
+
import * as i8 from "@angular/material/icon";
|
|
11
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
12
|
+
import * as i5 from "@angular/material/input";
|
|
13
|
+
import { MatInputModule } from "@angular/material/input";
|
|
14
|
+
import * as i9 from "@angular/material/paginator";
|
|
15
|
+
import { MatPaginatorModule } from "@angular/material/paginator";
|
|
16
|
+
import * as i1$1 from "@angular/material/progress-bar";
|
|
17
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
18
|
+
import * as i3 from "@angular/material/sort";
|
|
19
|
+
import { MatSortModule } from "@angular/material/sort";
|
|
20
|
+
import * as i2 from "@angular/material/table";
|
|
21
|
+
import { MatTableModule } from "@angular/material/table";
|
|
22
|
+
import { ControlValueAccessor, ParentControlContainerDirective, RxapFormControl, RxapFormGroup } from "@rxap/forms";
|
|
23
|
+
import { FormFieldNoPaddingDirective } from "@rxap/material-directives/form-field";
|
|
24
|
+
import { InputClearButtonDirective } from "@rxap/material-form-system";
|
|
25
|
+
import { BooleanCellComponent, CheckboxCellComponent, CheckboxHeaderCellComponent, DateCellComponent, FilterHeaderRowDirective, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_METHOD, RowAnimation, SelectRowService, TABLE_DATA_SOURCE, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableDataSourceDirective, TableFilterService } from "@rxap/material-table-system";
|
|
26
|
+
import { GetFromObjectPipe } from "@rxap/pipes";
|
|
27
|
+
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, RXAP_WINDOW_SETTINGS, WindowFooterDirective, WindowService } from "@rxap/window-system";
|
|
28
|
+
import { map, tap } from "rxjs/operators";
|
|
29
|
+
import * as i1 from "@angular/cdk/portal";
|
|
30
|
+
import { CdkPortalOutlet, ComponentPortal, PortalModule } from "@angular/cdk/portal";
|
|
31
|
+
import { ReplaySubject, Subject, Subscription, delay, startWith, tap as tap$1 } from "rxjs";
|
|
32
|
+
import { ExtractControlMixin, ExtractFormDefinitionMixin, RxapFormSystemError, UseDataSource } from "@rxap/form-system";
|
|
33
|
+
import { getMetadata, setMetadataMap } from "@rxap/reflect-metadata";
|
|
34
|
+
import { __decorate, __metadata } from "tslib";
|
|
35
|
+
import { Mixin } from "@rxap/mixin";
|
|
36
|
+
import { ExtractDatasourceMixin } from "@rxap/material-table-window-system";
|
|
37
|
+
import { BaseDataSource, DataSourceLoader, staticDataSource } from "@rxap/data-source";
|
|
38
|
+
import { GenerateRandomString, coerceArray } from "@rxap/utilities";
|
|
39
|
+
import "@rxap/rxjs";
|
|
40
|
+
import { AbstractTableDataSource, TableDataSource } from "@rxap/data-source/table";
|
|
41
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
42
|
+
var TableSelectWindowComponent = class TableSelectWindowComponent {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.data = inject(RXAP_WINDOW_DATA);
|
|
45
|
+
this.selectRows = inject(SelectRowService);
|
|
46
|
+
this.windowRef = inject(RXAP_WINDOW_REF);
|
|
47
|
+
this.id = this.data.id;
|
|
48
|
+
this.displayColumns = [...this.data.columns.keys()];
|
|
49
|
+
if (this.data.multiple) this.displayColumns.unshift("select");
|
|
50
|
+
this.filterDisplayColumns = this.displayColumns.map((column) => ["filter", column].join("__"));
|
|
51
|
+
this.hasSomeFilterColumn = Array.from(this.data.columns.values()).some((column) => column.filter);
|
|
52
|
+
this.hasNotSelected$ = this.selectRows.selectedRows$.pipe(map((selected) => selected.length === 0));
|
|
53
|
+
if (this.data.selected?.length) this.selectRows.selectionModel.select(...this.data.selected);
|
|
54
|
+
}
|
|
55
|
+
selectRow(element) {
|
|
56
|
+
this.selectRows.selectionModel.select(element);
|
|
57
|
+
if (!this.data.multiple) this.select();
|
|
58
|
+
}
|
|
59
|
+
close() {
|
|
60
|
+
this.windowRef.complete();
|
|
61
|
+
}
|
|
62
|
+
select() {
|
|
63
|
+
this.windowRef.next(this.selectRows.selectedRows);
|
|
64
|
+
this.close();
|
|
65
|
+
}
|
|
66
|
+
static {
|
|
67
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
68
|
+
minVersion: "12.0.0",
|
|
69
|
+
version: "22.3.0",
|
|
70
|
+
ngImport: i0,
|
|
71
|
+
type: TableSelectWindowComponent,
|
|
72
|
+
deps: [],
|
|
73
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
static {
|
|
77
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
78
|
+
minVersion: "17.0.0",
|
|
79
|
+
version: "22.3.0",
|
|
80
|
+
type: TableSelectWindowComponent,
|
|
81
|
+
isStandalone: true,
|
|
82
|
+
selector: "rxap-table-select-window",
|
|
83
|
+
providers: [SelectRowService, TableFilterService],
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
template: "@if (tableDataSourceDirective.loading$ | async) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n}\n<div class=\"table-scroll-container mt-4 overflow-x-auto overscroll-auto\">\n <table #tableDataSourceDirective=\"rxapTableDataSource\"\n [id]=\"id ?? 'table-select'\"\n [paginator]=\"paginator\"\n [parameters]=\"data.parameters\"\n mat-table\n matSort\n rxap-filter-header-row\n rxapTableDataSource>\n\n @if (data.multiple) {\n <ng-container matColumnDef=\"select\" [sticky]=\"true\">\n <th *matHeaderCellDef class=\"drop-shadow-2xl\" mat-header-cell rxap-checkbox-header-cell></th>\n <td\n *matCellDef=\"let element\"\n [element]=\"element\"\n class=\"drop-shadow-2xl\"\n mat-cell\n rxap-checkbox-cell\n ></td>\n </ng-container>\n }\n\n @if (hasSomeFilterColumn) {\n @if (data.multiple) {\n <ng-container [matColumnDef]=\"'filter__select'\">\n <th *matHeaderCellDef mat-header-cell></th>\n </ng-container>\n }\n @for (item of data.columns | keyvalue; track item) {\n @if (item.value.filter) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n <mat-form-field rxapNoPadding>\n <mat-label i18n>{{ item.value.label }}</mat-label>\n <input\n [formControlName]=\"item.key\"\n [placeholder]=\"'Enter the ' + item.value.label + ' filter'\"\n matInput\n parentControlContainer\n />\n <button mat-icon-button matSuffix rxapInputClearButton>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n </th>\n </ng-container>\n }\n }\n }\n @if (!item.value.filter) {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>{{ data.showHeader ? '' : item.value.label }}</th>\n </ng-container>\n }\n }\n }\n\n @for (item of data.columns | keyvalue; track item) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [format]=\"item.value['format']\"\n [rxap-date-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [rxap-boolean-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>\n {{ item.value.label }}\n </th>\n <td *matCellDef=\"let element\" mat-cell>\n {{ element | getFromObject:item.key }}\n </td>\n </ng-container>\n }\n }\n }\n\n @if (hasSomeFilterColumn) {\n <tr\n *matHeaderRowDef=\"filterDisplayColumns\"\n class=\"filter-header\"\n mat-header-row\n ></tr>\n }\n\n @if (data.showHeader) {\n <tr\n *matHeaderRowDef=\"displayColumns\"\n mat-header-row\n ></tr>\n }\n\n <tr\n (click)=\"selectRow(element)\"\n *matRowDef=\"let element; columns: displayColumns\"\n [@rowsAnimation]\n class=\"cursor-pointer\"\n mat-row\n ></tr>\n\n </table>\n</div>\n<mat-paginator\n #paginator=\"matPaginator\"\n [pageSizeOptions]=\"[5, 10, 25, 50, 75, 100, 150, 200]\"\n [pageSize]=\"10\"\n></mat-paginator>\n\n<ng-template rxapWindowFooter>\n <div class=\"flex flex-row items-center gap-4\">\n <button (click)=\"close()\" class=\"grow-0\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n @if (data.multiple) {\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button\n type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n }\n @if (!data.multiple) {\n <span class=\"hint\" i18n>Click on a row to select an entry.</span>\n }\n </div>\n</ng-template>\n",
|
|
86
|
+
styles: [".filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:initial}.filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:0}.hint{font-size:14px;opacity:.5}tr.mat-row{cursor:pointer}tr.mat-row:hover{opacity:.7}\n"],
|
|
87
|
+
dependencies: [
|
|
88
|
+
{
|
|
89
|
+
kind: "ngmodule",
|
|
90
|
+
type: MatProgressBarModule
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
kind: "component",
|
|
94
|
+
type: i1$1.MatProgressBar,
|
|
95
|
+
selector: "mat-progress-bar",
|
|
96
|
+
inputs: [
|
|
97
|
+
"color",
|
|
98
|
+
"value",
|
|
99
|
+
"bufferValue",
|
|
100
|
+
"mode"
|
|
101
|
+
],
|
|
102
|
+
outputs: ["animationEnd"],
|
|
103
|
+
exportAs: ["matProgressBar"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
kind: "ngmodule",
|
|
107
|
+
type: MatTableModule
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
kind: "component",
|
|
111
|
+
type: i2.MatTable,
|
|
112
|
+
selector: "mat-table, table[mat-table]",
|
|
113
|
+
exportAs: ["matTable"]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
kind: "directive",
|
|
117
|
+
type: i2.MatHeaderCellDef,
|
|
118
|
+
selector: "[matHeaderCellDef]"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
kind: "directive",
|
|
122
|
+
type: i2.MatHeaderRowDef,
|
|
123
|
+
selector: "[matHeaderRowDef]",
|
|
124
|
+
inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
kind: "directive",
|
|
128
|
+
type: i2.MatColumnDef,
|
|
129
|
+
selector: "[matColumnDef]",
|
|
130
|
+
inputs: ["matColumnDef"]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
kind: "directive",
|
|
134
|
+
type: i2.MatCellDef,
|
|
135
|
+
selector: "[matCellDef]"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
kind: "directive",
|
|
139
|
+
type: i2.MatRowDef,
|
|
140
|
+
selector: "[matRowDef]",
|
|
141
|
+
inputs: ["matRowDefColumns", "matRowDefWhen"]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
kind: "directive",
|
|
145
|
+
type: i2.MatHeaderCell,
|
|
146
|
+
selector: "mat-header-cell, th[mat-header-cell]"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
kind: "directive",
|
|
150
|
+
type: i2.MatCell,
|
|
151
|
+
selector: "mat-cell, td[mat-cell]"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
kind: "component",
|
|
155
|
+
type: i2.MatHeaderRow,
|
|
156
|
+
selector: "mat-header-row, tr[mat-header-row]",
|
|
157
|
+
exportAs: ["matHeaderRow"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
kind: "component",
|
|
161
|
+
type: i2.MatRow,
|
|
162
|
+
selector: "mat-row, tr[mat-row]",
|
|
163
|
+
exportAs: ["matRow"]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
kind: "directive",
|
|
167
|
+
type: TableDataSourceDirective,
|
|
168
|
+
selector: "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]",
|
|
169
|
+
inputs: [
|
|
170
|
+
"rxapTableDataSource",
|
|
171
|
+
"dataSource",
|
|
172
|
+
"paginator",
|
|
173
|
+
"id",
|
|
174
|
+
"parameters"
|
|
175
|
+
],
|
|
176
|
+
exportAs: ["rxapTableDataSource"]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
kind: "directive",
|
|
180
|
+
type: FilterHeaderRowDirective,
|
|
181
|
+
selector: "table[rxap-filter-header-row]",
|
|
182
|
+
inputs: ["rxap-filter-header-row"]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
kind: "ngmodule",
|
|
186
|
+
type: MatSortModule
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "directive",
|
|
190
|
+
type: i3.MatSort,
|
|
191
|
+
selector: "[matSort]",
|
|
192
|
+
inputs: [
|
|
193
|
+
"matSortActive",
|
|
194
|
+
"matSortStart",
|
|
195
|
+
"matSortDirection",
|
|
196
|
+
"matSortDisableClear",
|
|
197
|
+
"matSortDisabled"
|
|
198
|
+
],
|
|
199
|
+
outputs: ["matSortChange"],
|
|
200
|
+
exportAs: ["matSort"]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
kind: "component",
|
|
204
|
+
type: i3.MatSortHeader,
|
|
205
|
+
selector: "[mat-sort-header]",
|
|
206
|
+
inputs: [
|
|
207
|
+
"mat-sort-header",
|
|
208
|
+
"arrowPosition",
|
|
209
|
+
"start",
|
|
210
|
+
"disabled",
|
|
211
|
+
"sortActionDescription",
|
|
212
|
+
"disableClear"
|
|
213
|
+
],
|
|
214
|
+
exportAs: ["matSortHeader"]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
kind: "component",
|
|
218
|
+
type: CheckboxHeaderCellComponent,
|
|
219
|
+
selector: "th[rxap-checkbox-header-cell]"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
kind: "component",
|
|
223
|
+
type: CheckboxCellComponent,
|
|
224
|
+
selector: "td[rxap-checkbox-cell]",
|
|
225
|
+
inputs: ["element"]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
kind: "ngmodule",
|
|
229
|
+
type: MatFormFieldModule
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
kind: "component",
|
|
233
|
+
type: i4.MatFormField,
|
|
234
|
+
selector: "mat-form-field",
|
|
235
|
+
inputs: [
|
|
236
|
+
"hideRequiredMarker",
|
|
237
|
+
"color",
|
|
238
|
+
"floatLabel",
|
|
239
|
+
"appearance",
|
|
240
|
+
"subscriptSizing",
|
|
241
|
+
"hintLabel"
|
|
242
|
+
],
|
|
243
|
+
exportAs: ["matFormField"]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
kind: "directive",
|
|
247
|
+
type: i4.MatLabel,
|
|
248
|
+
selector: "mat-label"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
kind: "directive",
|
|
252
|
+
type: i4.MatSuffix,
|
|
253
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
254
|
+
inputs: ["matTextSuffix"]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
kind: "ngmodule",
|
|
258
|
+
type: MatInputModule
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
kind: "directive",
|
|
262
|
+
type: i5.MatInput,
|
|
263
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
264
|
+
inputs: [
|
|
265
|
+
"disabled",
|
|
266
|
+
"id",
|
|
267
|
+
"placeholder",
|
|
268
|
+
"name",
|
|
269
|
+
"required",
|
|
270
|
+
"type",
|
|
271
|
+
"errorStateMatcher",
|
|
272
|
+
"aria-describedby",
|
|
273
|
+
"value",
|
|
274
|
+
"readonly",
|
|
275
|
+
"disabledInteractive"
|
|
276
|
+
],
|
|
277
|
+
exportAs: ["matInput"]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
kind: "ngmodule",
|
|
281
|
+
type: FormsModule
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
kind: "directive",
|
|
285
|
+
type: i6.DefaultValueAccessor,
|
|
286
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
kind: "directive",
|
|
290
|
+
type: i6.NgControlStatus,
|
|
291
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
kind: "ngmodule",
|
|
295
|
+
type: ReactiveFormsModule
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
kind: "directive",
|
|
299
|
+
type: i6.FormControlName,
|
|
300
|
+
selector: "[formControlName]",
|
|
301
|
+
inputs: [
|
|
302
|
+
"formControlName",
|
|
303
|
+
"disabled",
|
|
304
|
+
"ngModel"
|
|
305
|
+
],
|
|
306
|
+
outputs: ["ngModelChange"]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
kind: "directive",
|
|
310
|
+
type: ParentControlContainerDirective,
|
|
311
|
+
selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
kind: "ngmodule",
|
|
315
|
+
type: MatButtonModule
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
kind: "component",
|
|
319
|
+
type: i7.MatButton,
|
|
320
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
321
|
+
inputs: ["matButton"],
|
|
322
|
+
exportAs: ["matButton", "matAnchor"]
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
kind: "component",
|
|
326
|
+
type: i7.MatIconButton,
|
|
327
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
328
|
+
exportAs: ["matButton", "matAnchor"]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
kind: "directive",
|
|
332
|
+
type: InputClearButtonDirective,
|
|
333
|
+
selector: "[rxapInputClearButton]"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
kind: "ngmodule",
|
|
337
|
+
type: MatIconModule
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
kind: "component",
|
|
341
|
+
type: i8.MatIcon,
|
|
342
|
+
selector: "mat-icon",
|
|
343
|
+
inputs: [
|
|
344
|
+
"color",
|
|
345
|
+
"inline",
|
|
346
|
+
"svgIcon",
|
|
347
|
+
"fontSet",
|
|
348
|
+
"fontIcon"
|
|
349
|
+
],
|
|
350
|
+
exportAs: ["matIcon"]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
kind: "component",
|
|
354
|
+
type: DateCellComponent,
|
|
355
|
+
selector: "td[rxap-date-cell]",
|
|
356
|
+
inputs: ["rxap-date-cell", "format"]
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
kind: "component",
|
|
360
|
+
type: BooleanCellComponent,
|
|
361
|
+
selector: "td[rxap-boolean-cell]",
|
|
362
|
+
inputs: ["rxap-boolean-cell"]
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
kind: "ngmodule",
|
|
366
|
+
type: MatPaginatorModule
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
kind: "component",
|
|
370
|
+
type: i9.MatPaginator,
|
|
371
|
+
selector: "mat-paginator",
|
|
372
|
+
inputs: [
|
|
373
|
+
"color",
|
|
374
|
+
"pageIndex",
|
|
375
|
+
"length",
|
|
376
|
+
"pageSize",
|
|
377
|
+
"pageSizeOptions",
|
|
378
|
+
"hidePageSize",
|
|
379
|
+
"showFirstLastButtons",
|
|
380
|
+
"selectConfig",
|
|
381
|
+
"disabled"
|
|
382
|
+
],
|
|
383
|
+
outputs: ["page"],
|
|
384
|
+
exportAs: ["matPaginator"]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
kind: "directive",
|
|
388
|
+
type: WindowFooterDirective,
|
|
389
|
+
selector: "[rxapWindowFooter]"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
kind: "directive",
|
|
393
|
+
type: FormFieldNoPaddingDirective,
|
|
394
|
+
selector: "mat-form-field[rxapNoPadding]"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
kind: "pipe",
|
|
398
|
+
type: AsyncPipe,
|
|
399
|
+
name: "async"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
kind: "pipe",
|
|
403
|
+
type: KeyValuePipe,
|
|
404
|
+
name: "keyvalue"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
kind: "pipe",
|
|
408
|
+
type: GetFromObjectPipe,
|
|
409
|
+
name: "getFromObject"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
animations: [RowAnimation],
|
|
413
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
418
|
+
minVersion: "12.0.0",
|
|
419
|
+
version: "22.3.0",
|
|
420
|
+
ngImport: i0,
|
|
421
|
+
type: TableSelectWindowComponent,
|
|
422
|
+
decorators: [{
|
|
423
|
+
type: Component,
|
|
424
|
+
args: [{
|
|
425
|
+
selector: "rxap-table-select-window",
|
|
426
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
427
|
+
animations: [RowAnimation],
|
|
428
|
+
providers: [SelectRowService, TableFilterService],
|
|
429
|
+
imports: [
|
|
430
|
+
MatProgressBarModule,
|
|
431
|
+
MatTableModule,
|
|
432
|
+
TableDataSourceDirective,
|
|
433
|
+
FilterHeaderRowDirective,
|
|
434
|
+
MatSortModule,
|
|
435
|
+
CheckboxHeaderCellComponent,
|
|
436
|
+
CheckboxCellComponent,
|
|
437
|
+
MatFormFieldModule,
|
|
438
|
+
MatInputModule,
|
|
439
|
+
FormsModule,
|
|
440
|
+
ReactiveFormsModule,
|
|
441
|
+
ParentControlContainerDirective,
|
|
442
|
+
MatButtonModule,
|
|
443
|
+
InputClearButtonDirective,
|
|
444
|
+
MatIconModule,
|
|
445
|
+
DateCellComponent,
|
|
446
|
+
BooleanCellComponent,
|
|
447
|
+
MatPaginatorModule,
|
|
448
|
+
WindowFooterDirective,
|
|
449
|
+
AsyncPipe,
|
|
450
|
+
KeyValuePipe,
|
|
451
|
+
GetFromObjectPipe,
|
|
452
|
+
FormFieldNoPaddingDirective
|
|
453
|
+
],
|
|
454
|
+
template: "@if (tableDataSourceDirective.loading$ | async) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n}\n<div class=\"table-scroll-container mt-4 overflow-x-auto overscroll-auto\">\n <table #tableDataSourceDirective=\"rxapTableDataSource\"\n [id]=\"id ?? 'table-select'\"\n [paginator]=\"paginator\"\n [parameters]=\"data.parameters\"\n mat-table\n matSort\n rxap-filter-header-row\n rxapTableDataSource>\n\n @if (data.multiple) {\n <ng-container matColumnDef=\"select\" [sticky]=\"true\">\n <th *matHeaderCellDef class=\"drop-shadow-2xl\" mat-header-cell rxap-checkbox-header-cell></th>\n <td\n *matCellDef=\"let element\"\n [element]=\"element\"\n class=\"drop-shadow-2xl\"\n mat-cell\n rxap-checkbox-cell\n ></td>\n </ng-container>\n }\n\n @if (hasSomeFilterColumn) {\n @if (data.multiple) {\n <ng-container [matColumnDef]=\"'filter__select'\">\n <th *matHeaderCellDef mat-header-cell></th>\n </ng-container>\n }\n @for (item of data.columns | keyvalue; track item) {\n @if (item.value.filter) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n </th>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n <mat-form-field rxapNoPadding>\n <mat-label i18n>{{ item.value.label }}</mat-label>\n <input\n [formControlName]=\"item.key\"\n [placeholder]=\"'Enter the ' + item.value.label + ' filter'\"\n matInput\n parentControlContainer\n />\n <button mat-icon-button matSuffix rxapInputClearButton>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n </th>\n </ng-container>\n }\n }\n }\n @if (!item.value.filter) {\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>{{ data.showHeader ? '' : item.value.label }}</th>\n </ng-container>\n }\n }\n }\n\n @for (item of data.columns | keyvalue; track item) {\n @switch (item.value.type) {\n @case ('date') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [format]=\"item.value['format']\"\n [rxap-date-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @case ('boolean') {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>{{ item.value.label }}</th>\n <td\n *matCellDef=\"let element\"\n [rxap-boolean-cell]=\"element | getFromObject:item.key\"\n mat-cell\n ></td>\n </ng-container>\n }\n @default {\n <ng-container [matColumnDef]=\"item.key\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header>\n {{ item.value.label }}\n </th>\n <td *matCellDef=\"let element\" mat-cell>\n {{ element | getFromObject:item.key }}\n </td>\n </ng-container>\n }\n }\n }\n\n @if (hasSomeFilterColumn) {\n <tr\n *matHeaderRowDef=\"filterDisplayColumns\"\n class=\"filter-header\"\n mat-header-row\n ></tr>\n }\n\n @if (data.showHeader) {\n <tr\n *matHeaderRowDef=\"displayColumns\"\n mat-header-row\n ></tr>\n }\n\n <tr\n (click)=\"selectRow(element)\"\n *matRowDef=\"let element; columns: displayColumns\"\n [@rowsAnimation]\n class=\"cursor-pointer\"\n mat-row\n ></tr>\n\n </table>\n</div>\n<mat-paginator\n #paginator=\"matPaginator\"\n [pageSizeOptions]=\"[5, 10, 25, 50, 75, 100, 150, 200]\"\n [pageSize]=\"10\"\n></mat-paginator>\n\n<ng-template rxapWindowFooter>\n <div class=\"flex flex-row items-center gap-4\">\n <button (click)=\"close()\" class=\"grow-0\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n @if (data.multiple) {\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button\n type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n }\n @if (!data.multiple) {\n <span class=\"hint\" i18n>Click on a row to select an entry.</span>\n }\n </div>\n</ng-template>\n",
|
|
455
|
+
styles: [".filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:initial}.filter-header ::ng-deep .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:0}.hint{font-size:14px;opacity:.5}tr.mat-row{cursor:pointer}tr.mat-row:hover{opacity:.7}\n"]
|
|
456
|
+
}]
|
|
457
|
+
}],
|
|
458
|
+
ctorParameters: () => []
|
|
459
|
+
});
|
|
460
|
+
var MockWindowRef = class extends Subject {
|
|
461
|
+
constructor() {
|
|
462
|
+
super(...arguments);
|
|
463
|
+
this.closed$ = new Subject();
|
|
464
|
+
this.footerPortal$ = new ReplaySubject(1);
|
|
465
|
+
}
|
|
466
|
+
close(result) {
|
|
467
|
+
this.closed$.next(result);
|
|
468
|
+
if (result !== void 0) this.next(result);
|
|
469
|
+
this.complete();
|
|
470
|
+
}
|
|
471
|
+
complete() {
|
|
472
|
+
super.complete();
|
|
473
|
+
}
|
|
474
|
+
setFooterPortal(portal) {
|
|
475
|
+
setTimeout(() => {
|
|
476
|
+
this.footerPortal$.next(portal);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
var WindowTestWrapperComponent = class WindowTestWrapperComponent {
|
|
481
|
+
constructor() {
|
|
482
|
+
this.component = input.required(...ngDevMode ? [{ debugName: "component" }] : /* istanbul ignore next */ []);
|
|
483
|
+
this.content = null;
|
|
484
|
+
this.footer = null;
|
|
485
|
+
this.injector = inject(INJECTOR);
|
|
486
|
+
this.viewContainerRef = this.injector.get(ViewContainerRef);
|
|
487
|
+
this.portalOutlet = viewChildren(CdkPortalOutlet, ...ngDevMode ? [{ debugName: "portalOutlet" }] : /* istanbul ignore next */ []);
|
|
488
|
+
}
|
|
489
|
+
ngAfterViewInit() {
|
|
490
|
+
this.portalOutlet().forEach((outlet) => {
|
|
491
|
+
outlet.attached.pipe(tap$1((attachedRef) => {
|
|
492
|
+
if (attachedRef instanceof ComponentRef) console.log("ComponentRef", attachedRef);
|
|
493
|
+
else if (attachedRef instanceof ViewRef) console.log("viewRef", attachedRef);
|
|
494
|
+
else console.log("attachedRef", attachedRef);
|
|
495
|
+
})).subscribe();
|
|
496
|
+
});
|
|
497
|
+
const windowRef = new MockWindowRef();
|
|
498
|
+
const injector = Injector.create({
|
|
499
|
+
parent: this.injector,
|
|
500
|
+
providers: [{
|
|
501
|
+
provide: RXAP_WINDOW_REF,
|
|
502
|
+
useValue: windowRef
|
|
503
|
+
}]
|
|
504
|
+
});
|
|
505
|
+
windowRef.footerPortal$.pipe(tap$1((portal) => this.footer = portal)).subscribe();
|
|
506
|
+
this.content = new ComponentPortal(this.component(), this.viewContainerRef, injector);
|
|
507
|
+
}
|
|
508
|
+
static {
|
|
509
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
510
|
+
minVersion: "12.0.0",
|
|
511
|
+
version: "22.3.0",
|
|
512
|
+
ngImport: i0,
|
|
513
|
+
type: WindowTestWrapperComponent,
|
|
514
|
+
deps: [],
|
|
515
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
static {
|
|
519
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
520
|
+
minVersion: "17.2.0",
|
|
521
|
+
version: "22.3.0",
|
|
522
|
+
type: WindowTestWrapperComponent,
|
|
523
|
+
isStandalone: true,
|
|
524
|
+
selector: "ng-component",
|
|
525
|
+
inputs: { component: {
|
|
526
|
+
classPropertyName: "component",
|
|
527
|
+
publicName: "component",
|
|
528
|
+
isSignal: true,
|
|
529
|
+
isRequired: true,
|
|
530
|
+
transformFunction: null
|
|
531
|
+
} },
|
|
532
|
+
viewQueries: [{
|
|
533
|
+
propertyName: "portalOutlet",
|
|
534
|
+
predicate: CdkPortalOutlet,
|
|
535
|
+
descendants: true,
|
|
536
|
+
isSignal: true
|
|
537
|
+
}],
|
|
538
|
+
ngImport: i0,
|
|
539
|
+
template: `
|
|
185
540
|
<div class="flex flex-col gap-8">
|
|
186
541
|
<div class="grow">
|
|
187
542
|
<ng-template [cdkPortalOutlet]="content"></ng-template>
|
|
@@ -191,12 +546,32 @@ class WindowTestWrapperComponent {
|
|
|
191
546
|
<ng-template [cdkPortalOutlet]="footer"></ng-template>
|
|
192
547
|
</div>
|
|
193
548
|
</div>
|
|
194
|
-
`,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
549
|
+
`,
|
|
550
|
+
isInline: true,
|
|
551
|
+
dependencies: [{
|
|
552
|
+
kind: "ngmodule",
|
|
553
|
+
type: PortalModule
|
|
554
|
+
}, {
|
|
555
|
+
kind: "directive",
|
|
556
|
+
type: i1.CdkPortalOutlet,
|
|
557
|
+
selector: "[cdkPortalOutlet]",
|
|
558
|
+
inputs: ["cdkPortalOutlet"],
|
|
559
|
+
outputs: ["attached"],
|
|
560
|
+
exportAs: ["cdkPortalOutlet"]
|
|
561
|
+
}],
|
|
562
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
567
|
+
minVersion: "12.0.0",
|
|
568
|
+
version: "22.3.0",
|
|
569
|
+
ngImport: i0,
|
|
570
|
+
type: WindowTestWrapperComponent,
|
|
571
|
+
decorators: [{
|
|
572
|
+
type: Component,
|
|
573
|
+
args: [{
|
|
574
|
+
template: `
|
|
200
575
|
<div class="flex flex-col gap-8">
|
|
201
576
|
<div class="grow">
|
|
202
577
|
<ng-template [cdkPortalOutlet]="content"></ng-template>
|
|
@@ -207,607 +582,983 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
207
582
|
</div>
|
|
208
583
|
</div>
|
|
209
584
|
`,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
585
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
586
|
+
imports: [PortalModule]
|
|
587
|
+
}]
|
|
588
|
+
}],
|
|
589
|
+
propDecorators: {
|
|
590
|
+
component: [{
|
|
591
|
+
type: i0.Input,
|
|
592
|
+
args: [{
|
|
593
|
+
isSignal: true,
|
|
594
|
+
alias: "component",
|
|
595
|
+
required: true
|
|
596
|
+
}]
|
|
597
|
+
}],
|
|
598
|
+
portalOutlet: [{
|
|
599
|
+
type: i0.ViewChildren,
|
|
600
|
+
args: [i0.forwardRef(() => CdkPortalOutlet), { isSignal: true }]
|
|
601
|
+
}]
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
var TableSelectInputComponent = class TableSelectInputComponent extends ControlValueAccessor {
|
|
605
|
+
static {
|
|
606
|
+
this.nextId = 0;
|
|
607
|
+
}
|
|
608
|
+
get empty() {
|
|
609
|
+
return this._value() === null;
|
|
610
|
+
}
|
|
611
|
+
get shouldLabelFloat() {
|
|
612
|
+
return this.focused || !this.empty;
|
|
613
|
+
}
|
|
614
|
+
get required() {
|
|
615
|
+
return this.requiredInput();
|
|
616
|
+
}
|
|
617
|
+
get disabled() {
|
|
618
|
+
return this._disabled();
|
|
619
|
+
}
|
|
620
|
+
get errorState() {
|
|
621
|
+
return this.ngControl?.invalid || false;
|
|
622
|
+
}
|
|
623
|
+
get placeholder() {
|
|
624
|
+
return this.placeholderInput();
|
|
625
|
+
}
|
|
626
|
+
set value(value) {
|
|
627
|
+
this._value.set(value);
|
|
628
|
+
}
|
|
629
|
+
get value() {
|
|
630
|
+
return this._value();
|
|
631
|
+
}
|
|
632
|
+
constructor() {
|
|
633
|
+
super();
|
|
634
|
+
this.ngControl = inject(NgControl, {
|
|
635
|
+
optional: true,
|
|
636
|
+
self: true
|
|
637
|
+
});
|
|
638
|
+
this.id = `rxap-table-select-input-${TableSelectInputComponent.nextId++}`;
|
|
639
|
+
this.stateChanges = new Subject();
|
|
640
|
+
this.control = null;
|
|
641
|
+
this.rxapControl = null;
|
|
642
|
+
this.focused = false;
|
|
643
|
+
this.requiredInput = input(false, {
|
|
644
|
+
...ngDevMode ? { debugName: "requiredInput" } : /* istanbul ignore next */ {},
|
|
645
|
+
alias: "required",
|
|
646
|
+
transform: booleanAttribute
|
|
647
|
+
});
|
|
648
|
+
this.disabledInput = input(false, {
|
|
649
|
+
...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
|
|
650
|
+
alias: "disabled",
|
|
651
|
+
transform: booleanAttribute
|
|
652
|
+
});
|
|
653
|
+
this._disabled = linkedSignal(() => this.disabledInput(), ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
|
|
654
|
+
this._subscription = new Subscription();
|
|
655
|
+
this._value = signal(null, ...ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []);
|
|
656
|
+
this.placeholderInput = input("", {
|
|
657
|
+
...ngDevMode ? { debugName: "placeholderInput" } : /* istanbul ignore next */ {},
|
|
658
|
+
alias: "placeholder"
|
|
659
|
+
});
|
|
660
|
+
this._display = signal(void 0, ...ngDevMode ? [{ debugName: "_display" }] : /* istanbul ignore next */ []);
|
|
661
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
662
|
+
effect(() => {
|
|
663
|
+
this.requiredInput();
|
|
664
|
+
this._disabled();
|
|
665
|
+
this.placeholderInput();
|
|
666
|
+
this._value();
|
|
667
|
+
this.stateChanges.next();
|
|
668
|
+
});
|
|
669
|
+
afterNextRender(() => this.initControl());
|
|
670
|
+
}
|
|
671
|
+
get display() {
|
|
672
|
+
return this._display();
|
|
673
|
+
}
|
|
674
|
+
set display(value) {
|
|
675
|
+
this._display.set(value);
|
|
676
|
+
}
|
|
677
|
+
writeValue(value) {
|
|
678
|
+
this.value = value;
|
|
679
|
+
}
|
|
680
|
+
setValue(value) {
|
|
681
|
+
this.value = value;
|
|
682
|
+
if (this.onChange) this.onChange(this.value);
|
|
683
|
+
}
|
|
684
|
+
initControl() {
|
|
685
|
+
if (this.ngControl) {
|
|
686
|
+
this.control = this.ngControl.control;
|
|
687
|
+
if (this.control instanceof RxapFormControl) this.rxapControl = this.control;
|
|
688
|
+
}
|
|
689
|
+
this._subscription.add(this.control?.valueChanges.pipe(startWith(this.control?.value ?? null), delay(100), tap(async (value) => this.display = value === null ? "" : await this.toDisplay(value))).subscribe());
|
|
690
|
+
this._subscription.add(this.rxapControl?.disabled$.pipe(tap((disabled) => this._disabled.set(disabled))).subscribe());
|
|
691
|
+
}
|
|
692
|
+
toDisplay(value) {
|
|
693
|
+
return value;
|
|
694
|
+
}
|
|
695
|
+
ngOnDestroy() {
|
|
696
|
+
this.stateChanges.complete();
|
|
697
|
+
this._subscription?.unsubscribe();
|
|
698
|
+
}
|
|
699
|
+
setDescribedByIds(ids) {}
|
|
700
|
+
onContainerClick(event) {}
|
|
701
|
+
static {
|
|
702
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
703
|
+
minVersion: "12.0.0",
|
|
704
|
+
version: "22.3.0",
|
|
705
|
+
ngImport: i0,
|
|
706
|
+
type: TableSelectInputComponent,
|
|
707
|
+
deps: [],
|
|
708
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
static {
|
|
712
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
713
|
+
minVersion: "17.0.0",
|
|
714
|
+
version: "22.3.0",
|
|
715
|
+
type: TableSelectInputComponent,
|
|
716
|
+
isStandalone: true,
|
|
717
|
+
selector: "rxap-table-select-input",
|
|
718
|
+
inputs: {
|
|
719
|
+
requiredInput: {
|
|
720
|
+
classPropertyName: "requiredInput",
|
|
721
|
+
publicName: "required",
|
|
722
|
+
isSignal: true,
|
|
723
|
+
isRequired: false,
|
|
724
|
+
transformFunction: null
|
|
725
|
+
},
|
|
726
|
+
disabledInput: {
|
|
727
|
+
classPropertyName: "disabledInput",
|
|
728
|
+
publicName: "disabled",
|
|
729
|
+
isSignal: true,
|
|
730
|
+
isRequired: false,
|
|
731
|
+
transformFunction: null
|
|
732
|
+
},
|
|
733
|
+
placeholderInput: {
|
|
734
|
+
classPropertyName: "placeholderInput",
|
|
735
|
+
publicName: "placeholder",
|
|
736
|
+
isSignal: true,
|
|
737
|
+
isRequired: false,
|
|
738
|
+
transformFunction: null
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
host: { properties: {
|
|
742
|
+
"id": "id",
|
|
743
|
+
"class.floating": "shouldLabelFloat"
|
|
744
|
+
} },
|
|
745
|
+
providers: [{
|
|
746
|
+
provide: MatFormFieldControl,
|
|
747
|
+
useExisting: forwardRef(() => TableSelectInputComponent)
|
|
748
|
+
}],
|
|
749
|
+
usesInheritance: true,
|
|
750
|
+
ngImport: i0,
|
|
751
|
+
template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n @if (display || placeholder) {\n <span>{{display ?? placeholder}}</span>\n }\n</div>\n",
|
|
752
|
+
styles: [":host{display:inline-block;width:100%;outline:none}.rxap-container{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%;height:24px}.disabled{color:#ffffff80;cursor:initial}.mat-select-trigger{overflow:hidden}.mat-select-trigger span{white-space:nowrap}\n"],
|
|
753
|
+
dependencies: [{
|
|
754
|
+
kind: "directive",
|
|
755
|
+
type: NgClass,
|
|
756
|
+
selector: "[ngClass]",
|
|
757
|
+
inputs: ["class", "ngClass"]
|
|
758
|
+
}],
|
|
759
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
764
|
+
minVersion: "12.0.0",
|
|
765
|
+
version: "22.3.0",
|
|
766
|
+
ngImport: i0,
|
|
767
|
+
type: TableSelectInputComponent,
|
|
768
|
+
decorators: [{
|
|
769
|
+
type: Component,
|
|
770
|
+
args: [{
|
|
771
|
+
selector: "rxap-table-select-input",
|
|
772
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
773
|
+
providers: [{
|
|
774
|
+
provide: MatFormFieldControl,
|
|
775
|
+
useExisting: forwardRef(() => TableSelectInputComponent)
|
|
776
|
+
}],
|
|
777
|
+
host: {
|
|
778
|
+
"[id]": "id",
|
|
779
|
+
"[class.floating]": "shouldLabelFloat"
|
|
780
|
+
},
|
|
781
|
+
imports: [NgClass],
|
|
782
|
+
template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n @if (display || placeholder) {\n <span>{{display ?? placeholder}}</span>\n }\n</div>\n",
|
|
783
|
+
styles: [":host{display:inline-block;width:100%;outline:none}.rxap-container{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%;height:24px}.disabled{color:#ffffff80;cursor:initial}.mat-select-trigger{overflow:hidden}.mat-select-trigger span{white-space:nowrap}\n"]
|
|
784
|
+
}]
|
|
785
|
+
}],
|
|
786
|
+
ctorParameters: () => [],
|
|
787
|
+
propDecorators: {
|
|
788
|
+
requiredInput: [{
|
|
789
|
+
type: i0.Input,
|
|
790
|
+
args: [{
|
|
791
|
+
isSignal: true,
|
|
792
|
+
alias: "required",
|
|
793
|
+
required: false
|
|
794
|
+
}]
|
|
795
|
+
}],
|
|
796
|
+
disabledInput: [{
|
|
797
|
+
type: i0.Input,
|
|
798
|
+
args: [{
|
|
799
|
+
isSignal: true,
|
|
800
|
+
alias: "disabled",
|
|
801
|
+
required: false
|
|
802
|
+
}]
|
|
803
|
+
}],
|
|
804
|
+
placeholderInput: [{
|
|
805
|
+
type: i0.Input,
|
|
806
|
+
args: [{
|
|
807
|
+
isSignal: true,
|
|
808
|
+
alias: "placeholder",
|
|
809
|
+
required: false
|
|
810
|
+
}]
|
|
811
|
+
}]
|
|
812
|
+
}
|
|
813
|
+
});
|
|
333
814
|
function CreateFilterFormProvider(columns) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
return {
|
|
348
|
-
provide: RXAP_TABLE_FILTER_FORM_DEFINITION,
|
|
349
|
-
useValue: form,
|
|
350
|
-
};
|
|
815
|
+
const columnNameList = Array.from(columns.entries()).filter(([key, column]) => column.filter).map(([key, column]) => key);
|
|
816
|
+
const controls = {};
|
|
817
|
+
for (const column of columnNameList) controls[column] = new RxapFormControl(null, { controlId: column });
|
|
818
|
+
const form = {
|
|
819
|
+
...controls,
|
|
820
|
+
rxapFormGroup: new RxapFormGroup(controls, { controlId: "filter" }),
|
|
821
|
+
rxapMetadata: { controlId: "filter" }
|
|
822
|
+
};
|
|
823
|
+
Reflect.set(form.rxapFormGroup, "_rxapFormDefinition", form);
|
|
824
|
+
return {
|
|
825
|
+
provide: RXAP_TABLE_FILTER_FORM_DEFINITION,
|
|
826
|
+
useValue: form
|
|
827
|
+
};
|
|
351
828
|
}
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const TABLE_SELECT_DATA_SOURCE = 'TABLE_SELECT_DATA_SOURCE';
|
|
829
|
+
const TABLE_SELECT_COLUMN_MAP = "TABLE_SELECT_COLUMN_MAP";
|
|
830
|
+
const TABLE_SELECT_TO_DISPLAY = "TABLE_SELECT_TO_DISPLAY";
|
|
831
|
+
const TABLE_SELECT_TO_VALUE = "TABLE_SELECT_TO_VALUE";
|
|
832
|
+
const TABLE_SELECT_METHOD = "TABLE_SELECT_METHOD";
|
|
833
|
+
const TABLE_SELECT_DATA_SOURCE = "TABLE_SELECT_DATA_SOURCE";
|
|
358
834
|
function UseTableSelectColumns(columnMap) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
835
|
+
return function(target, propertyKey) {
|
|
836
|
+
setMetadataMap(propertyKey, columnMap, TABLE_SELECT_COLUMN_MAP, target);
|
|
837
|
+
};
|
|
362
838
|
}
|
|
363
839
|
function UseTableSelectDataSource(dataSource, settings) {
|
|
364
|
-
|
|
840
|
+
return UseDataSource(dataSource, TABLE_SELECT_DATA_SOURCE, settings);
|
|
365
841
|
}
|
|
366
842
|
function UseTableSelectToDisplay(toDisplay) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
843
|
+
return function(target, propertyKey) {
|
|
844
|
+
setMetadataMap(propertyKey, toDisplay, TABLE_SELECT_TO_DISPLAY, target);
|
|
845
|
+
};
|
|
370
846
|
}
|
|
371
847
|
function UseTableSelectToValue(toValue) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
848
|
+
return function(target, propertyKey) {
|
|
849
|
+
setMetadataMap(propertyKey, toValue, TABLE_SELECT_TO_VALUE, target);
|
|
850
|
+
};
|
|
375
851
|
}
|
|
376
852
|
function UseTableSelectMethod(method) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
853
|
+
return function(target, propertyKey) {
|
|
854
|
+
setMetadataMap(propertyKey, method, TABLE_SELECT_METHOD, target);
|
|
855
|
+
};
|
|
380
856
|
}
|
|
381
|
-
|
|
382
857
|
let ExtractTableSelectColumnMapMixin = class ExtractTableSelectColumnMapMixin {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
390
|
-
}
|
|
391
|
-
return map.get(control.controlId);
|
|
392
|
-
}
|
|
858
|
+
extractTableSelectColumnMap(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
859
|
+
const map = getMetadata(TABLE_SELECT_COLUMN_MAP, Object.getPrototypeOf(formDefinition));
|
|
860
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use data source map from the form definition instance", "");
|
|
861
|
+
if (!map.has(control.controlId)) throw new RxapFormSystemError("A use data source definition does not exists in the form definition metadata", "");
|
|
862
|
+
return map.get(control.controlId);
|
|
863
|
+
}
|
|
393
864
|
};
|
|
394
|
-
ExtractTableSelectColumnMapMixin = __decorate([
|
|
395
|
-
Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)
|
|
396
|
-
], ExtractTableSelectColumnMapMixin);
|
|
397
|
-
|
|
865
|
+
ExtractTableSelectColumnMapMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)], ExtractTableSelectColumnMapMixin);
|
|
398
866
|
let ExtractTableSelectDataSourceMixin = class ExtractTableSelectDataSourceMixin {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
867
|
+
extractTableSelectDataSource() {
|
|
868
|
+
return this.extractDatasource(TABLE_SELECT_DATA_SOURCE);
|
|
869
|
+
}
|
|
402
870
|
};
|
|
403
|
-
ExtractTableSelectDataSourceMixin = __decorate([
|
|
404
|
-
Mixin(ExtractDatasourceMixin)
|
|
405
|
-
], ExtractTableSelectDataSourceMixin);
|
|
406
|
-
|
|
871
|
+
ExtractTableSelectDataSourceMixin = __decorate([Mixin(ExtractDatasourceMixin)], ExtractTableSelectDataSourceMixin);
|
|
407
872
|
let ExtractTableSelectToDisplayMixin = class ExtractTableSelectToDisplayMixin {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
415
|
-
}
|
|
416
|
-
return map.get(control.controlId);
|
|
417
|
-
}
|
|
873
|
+
extractTableSelectToDisplay(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
874
|
+
const map = getMetadata(TABLE_SELECT_TO_DISPLAY, Object.getPrototypeOf(formDefinition));
|
|
875
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use data source map from the form definition instance", "");
|
|
876
|
+
if (!map.has(control.controlId)) throw new RxapFormSystemError("A use data source definition does not exists in the form definition metadata", "");
|
|
877
|
+
return map.get(control.controlId);
|
|
878
|
+
}
|
|
418
879
|
};
|
|
419
|
-
ExtractTableSelectToDisplayMixin = __decorate([
|
|
420
|
-
Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)
|
|
421
|
-
], ExtractTableSelectToDisplayMixin);
|
|
422
|
-
|
|
880
|
+
ExtractTableSelectToDisplayMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)], ExtractTableSelectToDisplayMixin);
|
|
423
881
|
let ExtractTableSelectToValueMixin = class ExtractTableSelectToValueMixin {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
431
|
-
}
|
|
432
|
-
return map.get(control.controlId);
|
|
433
|
-
}
|
|
882
|
+
extractTableSelectToValue(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
883
|
+
const map = getMetadata(TABLE_SELECT_TO_VALUE, Object.getPrototypeOf(formDefinition));
|
|
884
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use data source map from the form definition instance", "");
|
|
885
|
+
if (!map.has(control.controlId)) throw new RxapFormSystemError("A use data source definition does not exists in the form definition metadata", "");
|
|
886
|
+
return map.get(control.controlId);
|
|
887
|
+
}
|
|
434
888
|
};
|
|
435
|
-
ExtractTableSelectToValueMixin = __decorate([
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
889
|
+
ExtractTableSelectToValueMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)], ExtractTableSelectToValueMixin);
|
|
890
|
+
var OpenTableSelectWindowMethod = class OpenTableSelectWindowMethod {
|
|
891
|
+
constructor() {
|
|
892
|
+
this.windowService = inject(WindowService);
|
|
893
|
+
this.injector = inject(INJECTOR);
|
|
894
|
+
}
|
|
895
|
+
async call(parameters) {
|
|
896
|
+
const providers = [{
|
|
897
|
+
provide: RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS,
|
|
898
|
+
useValue: {
|
|
899
|
+
multiple: parameters.multiple ?? false,
|
|
900
|
+
selected: parameters.selected ?? [],
|
|
901
|
+
compareWith: parameters.compareWith
|
|
902
|
+
}
|
|
903
|
+
}];
|
|
904
|
+
if (Array.isArray(parameters.data)) providers.push({
|
|
905
|
+
provide: TABLE_DATA_SOURCE,
|
|
906
|
+
useValue: new TableDataSource(staticDataSource(parameters.data))
|
|
907
|
+
});
|
|
908
|
+
else if (parameters.data instanceof AbstractTableDataSource) providers.push({
|
|
909
|
+
provide: TABLE_DATA_SOURCE,
|
|
910
|
+
useValue: parameters.data
|
|
911
|
+
});
|
|
912
|
+
else providers.push({
|
|
913
|
+
provide: TABLE_DATA_SOURCE,
|
|
914
|
+
useValue: new TableDataSource(parameters.data)
|
|
915
|
+
});
|
|
916
|
+
providers.push({
|
|
917
|
+
provide: RXAP_TABLE_METHOD,
|
|
918
|
+
useValue: null
|
|
919
|
+
});
|
|
920
|
+
providers.push({
|
|
921
|
+
provide: TABLE_REMOTE_METHOD_ADAPTER_FACTORY,
|
|
922
|
+
useValue: null
|
|
923
|
+
});
|
|
924
|
+
providers.push({
|
|
925
|
+
provide: RXAP_TABLE_FILTER,
|
|
926
|
+
useValue: null
|
|
927
|
+
});
|
|
928
|
+
providers.push({
|
|
929
|
+
provide: RXAP_WINDOW_SETTINGS,
|
|
930
|
+
useValue: null
|
|
931
|
+
});
|
|
932
|
+
providers.push(this.createFilterForm(parameters.columns));
|
|
933
|
+
const windowRef = this.windowService.open({
|
|
934
|
+
...parameters.windowConfig,
|
|
935
|
+
viewContainerRef: parameters.viewContainerRef,
|
|
936
|
+
injector: Injector.create({
|
|
937
|
+
parent: parameters.injector ?? this.injector,
|
|
938
|
+
providers
|
|
939
|
+
}),
|
|
940
|
+
title: parameters.title ?? $localize`Select`,
|
|
941
|
+
data: parameters,
|
|
942
|
+
component: TableSelectWindowComponent
|
|
943
|
+
});
|
|
944
|
+
return new Promise((resolve, reject) => {
|
|
945
|
+
windowRef.subscribe({
|
|
946
|
+
next: (data) => resolve(data ?? []),
|
|
947
|
+
error: (error) => reject(error),
|
|
948
|
+
complete: () => resolve([])
|
|
949
|
+
});
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
createFilterForm(columns) {
|
|
953
|
+
return CreateFilterFormProvider(columns);
|
|
954
|
+
}
|
|
955
|
+
static {
|
|
956
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
957
|
+
minVersion: "12.0.0",
|
|
958
|
+
version: "22.3.0",
|
|
959
|
+
ngImport: i0,
|
|
960
|
+
type: OpenTableSelectWindowMethod,
|
|
961
|
+
deps: [],
|
|
962
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
static {
|
|
966
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
967
|
+
minVersion: "12.0.0",
|
|
968
|
+
version: "22.3.0",
|
|
969
|
+
ngImport: i0,
|
|
970
|
+
type: OpenTableSelectWindowMethod
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
975
|
+
minVersion: "12.0.0",
|
|
976
|
+
version: "22.3.0",
|
|
977
|
+
ngImport: i0,
|
|
978
|
+
type: OpenTableSelectWindowMethod,
|
|
979
|
+
decorators: [{ type: Injectable }]
|
|
980
|
+
});
|
|
519
981
|
let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
982
|
+
constructor() {
|
|
983
|
+
this.dataInput = input(void 0, {
|
|
984
|
+
...ngDevMode ? { debugName: "dataInput" } : /* istanbul ignore next */ {},
|
|
985
|
+
alias: "data"
|
|
986
|
+
});
|
|
987
|
+
this.data = linkedSignal(() => this.dataInput(), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
988
|
+
this.columnsInput = input(void 0, {
|
|
989
|
+
...ngDevMode ? { debugName: "columnsInput" } : /* istanbul ignore next */ {},
|
|
990
|
+
alias: "columns"
|
|
991
|
+
});
|
|
992
|
+
this.columns = linkedSignal(() => this.columnsInput(), ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
993
|
+
this.selectedInput = input([], {
|
|
994
|
+
...ngDevMode ? { debugName: "selectedInput" } : /* istanbul ignore next */ {},
|
|
995
|
+
alias: "selected"
|
|
996
|
+
});
|
|
997
|
+
this.selected = linkedSignal(() => this.selectedInput(), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
998
|
+
this.parameters = input(...ngDevMode ? [void 0, { debugName: "parameters" }] : /* istanbul ignore next */ []);
|
|
999
|
+
this.selectedChange = output();
|
|
1000
|
+
this.labelInput = input(void 0, {
|
|
1001
|
+
...ngDevMode ? { debugName: "labelInput" } : /* istanbul ignore next */ {},
|
|
1002
|
+
alias: "label"
|
|
1003
|
+
});
|
|
1004
|
+
this.label = linkedSignal(() => this.labelInput(), ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
1005
|
+
this.id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
|
|
1006
|
+
this._internalId = GenerateRandomString();
|
|
1007
|
+
this.compareWithInput = input(void 0, {
|
|
1008
|
+
...ngDevMode ? { debugName: "compareWithInput" } : /* istanbul ignore next */ {},
|
|
1009
|
+
alias: "compareWith"
|
|
1010
|
+
});
|
|
1011
|
+
this.compareWith = linkedSignal(() => this.compareWithInput(), ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
|
|
1012
|
+
this.multiple = input(false, ...ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []);
|
|
1013
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1014
|
+
this._hasOpenWindow = false;
|
|
1015
|
+
this.openMethod = inject(OpenTableSelectWindowMethod);
|
|
1016
|
+
this.windowService = inject(WindowService);
|
|
1017
|
+
this.injector = inject(INJECTOR);
|
|
1018
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
1019
|
+
this._disabled = signal(false, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
|
|
1020
|
+
this.invalidInputs = computed(() => !this.columns() || !this.data(), ...ngDevMode ? [{ debugName: "invalidInputs" }] : /* istanbul ignore next */ []);
|
|
1021
|
+
this.disabled = computed(() => this._disabled() || this.invalidInputs(), ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
1022
|
+
this.toValueInput = input(void 0, {
|
|
1023
|
+
...ngDevMode ? { debugName: "toValueInput" } : /* istanbul ignore next */ {},
|
|
1024
|
+
alias: "toValue"
|
|
1025
|
+
});
|
|
1026
|
+
this.toValue = linkedSignal(() => this.toValueInput(), ...ngDevMode ? [{ debugName: "toValue" }] : /* istanbul ignore next */ []);
|
|
1027
|
+
effect(() => {
|
|
1028
|
+
const data = this.data();
|
|
1029
|
+
const columns = this.columns();
|
|
1030
|
+
const disabled = this.disabled();
|
|
1031
|
+
untracked(() => this.checkInputs(data, columns, disabled));
|
|
1032
|
+
});
|
|
1033
|
+
afterNextRender(() => this.initFromFormField());
|
|
1034
|
+
}
|
|
1035
|
+
setDisabled(value) {
|
|
1036
|
+
this._disabled.set(value);
|
|
1037
|
+
}
|
|
1038
|
+
ngOnDestroy() {
|
|
1039
|
+
if (this.windowService.has(this._internalId)) this.windowService.close(this._internalId);
|
|
1040
|
+
}
|
|
1041
|
+
async onClick($event) {
|
|
1042
|
+
$event.stopPropagation();
|
|
1043
|
+
if (this.disabled() || this._hasOpenWindow) {
|
|
1044
|
+
console.debug("disabled or has open window", {
|
|
1045
|
+
disabled: this.disabled(),
|
|
1046
|
+
hasOpenWindow: this._hasOpenWindow
|
|
1047
|
+
});
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
const data = this.data();
|
|
1051
|
+
const columns = this.columns();
|
|
1052
|
+
if (!data || !columns) throw new Error("FATAL: The data or columns input is not set");
|
|
1053
|
+
this._hasOpenWindow = true;
|
|
1054
|
+
this.control?.disable();
|
|
1055
|
+
let selected;
|
|
1056
|
+
try {
|
|
1057
|
+
selected = await this.openMethod.call({
|
|
1058
|
+
windowConfig: { id: this._internalId },
|
|
1059
|
+
injector: this.injector,
|
|
1060
|
+
data,
|
|
1061
|
+
columns: columns instanceof Map ? columns : new Map(Object.entries(columns)),
|
|
1062
|
+
selected: this.selected()?.slice() ?? [],
|
|
1063
|
+
title: this.label() ?? "Select value",
|
|
1064
|
+
compareWith: this.compareWith(),
|
|
1065
|
+
id: this.id() ?? GenerateRandomString(10),
|
|
1066
|
+
parameters: this.parameters(),
|
|
1067
|
+
multiple: this.multiple()
|
|
1068
|
+
});
|
|
1069
|
+
} finally {
|
|
1070
|
+
this._hasOpenWindow = false;
|
|
1071
|
+
this.control?.enable();
|
|
1072
|
+
}
|
|
1073
|
+
if (isDevMode()) console.debug("selected", selected);
|
|
1074
|
+
this.selected.set(selected ?? []);
|
|
1075
|
+
const selectedValue = this.selected();
|
|
1076
|
+
this.selectedChange.emit(selectedValue);
|
|
1077
|
+
if (selectedValue.length) {
|
|
1078
|
+
const toValue = this.toValue();
|
|
1079
|
+
if (toValue) this.control?.setValue(toValue(selectedValue[0]));
|
|
1080
|
+
else throw new Error("The toValue method is not defined");
|
|
1081
|
+
} else this.control?.reset();
|
|
1082
|
+
}
|
|
1083
|
+
initFromFormField() {
|
|
1084
|
+
const hasNgControl = !!this.injector.get(NgControl, null);
|
|
1085
|
+
if (!!this.injector.get(MatFormField, null) || hasNgControl) {
|
|
1086
|
+
this.matFormField = this.injector.get(MatFormField);
|
|
1087
|
+
this.ngControl = this.matFormField._control.ngControl;
|
|
1088
|
+
this.control ??= this.ngControl?.control ?? null;
|
|
1089
|
+
if (!this.data()) this.data.set(this.extractTableSelectDataSource());
|
|
1090
|
+
if (!this.columns()) this.columns.set(this.extractTableSelectColumnMap());
|
|
1091
|
+
if (!this.toValue()) this.toValue.set(this.extractTableSelectToValue() ?? ((value) => value));
|
|
1092
|
+
if (this.control) {
|
|
1093
|
+
this.setDisabled(this.control.disabled);
|
|
1094
|
+
this.control.registerOnDisabledChange((isDisabled) => {
|
|
1095
|
+
this.setDisabled(isDisabled);
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
checkInputs(data, columns, disabled) {
|
|
1101
|
+
if (!columns || !data) console.warn("columns or data is not defined");
|
|
1102
|
+
else {
|
|
1103
|
+
if (typeof columns !== "object") throw new Error("Ensure that the input columns has a valid value");
|
|
1104
|
+
if (!Array.isArray(data) && !(data instanceof BaseDataSource)) throw new Error("Ensure that the input data has a valid value");
|
|
1105
|
+
}
|
|
1106
|
+
if (this.matButton) this.matButton.disabled = disabled;
|
|
1107
|
+
}
|
|
1108
|
+
static {
|
|
1109
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1110
|
+
minVersion: "12.0.0",
|
|
1111
|
+
version: "22.3.0",
|
|
1112
|
+
ngImport: i0,
|
|
1113
|
+
type: OpenTableSelectWindowDirective,
|
|
1114
|
+
deps: [],
|
|
1115
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
static {
|
|
1119
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1120
|
+
minVersion: "17.1.0",
|
|
1121
|
+
version: "22.3.0",
|
|
1122
|
+
type: OpenTableSelectWindowDirective,
|
|
1123
|
+
isStandalone: true,
|
|
1124
|
+
selector: "[rxapOpenTableSelectWindow]",
|
|
1125
|
+
inputs: {
|
|
1126
|
+
dataInput: {
|
|
1127
|
+
classPropertyName: "dataInput",
|
|
1128
|
+
publicName: "data",
|
|
1129
|
+
isSignal: true,
|
|
1130
|
+
isRequired: false,
|
|
1131
|
+
transformFunction: null
|
|
1132
|
+
},
|
|
1133
|
+
columnsInput: {
|
|
1134
|
+
classPropertyName: "columnsInput",
|
|
1135
|
+
publicName: "columns",
|
|
1136
|
+
isSignal: true,
|
|
1137
|
+
isRequired: false,
|
|
1138
|
+
transformFunction: null
|
|
1139
|
+
},
|
|
1140
|
+
selectedInput: {
|
|
1141
|
+
classPropertyName: "selectedInput",
|
|
1142
|
+
publicName: "selected",
|
|
1143
|
+
isSignal: true,
|
|
1144
|
+
isRequired: false,
|
|
1145
|
+
transformFunction: null
|
|
1146
|
+
},
|
|
1147
|
+
parameters: {
|
|
1148
|
+
classPropertyName: "parameters",
|
|
1149
|
+
publicName: "parameters",
|
|
1150
|
+
isSignal: true,
|
|
1151
|
+
isRequired: false,
|
|
1152
|
+
transformFunction: null
|
|
1153
|
+
},
|
|
1154
|
+
labelInput: {
|
|
1155
|
+
classPropertyName: "labelInput",
|
|
1156
|
+
publicName: "label",
|
|
1157
|
+
isSignal: true,
|
|
1158
|
+
isRequired: false,
|
|
1159
|
+
transformFunction: null
|
|
1160
|
+
},
|
|
1161
|
+
id: {
|
|
1162
|
+
classPropertyName: "id",
|
|
1163
|
+
publicName: "id",
|
|
1164
|
+
isSignal: true,
|
|
1165
|
+
isRequired: false,
|
|
1166
|
+
transformFunction: null
|
|
1167
|
+
},
|
|
1168
|
+
compareWithInput: {
|
|
1169
|
+
classPropertyName: "compareWithInput",
|
|
1170
|
+
publicName: "compareWith",
|
|
1171
|
+
isSignal: true,
|
|
1172
|
+
isRequired: false,
|
|
1173
|
+
transformFunction: null
|
|
1174
|
+
},
|
|
1175
|
+
multiple: {
|
|
1176
|
+
classPropertyName: "multiple",
|
|
1177
|
+
publicName: "multiple",
|
|
1178
|
+
isSignal: true,
|
|
1179
|
+
isRequired: false,
|
|
1180
|
+
transformFunction: null
|
|
1181
|
+
},
|
|
1182
|
+
toValueInput: {
|
|
1183
|
+
classPropertyName: "toValueInput",
|
|
1184
|
+
publicName: "toValue",
|
|
1185
|
+
isSignal: true,
|
|
1186
|
+
isRequired: false,
|
|
1187
|
+
transformFunction: null
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
outputs: { selectedChange: "selectedChange" },
|
|
1191
|
+
host: {
|
|
1192
|
+
attributes: { "type": "button" },
|
|
1193
|
+
listeners: { "click": "onClick($event)" },
|
|
1194
|
+
properties: { "disabled": "disabled()" }
|
|
1195
|
+
},
|
|
1196
|
+
providers: [OpenTableSelectWindowMethod],
|
|
1197
|
+
ngImport: i0
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
659
1200
|
};
|
|
660
|
-
OpenTableSelectWindowDirective = __decorate([
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
1201
|
+
OpenTableSelectWindowDirective = __decorate([Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectColumnMapMixin, ExtractTableSelectToValueMixin), __metadata("design:paramtypes", [])], OpenTableSelectWindowDirective);
|
|
1202
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1203
|
+
minVersion: "12.0.0",
|
|
1204
|
+
version: "22.3.0",
|
|
1205
|
+
ngImport: i0,
|
|
1206
|
+
type: OpenTableSelectWindowDirective,
|
|
1207
|
+
decorators: [{
|
|
1208
|
+
type: Directive,
|
|
1209
|
+
args: [{
|
|
1210
|
+
selector: "[rxapOpenTableSelectWindow]",
|
|
1211
|
+
standalone: true,
|
|
1212
|
+
providers: [OpenTableSelectWindowMethod],
|
|
1213
|
+
host: {
|
|
1214
|
+
type: "button",
|
|
1215
|
+
"[disabled]": "disabled()",
|
|
1216
|
+
"(click)": "onClick($event)"
|
|
1217
|
+
}
|
|
1218
|
+
}]
|
|
1219
|
+
}],
|
|
1220
|
+
ctorParameters: () => [],
|
|
1221
|
+
propDecorators: {
|
|
1222
|
+
dataInput: [{
|
|
1223
|
+
type: i0.Input,
|
|
1224
|
+
args: [{
|
|
1225
|
+
isSignal: true,
|
|
1226
|
+
alias: "data",
|
|
1227
|
+
required: false
|
|
1228
|
+
}]
|
|
1229
|
+
}],
|
|
1230
|
+
columnsInput: [{
|
|
1231
|
+
type: i0.Input,
|
|
1232
|
+
args: [{
|
|
1233
|
+
isSignal: true,
|
|
1234
|
+
alias: "columns",
|
|
1235
|
+
required: false
|
|
1236
|
+
}]
|
|
1237
|
+
}],
|
|
1238
|
+
selectedInput: [{
|
|
1239
|
+
type: i0.Input,
|
|
1240
|
+
args: [{
|
|
1241
|
+
isSignal: true,
|
|
1242
|
+
alias: "selected",
|
|
1243
|
+
required: false
|
|
1244
|
+
}]
|
|
1245
|
+
}],
|
|
1246
|
+
parameters: [{
|
|
1247
|
+
type: i0.Input,
|
|
1248
|
+
args: [{
|
|
1249
|
+
isSignal: true,
|
|
1250
|
+
alias: "parameters",
|
|
1251
|
+
required: false
|
|
1252
|
+
}]
|
|
1253
|
+
}],
|
|
1254
|
+
selectedChange: [{
|
|
1255
|
+
type: i0.Output,
|
|
1256
|
+
args: ["selectedChange"]
|
|
1257
|
+
}],
|
|
1258
|
+
labelInput: [{
|
|
1259
|
+
type: i0.Input,
|
|
1260
|
+
args: [{
|
|
1261
|
+
isSignal: true,
|
|
1262
|
+
alias: "label",
|
|
1263
|
+
required: false
|
|
1264
|
+
}]
|
|
1265
|
+
}],
|
|
1266
|
+
id: [{
|
|
1267
|
+
type: i0.Input,
|
|
1268
|
+
args: [{
|
|
1269
|
+
isSignal: true,
|
|
1270
|
+
alias: "id",
|
|
1271
|
+
required: false
|
|
1272
|
+
}]
|
|
1273
|
+
}],
|
|
1274
|
+
compareWithInput: [{
|
|
1275
|
+
type: i0.Input,
|
|
1276
|
+
args: [{
|
|
1277
|
+
isSignal: true,
|
|
1278
|
+
alias: "compareWith",
|
|
1279
|
+
required: false
|
|
1280
|
+
}]
|
|
1281
|
+
}],
|
|
1282
|
+
multiple: [{
|
|
1283
|
+
type: i0.Input,
|
|
1284
|
+
args: [{
|
|
1285
|
+
isSignal: true,
|
|
1286
|
+
alias: "multiple",
|
|
1287
|
+
required: false
|
|
1288
|
+
}]
|
|
1289
|
+
}],
|
|
1290
|
+
toValueInput: [{
|
|
1291
|
+
type: i0.Input,
|
|
1292
|
+
args: [{
|
|
1293
|
+
isSignal: true,
|
|
1294
|
+
alias: "toValue",
|
|
1295
|
+
required: false
|
|
1296
|
+
}]
|
|
1297
|
+
}]
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
678
1300
|
let TableSelectControlDirective = class TableSelectControlDirective {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1301
|
+
get selected() {
|
|
1302
|
+
return this.value !== null ? [this.value] : [];
|
|
1303
|
+
}
|
|
1304
|
+
constructor() {
|
|
1305
|
+
this.multiple = input(...ngDevMode ? [void 0, { debugName: "multiple" }] : /* istanbul ignore next */ []);
|
|
1306
|
+
this.openMethod = input.required(...ngDevMode ? [{ debugName: "openMethod" }] : /* istanbul ignore next */ []);
|
|
1307
|
+
this.dataInput = input(void 0, {
|
|
1308
|
+
...ngDevMode ? { debugName: "dataInput" } : /* istanbul ignore next */ {},
|
|
1309
|
+
alias: "data"
|
|
1310
|
+
});
|
|
1311
|
+
this.data = linkedSignal(() => this.dataInput(), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1312
|
+
this.columnsInput = input(void 0, {
|
|
1313
|
+
...ngDevMode ? { debugName: "columnsInput" } : /* istanbul ignore next */ {},
|
|
1314
|
+
alias: "columns"
|
|
1315
|
+
});
|
|
1316
|
+
this.columns = linkedSignal(() => this.columnsInput(), ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
1317
|
+
this.ngControl = null;
|
|
1318
|
+
this.value = null;
|
|
1319
|
+
this.openTableSelectWindow = contentChildren(OpenTableSelectWindowDirective, ...ngDevMode ? [{ debugName: "openTableSelectWindow" }] : /* istanbul ignore next */ []);
|
|
1320
|
+
this.tableSelectInput = contentChild.required(TableSelectInputComponent, ...ngDevMode ? [{ debugName: "tableSelectInput" }] : /* istanbul ignore next */ []);
|
|
1321
|
+
this.matLabel = contentChild("mat-label", ...ngDevMode ? [{ debugName: "matLabel" }] : /* istanbul ignore next */ []);
|
|
1322
|
+
this.toValueInput = input(void 0, {
|
|
1323
|
+
...ngDevMode ? { debugName: "toValueInput" } : /* istanbul ignore next */ {},
|
|
1324
|
+
alias: "toValue"
|
|
1325
|
+
});
|
|
1326
|
+
this.toValue = linkedSignal(() => this.toValueInput(), ...ngDevMode ? [{ debugName: "toValue" }] : /* istanbul ignore next */ []);
|
|
1327
|
+
this.injector = inject(INJECTOR);
|
|
1328
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1329
|
+
this.disabled = signal(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
1330
|
+
this.matFormField = null;
|
|
1331
|
+
this.toDisplayInput = input((value) => value, {
|
|
1332
|
+
...ngDevMode ? { debugName: "toDisplayInput" } : /* istanbul ignore next */ {},
|
|
1333
|
+
alias: "toDisplay"
|
|
1334
|
+
});
|
|
1335
|
+
this.toDisplay = linkedSignal(() => this.toDisplayInput(), ...ngDevMode ? [{ debugName: "toDisplay" }] : /* istanbul ignore next */ []);
|
|
1336
|
+
this.destroyRef = inject(DestroyRef);
|
|
1337
|
+
effect(() => {
|
|
1338
|
+
const windows = this.openTableSelectWindow();
|
|
1339
|
+
const columns = this.columns();
|
|
1340
|
+
const data = this.data();
|
|
1341
|
+
const toValue = this.toValue();
|
|
1342
|
+
const matLabel = this.matLabel();
|
|
1343
|
+
untracked(() => this.updateOpenTableSelectWindow(windows, columns, data, toValue, matLabel));
|
|
1344
|
+
});
|
|
1345
|
+
effect(() => {
|
|
1346
|
+
const windows = this.openTableSelectWindow();
|
|
1347
|
+
const disabled = this.disabled();
|
|
1348
|
+
untracked(() => windows.forEach((openTableSelectWindow) => openTableSelectWindow.setDisabled(disabled)));
|
|
1349
|
+
});
|
|
1350
|
+
effect((onCleanup) => {
|
|
1351
|
+
const subscriptions = this.openTableSelectWindow().map((openTableSelectWindow) => openTableSelectWindow.selectedChange.subscribe(($event) => this.onSelected($event)));
|
|
1352
|
+
onCleanup(() => subscriptions.forEach((subscription) => subscription.unsubscribe()));
|
|
1353
|
+
});
|
|
1354
|
+
effect(() => {
|
|
1355
|
+
const toDisplay = this.toDisplay();
|
|
1356
|
+
const tableSelectInput = this.tableSelectInput();
|
|
1357
|
+
untracked(() => {
|
|
1358
|
+
if (toDisplay) tableSelectInput.toDisplay = toDisplay.bind(this);
|
|
1359
|
+
});
|
|
1360
|
+
});
|
|
1361
|
+
afterNextRender(() => this.initFromFormField());
|
|
1362
|
+
}
|
|
1363
|
+
initFromFormField() {
|
|
1364
|
+
this.matFormField = this.injector.get(MatFormField, null);
|
|
1365
|
+
if (!this.matFormField) throw new Error("The mat form field could not be injected");
|
|
1366
|
+
this.ngControl = this.matFormField._control.ngControl;
|
|
1367
|
+
if (this.ngControl) {
|
|
1368
|
+
const control = this.ngControl.control;
|
|
1369
|
+
if (control instanceof RxapFormControl) {
|
|
1370
|
+
this.control = control;
|
|
1371
|
+
this.data.set(this.extractTableSelectDataSource());
|
|
1372
|
+
this.toDisplay.set(this.extractTableSelectToDisplay() ?? this.toDisplay());
|
|
1373
|
+
this.toValue.set(this.extractTableSelectToValue() ?? this.toValue());
|
|
1374
|
+
this.columns.set(this.extractTableSelectColumnMap());
|
|
1375
|
+
control.disabled$.pipe(tap((disabled) => this.disabled.set(disabled)), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
1376
|
+
}
|
|
1377
|
+
} else if (isDevMode()) console.log("standalone mode");
|
|
1378
|
+
}
|
|
1379
|
+
updateOpenTableSelectWindow(windows, columns, data, toValue, matLabel) {
|
|
1380
|
+
for (const openTableSelectWindow of windows) {
|
|
1381
|
+
if (columns) openTableSelectWindow.columns.set(columns);
|
|
1382
|
+
if (data) openTableSelectWindow.data.set(data);
|
|
1383
|
+
if (toValue) openTableSelectWindow.compareWith.set((o1, o2) => toValue(o1) === toValue(o2));
|
|
1384
|
+
if (matLabel) openTableSelectWindow.label.set(matLabel.nativeElement.innerText);
|
|
1385
|
+
if (this.ngControl) {
|
|
1386
|
+
const control = this.ngControl.control;
|
|
1387
|
+
if (control?.value) openTableSelectWindow.selected.set(coerceArray(control.value));
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
async onSelected($event) {
|
|
1392
|
+
const tableSelectInput = this.tableSelectInput();
|
|
1393
|
+
if ($event?.length) {
|
|
1394
|
+
tableSelectInput.display = await this.toDisplay()($event[0]);
|
|
1395
|
+
this.value = $event[0];
|
|
1396
|
+
tableSelectInput.setValue(this.value);
|
|
1397
|
+
} else this.value = null;
|
|
1398
|
+
}
|
|
1399
|
+
static {
|
|
1400
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1401
|
+
minVersion: "12.0.0",
|
|
1402
|
+
version: "22.3.0",
|
|
1403
|
+
ngImport: i0,
|
|
1404
|
+
type: TableSelectControlDirective,
|
|
1405
|
+
deps: [],
|
|
1406
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
static {
|
|
1410
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1411
|
+
minVersion: "17.2.0",
|
|
1412
|
+
version: "22.3.0",
|
|
1413
|
+
type: TableSelectControlDirective,
|
|
1414
|
+
isStandalone: true,
|
|
1415
|
+
selector: "mat-form-field[rxapTableSelectControl]",
|
|
1416
|
+
inputs: {
|
|
1417
|
+
multiple: {
|
|
1418
|
+
classPropertyName: "multiple",
|
|
1419
|
+
publicName: "multiple",
|
|
1420
|
+
isSignal: true,
|
|
1421
|
+
isRequired: false,
|
|
1422
|
+
transformFunction: null
|
|
1423
|
+
},
|
|
1424
|
+
openMethod: {
|
|
1425
|
+
classPropertyName: "openMethod",
|
|
1426
|
+
publicName: "openMethod",
|
|
1427
|
+
isSignal: true,
|
|
1428
|
+
isRequired: true,
|
|
1429
|
+
transformFunction: null
|
|
1430
|
+
},
|
|
1431
|
+
dataInput: {
|
|
1432
|
+
classPropertyName: "dataInput",
|
|
1433
|
+
publicName: "data",
|
|
1434
|
+
isSignal: true,
|
|
1435
|
+
isRequired: false,
|
|
1436
|
+
transformFunction: null
|
|
1437
|
+
},
|
|
1438
|
+
columnsInput: {
|
|
1439
|
+
classPropertyName: "columnsInput",
|
|
1440
|
+
publicName: "columns",
|
|
1441
|
+
isSignal: true,
|
|
1442
|
+
isRequired: false,
|
|
1443
|
+
transformFunction: null
|
|
1444
|
+
},
|
|
1445
|
+
toValueInput: {
|
|
1446
|
+
classPropertyName: "toValueInput",
|
|
1447
|
+
publicName: "toValue",
|
|
1448
|
+
isSignal: true,
|
|
1449
|
+
isRequired: false,
|
|
1450
|
+
transformFunction: null
|
|
1451
|
+
},
|
|
1452
|
+
toDisplayInput: {
|
|
1453
|
+
classPropertyName: "toDisplayInput",
|
|
1454
|
+
publicName: "toDisplay",
|
|
1455
|
+
isSignal: true,
|
|
1456
|
+
isRequired: false,
|
|
1457
|
+
transformFunction: null
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
queries: [
|
|
1461
|
+
{
|
|
1462
|
+
propertyName: "openTableSelectWindow",
|
|
1463
|
+
predicate: OpenTableSelectWindowDirective,
|
|
1464
|
+
isSignal: true
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
propertyName: "tableSelectInput",
|
|
1468
|
+
first: true,
|
|
1469
|
+
predicate: TableSelectInputComponent,
|
|
1470
|
+
descendants: true,
|
|
1471
|
+
isSignal: true
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
propertyName: "matLabel",
|
|
1475
|
+
first: true,
|
|
1476
|
+
predicate: ["mat-label"],
|
|
1477
|
+
descendants: true,
|
|
1478
|
+
isSignal: true
|
|
1479
|
+
}
|
|
1480
|
+
],
|
|
1481
|
+
ngImport: i0
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
792
1484
|
};
|
|
793
|
-
TableSelectControlDirective = __decorate([
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1485
|
+
TableSelectControlDirective = __decorate([Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectToValueMixin, ExtractTableSelectToDisplayMixin, ExtractTableSelectColumnMapMixin), __metadata("design:paramtypes", [])], TableSelectControlDirective);
|
|
1486
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1487
|
+
minVersion: "12.0.0",
|
|
1488
|
+
version: "22.3.0",
|
|
1489
|
+
ngImport: i0,
|
|
1490
|
+
type: TableSelectControlDirective,
|
|
1491
|
+
decorators: [{
|
|
1492
|
+
type: Directive,
|
|
1493
|
+
args: [{
|
|
1494
|
+
selector: "mat-form-field[rxapTableSelectControl]",
|
|
1495
|
+
standalone: true
|
|
1496
|
+
}]
|
|
1497
|
+
}],
|
|
1498
|
+
ctorParameters: () => [],
|
|
1499
|
+
propDecorators: {
|
|
1500
|
+
multiple: [{
|
|
1501
|
+
type: i0.Input,
|
|
1502
|
+
args: [{
|
|
1503
|
+
isSignal: true,
|
|
1504
|
+
alias: "multiple",
|
|
1505
|
+
required: false
|
|
1506
|
+
}]
|
|
1507
|
+
}],
|
|
1508
|
+
openMethod: [{
|
|
1509
|
+
type: i0.Input,
|
|
1510
|
+
args: [{
|
|
1511
|
+
isSignal: true,
|
|
1512
|
+
alias: "openMethod",
|
|
1513
|
+
required: true
|
|
1514
|
+
}]
|
|
1515
|
+
}],
|
|
1516
|
+
dataInput: [{
|
|
1517
|
+
type: i0.Input,
|
|
1518
|
+
args: [{
|
|
1519
|
+
isSignal: true,
|
|
1520
|
+
alias: "data",
|
|
1521
|
+
required: false
|
|
1522
|
+
}]
|
|
1523
|
+
}],
|
|
1524
|
+
columnsInput: [{
|
|
1525
|
+
type: i0.Input,
|
|
1526
|
+
args: [{
|
|
1527
|
+
isSignal: true,
|
|
1528
|
+
alias: "columns",
|
|
1529
|
+
required: false
|
|
1530
|
+
}]
|
|
1531
|
+
}],
|
|
1532
|
+
openTableSelectWindow: [{
|
|
1533
|
+
type: i0.ContentChildren,
|
|
1534
|
+
args: [i0.forwardRef(() => OpenTableSelectWindowDirective), { isSignal: true }]
|
|
1535
|
+
}],
|
|
1536
|
+
tableSelectInput: [{
|
|
1537
|
+
type: i0.ContentChild,
|
|
1538
|
+
args: [i0.forwardRef(() => TableSelectInputComponent), { isSignal: true }]
|
|
1539
|
+
}],
|
|
1540
|
+
matLabel: [{
|
|
1541
|
+
type: i0.ContentChild,
|
|
1542
|
+
args: ["mat-label", { isSignal: true }]
|
|
1543
|
+
}],
|
|
1544
|
+
toValueInput: [{
|
|
1545
|
+
type: i0.Input,
|
|
1546
|
+
args: [{
|
|
1547
|
+
isSignal: true,
|
|
1548
|
+
alias: "toValue",
|
|
1549
|
+
required: false
|
|
1550
|
+
}]
|
|
1551
|
+
}],
|
|
1552
|
+
toDisplayInput: [{
|
|
1553
|
+
type: i0.Input,
|
|
1554
|
+
args: [{
|
|
1555
|
+
isSignal: true,
|
|
1556
|
+
alias: "toDisplay",
|
|
1557
|
+
required: false
|
|
1558
|
+
}]
|
|
1559
|
+
}]
|
|
1560
|
+
}
|
|
1561
|
+
});
|
|
812
1562
|
export { CreateFilterFormProvider, ExtractTableSelectColumnMapMixin, ExtractTableSelectDataSourceMixin, ExtractTableSelectToDisplayMixin, ExtractTableSelectToValueMixin, MockWindowRef, OpenTableSelectWindowDirective, OpenTableSelectWindowMethod, TABLE_SELECT_COLUMN_MAP, TABLE_SELECT_DATA_SOURCE, TABLE_SELECT_METHOD, TABLE_SELECT_TO_DISPLAY, TABLE_SELECT_TO_VALUE, TableSelectControlDirective, TableSelectInputComponent, TableSelectWindowComponent, UseTableSelectColumns, UseTableSelectDataSource, UseTableSelectMethod, UseTableSelectToDisplay, UseTableSelectToValue, WindowTestWrapperComponent };
|
|
813
|
-
|
|
1563
|
+
|
|
1564
|
+
//# sourceMappingURL=rxap-ngx-material-table-select.mjs.map
|