@rxap/ngx-material-table-select 16.1.0-dev.4 → 16.1.0-dev.6
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 +10 -0
- package/README.md +1 -1
- package/esm2022/lib/derectives.mjs +31 -0
- package/esm2022/lib/extract-table-select-column-map.mixin.mjs +21 -0
- package/esm2022/lib/extract-table-select-data-source.mixin.mjs +13 -0
- package/esm2022/lib/extract-table-select-to-display.mixin.mjs +21 -0
- package/esm2022/lib/extract-table-select-to-value.mixin.mjs +21 -0
- package/esm2022/lib/open-table-select-window.directive.mjs +73 -20
- package/esm2022/lib/open-table-select-window.method.mjs +17 -10
- package/esm2022/lib/table-select-control.directive.mjs +29 -79
- package/esm2022/lib/table-select-control.module.mjs +18 -8
- package/esm2022/lib/table-select-input/table-select-input.component.mjs +44 -44
- package/esm2022/lib/table-select-window/table-select-window.component.mjs +7 -5
- package/fesm2022/rxap-ngx-material-table-select.mjs +260 -155
- package/fesm2022/rxap-ngx-material-table-select.mjs.map +1 -1
- package/lib/derectives.d.ts +17 -0
- package/lib/extract-table-select-column-map.mixin.d.ts +7 -0
- package/lib/extract-table-select-data-source.mixin.d.ts +7 -0
- package/lib/extract-table-select-to-display.mixin.d.ts +7 -0
- package/lib/extract-table-select-to-value.mixin.d.ts +7 -0
- package/lib/open-table-select-window.directive.d.ts +21 -11
- package/lib/open-table-select-window.method.d.ts +2 -1
- package/lib/table-select-control.directive.d.ts +10 -10
- package/lib/table-select-control.module.d.ts +3 -1
- package/lib/table-select-input/table-select-input.component.d.ts +9 -9
- package/package.json +24 -18
- package/theme.css +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NgIf, NgFor, NgSwitch, NgSwitchCase, NgSwitchDefault, AsyncPipe, KeyValuePipe, NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Component, ChangeDetectionStrategy, Inject, forwardRef, Optional, Self, HostBinding, Input, Injector, INJECTOR, Injectable, EventEmitter, isDevMode, Directive, Output, HostListener, ContentChildren, ContentChild, NgModule } from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, Inject, forwardRef, Optional, Self, HostBinding, Input, Injector, INJECTOR, Injectable, EventEmitter, inject, isDevMode, Directive, Output, HostListener, ContentChildren, ContentChild, NgModule } from '@angular/core';
|
|
4
4
|
import * as i7 from '@angular/forms';
|
|
5
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
6
6
|
import * as i8 from '@angular/material/button';
|
|
7
|
-
import { MatButtonModule, MatButton
|
|
7
|
+
import { MatButtonModule, MatButton } from '@angular/material/button';
|
|
8
8
|
import * as i5 from '@angular/material/form-field';
|
|
9
9
|
import { MatFormFieldModule, MatFormFieldControl, MatFormField } from '@angular/material/form-field';
|
|
10
10
|
import * as i9 from '@angular/material/icon';
|
|
@@ -20,25 +20,25 @@ import { MatSortModule } from '@angular/material/sort';
|
|
|
20
20
|
import * as i3 from '@angular/material/table';
|
|
21
21
|
import { MatTableModule } from '@angular/material/table';
|
|
22
22
|
import { ParentControlContainerDirective, ControlValueAccessor, RxapFormControl, RxapFormGroup } from '@rxap/forms';
|
|
23
|
+
import { FormFieldNoPaddingDirective } from '@rxap/material-directives/form-field';
|
|
23
24
|
import { InputClearButtonDirective } from '@rxap/material-form-system';
|
|
24
25
|
import * as i1 from '@rxap/material-table-system';
|
|
25
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';
|
|
26
27
|
import { GetFromObjectPipe } from '@rxap/pipes';
|
|
27
28
|
import * as i1$1 from '@rxap/window-system';
|
|
28
|
-
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, WindowFooterDirective, RXAP_WINDOW_SETTINGS } from '@rxap/window-system';
|
|
29
|
+
import { RXAP_WINDOW_DATA, RXAP_WINDOW_REF, WindowFooterDirective, RXAP_WINDOW_SETTINGS, WindowService } from '@rxap/window-system';
|
|
29
30
|
import { map, tap } from 'rxjs/operators';
|
|
30
31
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
31
|
-
import { Subject, Subscription, startWith, delay
|
|
32
|
-
import { UseDataSource, RxapFormSystemError } from '@rxap/form-system';
|
|
32
|
+
import { Subject, Subscription, startWith, delay } from 'rxjs';
|
|
33
|
+
import { UseDataSource, RxapFormSystemError, ExtractFormDefinitionMixin, ExtractControlMixin } from '@rxap/form-system';
|
|
33
34
|
import { setMetadataMap, getMetadata } from '@rxap/reflect-metadata';
|
|
34
|
-
import
|
|
35
|
-
import { staticDataSource,
|
|
35
|
+
import { __decorate } from 'tslib';
|
|
36
|
+
import { staticDataSource, DataSourceLoader, BaseDataSource } from '@rxap/data-source';
|
|
37
|
+
import { Mixin } from '@rxap/mixin';
|
|
36
38
|
import { GenerateRandomString, coerceArray } from '@rxap/utilities';
|
|
37
|
-
import { TableDataSource, AbstractTableDataSource } from '@rxap/data-source/table';
|
|
38
|
-
import '@rxap/rxjs';
|
|
39
|
-
import { __decorate, __metadata } from 'tslib';
|
|
40
39
|
import { ExtractDatasourceMixin } from '@rxap/material-table-window-system';
|
|
41
|
-
import
|
|
40
|
+
import '@rxap/rxjs';
|
|
41
|
+
import { TableDataSource, AbstractTableDataSource } from '@rxap/data-source/table';
|
|
42
42
|
|
|
43
43
|
class TableSelectWindowComponent {
|
|
44
44
|
constructor(data, selectRows, windowRef) {
|
|
@@ -68,10 +68,10 @@ class TableSelectWindowComponent {
|
|
|
68
68
|
this.windowRef.next(this.selectRows.selectedRows);
|
|
69
69
|
this.close();
|
|
70
70
|
}
|
|
71
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
72
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableSelectWindowComponent, isStandalone: true, selector: "rxap-table-select-window", providers: [SelectRowService, TableFilterService], ngImport: i0, template: "<mat-progress-bar *ngIf=\"tableDataSourceDirective.loading$ | async\" mode=\"indeterminate\"></mat-progress-bar>\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>\n <th *matHeaderCellDef mat-header-cell rxap-checkbox-header-cell></th>\n <td\n *matCellDef=\"let element\"\n [element]=\"element\"\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 i18n-placeholder\n matInput\n parentControlContainer\n />\n <button type=\"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 mat-row\n ></tr>\n\n</table>\n\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: ["sticky", "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: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "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"], 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] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], 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: ["disabled"], 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" }], animations: [RowAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectWindowComponent, deps: [{ token: RXAP_WINDOW_DATA }, { token: i1.SelectRowService }, { token: RXAP_WINDOW_REF }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableSelectWindowComponent, isStandalone: true, selector: "rxap-table-select-window", providers: [SelectRowService, TableFilterService], 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: ["sticky", "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: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "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"], 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] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], 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: ["disabled"], 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 }); }
|
|
73
73
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectWindowComponent, decorators: [{
|
|
75
75
|
type: Component,
|
|
76
76
|
args: [{ selector: 'rxap-table-select-window', changeDetection: ChangeDetectionStrategy.OnPush, animations: [RowAnimation], providers: [SelectRowService, TableFilterService], standalone: true, imports: [
|
|
77
77
|
NgIf,
|
|
@@ -101,7 +101,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
101
101
|
AsyncPipe,
|
|
102
102
|
KeyValuePipe,
|
|
103
103
|
GetFromObjectPipe,
|
|
104
|
-
|
|
104
|
+
FormFieldNoPaddingDirective,
|
|
105
|
+
], 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"] }]
|
|
105
106
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
106
107
|
type: Inject,
|
|
107
108
|
args: [RXAP_WINDOW_DATA]
|
|
@@ -112,41 +113,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
112
113
|
|
|
113
114
|
class TableSelectInputComponent extends ControlValueAccessor {
|
|
114
115
|
static { this.nextId = 0; }
|
|
115
|
-
constructor(ngControl, cdr) {
|
|
116
|
-
super();
|
|
117
|
-
this.ngControl = ngControl;
|
|
118
|
-
this.cdr = cdr;
|
|
119
|
-
this.id = `rxap-table-select-input-${TableSelectInputComponent.nextId++}`;
|
|
120
|
-
this.stateChanges = new Subject();
|
|
121
|
-
this.control = null;
|
|
122
|
-
this.rxapControl = null;
|
|
123
|
-
this.focused = false;
|
|
124
|
-
this._subscription = new Subscription();
|
|
125
|
-
this._disabled = false;
|
|
126
|
-
this._required = false;
|
|
127
|
-
this._value = null;
|
|
128
|
-
this._placeholder = '';
|
|
129
|
-
// Replace the provider from above with this.
|
|
130
|
-
if (this.ngControl != null) {
|
|
131
|
-
// Setting the value accessor directly (instead of using
|
|
132
|
-
// the providers) to avoid running into a circular import.
|
|
133
|
-
this.ngControl.valueAccessor = this;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
116
|
get empty() {
|
|
137
117
|
return this._value === null;
|
|
138
118
|
}
|
|
139
119
|
get shouldLabelFloat() {
|
|
140
120
|
return this.focused || !this.empty;
|
|
141
121
|
}
|
|
142
|
-
get errorState() {
|
|
143
|
-
return this.ngControl?.invalid || false;
|
|
144
|
-
}
|
|
145
|
-
get disabled() { return this._disabled; }
|
|
146
|
-
set disabled(value) {
|
|
147
|
-
this._disabled = coerceBooleanProperty(value);
|
|
148
|
-
this.stateChanges.next();
|
|
149
|
-
}
|
|
150
122
|
get required() {
|
|
151
123
|
return this._required;
|
|
152
124
|
}
|
|
@@ -154,13 +126,14 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
154
126
|
this._required = coerceBooleanProperty(req);
|
|
155
127
|
this.stateChanges.next();
|
|
156
128
|
}
|
|
157
|
-
get
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
set value(value) {
|
|
161
|
-
this._value = value;
|
|
129
|
+
get disabled() { return this._disabled; }
|
|
130
|
+
set disabled(value) {
|
|
131
|
+
this._disabled = coerceBooleanProperty(value);
|
|
162
132
|
this.stateChanges.next();
|
|
163
133
|
}
|
|
134
|
+
get errorState() {
|
|
135
|
+
return this.ngControl?.invalid || false;
|
|
136
|
+
}
|
|
164
137
|
get placeholder() {
|
|
165
138
|
return this._placeholder;
|
|
166
139
|
}
|
|
@@ -168,6 +141,34 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
168
141
|
this._placeholder = placeholder;
|
|
169
142
|
this.stateChanges.next();
|
|
170
143
|
}
|
|
144
|
+
set value(value) {
|
|
145
|
+
this._value = value;
|
|
146
|
+
this.stateChanges.next();
|
|
147
|
+
}
|
|
148
|
+
get value() {
|
|
149
|
+
return this._value;
|
|
150
|
+
}
|
|
151
|
+
constructor(ngControl, cdr) {
|
|
152
|
+
super();
|
|
153
|
+
this.ngControl = ngControl;
|
|
154
|
+
this.cdr = cdr;
|
|
155
|
+
this.id = `rxap-table-select-input-${TableSelectInputComponent.nextId++}`;
|
|
156
|
+
this.stateChanges = new Subject();
|
|
157
|
+
this.control = null;
|
|
158
|
+
this.rxapControl = null;
|
|
159
|
+
this.focused = false;
|
|
160
|
+
this._subscription = new Subscription();
|
|
161
|
+
this._disabled = false;
|
|
162
|
+
this._required = false;
|
|
163
|
+
this._value = null;
|
|
164
|
+
this._placeholder = '';
|
|
165
|
+
// Replace the provider from above with this.
|
|
166
|
+
if (this.ngControl != null) {
|
|
167
|
+
// Setting the value accessor directly (instead of using
|
|
168
|
+
// the providers) to avoid running into a circular import.
|
|
169
|
+
this.ngControl.valueAccessor = this;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
171
172
|
get display() {
|
|
172
173
|
return this._display;
|
|
173
174
|
}
|
|
@@ -206,28 +207,28 @@ class TableSelectInputComponent extends ControlValueAccessor {
|
|
|
206
207
|
this.stateChanges.complete();
|
|
207
208
|
this._subscription?.unsubscribe();
|
|
208
209
|
}
|
|
209
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
210
210
|
setDescribedByIds(ids) {
|
|
211
|
+
// no op
|
|
211
212
|
}
|
|
212
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
213
213
|
onContainerClick(event) {
|
|
214
|
+
// no op
|
|
214
215
|
}
|
|
215
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
216
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
216
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectInputComponent, deps: [{ token: i7.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
217
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableSelectInputComponent, isStandalone: true, selector: "rxap-table-select-input", inputs: { required: "required", disabled: "disabled", placeholder: "placeholder" }, host: { properties: { "id": "this.id", "class.floating": "this.shouldLabelFloat" } }, providers: [
|
|
217
218
|
{
|
|
218
219
|
provide: MatFormFieldControl,
|
|
219
220
|
useExisting: forwardRef(() => TableSelectInputComponent),
|
|
220
221
|
},
|
|
221
|
-
], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n <span *ngIf=\"display || placeholder\">{{display ?? placeholder}}</span>\n</div>\n", styles: [":host{display:inline-block;width:100%;outline:none}.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"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
222
|
+
], usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n <span *ngIf=\"display || placeholder\">{{display ?? placeholder}}</span>\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"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
222
223
|
}
|
|
223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectInputComponent, decorators: [{
|
|
224
225
|
type: Component,
|
|
225
226
|
args: [{ selector: 'rxap-table-select-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
226
227
|
{
|
|
227
228
|
provide: MatFormFieldControl,
|
|
228
229
|
useExisting: forwardRef(() => TableSelectInputComponent),
|
|
229
230
|
},
|
|
230
|
-
], standalone: true, imports: [NgClass, NgIf], template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n <span *ngIf=\"display || placeholder\">{{display ?? placeholder}}</span>\n</div>\n", styles: [":host{display:inline-block;width:100%;outline:none}.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"] }]
|
|
231
|
+
], standalone: true, imports: [NgClass, NgIf], template: "<div [ngClass]=\"{ disabled: disabled }\" class=\"mat-select-trigger\">\n <span *ngIf=\"display || placeholder\">{{display ?? placeholder}}</span>\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"] }]
|
|
231
232
|
}], ctorParameters: function () { return [{ type: i7.NgControl, decorators: [{
|
|
232
233
|
type: Optional
|
|
233
234
|
}, {
|
|
@@ -237,14 +238,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
237
238
|
}], shouldLabelFloat: [{
|
|
238
239
|
type: HostBinding,
|
|
239
240
|
args: ['class.floating']
|
|
240
|
-
}], disabled: [{
|
|
241
|
-
type: Input
|
|
242
241
|
}], required: [{
|
|
243
242
|
type: Input
|
|
243
|
+
}], disabled: [{
|
|
244
|
+
type: Input
|
|
244
245
|
}], placeholder: [{
|
|
245
246
|
type: Input
|
|
246
247
|
}] } });
|
|
247
248
|
|
|
249
|
+
const TABLE_SELECT_COLUMN_MAP$1 = 'TABLE_SELECT_COLUMN_MAP';
|
|
250
|
+
const TABLE_SELECT_TO_DISPLAY$1 = 'TABLE_SELECT_TO_DISPLAY';
|
|
251
|
+
const TABLE_SELECT_TO_VALUE$1 = 'TABLE_SELECT_TO_VALUE';
|
|
252
|
+
const TABLE_SELECT_METHOD$1 = 'TABLE_SELECT_TO_VALUE';
|
|
253
|
+
const TABLE_SELECT_DATA_SOURCE$1 = 'TABLE_SELECT_DATA_SOURCE';
|
|
254
|
+
function UseTableSelectColumns$1(columnMap) {
|
|
255
|
+
return function (target, propertyKey) {
|
|
256
|
+
setMetadataMap(propertyKey, columnMap, TABLE_SELECT_COLUMN_MAP$1, target);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function UseTableSelectDataSource$1(dataSource, settings) {
|
|
260
|
+
return UseDataSource(dataSource, TABLE_SELECT_DATA_SOURCE$1, settings);
|
|
261
|
+
}
|
|
262
|
+
function UseTableSelectToDisplay$1(toDisplay) {
|
|
263
|
+
return function (target, propertyKey) {
|
|
264
|
+
setMetadataMap(propertyKey, toDisplay, TABLE_SELECT_TO_DISPLAY$1, target);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function UseTableSelectToValue$1(toValue) {
|
|
268
|
+
return function (target, propertyKey) {
|
|
269
|
+
setMetadataMap(propertyKey, toValue, TABLE_SELECT_TO_VALUE$1, target);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function UseTableSelectMethod$1(method) {
|
|
273
|
+
return function (target, propertyKey) {
|
|
274
|
+
setMetadataMap(propertyKey, method, TABLE_SELECT_METHOD$1, target);
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
248
278
|
const TABLE_SELECT_COLUMN_MAP = 'TABLE_SELECT_COLUMN_MAP';
|
|
249
279
|
const TABLE_SELECT_TO_DISPLAY = 'TABLE_SELECT_TO_DISPLAY';
|
|
250
280
|
const TABLE_SELECT_TO_VALUE = 'TABLE_SELECT_TO_VALUE';
|
|
@@ -274,6 +304,47 @@ function UseTableSelectMethod(method) {
|
|
|
274
304
|
};
|
|
275
305
|
}
|
|
276
306
|
|
|
307
|
+
let ExtractTableSelectColumnMapMixin = class ExtractTableSelectColumnMapMixin {
|
|
308
|
+
extractTableSelectColumnMap(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
309
|
+
const map = getMetadata(TABLE_SELECT_COLUMN_MAP, Object.getPrototypeOf(formDefinition));
|
|
310
|
+
if (!map) {
|
|
311
|
+
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
312
|
+
}
|
|
313
|
+
if (!map.has(control.controlId)) {
|
|
314
|
+
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
315
|
+
}
|
|
316
|
+
return map.get(control.controlId);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
ExtractTableSelectColumnMapMixin = __decorate([
|
|
320
|
+
Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)
|
|
321
|
+
], ExtractTableSelectColumnMapMixin);
|
|
322
|
+
|
|
323
|
+
let ExtractTableSelectDataSourceMixin = class ExtractTableSelectDataSourceMixin {
|
|
324
|
+
extractTableSelectDataSource() {
|
|
325
|
+
return this.extractDatasource(TABLE_SELECT_DATA_SOURCE);
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
ExtractTableSelectDataSourceMixin = __decorate([
|
|
329
|
+
Mixin(ExtractDatasourceMixin)
|
|
330
|
+
], ExtractTableSelectDataSourceMixin);
|
|
331
|
+
|
|
332
|
+
let ExtractTableSelectToValueMixin = class ExtractTableSelectToValueMixin {
|
|
333
|
+
extractTableSelectToValue(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
334
|
+
const map = getMetadata(TABLE_SELECT_TO_VALUE, Object.getPrototypeOf(formDefinition));
|
|
335
|
+
if (!map) {
|
|
336
|
+
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
337
|
+
}
|
|
338
|
+
if (!map.has(control.controlId)) {
|
|
339
|
+
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
340
|
+
}
|
|
341
|
+
return map.get(control.controlId);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
ExtractTableSelectToValueMixin = __decorate([
|
|
345
|
+
Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)
|
|
346
|
+
], ExtractTableSelectToValueMixin);
|
|
347
|
+
|
|
277
348
|
function CreateFilterFormProvider(columns) {
|
|
278
349
|
const columnNameList = Array.from(columns.entries())
|
|
279
350
|
.filter(([key, column]) => column.filter)
|
|
@@ -299,7 +370,7 @@ class OpenTableSelectWindowMethod {
|
|
|
299
370
|
this.windowService = windowService;
|
|
300
371
|
this.injector = injector;
|
|
301
372
|
}
|
|
302
|
-
call(parameters) {
|
|
373
|
+
async call(parameters) {
|
|
303
374
|
const providers = [
|
|
304
375
|
{
|
|
305
376
|
provide: RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS,
|
|
@@ -344,7 +415,7 @@ class OpenTableSelectWindowMethod {
|
|
|
344
415
|
provide: RXAP_WINDOW_SETTINGS,
|
|
345
416
|
useValue: null,
|
|
346
417
|
});
|
|
347
|
-
providers.push(
|
|
418
|
+
providers.push(this.createFilterForm(parameters.columns));
|
|
348
419
|
const windowRef = this.windowService.open({
|
|
349
420
|
...parameters.windowConfig,
|
|
350
421
|
viewContainerRef: parameters.viewContainerRef,
|
|
@@ -356,31 +427,45 @@ class OpenTableSelectWindowMethod {
|
|
|
356
427
|
data: parameters,
|
|
357
428
|
component: TableSelectWindowComponent,
|
|
358
429
|
});
|
|
359
|
-
return
|
|
430
|
+
return new Promise((resolve, reject) => {
|
|
431
|
+
windowRef.subscribe({
|
|
432
|
+
next: data => resolve(data ?? []),
|
|
433
|
+
error: error => reject(error),
|
|
434
|
+
complete: () => resolve([]),
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
createFilterForm(columns) {
|
|
439
|
+
return CreateFilterFormProvider(columns);
|
|
360
440
|
}
|
|
361
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
362
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OpenTableSelectWindowMethod, deps: [{ token: i1$1.WindowService }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
442
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OpenTableSelectWindowMethod }); }
|
|
363
443
|
}
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OpenTableSelectWindowMethod, decorators: [{
|
|
365
445
|
type: Injectable
|
|
366
446
|
}], ctorParameters: function () { return [{ type: i1$1.WindowService }, { type: i0.Injector, decorators: [{
|
|
367
447
|
type: Inject,
|
|
368
448
|
args: [INJECTOR]
|
|
369
449
|
}] }]; } });
|
|
370
450
|
|
|
371
|
-
class OpenTableSelectWindowDirective {
|
|
372
|
-
constructor(
|
|
373
|
-
this.openMethod = openMethod;
|
|
374
|
-
this.windowService = windowService;
|
|
375
|
-
this.injector = injector;
|
|
451
|
+
let OpenTableSelectWindowDirective = class OpenTableSelectWindowDirective {
|
|
452
|
+
constructor() {
|
|
376
453
|
this.selected = [];
|
|
377
454
|
this.selectedChange = new EventEmitter();
|
|
455
|
+
this._internalId = GenerateRandomString();
|
|
378
456
|
this.type = 'button';
|
|
457
|
+
// required for the use mixin ExtractDatasourceMixin
|
|
458
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
379
459
|
this._hasOpenWindow = false;
|
|
460
|
+
this.openMethod = inject(OpenTableSelectWindowMethod);
|
|
461
|
+
this.windowService = inject(WindowService);
|
|
462
|
+
this.injector = inject(INJECTOR);
|
|
463
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
380
464
|
this.invalidInputs = false;
|
|
381
|
-
this.matButton = null;
|
|
382
|
-
this._internalId = GenerateRandomString();
|
|
383
465
|
this._disabled = false;
|
|
466
|
+
this.toValue = (value) => {
|
|
467
|
+
return value;
|
|
468
|
+
};
|
|
384
469
|
}
|
|
385
470
|
get disabled() {
|
|
386
471
|
return this._disabled || this.invalidInputs;
|
|
@@ -392,7 +477,6 @@ class OpenTableSelectWindowDirective {
|
|
|
392
477
|
this.checkInputs();
|
|
393
478
|
}
|
|
394
479
|
ngOnInit() {
|
|
395
|
-
this.matButton = this.injector.get(MatButton, this.injector.get(MatIconButton, this.injector.get(MatMiniFabButton, this.injector.get(MatFabButton, null))));
|
|
396
480
|
this.checkInputs();
|
|
397
481
|
}
|
|
398
482
|
ngOnDestroy() {
|
|
@@ -401,13 +485,17 @@ class OpenTableSelectWindowDirective {
|
|
|
401
485
|
}
|
|
402
486
|
}
|
|
403
487
|
async onClick($event) {
|
|
488
|
+
$event.stopPropagation();
|
|
404
489
|
if (this.disabled || this._hasOpenWindow) {
|
|
490
|
+
console.debug('disabled or has open window', { disabled: this.disabled, hasOpenWindow: this._hasOpenWindow });
|
|
405
491
|
return;
|
|
406
492
|
}
|
|
407
|
-
$event.stopPropagation();
|
|
408
493
|
if (!this.data || !this.columns) {
|
|
409
494
|
throw new Error('FATAL: The data or columns input is not set');
|
|
410
495
|
}
|
|
496
|
+
setTimeout(() => {
|
|
497
|
+
this.control.disable();
|
|
498
|
+
});
|
|
411
499
|
const selected = await this.openMethod.call({
|
|
412
500
|
windowConfig: {
|
|
413
501
|
id: this._internalId,
|
|
@@ -421,12 +509,43 @@ class OpenTableSelectWindowDirective {
|
|
|
421
509
|
id: this.id ?? GenerateRandomString(10),
|
|
422
510
|
parameters: this.parameters,
|
|
423
511
|
});
|
|
512
|
+
this.control.enable();
|
|
424
513
|
if (isDevMode()) {
|
|
425
514
|
console.debug('selected', selected);
|
|
426
515
|
}
|
|
427
516
|
this.selected = selected ?? [];
|
|
428
517
|
this._hasOpenWindow = false;
|
|
429
518
|
this.selectedChange.emit(this.selected);
|
|
519
|
+
if (this.selected.length) {
|
|
520
|
+
this.control?.setValue(this.toValue(this.selected[0]));
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
this.control?.reset();
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
ngAfterViewInit() {
|
|
527
|
+
const hasNgControl = !!this.injector.get(NgControl, null);
|
|
528
|
+
const hasMatFormField = !!this.injector.get(MatFormField, null);
|
|
529
|
+
if (hasMatFormField || hasNgControl) {
|
|
530
|
+
this.matFormField = this.injector.get(MatFormField);
|
|
531
|
+
this.ngControl = this.matFormField._control.ngControl;
|
|
532
|
+
this.control ??= this.ngControl?.control ?? null;
|
|
533
|
+
this.data ??= this.extractTableSelectDataSource();
|
|
534
|
+
this.columns ??= this.extractTableSelectColumnMap();
|
|
535
|
+
try {
|
|
536
|
+
this.toValue = this.extractTableSelectToValue() ?? this.toValue;
|
|
537
|
+
}
|
|
538
|
+
catch (e) {
|
|
539
|
+
console.log('HACKING WORKAROUND', e);
|
|
540
|
+
}
|
|
541
|
+
if (this.control) {
|
|
542
|
+
this.disabled = this.control.disabled;
|
|
543
|
+
this.control.registerOnDisabledChange(isDisabled => {
|
|
544
|
+
this.disabled = isDisabled;
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
this.checkInputs();
|
|
430
549
|
}
|
|
431
550
|
checkInputs() {
|
|
432
551
|
if (!this.columns || !this.data) {
|
|
@@ -449,16 +568,20 @@ class OpenTableSelectWindowDirective {
|
|
|
449
568
|
}
|
|
450
569
|
}
|
|
451
570
|
}
|
|
452
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
453
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
454
|
-
}
|
|
455
|
-
|
|
571
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OpenTableSelectWindowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
572
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: OpenTableSelectWindowDirective, isStandalone: true, selector: "[rxapOpenTableSelectWindow]", inputs: { data: "data", columns: "columns", selected: "selected", parameters: "parameters", label: "label", id: "id", compareWith: "compareWith", toValue: "toValue" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "click": "onClick($event)" }, properties: { "type": "this.type", "disabled": "this.disabled" } }, providers: [OpenTableSelectWindowMethod], usesOnChanges: true, ngImport: i0 }); }
|
|
573
|
+
};
|
|
574
|
+
OpenTableSelectWindowDirective = __decorate([
|
|
575
|
+
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectColumnMapMixin, ExtractTableSelectToValueMixin)
|
|
576
|
+
], OpenTableSelectWindowDirective);
|
|
577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OpenTableSelectWindowDirective, decorators: [{
|
|
456
578
|
type: Directive,
|
|
457
579
|
args: [{
|
|
458
580
|
selector: '[rxapOpenTableSelectWindow]',
|
|
459
581
|
standalone: true,
|
|
582
|
+
providers: [OpenTableSelectWindowMethod],
|
|
460
583
|
}]
|
|
461
|
-
}],
|
|
584
|
+
}], propDecorators: { data: [{
|
|
462
585
|
type: Input
|
|
463
586
|
}], columns: [{
|
|
464
587
|
type: Input
|
|
@@ -477,21 +600,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
477
600
|
}], type: [{
|
|
478
601
|
type: HostBinding,
|
|
479
602
|
args: ['type']
|
|
603
|
+
}], disabled: [{
|
|
604
|
+
type: HostBinding,
|
|
605
|
+
args: ['disabled']
|
|
606
|
+
}], toValue: [{
|
|
607
|
+
type: Input
|
|
480
608
|
}], onClick: [{
|
|
481
609
|
type: HostListener,
|
|
482
610
|
args: ['click', ['$event']]
|
|
483
611
|
}] } });
|
|
484
612
|
|
|
613
|
+
let ExtractTableSelectToDisplayMixin = class ExtractTableSelectToDisplayMixin {
|
|
614
|
+
extractTableSelectToDisplay(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
615
|
+
const map = getMetadata(TABLE_SELECT_TO_DISPLAY, Object.getPrototypeOf(formDefinition));
|
|
616
|
+
if (!map) {
|
|
617
|
+
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
618
|
+
}
|
|
619
|
+
if (!map.has(control.controlId)) {
|
|
620
|
+
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
621
|
+
}
|
|
622
|
+
return map.get(control.controlId);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
ExtractTableSelectToDisplayMixin = __decorate([
|
|
626
|
+
Mixin(ExtractFormDefinitionMixin, ExtractControlMixin)
|
|
627
|
+
], ExtractTableSelectToDisplayMixin);
|
|
628
|
+
|
|
485
629
|
let TableSelectControlDirective = class TableSelectControlDirective {
|
|
486
|
-
constructor(
|
|
487
|
-
// required for the use mixin ExtractDatasourceMixin
|
|
488
|
-
dataSourceLoader, matFormField) {
|
|
489
|
-
this.injector = injector;
|
|
490
|
-
this.dataSourceLoader = dataSourceLoader;
|
|
491
|
-
this.matFormField = matFormField;
|
|
630
|
+
constructor() {
|
|
492
631
|
this.ngControl = null;
|
|
493
632
|
this.value = null;
|
|
633
|
+
this.injector = inject(INJECTOR);
|
|
634
|
+
// required for the use mixin ExtractDatasourceMixin
|
|
635
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
494
636
|
this.disabled = false;
|
|
637
|
+
this.matFormField = null;
|
|
495
638
|
this._subscription = new Subscription();
|
|
496
639
|
this.toDisplay = value => value;
|
|
497
640
|
}
|
|
@@ -508,25 +651,18 @@ let TableSelectControlDirective = class TableSelectControlDirective {
|
|
|
508
651
|
}
|
|
509
652
|
}
|
|
510
653
|
ngAfterViewInit() {
|
|
511
|
-
this.
|
|
654
|
+
this.matFormField = this.injector.get(MatFormField, null);
|
|
655
|
+
if (!this.matFormField) {
|
|
656
|
+
throw new Error('The mat form field could not be injected');
|
|
657
|
+
}
|
|
658
|
+
this.ngControl = this.matFormField._control.ngControl;
|
|
512
659
|
if (this.ngControl) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
this.data =
|
|
520
|
-
this.extractDatasource(TABLE_SELECT_DATA_SOURCE, this.control = control);
|
|
521
|
-
this.toDisplay = this.extractTableSelectToDisplay(this.control = control) ?? this.toDisplay;
|
|
522
|
-
this.toValue = this.extractTableSelectToValue(this.control = control);
|
|
523
|
-
this.columns = this.extractTableSelectColumnMap(this.control = control);
|
|
524
|
-
this.updateOpenTableSelectWindow();
|
|
525
|
-
this._subscription?.add(control.disabled$.pipe(tap(disabled => this.disabled = disabled), tap(() => this.updateOpenTableSelectWindowDisabledState())).subscribe());
|
|
526
|
-
}
|
|
527
|
-
else {
|
|
528
|
-
console.warn('The control in the ControlContainer is not a RxapFormControl. Can not extract the data source');
|
|
529
|
-
}
|
|
660
|
+
this.data = this.extractTableSelectDataSource();
|
|
661
|
+
this.toDisplay = this.extractTableSelectToDisplay() ?? this.toDisplay;
|
|
662
|
+
this.toValue = this.extractTableSelectToValue() ?? this.toValue;
|
|
663
|
+
this.columns = this.extractTableSelectColumnMap();
|
|
664
|
+
this.updateOpenTableSelectWindow();
|
|
665
|
+
this._subscription?.add(this.control.disabled$.pipe(tap(disabled => this.disabled = disabled), tap(() => this.updateOpenTableSelectWindowDisabledState())).subscribe());
|
|
530
666
|
}
|
|
531
667
|
else {
|
|
532
668
|
if (isDevMode()) {
|
|
@@ -594,58 +730,19 @@ let TableSelectControlDirective = class TableSelectControlDirective {
|
|
|
594
730
|
this.value = null;
|
|
595
731
|
}
|
|
596
732
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
const formDefinition = this.extractFormDefinition(control);
|
|
600
|
-
const map = getMetadata(TABLE_SELECT_COLUMN_MAP, Object.getPrototypeOf(formDefinition));
|
|
601
|
-
if (!map) {
|
|
602
|
-
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
603
|
-
}
|
|
604
|
-
if (!map.has(control.controlId)) {
|
|
605
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
606
|
-
}
|
|
607
|
-
return map.get(control.controlId);
|
|
608
|
-
}
|
|
609
|
-
extractTableSelectToDisplay(control = this.control) {
|
|
610
|
-
// TODO : create utility function to extract metadata for a specific control
|
|
611
|
-
const formDefinition = this.extractFormDefinition(control);
|
|
612
|
-
const map = getMetadata(TABLE_SELECT_TO_DISPLAY, Object.getPrototypeOf(formDefinition));
|
|
613
|
-
if (!map) {
|
|
614
|
-
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
615
|
-
}
|
|
616
|
-
if (!map.has(control.controlId)) {
|
|
617
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
618
|
-
}
|
|
619
|
-
return map.get(control.controlId);
|
|
620
|
-
}
|
|
621
|
-
extractTableSelectToValue(control = this.control) {
|
|
622
|
-
// TODO : create utility function to extract metadata for a specific control
|
|
623
|
-
const formDefinition = this.extractFormDefinition(control);
|
|
624
|
-
const map = getMetadata(TABLE_SELECT_TO_VALUE, Object.getPrototypeOf(formDefinition));
|
|
625
|
-
if (!map) {
|
|
626
|
-
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
627
|
-
}
|
|
628
|
-
if (!map.has(control.controlId)) {
|
|
629
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
630
|
-
}
|
|
631
|
-
return map.get(control.controlId);
|
|
632
|
-
}
|
|
633
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableSelectControlDirective, deps: [{ token: i0.Injector }, { token: i1$2.DataSourceLoader }, { token: i5.MatFormField }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
634
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableSelectControlDirective, isStandalone: true, selector: "mat-form-field[rxapTableSelectControl]", inputs: { multiple: "multiple", openMethod: "openMethod", data: "data", columns: "columns", toValue: "toValue", toDisplay: "toDisplay" }, queries: [{ propertyName: "tableSelectInput", first: true, predicate: TableSelectInputComponent, descendants: true }, { propertyName: "matLabel", first: true, predicate: ["mat-label"], descendants: true }, { propertyName: "openTableSelectWindow", predicate: OpenTableSelectWindowDirective }], usesOnChanges: true, ngImport: i0 }); }
|
|
733
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
734
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TableSelectControlDirective, isStandalone: true, selector: "mat-form-field[rxapTableSelectControl]", inputs: { multiple: "multiple", openMethod: "openMethod", data: "data", columns: "columns", toValue: "toValue", toDisplay: "toDisplay" }, queries: [{ propertyName: "tableSelectInput", first: true, predicate: TableSelectInputComponent, descendants: true }, { propertyName: "matLabel", first: true, predicate: ["mat-label"], descendants: true }, { propertyName: "openTableSelectWindow", predicate: OpenTableSelectWindowDirective }], usesOnChanges: true, ngImport: i0 }); }
|
|
635
735
|
};
|
|
636
736
|
TableSelectControlDirective = __decorate([
|
|
637
|
-
Mixin(
|
|
638
|
-
__metadata("design:paramtypes", [Injector,
|
|
639
|
-
DataSourceLoader,
|
|
640
|
-
MatFormField])
|
|
737
|
+
Mixin(ExtractTableSelectDataSourceMixin, ExtractTableSelectToValueMixin, ExtractTableSelectToDisplayMixin, ExtractTableSelectColumnMapMixin)
|
|
641
738
|
], TableSelectControlDirective);
|
|
642
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlDirective, decorators: [{
|
|
643
740
|
type: Directive,
|
|
644
741
|
args: [{
|
|
645
742
|
selector: 'mat-form-field[rxapTableSelectControl]',
|
|
646
743
|
standalone: true,
|
|
647
744
|
}]
|
|
648
|
-
}],
|
|
745
|
+
}], propDecorators: { multiple: [{
|
|
649
746
|
type: Input
|
|
650
747
|
}], openMethod: [{
|
|
651
748
|
type: Input
|
|
@@ -669,24 +766,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
669
766
|
}] } });
|
|
670
767
|
|
|
671
768
|
class TableSelectControlModule {
|
|
672
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
673
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.
|
|
674
|
-
TableSelectControlDirective
|
|
675
|
-
|
|
676
|
-
|
|
769
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
770
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlModule, imports: [OpenTableSelectWindowDirective,
|
|
771
|
+
TableSelectControlDirective,
|
|
772
|
+
TableSelectInputComponent,
|
|
773
|
+
TableSelectWindowComponent], exports: [OpenTableSelectWindowDirective,
|
|
774
|
+
TableSelectControlDirective,
|
|
775
|
+
TableSelectInputComponent,
|
|
776
|
+
TableSelectWindowComponent] }); }
|
|
777
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlModule, providers: [
|
|
677
778
|
OpenTableSelectWindowMethod,
|
|
678
|
-
] }); }
|
|
779
|
+
], imports: [TableSelectWindowComponent] }); }
|
|
679
780
|
}
|
|
680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableSelectControlModule, decorators: [{
|
|
681
782
|
type: NgModule,
|
|
682
783
|
args: [{
|
|
683
784
|
imports: [
|
|
684
785
|
OpenTableSelectWindowDirective,
|
|
685
786
|
TableSelectControlDirective,
|
|
787
|
+
TableSelectInputComponent,
|
|
788
|
+
TableSelectWindowComponent,
|
|
686
789
|
],
|
|
687
790
|
exports: [
|
|
688
791
|
OpenTableSelectWindowDirective,
|
|
689
792
|
TableSelectControlDirective,
|
|
793
|
+
TableSelectInputComponent,
|
|
794
|
+
TableSelectWindowComponent,
|
|
690
795
|
],
|
|
691
796
|
providers: [
|
|
692
797
|
OpenTableSelectWindowMethod,
|
|
@@ -701,5 +806,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
701
806
|
* Generated bundle index. Do not edit.
|
|
702
807
|
*/
|
|
703
808
|
|
|
704
|
-
export { OpenTableSelectWindowDirective, OpenTableSelectWindowMethod, TABLE_SELECT_COLUMN_MAP, TABLE_SELECT_DATA_SOURCE, TABLE_SELECT_METHOD, TABLE_SELECT_TO_DISPLAY, TABLE_SELECT_TO_VALUE, TableSelectControlDirective, TableSelectControlModule, TableSelectInputComponent, TableSelectWindowComponent, UseTableSelectColumns, UseTableSelectDataSource, UseTableSelectMethod, UseTableSelectToDisplay, UseTableSelectToValue };
|
|
809
|
+
export { OpenTableSelectWindowDirective, OpenTableSelectWindowMethod, TABLE_SELECT_COLUMN_MAP$1 as TABLE_SELECT_COLUMN_MAP, TABLE_SELECT_DATA_SOURCE$1 as TABLE_SELECT_DATA_SOURCE, TABLE_SELECT_METHOD$1 as TABLE_SELECT_METHOD, TABLE_SELECT_TO_DISPLAY$1 as TABLE_SELECT_TO_DISPLAY, TABLE_SELECT_TO_VALUE$1 as TABLE_SELECT_TO_VALUE, TableSelectControlDirective, TableSelectControlModule, TableSelectInputComponent, TableSelectWindowComponent, UseTableSelectColumns$1 as UseTableSelectColumns, UseTableSelectDataSource$1 as UseTableSelectDataSource, UseTableSelectMethod$1 as UseTableSelectMethod, UseTableSelectToDisplay$1 as UseTableSelectToDisplay, UseTableSelectToValue$1 as UseTableSelectToValue };
|
|
705
810
|
//# sourceMappingURL=rxap-ngx-material-table-select.mjs.map
|