ng-primitives 0.53.0 → 0.55.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/fesm2022/ng-primitives-focus-trap.mjs +4 -2
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +2 -1
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +4 -3
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +4 -5
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +2 -3
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +3 -3
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +1 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +16 -12
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +2 -2
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +2 -2
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +15 -2
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/form-field/form-control/form-control.d.ts +2 -1
- package/input/input/input.d.ts +6 -0
- package/package.json +13 -13
- package/portal/overlay-token.d.ts +3 -3
- package/portal/overlay.d.ts +3 -3
- package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template +1 -1
- package/schematics/ng-generate/templates/tooltip/tooltip.__fileSuffix@dasherize__.ts.template +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/observables/take-until-destroyed.d.ts +10 -0
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.
|
|
5
|
+
"version": "0.55.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -75,10 +75,6 @@
|
|
|
75
75
|
"types": "./autofill/index.d.ts",
|
|
76
76
|
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
77
77
|
},
|
|
78
|
-
"./button": {
|
|
79
|
-
"types": "./button/index.d.ts",
|
|
80
|
-
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
81
|
-
},
|
|
82
78
|
"./avatar": {
|
|
83
79
|
"types": "./avatar/index.d.ts",
|
|
84
80
|
"default": "./fesm2022/ng-primitives-avatar.mjs"
|
|
@@ -87,6 +83,10 @@
|
|
|
87
83
|
"types": "./checkbox/index.d.ts",
|
|
88
84
|
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
89
85
|
},
|
|
86
|
+
"./button": {
|
|
87
|
+
"types": "./button/index.d.ts",
|
|
88
|
+
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
89
|
+
},
|
|
90
90
|
"./combobox": {
|
|
91
91
|
"types": "./combobox/index.d.ts",
|
|
92
92
|
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
@@ -167,14 +167,14 @@
|
|
|
167
167
|
"types": "./radio/index.d.ts",
|
|
168
168
|
"default": "./fesm2022/ng-primitives-radio.mjs"
|
|
169
169
|
},
|
|
170
|
-
"./resize": {
|
|
171
|
-
"types": "./resize/index.d.ts",
|
|
172
|
-
"default": "./fesm2022/ng-primitives-resize.mjs"
|
|
173
|
-
},
|
|
174
170
|
"./roving-focus": {
|
|
175
171
|
"types": "./roving-focus/index.d.ts",
|
|
176
172
|
"default": "./fesm2022/ng-primitives-roving-focus.mjs"
|
|
177
173
|
},
|
|
174
|
+
"./resize": {
|
|
175
|
+
"types": "./resize/index.d.ts",
|
|
176
|
+
"default": "./fesm2022/ng-primitives-resize.mjs"
|
|
177
|
+
},
|
|
178
178
|
"./search": {
|
|
179
179
|
"types": "./search/index.d.ts",
|
|
180
180
|
"default": "./fesm2022/ng-primitives-search.mjs"
|
|
@@ -223,13 +223,13 @@
|
|
|
223
223
|
"types": "./toolbar/index.d.ts",
|
|
224
224
|
"default": "./fesm2022/ng-primitives-toolbar.mjs"
|
|
225
225
|
},
|
|
226
|
-
"./tooltip": {
|
|
227
|
-
"types": "./tooltip/index.d.ts",
|
|
228
|
-
"default": "./fesm2022/ng-primitives-tooltip.mjs"
|
|
229
|
-
},
|
|
230
226
|
"./utils": {
|
|
231
227
|
"types": "./utils/index.d.ts",
|
|
232
228
|
"default": "./fesm2022/ng-primitives-utils.mjs"
|
|
229
|
+
},
|
|
230
|
+
"./tooltip": {
|
|
231
|
+
"types": "./tooltip/index.d.ts",
|
|
232
|
+
"default": "./fesm2022/ng-primitives-tooltip.mjs"
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
"module": "fesm2022/ng-primitives.mjs",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ValueProvider } from '@angular/core';
|
|
1
|
+
import { Signal, ValueProvider } from '@angular/core';
|
|
2
2
|
/**
|
|
3
3
|
* Injects the context for the overlay.
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export declare function injectOverlayContext<T>(): T
|
|
6
|
+
export declare function injectOverlayContext<T>(): Signal<T>;
|
|
7
7
|
/**
|
|
8
8
|
* Provides the context for the overlay.
|
|
9
9
|
* @param value The value to provide as the context.
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
export declare function provideOverlayContext<T>(value: T): ValueProvider;
|
|
12
|
+
export declare function provideOverlayContext<T>(value: Signal<T | undefined> | undefined): ValueProvider;
|
package/portal/overlay.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
|
-
import { Injector, Provider, TemplateRef, Type, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { Injector, Provider, Signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { Middleware, Placement, Strategy } from '@floating-ui/dom';
|
|
4
4
|
import { Subject } from 'rxjs';
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ export interface NgpOverlayConfig<T = unknown> {
|
|
|
16
16
|
/** ViewContainerRef to use for creating the portal */
|
|
17
17
|
viewContainerRef: ViewContainerRef;
|
|
18
18
|
/** Context data to pass to the overlay content */
|
|
19
|
-
context?: T |
|
|
19
|
+
context?: Signal<T | undefined>;
|
|
20
20
|
/** Container element to attach the overlay to (defaults to document.body) */
|
|
21
21
|
container?: HTMLElement | null;
|
|
22
22
|
/** Preferred placement of the overlay relative to the trigger */
|
|
@@ -76,7 +76,7 @@ export declare class NgpOverlay<T = unknown> {
|
|
|
76
76
|
* Determine if the overlay has been positioned
|
|
77
77
|
* @internal
|
|
78
78
|
*/
|
|
79
|
-
readonly isPositioned:
|
|
79
|
+
readonly isPositioned: Signal<boolean>;
|
|
80
80
|
/** Signal tracking the trigger element width */
|
|
81
81
|
readonly triggerWidth: import("@angular/core").WritableSignal<number | null>;
|
|
82
82
|
/** The transform origin for the overlay */
|
package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -5,7 +5,7 @@ import { injectPopoverContext, NgpPopover } from 'ng-primitives/popover';
|
|
|
5
5
|
selector: '<%= prefix %>-popover',
|
|
6
6
|
hostDirectives: [NgpPopover],
|
|
7
7
|
template: `
|
|
8
|
-
{{ content }}
|
|
8
|
+
{{ content() }}
|
|
9
9
|
`,
|
|
10
10
|
styles: `
|
|
11
11
|
/* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
|
package/schematics/ng-generate/templates/tooltip/tooltip.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -5,7 +5,7 @@ import { injectTooltipContext, NgpTooltip } from 'ng-primitives/tooltip';
|
|
|
5
5
|
selector: '<%= prefix %>-tooltip',
|
|
6
6
|
hostDirectives: [NgpTooltip],
|
|
7
7
|
template: `
|
|
8
|
-
{{ content }}
|
|
8
|
+
{{ content() }}
|
|
9
9
|
`,
|
|
10
10
|
styles: `
|
|
11
11
|
/* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
|
package/utils/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { injectDisposables } from './helpers/disposables';
|
|
|
5
5
|
export { uniqueId } from './helpers/unique-id';
|
|
6
6
|
export { onBooleanChange, onChange } from './signals';
|
|
7
7
|
export { injectDimensions } from './ui/dimensions';
|
|
8
|
+
export { safeTakeUntilDestroyed } from './observables/take-until-destroyed';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DestroyRef } from '@angular/core';
|
|
2
|
+
import { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* The built-in `takeUntilDestroyed` operator does not handle the case when the component is destroyed before the source observable emits.
|
|
5
|
+
* This operator ensures that the source observable completes gracefully without throwing an error.
|
|
6
|
+
* https://github.com/angular/angular/issues/54527#issuecomment-2098254508
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function safeTakeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T>;
|