@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
@@ -1,160 +0,0 @@
|
|
1
|
-
import { MXInteractiveComponent } from '@acorex/components/common';
|
2
|
-
import { AXPopoverComponent } from '@acorex/components/popover';
|
3
|
-
import { Component, ContentChildren, HostBinding, HostListener, QueryList, ViewChild, ViewEncapsulation, afterNextRender, inject, input, output, signal, } from '@angular/core';
|
4
|
-
import { AXRootMenu } from '../class/root-menu.class';
|
5
|
-
import { AXMenuService } from '../menu.service';
|
6
|
-
import * as i0 from "@angular/core";
|
7
|
-
import * as i1 from "@acorex/components/popover";
|
8
|
-
/**
|
9
|
-
* Represents a menu item component used within an `ax-menu`.
|
10
|
-
* @category Components
|
11
|
-
*/
|
12
|
-
export class AXMenuItemComponent extends MXInteractiveComponent {
|
13
|
-
/** @ignore */
|
14
|
-
constructor() {
|
15
|
-
super();
|
16
|
-
this.service = inject(AXMenuService);
|
17
|
-
/**
|
18
|
-
* Injects the `AXMenuService` for managing menu interactions.
|
19
|
-
*/
|
20
|
-
this.menuService = inject(AXMenuService);
|
21
|
-
/**
|
22
|
-
* The vertical offset for positioning, initialized to 0.
|
23
|
-
*/
|
24
|
-
this.offsetY = signal(0);
|
25
|
-
/**
|
26
|
-
* The horizontal offset for positioning, initialized to 0.
|
27
|
-
*/
|
28
|
-
this.offsetX = signal(0);
|
29
|
-
/**
|
30
|
-
* The text content, initialized to an empty string.
|
31
|
-
*/
|
32
|
-
// text = input<string>();
|
33
|
-
/**
|
34
|
-
* Indicates whether the item is active.
|
35
|
-
*/
|
36
|
-
this.active = input();
|
37
|
-
/**
|
38
|
-
* Emitted when the active state changes.
|
39
|
-
*/
|
40
|
-
this.activeChange = output();
|
41
|
-
/**
|
42
|
-
* Emitted when the element is clicked.
|
43
|
-
*/
|
44
|
-
this.onClick = output();
|
45
|
-
/**
|
46
|
-
* Indicates whether the component is a root menu item.
|
47
|
-
* @defaultValue false
|
48
|
-
*/
|
49
|
-
this.isRoot = false;
|
50
|
-
/**
|
51
|
-
* Injects the root menu service.
|
52
|
-
*/
|
53
|
-
this.rootMenu = inject(AXRootMenu);
|
54
|
-
this.arrowState = input(true);
|
55
|
-
afterNextRender(() => {
|
56
|
-
this.children.forEach((c) => {
|
57
|
-
c.parent = this;
|
58
|
-
});
|
59
|
-
this.offsetY.set(this.isRoot ? 8 : 0);
|
60
|
-
this.offsetX.set(this.isRoot ? 0 : 4);
|
61
|
-
this.getPlacement();
|
62
|
-
});
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Closes the popover if it is open.
|
66
|
-
*/
|
67
|
-
close() {
|
68
|
-
this.popover?.close();
|
69
|
-
}
|
70
|
-
/** @ignore */
|
71
|
-
_handleOnOpened() {
|
72
|
-
this.parent.children.forEach((c) => {
|
73
|
-
if (c != this) {
|
74
|
-
c.close();
|
75
|
-
}
|
76
|
-
});
|
77
|
-
if (this.children.length) {
|
78
|
-
this.menuService.activeMenus$.next(this.menuService.activeMenus$.getValue().concat(this));
|
79
|
-
}
|
80
|
-
}
|
81
|
-
/** @ignore */
|
82
|
-
_handleOnClosed() {
|
83
|
-
this.children.forEach((c) => {
|
84
|
-
c.close();
|
85
|
-
});
|
86
|
-
}
|
87
|
-
/**
|
88
|
-
* Returns the icon based on the orientation of the root menu.
|
89
|
-
*/
|
90
|
-
getIcon() {
|
91
|
-
if (this.rootMenu.orientation() === 'vertical') {
|
92
|
-
return 'ax-icon-chevron-right';
|
93
|
-
}
|
94
|
-
else {
|
95
|
-
return 'ax-icon-chevron-down';
|
96
|
-
}
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* Determines the placement based on the root menu's orientation: 'bottom-start' for horizontal root, 'end-top' otherwise.
|
100
|
-
*/
|
101
|
-
getPlacement() {
|
102
|
-
switch (this.rootMenu.orientation()) {
|
103
|
-
case 'horizontal':
|
104
|
-
if (this.isRoot) {
|
105
|
-
return 'bottom-start';
|
106
|
-
}
|
107
|
-
else {
|
108
|
-
return 'end-top';
|
109
|
-
}
|
110
|
-
break;
|
111
|
-
case 'vertical':
|
112
|
-
if (this.isRoot) {
|
113
|
-
return 'end-top';
|
114
|
-
}
|
115
|
-
else {
|
116
|
-
return 'end-top';
|
117
|
-
}
|
118
|
-
break;
|
119
|
-
default:
|
120
|
-
return 'bottom-start';
|
121
|
-
}
|
122
|
-
}
|
123
|
-
/** @ignore */
|
124
|
-
get __hostClass() {
|
125
|
-
return [`${this.disabled ? 'ax-state-disabled' : ''}`, `${this.active() ? 'ax-state-active' : ''}`];
|
126
|
-
}
|
127
|
-
/** @ignore */
|
128
|
-
__hostClick(e) {
|
129
|
-
if (!this.disabled) {
|
130
|
-
this.onClick.emit({
|
131
|
-
component: this,
|
132
|
-
htmlElement: this.getHostElement(),
|
133
|
-
nativeEvent: e,
|
134
|
-
});
|
135
|
-
if (!this.children.length) {
|
136
|
-
this.menuService.activeMenus$.subscribe((c) => c.forEach((x) => x.close())).unsubscribe();
|
137
|
-
this.menuService.activeMenus$.next([]);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}
|
141
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
142
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, arrowState: { classPropertyName: "arrowState", publicName: "arrowState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeChange: "activeChange", onClick: "onClick" }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "click": "__hostClick($event)" }, properties: { "class": "this.__hostClass" } }, queries: [{ propertyName: "children", predicate: AXMenuItemComponent }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n <ng-content></ng-content>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length && arrowState()) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "component", type: i1.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
143
|
-
}
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMenuItemComponent, decorators: [{
|
145
|
-
type: Component,
|
146
|
-
args: [{ selector: 'ax-menu-item', inputs: ['disabled'], host: { ngSkipHydration: 'true' }, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-menu-item-start-side\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-text\"></ng-content>\n <ng-content></ng-content>\n</div>\n<ng-content select=\"ax-suffix\"></ng-content>\n@if (children.length && arrowState()) {\n <i class=\"ax-icon ax-icon-solid {{ getIcon() }} ax-menu-item-child-icon\"></i>\n}\n\n<ax-popover\n #popover\n [closeOn]=\"'clickOut'\"\n [openOn]=\"rootMenu.openOn()\"\n [target]=\"getHostElement()\"\n [offsetY]=\"offsetY()\"\n [offsetX]=\"offsetX()\"\n [placement]=\"getPlacement()\"\n (onOpened)=\"_handleOnOpened()\"\n (onClosed)=\"_handleOnClosed()\"\n>\n <div class=\"ax-menu-item-children ax-parent-{{ this.rootMenu.orientation() }}\">\n <ng-content select=\"ax-menu-item\"></ng-content>\n </div>\n</ax-popover>\n" }]
|
147
|
-
}], ctorParameters: () => [], propDecorators: { popover: [{
|
148
|
-
type: ViewChild,
|
149
|
-
args: [AXPopoverComponent]
|
150
|
-
}], children: [{
|
151
|
-
type: ContentChildren,
|
152
|
-
args: [AXMenuItemComponent]
|
153
|
-
}], __hostClass: [{
|
154
|
-
type: HostBinding,
|
155
|
-
args: ['class']
|
156
|
-
}], __hostClick: [{
|
157
|
-
type: HostListener,
|
158
|
-
args: ['click', ['$event']]
|
159
|
-
}] } });
|
160
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1pdGVtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9tZW51L3NyYy9saWIvbWVudS1pdGVtL21lbnUtaXRlbS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvbWVudS9zcmMvbGliL21lbnUtaXRlbS9tZW51LWl0ZW0uY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFnQixzQkFBc0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ2pGLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFDTCxTQUFTLEVBQ1QsZUFBZSxFQUNmLFdBQVcsRUFDWCxZQUFZLEVBQ1osU0FBUyxFQUNULFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsZUFBZSxFQUNmLE1BQU0sRUFDTixLQUFLLEVBQ0wsTUFBTSxFQUNOLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDdEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDOzs7QUFFaEQ7OztHQUdHO0FBUUgsTUFBTSxPQUFPLG1CQUFvQixTQUFRLHNCQUFzQjtJQWdFN0QsY0FBYztJQUNkO1FBQ0UsS0FBSyxFQUFFLENBQUM7UU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mZzZXRYXT1cIm9mZnNldFgoKVwiXG4gIFtwbGFjZW1lbnRdPVwiZ2V0UGxhY2VtZW50KClcIlxuICAob25PcGVuZWQpPVwiX2hhbmRsZU9uT3BlbmVkKClcIlxuICAob25DbG9zZWQpPVwiX2hhbmRsZU9uQ2xvc2VkKClcIlxuPlxuICA8ZGl2IGNsYXNzPVwiYXgtbWVudS1pdGVtLWNoaWxkcmVuIGF4LXBhcmVudC17eyB0aGlzLnJvb3RNZW51Lm9yaWVudGF0aW9uKCkgfX1cIj5cbiAgICA8bmctY29udGVudCBzZWxlY3Q9XCJheC1tZW51LWl0ZW1cIj48L25nLWNvbnRlbnQ+XG4gIDwvZGl2PlxuPC9heC1wb3BvdmVyPlxuIl19
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { AXOrientation } from '@acorex/components/common';
|
2
|
-
import { WritableSignal } from '@angular/core';
|
3
|
-
import { AXMenuPopoverTrigger } from './popover.class';
|
4
|
-
export declare class AXRootMenu {
|
5
|
-
orientation: WritableSignal<AXOrientation>;
|
6
|
-
openOn: WritableSignal<AXMenuPopoverTrigger>;
|
7
|
-
}
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import { AXClickEvent, MXInteractiveComponent } from '@acorex/components/common';
|
2
|
-
import { QueryList } from '@angular/core';
|
3
|
-
import { AXRootMenu } from '../class/root-menu.class';
|
4
|
-
import { AXMenuService } from '../menu.service';
|
5
|
-
import * as i0 from "@angular/core";
|
6
|
-
/**
|
7
|
-
* Represents a menu item component used within an `ax-menu`.
|
8
|
-
* @category Components
|
9
|
-
*/
|
10
|
-
export declare class AXMenuItemComponent extends MXInteractiveComponent {
|
11
|
-
service: AXMenuService;
|
12
|
-
/** @ignore */
|
13
|
-
private popover;
|
14
|
-
/**
|
15
|
-
* Injects the `AXMenuService` for managing menu interactions.
|
16
|
-
*/
|
17
|
-
menuService: AXMenuService;
|
18
|
-
/**
|
19
|
-
* The vertical offset for positioning, initialized to 0.
|
20
|
-
*/
|
21
|
-
offsetY: import("@angular/core").WritableSignal<number>;
|
22
|
-
/**
|
23
|
-
* The horizontal offset for positioning, initialized to 0.
|
24
|
-
*/
|
25
|
-
offsetX: import("@angular/core").WritableSignal<number>;
|
26
|
-
/**
|
27
|
-
* The text content, initialized to an empty string.
|
28
|
-
*/
|
29
|
-
/**
|
30
|
-
* Indicates whether the item is active.
|
31
|
-
*/
|
32
|
-
active: import("@angular/core").InputSignal<boolean>;
|
33
|
-
/**
|
34
|
-
* Emitted when the active state changes.
|
35
|
-
*/
|
36
|
-
activeChange: import("@angular/core").OutputEmitterRef<boolean>;
|
37
|
-
/**
|
38
|
-
* Emitted when the element is clicked.
|
39
|
-
*/
|
40
|
-
onClick: import("@angular/core").OutputEmitterRef<AXClickEvent>;
|
41
|
-
/**
|
42
|
-
* Indicates whether the component is a root menu item.
|
43
|
-
* @defaultValue false
|
44
|
-
*/
|
45
|
-
isRoot: boolean;
|
46
|
-
/**
|
47
|
-
* The parent menu item component, if any.
|
48
|
-
*/
|
49
|
-
parent?: AXMenuItemComponent;
|
50
|
-
/**
|
51
|
-
* Injects the root menu service.
|
52
|
-
*/
|
53
|
-
rootMenu: AXRootMenu;
|
54
|
-
/** @ignore */
|
55
|
-
children: QueryList<AXMenuItemComponent>;
|
56
|
-
arrowState: import("@angular/core").InputSignal<boolean>;
|
57
|
-
/** @ignore */
|
58
|
-
constructor();
|
59
|
-
/**
|
60
|
-
* Closes the popover if it is open.
|
61
|
-
*/
|
62
|
-
close(): void;
|
63
|
-
/** @ignore */
|
64
|
-
_handleOnOpened(): void;
|
65
|
-
/** @ignore */
|
66
|
-
_handleOnClosed(): void;
|
67
|
-
/**
|
68
|
-
* Returns the icon based on the orientation of the root menu.
|
69
|
-
*/
|
70
|
-
getIcon(): "ax-icon-chevron-right" | "ax-icon-chevron-down";
|
71
|
-
/**
|
72
|
-
* Determines the placement based on the root menu's orientation: 'bottom-start' for horizontal root, 'end-top' otherwise.
|
73
|
-
*/
|
74
|
-
getPlacement(): "bottom-start" | "end-top";
|
75
|
-
/** @ignore */
|
76
|
-
get __hostClass(): string[];
|
77
|
-
/** @ignore */
|
78
|
-
private __hostClick;
|
79
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMenuItemComponent, never>;
|
80
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXMenuItemComponent, "ax-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "arrowState": { "alias": "arrowState"; "required": false; "isSignal": true; }; }, { "activeChange": "activeChange"; "onClick": "onClick"; }, ["children"], ["ax-prefix", "ax-text", "*", "ax-suffix", "ax-menu-item"], false, never>;
|
81
|
-
}
|