@yuuvis/client-framework 3.0.1 → 3.2.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.
Files changed (67) hide show
  1. package/fesm2022/yuuvis-client-framework-actions.mjs +214 -126
  2. package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
  3. package/fesm2022/yuuvis-client-framework-app-bar.mjs +3 -3
  4. package/fesm2022/yuuvis-client-framework-app-bar.mjs.map +1 -1
  5. package/fesm2022/yuuvis-client-framework-badges.mjs +379 -0
  6. package/fesm2022/yuuvis-client-framework-badges.mjs.map +1 -0
  7. package/fesm2022/yuuvis-client-framework-breadcrumb.mjs +3 -3
  8. package/fesm2022/yuuvis-client-framework-breadcrumb.mjs.map +1 -1
  9. package/fesm2022/yuuvis-client-framework-clipboard.mjs +8 -8
  10. package/fesm2022/yuuvis-client-framework-clipboard.mjs.map +1 -1
  11. package/fesm2022/yuuvis-client-framework-datepicker.mjs +31 -31
  12. package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -1
  13. package/fesm2022/yuuvis-client-framework-forms.mjs +745 -657
  14. package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
  15. package/fesm2022/yuuvis-client-framework-icons.mjs +9 -9
  16. package/fesm2022/yuuvis-client-framework-icons.mjs.map +1 -1
  17. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +10 -9
  18. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
  19. package/fesm2022/yuuvis-client-framework-metadata-form.mjs +19 -17
  20. package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
  21. package/fesm2022/yuuvis-client-framework-object-details.mjs +215 -208
  22. package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
  23. package/fesm2022/yuuvis-client-framework-object-flavor.mjs +18 -18
  24. package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
  25. package/fesm2022/yuuvis-client-framework-object-form.mjs +41 -37
  26. package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
  27. package/fesm2022/yuuvis-client-framework-object-preview.mjs +9 -9
  28. package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
  29. package/fesm2022/yuuvis-client-framework-object-relationship.mjs +29 -29
  30. package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
  31. package/fesm2022/yuuvis-client-framework-object-summary.mjs +16 -16
  32. package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
  33. package/fesm2022/yuuvis-client-framework-object-versions.mjs +18 -12
  34. package/fesm2022/yuuvis-client-framework-object-versions.mjs.map +1 -1
  35. package/fesm2022/yuuvis-client-framework-pagination.mjs +3 -3
  36. package/fesm2022/yuuvis-client-framework-pagination.mjs.map +1 -1
  37. package/fesm2022/yuuvis-client-framework-query-list.mjs +7 -7
  38. package/fesm2022/yuuvis-client-framework-query-list.mjs.map +1 -1
  39. package/fesm2022/yuuvis-client-framework-renderer.mjs +40 -40
  40. package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
  41. package/fesm2022/yuuvis-client-framework-sequence-list.mjs +50 -38
  42. package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
  43. package/fesm2022/yuuvis-client-framework-simple-search.mjs +3 -3
  44. package/fesm2022/yuuvis-client-framework-simple-search.mjs.map +1 -1
  45. package/fesm2022/yuuvis-client-framework-sort.mjs +3 -3
  46. package/fesm2022/yuuvis-client-framework-sort.mjs.map +1 -1
  47. package/fesm2022/yuuvis-client-framework-tile-list.mjs +191 -127
  48. package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
  49. package/fesm2022/yuuvis-client-framework-token-search.mjs +7 -7
  50. package/fesm2022/yuuvis-client-framework-token-search.mjs.map +1 -1
  51. package/fesm2022/yuuvis-client-framework-tree.mjs +9 -9
  52. package/fesm2022/yuuvis-client-framework-tree.mjs.map +1 -1
  53. package/fesm2022/yuuvis-client-framework-upload-progress.mjs +10 -10
  54. package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
  55. package/fesm2022/yuuvis-client-framework.mjs +96 -51
  56. package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
  57. package/lib/assets/i18n/de.json +12 -1
  58. package/lib/assets/i18n/en.json +12 -1
  59. package/package.json +9 -5
  60. package/types/yuuvis-client-framework-actions.d.ts +91 -52
  61. package/types/yuuvis-client-framework-badges.d.ts +194 -0
  62. package/types/yuuvis-client-framework-forms.d.ts +215 -186
  63. package/types/yuuvis-client-framework-object-details.d.ts +104 -104
  64. package/types/yuuvis-client-framework-object-versions.d.ts +1 -0
  65. package/types/yuuvis-client-framework-sequence-list.d.ts +2 -2
  66. package/types/yuuvis-client-framework-tile-list.d.ts +11 -6
  67. package/types/yuuvis-client-framework.d.ts +13 -0
@@ -1,37 +1,114 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule, inject, signal, Component, input, output, viewChild, viewChildren, computed, afterRenderEffect, untracked, ChangeDetectionStrategy, Injector, runInInjectionContext, Injectable, effect, Input, Directive } from '@angular/core';
3
- import { TranslateModule, TranslateService as TranslateService$1 } from '@ngx-translate/core';
4
- import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
5
- import * as i1$1 from '@angular/material/icon';
2
+ import { NgModule, input, output, inject, viewChild, viewChildren, computed, afterRenderEffect, untracked, ChangeDetectionStrategy, Component, signal, effect, Input, Directive, Injectable, Injector, runInInjectionContext, InjectionToken } from '@angular/core';
3
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
4
+ import { A11yModule } from '@angular/cdk/a11y';
5
+ import * as i1$1 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+ import { CdkMenu, CdkMenuItem, CdkContextMenuTrigger, MENU_TRIGGER, MenuStack, MENU_STACK } from '@angular/cdk/menu';
8
+ import * as i1 from '@angular/material/icon';
6
9
  import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
7
- import { ClipboardService, TranslateService, DmsService, TranslatePipe, RetentionService, SystemType, Utils } from '@yuuvis/client-core';
10
+ import { YuvListModule } from '@yuuvis/client-framework/list';
11
+ import { MatTooltip } from '@angular/material/tooltip';
12
+ import { TranslateService as TranslateService$1, AppCacheService, ObjectLockingService, ClipboardService, DmsService, TranslatePipe, RetentionService, SystemType, Utils } from '@yuuvis/client-core';
8
13
  import { of, map, forkJoin, switchMap } from 'rxjs';
9
- import * as i1 from '@angular/common';
10
- import { CommonModule } from '@angular/common';
14
+ import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
11
15
  import { MatButtonModule } from '@angular/material/button';
12
16
  import { MatProgressBar } from '@angular/material/progress-bar';
13
17
  import { DialogComponent } from '@yuuvis/client-framework/common';
14
18
  import { YmtButtonDirective } from '@yuuvis/material';
15
- import { A11yModule } from '@angular/cdk/a11y';
16
- import { CdkMenu, CdkMenuItem, CdkContextMenuTrigger, MENU_TRIGGER, MenuStack, MENU_STACK } from '@angular/cdk/menu';
17
- import { YuvListModule } from '@yuuvis/client-framework/list';
18
- import { MatTooltip } from '@angular/material/tooltip';
19
19
 
20
20
  /**
21
21
  * Module for the actions library.
22
22
  */
23
23
  class ActionsModule {
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
25
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: ActionsModule, imports: [TranslateModule] }); }
26
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsModule, imports: [TranslateModule] }); }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
25
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: ActionsModule, imports: [TranslateModule] }); }
26
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsModule, imports: [TranslateModule] }); }
27
27
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsModule, decorators: [{
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsModule, decorators: [{
29
29
  type: NgModule,
30
30
  args: [{
31
31
  imports: [TranslateModule]
32
32
  }]
33
33
  }] });
34
34
 
35
+ class ContextmenuComponent {
36
+ constructor() {
37
+ this.actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
38
+ this.selection = input([], ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
39
+ this.itemSelect = output();
40
+ this.translate = inject(TranslateService);
41
+ this.cdkMenu = viewChild.required(CdkMenu);
42
+ this.menuItems = viewChildren(CdkMenuItem, ...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
43
+ this.sortedActions = computed(() => [...this.actions()].sort((a, b) => a.label.localeCompare(b.label, this.translate.getCurrentLang())), ...(ngDevMode ? [{ debugName: "sortedActions" }] : /* istanbul ignore next */ []));
44
+ afterRenderEffect(() => {
45
+ //Focus First Item when @for is finished
46
+ untracked(() => {
47
+ //firstElement?.nativeElement.focus();
48
+ this.cdkMenu().focusFirstItem('program');
49
+ });
50
+ });
51
+ }
52
+ onItemTrigger({ action }) {
53
+ this.itemSelect.emit({ action });
54
+ }
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ContextmenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
56
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ContextmenuComponent, isStandalone: true, selector: "yuv-contextmenu", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, providers: [MatTooltip], viewQueries: [{ propertyName: "cdkMenu", first: true, predicate: CdkMenu, descendants: true, isSignal: true }, { propertyName: "menuItems", predicate: CdkMenuItem, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"context-menu\" cdkMenu>\n @for (a of sortedActions(); track a.id) {\n <span [matTooltip]=\"a.description\" [matTooltipDisabled]=\"!a.description\">\n <div\n class=\"context-menu__item\"\n [class.context-menu__item--disabled]=\"a.disabled\"\n cdkMenuItem\n [cdkMenuItemDisabled]=\"a.disabled\"\n [attr.aria-label]=\"'Execute Action: ' + a.label\"\n (cdkMenuItemTriggered)=\"onItemTrigger({ action: a })\"\n >\n <mat-icon class=\"context-menu__item-icon ymt-icon--size-s\">{{ a.icon }}</mat-icon>\n {{ a.label }}\n </div>\n </span>\n }\n</div>\n", styles: [".context-menu{display:flex;flex-direction:column;background-color:var(--mat-sys-surface-container-low);border:var(--ymt-outline-width) solid var(--ymt-outline-variant);color:var(--ymt-on-surface);border-radius:var(--ymt-corner-s);padding:var(--ymt-spacing-xs) 0;letter-spacing:var(--ymt-font-body-tracking);max-height:300px;max-width:300px;overflow-y:auto;overflow-x:hidden}.context-menu>span{display:contents}.context-menu__item{all:unset;display:flex;align-items:center;gap:var(--ymt-spacing-s);cursor:pointer;font:var(--ymt-font-body);padding:var(--ymt-spacing-s) var(--ymt-spacing-m)}.context-menu__item:hover,.context-menu__item:focus{background-color:var(--mat-sys-surface-container-highest)}.context-menu__item.cdk-keyboard-focused:focus-visible{outline-offset:calc(var(--ymt-focus-indicator-size) * -2);outline:var(--ymt-focus-indicator-inner) solid var(--ymt-focus-indicator-size);box-shadow:inset 0 0 0 var(--ymt-focus-indicator-size) var(--ymt-focus-indicator-outer)}.context-menu__item--disabled{opacity:var(--ymt-disabled-opacity)}.context-menu__item-icon{align-items:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: YuvListModule }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: CdkMenu, selector: "[cdkMenu]", outputs: ["closed"], exportAs: ["cdkMenu"] }, { kind: "directive", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: ["cdkMenuItemDisabled", "cdkMenuitemTypeaheadLabel"], outputs: ["cdkMenuItemTriggered"], exportAs: ["cdkMenuItem"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ContextmenuComponent, decorators: [{
59
+ type: Component,
60
+ args: [{ selector: 'yuv-contextmenu', imports: [CommonModule, MatIconModule, YuvListModule, A11yModule, CdkMenu, CdkMenuItem, MatTooltip], providers: [MatTooltip], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"context-menu\" cdkMenu>\n @for (a of sortedActions(); track a.id) {\n <span [matTooltip]=\"a.description\" [matTooltipDisabled]=\"!a.description\">\n <div\n class=\"context-menu__item\"\n [class.context-menu__item--disabled]=\"a.disabled\"\n cdkMenuItem\n [cdkMenuItemDisabled]=\"a.disabled\"\n [attr.aria-label]=\"'Execute Action: ' + a.label\"\n (cdkMenuItemTriggered)=\"onItemTrigger({ action: a })\"\n >\n <mat-icon class=\"context-menu__item-icon ymt-icon--size-s\">{{ a.icon }}</mat-icon>\n {{ a.label }}\n </div>\n </span>\n }\n</div>\n", styles: [".context-menu{display:flex;flex-direction:column;background-color:var(--mat-sys-surface-container-low);border:var(--ymt-outline-width) solid var(--ymt-outline-variant);color:var(--ymt-on-surface);border-radius:var(--ymt-corner-s);padding:var(--ymt-spacing-xs) 0;letter-spacing:var(--ymt-font-body-tracking);max-height:300px;max-width:300px;overflow-y:auto;overflow-x:hidden}.context-menu>span{display:contents}.context-menu__item{all:unset;display:flex;align-items:center;gap:var(--ymt-spacing-s);cursor:pointer;font:var(--ymt-font-body);padding:var(--ymt-spacing-s) var(--ymt-spacing-m)}.context-menu__item:hover,.context-menu__item:focus{background-color:var(--mat-sys-surface-container-highest)}.context-menu__item.cdk-keyboard-focused:focus-visible{outline-offset:calc(var(--ymt-focus-indicator-size) * -2);outline:var(--ymt-focus-indicator-inner) solid var(--ymt-focus-indicator-size);box-shadow:inset 0 0 0 var(--ymt-focus-indicator-size) var(--ymt-focus-indicator-outer)}.context-menu__item--disabled{opacity:var(--ymt-disabled-opacity)}.context-menu__item-icon{align-items:flex-start}\n"] }]
61
+ }], ctorParameters: () => [], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], itemSelect: [{ type: i0.Output, args: ["itemSelect"] }], cdkMenu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkMenu), { isSignal: true }] }], menuItems: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => CdkMenuItem), { isSignal: true }] }] } });
62
+
63
+ class YuvContextMenuTriggerDirective extends CdkContextMenuTrigger {
64
+ #contextMenuEvent;
65
+ constructor() {
66
+ super();
67
+ this.triggerWhen = input(null, { ...(ngDevMode ? { debugName: "triggerWhen" } : /* istanbul ignore next */ {}), alias: 'yuvContextMenuTriggerWhen' });
68
+ this.#contextMenuEvent = signal(null, ...(ngDevMode ? [{ debugName: "#contextMenuEvent" }] : /* istanbul ignore next */ []));
69
+ effect(() => {
70
+ const event = this.#contextMenuEvent();
71
+ const triggerWhen = this.triggerWhen();
72
+ untracked(() => {
73
+ if ((event && triggerWhen) || (event && triggerWhen === null)) {
74
+ super._openOnContextMenu(event);
75
+ }
76
+ });
77
+ });
78
+ }
79
+ _openOnContextMenu(event) {
80
+ this.#contextMenuEvent.set(event);
81
+ }
82
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: YuvContextMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
83
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.12", type: YuvContextMenuTriggerDirective, isStandalone: true, selector: "[yuvContextMenuTrigger]", inputs: { menuTemplateRef: { classPropertyName: "menuTemplateRef", publicName: "yuvContextMenuTrigger", isSignal: false, isRequired: false, transformFunction: null }, triggerWhen: { classPropertyName: "triggerWhen", publicName: "yuvContextMenuTriggerWhen", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
84
+ { provide: MENU_TRIGGER, useExisting: YuvContextMenuTriggerDirective },
85
+ { provide: MENU_STACK, useClass: MenuStack }
86
+ ], exportAs: ["yuvContextMenuTrigger"], usesInheritance: true, ngImport: i0 }); }
87
+ }
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: YuvContextMenuTriggerDirective, decorators: [{
89
+ type: Directive,
90
+ args: [{
91
+ selector: '[yuvContextMenuTrigger]',
92
+ exportAs: 'yuvContextMenuTrigger',
93
+ standalone: true,
94
+ providers: [
95
+ { provide: MENU_TRIGGER, useExisting: YuvContextMenuTriggerDirective },
96
+ { provide: MENU_STACK, useClass: MenuStack }
97
+ ]
98
+ }]
99
+ }], ctorParameters: () => [], propDecorators: { menuTemplateRef: [{
100
+ type: Input,
101
+ args: [{ alias: 'yuvContextMenuTrigger' }]
102
+ }], triggerWhen: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuvContextMenuTriggerWhen", required: false }] }] } });
103
+
104
+ const ACTION_ICON = {
105
+ download: 'download',
106
+ delete: 'delete',
107
+ copy: 'content_copy',
108
+ cut: 'content_cut',
109
+ manageFlavor: 'cards_star'
110
+ };
111
+
35
112
  class AbstractContextAction {
36
113
  constructor(context) {
37
114
  this.context = context;
@@ -51,23 +128,79 @@ const BASE_ACTION = {
51
128
  delete: 'yuv.base.delete'
52
129
  };
53
130
 
54
- const ACTION_ICON = {
55
- download: 'download',
56
- delete: 'delete',
57
- copy: 'content_copy',
58
- cut: 'content_cut',
59
- manageFlavor: 'cards_star'
131
+ const ActionPriorityLevel = {
132
+ LEVEL_1: 1,
133
+ LEVEL_2: 2,
134
+ LEVEL_3: 3,
135
+ LEVEL_4: 4,
136
+ LEVEL_5: 5,
137
+ LEVEL_6: 6,
138
+ LEVEL_7: 7,
139
+ LEVEL_8: 8,
140
+ LEVEL_9: 9,
141
+ LEVEL_10: 10
60
142
  };
61
143
 
144
+ /**
145
+ * Service responsible for validating actions on DMS objects.
146
+ * Provides checks for document lock states and related user information.
147
+ */
148
+ class ActionsValidationService {
149
+ constructor() {
150
+ this.translate = inject(TranslateService$1);
151
+ this.#appCache = inject(AppCacheService);
152
+ this.#objectLocking = inject(ObjectLockingService);
153
+ /** Cache key used to retrieve the list of users from the application cache. */
154
+ this.#STORAGE_USER_KEY = 'yuv.core.users.storage';
155
+ }
156
+ #appCache;
157
+ #objectLocking;
158
+ /** Cache key used to retrieve the list of users from the application cache. */
159
+ #STORAGE_USER_KEY;
160
+ /**
161
+ * Checks whether a DMS object is locked by another user.
162
+ *
163
+ * Delegates lock detection to {@link ObjectLockingService.getLockState}. When the
164
+ * object is locked by a different user, returns `state: true` along with a
165
+ * translated description identifying the lock holder.
166
+ *
167
+ * @param dmsObject - The DMS object to check for a lock.
168
+ * @returns An observable emitting an object with:
169
+ * - `state`: `true` if the object is locked by another user, `false` otherwise.
170
+ * - `description`: An optional translated message describing the lock state (only present when `state` is `true`).
171
+ */
172
+ checkDocumentLock(dmsObject) {
173
+ const lockState = this.#objectLocking.getLockState(dmsObject);
174
+ if (!lockState.locked || lockState.lockedByCurrentUser)
175
+ return of({ state: false });
176
+ return this.#appCache.getItem(this.#STORAGE_USER_KEY).pipe(map((users) => {
177
+ const lockUser = users?.find((user) => user.id === lockState.ownerId);
178
+ const user = lockUser ? lockUser.title || lockUser.email || lockUser.id : null;
179
+ const description = user
180
+ ? this.translate.instant('yuv.action-menu.action.unlock.description-locked-by-other', { user })
181
+ : this.translate.instant('yuv.action-menu.action.unlock.description-locked-by-unknown-user');
182
+ return { state: true, description };
183
+ }));
184
+ }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
186
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, providedIn: 'root' }); }
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, decorators: [{
189
+ type: Injectable,
190
+ args: [{
191
+ providedIn: 'root'
192
+ }]
193
+ }] });
194
+
62
195
  class CopyAction extends AbstractContextAction {
63
196
  constructor() {
64
197
  super(...arguments);
65
- this.clipboardService = inject(ClipboardService);
66
- this.translate = inject(TranslateService);
198
+ this.#clipboardService = inject(ClipboardService);
199
+ this.#translate = inject(TranslateService$1);
67
200
  this.id = BASE_ACTION.copy;
68
- this.label = this.translate.instant('yuv.action-menu.action.copy.dms.object.label');
69
- this.description = this.translate.instant('yuv.action-menu.action.copy.dms.object.description');
70
- this.priority = 8;
201
+ this.label = this.#translate.instant('yuv.action-menu.action.copy.dms.object.label');
202
+ this.description = this.#translate.instant('yuv.action-menu.action.copy.dms.object.description');
203
+ this.priority = ActionPriorityLevel.LEVEL_8;
71
204
  this.icon = ACTION_ICON.copy;
72
205
  this.group = 'common';
73
206
  this.range = SelectionRange.MULTI_SELECT;
@@ -75,12 +208,14 @@ class CopyAction extends AbstractContextAction {
75
208
  pattern: '*'
76
209
  };
77
210
  }
211
+ #clipboardService;
212
+ #translate;
78
213
  isExecutable(items) {
79
214
  const notAllowed = items.some((item) => !item.permissions?.writeIndexData);
80
215
  return of(items.length > 0 && !notAllowed);
81
216
  }
82
217
  run(items) {
83
- this.clipboardService.addObjects(items, 'copy', this.context?.appId);
218
+ this.#clipboardService.addObjects(items, 'copy', this.context?.appId);
84
219
  return of(true);
85
220
  }
86
221
  }
@@ -88,12 +223,12 @@ class CopyAction extends AbstractContextAction {
88
223
  class CutAction extends AbstractContextAction {
89
224
  constructor() {
90
225
  super(...arguments);
91
- this.clipboardService = inject(ClipboardService);
92
- this.translate = inject(TranslateService);
226
+ this.#clipboardService = inject(ClipboardService);
227
+ this.#translate = inject(TranslateService$1);
93
228
  this.id = BASE_ACTION.cut;
94
- this.label = this.translate.instant('yuv.action-menu.action.cut.dms.object.label');
95
- this.description = this.translate.instant('yuv.action-menu.action.cut.dms.object.description');
96
- this.priority = 8;
229
+ this.label = this.#translate.instant('yuv.action-menu.action.cut.dms.object.label');
230
+ this.description = this.#translate.instant('yuv.action-menu.action.cut.dms.object.description');
231
+ this.priority = ActionPriorityLevel.LEVEL_8;
97
232
  this.icon = ACTION_ICON.cut;
98
233
  this.group = 'common';
99
234
  this.range = SelectionRange.MULTI_SELECT;
@@ -101,11 +236,14 @@ class CutAction extends AbstractContextAction {
101
236
  pattern: '*'
102
237
  };
103
238
  }
239
+ #clipboardService;
240
+ #translate;
104
241
  isExecutable(items) {
105
- return of(items.length > 0 && items.every((item) => item.permissions?.writeContent && item.permissions?.writeIndexData && item.permissions?.deleteObject));
242
+ return of(items.length > 0 &&
243
+ items.every((item) => item.permissions?.writeContent && item.permissions.writeIndexData && item.permissions.deleteObject));
106
244
  }
107
245
  run(items) {
108
- this.clipboardService.addObjects(items, 'cut', this.context?.appId);
246
+ this.#clipboardService.addObjects(items, 'cut', this.context?.appId);
109
247
  return of(true);
110
248
  }
111
249
  }
@@ -116,7 +254,7 @@ class CutAction extends AbstractContextAction {
116
254
  class DeleteComponent {
117
255
  constructor() {
118
256
  this.#dmsService = inject(DmsService);
119
- this.translate = inject(TranslateService);
257
+ this.translate = inject(TranslateService$1);
120
258
  this.#dialogData = inject(MAT_DIALOG_DATA);
121
259
  this.#dialogRef = inject((MatDialogRef));
122
260
  this.errors = signal([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
@@ -167,10 +305,10 @@ class DeleteComponent {
167
305
  cancel() {
168
306
  this.#dialogRef.close();
169
307
  }
170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
171
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DeleteComponent, isStandalone: true, selector: "yuv-delete", ngImport: i0, template: "<yuv-dialog [headertitle]=\"'yuv.action-menu.action.delete.dms.object.label' | translate\">\n <main class=\"yuv-delete\" [ngClass]=\"{ deleting: deleting() }\">\n <mat-progress-bar mode=\"indeterminate\" class=\"progress-bar\"></mat-progress-bar>\n\n @if (errors().length) {\n <ul class=\"errors\">\n @for (e of errors(); track $index) {\n <li class=\"error\">\n <span class=\"subject\">{{ e.subject }}</span>\n <span class=\"message\">{{ e.message }}</span>\n </li>\n }\n </ul>\n } @else {\n <p>{{ 'yuv.action-menu.action.delete.dms.object.confirm.message' | translate }}</p>\n }\n </main>\n <footer class=\"form-buttons\">\n <button ymtButton=\"secondary\" [disabled]=\"deleting()\" (click)=\"cancel()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.cancel' | translate }}\n </button>\n\n <button ymtButton=\"primary\" [disabled]=\"deleting() || !!errors().length\" (click)=\"run()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.ok' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [".yuv-delete{display:flex;flex-flow:column;justify-content:center;padding:var(--ymt-spacing-m);position:relative}.yuv-delete .progress-bar{position:absolute;inset-block-start:0;inset-inline-start:0;inset-inline-end:0}.yuv-delete:not(.deleting) .progress-bar{opacity:0}.yuv-delete p{margin:0}.yuv-delete ul.errors{list-style:none;margin:0;background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);padding:var(--ymt-spacing-xs);border-radius:.5rem;display:flex;flex-flow:column;gap:.5rem}.yuv-delete ul.errors .error{display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;grid-template-areas:\"icon subject\" \"icon message\";row-gap:.2em;column-gap:1em;align-items:center}.yuv-delete ul.errors .error .subject{grid-area:subject;font-weight:700}.yuv-delete ul.errors .error .message{grid-area:message;font-weight:400;font-style:italic;display:block}.yuv-delete ul.errors .error:before{align-self:start;font-weight:700;grid-area:icon;content:\"!\";outline:2px solid currentColor;border-radius:2px;width:1em;display:grid;place-items:center}.yuv-delete .form-buttons{display:flex;flex-flow:row-reverse;justify-content:flex-end;justify-content:end;gap:var(--ymt-spacing-2xs);align-items:center;margin-block-start:var(--ymt-spacing-xl)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
308
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
309
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DeleteComponent, isStandalone: true, selector: "yuv-delete", ngImport: i0, template: "<yuv-dialog [headertitle]=\"'yuv.action-menu.action.delete.dms.object.label' | translate\">\n <main class=\"yuv-delete\" [ngClass]=\"{ deleting: deleting() }\">\n <mat-progress-bar mode=\"indeterminate\" class=\"progress-bar\"></mat-progress-bar>\n\n @if (errors().length) {\n <ul class=\"errors\">\n @for (e of errors(); track $index) {\n <li class=\"error\">\n <span class=\"subject\">{{ e.subject }}</span>\n <span class=\"message\">{{ e.message }}</span>\n </li>\n }\n </ul>\n } @else {\n <p>{{ 'yuv.action-menu.action.delete.dms.object.confirm.message' | translate }}</p>\n }\n </main>\n <footer class=\"form-buttons\">\n <button ymtButton=\"secondary\" [disabled]=\"deleting()\" (click)=\"cancel()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.cancel' | translate }}\n </button>\n\n <button ymtButton=\"primary\" [disabled]=\"deleting() || !!errors().length\" (click)=\"run()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.ok' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [".yuv-delete{display:flex;flex-flow:column;justify-content:center;padding:var(--ymt-spacing-m);position:relative}.yuv-delete .progress-bar{position:absolute;inset-block-start:0;inset-inline-start:0;inset-inline-end:0}.yuv-delete:not(.deleting) .progress-bar{opacity:0}.yuv-delete p{margin:0}.yuv-delete ul.errors{list-style:none;margin:0;background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);padding:var(--ymt-spacing-xs);border-radius:.5rem;display:flex;flex-flow:column;gap:.5rem}.yuv-delete ul.errors .error{display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;grid-template-areas:\"icon subject\" \"icon message\";row-gap:.2em;column-gap:1em;align-items:center}.yuv-delete ul.errors .error .subject{grid-area:subject;font-weight:700}.yuv-delete ul.errors .error .message{grid-area:message;font-weight:400;font-style:italic;display:block}.yuv-delete ul.errors .error:before{align-self:start;font-weight:700;grid-area:icon;content:\"!\";outline:2px solid currentColor;border-radius:2px;width:1em;display:grid;place-items:center}.yuv-delete .form-buttons{display:flex;flex-flow:row-reverse;justify-content:flex-end;justify-content:end;gap:var(--ymt-spacing-2xs);align-items:center;margin-block-start:var(--ymt-spacing-xl)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
172
310
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DeleteComponent, decorators: [{
311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DeleteComponent, decorators: [{
174
312
  type: Component,
175
313
  args: [{ selector: 'yuv-delete', standalone: true, imports: [CommonModule, TranslatePipe, MatButtonModule, DialogComponent, MatProgressBar, YmtButtonDirective], template: "<yuv-dialog [headertitle]=\"'yuv.action-menu.action.delete.dms.object.label' | translate\">\n <main class=\"yuv-delete\" [ngClass]=\"{ deleting: deleting() }\">\n <mat-progress-bar mode=\"indeterminate\" class=\"progress-bar\"></mat-progress-bar>\n\n @if (errors().length) {\n <ul class=\"errors\">\n @for (e of errors(); track $index) {\n <li class=\"error\">\n <span class=\"subject\">{{ e.subject }}</span>\n <span class=\"message\">{{ e.message }}</span>\n </li>\n }\n </ul>\n } @else {\n <p>{{ 'yuv.action-menu.action.delete.dms.object.confirm.message' | translate }}</p>\n }\n </main>\n <footer class=\"form-buttons\">\n <button ymtButton=\"secondary\" [disabled]=\"deleting()\" (click)=\"cancel()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.cancel' | translate }}\n </button>\n\n <button ymtButton=\"primary\" [disabled]=\"deleting() || !!errors().length\" (click)=\"run()\">\n {{ 'yuv.action-menu.action.delete.dms.object.confirm.ok' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [".yuv-delete{display:flex;flex-flow:column;justify-content:center;padding:var(--ymt-spacing-m);position:relative}.yuv-delete .progress-bar{position:absolute;inset-block-start:0;inset-inline-start:0;inset-inline-end:0}.yuv-delete:not(.deleting) .progress-bar{opacity:0}.yuv-delete p{margin:0}.yuv-delete ul.errors{list-style:none;margin:0;background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);padding:var(--ymt-spacing-xs);border-radius:.5rem;display:flex;flex-flow:column;gap:.5rem}.yuv-delete ul.errors .error{display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;grid-template-areas:\"icon subject\" \"icon message\";row-gap:.2em;column-gap:1em;align-items:center}.yuv-delete ul.errors .error .subject{grid-area:subject;font-weight:700}.yuv-delete ul.errors .error .message{grid-area:message;font-weight:400;font-style:italic;display:block}.yuv-delete ul.errors .error:before{align-self:start;font-weight:700;grid-area:icon;content:\"!\";outline:2px solid currentColor;border-radius:2px;width:1em;display:grid;place-items:center}.yuv-delete .form-buttons{display:flex;flex-flow:row-reverse;justify-content:flex-end;justify-content:end;gap:var(--ymt-spacing-2xs);align-items:center;margin-block-start:var(--ymt-spacing-xl)}\n"] }]
176
314
  }] });
@@ -178,13 +316,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
178
316
  class DeleteAction extends AbstractContextAction {
179
317
  constructor() {
180
318
  super(...arguments);
181
- this.translate = inject(TranslateService);
319
+ this.#translate = inject(TranslateService$1);
182
320
  this.#dialog = inject(MatDialog);
183
- this.retention = inject(RetentionService);
321
+ this.#retention = inject(RetentionService);
322
+ this.#actionsValidation = inject(ActionsValidationService);
184
323
  this.id = BASE_ACTION.delete;
185
- this.label = this.translate.instant('yuv.action-menu.action.delete.dms.object.label');
186
- this.description = this.translate.instant('yuv.action-menu.action.delete.dms.object.description');
187
- this.priority = 8;
324
+ this.label = this.#translate.instant('yuv.action-menu.action.delete.dms.object.label');
325
+ this.description = this.#translate.instant('yuv.action-menu.action.delete.dms.object.description');
326
+ this.priority = ActionPriorityLevel.LEVEL_8;
188
327
  this.icon = ACTION_ICON.delete;
189
328
  this.group = 'common';
190
329
  this.range = SelectionRange.MULTI_SELECT;
@@ -192,10 +331,24 @@ class DeleteAction extends AbstractContextAction {
192
331
  pattern: '*'
193
332
  };
194
333
  }
334
+ #translate;
195
335
  #dialog;
336
+ #retention;
337
+ #actionsValidation;
338
+ isDisabled(items) {
339
+ return this.#actionsValidation.checkDocumentLock(items[0]).pipe(map(({ state, description }) => {
340
+ if (state) {
341
+ this.description = description;
342
+ return true;
343
+ }
344
+ return false;
345
+ }));
346
+ }
196
347
  isExecutable(items) {
197
- const e = items[0];
198
- return of(e && !!e.permissions && e.permissions.deleteObject && !this.retention.getRetentionState(e).underRetention);
348
+ const dmsObject = items[0];
349
+ return of(!!dmsObject.permissions &&
350
+ dmsObject.permissions.deleteObject &&
351
+ !this.#retention.getRetentionState(dmsObject).underRetention);
199
352
  }
200
353
  run(items) {
201
354
  this.#dialog.open(DeleteComponent, {
@@ -211,12 +364,12 @@ class DeleteAction extends AbstractContextAction {
211
364
  class DownloadAction extends AbstractContextAction {
212
365
  constructor() {
213
366
  super(...arguments);
214
- this.translate = inject(TranslateService);
215
- this.dmsService = inject(DmsService);
367
+ this.#translate = inject(TranslateService$1);
368
+ this.#dmsService = inject(DmsService);
216
369
  this.id = BASE_ACTION.download;
217
- this.label = this.translate.instant('yuv.action-menu.action.download.dms.object.content.label');
218
- this.description = this.translate.instant('yuv.action-menu.action.download.dms.object.content.description');
219
- this.priority = 2;
370
+ this.label = this.#translate.instant('yuv.action-menu.action.download.dms.object.content.label');
371
+ this.description = this.#translate.instant('yuv.action-menu.action.download.dms.object.content.description');
372
+ this.priority = ActionPriorityLevel.LEVEL_2;
220
373
  this.icon = ACTION_ICON.download;
221
374
  this.group = 'common';
222
375
  this.range = SelectionRange.MULTI_SELECT;
@@ -224,6 +377,8 @@ class DownloadAction extends AbstractContextAction {
224
377
  types: [SystemType.DOCUMENT]
225
378
  };
226
379
  }
380
+ #translate;
381
+ #dmsService;
227
382
  isExecutable(selection) {
228
383
  const noContentMatch = (Array.isArray(selection) ? selection : [selection]).find((e) => !e.content);
229
384
  if (selection.length < 1)
@@ -231,39 +386,11 @@ class DownloadAction extends AbstractContextAction {
231
386
  return of(!noContentMatch);
232
387
  }
233
388
  run(selection) {
234
- this.dmsService.downloadContent(Array.isArray(selection) ? selection : [selection]);
389
+ this.#dmsService.downloadContent(Array.isArray(selection) ? selection : [selection]);
235
390
  return of(true);
236
391
  }
237
392
  }
238
393
 
239
- class ContextmenuComponent {
240
- constructor() {
241
- this.actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
242
- this.selection = input([], ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
243
- this.itemSelect = output();
244
- this.translate = inject(TranslateService$1);
245
- this.cdkMenu = viewChild.required(CdkMenu);
246
- this.menuItems = viewChildren(CdkMenuItem, ...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
247
- this.sortedActions = computed(() => [...this.actions()].sort((a, b) => a.label.localeCompare(b.label, this.translate.getCurrentLang())), ...(ngDevMode ? [{ debugName: "sortedActions" }] : /* istanbul ignore next */ []));
248
- afterRenderEffect(() => {
249
- //Focus First Item when @for is finished
250
- untracked(() => {
251
- //firstElement?.nativeElement.focus();
252
- this.cdkMenu().focusFirstItem('program');
253
- });
254
- });
255
- }
256
- onItemTrigger({ action }) {
257
- this.itemSelect.emit({ action });
258
- }
259
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ContextmenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
260
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ContextmenuComponent, isStandalone: true, selector: "yuv-contextmenu", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, providers: [MatTooltip], viewQueries: [{ propertyName: "cdkMenu", first: true, predicate: CdkMenu, descendants: true, isSignal: true }, { propertyName: "menuItems", predicate: CdkMenuItem, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"context-menu\" cdkMenu>\n @for (a of sortedActions(); track a.id) {\n <span [matTooltip]=\"a.description\" [matTooltipDisabled]=\"!a.description\">\n <div\n class=\"context-menu__item\"\n [class.context-menu__item--disabled]=\"a.disabled\"\n cdkMenuItem\n [cdkMenuItemDisabled]=\"a.disabled\"\n [attr.aria-label]=\"'Execute Action: ' + a.label\"\n (cdkMenuItemTriggered)=\"onItemTrigger({ action: a })\"\n >\n <mat-icon class=\"context-menu__item-icon ymt-icon--size-s\">{{ a.icon }}</mat-icon>\n {{ a.label }}\n </div>\n </span>\n }\n</div>\n", styles: [".context-menu{display:flex;flex-direction:column;background-color:var(--mat-sys-surface-container-low);border:var(--ymt-outline-width) solid var(--ymt-outline-variant);color:var(--ymt-on-surface);border-radius:var(--ymt-corner-s);padding:var(--ymt-spacing-xs) 0;letter-spacing:var(--ymt-font-body-tracking);max-height:300px;max-width:300px;overflow-y:auto;overflow-x:hidden}.context-menu>span{display:contents}.context-menu__item{all:unset;display:flex;align-items:center;gap:var(--ymt-spacing-s);cursor:pointer;font:var(--ymt-font-body);padding:var(--ymt-spacing-s) var(--ymt-spacing-m)}.context-menu__item:hover,.context-menu__item:focus{background-color:var(--mat-sys-surface-container-highest)}.context-menu__item.cdk-keyboard-focused:focus-visible{outline-offset:calc(var(--ymt-focus-indicator-size) * -2);outline:var(--ymt-focus-indicator-inner) solid var(--ymt-focus-indicator-size);box-shadow:inset 0 0 0 var(--ymt-focus-indicator-size) var(--ymt-focus-indicator-outer)}.context-menu__item--disabled{opacity:var(--ymt-disabled-opacity)}.context-menu__item-icon{align-items:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: YuvListModule }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: CdkMenu, selector: "[cdkMenu]", outputs: ["closed"], exportAs: ["cdkMenu"] }, { kind: "directive", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: ["cdkMenuItemDisabled", "cdkMenuitemTypeaheadLabel"], outputs: ["cdkMenuItemTriggered"], exportAs: ["cdkMenuItem"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
261
- }
262
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ContextmenuComponent, decorators: [{
263
- type: Component,
264
- args: [{ selector: 'yuv-contextmenu', imports: [CommonModule, MatIconModule, YuvListModule, A11yModule, CdkMenu, CdkMenuItem, MatTooltip], providers: [MatTooltip], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"context-menu\" cdkMenu>\n @for (a of sortedActions(); track a.id) {\n <span [matTooltip]=\"a.description\" [matTooltipDisabled]=\"!a.description\">\n <div\n class=\"context-menu__item\"\n [class.context-menu__item--disabled]=\"a.disabled\"\n cdkMenuItem\n [cdkMenuItemDisabled]=\"a.disabled\"\n [attr.aria-label]=\"'Execute Action: ' + a.label\"\n (cdkMenuItemTriggered)=\"onItemTrigger({ action: a })\"\n >\n <mat-icon class=\"context-menu__item-icon ymt-icon--size-s\">{{ a.icon }}</mat-icon>\n {{ a.label }}\n </div>\n </span>\n }\n</div>\n", styles: [".context-menu{display:flex;flex-direction:column;background-color:var(--mat-sys-surface-container-low);border:var(--ymt-outline-width) solid var(--ymt-outline-variant);color:var(--ymt-on-surface);border-radius:var(--ymt-corner-s);padding:var(--ymt-spacing-xs) 0;letter-spacing:var(--ymt-font-body-tracking);max-height:300px;max-width:300px;overflow-y:auto;overflow-x:hidden}.context-menu>span{display:contents}.context-menu__item{all:unset;display:flex;align-items:center;gap:var(--ymt-spacing-s);cursor:pointer;font:var(--ymt-font-body);padding:var(--ymt-spacing-s) var(--ymt-spacing-m)}.context-menu__item:hover,.context-menu__item:focus{background-color:var(--mat-sys-surface-container-highest)}.context-menu__item.cdk-keyboard-focused:focus-visible{outline-offset:calc(var(--ymt-focus-indicator-size) * -2);outline:var(--ymt-focus-indicator-inner) solid var(--ymt-focus-indicator-size);box-shadow:inset 0 0 0 var(--ymt-focus-indicator-size) var(--ymt-focus-indicator-outer)}.context-menu__item--disabled{opacity:var(--ymt-disabled-opacity)}.context-menu__item-icon{align-items:flex-start}\n"] }]
265
- }], ctorParameters: () => [], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], itemSelect: [{ type: i0.Output, args: ["itemSelect"] }], cdkMenu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkMenu), { isSignal: true }] }], menuItems: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => CdkMenuItem), { isSignal: true }] }] } });
266
-
267
394
  class ActionsService {
268
395
  constructor() {
269
396
  this.injector = inject(Injector);
@@ -330,7 +457,7 @@ class ActionsService {
330
457
  return actions;
331
458
  }
332
459
  getActionsForType(objectTypeId, context) {
333
- return this.getAvailableActions(context).filter((action) => this._actionsSupportsType(action, objectTypeId));
460
+ return this.getAvailableActions(context).filter((action) => this.#actionsSupportsType(action, objectTypeId));
334
461
  }
335
462
  getActionById(id, context) {
336
463
  return this.getAvailableActions(context).find((action) => action.id === id);
@@ -357,7 +484,7 @@ class ActionsService {
357
484
  : of(Object.assign(action, { disabled: false }));
358
485
  // Recursively resolve children
359
486
  if (action.children?.length) {
360
- return resolve$.pipe(switchMap((a) => this.resolveDisabledState(a.children, selection).pipe(map(() => a))));
487
+ return resolve$.pipe(switchMap((action) => this.resolveDisabledState(action.children, selection).pipe(map(() => action))));
361
488
  }
362
489
  return resolve$;
363
490
  });
@@ -405,7 +532,7 @@ class ActionsService {
405
532
  { id: BASE_ACTION.cut, action: CutAction }
406
533
  ]);
407
534
  }
408
- _actionsSupportsType(action, objectTypeId) {
535
+ #actionsSupportsType(action, objectTypeId) {
409
536
  const matchesTypes = action.supports.types ? action.supports.types.includes(objectTypeId) : false;
410
537
  const matchesSOTs = action.supports.sots ? action.supports.sots.includes(objectTypeId) : false;
411
538
  const matchesPattern = action.supports.pattern
@@ -413,60 +540,21 @@ class ActionsService {
413
540
  : false;
414
541
  return matchesTypes || matchesSOTs || matchesPattern;
415
542
  }
416
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
417
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsService, providedIn: 'root' }); }
543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
544
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, providedIn: 'root' }); }
418
545
  }
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsService, decorators: [{
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, decorators: [{
420
547
  type: Injectable,
421
548
  args: [{
422
549
  providedIn: 'root'
423
550
  }]
424
551
  }] });
425
552
 
426
- class YuvContextMenuTriggerDirective extends CdkContextMenuTrigger {
427
- #contextMenuEvent;
428
- constructor() {
429
- super();
430
- this.triggerWhen = input(null, { ...(ngDevMode ? { debugName: "triggerWhen" } : /* istanbul ignore next */ {}), alias: 'yuvContextMenuTriggerWhen' });
431
- this.#contextMenuEvent = signal(null, ...(ngDevMode ? [{ debugName: "#contextMenuEvent" }] : /* istanbul ignore next */ []));
432
- effect(() => {
433
- const event = this.#contextMenuEvent();
434
- const triggerWhen = this.triggerWhen();
435
- untracked(() => {
436
- if ((event && triggerWhen) || (event && triggerWhen === null)) {
437
- super._openOnContextMenu(event);
438
- }
439
- });
440
- });
441
- }
442
- _openOnContextMenu(event) {
443
- this.#contextMenuEvent.set(event);
444
- }
445
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: YuvContextMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
446
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: YuvContextMenuTriggerDirective, isStandalone: true, selector: "[yuvContextMenuTrigger]", inputs: { menuTemplateRef: { classPropertyName: "menuTemplateRef", publicName: "yuvContextMenuTrigger", isSignal: false, isRequired: false, transformFunction: null }, triggerWhen: { classPropertyName: "triggerWhen", publicName: "yuvContextMenuTriggerWhen", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
447
- { provide: MENU_TRIGGER, useExisting: YuvContextMenuTriggerDirective },
448
- { provide: MENU_STACK, useClass: MenuStack }
449
- ], exportAs: ["yuvContextMenuTrigger"], usesInheritance: true, ngImport: i0 }); }
450
- }
451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: YuvContextMenuTriggerDirective, decorators: [{
452
- type: Directive,
453
- args: [{
454
- selector: '[yuvContextMenuTrigger]',
455
- exportAs: 'yuvContextMenuTrigger',
456
- standalone: true,
457
- providers: [
458
- { provide: MENU_TRIGGER, useExisting: YuvContextMenuTriggerDirective },
459
- { provide: MENU_STACK, useClass: MenuStack }
460
- ]
461
- }]
462
- }], ctorParameters: () => [], propDecorators: { menuTemplateRef: [{
463
- type: Input,
464
- args: [{ alias: 'yuvContextMenuTrigger' }]
465
- }], triggerWhen: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuvContextMenuTriggerWhen", required: false }] }] } });
553
+ const ACTION_CONTEXT_TOKEN = new InjectionToken('action-context');
466
554
 
467
555
  /**
468
556
  * Generated bundle index. Do not edit.
469
557
  */
470
558
 
471
- export { ACTION_ICON, AbstractContextAction, ActionsModule, ActionsService, BASE_ACTION, ContextmenuComponent, DeleteAction, DownloadAction, SelectionRange, YuvContextMenuTriggerDirective };
559
+ export { ACTION_CONTEXT_TOKEN, ACTION_ICON, AbstractContextAction, ActionPriorityLevel, ActionsModule, ActionsService, ActionsValidationService, BASE_ACTION, ContextmenuComponent, DeleteAction, DownloadAction, SelectionRange, YuvContextMenuTriggerDirective };
472
560
  //# sourceMappingURL=yuuvis-client-framework-actions.mjs.map