@yuuvis/client-framework 2.3.22 → 2.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/yuuvis-client-framework-forms.mjs +19 -30
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +0 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +1 -2
- package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-renderer.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
- package/lib/assets/i18n/de.json +3 -2
- package/lib/assets/i18n/en.json +3 -2
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i1$2 from '@angular/common';
|
|
2
|
-
import { CommonModule,
|
|
2
|
+
import { CommonModule, NgClass } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, signal, input, forwardRef, ChangeDetectionStrategy, Component, ChangeDetectorRef, ElementRef, computed, effect, untracked, viewChild, DestroyRef, Input, output, NgModule } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
@@ -16,6 +16,7 @@ import * as i2 from '@yuuvis/client-core';
|
|
|
16
16
|
import { SystemService, Situation, TranslateModule, ClipboardService, TranslateService, Operator, OperatorLabel, Utils, LocaleNumberPipe, FileSizePipe, Classification, UserService, YuvUser, IdmService, SearchUtils, LocaleDatePipe, ClassificationPrefix } from '@yuuvis/client-core';
|
|
17
17
|
import { YUV_ICONS } from '@yuuvis/client-framework/icons';
|
|
18
18
|
import { MetadataFormFieldComponent, ObjectMetadataElementLabelDirective } from '@yuuvis/client-framework/metadata-form';
|
|
19
|
+
import { RendererDirective } from '@yuuvis/client-framework/renderer';
|
|
19
20
|
import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
|
|
20
21
|
import { map, timer, take, of, forkJoin } from 'rxjs';
|
|
21
22
|
import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
|
|
@@ -156,8 +157,6 @@ class DataGridComponent {
|
|
|
156
157
|
this.#dialog = inject(MatDialog);
|
|
157
158
|
this.#clipboardService = inject(ClipboardService);
|
|
158
159
|
this.#systemService = inject(SystemService);
|
|
159
|
-
this.#decimalPipe = inject(DecimalPipe);
|
|
160
|
-
this.#datePipe = inject(DatePipe);
|
|
161
160
|
this.translate = inject(TranslateService);
|
|
162
161
|
this.#cdRef = inject(ChangeDetectorRef);
|
|
163
162
|
this.el = inject((ElementRef));
|
|
@@ -215,8 +214,6 @@ class DataGridComponent {
|
|
|
215
214
|
#dialog;
|
|
216
215
|
#clipboardService;
|
|
217
216
|
#systemService;
|
|
218
|
-
#decimalPipe;
|
|
219
|
-
#datePipe;
|
|
220
217
|
#cdRef;
|
|
221
218
|
#readOnlyUpdateEffect;
|
|
222
219
|
#loadData;
|
|
@@ -273,18 +270,6 @@ class DataGridComponent {
|
|
|
273
270
|
const formElement = this.formElement();
|
|
274
271
|
formElement && this.#updateTable(formElement['elements'], updatedData);
|
|
275
272
|
}
|
|
276
|
-
#cellValue(element, value) {
|
|
277
|
-
switch (element.type) {
|
|
278
|
-
case 'datetime':
|
|
279
|
-
return this.#datePipe.transform(value, 'short', undefined, this.translate.currentLang);
|
|
280
|
-
case 'string':
|
|
281
|
-
return value;
|
|
282
|
-
case 'decimal':
|
|
283
|
-
return this.#decimalPipe.transform(value, '1.2-4', this.translate.currentLang);
|
|
284
|
-
default:
|
|
285
|
-
return value;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
273
|
#updateTable(elements, data = []) {
|
|
289
274
|
if (elements.length > 0) {
|
|
290
275
|
const columns = elements.reduce((acc, el) => {
|
|
@@ -292,7 +277,15 @@ class DataGridComponent {
|
|
|
292
277
|
columnDef: el.name,
|
|
293
278
|
header: this.#systemService.getLocalizedLabel(el.name) || el.name,
|
|
294
279
|
type: el.type,
|
|
295
|
-
cell: (element) =>
|
|
280
|
+
cell: (element) => {
|
|
281
|
+
return {
|
|
282
|
+
value: {
|
|
283
|
+
propertyName: el.name,
|
|
284
|
+
rendererType: el.type,
|
|
285
|
+
value: element[el.name]
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
296
289
|
});
|
|
297
290
|
return acc;
|
|
298
291
|
}, []);
|
|
@@ -304,7 +297,6 @@ class DataGridComponent {
|
|
|
304
297
|
}
|
|
305
298
|
const displayedColumns = [...this.displayedColumns().map((col) => col.columnDef)];
|
|
306
299
|
this.displayedColumnsWithActions.set(displayedColumns);
|
|
307
|
-
this.dataSource.set(data);
|
|
308
300
|
}
|
|
309
301
|
writeValue(obj) {
|
|
310
302
|
this.propagateChange(obj);
|
|
@@ -354,14 +346,12 @@ class DataGridComponent {
|
|
|
354
346
|
provide: NG_VALIDATORS,
|
|
355
347
|
useExisting: forwardRef(() => DataGridComponent),
|
|
356
348
|
multi: true
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
DatePipe
|
|
360
|
-
], ngImport: i0, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"dataSource()\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <h1>Actions</h1>\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n {{ column.cell(element) }}\n </td>\n </ng-container>\n }\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"copyLine(selectedRow())\">{{ 'yuv.form.element.data.grid.copy' | translate }}</button>\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;margin-block-end:var(--ymt-spacing-m)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i4.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: ObjectMetadataElementLabelDirective, selector: "[yuvObjectMetadataElementLabel]", inputs: ["yuvObjectMetadataElementLabel"] }, { kind: "directive", type: YmtIconButtonDirective, selector: "button[ymtIconButton],button[ymt-icon-button],a[ymtIconButton],a[ymt-icon-button]", inputs: ["disabled", "disableRipple", "aria-disabled", "disabledInteractive", "icon-button-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
349
|
+
}
|
|
350
|
+
], ngImport: i0, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n @let data = dataSource();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <h1>Actions</h1>\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n <ng-template *yuvRenderer=\"column.cell(element).value\"></ng-template>\n </td>\n </ng-container>\n }\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell no-data-cell\" [attr.colspan]=\"column.length\"></td>\n </tr>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n @if (data.length === 0) {\n <span class=\"no-data\">{{ 'yuv.form.element.data.grid.noData' | translate }}</span>\n }\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"copyLine(selectedRow())\">{{ 'yuv.form.element.data.grid.copy' | translate }}</button>\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;margin-block-end:var(--ymt-spacing-m)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table .no-data{display:block;width:100%;background-color:var(--ymt-surface);text-align:center;padding:var(--ymt-spacing-s);font:var(--ymt-font-body);color:var(--ymt-text-color-subtle);font-style:italic}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i4.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i4.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "directive", type: RendererDirective, selector: "[yuvRenderer]", inputs: ["yuvRenderer"] }, { kind: "directive", type: ObjectMetadataElementLabelDirective, selector: "[yuvObjectMetadataElementLabel]", inputs: ["yuvObjectMetadataElementLabel"] }, { kind: "directive", type: YmtIconButtonDirective, selector: "button[ymtIconButton],button[ymt-icon-button],a[ymtIconButton],a[ymt-icon-button]", inputs: ["disabled", "disableRipple", "aria-disabled", "disabledInteractive", "icon-button-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
361
351
|
}
|
|
362
352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DataGridComponent, decorators: [{
|
|
363
353
|
type: Component,
|
|
364
|
-
args: [{ selector: 'yuv-data-grid', standalone: true, imports: [NgClass, TranslateModule, ...MATERIAL, ObjectMetadataElementLabelDirective, YmtIconButtonDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
354
|
+
args: [{ selector: 'yuv-data-grid', standalone: true, imports: [NgClass, TranslateModule, ...MATERIAL, RendererDirective, ObjectMetadataElementLabelDirective, YmtIconButtonDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
365
355
|
{
|
|
366
356
|
provide: NG_VALUE_ACCESSOR,
|
|
367
357
|
useExisting: forwardRef(() => DataGridComponent),
|
|
@@ -371,13 +361,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
371
361
|
provide: NG_VALIDATORS,
|
|
372
362
|
useExisting: forwardRef(() => DataGridComponent),
|
|
373
363
|
multi: true
|
|
374
|
-
}
|
|
375
|
-
DecimalPipe,
|
|
376
|
-
DatePipe
|
|
364
|
+
}
|
|
377
365
|
], host: {
|
|
378
366
|
class: 'yuv-data-grid',
|
|
379
367
|
'(focusout)': 'onHostFocusOut($event)'
|
|
380
|
-
}, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"
|
|
368
|
+
}, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n @let data = dataSource();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <h1>Actions</h1>\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n <ng-template *yuvRenderer=\"column.cell(element).value\"></ng-template>\n </td>\n </ng-container>\n }\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell no-data-cell\" [attr.colspan]=\"column.length\"></td>\n </tr>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n @if (data.length === 0) {\n <span class=\"no-data\">{{ 'yuv.form.element.data.grid.noData' | translate }}</span>\n }\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"copyLine(selectedRow())\">{{ 'yuv.form.element.data.grid.copy' | translate }}</button>\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;margin-block-end:var(--ymt-spacing-m)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table .no-data{display:block;width:100%;background-color:var(--ymt-surface);text-align:center;padding:var(--ymt-spacing-s);font:var(--ymt-font-body);color:var(--ymt-text-color-subtle);font-style:italic}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"] }]
|
|
381
369
|
}] });
|
|
382
370
|
|
|
383
371
|
class DatetimeComponent extends AbstractMatFormField {
|
|
@@ -438,6 +426,7 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
438
426
|
this.#propagate(value);
|
|
439
427
|
}
|
|
440
428
|
this.value = value || null;
|
|
429
|
+
this.fc.setValue(this.value, { emitEvent: false });
|
|
441
430
|
}
|
|
442
431
|
#propagate(value) {
|
|
443
432
|
let propagateValue = value;
|
|
@@ -1923,11 +1912,11 @@ class StringComponent extends AbstractMatFormField {
|
|
|
1923
1912
|
super.onNgOnDestroy();
|
|
1924
1913
|
}
|
|
1925
1914
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StringComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1926
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: "multiselect", rows: "rows", readonly: "readonly", autofocus: "autofocus", classifications: "classifications", situation: "situation", regex: "regex", minLength: "minLength", maxLength: "maxLength" }, providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], usesInheritance: true, ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [disabled]=\"disabled\" [readonly]=\"readonly\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <mat-chip-grid #chipGrid [formControl]=\"fc\" [disabled]=\"disabled\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [disabled]=\"disabled\"\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n matInput\n class=\"input-textarea\"\n (blur)=\"onBlur()\"\n [rows]=\"rows\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [formControl]=\"fc\"\n ></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){overflow-x:auto;scrollbar-width:none}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0;margin-block:var(--ymt-spacing-s)}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$3.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$3.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$3.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
1915
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: "multiselect", rows: "rows", readonly: "readonly", autofocus: "autofocus", classifications: "classifications", situation: "situation", regex: "regex", minLength: "minLength", maxLength: "maxLength" }, providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], usesInheritance: true, ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [disabled]=\"disabled\" [readonly]=\"readonly\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <mat-chip-grid #chipGrid [formControl]=\"fc\" [disabled]=\"disabled\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [disabled]=\"disabled\"\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n matInput\n class=\"input-textarea\"\n (blur)=\"onBlur()\"\n [rows]=\"rows\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [formControl]=\"fc\"\n ></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){overflow-x:auto;scrollbar-width:none}:host mat-chip-grid{flex:1}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0;margin-block:var(--ymt-spacing-s)}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$3.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$3.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$3.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
1927
1916
|
}
|
|
1928
1917
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StringComponent, decorators: [{
|
|
1929
1918
|
type: Component,
|
|
1930
|
-
args: [{ selector: 'yuv-string', standalone: true, imports: [CommonModule, MatChipsModule, MatIconModule, ReactiveFormsModule, FormsModule], providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [disabled]=\"disabled\" [readonly]=\"readonly\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <mat-chip-grid #chipGrid [formControl]=\"fc\" [disabled]=\"disabled\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [disabled]=\"disabled\"\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n matInput\n class=\"input-textarea\"\n (blur)=\"onBlur()\"\n [rows]=\"rows\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [formControl]=\"fc\"\n ></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){overflow-x:auto;scrollbar-width:none}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0;margin-block:var(--ymt-spacing-s)}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}\n"] }]
|
|
1919
|
+
args: [{ selector: 'yuv-string', standalone: true, imports: [CommonModule, MatChipsModule, MatIconModule, ReactiveFormsModule, FormsModule], providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [disabled]=\"disabled\" [readonly]=\"readonly\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <mat-chip-grid #chipGrid [formControl]=\"fc\" [disabled]=\"disabled\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [disabled]=\"disabled\"\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n matInput\n class=\"input-textarea\"\n (blur)=\"onBlur()\"\n [rows]=\"rows\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [formControl]=\"fc\"\n ></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){overflow-x:auto;scrollbar-width:none}:host mat-chip-grid{flex:1}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0;margin-block:var(--ymt-spacing-s)}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}\n"] }]
|
|
1931
1920
|
}], propDecorators: { multiselect: [{
|
|
1932
1921
|
type: Input
|
|
1933
1922
|
}], rows: [{
|