@ifsworld/granite-components 16.0.0 → 16.1.0-beta.2

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/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from './lib/menu/divider.directive';
17
17
  export * from './lib/menu/title.directive';
18
18
  export * from './lib/menu/menu-touch-close.component';
19
19
  export * from './lib/menu/menu-touch-title.component';
20
+ export * from './lib/menu/menu-custom-template.directive';
20
21
  export * from './lib/icon/icon.module';
21
22
  export * from './lib/icon/icon.component';
22
23
  export * from './lib/toggle-switch/toggle-switch.module';
@@ -7,6 +7,8 @@ import { ClientInputInterface, ClientOutputInterface } from '../core/client-envi
7
7
  import { GraniteMenuItemComponent } from './menu-item.component';
8
8
  import { ClosedEventType, OpenedEventType, GraniteMenuPanelInterface } from './menu-panel';
9
9
  import { MenuPositionX, MenuPositionY } from './menu-positions';
10
+ import { GraniteMenuCustomTemplateDirective } from './menu-custom-template.directive';
11
+ import { ConnectedPosition } from '@angular/cdk/overlay';
10
12
  import * as i0 from "@angular/core";
11
13
  /** Menu panel animation states */
12
14
  type TransformMenuStates = 'void' | 'enter' | 'enter-from-below' | 'below-with-delay' | 'below' | 'pan' | 'hide' | 'pan-hidden';
@@ -31,6 +33,13 @@ export declare class _MenuBaseComponent implements AfterContentInit, OnDestroy,
31
33
  /** Position of the menu in the Y axis. */
32
34
  get yPosition(): MenuPositionY;
33
35
  set yPosition(value: MenuPositionY);
36
+ /**
37
+ * Custom position configuration for the overlay.
38
+ * When provided, this overrides the default positioning logic based on
39
+ * xPosition and yPosition. Uses Angular CDK ConnectedPosition format.
40
+ * If empty or not provided, falls back to default positioning behavior.
41
+ */
42
+ cdkConnectedOverlayPosition: ConnectedPosition[];
34
43
  /** Optional touch menu panel title */
35
44
  title: string;
36
45
  /**
@@ -61,6 +70,11 @@ export declare class _MenuBaseComponent implements AfterContentInit, OnDestroy,
61
70
  * Event emitted when the menu is opened
62
71
  */
63
72
  readonly opened: EventEmitter<OpenedEventType>;
73
+ /**
74
+ * Reference to the custom template directive if present
75
+ */
76
+ customTemplate: GraniteMenuCustomTemplateDirective;
77
+ preventParentClose: boolean;
64
78
  /**
65
79
  * Used for locating the panel in tests and setting the aria-control attribute
66
80
  * for the menu trigger.
@@ -173,7 +187,7 @@ export declare class _MenuBaseComponent implements AfterContentInit, OnDestroy,
173
187
  * Handle click on the menu by emitting on the `closed` emitter
174
188
  * with a `click` reason
175
189
  */
176
- _handleClick(): void;
190
+ _handleClick(event?: Event): void;
177
191
  /**
178
192
  * Handle click on the close button by emitting on the `closed` emitter
179
193
  * without any particular reason
@@ -200,6 +214,6 @@ export declare class _MenuBaseComponent implements AfterContentInit, OnDestroy,
200
214
  */
201
215
  private _updateDirectDescendants;
202
216
  static ɵfac: i0.ɵɵFactoryDeclaration<_MenuBaseComponent, never>;
203
- static ɵdir: i0.ɵɵDirectiveDeclaration<_MenuBaseComponent, never, never, { "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "title": { "alias": "title"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "openOnHover": { "alias": "openOnHover"; "required": false; }; "scrollStrategy": { "alias": "scrollStrategy"; "required": false; }; "styles": { "alias": "styles"; "required": false; }; "touchStyles": { "alias": "touchStyles"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; }, ["_allItems"], never, true, never>;
217
+ static ɵdir: i0.ɵɵDirectiveDeclaration<_MenuBaseComponent, never, never, { "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "cdkConnectedOverlayPosition": { "alias": "cdkConnectedOverlayPosition"; "required": false; }; "title": { "alias": "title"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "openOnHover": { "alias": "openOnHover"; "required": false; }; "scrollStrategy": { "alias": "scrollStrategy"; "required": false; }; "styles": { "alias": "styles"; "required": false; }; "touchStyles": { "alias": "touchStyles"; "required": false; }; "preventParentClose": { "alias": "preventParentClose"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; }, ["customTemplate", "_allItems"], never, true, never>;
204
218
  }
205
219
  export {};
@@ -0,0 +1,14 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Directive to mark an element as a custom template area within a menu.
5
+ * This allows inserting custom content (dropdowns, inputs, etc.) anywhere
6
+ * within the menu, maintaining the natural DOM order.
7
+ */
8
+ export declare class GraniteMenuCustomTemplateDirective {
9
+ private _elementRef;
10
+ constructor(_elementRef: ElementRef<HTMLElement>);
11
+ _handleEvent(event: Event): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteMenuCustomTemplateDirective, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteMenuCustomTemplateDirective, "[graniteMenuCustomTemplate]", ["graniteMenuCustomTemplate"], {}, {}, never, never, false, never>;
14
+ }
@@ -12,13 +12,13 @@
12
12
  export declare function throwGraniteMenuMissingError(): void;
13
13
  /**
14
14
  * Throws an exception for the case when menu's x-position value isn't valid.
15
- * In other words, it doesn't match 'before' or 'after'.
15
+ * In other words, it doesn't match 'before', 'after', or 'center'.
16
16
  * @docs-private
17
17
  */
18
18
  export declare function throwGraniteMenuInvalidPositionX(): void;
19
19
  /**
20
20
  * Throws an exception for the case when menu's y-position value isn't valid.
21
- * In other words, it doesn't match 'above' or 'below'.
21
+ * In other words, it doesn't match 'above', 'below', or 'center'.
22
22
  * @docs-private
23
23
  */
24
24
  export declare function throwGraniteMenuInvalidPositionY(): void;
@@ -5,5 +5,5 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- export type MenuPositionX = 'before' | 'after';
9
- export type MenuPositionY = 'above' | 'below';
8
+ export type MenuPositionX = 'before' | 'after' | 'center';
9
+ export type MenuPositionY = 'above' | 'below' | 'center';
@@ -6,12 +6,13 @@ import * as i4 from "./menu-touch-close.component";
6
6
  import * as i5 from "./menu-touch-title.component";
7
7
  import * as i6 from "./divider.directive";
8
8
  import * as i7 from "./title.directive";
9
- import * as i8 from "@angular/common";
10
- import * as i9 from "@angular/cdk/overlay";
11
- import * as i10 from "@angular/cdk/portal";
12
- import * as i11 from "../icon/icon.module";
9
+ import * as i8 from "./menu-custom-template.directive";
10
+ import * as i9 from "@angular/common";
11
+ import * as i10 from "@angular/cdk/overlay";
12
+ import * as i11 from "@angular/cdk/portal";
13
+ import * as i12 from "../icon/icon.module";
13
14
  export declare class GraniteMenuModule {
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<GraniteMenuModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteMenuModule, [typeof i1.GraniteMenuComponent, typeof i2.GraniteMenuItemComponent, typeof i3.GraniteMenuTriggerForDirective, typeof i4.GraniteMenuTouchCloseComponent, typeof i5.GraniteMenuTouchTitleItemComponent, typeof i6.GraniteDividerDirective, typeof i7.GraniteTitleDirective], [typeof i8.CommonModule, typeof i9.OverlayModule, typeof i10.PortalModule, typeof i11.GraniteIconModule], [typeof i1.GraniteMenuComponent, typeof i2.GraniteMenuItemComponent, typeof i3.GraniteMenuTriggerForDirective, typeof i4.GraniteMenuTouchCloseComponent, typeof i5.GraniteMenuTouchTitleItemComponent, typeof i6.GraniteDividerDirective, typeof i7.GraniteTitleDirective]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteMenuModule, [typeof i1.GraniteMenuComponent, typeof i2.GraniteMenuItemComponent, typeof i3.GraniteMenuTriggerForDirective, typeof i4.GraniteMenuTouchCloseComponent, typeof i5.GraniteMenuTouchTitleItemComponent, typeof i6.GraniteDividerDirective, typeof i7.GraniteTitleDirective, typeof i8.GraniteMenuCustomTemplateDirective], [typeof i9.CommonModule, typeof i10.OverlayModule, typeof i11.PortalModule, typeof i12.GraniteIconModule], [typeof i1.GraniteMenuComponent, typeof i2.GraniteMenuItemComponent, typeof i3.GraniteMenuTriggerForDirective, typeof i4.GraniteMenuTouchCloseComponent, typeof i5.GraniteMenuTouchTitleItemComponent, typeof i6.GraniteDividerDirective, typeof i7.GraniteTitleDirective, typeof i8.GraniteMenuCustomTemplateDirective]>;
16
17
  static ɵinj: i0.ɵɵInjectorDeclaration<GraniteMenuModule>;
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifsworld/granite-components",
3
- "version": "16.0.0",
3
+ "version": "16.1.0-beta.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": ">=19.2.3",