@proyecto-viviana/solid-stately 0.1.5 → 0.2.1
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/{src → dist}/autocomplete/createAutocompleteState.d.ts +0 -1
- package/{src → dist}/autocomplete/index.d.ts +0 -1
- package/{src → dist}/calendar/createCalendarState.d.ts +0 -1
- package/{src → dist}/calendar/createDateFieldState.d.ts +0 -1
- package/{src → dist}/calendar/createRangeCalendarState.d.ts +0 -1
- package/{src → dist}/calendar/createTimeFieldState.d.ts +0 -1
- package/{src → dist}/calendar/index.d.ts +0 -1
- package/{src → dist}/checkbox/createCheckboxGroupState.d.ts +0 -1
- package/{src → dist}/checkbox/index.d.ts +0 -1
- package/{src → dist}/collections/ListCollection.d.ts +0 -1
- package/{src → dist}/collections/createListState.d.ts +0 -1
- package/{src → dist}/collections/createMenuState.d.ts +0 -1
- package/{src → dist}/collections/createSelectionState.d.ts +0 -1
- package/{src → dist}/collections/index.d.ts +0 -1
- package/{src → dist}/collections/types.d.ts +0 -1
- package/{src → dist}/color/Color.d.ts +0 -1
- package/{src → dist}/color/createColorAreaState.d.ts +0 -1
- package/{src → dist}/color/createColorFieldState.d.ts +0 -1
- package/{src → dist}/color/createColorSliderState.d.ts +0 -1
- package/{src → dist}/color/createColorWheelState.d.ts +0 -1
- package/{src → dist}/color/index.d.ts +0 -1
- package/{src → dist}/color/types.d.ts +0 -1
- package/{src → dist}/combobox/createComboBoxState.d.ts +0 -1
- package/{src → dist}/combobox/index.d.ts +0 -1
- package/{src → dist}/disclosure/createDisclosureState.d.ts +0 -1
- package/{src → dist}/disclosure/index.d.ts +0 -1
- package/{src → dist}/dnd/createDragState.d.ts +0 -1
- package/{src → dist}/dnd/createDraggableCollectionState.d.ts +0 -1
- package/{src → dist}/dnd/createDropState.d.ts +0 -1
- package/{src → dist}/dnd/createDroppableCollectionState.d.ts +0 -1
- package/{src → dist}/dnd/index.d.ts +0 -1
- package/{src → dist}/dnd/types.d.ts +0 -1
- package/{src → dist}/form/createFormValidationState.d.ts +0 -1
- package/{src → dist}/form/index.d.ts +0 -1
- package/{src → dist}/grid/createGridState.d.ts +0 -1
- package/{src → dist}/grid/index.d.ts +0 -1
- package/{src → dist}/grid/types.d.ts +0 -1
- package/dist/index.d.ts +25 -3363
- package/dist/index.js +2 -2
- package/dist/index.js.map +7 -1
- package/{src → dist}/numberfield/createNumberFieldState.d.ts +0 -1
- package/{src → dist}/numberfield/index.d.ts +0 -1
- package/{src → dist}/overlays/createOverlayTriggerState.d.ts +0 -1
- package/{src → dist}/overlays/index.d.ts +0 -1
- package/{src → dist}/radio/createRadioGroupState.d.ts +0 -1
- package/{src → dist}/radio/index.d.ts +0 -1
- package/{src → dist}/searchfield/createSearchFieldState.d.ts +0 -1
- package/{src → dist}/searchfield/index.d.ts +0 -1
- package/{src → dist}/select/createSelectState.d.ts +0 -1
- package/{src → dist}/select/index.d.ts +0 -1
- package/{src → dist}/slider/createSliderState.d.ts +0 -1
- package/{src → dist}/slider/index.d.ts +0 -1
- package/{src → dist}/ssr/index.d.ts +0 -1
- package/{src → dist}/table/TableCollection.d.ts +0 -1
- package/{src → dist}/table/createTableState.d.ts +0 -1
- package/{src → dist}/table/index.d.ts +0 -1
- package/{src → dist}/table/types.d.ts +0 -1
- package/{src → dist}/tabs/createTabListState.d.ts +0 -1
- package/{src → dist}/tabs/index.d.ts +0 -1
- package/{src → dist}/textfield/createTextFieldState.d.ts +0 -1
- package/{src → dist}/textfield/index.d.ts +0 -1
- package/{src → dist}/toast/createToastState.d.ts +0 -1
- package/{src → dist}/toast/index.d.ts +0 -1
- package/{src → dist}/toggle/createToggleState.d.ts +0 -1
- package/{src → dist}/toggle/index.d.ts +0 -1
- package/{src → dist}/tooltip/createTooltipTriggerState.d.ts +0 -1
- package/{src → dist}/tooltip/index.d.ts +0 -1
- package/{src → dist}/tree/TreeCollection.d.ts +0 -1
- package/{src → dist}/tree/createTreeState.d.ts +0 -1
- package/{src → dist}/tree/index.d.ts +0 -1
- package/{src → dist}/tree/types.d.ts +0 -1
- package/{src → dist}/utils/reactivity.d.ts +0 -1
- package/package.json +5 -7
- package/src/autocomplete/createAutocompleteState.d.ts.map +0 -1
- package/src/autocomplete/createAutocompleteState.ts +0 -90
- package/src/autocomplete/index.d.ts.map +0 -1
- package/src/autocomplete/index.ts +0 -5
- package/src/calendar/createCalendarState.d.ts.map +0 -1
- package/src/calendar/createCalendarState.ts +0 -461
- package/src/calendar/createDateFieldState.d.ts.map +0 -1
- package/src/calendar/createDateFieldState.ts +0 -562
- package/src/calendar/createRangeCalendarState.d.ts.map +0 -1
- package/src/calendar/createRangeCalendarState.ts +0 -535
- package/src/calendar/createTimeFieldState.d.ts.map +0 -1
- package/src/calendar/createTimeFieldState.ts +0 -483
- package/src/calendar/index.d.ts.map +0 -1
- package/src/calendar/index.ts +0 -81
- package/src/checkbox/createCheckboxGroupState.d.ts.map +0 -1
- package/src/checkbox/createCheckboxGroupState.ts +0 -193
- package/src/checkbox/index.d.ts.map +0 -1
- package/src/checkbox/index.ts +0 -5
- package/src/collections/ListCollection.d.ts.map +0 -1
- package/src/collections/ListCollection.ts +0 -146
- package/src/collections/createListState.d.ts.map +0 -1
- package/src/collections/createListState.ts +0 -264
- package/src/collections/createMenuState.d.ts.map +0 -1
- package/src/collections/createMenuState.ts +0 -106
- package/src/collections/createSelectionState.d.ts.map +0 -1
- package/src/collections/createSelectionState.ts +0 -336
- package/src/collections/index.d.ts.map +0 -1
- package/src/collections/index.ts +0 -46
- package/src/collections/types.d.ts.map +0 -1
- package/src/collections/types.ts +0 -169
- package/src/color/Color.d.ts.map +0 -1
- package/src/color/Color.ts +0 -951
- package/src/color/createColorAreaState.d.ts.map +0 -1
- package/src/color/createColorAreaState.ts +0 -293
- package/src/color/createColorFieldState.d.ts.map +0 -1
- package/src/color/createColorFieldState.ts +0 -292
- package/src/color/createColorSliderState.d.ts.map +0 -1
- package/src/color/createColorSliderState.ts +0 -241
- package/src/color/createColorWheelState.d.ts.map +0 -1
- package/src/color/createColorWheelState.ts +0 -211
- package/src/color/index.d.ts.map +0 -1
- package/src/color/index.ts +0 -47
- package/src/color/types.d.ts.map +0 -1
- package/src/color/types.ts +0 -127
- package/src/combobox/createComboBoxState.d.ts.map +0 -1
- package/src/combobox/createComboBoxState.ts +0 -703
- package/src/combobox/index.d.ts.map +0 -1
- package/src/combobox/index.ts +0 -13
- package/src/disclosure/createDisclosureState.d.ts.map +0 -1
- package/src/disclosure/createDisclosureState.ts +0 -193
- package/src/disclosure/index.d.ts.map +0 -1
- package/src/disclosure/index.ts +0 -9
- package/src/dnd/createDragState.d.ts.map +0 -1
- package/src/dnd/createDragState.ts +0 -153
- package/src/dnd/createDraggableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDraggableCollectionState.ts +0 -165
- package/src/dnd/createDropState.d.ts.map +0 -1
- package/src/dnd/createDropState.ts +0 -212
- package/src/dnd/createDroppableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDroppableCollectionState.ts +0 -357
- package/src/dnd/index.d.ts.map +0 -1
- package/src/dnd/index.ts +0 -76
- package/src/dnd/types.d.ts.map +0 -1
- package/src/dnd/types.ts +0 -317
- package/src/form/createFormValidationState.d.ts.map +0 -1
- package/src/form/createFormValidationState.ts +0 -389
- package/src/form/index.d.ts.map +0 -1
- package/src/form/index.ts +0 -15
- package/src/grid/createGridState.d.ts.map +0 -1
- package/src/grid/createGridState.ts +0 -327
- package/src/grid/index.d.ts.map +0 -1
- package/src/grid/index.ts +0 -13
- package/src/grid/types.d.ts.map +0 -1
- package/src/grid/types.ts +0 -179
- package/src/index.d.ts +0 -26
- package/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -383
- package/src/numberfield/createNumberFieldState.d.ts.map +0 -1
- package/src/numberfield/createNumberFieldState.ts +0 -383
- package/src/numberfield/index.d.ts.map +0 -1
- package/src/numberfield/index.ts +0 -5
- package/src/overlays/createOverlayTriggerState.d.ts.map +0 -1
- package/src/overlays/createOverlayTriggerState.ts +0 -67
- package/src/overlays/index.d.ts.map +0 -1
- package/src/overlays/index.ts +0 -5
- package/src/radio/createRadioGroupState.d.ts.map +0 -1
- package/src/radio/createRadioGroupState.ts +0 -201
- package/src/radio/index.d.ts.map +0 -1
- package/src/radio/index.ts +0 -6
- package/src/searchfield/createSearchFieldState.d.ts.map +0 -1
- package/src/searchfield/createSearchFieldState.ts +0 -62
- package/src/searchfield/index.d.ts.map +0 -1
- package/src/searchfield/index.ts +0 -5
- package/src/select/createSelectState.d.ts.map +0 -1
- package/src/select/createSelectState.ts +0 -181
- package/src/select/index.d.ts.map +0 -1
- package/src/select/index.ts +0 -5
- package/src/slider/createSliderState.d.ts.map +0 -1
- package/src/slider/createSliderState.ts +0 -211
- package/src/slider/index.d.ts.map +0 -1
- package/src/slider/index.ts +0 -6
- package/src/ssr/index.d.ts.map +0 -1
- package/src/ssr/index.ts +0 -41
- package/src/table/TableCollection.d.ts.map +0 -1
- package/src/table/TableCollection.ts +0 -388
- package/src/table/createTableState.d.ts.map +0 -1
- package/src/table/createTableState.ts +0 -127
- package/src/table/index.d.ts.map +0 -1
- package/src/table/index.ts +0 -18
- package/src/table/types.d.ts.map +0 -1
- package/src/table/types.ts +0 -150
- package/src/tabs/createTabListState.d.ts.map +0 -1
- package/src/tabs/createTabListState.ts +0 -240
- package/src/tabs/index.d.ts.map +0 -1
- package/src/tabs/index.ts +0 -7
- package/src/textfield/createTextFieldState.d.ts.map +0 -1
- package/src/textfield/createTextFieldState.ts +0 -75
- package/src/textfield/index.d.ts.map +0 -1
- package/src/textfield/index.ts +0 -5
- package/src/toast/createToastState.d.ts.map +0 -1
- package/src/toast/createToastState.ts +0 -316
- package/src/toast/index.d.ts.map +0 -1
- package/src/toast/index.ts +0 -11
- package/src/toggle/createToggleState.d.ts.map +0 -1
- package/src/toggle/createToggleState.ts +0 -94
- package/src/toggle/index.d.ts.map +0 -1
- package/src/toggle/index.ts +0 -5
- package/src/tooltip/createTooltipTriggerState.d.ts.map +0 -1
- package/src/tooltip/createTooltipTriggerState.ts +0 -183
- package/src/tooltip/index.d.ts.map +0 -1
- package/src/tooltip/index.ts +0 -6
- package/src/tree/TreeCollection.d.ts.map +0 -1
- package/src/tree/TreeCollection.ts +0 -175
- package/src/tree/createTreeState.d.ts.map +0 -1
- package/src/tree/createTreeState.ts +0 -392
- package/src/tree/index.d.ts.map +0 -1
- package/src/tree/index.ts +0 -13
- package/src/tree/types.d.ts.map +0 -1
- package/src/tree/types.ts +0 -174
- package/src/utils/index.d.ts +0 -2
- package/src/utils/index.d.ts.map +0 -1
- package/src/utils/reactivity.d.ts.map +0 -1
- package/src/utils/reactivity.ts +0 -36
- /package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,3363 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* A value that may be undefined or an accessor that returns the value or undefined.
|
|
27
|
-
*/
|
|
28
|
-
type MaybeAccessorValue<T> = T | undefined | Accessor<T | undefined>;
|
|
29
|
-
/**
|
|
30
|
-
* Checks if a value is an accessor function.
|
|
31
|
-
*/
|
|
32
|
-
declare function isAccessor<T>(value: MaybeAccessor<T>): value is Accessor<T>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Toggle state for Solid Stately
|
|
36
|
-
*
|
|
37
|
-
* Provides state management for toggle components like checkboxes and switches.
|
|
38
|
-
*
|
|
39
|
-
* This is a 1:1 port of @react-stately/toggle's useToggleState.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
interface ToggleStateOptions {
|
|
43
|
-
/** Whether the element should be selected (controlled). */
|
|
44
|
-
isSelected?: boolean;
|
|
45
|
-
/** Whether the element should be selected by default (uncontrolled). */
|
|
46
|
-
defaultSelected?: boolean;
|
|
47
|
-
/** Handler that is called when the element's selection state changes. */
|
|
48
|
-
onChange?: (isSelected: boolean) => void;
|
|
49
|
-
/** Whether the element is read only. */
|
|
50
|
-
isReadOnly?: boolean;
|
|
51
|
-
}
|
|
52
|
-
interface ToggleState {
|
|
53
|
-
/** Whether the toggle is selected. */
|
|
54
|
-
readonly isSelected: Accessor<boolean>;
|
|
55
|
-
/** Whether the toggle is selected by default. */
|
|
56
|
-
readonly defaultSelected: boolean;
|
|
57
|
-
/** Updates selection state. */
|
|
58
|
-
setSelected(isSelected: boolean): void;
|
|
59
|
-
/** Toggle the selection state. */
|
|
60
|
-
toggle(): void;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Provides state management for toggle components like checkboxes and switches.
|
|
64
|
-
*/
|
|
65
|
-
declare function createToggleState(props?: MaybeAccessor<ToggleStateOptions>): ToggleState;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* createAutocompleteState - State management for autocomplete components
|
|
69
|
-
*
|
|
70
|
-
* Based on @react-stately/autocomplete useAutocompleteState.
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
interface AutocompleteState {
|
|
74
|
-
/** The current value of the autocomplete input. */
|
|
75
|
-
inputValue: Accessor<string>;
|
|
76
|
-
/** Sets the value of the autocomplete input. */
|
|
77
|
-
setInputValue(value: string): void;
|
|
78
|
-
/** The id of the current aria-activedescendant of the autocomplete input. */
|
|
79
|
-
focusedNodeId: Accessor<string | null>;
|
|
80
|
-
/** Sets the id of the current aria-activedescendant of the autocomplete input. */
|
|
81
|
-
setFocusedNodeId(value: string | null): void;
|
|
82
|
-
}
|
|
83
|
-
interface AutocompleteStateOptions {
|
|
84
|
-
/** The value of the autocomplete input (controlled). */
|
|
85
|
-
inputValue?: string;
|
|
86
|
-
/** The default value of the autocomplete input (uncontrolled). */
|
|
87
|
-
defaultInputValue?: string;
|
|
88
|
-
/** Handler that is called when the autocomplete input value changes. */
|
|
89
|
-
onInputChange?: (value: string) => void;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Provides state management for an autocomplete component.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```tsx
|
|
96
|
-
* const state = createAutocompleteState({
|
|
97
|
-
* defaultInputValue: '',
|
|
98
|
-
* onInputChange: (value) => console.log('Input changed:', value),
|
|
99
|
-
* });
|
|
100
|
-
*
|
|
101
|
-
* // Access current input value
|
|
102
|
-
* console.log(state.inputValue());
|
|
103
|
-
*
|
|
104
|
-
* // Update input value
|
|
105
|
-
* state.setInputValue('new value');
|
|
106
|
-
*
|
|
107
|
-
* // Track focused node for aria-activedescendant
|
|
108
|
-
* state.setFocusedNodeId('item-1');
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
declare function createAutocompleteState(props?: AutocompleteStateOptions): AutocompleteState;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* TextField state for Solid Stately
|
|
115
|
-
*
|
|
116
|
-
* Provides state management for text input components.
|
|
117
|
-
*
|
|
118
|
-
* This is a port of @react-stately/utils's useControlledState pattern
|
|
119
|
-
* as used by @react-aria/textfield.
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
interface TextFieldStateOptions {
|
|
123
|
-
/** The current value (controlled). */
|
|
124
|
-
value?: string;
|
|
125
|
-
/** The default value (uncontrolled). */
|
|
126
|
-
defaultValue?: string;
|
|
127
|
-
/** Handler that is called when the value changes. */
|
|
128
|
-
onChange?: (value: string) => void;
|
|
129
|
-
}
|
|
130
|
-
interface TextFieldState {
|
|
131
|
-
/** The current value of the text field. */
|
|
132
|
-
readonly value: Accessor<string>;
|
|
133
|
-
/** Sets the value of the text field. */
|
|
134
|
-
setValue(value: string): void;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Provides state management for text input components.
|
|
138
|
-
* Supports both controlled and uncontrolled modes.
|
|
139
|
-
*/
|
|
140
|
-
declare function createTextFieldState(props?: MaybeAccessor<TextFieldStateOptions>): TextFieldState;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Checkbox group state for Solid Stately
|
|
144
|
-
*
|
|
145
|
-
* Provides state management for a checkbox group component.
|
|
146
|
-
* Provides a name for the group, and manages selection and focus state.
|
|
147
|
-
*
|
|
148
|
-
* This is a 1:1 port of @react-stately/checkbox's useCheckboxGroupState.
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
interface CheckboxGroupProps {
|
|
152
|
-
/** The current selected values (controlled). */
|
|
153
|
-
value?: string[];
|
|
154
|
-
/** The default selected values (uncontrolled). */
|
|
155
|
-
defaultValue?: string[];
|
|
156
|
-
/** Handler that is called when the value changes. */
|
|
157
|
-
onChange?: (value: string[]) => void;
|
|
158
|
-
/** Whether the checkbox group is disabled. */
|
|
159
|
-
isDisabled?: boolean;
|
|
160
|
-
/** Whether the checkbox group is read only. */
|
|
161
|
-
isReadOnly?: boolean;
|
|
162
|
-
/** Whether the checkbox group is required. */
|
|
163
|
-
isRequired?: boolean;
|
|
164
|
-
/** Whether the checkbox group is invalid. */
|
|
165
|
-
isInvalid?: boolean;
|
|
166
|
-
/** The name of the checkbox group, used when submitting an HTML form. */
|
|
167
|
-
name?: string;
|
|
168
|
-
/** The form to associate the checkbox group with. */
|
|
169
|
-
form?: string;
|
|
170
|
-
/** The label for the checkbox group. */
|
|
171
|
-
label?: string;
|
|
172
|
-
/** Handler that is called when the checkbox group receives focus. */
|
|
173
|
-
onFocus?: (e: FocusEvent) => void;
|
|
174
|
-
/** Handler that is called when the checkbox group loses focus. */
|
|
175
|
-
onBlur?: (e: FocusEvent) => void;
|
|
176
|
-
/** Handler that is called when the checkbox group's focus status changes. */
|
|
177
|
-
onFocusChange?: (isFocused: boolean) => void;
|
|
178
|
-
}
|
|
179
|
-
interface CheckboxGroupState {
|
|
180
|
-
/** Current selected values. */
|
|
181
|
-
readonly value: Accessor<readonly string[]>;
|
|
182
|
-
/** Default selected values. */
|
|
183
|
-
readonly defaultValue: readonly string[];
|
|
184
|
-
/** Whether the checkbox group is disabled. */
|
|
185
|
-
readonly isDisabled: boolean;
|
|
186
|
-
/** Whether the checkbox group is read only. */
|
|
187
|
-
readonly isReadOnly: boolean;
|
|
188
|
-
/** Whether the checkbox group is invalid. */
|
|
189
|
-
readonly isInvalid: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Whether the checkboxes in the group are required.
|
|
192
|
-
* This changes to false once at least one item is selected.
|
|
193
|
-
*/
|
|
194
|
-
readonly isRequired: Accessor<boolean>;
|
|
195
|
-
/** Returns whether the given value is selected. */
|
|
196
|
-
isSelected(value: string): boolean;
|
|
197
|
-
/** Sets the selected values. */
|
|
198
|
-
setValue(value: string[]): void;
|
|
199
|
-
/** Adds a value to the set of selected values. */
|
|
200
|
-
addValue(value: string): void;
|
|
201
|
-
/** Removes a value from the set of selected values. */
|
|
202
|
-
removeValue(value: string): void;
|
|
203
|
-
/** Toggles a value in the set of selected values. */
|
|
204
|
-
toggleValue(value: string): void;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Provides state management for a checkbox group component.
|
|
208
|
-
* Provides a name for the group, and manages selection and focus state.
|
|
209
|
-
*/
|
|
210
|
-
declare function createCheckboxGroupState(props?: MaybeAccessor<CheckboxGroupProps>): CheckboxGroupState;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Radio group state for Solid Stately
|
|
214
|
-
*
|
|
215
|
-
* Provides state management for a radio group component.
|
|
216
|
-
* Provides a name for the group, and manages selection and focus state.
|
|
217
|
-
*
|
|
218
|
-
* This is a 1:1 port of @react-stately/radio's useRadioGroupState.
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
interface RadioGroupProps {
|
|
222
|
-
/** The current selected value (controlled). */
|
|
223
|
-
value?: string | null;
|
|
224
|
-
/** The default selected value (uncontrolled). */
|
|
225
|
-
defaultValue?: string | null;
|
|
226
|
-
/** Handler that is called when the value changes. */
|
|
227
|
-
onChange?: (value: string) => void;
|
|
228
|
-
/** Whether the radio group is disabled. */
|
|
229
|
-
isDisabled?: boolean;
|
|
230
|
-
/** Whether the radio group is read only. */
|
|
231
|
-
isReadOnly?: boolean;
|
|
232
|
-
/** Whether the radio group is required. */
|
|
233
|
-
isRequired?: boolean;
|
|
234
|
-
/** Whether the radio group is invalid. */
|
|
235
|
-
isInvalid?: boolean;
|
|
236
|
-
/** The name of the radio group, used when submitting an HTML form. */
|
|
237
|
-
name?: string;
|
|
238
|
-
/** The form to associate the radio group with. */
|
|
239
|
-
form?: string;
|
|
240
|
-
/** The label for the radio group. */
|
|
241
|
-
label?: string;
|
|
242
|
-
/** Orientation of the radio group. */
|
|
243
|
-
orientation?: 'horizontal' | 'vertical';
|
|
244
|
-
/** Handler that is called when the radio group receives focus. */
|
|
245
|
-
onFocus?: (e: FocusEvent) => void;
|
|
246
|
-
/** Handler that is called when the radio group loses focus. */
|
|
247
|
-
onBlur?: (e: FocusEvent) => void;
|
|
248
|
-
/** Handler that is called when the radio group's focus status changes. */
|
|
249
|
-
onFocusChange?: (isFocused: boolean) => void;
|
|
250
|
-
}
|
|
251
|
-
interface RadioGroupState {
|
|
252
|
-
/** The name for the group, used for native form submission. */
|
|
253
|
-
readonly name: string;
|
|
254
|
-
/** Whether the radio group is disabled. */
|
|
255
|
-
readonly isDisabled: boolean;
|
|
256
|
-
/** Whether the radio group is read only. */
|
|
257
|
-
readonly isReadOnly: boolean;
|
|
258
|
-
/** Whether the radio group is required. */
|
|
259
|
-
readonly isRequired: boolean;
|
|
260
|
-
/** Whether the radio group is invalid. */
|
|
261
|
-
readonly isInvalid: boolean;
|
|
262
|
-
/** The currently selected value. */
|
|
263
|
-
readonly selectedValue: Accessor<string | null>;
|
|
264
|
-
/** The default selected value. */
|
|
265
|
-
readonly defaultSelectedValue: string | null;
|
|
266
|
-
/** Sets the selected value. */
|
|
267
|
-
setSelectedValue(value: string | null): void;
|
|
268
|
-
/** The value of the last focused radio. */
|
|
269
|
-
readonly lastFocusedValue: Accessor<string | null>;
|
|
270
|
-
/** Sets the last focused value. */
|
|
271
|
-
setLastFocusedValue(value: string | null): void;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Internal WeakMap to store sync version accessors for each radio group state.
|
|
275
|
-
* This is used by createRadio to trigger DOM sync when native radio behavior
|
|
276
|
-
* causes the DOM checked state to desync from our reactive state.
|
|
277
|
-
*
|
|
278
|
-
* This is kept separate from RadioGroupState to maintain API parity with React-Stately.
|
|
279
|
-
* @internal
|
|
280
|
-
*/
|
|
281
|
-
declare const radioGroupSyncVersion: WeakMap<RadioGroupState, Accessor<number>>;
|
|
282
|
-
/**
|
|
283
|
-
* Provides state management for a radio group component.
|
|
284
|
-
* Provides a name for the group, and manages selection and focus state.
|
|
285
|
-
*/
|
|
286
|
-
declare function createRadioGroupState(props?: MaybeAccessor<RadioGroupProps>): RadioGroupState;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Manages state for an overlay trigger.
|
|
290
|
-
* Based on @react-stately/overlays useOverlayTriggerState.
|
|
291
|
-
*/
|
|
292
|
-
|
|
293
|
-
interface OverlayTriggerProps {
|
|
294
|
-
/** Whether the overlay is open by default (uncontrolled). */
|
|
295
|
-
defaultOpen?: boolean;
|
|
296
|
-
/** Whether the overlay is open (controlled). */
|
|
297
|
-
isOpen?: boolean;
|
|
298
|
-
/** Handler that is called when the overlay's open state changes. */
|
|
299
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
300
|
-
}
|
|
301
|
-
interface OverlayTriggerState {
|
|
302
|
-
/** Whether the overlay is currently open. */
|
|
303
|
-
readonly isOpen: Accessor<boolean>;
|
|
304
|
-
/** Sets whether the overlay is open. */
|
|
305
|
-
setOpen(isOpen: boolean): void;
|
|
306
|
-
/** Opens the overlay. */
|
|
307
|
-
open(): void;
|
|
308
|
-
/** Closes the overlay. */
|
|
309
|
-
close(): void;
|
|
310
|
-
/** Toggles the overlay's visibility. */
|
|
311
|
-
toggle(): void;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Manages state for an overlay trigger. Tracks whether the overlay is open, and provides
|
|
315
|
-
* methods to toggle this state.
|
|
316
|
-
*/
|
|
317
|
-
declare function createOverlayTriggerState(props?: MaybeAccessor<OverlayTriggerProps>): OverlayTriggerState;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Core types for collection state management.
|
|
321
|
-
* Simplified from @react-stately/collections for SolidJS.
|
|
322
|
-
*/
|
|
323
|
-
|
|
324
|
-
/** A unique identifier for an item in a collection. */
|
|
325
|
-
type Key$1 = string | number;
|
|
326
|
-
/** The type of selection allowed in a collection. */
|
|
327
|
-
type SelectionMode = 'none' | 'single' | 'multiple';
|
|
328
|
-
/** How selection behaves when clicking on items. */
|
|
329
|
-
type SelectionBehavior = 'toggle' | 'replace';
|
|
330
|
-
/** Represents the current selection state. */
|
|
331
|
-
type Selection = 'all' | Set<Key$1>;
|
|
332
|
-
/** Strategy for focusing first or last item. */
|
|
333
|
-
type FocusStrategy = 'first' | 'last';
|
|
334
|
-
/** Whether disabled keys affect selection, actions, or both. */
|
|
335
|
-
type DisabledBehavior = 'selection' | 'all';
|
|
336
|
-
/**
|
|
337
|
-
* Represents a node in a collection (item or section).
|
|
338
|
-
*/
|
|
339
|
-
interface CollectionNode<T = unknown> {
|
|
340
|
-
/** The type of node: 'item' or 'section'. */
|
|
341
|
-
type: 'item' | 'section';
|
|
342
|
-
/** A unique key for the node. */
|
|
343
|
-
key: Key$1;
|
|
344
|
-
/** The original value/data for this node. */
|
|
345
|
-
value: T | null;
|
|
346
|
-
/** The text content for accessibility and typeahead. */
|
|
347
|
-
textValue: string;
|
|
348
|
-
/** The rendered content (JSX). */
|
|
349
|
-
rendered: JSX.Element;
|
|
350
|
-
/** The level of nesting (0 for top-level). */
|
|
351
|
-
level: number;
|
|
352
|
-
/** The index within the parent. */
|
|
353
|
-
index: number;
|
|
354
|
-
/** The key of the parent node, if any. */
|
|
355
|
-
parentKey: Key$1 | null;
|
|
356
|
-
/** Whether this node has child nodes. */
|
|
357
|
-
hasChildNodes: boolean;
|
|
358
|
-
/** Child nodes, if any. */
|
|
359
|
-
childNodes: CollectionNode<T>[];
|
|
360
|
-
/** Whether this item is disabled. */
|
|
361
|
-
isDisabled?: boolean;
|
|
362
|
-
/** ARIA label for this node. */
|
|
363
|
-
'aria-label'?: string;
|
|
364
|
-
/** Additional props for the node. */
|
|
365
|
-
props?: Record<string, unknown>;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* A collection of nodes with methods to traverse and query.
|
|
369
|
-
*/
|
|
370
|
-
interface Collection<T = unknown> extends Iterable<CollectionNode<T>> {
|
|
371
|
-
/** The number of items in the collection. */
|
|
372
|
-
readonly size: number;
|
|
373
|
-
/** Get all keys in the collection. */
|
|
374
|
-
getKeys(): Iterable<Key$1>;
|
|
375
|
-
/** Get a node by its key. */
|
|
376
|
-
getItem(key: Key$1): CollectionNode<T> | null;
|
|
377
|
-
/** Get a node by index. */
|
|
378
|
-
at(index: number): CollectionNode<T> | null;
|
|
379
|
-
/** Get the key before the given key. */
|
|
380
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
381
|
-
/** Get the key after the given key. */
|
|
382
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
383
|
-
/** Get the first key in the collection. */
|
|
384
|
-
getFirstKey(): Key$1 | null;
|
|
385
|
-
/** Get the last key in the collection. */
|
|
386
|
-
getLastKey(): Key$1 | null;
|
|
387
|
-
/** Get the children of a node. */
|
|
388
|
-
getChildren(key: Key$1): Iterable<CollectionNode<T>>;
|
|
389
|
-
/** Get the text value for a key. */
|
|
390
|
-
getTextValue(key: Key$1): string;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Props for items in a collection.
|
|
394
|
-
*/
|
|
395
|
-
interface ItemProps<T = unknown> {
|
|
396
|
-
/** Unique key for the item. Required if items is used for dynamic collections. */
|
|
397
|
-
key?: Key$1;
|
|
398
|
-
/** The text value for accessibility and typeahead. If not provided, derived from children. */
|
|
399
|
-
textValue?: string;
|
|
400
|
-
/** Whether the item is disabled. */
|
|
401
|
-
isDisabled?: boolean;
|
|
402
|
-
/** The rendered content of the item. */
|
|
403
|
-
children?: JSX.Element;
|
|
404
|
-
/** ARIA label for the item. */
|
|
405
|
-
'aria-label'?: string;
|
|
406
|
-
/** The original value for dynamic collections. */
|
|
407
|
-
value?: T;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Props for sections in a collection.
|
|
411
|
-
*/
|
|
412
|
-
interface SectionProps<T = unknown> {
|
|
413
|
-
/** Unique key for the section. */
|
|
414
|
-
key?: Key$1;
|
|
415
|
-
/** The section header/title. */
|
|
416
|
-
title?: JSX.Element;
|
|
417
|
-
/** ARIA label for the section. */
|
|
418
|
-
'aria-label'?: string;
|
|
419
|
-
/** The items in this section. */
|
|
420
|
-
children?: JSX.Element;
|
|
421
|
-
/** Items for dynamic rendering. */
|
|
422
|
-
items?: Iterable<T>;
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Base props for components that use collections.
|
|
426
|
-
*/
|
|
427
|
-
interface CollectionBase<T = unknown> {
|
|
428
|
-
/** The items in the collection (for dynamic rendering). */
|
|
429
|
-
items?: Iterable<T>;
|
|
430
|
-
/** The children (static items or render function). */
|
|
431
|
-
children?: JSX.Element | ((item: T) => JSX.Element);
|
|
432
|
-
/** Keys of disabled items. */
|
|
433
|
-
disabledKeys?: Iterable<Key$1>;
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Props for single selection.
|
|
437
|
-
*/
|
|
438
|
-
interface SingleSelection {
|
|
439
|
-
/** Whether empty selection is allowed. */
|
|
440
|
-
disallowEmptySelection?: boolean;
|
|
441
|
-
/** The currently selected key (controlled). */
|
|
442
|
-
selectedKey?: Key$1 | null;
|
|
443
|
-
/** The default selected key (uncontrolled). */
|
|
444
|
-
defaultSelectedKey?: Key$1;
|
|
445
|
-
/** Handler called when selection changes. */
|
|
446
|
-
onSelectionChange?: (key: Key$1 | null) => void;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Props for multiple selection.
|
|
450
|
-
*/
|
|
451
|
-
interface MultipleSelection {
|
|
452
|
-
/** The selection mode. */
|
|
453
|
-
selectionMode?: SelectionMode;
|
|
454
|
-
/** Whether empty selection is allowed. */
|
|
455
|
-
disallowEmptySelection?: boolean;
|
|
456
|
-
/** The currently selected keys (controlled). */
|
|
457
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
458
|
-
/** The default selected keys (uncontrolled). */
|
|
459
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
460
|
-
/** Handler called when selection changes. */
|
|
461
|
-
onSelectionChange?: (keys: Selection) => void;
|
|
462
|
-
/** Keys of disabled items. */
|
|
463
|
-
disabledKeys?: Iterable<Key$1>;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* A simple list collection implementation.
|
|
468
|
-
* Provides a Collection interface over an array of nodes.
|
|
469
|
-
*/
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* A basic implementation of Collection for list-based components.
|
|
473
|
-
*/
|
|
474
|
-
declare class ListCollection<T = unknown> implements Collection<T> {
|
|
475
|
-
private nodes;
|
|
476
|
-
private keyMap;
|
|
477
|
-
constructor(nodes: CollectionNode<T>[]);
|
|
478
|
-
get size(): number;
|
|
479
|
-
[Symbol.iterator](): Iterator<CollectionNode<T>>;
|
|
480
|
-
getKeys(): Iterable<Key$1>;
|
|
481
|
-
getItem(key: Key$1): CollectionNode<T> | null;
|
|
482
|
-
at(index: number): CollectionNode<T> | null;
|
|
483
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
484
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
485
|
-
getFirstKey(): Key$1 | null;
|
|
486
|
-
getLastKey(): Key$1 | null;
|
|
487
|
-
getChildren(key: Key$1): Iterable<CollectionNode<T>>;
|
|
488
|
-
getTextValue(key: Key$1): string;
|
|
489
|
-
/**
|
|
490
|
-
* Get all items (excluding sections, including items within sections).
|
|
491
|
-
*/
|
|
492
|
-
private getAllItems;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Create a collection from an array of items.
|
|
496
|
-
*/
|
|
497
|
-
declare function createListCollection<T>(items: T[], options?: {
|
|
498
|
-
getKey?: (item: T, index: number) => Key$1;
|
|
499
|
-
getTextValue?: (item: T) => string;
|
|
500
|
-
getDisabled?: (item: T) => boolean;
|
|
501
|
-
}): ListCollection<T>;
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Selection state management for collections.
|
|
505
|
-
* Based on @react-stately/selection.
|
|
506
|
-
*/
|
|
507
|
-
|
|
508
|
-
interface SelectionStateProps {
|
|
509
|
-
/** The selection mode. */
|
|
510
|
-
selectionMode?: SelectionMode;
|
|
511
|
-
/** How selection behaves on interaction. */
|
|
512
|
-
selectionBehavior?: SelectionBehavior;
|
|
513
|
-
/** Whether empty selection is disallowed. */
|
|
514
|
-
disallowEmptySelection?: boolean;
|
|
515
|
-
/** Currently selected keys (controlled). */
|
|
516
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
517
|
-
/** Default selected keys (uncontrolled). */
|
|
518
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
519
|
-
/** Handler for selection changes. */
|
|
520
|
-
onSelectionChange?: (keys: Selection) => void;
|
|
521
|
-
/** Keys of disabled items. */
|
|
522
|
-
disabledKeys?: Iterable<Key$1>;
|
|
523
|
-
/** How disabled keys behave. */
|
|
524
|
-
disabledBehavior?: DisabledBehavior;
|
|
525
|
-
/** Whether to allow duplicate selection events. */
|
|
526
|
-
allowDuplicateSelectionEvents?: boolean;
|
|
527
|
-
}
|
|
528
|
-
interface SelectionState {
|
|
529
|
-
/** The selection mode. */
|
|
530
|
-
readonly selectionMode: Accessor<SelectionMode>;
|
|
531
|
-
/** The selection behavior. */
|
|
532
|
-
readonly selectionBehavior: Accessor<SelectionBehavior>;
|
|
533
|
-
/** Whether empty selection is disallowed. */
|
|
534
|
-
readonly disallowEmptySelection: Accessor<boolean>;
|
|
535
|
-
/** The currently selected keys. */
|
|
536
|
-
readonly selectedKeys: Accessor<Selection>;
|
|
537
|
-
/** Set of disabled keys. */
|
|
538
|
-
readonly disabledKeys: Accessor<Set<Key$1>>;
|
|
539
|
-
/** How disabled keys behave. */
|
|
540
|
-
readonly disabledBehavior: Accessor<DisabledBehavior>;
|
|
541
|
-
/** Whether the selection is empty. */
|
|
542
|
-
readonly isEmpty: Accessor<boolean>;
|
|
543
|
-
/** Whether all items are selected. */
|
|
544
|
-
readonly isSelectAll: Accessor<boolean>;
|
|
545
|
-
/** Check if a key is selected. */
|
|
546
|
-
isSelected(key: Key$1): boolean;
|
|
547
|
-
/** Check if a key is disabled. */
|
|
548
|
-
isDisabled(key: Key$1): boolean;
|
|
549
|
-
/** Set the selection behavior. */
|
|
550
|
-
setSelectionBehavior(behavior: SelectionBehavior): void;
|
|
551
|
-
/** Toggle selection for a key. */
|
|
552
|
-
toggleSelection(key: Key$1): void;
|
|
553
|
-
/** Replace selection with a single key. */
|
|
554
|
-
replaceSelection(key: Key$1): void;
|
|
555
|
-
/** Set multiple selected keys. */
|
|
556
|
-
setSelectedKeys(keys: Iterable<Key$1>): void;
|
|
557
|
-
/** Select all items. */
|
|
558
|
-
selectAll(): void;
|
|
559
|
-
/** Clear all selection. */
|
|
560
|
-
clearSelection(): void;
|
|
561
|
-
/** Toggle between select all and clear. */
|
|
562
|
-
toggleSelectAll(): void;
|
|
563
|
-
/** Extend selection to a key (for shift-click). */
|
|
564
|
-
extendSelection(toKey: Key$1, collection: Collection): void;
|
|
565
|
-
/** Select a key based on interaction. */
|
|
566
|
-
select(key: Key$1, e?: {
|
|
567
|
-
shiftKey?: boolean;
|
|
568
|
-
ctrlKey?: boolean;
|
|
569
|
-
metaKey?: boolean;
|
|
570
|
-
}, collection?: Collection): void;
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Creates selection state for a collection.
|
|
574
|
-
*/
|
|
575
|
-
declare function createSelectionState(props?: MaybeAccessor<SelectionStateProps>): SelectionState;
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* State management for list-like components.
|
|
579
|
-
* Combines collection and selection state.
|
|
580
|
-
* Based on @react-stately/list.
|
|
581
|
-
*/
|
|
582
|
-
|
|
583
|
-
interface ListStateProps<T = unknown> {
|
|
584
|
-
/** The items in the list (for dynamic rendering). */
|
|
585
|
-
items?: T[];
|
|
586
|
-
/** Function to get a key from an item. */
|
|
587
|
-
getKey?: (item: T) => Key$1;
|
|
588
|
-
/** Function to get text value from an item. */
|
|
589
|
-
getTextValue?: (item: T) => string;
|
|
590
|
-
/** Function to check if an item is disabled. */
|
|
591
|
-
getDisabled?: (item: T) => boolean;
|
|
592
|
-
/** Keys of disabled items. */
|
|
593
|
-
disabledKeys?: Iterable<Key$1>;
|
|
594
|
-
/** How disabled keys behave. */
|
|
595
|
-
disabledBehavior?: DisabledBehavior;
|
|
596
|
-
/** The selection mode. */
|
|
597
|
-
selectionMode?: SelectionMode;
|
|
598
|
-
/** How selection behaves on interaction. */
|
|
599
|
-
selectionBehavior?: SelectionBehavior;
|
|
600
|
-
/** Whether empty selection is disallowed. */
|
|
601
|
-
disallowEmptySelection?: boolean;
|
|
602
|
-
/** Currently selected keys (controlled). */
|
|
603
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
604
|
-
/** Default selected keys (uncontrolled). */
|
|
605
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
606
|
-
/** Handler for selection changes. */
|
|
607
|
-
onSelectionChange?: (keys: 'all' | Set<Key$1>) => void;
|
|
608
|
-
/** Whether to allow duplicate selection events. */
|
|
609
|
-
allowDuplicateSelectionEvents?: boolean;
|
|
610
|
-
}
|
|
611
|
-
interface ListState<T = unknown> extends SelectionState {
|
|
612
|
-
/** The collection of items. */
|
|
613
|
-
readonly collection: Accessor<Collection<T>>;
|
|
614
|
-
/** Whether the collection is focused. */
|
|
615
|
-
readonly isFocused: Accessor<boolean>;
|
|
616
|
-
/** Set the focused state. */
|
|
617
|
-
setFocused(isFocused: boolean): void;
|
|
618
|
-
/** The currently focused key. */
|
|
619
|
-
readonly focusedKey: Accessor<Key$1 | null>;
|
|
620
|
-
/** Set the focused key. */
|
|
621
|
-
setFocusedKey(key: Key$1 | null, childStrategy?: FocusStrategy): void;
|
|
622
|
-
/** The child focus strategy. */
|
|
623
|
-
readonly childFocusStrategy: Accessor<FocusStrategy | null>;
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Creates state for a list component with selection.
|
|
627
|
-
*/
|
|
628
|
-
declare function createListState<T = unknown>(props: MaybeAccessor<ListStateProps<T>>): ListState<T>;
|
|
629
|
-
/**
|
|
630
|
-
* Props for single selection list state.
|
|
631
|
-
*/
|
|
632
|
-
interface SingleSelectListStateProps<T = unknown> extends Omit<ListStateProps<T>, 'selectionMode' | 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'> {
|
|
633
|
-
/** The currently selected key (controlled). */
|
|
634
|
-
selectedKey?: Key$1 | null;
|
|
635
|
-
/** The default selected key (uncontrolled). */
|
|
636
|
-
defaultSelectedKey?: Key$1;
|
|
637
|
-
/** Handler for selection changes. */
|
|
638
|
-
onSelectionChange?: (key: Key$1 | null) => void;
|
|
639
|
-
}
|
|
640
|
-
interface SingleSelectListState<T = unknown> extends ListState<T> {
|
|
641
|
-
/** The currently selected key. */
|
|
642
|
-
readonly selectedKey: Accessor<Key$1 | null>;
|
|
643
|
-
/** Set the selected key. */
|
|
644
|
-
setSelectedKey(key: Key$1 | null): void;
|
|
645
|
-
/** The currently selected item. */
|
|
646
|
-
readonly selectedItem: Accessor<CollectionNode<T> | null>;
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Creates state for a single-select list component.
|
|
650
|
-
*/
|
|
651
|
-
declare function createSingleSelectListState<T = unknown>(props: MaybeAccessor<SingleSelectListStateProps<T>>): SingleSelectListState<T>;
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* State management for menu components.
|
|
655
|
-
* Based on @react-stately/menu.
|
|
656
|
-
*/
|
|
657
|
-
|
|
658
|
-
interface MenuStateProps<T = unknown> extends Omit<ListStateProps<T>, 'selectionMode' | 'disallowEmptySelection'> {
|
|
659
|
-
/** Handler called when an item is activated (pressed). */
|
|
660
|
-
onAction?: (key: Key$1) => void;
|
|
661
|
-
/** Handler called when the menu should close. */
|
|
662
|
-
onClose?: () => void;
|
|
663
|
-
}
|
|
664
|
-
interface MenuState<T = unknown> extends ListState<T> {
|
|
665
|
-
/** Close the menu. */
|
|
666
|
-
close(): void;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* Creates state for a menu component.
|
|
670
|
-
* Menus are single-select lists that support actions.
|
|
671
|
-
*/
|
|
672
|
-
declare function createMenuState<T = unknown>(props: MaybeAccessor<MenuStateProps<T>>): MenuState<T>;
|
|
673
|
-
interface MenuTriggerStateProps {
|
|
674
|
-
/** Whether the menu is open (controlled). */
|
|
675
|
-
isOpen?: boolean;
|
|
676
|
-
/** Default open state (uncontrolled). */
|
|
677
|
-
defaultOpen?: boolean;
|
|
678
|
-
/** Handler called when the open state changes. */
|
|
679
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
680
|
-
}
|
|
681
|
-
interface MenuTriggerState {
|
|
682
|
-
/** Whether the menu is open. */
|
|
683
|
-
readonly isOpen: () => boolean;
|
|
684
|
-
/** Open the menu. */
|
|
685
|
-
open(): void;
|
|
686
|
-
/** Close the menu. */
|
|
687
|
-
close(): void;
|
|
688
|
-
/** Toggle the menu. */
|
|
689
|
-
toggle(): void;
|
|
690
|
-
/** Focus strategy for when the menu opens. */
|
|
691
|
-
readonly focusStrategy: () => 'first' | 'last' | null;
|
|
692
|
-
/** Set the focus strategy. */
|
|
693
|
-
setFocusStrategy(strategy: 'first' | 'last' | null): void;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* State management for select components.
|
|
698
|
-
* Based on @react-stately/select useSelectState.
|
|
699
|
-
*/
|
|
700
|
-
|
|
701
|
-
interface SelectStateProps<T = unknown> {
|
|
702
|
-
/** The items to display in the select. */
|
|
703
|
-
items: T[];
|
|
704
|
-
/** Function to get the key for an item. */
|
|
705
|
-
getKey?: (item: T) => Key$1;
|
|
706
|
-
/** Function to get the text value for an item. */
|
|
707
|
-
getTextValue?: (item: T) => string;
|
|
708
|
-
/** Function to check if an item is disabled. */
|
|
709
|
-
getDisabled?: (item: T) => boolean;
|
|
710
|
-
/** Keys of disabled items. */
|
|
711
|
-
disabledKeys?: Iterable<Key$1>;
|
|
712
|
-
/** The currently selected key (controlled). */
|
|
713
|
-
selectedKey?: Key$1 | null;
|
|
714
|
-
/** The default selected key (uncontrolled). */
|
|
715
|
-
defaultSelectedKey?: Key$1 | null;
|
|
716
|
-
/** Handler called when the selection changes. */
|
|
717
|
-
onSelectionChange?: (key: Key$1 | null) => void;
|
|
718
|
-
/** Whether the select is open (controlled). */
|
|
719
|
-
isOpen?: boolean;
|
|
720
|
-
/** Whether the select is open by default (uncontrolled). */
|
|
721
|
-
defaultOpen?: boolean;
|
|
722
|
-
/** Handler called when the open state changes. */
|
|
723
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
724
|
-
/** Whether the select is disabled. */
|
|
725
|
-
isDisabled?: boolean;
|
|
726
|
-
/** Whether the select is required. */
|
|
727
|
-
isRequired?: boolean;
|
|
728
|
-
}
|
|
729
|
-
interface SelectState<T = unknown> {
|
|
730
|
-
/** The collection of items. */
|
|
731
|
-
readonly collection: Accessor<Collection<T>>;
|
|
732
|
-
/** Whether the select dropdown is open. */
|
|
733
|
-
readonly isOpen: Accessor<boolean>;
|
|
734
|
-
/** Open the select dropdown. */
|
|
735
|
-
open(): void;
|
|
736
|
-
/** Close the select dropdown. */
|
|
737
|
-
close(): void;
|
|
738
|
-
/** Toggle the select dropdown. */
|
|
739
|
-
toggle(): void;
|
|
740
|
-
/** The currently selected key. */
|
|
741
|
-
readonly selectedKey: Accessor<Key$1 | null>;
|
|
742
|
-
/** The currently selected item. */
|
|
743
|
-
readonly selectedItem: Accessor<CollectionNode<T> | null>;
|
|
744
|
-
/** Set the selected key. */
|
|
745
|
-
setSelectedKey(key: Key$1 | null): void;
|
|
746
|
-
/** The currently focused key. */
|
|
747
|
-
readonly focusedKey: Accessor<Key$1 | null>;
|
|
748
|
-
/** Set the focused key. */
|
|
749
|
-
setFocusedKey(key: Key$1 | null): void;
|
|
750
|
-
/** Whether the select has focus. */
|
|
751
|
-
readonly isFocused: Accessor<boolean>;
|
|
752
|
-
/** Set whether the select has focus. */
|
|
753
|
-
setFocused(isFocused: boolean): void;
|
|
754
|
-
/** Whether a specific key is disabled. */
|
|
755
|
-
isKeyDisabled(key: Key$1): boolean;
|
|
756
|
-
/** Whether the select is disabled. */
|
|
757
|
-
readonly isDisabled: boolean;
|
|
758
|
-
/** Whether the select is required. */
|
|
759
|
-
readonly isRequired: boolean;
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* Creates state for a select component.
|
|
763
|
-
* Combines list state with overlay trigger state for dropdown behavior.
|
|
764
|
-
*/
|
|
765
|
-
declare function createSelectState<T = unknown>(props: MaybeAccessor<SelectStateProps<T>>): SelectState<T>;
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* State management for ComboBox components.
|
|
769
|
-
* Based on @react-stately/combobox useComboBoxState.
|
|
770
|
-
*
|
|
771
|
-
* ComboBox combines a text input with a dropdown list, allowing users to
|
|
772
|
-
* either type to filter options or select from a list.
|
|
773
|
-
*/
|
|
774
|
-
|
|
775
|
-
type MenuTriggerAction = 'focus' | 'input' | 'manual';
|
|
776
|
-
|
|
777
|
-
type FilterFn = (textValue: string, inputValue: string) => boolean;
|
|
778
|
-
interface ComboBoxStateProps<T = unknown> {
|
|
779
|
-
/** The items to display in the combobox dropdown. */
|
|
780
|
-
items: T[];
|
|
781
|
-
/** Default items when uncontrolled. */
|
|
782
|
-
defaultItems?: T[];
|
|
783
|
-
/** Function to get the key for an item. */
|
|
784
|
-
getKey?: (item: T) => Key$1;
|
|
785
|
-
/** Function to get the text value for an item. */
|
|
786
|
-
getTextValue?: (item: T) => string;
|
|
787
|
-
/** Function to check if an item is disabled. */
|
|
788
|
-
getDisabled?: (item: T) => boolean;
|
|
789
|
-
/** Keys of disabled items. */
|
|
790
|
-
disabledKeys?: Iterable<Key$1>;
|
|
791
|
-
/** The currently selected key (controlled). */
|
|
792
|
-
selectedKey?: Key$1 | null;
|
|
793
|
-
/** The default selected key (uncontrolled). */
|
|
794
|
-
defaultSelectedKey?: Key$1 | null;
|
|
795
|
-
/** Handler called when the selection changes. */
|
|
796
|
-
onSelectionChange?: (key: Key$1 | null) => void;
|
|
797
|
-
/** The current input value (controlled). */
|
|
798
|
-
inputValue?: string;
|
|
799
|
-
/** The default input value (uncontrolled). */
|
|
800
|
-
defaultInputValue?: string;
|
|
801
|
-
/** Handler called when the input value changes. */
|
|
802
|
-
onInputChange?: (value: string) => void;
|
|
803
|
-
/** Whether the combobox is open (controlled). */
|
|
804
|
-
isOpen?: boolean;
|
|
805
|
-
/** Whether the combobox is open by default (uncontrolled). */
|
|
806
|
-
defaultOpen?: boolean;
|
|
807
|
-
/** Handler called when the open state changes. */
|
|
808
|
-
onOpenChange?: (isOpen: boolean, trigger?: MenuTriggerAction) => void;
|
|
809
|
-
/** Whether the combobox is disabled. */
|
|
810
|
-
isDisabled?: boolean;
|
|
811
|
-
/** Whether the combobox is read-only. */
|
|
812
|
-
isReadOnly?: boolean;
|
|
813
|
-
/** Whether the combobox is required. */
|
|
814
|
-
isRequired?: boolean;
|
|
815
|
-
/** The filter function to use when filtering items. */
|
|
816
|
-
defaultFilter?: FilterFn;
|
|
817
|
-
/** Whether to allow the menu to open when there are no items. */
|
|
818
|
-
allowsEmptyCollection?: boolean;
|
|
819
|
-
/** Whether to allow custom values that don't match any option. */
|
|
820
|
-
allowsCustomValue?: boolean;
|
|
821
|
-
/** What triggers the menu to open. */
|
|
822
|
-
menuTrigger?: MenuTriggerAction;
|
|
823
|
-
/** Whether to close the menu on blur. */
|
|
824
|
-
shouldCloseOnBlur?: boolean;
|
|
825
|
-
}
|
|
826
|
-
interface ComboBoxState<T = unknown> {
|
|
827
|
-
/** The collection of items (may be filtered). */
|
|
828
|
-
readonly collection: Accessor<Collection<T>>;
|
|
829
|
-
/** Whether the combobox dropdown is open. */
|
|
830
|
-
readonly isOpen: Accessor<boolean>;
|
|
831
|
-
/** Open the combobox dropdown. */
|
|
832
|
-
open(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;
|
|
833
|
-
/** Close the combobox dropdown. */
|
|
834
|
-
close(): void;
|
|
835
|
-
/** Toggle the combobox dropdown. */
|
|
836
|
-
toggle(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;
|
|
837
|
-
/** The currently selected key. */
|
|
838
|
-
readonly selectedKey: Accessor<Key$1 | null>;
|
|
839
|
-
/** The default selected key. */
|
|
840
|
-
readonly defaultSelectedKey: Key$1 | null;
|
|
841
|
-
/** The currently selected item. */
|
|
842
|
-
readonly selectedItem: Accessor<CollectionNode<T> | null>;
|
|
843
|
-
/** Set the selected key. */
|
|
844
|
-
setSelectedKey(key: Key$1 | null): void;
|
|
845
|
-
/** The current input value. */
|
|
846
|
-
readonly inputValue: Accessor<string>;
|
|
847
|
-
/** The default input value. */
|
|
848
|
-
readonly defaultInputValue: string;
|
|
849
|
-
/** Set the input value. */
|
|
850
|
-
setInputValue(value: string): void;
|
|
851
|
-
/** The currently focused key in the list. */
|
|
852
|
-
readonly focusedKey: Accessor<Key$1 | null>;
|
|
853
|
-
/** Set the focused key. */
|
|
854
|
-
setFocusedKey(key: Key$1 | null): void;
|
|
855
|
-
/** Whether the combobox input has focus. */
|
|
856
|
-
readonly isFocused: Accessor<boolean>;
|
|
857
|
-
/** Set whether the combobox has focus. */
|
|
858
|
-
setFocused(isFocused: boolean): void;
|
|
859
|
-
/** The focus strategy to use when opening. */
|
|
860
|
-
readonly focusStrategy: Accessor<FocusStrategy | null>;
|
|
861
|
-
/** Commit the current selection (select focused item or custom value). */
|
|
862
|
-
commit(): void;
|
|
863
|
-
/** Revert input to the selected item's text and close menu. */
|
|
864
|
-
revert(): void;
|
|
865
|
-
/** Whether a specific key is disabled. */
|
|
866
|
-
isKeyDisabled(key: Key$1): boolean;
|
|
867
|
-
/** Select a key and close the menu (for ListState compatibility). */
|
|
868
|
-
select(key: Key$1): void;
|
|
869
|
-
/** The selection mode (always 'single' for combobox). */
|
|
870
|
-
readonly selectionMode: Accessor<'single'>;
|
|
871
|
-
/** Check if a key is selected. */
|
|
872
|
-
isSelected(key: Key$1): boolean;
|
|
873
|
-
/** Whether the combobox is disabled. */
|
|
874
|
-
readonly isDisabled: boolean;
|
|
875
|
-
/** Whether the combobox is read-only. */
|
|
876
|
-
readonly isReadOnly: boolean;
|
|
877
|
-
/** Whether the combobox is required. */
|
|
878
|
-
readonly isRequired: boolean;
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* Default filter function that does case-insensitive "contains" matching.
|
|
882
|
-
*/
|
|
883
|
-
declare const defaultContainsFilter: FilterFn;
|
|
884
|
-
/**
|
|
885
|
-
* Creates state for a combobox component.
|
|
886
|
-
* Combines list state with input value management and filtering.
|
|
887
|
-
*/
|
|
888
|
-
declare function createComboBoxState<T = unknown>(props: MaybeAccessor<ComboBoxStateProps<T>>): ComboBoxState<T>;
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* State management for tab components.
|
|
892
|
-
* Based on @react-stately/tabs.
|
|
893
|
-
*/
|
|
894
|
-
|
|
895
|
-
type KeyboardActivation = 'automatic' | 'manual';
|
|
896
|
-
type TabOrientation = 'horizontal' | 'vertical';
|
|
897
|
-
interface TabListStateProps<T = unknown> {
|
|
898
|
-
/** The items in the tab list. */
|
|
899
|
-
items?: T[];
|
|
900
|
-
/** Function to get a key from an item. */
|
|
901
|
-
getKey?: (item: T) => Key$1;
|
|
902
|
-
/** Function to get text value from an item. */
|
|
903
|
-
getTextValue?: (item: T) => string;
|
|
904
|
-
/** Function to check if an item is disabled. */
|
|
905
|
-
getDisabled?: (item: T) => boolean;
|
|
906
|
-
/** Keys of disabled tabs. */
|
|
907
|
-
disabledKeys?: Iterable<Key$1>;
|
|
908
|
-
/** The currently selected tab key (controlled). */
|
|
909
|
-
selectedKey?: Key$1 | null;
|
|
910
|
-
/** The default selected tab key (uncontrolled). */
|
|
911
|
-
defaultSelectedKey?: Key$1;
|
|
912
|
-
/** Handler for tab selection changes. */
|
|
913
|
-
onSelectionChange?: (key: Key$1) => void;
|
|
914
|
-
/** Whether the entire tab list is disabled. */
|
|
915
|
-
isDisabled?: boolean;
|
|
916
|
-
/** Whether tabs are activated automatically on focus or manually. */
|
|
917
|
-
keyboardActivation?: KeyboardActivation;
|
|
918
|
-
/** The orientation of the tab list. */
|
|
919
|
-
orientation?: TabOrientation;
|
|
920
|
-
}
|
|
921
|
-
interface TabListState<T = unknown> {
|
|
922
|
-
/** The collection of tabs. */
|
|
923
|
-
readonly collection: Accessor<Collection<T>>;
|
|
924
|
-
/** The currently selected tab key. */
|
|
925
|
-
readonly selectedKey: Accessor<Key$1 | null>;
|
|
926
|
-
/** Set the selected tab key. */
|
|
927
|
-
setSelectedKey(key: Key$1): void;
|
|
928
|
-
/** The currently selected tab item. */
|
|
929
|
-
readonly selectedItem: Accessor<CollectionNode<T> | null>;
|
|
930
|
-
/** Whether the tab list is disabled. */
|
|
931
|
-
readonly isDisabled: Accessor<boolean>;
|
|
932
|
-
/** The keyboard activation mode. */
|
|
933
|
-
readonly keyboardActivation: Accessor<KeyboardActivation>;
|
|
934
|
-
/** The orientation of the tab list. */
|
|
935
|
-
readonly orientation: Accessor<TabOrientation>;
|
|
936
|
-
/** Whether a tab key is disabled. */
|
|
937
|
-
isKeyDisabled(key: Key$1): boolean;
|
|
938
|
-
/** The set of disabled keys. */
|
|
939
|
-
readonly disabledKeys: Accessor<Set<Key$1>>;
|
|
940
|
-
/** Whether the collection is focused. */
|
|
941
|
-
readonly isFocused: Accessor<boolean>;
|
|
942
|
-
/** Set the focused state. */
|
|
943
|
-
setFocused(isFocused: boolean): void;
|
|
944
|
-
/** The currently focused tab key. */
|
|
945
|
-
readonly focusedKey: Accessor<Key$1 | null>;
|
|
946
|
-
/** Set the focused tab key. */
|
|
947
|
-
setFocusedKey(key: Key$1 | null, childStrategy?: FocusStrategy): void;
|
|
948
|
-
/** The child focus strategy. */
|
|
949
|
-
readonly childFocusStrategy: Accessor<FocusStrategy | null>;
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* Creates state for a tab list component.
|
|
953
|
-
*/
|
|
954
|
-
declare function createTabListState<T = unknown>(props: MaybeAccessor<TabListStateProps<T>>): TabListState<T>;
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* State management for NumberField.
|
|
958
|
-
* Based on @react-stately/numberfield useNumberFieldState.
|
|
959
|
-
*/
|
|
960
|
-
|
|
961
|
-
interface NumberFieldStateProps {
|
|
962
|
-
/** The current value (controlled). */
|
|
963
|
-
value?: number;
|
|
964
|
-
/** The default value (uncontrolled). */
|
|
965
|
-
defaultValue?: number;
|
|
966
|
-
/** Handler called when the value changes. */
|
|
967
|
-
onChange?: (value: number) => void;
|
|
968
|
-
/** The minimum value. */
|
|
969
|
-
minValue?: number;
|
|
970
|
-
/** The maximum value. */
|
|
971
|
-
maxValue?: number;
|
|
972
|
-
/** The step value for increment/decrement. */
|
|
973
|
-
step?: number;
|
|
974
|
-
/** Whether the field is disabled. */
|
|
975
|
-
isDisabled?: boolean;
|
|
976
|
-
/** Whether the field is read-only. */
|
|
977
|
-
isReadOnly?: boolean;
|
|
978
|
-
/** The locale for number formatting. */
|
|
979
|
-
locale?: string;
|
|
980
|
-
/** Number format options. */
|
|
981
|
-
formatOptions?: Intl.NumberFormatOptions;
|
|
982
|
-
}
|
|
983
|
-
interface NumberFieldState {
|
|
984
|
-
/** The current input value as a string. */
|
|
985
|
-
inputValue: Accessor<string>;
|
|
986
|
-
/** The current numeric value. */
|
|
987
|
-
numberValue: Accessor<number>;
|
|
988
|
-
/** Whether the value can be incremented. */
|
|
989
|
-
canIncrement: Accessor<boolean>;
|
|
990
|
-
/** Whether the value can be decremented. */
|
|
991
|
-
canDecrement: Accessor<boolean>;
|
|
992
|
-
/** Whether the field is disabled. */
|
|
993
|
-
isDisabled: Accessor<boolean>;
|
|
994
|
-
/** Whether the field is read-only. */
|
|
995
|
-
isReadOnly: Accessor<boolean>;
|
|
996
|
-
/** The minimum value. */
|
|
997
|
-
minValue: Accessor<number | undefined>;
|
|
998
|
-
/** The maximum value. */
|
|
999
|
-
maxValue: Accessor<number | undefined>;
|
|
1000
|
-
/** Set the input value. */
|
|
1001
|
-
setInputValue: (value: string) => void;
|
|
1002
|
-
/** Validate a partial input value. */
|
|
1003
|
-
validate: (value: string) => boolean;
|
|
1004
|
-
/** Commit the current input value. */
|
|
1005
|
-
commit: () => void;
|
|
1006
|
-
/** Increment the value by step. */
|
|
1007
|
-
increment: () => void;
|
|
1008
|
-
/** Decrement the value by step. */
|
|
1009
|
-
decrement: () => void;
|
|
1010
|
-
/** Set to maximum value. */
|
|
1011
|
-
incrementToMax: () => void;
|
|
1012
|
-
/** Set to minimum value. */
|
|
1013
|
-
decrementToMin: () => void;
|
|
1014
|
-
}
|
|
1015
|
-
/**
|
|
1016
|
-
* Creates state for a number field.
|
|
1017
|
-
*/
|
|
1018
|
-
declare function createNumberFieldState(props: MaybeAccessor<NumberFieldStateProps>): NumberFieldState;
|
|
1019
|
-
|
|
1020
|
-
/**
|
|
1021
|
-
* Creates state for a search field component.
|
|
1022
|
-
* Based on @react-stately/searchfield useSearchFieldState.
|
|
1023
|
-
*/
|
|
1024
|
-
|
|
1025
|
-
interface SearchFieldStateProps {
|
|
1026
|
-
/** The current value (controlled). */
|
|
1027
|
-
value?: string;
|
|
1028
|
-
/** The default value (uncontrolled). */
|
|
1029
|
-
defaultValue?: string;
|
|
1030
|
-
/** Handler that is called when the value changes. */
|
|
1031
|
-
onChange?: (value: string) => void;
|
|
1032
|
-
}
|
|
1033
|
-
interface SearchFieldState {
|
|
1034
|
-
/** The current value of the search field. */
|
|
1035
|
-
value: Accessor<string>;
|
|
1036
|
-
/** Sets the value of the search field. */
|
|
1037
|
-
setValue: (value: string) => void;
|
|
1038
|
-
}
|
|
1039
|
-
/**
|
|
1040
|
-
* Provides state management for a search field.
|
|
1041
|
-
*/
|
|
1042
|
-
declare function createSearchFieldState(props: MaybeAccessor<SearchFieldStateProps>): SearchFieldState;
|
|
1043
|
-
|
|
1044
|
-
/**
|
|
1045
|
-
* Creates state for a slider component.
|
|
1046
|
-
* Based on @react-stately/slider useSliderState.
|
|
1047
|
-
*/
|
|
1048
|
-
|
|
1049
|
-
type SliderOrientation = 'horizontal' | 'vertical';
|
|
1050
|
-
interface SliderStateProps {
|
|
1051
|
-
/** The current value (controlled). */
|
|
1052
|
-
value?: number;
|
|
1053
|
-
/** The default value (uncontrolled). */
|
|
1054
|
-
defaultValue?: number;
|
|
1055
|
-
/** Handler called when the value changes. */
|
|
1056
|
-
onChange?: (value: number) => void;
|
|
1057
|
-
/** Handler called when the user stops dragging. */
|
|
1058
|
-
onChangeEnd?: (value: number) => void;
|
|
1059
|
-
/** The minimum value. */
|
|
1060
|
-
minValue?: number;
|
|
1061
|
-
/** The maximum value. */
|
|
1062
|
-
maxValue?: number;
|
|
1063
|
-
/** The step value. */
|
|
1064
|
-
step?: number;
|
|
1065
|
-
/** The orientation of the slider. */
|
|
1066
|
-
orientation?: SliderOrientation;
|
|
1067
|
-
/** Whether the slider is disabled. */
|
|
1068
|
-
isDisabled?: boolean;
|
|
1069
|
-
/** The locale for number formatting. */
|
|
1070
|
-
locale?: string;
|
|
1071
|
-
/** Number format options. */
|
|
1072
|
-
formatOptions?: Intl.NumberFormatOptions;
|
|
1073
|
-
}
|
|
1074
|
-
interface SliderState {
|
|
1075
|
-
/** The current value. */
|
|
1076
|
-
value: Accessor<number>;
|
|
1077
|
-
/** Sets the value. */
|
|
1078
|
-
setValue: (value: number) => void;
|
|
1079
|
-
/** Sets the value by percent (0-1). */
|
|
1080
|
-
setValuePercent: (percent: number) => void;
|
|
1081
|
-
/** Gets the value as a percent (0-1). */
|
|
1082
|
-
getValuePercent: Accessor<number>;
|
|
1083
|
-
/** Gets the formatted value string. */
|
|
1084
|
-
getFormattedValue: Accessor<string>;
|
|
1085
|
-
/** Whether the thumb is being dragged. */
|
|
1086
|
-
isDragging: Accessor<boolean>;
|
|
1087
|
-
/** Sets the dragging state. */
|
|
1088
|
-
setDragging: (dragging: boolean) => void;
|
|
1089
|
-
/** Whether the slider is focused. */
|
|
1090
|
-
isFocused: Accessor<boolean>;
|
|
1091
|
-
/** Sets the focused state. */
|
|
1092
|
-
setFocused: (focused: boolean) => void;
|
|
1093
|
-
/** Increments the value by step. */
|
|
1094
|
-
increment: (stepMultiplier?: number) => void;
|
|
1095
|
-
/** Decrements the value by step. */
|
|
1096
|
-
decrement: (stepMultiplier?: number) => void;
|
|
1097
|
-
/** The minimum value. */
|
|
1098
|
-
minValue: number;
|
|
1099
|
-
/** The maximum value. */
|
|
1100
|
-
maxValue: number;
|
|
1101
|
-
/** The step value. */
|
|
1102
|
-
step: number;
|
|
1103
|
-
/** The page step (larger step for Page Up/Down). */
|
|
1104
|
-
pageStep: number;
|
|
1105
|
-
/** The orientation. */
|
|
1106
|
-
orientation: SliderOrientation;
|
|
1107
|
-
/** Whether the slider is disabled. */
|
|
1108
|
-
isDisabled: boolean;
|
|
1109
|
-
}
|
|
1110
|
-
/**
|
|
1111
|
-
* Provides state management for a slider component.
|
|
1112
|
-
*/
|
|
1113
|
-
declare function createSliderState(props: MaybeAccessor<SliderStateProps>): SliderState;
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
* Manages state for a tooltip trigger.
|
|
1117
|
-
* Based on @react-stately/tooltip useTooltipTriggerState.
|
|
1118
|
-
*
|
|
1119
|
-
* Tracks whether the tooltip is open, and provides methods to toggle this state.
|
|
1120
|
-
* Ensures only one tooltip is open at a time and controls the delay for showing a tooltip.
|
|
1121
|
-
*/
|
|
1122
|
-
|
|
1123
|
-
interface TooltipTriggerProps extends OverlayTriggerProps {
|
|
1124
|
-
/** The delay time in milliseconds for the tooltip to show up. */
|
|
1125
|
-
delay?: number;
|
|
1126
|
-
/** The delay time in milliseconds for the tooltip to close. */
|
|
1127
|
-
closeDelay?: number;
|
|
1128
|
-
}
|
|
1129
|
-
interface TooltipTriggerState {
|
|
1130
|
-
/** Whether the tooltip is currently showing. */
|
|
1131
|
-
readonly isOpen: Accessor<boolean>;
|
|
1132
|
-
/**
|
|
1133
|
-
* Shows the tooltip. By default, the tooltip becomes visible after a delay
|
|
1134
|
-
* depending on a global warmup timer. The `immediate` option shows the
|
|
1135
|
-
* tooltip immediately instead.
|
|
1136
|
-
*/
|
|
1137
|
-
open(immediate?: boolean): void;
|
|
1138
|
-
/** Hides the tooltip. */
|
|
1139
|
-
close(immediate?: boolean): void;
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Resets the global tooltip state. Useful for testing.
|
|
1143
|
-
* @internal
|
|
1144
|
-
*/
|
|
1145
|
-
declare function resetTooltipState(): void;
|
|
1146
|
-
/**
|
|
1147
|
-
* Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides
|
|
1148
|
-
* methods to toggle this state. Ensures only one tooltip is open at a time and controls
|
|
1149
|
-
* the delay for showing a tooltip.
|
|
1150
|
-
*/
|
|
1151
|
-
declare function createTooltipTriggerState(props?: TooltipTriggerProps): TooltipTriggerState;
|
|
1152
|
-
|
|
1153
|
-
/**
|
|
1154
|
-
* Toast state management for SolidJS
|
|
1155
|
-
* Based on @react-stately/toast useToastState
|
|
1156
|
-
*/
|
|
1157
|
-
|
|
1158
|
-
interface ToastOptions {
|
|
1159
|
-
/** A timeout to automatically close the toast, in milliseconds. */
|
|
1160
|
-
timeout?: number;
|
|
1161
|
-
/** The priority of the toast relative to other toasts. */
|
|
1162
|
-
priority?: number;
|
|
1163
|
-
/** Handler called when the toast is closed. */
|
|
1164
|
-
onClose?: () => void;
|
|
1165
|
-
}
|
|
1166
|
-
interface QueuedToast<T> {
|
|
1167
|
-
/** The content of the toast. */
|
|
1168
|
-
content: T;
|
|
1169
|
-
/** A unique key for the toast. */
|
|
1170
|
-
key: string;
|
|
1171
|
-
/** The timer for the toast. */
|
|
1172
|
-
timer: Timer | null;
|
|
1173
|
-
/** Whether the toast should be animated. */
|
|
1174
|
-
animation?: 'entering' | 'exiting' | 'queued';
|
|
1175
|
-
/** The priority of the toast. */
|
|
1176
|
-
priority: number;
|
|
1177
|
-
/** Handler called when the toast is closed. */
|
|
1178
|
-
onClose?: () => void;
|
|
1179
|
-
/** The timeout for the toast. */
|
|
1180
|
-
timeout?: number;
|
|
1181
|
-
}
|
|
1182
|
-
interface ToastQueueOptions {
|
|
1183
|
-
/** The maximum number of toasts to display at once. */
|
|
1184
|
-
maxVisibleToasts?: number;
|
|
1185
|
-
/** Whether toasts should stack (true) or queue (false). */
|
|
1186
|
-
hasExitAnimation?: boolean;
|
|
1187
|
-
}
|
|
1188
|
-
interface ToastStateProps<T> {
|
|
1189
|
-
/** The toast queue to use. */
|
|
1190
|
-
queue: ToastQueue<T>;
|
|
1191
|
-
}
|
|
1192
|
-
interface ToastState<T> {
|
|
1193
|
-
/** The currently visible toasts. */
|
|
1194
|
-
visibleToasts: Accessor<QueuedToast<T>[]>;
|
|
1195
|
-
/** Adds a toast to the queue. */
|
|
1196
|
-
add: (content: T, options?: ToastOptions) => string;
|
|
1197
|
-
/** Closes a toast by key. */
|
|
1198
|
-
close: (key: string) => void;
|
|
1199
|
-
/** Pauses all toast timers. */
|
|
1200
|
-
pauseAll: () => void;
|
|
1201
|
-
/** Resumes all toast timers. */
|
|
1202
|
-
resumeAll: () => void;
|
|
1203
|
-
}
|
|
1204
|
-
/**
|
|
1205
|
-
* A Timer that supports pause and resume.
|
|
1206
|
-
*/
|
|
1207
|
-
declare class Timer {
|
|
1208
|
-
private timerId;
|
|
1209
|
-
private startTime;
|
|
1210
|
-
private remaining;
|
|
1211
|
-
private callback;
|
|
1212
|
-
constructor(callback: () => void, delay: number);
|
|
1213
|
-
pause(): void;
|
|
1214
|
-
resume(): void;
|
|
1215
|
-
reset(delay: number): void;
|
|
1216
|
-
cancel(): void;
|
|
1217
|
-
}
|
|
1218
|
-
type SubscribeCallback<T> = (toasts: QueuedToast<T>[]) => void;
|
|
1219
|
-
/**
|
|
1220
|
-
* A queue that manages toast notifications.
|
|
1221
|
-
* Can be created once and shared across the app (singleton pattern).
|
|
1222
|
-
*/
|
|
1223
|
-
declare class ToastQueue<T> {
|
|
1224
|
-
private queue;
|
|
1225
|
-
private subscriptions;
|
|
1226
|
-
private maxVisibleToasts;
|
|
1227
|
-
private hasExitAnimation;
|
|
1228
|
-
private keyCounter;
|
|
1229
|
-
constructor(options?: ToastQueueOptions);
|
|
1230
|
-
/**
|
|
1231
|
-
* Subscribe to queue changes.
|
|
1232
|
-
*/
|
|
1233
|
-
subscribe(callback: SubscribeCallback<T>): () => void;
|
|
1234
|
-
/**
|
|
1235
|
-
* Add a toast to the queue.
|
|
1236
|
-
*/
|
|
1237
|
-
add(content: T, options?: ToastOptions): string;
|
|
1238
|
-
/**
|
|
1239
|
-
* Close a toast by key.
|
|
1240
|
-
*/
|
|
1241
|
-
close(key: string): void;
|
|
1242
|
-
/**
|
|
1243
|
-
* Remove a toast after exit animation completes.
|
|
1244
|
-
*/
|
|
1245
|
-
remove(key: string): void;
|
|
1246
|
-
/**
|
|
1247
|
-
* Pause all toast timers.
|
|
1248
|
-
*/
|
|
1249
|
-
pauseAll(): void;
|
|
1250
|
-
/**
|
|
1251
|
-
* Resume all toast timers.
|
|
1252
|
-
*/
|
|
1253
|
-
resumeAll(): void;
|
|
1254
|
-
private updateVisibility;
|
|
1255
|
-
private notify;
|
|
1256
|
-
}
|
|
1257
|
-
/**
|
|
1258
|
-
* Creates reactive toast state from a ToastQueue.
|
|
1259
|
-
* Use this hook to subscribe to toast changes in your component.
|
|
1260
|
-
*/
|
|
1261
|
-
declare function createToastState<T>(props: ToastStateProps<T>): ToastState<T>;
|
|
1262
|
-
/**
|
|
1263
|
-
* Creates a new ToastQueue and returns reactive state.
|
|
1264
|
-
* Use this if you don't need a global queue.
|
|
1265
|
-
*/
|
|
1266
|
-
declare function createToastQueue<T>(options?: ToastQueueOptions): ToastState<T> & {
|
|
1267
|
-
queue: ToastQueue<T>;
|
|
1268
|
-
};
|
|
1269
|
-
|
|
1270
|
-
/**
|
|
1271
|
-
* Disclosure state management for SolidJS
|
|
1272
|
-
* Based on @react-stately/disclosure useDisclosureState and useDisclosureGroupState
|
|
1273
|
-
*/
|
|
1274
|
-
|
|
1275
|
-
interface DisclosureStateProps {
|
|
1276
|
-
/** Whether the disclosure is expanded (controlled). */
|
|
1277
|
-
isExpanded?: boolean;
|
|
1278
|
-
/** Whether the disclosure is expanded by default (uncontrolled). */
|
|
1279
|
-
defaultExpanded?: boolean;
|
|
1280
|
-
/** Handler that is called when the disclosure expanded state changes. */
|
|
1281
|
-
onExpandedChange?: (isExpanded: boolean) => void;
|
|
1282
|
-
}
|
|
1283
|
-
interface DisclosureState {
|
|
1284
|
-
/** Whether the disclosure is currently expanded. */
|
|
1285
|
-
readonly isExpanded: Accessor<boolean>;
|
|
1286
|
-
/** Sets whether the disclosure is expanded. */
|
|
1287
|
-
setExpanded(isExpanded: boolean): void;
|
|
1288
|
-
/** Expand the disclosure. */
|
|
1289
|
-
expand(): void;
|
|
1290
|
-
/** Collapse the disclosure. */
|
|
1291
|
-
collapse(): void;
|
|
1292
|
-
/** Toggles the disclosure's visibility. */
|
|
1293
|
-
toggle(): void;
|
|
1294
|
-
}
|
|
1295
|
-
/**
|
|
1296
|
-
* Manages state for a disclosure widget. Tracks whether the disclosure is expanded,
|
|
1297
|
-
* and provides methods to toggle this state.
|
|
1298
|
-
*/
|
|
1299
|
-
declare function createDisclosureState(props?: MaybeAccessor<DisclosureStateProps>): DisclosureState;
|
|
1300
|
-
type Key = string | number;
|
|
1301
|
-
interface DisclosureGroupStateProps {
|
|
1302
|
-
/** Whether multiple items can be expanded at the same time. */
|
|
1303
|
-
allowsMultipleExpanded?: boolean;
|
|
1304
|
-
/** Whether all items are disabled. */
|
|
1305
|
-
isDisabled?: boolean;
|
|
1306
|
-
/** The currently expanded keys in the group (controlled). */
|
|
1307
|
-
expandedKeys?: Iterable<Key>;
|
|
1308
|
-
/** The initial expanded keys in the group (uncontrolled). */
|
|
1309
|
-
defaultExpandedKeys?: Iterable<Key>;
|
|
1310
|
-
/** Handler that is called when items are expanded or collapsed. */
|
|
1311
|
-
onExpandedChange?: (keys: Set<Key>) => void;
|
|
1312
|
-
}
|
|
1313
|
-
interface DisclosureGroupState {
|
|
1314
|
-
/** Whether multiple items can be expanded at the same time. */
|
|
1315
|
-
readonly allowsMultipleExpanded: boolean;
|
|
1316
|
-
/** Whether all items are disabled. */
|
|
1317
|
-
readonly isDisabled: boolean;
|
|
1318
|
-
/** A set of keys for items that are expanded. */
|
|
1319
|
-
readonly expandedKeys: Accessor<Set<Key>>;
|
|
1320
|
-
/** Toggles the expanded state for an item by its key. */
|
|
1321
|
-
toggleKey(key: Key): void;
|
|
1322
|
-
/** Replaces the set of expanded keys. */
|
|
1323
|
-
setExpandedKeys(keys: Set<Key>): void;
|
|
1324
|
-
/** Check if a specific key is expanded. */
|
|
1325
|
-
isExpanded(key: Key): boolean;
|
|
1326
|
-
}
|
|
1327
|
-
/**
|
|
1328
|
-
* Manages state for a group of disclosures, e.g. an accordion.
|
|
1329
|
-
* It supports both single and multiple expanded items.
|
|
1330
|
-
*/
|
|
1331
|
-
declare function createDisclosureGroupState(props?: MaybeAccessor<DisclosureGroupStateProps>): DisclosureGroupState;
|
|
1332
|
-
|
|
1333
|
-
/**
|
|
1334
|
-
* CalendarState for Solid-Stately
|
|
1335
|
-
*
|
|
1336
|
-
* Provides state management for calendar components.
|
|
1337
|
-
* Based on @react-stately/calendar useCalendarState
|
|
1338
|
-
*/
|
|
1339
|
-
|
|
1340
|
-
type ValidationState = 'valid' | 'invalid';
|
|
1341
|
-
interface CalendarStateProps<T extends DateValue = DateValue> {
|
|
1342
|
-
/** The current value (controlled). */
|
|
1343
|
-
value?: MaybeAccessor<T | null>;
|
|
1344
|
-
/** The default value (uncontrolled). */
|
|
1345
|
-
defaultValue?: T | null;
|
|
1346
|
-
/** Handler called when the value changes. */
|
|
1347
|
-
onChange?: (value: T) => void;
|
|
1348
|
-
/** The minimum allowed date. */
|
|
1349
|
-
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
1350
|
-
/** The maximum allowed date. */
|
|
1351
|
-
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
1352
|
-
/** Whether the calendar is disabled. */
|
|
1353
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
1354
|
-
/** Whether the calendar is read-only. */
|
|
1355
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
1356
|
-
/** Whether dates outside the visible range are automatically focused. */
|
|
1357
|
-
autoFocus?: boolean;
|
|
1358
|
-
/** The date that is focused when the calendar first mounts. */
|
|
1359
|
-
focusedValue?: MaybeAccessor<DateValue | undefined>;
|
|
1360
|
-
/** The default focused date (uncontrolled). */
|
|
1361
|
-
defaultFocusedValue?: DateValue;
|
|
1362
|
-
/** Handler called when the focused date changes. */
|
|
1363
|
-
onFocusChange?: (date: CalendarDate) => void;
|
|
1364
|
-
/** The locale to use for formatting. */
|
|
1365
|
-
locale?: string;
|
|
1366
|
-
/** Callback that is called for each date in the calendar to determine if it is unavailable. */
|
|
1367
|
-
isDateUnavailable?: (date: DateValue) => boolean;
|
|
1368
|
-
/** The number of months to display at once. */
|
|
1369
|
-
visibleMonths?: number;
|
|
1370
|
-
/** Whether to automatically focus the calendar when it is mounted. */
|
|
1371
|
-
autoFocusOnMount?: boolean;
|
|
1372
|
-
/** Controls which days are disabled. */
|
|
1373
|
-
isDateDisabled?: (date: DateValue) => boolean;
|
|
1374
|
-
/** Validation state. */
|
|
1375
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
1376
|
-
/** Error message. */
|
|
1377
|
-
errorMessage?: string;
|
|
1378
|
-
/** The first day of the week (0 = Sunday, 1 = Monday, etc.). */
|
|
1379
|
-
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1380
|
-
}
|
|
1381
|
-
interface CalendarState<T extends DateValue = DateValue> {
|
|
1382
|
-
/** The currently selected date. */
|
|
1383
|
-
value: Accessor<T | null>;
|
|
1384
|
-
/** Sets the selected date. */
|
|
1385
|
-
setValue: (value: T | null) => void;
|
|
1386
|
-
/** The currently focused date. */
|
|
1387
|
-
focusedDate: Accessor<CalendarDate>;
|
|
1388
|
-
/** Sets the focused date. */
|
|
1389
|
-
setFocusedDate: (date: CalendarDate) => void;
|
|
1390
|
-
/** Whether the calendar is disabled. */
|
|
1391
|
-
isDisabled: Accessor<boolean>;
|
|
1392
|
-
/** Whether the calendar is read-only. */
|
|
1393
|
-
isReadOnly: Accessor<boolean>;
|
|
1394
|
-
/** The visible date range (first and last day of visible month(s)). */
|
|
1395
|
-
visibleRange: Accessor<{
|
|
1396
|
-
start: CalendarDate;
|
|
1397
|
-
end: CalendarDate;
|
|
1398
|
-
}>;
|
|
1399
|
-
/** The timezone used for date calculations. */
|
|
1400
|
-
timeZone: string;
|
|
1401
|
-
/** The validation state. */
|
|
1402
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
1403
|
-
/** Whether a date is selected. */
|
|
1404
|
-
isSelected: (date: DateValue) => boolean;
|
|
1405
|
-
/** Whether a date is focused. */
|
|
1406
|
-
isCellFocused: (date: DateValue) => boolean;
|
|
1407
|
-
/** Whether a date is unavailable. */
|
|
1408
|
-
isCellUnavailable: (date: DateValue) => boolean;
|
|
1409
|
-
/** Whether a date is disabled. */
|
|
1410
|
-
isCellDisabled: (date: DateValue) => boolean;
|
|
1411
|
-
/** Whether a date is outside the visible range. */
|
|
1412
|
-
isOutsideVisibleRange: (date: DateValue) => boolean;
|
|
1413
|
-
/** Whether a date is invalid. */
|
|
1414
|
-
isInvalid: (date: DateValue) => boolean;
|
|
1415
|
-
/** Moves focus to the previous page (month). */
|
|
1416
|
-
focusPreviousPage: () => void;
|
|
1417
|
-
/** Moves focus to the next page (month). */
|
|
1418
|
-
focusNextPage: () => void;
|
|
1419
|
-
/** Moves focus to the previous section (year). */
|
|
1420
|
-
focusPreviousSection: () => void;
|
|
1421
|
-
/** Moves focus to the next section (year). */
|
|
1422
|
-
focusNextSection: () => void;
|
|
1423
|
-
/** Moves focus to the previous day. */
|
|
1424
|
-
focusPreviousDay: () => void;
|
|
1425
|
-
/** Moves focus to the next day. */
|
|
1426
|
-
focusNextDay: () => void;
|
|
1427
|
-
/** Moves focus to the previous week. */
|
|
1428
|
-
focusPreviousWeek: () => void;
|
|
1429
|
-
/** Moves focus to the next week. */
|
|
1430
|
-
focusNextWeek: () => void;
|
|
1431
|
-
/** Moves focus to the start of the month. */
|
|
1432
|
-
focusPageStart: () => void;
|
|
1433
|
-
/** Moves focus to the end of the month. */
|
|
1434
|
-
focusPageEnd: () => void;
|
|
1435
|
-
/** Selects the focused date. */
|
|
1436
|
-
selectFocusedDate: () => void;
|
|
1437
|
-
/** Selects a specific date. */
|
|
1438
|
-
selectDate: (date: CalendarDate) => void;
|
|
1439
|
-
/** Whether focus is currently within the calendar. */
|
|
1440
|
-
isFocused: Accessor<boolean>;
|
|
1441
|
-
/** Sets whether focus is within the calendar. */
|
|
1442
|
-
setFocused: (focused: boolean) => void;
|
|
1443
|
-
/** Gets the dates for a week in the visible range. */
|
|
1444
|
-
getDatesInWeek: (weekIndex: number, monthStartDate?: CalendarDate) => (CalendarDate | null)[];
|
|
1445
|
-
/** Gets the number of weeks in a month. */
|
|
1446
|
-
getWeeksInMonth: (date?: CalendarDate) => number;
|
|
1447
|
-
/** The week day headers. */
|
|
1448
|
-
weekDays: Accessor<string[]>;
|
|
1449
|
-
/** The title for the calendar (formatted month and year). */
|
|
1450
|
-
title: Accessor<string>;
|
|
1451
|
-
/** The number of visible months. */
|
|
1452
|
-
visibleMonths: number;
|
|
1453
|
-
/** Whether the calendar is paginating (for animations). */
|
|
1454
|
-
isPaginating: Accessor<boolean>;
|
|
1455
|
-
}
|
|
1456
|
-
/**
|
|
1457
|
-
* Provides state management for a calendar component.
|
|
1458
|
-
*/
|
|
1459
|
-
declare function createCalendarState<T extends DateValue = CalendarDate>(props?: CalendarStateProps<T>): CalendarState<T>;
|
|
1460
|
-
|
|
1461
|
-
/**
|
|
1462
|
-
* RangeCalendarState for Solid-Stately
|
|
1463
|
-
*
|
|
1464
|
-
* Provides state management for range calendar components.
|
|
1465
|
-
* Based on @react-stately/calendar useRangeCalendarState
|
|
1466
|
-
*/
|
|
1467
|
-
|
|
1468
|
-
interface DateRange {
|
|
1469
|
-
start: CalendarDate;
|
|
1470
|
-
end: CalendarDate;
|
|
1471
|
-
}
|
|
1472
|
-
interface RangeValue<T> {
|
|
1473
|
-
start: T;
|
|
1474
|
-
end: T;
|
|
1475
|
-
}
|
|
1476
|
-
interface RangeCalendarStateProps<T extends DateValue = DateValue> {
|
|
1477
|
-
/** The current value (controlled). */
|
|
1478
|
-
value?: MaybeAccessor<RangeValue<T> | null>;
|
|
1479
|
-
/** The default value (uncontrolled). */
|
|
1480
|
-
defaultValue?: RangeValue<T> | null;
|
|
1481
|
-
/** Handler called when the value changes. */
|
|
1482
|
-
onChange?: (value: RangeValue<T>) => void;
|
|
1483
|
-
/** The minimum allowed date. */
|
|
1484
|
-
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
1485
|
-
/** The maximum allowed date. */
|
|
1486
|
-
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
1487
|
-
/** Whether the calendar is disabled. */
|
|
1488
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
1489
|
-
/** Whether the calendar is read-only. */
|
|
1490
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
1491
|
-
/** The date that is focused when the calendar first mounts. */
|
|
1492
|
-
focusedValue?: MaybeAccessor<DateValue | undefined>;
|
|
1493
|
-
/** The default focused date (uncontrolled). */
|
|
1494
|
-
defaultFocusedValue?: DateValue;
|
|
1495
|
-
/** Handler called when the focused date changes. */
|
|
1496
|
-
onFocusChange?: (date: CalendarDate) => void;
|
|
1497
|
-
/** The locale to use for formatting. */
|
|
1498
|
-
locale?: string;
|
|
1499
|
-
/** Callback to determine if a date is unavailable. */
|
|
1500
|
-
isDateUnavailable?: (date: DateValue) => boolean;
|
|
1501
|
-
/** The number of months to display at once. */
|
|
1502
|
-
visibleMonths?: number;
|
|
1503
|
-
/** Controls which days are disabled. */
|
|
1504
|
-
isDateDisabled?: (date: DateValue) => boolean;
|
|
1505
|
-
/** Validation state. */
|
|
1506
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
1507
|
-
/** Whether to allow selecting the same date for start and end. */
|
|
1508
|
-
allowsNonContiguousRanges?: boolean;
|
|
1509
|
-
/** The first day of the week (0 = Sunday, 1 = Monday, etc.). */
|
|
1510
|
-
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1511
|
-
}
|
|
1512
|
-
interface RangeCalendarState<T extends DateValue = DateValue> {
|
|
1513
|
-
/** The currently selected date range. */
|
|
1514
|
-
value: Accessor<RangeValue<T> | null>;
|
|
1515
|
-
/** Sets the selected date range. */
|
|
1516
|
-
setValue: (value: RangeValue<T> | null) => void;
|
|
1517
|
-
/** The currently focused date. */
|
|
1518
|
-
focusedDate: Accessor<CalendarDate>;
|
|
1519
|
-
/** Sets the focused date. */
|
|
1520
|
-
setFocusedDate: (date: CalendarDate) => void;
|
|
1521
|
-
/** The anchor date when selecting a range (first click). */
|
|
1522
|
-
anchorDate: Accessor<CalendarDate | null>;
|
|
1523
|
-
/** Sets the anchor date. */
|
|
1524
|
-
setAnchorDate: (date: CalendarDate | null) => void;
|
|
1525
|
-
/** The highlighted range during selection. */
|
|
1526
|
-
highlightedRange: Accessor<RangeValue<CalendarDate> | null>;
|
|
1527
|
-
/** Whether the calendar is disabled. */
|
|
1528
|
-
isDisabled: Accessor<boolean>;
|
|
1529
|
-
/** Whether the calendar is read-only. */
|
|
1530
|
-
isReadOnly: Accessor<boolean>;
|
|
1531
|
-
/** The visible date range (first and last day of visible month(s)). */
|
|
1532
|
-
visibleRange: Accessor<{
|
|
1533
|
-
start: CalendarDate;
|
|
1534
|
-
end: CalendarDate;
|
|
1535
|
-
}>;
|
|
1536
|
-
/** The timezone used for date calculations. */
|
|
1537
|
-
timeZone: string;
|
|
1538
|
-
/** The validation state. */
|
|
1539
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
1540
|
-
/** Whether a date is within the selected range. */
|
|
1541
|
-
isSelected: (date: DateValue) => boolean;
|
|
1542
|
-
/** Whether a date is the start of the selection. */
|
|
1543
|
-
isSelectionStart: (date: DateValue) => boolean;
|
|
1544
|
-
/** Whether a date is the end of the selection. */
|
|
1545
|
-
isSelectionEnd: (date: DateValue) => boolean;
|
|
1546
|
-
/** Whether a date is focused. */
|
|
1547
|
-
isCellFocused: (date: DateValue) => boolean;
|
|
1548
|
-
/** Whether a date is unavailable. */
|
|
1549
|
-
isCellUnavailable: (date: DateValue) => boolean;
|
|
1550
|
-
/** Whether a date is disabled. */
|
|
1551
|
-
isCellDisabled: (date: DateValue) => boolean;
|
|
1552
|
-
/** Whether a date is outside the visible range. */
|
|
1553
|
-
isOutsideVisibleRange: (date: DateValue) => boolean;
|
|
1554
|
-
/** Whether a date is invalid. */
|
|
1555
|
-
isInvalid: (date: DateValue) => boolean;
|
|
1556
|
-
/** Moves focus to the previous page (month). */
|
|
1557
|
-
focusPreviousPage: () => void;
|
|
1558
|
-
/** Moves focus to the next page (month). */
|
|
1559
|
-
focusNextPage: () => void;
|
|
1560
|
-
/** Moves focus to the previous section (year). */
|
|
1561
|
-
focusPreviousSection: () => void;
|
|
1562
|
-
/** Moves focus to the next section (year). */
|
|
1563
|
-
focusNextSection: () => void;
|
|
1564
|
-
/** Moves focus to the previous day. */
|
|
1565
|
-
focusPreviousDay: () => void;
|
|
1566
|
-
/** Moves focus to the next day. */
|
|
1567
|
-
focusNextDay: () => void;
|
|
1568
|
-
/** Moves focus to the previous week. */
|
|
1569
|
-
focusPreviousWeek: () => void;
|
|
1570
|
-
/** Moves focus to the next week. */
|
|
1571
|
-
focusNextWeek: () => void;
|
|
1572
|
-
/** Moves focus to the start of the month. */
|
|
1573
|
-
focusPageStart: () => void;
|
|
1574
|
-
/** Moves focus to the end of the month. */
|
|
1575
|
-
focusPageEnd: () => void;
|
|
1576
|
-
/** Selects the focused date. */
|
|
1577
|
-
selectFocusedDate: () => void;
|
|
1578
|
-
/** Selects a specific date. */
|
|
1579
|
-
selectDate: (date: CalendarDate) => void;
|
|
1580
|
-
/** Whether focus is currently within the calendar. */
|
|
1581
|
-
isFocused: Accessor<boolean>;
|
|
1582
|
-
/** Sets whether focus is within the calendar. */
|
|
1583
|
-
setFocused: (focused: boolean) => void;
|
|
1584
|
-
/** Gets the dates for a week in the visible range. */
|
|
1585
|
-
getDatesInWeek: (weekIndex: number, monthStartDate?: CalendarDate) => (CalendarDate | null)[];
|
|
1586
|
-
/** Gets the number of weeks in a month. */
|
|
1587
|
-
getWeeksInMonth: (date?: CalendarDate) => number;
|
|
1588
|
-
/** The week day headers. */
|
|
1589
|
-
weekDays: Accessor<string[]>;
|
|
1590
|
-
/** The title for the calendar (formatted month and year). */
|
|
1591
|
-
title: Accessor<string>;
|
|
1592
|
-
/** The number of visible months. */
|
|
1593
|
-
visibleMonths: number;
|
|
1594
|
-
/** Whether the user is currently selecting a range. */
|
|
1595
|
-
isDragging: Accessor<boolean>;
|
|
1596
|
-
/** Sets whether the user is dragging to select. */
|
|
1597
|
-
setDragging: (dragging: boolean) => void;
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
|
-
* Provides state management for a range calendar component.
|
|
1601
|
-
*/
|
|
1602
|
-
declare function createRangeCalendarState<T extends DateValue = CalendarDate>(props?: RangeCalendarStateProps<T>): RangeCalendarState<T>;
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* DateFieldState for Solid-Stately
|
|
1606
|
-
*
|
|
1607
|
-
* Provides state management for date field components with segment-based editing.
|
|
1608
|
-
* Based on @react-stately/datepicker useDateFieldState
|
|
1609
|
-
*/
|
|
1610
|
-
|
|
1611
|
-
type DateSegmentType = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'era' | 'timeZoneName' | 'literal';
|
|
1612
|
-
interface DateSegment {
|
|
1613
|
-
/** The type of segment. */
|
|
1614
|
-
type: DateSegmentType;
|
|
1615
|
-
/** The text content of the segment. */
|
|
1616
|
-
text: string;
|
|
1617
|
-
/** The numeric value of the segment (if applicable). */
|
|
1618
|
-
value?: number;
|
|
1619
|
-
/** The minimum value for the segment. */
|
|
1620
|
-
minValue?: number;
|
|
1621
|
-
/** The maximum value for the segment. */
|
|
1622
|
-
maxValue?: number;
|
|
1623
|
-
/** Whether this segment is editable. */
|
|
1624
|
-
isEditable: boolean;
|
|
1625
|
-
/** Whether this segment is a placeholder. */
|
|
1626
|
-
isPlaceholder: boolean;
|
|
1627
|
-
/** A placeholder string for the segment. */
|
|
1628
|
-
placeholder: string;
|
|
1629
|
-
}
|
|
1630
|
-
interface DateFieldStateProps<T extends DateValue = DateValue> {
|
|
1631
|
-
/** The current value (controlled). */
|
|
1632
|
-
value?: MaybeAccessor<T | null>;
|
|
1633
|
-
/** The default value (uncontrolled). */
|
|
1634
|
-
defaultValue?: T | null;
|
|
1635
|
-
/** Handler called when the value changes. */
|
|
1636
|
-
onChange?: (value: T | null) => void;
|
|
1637
|
-
/** The minimum allowed date. */
|
|
1638
|
-
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
1639
|
-
/** The maximum allowed date. */
|
|
1640
|
-
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
1641
|
-
/** Whether the field is disabled. */
|
|
1642
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
1643
|
-
/** Whether the field is read-only. */
|
|
1644
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
1645
|
-
/** Whether the field is required. */
|
|
1646
|
-
isRequired?: MaybeAccessor<boolean>;
|
|
1647
|
-
/** The locale to use for formatting. */
|
|
1648
|
-
locale?: string;
|
|
1649
|
-
/** The granularity of the date/time (day, hour, minute, second). */
|
|
1650
|
-
granularity?: 'day' | 'hour' | 'minute' | 'second';
|
|
1651
|
-
/** Whether to show the hour in 12 or 24 hour format. */
|
|
1652
|
-
hourCycle?: 12 | 24;
|
|
1653
|
-
/** Whether to hide the time zone. */
|
|
1654
|
-
hideTimeZone?: boolean;
|
|
1655
|
-
/** The placeholder date (determines segment structure). */
|
|
1656
|
-
placeholderValue?: DateValue;
|
|
1657
|
-
/** Validation state. */
|
|
1658
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
1659
|
-
/** Description text. */
|
|
1660
|
-
description?: string;
|
|
1661
|
-
/** Error message. */
|
|
1662
|
-
errorMessage?: string;
|
|
1663
|
-
/** Whether dates outside the min/max range are allowed. */
|
|
1664
|
-
allowsNonContiguousRanges?: boolean;
|
|
1665
|
-
/** Whether to create a date or datetime. */
|
|
1666
|
-
createCalendar?: (name: string) => unknown;
|
|
1667
|
-
}
|
|
1668
|
-
interface DateFieldState<T extends DateValue = DateValue> {
|
|
1669
|
-
/** The current value. */
|
|
1670
|
-
value: Accessor<T | null>;
|
|
1671
|
-
/** The date value (may be partial during editing). */
|
|
1672
|
-
dateValue: Accessor<DateValue | null>;
|
|
1673
|
-
/** Sets the date value. */
|
|
1674
|
-
setValue: (value: T | null) => void;
|
|
1675
|
-
/** The segments that make up the date. */
|
|
1676
|
-
segments: Accessor<DateSegment[]>;
|
|
1677
|
-
/** The format string. */
|
|
1678
|
-
formatValue: (fieldOptions?: Intl.DateTimeFormatOptions) => string;
|
|
1679
|
-
/** Sets a segment value. */
|
|
1680
|
-
setSegment: (type: DateSegmentType, value: number) => void;
|
|
1681
|
-
/** Increments a segment. */
|
|
1682
|
-
incrementSegment: (type: DateSegmentType) => void;
|
|
1683
|
-
/** Decrements a segment. */
|
|
1684
|
-
decrementSegment: (type: DateSegmentType) => void;
|
|
1685
|
-
/** Clears a segment. */
|
|
1686
|
-
clearSegment: (type: DateSegmentType) => void;
|
|
1687
|
-
/** Confirms the value (after typing). */
|
|
1688
|
-
confirmPlaceholder: () => void;
|
|
1689
|
-
/** Whether the field is disabled. */
|
|
1690
|
-
isDisabled: Accessor<boolean>;
|
|
1691
|
-
/** Whether the field is read-only. */
|
|
1692
|
-
isReadOnly: Accessor<boolean>;
|
|
1693
|
-
/** Whether the field is required. */
|
|
1694
|
-
isRequired: Accessor<boolean>;
|
|
1695
|
-
/** The validation state. */
|
|
1696
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
1697
|
-
/** The granularity. */
|
|
1698
|
-
granularity: 'day' | 'hour' | 'minute' | 'second';
|
|
1699
|
-
/** Whether the value is invalid. */
|
|
1700
|
-
isInvalid: Accessor<boolean>;
|
|
1701
|
-
/** The locale. */
|
|
1702
|
-
locale: string;
|
|
1703
|
-
/** The time zone. */
|
|
1704
|
-
timeZone: string;
|
|
1705
|
-
}
|
|
1706
|
-
/**
|
|
1707
|
-
* Provides state management for a date field component.
|
|
1708
|
-
*/
|
|
1709
|
-
declare function createDateFieldState<T extends DateValue = CalendarDate>(props?: DateFieldStateProps<T>): DateFieldState<T>;
|
|
1710
|
-
|
|
1711
|
-
/**
|
|
1712
|
-
* TimeFieldState for Solid-Stately
|
|
1713
|
-
*
|
|
1714
|
-
* Provides state management for time field components with segment-based editing.
|
|
1715
|
-
* Based on @react-stately/datepicker useTimeFieldState
|
|
1716
|
-
*/
|
|
1717
|
-
|
|
1718
|
-
type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
|
1719
|
-
type TimeSegmentType = 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal';
|
|
1720
|
-
interface TimeSegment {
|
|
1721
|
-
/** The type of segment. */
|
|
1722
|
-
type: TimeSegmentType;
|
|
1723
|
-
/** The text content of the segment. */
|
|
1724
|
-
text: string;
|
|
1725
|
-
/** The numeric value of the segment (if applicable). */
|
|
1726
|
-
value?: number;
|
|
1727
|
-
/** The minimum value for the segment. */
|
|
1728
|
-
minValue?: number;
|
|
1729
|
-
/** The maximum value for the segment. */
|
|
1730
|
-
maxValue?: number;
|
|
1731
|
-
/** Whether this segment is editable. */
|
|
1732
|
-
isEditable: boolean;
|
|
1733
|
-
/** Whether this segment is a placeholder. */
|
|
1734
|
-
isPlaceholder: boolean;
|
|
1735
|
-
/** A placeholder string for the segment. */
|
|
1736
|
-
placeholder: string;
|
|
1737
|
-
}
|
|
1738
|
-
interface TimeFieldStateProps<T extends TimeValue = Time> {
|
|
1739
|
-
/** The current value (controlled). */
|
|
1740
|
-
value?: MaybeAccessor<T | null>;
|
|
1741
|
-
/** The default value (uncontrolled). */
|
|
1742
|
-
defaultValue?: T | null;
|
|
1743
|
-
/** Handler called when the value changes. */
|
|
1744
|
-
onChange?: (value: T | null) => void;
|
|
1745
|
-
/** The minimum allowed time. */
|
|
1746
|
-
minValue?: MaybeAccessor<TimeValue | undefined>;
|
|
1747
|
-
/** The maximum allowed time. */
|
|
1748
|
-
maxValue?: MaybeAccessor<TimeValue | undefined>;
|
|
1749
|
-
/** Whether the field is disabled. */
|
|
1750
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
1751
|
-
/** Whether the field is read-only. */
|
|
1752
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
1753
|
-
/** Whether the field is required. */
|
|
1754
|
-
isRequired?: MaybeAccessor<boolean>;
|
|
1755
|
-
/** The locale to use for formatting. */
|
|
1756
|
-
locale?: string;
|
|
1757
|
-
/** The granularity (hour, minute, second). */
|
|
1758
|
-
granularity?: 'hour' | 'minute' | 'second';
|
|
1759
|
-
/** Whether to show 12 or 24 hour format. */
|
|
1760
|
-
hourCycle?: 12 | 24;
|
|
1761
|
-
/** Validation state. */
|
|
1762
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
1763
|
-
/** The placeholder value. */
|
|
1764
|
-
placeholderValue?: T;
|
|
1765
|
-
}
|
|
1766
|
-
interface TimeFieldState<T extends TimeValue = Time> {
|
|
1767
|
-
/** The current value. */
|
|
1768
|
-
value: Accessor<T | null>;
|
|
1769
|
-
/** Sets the value. */
|
|
1770
|
-
setValue: (value: T | null) => void;
|
|
1771
|
-
/** The segments that make up the time. */
|
|
1772
|
-
segments: Accessor<TimeSegment[]>;
|
|
1773
|
-
/** Sets a segment value. */
|
|
1774
|
-
setSegment: (type: TimeSegmentType, value: number) => void;
|
|
1775
|
-
/** Increments a segment. */
|
|
1776
|
-
incrementSegment: (type: TimeSegmentType) => void;
|
|
1777
|
-
/** Decrements a segment. */
|
|
1778
|
-
decrementSegment: (type: TimeSegmentType) => void;
|
|
1779
|
-
/** Clears a segment. */
|
|
1780
|
-
clearSegment: (type: TimeSegmentType) => void;
|
|
1781
|
-
/** Whether the field is disabled. */
|
|
1782
|
-
isDisabled: Accessor<boolean>;
|
|
1783
|
-
/** Whether the field is read-only. */
|
|
1784
|
-
isReadOnly: Accessor<boolean>;
|
|
1785
|
-
/** Whether the field is required. */
|
|
1786
|
-
isRequired: Accessor<boolean>;
|
|
1787
|
-
/** The validation state. */
|
|
1788
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
1789
|
-
/** The granularity. */
|
|
1790
|
-
granularity: 'hour' | 'minute' | 'second';
|
|
1791
|
-
/** Whether the value is invalid. */
|
|
1792
|
-
isInvalid: Accessor<boolean>;
|
|
1793
|
-
/** The locale. */
|
|
1794
|
-
locale: string;
|
|
1795
|
-
/** The hour cycle. */
|
|
1796
|
-
hourCycle: 12 | 24;
|
|
1797
|
-
}
|
|
1798
|
-
/**
|
|
1799
|
-
* Provides state management for a time field component.
|
|
1800
|
-
*/
|
|
1801
|
-
declare function createTimeFieldState<T extends TimeValue = Time>(props?: TimeFieldStateProps<T>): TimeFieldState<T>;
|
|
1802
|
-
|
|
1803
|
-
/**
|
|
1804
|
-
* Grid collection types for Table and GridList components.
|
|
1805
|
-
* Based on @react-types/grid.
|
|
1806
|
-
*/
|
|
1807
|
-
|
|
1808
|
-
/**
|
|
1809
|
-
* Represents the type of a grid node.
|
|
1810
|
-
*/
|
|
1811
|
-
type GridNodeType = 'item' | 'cell' | 'column' | 'rowheader' | 'headerrow' | 'section' | 'placeholder';
|
|
1812
|
-
/**
|
|
1813
|
-
* Represents a node in a grid collection.
|
|
1814
|
-
*/
|
|
1815
|
-
interface GridNode<T = unknown> {
|
|
1816
|
-
/** The type of grid node. */
|
|
1817
|
-
type: GridNodeType;
|
|
1818
|
-
/** A unique key for the node. */
|
|
1819
|
-
key: Key$1;
|
|
1820
|
-
/** The original value/data for this node. */
|
|
1821
|
-
value: T | null;
|
|
1822
|
-
/** The text content for accessibility and typeahead. */
|
|
1823
|
-
textValue: string;
|
|
1824
|
-
/** The rendered content (JSX) - optional for programmatic nodes. */
|
|
1825
|
-
rendered?: unknown;
|
|
1826
|
-
/** The level of nesting (0 for top-level). */
|
|
1827
|
-
level: number;
|
|
1828
|
-
/** The index within the parent. */
|
|
1829
|
-
index: number;
|
|
1830
|
-
/** The key of the parent node, if any. */
|
|
1831
|
-
parentKey?: Key$1 | null;
|
|
1832
|
-
/** Whether this node has child nodes. */
|
|
1833
|
-
hasChildNodes: boolean;
|
|
1834
|
-
/** Child nodes (cells for rows, rows for sections). */
|
|
1835
|
-
childNodes: GridNode<T>[];
|
|
1836
|
-
/** Whether this item is disabled. */
|
|
1837
|
-
isDisabled?: boolean;
|
|
1838
|
-
/** ARIA label for this node. */
|
|
1839
|
-
'aria-label'?: string;
|
|
1840
|
-
/** Additional props for the node. */
|
|
1841
|
-
props?: Record<string, unknown>;
|
|
1842
|
-
/** Column index for cells. */
|
|
1843
|
-
column?: number;
|
|
1844
|
-
/** Column span for cells. */
|
|
1845
|
-
colspan?: number;
|
|
1846
|
-
/** Row index. */
|
|
1847
|
-
rowIndex?: number;
|
|
1848
|
-
/** Whether this row can be expanded (for tree grids). */
|
|
1849
|
-
isExpandable?: boolean;
|
|
1850
|
-
/** Whether this row is expanded. */
|
|
1851
|
-
isExpanded?: boolean;
|
|
1852
|
-
}
|
|
1853
|
-
/**
|
|
1854
|
-
* A collection of grid nodes with grid-specific navigation.
|
|
1855
|
-
*/
|
|
1856
|
-
interface GridCollection<T = unknown> {
|
|
1857
|
-
/** The number of items in the collection. */
|
|
1858
|
-
readonly size: number;
|
|
1859
|
-
/** All rows in the grid (including header rows). */
|
|
1860
|
-
readonly rows: GridNode<T>[];
|
|
1861
|
-
/** All column definitions. */
|
|
1862
|
-
readonly columns: GridNode<T>[];
|
|
1863
|
-
/** Number of header rows. */
|
|
1864
|
-
readonly headerRows: GridNode<T>[];
|
|
1865
|
-
/** Number of body rows (excluding headers). */
|
|
1866
|
-
readonly rowCount: number;
|
|
1867
|
-
/** Number of columns. */
|
|
1868
|
-
readonly columnCount: number;
|
|
1869
|
-
/** Get all keys in the collection. */
|
|
1870
|
-
getKeys(): Iterable<Key$1>;
|
|
1871
|
-
/** Get a node by its key. */
|
|
1872
|
-
getItem(key: Key$1): GridNode<T> | null;
|
|
1873
|
-
/** Get a node by index. */
|
|
1874
|
-
at(index: number): GridNode<T> | null;
|
|
1875
|
-
/** Get the key before the given key. */
|
|
1876
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
1877
|
-
/** Get the key after the given key. */
|
|
1878
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
1879
|
-
/** Get the first key in the collection. */
|
|
1880
|
-
getFirstKey(): Key$1 | null;
|
|
1881
|
-
/** Get the last key in the collection. */
|
|
1882
|
-
getLastKey(): Key$1 | null;
|
|
1883
|
-
/** Get the children of a node. */
|
|
1884
|
-
getChildren(key: Key$1): Iterable<GridNode<T>>;
|
|
1885
|
-
/** Get the text value for a key. */
|
|
1886
|
-
getTextValue(key: Key$1): string;
|
|
1887
|
-
/** Get a cell by row and column key. */
|
|
1888
|
-
getCell(rowKey: Key$1, columnKey: Key$1): GridNode<T> | null;
|
|
1889
|
-
/** Iterator over all nodes. */
|
|
1890
|
-
[Symbol.iterator](): Iterator<GridNode<T>>;
|
|
1891
|
-
}
|
|
1892
|
-
/**
|
|
1893
|
-
* State for a grid component.
|
|
1894
|
-
*/
|
|
1895
|
-
interface GridState<T, C extends GridCollection<T> = GridCollection<T>> {
|
|
1896
|
-
/** The grid collection. */
|
|
1897
|
-
readonly collection: C;
|
|
1898
|
-
/** Keys of disabled rows. */
|
|
1899
|
-
readonly disabledKeys: Set<Key$1>;
|
|
1900
|
-
/** Whether keyboard navigation is disabled. */
|
|
1901
|
-
readonly isKeyboardNavigationDisabled: boolean;
|
|
1902
|
-
/** Currently focused key. */
|
|
1903
|
-
readonly focusedKey: Key$1 | null;
|
|
1904
|
-
/** Focus strategy for child focus. */
|
|
1905
|
-
readonly childFocusStrategy: FocusStrategy | null;
|
|
1906
|
-
/** Whether the grid is focused. */
|
|
1907
|
-
readonly isFocused: boolean;
|
|
1908
|
-
/** The selection mode. */
|
|
1909
|
-
readonly selectionMode: 'none' | 'single' | 'multiple';
|
|
1910
|
-
/** The currently selected keys. */
|
|
1911
|
-
readonly selectedKeys: 'all' | Set<Key$1>;
|
|
1912
|
-
/** Check if a key is selected. */
|
|
1913
|
-
isSelected(key: Key$1): boolean;
|
|
1914
|
-
/** Check if a key is disabled. */
|
|
1915
|
-
isDisabled(key: Key$1): boolean;
|
|
1916
|
-
/** Set the focused key. */
|
|
1917
|
-
setFocusedKey(key: Key$1 | null, childFocusStrategy?: FocusStrategy): void;
|
|
1918
|
-
/** Set focused state. */
|
|
1919
|
-
setFocused(isFocused: boolean): void;
|
|
1920
|
-
/** Toggle selection for a key. */
|
|
1921
|
-
toggleSelection(key: Key$1): void;
|
|
1922
|
-
/** Replace selection with a key. */
|
|
1923
|
-
replaceSelection(key: Key$1): void;
|
|
1924
|
-
/** Extend selection to a key (shift-click). */
|
|
1925
|
-
extendSelection(toKey: Key$1): void;
|
|
1926
|
-
/** Select all rows. */
|
|
1927
|
-
selectAll(): void;
|
|
1928
|
-
/** Clear selection. */
|
|
1929
|
-
clearSelection(): void;
|
|
1930
|
-
/** Toggle select all. */
|
|
1931
|
-
toggleSelectAll(): void;
|
|
1932
|
-
/** Set keyboard navigation disabled. */
|
|
1933
|
-
setKeyboardNavigationDisabled(isDisabled: boolean): void;
|
|
1934
|
-
}
|
|
1935
|
-
/**
|
|
1936
|
-
* Options for creating grid state.
|
|
1937
|
-
*/
|
|
1938
|
-
interface GridStateOptions<T, C extends GridCollection<T> = GridCollection<T>> {
|
|
1939
|
-
/** The grid collection. */
|
|
1940
|
-
collection: C;
|
|
1941
|
-
/** Keys of disabled rows. */
|
|
1942
|
-
disabledKeys?: Iterable<Key$1>;
|
|
1943
|
-
/** Focus mode: 'row' or 'cell'. */
|
|
1944
|
-
focusMode?: 'row' | 'cell';
|
|
1945
|
-
/** Selection mode. */
|
|
1946
|
-
selectionMode?: 'none' | 'single' | 'multiple';
|
|
1947
|
-
/** Selection behavior. */
|
|
1948
|
-
selectionBehavior?: 'toggle' | 'replace';
|
|
1949
|
-
/** Whether empty selection is disallowed. */
|
|
1950
|
-
disallowEmptySelection?: boolean;
|
|
1951
|
-
/** Currently selected keys (controlled). */
|
|
1952
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
1953
|
-
/** Default selected keys (uncontrolled). */
|
|
1954
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
1955
|
-
/** Handler for selection changes. */
|
|
1956
|
-
onSelectionChange?: (keys: 'all' | Set<Key$1>) => void;
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
/**
|
|
1960
|
-
* Grid state management for Table and GridList components.
|
|
1961
|
-
* Based on @react-stately/grid/useGridState.
|
|
1962
|
-
*/
|
|
1963
|
-
|
|
1964
|
-
/**
|
|
1965
|
-
* Creates state management for a grid component.
|
|
1966
|
-
* Handles row selection, focus management, and keyboard navigation state.
|
|
1967
|
-
*/
|
|
1968
|
-
declare function createGridState<T extends object, C extends GridCollection<T> = GridCollection<T>>(options: Accessor<GridStateOptions<T, C>>): GridState<T, C>;
|
|
1969
|
-
|
|
1970
|
-
/**
|
|
1971
|
-
* Table state types for Table components.
|
|
1972
|
-
* Based on @react-stately/table and @react-types/table.
|
|
1973
|
-
*/
|
|
1974
|
-
|
|
1975
|
-
/**
|
|
1976
|
-
* Sort direction for table columns.
|
|
1977
|
-
*/
|
|
1978
|
-
type SortDirection = 'ascending' | 'descending';
|
|
1979
|
-
/**
|
|
1980
|
-
* Describes which column to sort by and in what direction.
|
|
1981
|
-
*/
|
|
1982
|
-
interface SortDescriptor {
|
|
1983
|
-
/** The key of the column to sort by. */
|
|
1984
|
-
column: Key$1;
|
|
1985
|
-
/** The direction to sort by. */
|
|
1986
|
-
direction: SortDirection;
|
|
1987
|
-
}
|
|
1988
|
-
/**
|
|
1989
|
-
* Interface for sortable components.
|
|
1990
|
-
*/
|
|
1991
|
-
interface Sortable {
|
|
1992
|
-
/** The current sorted column and direction. */
|
|
1993
|
-
sortDescriptor?: SortDescriptor;
|
|
1994
|
-
/** Handler that is called when the sorted column or direction changes. */
|
|
1995
|
-
onSortChange?: (descriptor: SortDescriptor) => void;
|
|
1996
|
-
}
|
|
1997
|
-
/**
|
|
1998
|
-
* A collection of table rows and columns.
|
|
1999
|
-
* Extends GridCollection with table-specific metadata.
|
|
2000
|
-
*/
|
|
2001
|
-
interface TableCollection$1<T = unknown> extends GridCollection<T> {
|
|
2002
|
-
/** A list of header row nodes in the table. */
|
|
2003
|
-
readonly headerRows: GridNode<T>[];
|
|
2004
|
-
/** A list of column nodes in the table. */
|
|
2005
|
-
readonly columns: GridNode<T>[];
|
|
2006
|
-
/** A set of column keys that serve as the row header. */
|
|
2007
|
-
readonly rowHeaderColumnKeys: Set<Key$1>;
|
|
2008
|
-
/** The node that makes up the header of the table. */
|
|
2009
|
-
readonly head?: GridNode<T>;
|
|
2010
|
-
/** The node that makes up the body of the table. */
|
|
2011
|
-
readonly body: GridNode<T>;
|
|
2012
|
-
}
|
|
2013
|
-
/**
|
|
2014
|
-
* State for a table component.
|
|
2015
|
-
* Extends GridState with table-specific functionality.
|
|
2016
|
-
*/
|
|
2017
|
-
interface TableState<T, C extends TableCollection$1<T> = TableCollection$1<T>> extends Omit<GridState<T, GridCollection<T>>, 'collection'> {
|
|
2018
|
-
/** The table collection. */
|
|
2019
|
-
readonly collection: C;
|
|
2020
|
-
/** Whether the row selection checkboxes should be displayed. */
|
|
2021
|
-
readonly showSelectionCheckboxes: boolean;
|
|
2022
|
-
/** The current sorted column and direction. */
|
|
2023
|
-
readonly sortDescriptor: SortDescriptor | null;
|
|
2024
|
-
/** Sort by the given column and direction. */
|
|
2025
|
-
sort(columnKey: Key$1, direction?: SortDirection): void;
|
|
2026
|
-
}
|
|
2027
|
-
/**
|
|
2028
|
-
* Options for creating table state.
|
|
2029
|
-
*/
|
|
2030
|
-
interface TableStateOptions<T, C extends TableCollection$1<T> = TableCollection$1<T>> extends Sortable {
|
|
2031
|
-
/** The table collection. */
|
|
2032
|
-
collection: C;
|
|
2033
|
-
/** Keys of disabled rows. */
|
|
2034
|
-
disabledKeys?: Iterable<Key$1>;
|
|
2035
|
-
/** Focus mode: 'row' or 'cell'. */
|
|
2036
|
-
focusMode?: 'row' | 'cell';
|
|
2037
|
-
/** Selection mode. */
|
|
2038
|
-
selectionMode?: 'none' | 'single' | 'multiple';
|
|
2039
|
-
/** Selection behavior. */
|
|
2040
|
-
selectionBehavior?: 'toggle' | 'replace';
|
|
2041
|
-
/** Whether empty selection is disallowed. */
|
|
2042
|
-
disallowEmptySelection?: boolean;
|
|
2043
|
-
/** Currently selected keys (controlled). */
|
|
2044
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
2045
|
-
/** Default selected keys (uncontrolled). */
|
|
2046
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
2047
|
-
/** Handler for selection changes. */
|
|
2048
|
-
onSelectionChange?: (keys: 'all' | Set<Key$1>) => void;
|
|
2049
|
-
/** Whether the row selection checkboxes should be displayed. */
|
|
2050
|
-
showSelectionCheckboxes?: boolean;
|
|
2051
|
-
}
|
|
2052
|
-
/**
|
|
2053
|
-
* Column definition for building table collections.
|
|
2054
|
-
*/
|
|
2055
|
-
interface ColumnDefinition<T = unknown> {
|
|
2056
|
-
/** The key for the column. */
|
|
2057
|
-
key: Key$1;
|
|
2058
|
-
/** The display name or rendered content. */
|
|
2059
|
-
name?: string;
|
|
2060
|
-
/** Text value for accessibility. */
|
|
2061
|
-
textValue?: string;
|
|
2062
|
-
/** Whether this column is a row header. */
|
|
2063
|
-
isRowHeader?: boolean;
|
|
2064
|
-
/** Whether this column allows sorting. */
|
|
2065
|
-
allowsSorting?: boolean;
|
|
2066
|
-
/** Child columns (for column groups). */
|
|
2067
|
-
children?: ColumnDefinition<T>[];
|
|
2068
|
-
/** Width of the column. */
|
|
2069
|
-
width?: number | string;
|
|
2070
|
-
/** Minimum width of the column. */
|
|
2071
|
-
minWidth?: number;
|
|
2072
|
-
/** Maximum width of the column. */
|
|
2073
|
-
maxWidth?: number;
|
|
2074
|
-
}
|
|
2075
|
-
/**
|
|
2076
|
-
* Row definition for building table collections.
|
|
2077
|
-
*/
|
|
2078
|
-
interface RowDefinition<T = unknown> {
|
|
2079
|
-
/** The key for the row. */
|
|
2080
|
-
key: Key$1;
|
|
2081
|
-
/** The data value for the row. */
|
|
2082
|
-
value: T;
|
|
2083
|
-
/** Text value for accessibility/search. */
|
|
2084
|
-
textValue?: string;
|
|
2085
|
-
/** Whether this row has child rows (for tree tables). */
|
|
2086
|
-
hasChildRows?: boolean;
|
|
2087
|
-
/** Child rows (for tree tables). */
|
|
2088
|
-
childRows?: RowDefinition<T>[];
|
|
2089
|
-
}
|
|
2090
|
-
/**
|
|
2091
|
-
* Options for building a table collection.
|
|
2092
|
-
*/
|
|
2093
|
-
interface TableCollectionOptions<T = unknown> {
|
|
2094
|
-
/** Column definitions. */
|
|
2095
|
-
columns: ColumnDefinition<T>[];
|
|
2096
|
-
/** Row definitions or data items. */
|
|
2097
|
-
rows: RowDefinition<T>[] | T[];
|
|
2098
|
-
/** Function to get the key from a data item. */
|
|
2099
|
-
getKey?: (item: T) => Key$1;
|
|
2100
|
-
/** Function to get the text value from a data item. */
|
|
2101
|
-
getTextValue?: (item: T, column: ColumnDefinition<T>) => string;
|
|
2102
|
-
/** Whether to show selection checkboxes. */
|
|
2103
|
-
showSelectionCheckboxes?: boolean;
|
|
2104
|
-
/** Set of column keys that serve as row headers. */
|
|
2105
|
-
rowHeaderColumnKeys?: Set<Key$1>;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
/**
|
|
2109
|
-
* Table state management for Table components.
|
|
2110
|
-
* Based on @react-stately/table/useTableState.
|
|
2111
|
-
*/
|
|
2112
|
-
|
|
2113
|
-
/**
|
|
2114
|
-
* Creates state management for a table component.
|
|
2115
|
-
* Extends grid state with sorting and table-specific features.
|
|
2116
|
-
*/
|
|
2117
|
-
declare function createTableState<T extends object, C extends TableCollection$1<T> = TableCollection$1<T>>(options: Accessor<TableStateOptions<T, C>>): TableState<T, C>;
|
|
2118
|
-
|
|
2119
|
-
/**
|
|
2120
|
-
* TableCollection - A collection class for table data.
|
|
2121
|
-
* Based on @react-stately/table/TableCollection.
|
|
2122
|
-
*/
|
|
2123
|
-
|
|
2124
|
-
/**
|
|
2125
|
-
* Creates a table collection from column and row definitions.
|
|
2126
|
-
*/
|
|
2127
|
-
declare class TableCollection<T = unknown> implements TableCollection$1<T> {
|
|
2128
|
-
private _columns;
|
|
2129
|
-
private _rows;
|
|
2130
|
-
private _headerRows;
|
|
2131
|
-
private _body;
|
|
2132
|
-
private _head;
|
|
2133
|
-
private _keyMap;
|
|
2134
|
-
private _rowHeaderColumnKeys;
|
|
2135
|
-
private _size;
|
|
2136
|
-
constructor(options: TableCollectionOptions<T>);
|
|
2137
|
-
private buildColumns;
|
|
2138
|
-
private buildColumnNode;
|
|
2139
|
-
private getDefaultRowHeaderColumnKeys;
|
|
2140
|
-
private buildHeaderRows;
|
|
2141
|
-
private buildRows;
|
|
2142
|
-
private isRowDefinition;
|
|
2143
|
-
get size(): number;
|
|
2144
|
-
get rows(): GridNode<T>[];
|
|
2145
|
-
get columns(): GridNode<T>[];
|
|
2146
|
-
get headerRows(): GridNode<T>[];
|
|
2147
|
-
get head(): GridNode<T> | undefined;
|
|
2148
|
-
get body(): GridNode<T>;
|
|
2149
|
-
get rowCount(): number;
|
|
2150
|
-
get columnCount(): number;
|
|
2151
|
-
get rowHeaderColumnKeys(): Set<Key$1>;
|
|
2152
|
-
getKeys(): Iterable<Key$1>;
|
|
2153
|
-
getItem(key: Key$1): GridNode<T> | null;
|
|
2154
|
-
at(index: number): GridNode<T> | null;
|
|
2155
|
-
getChildren(key: Key$1): Iterable<GridNode<T>>;
|
|
2156
|
-
getTextValue(key: Key$1): string;
|
|
2157
|
-
getCell(rowKey: Key$1, columnKey: Key$1): GridNode<T> | null;
|
|
2158
|
-
getFirstKey(): Key$1 | null;
|
|
2159
|
-
getLastKey(): Key$1 | null;
|
|
2160
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
2161
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
2162
|
-
[Symbol.iterator](): Iterator<GridNode<T>>;
|
|
2163
|
-
}
|
|
2164
|
-
/**
|
|
2165
|
-
* Creates a table collection from options.
|
|
2166
|
-
*/
|
|
2167
|
-
declare function createTableCollection<T>(options: TableCollectionOptions<T>): TableCollection<T>;
|
|
2168
|
-
|
|
2169
|
-
/**
|
|
2170
|
-
* Tree collection types for Tree components.
|
|
2171
|
-
* Based on @react-stately/tree.
|
|
2172
|
-
*/
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
* Represents a node in a tree collection.
|
|
2176
|
-
* Extends GridNode with tree-specific properties.
|
|
2177
|
-
*/
|
|
2178
|
-
interface TreeNode<T = unknown> extends GridNode<T> {
|
|
2179
|
-
/** Whether this node has child nodes that can be expanded. */
|
|
2180
|
-
hasChildNodes: boolean;
|
|
2181
|
-
/** Child nodes of this tree item. */
|
|
2182
|
-
childNodes: TreeNode<T>[];
|
|
2183
|
-
/** The level of nesting (0 for root items). */
|
|
2184
|
-
level: number;
|
|
2185
|
-
/** The key of the parent node, if any. */
|
|
2186
|
-
parentKey?: Key$1 | null;
|
|
2187
|
-
/** Whether this node is expandable. */
|
|
2188
|
-
isExpandable?: boolean;
|
|
2189
|
-
/** Whether this node is currently expanded (only meaningful if expandable). */
|
|
2190
|
-
isExpanded?: boolean;
|
|
2191
|
-
}
|
|
2192
|
-
/**
|
|
2193
|
-
* A collection of tree nodes with tree-specific navigation.
|
|
2194
|
-
* Only includes visible nodes (respects expanded state).
|
|
2195
|
-
*/
|
|
2196
|
-
interface TreeCollection$1<T = unknown> extends Omit<GridCollection<T>, 'rows' | 'columns' | 'headerRows' | 'columnCount' | 'getCell'> {
|
|
2197
|
-
/** All visible rows in the tree (respects expanded state). */
|
|
2198
|
-
readonly rows: TreeNode<T>[];
|
|
2199
|
-
/** Number of visible rows. */
|
|
2200
|
-
readonly rowCount: number;
|
|
2201
|
-
/** Get all keys in the collection (visible only). */
|
|
2202
|
-
getKeys(): Iterable<Key$1>;
|
|
2203
|
-
/** Get a node by its key (any node, visible or not). */
|
|
2204
|
-
getItem(key: Key$1): TreeNode<T> | null;
|
|
2205
|
-
/** Get a node by index (visible nodes only). */
|
|
2206
|
-
at(index: number): TreeNode<T> | null;
|
|
2207
|
-
/** Get the key before the given key (visible nodes only). */
|
|
2208
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
2209
|
-
/** Get the key after the given key (visible nodes only). */
|
|
2210
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
2211
|
-
/** Get the first key in the collection. */
|
|
2212
|
-
getFirstKey(): Key$1 | null;
|
|
2213
|
-
/** Get the last key in the collection. */
|
|
2214
|
-
getLastKey(): Key$1 | null;
|
|
2215
|
-
/** Get the children of a node. */
|
|
2216
|
-
getChildren(key: Key$1): Iterable<TreeNode<T>>;
|
|
2217
|
-
/** Get the text value for a key. */
|
|
2218
|
-
getTextValue(key: Key$1): string;
|
|
2219
|
-
/** Get the parent key for a node. */
|
|
2220
|
-
getParentKey(key: Key$1): Key$1 | null;
|
|
2221
|
-
/** Iterator over visible nodes. */
|
|
2222
|
-
[Symbol.iterator](): Iterator<TreeNode<T>>;
|
|
2223
|
-
}
|
|
2224
|
-
/**
|
|
2225
|
-
* State for a tree component.
|
|
2226
|
-
* Extends grid state with expansion management.
|
|
2227
|
-
*/
|
|
2228
|
-
interface TreeState<T, C extends TreeCollection$1<T> = TreeCollection$1<T>> {
|
|
2229
|
-
/** The tree collection (only visible nodes). */
|
|
2230
|
-
readonly collection: C;
|
|
2231
|
-
/** Keys of disabled items. */
|
|
2232
|
-
readonly disabledKeys: Set<Key$1>;
|
|
2233
|
-
/** Keys of expanded items. */
|
|
2234
|
-
readonly expandedKeys: Set<Key$1>;
|
|
2235
|
-
/** Whether keyboard navigation is disabled. */
|
|
2236
|
-
readonly isKeyboardNavigationDisabled: boolean;
|
|
2237
|
-
/** Currently focused key. */
|
|
2238
|
-
readonly focusedKey: Key$1 | null;
|
|
2239
|
-
/** Focus strategy for child focus. */
|
|
2240
|
-
readonly childFocusStrategy: FocusStrategy | null;
|
|
2241
|
-
/** Whether the tree is focused. */
|
|
2242
|
-
readonly isFocused: boolean;
|
|
2243
|
-
/** The selection mode. */
|
|
2244
|
-
readonly selectionMode: 'none' | 'single' | 'multiple';
|
|
2245
|
-
/** The currently selected keys. */
|
|
2246
|
-
readonly selectedKeys: 'all' | Set<Key$1>;
|
|
2247
|
-
/** Check if a key is selected. */
|
|
2248
|
-
isSelected(key: Key$1): boolean;
|
|
2249
|
-
/** Check if a key is disabled. */
|
|
2250
|
-
isDisabled(key: Key$1): boolean;
|
|
2251
|
-
/** Check if a key is expanded. */
|
|
2252
|
-
isExpanded(key: Key$1): boolean;
|
|
2253
|
-
/** Set the focused key. */
|
|
2254
|
-
setFocusedKey(key: Key$1 | null, childFocusStrategy?: FocusStrategy): void;
|
|
2255
|
-
/** Set focused state. */
|
|
2256
|
-
setFocused(isFocused: boolean): void;
|
|
2257
|
-
/** Toggle selection for a key. */
|
|
2258
|
-
toggleSelection(key: Key$1): void;
|
|
2259
|
-
/** Replace selection with a key. */
|
|
2260
|
-
replaceSelection(key: Key$1): void;
|
|
2261
|
-
/** Extend selection to a key (shift-click). */
|
|
2262
|
-
extendSelection(toKey: Key$1): void;
|
|
2263
|
-
/** Select all visible items. */
|
|
2264
|
-
selectAll(): void;
|
|
2265
|
-
/** Clear selection. */
|
|
2266
|
-
clearSelection(): void;
|
|
2267
|
-
/** Toggle select all. */
|
|
2268
|
-
toggleSelectAll(): void;
|
|
2269
|
-
/** Toggle expansion for a key. */
|
|
2270
|
-
toggleKey(key: Key$1): void;
|
|
2271
|
-
/** Expand a key. */
|
|
2272
|
-
expandKey(key: Key$1): void;
|
|
2273
|
-
/** Collapse a key. */
|
|
2274
|
-
collapseKey(key: Key$1): void;
|
|
2275
|
-
/** Set the expanded keys. */
|
|
2276
|
-
setExpandedKeys(keys: Set<Key$1>): void;
|
|
2277
|
-
/** Set keyboard navigation disabled. */
|
|
2278
|
-
setKeyboardNavigationDisabled(isDisabled: boolean): void;
|
|
2279
|
-
}
|
|
2280
|
-
/**
|
|
2281
|
-
* Options for creating tree state.
|
|
2282
|
-
*/
|
|
2283
|
-
interface TreeStateOptions<T, C extends TreeCollection$1<T> = TreeCollection$1<T>> {
|
|
2284
|
-
/** The tree collection builder - receives expanded keys and returns collection. */
|
|
2285
|
-
collectionFactory: (expandedKeys: Set<Key$1>) => C;
|
|
2286
|
-
/** Keys of disabled items. */
|
|
2287
|
-
disabledKeys?: Iterable<Key$1>;
|
|
2288
|
-
/** Disabled behavior: 'selection' only or 'all' interactions. */
|
|
2289
|
-
disabledBehavior?: 'selection' | 'all';
|
|
2290
|
-
/** Selection mode. */
|
|
2291
|
-
selectionMode?: 'none' | 'single' | 'multiple';
|
|
2292
|
-
/** Selection behavior. */
|
|
2293
|
-
selectionBehavior?: 'toggle' | 'replace';
|
|
2294
|
-
/** Whether empty selection is disallowed. */
|
|
2295
|
-
disallowEmptySelection?: boolean;
|
|
2296
|
-
/** Currently selected keys (controlled). */
|
|
2297
|
-
selectedKeys?: 'all' | Iterable<Key$1>;
|
|
2298
|
-
/** Default selected keys (uncontrolled). */
|
|
2299
|
-
defaultSelectedKeys?: 'all' | Iterable<Key$1>;
|
|
2300
|
-
/** Handler for selection changes. */
|
|
2301
|
-
onSelectionChange?: (keys: 'all' | Set<Key$1>) => void;
|
|
2302
|
-
/** Currently expanded keys (controlled). */
|
|
2303
|
-
expandedKeys?: Iterable<Key$1>;
|
|
2304
|
-
/** Default expanded keys (uncontrolled). */
|
|
2305
|
-
defaultExpandedKeys?: Iterable<Key$1>;
|
|
2306
|
-
/** Handler for expansion changes. */
|
|
2307
|
-
onExpandedChange?: (keys: Set<Key$1>) => void;
|
|
2308
|
-
}
|
|
2309
|
-
/**
|
|
2310
|
-
* Item representation for building tree collections.
|
|
2311
|
-
*/
|
|
2312
|
-
interface TreeItemData<T = unknown> {
|
|
2313
|
-
/** Unique key for this item. */
|
|
2314
|
-
key: Key$1;
|
|
2315
|
-
/** The data value for this item. */
|
|
2316
|
-
value: T;
|
|
2317
|
-
/** Text content for accessibility and search. */
|
|
2318
|
-
textValue?: string;
|
|
2319
|
-
/** Child items (makes this item expandable). */
|
|
2320
|
-
children?: TreeItemData<T>[];
|
|
2321
|
-
/** Whether this item is disabled. */
|
|
2322
|
-
isDisabled?: boolean;
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
/**
|
|
2326
|
-
* Tree state management for Tree components.
|
|
2327
|
-
* Based on @react-stately/tree/useTreeState.
|
|
2328
|
-
*
|
|
2329
|
-
* Manages expansion state, selection, and focus for hierarchical tree data.
|
|
2330
|
-
*/
|
|
2331
|
-
|
|
2332
|
-
/**
|
|
2333
|
-
* Creates state management for a tree component.
|
|
2334
|
-
* Handles expansion, selection, focus management, and keyboard navigation state.
|
|
2335
|
-
*/
|
|
2336
|
-
declare function createTreeState<T extends object, C extends TreeCollection$1<T> = TreeCollection$1<T>>(options: Accessor<TreeStateOptions<T, C>>): TreeState<T, C>;
|
|
2337
|
-
|
|
2338
|
-
/**
|
|
2339
|
-
* TreeCollection implementation.
|
|
2340
|
-
* Based on @react-stately/tree/TreeCollection.
|
|
2341
|
-
*
|
|
2342
|
-
* A flattened view of tree nodes that respects expanded state.
|
|
2343
|
-
* Only visible nodes (root + expanded children) are included in iteration.
|
|
2344
|
-
*/
|
|
2345
|
-
|
|
2346
|
-
/**
|
|
2347
|
-
* Creates a TreeCollection from hierarchical data.
|
|
2348
|
-
* The collection is flattened based on expanded keys.
|
|
2349
|
-
*/
|
|
2350
|
-
declare class TreeCollection<T> implements TreeCollection$1<T> {
|
|
2351
|
-
private keyMap;
|
|
2352
|
-
private visibleKeys;
|
|
2353
|
-
private _rows;
|
|
2354
|
-
constructor(items: TreeItemData<T>[], expandedKeys: Set<Key$1>);
|
|
2355
|
-
private buildCollection;
|
|
2356
|
-
get size(): number;
|
|
2357
|
-
get rows(): TreeNode<T>[];
|
|
2358
|
-
get rowCount(): number;
|
|
2359
|
-
getKeys(): Iterable<Key$1>;
|
|
2360
|
-
getItem(key: Key$1): TreeNode<T> | null;
|
|
2361
|
-
at(index: number): TreeNode<T> | null;
|
|
2362
|
-
getKeyBefore(key: Key$1): Key$1 | null;
|
|
2363
|
-
getKeyAfter(key: Key$1): Key$1 | null;
|
|
2364
|
-
getFirstKey(): Key$1 | null;
|
|
2365
|
-
getLastKey(): Key$1 | null;
|
|
2366
|
-
getChildren(key: Key$1): Iterable<TreeNode<T>>;
|
|
2367
|
-
getTextValue(key: Key$1): string;
|
|
2368
|
-
getParentKey(key: Key$1): Key$1 | null;
|
|
2369
|
-
[Symbol.iterator](): Iterator<TreeNode<T>>;
|
|
2370
|
-
}
|
|
2371
|
-
/**
|
|
2372
|
-
* Factory function to create a TreeCollection.
|
|
2373
|
-
* Useful for the collectionFactory pattern in TreeStateOptions.
|
|
2374
|
-
*/
|
|
2375
|
-
declare function createTreeCollection<T>(items: TreeItemData<T>[], expandedKeys: Set<Key$1>): TreeCollection<T>;
|
|
2376
|
-
|
|
2377
|
-
/**
|
|
2378
|
-
* Color types for color picker components.
|
|
2379
|
-
* Based on @react-stately/color.
|
|
2380
|
-
*/
|
|
2381
|
-
/**
|
|
2382
|
-
* Supported color formats.
|
|
2383
|
-
*/
|
|
2384
|
-
type ColorFormat = 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsb' | 'hsba';
|
|
2385
|
-
/**
|
|
2386
|
-
* Color spaces.
|
|
2387
|
-
*/
|
|
2388
|
-
type ColorSpace = 'rgb' | 'hsl' | 'hsb';
|
|
2389
|
-
/**
|
|
2390
|
-
* Color channels.
|
|
2391
|
-
*/
|
|
2392
|
-
type ColorChannel = 'hue' | 'saturation' | 'brightness' | 'lightness' | 'red' | 'green' | 'blue' | 'alpha';
|
|
2393
|
-
/**
|
|
2394
|
-
* Range for a color channel.
|
|
2395
|
-
*/
|
|
2396
|
-
interface ColorChannelRange {
|
|
2397
|
-
/** Minimum value. */
|
|
2398
|
-
minValue: number;
|
|
2399
|
-
/** Maximum value. */
|
|
2400
|
-
maxValue: number;
|
|
2401
|
-
/** Step for keyboard increment. */
|
|
2402
|
-
step: number;
|
|
2403
|
-
/** Page step for larger increments. */
|
|
2404
|
-
pageSize: number;
|
|
2405
|
-
}
|
|
2406
|
-
/**
|
|
2407
|
-
* Color axes for a color space.
|
|
2408
|
-
*/
|
|
2409
|
-
interface ColorAxes {
|
|
2410
|
-
/** X-axis channel. */
|
|
2411
|
-
xChannel: ColorChannel;
|
|
2412
|
-
/** Y-axis channel. */
|
|
2413
|
-
yChannel: ColorChannel;
|
|
2414
|
-
/** Z-axis channel (the one not on x or y). */
|
|
2415
|
-
zChannel: ColorChannel;
|
|
2416
|
-
}
|
|
2417
|
-
/**
|
|
2418
|
-
* Color interface representing a color value.
|
|
2419
|
-
*/
|
|
2420
|
-
interface Color {
|
|
2421
|
-
/** Convert to a different format. */
|
|
2422
|
-
toFormat(format: ColorFormat): Color;
|
|
2423
|
-
/** Convert to a CSS string. */
|
|
2424
|
-
toString(format?: ColorFormat | 'css'): string;
|
|
2425
|
-
/** Clone this color. */
|
|
2426
|
-
clone(): Color;
|
|
2427
|
-
/** Get the hex value as an integer. */
|
|
2428
|
-
toHexInt(): number;
|
|
2429
|
-
/** Get the value of a specific channel. */
|
|
2430
|
-
getChannelValue(channel: ColorChannel): number;
|
|
2431
|
-
/** Create a new color with a channel value changed. */
|
|
2432
|
-
withChannelValue(channel: ColorChannel, value: number): Color;
|
|
2433
|
-
/** Get the range for a channel. */
|
|
2434
|
-
getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
2435
|
-
/** Get the localized name of a channel. */
|
|
2436
|
-
getChannelName(channel: ColorChannel, locale: string): string;
|
|
2437
|
-
/** Get the format options for a channel. */
|
|
2438
|
-
getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
2439
|
-
/** Format the value of a channel. */
|
|
2440
|
-
formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
2441
|
-
/** Get the color space. */
|
|
2442
|
-
getColorSpace(): ColorSpace;
|
|
2443
|
-
/** Get the axes for a color space. */
|
|
2444
|
-
getColorSpaceAxes(xyChannels?: {
|
|
2445
|
-
xChannel?: ColorChannel;
|
|
2446
|
-
yChannel?: ColorChannel;
|
|
2447
|
-
}): ColorAxes;
|
|
2448
|
-
/** Get all channels for this color space. */
|
|
2449
|
-
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
2450
|
-
/** Get a human-readable color name. */
|
|
2451
|
-
getColorName(locale: string): string;
|
|
2452
|
-
/** Get the hue name (e.g., "red", "blue"). */
|
|
2453
|
-
getHueName(locale: string): string;
|
|
2454
|
-
}
|
|
2455
|
-
|
|
2456
|
-
/**
|
|
2457
|
-
* Color class implementation.
|
|
2458
|
-
* Based on @react-stately/color.
|
|
2459
|
-
*
|
|
2460
|
-
* Provides color manipulation, conversion, and formatting.
|
|
2461
|
-
*/
|
|
2462
|
-
|
|
2463
|
-
/**
|
|
2464
|
-
* Parse a color string into a Color object.
|
|
2465
|
-
*/
|
|
2466
|
-
declare function parseColor(value: string): Color;
|
|
2467
|
-
/**
|
|
2468
|
-
* Create an RGB color.
|
|
2469
|
-
*/
|
|
2470
|
-
declare function createRGBColor(red: number, green: number, blue: number, alpha?: number): Color;
|
|
2471
|
-
/**
|
|
2472
|
-
* Create an HSL color.
|
|
2473
|
-
*/
|
|
2474
|
-
declare function createHSLColor(hue: number, saturation: number, lightness: number, alpha?: number): Color;
|
|
2475
|
-
/**
|
|
2476
|
-
* Create an HSB color.
|
|
2477
|
-
*/
|
|
2478
|
-
declare function createHSBColor(hue: number, saturation: number, brightness: number, alpha?: number): Color;
|
|
2479
|
-
/**
|
|
2480
|
-
* Normalize a color value (string or Color) to a Color object.
|
|
2481
|
-
*/
|
|
2482
|
-
declare function normalizeColor(value: string | Color): Color;
|
|
2483
|
-
|
|
2484
|
-
/**
|
|
2485
|
-
* ColorSlider state management.
|
|
2486
|
-
* Based on @react-stately/color useColorSliderState.
|
|
2487
|
-
*/
|
|
2488
|
-
|
|
2489
|
-
interface ColorSliderStateOptions {
|
|
2490
|
-
/** The current color value (controlled). */
|
|
2491
|
-
value?: Color | string;
|
|
2492
|
-
/** The default color value (uncontrolled). */
|
|
2493
|
-
defaultValue?: Color | string;
|
|
2494
|
-
/** Handler called when the color changes. */
|
|
2495
|
-
onChange?: (color: Color) => void;
|
|
2496
|
-
/** Handler called when dragging ends. */
|
|
2497
|
-
onChangeEnd?: (color: Color) => void;
|
|
2498
|
-
/** The color channel this slider controls. */
|
|
2499
|
-
channel: ColorChannel;
|
|
2500
|
-
/** Whether the slider is disabled. */
|
|
2501
|
-
isDisabled?: boolean;
|
|
2502
|
-
/** The locale for formatting. */
|
|
2503
|
-
locale?: string;
|
|
2504
|
-
}
|
|
2505
|
-
interface ColorSliderState {
|
|
2506
|
-
/** The current color value. */
|
|
2507
|
-
readonly value: Color;
|
|
2508
|
-
/** Whether the slider is being dragged. */
|
|
2509
|
-
readonly isDragging: boolean;
|
|
2510
|
-
/** The color channel being controlled. */
|
|
2511
|
-
readonly channel: ColorChannel;
|
|
2512
|
-
/** The step value for the channel. */
|
|
2513
|
-
readonly step: number;
|
|
2514
|
-
/** The page step value for the channel. */
|
|
2515
|
-
readonly pageSize: number;
|
|
2516
|
-
/** The minimum value for the channel. */
|
|
2517
|
-
readonly minValue: number;
|
|
2518
|
-
/** The maximum value for the channel. */
|
|
2519
|
-
readonly maxValue: number;
|
|
2520
|
-
/** Whether the slider is disabled. */
|
|
2521
|
-
readonly isDisabled: boolean;
|
|
2522
|
-
/** Get the current channel value. */
|
|
2523
|
-
getThumbValue(): number;
|
|
2524
|
-
/** Get the minimum percent. */
|
|
2525
|
-
getThumbMinValue(): number;
|
|
2526
|
-
/** Get the maximum percent. */
|
|
2527
|
-
getThumbMaxValue(): number;
|
|
2528
|
-
/** Get the thumb value as a percentage. */
|
|
2529
|
-
getThumbPercent(): number;
|
|
2530
|
-
/** Set the channel value. */
|
|
2531
|
-
setThumbValue(value: number): void;
|
|
2532
|
-
/** Set the thumb value from a percentage (0-1). */
|
|
2533
|
-
setThumbPercent(percent: number): void;
|
|
2534
|
-
/** Increment the channel value. */
|
|
2535
|
-
incrementThumb(stepSize?: number): void;
|
|
2536
|
-
/** Decrement the channel value. */
|
|
2537
|
-
decrementThumb(stepSize?: number): void;
|
|
2538
|
-
/** Set the dragging state. */
|
|
2539
|
-
setDragging(isDragging: boolean): void;
|
|
2540
|
-
/** Get the display color (with alpha = 1). */
|
|
2541
|
-
getDisplayColor(): Color;
|
|
2542
|
-
/** Get the formatted value label. */
|
|
2543
|
-
getThumbValueLabel(): string;
|
|
2544
|
-
}
|
|
2545
|
-
/**
|
|
2546
|
-
* Creates state for a color slider.
|
|
2547
|
-
*/
|
|
2548
|
-
declare function createColorSliderState(options: Accessor<ColorSliderStateOptions>): ColorSliderState;
|
|
2549
|
-
|
|
2550
|
-
/**
|
|
2551
|
-
* ColorArea state management.
|
|
2552
|
-
* Based on @react-stately/color useColorAreaState.
|
|
2553
|
-
*/
|
|
2554
|
-
|
|
2555
|
-
interface ColorAreaStateOptions {
|
|
2556
|
-
/** The current color value (controlled). */
|
|
2557
|
-
value?: Color | string;
|
|
2558
|
-
/** The default color value (uncontrolled). */
|
|
2559
|
-
defaultValue?: Color | string;
|
|
2560
|
-
/** Handler called when the color changes. */
|
|
2561
|
-
onChange?: (color: Color) => void;
|
|
2562
|
-
/** Handler called when dragging ends. */
|
|
2563
|
-
onChangeEnd?: (color: Color) => void;
|
|
2564
|
-
/** The color channel for the X axis. */
|
|
2565
|
-
xChannel?: ColorChannel;
|
|
2566
|
-
/** The color channel for the Y axis. */
|
|
2567
|
-
yChannel?: ColorChannel;
|
|
2568
|
-
/** Whether the area is disabled. */
|
|
2569
|
-
isDisabled?: boolean;
|
|
2570
|
-
}
|
|
2571
|
-
interface ColorAreaState {
|
|
2572
|
-
/** The current color value. */
|
|
2573
|
-
readonly value: Color;
|
|
2574
|
-
/** The X axis channel. */
|
|
2575
|
-
readonly xChannel: ColorChannel;
|
|
2576
|
-
/** The Y axis channel. */
|
|
2577
|
-
readonly yChannel: ColorChannel;
|
|
2578
|
-
/** The Z axis channel (the third channel). */
|
|
2579
|
-
readonly zChannel: ColorChannel;
|
|
2580
|
-
/** Whether the area is being dragged. */
|
|
2581
|
-
readonly isDragging: boolean;
|
|
2582
|
-
/** Whether the area is disabled. */
|
|
2583
|
-
readonly isDisabled: boolean;
|
|
2584
|
-
/** Step for X channel. */
|
|
2585
|
-
readonly xChannelStep: number;
|
|
2586
|
-
/** Step for Y channel. */
|
|
2587
|
-
readonly yChannelStep: number;
|
|
2588
|
-
/** Page step for X channel. */
|
|
2589
|
-
readonly xChannelPageStep: number;
|
|
2590
|
-
/** Page step for Y channel. */
|
|
2591
|
-
readonly yChannelPageStep: number;
|
|
2592
|
-
/** Get the X channel value. */
|
|
2593
|
-
getXValue(): number;
|
|
2594
|
-
/** Get the Y channel value. */
|
|
2595
|
-
getYValue(): number;
|
|
2596
|
-
/** Set the X channel value. */
|
|
2597
|
-
setXValue(value: number): void;
|
|
2598
|
-
/** Set the Y channel value. */
|
|
2599
|
-
setYValue(value: number): void;
|
|
2600
|
-
/** Set color from a point (0-1, 0-1). */
|
|
2601
|
-
setColorFromPoint(x: number, y: number): void;
|
|
2602
|
-
/** Get the thumb position as percentages. */
|
|
2603
|
-
getThumbPosition(): {
|
|
2604
|
-
x: number;
|
|
2605
|
-
y: number;
|
|
2606
|
-
};
|
|
2607
|
-
/** Increment X value. */
|
|
2608
|
-
incrementX(stepSize?: number): void;
|
|
2609
|
-
/** Decrement X value. */
|
|
2610
|
-
decrementX(stepSize?: number): void;
|
|
2611
|
-
/** Increment Y value. */
|
|
2612
|
-
incrementY(stepSize?: number): void;
|
|
2613
|
-
/** Decrement Y value. */
|
|
2614
|
-
decrementY(stepSize?: number): void;
|
|
2615
|
-
/** Set the dragging state. */
|
|
2616
|
-
setDragging(isDragging: boolean): void;
|
|
2617
|
-
/** Get the display color (with alpha = 1). */
|
|
2618
|
-
getDisplayColor(): Color;
|
|
2619
|
-
}
|
|
2620
|
-
/**
|
|
2621
|
-
* Creates state for a color area (2D color picker).
|
|
2622
|
-
*/
|
|
2623
|
-
declare function createColorAreaState(options: Accessor<ColorAreaStateOptions>): ColorAreaState;
|
|
2624
|
-
|
|
2625
|
-
/**
|
|
2626
|
-
* ColorWheel state management.
|
|
2627
|
-
* Based on @react-stately/color useColorWheelState.
|
|
2628
|
-
*/
|
|
2629
|
-
|
|
2630
|
-
interface ColorWheelStateOptions {
|
|
2631
|
-
/** The current color value (controlled). */
|
|
2632
|
-
value?: Color | string;
|
|
2633
|
-
/** The default color value (uncontrolled). */
|
|
2634
|
-
defaultValue?: Color | string;
|
|
2635
|
-
/** Handler called when the color changes. */
|
|
2636
|
-
onChange?: (color: Color) => void;
|
|
2637
|
-
/** Handler called when dragging ends. */
|
|
2638
|
-
onChangeEnd?: (color: Color) => void;
|
|
2639
|
-
/** Whether the wheel is disabled. */
|
|
2640
|
-
isDisabled?: boolean;
|
|
2641
|
-
}
|
|
2642
|
-
interface ColorWheelState {
|
|
2643
|
-
/** The current color value. */
|
|
2644
|
-
readonly value: Color;
|
|
2645
|
-
/** Whether the wheel is being dragged. */
|
|
2646
|
-
readonly isDragging: boolean;
|
|
2647
|
-
/** Whether the wheel is disabled. */
|
|
2648
|
-
readonly isDisabled: boolean;
|
|
2649
|
-
/** Step value for hue changes. */
|
|
2650
|
-
readonly step: number;
|
|
2651
|
-
/** Page step value for hue changes. */
|
|
2652
|
-
readonly pageStep: number;
|
|
2653
|
-
/** Get the current hue value (0-360). */
|
|
2654
|
-
getHue(): number;
|
|
2655
|
-
/** Set the hue value. */
|
|
2656
|
-
setHue(value: number): void;
|
|
2657
|
-
/** Set hue from an angle in radians. */
|
|
2658
|
-
setHueFromAngle(angle: number): void;
|
|
2659
|
-
/** Get the thumb angle in radians (0 = right, increases counterclockwise). */
|
|
2660
|
-
getThumbAngle(): number;
|
|
2661
|
-
/** Increment hue value. */
|
|
2662
|
-
increment(stepSize?: number): void;
|
|
2663
|
-
/** Decrement hue value. */
|
|
2664
|
-
decrement(stepSize?: number): void;
|
|
2665
|
-
/** Set the dragging state. */
|
|
2666
|
-
setDragging(isDragging: boolean): void;
|
|
2667
|
-
/** Get the display color (with full saturation/brightness for wheel). */
|
|
2668
|
-
getDisplayColor(): Color;
|
|
2669
|
-
}
|
|
2670
|
-
/**
|
|
2671
|
-
* Creates state for a color wheel (circular hue picker).
|
|
2672
|
-
*/
|
|
2673
|
-
declare function createColorWheelState(options: Accessor<ColorWheelStateOptions>): ColorWheelState;
|
|
2674
|
-
|
|
2675
|
-
/**
|
|
2676
|
-
* ColorField state management.
|
|
2677
|
-
* Based on @react-stately/color useColorFieldState.
|
|
2678
|
-
*/
|
|
2679
|
-
|
|
2680
|
-
interface ColorFieldStateOptions {
|
|
2681
|
-
/** The current color value (controlled). */
|
|
2682
|
-
value?: Color | string | null;
|
|
2683
|
-
/** The default color value (uncontrolled). */
|
|
2684
|
-
defaultValue?: Color | string;
|
|
2685
|
-
/** Handler called when the color changes. */
|
|
2686
|
-
onChange?: (color: Color | null) => void;
|
|
2687
|
-
/** The color channel to edit (for single channel mode). */
|
|
2688
|
-
channel?: ColorChannel;
|
|
2689
|
-
/** The color format for parsing/displaying. */
|
|
2690
|
-
colorFormat?: ColorFormat;
|
|
2691
|
-
/** Whether the field is disabled. */
|
|
2692
|
-
isDisabled?: boolean;
|
|
2693
|
-
/** Whether the field is read-only. */
|
|
2694
|
-
isReadOnly?: boolean;
|
|
2695
|
-
}
|
|
2696
|
-
interface ColorFieldState {
|
|
2697
|
-
/** The current color value (null if invalid). */
|
|
2698
|
-
readonly value: Color | null;
|
|
2699
|
-
/** The current input text. */
|
|
2700
|
-
readonly inputValue: string;
|
|
2701
|
-
/** Whether the input is invalid. */
|
|
2702
|
-
readonly isInvalid: boolean;
|
|
2703
|
-
/** Whether the field is disabled. */
|
|
2704
|
-
readonly isDisabled: boolean;
|
|
2705
|
-
/** Whether the field is read-only. */
|
|
2706
|
-
readonly isReadOnly: boolean;
|
|
2707
|
-
/** The color channel being edited (if single channel mode). */
|
|
2708
|
-
readonly channel: ColorChannel | undefined;
|
|
2709
|
-
/** Set the input text value. */
|
|
2710
|
-
setInputValue(value: string): void;
|
|
2711
|
-
/** Commit the current input value. */
|
|
2712
|
-
commit(): void;
|
|
2713
|
-
/** Increment the color channel value. */
|
|
2714
|
-
increment(): void;
|
|
2715
|
-
/** Decrement the color channel value. */
|
|
2716
|
-
decrement(): void;
|
|
2717
|
-
/** Increment by page size. */
|
|
2718
|
-
incrementToMax(): void;
|
|
2719
|
-
/** Decrement to minimum. */
|
|
2720
|
-
decrementToMin(): void;
|
|
2721
|
-
/** Validate the current input. */
|
|
2722
|
-
validate(): boolean;
|
|
2723
|
-
}
|
|
2724
|
-
/**
|
|
2725
|
-
* Creates state for a color field (text input for color values).
|
|
2726
|
-
*/
|
|
2727
|
-
declare function createColorFieldState(options: Accessor<ColorFieldStateOptions>): ColorFieldState;
|
|
2728
|
-
|
|
2729
|
-
/**
|
|
2730
|
-
* Drag and Drop types for solid-stately.
|
|
2731
|
-
*
|
|
2732
|
-
* Core types for drag and drop operations, matching React Aria's DnD API.
|
|
2733
|
-
*/
|
|
2734
|
-
/** The type of drop operation to perform. */
|
|
2735
|
-
type DropOperation = 'copy' | 'link' | 'move' | 'cancel';
|
|
2736
|
-
/** Drag item data as key-value pairs where keys are MIME types or custom types. */
|
|
2737
|
-
interface DragItem {
|
|
2738
|
-
[type: string]: string;
|
|
2739
|
-
}
|
|
2740
|
-
/** Base event for drag/drop operations with coordinates. */
|
|
2741
|
-
interface DragDropEvent {
|
|
2742
|
-
/** The x coordinate of the event, relative to the target element. */
|
|
2743
|
-
x: number;
|
|
2744
|
-
/** The y coordinate of the event, relative to the target element. */
|
|
2745
|
-
y: number;
|
|
2746
|
-
}
|
|
2747
|
-
/** Event fired when a drag operation starts. */
|
|
2748
|
-
interface DragStartEvent extends DragDropEvent {
|
|
2749
|
-
/** The event type. */
|
|
2750
|
-
type: 'dragstart';
|
|
2751
|
-
}
|
|
2752
|
-
/** Event fired as a drag moves. */
|
|
2753
|
-
interface DragMoveEvent extends DragDropEvent {
|
|
2754
|
-
/** The event type. */
|
|
2755
|
-
type: 'dragmove';
|
|
2756
|
-
}
|
|
2757
|
-
/** Event fired when a drag operation ends. */
|
|
2758
|
-
interface DragEndEvent extends DragDropEvent {
|
|
2759
|
-
/** The event type. */
|
|
2760
|
-
type: 'dragend';
|
|
2761
|
-
/** The drop operation that occurred. */
|
|
2762
|
-
dropOperation: DropOperation;
|
|
2763
|
-
}
|
|
2764
|
-
/** Event fired when a drag enters a drop target. */
|
|
2765
|
-
interface DropEnterEvent extends DragDropEvent {
|
|
2766
|
-
/** The event type. */
|
|
2767
|
-
type: 'dropenter';
|
|
2768
|
-
}
|
|
2769
|
-
/** Event fired as a drag moves within a drop target. */
|
|
2770
|
-
interface DropMoveEvent extends DragDropEvent {
|
|
2771
|
-
/** The event type. */
|
|
2772
|
-
type: 'dropmove';
|
|
2773
|
-
}
|
|
2774
|
-
/** Event fired when a drag is held over a drop target. */
|
|
2775
|
-
interface DropActivateEvent extends DragDropEvent {
|
|
2776
|
-
/** The event type. */
|
|
2777
|
-
type: 'dropactivate';
|
|
2778
|
-
}
|
|
2779
|
-
/** Event fired when a drag exits a drop target. */
|
|
2780
|
-
interface DropExitEvent extends DragDropEvent {
|
|
2781
|
-
/** The event type. */
|
|
2782
|
-
type: 'dropexit';
|
|
2783
|
-
}
|
|
2784
|
-
/** A text item in a drop operation. */
|
|
2785
|
-
interface TextDropItem {
|
|
2786
|
-
/** The item kind. */
|
|
2787
|
-
kind: 'text';
|
|
2788
|
-
/** The drag types available for this item. */
|
|
2789
|
-
types: Set<string>;
|
|
2790
|
-
/** Returns the data for the given type as a string. */
|
|
2791
|
-
getText(type: string): Promise<string>;
|
|
2792
|
-
}
|
|
2793
|
-
/** A file item in a drop operation. */
|
|
2794
|
-
interface FileDropItem {
|
|
2795
|
-
/** The item kind. */
|
|
2796
|
-
kind: 'file';
|
|
2797
|
-
/** The file type (usually a mime type). */
|
|
2798
|
-
type: string;
|
|
2799
|
-
/** The file name. */
|
|
2800
|
-
name: string;
|
|
2801
|
-
/** Returns the contents of the file as a blob. */
|
|
2802
|
-
getFile(): Promise<File>;
|
|
2803
|
-
/** Returns the contents of the file as a string. */
|
|
2804
|
-
getText(): Promise<string>;
|
|
2805
|
-
}
|
|
2806
|
-
/** A directory item in a drop operation. */
|
|
2807
|
-
interface DirectoryDropItem {
|
|
2808
|
-
/** The item kind. */
|
|
2809
|
-
kind: 'directory';
|
|
2810
|
-
/** The directory name. */
|
|
2811
|
-
name: string;
|
|
2812
|
-
/** Returns the entries contained within the directory. */
|
|
2813
|
-
getEntries(): AsyncIterable<FileDropItem | DirectoryDropItem>;
|
|
2814
|
-
}
|
|
2815
|
-
/** Union of all drop item types. */
|
|
2816
|
-
type DropItem = TextDropItem | FileDropItem | DirectoryDropItem;
|
|
2817
|
-
/** Event fired when items are dropped. */
|
|
2818
|
-
interface DropEvent extends DragDropEvent {
|
|
2819
|
-
/** The event type. */
|
|
2820
|
-
type: 'drop';
|
|
2821
|
-
/** The drop operation that should occur. */
|
|
2822
|
-
dropOperation: DropOperation;
|
|
2823
|
-
/** The dropped items. */
|
|
2824
|
-
items: DropItem[];
|
|
2825
|
-
}
|
|
2826
|
-
/** Position relative to an item for drop operations. */
|
|
2827
|
-
type DropPosition = 'on' | 'before' | 'after';
|
|
2828
|
-
/** Drop target representing the root of a collection. */
|
|
2829
|
-
interface RootDropTarget {
|
|
2830
|
-
/** The drop target type. */
|
|
2831
|
-
type: 'root';
|
|
2832
|
-
}
|
|
2833
|
-
/** Drop target representing an item in a collection. */
|
|
2834
|
-
interface ItemDropTarget {
|
|
2835
|
-
/** The drop target type. */
|
|
2836
|
-
type: 'item';
|
|
2837
|
-
/** The item key. */
|
|
2838
|
-
key: string | number;
|
|
2839
|
-
/** The drop position relative to the item. */
|
|
2840
|
-
dropPosition: DropPosition;
|
|
2841
|
-
}
|
|
2842
|
-
/** Union of drop target types. */
|
|
2843
|
-
type DropTarget = RootDropTarget | ItemDropTarget;
|
|
2844
|
-
/** Event fired when a drag enters a droppable collection. */
|
|
2845
|
-
interface DroppableCollectionEnterEvent extends DropEnterEvent {
|
|
2846
|
-
/** The drop target. */
|
|
2847
|
-
target: DropTarget;
|
|
2848
|
-
}
|
|
2849
|
-
/** Event fired as a drag moves within a droppable collection. */
|
|
2850
|
-
interface DroppableCollectionMoveEvent extends DropMoveEvent {
|
|
2851
|
-
/** The drop target. */
|
|
2852
|
-
target: DropTarget;
|
|
2853
|
-
}
|
|
2854
|
-
/** Event fired when a drag is held over a droppable collection item. */
|
|
2855
|
-
interface DroppableCollectionActivateEvent extends DropActivateEvent {
|
|
2856
|
-
/** The drop target. */
|
|
2857
|
-
target: DropTarget;
|
|
2858
|
-
}
|
|
2859
|
-
/** Event fired when a drag exits a droppable collection. */
|
|
2860
|
-
interface DroppableCollectionExitEvent extends DropExitEvent {
|
|
2861
|
-
/** The drop target. */
|
|
2862
|
-
target: DropTarget;
|
|
2863
|
-
}
|
|
2864
|
-
/** Event fired when items are dropped on a droppable collection. */
|
|
2865
|
-
interface DroppableCollectionDropEvent extends DropEvent {
|
|
2866
|
-
/** The drop target. */
|
|
2867
|
-
target: DropTarget;
|
|
2868
|
-
}
|
|
2869
|
-
/** Event for inserting items between existing collection items. */
|
|
2870
|
-
interface DroppableCollectionInsertDropEvent {
|
|
2871
|
-
/** The dropped items. */
|
|
2872
|
-
items: DropItem[];
|
|
2873
|
-
/** The drop operation that should occur. */
|
|
2874
|
-
dropOperation: DropOperation;
|
|
2875
|
-
/** The drop target. */
|
|
2876
|
-
target: ItemDropTarget;
|
|
2877
|
-
}
|
|
2878
|
-
/** Event for dropping on the root of a collection. */
|
|
2879
|
-
interface DroppableCollectionRootDropEvent {
|
|
2880
|
-
/** The dropped items. */
|
|
2881
|
-
items: DropItem[];
|
|
2882
|
-
/** The drop operation that should occur. */
|
|
2883
|
-
dropOperation: DropOperation;
|
|
2884
|
-
}
|
|
2885
|
-
/** Event for dropping on a specific item. */
|
|
2886
|
-
interface DroppableCollectionOnItemDropEvent {
|
|
2887
|
-
/** The dropped items. */
|
|
2888
|
-
items: DropItem[];
|
|
2889
|
-
/** The drop operation that should occur. */
|
|
2890
|
-
dropOperation: DropOperation;
|
|
2891
|
-
/** Whether the drag originated within the same collection as the drop. */
|
|
2892
|
-
isInternal: boolean;
|
|
2893
|
-
/** The drop target. */
|
|
2894
|
-
target: ItemDropTarget;
|
|
2895
|
-
}
|
|
2896
|
-
/** Event for reordering items within a collection. */
|
|
2897
|
-
interface DroppableCollectionReorderEvent {
|
|
2898
|
-
/** The keys of the items that were reordered. */
|
|
2899
|
-
keys: Set<string | number>;
|
|
2900
|
-
/** The drop operation that should occur. */
|
|
2901
|
-
dropOperation: DropOperation;
|
|
2902
|
-
/** The drop target. */
|
|
2903
|
-
target: ItemDropTarget;
|
|
2904
|
-
}
|
|
2905
|
-
/** Interface for checking drag types. */
|
|
2906
|
-
interface DragTypes {
|
|
2907
|
-
/** Returns whether the drag contains data of the given type. */
|
|
2908
|
-
has(type: string | symbol): boolean;
|
|
2909
|
-
}
|
|
2910
|
-
/** Delegate for determining drop targets within a collection. */
|
|
2911
|
-
interface DropTargetDelegate {
|
|
2912
|
-
/**
|
|
2913
|
-
* Returns a drop target within a collection for the given coordinates.
|
|
2914
|
-
* @param x - X coordinate relative to the collection container
|
|
2915
|
-
* @param y - Y coordinate relative to the collection container
|
|
2916
|
-
* @param isValidDropTarget - Function to check if a target is valid
|
|
2917
|
-
*/
|
|
2918
|
-
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
|
|
2919
|
-
}
|
|
2920
|
-
/** Event fired when a collection drag starts. */
|
|
2921
|
-
interface DraggableCollectionStartEvent extends DragStartEvent {
|
|
2922
|
-
/** The keys of the items that were dragged. */
|
|
2923
|
-
keys: Set<string | number>;
|
|
2924
|
-
}
|
|
2925
|
-
/** Event fired as a collection drag moves. */
|
|
2926
|
-
interface DraggableCollectionMoveEvent extends DragMoveEvent {
|
|
2927
|
-
/** The keys of the items that were dragged. */
|
|
2928
|
-
keys: Set<string | number>;
|
|
2929
|
-
}
|
|
2930
|
-
/** Event fired when a collection drag ends. */
|
|
2931
|
-
interface DraggableCollectionEndEvent extends DragEndEvent {
|
|
2932
|
-
/** The keys of the items that were dragged. */
|
|
2933
|
-
keys: Set<string | number>;
|
|
2934
|
-
/** Whether the drop ended within the same collection as it originated. */
|
|
2935
|
-
isInternal: boolean;
|
|
2936
|
-
}
|
|
2937
|
-
/** Function to render a custom drag preview. */
|
|
2938
|
-
type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => void;
|
|
2939
|
-
/** Props for droppable collection utility handlers. */
|
|
2940
|
-
interface DroppableCollectionUtilityOptions {
|
|
2941
|
-
/**
|
|
2942
|
-
* The drag types that the droppable collection accepts.
|
|
2943
|
-
* @default 'all'
|
|
2944
|
-
*/
|
|
2945
|
-
acceptedDragTypes?: 'all' | Array<string | symbol>;
|
|
2946
|
-
/** Handler that is called when external items are dropped "between" items. */
|
|
2947
|
-
onInsert?: (e: DroppableCollectionInsertDropEvent) => void;
|
|
2948
|
-
/** Handler that is called when external items are dropped on the collection's root. */
|
|
2949
|
-
onRootDrop?: (e: DroppableCollectionRootDropEvent) => void;
|
|
2950
|
-
/** Handler that is called when items are dropped "on" an item. */
|
|
2951
|
-
onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;
|
|
2952
|
-
/** Handler that is called when items are reordered within the collection. */
|
|
2953
|
-
onReorder?: (e: DroppableCollectionReorderEvent) => void;
|
|
2954
|
-
/** Handler that is called when items are moved within the source collection. */
|
|
2955
|
-
onMove?: (e: DroppableCollectionReorderEvent) => void;
|
|
2956
|
-
/** A function returning whether a given target is a valid "on" drop target. */
|
|
2957
|
-
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean;
|
|
2958
|
-
}
|
|
2959
|
-
/** Base props for droppable collections. */
|
|
2960
|
-
interface DroppableCollectionBaseProps {
|
|
2961
|
-
/** Handler that is called when a valid drag enters a drop target. */
|
|
2962
|
-
onDropEnter?: (e: DroppableCollectionEnterEvent) => void;
|
|
2963
|
-
/** Handler that is called after a valid drag is held over a drop target. */
|
|
2964
|
-
onDropActivate?: (e: DroppableCollectionActivateEvent) => void;
|
|
2965
|
-
/** Handler that is called when a valid drag exits a drop target. */
|
|
2966
|
-
onDropExit?: (e: DroppableCollectionExitEvent) => void;
|
|
2967
|
-
/** Handler that is called when a valid drag is dropped on a drop target. */
|
|
2968
|
-
onDrop?: (e: DroppableCollectionDropEvent) => void;
|
|
2969
|
-
/** A function returning the drop operation to be performed. */
|
|
2970
|
-
getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
|
|
2971
|
-
}
|
|
2972
|
-
/** Combined props for droppable collections. */
|
|
2973
|
-
interface DroppableCollectionProps extends DroppableCollectionUtilityOptions, DroppableCollectionBaseProps {
|
|
2974
|
-
}
|
|
2975
|
-
/** Props for draggable collections. */
|
|
2976
|
-
interface DraggableCollectionProps<T = object> {
|
|
2977
|
-
/** Handler that is called when a drag operation is started. */
|
|
2978
|
-
onDragStart?: (e: DraggableCollectionStartEvent) => void;
|
|
2979
|
-
/** Handler that is called when the drag is moved. */
|
|
2980
|
-
onDragMove?: (e: DraggableCollectionMoveEvent) => void;
|
|
2981
|
-
/** Handler that is called when the drag operation ends. */
|
|
2982
|
-
onDragEnd?: (e: DraggableCollectionEndEvent) => void;
|
|
2983
|
-
/** A function that returns the items being dragged. */
|
|
2984
|
-
getItems: (keys: Set<string | number>, items: T[]) => DragItem[];
|
|
2985
|
-
/** The ref of the element that will be rendered as the drag preview. */
|
|
2986
|
-
preview?: {
|
|
2987
|
-
current: DragPreviewRenderer | null;
|
|
2988
|
-
};
|
|
2989
|
-
/** Function that returns the allowed drop operations. */
|
|
2990
|
-
getAllowedDropOperations?: () => DropOperation[];
|
|
2991
|
-
}
|
|
2992
|
-
|
|
2993
|
-
/**
|
|
2994
|
-
* Drag state management for solid-stately.
|
|
2995
|
-
*
|
|
2996
|
-
* Provides reactive state for drag operations.
|
|
2997
|
-
*/
|
|
2998
|
-
|
|
2999
|
-
interface DragStateOptions {
|
|
3000
|
-
/** A function that returns the items being dragged. */
|
|
3001
|
-
getItems: () => DragItem[];
|
|
3002
|
-
/** Function that returns the allowed drop operations. */
|
|
3003
|
-
getAllowedDropOperations?: () => DropOperation[];
|
|
3004
|
-
/** Handler that is called when a drag operation is started. */
|
|
3005
|
-
onDragStart?: (e: DragStartEvent) => void;
|
|
3006
|
-
/** Handler that is called when the drag is moved. */
|
|
3007
|
-
onDragMove?: (e: DragMoveEvent) => void;
|
|
3008
|
-
/** Handler that is called when the drag operation ends. */
|
|
3009
|
-
onDragEnd?: (e: DragEndEvent) => void;
|
|
3010
|
-
/** Whether the drag operation is disabled. */
|
|
3011
|
-
isDisabled?: boolean;
|
|
3012
|
-
/** Whether there is a separate drag button affordance. */
|
|
3013
|
-
hasDragButton?: boolean;
|
|
3014
|
-
/** Preview renderer function ref. */
|
|
3015
|
-
preview?: {
|
|
3016
|
-
current: DragPreviewRenderer | null;
|
|
3017
|
-
};
|
|
3018
|
-
}
|
|
3019
|
-
interface DragState {
|
|
3020
|
-
/** Whether an element is currently being dragged. */
|
|
3021
|
-
readonly isDragging: boolean;
|
|
3022
|
-
/** Whether drag is disabled. */
|
|
3023
|
-
readonly isDisabled: boolean;
|
|
3024
|
-
/** Start a drag operation. */
|
|
3025
|
-
startDrag(x: number, y: number): void;
|
|
3026
|
-
/** Update drag position. */
|
|
3027
|
-
moveDrag(x: number, y: number): void;
|
|
3028
|
-
/** End a drag operation. */
|
|
3029
|
-
endDrag(x: number, y: number, dropOperation: DropOperation): void;
|
|
3030
|
-
/** Cancel a drag operation. */
|
|
3031
|
-
cancelDrag(): void;
|
|
3032
|
-
/** Get the items being dragged. */
|
|
3033
|
-
getItems(): DragItem[];
|
|
3034
|
-
/** Get allowed drop operations. */
|
|
3035
|
-
getAllowedDropOperations(): DropOperation[];
|
|
3036
|
-
/** Whether there is a drag button. */
|
|
3037
|
-
readonly hasDragButton: boolean;
|
|
3038
|
-
/** Preview renderer. */
|
|
3039
|
-
readonly preview: {
|
|
3040
|
-
current: DragPreviewRenderer | null;
|
|
3041
|
-
} | undefined;
|
|
3042
|
-
}
|
|
3043
|
-
/**
|
|
3044
|
-
* Creates drag state for managing drag operations.
|
|
3045
|
-
*
|
|
3046
|
-
* @param props - Accessor returning drag state options
|
|
3047
|
-
* @returns Drag state object
|
|
3048
|
-
*/
|
|
3049
|
-
declare function createDragState(props: Accessor<DragStateOptions>): DragState;
|
|
3050
|
-
|
|
3051
|
-
/**
|
|
3052
|
-
* Drop state management for solid-stately.
|
|
3053
|
-
*
|
|
3054
|
-
* Provides reactive state for drop target operations.
|
|
3055
|
-
*/
|
|
3056
|
-
|
|
3057
|
-
interface DropStateOptions {
|
|
3058
|
-
/**
|
|
3059
|
-
* A function returning the drop operation to be performed.
|
|
3060
|
-
*/
|
|
3061
|
-
getDropOperation?: (types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
|
|
3062
|
-
/**
|
|
3063
|
-
* A function returning the drop operation for a specific point.
|
|
3064
|
-
*/
|
|
3065
|
-
getDropOperationForPoint?: (types: DragTypes, allowedOperations: DropOperation[], x: number, y: number) => DropOperation;
|
|
3066
|
-
/** Handler that is called when a valid drag enters the drop target. */
|
|
3067
|
-
onDropEnter?: (e: DropEnterEvent) => void;
|
|
3068
|
-
/** Handler that is called when a valid drag is moved within the drop target. */
|
|
3069
|
-
onDropMove?: (e: DropMoveEvent) => void;
|
|
3070
|
-
/** Handler that is called after a valid drag is held over the drop target. */
|
|
3071
|
-
onDropActivate?: (e: DropActivateEvent) => void;
|
|
3072
|
-
/** Handler that is called when a valid drag exits the drop target. */
|
|
3073
|
-
onDropExit?: (e: DropExitEvent) => void;
|
|
3074
|
-
/** Handler that is called when a valid drag is dropped on the drop target. */
|
|
3075
|
-
onDrop?: (e: DropEvent) => void;
|
|
3076
|
-
/** Whether there is a separate drop button affordance. */
|
|
3077
|
-
hasDropButton?: boolean;
|
|
3078
|
-
/** Whether the drop target is disabled. */
|
|
3079
|
-
isDisabled?: boolean;
|
|
3080
|
-
}
|
|
3081
|
-
interface DropState {
|
|
3082
|
-
/** Whether the drop target is currently being hovered or focused. */
|
|
3083
|
-
readonly isDropTarget: boolean;
|
|
3084
|
-
/** Whether the drop target is disabled. */
|
|
3085
|
-
readonly isDisabled: boolean;
|
|
3086
|
-
/** Whether there is a drop button. */
|
|
3087
|
-
readonly hasDropButton: boolean;
|
|
3088
|
-
/** Enter the drop target. */
|
|
3089
|
-
enterTarget(x: number, y: number): void;
|
|
3090
|
-
/** Move within the drop target. */
|
|
3091
|
-
moveInTarget(x: number, y: number): void;
|
|
3092
|
-
/** Exit the drop target. */
|
|
3093
|
-
exitTarget(x: number, y: number): void;
|
|
3094
|
-
/** Activate the drop target (after holding). */
|
|
3095
|
-
activateTarget(x: number, y: number): void;
|
|
3096
|
-
/** Perform a drop on the target. */
|
|
3097
|
-
drop(x: number, y: number, items: DropItem[], dropOperation: DropOperation): void;
|
|
3098
|
-
/** Get the drop operation for given types. */
|
|
3099
|
-
getDropOperation(types: DragTypes, allowedOperations: DropOperation[]): DropOperation;
|
|
3100
|
-
/** Get the drop operation for a specific point. */
|
|
3101
|
-
getDropOperationForPoint(types: DragTypes, allowedOperations: DropOperation[], x: number, y: number): DropOperation;
|
|
3102
|
-
}
|
|
3103
|
-
/**
|
|
3104
|
-
* Creates drop state for managing drop target operations.
|
|
3105
|
-
*
|
|
3106
|
-
* @param props - Accessor returning drop state options
|
|
3107
|
-
* @returns Drop state object
|
|
3108
|
-
*/
|
|
3109
|
-
declare function createDropState(props: Accessor<DropStateOptions>): DropState;
|
|
3110
|
-
|
|
3111
|
-
/**
|
|
3112
|
-
* Draggable collection state management for solid-stately.
|
|
3113
|
-
*
|
|
3114
|
-
* Provides reactive state for dragging items from a collection.
|
|
3115
|
-
*/
|
|
3116
|
-
|
|
3117
|
-
interface DraggableCollectionStateOptions<T = object> {
|
|
3118
|
-
/** A function that returns the items being dragged. */
|
|
3119
|
-
getItems: (keys: Set<string | number>) => DragItem[];
|
|
3120
|
-
/** Function that returns the allowed drop operations. */
|
|
3121
|
-
getAllowedDropOperations?: () => DropOperation[];
|
|
3122
|
-
/** Handler that is called when a drag operation is started. */
|
|
3123
|
-
onDragStart?: (e: DraggableCollectionStartEvent) => void;
|
|
3124
|
-
/** Handler that is called when the drag is moved. */
|
|
3125
|
-
onDragMove?: (e: DraggableCollectionMoveEvent) => void;
|
|
3126
|
-
/** Handler that is called when the drag operation ends. */
|
|
3127
|
-
onDragEnd?: (e: DraggableCollectionEndEvent) => void;
|
|
3128
|
-
/** Whether the drag operation is disabled. */
|
|
3129
|
-
isDisabled?: boolean;
|
|
3130
|
-
/** Preview renderer function ref. */
|
|
3131
|
-
preview?: {
|
|
3132
|
-
current: DragPreviewRenderer | null;
|
|
3133
|
-
};
|
|
3134
|
-
}
|
|
3135
|
-
interface DraggableCollectionState {
|
|
3136
|
-
/** Whether items are currently being dragged. */
|
|
3137
|
-
readonly isDragging: boolean;
|
|
3138
|
-
/** The keys of the items being dragged. */
|
|
3139
|
-
readonly draggingKeys: Set<string | number>;
|
|
3140
|
-
/** Whether dragging is disabled. */
|
|
3141
|
-
readonly isDisabled: boolean;
|
|
3142
|
-
/** Start a drag operation with the given keys. */
|
|
3143
|
-
startDrag(keys: Set<string | number>, x: number, y: number): void;
|
|
3144
|
-
/** Update drag position. */
|
|
3145
|
-
moveDrag(x: number, y: number): void;
|
|
3146
|
-
/** End a drag operation. */
|
|
3147
|
-
endDrag(x: number, y: number, dropOperation: DropOperation, isInternal: boolean): void;
|
|
3148
|
-
/** Cancel a drag operation. */
|
|
3149
|
-
cancelDrag(): void;
|
|
3150
|
-
/** Get the items being dragged for the given keys. */
|
|
3151
|
-
getItems(keys: Set<string | number>): DragItem[];
|
|
3152
|
-
/** Get allowed drop operations. */
|
|
3153
|
-
getAllowedDropOperations(): DropOperation[];
|
|
3154
|
-
/** Preview renderer. */
|
|
3155
|
-
readonly preview: {
|
|
3156
|
-
current: DragPreviewRenderer | null;
|
|
3157
|
-
} | undefined;
|
|
3158
|
-
}
|
|
3159
|
-
/**
|
|
3160
|
-
* Creates state for dragging items from a collection.
|
|
3161
|
-
*
|
|
3162
|
-
* @param props - Accessor returning draggable collection options
|
|
3163
|
-
* @returns Draggable collection state object
|
|
3164
|
-
*/
|
|
3165
|
-
declare function createDraggableCollectionState<T = object>(props: Accessor<DraggableCollectionStateOptions<T>>): DraggableCollectionState;
|
|
3166
|
-
|
|
3167
|
-
/**
|
|
3168
|
-
* Droppable collection state management for solid-stately.
|
|
3169
|
-
*
|
|
3170
|
-
* Provides reactive state for accepting drops onto a collection.
|
|
3171
|
-
*/
|
|
3172
|
-
|
|
3173
|
-
interface DroppableCollectionStateOptions {
|
|
3174
|
-
/**
|
|
3175
|
-
* The drag types that the droppable collection accepts.
|
|
3176
|
-
* @default 'all'
|
|
3177
|
-
*/
|
|
3178
|
-
acceptedDragTypes?: 'all' | Array<string | symbol>;
|
|
3179
|
-
/**
|
|
3180
|
-
* A function returning the drop operation to be performed.
|
|
3181
|
-
*/
|
|
3182
|
-
getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
|
|
3183
|
-
/** Handler that is called when a valid drag enters a drop target. */
|
|
3184
|
-
onDropEnter?: (e: DroppableCollectionEnterEvent) => void;
|
|
3185
|
-
/** Handler that is called after a valid drag is held over a drop target. */
|
|
3186
|
-
onDropActivate?: (e: DroppableCollectionActivateEvent) => void;
|
|
3187
|
-
/** Handler that is called when a valid drag exits a drop target. */
|
|
3188
|
-
onDropExit?: (e: DroppableCollectionExitEvent) => void;
|
|
3189
|
-
/** Handler that is called when a valid drag is dropped. */
|
|
3190
|
-
onDrop?: (e: DroppableCollectionDropEvent) => void;
|
|
3191
|
-
/** Handler that is called when external items are dropped "between" items. */
|
|
3192
|
-
onInsert?: (e: DroppableCollectionInsertDropEvent) => void;
|
|
3193
|
-
/** Handler that is called when external items are dropped on the collection's root. */
|
|
3194
|
-
onRootDrop?: (e: DroppableCollectionRootDropEvent) => void;
|
|
3195
|
-
/** Handler that is called when items are dropped "on" an item. */
|
|
3196
|
-
onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;
|
|
3197
|
-
/** Handler that is called when items are reordered within the collection. */
|
|
3198
|
-
onReorder?: (e: DroppableCollectionReorderEvent) => void;
|
|
3199
|
-
/** Handler that is called when items are moved within the source collection. */
|
|
3200
|
-
onMove?: (e: DroppableCollectionReorderEvent) => void;
|
|
3201
|
-
/** A function returning whether a given target is a valid "on" drop target. */
|
|
3202
|
-
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean;
|
|
3203
|
-
/** Whether the droppable collection is disabled. */
|
|
3204
|
-
isDisabled?: boolean;
|
|
3205
|
-
}
|
|
3206
|
-
interface DroppableCollectionState {
|
|
3207
|
-
/** Whether a drag is currently over the collection. */
|
|
3208
|
-
readonly isDropTarget: boolean;
|
|
3209
|
-
/** The current drop target within the collection. */
|
|
3210
|
-
readonly target: DropTarget | null;
|
|
3211
|
-
/** Whether the collection is disabled for drops. */
|
|
3212
|
-
readonly isDisabled: boolean;
|
|
3213
|
-
/** Set the current drop target. */
|
|
3214
|
-
setTarget(target: DropTarget | null): void;
|
|
3215
|
-
/** Check if a drag type is accepted. */
|
|
3216
|
-
isAccepted(types: DragTypes): boolean;
|
|
3217
|
-
/** Enter the collection with a drop target. */
|
|
3218
|
-
enterTarget(target: DropTarget, x: number, y: number): void;
|
|
3219
|
-
/** Move to a new target within the collection. */
|
|
3220
|
-
moveToTarget(target: DropTarget, x: number, y: number): void;
|
|
3221
|
-
/** Exit the collection. */
|
|
3222
|
-
exitTarget(x: number, y: number): void;
|
|
3223
|
-
/** Activate the current target. */
|
|
3224
|
-
activateTarget(x: number, y: number): void;
|
|
3225
|
-
/** Perform a drop on the collection. */
|
|
3226
|
-
drop(items: DropItem[], dropOperation: DropOperation, isInternal: boolean, draggingKeys?: Set<string | number>): void;
|
|
3227
|
-
/** Get the drop operation for a target. */
|
|
3228
|
-
getDropOperation(target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]): DropOperation;
|
|
3229
|
-
/** Check if an item drop should be accepted. */
|
|
3230
|
-
shouldAcceptItemDrop(target: ItemDropTarget, types: DragTypes): boolean;
|
|
3231
|
-
}
|
|
3232
|
-
/**
|
|
3233
|
-
* Symbol for directory drag type.
|
|
3234
|
-
*/
|
|
3235
|
-
declare const DIRECTORY_DRAG_TYPE: symbol;
|
|
3236
|
-
/**
|
|
3237
|
-
* Creates state for accepting drops onto a collection.
|
|
3238
|
-
*
|
|
3239
|
-
* @param props - Accessor returning droppable collection options
|
|
3240
|
-
* @returns Droppable collection state object
|
|
3241
|
-
*/
|
|
3242
|
-
declare function createDroppableCollectionState(props: Accessor<DroppableCollectionStateOptions>): DroppableCollectionState;
|
|
3243
|
-
|
|
3244
|
-
/** Standard HTML ValidityState interface. */
|
|
3245
|
-
interface ValidityState {
|
|
3246
|
-
badInput: boolean;
|
|
3247
|
-
customError: boolean;
|
|
3248
|
-
patternMismatch: boolean;
|
|
3249
|
-
rangeOverflow: boolean;
|
|
3250
|
-
rangeUnderflow: boolean;
|
|
3251
|
-
stepMismatch: boolean;
|
|
3252
|
-
tooLong: boolean;
|
|
3253
|
-
tooShort: boolean;
|
|
3254
|
-
typeMismatch: boolean;
|
|
3255
|
-
valueMissing: boolean;
|
|
3256
|
-
valid: boolean;
|
|
3257
|
-
}
|
|
3258
|
-
/** Result of validation. */
|
|
3259
|
-
interface ValidationResult {
|
|
3260
|
-
/** Whether the value is invalid. */
|
|
3261
|
-
isInvalid: boolean;
|
|
3262
|
-
/** Details about which validation constraints failed. */
|
|
3263
|
-
validationDetails: ValidityState;
|
|
3264
|
-
/** Error messages to display. */
|
|
3265
|
-
validationErrors: string[];
|
|
3266
|
-
}
|
|
3267
|
-
/** Map of field names to their validation errors. */
|
|
3268
|
-
type ValidationErrors = Record<string, string | string[]>;
|
|
3269
|
-
/** Validation function that returns error messages or true/false. */
|
|
3270
|
-
type ValidationFunction<T> = (value: T) => boolean | string | string[] | null | undefined;
|
|
3271
|
-
/** Validation behavior mode. */
|
|
3272
|
-
type ValidationBehavior = 'aria' | 'native';
|
|
3273
|
-
interface FormValidationProps<T> {
|
|
3274
|
-
/** Whether the value is invalid (controlled). */
|
|
3275
|
-
isInvalid?: boolean;
|
|
3276
|
-
/** @deprecated Use isInvalid instead. */
|
|
3277
|
-
validationState?: 'valid' | 'invalid';
|
|
3278
|
-
/** Custom validation function. */
|
|
3279
|
-
validate?: ValidationFunction<T>;
|
|
3280
|
-
/** Validation behavior: 'aria' for realtime, 'native' for on submit. */
|
|
3281
|
-
validationBehavior?: ValidationBehavior;
|
|
3282
|
-
/** Built-in validation result from native input. */
|
|
3283
|
-
builtinValidation?: ValidationResult;
|
|
3284
|
-
/** Field name(s) for server error lookup. */
|
|
3285
|
-
name?: string | string[];
|
|
3286
|
-
/** Current field value. */
|
|
3287
|
-
value: T | null;
|
|
3288
|
-
}
|
|
3289
|
-
interface FormValidationState {
|
|
3290
|
-
/** Realtime validation results, updated as the user edits the value. */
|
|
3291
|
-
realtimeValidation: Accessor<ValidationResult>;
|
|
3292
|
-
/** Currently displayed validation results, updated when the user commits their changes. */
|
|
3293
|
-
displayValidation: Accessor<ValidationResult>;
|
|
3294
|
-
/** Updates the current validation result. Not displayed to the user until `commitValidation` is called. */
|
|
3295
|
-
updateValidation(result: ValidationResult): void;
|
|
3296
|
-
/** Resets the displayed validation state to valid when the user resets the form. */
|
|
3297
|
-
resetValidation(): void;
|
|
3298
|
-
/** Commits the realtime validation so it is displayed to the user. */
|
|
3299
|
-
commitValidation(): void;
|
|
3300
|
-
}
|
|
3301
|
-
/** A valid validity state. */
|
|
3302
|
-
declare const VALID_VALIDITY_STATE: ValidityState;
|
|
3303
|
-
/** Default validation result (valid). */
|
|
3304
|
-
declare const DEFAULT_VALIDATION_RESULT: ValidationResult;
|
|
3305
|
-
/** Context for server-side validation errors. */
|
|
3306
|
-
declare const FormValidationContext: solid_js.Context<ValidationErrors>;
|
|
3307
|
-
/** Private prop key for passing validation state to children. */
|
|
3308
|
-
declare const privateValidationStateProp: string;
|
|
3309
|
-
/**
|
|
3310
|
-
* Creates form validation state for a field.
|
|
3311
|
-
*
|
|
3312
|
-
* @example
|
|
3313
|
-
* ```tsx
|
|
3314
|
-
* const validationState = createFormValidationState({
|
|
3315
|
-
* value: inputValue(),
|
|
3316
|
-
* validate: (value) => {
|
|
3317
|
-
* if (!value) return 'This field is required';
|
|
3318
|
-
* if (value.length < 3) return 'Must be at least 3 characters';
|
|
3319
|
-
* return null;
|
|
3320
|
-
* },
|
|
3321
|
-
* validationBehavior: 'aria',
|
|
3322
|
-
* });
|
|
3323
|
-
*
|
|
3324
|
-
* // Access validation state
|
|
3325
|
-
* const isInvalid = () => validationState.displayValidation().isInvalid;
|
|
3326
|
-
* const errors = () => validationState.displayValidation().validationErrors;
|
|
3327
|
-
* ```
|
|
3328
|
-
*/
|
|
3329
|
-
declare function createFormValidationState<T>(props: FormValidationProps<T>): FormValidationState;
|
|
3330
|
-
/**
|
|
3331
|
-
* Merges multiple validation results into one.
|
|
3332
|
-
*/
|
|
3333
|
-
declare function mergeValidation(...results: ValidationResult[]): ValidationResult;
|
|
3334
|
-
|
|
3335
|
-
/**
|
|
3336
|
-
* SSR utilities for Solid Stately
|
|
3337
|
-
*
|
|
3338
|
-
* SolidJS has built-in SSR support with `isServer` and `createUniqueId()`.
|
|
3339
|
-
* These utilities provide a consistent API matching React-Stately's patterns.
|
|
3340
|
-
*/
|
|
3341
|
-
/**
|
|
3342
|
-
* Re-export isServer from solid-js/web for convenience.
|
|
3343
|
-
*/
|
|
3344
|
-
declare const isServer: boolean;
|
|
3345
|
-
/**
|
|
3346
|
-
* Returns whether the component is currently being server side rendered.
|
|
3347
|
-
* Can be used to delay browser-specific rendering until after hydration.
|
|
3348
|
-
*/
|
|
3349
|
-
declare function createIsSSR(): boolean;
|
|
3350
|
-
/**
|
|
3351
|
-
* Generate a unique ID that is stable across server and client.
|
|
3352
|
-
* Uses SolidJS's built-in createUniqueId which handles SSR correctly.
|
|
3353
|
-
*
|
|
3354
|
-
* @param defaultId - Optional default ID to use instead of generating one.
|
|
3355
|
-
*/
|
|
3356
|
-
declare function createId(defaultId?: string): string;
|
|
3357
|
-
/**
|
|
3358
|
-
* Check if we can use DOM APIs.
|
|
3359
|
-
* This is useful for code that needs to run only in the browser.
|
|
3360
|
-
*/
|
|
3361
|
-
declare const canUseDOM: boolean;
|
|
3362
|
-
|
|
3363
|
-
export { type AutocompleteState, type AutocompleteStateOptions, type CalendarState, type CalendarStateProps, type CheckboxGroupProps, type CheckboxGroupState, type Collection, type CollectionBase, type CollectionNode, type Color, type ColorAreaState, type ColorAreaStateOptions, type ColorAxes, type ColorChannel, type ColorChannelRange, type ColorFieldState, type ColorFieldStateOptions, type ColorFormat, type ColorSliderState, type ColorSliderStateOptions, type ColorSpace, type ColorWheelState, type ColorWheelStateOptions, type ColumnDefinition, type ComboBoxState, type ComboBoxStateProps, DEFAULT_VALIDATION_RESULT, DIRECTORY_DRAG_TYPE, type DateFieldState, type DateFieldStateProps, type DateRange, type DateSegment, type DateSegmentType, type DirectoryDropItem, type DisabledBehavior, type DisclosureGroupState, type DisclosureGroupStateProps, type Key as DisclosureKey, type DisclosureState, type DisclosureStateProps, type DragDropEvent, type DragEndEvent, type DragItem, type DragMoveEvent, type DragPreviewRenderer, type DragStartEvent, type DragState, type DragStateOptions, type DragTypes, type DraggableCollectionEndEvent, type DraggableCollectionMoveEvent, type DraggableCollectionProps, type DraggableCollectionStartEvent, type DraggableCollectionState, type DraggableCollectionStateOptions, type DropActivateEvent, type DropEnterEvent, type DropEvent, type DropExitEvent, type DropItem, type DropMoveEvent, type DropOperation, type DropPosition, type DropState, type DropStateOptions, type DropTarget, type DropTargetDelegate, type DroppableCollectionActivateEvent, type DroppableCollectionBaseProps, type DroppableCollectionDropEvent, type DroppableCollectionEnterEvent, type DroppableCollectionExitEvent, type DroppableCollectionInsertDropEvent, type DroppableCollectionMoveEvent, type DroppableCollectionOnItemDropEvent, type DroppableCollectionProps, type DroppableCollectionReorderEvent, type DroppableCollectionRootDropEvent, type DroppableCollectionState, type DroppableCollectionStateOptions, type DroppableCollectionUtilityOptions, type FileDropItem, type FilterFn, type FocusStrategy, FormValidationContext, type FormValidationProps, type FormValidationState, type GridCollection, type GridNode, type GridNodeType, type GridState, type GridStateOptions, type TableCollection$1 as ITableCollection, type ItemDropTarget, type ItemProps, type Key$1 as Key, type KeyboardActivation, ListCollection, type ListState, type ListStateProps, type MaybeAccessor, type MaybeAccessorValue, type MenuState, type MenuStateProps, type MenuTriggerAction, type MenuTriggerState, type MenuTriggerStateProps, type MultipleSelection, type NumberFieldState, type NumberFieldStateProps, type OverlayTriggerProps, type OverlayTriggerState, type QueuedToast, type RadioGroupProps, type RadioGroupState, type RangeCalendarState, type RangeCalendarStateProps, type RangeValue, type RootDropTarget, type RowDefinition, type SearchFieldState, type SearchFieldStateProps, type SectionProps, type SelectState, type SelectStateProps, type Selection, type SelectionBehavior, type SelectionMode, type SelectionState, type SelectionStateProps, type SingleSelectListState, type SingleSelectListStateProps, type SingleSelection, type SliderOrientation, type SliderState, type SliderStateProps, type SortDescriptor, type SortDirection, type Sortable, type TabListState, type TabListStateProps, type TabOrientation, TableCollection, type TableCollectionOptions, type TableState, type TableStateOptions, type TextDropItem, type TextFieldState, type TextFieldStateOptions, type TimeFieldState, type TimeFieldStateProps, type TimeSegment, type TimeSegmentType, type TimeValue, Timer, type ToastOptions, ToastQueue, type ToastQueueOptions, type ToastState, type ToastStateProps, type ToggleState, type ToggleStateOptions, type TooltipTriggerProps, type TooltipTriggerState, TreeCollection, type TreeCollection$1 as TreeCollectionInterface, type TreeItemData, type TreeNode, type TreeState, type TreeStateOptions, VALID_VALIDITY_STATE, type ValidationBehavior, type ValidationErrors, type ValidationFunction, type ValidationResult, type ValidationState, type ValidityState, access, canUseDOM, createAutocompleteState, createCalendarState, createCheckboxGroupState, createColorAreaState, createColorFieldState, createColorSliderState, createColorWheelState, createComboBoxState, createDateFieldState, createDisclosureGroupState, createDisclosureState, createDragState, createDraggableCollectionState, createDropState, createDroppableCollectionState, createFormValidationState, createGridState, createHSBColor, createHSLColor, createId, createIsSSR, createListCollection, createListState, createMenuState, createOverlayTriggerState as createMenuTriggerState, createNumberFieldState, createOverlayTriggerState, createRGBColor, createRadioGroupState, createRangeCalendarState, createSearchFieldState, createSelectState, createSelectionState, createSingleSelectListState, createSliderState, createTabListState, createTableCollection, createTableState, createTextFieldState, createTimeFieldState, createToastQueue, createToastState, createToggleState, createTooltipTriggerState, createTreeCollection, createTreeState, defaultContainsFilter, isAccessor, isServer, mergeValidation, normalizeColor, parseColor, privateValidationStateProp, radioGroupSyncVersion, resetTooltipState };
|
|
1
|
+
export { createToggleState, type ToggleStateOptions, type ToggleState, } from './toggle';
|
|
2
|
+
export { createAutocompleteState, type AutocompleteState, type AutocompleteStateOptions, } from './autocomplete';
|
|
3
|
+
export { createTextFieldState, type TextFieldStateOptions, type TextFieldState, } from './textfield';
|
|
4
|
+
export { createCheckboxGroupState, type CheckboxGroupProps, type CheckboxGroupState, } from './checkbox';
|
|
5
|
+
export { createRadioGroupState, radioGroupSyncVersion, type RadioGroupProps, type RadioGroupState, } from './radio';
|
|
6
|
+
export { createOverlayTriggerState, type OverlayTriggerProps, type OverlayTriggerState, } from './overlays';
|
|
7
|
+
export { type Key, type SelectionMode, type SelectionBehavior, type Selection, type FocusStrategy, type DisabledBehavior, type CollectionNode, type Collection, type ItemProps, type SectionProps, type CollectionBase, type SingleSelection, type MultipleSelection, ListCollection, createListCollection, createSelectionState, type SelectionStateProps, type SelectionState, createListState, createSingleSelectListState, type ListStateProps, type ListState, type SingleSelectListStateProps, type SingleSelectListState, createMenuState, createMenuTriggerState, type MenuStateProps, type MenuState, type MenuTriggerStateProps, type MenuTriggerState, } from './collections';
|
|
8
|
+
export { createSelectState, type SelectStateProps, type SelectState, } from './select';
|
|
9
|
+
export { createComboBoxState, defaultContainsFilter, type ComboBoxState, type ComboBoxStateProps, type FilterFn, type MenuTriggerAction, } from './combobox';
|
|
10
|
+
export { createTabListState, type TabListStateProps, type TabListState, type KeyboardActivation, type TabOrientation, } from './tabs';
|
|
11
|
+
export { createNumberFieldState, type NumberFieldStateProps, type NumberFieldState, } from './numberfield';
|
|
12
|
+
export { createSearchFieldState, type SearchFieldStateProps, type SearchFieldState, } from './searchfield';
|
|
13
|
+
export { createSliderState, type SliderStateProps, type SliderState, type SliderOrientation, } from './slider';
|
|
14
|
+
export { createTooltipTriggerState, resetTooltipState, type TooltipTriggerProps, type TooltipTriggerState, } from './tooltip';
|
|
15
|
+
export { createToastState, createToastQueue, ToastQueue, Timer, type ToastOptions, type QueuedToast, type ToastQueueOptions, type ToastStateProps, type ToastState, } from './toast';
|
|
16
|
+
export { createDisclosureState, createDisclosureGroupState, type DisclosureStateProps, type DisclosureState, type DisclosureGroupStateProps, type DisclosureGroupState, type Key as DisclosureKey, } from './disclosure';
|
|
17
|
+
export { createCalendarState, type CalendarStateProps, type CalendarState, type ValidationState, createRangeCalendarState, type RangeCalendarStateProps, type RangeCalendarState, type DateRange, type RangeValue, createDateFieldState, type DateFieldStateProps, type DateFieldState, type DateSegment, type DateSegmentType, createTimeFieldState, type TimeFieldStateProps, type TimeFieldState, type TimeSegment, type TimeSegmentType, type TimeValue, type CalendarDate, type CalendarDateTime, type ZonedDateTime, type DateValue, type Time, today, now, getLocalTimeZone, parseDate, parseDateTime, parseTime, parseAbsolute, parseAbsoluteToLocal, parseZonedDateTime, toCalendarDate, toCalendarDateTime, toZoned, toTime, CalendarDateClass, CalendarDateTimeClass, ZonedDateTimeClass, TimeClass, DateFormatter, isSameDay, isSameMonth, isSameYear, isToday, isWeekend, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfYear, endOfYear, getWeeksInMonth, getDayOfWeek, minDate, maxDate, } from './calendar';
|
|
18
|
+
export { createGridState, type GridState, type GridStateOptions, type GridCollection, type GridNode, type GridNodeType, } from './grid';
|
|
19
|
+
export { createTableState, TableCollection, createTableCollection, type TableState, type TableStateOptions, type ITableCollection, type SortDescriptor, type SortDirection, type Sortable, type ColumnDefinition, type RowDefinition, type TableCollectionOptions, } from './table';
|
|
20
|
+
export { createTreeState, TreeCollection, createTreeCollection, type TreeState, type TreeStateOptions, type TreeCollectionInterface, type TreeNode, type TreeItemData, } from './tree';
|
|
21
|
+
export { type Color, type ColorFormat, type ColorSpace, type ColorChannel, type ColorChannelRange, type ColorAxes, parseColor, normalizeColor, createRGBColor, createHSLColor, createHSBColor, createColorSliderState, type ColorSliderStateOptions, type ColorSliderState, createColorAreaState, type ColorAreaStateOptions, type ColorAreaState, createColorWheelState, type ColorWheelStateOptions, type ColorWheelState, createColorFieldState, type ColorFieldStateOptions, type ColorFieldState, } from './color';
|
|
22
|
+
export { type DropOperation, type DragItem, type DragDropEvent, type DragStartEvent, type DragMoveEvent, type DragEndEvent, type DropEnterEvent, type DropMoveEvent, type DropActivateEvent, type DropExitEvent, type TextDropItem, type FileDropItem, type DirectoryDropItem, type DropItem, type DropEvent, type DropPosition, type RootDropTarget, type ItemDropTarget, type DropTarget, type DroppableCollectionEnterEvent, type DroppableCollectionMoveEvent, type DroppableCollectionActivateEvent, type DroppableCollectionExitEvent, type DroppableCollectionDropEvent, type DroppableCollectionInsertDropEvent, type DroppableCollectionRootDropEvent, type DroppableCollectionOnItemDropEvent, type DroppableCollectionReorderEvent, type DragTypes, type DropTargetDelegate, type DraggableCollectionStartEvent, type DraggableCollectionMoveEvent, type DraggableCollectionEndEvent, type DragPreviewRenderer, type DroppableCollectionUtilityOptions, type DroppableCollectionBaseProps, type DroppableCollectionProps, type DraggableCollectionProps, createDragState, type DragStateOptions, type DragState, createDropState, type DropStateOptions, type DropState, createDraggableCollectionState, type DraggableCollectionStateOptions, type DraggableCollectionState, createDroppableCollectionState, DIRECTORY_DRAG_TYPE, type DroppableCollectionStateOptions, type DroppableCollectionState, } from './dnd';
|
|
23
|
+
export { createFormValidationState, mergeValidation, FormValidationContext, privateValidationStateProp, VALID_VALIDITY_STATE, DEFAULT_VALIDATION_RESULT, type FormValidationState, type FormValidationProps, type ValidationResult, type ValidationErrors, type ValidationFunction, type ValidationBehavior, type ValidityState, } from './form';
|
|
24
|
+
export { createIsSSR, createId, canUseDOM, isServer } from './ssr';
|
|
25
|
+
export { access, isAccessor, type MaybeAccessor, type MaybeAccessorValue } from './utils';
|