@yuuvis/client-framework 2.1.8 → 2.1.10
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/common/lib/services/layout-settings/layout-settings.service.d.ts +1 -0
- package/fesm2022/yuuvis-client-framework-common.mjs +3 -2
- package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-list.mjs +7 -2
- package/fesm2022/yuuvis-client-framework-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +48 -18
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-details.mjs +23 -8
- package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-summary.mjs +120 -118
- package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-versions.mjs +177 -0
- package/fesm2022/yuuvis-client-framework-object-versions.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-overflow-hidden.mjs +70 -0
- package/fesm2022/yuuvis-client-framework-overflow-hidden.mjs.map +1 -0
- package/fesm2022/yuuvis-client-framework-widget-grid.mjs +7 -4
- package/fesm2022/yuuvis-client-framework-widget-grid.mjs.map +1 -1
- package/lib/assets/i18n/de.json +8 -0
- package/lib/assets/i18n/en.json +8 -0
- package/list/lib/list.component.d.ts +1 -0
- package/metadata-form/lib/metadata-form-element-registry.service.d.ts +1 -0
- package/metadata-form/lib/object-metadata-element-template.directive.d.ts +23 -5
- package/object-details/lib/object-details-header/object-details-header.component.d.ts +12 -1
- package/object-details/lib/object-details.component.d.ts +5 -0
- package/object-form/README.md +43 -0
- package/object-summary/lib/object-summary.module.d.ts +7 -5
- package/object-versions/README.md +3 -0
- package/object-versions/index.d.ts +2 -0
- package/object-versions/lib/object-versions.component.d.ts +30 -0
- package/object-versions/lib/object-versions.module.d.ts +7 -0
- package/overflow-hidden/README.md +3 -0
- package/overflow-hidden/index.d.ts +2 -0
- package/overflow-hidden/lib/overflow-hidden.component.d.ts +19 -0
- package/overflow-hidden/lib/overflow-hidden.module.d.ts +7 -0
- package/package.json +12 -4
- package/widget-grid/lib/widget-grid.component.d.ts +1 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, viewChild, effect, input, output, signal, untracked, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i6 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import * as i5 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i4 from '@angular/material/tabs';
|
|
8
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
9
|
+
import * as i7 from '@angular/material/tooltip';
|
|
10
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
11
|
+
import * as i2 from '@yuuvis/client-core';
|
|
12
|
+
import { DmsService, TranslateService, TranslateModule, LocaleDatePipe } from '@yuuvis/client-core';
|
|
13
|
+
import { LayoutSettingsService, ConfirmService, BusyOverlayDirective } from '@yuuvis/client-framework/common';
|
|
14
|
+
import * as i3 from '@yuuvis/client-framework/list';
|
|
15
|
+
import { ListComponent, YuvListModule } from '@yuuvis/client-framework/list';
|
|
16
|
+
import { ObjectDetailsHeaderComponent } from '@yuuvis/client-framework/object-details';
|
|
17
|
+
import { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';
|
|
18
|
+
import { ObjectSummaryDataComponent } from '@yuuvis/client-framework/object-summary';
|
|
19
|
+
import * as i1 from '@yuuvis/client-framework/split-view';
|
|
20
|
+
import { YuvSplitViewModule } from '@yuuvis/client-framework/split-view';
|
|
21
|
+
import { switchMap, finalize } from 'rxjs';
|
|
22
|
+
|
|
23
|
+
class ObjectVersionsComponent {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.#layoutSettingsService = inject(LayoutSettingsService);
|
|
26
|
+
this.#dmsService = inject(DmsService);
|
|
27
|
+
this.#confirm = inject(ConfirmService);
|
|
28
|
+
this.translate = inject(TranslateService);
|
|
29
|
+
this.versionList = viewChild(ListComponent);
|
|
30
|
+
this.#versionListEffect = effect(() => {
|
|
31
|
+
const list = this.versionList();
|
|
32
|
+
if (list)
|
|
33
|
+
setTimeout(() => list.focus(), 100);
|
|
34
|
+
this.#preSelect();
|
|
35
|
+
});
|
|
36
|
+
this.dmsObject = input.required();
|
|
37
|
+
this.#dmsObjectEffect = effect(() => {
|
|
38
|
+
const o = this.dmsObject();
|
|
39
|
+
// this.selectedVersion.set(o);
|
|
40
|
+
if (o)
|
|
41
|
+
this.#fetchVersions(o);
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Object type to use for retrieving header data
|
|
45
|
+
*/
|
|
46
|
+
this.type = input.required();
|
|
47
|
+
/**
|
|
48
|
+
* If the object config for the given type has been stored in a certain bucket, this
|
|
49
|
+
* bucket can be provided here. If no bucket is set, the config will be retrieved
|
|
50
|
+
* from the main object config
|
|
51
|
+
*/
|
|
52
|
+
this.objectConfigBucket = input(undefined);
|
|
53
|
+
this.objectRestored = output();
|
|
54
|
+
this.splitGutterSize = this.#layoutSettingsService.DEFAULT_SPLIT_VIEW_GUTTER_SIZE;
|
|
55
|
+
this.busy = signal(false);
|
|
56
|
+
this.versions = signal([]);
|
|
57
|
+
this.#versionsEffect = effect(() => {
|
|
58
|
+
const v = this.versions();
|
|
59
|
+
untracked(() => {
|
|
60
|
+
this.#preSelect();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
this.selectedVersion = signal(undefined);
|
|
64
|
+
this.error = signal(undefined);
|
|
65
|
+
}
|
|
66
|
+
#layoutSettingsService;
|
|
67
|
+
#dmsService;
|
|
68
|
+
#confirm;
|
|
69
|
+
#versionListEffect;
|
|
70
|
+
#dmsObjectEffect;
|
|
71
|
+
#versionsEffect;
|
|
72
|
+
#preSelect() {
|
|
73
|
+
const vl = this.versionList();
|
|
74
|
+
if (vl && !this.selectedVersion()) {
|
|
75
|
+
vl.select(0);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
itemSelected(selectedIndex) {
|
|
79
|
+
const idx = selectedIndex[0];
|
|
80
|
+
this.selectedVersion.set(this.versions()[idx]);
|
|
81
|
+
}
|
|
82
|
+
downloadCurrentVersion() {
|
|
83
|
+
const o = this.selectedVersion();
|
|
84
|
+
if (o)
|
|
85
|
+
this.#dmsService.downloadContent([o], true);
|
|
86
|
+
}
|
|
87
|
+
restoreCurrentVersion() {
|
|
88
|
+
const o = this.selectedVersion();
|
|
89
|
+
if (o) {
|
|
90
|
+
this.#confirm
|
|
91
|
+
.confirm({
|
|
92
|
+
title: this.translate.instant('yuv.object-versions.actions.restore'),
|
|
93
|
+
message: this.translate.instant('yuv.object-versions.actions.restore.confirm.message', {
|
|
94
|
+
version: o.version
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
.subscribe((confirmed) => {
|
|
98
|
+
if (confirmed)
|
|
99
|
+
this.#executeRestoreCurrentVersion(o);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
#executeRestoreCurrentVersion(version) {
|
|
104
|
+
this.busy.set(true);
|
|
105
|
+
this.#dmsService
|
|
106
|
+
.restoreDmsObject(version.id, version.version)
|
|
107
|
+
.pipe(switchMap((dmsObject) => this.#dmsService.getDmsObjectVersions(dmsObject.id)), finalize(() => this.busy.set(false)))
|
|
108
|
+
.subscribe({
|
|
109
|
+
next: (versions) => {
|
|
110
|
+
this.versions.set(versions);
|
|
111
|
+
this.versionList()?.select(0);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
#fetchVersions(dmsObject) {
|
|
116
|
+
// if the dms object only has one version we do not need to ask the backend
|
|
117
|
+
if (dmsObject.version === 1) {
|
|
118
|
+
this.versions.set([dmsObject]);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.busy.set(true);
|
|
122
|
+
this.#dmsService
|
|
123
|
+
.getDmsObjectVersions(dmsObject.id)
|
|
124
|
+
.pipe(finalize(() => this.busy.set(false)))
|
|
125
|
+
.subscribe({
|
|
126
|
+
next: (versions) => {
|
|
127
|
+
this.versions.set(versions);
|
|
128
|
+
},
|
|
129
|
+
error: (e) => {
|
|
130
|
+
// TODO: handle errors
|
|
131
|
+
this.error.set(this.translate.instant('yuv.object-versions.error.fetch-versions'));
|
|
132
|
+
console.error(e);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: ObjectVersionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.12", type: ObjectVersionsComponent, isStandalone: true, selector: "yuv-object-versions", inputs: { dmsObject: { classPropertyName: "dmsObject", publicName: "dmsObject", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, objectConfigBucket: { classPropertyName: "objectConfigBucket", publicName: "objectConfigBucket", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { objectRestored: "objectRestored" }, viewQueries: [{ propertyName: "versionList", first: true, predicate: ListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let err = error();\n@if (!err) {\n <yuv-split-view [gutterSize]=\"splitGutterSize\" layoutSettingsID=\"yuv.object-versions.split\">\n <!-- version details -->\n <ng-template yuvSplitArea [size]=\"60\">\n <div class=\"version-details ymt-panel\" [yuvBusyOverlay]=\"busy()\">\n @let selected = selectedVersion();\n @if (selected) {\n <yuv-object-details-header [dmsObject]=\"selected\" [type]=\"type()\" [bucket]=\"objectConfigBucket()\">\n <ng-template #yuvHeaderActions>\n <button mat-icon-button (click)=\"downloadCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.download' | translate\">\n <mat-icon>download</mat-icon>\n </button>\n <button mat-icon-button (click)=\"restoreCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.restore' | translate\">\n <mat-icon>restore_page</mat-icon>\n </button>\n </ng-template>\n </yuv-object-details-header>\n\n <mat-tab-group class=\"version-tabs\">\n <mat-tab [label]=\"'yuv.object-versions.tabs.content.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-preview [dmsObject]=\"selected\" [version]=\"selected.version\"></yuv-object-preview>\n </ng-template>\n </mat-tab>\n <mat-tab [label]=\"'yuv.object-versions.tabs.indexdata.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-summary-data [dmsObject]=\"selected\"></yuv-object-summary-data>\n </ng-template> </mat-tab\n ></mat-tab-group>\n }\n </div>\n </ng-template>\n\n <!-- versions list -->\n <ng-template yuvSplitArea [size]=\"40\">\n <div class=\"version-list ymt-panel\">\n <yuv-list selectOnEnter=\"true\" (itemSelect)=\"itemSelected($event)\">\n @for (v of versions(); track v.version) {\n <div class=\"version\" yuvListItem>\n <div class=\"label\">{{ 'yuv.object-versions.list.version' | translate: { version: v.version } }}</div>\n\n <span class=\"modified-on\">{{ v.modified.on | localeDate }}</span>\n <span class=\"modified-by\">{{ v.modified.by.title }}</span>\n </div>\n }\n </yuv-list>\n </div>\n </ng-template>\n </yuv-split-view>\n} @else {\n <div class=\"error\">\n <p>{{ err }}</p>\n </div>\n}\n", styles: [":host{display:block}:host .ymt-panel{background-color:var(--ymt-surface);border:1px solid var(--ymt-outline-variant);border-radius:var(--ymt-corner-m)}:host .ymt-panel{height:100%;overflow:hidden}:host mat-tab-group{overflow:hidden;height:100%}:host mat-tab-group ::ng-deep .mat-mdc-tab-body-wrapper{height:100%}:host .version{display:grid;grid-template-rows:auto auto;grid-template-columns:1fr auto;grid-template-areas:\"version version\" \"by on\";border-block-end:1px solid var(--ymt-outline-variant);padding:var(--ymt-spacing-s) var(--ymt-spacing-l);gap:var(--ymt-spacing-s)}:host .version .label{grid-area:version;font:var(--ymt-font-title-small)}:host .version .modified-by{grid-area:by;font:var(--ymt-font-body);color:var(--ymt-text-color-subtle)}:host .version .modified-on{grid-area:on;font:var(--ymt-font-body);color:var(--ymt-text-color-subtle)}:host .error{height:100%;display:flex;align-items:center;justify-content:center}:host .error>p{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);border:var(--ymt-danger);padding:var(--ymt-spacing-xs);border-radius:var(--ymt-corner-xs)}\n"], dependencies: [{ kind: "ngmodule", type: YuvSplitViewModule }, { kind: "directive", type: i1.SplitAreaDirective, selector: "[yuvSplitArea]", inputs: ["size", "minSize", "maxSize", "panelClass", "visible"] }, { kind: "component", type: i1.SplitViewComponent, selector: "yuv-split-view", inputs: ["direction", "gutterSize", "restrictMove", "disabled", "layoutSettingsID"], outputs: ["layoutSettingsChange", "dragStart", "dragEnd", "gutterClick", "gutterDblClick"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: ObjectPreviewComponent, selector: "yuv-object-preview", inputs: ["objectId", "dmsObject", "version"] }, { kind: "component", type: ObjectDetailsHeaderComponent, selector: "yuv-object-details-header", inputs: ["dmsObject", "type", "bucket"] }, { kind: "ngmodule", type: YuvListModule }, { kind: "component", type: i3.ListComponent, selector: "yuv-list", inputs: ["multiselect", "selfHandleSelection", "disableSelection"], outputs: ["itemSelect", "itemFocus"] }, { kind: "directive", type: i3.ListItemDirective, selector: "[yuvListItem]", inputs: ["disabled", "active", "selected"] }, { kind: "directive", type: BusyOverlayDirective, selector: "[yuvBusyOverlay]", inputs: ["yuvBusyOverlay"] }, { kind: "component", type: ObjectSummaryDataComponent, selector: "yuv-object-summary-data", inputs: ["dmsObject"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i4.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i4.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i4.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: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }] }); }
|
|
139
|
+
}
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: ObjectVersionsComponent, decorators: [{
|
|
141
|
+
type: Component,
|
|
142
|
+
args: [{ selector: 'yuv-object-versions', imports: [
|
|
143
|
+
YuvSplitViewModule,
|
|
144
|
+
TranslateModule,
|
|
145
|
+
ObjectPreviewComponent,
|
|
146
|
+
ObjectDetailsHeaderComponent,
|
|
147
|
+
YuvListModule,
|
|
148
|
+
BusyOverlayDirective,
|
|
149
|
+
ObjectSummaryDataComponent,
|
|
150
|
+
MatTabsModule,
|
|
151
|
+
MatIconModule,
|
|
152
|
+
MatButtonModule,
|
|
153
|
+
MatTooltipModule,
|
|
154
|
+
LocaleDatePipe
|
|
155
|
+
], template: "@let err = error();\n@if (!err) {\n <yuv-split-view [gutterSize]=\"splitGutterSize\" layoutSettingsID=\"yuv.object-versions.split\">\n <!-- version details -->\n <ng-template yuvSplitArea [size]=\"60\">\n <div class=\"version-details ymt-panel\" [yuvBusyOverlay]=\"busy()\">\n @let selected = selectedVersion();\n @if (selected) {\n <yuv-object-details-header [dmsObject]=\"selected\" [type]=\"type()\" [bucket]=\"objectConfigBucket()\">\n <ng-template #yuvHeaderActions>\n <button mat-icon-button (click)=\"downloadCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.download' | translate\">\n <mat-icon>download</mat-icon>\n </button>\n <button mat-icon-button (click)=\"restoreCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.restore' | translate\">\n <mat-icon>restore_page</mat-icon>\n </button>\n </ng-template>\n </yuv-object-details-header>\n\n <mat-tab-group class=\"version-tabs\">\n <mat-tab [label]=\"'yuv.object-versions.tabs.content.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-preview [dmsObject]=\"selected\" [version]=\"selected.version\"></yuv-object-preview>\n </ng-template>\n </mat-tab>\n <mat-tab [label]=\"'yuv.object-versions.tabs.indexdata.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-summary-data [dmsObject]=\"selected\"></yuv-object-summary-data>\n </ng-template> </mat-tab\n ></mat-tab-group>\n }\n </div>\n </ng-template>\n\n <!-- versions list -->\n <ng-template yuvSplitArea [size]=\"40\">\n <div class=\"version-list ymt-panel\">\n <yuv-list selectOnEnter=\"true\" (itemSelect)=\"itemSelected($event)\">\n @for (v of versions(); track v.version) {\n <div class=\"version\" yuvListItem>\n <div class=\"label\">{{ 'yuv.object-versions.list.version' | translate: { version: v.version } }}</div>\n\n <span class=\"modified-on\">{{ v.modified.on | localeDate }}</span>\n <span class=\"modified-by\">{{ v.modified.by.title }}</span>\n </div>\n }\n </yuv-list>\n </div>\n </ng-template>\n </yuv-split-view>\n} @else {\n <div class=\"error\">\n <p>{{ err }}</p>\n </div>\n}\n", styles: [":host{display:block}:host .ymt-panel{background-color:var(--ymt-surface);border:1px solid var(--ymt-outline-variant);border-radius:var(--ymt-corner-m)}:host .ymt-panel{height:100%;overflow:hidden}:host mat-tab-group{overflow:hidden;height:100%}:host mat-tab-group ::ng-deep .mat-mdc-tab-body-wrapper{height:100%}:host .version{display:grid;grid-template-rows:auto auto;grid-template-columns:1fr auto;grid-template-areas:\"version version\" \"by on\";border-block-end:1px solid var(--ymt-outline-variant);padding:var(--ymt-spacing-s) var(--ymt-spacing-l);gap:var(--ymt-spacing-s)}:host .version .label{grid-area:version;font:var(--ymt-font-title-small)}:host .version .modified-by{grid-area:by;font:var(--ymt-font-body);color:var(--ymt-text-color-subtle)}:host .version .modified-on{grid-area:on;font:var(--ymt-font-body);color:var(--ymt-text-color-subtle)}:host .error{height:100%;display:flex;align-items:center;justify-content:center}:host .error>p{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);border:var(--ymt-danger);padding:var(--ymt-spacing-xs);border-radius:var(--ymt-corner-xs)}\n"] }]
|
|
156
|
+
}] });
|
|
157
|
+
|
|
158
|
+
const cmp = [ObjectVersionsComponent];
|
|
159
|
+
class YuvObjectVersionsModule {
|
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvObjectVersionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
161
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.12", ngImport: i0, type: YuvObjectVersionsModule, imports: [ObjectVersionsComponent], exports: [ObjectVersionsComponent] }); }
|
|
162
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvObjectVersionsModule, imports: [cmp] }); }
|
|
163
|
+
}
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvObjectVersionsModule, decorators: [{
|
|
165
|
+
type: NgModule,
|
|
166
|
+
args: [{
|
|
167
|
+
imports: cmp,
|
|
168
|
+
exports: cmp
|
|
169
|
+
}]
|
|
170
|
+
}] });
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Generated bundle index. Do not edit.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export { ObjectVersionsComponent, YuvObjectVersionsModule };
|
|
177
|
+
//# sourceMappingURL=yuuvis-client-framework-object-versions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yuuvis-client-framework-object-versions.mjs","sources":["../../../../../libs/yuuvis/client-framework/object-versions/src/lib/object-versions.component.ts","../../../../../libs/yuuvis/client-framework/object-versions/src/lib/object-versions.component.html","../../../../../libs/yuuvis/client-framework/object-versions/src/lib/object-versions.module.ts","../../../../../libs/yuuvis/client-framework/object-versions/src/yuuvis-client-framework-object-versions.ts"],"sourcesContent":["import { Component, effect, inject, input, output, signal, untracked, viewChild } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { DmsObject, DmsService, LocaleDatePipe, TranslateModule, TranslateService, VirtualObjectType } from '@yuuvis/client-core';\nimport { BusyOverlayDirective, ConfirmService, LayoutSettingsService } from '@yuuvis/client-framework/common';\nimport { ListComponent, YuvListModule } from '@yuuvis/client-framework/list';\nimport { ObjectDetailsHeaderComponent } from '@yuuvis/client-framework/object-details';\nimport { ObjectPreviewComponent } from '@yuuvis/client-framework/object-preview';\nimport { ObjectSummaryDataComponent } from '@yuuvis/client-framework/object-summary';\nimport { YuvSplitViewModule } from '@yuuvis/client-framework/split-view';\nimport { finalize, switchMap } from 'rxjs';\n\n@Component({\n selector: 'yuv-object-versions',\n imports: [\n YuvSplitViewModule,\n TranslateModule,\n ObjectPreviewComponent,\n ObjectDetailsHeaderComponent,\n YuvListModule,\n BusyOverlayDirective,\n ObjectSummaryDataComponent,\n MatTabsModule,\n MatIconModule,\n MatButtonModule,\n MatTooltipModule,\n LocaleDatePipe\n ],\n templateUrl: './object-versions.component.html',\n styleUrl: './object-versions.component.scss'\n})\nexport class ObjectVersionsComponent {\n #layoutSettingsService = inject(LayoutSettingsService);\n #dmsService = inject(DmsService);\n #confirm = inject(ConfirmService);\n\n private translate = inject(TranslateService);\n\n versionList = viewChild(ListComponent);\n #versionListEffect = effect(() => {\n const list = this.versionList();\n\n if (list) setTimeout(() => list.focus(), 100);\n this.#preSelect();\n });\n\n dmsObject = input.required<DmsObject>();\n #dmsObjectEffect = effect(() => {\n const o = this.dmsObject();\n // this.selectedVersion.set(o);\n if (o) this.#fetchVersions(o);\n });\n\n /**\n * Object type to use for retrieving header data\n */\n type = input.required<VirtualObjectType>();\n /**\n * If the object config for the given type has been stored in a certain bucket, this\n * bucket can be provided here. If no bucket is set, the config will be retrieved\n * from the main object config\n */\n objectConfigBucket = input<string | undefined>(undefined);\n\n objectRestored = output<number>();\n\n splitGutterSize = this.#layoutSettingsService.DEFAULT_SPLIT_VIEW_GUTTER_SIZE;\n busy = signal<boolean>(false);\n versions = signal<DmsObject[]>([]);\n #versionsEffect = effect(() => {\n const v = this.versions();\n untracked(() => {\n this.#preSelect();\n });\n });\n selectedVersion = signal<DmsObject | undefined>(undefined);\n error = signal<string | undefined>(undefined);\n\n #preSelect() {\n const vl = this.versionList();\n if (vl && !this.selectedVersion()) {\n vl.select(0);\n }\n }\n\n itemSelected(selectedIndex: number[]) {\n const idx = selectedIndex[0];\n this.selectedVersion.set(this.versions()[idx]);\n }\n\n downloadCurrentVersion() {\n const o = this.selectedVersion();\n if (o) this.#dmsService.downloadContent([o], true);\n }\n\n restoreCurrentVersion() {\n const o = this.selectedVersion();\n if (o) {\n this.#confirm\n .confirm({\n title: this.translate.instant('yuv.object-versions.actions.restore'),\n message: this.translate.instant('yuv.object-versions.actions.restore.confirm.message', {\n version: o.version\n })\n })\n .subscribe((confirmed: boolean) => {\n if (confirmed) this.#executeRestoreCurrentVersion(o);\n });\n }\n }\n\n #executeRestoreCurrentVersion(version: DmsObject) {\n this.busy.set(true);\n this.#dmsService\n .restoreDmsObject(version.id, version.version)\n .pipe(\n switchMap((dmsObject: DmsObject) => this.#dmsService.getDmsObjectVersions(dmsObject.id)),\n finalize(() => this.busy.set(false))\n )\n .subscribe({\n next: (versions: DmsObject[]) => {\n this.versions.set(versions);\n this.versionList()?.select(0);\n }\n });\n }\n\n #fetchVersions(dmsObject: DmsObject) {\n // if the dms object only has one version we do not need to ask the backend\n if (dmsObject.version === 1) {\n this.versions.set([dmsObject]);\n } else {\n this.busy.set(true);\n this.#dmsService\n .getDmsObjectVersions(dmsObject.id)\n .pipe(finalize(() => this.busy.set(false)))\n .subscribe({\n next: (versions: DmsObject[]) => {\n this.versions.set(versions);\n },\n error: (e) => {\n // TODO: handle errors\n this.error.set(this.translate.instant('yuv.object-versions.error.fetch-versions'));\n console.error(e);\n }\n });\n }\n }\n}\n","@let err = error();\n@if (!err) {\n <yuv-split-view [gutterSize]=\"splitGutterSize\" layoutSettingsID=\"yuv.object-versions.split\">\n <!-- version details -->\n <ng-template yuvSplitArea [size]=\"60\">\n <div class=\"version-details ymt-panel\" [yuvBusyOverlay]=\"busy()\">\n @let selected = selectedVersion();\n @if (selected) {\n <yuv-object-details-header [dmsObject]=\"selected\" [type]=\"type()\" [bucket]=\"objectConfigBucket()\">\n <ng-template #yuvHeaderActions>\n <button mat-icon-button (click)=\"downloadCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.download' | translate\">\n <mat-icon>download</mat-icon>\n </button>\n <button mat-icon-button (click)=\"restoreCurrentVersion()\" [matTooltip]=\"'yuv.object-versions.actions.restore' | translate\">\n <mat-icon>restore_page</mat-icon>\n </button>\n </ng-template>\n </yuv-object-details-header>\n\n <mat-tab-group class=\"version-tabs\">\n <mat-tab [label]=\"'yuv.object-versions.tabs.content.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-preview [dmsObject]=\"selected\" [version]=\"selected.version\"></yuv-object-preview>\n </ng-template>\n </mat-tab>\n <mat-tab [label]=\"'yuv.object-versions.tabs.indexdata.title' | translate\">\n <ng-template matTabContent>\n <yuv-object-summary-data [dmsObject]=\"selected\"></yuv-object-summary-data>\n </ng-template> </mat-tab\n ></mat-tab-group>\n }\n </div>\n </ng-template>\n\n <!-- versions list -->\n <ng-template yuvSplitArea [size]=\"40\">\n <div class=\"version-list ymt-panel\">\n <yuv-list selectOnEnter=\"true\" (itemSelect)=\"itemSelected($event)\">\n @for (v of versions(); track v.version) {\n <div class=\"version\" yuvListItem>\n <div class=\"label\">{{ 'yuv.object-versions.list.version' | translate: { version: v.version } }}</div>\n\n <span class=\"modified-on\">{{ v.modified.on | localeDate }}</span>\n <span class=\"modified-by\">{{ v.modified.by.title }}</span>\n </div>\n }\n </yuv-list>\n </div>\n </ng-template>\n </yuv-split-view>\n} @else {\n <div class=\"error\">\n <p>{{ err }}</p>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { ObjectVersionsComponent } from './object-versions.component';\n\nconst cmp = [ObjectVersionsComponent];\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YuvObjectVersionsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAiCa,uBAAuB,CAAA;AAnBpC,IAAA,WAAA,GAAA;AAoBE,QAAA,IAAA,CAAA,sBAAsB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACtD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC;AAEzB,QAAA,IAAA,CAAA,SAAS,G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AuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAvB,uBAAuB,EAAA,OAAA,EAAA,CALvB,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAAvB,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAKvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAHzB,GAAG,CAAA,EAAA,CAAA,CAAA;;4FAGD,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,GAAG;AACZ,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, contentChild, signal, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This component is designed to switch the rendered content when it is overflowing due to
|
|
8
|
+
* resizing. If there is enough available space you can render the 'real' component. If there
|
|
9
|
+
* is not enough space to render the whole component anymore (it would overflow) another component
|
|
10
|
+
* can take it's place. If you do not specify that replace-component, the component will just
|
|
11
|
+
* disappear and make room for other more important components.
|
|
12
|
+
*/
|
|
13
|
+
class OverflowHiddenComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.#elRef = inject(ElementRef);
|
|
16
|
+
// component/content to be rendered when there is enough space
|
|
17
|
+
this.defaultSlot = contentChild.required('yuvDefaultSlot');
|
|
18
|
+
// component/content to be rendered when the default component overflows
|
|
19
|
+
this.overflowSlot = contentChild('yuvOverflowSlot');
|
|
20
|
+
this.overflow = signal(false);
|
|
21
|
+
}
|
|
22
|
+
#elRef;
|
|
23
|
+
#contentObserver;
|
|
24
|
+
#initObserver() {
|
|
25
|
+
this.#contentObserver = new IntersectionObserver((entries) => {
|
|
26
|
+
const overflowContainer = entries[0];
|
|
27
|
+
this.overflow.set(overflowContainer.intersectionRatio < 1);
|
|
28
|
+
}, {
|
|
29
|
+
threshold: [1],
|
|
30
|
+
root: this.#elRef.nativeElement
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ngAfterViewInit() {
|
|
34
|
+
this.#initObserver();
|
|
35
|
+
this.#contentObserver?.observe(this.#elRef.nativeElement.querySelector('.default'));
|
|
36
|
+
}
|
|
37
|
+
ngOnDestroy() {
|
|
38
|
+
if (this.#contentObserver)
|
|
39
|
+
this.#contentObserver.disconnect();
|
|
40
|
+
}
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: OverflowHiddenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.12", type: OverflowHiddenComponent, isStandalone: true, selector: "yuv-overflow-hidden", host: { properties: { "class.overflowing": "overflow()" } }, queries: [{ propertyName: "defaultSlot", first: true, predicate: ["yuvDefaultSlot"], descendants: true, isSignal: true }, { propertyName: "overflowSlot", first: true, predicate: ["yuvOverflowSlot"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"default\">\n <ng-container *ngTemplateOutlet=\"defaultSlot()\"></ng-container>\n</div>\n@let os = overflowSlot();\n@if (os) {\n <div class=\"overflow\">\n <ng-container *ngTemplateOutlet=\"os\"></ng-container>\n </div>\n}\n", styles: [":host{display:grid;grid-template-columns:auto;grid-template-rows:auto;align-items:center;overflow:hidden}:host.overflowing .default{opacity:0;z-index:0}:host.overflowing .overflow{opacity:1;z-index:1}:host .default,:host .overflow{grid-column:1;grid-row:1;z-index:1}:host .overflow{opacity:0;z-index:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: OverflowHiddenComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{ selector: 'yuv-overflow-hidden', imports: [CommonModule], host: {
|
|
47
|
+
'[class.overflowing]': 'overflow()'
|
|
48
|
+
}, template: "<div class=\"default\">\n <ng-container *ngTemplateOutlet=\"defaultSlot()\"></ng-container>\n</div>\n@let os = overflowSlot();\n@if (os) {\n <div class=\"overflow\">\n <ng-container *ngTemplateOutlet=\"os\"></ng-container>\n </div>\n}\n", styles: [":host{display:grid;grid-template-columns:auto;grid-template-rows:auto;align-items:center;overflow:hidden}:host.overflowing .default{opacity:0;z-index:0}:host.overflowing .overflow{opacity:1;z-index:1}:host .default,:host .overflow{grid-column:1;grid-row:1;z-index:1}:host .overflow{opacity:0;z-index:0}\n"] }]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
const cmp = [OverflowHiddenComponent];
|
|
52
|
+
class YuvOverflowHiddenModule {
|
|
53
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvOverflowHiddenModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
54
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.12", ngImport: i0, type: YuvOverflowHiddenModule, imports: [OverflowHiddenComponent], exports: [OverflowHiddenComponent] }); }
|
|
55
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvOverflowHiddenModule, imports: [cmp] }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvOverflowHiddenModule, decorators: [{
|
|
58
|
+
type: NgModule,
|
|
59
|
+
args: [{
|
|
60
|
+
imports: cmp,
|
|
61
|
+
exports: cmp
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Generated bundle index. Do not edit.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export { OverflowHiddenComponent, YuvOverflowHiddenModule };
|
|
70
|
+
//# sourceMappingURL=yuuvis-client-framework-overflow-hidden.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yuuvis-client-framework-overflow-hidden.mjs","sources":["../../../../../libs/yuuvis/client-framework/overflow-hidden/src/lib/overflow-hidden.component.ts","../../../../../libs/yuuvis/client-framework/overflow-hidden/src/lib/overflow-hidden.component.html","../../../../../libs/yuuvis/client-framework/overflow-hidden/src/lib/overflow-hidden.module.ts","../../../../../libs/yuuvis/client-framework/overflow-hidden/src/yuuvis-client-framework-overflow-hidden.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { AfterViewInit, Component, contentChild, ElementRef, inject, OnDestroy, signal, TemplateRef } from '@angular/core';\n\n/**\n * This component is designed to switch the rendered content when it is overflowing due to\n * resizing. If there is enough available space you can render the 'real' component. If there\n * is not enough space to render the whole component anymore (it would overflow) another component\n * can take it's place. If you do not specify that replace-component, the component will just\n * disappear and make room for other more important components.\n */\n@Component({\n selector: 'yuv-overflow-hidden',\n imports: [CommonModule],\n templateUrl: './overflow-hidden.component.html',\n styleUrl: './overflow-hidden.component.scss',\n host: {\n '[class.overflowing]': 'overflow()'\n }\n})\nexport class OverflowHiddenComponent implements AfterViewInit, OnDestroy {\n #elRef = inject(ElementRef);\n\n // component/content to be rendered when there is enough space\n defaultSlot = contentChild.required<TemplateRef<any>>('yuvDefaultSlot');\n // component/content to be rendered when the default component overflows\n overflowSlot = contentChild<TemplateRef<any>>('yuvOverflowSlot');\n\n #contentObserver?: IntersectionObserver;\n overflow = signal<boolean>(false);\n\n #initObserver() {\n this.#contentObserver = new IntersectionObserver(\n (entries) => {\n const overflowContainer = entries[0];\n this.overflow.set(overflowContainer.intersectionRatio < 1);\n },\n {\n threshold: [1],\n root: this.#elRef.nativeElement\n }\n );\n }\n\n ngAfterViewInit(): void {\n this.#initObserver();\n this.#contentObserver?.observe(this.#elRef.nativeElement.querySelector('.default'));\n }\n\n ngOnDestroy(): void {\n if (this.#contentObserver) this.#contentObserver.disconnect();\n }\n}\n","<div class=\"default\">\n <ng-container *ngTemplateOutlet=\"defaultSlot()\"></ng-container>\n</div>\n@let os = overflowSlot();\n@if (os) {\n <div class=\"overflow\">\n <ng-container *ngTemplateOutlet=\"os\"></ng-container>\n </div>\n}\n","import { NgModule } from '@angular/core';\n\nimport { OverflowHiddenComponent } from './overflow-hidden.component';\n\nconst cmp = [OverflowHiddenComponent];\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YuvOverflowHiddenModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;AAMG;MAUU,uBAAuB,CAAA;AATpC,IAAA,WAAA,GAAA;AAUE,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;;AAG3B,QAAA,IAAA,CAAA,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAmB,gBAAgB,CAAC;;AAEvE,QAAA,IAAA,CAAA,YAAY,GAAG,YAAY,CAAmB,iBAAiB,CAAC;AAGhE,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,CAAC;AAuBlC;AA/BC,IAAA,MAAM;AAON,IAAA,gBAAgB;IAGhB,aAAa,GAAA;QACX,IAAI,CAAC,gBAAgB,GAAG,IAAI,oBAAoB,CAC9C,C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
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Input, Component, inject, input, effect, output, viewChild, TemplateRef,
|
|
4
|
+
import { Injectable, Input, Component, inject, input, effect, output, viewChild, TemplateRef, signal, computed, untracked, NgModule } from '@angular/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
|
|
7
7
|
import * as i4$2 from '@angular/material/icon';
|
|
@@ -540,6 +540,7 @@ class YuvWidgetGridComponent {
|
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
|
+
this._editMode = signal(false);
|
|
543
544
|
/**
|
|
544
545
|
* Whether or not to enable edit mode. In edit mode controls
|
|
545
546
|
* for editing existing tiles and creating new ones are shown.
|
|
@@ -548,6 +549,7 @@ class YuvWidgetGridComponent {
|
|
|
548
549
|
this.editMode = input(false);
|
|
549
550
|
this.#editModeEffect = effect(() => {
|
|
550
551
|
const e = this.editMode();
|
|
552
|
+
this._editMode.set(e);
|
|
551
553
|
this.options.draggable.enabled = !!e;
|
|
552
554
|
this.options.resizable.enabled = !!e;
|
|
553
555
|
this.options.displayGrid = e ? DisplayGrid.Always : DisplayGrid.None;
|
|
@@ -635,7 +637,7 @@ class YuvWidgetGridComponent {
|
|
|
635
637
|
this.gridChange.emit(mapped);
|
|
636
638
|
}
|
|
637
639
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvWidgetGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
638
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.12", type: YuvWidgetGridComponent, isStandalone: true, selector: "yuv-widget-grid", inputs: { gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, gridItemConfig: { classPropertyName: "gridItemConfig", publicName: "gridItemConfig", isSignal: true, isRequired: false, transformFunction: null }, buckets: { classPropertyName: "buckets", publicName: "buckets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridChange: "gridChange", gridItemEvent: "gridItemEvent", widgetPickerOpen: "widgetPickerOpen" }, host: { properties: { "class.widget-grid-edit": "editMode()" } }, providers: [WidgetGridService], viewQueries: [{ propertyName: "gridsterItems", first: true, predicate: GridsterItemComponent, descendants: true, isSignal: true }, { propertyName: "widgetPicker", first: true, predicate: ["widgetPicker"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (
|
|
640
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.12", type: YuvWidgetGridComponent, isStandalone: true, selector: "yuv-widget-grid", inputs: { gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, gridItemConfig: { classPropertyName: "gridItemConfig", publicName: "gridItemConfig", isSignal: true, isRequired: false, transformFunction: null }, buckets: { classPropertyName: "buckets", publicName: "buckets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridChange: "gridChange", gridItemEvent: "gridItemEvent", widgetPickerOpen: "widgetPickerOpen" }, host: { properties: { "class.widget-grid-edit": "editMode()" } }, providers: [WidgetGridService], viewQueries: [{ propertyName: "gridsterItems", first: true, predicate: GridsterItemComponent, descendants: true, isSignal: true }, { propertyName: "widgetPicker", first: true, predicate: ["widgetPicker"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (_editMode()) {\n <button class=\"fab\" mat-fab [attr.aria-label]=\"'yuv.widget-grid.widget.add.label' | translate\" (click)=\"addItem()\">\n <mat-icon>add</mat-icon>\n </button>\n}\n\n@if (widgetGrid.length === 0 && !_editMode()) {\n <div class=\"empty\">\n <p>{{ 'yuv.widget-grid.empty' | translate }}</p>\n <button ymtButton=\"primary\" (click)=\"_editMode.set(true)\"> \n {{'yuv.widget-grid.empty.create' | translate}}</button>\n </div>\n} @else {\n <gridster [options]=\"options\">\n @for (item of widgetGrid; track item.id) {\n <gridster-item [item]=\"item\">\n @if (_editMode()) {\n <div class=\"toolbar\">\n <!-- drag handle -->\n <mat-icon class=\"dragHandle ymt-icon--size-s\">drag_indicator</mat-icon>\n <!-- edit -->\n <button mat-icon-button (click)=\"openWidgetPicker(item)\"><mat-icon class=\"ymt-icon--size-s\">edit</mat-icon></button>\n <!-- remove -->\n <button mat-icon-button (click)=\"removeItem(item)\"><mat-icon class=\"ymt-icon--size-s\">clear</mat-icon></button>\n </div>\n }\n <div class=\"cmp\">\n <ng-container *ngComponentOutlet=\"item.widget; ndcDynamicInputs: item.widgetConfigMap\"></ng-container>\n </div>\n </gridster-item>\n }\n </gridster>\n}\n<ng-template #widgetPicker>\n <yuv-widget-picker [pickerData]=\"widgetPickerData\" [buckets]=\"buckets()\"></yuv-widget-picker>\n</ng-template>\n", styles: [":host{--_widget-grid-toolbar-background: var(--widget-grid-toolbar-background, var(--ymt-surface));--_widget-grid-on-toolbar: var(--widget-grid-on-toolbar, var(--ymt-on-surface));position:relative}:host .fab{position:absolute;inset-inline-end:var(--ymt-spacing-m);inset-block-end:var(--ymt-spacing-m);z-index:100}:host .cmp{height:100%}:host.widget-grid-edit gridster-item{outline:1px solid var(--ymt-outline);outline-offset:-1px}:host .empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--ymt-on-surface);font:var(--ymt-font-body-medium)}:host .empty p{padding:var(--ymt-spacing-m);max-width:45ch;text-align:center}:host gridster{background-color:transparent}:host gridster ::ng-deep .gridster-column,:host gridster ::ng-deep .gridster-row{border-color:var(--ymt-outline-variant);transition:none}:host gridster-item{transition:none;background-color:transparent}:host gridster-item .toolbar{position:absolute;z-index:1;background-color:var(--_widget-grid-toolbar-background);color:var(--_widget-grid-on-toolbar);right:0;top:var(--ymt-spacing-xs);padding:var(--ymt-spacing-xs);gap:var(--ymt-spacing-s);display:flex;flex-flow:row nowrap;align-items:center;outline:1px solid var(--ymt-outline);outline-offset:-1px}:host gridster-item .toolbar button{color:currentColor}:host gridster-item .dragHandle{display:flex;flex-flow:column;align-items:center;justify-content:center;padding:0 var(--ymt-spacing-s);cursor:move}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: DynamicIoModule }, { kind: "directive", type: i4.ComponentOutletInjectorDirective, selector: "[ngComponentOutlet]", exportAs: ["ndcComponentOutletInjector"] }, { kind: "directive", type: i4.ComponentOutletIoDirective, selector: "[ngComponentOutletNdcDynamicInputs],[ngComponentOutletNdcDynamicOutputs]", inputs: ["ngComponentOutletNdcDynamicInputs", "ngComponentOutletNdcDynamicOutputs"], exportAs: ["ndcDynamicIo"] }, { kind: "ngmodule", type: SignalComponentIoModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "component", type: GridsterComponent, selector: "gridster", inputs: ["options"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }, { kind: "component", type: WidgetPickerComponent, selector: "yuv-widget-picker", inputs: ["pickerData", "buckets"], outputs: ["picked", "canceled"] }, { kind: "component", type: GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }] }); }
|
|
639
641
|
}
|
|
640
642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: YuvWidgetGridComponent, decorators: [{
|
|
641
643
|
type: Component,
|
|
@@ -648,8 +650,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImpo
|
|
|
648
650
|
MatIconModule,
|
|
649
651
|
MatButtonModule,
|
|
650
652
|
WidgetPickerComponent,
|
|
651
|
-
GridsterItemComponent
|
|
652
|
-
|
|
653
|
+
GridsterItemComponent,
|
|
654
|
+
YmtButtonDirective
|
|
655
|
+
], providers: [WidgetGridService], host: { '[class.widget-grid-edit]': 'editMode()' }, template: "@if (_editMode()) {\n <button class=\"fab\" mat-fab [attr.aria-label]=\"'yuv.widget-grid.widget.add.label' | translate\" (click)=\"addItem()\">\n <mat-icon>add</mat-icon>\n </button>\n}\n\n@if (widgetGrid.length === 0 && !_editMode()) {\n <div class=\"empty\">\n <p>{{ 'yuv.widget-grid.empty' | translate }}</p>\n <button ymtButton=\"primary\" (click)=\"_editMode.set(true)\"> \n {{'yuv.widget-grid.empty.create' | translate}}</button>\n </div>\n} @else {\n <gridster [options]=\"options\">\n @for (item of widgetGrid; track item.id) {\n <gridster-item [item]=\"item\">\n @if (_editMode()) {\n <div class=\"toolbar\">\n <!-- drag handle -->\n <mat-icon class=\"dragHandle ymt-icon--size-s\">drag_indicator</mat-icon>\n <!-- edit -->\n <button mat-icon-button (click)=\"openWidgetPicker(item)\"><mat-icon class=\"ymt-icon--size-s\">edit</mat-icon></button>\n <!-- remove -->\n <button mat-icon-button (click)=\"removeItem(item)\"><mat-icon class=\"ymt-icon--size-s\">clear</mat-icon></button>\n </div>\n }\n <div class=\"cmp\">\n <ng-container *ngComponentOutlet=\"item.widget; ndcDynamicInputs: item.widgetConfigMap\"></ng-container>\n </div>\n </gridster-item>\n }\n </gridster>\n}\n<ng-template #widgetPicker>\n <yuv-widget-picker [pickerData]=\"widgetPickerData\" [buckets]=\"buckets()\"></yuv-widget-picker>\n</ng-template>\n", styles: [":host{--_widget-grid-toolbar-background: var(--widget-grid-toolbar-background, var(--ymt-surface));--_widget-grid-on-toolbar: var(--widget-grid-on-toolbar, var(--ymt-on-surface));position:relative}:host .fab{position:absolute;inset-inline-end:var(--ymt-spacing-m);inset-block-end:var(--ymt-spacing-m);z-index:100}:host .cmp{height:100%}:host.widget-grid-edit gridster-item{outline:1px solid var(--ymt-outline);outline-offset:-1px}:host .empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--ymt-on-surface);font:var(--ymt-font-body-medium)}:host .empty p{padding:var(--ymt-spacing-m);max-width:45ch;text-align:center}:host gridster{background-color:transparent}:host gridster ::ng-deep .gridster-column,:host gridster ::ng-deep .gridster-row{border-color:var(--ymt-outline-variant);transition:none}:host gridster-item{transition:none;background-color:transparent}:host gridster-item .toolbar{position:absolute;z-index:1;background-color:var(--_widget-grid-toolbar-background);color:var(--_widget-grid-on-toolbar);right:0;top:var(--ymt-spacing-xs);padding:var(--ymt-spacing-xs);gap:var(--ymt-spacing-s);display:flex;flex-flow:row nowrap;align-items:center;outline:1px solid var(--ymt-outline);outline-offset:-1px}:host gridster-item .toolbar button{color:currentColor}:host gridster-item .dragHandle{display:flex;flex-flow:column;align-items:center;justify-content:center;padding:0 var(--ymt-spacing-s);cursor:move}\n"] }]
|
|
653
656
|
}], ctorParameters: () => [] });
|
|
654
657
|
|
|
655
658
|
class WorkspaceEditComponent {
|