@yuuvis/client-framework 3.1.0 → 3.2.1

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 (65) hide show
  1. package/fesm2022/yuuvis-client-framework-actions.mjs +209 -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 +65 -66
  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 +7 -7
  18. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
  19. package/fesm2022/yuuvis-client-framework-metadata-form.mjs +15 -15
  20. package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
  21. package/fesm2022/yuuvis-client-framework-object-details.mjs +53 -46
  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 +32 -32
  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 +28 -28
  30. package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
  31. package/fesm2022/yuuvis-client-framework-object-summary.mjs +14 -14
  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 +39 -39
  40. package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
  41. package/fesm2022/yuuvis-client-framework-sequence-list.mjs +3 -3
  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 +163 -125
  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 +81 -52
  61. package/types/yuuvis-client-framework-badges.d.ts +194 -0
  62. package/types/yuuvis-client-framework-object-details.d.ts +5 -5
  63. package/types/yuuvis-client-framework-object-versions.d.ts +1 -0
  64. package/types/yuuvis-client-framework-tile-list.d.ts +10 -6
  65. 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, IdmService, 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,69 @@ 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
+ /** @deprecated */
149
+ class ActionsValidationService {
150
+ constructor() {
151
+ this.translate = inject(TranslateService$1);
152
+ this.#appCache = inject(AppCacheService);
153
+ this.#objectLocking = inject(ObjectLockingService);
154
+ /** Cache key used to retrieve the list of users from the application cache. */
155
+ this.#STORAGE_USER_KEY = 'yuv.core.users.storage';
156
+ }
157
+ #appCache;
158
+ #objectLocking;
159
+ /** Cache key used to retrieve the list of users from the application cache. */
160
+ #STORAGE_USER_KEY;
161
+ /** @deprecated */
162
+ checkDocumentLock(dmsObject) {
163
+ const lockState = this.#objectLocking.getLockState(dmsObject);
164
+ if (!lockState.locked || lockState.lockedByCurrentUser)
165
+ return of({ state: false });
166
+ return this.#appCache.getItem(this.#STORAGE_USER_KEY).pipe(map((users) => {
167
+ const lockUser = users?.find((user) => user.id === lockState.ownerId);
168
+ const user = lockUser ? lockUser.title || lockUser.email || lockUser.id : null;
169
+ const description = user
170
+ ? this.translate.instant('yuv.action-menu.action.unlock.description-locked-by-other', { user })
171
+ : this.translate.instant('yuv.action-menu.action.unlock.description-locked-by-unknown-user');
172
+ return { state: true, description };
173
+ }));
174
+ }
175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
176
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, providedIn: 'root' }); }
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsValidationService, decorators: [{
179
+ type: Injectable,
180
+ args: [{
181
+ providedIn: 'root'
182
+ }]
183
+ }] });
184
+
62
185
  class CopyAction extends AbstractContextAction {
63
186
  constructor() {
64
187
  super(...arguments);
65
- this.clipboardService = inject(ClipboardService);
66
- this.translate = inject(TranslateService);
188
+ this.#clipboardService = inject(ClipboardService);
189
+ this.#translate = inject(TranslateService$1);
67
190
  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;
191
+ this.label = this.#translate.instant('yuv.action-menu.action.copy.dms.object.label');
192
+ this.description = this.#translate.instant('yuv.action-menu.action.copy.dms.object.description');
193
+ this.priority = ActionPriorityLevel.LEVEL_8;
71
194
  this.icon = ACTION_ICON.copy;
72
195
  this.group = 'common';
73
196
  this.range = SelectionRange.MULTI_SELECT;
@@ -75,12 +198,14 @@ class CopyAction extends AbstractContextAction {
75
198
  pattern: '*'
76
199
  };
77
200
  }
201
+ #clipboardService;
202
+ #translate;
78
203
  isExecutable(items) {
79
204
  const notAllowed = items.some((item) => !item.permissions?.writeIndexData);
80
205
  return of(items.length > 0 && !notAllowed);
81
206
  }
82
207
  run(items) {
83
- this.clipboardService.addObjects(items, 'copy', this.context?.appId);
208
+ this.#clipboardService.addObjects(items, 'copy', this.context?.appId);
84
209
  return of(true);
85
210
  }
86
211
  }
@@ -88,12 +213,12 @@ class CopyAction extends AbstractContextAction {
88
213
  class CutAction extends AbstractContextAction {
89
214
  constructor() {
90
215
  super(...arguments);
91
- this.clipboardService = inject(ClipboardService);
92
- this.translate = inject(TranslateService);
216
+ this.#clipboardService = inject(ClipboardService);
217
+ this.#translate = inject(TranslateService$1);
93
218
  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;
219
+ this.label = this.#translate.instant('yuv.action-menu.action.cut.dms.object.label');
220
+ this.description = this.#translate.instant('yuv.action-menu.action.cut.dms.object.description');
221
+ this.priority = ActionPriorityLevel.LEVEL_8;
97
222
  this.icon = ACTION_ICON.cut;
98
223
  this.group = 'common';
99
224
  this.range = SelectionRange.MULTI_SELECT;
@@ -101,11 +226,14 @@ class CutAction extends AbstractContextAction {
101
226
  pattern: '*'
102
227
  };
103
228
  }
229
+ #clipboardService;
230
+ #translate;
104
231
  isExecutable(items) {
105
- return of(items.length > 0 && items.every((item) => item.permissions?.writeContent && item.permissions?.writeIndexData && item.permissions?.deleteObject));
232
+ return of(items.length > 0 &&
233
+ items.every((item) => item.permissions?.writeContent && item.permissions.writeIndexData && item.permissions.deleteObject));
106
234
  }
107
235
  run(items) {
108
- this.clipboardService.addObjects(items, 'cut', this.context?.appId);
236
+ this.#clipboardService.addObjects(items, 'cut', this.context?.appId);
109
237
  return of(true);
110
238
  }
111
239
  }
@@ -116,7 +244,7 @@ class CutAction extends AbstractContextAction {
116
244
  class DeleteComponent {
117
245
  constructor() {
118
246
  this.#dmsService = inject(DmsService);
119
- this.translate = inject(TranslateService);
247
+ this.translate = inject(TranslateService$1);
120
248
  this.#dialogData = inject(MAT_DIALOG_DATA);
121
249
  this.#dialogRef = inject((MatDialogRef));
122
250
  this.errors = signal([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
@@ -167,10 +295,10 @@ class DeleteComponent {
167
295
  cancel() {
168
296
  this.#dialogRef.close();
169
297
  }
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" }] }); }
298
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
299
+ 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
300
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DeleteComponent, decorators: [{
301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DeleteComponent, decorators: [{
174
302
  type: Component,
175
303
  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
304
  }] });
@@ -178,13 +306,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
178
306
  class DeleteAction extends AbstractContextAction {
179
307
  constructor() {
180
308
  super(...arguments);
181
- this.translate = inject(TranslateService);
309
+ this.#translate = inject(TranslateService$1);
182
310
  this.#dialog = inject(MatDialog);
183
- this.retention = inject(RetentionService);
311
+ this.#retention = inject(RetentionService);
312
+ this.#idmService = inject(IdmService);
313
+ this.#objectLocking = inject(ObjectLockingService);
184
314
  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;
315
+ this.label = this.#translate.instant('yuv.action-menu.action.delete.dms.object.label');
316
+ this.description = this.#translate.instant('yuv.action-menu.action.delete.dms.object.description');
317
+ this.priority = ActionPriorityLevel.LEVEL_8;
188
318
  this.icon = ACTION_ICON.delete;
189
319
  this.group = 'common';
190
320
  this.range = SelectionRange.MULTI_SELECT;
@@ -192,10 +322,28 @@ class DeleteAction extends AbstractContextAction {
192
322
  pattern: '*'
193
323
  };
194
324
  }
325
+ #translate;
195
326
  #dialog;
327
+ #retention;
328
+ #idmService;
329
+ #objectLocking;
330
+ isDisabled(items) {
331
+ const lockState = this.#objectLocking.getLockState(items[0]);
332
+ if (!lockState.locked)
333
+ return of(false);
334
+ return this.#idmService.getUserById(lockState.ownerId || '').pipe(map((user) => {
335
+ const userName = user ? user.title || user.email || user.id : null;
336
+ this.description = userName
337
+ ? this.#translate.instant('yuv.action-menu.action.unlock.description-locked-by-other', { user: userName })
338
+ : this.#translate.instant('yuv.action-menu.action.unlock.description-locked-by-unknown-user');
339
+ return true;
340
+ }));
341
+ }
196
342
  isExecutable(items) {
197
- const e = items[0];
198
- return of(e && !!e.permissions && e.permissions.deleteObject && !this.retention.getRetentionState(e).underRetention);
343
+ const dmsObject = items[0];
344
+ return of(!!dmsObject.permissions &&
345
+ dmsObject.permissions.deleteObject &&
346
+ !this.#retention.getRetentionState(dmsObject).underRetention);
199
347
  }
200
348
  run(items) {
201
349
  this.#dialog.open(DeleteComponent, {
@@ -211,12 +359,12 @@ class DeleteAction extends AbstractContextAction {
211
359
  class DownloadAction extends AbstractContextAction {
212
360
  constructor() {
213
361
  super(...arguments);
214
- this.translate = inject(TranslateService);
215
- this.dmsService = inject(DmsService);
362
+ this.#translate = inject(TranslateService$1);
363
+ this.#dmsService = inject(DmsService);
216
364
  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;
365
+ this.label = this.#translate.instant('yuv.action-menu.action.download.dms.object.content.label');
366
+ this.description = this.#translate.instant('yuv.action-menu.action.download.dms.object.content.description');
367
+ this.priority = ActionPriorityLevel.LEVEL_2;
220
368
  this.icon = ACTION_ICON.download;
221
369
  this.group = 'common';
222
370
  this.range = SelectionRange.MULTI_SELECT;
@@ -224,6 +372,8 @@ class DownloadAction extends AbstractContextAction {
224
372
  types: [SystemType.DOCUMENT]
225
373
  };
226
374
  }
375
+ #translate;
376
+ #dmsService;
227
377
  isExecutable(selection) {
228
378
  const noContentMatch = (Array.isArray(selection) ? selection : [selection]).find((e) => !e.content);
229
379
  if (selection.length < 1)
@@ -231,39 +381,11 @@ class DownloadAction extends AbstractContextAction {
231
381
  return of(!noContentMatch);
232
382
  }
233
383
  run(selection) {
234
- this.dmsService.downloadContent(Array.isArray(selection) ? selection : [selection]);
384
+ this.#dmsService.downloadContent(Array.isArray(selection) ? selection : [selection]);
235
385
  return of(true);
236
386
  }
237
387
  }
238
388
 
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
389
  class ActionsService {
268
390
  constructor() {
269
391
  this.injector = inject(Injector);
@@ -330,7 +452,7 @@ class ActionsService {
330
452
  return actions;
331
453
  }
332
454
  getActionsForType(objectTypeId, context) {
333
- return this.getAvailableActions(context).filter((action) => this._actionsSupportsType(action, objectTypeId));
455
+ return this.getAvailableActions(context).filter((action) => this.#actionsSupportsType(action, objectTypeId));
334
456
  }
335
457
  getActionById(id, context) {
336
458
  return this.getAvailableActions(context).find((action) => action.id === id);
@@ -357,7 +479,7 @@ class ActionsService {
357
479
  : of(Object.assign(action, { disabled: false }));
358
480
  // Recursively resolve children
359
481
  if (action.children?.length) {
360
- return resolve$.pipe(switchMap((a) => this.resolveDisabledState(a.children, selection).pipe(map(() => a))));
482
+ return resolve$.pipe(switchMap((action) => this.resolveDisabledState(action.children, selection).pipe(map(() => action))));
361
483
  }
362
484
  return resolve$;
363
485
  });
@@ -405,7 +527,7 @@ class ActionsService {
405
527
  { id: BASE_ACTION.cut, action: CutAction }
406
528
  ]);
407
529
  }
408
- _actionsSupportsType(action, objectTypeId) {
530
+ #actionsSupportsType(action, objectTypeId) {
409
531
  const matchesTypes = action.supports.types ? action.supports.types.includes(objectTypeId) : false;
410
532
  const matchesSOTs = action.supports.sots ? action.supports.sots.includes(objectTypeId) : false;
411
533
  const matchesPattern = action.supports.pattern
@@ -413,60 +535,21 @@ class ActionsService {
413
535
  : false;
414
536
  return matchesTypes || matchesSOTs || matchesPattern;
415
537
  }
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' }); }
538
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
539
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, providedIn: 'root' }); }
418
540
  }
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActionsService, decorators: [{
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ActionsService, decorators: [{
420
542
  type: Injectable,
421
543
  args: [{
422
544
  providedIn: 'root'
423
545
  }]
424
546
  }] });
425
547
 
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 }] }] } });
548
+ const ACTION_CONTEXT_TOKEN = new InjectionToken('action-context');
466
549
 
467
550
  /**
468
551
  * Generated bundle index. Do not edit.
469
552
  */
470
553
 
471
- export { ACTION_ICON, AbstractContextAction, ActionsModule, ActionsService, BASE_ACTION, ContextmenuComponent, DeleteAction, DownloadAction, SelectionRange, YuvContextMenuTriggerDirective };
554
+ export { ACTION_CONTEXT_TOKEN, ACTION_ICON, AbstractContextAction, ActionPriorityLevel, ActionsModule, ActionsService, ActionsValidationService, BASE_ACTION, ContextmenuComponent, DeleteAction, DownloadAction, SelectionRange, YuvContextMenuTriggerDirective };
472
555
  //# sourceMappingURL=yuuvis-client-framework-actions.mjs.map