@radix-ng/primitives 0.37.0 → 0.38.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/accordion/index.d.ts +3 -1
- package/accordion/src/accordion-content-presence.directive.d.ts +6 -0
- package/accordion/src/accordion-content.directive.d.ts +4 -7
- package/accordion/src/accordion-header.directive.d.ts +2 -2
- package/accordion/src/accordion-item.directive.d.ts +24 -83
- package/accordion/src/accordion-root.directive.d.ts +33 -87
- package/accordion/src/accordion-trigger.directive.d.ts +5 -11
- package/collapsible/index.d.ts +11 -0
- package/collapsible/src/collapsible-content-presence.directive.d.ts +6 -0
- package/collapsible/src/collapsible-content.directive.d.ts +10 -9
- package/collapsible/src/collapsible-root.directive.d.ts +19 -37
- package/collapsible/src/collapsible-trigger.directive.d.ts +1 -21
- package/core/index.d.ts +5 -0
- package/core/src/accessor/control-value-accessor.d.ts +67 -0
- package/core/src/create-context.d.ts +10 -0
- package/core/src/date-time/comparators.d.ts +7 -1
- package/core/src/date-time/useDateField.d.ts +2 -2
- package/core/src/types.d.ts +24 -0
- package/{stepper/src/utils → core/src}/useArrowNavigation.d.ts +2 -2
- package/core/src/useResizeObserver.d.ts +15 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +196 -408
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +2 -10
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +3 -14
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +138 -143
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +248 -7
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +1 -3
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +1 -8
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +2 -6
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +2 -6
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +34 -1
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +2 -7
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +1 -3
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +75 -33
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +1 -84
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +61 -100
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +4 -19
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +351 -0
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +1 -6
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +1 -3
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/hover-card/src/hover-card-root.directive.d.ts +4 -4
- package/package.json +5 -1
- package/popover/src/popover-root.directive.d.ts +4 -4
- package/presence/index.d.ts +1 -0
- package/presence/src/presence.directive.d.ts +27 -0
- package/select/src/select-trigger.directive.d.ts +8 -2
- package/select/src/select.component.d.ts +23 -6
- package/switch/index.d.ts +0 -1
- package/switch/src/switch-input.directive.d.ts +1 -1
- package/switch/src/switch-root.directive.d.ts +23 -46
- package/switch/src/switch-thumb.directive.d.ts +1 -1
- package/time-field/README.md +1 -0
- package/time-field/index.d.ts +11 -0
- package/time-field/src/time-field-context.token.d.ts +19 -0
- package/time-field/src/time-field-input.directive.d.ts +53 -0
- package/time-field/src/time-field-root.directive.d.ts +125 -0
- package/tooltip/src/tooltip-root.directive.d.ts +4 -4
- package/collapsible/src/collapsible-content.token.d.ts +0 -3
package/accordion/index.d.ts
CHANGED
@@ -4,6 +4,8 @@ import * as i2 from "./src/accordion-header.directive";
|
|
4
4
|
import * as i3 from "./src/accordion-item.directive";
|
5
5
|
import * as i4 from "./src/accordion-root.directive";
|
6
6
|
import * as i5 from "./src/accordion-trigger.directive";
|
7
|
+
import * as i6 from "./src/accordion-content-presence.directive";
|
8
|
+
export * from './src/accordion-content-presence.directive';
|
7
9
|
export * from './src/accordion-content.directive';
|
8
10
|
export * from './src/accordion-header.directive';
|
9
11
|
export * from './src/accordion-item.directive';
|
@@ -11,6 +13,6 @@ export * from './src/accordion-root.directive';
|
|
11
13
|
export * from './src/accordion-trigger.directive';
|
12
14
|
export declare class RdxAccordionModule {
|
13
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionModule, never>;
|
14
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxAccordionModule, never, [typeof i1.RdxAccordionContentDirective, typeof i2.RdxAccordionHeaderDirective, typeof i3.RdxAccordionItemDirective, typeof i4.RdxAccordionRootDirective, typeof i5.RdxAccordionTriggerDirective], [typeof i1.RdxAccordionContentDirective, typeof i2.RdxAccordionHeaderDirective, typeof i3.RdxAccordionItemDirective, typeof i4.RdxAccordionRootDirective, typeof i5.RdxAccordionTriggerDirective]>;
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxAccordionModule, never, [typeof i1.RdxAccordionContentDirective, typeof i2.RdxAccordionHeaderDirective, typeof i3.RdxAccordionItemDirective, typeof i4.RdxAccordionRootDirective, typeof i5.RdxAccordionTriggerDirective, typeof i6.RdxAccordionContentPresenceDirective], [typeof i1.RdxAccordionContentDirective, typeof i2.RdxAccordionHeaderDirective, typeof i3.RdxAccordionItemDirective, typeof i4.RdxAccordionRootDirective, typeof i5.RdxAccordionTriggerDirective, typeof i6.RdxAccordionContentPresenceDirective]>;
|
15
17
|
static ɵinj: i0.ɵɵInjectorDeclaration<RdxAccordionModule>;
|
16
18
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/collapsible";
|
3
|
+
export declare class RdxAccordionContentPresenceDirective {
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionContentPresenceDirective, never>;
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionContentPresenceDirective, "ng-template[rdxAccordionContentPresence]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxCollapsibleContentPresenceDirective; inputs: {}; outputs: {}; }]>;
|
6
|
+
}
|
@@ -1,11 +1,8 @@
|
|
1
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
2
1
|
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/collapsible";
|
3
3
|
export declare class RdxAccordionContentDirective {
|
4
|
-
protected readonly
|
5
|
-
protected readonly
|
6
|
-
protected hidden: boolean;
|
7
|
-
protected onAnimationEnd(): void;
|
8
|
-
onToggle(): void;
|
4
|
+
protected readonly rootContext: import("./accordion-root.directive").AccordionRootContext;
|
5
|
+
protected readonly itemContext: import("./accordion-item.directive").AccordionItemContext;
|
9
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionContentDirective, never>;
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionContentDirective, "[rdxAccordionContent]",
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionContentDirective, "[rdxAccordionContent]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxCollapsibleContentDirective; inputs: {}; outputs: {}; }]>;
|
11
8
|
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
2
1
|
import * as i0 from "@angular/core";
|
3
2
|
export declare class RdxAccordionHeaderDirective {
|
4
|
-
protected readonly
|
3
|
+
protected readonly rootContext: import("./accordion-root.directive").AccordionRootContext;
|
4
|
+
protected readonly itemContext: import("./accordion-item.directive").AccordionItemContext;
|
5
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionHeaderDirective, never>;
|
6
6
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionHeaderDirective, "[rdxAccordionHeader]", never, {}, {}, never, never, true, never>;
|
7
7
|
}
|
@@ -1,91 +1,32 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
|
4
|
-
import { RdxAccordionContentDirective } from './accordion-content.directive';
|
5
|
-
import { RdxAccordionOrientation } from './accordion-root.directive';
|
6
|
-
import { RdxAccordionTriggerDirective } from './accordion-trigger.directive';
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { ElementRef, Signal } from '@angular/core';
|
7
3
|
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@radix-ng/primitives/collapsible";
|
8
5
|
export type RdxAccordionItemState = 'open' | 'closed';
|
6
|
+
export type AccordionItemContext = {
|
7
|
+
open: Signal<boolean>;
|
8
|
+
disabled: Signal<boolean>;
|
9
|
+
triggerId: string;
|
10
|
+
dataState: Signal<RdxAccordionItemState>;
|
11
|
+
dataDisabled: Signal<boolean>;
|
12
|
+
currentElement: ElementRef<HTMLElement>;
|
13
|
+
value: Signal<string | undefined>;
|
14
|
+
};
|
15
|
+
export declare const injectAccordionItemContext: (optional?: boolean) => AccordionItemContext | null, provideAccordionItemContext: (useFactory: () => AccordionItemContext) => import("@angular/core").Provider;
|
9
16
|
/**
|
10
17
|
* @group Components
|
11
18
|
*/
|
12
|
-
export declare class RdxAccordionItemDirective
|
13
|
-
|
14
|
-
|
15
|
-
protected readonly
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
* @ignore
|
22
|
-
*/
|
23
|
-
content: RdxAccordionContentDirective;
|
24
|
-
get dataState(): RdxAccordionItemState;
|
25
|
-
/**
|
26
|
-
* The unique AccordionItem id.
|
27
|
-
* @ignore
|
28
|
-
*/
|
29
|
-
readonly id: string;
|
30
|
-
get orientation(): RdxAccordionOrientation;
|
31
|
-
/**
|
32
|
-
* @defaultValue false
|
33
|
-
* @group Props
|
34
|
-
*/
|
35
|
-
set expanded(expanded: boolean);
|
36
|
-
get expanded(): boolean;
|
37
|
-
private _expanded;
|
38
|
-
/**
|
39
|
-
* Accordion value.
|
40
|
-
*
|
41
|
-
* @group Props
|
42
|
-
*/
|
43
|
-
set value(value: string);
|
44
|
-
get value(): string;
|
45
|
-
private _value?;
|
46
|
-
/**
|
47
|
-
* Whether the AccordionItem is disabled.
|
48
|
-
*
|
49
|
-
* @defaultValue false
|
50
|
-
* @group Props
|
51
|
-
*/
|
52
|
-
set disabled(value: boolean);
|
53
|
-
get disabled(): boolean;
|
54
|
-
private _disabled;
|
55
|
-
/**
|
56
|
-
* Event emitted every time the AccordionItem is closed.
|
57
|
-
*/
|
58
|
-
readonly closed: EventEmitter<void>;
|
59
|
-
/** Event emitted every time the AccordionItem is opened. */
|
60
|
-
readonly opened: EventEmitter<void>;
|
61
|
-
/**
|
62
|
-
* Event emitted when the AccordionItem is destroyed.
|
63
|
-
* @ignore
|
64
|
-
*/
|
65
|
-
readonly destroyed: EventEmitter<void>;
|
66
|
-
/**
|
67
|
-
* Emits whenever the expanded state of the accordion changes.
|
68
|
-
* Primarily used to facilitate two-way binding.
|
69
|
-
* @group Emits
|
70
|
-
*/
|
71
|
-
readonly expandedChange: EventEmitter<boolean>;
|
72
|
-
/** Unregister function for expansionDispatcher. */
|
73
|
-
private removeUniqueSelectionListener;
|
74
|
-
/** Subscription to openAll/closeAll events. */
|
75
|
-
private openCloseAllSubscription;
|
19
|
+
export declare class RdxAccordionItemDirective {
|
20
|
+
readonly elementRef: ElementRef<HTMLElement>;
|
21
|
+
private readonly collapsibleContext;
|
22
|
+
protected readonly rootContext: import("./accordion-root.directive").AccordionRootContext;
|
23
|
+
readonly value: import("@angular/core").InputSignal<string | undefined>;
|
24
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
25
|
+
readonly isDisabled: Signal<boolean>;
|
26
|
+
readonly open: Signal<boolean>;
|
27
|
+
readonly dataState: Signal<RdxAccordionItemState>;
|
76
28
|
constructor();
|
77
|
-
|
78
|
-
ngOnDestroy(): void;
|
79
|
-
focus(): void;
|
80
|
-
/** Toggles the expanded state of the accordion item. */
|
81
|
-
toggle(): void;
|
82
|
-
/** Sets the expanded state of the accordion item to false. */
|
83
|
-
close(): void;
|
84
|
-
/** Sets the expanded state of the accordion item to true. */
|
85
|
-
open(): void;
|
86
|
-
private subscribeToOpenCloseAllActions;
|
29
|
+
handleArrowKey(event: KeyboardEvent): void;
|
87
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionItemDirective, never>;
|
88
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "
|
89
|
-
static ngAcceptInputType_expanded: unknown;
|
90
|
-
static ngAcceptInputType_disabled: unknown;
|
31
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxCollapsibleRootDirective; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
91
32
|
}
|
@@ -1,112 +1,58 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { Subject } from 'rxjs';
|
6
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
1
|
+
import { Direction } from '@angular/cdk/bidi';
|
2
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
3
|
+
import { ElementRef, InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';
|
4
|
+
import { DataOrientation } from '@radix-ng/primitives/core';
|
7
5
|
import * as i0 from "@angular/core";
|
8
|
-
export type
|
9
|
-
|
10
|
-
|
6
|
+
export type AccordionRootContext = {
|
7
|
+
disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
8
|
+
direction: InputSignal<Direction>;
|
9
|
+
orientation: InputSignal<DataOrientation>;
|
10
|
+
value: ModelSignal<string | string[] | undefined>;
|
11
|
+
collapsible: Signal<boolean>;
|
12
|
+
isSingle: Signal<boolean>;
|
13
|
+
elementRef: ElementRef<HTMLElement>;
|
14
|
+
changeModelValue: (value: string, isOpen: boolean) => void;
|
15
|
+
isItemOpen: (value: string) => boolean;
|
16
|
+
};
|
17
|
+
export declare const injectAccordionRootContext: (optional?: boolean) => AccordionRootContext | null, provideAccordionRootContext: (useFactory: () => AccordionRootContext) => import("@angular/core").Provider;
|
11
18
|
/**
|
12
19
|
* @group Components
|
13
20
|
*/
|
14
|
-
export declare class RdxAccordionRootDirective
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
protected readonly selectionDispatcher: UniqueSelectionDispatcher;
|
19
|
-
/**
|
20
|
-
* @ignore
|
21
|
-
*/
|
22
|
-
protected readonly dir: Directionality | null;
|
23
|
-
/**
|
24
|
-
* @ignore
|
25
|
-
*/
|
26
|
-
protected keyManager: FocusKeyManager<RdxAccordionItemDirective>;
|
27
|
-
/**
|
28
|
-
* @ignore
|
29
|
-
*/
|
30
|
-
readonly id: string;
|
31
|
-
/**
|
32
|
-
* @ignore
|
33
|
-
*/
|
34
|
-
readonly openCloseAllActions: Subject<boolean>;
|
35
|
-
get isMultiple(): boolean;
|
21
|
+
export declare class RdxAccordionRootDirective {
|
22
|
+
readonly elementRef: ElementRef<HTMLElement>;
|
23
|
+
readonly id: InputSignal<string>;
|
24
|
+
readonly dir: InputSignal<Direction>;
|
36
25
|
/** Whether the Accordion is disabled.
|
37
26
|
* @defaultValue false
|
38
27
|
* @group Props
|
39
28
|
*/
|
40
|
-
disabled: boolean
|
29
|
+
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
41
30
|
/**
|
42
31
|
* The orientation of the accordion.
|
43
32
|
*
|
44
33
|
* @defaultValue 'vertical'
|
45
34
|
* @group Props
|
46
35
|
*/
|
47
|
-
orientation:
|
48
|
-
|
49
|
-
* @private
|
50
|
-
* @ignore
|
51
|
-
*/
|
52
|
-
items: QueryList<RdxAccordionItemDirective>;
|
53
|
-
/**
|
54
|
-
* The value of the item to expand when initially rendered and type is "single".
|
55
|
-
* Use when you do not need to control the state of the items.
|
56
|
-
* @group Props
|
57
|
-
*/
|
58
|
-
set defaultValue(value: string[] | string);
|
59
|
-
get defaultValue(): string[] | string;
|
60
|
-
/**
|
61
|
-
* Determines whether one or multiple items can be opened at the same time.
|
62
|
-
* @group Props
|
63
|
-
* @defaultValue 'single'
|
64
|
-
*/
|
65
|
-
type: RdxAccordionType;
|
66
|
-
/**
|
67
|
-
* @ignore
|
68
|
-
*/
|
69
|
-
collapsible: boolean;
|
36
|
+
readonly orientation: InputSignal<DataOrientation>;
|
37
|
+
readonly defaultValue: InputSignal<string | string[] | undefined>;
|
70
38
|
/**
|
71
39
|
* The controlled value of the item to expand.
|
72
40
|
*
|
73
41
|
* @group Props
|
74
42
|
*/
|
75
|
-
|
76
|
-
|
43
|
+
readonly value: ModelSignal<string | string[] | undefined>;
|
44
|
+
readonly collapsible: InputSignalWithTransform<boolean, BooleanInput>;
|
45
|
+
readonly type: InputSignal<"multiple" | "single">;
|
77
46
|
/**
|
78
47
|
* Event handler called when the expanded state of an item changes and type is "multiple".
|
79
48
|
* @group Emits
|
80
49
|
*/
|
81
|
-
readonly onValueChange:
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
*/
|
88
|
-
ngAfterContentInit(): void;
|
89
|
-
/**
|
90
|
-
* @ignore
|
91
|
-
*/
|
92
|
-
ngOnDestroy(): void;
|
93
|
-
/**
|
94
|
-
* @ignore
|
95
|
-
*/
|
96
|
-
handleKeydown(event: KeyboardEvent): void;
|
97
|
-
/** Opens all enabled accordion items in an accordion where multi is enabled.
|
98
|
-
* @ignore
|
99
|
-
*/
|
100
|
-
openAll(): void;
|
101
|
-
/** Closes all enabled accordion items.
|
102
|
-
* @ignore
|
103
|
-
*/
|
104
|
-
closeAll(): void;
|
105
|
-
/**
|
106
|
-
* @ignore
|
107
|
-
*/
|
108
|
-
setActiveItem(item: RdxAccordionItemDirective): void;
|
50
|
+
readonly onValueChange: import("@angular/core").OutputEmitterRef<void>;
|
51
|
+
readonly isCollapsible: Signal<boolean>;
|
52
|
+
readonly isSingle: Signal<boolean>;
|
53
|
+
constructor();
|
54
|
+
changeModelValue: (value: string, isOpen: boolean) => void;
|
55
|
+
isItemOpen: (value: string) => boolean;
|
109
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionRootDirective, never>;
|
110
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]",
|
111
|
-
static ngAcceptInputType_disabled: unknown;
|
57
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]", ["rdxAccordionRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
112
58
|
}
|
@@ -1,15 +1,9 @@
|
|
1
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
2
|
-
import { RdxAccordionRootDirective } from './accordion-root.directive';
|
3
1
|
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/collapsible";
|
4
3
|
export declare class RdxAccordionTriggerDirective {
|
5
|
-
protected readonly
|
6
|
-
protected readonly
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Fires when trigger clicked
|
10
|
-
*/
|
11
|
-
onClick(): void;
|
12
|
-
focus(): void;
|
4
|
+
protected readonly rootContext: import("./accordion-root.directive").AccordionRootContext;
|
5
|
+
protected readonly itemContext: import("./accordion-item.directive").AccordionItemContext;
|
6
|
+
constructor();
|
13
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionTriggerDirective, never>;
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionTriggerDirective, "[rdxAccordionTrigger]", never, {}, {}, never, never, true,
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionTriggerDirective, "[rdxAccordionTrigger]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxCollapsibleTriggerDirective; inputs: {}; outputs: {}; }]>;
|
15
9
|
}
|
package/collapsible/index.d.ts
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "./src/collapsible-content.directive";
|
3
|
+
import * as i2 from "./src/collapsible-root.directive";
|
4
|
+
import * as i3 from "./src/collapsible-trigger.directive";
|
5
|
+
import * as i4 from "./src/collapsible-content-presence.directive";
|
6
|
+
export * from './src/collapsible-content-presence.directive';
|
1
7
|
export * from './src/collapsible-content.directive';
|
2
8
|
export * from './src/collapsible-root.directive';
|
3
9
|
export * from './src/collapsible-trigger.directive';
|
10
|
+
export declare class RdxCollapsibleModule {
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleModule, never>;
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxCollapsibleModule, never, [typeof i1.RdxCollapsibleContentDirective, typeof i2.RdxCollapsibleRootDirective, typeof i3.RdxCollapsibleTriggerDirective, typeof i4.RdxCollapsibleContentPresenceDirective], [typeof i1.RdxCollapsibleContentDirective, typeof i2.RdxCollapsibleRootDirective, typeof i3.RdxCollapsibleTriggerDirective, typeof i4.RdxCollapsibleContentPresenceDirective]>;
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RdxCollapsibleModule>;
|
14
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/presence";
|
3
|
+
export declare class RdxCollapsibleContentPresenceDirective {
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleContentPresenceDirective, never>;
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleContentPresenceDirective, "ng-template[rdxCollapsibleContentPresence]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxPresenceDirective; inputs: {}; outputs: {}; }]>;
|
6
|
+
}
|
@@ -1,14 +1,15 @@
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
2
|
-
import { RdxCollapsibleRootDirective } from './collapsible-root.directive';
|
3
1
|
import * as i0 from "@angular/core";
|
4
2
|
export declare class RdxCollapsibleContentDirective {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
readonly
|
11
|
-
|
3
|
+
private readonly elementRef;
|
4
|
+
protected readonly rootContext: import("./collapsible-root.directive").CollapsibleRootContext;
|
5
|
+
readonly isOpen: import("@angular/core").Signal<boolean>;
|
6
|
+
readonly height: import("@angular/core").WritableSignal<number>;
|
7
|
+
readonly width: import("@angular/core").WritableSignal<number>;
|
8
|
+
readonly isMountAnimationPrevented: import("@angular/core").WritableSignal<boolean>;
|
9
|
+
private originalStyles;
|
10
|
+
protected readonly hiddenSignal: import("@angular/core").WritableSignal<boolean>;
|
11
|
+
constructor();
|
12
|
+
onAnimationEnd(): void;
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleContentDirective, never>;
|
13
14
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleContentDirective, "[rdxCollapsibleContent]", never, {}, {}, never, never, true, never>;
|
14
15
|
}
|
@@ -1,22 +1,18 @@
|
|
1
1
|
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { InputSignal, ModelSignal, Signal } from '@angular/core';
|
2
3
|
import * as i0 from "@angular/core";
|
3
|
-
export declare function injectCollapsible(): RdxCollapsibleRootDirective;
|
4
4
|
export type RdxCollapsibleState = 'open' | 'closed';
|
5
|
+
export interface CollapsibleRootContext {
|
6
|
+
contentId: InputSignal<string>;
|
7
|
+
open: ModelSignal<boolean>;
|
8
|
+
toggle: () => void;
|
9
|
+
disabled: Signal<boolean>;
|
10
|
+
}
|
11
|
+
export declare const injectCollapsibleRootContext: (optional?: boolean) => CollapsibleRootContext | null, provideCollapsibleRootContext: (useFactory: () => CollapsibleRootContext) => import("@angular/core").Provider;
|
5
12
|
/**
|
6
13
|
* @group Components
|
7
14
|
*/
|
8
15
|
export declare class RdxCollapsibleRootDirective {
|
9
|
-
/**
|
10
|
-
* Reference to RdxCollapsibleContent directive
|
11
|
-
*/
|
12
|
-
private readonly contentDirective;
|
13
|
-
/**
|
14
|
-
* Determines whether a directive is available for interaction.
|
15
|
-
* When true, prevents the user from interacting with the collapsible.
|
16
|
-
*
|
17
|
-
* @group Props
|
18
|
-
*/
|
19
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
20
16
|
/**
|
21
17
|
* The controlled open state of the collapsible.
|
22
18
|
* Sets the state of the directive. `true` - expanded, `false` - collapsed
|
@@ -24,12 +20,18 @@ export declare class RdxCollapsibleRootDirective {
|
|
24
20
|
* @group Props
|
25
21
|
* @defaultValue false
|
26
22
|
*/
|
27
|
-
|
28
|
-
|
23
|
+
readonly open: ModelSignal<boolean>;
|
24
|
+
readonly contentId: InputSignal<string>;
|
29
25
|
/**
|
30
|
-
*
|
26
|
+
* Determines whether a directive is available for interaction.
|
27
|
+
* When true, prevents the user from interacting with the collapsible.
|
28
|
+
*
|
29
|
+
* @group Props
|
31
30
|
*/
|
32
|
-
|
31
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
32
|
+
readonly _disabled: import("@angular/core").WritableSignal<boolean>;
|
33
|
+
readonly isDisabled: Signal<boolean>;
|
34
|
+
readonly isOpen: Signal<boolean>;
|
33
35
|
/**
|
34
36
|
* Emitted with new value when directive state changed.
|
35
37
|
* Event handler called when the open state of the collapsible changes.
|
@@ -37,26 +39,6 @@ export declare class RdxCollapsibleRootDirective {
|
|
37
39
|
* @group Emits
|
38
40
|
*/
|
39
41
|
readonly onOpenChange: import("@angular/core").OutputEmitterRef<boolean>;
|
40
|
-
/**
|
41
|
-
* Allows to change directive state
|
42
|
-
* @param {boolean | undefined} value
|
43
|
-
* @ignore
|
44
|
-
*/
|
45
|
-
setOpen(value?: boolean): void;
|
46
|
-
/**
|
47
|
-
* Returns directive state (open | closed)
|
48
|
-
* @ignore
|
49
|
-
*/
|
50
|
-
getState(): RdxCollapsibleState;
|
51
|
-
/**
|
52
|
-
* Returns current directive state
|
53
|
-
* @ignore
|
54
|
-
*/
|
55
|
-
isOpen(): boolean;
|
56
|
-
/**
|
57
|
-
* Controls visibility of content
|
58
|
-
*/
|
59
|
-
private setPresence;
|
60
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleRootDirective, never>;
|
61
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleRootDirective, "[rdxCollapsibleRoot]", ["
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleRootDirective, "[rdxCollapsibleRoot]", ["rdxCollapsibleRoot"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "contentId": { "alias": "contentId"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "onOpenChange": "onOpenChange"; }, never, never, true, never>;
|
62
44
|
}
|
@@ -1,26 +1,6 @@
|
|
1
|
-
import { RdxCollapsibleState } from './collapsible-root.directive';
|
2
1
|
import * as i0 from "@angular/core";
|
3
2
|
export declare class RdxCollapsibleTriggerDirective {
|
4
|
-
|
5
|
-
* Reference to CollapsibleRoot
|
6
|
-
* @private
|
7
|
-
* @ignore
|
8
|
-
*/
|
9
|
-
private readonly collapsible;
|
10
|
-
/**
|
11
|
-
* Called on trigger clicked
|
12
|
-
*/
|
13
|
-
onOpenToggle(): void;
|
14
|
-
/**
|
15
|
-
* Returns current directive state (open | closed)
|
16
|
-
* @ignore
|
17
|
-
*/
|
18
|
-
getState(): RdxCollapsibleState;
|
19
|
-
/**
|
20
|
-
* Returns current trigger state
|
21
|
-
* @ignore
|
22
|
-
*/
|
23
|
-
getDisabled(): string | undefined;
|
3
|
+
protected readonly rootContext: import("./collapsible-root.directive").CollapsibleRootContext;
|
24
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleTriggerDirective, never>;
|
25
5
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleTriggerDirective, "[rdxCollapsibleTrigger]", never, {}, {}, never, never, true, never>;
|
26
6
|
}
|
package/core/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './src/accessor/control-value-accessor';
|
1
2
|
export * from './src/accessor/provide-value-accessor';
|
2
3
|
export * from './src/auto-focus.directive';
|
3
4
|
export * from './src/clamp';
|
@@ -13,8 +14,12 @@ export * from './src/is-number';
|
|
13
14
|
export * from './src/kbd-constants';
|
14
15
|
export * from './src/provide-token';
|
15
16
|
export * from './src/window';
|
17
|
+
export * from './src/create-context';
|
16
18
|
export * from './src/date-time';
|
17
19
|
export * from './src/positioning/constants';
|
18
20
|
export * from './src/positioning/types';
|
19
21
|
export * from './src/positioning/utils';
|
22
|
+
export * from './src/types';
|
23
|
+
export * from './src/useArrowNavigation';
|
24
|
+
export * from './src/useResizeObserver';
|
20
25
|
export * from './src/watch';
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
/**
|
5
|
+
* A reusable ControlValueAccessor implementation for form controls
|
6
|
+
* @template T The type of the control's value
|
7
|
+
*/
|
8
|
+
export declare class RdxControlValueAccessor<T> implements ControlValueAccessor {
|
9
|
+
/**
|
10
|
+
* Input for the control's value with alias 'value'
|
11
|
+
* @default undefined
|
12
|
+
*/
|
13
|
+
readonly valueInput: import("@angular/core").InputSignal<T | undefined>;
|
14
|
+
/**
|
15
|
+
* Input for the disabled state with alias 'disabled'
|
16
|
+
* Uses booleanAttribute transform to convert string attributes to booleans
|
17
|
+
* @default false
|
18
|
+
*/
|
19
|
+
readonly disabledInput: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
20
|
+
readonly valueChange: import("@angular/core").OutputEmitterRef<T>;
|
21
|
+
private readonly _value;
|
22
|
+
/**
|
23
|
+
* Readonly access to the current value
|
24
|
+
*/
|
25
|
+
readonly value: import("@angular/core").Signal<T | undefined>;
|
26
|
+
private readonly _disabled;
|
27
|
+
/**
|
28
|
+
* Readonly access to the disabled state
|
29
|
+
*/
|
30
|
+
readonly disabled: import("@angular/core").Signal<boolean>;
|
31
|
+
private onChange?;
|
32
|
+
private onTouched?;
|
33
|
+
/**
|
34
|
+
* Writes a new value to the control (ControlValueAccessor interface)
|
35
|
+
* @param value The new value for the control
|
36
|
+
*/
|
37
|
+
writeValue(value: T | undefined): void;
|
38
|
+
/**
|
39
|
+
* Registers a callback for when the control value changes (ControlValueAccessor interface)
|
40
|
+
* @param fn The callback function
|
41
|
+
*/
|
42
|
+
registerOnChange(fn: (value: T | undefined) => void): void;
|
43
|
+
/**
|
44
|
+
* Registers a callback for when the control is touched (ControlValueAccessor interface)
|
45
|
+
* @param fn The callback function
|
46
|
+
*/
|
47
|
+
registerOnTouched(fn: () => void): void;
|
48
|
+
/**
|
49
|
+
* Sets the disabled state of the control (ControlValueAccessor interface)
|
50
|
+
* @param isDisabled Whether the control should be disabled
|
51
|
+
*/
|
52
|
+
setDisabledState(isDisabled: boolean): void;
|
53
|
+
/**
|
54
|
+
* Updates the control's value and triggers change detection
|
55
|
+
* @param value The new value
|
56
|
+
*/
|
57
|
+
setValue(value: T): void;
|
58
|
+
markAsTouched(): void;
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxControlValueAccessor<any>, never>;
|
60
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxControlValueAccessor<any>, never, ["rdxControlValueAccessor"], { "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Provides a type-safe way to inject the RdxControlValueAccessor
|
64
|
+
* @template T The type of the control's value
|
65
|
+
* @returns An instance of RdxControlValueAccessor<T>
|
66
|
+
*/
|
67
|
+
export declare function injectControlValueAccessor<T>(): RdxControlValueAccessor<T>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Provider } from '@angular/core';
|
2
|
+
/**
|
3
|
+
* Creates a context with injector and provider functions for a given type
|
4
|
+
* @template T The type of the context value
|
5
|
+
* @param description Descriptive string for the context (used in token creation)
|
6
|
+
* @returns A tuple containing:
|
7
|
+
* - injectContext: Function to retrieve the context value
|
8
|
+
* - provideContext: Function to create a provider for the context
|
9
|
+
*/
|
10
|
+
export declare function createContext<T>(description: string): readonly [injectContext: (optional?: boolean) => T | null, provideContext: (useFactory: () => T) => Provider];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CalendarDateTime, type DateValue, ZonedDateTime } from '@internationalized/date';
|
1
|
+
import { CalendarDateTime, type DateValue, Time, ZonedDateTime } from '@internationalized/date';
|
2
2
|
import type { DateMatcher } from './types';
|
3
3
|
/**
|
4
4
|
* Given a `DateValue` object, convert it to a native `Date` object.
|
@@ -70,6 +70,7 @@ export declare function isBetween(date: DateValue, start: DateValue, end: DateVa
|
|
70
70
|
export declare function getLastFirstDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
|
71
71
|
export declare function getNextLastDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
|
72
72
|
export declare function areAllDaysBetweenValid(start: DateValue, end: DateValue, isUnavailable: DateMatcher | undefined, isDisabled: DateMatcher | undefined): boolean;
|
73
|
+
export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
73
74
|
export type Granularity = 'day' | 'hour' | 'minute' | 'second';
|
74
75
|
export type TimeGranularity = 'hour' | 'minute' | 'second';
|
75
76
|
type GetDefaultDateProps = {
|
@@ -89,4 +90,9 @@ type GetDefaultDateProps = {
|
|
89
90
|
*
|
90
91
|
*/
|
91
92
|
export declare function getDefaultDate(props: GetDefaultDateProps): DateValue;
|
93
|
+
type GetDefaultTimeProps = {
|
94
|
+
defaultValue?: TimeValue | undefined;
|
95
|
+
defaultPlaceholder?: TimeValue | undefined;
|
96
|
+
};
|
97
|
+
export declare function getDefaultTime(props: GetDefaultTimeProps): TimeValue;
|
92
98
|
export {};
|
@@ -5,14 +5,14 @@ import { HourCycle, SegmentPart, SegmentValueObj } from './types';
|
|
5
5
|
export type UseDateFieldProps = {
|
6
6
|
hasLeftFocus: WritableSignal<boolean>;
|
7
7
|
lastKeyZero: WritableSignal<boolean>;
|
8
|
-
placeholder: ModelSignal<DateValue>;
|
8
|
+
placeholder: ModelSignal<DateValue> | WritableSignal<DateValue>;
|
9
9
|
hourCycle: HourCycle;
|
10
10
|
formatter: Formatter;
|
11
11
|
segmentValues: WritableSignal<SegmentValueObj>;
|
12
12
|
disabled: InputSignal<boolean>;
|
13
13
|
readonly: InputSignal<boolean>;
|
14
14
|
part: SegmentPart;
|
15
|
-
modelValue: ModelSignal<DateValue | undefined>;
|
15
|
+
modelValue: ModelSignal<DateValue | undefined> | WritableSignal<DateValue | undefined>;
|
16
16
|
focusNext: () => void;
|
17
17
|
};
|
18
18
|
type SegmentAttrProps = {
|