@acorex/components 18.10.16 → 18.11.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/common/lib/classes/events.class.mjs +1 -1
- package/esm2022/menu/index.mjs +4 -4
- package/esm2022/menu/lib/context-menu.component.mjs +181 -0
- package/esm2022/menu/lib/menu-item.component.mjs +311 -0
- package/esm2022/menu/lib/menu.component.mjs +24 -30
- package/esm2022/menu/lib/menu.module.mjs +7 -7
- package/esm2022/menu/lib/menu.service.mjs +10 -8
- package/esm2022/menu/lib/menu.types.mjs +22 -0
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +494 -161
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/menu/index.d.ts +3 -3
- package/menu/lib/context-menu.component.d.ts +41 -0
- package/menu/lib/menu-item.component.d.ts +60 -0
- package/menu/lib/menu.component.d.ts +8 -10
- package/menu/lib/menu.module.d.ts +9 -9
- package/menu/lib/menu.service.d.ts +14 -3
- package/menu/lib/menu.types.d.ts +43 -0
- package/package.json +31 -31
- package/esm2022/menu/lib/class/popover.class.mjs +0 -2
- package/esm2022/menu/lib/class/root-menu.class.mjs +0 -8
- package/esm2022/menu/lib/menu-item/menu-item.component.mjs +0 -160
- package/menu/lib/class/popover.class.d.ts +0 -2
- package/menu/lib/class/root-menu.class.d.ts +0 -7
- package/menu/lib/menu-item/menu-item.component.d.ts +0 -81
@@ -76,4 +76,4 @@ export class AXSelectionValueChangedEvent extends AXValueChangedEvent {
|
|
76
76
|
*/
|
77
77
|
export class AXRangeChangedEvent extends AXEvent {
|
78
78
|
}
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmNsYXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2NvbW1vbi9zcmMvbGliL2NsYXNz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b3IgdmFsdWUuXG4gKiBAY2F0ZWdvcnkgRXZlbnRzXG4gKi9cbmV4cG9ydCBjbGFzcyBBWFNlbGVjdGlvblZhbHVlQ2hhbmdlZEV2ZW50IGV4dGVuZHMgQVhWYWx1ZUNoYW5nZWRFdmVudDxhbnkgfCBhbnlbXT4ge1xuICBvdmVycmlkZSB2YWx1ZT86IGFueSA9IG51bGw7XG4gIG92ZXJyaWRlIG9sZFZhbHVlPzogYW55ID0gbnVsbDtcbiAgc2VsZWN0ZWRLZXlzPzogYW55W10gPSBbXTtcbiAgc2VsZWN0ZWRJdGVtcz86IGFueVtdID0gW107XG59XG5cbi8qKlxuICogIENvbnRhaW5zIHJhbmdlIHN0YXJ0ICYgZW5kIHZhbHVlc1xuICogQGNhdGVnb3J5IEV2ZW50c1xuICovXG5leHBvcnQgY2xhc3MgQVhSYW5nZUNoYW5nZWRFdmVudDxUPiBleHRlbmRzIEFYRXZlbnQge1xuICAvKipcbiAgICogIFRoZSByYW5nZSBzdGFydCB2YWx1ZVxuICAgKi9cbiAgc3RhcnQ/OiBUO1xuICAvKipcbiAgICogIFRoZSByYW5nZSBlbmQgdmFsdWVcbiAgICovXG4gIGVuZD86IFQ7XG59XG4iXX0=
|
package/esm2022/menu/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from './lib/
|
2
|
-
export * from './lib/
|
3
|
-
export * from './lib/
|
1
|
+
export * from './lib/menu.types';
|
2
|
+
export * from './lib/menu-item.component';
|
3
|
+
export * from './lib/context-menu.component';
|
4
4
|
export * from './lib/menu.component';
|
5
5
|
export * from './lib/menu.module';
|
6
6
|
export * from './lib/menu.service';
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvbWVudS9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsb0JBQW9CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9tZW51LnR5cGVzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21lbnUtaXRlbS5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29udGV4dC1tZW51LmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tZW51LmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tZW51Lm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tZW51LnNlcnZpY2UnO1xuIl19
|
@@ -0,0 +1,181 @@
|
|
1
|
+
import { MXBaseComponent } from '@acorex/components/common';
|
2
|
+
import { afterNextRender, ChangeDetectionStrategy, Component, HostBinding, HostListener, inject, input, output, Renderer2, signal, ViewEncapsulation, } from '@angular/core';
|
3
|
+
import { AXRootMenu } from './menu.types';
|
4
|
+
import { AXMenuService } from './menu.service';
|
5
|
+
import { AXHtmlUtil } from '@acorex/core/utils';
|
6
|
+
import { cloneDeep } from 'lodash-es';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "@angular/common";
|
9
|
+
import * as i2 from "@acorex/components/decorators";
|
10
|
+
import * as i3 from "./menu-item.component";
|
11
|
+
/**
|
12
|
+
* Represents a menu component that displays context menu.
|
13
|
+
* @category Components
|
14
|
+
*/
|
15
|
+
export class AXContextMenuComponent extends MXBaseComponent {
|
16
|
+
// Constructor (Dependency Injection)
|
17
|
+
/** @ignore */
|
18
|
+
constructor(renderer) {
|
19
|
+
super();
|
20
|
+
this.renderer = renderer;
|
21
|
+
// Inputs and Outputs
|
22
|
+
this.orientation = input('vertical');
|
23
|
+
this.openOn = input('hover');
|
24
|
+
this.closeOn = input('click');
|
25
|
+
this.orginalItems = input([], { alias: "items" });
|
26
|
+
this.target = input();
|
27
|
+
this.onItemClick = output();
|
28
|
+
this.onOpening = output();
|
29
|
+
// Injected Services
|
30
|
+
this.service = inject(AXMenuService);
|
31
|
+
// Private Properties
|
32
|
+
this.scrollableParents = [];
|
33
|
+
this.items = signal([]);
|
34
|
+
afterNextRender(() => {
|
35
|
+
if (this.target()) {
|
36
|
+
this.target().addEventListener('contextmenu', this.handleContextMenu.bind(this));
|
37
|
+
}
|
38
|
+
this.bindScrollEvents();
|
39
|
+
});
|
40
|
+
this.service.closeAllContextMenu$.subscribe(() => {
|
41
|
+
this.service.closeAll$.next();
|
42
|
+
this.close();
|
43
|
+
});
|
44
|
+
this.service.openContextMenu$.subscribe((e) => {
|
45
|
+
if (e.sender == this) {
|
46
|
+
this.internalShowAt(e.point);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
// Lifecycle Hooks
|
51
|
+
ngOnDestroy() {
|
52
|
+
this.removeScrollEvents();
|
53
|
+
}
|
54
|
+
// Public Methods
|
55
|
+
showAt(point) {
|
56
|
+
const sender = this;
|
57
|
+
this.service.closeAllContextMenu$.next({ sender });
|
58
|
+
this.service.openContextMenu$.next({ sender, point });
|
59
|
+
}
|
60
|
+
close() {
|
61
|
+
const elementRef = this.getHostElement();
|
62
|
+
elementRef.classList.remove('ax-state-open');
|
63
|
+
}
|
64
|
+
// Private Methods (Internal Logic)
|
65
|
+
/** @ignore */
|
66
|
+
handleContextMenu(e) {
|
67
|
+
e.preventDefault();
|
68
|
+
e.stopPropagation();
|
69
|
+
//
|
70
|
+
const event = {
|
71
|
+
component: this,
|
72
|
+
htmlElement: this.getHostElement(),
|
73
|
+
nativeEvent: e,
|
74
|
+
canceled: false,
|
75
|
+
items: cloneDeep(this.orginalItems()),
|
76
|
+
};
|
77
|
+
this.onOpening.emit(event);
|
78
|
+
this.items.set(event.items);
|
79
|
+
//
|
80
|
+
if (!event.canceled) {
|
81
|
+
this.showAt({ x: e.clientX, y: e.clientY });
|
82
|
+
}
|
83
|
+
}
|
84
|
+
internalShowAt(point) {
|
85
|
+
const elementRef = this.getHostElement();
|
86
|
+
elementRef.classList.add('ax-state-open');
|
87
|
+
const itemRect = elementRef.getBoundingClientRect();
|
88
|
+
const windowWidth = window.innerWidth;
|
89
|
+
const windowHeight = window.innerHeight;
|
90
|
+
// Detect RTL (Right-To-Left) mode
|
91
|
+
const isRtl = AXHtmlUtil.isRtl(this.getHostElement());
|
92
|
+
let left;
|
93
|
+
if (isRtl) {
|
94
|
+
left = point.x - itemRect.width;
|
95
|
+
if (left < 0) {
|
96
|
+
left = point.x;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
left = point.x;
|
101
|
+
if (left + itemRect.width > windowWidth) {
|
102
|
+
left = point.x - itemRect.width;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
const bottom = point.y + itemRect.height;
|
106
|
+
let top;
|
107
|
+
if (bottom > windowHeight) {
|
108
|
+
top = point.y - itemRect.height;
|
109
|
+
if (top < 0) {
|
110
|
+
top = 0;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
top = point.y;
|
115
|
+
}
|
116
|
+
this.renderer.setStyle(elementRef, 'left', `${left}px`);
|
117
|
+
this.renderer.setStyle(elementRef, 'top', `${top}px`);
|
118
|
+
this.renderer.setStyle(elementRef, 'position', 'fixed');
|
119
|
+
}
|
120
|
+
bindScrollEvents() {
|
121
|
+
this.scrollableParents = AXHtmlUtil.getScrollableParents(this.getHostElement());
|
122
|
+
this.scrollableParents.forEach((parent) => {
|
123
|
+
parent.addEventListener('scroll', this.onContainerScroll.bind(this));
|
124
|
+
});
|
125
|
+
}
|
126
|
+
removeScrollEvents() {
|
127
|
+
this.scrollableParents.forEach((parent) => {
|
128
|
+
parent.removeEventListener('scroll', this.onContainerScroll.bind(this));
|
129
|
+
});
|
130
|
+
}
|
131
|
+
onContainerScroll() {
|
132
|
+
this.service.closeAllContextMenu$.next({ sender: this });
|
133
|
+
}
|
134
|
+
// Host Listeners (UI Interaction Handling)
|
135
|
+
/** @ignore */
|
136
|
+
onClickOutside(event) {
|
137
|
+
const hostElement = this.getHostElement();
|
138
|
+
if (!hostElement.contains(event.target)) {
|
139
|
+
const sender = this;
|
140
|
+
this.service.closeAllContextMenu$.next({ sender });
|
141
|
+
}
|
142
|
+
}
|
143
|
+
onContextMenuOutside(event) {
|
144
|
+
if (!this.target().contains(event.target)) {
|
145
|
+
const sender = this;
|
146
|
+
this.service.closeAllContextMenu$.next({ sender });
|
147
|
+
}
|
148
|
+
}
|
149
|
+
/** @ignore */
|
150
|
+
get __hostClass() {
|
151
|
+
return ['ax-menu-container', `ax-orientation-${this.orientation()}`];
|
152
|
+
}
|
153
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXContextMenuComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
154
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXContextMenuComponent, 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 }, orginalItems: { classPropertyName: "orginalItems", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick", onOpening: "onOpening" }, host: { listeners: { "document:click": "onClickOutside($event)", "document:contextmenu": "onContextMenuOutside($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
|
155
|
+
AXMenuService,
|
156
|
+
{
|
157
|
+
provide: AXRootMenu,
|
158
|
+
useExisting: AXContextMenuComponent
|
159
|
+
}
|
160
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-title,ng-container\"></ng-content>\n\n<ng-container *ngFor=\"let node of items()\" [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n</ng-container>\n<ng-template #Recursion let-item>\n @if(item.group?.title)\n {\n <ax-title>{{item.group?.title}}</ax-title>\n }\n <ax-menu-item [name]=\"item.name\" [data]=\"item.data\" [disabled]=\"item.disabled\" [color]=\"item.color\">\n <ax-prefix>\n @if(item.icon)\n {\n <ax-icon [icon]=\"item.icon\">\n </ax-icon>\n }\n </ax-prefix>\n @if(item.text)\n {\n <ax-text>{{ item.text }}</ax-text>\n }\n @if(item.suffix)\n {\n <ax-suffix>\n <ax-text>{{ item.suffix.text }}</ax-text>\n </ax-suffix>\n }\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n </ax-menu-item>\n @if(item.break)\n {\n <ax-divider></ax-divider>\n }\n</ng-template>", styles: ["ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-orientation-horizontal,ax-menu.ax-orientation-horizontal{flex-direction:row!important}ax-context-menu.ax-orientation-vertical,ax-menu.ax-orientation-vertical{flex-direction:column!important}ax-context-menu ax-title,ax-menu ax-title{display:block;padding-inline:1rem;padding-block:.25rem;font-size:.75rem;line-height:1rem;font-weight:bolder;text-transform:uppercase;opacity:.5}ax-context-menu ax-divider,ax-menu ax-divider{margin-top:.25rem;margin-bottom:.25rem;height:.5px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-context-menu ax-menu-item,ax-menu ax-menu-item{display:flex;align-items:center;font-size:.875rem;line-height:1.25rem;justify-content:space-between;color:rgba(var(--ax-color-text-default));height:2.25rem;cursor:pointer}ax-context-menu ax-menu-item>.ax-menu-item-prefix,ax-menu ax-menu-item>.ax-menu-item-prefix{display:flex;gap:.5rem}ax-context-menu ax-menu-item.ax-state-disabled,ax-menu ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-context-menu ax-menu-item ax-suffix ax-text,ax-menu ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-color-text-default))!important;opacity:.5!important;font-weight:200!important;padding-inline-start:2rem}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{padding-block:.5rem;display:flex;opacity:0;visibility:hidden;transition:opacity .3s;width:max-content;min-width:12rem;height:max-content;position:fixed;flex-direction:column;border-radius:0;border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);border-radius:var(--ax-rounded-border-default);z-index:9999}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{opacity:1;visibility:visible}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{padding-inline:1rem;padding-block:.5rem}ax-context-menu.ax-menu-container ax-menu-item ax-prefix,ax-context-menu .ax-menu-items ax-menu-item ax-prefix,ax-menu.ax-menu-container ax-menu-item ax-prefix,ax-menu .ax-menu-items ax-menu-item ax-prefix{width:1rem}ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}ax-context-menu.ax-orientation-horizontal{padding-inline:1rem}ax-menu.ax-orientation-horizontal{min-width:12rem;gap:.875rem}ax-menu.ax-orientation-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-orientation-vertical{width:max-content;min-width:12rem}ax-menu.ax-orientation-vertical>ax-menu-item{padding-inline:1rem;font-weight:500}ax-menu>ax-menu-item{padding-block:.5rem}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{color:rgba(var(--ax-color-primary-500))}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i3.AXMenuItemComponent, selector: "ax-menu-item", inputs: ["name", "data", "disabled", "color"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
161
|
+
}
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXContextMenuComponent, decorators: [{
|
163
|
+
type: Component,
|
164
|
+
args: [{ selector: 'ax-context-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
165
|
+
AXMenuService,
|
166
|
+
{
|
167
|
+
provide: AXRootMenu,
|
168
|
+
useExisting: AXContextMenuComponent
|
169
|
+
}
|
170
|
+
], template: "<ng-content select=\"ax-menu-item,ax-title,ng-container\"></ng-content>\n\n<ng-container *ngFor=\"let node of items()\" [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: node }\">\n</ng-container>\n<ng-template #Recursion let-item>\n @if(item.group?.title)\n {\n <ax-title>{{item.group?.title}}</ax-title>\n }\n <ax-menu-item [name]=\"item.name\" [data]=\"item.data\" [disabled]=\"item.disabled\" [color]=\"item.color\">\n <ax-prefix>\n @if(item.icon)\n {\n <ax-icon [icon]=\"item.icon\">\n </ax-icon>\n }\n </ax-prefix>\n @if(item.text)\n {\n <ax-text>{{ item.text }}</ax-text>\n }\n @if(item.suffix)\n {\n <ax-suffix>\n <ax-text>{{ item.suffix.text }}</ax-text>\n </ax-suffix>\n }\n <ng-container *ngFor=\"let child of item.children\" [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n </ax-menu-item>\n @if(item.break)\n {\n <ax-divider></ax-divider>\n }\n</ng-template>", styles: ["ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-orientation-horizontal,ax-menu.ax-orientation-horizontal{flex-direction:row!important}ax-context-menu.ax-orientation-vertical,ax-menu.ax-orientation-vertical{flex-direction:column!important}ax-context-menu ax-title,ax-menu ax-title{display:block;padding-inline:1rem;padding-block:.25rem;font-size:.75rem;line-height:1rem;font-weight:bolder;text-transform:uppercase;opacity:.5}ax-context-menu ax-divider,ax-menu ax-divider{margin-top:.25rem;margin-bottom:.25rem;height:.5px;width:100%;background-color:rgba(var(--ax-color-border-default))}ax-context-menu ax-menu-item,ax-menu ax-menu-item{display:flex;align-items:center;font-size:.875rem;line-height:1.25rem;justify-content:space-between;color:rgba(var(--ax-color-text-default));height:2.25rem;cursor:pointer}ax-context-menu ax-menu-item>.ax-menu-item-prefix,ax-menu ax-menu-item>.ax-menu-item-prefix{display:flex;gap:.5rem}ax-context-menu ax-menu-item.ax-state-disabled,ax-menu ax-menu-item.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-context-menu ax-menu-item ax-suffix ax-text,ax-menu ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-color-text-default))!important;opacity:.5!important;font-weight:200!important;padding-inline-start:2rem}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{padding-block:.5rem;display:flex;opacity:0;visibility:hidden;transition:opacity .3s;width:max-content;min-width:12rem;height:max-content;position:fixed;flex-direction:column;border-radius:0;border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);border-radius:var(--ax-rounded-border-default);z-index:9999}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{opacity:1;visibility:visible}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{padding-inline:1rem;padding-block:.5rem}ax-context-menu.ax-menu-container ax-menu-item ax-prefix,ax-context-menu .ax-menu-items ax-menu-item ax-prefix,ax-menu.ax-menu-container ax-menu-item ax-prefix,ax-menu .ax-menu-items ax-menu-item ax-prefix{width:1rem}ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled){background-color:rgba(var(--ax-color-on-surface))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-context-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-context-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-menu.ax-menu-container ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix,ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-prefix,ax-menu .ax-menu-items ax-menu-item:hover:not(ax-context-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-context-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled,ax-menu.ax-menu-container ax-menu-item:hover.ax-state-disabled,ax-menu .ax-menu-items ax-menu-item:hover.ax-state-disabled) ax-suffix{opacity:1}ax-context-menu.ax-orientation-horizontal{padding-inline:1rem}ax-menu.ax-orientation-horizontal{min-width:12rem;gap:.875rem}ax-menu.ax-orientation-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-orientation-vertical{width:max-content;min-width:12rem}ax-menu.ax-orientation-vertical>ax-menu-item{padding-inline:1rem;font-weight:500}ax-menu>ax-menu-item{padding-block:.5rem}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{color:rgba(var(--ax-color-primary-500))}\n"] }]
|
171
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { onClickOutside: [{
|
172
|
+
type: HostListener,
|
173
|
+
args: ['document:click', ['$event']]
|
174
|
+
}], onContextMenuOutside: [{
|
175
|
+
type: HostListener,
|
176
|
+
args: ['document:contextmenu', ['$event']]
|
177
|
+
}], __hostClass: [{
|
178
|
+
type: HostBinding,
|
179
|
+
args: ['class']
|
180
|
+
}] } });
|
181
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC1tZW51LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9tZW51L3NyYy9saWIvY29udGV4dC1tZW51LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9tZW51L3NyYy9saWIvbWVudS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWlCLGVBQWUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzNFLE9BQU8sRUFDSCxlQUFlLEVBQ2YsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxXQUFXLEVBQ1gsWUFBWSxFQUNaLE1BQU0sRUFDTixLQUFLLEVBQ0wsTUFBTSxFQUNOLFNBQVMsRUFDVCxNQUFNLEVBQ04saUJBQWlCLEdBQ3BCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBc0csVUFBVSxFQUFFLE1BQ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