@acorex/components 21.0.2-next.5 → 21.0.2-next.50
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/conversation2/README.md +5 -8
- package/fesm2022/acorex-components-accordion.mjs +29 -29
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +30 -30
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +16 -16
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs +5 -5
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +11 -11
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs +14 -14
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +17 -16
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +9 -9
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +14 -14
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +13 -13
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +40 -20
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +35 -36
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +256 -54
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +10 -10
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +9 -9
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +13 -13
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs +27 -27
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +14 -14
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +84 -43
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +19 -19
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +35 -35
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +105 -105
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation2.mjs +11165 -8111
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +51 -51
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs +31 -31
- package/fesm2022/acorex-components-data-list.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +93 -104
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +69 -57
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +174 -39
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +30 -38
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +62 -55
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +39 -39
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +19 -26
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +23 -23
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +9 -9
- package/fesm2022/acorex-components-dropdown.mjs +19 -19
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-editor.mjs +12 -12
- package/fesm2022/acorex-components-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-fab.mjs +15 -15
- package/fesm2022/acorex-components-fab.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs +74 -58
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +30 -30
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +15 -15
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +87 -87
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +11 -11
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +12 -12
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +23 -23
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +15 -15
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +9 -9
- package/fesm2022/acorex-components-list.mjs +15 -15
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +19 -19
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +21 -21
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +46 -46
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +82 -82
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +353 -197
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-CcXuJ4IW.mjs → acorex-components-modal-acorex-components-modal-JpPBSiVh.mjs} +28 -28
- package/fesm2022/{acorex-components-modal-acorex-components-modal-CcXuJ4IW.mjs.map → acorex-components-modal-acorex-components-modal-JpPBSiVh.mjs.map} +1 -1
- package/fesm2022/{acorex-components-modal-modal-content.component-DTZu2zbU.mjs → acorex-components-modal-modal-content.component-DKweXQfl.mjs} +39 -39
- package/fesm2022/acorex-components-modal-modal-content.component-DKweXQfl.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +8 -8
- package/fesm2022/acorex-components-notification.mjs +28 -28
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +61 -23
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +45 -21
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +10 -10
- package/fesm2022/acorex-components-paint.mjs +53 -53
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +28 -28
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +9 -9
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +19 -19
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +31 -31
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +11 -11
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +48 -24
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +8 -8
- package/fesm2022/acorex-components-qrcode.mjs +37 -20
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +15 -14
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +9 -9
- package/fesm2022/acorex-components-rail-navigation.mjs +28 -28
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +34 -34
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +17 -17
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +33 -33
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +8 -8
- package/fesm2022/acorex-components-routing-progress.mjs +8 -8
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +36 -36
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +118 -118
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +398 -326
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +9 -9
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +22 -22
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +12 -12
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +11 -11
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +455 -97
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +8 -8
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +7 -7
- package/fesm2022/acorex-components-sliding-item.mjs +25 -25
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +40 -39
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +12 -12
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +20 -20
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +19 -19
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +8 -8
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +9 -9
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +12 -12
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs +28 -30
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +19 -19
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +26 -26
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +13 -13
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +27 -18
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +326 -67
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +17 -17
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +8 -8
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +60 -53
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/package.json +5 -4
- package/types/acorex-components-button-group.d.ts +9 -3
- package/types/acorex-components-button.d.ts +2 -8
- package/types/acorex-components-calendar.d.ts +138 -27
- package/types/acorex-components-color-palette.d.ts +2 -0
- package/types/acorex-components-conversation2.d.ts +1296 -1256
- package/types/acorex-components-data-pager.d.ts +6 -25
- package/types/acorex-components-data-table.d.ts +12 -2
- package/types/acorex-components-datetime-box.d.ts +79 -8
- package/types/acorex-components-datetime-input.d.ts +2 -2
- package/types/acorex-components-datetime-picker.d.ts +15 -5
- package/types/acorex-components-flow-chart.d.ts +4 -0
- package/types/acorex-components-menu.d.ts +101 -36
- package/types/acorex-components-number-box.d.ts +9 -0
- package/types/acorex-components-otp.d.ts +18 -1
- package/types/acorex-components-popup.d.ts +11 -1
- package/types/acorex-components-qrcode.d.ts +1 -0
- package/types/acorex-components-query-builder.d.ts +1 -1
- package/types/acorex-components-scheduler.d.ts +23 -2
- package/types/acorex-components-side-menu.d.ts +96 -34
- package/types/acorex-components-step-wizard.d.ts +2 -1
- package/types/acorex-components-tree-view.d.ts +43 -2
- package/types/acorex-components-wysiwyg.d.ts +6 -1
- package/fesm2022/acorex-components-modal-modal-content.component-DTZu2zbU.mjs.map +0 -1
|
@@ -2,11 +2,14 @@ import { NXClickEvent, NXComponent, AXComponent, NXEvent } from '@acorex/cdk/com
|
|
|
2
2
|
import { AXDecoratorGenericComponent, AXDecoratorIconComponent } from '@acorex/components/decorators';
|
|
3
3
|
import { isBrowser } from '@acorex/core/platform';
|
|
4
4
|
import { AXTranslatorPipe } from '@acorex/core/translation';
|
|
5
|
-
import {
|
|
5
|
+
import { AXHtmlUtil, AXUnsubscriber } from '@acorex/core/utils';
|
|
6
6
|
import { AXZIndexService } from '@acorex/core/z-index';
|
|
7
7
|
import { isPlatformBrowser, NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { Injectable, signal,
|
|
9
|
+
import { inject, DestroyRef, DOCUMENT, PLATFORM_ID, Injectable, signal, computed, contentChildren, viewChild, input, Renderer2, Injector, output, afterNextRender, HostBinding, HostListener, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
10
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
+
import { Router, NavigationStart } from '@angular/router';
|
|
12
|
+
import { filter } from 'rxjs/operators';
|
|
10
13
|
import { cloneDeep } from 'lodash-es';
|
|
11
14
|
import { Subject } from 'rxjs';
|
|
12
15
|
|
|
@@ -15,23 +18,86 @@ class AXMenuService {
|
|
|
15
18
|
this.closeAll$ = new Subject();
|
|
16
19
|
this.open$ = new Subject();
|
|
17
20
|
this.close$ = new Subject();
|
|
18
|
-
this.closeExcept$ = new Subject();
|
|
19
21
|
this.openContextMenu$ = new Subject();
|
|
20
22
|
this.closeAllContextMenu$ = new Subject();
|
|
23
|
+
this.destroyRef = inject(DestroyRef);
|
|
24
|
+
this.document = inject(DOCUMENT);
|
|
25
|
+
this.platformId = inject(PLATFORM_ID);
|
|
26
|
+
this.openItems = new Set();
|
|
27
|
+
this.globalListenersBound = false;
|
|
28
|
+
this.scrollableParents = [];
|
|
29
|
+
this.onDocumentClick = (event) => {
|
|
30
|
+
if (this.rootElement && !this.rootElement.contains(event.target)) {
|
|
31
|
+
this.closeAll$.next();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.onWindowOrScrollEvent = () => {
|
|
35
|
+
this.closeAll$.next();
|
|
36
|
+
};
|
|
37
|
+
this.closeAll$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
38
|
+
this.openItems.clear();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Registers a single set of document/window/scroll listeners for the whole menu tree.
|
|
43
|
+
*/
|
|
44
|
+
initGlobalListeners(rootElement) {
|
|
45
|
+
if (!isPlatformBrowser(this.platformId) || this.globalListenersBound) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.globalListenersBound = true;
|
|
49
|
+
this.rootElement = rootElement;
|
|
50
|
+
this.document.addEventListener('click', this.onDocumentClick);
|
|
51
|
+
window.addEventListener('scroll', this.onWindowOrScrollEvent, { capture: true });
|
|
52
|
+
window.addEventListener('resize', this.onWindowOrScrollEvent);
|
|
53
|
+
this.scrollableParents = AXHtmlUtil.getScrollableParents(rootElement);
|
|
54
|
+
this.scrollableParents.forEach((parent) => {
|
|
55
|
+
parent.addEventListener('scroll', this.onWindowOrScrollEvent);
|
|
56
|
+
});
|
|
57
|
+
this.destroyRef.onDestroy(() => {
|
|
58
|
+
this.document.removeEventListener('click', this.onDocumentClick);
|
|
59
|
+
window.removeEventListener('scroll', this.onWindowOrScrollEvent, { capture: true });
|
|
60
|
+
window.removeEventListener('resize', this.onWindowOrScrollEvent);
|
|
61
|
+
this.scrollableParents.forEach((parent) => {
|
|
62
|
+
parent.removeEventListener('scroll', this.onWindowOrScrollEvent);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Closes open submenus that are not on the ancestor path of the item being opened.
|
|
68
|
+
*/
|
|
69
|
+
closeExcept(opener) {
|
|
70
|
+
const keepOpen = new Set();
|
|
71
|
+
let current = opener;
|
|
72
|
+
while (current) {
|
|
73
|
+
keepOpen.add(current);
|
|
74
|
+
current = current.getParentMenuItem?.() ?? current.parent ?? null;
|
|
75
|
+
}
|
|
76
|
+
for (const openItem of [...this.openItems]) {
|
|
77
|
+
if (!keepOpen.has(openItem)) {
|
|
78
|
+
this.markClosed(openItem);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
21
81
|
}
|
|
22
|
-
|
|
23
|
-
|
|
82
|
+
markOpen(item) {
|
|
83
|
+
this.openItems.add(item);
|
|
84
|
+
this.open$.next(item);
|
|
85
|
+
}
|
|
86
|
+
markClosed(item) {
|
|
87
|
+
this.openItems.delete(item);
|
|
88
|
+
this.close$.next(item);
|
|
89
|
+
}
|
|
90
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
91
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuService }); }
|
|
24
92
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuService, decorators: [{
|
|
26
94
|
type: Injectable
|
|
27
|
-
}] });
|
|
95
|
+
}], ctorParameters: () => [] });
|
|
28
96
|
|
|
29
97
|
class AXRootMenu {
|
|
30
98
|
}
|
|
31
99
|
class AXMenuItemComponentBase {
|
|
32
100
|
}
|
|
33
|
-
class AXMenuItem {
|
|
34
|
-
}
|
|
35
101
|
class AXMenuItemClickBaseEvent extends NXClickEvent {
|
|
36
102
|
constructor() {
|
|
37
103
|
super(...arguments);
|
|
@@ -46,15 +112,26 @@ class AXMenuItemClickBaseEvent extends NXClickEvent {
|
|
|
46
112
|
class AXMenuItemComponent extends NXComponent {
|
|
47
113
|
constructor() {
|
|
48
114
|
super();
|
|
49
|
-
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
50
|
-
this.
|
|
51
|
-
this.isFirstLevel =
|
|
115
|
+
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
116
|
+
this.parent = inject(AXMenuItemComponent, { optional: true, skipSelf: true });
|
|
117
|
+
this.isFirstLevel = computed(() => this.getParentMenuItem() == null, ...(ngDevMode ? [{ debugName: "isFirstLevel" }] : /* istanbul ignore next */ []));
|
|
118
|
+
this.childMenuItems = contentChildren(AXMenuItemComponent, { ...(ngDevMode ? { debugName: "childMenuItems" } : /* istanbul ignore next */ {}), descendants: false });
|
|
119
|
+
this.submenuSlot = viewChild('submenuSlot', ...(ngDevMode ? [{ debugName: "submenuSlot" }] : /* istanbul ignore next */ []));
|
|
120
|
+
this.platformId = inject(PLATFORM_ID);
|
|
121
|
+
this.destroyRef = inject(DestroyRef);
|
|
122
|
+
this.childObserver = null;
|
|
123
|
+
this.childRefreshScheduled = false;
|
|
124
|
+
/**
|
|
125
|
+
* Nested items from the data model. Required for recursive `ngTemplateOutlet` templates
|
|
126
|
+
* because `contentChildren` does not traverse those embedded views.
|
|
127
|
+
*/
|
|
128
|
+
this.subItems = input([], ...(ngDevMode ? [{ debugName: "subItems" }] : /* istanbul ignore next */ []));
|
|
129
|
+
this.hasSubItems = computed(() => (this.subItems()?.length ?? 0) > 0 || this.childMenuItems().length > 0, ...(ngDevMode ? [{ debugName: "hasSubItems" }] : /* istanbul ignore next */ []));
|
|
52
130
|
this.root = inject(AXRootMenu);
|
|
53
|
-
this.isRoot = () => this.parent == null;
|
|
54
131
|
this.service = inject(AXMenuService);
|
|
55
|
-
this.scrollableParents = [];
|
|
56
132
|
this.unsuscriber = inject(AXUnsubscriber);
|
|
57
133
|
this.renderer = inject(Renderer2);
|
|
134
|
+
this.injector = inject(Injector);
|
|
58
135
|
this.zIndexService = inject(AXZIndexService);
|
|
59
136
|
this.zToken = null;
|
|
60
137
|
this.arrowIcon = computed(() => {
|
|
@@ -64,150 +141,123 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
64
141
|
: isRtl
|
|
65
142
|
? 'ax-icon-chevron-left'
|
|
66
143
|
: 'ax-icon-chevron-right';
|
|
67
|
-
}, ...(ngDevMode ? [{ debugName: "arrowIcon" }] : []));
|
|
144
|
+
}, ...(ngDevMode ? [{ debugName: "arrowIcon" }] : /* istanbul ignore next */ []));
|
|
68
145
|
this.onClick = output();
|
|
69
|
-
this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
|
|
70
|
-
this.data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
|
|
71
|
-
this.disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : []));
|
|
72
|
-
this.color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
73
|
-
|
|
146
|
+
this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
147
|
+
this.data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
|
|
148
|
+
this.disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
149
|
+
this.color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
|
|
150
|
+
this.mouseLeaveTimeout = null;
|
|
74
151
|
afterNextRender(() => {
|
|
75
|
-
this.
|
|
76
|
-
|
|
77
|
-
|
|
152
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.reparentOrphanedChildren();
|
|
156
|
+
this.childObserver = new MutationObserver((records) => {
|
|
157
|
+
if (!this.hasRelevantChildMutation(records)) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.scheduleChildRefresh();
|
|
161
|
+
});
|
|
162
|
+
this.childObserver.observe(this.nativeElement, { childList: true, subtree: true });
|
|
163
|
+
this.destroyRef.onDestroy(() => this.childObserver?.disconnect());
|
|
78
164
|
});
|
|
79
|
-
//
|
|
80
165
|
this.service.closeAll$.pipe(this.unsuscriber.takeUntilDestroy).subscribe(() => this.close());
|
|
81
166
|
this.service.open$.pipe(this.unsuscriber.takeUntilDestroy).subscribe((item) => {
|
|
82
167
|
if (this === item) {
|
|
83
168
|
this.isOpen.set(true);
|
|
84
|
-
this.
|
|
169
|
+
this.schedulePositionCalculation();
|
|
85
170
|
}
|
|
86
171
|
});
|
|
87
|
-
//
|
|
88
172
|
this.service.close$.pipe(this.unsuscriber.takeUntilDestroy).subscribe((item) => {
|
|
89
173
|
if (this == item) {
|
|
90
174
|
this.isOpen.set(false);
|
|
91
175
|
}
|
|
92
176
|
});
|
|
93
|
-
//
|
|
94
|
-
this.service.closeExcept$.pipe(this.unsuscriber.takeUntilDestroy).subscribe((item) => {
|
|
95
|
-
this.closeExcept(item);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
closeExcept(item) {
|
|
99
|
-
const list = [item];
|
|
100
|
-
// TODO: Check for better solution
|
|
101
|
-
const parentEl = this.nativeElement.parentElement?.parentElement;
|
|
102
|
-
this.parent = parentEl?.tagName == 'AX-MENU-ITEM' ? parentEl?.['__axContext__'] : null;
|
|
103
|
-
//
|
|
104
|
-
let parent = item.parent;
|
|
105
|
-
while (parent != null) {
|
|
106
|
-
list.push(parent);
|
|
107
|
-
parent = parent.parent;
|
|
108
|
-
}
|
|
109
|
-
//
|
|
110
|
-
if (!list.includes(this)) {
|
|
111
|
-
this.close();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
observeMutations() {
|
|
115
|
-
this.mutationObserver = new MutationObserver(() => {
|
|
116
|
-
this.detectSubItems();
|
|
117
|
-
});
|
|
118
|
-
// Start observing changes in child elements
|
|
119
|
-
this.mutationObserver.observe(this.nativeElement, {
|
|
120
|
-
childList: true,
|
|
121
|
-
subtree: true,
|
|
122
|
-
});
|
|
123
177
|
}
|
|
124
178
|
getText() {
|
|
125
179
|
return this.nativeElement.querySelector('ax-text')?.innerText;
|
|
126
180
|
}
|
|
127
181
|
/**
|
|
128
|
-
*
|
|
182
|
+
* Resolves the parent menu item. Items rendered via recursive `ngTemplateOutlet` do not
|
|
183
|
+
* receive a DI parent, so we fall back to the DOM tree after reparenting.
|
|
129
184
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this.parent = parentEl?.tagName == 'AX-MENU-ITEM' ? parentEl?.['__axContext__'] : null;
|
|
134
|
-
//
|
|
135
|
-
const tag = this.nativeElement.parentElement?.tagName;
|
|
136
|
-
this.isFirstLevel.set(tag == 'AX-MENU' || tag == 'AX-CONTEXT-MENU');
|
|
137
|
-
const subItems = this.nativeElement.querySelectorAll('ax-menu-item');
|
|
138
|
-
if (subItems.length > 0) {
|
|
139
|
-
this.hasSubItems.set(true);
|
|
185
|
+
getParentMenuItem() {
|
|
186
|
+
if (this.parent) {
|
|
187
|
+
return this.parent;
|
|
140
188
|
}
|
|
141
|
-
|
|
142
|
-
|
|
189
|
+
const parentHost = this.nativeElement.parentElement?.closest('ax-menu-item');
|
|
190
|
+
if (!parentHost || parentHost === this.nativeElement) {
|
|
191
|
+
return null;
|
|
143
192
|
}
|
|
193
|
+
const ctx = parentHost.__axContext__;
|
|
194
|
+
return ctx instanceof AXMenuItemComponent ? ctx : null;
|
|
144
195
|
}
|
|
145
196
|
/**
|
|
146
197
|
* Opens the submenu of this menu item if it has sub-items and is not disabled.
|
|
147
|
-
*
|
|
148
|
-
* Inherited behavior: Uses the injected service to notify other items to close.
|
|
149
|
-
*
|
|
150
|
-
* @returns void - No return value. Triggers submenu opening side-effects.
|
|
151
198
|
*/
|
|
152
199
|
open() {
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
this.
|
|
200
|
+
if (this.disabled() || !this.hasSubItems()) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.reparentOrphanedChildren();
|
|
204
|
+
this.service.closeExcept(this);
|
|
205
|
+
if (!this.zToken) {
|
|
206
|
+
this.zToken = this.zIndexService.acquire();
|
|
160
207
|
}
|
|
208
|
+
this.service.markOpen(this);
|
|
161
209
|
}
|
|
162
210
|
/**
|
|
163
211
|
* Closes the submenu of this menu item if open.
|
|
164
|
-
*
|
|
165
|
-
* @returns void - No return value. Triggers submenu closing side-effects.
|
|
166
212
|
*/
|
|
167
213
|
close() {
|
|
168
|
-
this.service.
|
|
169
|
-
// Release z-index token
|
|
214
|
+
this.service.markClosed(this);
|
|
170
215
|
this.zIndexService.release(this.zToken);
|
|
171
216
|
this.zToken = null;
|
|
172
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Positions the submenu after layout so nested levels measure their full height.
|
|
220
|
+
*/
|
|
221
|
+
schedulePositionCalculation() {
|
|
222
|
+
afterNextRender(() => {
|
|
223
|
+
if (this.isOpen()) {
|
|
224
|
+
this.calculatePosition();
|
|
225
|
+
afterNextRender(() => {
|
|
226
|
+
if (this.isOpen()) {
|
|
227
|
+
this.calculatePosition();
|
|
228
|
+
}
|
|
229
|
+
}, { injector: this.injector });
|
|
230
|
+
}
|
|
231
|
+
}, { injector: this.injector });
|
|
232
|
+
}
|
|
173
233
|
/**
|
|
174
234
|
* Calculate the position of the submenu to avoid it going out of the viewport.
|
|
175
235
|
*/
|
|
176
236
|
calculatePosition() {
|
|
177
|
-
const submenu = this.
|
|
237
|
+
const submenu = this.submenuSlot()?.nativeElement;
|
|
178
238
|
if (!submenu)
|
|
179
239
|
return;
|
|
180
|
-
|
|
181
|
-
this.renderer.setStyle(submenu, 'visibility', 'hidden');
|
|
182
|
-
this.renderer.setStyle(submenu, 'display', 'block');
|
|
183
|
-
const submenuRect = submenu.getBoundingClientRect();
|
|
240
|
+
const submenuRect = this.measureSubmenuRect(submenu);
|
|
184
241
|
const itemRect = this.nativeElement.getBoundingClientRect();
|
|
185
242
|
const windowWidth = window.innerWidth;
|
|
186
243
|
const windowHeight = window.innerHeight;
|
|
187
|
-
// Reset temporary styles
|
|
188
|
-
this.renderer.removeStyle(submenu, 'visibility');
|
|
189
|
-
this.renderer.removeStyle(submenu, 'display');
|
|
190
244
|
const isRtl = AXHtmlUtil.isRtl(this.nativeElement);
|
|
191
245
|
let finalTop;
|
|
192
246
|
let finalLeft;
|
|
193
|
-
// --- 1. VERTICAL POSITIONING ---
|
|
194
247
|
const preferredTop = this.isFirstLevel() && this.root.orientation() === 'horizontal'
|
|
195
|
-
? itemRect.bottom
|
|
196
|
-
: itemRect.top;
|
|
197
|
-
const alternateTop = itemRect.top - submenuRect.height;
|
|
248
|
+
? itemRect.bottom
|
|
249
|
+
: itemRect.top;
|
|
250
|
+
const alternateTop = itemRect.top - submenuRect.height;
|
|
198
251
|
if (preferredTop + submenuRect.height <= windowHeight) {
|
|
199
252
|
finalTop = preferredTop;
|
|
200
253
|
}
|
|
201
|
-
else if (
|
|
254
|
+
else if (alternateTop >= 0) {
|
|
202
255
|
finalTop = alternateTop;
|
|
203
256
|
}
|
|
204
257
|
else {
|
|
205
258
|
finalTop = windowHeight - submenuRect.height;
|
|
206
259
|
}
|
|
207
|
-
|
|
208
|
-
finalTop = 0;
|
|
209
|
-
}
|
|
210
|
-
// --- 2. HORIZONTAL POSITIONING ---
|
|
260
|
+
finalTop = this.clampVerticalPosition(finalTop, submenuRect.height, windowHeight);
|
|
211
261
|
if (this.isFirstLevel() && this.root.orientation() === 'horizontal') {
|
|
212
262
|
const preferredLeft = isRtl ? itemRect.right - submenuRect.width : itemRect.left;
|
|
213
263
|
const alternateLeft = isRtl ? itemRect.left : itemRect.right - submenuRect.width;
|
|
@@ -246,7 +296,6 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
246
296
|
}
|
|
247
297
|
}
|
|
248
298
|
}
|
|
249
|
-
// --- 3. NEW: OVERLAP-AWARE VERTICAL SHIFT ---
|
|
250
299
|
const isNestedMenu = !(this.isFirstLevel() && this.root.orientation() === 'horizontal');
|
|
251
300
|
if (isNestedMenu) {
|
|
252
301
|
const overlapsParent = finalLeft < itemRect.right && itemRect.left < finalLeft + submenuRect.width;
|
|
@@ -257,20 +306,100 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
257
306
|
}
|
|
258
307
|
}
|
|
259
308
|
}
|
|
260
|
-
|
|
309
|
+
finalTop = this.clampVerticalPosition(finalTop, submenuRect.height, windowHeight);
|
|
261
310
|
this.renderer.setStyle(submenu, 'position', 'fixed');
|
|
262
311
|
this.renderer.setStyle(submenu, 'top', `${finalTop}px`);
|
|
263
312
|
this.renderer.setStyle(submenu, 'left', `${finalLeft}px`);
|
|
264
|
-
// Apply z-index from token
|
|
265
313
|
if (this.zToken) {
|
|
266
314
|
this.renderer.setStyle(submenu, 'z-index', String(this.zToken.zIndex));
|
|
267
315
|
}
|
|
268
316
|
}
|
|
317
|
+
/** Measures submenu size using the same flex layout as the rendered menu. */
|
|
318
|
+
measureSubmenuRect(submenu) {
|
|
319
|
+
this.renderer.setStyle(submenu, 'visibility', 'hidden');
|
|
320
|
+
this.renderer.setStyle(submenu, 'display', 'flex');
|
|
321
|
+
const rect = submenu.getBoundingClientRect();
|
|
322
|
+
this.renderer.removeStyle(submenu, 'visibility');
|
|
323
|
+
this.renderer.removeStyle(submenu, 'display');
|
|
324
|
+
return rect;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Moves nested `ax-menu-item` nodes rendered by recursive `ngTemplateOutlet` templates
|
|
328
|
+
* into the submenu slot. Angular content queries do not traverse those embedded views.
|
|
329
|
+
*/
|
|
330
|
+
reparentOrphanedChildren() {
|
|
331
|
+
const container = this.submenuSlot()?.nativeElement;
|
|
332
|
+
if (!container) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
for (const el of this.getDirectChildElements()) {
|
|
336
|
+
if (!container.contains(el)) {
|
|
337
|
+
try {
|
|
338
|
+
container.appendChild(el);
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
// HierarchyRequestError when the node is already being moved.
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/** Direct nested `ax-menu-item` hosts for this item only. */
|
|
347
|
+
getDirectChildElements() {
|
|
348
|
+
return Array.from(this.nativeElement.querySelectorAll('ax-menu-item')).filter((el) => {
|
|
349
|
+
if (el === this.nativeElement) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
return el.parentElement?.closest('ax-menu-item') === this.nativeElement;
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
scheduleChildRefresh() {
|
|
356
|
+
if (this.childRefreshScheduled) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
this.childRefreshScheduled = true;
|
|
360
|
+
requestAnimationFrame(() => {
|
|
361
|
+
this.childRefreshScheduled = false;
|
|
362
|
+
this.reparentOrphanedChildren();
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
hasRelevantChildMutation(records) {
|
|
366
|
+
for (const record of records) {
|
|
367
|
+
if (this.nodeListContainsMenuStructuralNode(record.addedNodes) ||
|
|
368
|
+
this.nodeListContainsMenuStructuralNode(record.removedNodes)) {
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
nodeListContainsMenuStructuralNode(nodes) {
|
|
375
|
+
for (const node of Array.from(nodes)) {
|
|
376
|
+
if (!(node instanceof Element)) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
const tagName = node.tagName;
|
|
380
|
+
if (tagName === 'AX-MENU-ITEM' || tagName === 'AX-TITLE' || tagName === 'AX-DIVIDER') {
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
if (node.querySelector?.('ax-menu-item,ax-title,ax-divider')) {
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
/** Keeps the submenu fully inside the viewport vertically. */
|
|
390
|
+
clampVerticalPosition(top, height, windowHeight) {
|
|
391
|
+
if (top + height > windowHeight) {
|
|
392
|
+
top = windowHeight - height;
|
|
393
|
+
}
|
|
394
|
+
if (top < 0) {
|
|
395
|
+
top = 0;
|
|
396
|
+
}
|
|
397
|
+
return top;
|
|
398
|
+
}
|
|
269
399
|
handleClick(e) {
|
|
270
400
|
e.stopPropagation();
|
|
271
401
|
if (this.disabled())
|
|
272
402
|
return;
|
|
273
|
-
//
|
|
274
403
|
const event = {
|
|
275
404
|
sender: this,
|
|
276
405
|
nativeEvent: e,
|
|
@@ -281,10 +410,8 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
281
410
|
data: this.data(),
|
|
282
411
|
},
|
|
283
412
|
};
|
|
284
|
-
//
|
|
285
413
|
this.onClick.emit(event);
|
|
286
414
|
this.root.onItemClick.emit({ ...event, ...{ sender: this.root } });
|
|
287
|
-
//
|
|
288
415
|
if (this.hasSubItems() && !event.canceled) {
|
|
289
416
|
this.open();
|
|
290
417
|
}
|
|
@@ -295,10 +422,9 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
295
422
|
}
|
|
296
423
|
handleMouseEnter(event) {
|
|
297
424
|
event.stopPropagation();
|
|
298
|
-
// Cancel the close delay if the mouse re-enters the element
|
|
299
425
|
if (this.mouseLeaveTimeout) {
|
|
300
426
|
clearTimeout(this.mouseLeaveTimeout);
|
|
301
|
-
this.mouseLeaveTimeout = null;
|
|
427
|
+
this.mouseLeaveTimeout = null;
|
|
302
428
|
}
|
|
303
429
|
if (!this.isFirstLevel() || this.root.openOn() == 'hover') {
|
|
304
430
|
this.open();
|
|
@@ -306,49 +432,35 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
306
432
|
}
|
|
307
433
|
handleMouseLeave(event) {
|
|
308
434
|
event.stopPropagation();
|
|
309
|
-
if (this.hasSubItems()
|
|
310
|
-
|
|
311
|
-
if (this.mouseLeaveTimeout) {
|
|
312
|
-
clearTimeout(this.mouseLeaveTimeout);
|
|
313
|
-
}
|
|
314
|
-
// Set a delay before closing the submenu
|
|
315
|
-
this.mouseLeaveTimeout = setTimeout(() => {
|
|
316
|
-
this.close();
|
|
317
|
-
}, 500); // Adjust the delay (500ms in this case) as per your requirement
|
|
435
|
+
if (!this.hasSubItems() || this.root.closeOn() !== 'leave') {
|
|
436
|
+
return;
|
|
318
437
|
}
|
|
438
|
+
const relatedTarget = event.relatedTarget;
|
|
439
|
+
if (relatedTarget instanceof Node && this.containsSubmenuPointer(relatedTarget)) {
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (this.mouseLeaveTimeout) {
|
|
443
|
+
clearTimeout(this.mouseLeaveTimeout);
|
|
444
|
+
}
|
|
445
|
+
this.mouseLeaveTimeout = setTimeout(() => {
|
|
446
|
+
this.close();
|
|
447
|
+
}, 500);
|
|
319
448
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*/
|
|
326
|
-
onClickOutside(event) {
|
|
327
|
-
const hostElement = this.root.nativeElement;
|
|
328
|
-
if (!hostElement.contains(event.target)) {
|
|
329
|
-
this.service.closeAll$.next(); // Close all menus if click is outside the root and sub-items
|
|
449
|
+
/** True when the pointer moved into this item's submenu panel or a nested open submenu. */
|
|
450
|
+
containsSubmenuPointer(node) {
|
|
451
|
+
const submenu = this.submenuSlot()?.nativeElement;
|
|
452
|
+
if (submenu?.contains(node)) {
|
|
453
|
+
return true;
|
|
330
454
|
}
|
|
455
|
+
if (this.nativeElement.contains(node)) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
return this.getDirectChildElements().some((child) => child.contains(node));
|
|
331
459
|
}
|
|
332
460
|
ngOnDestroy() {
|
|
333
|
-
this.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this.scrollableParents = AXHtmlUtil.getScrollableParents(this.nativeElement);
|
|
337
|
-
this.scrollableParents.forEach((parent) => {
|
|
338
|
-
parent.addEventListener('scroll', this.onContainerScroll.bind(this));
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
// Remove scroll event listeners
|
|
342
|
-
removeScrollEvents() {
|
|
343
|
-
this.scrollableParents.forEach((parent) => {
|
|
344
|
-
parent.removeEventListener('scroll', this.onContainerScroll.bind(this));
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Handler for scroll events (window or scrollable parent containers)
|
|
349
|
-
*/
|
|
350
|
-
onContainerScroll() {
|
|
351
|
-
this.service.closeAll$.next(); // Close all menus on scroll
|
|
461
|
+
if (this.isOpen()) {
|
|
462
|
+
this.close();
|
|
463
|
+
}
|
|
352
464
|
}
|
|
353
465
|
/** @ignore */
|
|
354
466
|
get __hostClass() {
|
|
@@ -356,11 +468,11 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
356
468
|
if (this.disabled()) {
|
|
357
469
|
list.push('ax-state-disabled');
|
|
358
470
|
}
|
|
359
|
-
list.push(
|
|
471
|
+
list.push(`${this.color() ?? 'ax-default'}`);
|
|
360
472
|
return list;
|
|
361
473
|
}
|
|
362
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
363
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
474
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
475
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMenuItemComponent, isStandalone: true, selector: "ax-menu-item", inputs: { subItems: { classPropertyName: "subItems", publicName: "subItems", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, host: { listeners: { "click": "handleClick($event)", "mouseenter": "handleMouseEnter($event)", "mouseleave": "handleMouseLeave($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
|
|
364
476
|
{
|
|
365
477
|
provide: AXMenuItemComponentBase,
|
|
366
478
|
useExisting: AXMenuItemComponent,
|
|
@@ -370,9 +482,9 @@ class AXMenuItemComponent extends NXComponent {
|
|
|
370
482
|
provide: AXComponent,
|
|
371
483
|
useExisting: AXMenuItemComponent,
|
|
372
484
|
},
|
|
373
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if (hasSubItems() && (!
|
|
485
|
+
], queries: [{ propertyName: "childMenuItems", predicate: AXMenuItemComponent, isSignal: true }], viewQueries: [{ propertyName: "submenuSlot", first: true, predicate: ["submenuSlot"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if (hasSubItems() && (!isFirstLevel() || root.hasArrow())) {\n <i class=\"ax-icon ax-icon-solid {{ arrowIcon() }} \"></i>\n }\n</div>\n<div\n #submenuSlot\n class=\"ax-menu-items ax-action-list ax-action-list-vertical\"\n [class.ax-state-open]=\"isOpen()\"\n>\n <ng-content select=\"ax-menu-item,ax-title,ax-divider,ng-container,[ngTemplateOutlet]\"></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
374
486
|
}
|
|
375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuItemComponent, decorators: [{
|
|
376
488
|
type: Component,
|
|
377
489
|
args: [{ selector: 'ax-menu-item', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
378
490
|
{
|
|
@@ -384,8 +496,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
384
496
|
provide: AXComponent,
|
|
385
497
|
useExisting: AXMenuItemComponent,
|
|
386
498
|
},
|
|
387
|
-
], template: "<div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if (hasSubItems() && (!
|
|
388
|
-
}], ctorParameters: () => [], propDecorators: { onClick: [{ type: i0.Output, args: ["onClick"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], handleClick: [{
|
|
499
|
+
], template: "<div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"></ng-content>\n @if (hasSubItems() && (!isFirstLevel() || root.hasArrow())) {\n <i class=\"ax-icon ax-icon-solid {{ arrowIcon() }} \"></i>\n }\n</div>\n<div\n #submenuSlot\n class=\"ax-menu-items ax-action-list ax-action-list-vertical\"\n [class.ax-state-open]=\"isOpen()\"\n>\n <ng-content select=\"ax-menu-item,ax-title,ax-divider,ng-container,[ngTemplateOutlet]\"></ng-content>\n</div>\n" }]
|
|
500
|
+
}], ctorParameters: () => [], propDecorators: { childMenuItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AXMenuItemComponent), { ...{ descendants: false }, isSignal: true }] }], submenuSlot: [{ type: i0.ViewChild, args: ['submenuSlot', { isSignal: true }] }], subItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "subItems", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], handleClick: [{
|
|
389
501
|
type: HostListener,
|
|
390
502
|
args: ['click', ['$event']]
|
|
391
503
|
}], handleMouseEnter: [{
|
|
@@ -394,15 +506,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
394
506
|
}], handleMouseLeave: [{
|
|
395
507
|
type: HostListener,
|
|
396
508
|
args: ['mouseleave', ['$event']]
|
|
397
|
-
}], onWindowEvent: [{
|
|
398
|
-
type: HostListener,
|
|
399
|
-
args: ['window:scroll']
|
|
400
|
-
}, {
|
|
401
|
-
type: HostListener,
|
|
402
|
-
args: ['window:resize']
|
|
403
|
-
}], onClickOutside: [{
|
|
404
|
-
type: HostListener,
|
|
405
|
-
args: ['document:click', ['$event']]
|
|
406
509
|
}], __hostClass: [{
|
|
407
510
|
type: HostBinding,
|
|
408
511
|
args: ['class']
|
|
@@ -424,30 +527,38 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
424
527
|
constructor() {
|
|
425
528
|
super();
|
|
426
529
|
// Inputs and Outputs
|
|
427
|
-
this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
428
|
-
this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : []));
|
|
429
|
-
this.closeOn = input('click', ...(ngDevMode ? [{ debugName: "closeOn" }] : []));
|
|
430
|
-
|
|
431
|
-
this.
|
|
530
|
+
this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
531
|
+
this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : /* istanbul ignore next */ []));
|
|
532
|
+
this.closeOn = input('click', ...(ngDevMode ? [{ debugName: "closeOn" }] : /* istanbul ignore next */ []));
|
|
533
|
+
/** When true, closes the menu on router navigation (e.g. side-menu route changes). */
|
|
534
|
+
this.closeOnRouteChange = input(false, ...(ngDevMode ? [{ debugName: "closeOnRouteChange" }] : /* istanbul ignore next */ []));
|
|
535
|
+
this.originalItems = input([], { ...(ngDevMode ? { debugName: "originalItems" } : /* istanbul ignore next */ {}), alias: 'items' });
|
|
536
|
+
this.target = input(...(ngDevMode ? [undefined, { debugName: "target" }] : /* istanbul ignore next */ []));
|
|
432
537
|
this.onItemClick = output();
|
|
433
538
|
this.onOpening = output();
|
|
434
539
|
/** Emitted when the menu closes (backdrop, item click, scroll, another menu opening, etc.). */
|
|
435
540
|
this.onClose = output();
|
|
436
|
-
this.hasArrow = signal(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : []));
|
|
541
|
+
this.hasArrow = signal(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : /* istanbul ignore next */ []));
|
|
437
542
|
// Injected Services
|
|
438
543
|
this.service = inject(AXMenuService);
|
|
439
544
|
this.renderer = inject(Renderer2);
|
|
440
545
|
this.document = inject(DOCUMENT);
|
|
441
546
|
this.platformID = inject(PLATFORM_ID);
|
|
442
547
|
this.zIndexService = inject(AXZIndexService);
|
|
548
|
+
this.injector = inject(Injector);
|
|
443
549
|
this.zToken = null;
|
|
550
|
+
this.lastOpenPoint = null;
|
|
551
|
+
this.router = inject(Router, { optional: true });
|
|
552
|
+
this.destroyRef = inject(DestroyRef);
|
|
444
553
|
this.originalNextSibling = null;
|
|
445
554
|
this.originalParent = null;
|
|
446
|
-
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
555
|
+
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
447
556
|
//
|
|
448
557
|
afterNextRender(() => {
|
|
449
558
|
this.bindContextEvent();
|
|
559
|
+
this.service.initGlobalListeners(this.nativeElement);
|
|
450
560
|
});
|
|
561
|
+
this.setupCloseOnRouteChange();
|
|
451
562
|
this.service.closeAllContextMenu$.subscribe(() => {
|
|
452
563
|
this.service.closeAll$.next();
|
|
453
564
|
this.close();
|
|
@@ -479,7 +590,6 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
479
590
|
showAt(point, targetElement, event) {
|
|
480
591
|
const sender = this;
|
|
481
592
|
this.service.closeAllContextMenu$.next({ sender });
|
|
482
|
-
this.service.openContextMenu$.next({ sender, point });
|
|
483
593
|
if (isPlatformBrowser(this.platformID)) {
|
|
484
594
|
if (!targetElement) {
|
|
485
595
|
targetElement = this.document.elementFromPoint(point.x, point.y);
|
|
@@ -497,6 +607,7 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
497
607
|
this.onOpening.emit(event);
|
|
498
608
|
this.items.set(event.items);
|
|
499
609
|
}
|
|
610
|
+
this.service.openContextMenu$.next({ sender, point });
|
|
500
611
|
}
|
|
501
612
|
/**
|
|
502
613
|
* Closes the context menu and removes the backdrop.
|
|
@@ -504,6 +615,12 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
504
615
|
close() {
|
|
505
616
|
const wasOpen = this.nativeElement.classList.contains('ax-state-open');
|
|
506
617
|
this.nativeElement.classList.remove('ax-state-open');
|
|
618
|
+
this.lastOpenPoint = null;
|
|
619
|
+
// Drop rendered items before moving DOM nodes back to the original parent.
|
|
620
|
+
// This prevents a large menu tree from being re-parented/removed as a single heavy DOM operation.
|
|
621
|
+
if (wasOpen) {
|
|
622
|
+
this.items.set([]);
|
|
623
|
+
}
|
|
507
624
|
this.removeBackdrop();
|
|
508
625
|
// Release z-index token
|
|
509
626
|
this.zIndexService.release(this.zToken);
|
|
@@ -514,6 +631,19 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
514
631
|
}
|
|
515
632
|
// Private Methods (Internal Logic)
|
|
516
633
|
/** @ignore */
|
|
634
|
+
setupCloseOnRouteChange() {
|
|
635
|
+
if (!this.router || !isPlatformBrowser(this.platformID)) {
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
this.router.events
|
|
639
|
+
.pipe(filter((event) => event instanceof NavigationStart), takeUntilDestroyed(this.destroyRef))
|
|
640
|
+
.subscribe(() => {
|
|
641
|
+
if (this.closeOnRouteChange()) {
|
|
642
|
+
this.close();
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
/** @ignore */
|
|
517
647
|
getTargetElements() {
|
|
518
648
|
if (isPlatformBrowser(this.platformID)) {
|
|
519
649
|
const elements = typeof this.target() == 'string'
|
|
@@ -561,12 +691,27 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
561
691
|
}
|
|
562
692
|
/** @ignore */
|
|
563
693
|
internalShowAt(point) {
|
|
694
|
+
this.lastOpenPoint = point;
|
|
564
695
|
const elementRef = this.nativeElement;
|
|
565
696
|
elementRef.classList.add('ax-state-open');
|
|
566
|
-
|
|
697
|
+
this.positionAtPoint(point);
|
|
698
|
+
this.createBackdrop();
|
|
699
|
+
// Items may render after the signal update (e.g. compact side-menu); reposition once laid out.
|
|
700
|
+
afterNextRender(() => {
|
|
701
|
+
if (this.lastOpenPoint && elementRef.classList.contains('ax-state-open')) {
|
|
702
|
+
this.positionAtPoint(this.lastOpenPoint);
|
|
703
|
+
}
|
|
704
|
+
}, { injector: this.injector });
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Positions the menu at `point`, flipping when it would overflow the viewport.
|
|
708
|
+
* Uses a temporary visible layout pass so parents that hide the host (e.g. side-menu `display: none`) do not yield a zero-sized rect.
|
|
709
|
+
*/
|
|
710
|
+
positionAtPoint(point) {
|
|
711
|
+
const elementRef = this.nativeElement;
|
|
712
|
+
const itemRect = this.measureMenuRect(elementRef);
|
|
567
713
|
const windowWidth = window.innerWidth;
|
|
568
714
|
const windowHeight = window.innerHeight;
|
|
569
|
-
// Detect RTL (Right-To-Left) mode
|
|
570
715
|
const isRtl = AXHtmlUtil.isRtl(elementRef);
|
|
571
716
|
let left;
|
|
572
717
|
if (isRtl) {
|
|
@@ -595,7 +740,15 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
595
740
|
this.renderer.setStyle(elementRef, 'left', `${left}px`);
|
|
596
741
|
this.renderer.setStyle(elementRef, 'top', `${top}px`);
|
|
597
742
|
this.renderer.setStyle(elementRef, 'position', 'fixed');
|
|
598
|
-
|
|
743
|
+
}
|
|
744
|
+
/** Measures menu size even when an ancestor hides the host with `display: none`. */
|
|
745
|
+
measureMenuRect(elementRef) {
|
|
746
|
+
this.renderer.setStyle(elementRef, 'visibility', 'hidden');
|
|
747
|
+
this.renderer.setStyle(elementRef, 'display', 'flex');
|
|
748
|
+
const rect = elementRef.getBoundingClientRect();
|
|
749
|
+
this.renderer.removeStyle(elementRef, 'visibility');
|
|
750
|
+
this.renderer.removeStyle(elementRef, 'display');
|
|
751
|
+
return rect;
|
|
599
752
|
}
|
|
600
753
|
/** @ignore */
|
|
601
754
|
createBackdrop() {
|
|
@@ -679,8 +832,8 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
679
832
|
get __hostClass() {
|
|
680
833
|
return ['ax-menu-container', `ax-orientation-${this.orientation()}`, 'ax-action-list', 'ax-action-list-vertical'];
|
|
681
834
|
}
|
|
682
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
683
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
835
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
836
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXContextMenuComponent, isStandalone: true, selector: "ax-context-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, closeOn: { classPropertyName: "closeOn", publicName: "closeOn", isSignal: true, isRequired: false, transformFunction: null }, closeOnRouteChange: { classPropertyName: "closeOnRouteChange", publicName: "closeOnRouteChange", isSignal: true, isRequired: false, transformFunction: null }, originalItems: { classPropertyName: "originalItems", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick", onOpening: "onOpening", onClose: "onClose" }, host: { listeners: { "window:scroll": "onWindowEvent()", "window:resize": "onWindowEvent()" }, properties: { "class": "this.__hostClass" } }, providers: [
|
|
684
837
|
AXMenuService,
|
|
685
838
|
{
|
|
686
839
|
provide: AXRootMenu,
|
|
@@ -690,9 +843,9 @@ class AXContextMenuComponent extends NXComponent {
|
|
|
690
843
|
provide: AXComponent,
|
|
691
844
|
useExisting: AXContextMenuComponent,
|
|
692
845
|
},
|
|
693
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item
|
|
846
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item\n [name]=\"item.name\"\n [data]=\"item.data\"\n [disabled]=\"item.disabled\"\n [color]=\"item.color\"\n [subItems]=\"item.items ?? []\"\n >\n @if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"> </ax-icon>\n </ax-prefix>\n }\n @if (item.text) {\n <ax-text>{{ item.text | translate | async }}</ax-text>\n }\n @if (item.suffix) {\n <ax-suffix>\n <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n </ax-suffix>\n }\n @for (child of item.items; track child) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n }\n </ax-menu-item>\n @if (item.break) {\n <ax-divider></ax-divider>\n }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{display:flex;width:max-content;color:inherit}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{visibility:hidden;position:fixed;display:flex;height:max-content;width:max-content;min-width:calc(var(--spacing, .25rem) * 48);flex-direction:column;border-radius:var(--radius-default, var(--ax-sys-border-radius));border-width:1px;border-style:solid;border-color:var(--color-border-lightest, rgba(var(--ax-sys-color-border-lightest-surface)));background-color:var(--color-lightest, rgba(var(--ax-sys-color-lightest-surface)));color:var(--color-on-lightest, rgba(var(--ax-sys-color-on-lightest-surface)));padding-block:calc(var(--spacing, .25rem) * 2);opacity:0;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{visibility:visible;opacity:1}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){background-color:var(--ax-comp-bg);color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:calc(var(--spacing, .25rem) * 4)}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:calc(var(--spacing, .25rem) * 2)}ax-menu.ax-action-list-horizontal{min-width:calc(var(--spacing, .25rem) * 48);gap:calc(var(--spacing, .25rem) * 5)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item .ax-action-item-suffix:empty){margin-inline-end:0!important;padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu.ax-action-list-vertical{width:max-content;min-width:calc(var(--spacing, .25rem) * 48)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu>ax-menu-item{padding-block:calc(var(--spacing, .25rem) * 2)}ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled){border-radius:var(--radius-default, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled)>ax-text{opacity:.7}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: ["subItems", "name", "data", "disabled", "color"], outputs: ["onClick"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
694
847
|
}
|
|
695
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXContextMenuComponent, decorators: [{
|
|
696
849
|
type: Component,
|
|
697
850
|
args: [{ selector: 'ax-context-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
698
851
|
AXMenuService,
|
|
@@ -711,8 +864,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
711
864
|
AXDecoratorIconComponent,
|
|
712
865
|
AsyncPipe,
|
|
713
866
|
AXTranslatorPipe,
|
|
714
|
-
], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item
|
|
715
|
-
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], openOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOn", required: false }] }], closeOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOn", required: false }] }], originalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], onOpening: [{ type: i0.Output, args: ["onOpening"] }], onClose: [{ type: i0.Output, args: ["onClose"] }], onWindowEvent: [{
|
|
867
|
+
], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item\n [name]=\"item.name\"\n [data]=\"item.data\"\n [disabled]=\"item.disabled\"\n [color]=\"item.color\"\n [subItems]=\"item.items ?? []\"\n >\n @if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"> </ax-icon>\n </ax-prefix>\n }\n @if (item.text) {\n <ax-text>{{ item.text | translate | async }}</ax-text>\n }\n @if (item.suffix) {\n <ax-suffix>\n <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n </ax-suffix>\n }\n @for (child of item.items; track child) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n }\n </ax-menu-item>\n @if (item.break) {\n <ax-divider></ax-divider>\n }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{display:flex;width:max-content;color:inherit}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{visibility:hidden;position:fixed;display:flex;height:max-content;width:max-content;min-width:calc(var(--spacing, .25rem) * 48);flex-direction:column;border-radius:var(--radius-default, var(--ax-sys-border-radius));border-width:1px;border-style:solid;border-color:var(--color-border-lightest, rgba(var(--ax-sys-color-border-lightest-surface)));background-color:var(--color-lightest, rgba(var(--ax-sys-color-lightest-surface)));color:var(--color-on-lightest, rgba(var(--ax-sys-color-on-lightest-surface)));padding-block:calc(var(--spacing, .25rem) * 2);opacity:0;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{visibility:visible;opacity:1}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){background-color:var(--ax-comp-bg);color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:var(--ax-comp-bg)}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:calc(var(--spacing, .25rem) * 4)}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:calc(var(--spacing, .25rem) * 2)}ax-menu.ax-action-list-horizontal{min-width:calc(var(--spacing, .25rem) * 48);gap:calc(var(--spacing, .25rem) * 5)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item .ax-action-item-suffix:empty){margin-inline-end:0!important;padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu.ax-action-list-vertical{width:max-content;min-width:calc(var(--spacing, .25rem) * 48)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu>ax-menu-item{padding-block:calc(var(--spacing, .25rem) * 2)}ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled){border-radius:var(--radius-default, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu ax-menu-item.ax-state-disabled)>ax-text{opacity:.7}\n"] }]
|
|
868
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], openOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOn", required: false }] }], closeOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOn", required: false }] }], closeOnRouteChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnRouteChange", required: false }] }], originalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], onOpening: [{ type: i0.Output, args: ["onOpening"] }], onClose: [{ type: i0.Output, args: ["onClose"] }], onWindowEvent: [{
|
|
716
869
|
type: HostListener,
|
|
717
870
|
args: ['window:scroll']
|
|
718
871
|
}, {
|
|
@@ -729,14 +882,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
729
882
|
*/
|
|
730
883
|
class AXMenuComponent extends NXComponent {
|
|
731
884
|
constructor() {
|
|
732
|
-
super(
|
|
733
|
-
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
734
|
-
this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : []));
|
|
735
|
-
this.closeOn = input('leave', ...(ngDevMode ? [{ debugName: "closeOn" }] : []));
|
|
885
|
+
super();
|
|
886
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
887
|
+
this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : /* istanbul ignore next */ []));
|
|
888
|
+
this.closeOn = input('leave', ...(ngDevMode ? [{ debugName: "closeOn" }] : /* istanbul ignore next */ []));
|
|
736
889
|
this.service = inject(AXMenuService);
|
|
737
890
|
this.onItemClick = output();
|
|
738
|
-
this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
739
|
-
this.hasArrow = input(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : []));
|
|
891
|
+
this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
892
|
+
this.hasArrow = input(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : /* istanbul ignore next */ []));
|
|
893
|
+
afterNextRender(() => {
|
|
894
|
+
this.service.initGlobalListeners(this.nativeElement);
|
|
895
|
+
});
|
|
740
896
|
}
|
|
741
897
|
/** @ignore */
|
|
742
898
|
get __hostClass() {
|
|
@@ -755,8 +911,8 @@ class AXMenuComponent extends NXComponent {
|
|
|
755
911
|
close() {
|
|
756
912
|
this.service.closeAll$.next();
|
|
757
913
|
}
|
|
758
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
759
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
914
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
915
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMenuComponent, isStandalone: true, selector: "ax-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, closeOn: { classPropertyName: "closeOn", publicName: "closeOn", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, hasArrow: { classPropertyName: "hasArrow", publicName: "hasArrow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick" }, host: { properties: { "class": "this.__hostClass" } }, providers: [
|
|
760
916
|
AXMenuService,
|
|
761
917
|
{
|
|
762
918
|
provide: AXRootMenu,
|
|
@@ -766,9 +922,9 @@ class AXMenuComponent extends NXComponent {
|
|
|
766
922
|
provide: AXComponent,
|
|
767
923
|
useExisting: AXMenuComponent,
|
|
768
924
|
},
|
|
769
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item
|
|
925
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item\n [name]=\"item.name\"\n [data]=\"item.data\"\n [disabled]=\"item.disabled\"\n [color]=\"item.color\"\n [subItems]=\"item.items ?? []\"\n >\n @if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"> </ax-icon>\n </ax-prefix>\n }\n @if (item.text) {\n <ax-text>{{ item.text | translate | async }}</ax-text>\n }\n @if (item.suffix) {\n <ax-suffix>\n <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n </ax-suffix>\n }\n @for (child of item.items; track child) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n }\n </ax-menu-item>\n @if (item.break) {\n <ax-divider></ax-divider>\n }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{width:max-content;color:inherit;display:flex}:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items{visibility:hidden;width:max-content;height:max-content;min-width:calc(var(--spacing,.25rem) * 48);border-radius:var(--radius-default,var(--ax-sys-border-radius));border-style:solid;border-width:1px;border-color:var(--color-border-lightest,rgba(var(--ax-sys-color-border-lightest-surface)));background-color:var(--color-lightest,rgba(var(--ax-sys-color-lightest-surface)));color:var(--color-on-lightest,rgba(var(--ax-sys-color-on-lightest-surface)));padding-block:calc(var(--spacing,.25rem) * 2);opacity:0;transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function);flex-direction:column;display:flex;position:fixed;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items).ax-state-open{visibility:visible;opacity:1}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item{color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item:hover:not(.ax-state-disabled){background-color:var(--ax-comp-bg);color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:calc(var(--spacing,.25rem) * 4)}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:calc(var(--spacing,.25rem) * 2)}ax-menu.ax-action-list-horizontal{min-width:calc(var(--spacing,.25rem) * 48);gap:calc(var(--spacing,.25rem) * 5)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){margin-inline-end:0!important;padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled){background-color:#0000!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu.ax-action-list-vertical{width:max-content;min-width:calc(var(--spacing,.25rem) * 48)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled){background-color:#0000!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu>ax-menu-item{padding-block:calc(var(--spacing,.25rem) * 2)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled){border-radius:var(--radius-default,var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled)>ax-text{opacity:.7}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: ["subItems", "name", "data", "disabled", "color"], outputs: ["onClick"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
770
926
|
}
|
|
771
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuComponent, decorators: [{
|
|
772
928
|
type: Component,
|
|
773
929
|
args: [{ selector: 'ax-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
774
930
|
AXMenuService,
|
|
@@ -787,18 +943,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
787
943
|
AXDecoratorIconComponent,
|
|
788
944
|
AsyncPipe,
|
|
789
945
|
AXTranslatorPipe,
|
|
790
|
-
], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item
|
|
791
|
-
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], openOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOn", required: false }] }], closeOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOn", required: false }] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], hasArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasArrow", required: false }] }], __hostClass: [{
|
|
946
|
+
], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item.group?.title) {\n <ax-title>{{ item.group?.title }}</ax-title>\n }\n <ax-menu-item\n [name]=\"item.name\"\n [data]=\"item.data\"\n [disabled]=\"item.disabled\"\n [color]=\"item.color\"\n [subItems]=\"item.items ?? []\"\n >\n @if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"> </ax-icon>\n </ax-prefix>\n }\n @if (item.text) {\n <ax-text>{{ item.text | translate | async }}</ax-text>\n }\n @if (item.suffix) {\n <ax-suffix>\n <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n </ax-suffix>\n }\n @for (child of item.items; track child) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n }\n </ax-menu-item>\n @if (item.break) {\n <ax-divider></ax-divider>\n }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{width:max-content;color:inherit;display:flex}:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items{visibility:hidden;width:max-content;height:max-content;min-width:calc(var(--spacing,.25rem) * 48);border-radius:var(--radius-default,var(--ax-sys-border-radius));border-style:solid;border-width:1px;border-color:var(--color-border-lightest,rgba(var(--ax-sys-color-border-lightest-surface)));background-color:var(--color-lightest,rgba(var(--ax-sys-color-lightest-surface)));color:var(--color-on-lightest,rgba(var(--ax-sys-color-on-lightest-surface)));padding-block:calc(var(--spacing,.25rem) * 2);opacity:0;transition-property:all;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function);flex-direction:column;display:flex;position:fixed;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items).ax-state-open{visibility:visible;opacity:1}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item{color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item:hover:not(.ax-state-disabled){background-color:var(--ax-comp-bg);color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:var(--ax-comp-bg)}:is(:is(ax-context-menu,ax-menu).ax-menu-container,:is(ax-context-menu,ax-menu) .ax-menu-items) ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:calc(var(--spacing,.25rem) * 4)}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:calc(var(--spacing,.25rem) * 2)}ax-menu.ax-action-list-horizontal{min-width:calc(var(--spacing,.25rem) * 48);gap:calc(var(--spacing,.25rem) * 5)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){margin-inline-end:0!important;padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled){background-color:#0000!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu.ax-action-list-vertical{width:max-content;min-width:calc(var(--spacing,.25rem) * 48)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled){background-color:#0000!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item.ax-state-disabled)>.ax-action-item-suffix{opacity:.7}ax-menu>ax-menu-item{padding-block:calc(var(--spacing,.25rem) * 2)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled){border-radius:var(--radius-default,var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item.ax-state-disabled)>ax-text{opacity:.7}\n"] }]
|
|
947
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], openOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOn", required: false }] }], closeOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOn", required: false }] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], hasArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasArrow", required: false }] }], __hostClass: [{
|
|
792
948
|
type: HostBinding,
|
|
793
949
|
args: ['class']
|
|
794
950
|
}] } });
|
|
795
951
|
|
|
796
952
|
class AXMenuModule {
|
|
797
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
798
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.
|
|
799
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.
|
|
953
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
954
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXMenuModule, imports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent], exports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent] }); }
|
|
955
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuModule, imports: [AXMenuComponent, AXContextMenuComponent] }); }
|
|
800
956
|
}
|
|
801
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
957
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMenuModule, decorators: [{
|
|
802
958
|
type: NgModule,
|
|
803
959
|
args: [{
|
|
804
960
|
imports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent],
|
|
@@ -810,5 +966,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
810
966
|
* Generated bundle index. Do not edit.
|
|
811
967
|
*/
|
|
812
968
|
|
|
813
|
-
export { AXContextMenuComponent, AXContextMenuOpeningEvent, AXMenuComponent,
|
|
969
|
+
export { AXContextMenuComponent, AXContextMenuOpeningEvent, AXMenuComponent, AXMenuItemClickBaseEvent, AXMenuItemComponent, AXMenuItemComponentBase, AXMenuModule, AXMenuService, AXRootMenu };
|
|
814
970
|
//# sourceMappingURL=acorex-components-menu.mjs.map
|