@acorex/components 21.0.2-next.26 → 21.0.2-next.28

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@acorex/components",
3
- "version": "21.0.2-next.26",
3
+ "version": "21.0.2-next.28",
4
4
  "peerDependencies": {
5
- "@acorex/core": "21.0.2-next.26",
6
- "@acorex/cdk": "21.0.2-next.26",
5
+ "@acorex/core": "21.0.2-next.28",
6
+ "@acorex/cdk": "21.0.2-next.28",
7
7
  "polytype": ">=0.17.0",
8
8
  "angular-imask": ">=7.6.1",
9
9
  "gridstack": ">=12.0.0",
@@ -2,6 +2,7 @@ import * as _angular_core from '@angular/core';
2
2
  import { WritableSignal, OutputEmitterRef, OnDestroy } from '@angular/core';
3
3
  import { AXStyleColorType, NXComponent, NXClickEvent, AXOrientation, NXEvent } from '@acorex/cdk/common';
4
4
  import { AXPoint } from '@acorex/core/utils';
5
+ import { UrlTree, IsActiveMatchOptions } from '@angular/router';
5
6
  import { Subject } from 'rxjs';
6
7
 
7
8
  type AXMenuOpenTrigger = 'click' | 'hover';
@@ -16,22 +17,37 @@ declare abstract class AXRootMenu {
16
17
  }
17
18
  declare abstract class AXMenuItemComponentBase {
18
19
  }
19
- declare abstract class AXMenuItem {
20
- color?: AXStyleColorType;
21
- name?: string;
20
+ /** Shared tree item shape for `ax-menu`, `ax-context-menu`, and `ax-side-menu`. */
21
+ interface AXMenuItem {
22
22
  text: string;
23
- data?: any;
23
+ name?: string;
24
24
  icon?: string;
25
+ data?: unknown;
25
26
  disabled?: boolean;
26
27
  items?: AXMenuItem[];
28
+ color?: AXStyleColorType;
27
29
  suffix?: {
28
30
  text: string;
29
31
  };
32
+ /** Side-menu alias for `suffix.text`. */
33
+ suffixText?: string;
30
34
  break?: boolean;
31
35
  group?: {
32
36
  name?: string;
33
37
  title?: string;
34
38
  };
39
+ title?: string;
40
+ routerLink?: string | any[] | UrlTree;
41
+ routerLinkActive?: string | string[];
42
+ routerLinkActiveOptions?: {
43
+ exact: boolean;
44
+ } | IsActiveMatchOptions;
45
+ href?: string;
46
+ target?: '_blank' | '_self' | '_parent' | '_top';
47
+ active?: boolean;
48
+ isLoading?: boolean;
49
+ isCollapsed?: boolean;
50
+ toggleOnClick?: boolean;
35
51
  }
36
52
  declare class AXMenuItemClickBaseEvent<T extends NXComponent = NXComponent> extends NXClickEvent<T> {
37
53
  item: {
@@ -56,6 +72,8 @@ declare class AXContextMenuComponent extends NXComponent {
56
72
  readonly orientation: _angular_core.InputSignal<AXOrientation>;
57
73
  readonly openOn: _angular_core.InputSignal<AXMenuOpenTrigger>;
58
74
  readonly closeOn: _angular_core.InputSignal<AXMenuCloseTrigger>;
75
+ /** When true, closes the menu on router navigation (e.g. side-menu route changes). */
76
+ readonly closeOnRouteChange: _angular_core.InputSignal<boolean>;
59
77
  readonly originalItems: _angular_core.InputSignal<AXMenuItem[]>;
60
78
  readonly target: _angular_core.InputSignal<string | HTMLElement | HTMLElement[]>;
61
79
  onItemClick: _angular_core.OutputEmitterRef<AXContextMenuItemsClickEvent>;
@@ -71,6 +89,8 @@ declare class AXContextMenuComponent extends NXComponent {
71
89
  private injector;
72
90
  private zToken;
73
91
  private lastOpenPoint;
92
+ private router;
93
+ private destroyRef;
74
94
  /** @ignore */
75
95
  constructor();
76
96
  ngOnDestroy(): void;
@@ -94,6 +114,8 @@ declare class AXContextMenuComponent extends NXComponent {
94
114
  private originalParent;
95
115
  protected items: _angular_core.WritableSignal<AXMenuItem[]>;
96
116
  /** @ignore */
117
+ private setupCloseOnRouteChange;
118
+ /** @ignore */
97
119
  private getTargetElements;
98
120
  /** @ignore */
99
121
  private bindContextEvent;
@@ -120,7 +142,7 @@ declare class AXContextMenuComponent extends NXComponent {
120
142
  /** @ignore */
121
143
  get __hostClass(): any;
122
144
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXContextMenuComponent, never>;
123
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXContextMenuComponent, "ax-context-menu", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "openOn": { "alias": "openOn"; "required": false; "isSignal": true; }; "closeOn": { "alias": "closeOn"; "required": false; "isSignal": true; }; "originalItems": { "alias": "items"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, { "onItemClick": "onItemClick"; "onOpening": "onOpening"; "onClose": "onClose"; }, never, ["ax-menu-item,ax-divider,ax-title,ng-container"], true, never>;
145
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXContextMenuComponent, "ax-context-menu", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "openOn": { "alias": "openOn"; "required": false; "isSignal": true; }; "closeOn": { "alias": "closeOn"; "required": false; "isSignal": true; }; "closeOnRouteChange": { "alias": "closeOnRouteChange"; "required": false; "isSignal": true; }; "originalItems": { "alias": "items"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, { "onItemClick": "onItemClick"; "onOpening": "onOpening"; "onClose": "onClose"; }, never, ["ax-menu-item,ax-divider,ax-title,ng-container"], true, never>;
124
146
  }
125
147
 
126
148
  type AXMenuItemClickEvent = AXMenuItemClickBaseEvent<AXMenuItemComponent>;
@@ -140,6 +162,7 @@ declare class AXMenuItemComponent extends NXComponent implements OnDestroy {
140
162
  private scrollableParents;
141
163
  private unsuscriber;
142
164
  private renderer;
165
+ private injector;
143
166
  private zIndexService;
144
167
  private zToken;
145
168
  protected arrowIcon: _angular_core.Signal<string>;
@@ -170,10 +193,18 @@ declare class AXMenuItemComponent extends NXComponent implements OnDestroy {
170
193
  * @returns void - No return value. Triggers submenu closing side-effects.
171
194
  */
172
195
  close(): void;
196
+ /**
197
+ * Positions the submenu after layout so nested levels measure their full height.
198
+ */
199
+ private schedulePositionCalculation;
173
200
  /**
174
201
  * Calculate the position of the submenu to avoid it going out of the viewport.
175
202
  */
176
203
  private calculatePosition;
204
+ /** Measures submenu size using the same flex layout as the rendered menu. */
205
+ private measureSubmenuRect;
206
+ /** Keeps the submenu fully inside the viewport vertically. */
207
+ private clampVerticalPosition;
177
208
  handleClick(e: MouseEvent): void;
178
209
  handleMouseEnter(event: MouseEvent): void;
179
210
  private mouseLeaveTimeout;
@@ -243,5 +274,5 @@ declare class AXMenuModule {
243
274
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXMenuModule>;
244
275
  }
245
276
 
246
- export { AXContextMenuComponent, AXContextMenuOpeningEvent, AXMenuComponent, AXMenuItem, AXMenuItemClickBaseEvent, AXMenuItemComponent, AXMenuItemComponentBase, AXMenuModule, AXMenuService, AXRootMenu };
247
- export type { AXContextMenuItemsClickEvent, AXMenuCloseTrigger, AXMenuItemClickEvent, AXMenuItemsClickEvent, AXMenuOpenTrigger };
277
+ export { AXContextMenuComponent, AXContextMenuOpeningEvent, AXMenuComponent, AXMenuItemClickBaseEvent, AXMenuItemComponent, AXMenuItemComponentBase, AXMenuModule, AXMenuService, AXRootMenu };
278
+ export type { AXContextMenuItemsClickEvent, AXMenuCloseTrigger, AXMenuItem, AXMenuItemClickEvent, AXMenuItemsClickEvent, AXMenuOpenTrigger };
@@ -9,7 +9,7 @@ import * as i3 from '@acorex/components/decorators';
9
9
  import * as i4 from '@acorex/core/translation';
10
10
 
11
11
  type AXPopupContentType = TemplateRef<unknown> | AXComponentType<unknown>;
12
- type AXPopupSizeType = 'sm' | 'md' | 'lg' | 'full' | 'fit';
12
+ type AXPopupSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';
13
13
  interface AXPopupConfig {
14
14
  title?: string;
15
15
  closeButton?: boolean;
@@ -33,7 +33,6 @@ declare class AXSideMenuItemComponent extends MXInteractiveComponent {
33
33
  isLoading: _angular_core.ModelSignal<boolean>;
34
34
  isCollapsed: _angular_core.ModelSignal<boolean>;
35
35
  onClick: _angular_core.OutputEmitterRef<AXSideMenuItemClickEvent>;
36
- tooltipText: _angular_core.InputSignal<string>;
37
36
  readonly toggleOnClick: _angular_core.InputSignal<boolean>;
38
37
  readonly href: _angular_core.InputSignal<string>;
39
38
  readonly routerLink: _angular_core.InputSignal<string | any[] | UrlTree>;
@@ -79,7 +78,7 @@ declare class AXSideMenuItemComponent extends MXInteractiveComponent {
79
78
  private getDirectChildElements;
80
79
  private reparentOrphanedChildren;
81
80
  private scheduleChildRefresh;
82
- private hasRelevantChildMutation;
81
+ private hasRelevantMutation;
83
82
  private nodeListContainsMenuStructuralNode;
84
83
  private getItemLabel;
85
84
  private getItemIcon;
@@ -89,38 +88,18 @@ declare class AXSideMenuItemComponent extends MXInteractiveComponent {
89
88
  private updateHasChild;
90
89
  private updateContentLabel;
91
90
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXSideMenuItemComponent, never>;
92
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXSideMenuItemComponent, "ax-side-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; "tooltipText": { "alias": "tooltipText"; "required": false; "isSignal": true; }; "toggleOnClick": { "alias": "toggleOnClick"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "routerLink": { "alias": "routerLink"; "required": false; "isSignal": true; }; "routerLinkActive": { "alias": "routerLinkActive"; "required": false; "isSignal": true; }; "routerLinkActiveOptions": { "alias": "routerLinkActiveOptions"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, { "text": "textChange"; "active": "activeChange"; "isLoading": "isLoadingChange"; "isCollapsed": "isCollapsedChange"; "onClick": "onClick"; }, ["childItems"], ["ax-title", "ax-side-menu-item, ng-container, [ngTemplateOutlet]", "ax-divider", "ax-prefix", "*", "ax-suffix"], true, never>;
91
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXSideMenuItemComponent, "ax-side-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; "toggleOnClick": { "alias": "toggleOnClick"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "routerLink": { "alias": "routerLink"; "required": false; "isSignal": true; }; "routerLinkActive": { "alias": "routerLinkActive"; "required": false; "isSignal": true; }; "routerLinkActiveOptions": { "alias": "routerLinkActiveOptions"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, { "text": "textChange"; "active": "activeChange"; "isLoading": "isLoadingChange"; "isCollapsed": "isCollapsedChange"; "onClick": "onClick"; }, ["childItems"], ["ax-title", "ax-side-menu-item, ng-container, [ngTemplateOutlet]", "ax-divider", "ax-prefix", "*", "ax-suffix"], true, never>;
93
92
  }
94
93
 
95
94
  type AXSideMenuLook = 'pills' | 'with-line' | 'with-line-color' | 'default';
96
95
  type AXSideMenuLocation = 'start' | 'end';
97
- type AXSideMenuItem = {
98
- title?: string;
99
- routerLink?: string | any[] | UrlTree;
100
- routerLinkActive?: string | string[];
101
- routerLinkActiveOptions?: {
102
- exact: boolean;
103
- } | IsActiveMatchOptions;
104
- href?: string;
105
- target?: '_blank' | '_self' | '_parent' | '_top';
106
- text: string;
107
- active?: boolean;
108
- disabled?: boolean;
109
- isLoading?: boolean;
110
- isCollapsed?: boolean;
111
- icon?: string;
112
- data?: unknown;
113
- suffixText?: string;
114
- toggleOnClick?: boolean;
115
- items?: AXSideMenuItem[];
116
- };
117
96
  /**
118
97
  * @category
119
98
  * A component for displaying a side menu with customizable content.
120
99
  */
121
100
  declare class AXSideMenuComponent extends NXComponent implements AXSideMenuBase {
122
101
  #private;
123
- items: _angular_core.ModelSignal<AXSideMenuItem[]>;
102
+ items: _angular_core.ModelSignal<AXMenuItem[]>;
124
103
  readonly look: _angular_core.InputSignal<AXSideMenuLook>;
125
104
  readonly location: _angular_core.InputSignal<AXSideMenuLocation>;
126
105
  readonly mode: _angular_core.InputSignal<"full" | "compact">;
@@ -191,4 +170,4 @@ declare class AXSideMenuModule {
191
170
  }
192
171
 
193
172
  export { AXOutlineSideMenuDirective, AXSideMenuBase, AXSideMenuComponent, AXSideMenuItemClickEvent, AXSideMenuItemComponent, AXSideMenuModule };
194
- export type { AXSideMenuContextMenuItemData, AXSideMenuItem, AXSideMenuLocation, AXSideMenuLook };
173
+ export type { AXSideMenuContextMenuItemData, AXSideMenuLocation, AXSideMenuLook };