@proyecto-viviana/solid-stately 0.2.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -283
- package/dist/autocomplete/createAutocompleteState.d.ts +2 -2
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/calendar/IncompleteDate.d.ts +61 -0
- package/dist/calendar/createCalendarState.d.ts +41 -16
- package/dist/calendar/createDateFieldState.d.ts +39 -9
- package/dist/calendar/createDatePickerState.d.ts +60 -0
- package/dist/calendar/createRangeCalendarState.d.ts +37 -10
- package/dist/calendar/createTimeFieldState.d.ts +34 -7
- package/dist/calendar/index.d.ts +7 -6
- package/dist/checkbox/createCheckboxGroupState.d.ts +6 -6
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/collections/ListCollection.d.ts +1 -1
- package/dist/collections/createListState.d.ts +11 -8
- package/dist/collections/createMenuState.d.ts +7 -7
- package/dist/collections/createSelectionState.d.ts +22 -10
- package/dist/collections/getChildNodes.d.ts +11 -0
- package/dist/collections/index.d.ts +6 -5
- package/dist/collections/types.d.ts +12 -12
- package/dist/color/Color.d.ts +1 -1
- package/dist/color/createColorAreaState.d.ts +4 -2
- package/dist/color/createColorFieldState.d.ts +38 -12
- package/dist/color/createColorSliderState.d.ts +9 -2
- package/dist/color/createColorWheelState.d.ts +13 -2
- package/dist/color/getColorChannels.d.ts +1 -1
- package/dist/color/index.d.ts +6 -6
- package/dist/color/types.d.ts +4 -4
- package/dist/combobox/createComboBoxState.d.ts +34 -13
- package/dist/combobox/index.d.ts +1 -1
- package/dist/data/createAsyncList.d.ts +4 -4
- package/dist/data/createListData.d.ts +2 -2
- package/dist/data/createTreeData.d.ts +6 -2
- package/dist/data/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts +2 -4
- package/dist/disclosure/createDisclosureState.d.ts +2 -2
- package/dist/disclosure/index.d.ts +1 -1
- package/dist/dnd/createDragState.d.ts +2 -2
- package/dist/dnd/createDraggableCollectionState.d.ts +2 -2
- package/dist/dnd/createDropState.d.ts +2 -2
- package/dist/dnd/createDroppableCollectionState.d.ts +3 -3
- package/dist/dnd/index.d.ts +5 -5
- package/dist/dnd/types.d.ts +19 -17
- package/dist/form/createFormValidationState.d.ts +3 -3
- package/dist/form/index.d.ts +1 -1
- package/dist/grid/createGridState.d.ts +2 -2
- package/dist/grid/index.d.ts +2 -2
- package/dist/grid/types.d.ts +27 -11
- package/dist/index.d.ts +31 -30
- package/dist/index.js +9077 -7246
- package/dist/index.js.map +1 -1
- package/dist/menu/index.d.ts +2 -2
- package/dist/numberfield/createNumberFieldState.d.ts +2 -2
- package/dist/numberfield/index.d.ts +1 -1
- package/dist/overlays/createOverlayTriggerState.d.ts +2 -2
- package/dist/overlays/index.d.ts +1 -1
- package/dist/radio/createRadioGroupState.d.ts +7 -7
- package/dist/radio/index.d.ts +1 -1
- package/dist/searchfield/createSearchFieldState.d.ts +2 -2
- package/dist/searchfield/index.d.ts +2 -2
- package/dist/select/createSelectState.d.ts +14 -8
- package/dist/select/index.d.ts +1 -1
- package/dist/selection/Selection.d.ts +16 -0
- package/dist/selection/SelectionManager.d.ts +110 -0
- package/dist/selection/createMultipleSelectionState.d.ts +59 -0
- package/dist/selection/index.d.ts +6 -5
- package/dist/slider/createSliderState.d.ts +3 -3
- package/dist/slider/index.d.ts +2 -2
- package/dist/steplist/createStepListState.d.ts +48 -0
- package/dist/steplist/index.d.ts +1 -0
- package/dist/table/TableCollection.d.ts +33 -3
- package/dist/table/createTableColumnResizeState.d.ts +54 -0
- package/dist/table/createTableState.d.ts +2 -2
- package/dist/table/createTreeGridState.d.ts +15 -0
- package/dist/table/index.d.ts +6 -3
- package/dist/table/types.d.ts +68 -10
- package/dist/tabs/createTabListState.d.ts +5 -5
- package/dist/tabs/index.d.ts +1 -1
- package/dist/textfield/createTextFieldState.d.ts +2 -2
- package/dist/textfield/index.d.ts +1 -1
- package/dist/toast/createToastState.d.ts +24 -2
- package/dist/toast/index.d.ts +1 -1
- package/dist/toggle/createToggleGroupState.d.ts +4 -4
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/index.d.ts +2 -2
- package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tree/TreeCollection.d.ts +2 -2
- package/dist/tree/createTreeState.d.ts +2 -2
- package/dist/tree/index.d.ts +3 -3
- package/dist/tree/types.d.ts +27 -13
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/reactivity.d.ts +1 -1
- package/package.json +29 -30
- package/src/autocomplete/createAutocompleteState.d.ts +19 -17
- package/src/autocomplete/createAutocompleteState.ts +24 -30
- package/src/autocomplete/index.d.ts +6 -2
- package/src/autocomplete/index.ts +1 -1
- package/src/calendar/IncompleteDate.ts +430 -0
- package/src/calendar/createCalendarState.d.ts +139 -117
- package/src/calendar/createCalendarState.ts +308 -94
- package/src/calendar/createDateFieldState.d.ts +130 -95
- package/src/calendar/createDateFieldState.ts +447 -334
- package/src/calendar/createDatePickerState.ts +347 -0
- package/src/calendar/createRangeCalendarState.d.ts +154 -129
- package/src/calendar/createRangeCalendarState.ts +411 -85
- package/src/calendar/createTimeFieldState.d.ts +81 -79
- package/src/calendar/createTimeFieldState.ts +187 -108
- package/src/calendar/index.d.ts +80 -7
- package/src/calendar/index.ts +23 -12
- package/src/checkbox/createCheckboxGroupState.d.ts +57 -55
- package/src/checkbox/createCheckboxGroupState.ts +20 -29
- package/src/checkbox/index.d.ts +6 -2
- package/src/checkbox/index.ts +1 -1
- package/src/collections/ListCollection.d.ts +25 -22
- package/src/collections/ListCollection.ts +6 -6
- package/src/collections/createListState.d.ts +73 -58
- package/src/collections/createListState.ts +67 -35
- package/src/collections/createMenuState.d.ts +36 -31
- package/src/collections/createMenuState.ts +21 -12
- package/src/collections/createSelectionState.d.ts +78 -65
- package/src/collections/createSelectionState.ts +66 -52
- package/src/collections/getChildNodes.ts +98 -0
- package/src/collections/index.d.ts +38 -6
- package/src/collections/index.ts +14 -10
- package/src/collections/types.d.ts +101 -101
- package/src/collections/types.ts +12 -12
- package/src/color/Color.d.ts +20 -5
- package/src/color/Color.ts +357 -254
- package/src/color/createColorAreaState.d.ts +67 -65
- package/src/color/createColorAreaState.ts +21 -13
- package/src/color/createColorFieldState.d.ts +46 -44
- package/src/color/createColorFieldState.ts +285 -149
- package/src/color/createColorSliderState.d.ts +58 -56
- package/src/color/createColorSliderState.ts +45 -14
- package/src/color/createColorWheelState.d.ts +42 -40
- package/src/color/createColorWheelState.ts +101 -64
- package/src/color/getColorChannels.ts +7 -5
- package/src/color/index.d.ts +36 -7
- package/src/color/index.ts +6 -9
- package/src/color/types.d.ts +68 -63
- package/src/color/types.ts +11 -19
- package/src/combobox/createComboBoxState.d.ts +107 -105
- package/src/combobox/createComboBoxState.ts +184 -89
- package/src/combobox/index.d.ts +10 -2
- package/src/combobox/index.ts +1 -1
- package/src/data/createAsyncList.ts +89 -63
- package/src/data/createListData.ts +67 -67
- package/src/data/createTreeData.ts +304 -91
- package/src/data/index.ts +3 -3
- package/src/datepicker/index.ts +6 -10
- package/src/disclosure/createDisclosureState.d.ts +47 -43
- package/src/disclosure/createDisclosureState.ts +7 -21
- package/src/disclosure/index.d.ts +10 -2
- package/src/disclosure/index.ts +1 -1
- package/src/dnd/createDragState.d.ts +51 -42
- package/src/dnd/createDragState.ts +12 -14
- package/src/dnd/createDraggableCollectionState.d.ts +52 -41
- package/src/dnd/createDraggableCollectionState.ts +14 -21
- package/src/dnd/createDropState.d.ts +64 -45
- package/src/dnd/createDropState.ts +22 -32
- package/src/dnd/createDroppableCollectionState.d.ts +88 -59
- package/src/dnd/createDroppableCollectionState.ts +40 -43
- package/src/dnd/index.d.ts +55 -6
- package/src/dnd/index.ts +6 -18
- package/src/dnd/types.d.ts +170 -157
- package/src/dnd/types.ts +24 -22
- package/src/form/createFormValidationState.d.ts +47 -45
- package/src/form/createFormValidationState.ts +30 -63
- package/src/form/index.d.ts +16 -2
- package/src/form/index.ts +1 -1
- package/src/grid/createGridState.d.ts +7 -4
- package/src/grid/createGridState.ts +78 -51
- package/src/grid/index.d.ts +3 -3
- package/src/grid/index.ts +2 -8
- package/src/grid/types.d.ts +136 -129
- package/src/grid/types.ts +34 -18
- package/src/index.d.ts +311 -26
- package/src/index.ts +59 -89
- package/src/menu/index.ts +2 -4
- package/src/numberfield/createNumberFieldState.d.ts +56 -54
- package/src/numberfield/createNumberFieldState.ts +26 -31
- package/src/numberfield/index.d.ts +6 -2
- package/src/numberfield/index.ts +1 -1
- package/src/overlays/createOverlayTriggerState.d.ts +22 -20
- package/src/overlays/createOverlayTriggerState.ts +3 -4
- package/src/overlays/index.d.ts +6 -2
- package/src/overlays/index.ts +1 -1
- package/src/radio/createRadioGroupState.d.ts +54 -52
- package/src/radio/createRadioGroupState.ts +27 -29
- package/src/radio/index.d.ts +7 -2
- package/src/radio/index.ts +1 -1
- package/src/searchfield/createSearchFieldState.d.ts +16 -14
- package/src/searchfield/createSearchFieldState.ts +5 -11
- package/src/searchfield/index.d.ts +3 -3
- package/src/searchfield/index.ts +2 -5
- package/src/select/createSelectState.d.ts +63 -61
- package/src/select/createSelectState.ts +42 -29
- package/src/select/index.d.ts +2 -2
- package/src/select/index.ts +1 -5
- package/src/selection/Selection.ts +28 -0
- package/src/selection/SelectionManager.ts +526 -0
- package/src/selection/createMultipleSelectionState.ts +247 -0
- package/src/selection/index.ts +12 -7
- package/src/slider/createSliderState.d.ts +60 -60
- package/src/slider/createSliderState.ts +55 -33
- package/src/slider/index.d.ts +3 -3
- package/src/slider/index.ts +2 -6
- package/src/ssr/index.d.ts +1 -1
- package/src/ssr/index.ts +2 -2
- package/src/steplist/createStepListState.ts +191 -0
- package/src/steplist/index.ts +5 -0
- package/src/table/TableCollection.d.ts +42 -40
- package/src/table/TableCollection.ts +266 -99
- package/src/table/createTableColumnResizeState.ts +242 -0
- package/src/table/createTableState.d.ts +7 -4
- package/src/table/createTableState.ts +30 -7
- package/src/table/createTreeGridState.ts +146 -0
- package/src/table/index.d.ts +14 -4
- package/src/table/index.ts +13 -3
- package/src/table/types.d.ts +98 -92
- package/src/table/types.ts +83 -13
- package/src/tabs/createTabListState.d.ts +59 -57
- package/src/tabs/createTabListState.ts +34 -39
- package/src/tabs/index.d.ts +8 -2
- package/src/tabs/index.ts +1 -1
- package/src/textfield/createTextFieldState.d.ts +16 -14
- package/src/textfield/createTextFieldState.ts +7 -18
- package/src/textfield/index.d.ts +6 -2
- package/src/textfield/index.ts +1 -1
- package/src/toast/createToastState.d.ts +92 -86
- package/src/toast/createToastState.ts +90 -52
- package/src/toast/index.d.ts +12 -2
- package/src/toast/index.ts +2 -1
- package/src/toggle/createToggleGroupState.ts +11 -21
- package/src/toggle/createToggleState.d.ts +19 -19
- package/src/toggle/createToggleState.ts +2 -16
- package/src/toggle/index.d.ts +2 -2
- package/src/toggle/index.ts +2 -6
- package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
- package/src/tooltip/createTooltipTriggerState.ts +12 -11
- package/src/tooltip/index.d.ts +7 -2
- package/src/tooltip/index.ts +1 -1
- package/src/tree/TreeCollection.d.ts +26 -23
- package/src/tree/TreeCollection.ts +29 -22
- package/src/tree/createTreeState.d.ts +7 -4
- package/src/tree/createTreeState.ts +70 -41
- package/src/tree/index.d.ts +10 -4
- package/src/tree/index.ts +3 -3
- package/src/tree/types.d.ts +131 -126
- package/src/tree/types.ts +30 -13
- package/src/utils/index.d.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/reactivity.d.ts +2 -2
- package/src/utils/reactivity.ts +3 -3
|
@@ -4,127 +4,149 @@
|
|
|
4
4
|
* Provides state management for calendar components.
|
|
5
5
|
* Based on @react-stately/calendar useCalendarState
|
|
6
6
|
*/
|
|
7
|
-
import { type Accessor } from
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { type Accessor } from "solid-js";
|
|
8
|
+
import {
|
|
9
|
+
type Calendar as InternationalizedCalendar,
|
|
10
|
+
type CalendarDate,
|
|
11
|
+
type CalendarIdentifier,
|
|
12
|
+
type DateValue,
|
|
13
|
+
} from "@internationalized/date";
|
|
14
|
+
import { type MaybeAccessor } from "../utils";
|
|
15
|
+
export type ValidationState = "valid" | "invalid";
|
|
16
|
+
export type CalendarPageBehavior = "single" | "visible";
|
|
17
|
+
export type CalendarSelectionAlignment = "start" | "center" | "end";
|
|
18
|
+
export type CalendarDayOfWeek = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
|
|
11
19
|
export interface CalendarStateProps<T extends DateValue = DateValue> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
20
|
+
/** The current value (controlled). */
|
|
21
|
+
value?: MaybeAccessor<T | null>;
|
|
22
|
+
/** The default value (uncontrolled). */
|
|
23
|
+
defaultValue?: T | null;
|
|
24
|
+
/** Handler called when the value changes. */
|
|
25
|
+
onChange?: (value: T | null) => void;
|
|
26
|
+
/** The minimum allowed date. */
|
|
27
|
+
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
28
|
+
/** The maximum allowed date. */
|
|
29
|
+
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
30
|
+
/** Whether the calendar is disabled. */
|
|
31
|
+
isDisabled?: MaybeAccessor<boolean>;
|
|
32
|
+
/** Whether the calendar is read-only. */
|
|
33
|
+
isReadOnly?: MaybeAccessor<boolean>;
|
|
34
|
+
/** Whether dates outside the visible range are automatically focused. */
|
|
35
|
+
autoFocus?: boolean;
|
|
36
|
+
/** The date that is focused when the calendar first mounts. */
|
|
37
|
+
focusedValue?: MaybeAccessor<DateValue | null | undefined>;
|
|
38
|
+
/** The default focused date (uncontrolled). */
|
|
39
|
+
defaultFocusedValue?: DateValue;
|
|
40
|
+
/** Handler called when the focused date changes. */
|
|
41
|
+
onFocusChange?: (date: CalendarDate) => void;
|
|
42
|
+
/** The locale to use for formatting. */
|
|
43
|
+
locale?: MaybeAccessor<string | undefined>;
|
|
44
|
+
/** Creates a calendar object for a locale calendar identifier. */
|
|
45
|
+
createCalendar?: (identifier: CalendarIdentifier) => InternationalizedCalendar;
|
|
46
|
+
/** Callback that is called for each date in the calendar to determine if it is unavailable. */
|
|
47
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
48
|
+
/** The number of months to display at once. */
|
|
49
|
+
visibleMonths?: number;
|
|
50
|
+
/** Controls whether paging advances by one month or by the visible month range. */
|
|
51
|
+
pageBehavior?: CalendarPageBehavior;
|
|
52
|
+
/** Determines how the visible months align around the initial focused date. */
|
|
53
|
+
selectionAlignment?: CalendarSelectionAlignment;
|
|
54
|
+
/** Whether to automatically focus the calendar when it is mounted. */
|
|
55
|
+
autoFocusOnMount?: boolean;
|
|
56
|
+
/** Controls which days are disabled. */
|
|
57
|
+
isDateDisabled?: (date: DateValue) => boolean;
|
|
58
|
+
/** Validation state. */
|
|
59
|
+
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
60
|
+
/** Error message. */
|
|
61
|
+
errorMessage?: string;
|
|
62
|
+
/** The first day of the week (0 = Sunday, 1 = Monday, etc.). */
|
|
63
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
50
64
|
}
|
|
51
65
|
export interface CalendarState<T extends DateValue = DateValue> {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
66
|
+
/** The currently selected date. */
|
|
67
|
+
value: Accessor<T | null>;
|
|
68
|
+
/** Sets the selected date. */
|
|
69
|
+
setValue: (value: T | null) => void;
|
|
70
|
+
/** The currently focused date. */
|
|
71
|
+
focusedDate: Accessor<CalendarDate>;
|
|
72
|
+
/** Sets the focused date. */
|
|
73
|
+
setFocusedDate: (date: CalendarDate) => void;
|
|
74
|
+
/** Whether the calendar is disabled. */
|
|
75
|
+
isDisabled: Accessor<boolean>;
|
|
76
|
+
/** Whether the calendar is read-only. */
|
|
77
|
+
isReadOnly: Accessor<boolean>;
|
|
78
|
+
/** The visible date range (first and last day of visible month(s)). */
|
|
79
|
+
visibleRange: Accessor<{
|
|
80
|
+
start: CalendarDate;
|
|
81
|
+
end: CalendarDate;
|
|
82
|
+
}>;
|
|
83
|
+
/** The timezone used for date calculations. */
|
|
84
|
+
timeZone: string;
|
|
85
|
+
/** The locale used for formatting and locale-specific week starts. */
|
|
86
|
+
locale: Accessor<string>;
|
|
87
|
+
/** The explicitly requested first weekday, or undefined for the locale default. */
|
|
88
|
+
firstDayOfWeek: Accessor<CalendarDayOfWeek | undefined>;
|
|
89
|
+
/** The validation state. */
|
|
90
|
+
validationState: Accessor<ValidationState | undefined>;
|
|
91
|
+
/** Whether the current value is invalid according to validation state. */
|
|
92
|
+
isValueInvalid: Accessor<boolean>;
|
|
93
|
+
/** Whether a date is selected. */
|
|
94
|
+
isSelected: (date: DateValue) => boolean;
|
|
95
|
+
/** Whether a date is focused. */
|
|
96
|
+
isCellFocused: (date: DateValue) => boolean;
|
|
97
|
+
/** Whether a date is unavailable. */
|
|
98
|
+
isCellUnavailable: (date: DateValue) => boolean;
|
|
99
|
+
/** Whether a date is disabled. */
|
|
100
|
+
isCellDisabled: (date: DateValue) => boolean;
|
|
101
|
+
/** Whether a date is outside the visible range. */
|
|
102
|
+
isOutsideVisibleRange: (date: DateValue) => boolean;
|
|
103
|
+
/** Whether a date is invalid. */
|
|
104
|
+
isInvalid: (date: DateValue) => boolean;
|
|
105
|
+
/** Moves focus to the previous page (month). */
|
|
106
|
+
focusPreviousPage: () => void;
|
|
107
|
+
/** Moves focus to the next page (month). */
|
|
108
|
+
focusNextPage: () => void;
|
|
109
|
+
/** Moves focus to the previous section (year). */
|
|
110
|
+
focusPreviousSection: () => void;
|
|
111
|
+
/** Moves focus to the next section (year). */
|
|
112
|
+
focusNextSection: () => void;
|
|
113
|
+
/** Moves focus to the previous day. */
|
|
114
|
+
focusPreviousDay: () => void;
|
|
115
|
+
/** Moves focus to the next day. */
|
|
116
|
+
focusNextDay: () => void;
|
|
117
|
+
/** Moves focus to the previous week. */
|
|
118
|
+
focusPreviousWeek: () => void;
|
|
119
|
+
/** Moves focus to the next week. */
|
|
120
|
+
focusNextWeek: () => void;
|
|
121
|
+
/** Moves focus to the start of the month. */
|
|
122
|
+
focusPageStart: () => void;
|
|
123
|
+
/** Moves focus to the end of the month. */
|
|
124
|
+
focusPageEnd: () => void;
|
|
125
|
+
/** Selects the focused date. */
|
|
126
|
+
selectFocusedDate: () => void;
|
|
127
|
+
/** Selects a specific date. */
|
|
128
|
+
selectDate: (date: CalendarDate) => void;
|
|
129
|
+
/** Whether focus is currently within the calendar. */
|
|
130
|
+
isFocused: Accessor<boolean>;
|
|
131
|
+
/** Sets whether focus is within the calendar. */
|
|
132
|
+
setFocused: (focused: boolean) => void;
|
|
133
|
+
/** Gets the dates for a week in the visible range. */
|
|
134
|
+
getDatesInWeek: (weekIndex: number, monthStartDate?: CalendarDate) => (CalendarDate | null)[];
|
|
135
|
+
/** Gets the number of weeks in a month. */
|
|
136
|
+
getWeeksInMonth: (date?: CalendarDate) => number;
|
|
137
|
+
/** The week day headers. */
|
|
138
|
+
weekDays: Accessor<string[]>;
|
|
139
|
+
/** The title for the calendar (formatted month and year). */
|
|
140
|
+
title: Accessor<string>;
|
|
141
|
+
/** The number of visible months. */
|
|
142
|
+
visibleMonths: number;
|
|
143
|
+
/** Whether the calendar is paginating (for animations). */
|
|
144
|
+
isPaginating: Accessor<boolean>;
|
|
125
145
|
}
|
|
126
146
|
/**
|
|
127
147
|
* Provides state management for a calendar component.
|
|
128
148
|
*/
|
|
129
|
-
export declare function createCalendarState<T extends DateValue = CalendarDate>(
|
|
130
|
-
|
|
149
|
+
export declare function createCalendarState<T extends DateValue = CalendarDate>(
|
|
150
|
+
props?: CalendarStateProps<T>,
|
|
151
|
+
): CalendarState<T>;
|
|
152
|
+
//# sourceMappingURL=createCalendarState.d.ts.map
|