ng-primitives 0.121.0 → 0.122.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-combobox.mjs +13 -3
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +9 -3
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +8 -2
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +6 -2
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +8 -3
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +7 -2
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +15 -12
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +9 -5
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-primitives-combobox.d.ts +11 -1
- package/types/ng-primitives-context-menu.d.ts +16 -3
- package/types/ng-primitives-menu.d.ts +16 -1
- package/types/ng-primitives-navigation-menu.d.ts +22 -9
- package/types/ng-primitives-popover.d.ts +9 -2
- package/types/ng-primitives-select.d.ts +9 -2
- package/types/ng-primitives-toast.d.ts +4 -3
- package/types/ng-primitives-tooltip.d.ts +18 -8
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.122.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -290,7 +290,17 @@ declare class NgpCombobox {
|
|
|
290
290
|
reset: ({ scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void;
|
|
291
291
|
validate: () => void;
|
|
292
292
|
};
|
|
293
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* The form control status of the combobox host element itself. When the combobox is used as a
|
|
295
|
+
* form control (e.g. via a `ControlValueAccessor` wrapper) the `NgControl` lives on an ancestor
|
|
296
|
+
* element, so this resolves it even when there is no `ngpComboboxInput`.
|
|
297
|
+
*/
|
|
298
|
+
private readonly hostControlStatus;
|
|
299
|
+
/**
|
|
300
|
+
* The control status. When an input is present it can resolve the associated `NgControl` (whether
|
|
301
|
+
* the control is on the input itself or an ancestor), so we use its status. Otherwise we fall back
|
|
302
|
+
* to the combobox host's own control status so an input-less combobox still reflects validity.
|
|
303
|
+
*/
|
|
294
304
|
protected readonly controlStatus: _angular_core.Signal<ng_primitives_utils.NgpControlStatus | undefined>;
|
|
295
305
|
/** The state of the combobox. */
|
|
296
306
|
protected readonly state: ng_primitives_state.CreatedState<NgpCombobox>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Provider, Signal } from '@angular/core';
|
|
2
|
+
import { Provider, Signal, WritableSignal } from '@angular/core';
|
|
3
3
|
import { NgpOffset, NgpFlip, NgpShift, NgpOverlayContent, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal';
|
|
4
4
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
5
5
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
@@ -222,6 +222,11 @@ interface NgpContextMenuTriggerState {
|
|
|
222
222
|
* The focus origin that was used to open the menu.
|
|
223
223
|
*/
|
|
224
224
|
readonly openOrigin: Signal<FocusOrigin>;
|
|
225
|
+
/**
|
|
226
|
+
* The container in which the menu should be attached.
|
|
227
|
+
* @default document.body
|
|
228
|
+
*/
|
|
229
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
225
230
|
/**
|
|
226
231
|
* Show the context menu.
|
|
227
232
|
*/
|
|
@@ -230,6 +235,12 @@ interface NgpContextMenuTriggerState {
|
|
|
230
235
|
* Hide the context menu.
|
|
231
236
|
*/
|
|
232
237
|
hide(origin?: FocusOrigin): void;
|
|
238
|
+
/**
|
|
239
|
+
* Set the container in which the menu should be attached. Takes effect the
|
|
240
|
+
* next time the menu is opened; it does not move a menu that is already open.
|
|
241
|
+
* @param container - The new container
|
|
242
|
+
*/
|
|
243
|
+
setContainer(container: HTMLElement | string | null): void;
|
|
233
244
|
/**
|
|
234
245
|
* Set whether the pointer is over the menu content.
|
|
235
246
|
*/
|
|
@@ -269,11 +280,13 @@ interface NgpContextMenuTriggerProps<T = unknown> {
|
|
|
269
280
|
*/
|
|
270
281
|
readonly context?: Signal<T>;
|
|
271
282
|
}
|
|
272
|
-
declare const ngpContextMenuTrigger: <T>({ disabled: _disabled, menu: _menu, offset: _offset, flip: _flip, context: _context, container, scrollBehavior, shift, }: NgpContextMenuTriggerProps<T>) => {
|
|
283
|
+
declare const ngpContextMenuTrigger: <T>({ disabled: _disabled, menu: _menu, offset: _offset, flip: _flip, context: _context, container: _container, scrollBehavior, shift, }: NgpContextMenuTriggerProps<T>) => {
|
|
273
284
|
open: Signal<boolean>;
|
|
274
|
-
openOrigin:
|
|
285
|
+
openOrigin: WritableSignal<FocusOrigin>;
|
|
286
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
275
287
|
show: (origin?: FocusOrigin) => void;
|
|
276
288
|
hide: (origin?: FocusOrigin) => void;
|
|
289
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
277
290
|
setPointerOverContent: (_isOver: boolean) => void;
|
|
278
291
|
};
|
|
279
292
|
declare const provideContextMenuTriggerState: (opts?: {
|
|
@@ -393,6 +393,11 @@ interface NgpMenuTriggerState<T = unknown> {
|
|
|
393
393
|
* Whether the menu should flip when there is not enough space.
|
|
394
394
|
*/
|
|
395
395
|
readonly flip: WritableSignal<NgpFlip>;
|
|
396
|
+
/**
|
|
397
|
+
* The container in which the menu should be attached.
|
|
398
|
+
* @default document.body
|
|
399
|
+
*/
|
|
400
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
396
401
|
/**
|
|
397
402
|
* The context provided to the menu.
|
|
398
403
|
*/
|
|
@@ -427,6 +432,12 @@ interface NgpMenuTriggerState<T = unknown> {
|
|
|
427
432
|
* @param context - The new context
|
|
428
433
|
*/
|
|
429
434
|
setContext(context: T): void;
|
|
435
|
+
/**
|
|
436
|
+
* Set the container in which the menu should be attached. Takes effect the
|
|
437
|
+
* next time the menu is opened; it does not move a menu that is already open.
|
|
438
|
+
* @param container - The new container
|
|
439
|
+
*/
|
|
440
|
+
setContainer(container: HTMLElement | string | null): void;
|
|
430
441
|
/**
|
|
431
442
|
* Show the menu.
|
|
432
443
|
* @param origin - The focus origin
|
|
@@ -526,10 +537,12 @@ declare const NgpMenuTriggerStateToken: _angular_core.InjectionToken<WritableSig
|
|
|
526
537
|
setPlacement: (newPlacement: NgpMenuPlacement) => void;
|
|
527
538
|
setOffset: (newOffset: NgpOffset) => void;
|
|
528
539
|
setContext: (newContext: unknown) => void;
|
|
540
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
529
541
|
setPointerOverContent: (isOver: boolean) => void;
|
|
530
542
|
flip: WritableSignal<NgpFlip>;
|
|
543
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
531
544
|
}>>;
|
|
532
|
-
declare const ngpMenuTrigger: <T>({ disabled: _disabled, menu: _menu, placement: _placement, offset: _offset, flip: _flip, shift: _shift, context: _context, container, scrollBehavior, cooldown, triggers, showDelay, hideDelay, }: NgpMenuTriggerProps<T>) => {
|
|
545
|
+
declare const ngpMenuTrigger: <T>({ disabled: _disabled, menu: _menu, placement: _placement, offset: _offset, flip: _flip, shift: _shift, context: _context, container: _container, scrollBehavior, cooldown, triggers, showDelay, hideDelay, }: NgpMenuTriggerProps<T>) => {
|
|
533
546
|
menu: WritableSignal<NgpOverlayContent<T> | undefined>;
|
|
534
547
|
placement: WritableSignal<NgpMenuPlacement>;
|
|
535
548
|
offset: WritableSignal<NgpOffset>;
|
|
@@ -546,8 +559,10 @@ declare const ngpMenuTrigger: <T>({ disabled: _disabled, menu: _menu, placement:
|
|
|
546
559
|
setPlacement: (newPlacement: NgpMenuPlacement) => void;
|
|
547
560
|
setOffset: (newOffset: NgpOffset) => void;
|
|
548
561
|
setContext: (newContext: T) => void;
|
|
562
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
549
563
|
setPointerOverContent: (isOver: boolean) => void;
|
|
550
564
|
flip: WritableSignal<NgpFlip>;
|
|
565
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
551
566
|
};
|
|
552
567
|
declare const provideMenuTriggerState: (opts?: {
|
|
553
568
|
inherit?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, Provider, Signal } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Provider, Signal, WritableSignal } from '@angular/core';
|
|
3
3
|
import { Placement } from '@floating-ui/dom';
|
|
4
4
|
import { NgpOrientation } from 'ng-primitives/common';
|
|
5
5
|
import { NgpOffset, NgpFlip, NgpShift, NgpOverlayContent, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal';
|
|
@@ -635,7 +635,7 @@ interface NgpNavigationMenuTriggerState {
|
|
|
635
635
|
/**
|
|
636
636
|
* The container for the content.
|
|
637
637
|
*/
|
|
638
|
-
readonly container:
|
|
638
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
639
639
|
/**
|
|
640
640
|
* Whether the content is currently open.
|
|
641
641
|
*/
|
|
@@ -670,6 +670,13 @@ interface NgpNavigationMenuTriggerState {
|
|
|
670
670
|
* @param id The content ID
|
|
671
671
|
*/
|
|
672
672
|
setContentId(id: string): void;
|
|
673
|
+
/**
|
|
674
|
+
* Set the container in which the content should be attached. Takes effect the
|
|
675
|
+
* next time the content is opened; it does not move content that is already
|
|
676
|
+
* open.
|
|
677
|
+
* @param container The new container
|
|
678
|
+
*/
|
|
679
|
+
setContainer(container: HTMLElement | string | null): void;
|
|
673
680
|
/**
|
|
674
681
|
* Update pointer over content state.
|
|
675
682
|
* @param isOver Whether pointer is over content
|
|
@@ -721,14 +728,14 @@ interface NgpNavigationMenuTriggerProps {
|
|
|
721
728
|
*/
|
|
722
729
|
readonly cooldown?: Signal<number>;
|
|
723
730
|
}
|
|
724
|
-
declare const NgpNavigationMenuTriggerStateToken: _angular_core.InjectionToken<
|
|
731
|
+
declare const NgpNavigationMenuTriggerStateToken: _angular_core.InjectionToken<WritableSignal<{
|
|
725
732
|
content: Signal<NgpOverlayContent<unknown> | undefined>;
|
|
726
733
|
disabled: Signal<boolean>;
|
|
727
734
|
placement: Signal<Placement>;
|
|
728
735
|
offset: Signal<NgpOffset>;
|
|
729
736
|
flip: Signal<NgpFlip>;
|
|
730
737
|
shift: Signal<NgpShift>;
|
|
731
|
-
container:
|
|
738
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
732
739
|
open: Signal<boolean>;
|
|
733
740
|
id: string;
|
|
734
741
|
contentId: Signal<string | undefined>;
|
|
@@ -737,6 +744,7 @@ declare const NgpNavigationMenuTriggerStateToken: _angular_core.InjectionToken<_
|
|
|
737
744
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
738
745
|
focusLastContentItem: (retryCount?: number) => void;
|
|
739
746
|
setContentId: (newId: string) => void;
|
|
747
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
740
748
|
setPointerOverContent: (isOver: boolean) => void;
|
|
741
749
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
742
750
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -748,7 +756,7 @@ declare const ngpNavigationMenuTrigger: ({ content: _content, disabled: _disable
|
|
|
748
756
|
offset: Signal<NgpOffset>;
|
|
749
757
|
flip: Signal<NgpFlip>;
|
|
750
758
|
shift: Signal<NgpShift>;
|
|
751
|
-
container:
|
|
759
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
752
760
|
open: Signal<boolean>;
|
|
753
761
|
id: string;
|
|
754
762
|
contentId: Signal<string | undefined>;
|
|
@@ -757,6 +765,7 @@ declare const ngpNavigationMenuTrigger: ({ content: _content, disabled: _disable
|
|
|
757
765
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
758
766
|
focusLastContentItem: (retryCount?: number) => void;
|
|
759
767
|
setContentId: (newId: string) => void;
|
|
768
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
760
769
|
setPointerOverContent: (isOver: boolean) => void;
|
|
761
770
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
762
771
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -769,7 +778,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
769
778
|
offset: Signal<NgpOffset>;
|
|
770
779
|
flip: Signal<NgpFlip>;
|
|
771
780
|
shift: Signal<NgpShift>;
|
|
772
|
-
container:
|
|
781
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
773
782
|
open: Signal<boolean>;
|
|
774
783
|
id: string;
|
|
775
784
|
contentId: Signal<string | undefined>;
|
|
@@ -778,6 +787,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
778
787
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
779
788
|
focusLastContentItem: (retryCount?: number) => void;
|
|
780
789
|
setContentId: (newId: string) => void;
|
|
790
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
781
791
|
setPointerOverContent: (isOver: boolean) => void;
|
|
782
792
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
783
793
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -789,7 +799,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
789
799
|
offset: Signal<NgpOffset>;
|
|
790
800
|
flip: Signal<NgpFlip>;
|
|
791
801
|
shift: Signal<NgpShift>;
|
|
792
|
-
container:
|
|
802
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
793
803
|
open: Signal<boolean>;
|
|
794
804
|
id: string;
|
|
795
805
|
contentId: Signal<string | undefined>;
|
|
@@ -798,6 +808,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
798
808
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
799
809
|
focusLastContentItem: (retryCount?: number) => void;
|
|
800
810
|
setContentId: (newId: string) => void;
|
|
811
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
801
812
|
setPointerOverContent: (isOver: boolean) => void;
|
|
802
813
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
803
814
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -809,7 +820,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
809
820
|
offset: Signal<NgpOffset>;
|
|
810
821
|
flip: Signal<NgpFlip>;
|
|
811
822
|
shift: Signal<NgpShift>;
|
|
812
|
-
container:
|
|
823
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
813
824
|
open: Signal<boolean>;
|
|
814
825
|
id: string;
|
|
815
826
|
contentId: Signal<string | undefined>;
|
|
@@ -818,6 +829,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
818
829
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
819
830
|
focusLastContentItem: (retryCount?: number) => void;
|
|
820
831
|
setContentId: (newId: string) => void;
|
|
832
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
821
833
|
setPointerOverContent: (isOver: boolean) => void;
|
|
822
834
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
823
835
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -828,7 +840,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
828
840
|
offset: Signal<NgpOffset>;
|
|
829
841
|
flip: Signal<NgpFlip>;
|
|
830
842
|
shift: Signal<NgpShift>;
|
|
831
|
-
container:
|
|
843
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
832
844
|
open: Signal<boolean>;
|
|
833
845
|
id: string;
|
|
834
846
|
contentId: Signal<string | undefined>;
|
|
@@ -837,6 +849,7 @@ declare const injectNavigationMenuTriggerState: {
|
|
|
837
849
|
focusFirstContentItem: (retryCount?: number) => void;
|
|
838
850
|
focusLastContentItem: (retryCount?: number) => void;
|
|
839
851
|
setContentId: (newId: string) => void;
|
|
852
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
840
853
|
setPointerOverContent: (isOver: boolean) => void;
|
|
841
854
|
setFocusInsideContent: (isFocused: boolean) => void;
|
|
842
855
|
registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void;
|
|
@@ -159,7 +159,7 @@ interface NgpPopoverTriggerState<T> {
|
|
|
159
159
|
* Define the container in which the popover should be attached.
|
|
160
160
|
* @default document.body
|
|
161
161
|
*/
|
|
162
|
-
readonly container:
|
|
162
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
163
163
|
/**
|
|
164
164
|
* Define whether the popover should close when clicking outside of it, or a guard function.
|
|
165
165
|
* @default true
|
|
@@ -209,6 +209,13 @@ interface NgpPopoverTriggerState<T> {
|
|
|
209
209
|
readonly open: Signal<boolean>;
|
|
210
210
|
/** @internal onDestroy callback */
|
|
211
211
|
destroy: () => void;
|
|
212
|
+
/**
|
|
213
|
+
* Set the container in which the popover should be attached. Takes effect the
|
|
214
|
+
* next time the popover is opened; it does not move a popover that is already
|
|
215
|
+
* open.
|
|
216
|
+
* @param container - The new container
|
|
217
|
+
*/
|
|
218
|
+
setContainer: (container: HTMLElement | string | null) => void;
|
|
212
219
|
/**
|
|
213
220
|
* Show the popover.
|
|
214
221
|
* @returns A promise that resolves when the popover has been shown
|
|
@@ -308,7 +315,7 @@ interface NgpPopoverTriggerProps<T> {
|
|
|
308
315
|
readonly onOpenChange?: (value: boolean) => void;
|
|
309
316
|
}
|
|
310
317
|
declare const NgpPopoverTriggerStateToken: _angular_core.InjectionToken<WritableSignal<NgpPopoverTriggerState<unknown>>>;
|
|
311
|
-
declare const ngpPopoverTrigger: <T>({ popover: _popover, disabled, placement, offset, showDelay, hideDelay, flip, shift, container, closeOnOutsideClick, closeOnEscape, scrollBehavior, context, anchor, trackPosition, cooldown, onOpenChange, }: NgpPopoverTriggerProps<T>) => NgpPopoverTriggerState<T>;
|
|
318
|
+
declare const ngpPopoverTrigger: <T>({ popover: _popover, disabled, placement, offset, showDelay, hideDelay, flip, shift, container: _container, closeOnOutsideClick, closeOnEscape, scrollBehavior, context, anchor, trackPosition, cooldown, onOpenChange, }: NgpPopoverTriggerProps<T>) => NgpPopoverTriggerState<T>;
|
|
312
319
|
declare const providePopoverTriggerState: (opts?: {
|
|
313
320
|
inherit?: boolean;
|
|
314
321
|
}) => _angular_core.FactoryProvider;
|
|
@@ -229,7 +229,7 @@ interface NgpSelectState<T> {
|
|
|
229
229
|
/** The position of the dropdown. */
|
|
230
230
|
readonly placement: Signal<Placement>;
|
|
231
231
|
/** The container for the dropdown. */
|
|
232
|
-
readonly container:
|
|
232
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
233
233
|
/** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */
|
|
234
234
|
readonly flip: Signal<NgpFlip>;
|
|
235
235
|
/**
|
|
@@ -381,6 +381,13 @@ interface NgpSelectState<T> {
|
|
|
381
381
|
* `setDisabledState` integration.
|
|
382
382
|
*/
|
|
383
383
|
setDisabled(disabled: boolean): void;
|
|
384
|
+
/**
|
|
385
|
+
* Set the container in which the dropdown should be attached. Takes effect the
|
|
386
|
+
* next time the dropdown is opened; it does not move a dropdown that is already
|
|
387
|
+
* open.
|
|
388
|
+
* @param container - The new container
|
|
389
|
+
*/
|
|
390
|
+
setContainer(container: HTMLElement | string | null): void;
|
|
384
391
|
/**
|
|
385
392
|
* Observable that emits whenever the value changes.
|
|
386
393
|
*/
|
|
@@ -427,7 +434,7 @@ interface NgpSelectProps<T> {
|
|
|
427
434
|
readonly allOptions?: Signal<T[] | undefined>;
|
|
428
435
|
}
|
|
429
436
|
declare const NgpSelectStateToken: _angular_core.InjectionToken<WritableSignal<NgpSelectState<unknown>>>;
|
|
430
|
-
declare const ngpSelect: <T>({ id, value: _value, multiple, disabled: _disabled, compareWith, placement, container, flip, offset, scrollToOption, allOptions, onValueChange, onOpenChange, }: NgpSelectProps<T>) => NgpSelectState<T>;
|
|
437
|
+
declare const ngpSelect: <T>({ id, value: _value, multiple, disabled: _disabled, compareWith, placement, container: _container, flip, offset, scrollToOption, allOptions, onValueChange, onOpenChange, }: NgpSelectProps<T>) => NgpSelectState<T>;
|
|
431
438
|
declare const provideSelectState: (opts?: {
|
|
432
439
|
inherit?: boolean;
|
|
433
440
|
}) => _angular_core.FactoryProvider;
|
|
@@ -48,6 +48,7 @@ interface NgpToastOptions$1 {
|
|
|
48
48
|
declare class NgpToast {
|
|
49
49
|
private readonly manager;
|
|
50
50
|
private readonly injector;
|
|
51
|
+
private readonly elementRef;
|
|
51
52
|
protected readonly config: ng_primitives_toast.NgpToastConfig;
|
|
52
53
|
/** @internal */
|
|
53
54
|
readonly options: NgpToastOptions$1;
|
|
@@ -108,9 +109,9 @@ declare class NgpToast {
|
|
|
108
109
|
*/
|
|
109
110
|
private readonly timer;
|
|
110
111
|
constructor();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
private onPointerDown;
|
|
113
|
+
private onPointerMove;
|
|
114
|
+
private onPointerUp;
|
|
114
115
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpToast, never>;
|
|
115
116
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpToast, "[ngpToast]", ["ngpToast"], {}, {}, never, never, true, never>;
|
|
116
117
|
}
|
|
@@ -124,7 +124,7 @@ interface NgpTooltipTriggerState<T> {
|
|
|
124
124
|
/** Access the tooltip template ref. */
|
|
125
125
|
readonly tooltip: WritableSignal<NgpOverlayContent<T> | string | null>;
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.
|
|
128
128
|
* @default false
|
|
129
129
|
*/
|
|
130
130
|
readonly disabled: Signal<boolean>;
|
|
@@ -165,7 +165,7 @@ interface NgpTooltipTriggerState<T> {
|
|
|
165
165
|
* Define the container in which the tooltip should be attached.
|
|
166
166
|
* @default document.body
|
|
167
167
|
*/
|
|
168
|
-
readonly container:
|
|
168
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
169
169
|
/**
|
|
170
170
|
* Define whether the tooltip should only show when the trigger element overflows.
|
|
171
171
|
* @default false
|
|
@@ -253,6 +253,13 @@ interface NgpTooltipTriggerState<T> {
|
|
|
253
253
|
* Set the tooltip id.
|
|
254
254
|
*/
|
|
255
255
|
setTooltipId: (id: string) => void;
|
|
256
|
+
/**
|
|
257
|
+
* Set the container in which the tooltip should be attached. Takes effect the
|
|
258
|
+
* next time the tooltip is shown; it does not move a tooltip that is already
|
|
259
|
+
* visible.
|
|
260
|
+
* @param container - The new container
|
|
261
|
+
*/
|
|
262
|
+
setContainer: (container: HTMLElement | string | null) => void;
|
|
256
263
|
/**
|
|
257
264
|
* Called by tooltip content when pointer enters the tooltip.
|
|
258
265
|
* @internal
|
|
@@ -269,7 +276,7 @@ interface NgpTooltipTriggerProps<T> {
|
|
|
269
276
|
/** Access the tooltip template ref. */
|
|
270
277
|
readonly tooltip?: Signal<NgpOverlayContent<T> | string | null>;
|
|
271
278
|
/**
|
|
272
|
-
*
|
|
279
|
+
* Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.
|
|
273
280
|
* @default false
|
|
274
281
|
*/
|
|
275
282
|
readonly disabled?: Signal<boolean>;
|
|
@@ -370,7 +377,7 @@ declare const NgpTooltipTriggerStateToken: _angular_core.InjectionToken<Writable
|
|
|
370
377
|
hideDelay: Signal<number>;
|
|
371
378
|
flip: Signal<NgpFlip>;
|
|
372
379
|
shift: Signal<NgpShift>;
|
|
373
|
-
container:
|
|
380
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
374
381
|
showOnOverflow: Signal<boolean>;
|
|
375
382
|
anchor: Signal<HTMLElement | null>;
|
|
376
383
|
context: Signal<unknown>;
|
|
@@ -389,11 +396,12 @@ declare const NgpTooltipTriggerStateToken: _angular_core.InjectionToken<Writable
|
|
|
389
396
|
show: () => void;
|
|
390
397
|
hide: () => void;
|
|
391
398
|
setTooltipId: (id: string) => void;
|
|
399
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
392
400
|
onTooltipHoverStart: () => void;
|
|
393
401
|
onTooltipHoverEnd: () => void;
|
|
394
402
|
destroy: () => void;
|
|
395
403
|
}>>;
|
|
396
|
-
declare const ngpTooltipTrigger: <T>({ tooltip: _tooltip, disabled, placement, offset, showDelay, hideDelay, flip, shift, container, showOnOverflow, anchor, context, useTextContent, trackPosition, position, scrollBehavior, cooldown, hoverableContent, }: NgpTooltipTriggerProps<T>) => {
|
|
404
|
+
declare const ngpTooltipTrigger: <T>({ tooltip: _tooltip, disabled, placement, offset, showDelay, hideDelay, flip, shift, container: _container, showOnOverflow, anchor, context, useTextContent, trackPosition, position, scrollBehavior, cooldown, hoverableContent, }: NgpTooltipTriggerProps<T>) => {
|
|
397
405
|
tooltip: WritableSignal<string | NgpOverlayContent<T> | null>;
|
|
398
406
|
disabled: Signal<boolean>;
|
|
399
407
|
placement: Signal<NgpTooltipPlacement>;
|
|
@@ -402,7 +410,7 @@ declare const ngpTooltipTrigger: <T>({ tooltip: _tooltip, disabled, placement, o
|
|
|
402
410
|
hideDelay: Signal<number>;
|
|
403
411
|
flip: Signal<NgpFlip>;
|
|
404
412
|
shift: Signal<NgpShift>;
|
|
405
|
-
container:
|
|
413
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
406
414
|
showOnOverflow: Signal<boolean>;
|
|
407
415
|
anchor: Signal<HTMLElement | null>;
|
|
408
416
|
context: Signal<T | undefined>;
|
|
@@ -421,6 +429,7 @@ declare const ngpTooltipTrigger: <T>({ tooltip: _tooltip, disabled, placement, o
|
|
|
421
429
|
show: () => void;
|
|
422
430
|
hide: () => void;
|
|
423
431
|
setTooltipId: (id: string) => void;
|
|
432
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
424
433
|
onTooltipHoverStart: () => void;
|
|
425
434
|
onTooltipHoverEnd: () => void;
|
|
426
435
|
destroy: () => void;
|
|
@@ -445,7 +454,7 @@ declare class NgpTooltipTrigger<T = null> implements OnDestroy {
|
|
|
445
454
|
*/
|
|
446
455
|
readonly tooltip: _angular_core.InputSignalWithTransform<string | NgpOverlayContent<T> | null, TooltipInput<T>>;
|
|
447
456
|
/**
|
|
448
|
-
*
|
|
457
|
+
* Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.
|
|
449
458
|
* @default false
|
|
450
459
|
*/
|
|
451
460
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
@@ -545,7 +554,7 @@ declare class NgpTooltipTrigger<T = null> implements OnDestroy {
|
|
|
545
554
|
hideDelay: _angular_core.Signal<number>;
|
|
546
555
|
flip: _angular_core.Signal<NgpFlip>;
|
|
547
556
|
shift: _angular_core.Signal<NgpShift>;
|
|
548
|
-
container: _angular_core.
|
|
557
|
+
container: _angular_core.WritableSignal<string | HTMLElement | null>;
|
|
549
558
|
showOnOverflow: _angular_core.Signal<boolean>;
|
|
550
559
|
anchor: _angular_core.Signal<HTMLElement | null>;
|
|
551
560
|
context: _angular_core.Signal<T | undefined>;
|
|
@@ -564,6 +573,7 @@ declare class NgpTooltipTrigger<T = null> implements OnDestroy {
|
|
|
564
573
|
show: () => void;
|
|
565
574
|
hide: () => void;
|
|
566
575
|
setTooltipId: (id: string) => void;
|
|
576
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
567
577
|
onTooltipHoverStart: () => void;
|
|
568
578
|
onTooltipHoverEnd: () => void;
|
|
569
579
|
destroy: () => void;
|