@nanahoshi/mona-ui 0.24.7 → 0.24.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -9
- package/fesm2022/nanahoshi-mona-ui-button.mjs +8 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +101 -47
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +339 -101
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +119 -69
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs → nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs → nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs} +2 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DAPNqnWV.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs} +10 -10
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +44 -3
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +20 -4
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +335 -45
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +565 -197
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +465 -23
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +598 -208
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +193 -71
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +40 -3
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +49 -3
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +127 -133
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +473 -240
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +202 -90
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +609 -256
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +45 -10
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +102 -58
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +286 -443
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +205 -140
- package/fesm2022/nanahoshi-mona-ui-window.mjs +591 -310
- package/i18n/catalogs/en-US.messages.json +32 -6
- package/locales/ar-sa/ar-sa.messages.json +29 -3
- package/locales/de-de/de-de.messages.json +29 -3
- package/locales/es-es/es-es.messages.json +29 -3
- package/locales/fr-fr/fr-fr.messages.json +29 -3
- package/locales/id-id/id-id.messages.json +29 -3
- package/locales/it-it/it-it.messages.json +29 -3
- package/locales/ja-jp/ja-jp.messages.json +29 -3
- package/locales/ko-kr/ko-kr.messages.json +29 -3
- package/locales/pt-br/pt-br.messages.json +29 -3
- package/locales/ru-ru/ru-ru.messages.json +29 -3
- package/locales/tr-tr/tr-tr.messages.json +29 -3
- package/locales/zh-cn/zh-cn.messages.json +29 -3
- package/locales/zh-tw/zh-tw.messages.json +29 -3
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-button-group.d.ts +13 -3
- package/types/nanahoshi-mona-ui-button.d.ts +20 -3
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -6
- package/types/nanahoshi-mona-ui-dialog.d.ts +131 -20
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +75 -56
- package/types/nanahoshi-mona-ui-i18n.d.ts +69 -0
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +14 -2
- package/types/nanahoshi-mona-ui-internal-list.d.ts +89 -10
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +155 -40
- package/types/nanahoshi-mona-ui-internal.d.ts +128 -16
- package/types/nanahoshi-mona-ui-list-box.d.ts +148 -47
- package/types/nanahoshi-mona-ui-list-view.d.ts +112 -21
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +26 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +65 -62
- package/types/nanahoshi-mona-ui-notification.d.ts +76 -16
- package/types/nanahoshi-mona-ui-popover.d.ts +44 -17
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +110 -32
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +16 -5
- package/types/nanahoshi-mona-ui-split-button.d.ts +29 -7
- package/types/nanahoshi-mona-ui-tooltip.d.ts +43 -20
- package/types/nanahoshi-mona-ui-tree-view.d.ts +84 -40
- package/types/nanahoshi-mona-ui-window.d.ts +103 -14
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { forwardRef, Directive,
|
|
4
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
+
import { forwardRef, Directive, signal, inject, DOCUMENT, contentChildren, contentChild, TemplateRef, computed, viewChild, input, output, effect, afterRenderEffect, ElementRef, untracked, Component } from '@angular/core';
|
|
5
4
|
import { PopupMenuGroupTemplateDirective, PopupMenuTemplateOrigin, PopupMenuGroupTemplateToken, PopupMenuIconTemplateDirective, PopupMenuIconTemplateToken, PopupMenuShortcutTemplateDirective, PopupMenuShortcutTemplateToken, PopupMenuTextTemplateDirective, PopupMenuTextTemplateToken, PopupMenuItemType, PopupMenuTemplateType, ensurePopupComponentTypes, PopupMenuOrigin, ensurePopupTemplateTypes, PopupMenuToken, PopupMenuComponent, PopupMenuGroupComponent, PopupMenuCheckboxItemComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuRadioItemToken, PopupMenuSeparatorComponent } from '@nanahoshi/mona-ui/popup-menu';
|
|
6
5
|
import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
7
6
|
import { any } from '@mirei/ts-collections';
|
|
8
|
-
import { fromEvent } from 'rxjs';
|
|
9
7
|
|
|
10
8
|
class ContextMenuGroupTemplateDirective extends PopupMenuGroupTemplateDirective {
|
|
11
9
|
constructor() {
|
|
@@ -142,11 +140,39 @@ const ensureContextMenuTemplateTypes = (templates) => {
|
|
|
142
140
|
});
|
|
143
141
|
};
|
|
144
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Roles that allow both `aria-haspopup` and `aria-expanded`. On any other target (a `div`, a `section`, a table row)
|
|
145
|
+
* the attributes are invalid, so the menu leaves them off: context menus are found through the ContextMenu key and
|
|
146
|
+
* Shift+F10, not through `aria-haspopup`.
|
|
147
|
+
*/
|
|
148
|
+
const POPUP_ROLES = new Set(["button", "gridcell", "link", "menuitem", "tab", "treeitem"]);
|
|
149
|
+
const MANAGED_ATTRIBUTES = ["aria-controls", "aria-expanded", "aria-haspopup"];
|
|
150
|
+
const roleOf = (element) => {
|
|
151
|
+
const explicit = element.getAttribute("role")?.trim().split(/\s+/)[0];
|
|
152
|
+
if (explicit) {
|
|
153
|
+
return explicit;
|
|
154
|
+
}
|
|
155
|
+
if (element instanceof HTMLButtonElement) {
|
|
156
|
+
return "button";
|
|
157
|
+
}
|
|
158
|
+
if (element instanceof HTMLAnchorElement && element.hasAttribute("href")) {
|
|
159
|
+
return "link";
|
|
160
|
+
}
|
|
161
|
+
if (element instanceof HTMLInputElement && ["button", "image", "reset", "submit"].includes(element.type)) {
|
|
162
|
+
return "button";
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
};
|
|
145
166
|
class ContextMenuComponent {
|
|
146
|
-
|
|
167
|
+
/** The target, while it has a role that allows the popup attributes. */
|
|
168
|
+
#ariaTarget;
|
|
169
|
+
#document;
|
|
147
170
|
#isMenuOpen;
|
|
148
171
|
constructor() {
|
|
149
|
-
|
|
172
|
+
/** The target, while it has a role that allows the popup attributes. */
|
|
173
|
+
this.#ariaTarget = signal(null, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "#ariaTarget" }] : /* istanbul ignore next */ []));
|
|
175
|
+
this.#document = inject(DOCUMENT);
|
|
150
176
|
this.#isMenuOpen = signal(false, /* @ts-ignore */
|
|
151
177
|
...(ngDevMode ? [{ debugName: "#isMenuOpen" }] : /* istanbul ignore next */ []));
|
|
152
178
|
this.menuItemComponents = contentChildren(PopupMenuToken, { ...(ngDevMode ? { debugName: "menuItemComponents" } : /* istanbul ignore next */ {}), descendants: false });
|
|
@@ -171,8 +197,7 @@ class ContextMenuComponent {
|
|
|
171
197
|
this.textTemplate = contentChild(ContextMenuTextTemplateDirective, { ...(ngDevMode ? { debugName: "textTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
|
|
172
198
|
descendants: false });
|
|
173
199
|
/**
|
|
174
|
-
* @description
|
|
175
|
-
* Not currently applied to the target element or the rendered menu.
|
|
200
|
+
* @description Accessible name for the menu. When empty, the menu is named by the target if it has an `id`.
|
|
176
201
|
*/
|
|
177
202
|
this.ariaLabel = input("", /* @ts-ignore */
|
|
178
203
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -203,7 +228,10 @@ class ContextMenuComponent {
|
|
|
203
228
|
this.size = input("medium", /* @ts-ignore */
|
|
204
229
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
205
230
|
/**
|
|
206
|
-
* @description The target element that will be used to trigger the context menu.
|
|
231
|
+
* @description The target element that will be used to trigger the context menu. It can change: the menu, its
|
|
232
|
+
* keyboard shortcuts and its ARIA attributes follow. `aria-haspopup`, `aria-expanded` and `aria-controls` are set
|
|
233
|
+
* only on targets whose role allows them (button, link, gridcell, menuitem, tab, treeitem), and are put back
|
|
234
|
+
* when the target changes or the menu is destroyed.
|
|
207
235
|
*/
|
|
208
236
|
this.target = input.required(/* @ts-ignore */
|
|
209
237
|
...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
@@ -214,62 +242,88 @@ class ContextMenuComponent {
|
|
|
214
242
|
this.width = input(/* @ts-ignore */
|
|
215
243
|
...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
|
|
216
244
|
effect(() => ensureContextMenuComponentTypes(this.menuItemComponents()));
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
245
|
+
// After render, so the target's own host bindings (a monaButton's aria-haspopup) have run and don't undo it.
|
|
246
|
+
afterRenderEffect(onCleanup => {
|
|
247
|
+
const target = this.target();
|
|
248
|
+
const element = target instanceof ElementRef ? target.nativeElement : target;
|
|
249
|
+
if (!element) {
|
|
250
|
+
return;
|
|
221
251
|
}
|
|
252
|
+
onCleanup(untracked(() => this.#attachTo(element)));
|
|
253
|
+
});
|
|
254
|
+
effect(() => {
|
|
255
|
+
const element = this.#ariaTarget();
|
|
256
|
+
const open = this.#isMenuOpen();
|
|
257
|
+
if (!element) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
element.setAttribute("aria-expanded", String(open));
|
|
261
|
+
if (open) {
|
|
262
|
+
element.setAttribute("aria-controls", this.menuId);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
element.removeAttribute("aria-controls");
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
effect(onCleanup => {
|
|
269
|
+
const view = this.#document.defaultView;
|
|
270
|
+
if (!this.#isMenuOpen() || !view) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
// Like a native context menu, it closes when the window loses focus.
|
|
274
|
+
const close = () => this.popupMenuRef()?.closeMenu();
|
|
275
|
+
view.addEventListener("blur", close);
|
|
276
|
+
onCleanup(() => view.removeEventListener("blur", close));
|
|
222
277
|
});
|
|
223
278
|
}
|
|
224
279
|
onMenuClose() {
|
|
225
280
|
this.#isMenuOpen.set(false);
|
|
226
|
-
this.updateTargetAriaAttributes();
|
|
227
281
|
}
|
|
228
282
|
onMenuOpen() {
|
|
229
283
|
this.#isMenuOpen.set(true);
|
|
230
|
-
this.updateTargetAriaAttributes();
|
|
231
284
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
setKeyboardEvents() {
|
|
239
|
-
const target = this.target();
|
|
240
|
-
const targetElement = target instanceof ElementRef ? target.nativeElement : target;
|
|
241
|
-
if (!targetElement) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
fromEvent(targetElement, "keydown")
|
|
245
|
-
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
246
|
-
.subscribe(event => {
|
|
285
|
+
/**
|
|
286
|
+
* Listens for the keyboard shortcuts on the target and, when its role allows them, sets the popup attributes.
|
|
287
|
+
* Returns the cleanup that undoes both.
|
|
288
|
+
*/
|
|
289
|
+
#attachTo(element) {
|
|
290
|
+
const onKeydown = (event) => {
|
|
247
291
|
if (event.key === "ContextMenu" || (event.key === "F10" && event.shiftKey)) {
|
|
248
292
|
event.preventDefault();
|
|
249
293
|
this.openMenuViaKeyboard();
|
|
250
294
|
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
|
|
295
|
+
};
|
|
296
|
+
element.addEventListener("keydown", onKeydown);
|
|
297
|
+
const role = roleOf(element);
|
|
298
|
+
const managed = role !== null && POPUP_ROLES.has(role);
|
|
299
|
+
const previous = MANAGED_ATTRIBUTES.map(name => [name, element.getAttribute(name)]);
|
|
300
|
+
if (managed) {
|
|
301
|
+
element.setAttribute("aria-haspopup", "menu");
|
|
302
|
+
this.#ariaTarget.set(element);
|
|
258
303
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
304
|
+
return () => {
|
|
305
|
+
element.removeEventListener("keydown", onKeydown);
|
|
306
|
+
if (managed) {
|
|
307
|
+
this.#ariaTarget.set(null);
|
|
308
|
+
for (const [name, value] of previous) {
|
|
309
|
+
if (value === null) {
|
|
310
|
+
element.removeAttribute(name);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
element.setAttribute(name, value);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
262
318
|
}
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return;
|
|
319
|
+
openMenuViaKeyboard() {
|
|
320
|
+
const popupMenu = this.popupMenuRef();
|
|
321
|
+
if (popupMenu && !this.#isMenuOpen()) {
|
|
322
|
+
popupMenu.openMenuViaKeyboard(true);
|
|
268
323
|
}
|
|
269
|
-
targetElement.setAttribute("aria-expanded", this.#isMenuOpen().toString());
|
|
270
324
|
}
|
|
271
325
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
272
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ContextMenuComponent, isStandalone: true, selector: "mona-contextmenu", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuClick: "menuClick" }, queries: [{ propertyName: "menuItemComponents", predicate: PopupMenuToken, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ContextMenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ContextMenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "shortcutTemplate", first: true, predicate: ContextMenuShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: ContextMenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuRef", first: true, predicate: ["popupMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<mona-popup-menu\n [target]=\"target()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n", dependencies: [{ kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "
|
|
326
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ContextMenuComponent, isStandalone: true, selector: "mona-contextmenu", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuClick: "menuClick" }, queries: [{ propertyName: "menuItemComponents", predicate: PopupMenuToken, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ContextMenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ContextMenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "shortcutTemplate", first: true, predicate: ContextMenuShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: ContextMenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuRef", first: true, predicate: ["popupMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<mona-popup-menu\n [target]=\"target()\"\n [ariaLabel]=\"ariaLabel()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n", dependencies: [{ kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "ariaLabel", "ariaLabelledBy", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "class", "width"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
|
|
273
327
|
}
|
|
274
328
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuComponent, decorators: [{
|
|
275
329
|
type: Component,
|
|
@@ -280,7 +334,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
280
334
|
PopupMenuIconTemplateDirective,
|
|
281
335
|
PopupMenuShortcutTemplateDirective,
|
|
282
336
|
PopupMenuGroupTemplateDirective
|
|
283
|
-
], template: "<mona-popup-menu\n [target]=\"target()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n" }]
|
|
337
|
+
], template: "<mona-popup-menu\n [target]=\"target()\"\n [ariaLabel]=\"ariaLabel()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n" }]
|
|
284
338
|
}], ctorParameters: () => [], propDecorators: { menuItemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PopupMenuToken), { ...{ descendants: false }, isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ContextMenuGroupTemplateDirective), { ...{
|
|
285
339
|
read: TemplateRef,
|
|
286
340
|
descendants: false
|