@yuuvis/client-framework 2.3.0 → 2.3.2
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 +22 -12
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +55 -22
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +139 -52
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-object-preview.mjs +4 -26
- package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +8 -3
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/forms/index.d.ts +1 -0
- package/forms/lib/elements/data-grid/data-grid/data-grid.component.d.ts +3 -1
- package/forms/lib/forms.utils.d.ts +4 -0
- package/metadata-form/lib/object-metadata-element-label.directive.d.ts +16 -5
- package/object-details/lib/object-details-shell/object-details-shell.component.d.ts +1 -1
- package/object-details/lib/object-details-shell/object-details-shell.service.d.ts +2 -1
- package/object-details/lib/object-details.component.d.ts +4 -3
- package/object-details/lib/object-metadata/object-metadata-section/object-metadata-section.component.d.ts +8 -4
- package/object-details/lib/object-metadata/object-metadata.component.d.ts +16 -5
- package/object-form/index.d.ts +0 -1
- package/object-preview/lib/services/object-preview.service.d.ts +1 -22
- package/package.json +8 -8
- package/tile-list/lib/tile-list/tile-list.component.d.ts +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, contentChild, input, effect, Component, signal, Injectable, linkedSignal,
|
|
2
|
+
import { inject, contentChild, input, effect, Component, signal, Injectable, linkedSignal, output, viewChildren, computed, Input, untracked, NgModule, Pipe } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@yuuvis/client-core';
|
|
@@ -8,9 +8,9 @@ import { RendererDirective } from '@yuuvis/client-framework/renderer';
|
|
|
8
8
|
import * as i2 from '@angular/material/icon';
|
|
9
9
|
import { MatIconModule } from '@angular/material/icon';
|
|
10
10
|
import { RetentionBadgeComponent, BusyOverlayDirective } from '@yuuvis/client-framework/common';
|
|
11
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
+
import { takeUntilDestroyed, rxResource } from '@angular/core/rxjs-interop';
|
|
12
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import { finalize } from 'rxjs';
|
|
13
|
+
import { finalize, catchError, of, map } from 'rxjs';
|
|
14
14
|
import * as i2$2 from '@angular/material/tabs';
|
|
15
15
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
16
16
|
import { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';
|
|
@@ -95,20 +95,26 @@ class ObjectDetailsShellService {
|
|
|
95
95
|
this.id = Utils.uuid();
|
|
96
96
|
this.#dmsService = inject(DmsService);
|
|
97
97
|
this.translate = inject(TranslateService);
|
|
98
|
-
this
|
|
98
|
+
this.#dmsObject = signal(undefined);
|
|
99
|
+
this.dmsObject = this.#dmsObject.asReadonly();
|
|
99
100
|
this.contextError = signal(undefined);
|
|
100
101
|
this.busy = signal(false);
|
|
101
102
|
}
|
|
102
103
|
#dmsService;
|
|
104
|
+
#dmsObject;
|
|
105
|
+
setDmsObject(dmsObject) {
|
|
106
|
+
this.#dmsObject.set(dmsObject);
|
|
107
|
+
this.contextError.set(undefined);
|
|
108
|
+
}
|
|
103
109
|
fetchDmsObject(id) {
|
|
104
110
|
this.busy.set(true);
|
|
105
111
|
this.#dmsService
|
|
106
112
|
.getDmsObject(id)
|
|
107
113
|
.pipe(finalize(() => this.busy.set(false)))
|
|
108
114
|
.subscribe({
|
|
109
|
-
next: (dmsObject) => this
|
|
115
|
+
next: (dmsObject) => this.#dmsObject.set(dmsObject),
|
|
110
116
|
error: () => {
|
|
111
|
-
this
|
|
117
|
+
this.#dmsObject.set(undefined);
|
|
112
118
|
this.contextError.set(this.translate.instant('yuv.object-metadata.context.load.error'));
|
|
113
119
|
}
|
|
114
120
|
});
|
|
@@ -154,14 +160,14 @@ class ObjectDetailsShellComponent {
|
|
|
154
160
|
const o = e.data;
|
|
155
161
|
const dmsObj = this.dmsObject();
|
|
156
162
|
if (dmsObj && dmsObj.id === o.id)
|
|
157
|
-
this.
|
|
163
|
+
this.#odShellService.setDmsObject(o);
|
|
158
164
|
});
|
|
159
165
|
this.#eventService
|
|
160
166
|
.on(YuvEventType.DMS_OBJECT_DELETED)
|
|
161
167
|
.pipe(takeUntilDestroyed())
|
|
162
168
|
.subscribe((e) => {
|
|
163
169
|
if (e.data?.id === this.dmsObject()?.id) {
|
|
164
|
-
this.
|
|
170
|
+
this.#odShellService.setDmsObject(undefined);
|
|
165
171
|
}
|
|
166
172
|
});
|
|
167
173
|
}
|
|
@@ -344,43 +350,78 @@ class ObjectMetadataSectionComponent {
|
|
|
344
350
|
constructor() {
|
|
345
351
|
this.#system = inject(SystemService);
|
|
346
352
|
this._formOptions = signal(undefined);
|
|
347
|
-
|
|
353
|
+
// busy = signal<boolean>(false);
|
|
348
354
|
this.section = input.required();
|
|
349
|
-
this.
|
|
355
|
+
this.expandedInput = input(false, { alias: 'expanded' });
|
|
350
356
|
this.elementExtensions = input([]);
|
|
351
|
-
this.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
357
|
+
this.expanded = linkedSignal(this.expandedInput);
|
|
358
|
+
// #objectFormLoadEffect = effect(() => {
|
|
359
|
+
// const section = this.section();
|
|
360
|
+
// const expanded = this.expanded();
|
|
361
|
+
// if (expanded && section && !this._formOptions()) {
|
|
362
|
+
// untracked(() => {
|
|
363
|
+
// this.busy.set(true);
|
|
364
|
+
// this.#system.getObjectTypeForm(section.id, section.situation || Situation.EDIT).subscribe({
|
|
365
|
+
// next: (formModel) => {
|
|
366
|
+
// this._formOptions.set({
|
|
367
|
+
// formModel,
|
|
368
|
+
// data: section.data || {}
|
|
369
|
+
// });
|
|
370
|
+
// this.busy.set(false);
|
|
371
|
+
// },
|
|
372
|
+
// error: () => {
|
|
373
|
+
// this._formOptions.set(undefined);
|
|
374
|
+
// this.busy.set(false);
|
|
375
|
+
// }
|
|
376
|
+
// });
|
|
377
|
+
// });
|
|
378
|
+
// }
|
|
379
|
+
// });
|
|
380
|
+
this.#formOptionsResource = rxResource({
|
|
381
|
+
request: () => ({ section: this.section(), extended: this.expanded() }),
|
|
382
|
+
loader: ({ request }) => {
|
|
383
|
+
if (request.extended && request.section) {
|
|
384
|
+
return this.#system.getObjectTypeForm(request.section.id, request.section.situation || Situation.EDIT).pipe(catchError(() => of(undefined)), map((formModel) => ({ formModel, data: request.section?.data || {} })));
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
return of(undefined);
|
|
388
|
+
}
|
|
372
389
|
}
|
|
373
390
|
});
|
|
391
|
+
this.formOptions = this.#formOptionsResource.value;
|
|
392
|
+
this.busy = this.#formOptionsResource.isLoading;
|
|
374
393
|
this.statusChanged = output();
|
|
375
394
|
}
|
|
376
395
|
#system;
|
|
377
|
-
#objectFormLoadEffect
|
|
396
|
+
// #objectFormLoadEffect = effect(() => {
|
|
397
|
+
// const section = this.section();
|
|
398
|
+
// const expanded = this.expanded();
|
|
399
|
+
// if (expanded && section && !this._formOptions()) {
|
|
400
|
+
// untracked(() => {
|
|
401
|
+
// this.busy.set(true);
|
|
402
|
+
// this.#system.getObjectTypeForm(section.id, section.situation || Situation.EDIT).subscribe({
|
|
403
|
+
// next: (formModel) => {
|
|
404
|
+
// this._formOptions.set({
|
|
405
|
+
// formModel,
|
|
406
|
+
// data: section.data || {}
|
|
407
|
+
// });
|
|
408
|
+
// this.busy.set(false);
|
|
409
|
+
// },
|
|
410
|
+
// error: () => {
|
|
411
|
+
// this._formOptions.set(undefined);
|
|
412
|
+
// this.busy.set(false);
|
|
413
|
+
// }
|
|
414
|
+
// });
|
|
415
|
+
// });
|
|
416
|
+
// }
|
|
417
|
+
// });
|
|
418
|
+
#formOptionsResource;
|
|
378
419
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectMetadataSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
379
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectMetadataSectionComponent, isStandalone: true, selector: "yuv-object-metadata-section", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null },
|
|
420
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectMetadataSectionComponent, isStandalone: true, selector: "yuv-object-metadata-section", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null }, expandedInput: { classPropertyName: "expandedInput", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, elementExtensions: { classPropertyName: "elementExtensions", publicName: "elementExtensions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { statusChanged: "statusChanged" }, ngImport: i0, template: "@let _section = section();\n@let fo = formOptions();\n\n<h3>\n <button\n type=\"button\"\n [attr.aria-expanded]=\"expanded()\"\n class=\"accordion-trigger\"\n [attr.aria-controls]=\"'sect_' + _section.id\"\n [id]=\"'accordion_' + _section.id\"\n (click)=\"expanded.set(!expanded())\"\n [attr.aria-busy]=\"busy()\"\n >\n @if (_section.icon) {\n @if (_section.svgIcon) {\n <mat-icon [svgIcon]=\"_section.icon\"></mat-icon>\n } @else {\n <mat-icon>{{ _section.icon }}</mat-icon>\n }\n }\n <span>{{ _section.label }}</span>\n @if (busy()) {\n <mat-spinner diameter=\"24\"></mat-spinner>\n }\n <mat-icon class=\"arr\">keyboard_arrow_down</mat-icon>\n </button>\n</h3>\n<div [id]=\"'sect_' + _section.id\" role=\"region\" [attr.aria-labelledby]=\"'accordion_' + _section.id\" class=\"accordion-panel\">\n @if (fo && expanded()) {\n <yuv-object-form [formOptions]=\"fo\" [elementExtensions]=\"elementExtensions()\" (statusChanged)=\"statusChanged.emit($event)\"></yuv-object-form>\n }\n</div>\n", styles: [":host{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner)}:host h3{margin:0;padding:0;display:flex}:host h3 button{margin:var(--ymt-spacing-2xs);border-radius:calc(var(--_object-metadata-section-corner) * .5);flex:1;padding:var(--ymt-spacing-xs);cursor:pointer;display:flex;gap:var(--ymt-spacing-xs);align-items:center;font-weight:700;color:var(--ymt-text-color-subtle);background-color:transparent;border:none}:host h3 button:hover{background-color:var(--ymt-hover-background)}:host h3 button:focus-visible{background-color:var(--ymt-hover-background);outline:2px solid var(--ymt-outline);outline-offset:-2px}:host h3 button[aria-expanded=true] mat-icon.arr{transform:rotate(180deg)}:host h3 button span{flex:1;text-align:start}:host h3 button mat-icon{margin-inline-end:var(--ymt-spacing-xs);transition:transform .3s ease}:host details{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner)}:host details:not(:last-child){margin-block-end:var(--ymt-spacing-m)}:host details[open] yuv-icon.arr{transform:rotate(180deg)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: ObjectFormComponent, selector: "yuv-object-form", inputs: ["formOptions", "inert", "elementExtensions", "isInnerTableForm"], outputs: ["statusChanged", "onFormReady"] }] }); }
|
|
380
421
|
}
|
|
381
422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectMetadataSectionComponent, decorators: [{
|
|
382
423
|
type: Component,
|
|
383
|
-
args: [{ selector: 'yuv-object-metadata-section', imports: [CommonModule, MatIconModule, MatProgressSpinnerModule, ObjectFormComponent], template: "@let _section = section();\n@let fo =
|
|
424
|
+
args: [{ selector: 'yuv-object-metadata-section', imports: [CommonModule, MatIconModule, MatProgressSpinnerModule, ObjectFormComponent], template: "@let _section = section();\n@let fo = formOptions();\n\n<h3>\n <button\n type=\"button\"\n [attr.aria-expanded]=\"expanded()\"\n class=\"accordion-trigger\"\n [attr.aria-controls]=\"'sect_' + _section.id\"\n [id]=\"'accordion_' + _section.id\"\n (click)=\"expanded.set(!expanded())\"\n [attr.aria-busy]=\"busy()\"\n >\n @if (_section.icon) {\n @if (_section.svgIcon) {\n <mat-icon [svgIcon]=\"_section.icon\"></mat-icon>\n } @else {\n <mat-icon>{{ _section.icon }}</mat-icon>\n }\n }\n <span>{{ _section.label }}</span>\n @if (busy()) {\n <mat-spinner diameter=\"24\"></mat-spinner>\n }\n <mat-icon class=\"arr\">keyboard_arrow_down</mat-icon>\n </button>\n</h3>\n<div [id]=\"'sect_' + _section.id\" role=\"region\" [attr.aria-labelledby]=\"'accordion_' + _section.id\" class=\"accordion-panel\">\n @if (fo && expanded()) {\n <yuv-object-form [formOptions]=\"fo\" [elementExtensions]=\"elementExtensions()\" (statusChanged)=\"statusChanged.emit($event)\"></yuv-object-form>\n }\n</div>\n", styles: [":host{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner)}:host h3{margin:0;padding:0;display:flex}:host h3 button{margin:var(--ymt-spacing-2xs);border-radius:calc(var(--_object-metadata-section-corner) * .5);flex:1;padding:var(--ymt-spacing-xs);cursor:pointer;display:flex;gap:var(--ymt-spacing-xs);align-items:center;font-weight:700;color:var(--ymt-text-color-subtle);background-color:transparent;border:none}:host h3 button:hover{background-color:var(--ymt-hover-background)}:host h3 button:focus-visible{background-color:var(--ymt-hover-background);outline:2px solid var(--ymt-outline);outline-offset:-2px}:host h3 button[aria-expanded=true] mat-icon.arr{transform:rotate(180deg)}:host h3 button span{flex:1;text-align:start}:host h3 button mat-icon{margin-inline-end:var(--ymt-spacing-xs);transition:transform .3s ease}:host details{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner)}:host details:not(:last-child){margin-block-end:var(--ymt-spacing-m)}:host details[open] yuv-icon.arr{transform:rotate(180deg)}\n"] }]
|
|
384
425
|
}] });
|
|
385
426
|
|
|
386
427
|
class ObjectMetadataComponent {
|
|
@@ -405,10 +446,6 @@ class ObjectMetadataComponent {
|
|
|
405
446
|
this.elementExtensions = input([]);
|
|
406
447
|
this.controlsVisible = signal(false);
|
|
407
448
|
this.empty = computed(() => !this.mainFormOptions() && this.flavorFormOptions().length === 0 && this.disableBasicMetadata());
|
|
408
|
-
// form of the dms object itself
|
|
409
|
-
this.mainFormOptions = signal(undefined);
|
|
410
|
-
// forms off allpied flavors
|
|
411
|
-
this.flavorFormOptions = signal([]);
|
|
412
449
|
// state of all individual forms
|
|
413
450
|
this.#formStates = new Map();
|
|
414
451
|
this.baseData = [];
|
|
@@ -422,8 +459,15 @@ class ObjectMetadataComponent {
|
|
|
422
459
|
this.formDisabled = false;
|
|
423
460
|
this.dmsObject = input();
|
|
424
461
|
this.#dmsObjectEffect = effect(() => {
|
|
425
|
-
this
|
|
462
|
+
const object = this.dmsObject();
|
|
463
|
+
if (object) {
|
|
464
|
+
this.#initialData = structuredClone(object.data);
|
|
465
|
+
}
|
|
426
466
|
});
|
|
467
|
+
/**
|
|
468
|
+
* @deprecated This input will be removed in the future.
|
|
469
|
+
* Please migrate to using `dmsObject` and `flavors` inputs instead.
|
|
470
|
+
*/
|
|
427
471
|
this.flavoredDmsObject = input();
|
|
428
472
|
this.#flavoredDmsObjectEffect = effect(() => {
|
|
429
473
|
const flavoredDmsObject = this.flavoredDmsObject();
|
|
@@ -437,6 +481,42 @@ class ObjectMetadataComponent {
|
|
|
437
481
|
* Emits the current state of the metadata form.
|
|
438
482
|
*/
|
|
439
483
|
this.statusChanged = output();
|
|
484
|
+
this.#mainFormOptionsRecource = rxResource({
|
|
485
|
+
request: this.dmsObject,
|
|
486
|
+
loader: ({ request }) => {
|
|
487
|
+
if (!request)
|
|
488
|
+
return of(undefined);
|
|
489
|
+
return this.#system.getObjectTypeForms([request.objectTypeId], this.situation).pipe(map((res) => res[request.objectTypeId]
|
|
490
|
+
? {
|
|
491
|
+
formModel: res[request.objectTypeId],
|
|
492
|
+
data: request.data,
|
|
493
|
+
disabled: this.formDisabled || !request.permissions?.writeIndexData
|
|
494
|
+
}
|
|
495
|
+
: undefined));
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
// form of the dms object itself
|
|
499
|
+
this.mainFormOptions = this.#mainFormOptionsRecource.value;
|
|
500
|
+
this.mainFormOptionsIsLoading = this.#mainFormOptionsRecource.isLoading;
|
|
501
|
+
this.flavors = input(undefined);
|
|
502
|
+
// forms off allpied flavors
|
|
503
|
+
this.flavorFormOptions = linkedSignal({
|
|
504
|
+
source: () => ({ object: this.dmsObject(), flavors: this.flavors() }),
|
|
505
|
+
computation: ({ object, flavors }) => {
|
|
506
|
+
const mappedFlavors = (flavors || []).reduce((acc, curr) => ({ ...acc, [curr.sot]: curr }), {});
|
|
507
|
+
if (!object)
|
|
508
|
+
return [];
|
|
509
|
+
return (flavors || [])
|
|
510
|
+
.map((f) => f.sot)
|
|
511
|
+
.map((id) => ({
|
|
512
|
+
id,
|
|
513
|
+
label: this.#system.getLocalizedLabel(id),
|
|
514
|
+
icon: mappedFlavors[id]?.icon,
|
|
515
|
+
svgIcon: mappedFlavors[id]?.svgIcon,
|
|
516
|
+
data: object.data
|
|
517
|
+
}));
|
|
518
|
+
}
|
|
519
|
+
});
|
|
440
520
|
}
|
|
441
521
|
#pendingChanges;
|
|
442
522
|
#notificationService;
|
|
@@ -449,6 +529,11 @@ class ObjectMetadataComponent {
|
|
|
449
529
|
#formStates;
|
|
450
530
|
#dmsObjectEffect;
|
|
451
531
|
#flavoredDmsObjectEffect;
|
|
532
|
+
/**
|
|
533
|
+
* @deprecated once input flavoredDmsObject will be removed in the future.
|
|
534
|
+
* this is not used anymore
|
|
535
|
+
*
|
|
536
|
+
*/
|
|
452
537
|
#init(object, flavors) {
|
|
453
538
|
if (object && (!this._dmsObject || this._dmsObject !== object)) {
|
|
454
539
|
this.#initialData = structuredClone(object.data);
|
|
@@ -456,6 +541,12 @@ class ObjectMetadataComponent {
|
|
|
456
541
|
}
|
|
457
542
|
this._dmsObject = object;
|
|
458
543
|
}
|
|
544
|
+
#mainFormOptionsRecource;
|
|
545
|
+
/**
|
|
546
|
+
* @deprecated once input flavoredDmsObject will be removed in the future.
|
|
547
|
+
* this is not used anymore
|
|
548
|
+
*
|
|
549
|
+
*/
|
|
459
550
|
#objectToForm(object, flavors) {
|
|
460
551
|
if (object) {
|
|
461
552
|
const mappedFlavors = (flavors || []).reduce((acc, curr) => ({ ...acc, [curr.sot]: curr }), {});
|
|
@@ -590,7 +681,7 @@ class ObjectMetadataComponent {
|
|
|
590
681
|
this.#formSubscriptions.forEach((s) => s.unsubscribe());
|
|
591
682
|
}
|
|
592
683
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectMetadataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
593
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectMetadataComponent, isStandalone: true, selector: "yuv-object-metadata", inputs: { disableControls: { classPropertyName: "disableControls", publicName: "disableControls", isSignal: true, isRequired: false, transformFunction: null }, disableBasicMetadata: { classPropertyName: "disableBasicMetadata", publicName: "disableBasicMetadata", isSignal: true, isRequired: false, transformFunction: null }, elementExtensions: { classPropertyName: "elementExtensions", publicName: "elementExtensions", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: false, isRequired: false, transformFunction: null }, formDisabled: { classPropertyName: "formDisabled", publicName: "formDisabled", isSignal: false, isRequired: false, transformFunction: null }, dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, flavoredDmsObject: { classPropertyName: "flavoredDmsObject", publicName: "flavoredDmsObject", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { indexDataSaved: "indexDataSaved", statusChanged: "statusChanged" }, host: { properties: { "class.empty": "empty()", "class.loading": "busyLoading()" } }, viewQueries: [{ propertyName: "objectForms", predicate: ObjectFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<main [yuvBusyOverlay]=\"busySaving() || busyLoading()\">\n @if (empty()) {\n <p>{{ 'yuv.object-metadata.empty.message' | translate }}</p>\n }\n @if (!mainFormOptions()) {\n <yuv-object-form
|
|
684
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectMetadataComponent, isStandalone: true, selector: "yuv-object-metadata", inputs: { disableControls: { classPropertyName: "disableControls", publicName: "disableControls", isSignal: true, isRequired: false, transformFunction: null }, disableBasicMetadata: { classPropertyName: "disableBasicMetadata", publicName: "disableBasicMetadata", isSignal: true, isRequired: false, transformFunction: null }, elementExtensions: { classPropertyName: "elementExtensions", publicName: "elementExtensions", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: false, isRequired: false, transformFunction: null }, formDisabled: { classPropertyName: "formDisabled", publicName: "formDisabled", isSignal: false, isRequired: false, transformFunction: null }, dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, flavoredDmsObject: { classPropertyName: "flavoredDmsObject", publicName: "flavoredDmsObject", isSignal: true, isRequired: false, transformFunction: null }, flavors: { classPropertyName: "flavors", publicName: "flavors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { indexDataSaved: "indexDataSaved", statusChanged: "statusChanged" }, host: { properties: { "class.empty": "empty()", "class.loading": "busyLoading()" } }, viewQueries: [{ propertyName: "objectForms", predicate: ObjectFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<main [yuvBusyOverlay]=\"busySaving() || busyLoading() || mainFormOptionsIsLoading()\">\n @if (empty()) {\n <p>{{ 'yuv.object-metadata.empty.message' | translate }}</p>\n }\n @if (!mainFormOptions()) {\n <yuv-object-form\n [formOptions]=\"mainFormOptions()\"\n [elementExtensions]=\"elementExtensions()\"\n (statusChanged)=\"onFormStatusChanged('main', $event)\"\n ></yuv-object-form>\n }\n @for (fo of flavorFormOptions(); track $index) {\n <yuv-object-metadata-section\n [section]=\"fo\"\n [elementExtensions]=\"elementExtensions()\"\n [expanded]=\"$index === 0\"\n (statusChanged)=\"onFormStatusChanged(fo.id, $event)\"\n ></yuv-object-metadata-section>\n }\n\n <!-- base data -->\n @if (_dmsObject && !disableBasicMetadata()) {\n <yuv-object-summary-data [dmsObject]=\"_dmsObject\"></yuv-object-summary-data>\n }\n</main>\n\n<footer [attr.inert]=\"disableControls() || !controlsVisible() || null\">\n <div class=\"container\">\n <button\n ymtButton=\"secondary\"\n button-size=\"small\"\n [disabled]=\"busySaving() || busyLoading()\"\n (click)=\"resetForm()\"\n [hidden]=\"!combinedFormState?.dirty\"\n [disabled]=\"!combinedFormState?.dirty\"\n >\n {{ 'yuv.object-metadata.button.reset' | translate }}\n </button>\n <button\n ymtButton=\"primary\"\n button-size=\"small\"\n (click)=\"save()\"\n [disabled]=\"!combinedFormState?.dirty || combinedFormState?.invalid || busySaving() || busyLoading()\"\n >\n {{ 'yuv.object-metadata.button.save' | translate }}\n </button>\n </div>\n</footer>\n", styles: [":host{--_object-metadata-panel-background: var(--object-metadata-panel-background, var(--ymt-surface-container-low));--_object-metadata-section-background: var(--object-metadata-section-background, var(--ymt-surface));--_object-metadata-section-corner: var(--object-metadata-section-corner, var(--ymt-corner-m));--_object-metadata-footer-background: var(--object-metadata-footer-background, var(--ymt-surface-container));--_object-metadata-footer-height: 4rem;display:grid;grid-template-rows:1fr auto;grid-template-columns:1fr;height:100%;overflow:hidden;position:relative;background-color:var(--_object-metadata-panel-background)}:host.empty main{justify-content:center;align-items:center}:host.loading main>*{opacity:0}:host main{grid-row:1/span 3;grid-column:1;overflow-y:auto;width:100%;display:flex;flex-flow:column;padding:var(--ymt-spacing-3xl) var(--ymt-spacing-l) var(--_object-metadata-footer-height) var(--ymt-spacing-l)}:host footer{grid-row:-1;grid-column:1;padding:var(--ymt-spacing-l);opacity:0;z-index:1}:host footer .container{background:var(--_object-metadata-footer-background);padding:var(--ymt-spacing-s);display:flex;align-items:center;justify-content:end;gap:var(--ymt-spacing-s);border-radius:var(--ymt-corner-full)}:host footer:not([inert]){animation:controlsAppear .2s ease-in-out forwards}:host main yuv-object-metadata-section{margin-block-end:var(--ymt-spacing-m)}:host main yuv-object-summary-data{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner);padding:var(--ymt-spacing-m)}@keyframes controlsAppear{0%{opacity:0;translate:0 var(--ymt-spacing-m)}to{opacity:1;translate:0 0}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ObjectFormComponent, selector: "yuv-object-form", inputs: ["formOptions", "inert", "elementExtensions", "isInnerTableForm"], outputs: ["statusChanged", "onFormReady"] }, { kind: "component", type: ObjectSummaryDataComponent, selector: "yuv-object-summary-data", inputs: ["dmsObject", "flavors", "showAppliedFlavors"] }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay", "yuvBusyOverlayConfig"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: ObjectMetadataSectionComponent, selector: "yuv-object-metadata-section", inputs: ["section", "expanded", "elementExtensions"], outputs: ["statusChanged"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }] }); }
|
|
594
685
|
}
|
|
595
686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectMetadataComponent, decorators: [{
|
|
596
687
|
type: Component,
|
|
@@ -608,7 +699,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
608
699
|
], host: {
|
|
609
700
|
'[class.empty]': 'empty()',
|
|
610
701
|
'[class.loading]': 'busyLoading()'
|
|
611
|
-
}, template: "<main [yuvBusyOverlay]=\"busySaving() || busyLoading()\">\n @if (empty()) {\n <p>{{ 'yuv.object-metadata.empty.message' | translate }}</p>\n }\n @if (!mainFormOptions()) {\n <yuv-object-form
|
|
702
|
+
}, template: "<main [yuvBusyOverlay]=\"busySaving() || busyLoading() || mainFormOptionsIsLoading()\">\n @if (empty()) {\n <p>{{ 'yuv.object-metadata.empty.message' | translate }}</p>\n }\n @if (!mainFormOptions()) {\n <yuv-object-form\n [formOptions]=\"mainFormOptions()\"\n [elementExtensions]=\"elementExtensions()\"\n (statusChanged)=\"onFormStatusChanged('main', $event)\"\n ></yuv-object-form>\n }\n @for (fo of flavorFormOptions(); track $index) {\n <yuv-object-metadata-section\n [section]=\"fo\"\n [elementExtensions]=\"elementExtensions()\"\n [expanded]=\"$index === 0\"\n (statusChanged)=\"onFormStatusChanged(fo.id, $event)\"\n ></yuv-object-metadata-section>\n }\n\n <!-- base data -->\n @if (_dmsObject && !disableBasicMetadata()) {\n <yuv-object-summary-data [dmsObject]=\"_dmsObject\"></yuv-object-summary-data>\n }\n</main>\n\n<footer [attr.inert]=\"disableControls() || !controlsVisible() || null\">\n <div class=\"container\">\n <button\n ymtButton=\"secondary\"\n button-size=\"small\"\n [disabled]=\"busySaving() || busyLoading()\"\n (click)=\"resetForm()\"\n [hidden]=\"!combinedFormState?.dirty\"\n [disabled]=\"!combinedFormState?.dirty\"\n >\n {{ 'yuv.object-metadata.button.reset' | translate }}\n </button>\n <button\n ymtButton=\"primary\"\n button-size=\"small\"\n (click)=\"save()\"\n [disabled]=\"!combinedFormState?.dirty || combinedFormState?.invalid || busySaving() || busyLoading()\"\n >\n {{ 'yuv.object-metadata.button.save' | translate }}\n </button>\n </div>\n</footer>\n", styles: [":host{--_object-metadata-panel-background: var(--object-metadata-panel-background, var(--ymt-surface-container-low));--_object-metadata-section-background: var(--object-metadata-section-background, var(--ymt-surface));--_object-metadata-section-corner: var(--object-metadata-section-corner, var(--ymt-corner-m));--_object-metadata-footer-background: var(--object-metadata-footer-background, var(--ymt-surface-container));--_object-metadata-footer-height: 4rem;display:grid;grid-template-rows:1fr auto;grid-template-columns:1fr;height:100%;overflow:hidden;position:relative;background-color:var(--_object-metadata-panel-background)}:host.empty main{justify-content:center;align-items:center}:host.loading main>*{opacity:0}:host main{grid-row:1/span 3;grid-column:1;overflow-y:auto;width:100%;display:flex;flex-flow:column;padding:var(--ymt-spacing-3xl) var(--ymt-spacing-l) var(--_object-metadata-footer-height) var(--ymt-spacing-l)}:host footer{grid-row:-1;grid-column:1;padding:var(--ymt-spacing-l);opacity:0;z-index:1}:host footer .container{background:var(--_object-metadata-footer-background);padding:var(--ymt-spacing-s);display:flex;align-items:center;justify-content:end;gap:var(--ymt-spacing-s);border-radius:var(--ymt-corner-full)}:host footer:not([inert]){animation:controlsAppear .2s ease-in-out forwards}:host main yuv-object-metadata-section{margin-block-end:var(--ymt-spacing-m)}:host main yuv-object-summary-data{background-color:var(--_object-metadata-section-background);border:1px solid var(--ymt-outline-variant);border-radius:var(--_object-metadata-section-corner);padding:var(--ymt-spacing-m)}@keyframes controlsAppear{0%{opacity:0;translate:0 var(--ymt-spacing-m)}to{opacity:1;translate:0 0}}\n"] }]
|
|
612
703
|
}], propDecorators: { situation: [{
|
|
613
704
|
type: Input
|
|
614
705
|
}], formDisabled: [{
|
|
@@ -628,13 +719,11 @@ class ObjectDetailsComponent {
|
|
|
628
719
|
/**
|
|
629
720
|
* DmsObject to show the details for.
|
|
630
721
|
*/
|
|
631
|
-
this.
|
|
632
|
-
this.
|
|
633
|
-
this
|
|
634
|
-
this._dmsObject.set(this.dmsObject());
|
|
635
|
-
});
|
|
722
|
+
this.dmsObjectInput = input(undefined, { alias: 'dmsObject' });
|
|
723
|
+
this.dmsObjectInputEffect = effect(() => untracked(() => this.#odShellService.setDmsObject(this.dmsObjectInput())));
|
|
724
|
+
this.dmsObject = this.#odShellService.dmsObject;
|
|
636
725
|
this.flavoredDmsObject = computed(() => {
|
|
637
|
-
const o = this.
|
|
726
|
+
const o = this.dmsObject();
|
|
638
727
|
const f = this.flavors();
|
|
639
728
|
return o
|
|
640
729
|
? {
|
|
@@ -674,18 +763,16 @@ class ObjectDetailsComponent {
|
|
|
674
763
|
}
|
|
675
764
|
#userService;
|
|
676
765
|
#odShellService;
|
|
677
|
-
#dmsObjectEffect;
|
|
678
766
|
#objectIdEffect;
|
|
679
767
|
onIndexdataSaved(updatedObject) {
|
|
680
|
-
|
|
681
|
-
this._dmsObject.set(updatedObject);
|
|
768
|
+
this.#odShellService.setDmsObject(updatedObject);
|
|
682
769
|
}
|
|
683
770
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
684
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectDetailsComponent, isStandalone: true, selector: "yuv-object-details", inputs: {
|
|
771
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ObjectDetailsComponent, isStandalone: true, selector: "yuv-object-details", inputs: { dmsObjectInput: { classPropertyName: "dmsObjectInput", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, flavors: { classPropertyName: "flavors", publicName: "flavors", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, objectConfigBucket: { classPropertyName: "objectConfigBucket", publicName: "objectConfigBucket", isSignal: true, isRequired: false, transformFunction: null }, objectId: { classPropertyName: "objectId", publicName: "objectId", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, providers: [ObjectDetailsShellService], ngImport: i0, template: "<yuv-object-details-shell [type]=\"type()\" [hideHeader]=\"hideHeader()\" [bucket]=\"objectConfigBucket()\">\n @let dmsObj = dmsObject();\n <mat-tab-group>\n <!-- content -->\n @if (dmsObj && dmsObj.content) {\n <mat-tab [label]=\"'yuv.object-details.tabs.content.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-preview [dmsObject]=\"dmsObj\"></yuv-object-preview>\n </ng-template>\n </mat-tab>\n }\n\n <!-- indexdata -->\n <mat-tab [label]=\"'yuv.object-metadata.tabs.indexdata.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-metadata [dmsObject]=\"dmsObject()\" [flavors]=\"flavors()\" (indexDataSaved)=\"onIndexdataSaved($event)\"> </yuv-object-metadata>\n </ng-template>\n </mat-tab>\n <!-- history -->\n <mat-tab [label]=\"'yuv.object-metadata.tabs.history.title' | translate\">\n <ng-template matTabContent> <yuv-object-audit [dmsObject]=\"dmsObj\"></yuv-object-audit> </ng-template\n ></mat-tab>\n </mat-tab-group>\n</yuv-object-details-shell>\n", styles: [":host{display:block;overflow:hidden}:host yuv-object-details-shell{height:100%}:host mat-tab-group{overflow:hidden;height:100%}:host mat-tab-group ::ng-deep .mat-mdc-tab-body-wrapper{height:100%}:host yuv-object-preview{background-color:var(--ymt-surface-container-low)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i2$2.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i2$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i2$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: ObjectDetailsShellComponent, selector: "yuv-object-details-shell", inputs: ["type", "bucket", "hideHeader"] }, { kind: "component", type: ObjectPreviewComponent, selector: "yuv-object-preview", inputs: ["objectId", "dmsObject", "version", "metadata"] }, { kind: "component", type: ObjectMetadataComponent, selector: "yuv-object-metadata", inputs: ["disableControls", "disableBasicMetadata", "elementExtensions", "situation", "formDisabled", "dmsObject", "flavoredDmsObject", "flavors"], outputs: ["indexDataSaved", "statusChanged"] }, { kind: "component", type: ObjectAuditComponent, selector: "yuv-object-audit", inputs: ["dmsObject", "skipActions", "allActions"] }] }); }
|
|
685
772
|
}
|
|
686
773
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ObjectDetailsComponent, decorators: [{
|
|
687
774
|
type: Component,
|
|
688
|
-
args: [{ selector: 'yuv-object-details', standalone: true, imports: [CommonModule, TranslateModule, MatTabsModule, ObjectDetailsShellComponent, ObjectPreviewComponent, ObjectMetadataComponent, ObjectAuditComponent], providers: [ObjectDetailsShellService], template: "<yuv-object-details-shell [type]=\"type()\" [hideHeader]=\"hideHeader()\" [bucket]=\"objectConfigBucket()\">\n @let dmsObj =
|
|
775
|
+
args: [{ selector: 'yuv-object-details', standalone: true, imports: [CommonModule, TranslateModule, MatTabsModule, ObjectDetailsShellComponent, ObjectPreviewComponent, ObjectMetadataComponent, ObjectAuditComponent], providers: [ObjectDetailsShellService], template: "<yuv-object-details-shell [type]=\"type()\" [hideHeader]=\"hideHeader()\" [bucket]=\"objectConfigBucket()\">\n @let dmsObj = dmsObject();\n <mat-tab-group>\n <!-- content -->\n @if (dmsObj && dmsObj.content) {\n <mat-tab [label]=\"'yuv.object-details.tabs.content.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-preview [dmsObject]=\"dmsObj\"></yuv-object-preview>\n </ng-template>\n </mat-tab>\n }\n\n <!-- indexdata -->\n <mat-tab [label]=\"'yuv.object-metadata.tabs.indexdata.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-metadata [dmsObject]=\"dmsObject()\" [flavors]=\"flavors()\" (indexDataSaved)=\"onIndexdataSaved($event)\"> </yuv-object-metadata>\n </ng-template>\n </mat-tab>\n <!-- history -->\n <mat-tab [label]=\"'yuv.object-metadata.tabs.history.title' | translate\">\n <ng-template matTabContent> <yuv-object-audit [dmsObject]=\"dmsObj\"></yuv-object-audit> </ng-template\n ></mat-tab>\n </mat-tab-group>\n</yuv-object-details-shell>\n", styles: [":host{display:block;overflow:hidden}:host yuv-object-details-shell{height:100%}:host mat-tab-group{overflow:hidden;height:100%}:host mat-tab-group ::ng-deep .mat-mdc-tab-body-wrapper{height:100%}:host yuv-object-preview{background-color:var(--ymt-surface-container-low)}\n"] }]
|
|
689
776
|
}] });
|
|
690
777
|
|
|
691
778
|
const cmp = [
|