ng-primitives 0.56.0 → 0.57.0

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
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.56.0",
5
+ "version": "0.57.0",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -71,22 +71,22 @@
71
71
  "types": "./accordion/index.d.ts",
72
72
  "default": "./fesm2022/ng-primitives-accordion.mjs"
73
73
  },
74
- "./autofill": {
75
- "types": "./autofill/index.d.ts",
76
- "default": "./fesm2022/ng-primitives-autofill.mjs"
77
- },
78
- "./avatar": {
79
- "types": "./avatar/index.d.ts",
80
- "default": "./fesm2022/ng-primitives-avatar.mjs"
81
- },
82
74
  "./button": {
83
75
  "types": "./button/index.d.ts",
84
76
  "default": "./fesm2022/ng-primitives-button.mjs"
85
77
  },
78
+ "./autofill": {
79
+ "types": "./autofill/index.d.ts",
80
+ "default": "./fesm2022/ng-primitives-autofill.mjs"
81
+ },
86
82
  "./checkbox": {
87
83
  "types": "./checkbox/index.d.ts",
88
84
  "default": "./fesm2022/ng-primitives-checkbox.mjs"
89
85
  },
86
+ "./avatar": {
87
+ "types": "./avatar/index.d.ts",
88
+ "default": "./fesm2022/ng-primitives-avatar.mjs"
89
+ },
90
90
  "./combobox": {
91
91
  "types": "./combobox/index.d.ts",
92
92
  "default": "./fesm2022/ng-primitives-combobox.mjs"
@@ -155,14 +155,14 @@
155
155
  "types": "./popover/index.d.ts",
156
156
  "default": "./fesm2022/ng-primitives-popover.mjs"
157
157
  },
158
- "./progress": {
159
- "types": "./progress/index.d.ts",
160
- "default": "./fesm2022/ng-primitives-progress.mjs"
161
- },
162
158
  "./portal": {
163
159
  "types": "./portal/index.d.ts",
164
160
  "default": "./fesm2022/ng-primitives-portal.mjs"
165
161
  },
162
+ "./progress": {
163
+ "types": "./progress/index.d.ts",
164
+ "default": "./fesm2022/ng-primitives-progress.mjs"
165
+ },
166
166
  "./radio": {
167
167
  "types": "./radio/index.d.ts",
168
168
  "default": "./fesm2022/ng-primitives-radio.mjs"
@@ -1,5 +1,6 @@
1
1
  export { injectOverlayContext as injectPopoverContext } from 'ng-primitives/portal';
2
2
  export { NgpPopoverConfig, providePopoverConfig } from './config/popover-config';
3
+ export { NgpPopoverArrow } from './popover-arrow/popover-arrow';
3
4
  export { NgpPopoverTrigger } from './popover-trigger/popover-trigger';
4
5
  export { injectPopoverTriggerState, providePopoverTriggerState, } from './popover-trigger/popover-trigger-state';
5
6
  export { NgpPopover } from './popover/popover';
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NgpPopoverArrow {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopoverArrow, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopoverArrow, "[ngpPopoverArrow]", ["ngpPopoverArrow"], {}, {}, never, never, true, never>;
6
+ }
package/portal/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { createOverlay, injectOverlay, NgpOverlay, NgpOverlayConfig, NgpOverlayContent, NgpOverlayTemplateContext, } from './overlay';
2
+ export { setupOverlayArrow } from './overlay-arrow';
2
3
  export { injectOverlayContext, provideOverlayContext } from './overlay-token';
3
4
  export { createPortal, NgpComponentPortal, NgpPortal, NgpTemplatePortal } from './portal';
4
5
  export { BlockScrollStrategy, NoopScrollStrategy, ScrollStrategy } from './scroll-strategy';
@@ -0,0 +1 @@
1
+ export declare function setupOverlayArrow(): void;
@@ -93,6 +93,13 @@ export declare class NgpOverlay<T = unknown> {
93
93
  private scrollStrategy;
94
94
  /** An observable that emits when the overlay is closing */
95
95
  readonly closing: Subject<void>;
96
+ /** Store the arrow element */
97
+ private arrowElement;
98
+ /** @internal The position of the arrow */
99
+ readonly arrowPosition: import("@angular/core").WritableSignal<{
100
+ x: number | undefined;
101
+ y: number | undefined;
102
+ }>;
96
103
  /**
97
104
  * Creates a new overlay instance
98
105
  * @param config Initial configuration for the overlay
@@ -154,6 +161,16 @@ export declare class NgpOverlay<T = unknown> {
154
161
  * Get the transform origin for the overlay
155
162
  */
156
163
  private getTransformOrigin;
164
+ /**
165
+ * Register the arrow element for positioning
166
+ * @internal
167
+ */
168
+ registerArrow(arrowElement: HTMLElement | null): void;
169
+ /**
170
+ * Remove the registered arrow element
171
+ * @internal
172
+ */
173
+ unregisterArrow(): void;
157
174
  }
158
175
  /**
159
176
  * Helper function to create an overlay in a single call
@@ -1,11 +1,11 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
- import { OnInit } from '@angular/core';
2
+ import { OnDestroy, OnInit } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "ng-primitives/roving-focus";
5
5
  /**
6
6
  * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.
7
7
  */
8
- export declare class NgpTabButton implements OnInit {
8
+ export declare class NgpTabButton implements OnInit, OnDestroy {
9
9
  /**
10
10
  * Access the tag host name
11
11
  */
@@ -44,6 +44,7 @@ export declare class NgpTabButton implements OnInit {
44
44
  readonly active: import("@angular/core").Signal<boolean>;
45
45
  constructor();
46
46
  ngOnInit(): void;
47
+ ngOnDestroy(): void;
47
48
  /**
48
49
  * Select the tab this trigger controls
49
50
  */
@@ -53,5 +54,5 @@ export declare class NgpTabButton implements OnInit {
53
54
  */
54
55
  protected activateOnFocus(): void;
55
56
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpTabButton, never>;
56
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTabButton, "[ngpTabButton]", ["ngpTabButton"], { "value": { "alias": "ngpTabButtonValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpTabButtonDisabled"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpRovingFocusItem; inputs: {}; outputs: {}; }]>;
57
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTabButton, "[ngpTabButton]", ["ngpTabButton"], { "value": { "alias": "ngpTabButtonValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpTabButtonDisabled"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpRovingFocusItem; inputs: { "ngpRovingFocusItemDisabled": "ngpTabButtonDisabled"; }; outputs: {}; }]>;
57
58
  }
@@ -1,9 +1,9 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
1
+ import { OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.
5
5
  */
6
- export declare class NgpTabPanel implements OnInit, OnDestroy {
6
+ export declare class NgpTabPanel implements OnInit {
7
7
  /**
8
8
  * Access the tabset
9
9
  */
@@ -32,7 +32,6 @@ export declare class NgpTabPanel implements OnInit, OnDestroy {
32
32
  */
33
33
  protected readonly active: import("@angular/core").Signal<boolean>;
34
34
  ngOnInit(): void;
35
- ngOnDestroy(): void;
36
35
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpTabPanel, never>;
37
36
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTabPanel, "[ngpTabPanel]", ["ngpTabPanel"], { "value": { "alias": "ngpTabPanelValue"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
38
37
  }
@@ -1,6 +1,6 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
2
  import { NgpOrientation } from 'ng-primitives/common';
3
- import type { NgpTabPanel } from '../tab-panel/tab-panel';
3
+ import type { NgpTabButton } from '../tab-button/tab-button';
4
4
  import * as i0 from "@angular/core";
5
5
  import * as i1 from "ng-primitives/roving-focus";
6
6
  /**
@@ -40,7 +40,7 @@ export declare class NgpTabset {
40
40
  * Access the tabs within the tabset
41
41
  * @internal
42
42
  */
43
- readonly panels: import("@angular/core").WritableSignal<NgpTabPanel[]>;
43
+ readonly buttons: import("@angular/core").WritableSignal<NgpTabButton[]>;
44
44
  /**
45
45
  * @internal
46
46
  * Get the id of the selected tab
@@ -60,12 +60,12 @@ export declare class NgpTabset {
60
60
  * @internal
61
61
  * Register a tab with the tabset
62
62
  */
63
- registerTab(tab: NgpTabPanel): void;
63
+ registerTab(tab: NgpTabButton): void;
64
64
  /**
65
65
  * @internal
66
66
  * Unregister a tab with the tabset
67
67
  */
68
- unregisterTab(tab: NgpTabPanel): void;
68
+ unregisterTab(tab: NgpTabButton): void;
69
69
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpTabset, never>;
70
70
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTabset, "[ngpTabset]", ["ngpTabset"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "ngpTabsetValue"; "required": false; "isSignal": true; }; "orientation": { "alias": "ngpTabsetOrientation"; "required": false; "isSignal": true; }; "activateOnFocus": { "alias": "ngpTabsetActivateOnFocus"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpTabsetValueChange"; }, never, never, true, [{ directive: typeof i1.NgpRovingFocusGroup; inputs: {}; outputs: {}; }]>;
71
71
  }
@@ -3,3 +3,4 @@ export { NgpTooltipConfig, provideTooltipConfig } from './config/tooltip-config'
3
3
  export { NgpTooltipTrigger } from './tooltip-trigger/tooltip-trigger';
4
4
  export { injectTooltipTriggerState, provideTooltipTriggerState, } from './tooltip-trigger/tooltip-trigger-state';
5
5
  export { NgpTooltip } from './tooltip/tooltip';
6
+ export { NgpTooltipArrow } from './tooltip-arrow/tooltip-arrow';
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NgpTooltipArrow {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpTooltipArrow, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltipArrow, "[ngpTooltipArrow]", ["ngpTooltipArrow"], {}, {}, never, never, true, never>;
6
+ }