@yuuvis/client-framework 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/yuuvis-client-framework-forms.mjs +702 -613
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +4 -3
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +4 -2
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +173 -173
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +9 -5
- package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-summary.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-renderer.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs +47 -35
- package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +34 -17
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/lib/assets/i18n/de.json +22 -22
- package/lib/assets/i18n/en.json +12 -12
- package/package.json +6 -6
- package/types/yuuvis-client-framework-forms.d.ts +215 -186
- package/types/yuuvis-client-framework-object-details.d.ts +99 -99
- package/types/yuuvis-client-framework-sequence-list.d.ts +2 -2
- package/types/yuuvis-client-framework-tile-list.d.ts +3 -2
|
@@ -1,189 +1,30 @@
|
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
4
|
+
import { signal, input, effect, Component, inject, computed, ChangeDetectionStrategy, Injectable, viewChild, linkedSignal, untracked, output, viewChildren, NgModule, Pipe } from '@angular/core';
|
|
3
5
|
import { takeUntilDestroyed, toSignal, rxResource } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
7
|
import * as i3 from '@angular/material/icon';
|
|
5
8
|
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
-
import * as i1
|
|
7
|
-
import {
|
|
9
|
+
import * as i1 from '@yuuvis/client-core';
|
|
10
|
+
import { YuvEventType, LocaleDatePipe, TranslatePipe, ObjectConfigService, EventService, Utils, DmsService, TranslateService, SystemService, Situation, PendingChangesService, NotificationService, UserService, TabGuardDirective } from '@yuuvis/client-core';
|
|
11
|
+
import { BusyOverlayDirective, RetentionBadgeComponent } from '@yuuvis/client-framework/common';
|
|
12
|
+
import { YUV_ICONS } from '@yuuvis/client-framework/icons';
|
|
13
|
+
import { YmtIconButtonDirective, YmtButtonDirective } from '@yuuvis/material';
|
|
14
|
+
import { finalize, of, map } from 'rxjs';
|
|
8
15
|
import { RendererDirective } from '@yuuvis/client-framework/renderer';
|
|
9
|
-
import * as i1 from '@yuuvis/material/panes';
|
|
16
|
+
import * as i1$1 from '@yuuvis/material/panes';
|
|
10
17
|
import { YmtPanesModule } from '@yuuvis/material/panes';
|
|
11
18
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
12
|
-
import { BusyOverlayDirective, RetentionBadgeComponent } from '@yuuvis/client-framework/common';
|
|
13
|
-
import { finalize, of, map } from 'rxjs';
|
|
14
19
|
import * as i1$2 from '@angular/material/tabs';
|
|
15
20
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
16
21
|
import { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';
|
|
17
|
-
import * as i2 from '@angular/common';
|
|
18
|
-
import { CommonModule } from '@angular/common';
|
|
19
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
20
|
-
import { YUV_ICONS } from '@yuuvis/client-framework/icons';
|
|
21
|
-
import { YmtIconButtonDirective, YmtButtonDirective } from '@yuuvis/material';
|
|
22
22
|
import { MatButtonModule } from '@angular/material/button';
|
|
23
23
|
import { ObjectFormComponent } from '@yuuvis/client-framework/object-form';
|
|
24
24
|
import { ObjectSummaryDataComponent } from '@yuuvis/client-framework/object-summary';
|
|
25
25
|
import * as i2$1 from '@angular/material/progress-spinner';
|
|
26
26
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Component showing header data for a dms object. These will be
|
|
30
|
-
* generated from the object config for the given object.
|
|
31
|
-
*
|
|
32
|
-
* You could inject a set of actions into the headers actions slot
|
|
33
|
-
* by adding them to the components body:
|
|
34
|
-
*
|
|
35
|
-
* ```html
|
|
36
|
-
* <yuv-object-details-header [dmsObject]="obj">
|
|
37
|
-
* <ng-template #yuvHeaderActions>...</ng-template>
|
|
38
|
-
* </yuv-object-details-header>
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
class ObjectDetailsHeaderComponent {
|
|
42
|
-
#objectConfig;
|
|
43
|
-
#eventService;
|
|
44
|
-
constructor() {
|
|
45
|
-
this.#objectConfig = inject(ObjectConfigService);
|
|
46
|
-
this.#eventService = inject(EventService);
|
|
47
|
-
this.dmsObject = input(undefined, ...(ngDevMode ? [{ debugName: "dmsObject" }] : /* istanbul ignore next */ []));
|
|
48
|
-
/**
|
|
49
|
-
* Virtual object type to use for retrieving header data
|
|
50
|
-
*/
|
|
51
|
-
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
52
|
-
/**
|
|
53
|
-
* Bucket of the object config to retrieve header data from
|
|
54
|
-
*/
|
|
55
|
-
this.bucket = input(undefined, ...(ngDevMode ? [{ debugName: "bucket" }] : /* istanbul ignore next */ []));
|
|
56
|
-
/** Template rendered in the actions area, aligned to the right of the title row. */
|
|
57
|
-
this.actions = input(undefined, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
58
|
-
/** Template rendered in the badges area, aligned to the right of the subtitle row. */
|
|
59
|
-
this.badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
|
|
60
|
-
this.headerData = computed(() => {
|
|
61
|
-
const object = this.dmsObject();
|
|
62
|
-
const type = this.type();
|
|
63
|
-
return object && type ? this.#setHeaderData() : undefined;
|
|
64
|
-
}, ...(ngDevMode ? [{ debugName: "headerData" }] : /* istanbul ignore next */ []));
|
|
65
|
-
this.#eventService
|
|
66
|
-
.on(YuvEventType.DMS_OBJECT_UPDATED)
|
|
67
|
-
.pipe(takeUntilDestroyed())
|
|
68
|
-
.subscribe(() => this.#setHeaderData());
|
|
69
|
-
}
|
|
70
|
-
#setHeaderData() {
|
|
71
|
-
const object = this.dmsObject();
|
|
72
|
-
if (!object) {
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
const roc = this.#objectConfig.getResolvedObjectConfig(object.data, this.type(), this.bucket());
|
|
77
|
-
return {
|
|
78
|
-
title: roc.title,
|
|
79
|
-
description: roc.description,
|
|
80
|
-
icon: roc.icon?.value
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
85
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ObjectDetailsHeaderComponent, isStandalone: true, selector: "yuv-object-details-header", inputs: { dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, bucket: { classPropertyName: "bucket", publicName: "bucket", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let dmsObj = dmsObject();\n@let headerD = headerData();\n@if (dmsObj && headerD) {\n <ymt-pane-header [icon]=\"headerD.icon\" [actions]=\"actions()\" [badges]=\"badges()\">\n <ng-template #yuvPaneHeaderTitle>\n <ng-container *yuvRenderer=\"headerD.title\" />\n </ng-template>\n <ng-template #yuvPaneHeaderSubtitle>\n <ng-container *yuvRenderer=\"headerD.description\" />\n </ng-template>\n </ymt-pane-header>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: YmtPanesModule }, { kind: "component", type: i1.YmtPaneHeaderComponent, selector: "ymt-pane-header", inputs: ["title", "icon", "subtitle", "actions", "badges"] }, { kind: "directive", type: RendererDirective, selector: "[yuvRenderer]", inputs: ["yuvRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
86
|
-
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsHeaderComponent, decorators: [{
|
|
88
|
-
type: Component,
|
|
89
|
-
args: [{ selector: 'yuv-object-details-header', imports: [MatIconModule, YmtPanesModule, RendererDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dmsObj = dmsObject();\n@let headerD = headerData();\n@if (dmsObj && headerD) {\n <ymt-pane-header [icon]=\"headerD.icon\" [actions]=\"actions()\" [badges]=\"badges()\">\n <ng-template #yuvPaneHeaderTitle>\n <ng-container *yuvRenderer=\"headerD.title\" />\n </ng-template>\n <ng-template #yuvPaneHeaderSubtitle>\n <ng-container *yuvRenderer=\"headerD.description\" />\n </ng-template>\n </ymt-pane-header>\n}\n" }]
|
|
90
|
-
}], ctorParameters: () => [], propDecorators: { dmsObject: [{ type: i0.Input, args: [{ isSignal: true, alias: "dmsObject", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], bucket: [{ type: i0.Input, args: [{ isSignal: true, alias: "bucket", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }] } });
|
|
91
|
-
|
|
92
|
-
class ObjectDetailsShellService {
|
|
93
|
-
constructor() {
|
|
94
|
-
this.id = Utils.uuid();
|
|
95
|
-
this.#dmsService = inject(DmsService);
|
|
96
|
-
this.translate = inject(TranslateService);
|
|
97
|
-
this.#dmsObject = signal(undefined, ...(ngDevMode ? [{ debugName: "#dmsObject" }] : /* istanbul ignore next */ []));
|
|
98
|
-
this.dmsObject = this.#dmsObject.asReadonly();
|
|
99
|
-
this.contextError = signal(undefined, ...(ngDevMode ? [{ debugName: "contextError" }] : /* istanbul ignore next */ []));
|
|
100
|
-
this.busy = signal(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
101
|
-
}
|
|
102
|
-
#dmsService;
|
|
103
|
-
#dmsObject;
|
|
104
|
-
setDmsObject(dmsObject) {
|
|
105
|
-
this.#dmsObject.set(dmsObject);
|
|
106
|
-
this.contextError.set(undefined);
|
|
107
|
-
}
|
|
108
|
-
fetchDmsObject(id) {
|
|
109
|
-
this.busy.set(true);
|
|
110
|
-
this.#dmsService
|
|
111
|
-
.getDmsObject(id)
|
|
112
|
-
.pipe(finalize(() => this.busy.set(false)))
|
|
113
|
-
.subscribe({
|
|
114
|
-
next: (dmsObject) => this.#dmsObject.set(dmsObject),
|
|
115
|
-
error: () => {
|
|
116
|
-
this.#dmsObject.set(undefined);
|
|
117
|
-
this.contextError.set(this.translate.instant('yuv.object-metadata.context.load.error'));
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
122
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService }); }
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService, decorators: [{
|
|
125
|
-
type: Injectable
|
|
126
|
-
}] });
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Wrapper component for details of a dms object. This component
|
|
130
|
-
* provides a header based on the object configuration for the given object.
|
|
131
|
-
* It will also take care of loading the object if you only provide the objects ID.
|
|
132
|
-
*/
|
|
133
|
-
class ObjectDetailsShellComponent {
|
|
134
|
-
#eventService;
|
|
135
|
-
#odShellService;
|
|
136
|
-
constructor() {
|
|
137
|
-
this.#eventService = inject(EventService);
|
|
138
|
-
this.#odShellService = inject(ObjectDetailsShellService);
|
|
139
|
-
this.retentionState = signal(undefined, ...(ngDevMode ? [{ debugName: "retentionState" }] : /* istanbul ignore next */ []));
|
|
140
|
-
this.contextError = this.#odShellService.contextError;
|
|
141
|
-
this.dmsObject = this.#odShellService.dmsObject;
|
|
142
|
-
this.busy = this.#odShellService.busy;
|
|
143
|
-
/** Template rendered in the actions area, aligned to the right of the title row. */
|
|
144
|
-
this.actions = input(undefined, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
145
|
-
/** Template rendered in the badges area, aligned to the right of the subtitle row. */
|
|
146
|
-
this.badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
|
|
147
|
-
/**
|
|
148
|
-
* Virtual object type to use for retrieving header data
|
|
149
|
-
*/
|
|
150
|
-
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
151
|
-
/**
|
|
152
|
-
* Bucket of the object config to retrieve header data from
|
|
153
|
-
*/
|
|
154
|
-
this.bucket = input(undefined, ...(ngDevMode ? [{ debugName: "bucket" }] : /* istanbul ignore next */ []));
|
|
155
|
-
/**
|
|
156
|
-
* Whether to hide the header
|
|
157
|
-
*/
|
|
158
|
-
this.hideHeader = input(false, ...(ngDevMode ? [{ debugName: "hideHeader" }] : /* istanbul ignore next */ []));
|
|
159
|
-
this.#eventService
|
|
160
|
-
.on(YuvEventType.DMS_OBJECT_UPDATED, YuvEventType.DMS_OBJECT_DELETED)
|
|
161
|
-
.pipe(takeUntilDestroyed())
|
|
162
|
-
.subscribe((evt) => {
|
|
163
|
-
switch (evt.type) {
|
|
164
|
-
case YuvEventType.DMS_OBJECT_UPDATED: {
|
|
165
|
-
const obj = evt.data;
|
|
166
|
-
const dmsObj = this.dmsObject();
|
|
167
|
-
if (dmsObj?.id === obj.id)
|
|
168
|
-
this.#odShellService.setDmsObject(obj);
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
case YuvEventType.DMS_OBJECT_DELETED: {
|
|
172
|
-
if (evt.data?.id === this.dmsObject()?.id) {
|
|
173
|
-
this.#odShellService.setDmsObject(undefined);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
180
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ObjectDetailsShellComponent, isStandalone: true, selector: "yuv-object-details-shell", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, bucket: { classPropertyName: "bucket", publicName: "bucket", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let dmsObj = dmsObject();\n@if (dmsObj) {\n @if (!hideHeader()) {\n <yuv-object-details-header\n [dmsObject]=\"dmsObj\"\n [type]=\"type()\"\n [bucket]=\"bucket()\"\n [badges]=\"badges()\"\n [actions]=\"actions()\"\n />\n }\n <div class=\"content\" [yuvBusyOverlay]=\"busy()\">\n <ng-content />\n </div>\n} @else {\n <div class=\"empty\">\n @if (contextError()) {\n <div class=\"error\">{{ contextError() }}</div>\n } @else {\n <!-- EMPTY -->\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;position:relative;background-color:var(--ymt-surface)}:host .content{flex:1;overflow:hidden}:host .empty{height:100%;display:grid;align-items:center;justify-content:center}:host .empty .error{max-width:40ch;margin:var(--ymt-spacing-m);color:var(--ymt-text-color-subtle);padding:var(--ymt-spacing-s);border-radius:.5em;line-height:1.5em;border:1px solid var(--ymt-outline-variant)}\n"], dependencies: [{ kind: "component", type: ObjectDetailsHeaderComponent, selector: "yuv-object-details-header", inputs: ["dmsObject", "type", "bucket", "actions", "badges"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay", "yuvBusyOverlayConfig", "yuvBusyError"], outputs: ["yuvBusyErrorDismiss"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
181
|
-
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellComponent, decorators: [{
|
|
183
|
-
type: Component,
|
|
184
|
-
args: [{ selector: 'yuv-object-details-shell', standalone: true, imports: [ObjectDetailsHeaderComponent, MatTooltipModule, BusyOverlayDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dmsObj = dmsObject();\n@if (dmsObj) {\n @if (!hideHeader()) {\n <yuv-object-details-header\n [dmsObject]=\"dmsObj\"\n [type]=\"type()\"\n [bucket]=\"bucket()\"\n [badges]=\"badges()\"\n [actions]=\"actions()\"\n />\n }\n <div class=\"content\" [yuvBusyOverlay]=\"busy()\">\n <ng-content />\n </div>\n} @else {\n <div class=\"empty\">\n @if (contextError()) {\n <div class=\"error\">{{ contextError() }}</div>\n } @else {\n <!-- EMPTY -->\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;position:relative;background-color:var(--ymt-surface)}:host .content{flex:1;overflow:hidden}:host .empty{height:100%;display:grid;align-items:center;justify-content:center}:host .empty .error{max-width:40ch;margin:var(--ymt-spacing-m);color:var(--ymt-text-color-subtle);padding:var(--ymt-spacing-s);border-radius:.5em;line-height:1.5em;border:1px solid var(--ymt-outline-variant)}\n"] }]
|
|
185
|
-
}], ctorParameters: () => [], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], bucket: [{ type: i0.Input, args: [{ isSignal: true, alias: "bucket", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }] } });
|
|
186
|
-
|
|
187
28
|
class ObjectAuditComponent {
|
|
188
29
|
#dmsObjectEffect;
|
|
189
30
|
get objectID() {
|
|
@@ -341,7 +182,7 @@ class ObjectAuditComponent {
|
|
|
341
182
|
this.auditsRes.set(undefined);
|
|
342
183
|
this.error.set(true);
|
|
343
184
|
}
|
|
344
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectAuditComponent, deps: [{ token: i1
|
|
185
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectAuditComponent, deps: [{ token: i1.AuditService }, { token: i1.EventService }, { token: i1.SystemService }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
345
186
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ObjectAuditComponent, isStandalone: true, selector: "yuv-object-audit", inputs: { dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, skipActions: { classPropertyName: "skipActions", publicName: "skipActions", isSignal: true, isRequired: false, transformFunction: null }, allActions: { classPropertyName: "allActions", publicName: "allActions", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let auditsResult = auditsRes();\n\n<div\n class=\"yuv-audit\"\n [ngClass]=\"{ singleEntry: auditsResult?.items?.length === 1, onPage: auditsResult && auditsResult.page > 1 }\"\n [yuvBusyOverlay]=\"busy()\"\n>\n @if (error()) {\n <div class=\"error\">\n <div translate>yuv.audit.fetch.error</div>\n </div>\n }\n\n @if (auditsResult) {\n <!-- list of audits -->\n @let resItems = resolvedItems();\n @if (resItems.length) {\n <ul class=\"timeline\" [attr.aria-label]=\"'yuv.audit.timeline' | translate\">\n @for (item of resItems; track $index) {\n <li class=\"audit\" attr.aria-labelledby=\"'title-{{ $index }} creator-{{ $index }} date-{{ $index }}'\">\n <time [attr.datetime]=\"item.creationDate\" class=\"date\">{{ item.creationDate | localeDate }}</time>\n <div class=\"node\">\n <div class=\"label\">\n <span class=\"title\" id=\"title-{{ $index }}\">{{ item.label }}</span>\n <span class=\"version\">{{ 'yuv.audit.label.version' | translate: ({version: item.version}) }}</span>\n </div>\n <div class=\"more meta\">{{ item.more }}</div>\n <div class=\"creator meta\" id=\"creator-{{ $index }}\">{{ item.createdBy.title }}</div>\n </div>\n </li>\n }\n </ul>\n } @else {\n <div class=\"empty\" translate>yuv.audit.result.empty</div>\n }\n\n <!-- controls -->\n @if (auditsResult.hasMoreItems || auditsResult.page > 1) {\n <div class=\"footer\" yuvOfflineDisabled>\n <div class=\"paging\">\n <button\n ymtIconButton\n [attr.aria-label]=\"'yuv.audit.label.paging.prev' | translate\"\n [disabled]=\"auditsResult.page === 1\"\n (click)=\"goToPage(auditsResult.page - 1)\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <div class=\"page\">\n {{ auditsResult.page }}\n </div>\n <button\n ymtIconButton\n [attr.aria-label]=\"'yuv.audit.label.paging.next' | translate\"\n [disabled]=\"!auditsResult.hasMoreItems\"\n (click)=\"goToPage(auditsResult.page + 1)\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n }\n }\n</div>\n", styles: [":host{--_object-audit-panel-background: var(--object-audit-panel-background, var(--ymt-surface))}:host .yuv-audit{position:relative;height:100%;width:100%;display:grid;grid-template-columns:1fr;grid-template-rows:1fr auto;grid-template-areas:\"items\" \"footer\";background-color:var(--_object-audit-panel-background);container-type:inline-size;container-name:cmp}:host .yuv-audit .error{grid-area:items;display:flex;flex-flow:column;align-items:center;justify-content:center}:host .yuv-audit .error>div{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);margin:var(--ymt-spacing-m);padding:var(--ymt-spacing-m);border-radius:var(--ymt-spacing-xs)}:host .yuv-audit .audits{grid-area:items}:host .yuv-audit .empty{grid-area:items;display:flex;flex-flow:column;align-items:center;justify-content:center;color:var(--ymt-text-color-subtle)}:host .yuv-audit .footer{grid-area:footer;background-color:var(--ymt-surface);border-top:1px solid var(--ymt-outline-variant);display:flex}:host .yuv-audit .footer .paging{flex:1;display:flex;align-items:center;justify-content:flex-end;padding:var(--ymt-spacing-xs)}:host .yuv-audit .footer .paging .page{padding:0 var(--ymt-spacing-xs)}:host .timeline{--track-color: var(--ymt-outline-variant);--track-size: var(--ymt-spacing-4xl);margin-block-start:0;margin-block-end:0;overflow-y:auto;padding:var(--ymt-spacing-3xl) var(--ymt-spacing-2xs) var(--ymt-spacing-3xl) var(--ymt-spacing-l)}@container (max-width: 450px){:host .timeline .audit{grid-template-columns:var(--track-size) auto;grid-template-rows:var(--track-size) auto;grid-template-areas:\"line date\" \"node node\"}:host .timeline .audit .date{justify-self:start}:host .timeline .audit .date,:host .timeline .audit:after{translate:0 .5em}:host .timeline .audit .node{margin:0;width:100%}:host .timeline .audit:last-child:before{height:100%}}:host .timeline :where(.audit){display:grid;grid-template-columns:1fr var(--track-size) 6fr;grid-template-areas:\"date line node\"}:host .timeline :where(.audit) .date{grid-area:date;justify-self:end;align-self:center}:host .timeline :where(.audit) .node{grid-area:node;justify-self:start;background-color:var(--ymt-surface-panel);border:1px solid var(--ymt-outline-variant);border-radius:.25em;margin:var(--ymt-spacing-xs) 0;padding:var(--ymt-spacing-m);box-sizing:border-box;display:grid;gap:var(--ymt-spacing-3xs)}:host .timeline :where(.audit) .node .label{display:flex;align-items:center}:host .timeline :where(.audit) .node .label .title{flex:1;word-break:break-word;font-weight:700;color:var(--ymt-text-color)}:host .timeline :where(.audit) .node .label .version{line-height:1em;border-radius:2px;background-color:rgb(from var(--ymt-primary) r g b/.15);color:var(--ymt-primary);font:var(--ymt-font-body-subtle);font-family:monospace;align-self:center;margin-left:var(--ymt-spacing-m);padding:2px 4px;display:block}:host .timeline :where(.audit) .node .meta{color:var(--ymt-text-color-subtle)}:host .timeline :where(.audit):before{grid-area:line;content:\"\";width:calc(50% + 1px);height:100%;border-inline-end:2px solid var(--track-color)}:host .timeline :where(.audit):after{grid-area:line;content:\"\";width:14px;height:14px;border-radius:50%;border:2px solid var(--track-color);background-color:var(--ymt-surface-panel);box-sizing:border-box;align-self:center;justify-self:center}:host .timeline :where(.audit):first-child:before{height:50%;align-self:end}:host .timeline :where(.audit):last-child:before{height:50%;align-self:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay", "yuvBusyOverlayConfig", "yuvBusyError"], outputs: ["yuvBusyErrorDismiss"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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"] }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
346
187
|
}
|
|
347
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectAuditComponent, decorators: [{
|
|
@@ -355,7 +196,166 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
355
196
|
MatIconModule,
|
|
356
197
|
YmtIconButtonDirective
|
|
357
198
|
], template: "@let auditsResult = auditsRes();\n\n<div\n class=\"yuv-audit\"\n [ngClass]=\"{ singleEntry: auditsResult?.items?.length === 1, onPage: auditsResult && auditsResult.page > 1 }\"\n [yuvBusyOverlay]=\"busy()\"\n>\n @if (error()) {\n <div class=\"error\">\n <div translate>yuv.audit.fetch.error</div>\n </div>\n }\n\n @if (auditsResult) {\n <!-- list of audits -->\n @let resItems = resolvedItems();\n @if (resItems.length) {\n <ul class=\"timeline\" [attr.aria-label]=\"'yuv.audit.timeline' | translate\">\n @for (item of resItems; track $index) {\n <li class=\"audit\" attr.aria-labelledby=\"'title-{{ $index }} creator-{{ $index }} date-{{ $index }}'\">\n <time [attr.datetime]=\"item.creationDate\" class=\"date\">{{ item.creationDate | localeDate }}</time>\n <div class=\"node\">\n <div class=\"label\">\n <span class=\"title\" id=\"title-{{ $index }}\">{{ item.label }}</span>\n <span class=\"version\">{{ 'yuv.audit.label.version' | translate: ({version: item.version}) }}</span>\n </div>\n <div class=\"more meta\">{{ item.more }}</div>\n <div class=\"creator meta\" id=\"creator-{{ $index }}\">{{ item.createdBy.title }}</div>\n </div>\n </li>\n }\n </ul>\n } @else {\n <div class=\"empty\" translate>yuv.audit.result.empty</div>\n }\n\n <!-- controls -->\n @if (auditsResult.hasMoreItems || auditsResult.page > 1) {\n <div class=\"footer\" yuvOfflineDisabled>\n <div class=\"paging\">\n <button\n ymtIconButton\n [attr.aria-label]=\"'yuv.audit.label.paging.prev' | translate\"\n [disabled]=\"auditsResult.page === 1\"\n (click)=\"goToPage(auditsResult.page - 1)\"\n >\n <mat-icon>chevron_left</mat-icon>\n </button>\n <div class=\"page\">\n {{ auditsResult.page }}\n </div>\n <button\n ymtIconButton\n [attr.aria-label]=\"'yuv.audit.label.paging.next' | translate\"\n [disabled]=\"!auditsResult.hasMoreItems\"\n (click)=\"goToPage(auditsResult.page + 1)\"\n >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n }\n }\n</div>\n", styles: [":host{--_object-audit-panel-background: var(--object-audit-panel-background, var(--ymt-surface))}:host .yuv-audit{position:relative;height:100%;width:100%;display:grid;grid-template-columns:1fr;grid-template-rows:1fr auto;grid-template-areas:\"items\" \"footer\";background-color:var(--_object-audit-panel-background);container-type:inline-size;container-name:cmp}:host .yuv-audit .error{grid-area:items;display:flex;flex-flow:column;align-items:center;justify-content:center}:host .yuv-audit .error>div{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);margin:var(--ymt-spacing-m);padding:var(--ymt-spacing-m);border-radius:var(--ymt-spacing-xs)}:host .yuv-audit .audits{grid-area:items}:host .yuv-audit .empty{grid-area:items;display:flex;flex-flow:column;align-items:center;justify-content:center;color:var(--ymt-text-color-subtle)}:host .yuv-audit .footer{grid-area:footer;background-color:var(--ymt-surface);border-top:1px solid var(--ymt-outline-variant);display:flex}:host .yuv-audit .footer .paging{flex:1;display:flex;align-items:center;justify-content:flex-end;padding:var(--ymt-spacing-xs)}:host .yuv-audit .footer .paging .page{padding:0 var(--ymt-spacing-xs)}:host .timeline{--track-color: var(--ymt-outline-variant);--track-size: var(--ymt-spacing-4xl);margin-block-start:0;margin-block-end:0;overflow-y:auto;padding:var(--ymt-spacing-3xl) var(--ymt-spacing-2xs) var(--ymt-spacing-3xl) var(--ymt-spacing-l)}@container (max-width: 450px){:host .timeline .audit{grid-template-columns:var(--track-size) auto;grid-template-rows:var(--track-size) auto;grid-template-areas:\"line date\" \"node node\"}:host .timeline .audit .date{justify-self:start}:host .timeline .audit .date,:host .timeline .audit:after{translate:0 .5em}:host .timeline .audit .node{margin:0;width:100%}:host .timeline .audit:last-child:before{height:100%}}:host .timeline :where(.audit){display:grid;grid-template-columns:1fr var(--track-size) 6fr;grid-template-areas:\"date line node\"}:host .timeline :where(.audit) .date{grid-area:date;justify-self:end;align-self:center}:host .timeline :where(.audit) .node{grid-area:node;justify-self:start;background-color:var(--ymt-surface-panel);border:1px solid var(--ymt-outline-variant);border-radius:.25em;margin:var(--ymt-spacing-xs) 0;padding:var(--ymt-spacing-m);box-sizing:border-box;display:grid;gap:var(--ymt-spacing-3xs)}:host .timeline :where(.audit) .node .label{display:flex;align-items:center}:host .timeline :where(.audit) .node .label .title{flex:1;word-break:break-word;font-weight:700;color:var(--ymt-text-color)}:host .timeline :where(.audit) .node .label .version{line-height:1em;border-radius:2px;background-color:rgb(from var(--ymt-primary) r g b/.15);color:var(--ymt-primary);font:var(--ymt-font-body-subtle);font-family:monospace;align-self:center;margin-left:var(--ymt-spacing-m);padding:2px 4px;display:block}:host .timeline :where(.audit) .node .meta{color:var(--ymt-text-color-subtle)}:host .timeline :where(.audit):before{grid-area:line;content:\"\";width:calc(50% + 1px);height:100%;border-inline-end:2px solid var(--track-color)}:host .timeline :where(.audit):after{grid-area:line;content:\"\";width:14px;height:14px;border-radius:50%;border:2px solid var(--track-color);background-color:var(--ymt-surface-panel);box-sizing:border-box;align-self:center;justify-self:center}:host .timeline :where(.audit):first-child:before{height:50%;align-self:end}:host .timeline :where(.audit):last-child:before{height:50%;align-self:start}\n"] }]
|
|
358
|
-
}], ctorParameters: () => [{ type: i1
|
|
199
|
+
}], ctorParameters: () => [{ type: i1.AuditService }, { type: i1.EventService }, { type: i1.SystemService }, { type: i1.TranslateService }], propDecorators: { dmsObject: [{ type: i0.Input, args: [{ isSignal: true, alias: "dmsObject", required: false }] }], skipActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "skipActions", required: false }] }], allActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "allActions", required: false }] }] } });
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Component showing header data for a dms object. These will be
|
|
203
|
+
* generated from the object config for the given object.
|
|
204
|
+
*
|
|
205
|
+
* You could inject a set of actions into the headers actions slot
|
|
206
|
+
* by adding them to the components body:
|
|
207
|
+
*
|
|
208
|
+
* ```html
|
|
209
|
+
* <yuv-object-details-header [dmsObject]="obj">
|
|
210
|
+
* <ng-template #yuvHeaderActions>...</ng-template>
|
|
211
|
+
* </yuv-object-details-header>
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
class ObjectDetailsHeaderComponent {
|
|
215
|
+
#objectConfig;
|
|
216
|
+
#eventService;
|
|
217
|
+
constructor() {
|
|
218
|
+
this.#objectConfig = inject(ObjectConfigService);
|
|
219
|
+
this.#eventService = inject(EventService);
|
|
220
|
+
this.dmsObject = input(undefined, ...(ngDevMode ? [{ debugName: "dmsObject" }] : /* istanbul ignore next */ []));
|
|
221
|
+
/**
|
|
222
|
+
* Virtual object type to use for retrieving header data
|
|
223
|
+
*/
|
|
224
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
225
|
+
/**
|
|
226
|
+
* Bucket of the object config to retrieve header data from
|
|
227
|
+
*/
|
|
228
|
+
this.bucket = input(undefined, ...(ngDevMode ? [{ debugName: "bucket" }] : /* istanbul ignore next */ []));
|
|
229
|
+
/** Template rendered in the actions area, aligned to the right of the title row. */
|
|
230
|
+
this.actions = input(undefined, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
231
|
+
/** Template rendered in the badges area, aligned to the right of the subtitle row. */
|
|
232
|
+
this.badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
|
|
233
|
+
this.headerData = computed(() => {
|
|
234
|
+
const object = this.dmsObject();
|
|
235
|
+
const type = this.type();
|
|
236
|
+
return object && type ? this.#setHeaderData() : undefined;
|
|
237
|
+
}, ...(ngDevMode ? [{ debugName: "headerData" }] : /* istanbul ignore next */ []));
|
|
238
|
+
this.#eventService
|
|
239
|
+
.on(YuvEventType.DMS_OBJECT_UPDATED)
|
|
240
|
+
.pipe(takeUntilDestroyed())
|
|
241
|
+
.subscribe(() => this.#setHeaderData());
|
|
242
|
+
}
|
|
243
|
+
#setHeaderData() {
|
|
244
|
+
const object = this.dmsObject();
|
|
245
|
+
if (!object) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const roc = this.#objectConfig.getResolvedObjectConfig(object.data, this.type(), this.bucket());
|
|
250
|
+
return {
|
|
251
|
+
title: roc.title,
|
|
252
|
+
description: roc.description,
|
|
253
|
+
icon: roc.icon?.value
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
258
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ObjectDetailsHeaderComponent, isStandalone: true, selector: "yuv-object-details-header", inputs: { dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, bucket: { classPropertyName: "bucket", publicName: "bucket", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let dmsObj = dmsObject();\n@let headerD = headerData();\n@if (dmsObj && headerD) {\n <ymt-pane-header [icon]=\"headerD.icon\" [actions]=\"actions()\" [badges]=\"badges()\">\n <ng-template #yuvPaneHeaderTitle>\n <ng-container *yuvRenderer=\"headerD.title\" />\n </ng-template>\n <ng-template #yuvPaneHeaderSubtitle>\n <ng-container *yuvRenderer=\"headerD.description\" />\n </ng-template>\n </ymt-pane-header>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: YmtPanesModule }, { kind: "component", type: i1$1.YmtPaneHeaderComponent, selector: "ymt-pane-header", inputs: ["title", "icon", "subtitle", "actions", "badges"] }, { kind: "directive", type: RendererDirective, selector: "[yuvRenderer]", inputs: ["yuvRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
259
|
+
}
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsHeaderComponent, decorators: [{
|
|
261
|
+
type: Component,
|
|
262
|
+
args: [{ selector: 'yuv-object-details-header', imports: [MatIconModule, YmtPanesModule, RendererDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dmsObj = dmsObject();\n@let headerD = headerData();\n@if (dmsObj && headerD) {\n <ymt-pane-header [icon]=\"headerD.icon\" [actions]=\"actions()\" [badges]=\"badges()\">\n <ng-template #yuvPaneHeaderTitle>\n <ng-container *yuvRenderer=\"headerD.title\" />\n </ng-template>\n <ng-template #yuvPaneHeaderSubtitle>\n <ng-container *yuvRenderer=\"headerD.description\" />\n </ng-template>\n </ymt-pane-header>\n}\n" }]
|
|
263
|
+
}], ctorParameters: () => [], propDecorators: { dmsObject: [{ type: i0.Input, args: [{ isSignal: true, alias: "dmsObject", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], bucket: [{ type: i0.Input, args: [{ isSignal: true, alias: "bucket", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }] } });
|
|
264
|
+
|
|
265
|
+
class ObjectDetailsShellService {
|
|
266
|
+
constructor() {
|
|
267
|
+
this.id = Utils.uuid();
|
|
268
|
+
this.#dmsService = inject(DmsService);
|
|
269
|
+
this.translate = inject(TranslateService);
|
|
270
|
+
this.#dmsObject = signal(undefined, ...(ngDevMode ? [{ debugName: "#dmsObject" }] : /* istanbul ignore next */ []));
|
|
271
|
+
this.dmsObject = this.#dmsObject.asReadonly();
|
|
272
|
+
this.contextError = signal(undefined, ...(ngDevMode ? [{ debugName: "contextError" }] : /* istanbul ignore next */ []));
|
|
273
|
+
this.busy = signal(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
274
|
+
}
|
|
275
|
+
#dmsService;
|
|
276
|
+
#dmsObject;
|
|
277
|
+
setDmsObject(dmsObject) {
|
|
278
|
+
this.#dmsObject.set(dmsObject);
|
|
279
|
+
this.contextError.set(undefined);
|
|
280
|
+
}
|
|
281
|
+
fetchDmsObject(id) {
|
|
282
|
+
this.busy.set(true);
|
|
283
|
+
this.#dmsService
|
|
284
|
+
.getDmsObject(id)
|
|
285
|
+
.pipe(finalize(() => this.busy.set(false)))
|
|
286
|
+
.subscribe({
|
|
287
|
+
next: (dmsObject) => this.#dmsObject.set(dmsObject),
|
|
288
|
+
error: () => {
|
|
289
|
+
this.#dmsObject.set(undefined);
|
|
290
|
+
this.contextError.set(this.translate.instant('yuv.object-metadata.context.load.error'));
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
295
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService }); }
|
|
296
|
+
}
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellService, decorators: [{
|
|
298
|
+
type: Injectable
|
|
299
|
+
}] });
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Wrapper component for details of a dms object. This component
|
|
303
|
+
* provides a header based on the object configuration for the given object.
|
|
304
|
+
* It will also take care of loading the object if you only provide the objects ID.
|
|
305
|
+
*/
|
|
306
|
+
class ObjectDetailsShellComponent {
|
|
307
|
+
#eventService;
|
|
308
|
+
#odShellService;
|
|
309
|
+
constructor() {
|
|
310
|
+
this.#eventService = inject(EventService);
|
|
311
|
+
this.#odShellService = inject(ObjectDetailsShellService);
|
|
312
|
+
this.retentionState = signal(undefined, ...(ngDevMode ? [{ debugName: "retentionState" }] : /* istanbul ignore next */ []));
|
|
313
|
+
this.contextError = this.#odShellService.contextError;
|
|
314
|
+
this.dmsObject = this.#odShellService.dmsObject;
|
|
315
|
+
this.busy = this.#odShellService.busy;
|
|
316
|
+
/** Template rendered in the actions area, aligned to the right of the title row. */
|
|
317
|
+
this.actions = input(undefined, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
318
|
+
/** Template rendered in the badges area, aligned to the right of the subtitle row. */
|
|
319
|
+
this.badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
|
|
320
|
+
/**
|
|
321
|
+
* Virtual object type to use for retrieving header data
|
|
322
|
+
*/
|
|
323
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
324
|
+
/**
|
|
325
|
+
* Bucket of the object config to retrieve header data from
|
|
326
|
+
*/
|
|
327
|
+
this.bucket = input(undefined, ...(ngDevMode ? [{ debugName: "bucket" }] : /* istanbul ignore next */ []));
|
|
328
|
+
/**
|
|
329
|
+
* Whether to hide the header
|
|
330
|
+
*/
|
|
331
|
+
this.hideHeader = input(false, ...(ngDevMode ? [{ debugName: "hideHeader" }] : /* istanbul ignore next */ []));
|
|
332
|
+
this.#eventService
|
|
333
|
+
.on(YuvEventType.DMS_OBJECT_UPDATED, YuvEventType.DMS_OBJECT_DELETED)
|
|
334
|
+
.pipe(takeUntilDestroyed())
|
|
335
|
+
.subscribe((evt) => {
|
|
336
|
+
switch (evt.type) {
|
|
337
|
+
case YuvEventType.DMS_OBJECT_UPDATED: {
|
|
338
|
+
const obj = evt.data;
|
|
339
|
+
const dmsObj = this.dmsObject();
|
|
340
|
+
if (dmsObj?.id === obj.id)
|
|
341
|
+
this.#odShellService.setDmsObject(obj);
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
case YuvEventType.DMS_OBJECT_DELETED: {
|
|
345
|
+
if (evt.data?.id === this.dmsObject()?.id) {
|
|
346
|
+
this.#odShellService.setDmsObject(undefined);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ObjectDetailsShellComponent, isStandalone: true, selector: "yuv-object-details-shell", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, bucket: { classPropertyName: "bucket", publicName: "bucket", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let dmsObj = dmsObject();\n@if (dmsObj) {\n @if (!hideHeader()) {\n <yuv-object-details-header\n [dmsObject]=\"dmsObj\"\n [type]=\"type()\"\n [bucket]=\"bucket()\"\n [badges]=\"badges()\"\n [actions]=\"actions()\"\n />\n }\n <div class=\"content\" [yuvBusyOverlay]=\"busy()\">\n <ng-content />\n </div>\n} @else {\n <div class=\"empty\">\n @if (contextError()) {\n <div class=\"error\">{{ contextError() }}</div>\n } @else {\n <!-- EMPTY -->\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;position:relative;background-color:var(--ymt-surface)}:host .content{flex:1;overflow:hidden}:host .empty{height:100%;display:grid;align-items:center;justify-content:center}:host .empty .error{max-width:40ch;margin:var(--ymt-spacing-m);color:var(--ymt-text-color-subtle);padding:var(--ymt-spacing-s);border-radius:.5em;line-height:1.5em;border:1px solid var(--ymt-outline-variant)}\n"], dependencies: [{ kind: "component", type: ObjectDetailsHeaderComponent, selector: "yuv-object-details-header", inputs: ["dmsObject", "type", "bucket", "actions", "badges"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay", "yuvBusyOverlayConfig", "yuvBusyError"], outputs: ["yuvBusyErrorDismiss"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
354
|
+
}
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ObjectDetailsShellComponent, decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{ selector: 'yuv-object-details-shell', standalone: true, imports: [ObjectDetailsHeaderComponent, MatTooltipModule, BusyOverlayDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dmsObj = dmsObject();\n@if (dmsObj) {\n @if (!hideHeader()) {\n <yuv-object-details-header\n [dmsObject]=\"dmsObj\"\n [type]=\"type()\"\n [bucket]=\"bucket()\"\n [badges]=\"badges()\"\n [actions]=\"actions()\"\n />\n }\n <div class=\"content\" [yuvBusyOverlay]=\"busy()\">\n <ng-content />\n </div>\n} @else {\n <div class=\"empty\">\n @if (contextError()) {\n <div class=\"error\">{{ contextError() }}</div>\n } @else {\n <!-- EMPTY -->\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;position:relative;background-color:var(--ymt-surface)}:host .content{flex:1;overflow:hidden}:host .empty{height:100%;display:grid;align-items:center;justify-content:center}:host .empty .error{max-width:40ch;margin:var(--ymt-spacing-m);color:var(--ymt-text-color-subtle);padding:var(--ymt-spacing-s);border-radius:.5em;line-height:1.5em;border:1px solid var(--ymt-outline-variant)}\n"] }]
|
|
358
|
+
}], ctorParameters: () => [], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], bucket: [{ type: i0.Input, args: [{ isSignal: true, alias: "bucket", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }] } });
|
|
359
359
|
|
|
360
360
|
class ObjectMetadataSectionComponent {
|
|
361
361
|
constructor() {
|
|
@@ -820,5 +820,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
820
820
|
* Generated bundle index. Do not edit.
|
|
821
821
|
*/
|
|
822
822
|
|
|
823
|
-
export { FormSectionGroupPipe, ObjectAuditComponent, ObjectDetailsComponent, ObjectDetailsHeaderComponent, ObjectDetailsShellComponent, ObjectDetailsShellService, ObjectMetadataComponent, YuvObjectDetailsModule };
|
|
823
|
+
export { FormSectionGroupPipe, ObjectAuditComponent, ObjectDetailsComponent, ObjectDetailsHeaderComponent, ObjectDetailsShellComponent, ObjectDetailsShellService, ObjectMetadataComponent, ObjectMetadataSectionComponent, YuvObjectDetailsModule };
|
|
824
824
|
//# sourceMappingURL=yuuvis-client-framework-object-details.mjs.map
|