ng-primitives 0.43.1 → 0.45.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.
Files changed (63) hide show
  1. package/a11y/active-descendant/active-descendant.d.ts +38 -0
  2. package/a11y/index.d.ts +2 -1
  3. package/combobox/README.md +3 -0
  4. package/combobox/combobox/combobox-state.d.ts +60 -0
  5. package/combobox/combobox/combobox.d.ts +182 -0
  6. package/combobox/combobox-button/combobox-button.d.ts +61 -0
  7. package/combobox/combobox-dropdown/combobox-dropdown.d.ts +65 -0
  8. package/combobox/combobox-input/combobox-input.d.ts +79 -0
  9. package/combobox/combobox-option/combobox-option.d.ts +94 -0
  10. package/combobox/combobox-portal/combobox-portal.d.ts +35 -0
  11. package/combobox/index.d.ts +7 -0
  12. package/dialog/config/dialog-config.d.ts +2 -0
  13. package/dialog/dialog/dialog-ref.d.ts +2 -0
  14. package/dialog/dialog-trigger/dialog-trigger.d.ts +8 -1
  15. package/example-theme/index.css +1 -0
  16. package/fesm2022/ng-primitives-a11y.mjs +100 -1
  17. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-combobox.mjs +783 -0
  19. package/fesm2022/ng-primitives-combobox.mjs.map +1 -0
  20. package/fesm2022/ng-primitives-dialog.mjs +19 -3
  21. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-focus-trap.mjs +9 -1
  23. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-listbox.mjs +1 -1
  25. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-menu.mjs +372 -63
  27. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-popover.mjs +62 -332
  29. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-portal.mjs +359 -2
  31. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  32. package/fesm2022/ng-primitives-resize.mjs +21 -2
  33. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-tooltip.mjs +51 -176
  35. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  36. package/focus-trap/focus-trap/focus-trap-state.d.ts +1 -0
  37. package/focus-trap/focus-trap/focus-trap.d.ts +5 -0
  38. package/menu/config/menu-config.d.ts +42 -0
  39. package/menu/index.d.ts +5 -1
  40. package/menu/menu/menu.d.ts +6 -2
  41. package/menu/menu-trigger/menu-trigger-state.d.ts +37 -0
  42. package/menu/menu-trigger/menu-trigger.d.ts +87 -13
  43. package/menu/submenu-trigger/submenu-trigger-state.d.ts +56 -0
  44. package/menu/submenu-trigger/submenu-trigger.d.ts +62 -10
  45. package/package.json +17 -13
  46. package/popover/index.d.ts +1 -2
  47. package/popover/popover/popover.d.ts +2 -43
  48. package/popover/popover-trigger/popover-trigger.d.ts +13 -107
  49. package/portal/index.d.ts +2 -0
  50. package/portal/overlay-token.d.ts +12 -0
  51. package/portal/overlay.d.ts +170 -0
  52. package/resize/index.d.ts +1 -1
  53. package/resize/utils/resize.d.ts +5 -0
  54. package/schematics/ng-generate/schema.d.ts +2 -1
  55. package/schematics/ng-generate/schema.json +1 -0
  56. package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +264 -0
  57. package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template +2 -0
  58. package/tooltip/index.d.ts +1 -1
  59. package/tooltip/tooltip/tooltip.d.ts +3 -25
  60. package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +12 -63
  61. package/popover/popover/popover-token.d.ts +0 -10
  62. package/popover/utils/transform-origin.d.ts +0 -2
  63. package/tooltip/tooltip/tooltip-token.d.ts +0 -10
@@ -0,0 +1,38 @@
1
+ import { Signal } from '@angular/core';
2
+ interface ActiveDescendantManagerOptions<T extends NgpActivatable> {
3
+ /**
4
+ * The disabled state of the active descendant group.
5
+ * @default false
6
+ */
7
+ disabled?: Signal<boolean>;
8
+ /**
9
+ * The items in the active descendant group.
10
+ */
11
+ items: Signal<T[]>;
12
+ /**
13
+ * Whether active descendant should wrap around.
14
+ * @default false
15
+ */
16
+ wrap?: Signal<boolean>;
17
+ }
18
+ export interface NgpActivatable {
19
+ /**
20
+ * The id of the item.
21
+ */
22
+ id: Signal<string>;
23
+ /**
24
+ * Whether the item is disabled.
25
+ */
26
+ disabled?: Signal<boolean>;
27
+ }
28
+ export declare function activeDescendantManager<T extends NgpActivatable>(options: ActiveDescendantManagerOptions<T>): {
29
+ activeDescendant: Signal<string | undefined>;
30
+ activeItem: Signal<T | undefined>;
31
+ activate: (item: T | undefined) => void;
32
+ first: () => void;
33
+ last: () => void;
34
+ next: () => void;
35
+ previous: () => void;
36
+ reset: () => void;
37
+ };
38
+ export {};
package/a11y/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './active-descendant/active-descendant';
1
2
  export * from './visually-hidden/visually-hidden';
2
- export { provideVisuallyHiddenState, injectVisuallyHiddenState, } from './visually-hidden/visually-hidden-state';
3
+ export { injectVisuallyHiddenState, provideVisuallyHiddenState, } from './visually-hidden/visually-hidden-state';
@@ -0,0 +1,3 @@
1
+ # ng-primitives/combobox
2
+
3
+ Secondary entry point of `ng-primitives`. It can be used by importing from `ng-primitives/combobox`.
@@ -0,0 +1,60 @@
1
+ import type { NgpCombobox } from './combobox';
2
+ /**
3
+ * The state token for the Combobox primitive.
4
+ */
5
+ export declare const NgpComboboxStateToken: import("@angular/core").InjectionToken<NgpCombobox>;
6
+ /**
7
+ * Provides the Combobox state.
8
+ */
9
+ export declare const provideComboboxState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
10
+ /**
11
+ * Injects the Combobox state.
12
+ */
13
+ export declare const injectComboboxState: <U = {
14
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
15
+ readonly injector: import("@angular/core").Injector;
16
+ readonly value: import("@angular/core").InputSignal<any>;
17
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
18
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
19
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
20
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
21
+ readonly compareWith: import("@angular/core").InputSignal<(a: any | undefined, b: any | undefined) => boolean>;
22
+ readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
23
+ readonly input: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxInput | undefined>;
24
+ readonly button: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxButton | undefined>;
25
+ readonly portal: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxPortal | undefined>;
26
+ readonly dropdown: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxDropdown | undefined>;
27
+ readonly options: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxOption[]>;
28
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
29
+ readonly open: import("@angular/core").Signal<boolean>;
30
+ readonly activeDescendantManager: {
31
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
32
+ activeItem: import("@angular/core").Signal<import("ng-primitives/combobox").NgpComboboxOption | undefined>;
33
+ activate: (item: import("ng-primitives/combobox").NgpComboboxOption | undefined) => void;
34
+ first: () => void;
35
+ last: () => void;
36
+ next: () => void;
37
+ previous: () => void;
38
+ reset: () => void;
39
+ };
40
+ readonly state: import("ng-primitives/state").CreatedState<NgpCombobox>;
41
+ openDropdown: () => Promise<void>;
42
+ closeDropdown: () => void;
43
+ toggleDropdown: () => void;
44
+ selectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
45
+ deselectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
46
+ toggleOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
47
+ isOptionSelected: (option: import("ng-primitives/combobox").NgpComboboxOption) => boolean;
48
+ activateNextOption: () => void;
49
+ activatePreviousOption: () => void;
50
+ registerPortal: (portal: import("ng-primitives/combobox").NgpComboboxPortal) => void;
51
+ registerInput: (input: import("ng-primitives/combobox").NgpComboboxInput) => void;
52
+ registerButton: (button: import("ng-primitives/combobox").NgpComboboxButton) => void;
53
+ registerDropdown: (dropdown: import("ng-primitives/combobox").NgpComboboxDropdown) => void;
54
+ registerOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
55
+ unregisterOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
56
+ }>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
57
+ /**
58
+ * The Combobox state registration function.
59
+ */
60
+ export declare const comboboxState: <U>(state: U) => import("ng-primitives/state").CreatedState<U>;
@@ -0,0 +1,182 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { Injector } from '@angular/core';
3
+ import { Placement } from '@floating-ui/dom';
4
+ import type { NgpComboboxButton } from '../combobox-button/combobox-button';
5
+ import type { NgpComboboxDropdown } from '../combobox-dropdown/combobox-dropdown';
6
+ import type { NgpComboboxInput } from '../combobox-input/combobox-input';
7
+ import { NgpComboboxOption } from '../combobox-option/combobox-option';
8
+ import type { NgpComboboxPortal } from '../combobox-portal/combobox-portal';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Ideally we would use a generic type here, unfortunately, unlike in React,
12
+ * we cannot infer the type based on another input. For example, if multiple
13
+ * is true, we cannot infer that the value is an array of T. Using a union
14
+ * type is not ideal either because it requires the user to handle multiple cases.
15
+ * Using a generic also isn't ideal because we need to use T as both an array and
16
+ * a single value.
17
+ *
18
+ * Any seems to be used by Angular Material, ng-select, and other libraries
19
+ * so we will use it here as well.
20
+ */
21
+ type T = any;
22
+ export declare class NgpCombobox {
23
+ /** @internal Access the combobox element. */
24
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
25
+ /** Access the injector. */
26
+ protected readonly injector: Injector;
27
+ /** The value of the combobox. */
28
+ readonly value: import("@angular/core").InputSignal<any>;
29
+ /** Event emitted when the value changes. */
30
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
31
+ /** Whether the combobox is multiple selection. */
32
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
33
+ /** Whether the combobox is disabled. */
34
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
35
+ /** Emit when the dropdown open state changes. */
36
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
37
+ /** The comparator function used to compare options. */
38
+ readonly compareWith: import("@angular/core").InputSignal<(a: T | undefined, b: T | undefined) => boolean>;
39
+ /** The position of the dropdown. */
40
+ readonly placement: import("@angular/core").InputSignal<Placement>;
41
+ /**
42
+ * Store the combobox input
43
+ * @internal
44
+ */
45
+ readonly input: import("@angular/core").WritableSignal<NgpComboboxInput | undefined>;
46
+ /**
47
+ * Store the combobox button.
48
+ * @internal
49
+ */
50
+ readonly button: import("@angular/core").WritableSignal<NgpComboboxButton | undefined>;
51
+ /**
52
+ * Store the combobox portal.
53
+ * @internal
54
+ */
55
+ readonly portal: import("@angular/core").WritableSignal<NgpComboboxPortal | undefined>;
56
+ /**
57
+ * Store the combobox dropdown.
58
+ * @internal
59
+ */
60
+ readonly dropdown: import("@angular/core").WritableSignal<NgpComboboxDropdown | undefined>;
61
+ /**
62
+ * Store the combobox options.
63
+ * @internal
64
+ */
65
+ readonly options: import("@angular/core").WritableSignal<NgpComboboxOption[]>;
66
+ /**
67
+ * Access the overlay
68
+ * @internal
69
+ */
70
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
71
+ /**
72
+ * The open state of the combobox.
73
+ * @internal
74
+ */
75
+ readonly open: import("@angular/core").Signal<boolean>;
76
+ /**
77
+ * The active key descendant manager.
78
+ * @internal
79
+ */
80
+ readonly activeDescendantManager: {
81
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
82
+ activeItem: import("@angular/core").Signal<NgpComboboxOption | undefined>;
83
+ activate: (item: NgpComboboxOption | undefined) => void;
84
+ first: () => void;
85
+ last: () => void;
86
+ next: () => void;
87
+ previous: () => void;
88
+ reset: () => void;
89
+ };
90
+ /** The state of the combobox. */
91
+ protected readonly state: import("ng-primitives/state").CreatedState<NgpCombobox>;
92
+ constructor();
93
+ /**
94
+ * Open the dropdown.
95
+ * @internal
96
+ */
97
+ openDropdown(): Promise<void>;
98
+ /**
99
+ * Close the dropdown.
100
+ * @internal
101
+ */
102
+ closeDropdown(): void;
103
+ /**
104
+ * Toggle the dropdown.
105
+ * @internal
106
+ */
107
+ toggleDropdown(): void;
108
+ /**
109
+ * Select an option.
110
+ * @param option The option to select.
111
+ * @internal
112
+ */
113
+ selectOption(option: NgpComboboxOption): void;
114
+ /**
115
+ * Deselect an option.
116
+ * @param option The option to deselect.
117
+ * @internal
118
+ */
119
+ deselectOption(option: NgpComboboxOption): void;
120
+ /**
121
+ * Toggle the selection of an option.
122
+ * @param option The option to toggle.
123
+ * @internal
124
+ */
125
+ toggleOption(option: NgpComboboxOption): void;
126
+ /**
127
+ * Determine if an option is selected.
128
+ * @param option The option to check.
129
+ * @internal
130
+ */
131
+ isOptionSelected(option: NgpComboboxOption): boolean;
132
+ /**
133
+ * Activate the next option in the list if there is one.
134
+ * If there is no option currently active, activate the selected option or the first option.
135
+ * @internal
136
+ */
137
+ activateNextOption(): void;
138
+ /**
139
+ * Activate the previous option in the list if there is one.
140
+ * @internal
141
+ */
142
+ activatePreviousOption(): void;
143
+ /**
144
+ * Register the dropdown portal with the combobox.
145
+ * @param portal The dropdown portal.
146
+ * @internal
147
+ */
148
+ registerPortal(portal: NgpComboboxPortal): void;
149
+ /**
150
+ * Register the combobox input with the combobox.
151
+ * @param input The combobox input.
152
+ * @internal
153
+ */
154
+ registerInput(input: NgpComboboxInput): void;
155
+ /**
156
+ * Register the combobox button with the combobox.
157
+ * @param button The combobox button.
158
+ * @internal
159
+ */
160
+ registerButton(button: NgpComboboxButton): void;
161
+ /**
162
+ * Register the dropdown with the combobox.
163
+ * @param dropdown The dropdown to register.
164
+ * @internal
165
+ */
166
+ registerDropdown(dropdown: NgpComboboxDropdown): void;
167
+ /**
168
+ * Register an option with the combobox.
169
+ * @param option The option to register.
170
+ * @internal
171
+ */
172
+ registerOption(option: NgpComboboxOption): void;
173
+ /**
174
+ * Unregister an option from the combobox.
175
+ * @param option The option to unregister.
176
+ * @internal
177
+ */
178
+ unregisterOption(option: NgpComboboxOption): void;
179
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpCombobox, never>;
180
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpCombobox, "[ngpCombobox]", ["ngpCombobox"], { "value": { "alias": "ngpComboboxValue"; "required": false; "isSignal": true; }; "multiple": { "alias": "ngpComboboxMultiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpComboboxDisabled"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpComboboxCompareWith"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpComboboxDropdownPlacement"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpComboboxValueChange"; "openChange": "ngpComboboxOpenChange"; }, never, never, true, never>;
181
+ }
182
+ export {};
@@ -0,0 +1,61 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NgpComboboxButton {
3
+ /** Access the combobox state. */
4
+ protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
5
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
6
+ readonly injector: import("@angular/core").Injector;
7
+ readonly value: import("@angular/core").InputSignal<any>;
8
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
9
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
10
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
11
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
12
+ readonly compareWith: import("@angular/core").InputSignal<(a: any | undefined, b: any | undefined) => boolean>;
13
+ readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
14
+ readonly input: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxInput | undefined>;
15
+ readonly button: import("@angular/core").WritableSignal<NgpComboboxButton | undefined>;
16
+ readonly portal: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxPortal | undefined>;
17
+ readonly dropdown: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxDropdown | undefined>;
18
+ readonly options: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxOption[]>;
19
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
20
+ readonly open: import("@angular/core").Signal<boolean>;
21
+ readonly activeDescendantManager: {
22
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
23
+ activeItem: import("@angular/core").Signal<import("ng-primitives/combobox").NgpComboboxOption | undefined>;
24
+ activate: (item: import("ng-primitives/combobox").NgpComboboxOption | undefined) => void;
25
+ first: () => void;
26
+ last: () => void;
27
+ next: () => void;
28
+ previous: () => void;
29
+ reset: () => void;
30
+ };
31
+ readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/combobox").NgpCombobox>;
32
+ openDropdown: () => Promise<void>;
33
+ closeDropdown: () => void;
34
+ toggleDropdown: () => void;
35
+ selectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
36
+ deselectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
37
+ toggleOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
38
+ isOptionSelected: (option: import("ng-primitives/combobox").NgpComboboxOption) => boolean;
39
+ activateNextOption: () => void;
40
+ activatePreviousOption: () => void;
41
+ registerPortal: (portal: import("ng-primitives/combobox").NgpComboboxPortal) => void;
42
+ registerInput: (input: import("ng-primitives/combobox").NgpComboboxInput) => void;
43
+ registerButton: (button: NgpComboboxButton) => void;
44
+ registerDropdown: (dropdown: import("ng-primitives/combobox").NgpComboboxDropdown) => void;
45
+ registerOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
46
+ unregisterOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
47
+ }>>;
48
+ /**
49
+ * Access the element reference.
50
+ * @internal
51
+ */
52
+ readonly elementRef: import("@angular/core").ElementRef<HTMLButtonElement>;
53
+ /** The id of the button. */
54
+ readonly id: import("@angular/core").InputSignal<string>;
55
+ /** The id of the dropdown. */
56
+ readonly dropdownId: import("@angular/core").Signal<string | undefined>;
57
+ constructor();
58
+ protected toggleDropdown(): void;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpComboboxButton, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpComboboxButton, "[ngpComboboxButton]", ["ngpComboboxButton"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
61
+ }
@@ -0,0 +1,65 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "ng-primitives/internal";
3
+ export declare class NgpComboboxDropdown {
4
+ /** Access the combobox state. */
5
+ protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
6
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
7
+ readonly injector: import("@angular/core").Injector;
8
+ readonly value: import("@angular/core").InputSignal<any>;
9
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
10
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
11
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
12
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
13
+ readonly compareWith: import("@angular/core").InputSignal<(a: any | undefined, b: any | undefined) => boolean>;
14
+ readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
15
+ readonly input: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxInput | undefined>;
16
+ readonly button: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxButton | undefined>;
17
+ readonly portal: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxPortal | undefined>;
18
+ readonly dropdown: import("@angular/core").WritableSignal<NgpComboboxDropdown | undefined>;
19
+ readonly options: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxOption[]>;
20
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
21
+ readonly open: import("@angular/core").Signal<boolean>;
22
+ readonly activeDescendantManager: {
23
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
24
+ activeItem: import("@angular/core").Signal<import("ng-primitives/combobox").NgpComboboxOption | undefined>;
25
+ activate: (item: import("ng-primitives/combobox").NgpComboboxOption | undefined) => void;
26
+ first: () => void;
27
+ last: () => void;
28
+ next: () => void;
29
+ previous: () => void;
30
+ reset: () => void;
31
+ };
32
+ readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/combobox").NgpCombobox>;
33
+ openDropdown: () => Promise<void>;
34
+ closeDropdown: () => void;
35
+ toggleDropdown: () => void;
36
+ selectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
37
+ deselectOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
38
+ toggleOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
39
+ isOptionSelected: (option: import("ng-primitives/combobox").NgpComboboxOption) => boolean;
40
+ activateNextOption: () => void;
41
+ activatePreviousOption: () => void;
42
+ registerPortal: (portal: import("ng-primitives/combobox").NgpComboboxPortal) => void;
43
+ registerInput: (input: import("ng-primitives/combobox").NgpComboboxInput) => void;
44
+ registerButton: (button: import("ng-primitives/combobox").NgpComboboxButton) => void;
45
+ registerDropdown: (dropdown: NgpComboboxDropdown) => void;
46
+ registerOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
47
+ unregisterOption: (option: import("ng-primitives/combobox").NgpComboboxOption) => void;
48
+ }>>;
49
+ /** The dimensions of the combobox. */
50
+ protected readonly comboboxDimensions: import("@angular/core").Signal<import("ng-primitives/resize").Dimensions>;
51
+ /** The dimensions of the combobox. */
52
+ protected readonly inputDimensions: import("@angular/core").Signal<import("ng-primitives/resize").Dimensions>;
53
+ /** Store the combobox button dimensions. */
54
+ protected readonly buttonDimensions: import("@angular/core").Signal<import("ng-primitives/resize").Dimensions>;
55
+ /**
56
+ * Access the element reference.
57
+ * @internal
58
+ */
59
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
60
+ /** The id of the dropdown. */
61
+ readonly id: import("@angular/core").InputSignal<string>;
62
+ constructor();
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpComboboxDropdown, never>;
64
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpComboboxDropdown, "[ngpComboboxDropdown]", ["ngpComboboxDropdown"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpExitAnimation; inputs: {}; outputs: {}; }]>;
65
+ }
@@ -0,0 +1,79 @@
1
+ import type { NgpComboboxOption } from '../combobox-option/combobox-option';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NgpComboboxInput {
4
+ /** Access the combobox state. */
5
+ protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
6
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
7
+ readonly injector: import("@angular/core").Injector;
8
+ readonly value: import("@angular/core").InputSignal<any>;
9
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
10
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
11
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
12
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
13
+ readonly compareWith: import("@angular/core").InputSignal<(a: any | undefined, b: any | undefined) => boolean>;
14
+ readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
15
+ readonly input: import("@angular/core").WritableSignal<NgpComboboxInput | undefined>;
16
+ readonly button: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxButton | undefined>;
17
+ readonly portal: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxPortal | undefined>;
18
+ readonly dropdown: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxDropdown | undefined>;
19
+ readonly options: import("@angular/core").WritableSignal<NgpComboboxOption[]>;
20
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
21
+ readonly open: import("@angular/core").Signal<boolean>;
22
+ readonly activeDescendantManager: {
23
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
24
+ activeItem: import("@angular/core").Signal<NgpComboboxOption | undefined>;
25
+ activate: (item: NgpComboboxOption | undefined) => void;
26
+ first: () => void;
27
+ last: () => void;
28
+ next: () => void;
29
+ previous: () => void;
30
+ reset: () => void;
31
+ };
32
+ readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/combobox").NgpCombobox>;
33
+ openDropdown: () => Promise<void>;
34
+ closeDropdown: () => void;
35
+ toggleDropdown: () => void;
36
+ selectOption: (option: NgpComboboxOption) => void;
37
+ deselectOption: (option: NgpComboboxOption) => void;
38
+ toggleOption: (option: NgpComboboxOption) => void;
39
+ isOptionSelected: (option: NgpComboboxOption) => boolean;
40
+ activateNextOption: () => void;
41
+ activatePreviousOption: () => void;
42
+ registerPortal: (portal: import("ng-primitives/combobox").NgpComboboxPortal) => void;
43
+ registerInput: (input: NgpComboboxInput) => void;
44
+ registerButton: (button: import("ng-primitives/combobox").NgpComboboxButton) => void;
45
+ registerDropdown: (dropdown: import("ng-primitives/combobox").NgpComboboxDropdown) => void;
46
+ registerOption: (option: NgpComboboxOption) => void;
47
+ unregisterOption: (option: NgpComboboxOption) => void;
48
+ }>>;
49
+ /**
50
+ * Access the element reference.
51
+ * @internal
52
+ */
53
+ readonly elementRef: import("@angular/core").ElementRef<HTMLInputElement>;
54
+ /** The id of the input. */
55
+ readonly id: import("@angular/core").InputSignal<string>;
56
+ /**
57
+ * Extract the string representation of the value.
58
+ */
59
+ readonly displayWith: import("@angular/core").InputSignal<(value: any) => string>;
60
+ /** The id of the dropdown. */
61
+ readonly dropdownId: import("@angular/core").Signal<string | undefined>;
62
+ /** The id of the active descendant. */
63
+ protected readonly activeDescendant: import("@angular/core").Signal<string | undefined>;
64
+ /** Determine if the pointer was used to focus the input. */
65
+ protected pointerFocused: boolean;
66
+ constructor();
67
+ /** Handle keydown events for accessibility. */
68
+ protected handleKeydown(event: KeyboardEvent): void;
69
+ protected closeDropdown(event: FocusEvent): void;
70
+ /**
71
+ * Focus the input field
72
+ * @internal
73
+ */
74
+ focus(): void;
75
+ protected highlightText(): void;
76
+ protected handlePointerDown(): void;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpComboboxInput, never>;
78
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpComboboxInput, "input[ngpComboboxInput]", ["ngpComboboxInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
79
+ }
@@ -0,0 +1,94 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { OnDestroy, OnInit } from '@angular/core';
3
+ import { NgpActivatable } from 'ng-primitives/a11y';
4
+ import * as i0 from "@angular/core";
5
+ export declare class NgpComboboxOption implements OnInit, OnDestroy, NgpActivatable {
6
+ /** Access the combobox state. */
7
+ protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
8
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
9
+ readonly injector: import("@angular/core").Injector;
10
+ readonly value: import("@angular/core").InputSignal<any>;
11
+ readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
12
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
13
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
14
+ readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
15
+ readonly compareWith: import("@angular/core").InputSignal<(a: any | undefined, b: any | undefined) => boolean>;
16
+ readonly placement: import("@angular/core").InputSignal<import("@floating-ui/dom").Placement>;
17
+ readonly input: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxInput | undefined>;
18
+ readonly button: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxButton | undefined>;
19
+ readonly portal: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxPortal | undefined>;
20
+ readonly dropdown: import("@angular/core").WritableSignal<import("ng-primitives/combobox").NgpComboboxDropdown | undefined>;
21
+ readonly options: import("@angular/core").WritableSignal<NgpComboboxOption[]>;
22
+ readonly overlay: import("@angular/core").Signal<import("ng-primitives/portal").NgpOverlay<void> | null | undefined>;
23
+ readonly open: import("@angular/core").Signal<boolean>;
24
+ readonly activeDescendantManager: {
25
+ activeDescendant: import("@angular/core").Signal<string | undefined>;
26
+ activeItem: import("@angular/core").Signal<NgpComboboxOption | undefined>;
27
+ activate: (item: NgpComboboxOption | undefined) => void;
28
+ first: () => void;
29
+ last: () => void;
30
+ next: () => void;
31
+ previous: () => void;
32
+ reset: () => void;
33
+ };
34
+ readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/combobox").NgpCombobox>;
35
+ openDropdown: () => Promise<void>;
36
+ closeDropdown: () => void;
37
+ toggleDropdown: () => void;
38
+ selectOption: (option: NgpComboboxOption) => void;
39
+ deselectOption: (option: NgpComboboxOption) => void;
40
+ toggleOption: (option: NgpComboboxOption) => void;
41
+ isOptionSelected: (option: NgpComboboxOption) => boolean;
42
+ activateNextOption: () => void;
43
+ activatePreviousOption: () => void;
44
+ registerPortal: (portal: import("ng-primitives/combobox").NgpComboboxPortal) => void;
45
+ registerInput: (input: import("ng-primitives/combobox").NgpComboboxInput) => void;
46
+ registerButton: (button: import("ng-primitives/combobox").NgpComboboxButton) => void;
47
+ registerDropdown: (dropdown: import("ng-primitives/combobox").NgpComboboxDropdown) => void;
48
+ registerOption: (option: NgpComboboxOption) => void;
49
+ unregisterOption: (option: NgpComboboxOption) => void;
50
+ }>>;
51
+ /**
52
+ * The element reference of the option.
53
+ * @internal
54
+ */
55
+ readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
56
+ /** The id of the option. */
57
+ readonly id: import("@angular/core").InputSignal<string>;
58
+ /** The value of the option. */
59
+ readonly value: import("@angular/core").InputSignal<any>;
60
+ /** The disabled state of the option. */
61
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
62
+ /**
63
+ * Whether this option is the active descendant.
64
+ * @internal
65
+ */
66
+ protected readonly active: import("@angular/core").Signal<boolean>;
67
+ /** Whether this option is selected. */
68
+ protected readonly selected: import("@angular/core").Signal<boolean>;
69
+ constructor();
70
+ ngOnInit(): void;
71
+ ngOnDestroy(): void;
72
+ /**
73
+ * Select the option.
74
+ * @internal
75
+ */
76
+ select(): void;
77
+ /**
78
+ * Scroll the option into view.
79
+ * @internal
80
+ */
81
+ scrollIntoView(): void;
82
+ /**
83
+ * Whenever the pointer enters the option, activate it.
84
+ * @internal
85
+ */
86
+ protected onPointerEnter(): void;
87
+ /**
88
+ * Whenever the pointer leaves the option, deactivate it.
89
+ * @internal
90
+ */
91
+ protected onPointerLeave(): void;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpComboboxOption, never>;
93
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpComboboxOption, "[ngpComboboxOption]", ["ngpComboboxOption"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "ngpComboboxOptionValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpComboboxOptionDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
94
+ }
@@ -0,0 +1,35 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { NgpOverlay } from 'ng-primitives/portal';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NgpComboboxPortal implements OnDestroy {
5
+ /** Access the combobox state. */
6
+ private readonly state;
7
+ /** Access the template reference. */
8
+ private readonly templateRef;
9
+ /** Access the injector. */
10
+ private readonly injector;
11
+ /**
12
+ * The overlay that manages the popover
13
+ * @internal
14
+ */
15
+ readonly overlay: import("@angular/core").WritableSignal<NgpOverlay<void> | null>;
16
+ constructor();
17
+ /** Cleanup the portal. */
18
+ ngOnDestroy(): void;
19
+ /**
20
+ * Attach the portal.
21
+ * @internal
22
+ */
23
+ show(): Promise<void>;
24
+ /**
25
+ * Detach the portal.
26
+ * @internal
27
+ */
28
+ detach(): Promise<void>;
29
+ /**
30
+ * Create the overlay that will contain the dropdown
31
+ */
32
+ private createOverlay;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgpComboboxPortal, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgpComboboxPortal, "[ngpComboboxPortal]", ["ngpComboboxPortal"], {}, {}, never, never, true, never>;
35
+ }
@@ -0,0 +1,7 @@
1
+ export { NgpComboboxDropdown } from './combobox-dropdown/combobox-dropdown';
2
+ export { NgpComboboxInput } from './combobox-input/combobox-input';
3
+ export { NgpComboboxOption } from './combobox-option/combobox-option';
4
+ export { NgpComboboxPortal } from './combobox-portal/combobox-portal';
5
+ export { NgpCombobox } from './combobox/combobox';
6
+ export { injectComboboxState, provideComboboxState } from './combobox/combobox-state';
7
+ export { NgpComboboxButton } from './combobox-button/combobox-button';