ng-primitives 0.45.1 → 0.47.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/combobox/combobox-dropdown/combobox-dropdown.d.ts +1 -2
- package/example-theme/index.css +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +4 -6
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +6 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +10 -8
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +53 -41
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +39 -42
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +5 -6
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +17 -10
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +5 -3
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +3 -6
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +38 -3
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/file-upload/file-upload/file-upload-state.d.ts +1 -0
- package/file-upload/file-upload/file-upload.d.ts +4 -0
- package/internal/exit-animation/exit-animation.d.ts +14 -5
- package/internal/index.d.ts +1 -1
- package/menu/menu/menu.d.ts +5 -7
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +1 -23
- package/menu/submenu-trigger/submenu-trigger.d.ts +2 -4
- package/package.json +16 -16
- package/popover/popover/popover.d.ts +1 -2
- package/portal/portal.d.ts +2 -0
- package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +5 -4
- package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template +1 -0
- package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +3 -3
- package/switch/switch/switch-state.d.ts +1 -1
- package/switch/switch/switch.d.ts +1 -1
- package/switch/switch-thumb/switch-thumb.d.ts +1 -1
- package/tooltip/tooltip/tooltip.d.ts +1 -2
- package/utils/forms/status.d.ts +16 -0
- package/utils/index.d.ts +1 -0
|
@@ -3,15 +3,24 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class NgpExitAnimation implements OnDestroy {
|
|
4
4
|
/** The animation manager. */
|
|
5
5
|
private readonly animationManager;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
6
|
+
/** Access the element reference. */
|
|
7
|
+
protected readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
8
|
+
/** Exist animation reference. */
|
|
9
|
+
protected readonly ref: NgpExitAnimationRef;
|
|
10
10
|
constructor();
|
|
11
11
|
ngOnDestroy(): void;
|
|
12
12
|
/** Mark the element as exiting. */
|
|
13
13
|
exit(): Promise<void>;
|
|
14
|
-
private setAnimationState;
|
|
15
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpExitAnimation, never>;
|
|
16
15
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpExitAnimation, "[ngpExitAnimation]", ["ngpExitAnimation"], {}, {}, never, never, true, never>;
|
|
17
16
|
}
|
|
17
|
+
interface NgpExitAnimationOptions {
|
|
18
|
+
/** The element to animate. */
|
|
19
|
+
element: HTMLElement;
|
|
20
|
+
}
|
|
21
|
+
export interface NgpExitAnimationRef {
|
|
22
|
+
/** Mark the element as exiting and wait for the animation to finish. */
|
|
23
|
+
exit: () => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef;
|
|
26
|
+
export {};
|
package/internal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NgpExitAnimation } from './exit-animation/exit-animation';
|
|
1
|
+
export { NgpExitAnimation, NgpExitAnimationRef, setupExitAnimation, } from './exit-animation/exit-animation';
|
|
2
2
|
export { injectExitAnimationManager, NgpExitAnimationManager, provideExitAnimationManager, } from './exit-animation/exit-animation-manager';
|
|
3
3
|
export * from './interactions/index';
|
|
4
4
|
export * from './signals/explicit-effect';
|
package/menu/menu/menu.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "ng-primitives/
|
|
5
|
-
import * as i2 from "ng-primitives/
|
|
4
|
+
import * as i1 from "ng-primitives/roving-focus";
|
|
5
|
+
import * as i2 from "ng-primitives/focus-trap";
|
|
6
6
|
/**
|
|
7
7
|
* The `NgpMenu` is a container for menu items.
|
|
8
8
|
*/
|
|
9
9
|
export declare class NgpMenu {
|
|
10
|
-
/**
|
|
11
|
-
* Access the overlay.
|
|
12
|
-
*/
|
|
10
|
+
/** Access the overlay. */
|
|
13
11
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
14
12
|
/** Access the menu trigger state */
|
|
15
13
|
private readonly menuTrigger;
|
|
@@ -17,8 +15,8 @@ export declare class NgpMenu {
|
|
|
17
15
|
private readonly parentMenu;
|
|
18
16
|
/** @internal Whether we should close submenus */
|
|
19
17
|
readonly closeSubmenus: Subject<HTMLElement>;
|
|
20
|
-
/** Close the menu and any parent menus */
|
|
18
|
+
/** @internal Close the menu and any parent menus */
|
|
21
19
|
closeAllMenus(origin: FocusOrigin): void;
|
|
22
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpMenu, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenu, "[ngpMenu]", ["ngpMenu"], {}, {}, never, never, true, [{ directive: typeof i1.
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenu, "[ngpMenu]", ["ngpMenu"], {}, {}, never, never, true, [{ directive: typeof i1.NgpRovingFocusGroup; inputs: {}; outputs: {}; }, { directive: typeof i2.NgpFocusTrap; inputs: {}; outputs: {}; }]>;
|
|
24
22
|
}
|
|
@@ -14,28 +14,6 @@ export declare const injectSubmenuTriggerState: <U = {
|
|
|
14
14
|
readonly trigger: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
15
|
readonly injector: import("@angular/core").Injector;
|
|
16
16
|
readonly viewContainerRef: import("@angular/core").ViewContainerRef;
|
|
17
|
-
readonly menuTrigger: import("@angular/core").Signal<import("ng-primitives/state").State<{
|
|
18
|
-
readonly trigger: /*elided*/ any;
|
|
19
|
-
readonly injector: /*elided*/ any;
|
|
20
|
-
readonly viewContainerRef: /*elided*/ any;
|
|
21
|
-
readonly config: /*elided*/ any;
|
|
22
|
-
readonly menu: /*elided*/ any;
|
|
23
|
-
readonly disabled: /*elided*/ any;
|
|
24
|
-
readonly placement: /*elided*/ any;
|
|
25
|
-
readonly offset: /*elided*/ any;
|
|
26
|
-
readonly flip: /*elided*/ any;
|
|
27
|
-
readonly container: /*elided*/ any;
|
|
28
|
-
readonly scrollBehavior: /*elided*/ any;
|
|
29
|
-
readonly context: /*elided*/ any;
|
|
30
|
-
readonly overlay: /*elided*/ any;
|
|
31
|
-
readonly open: /*elided*/ any;
|
|
32
|
-
readonly state: /*elided*/ any;
|
|
33
|
-
ngOnDestroy: /*elided*/ any;
|
|
34
|
-
toggle: /*elided*/ any;
|
|
35
|
-
show: /*elided*/ any;
|
|
36
|
-
hide: /*elided*/ any;
|
|
37
|
-
createOverlay: /*elided*/ any;
|
|
38
|
-
}>>;
|
|
39
17
|
readonly parentMenu: import("ng-primitives/menu").NgpMenu | null;
|
|
40
18
|
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
41
19
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
@@ -50,7 +28,7 @@ export declare const injectSubmenuTriggerState: <U = {
|
|
|
50
28
|
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
51
29
|
createOverlay: () => void;
|
|
52
30
|
showSubmenuOnArrow: (event: KeyboardEvent) => void;
|
|
53
|
-
showSubmenuOnHover: () => void;
|
|
31
|
+
showSubmenuOnHover: (event: PointerEvent) => void;
|
|
54
32
|
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
55
33
|
/**
|
|
56
34
|
* The SubmenuTrigger state registration function.
|
|
@@ -16,8 +16,6 @@ export declare class NgpSubmenuTrigger<T = unknown> {
|
|
|
16
16
|
* Access the view container reference.
|
|
17
17
|
*/
|
|
18
18
|
private readonly viewContainerRef;
|
|
19
|
-
/** Access the menu trigger state */
|
|
20
|
-
private readonly menuTrigger;
|
|
21
19
|
/** Access the parent menu */
|
|
22
20
|
private readonly parentMenu;
|
|
23
21
|
/**
|
|
@@ -83,7 +81,7 @@ export declare class NgpSubmenuTrigger<T = unknown> {
|
|
|
83
81
|
/**
|
|
84
82
|
* If the user hovers over the trigger, we want to open the submenu
|
|
85
83
|
*/
|
|
86
|
-
protected showSubmenuOnHover(): void;
|
|
84
|
+
protected showSubmenuOnHover(event: PointerEvent): void;
|
|
87
85
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger<any>, never>;
|
|
88
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger<any>, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "
|
|
86
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger<any>, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSubmenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpSubmenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpSubmenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpSubmenuTriggerFlip"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
89
87
|
}
|
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.47.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -71,26 +71,26 @@
|
|
|
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
74
|
"./avatar": {
|
|
79
75
|
"types": "./avatar/index.d.ts",
|
|
80
76
|
"default": "./fesm2022/ng-primitives-avatar.mjs"
|
|
81
77
|
},
|
|
78
|
+
"./autofill": {
|
|
79
|
+
"types": "./autofill/index.d.ts",
|
|
80
|
+
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
81
|
+
},
|
|
82
82
|
"./button": {
|
|
83
83
|
"types": "./button/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
85
85
|
},
|
|
86
|
-
"./combobox": {
|
|
87
|
-
"types": "./combobox/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
89
|
-
},
|
|
90
86
|
"./checkbox": {
|
|
91
87
|
"types": "./checkbox/index.d.ts",
|
|
92
88
|
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
93
89
|
},
|
|
90
|
+
"./combobox": {
|
|
91
|
+
"types": "./combobox/index.d.ts",
|
|
92
|
+
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
93
|
+
},
|
|
94
94
|
"./common": {
|
|
95
95
|
"types": "./common/index.d.ts",
|
|
96
96
|
"default": "./fesm2022/ng-primitives-common.mjs"
|
|
@@ -99,14 +99,18 @@
|
|
|
99
99
|
"types": "./date-picker/index.d.ts",
|
|
100
100
|
"default": "./fesm2022/ng-primitives-date-picker.mjs"
|
|
101
101
|
},
|
|
102
|
-
"./
|
|
103
|
-
"types": "./
|
|
104
|
-
"default": "./fesm2022/ng-primitives-
|
|
102
|
+
"./date-time": {
|
|
103
|
+
"types": "./date-time/index.d.ts",
|
|
104
|
+
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
105
105
|
},
|
|
106
106
|
"./date-time-luxon": {
|
|
107
107
|
"types": "./date-time-luxon/index.d.ts",
|
|
108
108
|
"default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
|
|
109
109
|
},
|
|
110
|
+
"./dialog": {
|
|
111
|
+
"types": "./dialog/index.d.ts",
|
|
112
|
+
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
113
|
+
},
|
|
110
114
|
"./file-upload": {
|
|
111
115
|
"types": "./file-upload/index.d.ts",
|
|
112
116
|
"default": "./fesm2022/ng-primitives-file-upload.mjs"
|
|
@@ -155,10 +159,6 @@
|
|
|
155
159
|
"types": "./portal/index.d.ts",
|
|
156
160
|
"default": "./fesm2022/ng-primitives-portal.mjs"
|
|
157
161
|
},
|
|
158
|
-
"./date-time": {
|
|
159
|
-
"types": "./date-time/index.d.ts",
|
|
160
|
-
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
161
|
-
},
|
|
162
162
|
"./progress": {
|
|
163
163
|
"types": "./progress/index.d.ts",
|
|
164
164
|
"default": "./fesm2022/ng-primitives-progress.mjs"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "ng-primitives/focus-trap";
|
|
3
|
-
import * as i2 from "ng-primitives/internal";
|
|
4
3
|
/**
|
|
5
4
|
* Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.
|
|
6
5
|
*/
|
|
@@ -10,5 +9,5 @@ export declare class NgpPopover {
|
|
|
10
9
|
*/
|
|
11
10
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
12
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopover, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopover, "[ngpPopover]", ["ngpPopover"], {}, {}, never, never, true, [{ directive: typeof i1.NgpFocusTrap; inputs: {}; outputs: {}; }
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopover, "[ngpPopover]", ["ngpPopover"], {}, {}, never, never, true, [{ directive: typeof i1.NgpFocusTrap; inputs: {}; outputs: {}; }]>;
|
|
14
13
|
}
|
package/portal/portal.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare class NgpComponentPortal<T> extends NgpPortal {
|
|
|
29
29
|
private readonly componentPortal;
|
|
30
30
|
private viewRef;
|
|
31
31
|
private isDestroying;
|
|
32
|
+
private exitAnimationRef;
|
|
32
33
|
constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector);
|
|
33
34
|
/**
|
|
34
35
|
* Attach the portal to a DOM element.
|
|
@@ -55,6 +56,7 @@ export declare class NgpComponentPortal<T> extends NgpPortal {
|
|
|
55
56
|
export declare class NgpTemplatePortal<T> extends NgpPortal {
|
|
56
57
|
private readonly templatePortal;
|
|
57
58
|
private viewRef;
|
|
59
|
+
private exitAnimationRefs;
|
|
58
60
|
private isDestroying;
|
|
59
61
|
constructor(template: TemplateRef<T>, viewContainerRef: ViewContainerRef, injector: Injector, context?: T);
|
|
60
62
|
/**
|
package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -106,6 +106,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
106
106
|
position: absolute;
|
|
107
107
|
animation: popover-show 0.1s ease-out;
|
|
108
108
|
width: var(--ngp-combobox-width);
|
|
109
|
+
box-shadow: var(--ngp-shadow-lg);
|
|
109
110
|
box-sizing: border-box;
|
|
110
111
|
margin-top: 4px;
|
|
111
112
|
max-height: 240px;
|
|
@@ -161,22 +162,22 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
161
162
|
@keyframes combobox-show {
|
|
162
163
|
0% {
|
|
163
164
|
opacity: 0;
|
|
164
|
-
transform: scale(0.9);
|
|
165
|
+
transform: translateY(-10px) scale(0.9);
|
|
165
166
|
}
|
|
166
167
|
100% {
|
|
167
168
|
opacity: 1;
|
|
168
|
-
transform: scale(1);
|
|
169
|
+
transform: translateY(0) scale(1);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
@keyframes combobox-hide {
|
|
173
174
|
0% {
|
|
174
175
|
opacity: 1;
|
|
175
|
-
transform: scale(1);
|
|
176
|
+
transform: translateY(0) scale(1);
|
|
176
177
|
}
|
|
177
178
|
100% {
|
|
178
179
|
opacity: 0;
|
|
179
|
-
transform: scale(0.9);
|
|
180
|
+
transform: translateY(-10px) scale(0.9);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
`,
|
package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -76,6 +76,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
76
76
|
position: absolute;
|
|
77
77
|
animation: popover-show 0.1s ease-out;
|
|
78
78
|
width: var(--ngp-popover-trigger-width);
|
|
79
|
+
box-shadow: var(--ngp-shadow-lg);
|
|
79
80
|
box-sizing: border-box;
|
|
80
81
|
}
|
|
81
82
|
`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
3
|
import { injectSwitchState, NgpSwitch, NgpSwitchThumb } from 'ng-primitives/switch';
|
|
4
4
|
import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
@@ -68,7 +68,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
68
68
|
'(focusout)': 'onTouched?.()',
|
|
69
69
|
},
|
|
70
70
|
})
|
|
71
|
-
export class Switch<%= componentSuffix %> implements ControlValueAccessor {
|
|
71
|
+
export class Switch<%= componentSuffix %> implements OnInit, ControlValueAccessor {
|
|
72
72
|
/** Access the switch state. */
|
|
73
73
|
private readonly switch = injectSwitchState();
|
|
74
74
|
|
|
@@ -78,7 +78,7 @@ export class Switch<%= componentSuffix %> implements ControlValueAccessor {
|
|
|
78
78
|
/** The on touched callback */
|
|
79
79
|
protected onTouched?: TouchedFn;
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
ngOnInit() {
|
|
82
82
|
// Any time the switch changes, update the form value.
|
|
83
83
|
this.switch().checkedChange.subscribe(value => this.onChange?.(value));
|
|
84
84
|
}
|
|
@@ -18,7 +18,7 @@ export declare const injectSwitchState: <U = {
|
|
|
18
18
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
19
19
|
readonly state: import("ng-primitives/state").CreatedState<NgpSwitch>;
|
|
20
20
|
toggle: () => void;
|
|
21
|
-
onKeyDown: () => void;
|
|
21
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
22
22
|
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
23
23
|
/**
|
|
24
24
|
* The Switch state registration function.
|
|
@@ -40,7 +40,7 @@ export declare class NgpSwitch {
|
|
|
40
40
|
/**
|
|
41
41
|
* Handle the keydown event.
|
|
42
42
|
*/
|
|
43
|
-
protected onKeyDown(): void;
|
|
43
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
44
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitch, never>;
|
|
45
45
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSwitch, "[ngpSwitch]", ["ngpSwitch"], { "checked": { "alias": "ngpSwitchChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSwitchDisabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "ngpSwitchCheckedChange"; }, never, never, true, [{ directive: typeof i1.NgpFormControl; inputs: {}; outputs: {}; }]>;
|
|
46
46
|
}
|
|
@@ -14,7 +14,7 @@ export declare class NgpSwitchThumb {
|
|
|
14
14
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
15
15
|
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/switch").NgpSwitch>;
|
|
16
16
|
toggle: () => void;
|
|
17
|
-
onKeyDown: () => void;
|
|
17
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
18
18
|
}>>;
|
|
19
19
|
constructor();
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitchThumb, never>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "ng-primitives/internal";
|
|
3
2
|
/**
|
|
4
3
|
* Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
|
|
5
4
|
*/
|
|
@@ -9,5 +8,5 @@ export declare class NgpTooltip {
|
|
|
9
8
|
*/
|
|
10
9
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
11
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpTooltip, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true,
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true, never>;
|
|
13
12
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
export interface NgpControlStatus {
|
|
3
|
+
valid: boolean | null;
|
|
4
|
+
invalid: boolean | null;
|
|
5
|
+
pristine: boolean | null;
|
|
6
|
+
dirty: boolean | null;
|
|
7
|
+
touched: boolean | null;
|
|
8
|
+
pending: boolean | null;
|
|
9
|
+
disabled: boolean | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A utility function to get the status of an Angular form control as a reactive signal.
|
|
13
|
+
* This function injects the NgControl and returns a signal that reflects the control's status.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function controlStatus(): Signal<NgpControlStatus>;
|
package/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { provideValueAccessor } from './forms/providers';
|
|
2
|
+
export { controlStatus, NgpControlStatus } from './forms/status';
|
|
2
3
|
export { ChangeFn, TouchedFn } from './forms/types';
|
|
3
4
|
export { injectDisposables } from './helpers/disposables';
|
|
4
5
|
export { uniqueId } from './helpers/unique-id';
|