@rxap/ngx-material-table-select 19.1.0 → 21.0.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/compodoc/changelog.html +58 -0
- package/compodoc/classes/MockWindowRef.html +16 -20
- package/compodoc/components/TableSelectInputComponent.html +168 -461
- package/compodoc/components/TableSelectWindowComponent.html +114 -228
- package/compodoc/components/WindowTestWrapperComponent.html +47 -74
- package/compodoc/dependencies.html +21 -21
- package/compodoc/directives/OpenTableSelectWindowDirective.html +671 -591
- package/compodoc/directives/TableSelectControlDirective.html +433 -280
- package/compodoc/graph/dependencies.svg +15 -145
- package/compodoc/injectables/OpenTableSelectWindowMethod.html +5 -76
- package/compodoc/interfaces/BooleanColumn.html +3 -14
- package/compodoc/interfaces/DateColumn.html +3 -14
- package/compodoc/interfaces/OpenTableSelectWindowMethodParameters.html +3 -14
- package/compodoc/interfaces/SelectColumn.html +4 -15
- package/compodoc/js/menu-wc.js +13 -63
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/variables.html +1 -1
- package/compodoc/modules.html +0 -17
- package/compodoc/overview.html +1 -177
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +4633 -4087
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- 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 +20 -20
- package/docs/html/classes/OpenTableSelectWindowDirective.html +19 -29
- package/docs/html/classes/OpenTableSelectWindowMethod.html +2 -2
- package/docs/html/classes/TableSelectControlDirective.html +11 -25
- package/docs/html/classes/TableSelectInputComponent.html +23 -26
- 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 +39 -41
- package/docs/markdown/classes/OpenTableSelectWindowDirective.md +107 -159
- package/docs/markdown/classes/OpenTableSelectWindowMethod.md +4 -16
- package/docs/markdown/classes/TableSelectControlDirective.md +73 -139
- package/docs/markdown/classes/TableSelectInputComponent.md +59 -118
- package/docs/markdown/classes/TableSelectWindowComponent.md +14 -28
- package/docs/markdown/classes/WindowTestWrapperComponent.md +11 -11
- 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 -3
- 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 +3 -3
- 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 +38 -40
- package/docs/wiki/Class.OpenTableSelectWindowDirective.md +106 -158
- package/docs/wiki/Class.OpenTableSelectWindowMethod.md +3 -15
- package/docs/wiki/Class.TableSelectControlDirective.md +72 -138
- package/docs/wiki/Class.TableSelectInputComponent.md +58 -117
- package/docs/wiki/Class.TableSelectWindowComponent.md +13 -27
- package/docs/wiki/Class.WindowTestWrapperComponent.md +10 -10
- 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 +2 -2
- 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/_Sidebar.md +0 -1
- package/docs/wiki/globals.md +1 -2
- package/fesm2022/rxap-ngx-material-table-select.mjs +254 -345
- package/fesm2022/rxap-ngx-material-table-select.mjs.map +1 -1
- package/package.json +60 -59
- package/types/rxap-ngx-material-table-select.d.ts +266 -0
- package/docs/html/classes/TableSelectControlModule.html +0 -2
- package/docs/markdown/classes/TableSelectControlModule.md +0 -19
- package/docs/wiki/Class.TableSelectControlModule.md +0 -15
- package/index.d.ts +0 -13
- package/lib/create-filter-form-provider.d.ts +0 -3
- package/lib/decorators.d.ts +0 -17
- package/lib/extract-table-select-column-map.mixin.d.ts +0 -7
- package/lib/extract-table-select-data-source.mixin.d.ts +0 -7
- package/lib/extract-table-select-to-display.mixin.d.ts +0 -7
- package/lib/extract-table-select-to-value.mixin.d.ts +0 -7
- package/lib/open-table-select-window.directive.d.ts +0 -47
- package/lib/open-table-select-window.method.d.ts +0 -55
- package/lib/table-select-control.directive.d.ts +0 -49
- package/lib/table-select-control.module.d.ts +0 -10
- package/lib/table-select-input/table-select-input.component.d.ts +0 -45
- package/lib/table-select-window/table-select-window.component.d.ts +0 -21
- package/lib/table-select-window/window-test-wrapper.d.ts +0 -36
|
@@ -1,52 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsyncPipe, KeyValuePipe, NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
3
|
+
import { inject, ChangeDetectionStrategy, Component, input, INJECTOR, ViewContainerRef, viewChildren, ComponentRef, ViewRef, Injector, booleanAttribute, linkedSignal, signal, effect, afterNextRender, forwardRef, Injectable, output, computed, untracked, isDevMode, Directive, contentChildren, contentChild, DestroyRef } from '@angular/core';
|
|
4
|
+
import * as i6 from '@angular/forms';
|
|
5
5
|
import { FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i7 from '@angular/material/button';
|
|
7
7
|
import { MatButtonModule, MatButton } from '@angular/material/button';
|
|
8
|
-
import * as
|
|
8
|
+
import * as i4 from '@angular/material/form-field';
|
|
9
9
|
import { MatFormFieldModule, MatFormFieldControl, MatFormField } from '@angular/material/form-field';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i8 from '@angular/material/icon';
|
|
11
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i5 from '@angular/material/input';
|
|
13
13
|
import { MatInputModule } from '@angular/material/input';
|
|
14
|
-
import * as
|
|
14
|
+
import * as i9 from '@angular/material/paginator';
|
|
15
15
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i1 from '@angular/material/progress-bar';
|
|
17
17
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
18
|
-
import * as
|
|
18
|
+
import * as i3 from '@angular/material/sort';
|
|
19
19
|
import { MatSortModule } from '@angular/material/sort';
|
|
20
|
-
import * as
|
|
20
|
+
import * as i2 from '@angular/material/table';
|
|
21
21
|
import { MatTableModule } from '@angular/material/table';
|
|
22
22
|
import { ParentControlContainerDirective, ControlValueAccessor, RxapFormControl, RxapFormGroup } from '@rxap/forms';
|
|
23
23
|
import { FormFieldNoPaddingDirective } from '@rxap/material-directives/form-field';
|
|
24
24
|
import { InputClearButtonDirective } from '@rxap/material-form-system';
|
|
25
|
-
import
|
|
26
|
-
import { SelectRowService, TableFilterService, TableDataSourceDirective, FilterHeaderRowDirective, CheckboxHeaderCellComponent, CheckboxCellComponent, DateCellComponent, BooleanCellComponent, RowAnimation, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, TABLE_DATA_SOURCE, RXAP_TABLE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, RXAP_TABLE_FILTER } from '@rxap/material-table-system';
|
|
25
|
+
import { SelectRowService, RowAnimation, TableDataSourceDirective, FilterHeaderRowDirective, CheckboxHeaderCellComponent, CheckboxCellComponent, DateCellComponent, BooleanCellComponent, TableFilterService, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, TABLE_DATA_SOURCE, RXAP_TABLE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, RXAP_TABLE_FILTER } from '@rxap/material-table-system';
|
|
27
26
|
import { GetFromObjectPipe } from '@rxap/pipes';
|
|
28
|
-
import
|
|
29
|
-
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, WindowFooterDirective, RXAP_WINDOW_SETTINGS, WindowService } from '@rxap/window-system';
|
|
27
|
+
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, WindowFooterDirective, WindowService, RXAP_WINDOW_SETTINGS } from '@rxap/window-system';
|
|
30
28
|
import { map, tap as tap$1 } from 'rxjs/operators';
|
|
31
|
-
import * as i1$
|
|
32
|
-
import {
|
|
29
|
+
import * as i1$1 from '@angular/cdk/portal';
|
|
30
|
+
import { CdkPortalOutlet, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
33
31
|
import { Subject, ReplaySubject, tap, Subscription, startWith, delay } from 'rxjs';
|
|
34
|
-
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
35
32
|
import { UseDataSource, RxapFormSystemError, ExtractFormDefinitionMixin, ExtractControlMixin } from '@rxap/form-system';
|
|
36
33
|
import { setMetadataMap, getMetadata } from '@rxap/reflect-metadata';
|
|
37
|
-
import { __decorate } from 'tslib';
|
|
34
|
+
import { __decorate, __metadata } from 'tslib';
|
|
38
35
|
import { Mixin } from '@rxap/mixin';
|
|
39
36
|
import { ExtractDatasourceMixin } from '@rxap/material-table-window-system';
|
|
40
37
|
import { staticDataSource, DataSourceLoader, BaseDataSource } from '@rxap/data-source';
|
|
41
38
|
import { GenerateRandomString, coerceArray } from '@rxap/utilities';
|
|
42
39
|
import '@rxap/rxjs';
|
|
43
40
|
import { TableDataSource, AbstractTableDataSource } from '@rxap/data-source/table';
|
|
41
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
44
42
|
|
|
45
43
|
class TableSelectWindowComponent {
|
|
46
|
-
constructor(
|
|
47
|
-
this.data =
|
|
48
|
-
this.selectRows =
|
|
49
|
-
this.windowRef =
|
|
44
|
+
constructor() {
|
|
45
|
+
this.data = inject(RXAP_WINDOW_DATA);
|
|
46
|
+
this.selectRows = inject(SelectRowService);
|
|
47
|
+
this.windowRef = inject(RXAP_WINDOW_REF);
|
|
50
48
|
this.id = this.data.id;
|
|
51
49
|
this.displayColumns = [...this.data.columns.keys()];
|
|
52
50
|
if (this.data.multiple) {
|
|
@@ -73,19 +71,18 @@ class TableSelectWindowComponent {
|
|
|
73
71
|
this.windowRef.next(this.selectRows.selectedRows);
|
|
74
72
|
this.close();
|
|
75
73
|
}
|
|
76
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
77
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
75
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TableSelectWindowComponent, isStandalone: true, selector: "rxap-table-select-window", providers: [
|
|
78
76
|
SelectRowService,
|
|
79
77
|
TableFilterService,
|
|
80
|
-
], ngImport: i0, template: "<mat-progress-bar *ngIf=\"tableDataSourceDirective.loading$ | async\" mode=\"indeterminate\"></mat-progress-bar>\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 <ng-container *ngIf=\"data.multiple\" 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 <ng-container *ngIf=\"hasSomeFilterColumn\">\n\n <ng-container *ngIf=\"data.multiple\" [matColumnDef]=\"'filter__select'\">\n <th *matHeaderCellDef mat-header-cell></th>\n </ng-container>\n\n <ng-container *ngFor=\"let item of data.columns | keyvalue\">\n\n <ng-container *ngIf=\"item.value.filter\">\n\n <ng-container [ngSwitch]=\"item.value.type\">\n\n <ng-container *ngSwitchCase=\"'date'\">\n\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n\n </th>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'boolean'\">\n\n <ng-container [matColumnDef]=\"'filter__' + item.key\">\n <th *matHeaderCellDef mat-header-cell>\n\n </th>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n\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 </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!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 </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngFor=\"let item of data.columns | keyvalue\">\n\n <ng-container [ngSwitch]=\"item.value.type\">\n\n <ng-container *ngSwitchCase=\"'date'\">\n\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 </ng-container>\n\n <ng-container *ngSwitchCase=\"'boolean'\">\n\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 </ng-container>\n\n <ng-container *ngSwitchDefault>\n\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 </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"hasSomeFilterColumn\">\n <tr\n *matHeaderRowDef=\"filterDisplayColumns\"\n class=\"filter-header\"\n mat-header-row\n ></tr>\n </ng-container>\n\n <ng-template [ngIf]=\"data.showHeader\">\n <tr\n *matHeaderRowDef=\"displayColumns\"\n mat-header-row\n ></tr>\n </ng-template>\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 <button (click)=\"select()\" *ngIf=\"data.multiple\" [disabled]=\"hasNotSelected$ | async\" class=\"grow-0\" mat-raised-button\n type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n <span *ngIf=\"!data.multiple\" class=\"hint\" i18n>Click on a row to select an entry.</span>\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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: TableDataSourceDirective, selector: "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", inputs: ["rxapTableDataSource", "paginator", "id", "parameters", "dataSource"], exportAs: ["rxapTableDataSource"] }, { kind: "directive", type: FilterHeaderRowDirective, selector: "table[rxap-filter-header-row]", inputs: ["rxap-filter-header-row"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i4.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i4.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: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.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: i8.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: InputClearButtonDirective, selector: "[rxapInputClearButton]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i9.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: i10.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: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: GetFromObjectPipe, name: "getFromObject" }, { kind: "directive", type: FormFieldNoPaddingDirective, selector: "mat-form-field[rxapNoPadding]" }], animations: [RowAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
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 }); }
|
|
81
79
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectWindowComponent, decorators: [{
|
|
83
81
|
type: Component,
|
|
84
82
|
args: [{ selector: 'rxap-table-select-window', changeDetection: ChangeDetectionStrategy.OnPush, animations: [RowAnimation], providers: [
|
|
85
83
|
SelectRowService,
|
|
86
84
|
TableFilterService,
|
|
87
85
|
], imports: [
|
|
88
|
-
NgIf,
|
|
89
86
|
MatProgressBarModule,
|
|
90
87
|
MatTableModule,
|
|
91
88
|
TableDataSourceDirective,
|
|
@@ -93,10 +90,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
93
90
|
MatSortModule,
|
|
94
91
|
CheckboxHeaderCellComponent,
|
|
95
92
|
CheckboxCellComponent,
|
|
96
|
-
NgFor,
|
|
97
|
-
NgSwitch,
|
|
98
|
-
NgSwitchCase,
|
|
99
|
-
NgSwitchDefault,
|
|
100
93
|
MatFormFieldModule,
|
|
101
94
|
MatInputModule,
|
|
102
95
|
FormsModule,
|
|
@@ -112,15 +105,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
112
105
|
AsyncPipe,
|
|
113
106
|
KeyValuePipe,
|
|
114
107
|
GetFromObjectPipe,
|
|
115
|
-
FormFieldNoPaddingDirective
|
|
116
|
-
], template: "
|
|
117
|
-
}], ctorParameters: () => [
|
|
118
|
-
type: Inject,
|
|
119
|
-
args: [RXAP_WINDOW_DATA]
|
|
120
|
-
}] }, { type: i1.SelectRowService }, { type: i1$1.WindowRef, decorators: [{
|
|
121
|
-
type: Inject,
|
|
122
|
-
args: [RXAP_WINDOW_REF]
|
|
123
|
-
}] }] });
|
|
108
|
+
FormFieldNoPaddingDirective
|
|
109
|
+
], 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"] }]
|
|
110
|
+
}], ctorParameters: () => [] });
|
|
124
111
|
|
|
125
112
|
// TODO : refactor move to package @rxap/ngx-testing
|
|
126
113
|
class MockWindowRef extends Subject {
|
|
@@ -160,13 +147,15 @@ class MockWindowRef extends Subject {
|
|
|
160
147
|
}
|
|
161
148
|
class WindowTestWrapperComponent {
|
|
162
149
|
constructor() {
|
|
150
|
+
this.component = input.required(...(ngDevMode ? [{ debugName: "component" }] : /* istanbul ignore next */ []));
|
|
163
151
|
this.content = null;
|
|
164
152
|
this.footer = null;
|
|
165
153
|
this.injector = inject(INJECTOR);
|
|
166
154
|
this.viewContainerRef = this.injector.get(ViewContainerRef);
|
|
155
|
+
this.portalOutlet = viewChildren(CdkPortalOutlet, ...(ngDevMode ? [{ debugName: "portalOutlet" }] : /* istanbul ignore next */ []));
|
|
167
156
|
}
|
|
168
157
|
ngAfterViewInit() {
|
|
169
|
-
this.portalOutlet.forEach((outlet) => {
|
|
158
|
+
this.portalOutlet().forEach((outlet) => {
|
|
170
159
|
outlet.attached.pipe(tap(attachedRef => {
|
|
171
160
|
if (attachedRef instanceof ComponentRef) {
|
|
172
161
|
console.log('ComponentRef', attachedRef);
|
|
@@ -189,10 +178,10 @@ class WindowTestWrapperComponent {
|
|
|
189
178
|
}],
|
|
190
179
|
});
|
|
191
180
|
windowRef.footerPortal$.pipe(tap((portal) => this.footer = portal)).subscribe();
|
|
192
|
-
this.content = new ComponentPortal(this.component, this.viewContainerRef, injector);
|
|
181
|
+
this.content = new ComponentPortal(this.component(), this.viewContainerRef, injector);
|
|
193
182
|
}
|
|
194
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
195
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WindowTestWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
184
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: WindowTestWrapperComponent, isStandalone: true, selector: "ng-component", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "portalOutlet", predicate: CdkPortalOutlet, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
196
185
|
<div class="flex flex-col gap-8">
|
|
197
186
|
<div class="grow">
|
|
198
187
|
<ng-template [cdkPortalOutlet]="content"></ng-template>
|
|
@@ -202,9 +191,9 @@ class WindowTestWrapperComponent {
|
|
|
202
191
|
<ng-template [cdkPortalOutlet]="footer"></ng-template>
|
|
203
192
|
</div>
|
|
204
193
|
</div>
|
|
205
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$
|
|
194
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] }); }
|
|
206
195
|
}
|
|
207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WindowTestWrapperComponent, decorators: [{
|
|
208
197
|
type: Component,
|
|
209
198
|
args: [{
|
|
210
199
|
template: `
|
|
@@ -219,82 +208,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
219
208
|
</div>
|
|
220
209
|
`,
|
|
221
210
|
imports: [
|
|
222
|
-
PortalModule
|
|
223
|
-
NgIf,
|
|
211
|
+
PortalModule
|
|
224
212
|
]
|
|
225
213
|
}]
|
|
226
|
-
}], propDecorators: { component: [{
|
|
227
|
-
type: Input,
|
|
228
|
-
args: [{ required: true }]
|
|
229
|
-
}], portalOutlet: [{
|
|
230
|
-
type: ViewChildren,
|
|
231
|
-
args: [CdkPortalOutlet]
|
|
232
|
-
}] } });
|
|
214
|
+
}], propDecorators: { component: [{ type: i0.Input, args: [{ isSignal: true, alias: "component", required: true }] }], portalOutlet: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => CdkPortalOutlet), { isSignal: true }] }] } });
|
|
233
215
|
|
|
234
216
|
class TableSelectInputComponent extends ControlValueAccessor {
|
|
235
217
|
static { this.nextId = 0; }
|
|
236
218
|
get empty() {
|
|
237
|
-
return this._value === null;
|
|
219
|
+
return this._value() === null;
|
|
238
220
|
}
|
|
239
221
|
get shouldLabelFloat() {
|
|
240
222
|
return this.focused || !this.empty;
|
|
241
223
|
}
|
|
242
224
|
get required() {
|
|
243
|
-
return this.
|
|
244
|
-
}
|
|
245
|
-
set required(req) {
|
|
246
|
-
this._required = coerceBooleanProperty(req);
|
|
247
|
-
this.stateChanges.next();
|
|
248
|
-
}
|
|
249
|
-
get disabled() { return this._disabled; }
|
|
250
|
-
set disabled(value) {
|
|
251
|
-
this._disabled = coerceBooleanProperty(value);
|
|
252
|
-
this.stateChanges.next();
|
|
225
|
+
return this.requiredInput();
|
|
253
226
|
}
|
|
227
|
+
get disabled() { return this._disabled(); }
|
|
254
228
|
get errorState() {
|
|
255
229
|
return this.ngControl?.invalid || false;
|
|
256
230
|
}
|
|
257
231
|
get placeholder() {
|
|
258
|
-
return this.
|
|
259
|
-
}
|
|
260
|
-
set placeholder(placeholder) {
|
|
261
|
-
this._placeholder = placeholder;
|
|
262
|
-
this.stateChanges.next();
|
|
232
|
+
return this.placeholderInput();
|
|
263
233
|
}
|
|
264
234
|
set value(value) {
|
|
265
|
-
this._value
|
|
266
|
-
this.stateChanges.next();
|
|
235
|
+
this._value.set(value);
|
|
267
236
|
}
|
|
268
237
|
get value() {
|
|
269
|
-
return this._value;
|
|
238
|
+
return this._value();
|
|
270
239
|
}
|
|
271
|
-
constructor(
|
|
240
|
+
constructor() {
|
|
272
241
|
super();
|
|
273
|
-
this.ngControl =
|
|
274
|
-
this.cdr = cdr;
|
|
242
|
+
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
275
243
|
this.id = `rxap-table-select-input-${TableSelectInputComponent.nextId++}`;
|
|
276
244
|
this.stateChanges = new Subject();
|
|
277
245
|
this.control = null;
|
|
278
246
|
this.rxapControl = null;
|
|
279
247
|
this.focused = false;
|
|
248
|
+
this.requiredInput = input(false, { ...(ngDevMode ? { debugName: "requiredInput" } : /* istanbul ignore next */ {}), alias: 'required', transform: booleanAttribute });
|
|
249
|
+
this.disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
|
|
250
|
+
this._disabled = linkedSignal(() => this.disabledInput(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
280
251
|
this._subscription = new Subscription();
|
|
281
|
-
this.
|
|
282
|
-
this.
|
|
283
|
-
this.
|
|
284
|
-
this._placeholder = '';
|
|
252
|
+
this._value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
253
|
+
this.placeholderInput = input('', { ...(ngDevMode ? { debugName: "placeholderInput" } : /* istanbul ignore next */ {}), alias: 'placeholder' });
|
|
254
|
+
this._display = signal(undefined, ...(ngDevMode ? [{ debugName: "_display" }] : /* istanbul ignore next */ []));
|
|
285
255
|
// Replace the provider from above with this.
|
|
286
256
|
if (this.ngControl != null) {
|
|
287
257
|
// Setting the value accessor directly (instead of using
|
|
288
258
|
// the providers) to avoid running into a circular import.
|
|
289
259
|
this.ngControl.valueAccessor = this;
|
|
290
260
|
}
|
|
261
|
+
effect(() => {
|
|
262
|
+
this.requiredInput();
|
|
263
|
+
this._disabled();
|
|
264
|
+
this.placeholderInput();
|
|
265
|
+
this._value();
|
|
266
|
+
this.stateChanges.next();
|
|
267
|
+
});
|
|
268
|
+
afterNextRender(() => this.initControl());
|
|
291
269
|
}
|
|
292
270
|
get display() {
|
|
293
|
-
return this._display;
|
|
271
|
+
return this._display();
|
|
294
272
|
}
|
|
295
273
|
set display(value) {
|
|
296
|
-
this._display
|
|
297
|
-
this.cdr.detectChanges();
|
|
274
|
+
this._display.set(value);
|
|
298
275
|
}
|
|
299
276
|
writeValue(value) {
|
|
300
277
|
this.value = value;
|
|
@@ -305,7 +282,7 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
305
282
|
this.onChange(this.value);
|
|
306
283
|
}
|
|
307
284
|
}
|
|
308
|
-
|
|
285
|
+
initControl() {
|
|
309
286
|
if (this.ngControl) {
|
|
310
287
|
this.control = this.ngControl.control;
|
|
311
288
|
if (this.control instanceof RxapFormControl) {
|
|
@@ -313,12 +290,11 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
313
290
|
}
|
|
314
291
|
}
|
|
315
292
|
this._subscription.add(this.control?.valueChanges.pipe(startWith(this.control?.value ?? null), delay(100), // TODO : remove timing workaround
|
|
316
|
-
// the
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
// execution else for the first this.toDisplay function the default implementation is used
|
|
293
|
+
// the toDisplay function of this component is replaced by the TableSelectControlDirective
|
|
294
|
+
// after the form field was initialized. The delay ensures the the this.toDisplay function
|
|
295
|
+
// is called after that replacement else for the first value the default implementation is used
|
|
320
296
|
tap$1(async (value) => this.display = value === null ? '' : await this.toDisplay(value))).subscribe());
|
|
321
|
-
this._subscription.add(this.rxapControl?.disabled$.pipe(tap$1(disabled => this.disabled
|
|
297
|
+
this._subscription.add(this.rxapControl?.disabled$.pipe(tap$1(disabled => this._disabled.set(disabled))).subscribe());
|
|
322
298
|
}
|
|
323
299
|
toDisplay(value) {
|
|
324
300
|
return value;
|
|
@@ -333,38 +309,26 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
333
309
|
onContainerClick(event) {
|
|
334
310
|
// no op
|
|
335
311
|
}
|
|
336
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
337
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
313
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TableSelectInputComponent, isStandalone: true, selector: "rxap-table-select-input", inputs: { requiredInput: { classPropertyName: "requiredInput", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholderInput: { classPropertyName: "placeholderInput", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id", "class.floating": "shouldLabelFloat" } }, providers: [
|
|
338
314
|
{
|
|
339
315
|
provide: MatFormFieldControl,
|
|
340
316
|
useExisting: forwardRef(() => TableSelectInputComponent),
|
|
341
317
|
},
|
|
342
|
-
], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n
|
|
318
|
+
], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n @if (display || placeholder) {\n <span>{{display ?? placeholder}}</span>\n }\n</div>\n", 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"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
343
319
|
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectInputComponent, decorators: [{
|
|
345
321
|
type: Component,
|
|
346
322
|
args: [{ selector: 'rxap-table-select-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
347
323
|
{
|
|
348
324
|
provide: MatFormFieldControl,
|
|
349
325
|
useExisting: forwardRef(() => TableSelectInputComponent),
|
|
350
326
|
},
|
|
351
|
-
],
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
|
357
|
-
type: HostBinding
|
|
358
|
-
}], shouldLabelFloat: [{
|
|
359
|
-
type: HostBinding,
|
|
360
|
-
args: ['class.floating']
|
|
361
|
-
}], required: [{
|
|
362
|
-
type: Input
|
|
363
|
-
}], disabled: [{
|
|
364
|
-
type: Input
|
|
365
|
-
}], placeholder: [{
|
|
366
|
-
type: Input
|
|
367
|
-
}] } });
|
|
327
|
+
], host: {
|
|
328
|
+
'[id]': 'id',
|
|
329
|
+
'[class.floating]': 'shouldLabelFloat',
|
|
330
|
+
}, imports: [NgClass], template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n @if (display || placeholder) {\n <span>{{display ?? placeholder}}</span>\n }\n</div>\n", 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"] }]
|
|
331
|
+
}], ctorParameters: () => [], propDecorators: { requiredInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholderInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
368
332
|
|
|
369
333
|
function CreateFilterFormProvider(columns) {
|
|
370
334
|
const columnNameList = Array.from(columns.entries())
|
|
@@ -389,7 +353,7 @@ function CreateFilterFormProvider(columns) {
|
|
|
389
353
|
const TABLE_SELECT_COLUMN_MAP = 'TABLE_SELECT_COLUMN_MAP';
|
|
390
354
|
const TABLE_SELECT_TO_DISPLAY = 'TABLE_SELECT_TO_DISPLAY';
|
|
391
355
|
const TABLE_SELECT_TO_VALUE = 'TABLE_SELECT_TO_VALUE';
|
|
392
|
-
const TABLE_SELECT_METHOD = '
|
|
356
|
+
const TABLE_SELECT_METHOD = 'TABLE_SELECT_METHOD';
|
|
393
357
|
const TABLE_SELECT_DATA_SOURCE = 'TABLE_SELECT_DATA_SOURCE';
|
|
394
358
|
function UseTableSelectColumns(columnMap) {
|
|
395
359
|
return function (target, propertyKey) {
|
|
@@ -473,9 +437,9 @@ ExtractTableSelectToValueMixin = __decorate([
|
|
|
473
437
|
], ExtractTableSelectToValueMixin);
|
|
474
438
|
|
|
475
439
|
class OpenTableSelectWindowMethod {
|
|
476
|
-
constructor(
|
|
477
|
-
this.windowService =
|
|
478
|
-
this.injector =
|
|
440
|
+
constructor() {
|
|
441
|
+
this.windowService = inject(WindowService);
|
|
442
|
+
this.injector = inject(INJECTOR);
|
|
479
443
|
}
|
|
480
444
|
async call(parameters) {
|
|
481
445
|
const providers = [
|
|
@@ -545,23 +509,30 @@ class OpenTableSelectWindowMethod {
|
|
|
545
509
|
createFilterForm(columns) {
|
|
546
510
|
return CreateFilterFormProvider(columns);
|
|
547
511
|
}
|
|
548
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
549
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
512
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OpenTableSelectWindowMethod, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
513
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OpenTableSelectWindowMethod }); }
|
|
550
514
|
}
|
|
551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OpenTableSelectWindowMethod, decorators: [{
|
|
552
516
|
type: Injectable
|
|
553
|
-
}]
|
|
554
|
-
type: Inject,
|
|
555
|
-
args: [INJECTOR]
|
|
556
|
-
}] }] });
|
|
517
|
+
}] });
|
|
557
518
|
|
|
558
519
|
let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
559
520
|
constructor() {
|
|
560
|
-
this.
|
|
561
|
-
this.
|
|
521
|
+
this.dataInput = input(undefined, { ...(ngDevMode ? { debugName: "dataInput" } : /* istanbul ignore next */ {}), alias: 'data' });
|
|
522
|
+
this.data = linkedSignal(() => this.dataInput(), ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
523
|
+
this.columnsInput = input(undefined, { ...(ngDevMode ? { debugName: "columnsInput" } : /* istanbul ignore next */ {}), alias: 'columns' });
|
|
524
|
+
this.columns = linkedSignal(() => this.columnsInput(), ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
525
|
+
this.selectedInput = input([], { ...(ngDevMode ? { debugName: "selectedInput" } : /* istanbul ignore next */ {}), alias: 'selected' });
|
|
526
|
+
this.selected = linkedSignal(() => this.selectedInput(), ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
527
|
+
this.parameters = input(...(ngDevMode ? [undefined, { debugName: "parameters" }] : /* istanbul ignore next */ []));
|
|
528
|
+
this.selectedChange = output();
|
|
529
|
+
this.labelInput = input(undefined, { ...(ngDevMode ? { debugName: "labelInput" } : /* istanbul ignore next */ {}), alias: 'label' });
|
|
530
|
+
this.label = linkedSignal(() => this.labelInput(), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
531
|
+
this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
562
532
|
this._internalId = GenerateRandomString();
|
|
563
|
-
this.
|
|
564
|
-
this.
|
|
533
|
+
this.compareWithInput = input(undefined, { ...(ngDevMode ? { debugName: "compareWithInput" } : /* istanbul ignore next */ {}), alias: 'compareWith' });
|
|
534
|
+
this.compareWith = linkedSignal(() => this.compareWithInput(), ...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
|
|
535
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
565
536
|
// required for the use mixin ExtractDatasourceMixin
|
|
566
537
|
this.dataSourceLoader = inject(DataSourceLoader);
|
|
567
538
|
this._hasOpenWindow = false;
|
|
@@ -569,20 +540,21 @@ let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
|
569
540
|
this.windowService = inject(WindowService);
|
|
570
541
|
this.injector = inject(INJECTOR);
|
|
571
542
|
this.matButton = inject(MatButton, { optional: true });
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
543
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
544
|
+
this.invalidInputs = computed(() => !this.columns() || !this.data(), ...(ngDevMode ? [{ debugName: "invalidInputs" }] : /* istanbul ignore next */ []));
|
|
545
|
+
this.disabled = computed(() => this._disabled() || this.invalidInputs(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
546
|
+
this.toValueInput = input(undefined, { ...(ngDevMode ? { debugName: "toValueInput" } : /* istanbul ignore next */ {}), alias: 'toValue' });
|
|
547
|
+
this.toValue = linkedSignal(() => this.toValueInput(), ...(ngDevMode ? [{ debugName: "toValue" }] : /* istanbul ignore next */ []));
|
|
548
|
+
effect(() => {
|
|
549
|
+
const data = this.data();
|
|
550
|
+
const columns = this.columns();
|
|
551
|
+
const disabled = this.disabled();
|
|
552
|
+
untracked(() => this.checkInputs(data, columns, disabled));
|
|
553
|
+
});
|
|
554
|
+
afterNextRender(() => this.initFromFormField());
|
|
583
555
|
}
|
|
584
|
-
|
|
585
|
-
this.
|
|
556
|
+
setDisabled(value) {
|
|
557
|
+
this._disabled.set(value);
|
|
586
558
|
}
|
|
587
559
|
ngOnDestroy() {
|
|
588
560
|
if (this.windowService.has(this._internalId)) {
|
|
@@ -591,40 +563,48 @@ let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
|
591
563
|
}
|
|
592
564
|
async onClick($event) {
|
|
593
565
|
$event.stopPropagation();
|
|
594
|
-
if (this.disabled || this._hasOpenWindow) {
|
|
595
|
-
console.debug('disabled or has open window', { disabled: this.disabled, hasOpenWindow: this._hasOpenWindow });
|
|
566
|
+
if (this.disabled() || this._hasOpenWindow) {
|
|
567
|
+
console.debug('disabled or has open window', { disabled: this.disabled(), hasOpenWindow: this._hasOpenWindow });
|
|
596
568
|
return;
|
|
597
569
|
}
|
|
598
|
-
|
|
570
|
+
const data = this.data();
|
|
571
|
+
const columns = this.columns();
|
|
572
|
+
if (!data || !columns) {
|
|
599
573
|
throw new Error('FATAL: The data or columns input is not set');
|
|
600
574
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
575
|
+
this._hasOpenWindow = true;
|
|
576
|
+
this.control?.disable();
|
|
577
|
+
let selected;
|
|
578
|
+
try {
|
|
579
|
+
selected = await this.openMethod.call({
|
|
580
|
+
windowConfig: {
|
|
581
|
+
id: this._internalId,
|
|
582
|
+
},
|
|
583
|
+
injector: this.injector,
|
|
584
|
+
data: data,
|
|
585
|
+
columns: columns instanceof Map ? columns : new Map(Object.entries(columns)),
|
|
586
|
+
selected: this.selected()?.slice() ?? [],
|
|
587
|
+
title: this.label() ?? 'Select value',
|
|
588
|
+
compareWith: this.compareWith(),
|
|
589
|
+
id: this.id() ?? GenerateRandomString(10),
|
|
590
|
+
parameters: this.parameters(),
|
|
591
|
+
multiple: this.multiple(),
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
finally {
|
|
595
|
+
this._hasOpenWindow = false;
|
|
596
|
+
this.control?.enable();
|
|
597
|
+
}
|
|
619
598
|
if (isDevMode()) {
|
|
620
599
|
console.debug('selected', selected);
|
|
621
600
|
}
|
|
622
|
-
this.selected
|
|
623
|
-
|
|
624
|
-
this.selectedChange.emit(
|
|
625
|
-
if (
|
|
626
|
-
|
|
627
|
-
|
|
601
|
+
this.selected.set(selected ?? []);
|
|
602
|
+
const selectedValue = this.selected();
|
|
603
|
+
this.selectedChange.emit(selectedValue);
|
|
604
|
+
if (selectedValue.length) {
|
|
605
|
+
const toValue = this.toValue();
|
|
606
|
+
if (toValue) {
|
|
607
|
+
this.control?.setValue(toValue(selectedValue[0]));
|
|
628
608
|
}
|
|
629
609
|
else {
|
|
630
610
|
throw new Error('The toValue method is not defined');
|
|
@@ -634,128 +614,138 @@ let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
|
634
614
|
this.control?.reset();
|
|
635
615
|
}
|
|
636
616
|
}
|
|
637
|
-
|
|
617
|
+
initFromFormField() {
|
|
638
618
|
const hasNgControl = !!this.injector.get(NgControl, null);
|
|
639
619
|
const hasMatFormField = !!this.injector.get(MatFormField, null);
|
|
640
620
|
if (hasMatFormField || hasNgControl) {
|
|
641
621
|
this.matFormField = this.injector.get(MatFormField);
|
|
642
622
|
this.ngControl = this.matFormField._control.ngControl;
|
|
643
623
|
this.control ??= this.ngControl?.control ?? null;
|
|
644
|
-
this.data
|
|
645
|
-
|
|
646
|
-
|
|
624
|
+
if (!this.data()) {
|
|
625
|
+
this.data.set(this.extractTableSelectDataSource());
|
|
626
|
+
}
|
|
627
|
+
if (!this.columns()) {
|
|
628
|
+
this.columns.set(this.extractTableSelectColumnMap());
|
|
629
|
+
}
|
|
630
|
+
if (!this.toValue()) {
|
|
631
|
+
this.toValue.set(this.extractTableSelectToValue() ?? (value => value));
|
|
632
|
+
}
|
|
647
633
|
if (this.control) {
|
|
648
|
-
this.
|
|
634
|
+
this.setDisabled(this.control.disabled);
|
|
649
635
|
this.control.registerOnDisabledChange(isDisabled => {
|
|
650
|
-
this.
|
|
636
|
+
this.setDisabled(isDisabled);
|
|
651
637
|
});
|
|
652
638
|
}
|
|
653
639
|
}
|
|
654
|
-
this.checkInputs();
|
|
655
640
|
}
|
|
656
|
-
checkInputs() {
|
|
657
|
-
if (!
|
|
641
|
+
checkInputs(data, columns, disabled) {
|
|
642
|
+
if (!columns || !data) {
|
|
658
643
|
console.warn('columns or data is not defined');
|
|
659
|
-
this.invalidInputs = true;
|
|
660
|
-
if (this.matButton) {
|
|
661
|
-
this.matButton.disabled = this.disabled;
|
|
662
|
-
}
|
|
663
644
|
}
|
|
664
645
|
else {
|
|
665
|
-
if (typeof
|
|
646
|
+
if (typeof columns !== 'object') {
|
|
666
647
|
throw new Error('Ensure that the input columns has a valid value');
|
|
667
648
|
}
|
|
668
|
-
if (!Array.isArray(
|
|
649
|
+
if (!Array.isArray(data) && !(data instanceof BaseDataSource)) {
|
|
669
650
|
throw new Error('Ensure that the input data has a valid value');
|
|
670
651
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
652
|
+
}
|
|
653
|
+
if (this.matButton) {
|
|
654
|
+
this.matButton.disabled = disabled;
|
|
675
655
|
}
|
|
676
656
|
}
|
|
677
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
678
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
657
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OpenTableSelectWindowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
658
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: OpenTableSelectWindowDirective, isStandalone: true, selector: "[rxapOpenTableSelectWindow]", inputs: { dataInput: { classPropertyName: "dataInput", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columnsInput: { classPropertyName: "columnsInput", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, selectedInput: { classPropertyName: "selectedInput", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, labelInput: { classPropertyName: "labelInput", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, compareWithInput: { classPropertyName: "compareWithInput", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, toValueInput: { classPropertyName: "toValueInput", publicName: "toValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick($event)" }, properties: { "disabled": "disabled()" } }, providers: [OpenTableSelectWindowMethod], ngImport: i0 }); }
|
|
679
659
|
};
|
|
680
660
|
OpenTableSelectWindowDirective = __decorate([
|
|
681
|
-
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectColumnMapMixin, ExtractTableSelectToValueMixin)
|
|
661
|
+
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectColumnMapMixin, ExtractTableSelectToValueMixin),
|
|
662
|
+
__metadata("design:paramtypes", [])
|
|
682
663
|
], OpenTableSelectWindowDirective);
|
|
683
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OpenTableSelectWindowDirective, decorators: [{
|
|
684
665
|
type: Directive,
|
|
685
666
|
args: [{
|
|
686
667
|
selector: '[rxapOpenTableSelectWindow]',
|
|
687
668
|
standalone: true,
|
|
688
669
|
providers: [OpenTableSelectWindowMethod],
|
|
670
|
+
host: {
|
|
671
|
+
type: 'button',
|
|
672
|
+
'[disabled]': 'disabled()',
|
|
673
|
+
'(click)': 'onClick($event)',
|
|
674
|
+
},
|
|
689
675
|
}]
|
|
690
|
-
}], propDecorators: { data: [{
|
|
691
|
-
type: Input
|
|
692
|
-
}], columns: [{
|
|
693
|
-
type: Input
|
|
694
|
-
}], selected: [{
|
|
695
|
-
type: Input
|
|
696
|
-
}], parameters: [{
|
|
697
|
-
type: Input
|
|
698
|
-
}], selectedChange: [{
|
|
699
|
-
type: Output
|
|
700
|
-
}], label: [{
|
|
701
|
-
type: Input
|
|
702
|
-
}], id: [{
|
|
703
|
-
type: Input
|
|
704
|
-
}], compareWith: [{
|
|
705
|
-
type: Input
|
|
706
|
-
}], type: [{
|
|
707
|
-
type: HostBinding,
|
|
708
|
-
args: ['type']
|
|
709
|
-
}], disabled: [{
|
|
710
|
-
type: HostBinding,
|
|
711
|
-
args: ['disabled']
|
|
712
|
-
}], toValue: [{
|
|
713
|
-
type: Input
|
|
714
|
-
}], onClick: [{
|
|
715
|
-
type: HostListener,
|
|
716
|
-
args: ['click', ['$event']]
|
|
717
|
-
}] } });
|
|
676
|
+
}], ctorParameters: () => [], propDecorators: { dataInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columnsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], selectedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }], labelInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], compareWithInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], toValueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "toValue", required: false }] }] } });
|
|
718
677
|
|
|
719
678
|
let TableSelectControlDirective = class TableSelectControlDirective {
|
|
679
|
+
get selected() {
|
|
680
|
+
return this.value !== null ? [this.value] : [];
|
|
681
|
+
}
|
|
720
682
|
constructor() {
|
|
683
|
+
this.multiple = input(...(ngDevMode ? [undefined, { debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
684
|
+
this.openMethod = input.required(...(ngDevMode ? [{ debugName: "openMethod" }] : /* istanbul ignore next */ []));
|
|
685
|
+
this.dataInput = input(undefined, { ...(ngDevMode ? { debugName: "dataInput" } : /* istanbul ignore next */ {}), alias: 'data' });
|
|
686
|
+
this.data = linkedSignal(() => this.dataInput(), ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
687
|
+
this.columnsInput = input(undefined, { ...(ngDevMode ? { debugName: "columnsInput" } : /* istanbul ignore next */ {}), alias: 'columns' });
|
|
688
|
+
this.columns = linkedSignal(() => this.columnsInput(), ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
721
689
|
this.ngControl = null;
|
|
722
690
|
this.value = null;
|
|
691
|
+
this.openTableSelectWindow = contentChildren(OpenTableSelectWindowDirective, ...(ngDevMode ? [{ debugName: "openTableSelectWindow" }] : /* istanbul ignore next */ []));
|
|
692
|
+
this.tableSelectInput = contentChild.required(TableSelectInputComponent);
|
|
693
|
+
this.matLabel = contentChild('mat-label', ...(ngDevMode ? [{ debugName: "matLabel" }] : /* istanbul ignore next */ []));
|
|
694
|
+
this.toValueInput = input(undefined, { ...(ngDevMode ? { debugName: "toValueInput" } : /* istanbul ignore next */ {}), alias: 'toValue' });
|
|
695
|
+
this.toValue = linkedSignal(() => this.toValueInput(), ...(ngDevMode ? [{ debugName: "toValue" }] : /* istanbul ignore next */ []));
|
|
723
696
|
this.injector = inject(INJECTOR);
|
|
724
697
|
// required for the use mixin ExtractDatasourceMixin
|
|
725
698
|
this.dataSourceLoader = inject(DataSourceLoader);
|
|
726
|
-
this.disabled = false;
|
|
699
|
+
this.disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
727
700
|
this.matFormField = null;
|
|
728
|
-
this.
|
|
729
|
-
this.toDisplay =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
701
|
+
this.toDisplayInput = input(value => value, { ...(ngDevMode ? { debugName: "toDisplayInput" } : /* istanbul ignore next */ {}), alias: 'toDisplay' });
|
|
702
|
+
this.toDisplay = linkedSignal(() => this.toDisplayInput(), ...(ngDevMode ? [{ debugName: "toDisplay" }] : /* istanbul ignore next */ []));
|
|
703
|
+
this.destroyRef = inject(DestroyRef);
|
|
704
|
+
// push the resolved inputs into the projected open table select window directives
|
|
705
|
+
effect(() => {
|
|
706
|
+
const windows = this.openTableSelectWindow();
|
|
707
|
+
const columns = this.columns();
|
|
708
|
+
const data = this.data();
|
|
709
|
+
const toValue = this.toValue();
|
|
710
|
+
const matLabel = this.matLabel();
|
|
711
|
+
untracked(() => this.updateOpenTableSelectWindow(windows, columns, data, toValue, matLabel));
|
|
712
|
+
});
|
|
713
|
+
effect(() => {
|
|
714
|
+
const windows = this.openTableSelectWindow();
|
|
715
|
+
const disabled = this.disabled();
|
|
716
|
+
untracked(() => windows.forEach(openTableSelectWindow => openTableSelectWindow.setDisabled(disabled)));
|
|
717
|
+
});
|
|
718
|
+
// react to the selection of the projected open table select window directives
|
|
719
|
+
effect((onCleanup) => {
|
|
720
|
+
const subscriptions = this.openTableSelectWindow().map(openTableSelectWindow => openTableSelectWindow.selectedChange.subscribe($event => this.onSelected($event)));
|
|
721
|
+
onCleanup(() => subscriptions.forEach(subscription => subscription.unsubscribe()));
|
|
722
|
+
});
|
|
723
|
+
effect(() => {
|
|
724
|
+
const toDisplay = this.toDisplay();
|
|
725
|
+
const tableSelectInput = this.tableSelectInput();
|
|
726
|
+
untracked(() => {
|
|
727
|
+
if (toDisplay) {
|
|
728
|
+
tableSelectInput.toDisplay = toDisplay.bind(this);
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
});
|
|
732
|
+
afterNextRender(() => this.initFromFormField());
|
|
742
733
|
}
|
|
743
|
-
|
|
734
|
+
initFromFormField() {
|
|
744
735
|
this.matFormField = this.injector.get(MatFormField, null);
|
|
745
736
|
if (!this.matFormField) {
|
|
746
737
|
throw new Error('The mat form field could not be injected');
|
|
747
738
|
}
|
|
748
739
|
this.ngControl = this.matFormField._control.ngControl;
|
|
749
740
|
if (this.ngControl) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
this.
|
|
753
|
-
this.
|
|
754
|
-
this.
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
this._subscription?.add(this.control.disabled$.pipe(tap$1(disabled => this.disabled = disabled), tap$1(() => this.updateOpenTableSelectWindowDisabledState())).subscribe());
|
|
741
|
+
const control = this.ngControl.control;
|
|
742
|
+
if (control instanceof RxapFormControl) {
|
|
743
|
+
this.control = control;
|
|
744
|
+
this.data.set(this.extractTableSelectDataSource());
|
|
745
|
+
this.toDisplay.set(this.extractTableSelectToDisplay() ?? this.toDisplay());
|
|
746
|
+
this.toValue.set(this.extractTableSelectToValue() ?? this.toValue());
|
|
747
|
+
this.columns.set(this.extractTableSelectColumnMap());
|
|
748
|
+
control.disabled$.pipe(tap$1(disabled => this.disabled.set(disabled)), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
759
749
|
}
|
|
760
750
|
}
|
|
761
751
|
else {
|
|
@@ -763,135 +753,54 @@ let TableSelectControlDirective = class TableSelectControlDirective {
|
|
|
763
753
|
console.log('standalone mode');
|
|
764
754
|
}
|
|
765
755
|
}
|
|
766
|
-
this.updateTableSelectInput();
|
|
767
756
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
ngOnDestroy() {
|
|
775
|
-
this._subscription?.unsubscribe();
|
|
776
|
-
}
|
|
777
|
-
updateTableSelectInput() {
|
|
778
|
-
if (this.toDisplay) {
|
|
779
|
-
this.tableSelectInput.toDisplay = this.toDisplay.bind(this);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
updateOpenTableSelectWindowDisabledState() {
|
|
783
|
-
for (const openTableSelectWindow of this.openTableSelectWindow) {
|
|
784
|
-
openTableSelectWindow.disabled = this.disabled;
|
|
785
|
-
openTableSelectWindow.checkInputs();
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
updateOpenTableSelectWindow() {
|
|
789
|
-
for (const openTableSelectWindow of this.openTableSelectWindow) {
|
|
790
|
-
openTableSelectWindow.disabled = this.disabled;
|
|
791
|
-
if (this.columns) {
|
|
792
|
-
openTableSelectWindow.columns = this.columns;
|
|
757
|
+
updateOpenTableSelectWindow(windows, columns, data, toValue, matLabel) {
|
|
758
|
+
for (const openTableSelectWindow of windows) {
|
|
759
|
+
if (columns) {
|
|
760
|
+
openTableSelectWindow.columns.set(columns);
|
|
793
761
|
}
|
|
794
|
-
if (
|
|
795
|
-
openTableSelectWindow.data
|
|
762
|
+
if (data) {
|
|
763
|
+
openTableSelectWindow.data.set(data);
|
|
796
764
|
}
|
|
797
|
-
if (
|
|
798
|
-
openTableSelectWindow.compareWith
|
|
799
|
-
if (this.toValue) {
|
|
800
|
-
return this.toValue(o1) === this.toValue(o2);
|
|
801
|
-
}
|
|
802
|
-
return o1 === o2;
|
|
803
|
-
});
|
|
765
|
+
if (toValue) {
|
|
766
|
+
openTableSelectWindow.compareWith.set((o1, o2) => toValue(o1) === toValue(o2));
|
|
804
767
|
}
|
|
805
|
-
if (
|
|
806
|
-
openTableSelectWindow.label
|
|
768
|
+
if (matLabel) {
|
|
769
|
+
openTableSelectWindow.label.set(matLabel.nativeElement.innerText);
|
|
807
770
|
}
|
|
808
771
|
if (this.ngControl) {
|
|
809
772
|
const control = this.ngControl.control;
|
|
810
773
|
if (control?.value) {
|
|
811
|
-
openTableSelectWindow.selected
|
|
774
|
+
openTableSelectWindow.selected.set(coerceArray(control.value));
|
|
812
775
|
}
|
|
813
776
|
}
|
|
814
|
-
openTableSelectWindow.checkInputs();
|
|
815
777
|
}
|
|
816
778
|
}
|
|
817
779
|
async onSelected($event) {
|
|
780
|
+
const tableSelectInput = this.tableSelectInput();
|
|
818
781
|
if ($event?.length) {
|
|
819
|
-
|
|
782
|
+
tableSelectInput.display = await this.toDisplay()($event[0]);
|
|
820
783
|
this.value = $event[0];
|
|
821
|
-
|
|
784
|
+
tableSelectInput.setValue(this.value);
|
|
822
785
|
}
|
|
823
786
|
else {
|
|
824
787
|
this.value = null;
|
|
825
788
|
}
|
|
826
789
|
}
|
|
827
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
828
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
790
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
791
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.9", type: TableSelectControlDirective, isStandalone: true, selector: "mat-form-field[rxapTableSelectControl]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, openMethod: { classPropertyName: "openMethod", publicName: "openMethod", isSignal: true, isRequired: true, transformFunction: null }, dataInput: { classPropertyName: "dataInput", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columnsInput: { classPropertyName: "columnsInput", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, toValueInput: { classPropertyName: "toValueInput", publicName: "toValue", isSignal: true, isRequired: false, transformFunction: null }, toDisplayInput: { classPropertyName: "toDisplayInput", publicName: "toDisplay", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "openTableSelectWindow", predicate: OpenTableSelectWindowDirective, isSignal: true }, { propertyName: "tableSelectInput", first: true, predicate: TableSelectInputComponent, descendants: true, isSignal: true }, { propertyName: "matLabel", first: true, predicate: ["mat-label"], descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
829
792
|
};
|
|
830
793
|
TableSelectControlDirective = __decorate([
|
|
831
|
-
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectToValueMixin, ExtractTableSelectToDisplayMixin, ExtractTableSelectColumnMapMixin)
|
|
794
|
+
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectToValueMixin, ExtractTableSelectToDisplayMixin, ExtractTableSelectColumnMapMixin),
|
|
795
|
+
__metadata("design:paramtypes", [])
|
|
832
796
|
], TableSelectControlDirective);
|
|
833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableSelectControlDirective, decorators: [{
|
|
834
798
|
type: Directive,
|
|
835
799
|
args: [{
|
|
836
800
|
selector: 'mat-form-field[rxapTableSelectControl]',
|
|
837
801
|
standalone: true,
|
|
838
802
|
}]
|
|
839
|
-
}], propDecorators: { multiple: [{
|
|
840
|
-
type: Input
|
|
841
|
-
}], openMethod: [{
|
|
842
|
-
type: Input
|
|
843
|
-
}], data: [{
|
|
844
|
-
type: Input
|
|
845
|
-
}], columns: [{
|
|
846
|
-
type: Input
|
|
847
|
-
}], openTableSelectWindow: [{
|
|
848
|
-
type: ContentChildren,
|
|
849
|
-
args: [OpenTableSelectWindowDirective]
|
|
850
|
-
}], tableSelectInput: [{
|
|
851
|
-
type: ContentChild,
|
|
852
|
-
args: [TableSelectInputComponent]
|
|
853
|
-
}], matLabel: [{
|
|
854
|
-
type: ContentChild,
|
|
855
|
-
args: ['mat-label']
|
|
856
|
-
}], toValue: [{
|
|
857
|
-
type: Input
|
|
858
|
-
}], toDisplay: [{
|
|
859
|
-
type: Input
|
|
860
|
-
}] } });
|
|
861
|
-
|
|
862
|
-
class TableSelectControlModule {
|
|
863
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TableSelectControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
864
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.16", ngImport: i0, type: TableSelectControlModule, imports: [OpenTableSelectWindowDirective,
|
|
865
|
-
TableSelectControlDirective,
|
|
866
|
-
TableSelectInputComponent,
|
|
867
|
-
TableSelectWindowComponent], exports: [OpenTableSelectWindowDirective,
|
|
868
|
-
TableSelectControlDirective,
|
|
869
|
-
TableSelectInputComponent,
|
|
870
|
-
TableSelectWindowComponent] }); }
|
|
871
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TableSelectControlModule, providers: [
|
|
872
|
-
OpenTableSelectWindowMethod,
|
|
873
|
-
], imports: [TableSelectWindowComponent] }); }
|
|
874
|
-
}
|
|
875
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TableSelectControlModule, decorators: [{
|
|
876
|
-
type: NgModule,
|
|
877
|
-
args: [{
|
|
878
|
-
imports: [
|
|
879
|
-
OpenTableSelectWindowDirective,
|
|
880
|
-
TableSelectControlDirective,
|
|
881
|
-
TableSelectInputComponent,
|
|
882
|
-
TableSelectWindowComponent,
|
|
883
|
-
],
|
|
884
|
-
exports: [
|
|
885
|
-
OpenTableSelectWindowDirective,
|
|
886
|
-
TableSelectControlDirective,
|
|
887
|
-
TableSelectInputComponent,
|
|
888
|
-
TableSelectWindowComponent,
|
|
889
|
-
],
|
|
890
|
-
providers: [
|
|
891
|
-
OpenTableSelectWindowMethod,
|
|
892
|
-
],
|
|
893
|
-
}]
|
|
894
|
-
}] });
|
|
803
|
+
}], ctorParameters: () => [], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], openMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "openMethod", required: true }] }], dataInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columnsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], openTableSelectWindow: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => OpenTableSelectWindowDirective), { isSignal: true }] }], tableSelectInput: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TableSelectInputComponent), { isSignal: true }] }], matLabel: [{ type: i0.ContentChild, args: ['mat-label', { isSignal: true }] }], toValueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "toValue", required: false }] }], toDisplayInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "toDisplay", required: false }] }] } });
|
|
895
804
|
|
|
896
805
|
// region table-select-window
|
|
897
806
|
// endregion
|
|
@@ -900,5 +809,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
900
809
|
* Generated bundle index. Do not edit.
|
|
901
810
|
*/
|
|
902
811
|
|
|
903
|
-
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,
|
|
812
|
+
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 };
|
|
904
813
|
//# sourceMappingURL=rxap-ngx-material-table-select.mjs.map
|