@proyecto-viviana/solid-stately 0.5.1 → 0.6.0-rc.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/LICENSE-APACHE-2.0 +201 -0
- package/NOTICE +91 -0
- package/README.md +59 -29
- package/dist/autocomplete/createAutocompleteState.d.ts +2 -1
- package/dist/autocomplete/createAutocompleteState.d.ts.map +1 -0
- package/dist/autocomplete/index.d.ts +1 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/calendar/IncompleteDate.d.ts +2 -1
- package/dist/calendar/IncompleteDate.d.ts.map +1 -0
- package/dist/calendar/createCalendarState.d.ts +10 -9
- package/dist/calendar/createCalendarState.d.ts.map +1 -0
- package/dist/calendar/createDateFieldState.d.ts +4 -20
- package/dist/calendar/createDateFieldState.d.ts.map +1 -0
- package/dist/calendar/createDatePickerState.d.ts +4 -7
- package/dist/calendar/createDatePickerState.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendarState.d.ts +9 -7
- package/dist/calendar/createRangeCalendarState.d.ts.map +1 -0
- package/dist/calendar/createTimeFieldState.d.ts +5 -24
- package/dist/calendar/createTimeFieldState.d.ts.map +1 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/intl/index.d.ts +1 -0
- package/dist/calendar/intl/index.d.ts.map +1 -0
- package/dist/checkbox/createCheckboxGroupState.d.ts +3 -0
- package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.d.ts.map +1 -0
- package/dist/collections/ListCollection.d.ts +5 -0
- package/dist/collections/ListCollection.d.ts.map +1 -0
- package/dist/collections/createListState.d.ts +2 -6
- package/dist/collections/createListState.d.ts.map +1 -0
- package/dist/collections/createMenuState.d.ts +74 -13
- package/dist/collections/createMenuState.d.ts.map +1 -0
- package/dist/collections/createSelectionState.d.ts +2 -5
- package/dist/collections/createSelectionState.d.ts.map +1 -0
- package/dist/collections/getChildNodes.d.ts +6 -3
- package/dist/collections/getChildNodes.d.ts.map +1 -0
- package/dist/collections/index.d.ts +2 -1
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/collections/types.d.ts +36 -2
- package/dist/collections/types.d.ts.map +1 -0
- package/dist/color/Color.d.ts +7 -1
- package/dist/color/Color.d.ts.map +1 -0
- package/dist/color/createColorAreaState.d.ts +6 -5
- package/dist/color/createColorAreaState.d.ts.map +1 -0
- package/dist/color/createColorFieldState.d.ts +4 -5
- package/dist/color/createColorFieldState.d.ts.map +1 -0
- package/dist/color/createColorSliderState.d.ts +4 -5
- package/dist/color/createColorSliderState.d.ts.map +1 -0
- package/dist/color/createColorWheelState.d.ts +2 -5
- package/dist/color/createColorWheelState.d.ts.map +1 -0
- package/dist/color/getColorChannels.d.ts +3 -0
- package/dist/color/getColorChannels.d.ts.map +1 -0
- package/dist/color/index.d.ts +2 -1
- package/dist/color/index.d.ts.map +1 -0
- package/dist/color/intl/index.d.ts +1 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/color/types.d.ts +2 -1
- package/dist/color/types.d.ts.map +1 -0
- package/dist/combobox/createComboBoxState.d.ts +92 -29
- package/dist/combobox/createComboBoxState.d.ts.map +1 -0
- package/dist/combobox/index.d.ts +2 -1
- package/dist/combobox/index.d.ts.map +1 -0
- package/dist/data/createAsyncList.d.ts +1 -7
- package/dist/data/createAsyncList.d.ts.map +1 -0
- package/dist/data/createListData.d.ts +1 -6
- package/dist/data/createListData.d.ts.map +1 -0
- package/dist/data/createTreeData.d.ts +1 -6
- package/dist/data/createTreeData.d.ts.map +1 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/datepicker/index.d.ts +1 -0
- package/dist/datepicker/index.d.ts.map +1 -0
- package/dist/disclosure/createDisclosureState.d.ts +2 -5
- package/dist/disclosure/createDisclosureState.d.ts.map +1 -0
- package/dist/disclosure/index.d.ts +1 -0
- package/dist/disclosure/index.d.ts.map +1 -0
- package/dist/dnd/createDragState.d.ts +2 -6
- package/dist/dnd/createDragState.d.ts.map +1 -0
- package/dist/dnd/createDraggableCollectionState.d.ts +44 -11
- package/dist/dnd/createDraggableCollectionState.d.ts.map +1 -0
- package/dist/dnd/createDropState.d.ts +2 -6
- package/dist/dnd/createDropState.d.ts.map +1 -0
- package/dist/dnd/createDroppableCollectionState.d.ts +34 -11
- package/dist/dnd/createDroppableCollectionState.d.ts.map +1 -0
- package/dist/dnd/index.d.ts +3 -2
- package/dist/dnd/index.d.ts.map +1 -0
- package/dist/dnd/types.d.ts +17 -0
- package/dist/dnd/types.d.ts.map +1 -0
- package/dist/form/createFormValidationState.d.ts +2 -9
- package/{src → dist}/form/createFormValidationState.d.ts.map +1 -1
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/grid/createGridState.d.ts +4 -3
- package/dist/grid/createGridState.d.ts.map +1 -0
- package/dist/grid/index.d.ts +1 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/types.d.ts +23 -1
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2947 -969
- package/dist/index.js.map +1 -1
- package/dist/menu/index.d.ts +3 -1
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/numberfield/createNumberFieldState.d.ts +37 -9
- package/dist/numberfield/createNumberFieldState.d.ts.map +1 -0
- package/dist/numberfield/index.d.ts +1 -0
- package/dist/numberfield/index.d.ts.map +1 -0
- package/dist/overlays/createOverlayTriggerState.d.ts +12 -1
- package/dist/overlays/createOverlayTriggerState.d.ts.map +1 -0
- package/dist/overlays/index.d.ts +1 -0
- package/dist/overlays/index.d.ts.map +1 -0
- package/dist/private/flags/flags.d.ts +5 -0
- package/dist/private/flags/flags.d.ts.map +1 -0
- package/dist/private/flags/flags.js +26 -0
- package/dist/private/flags/flags.js.map +1 -0
- package/dist/radio/createRadioGroupState.d.ts +1 -0
- package/dist/radio/createRadioGroupState.d.ts.map +1 -0
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.d.ts.map +1 -0
- package/dist/searchfield/createSearchFieldState.d.ts +2 -5
- package/dist/searchfield/createSearchFieldState.d.ts.map +1 -0
- package/dist/searchfield/index.d.ts +1 -0
- package/dist/searchfield/index.d.ts.map +1 -0
- package/dist/select/createSelectState.d.ts +100 -33
- package/dist/select/createSelectState.d.ts.map +1 -0
- package/dist/select/index.d.ts +2 -1
- package/dist/select/index.d.ts.map +1 -0
- package/dist/selection/Selection.d.ts +2 -1
- package/dist/selection/Selection.d.ts.map +1 -0
- package/dist/selection/SelectionManager.d.ts +1 -19
- package/dist/selection/SelectionManager.d.ts.map +1 -0
- package/dist/selection/createMultipleSelectionState.d.ts +2 -13
- package/dist/selection/createMultipleSelectionState.d.ts.map +1 -0
- package/dist/selection/index.d.ts +1 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/slider/createSliderState.d.ts +37 -14
- package/dist/slider/createSliderState.d.ts.map +1 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +2 -13
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/steplist/createStepListState.d.ts +10 -18
- package/dist/steplist/createStepListState.d.ts.map +1 -0
- package/dist/steplist/index.d.ts +1 -0
- package/dist/steplist/index.d.ts.map +1 -0
- package/dist/table/TableCollection.d.ts +1 -0
- package/dist/table/TableCollection.d.ts.map +1 -0
- package/dist/table/createTableColumnResizeState.d.ts +2 -9
- package/dist/table/createTableColumnResizeState.d.ts.map +1 -0
- package/dist/table/createTableState.d.ts +3 -6
- package/dist/table/createTableState.d.ts.map +1 -0
- package/dist/table/createTreeGridState.d.ts +3 -9
- package/dist/table/createTreeGridState.d.ts.map +1 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/types.d.ts +37 -3
- package/dist/table/types.d.ts.map +1 -0
- package/dist/tabs/createTabListState.d.ts +2 -5
- package/dist/tabs/createTabListState.d.ts.map +1 -0
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/textfield/createTextFieldState.d.ts +1 -0
- package/dist/textfield/createTextFieldState.d.ts.map +1 -0
- package/dist/textfield/index.d.ts +1 -0
- package/dist/textfield/index.d.ts.map +1 -0
- package/dist/toast/createToastState.d.ts +2 -5
- package/dist/toast/createToastState.d.ts.map +1 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toggle/createToggleGroupState.d.ts +1 -0
- package/dist/toggle/createToggleGroupState.d.ts.map +1 -0
- package/dist/toggle/createToggleState.d.ts +1 -0
- package/dist/toggle/createToggleState.d.ts.map +1 -0
- package/dist/toggle/index.d.ts +1 -0
- package/dist/toggle/index.d.ts.map +1 -0
- package/dist/tokenfield/TokenFieldValue.d.ts +96 -0
- package/dist/tokenfield/TokenFieldValue.d.ts.map +1 -0
- package/dist/tokenfield/createTokenFieldState.d.ts +33 -0
- package/dist/tokenfield/createTokenFieldState.d.ts.map +1 -0
- package/dist/tokenfield/index.d.ts +3 -0
- package/dist/tokenfield/index.d.ts.map +1 -0
- package/dist/tooltip/createTooltipTriggerState.d.ts +9 -8
- package/dist/tooltip/createTooltipTriggerState.d.ts.map +1 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/dist/tree/TreeCollection.d.ts +1 -0
- package/dist/tree/TreeCollection.d.ts.map +1 -0
- package/dist/tree/createTreeState.d.ts +3 -8
- package/dist/tree/createTreeState.d.ts.map +1 -0
- package/dist/tree/index.d.ts +1 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/types.d.ts +19 -1
- package/dist/tree/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/owner.d.ts +9 -0
- package/dist/utils/owner.d.ts.map +1 -0
- package/dist/utils/reactivity.d.ts +24 -0
- package/dist/utils/reactivity.d.ts.map +1 -0
- package/package.json +21 -9
- package/src/autocomplete/createAutocompleteState.ts +18 -4
- package/src/calendar/IncompleteDate.ts +15 -1
- package/src/calendar/createCalendarState.ts +321 -125
- package/src/calendar/createDateFieldState.ts +45 -31
- package/src/calendar/createDatePickerState.ts +47 -26
- package/src/calendar/createRangeCalendarState.ts +173 -86
- package/src/calendar/createTimeFieldState.ts +26 -7
- package/src/calendar/intl/index.ts +37 -2
- package/src/checkbox/createCheckboxGroupState.ts +45 -13
- package/src/collections/ListCollection.ts +31 -0
- package/src/collections/createListState.ts +27 -10
- package/src/collections/createMenuState.ts +190 -15
- package/src/collections/createSelectionState.ts +33 -13
- package/src/collections/getChildNodes.ts +20 -3
- package/src/collections/index.ts +6 -0
- package/src/collections/types.ts +35 -2
- package/src/color/Color.ts +61 -22
- package/src/color/createColorAreaState.ts +48 -4
- package/src/color/createColorFieldState.ts +114 -38
- package/src/color/createColorSliderState.ts +61 -9
- package/src/color/createColorWheelState.ts +29 -9
- package/src/color/getColorChannels.ts +16 -0
- package/src/color/index.ts +1 -0
- package/src/color/intl/index.ts +38 -3
- package/src/color/types.ts +1 -1
- package/src/combobox/createComboBoxState.ts +530 -297
- package/src/combobox/index.ts +4 -0
- package/src/data/createAsyncList.ts +41 -6
- package/src/data/createListData.ts +27 -4
- package/src/data/createTreeData.ts +30 -6
- package/src/disclosure/createDisclosureState.ts +40 -19
- package/src/dnd/createDragState.ts +22 -4
- package/src/dnd/createDraggableCollectionState.ts +145 -11
- package/src/dnd/createDropState.ts +21 -3
- package/src/dnd/createDroppableCollectionState.ts +127 -11
- package/src/dnd/index.ts +4 -0
- package/src/dnd/types.ts +16 -0
- package/src/form/createFormValidationState.ts +69 -37
- package/src/grid/createGridState.ts +196 -111
- package/src/grid/types.ts +22 -1
- package/src/index.ts +33 -2
- package/src/menu/index.ts +7 -0
- package/src/numberfield/createNumberFieldState.ts +247 -98
- package/src/overlays/createOverlayTriggerState.ts +31 -4
- package/src/private/flags/flags.ts +25 -0
- package/src/radio/createRadioGroupState.ts +23 -6
- package/src/searchfield/createSearchFieldState.ts +18 -3
- package/src/select/createSelectState.ts +317 -130
- package/src/select/index.ts +8 -1
- package/src/selection/Selection.ts +15 -1
- package/src/selection/SelectionManager.ts +17 -1
- package/src/selection/createMultipleSelectionState.ts +45 -26
- package/src/slider/createSliderState.ts +243 -104
- package/src/ssr/index.ts +34 -4
- package/src/steplist/createStepListState.ts +184 -130
- package/src/table/TableCollection.ts +14 -0
- package/src/table/createTableColumnResizeState.ts +71 -14
- package/src/table/createTableState.ts +26 -4
- package/src/table/createTreeGridState.ts +22 -6
- package/src/table/types.ts +38 -5
- package/src/tabs/createTabListState.ts +63 -43
- package/src/textfield/createTextFieldState.ts +17 -3
- package/src/toast/createToastState.ts +28 -3
- package/src/toggle/createToggleGroupState.ts +20 -5
- package/src/toggle/createToggleState.ts +19 -4
- package/src/tokenfield/TokenFieldValue.ts +499 -0
- package/src/tokenfield/createTokenFieldState.ts +88 -0
- package/src/tokenfield/index.ts +15 -0
- package/src/tooltip/createTooltipTriggerState.ts +49 -13
- package/src/tree/TreeCollection.ts +14 -0
- package/src/tree/createTreeState.ts +70 -36
- package/src/tree/types.ts +18 -1
- package/src/utils/index.ts +10 -1
- package/src/utils/owner.ts +20 -0
- package/src/utils/reactivity.ts +53 -1
- package/src/autocomplete/createAutocompleteState.d.ts +0 -48
- package/src/autocomplete/createAutocompleteState.d.ts.map +0 -1
- package/src/autocomplete/index.d.ts +0 -6
- package/src/autocomplete/index.d.ts.map +0 -1
- package/src/calendar/createCalendarState.d.ts +0 -152
- package/src/calendar/createCalendarState.d.ts.map +0 -1
- package/src/calendar/createDateFieldState.d.ts +0 -145
- package/src/calendar/createDateFieldState.d.ts.map +0 -1
- package/src/calendar/createRangeCalendarState.d.ts +0 -171
- package/src/calendar/createRangeCalendarState.d.ts.map +0 -1
- package/src/calendar/createTimeFieldState.d.ts +0 -97
- package/src/calendar/createTimeFieldState.d.ts.map +0 -1
- package/src/calendar/index.d.ts +0 -80
- package/src/calendar/index.d.ts.map +0 -1
- package/src/checkbox/createCheckboxGroupState.d.ts +0 -73
- package/src/checkbox/createCheckboxGroupState.d.ts.map +0 -1
- package/src/checkbox/index.d.ts +0 -6
- package/src/checkbox/index.d.ts.map +0 -1
- package/src/collections/ListCollection.d.ts +0 -40
- package/src/collections/ListCollection.d.ts.map +0 -1
- package/src/collections/createListState.d.ts +0 -94
- package/src/collections/createListState.d.ts.map +0 -1
- package/src/collections/createMenuState.d.ts +0 -55
- package/src/collections/createMenuState.d.ts.map +0 -1
- package/src/collections/createSelectionState.d.ts +0 -89
- package/src/collections/createSelectionState.d.ts.map +0 -1
- package/src/collections/index.d.ts +0 -38
- package/src/collections/index.d.ts.map +0 -1
- package/src/collections/types.d.ts +0 -147
- package/src/collections/types.d.ts.map +0 -1
- package/src/color/Color.d.ts +0 -43
- package/src/color/Color.d.ts.map +0 -1
- package/src/color/createColorAreaState.d.ts +0 -78
- package/src/color/createColorAreaState.d.ts.map +0 -1
- package/src/color/createColorFieldState.d.ts +0 -57
- package/src/color/createColorFieldState.d.ts.map +0 -1
- package/src/color/createColorSliderState.d.ts +0 -69
- package/src/color/createColorSliderState.d.ts.map +0 -1
- package/src/color/createColorWheelState.d.ts +0 -53
- package/src/color/createColorWheelState.d.ts.map +0 -1
- package/src/color/index.d.ts +0 -39
- package/src/color/index.d.ts.map +0 -1
- package/src/color/types.d.ts +0 -111
- package/src/color/types.d.ts.map +0 -1
- package/src/combobox/createComboBoxState.d.ts +0 -127
- package/src/combobox/createComboBoxState.d.ts.map +0 -1
- package/src/combobox/index.d.ts +0 -13
- package/src/combobox/index.d.ts.map +0 -1
- package/src/disclosure/createDisclosureState.d.ts +0 -68
- package/src/disclosure/createDisclosureState.d.ts.map +0 -1
- package/src/disclosure/index.d.ts +0 -10
- package/src/disclosure/index.d.ts.map +0 -1
- package/src/dnd/createDragState.d.ts +0 -68
- package/src/dnd/createDragState.d.ts.map +0 -1
- package/src/dnd/createDraggableCollectionState.d.ts +0 -68
- package/src/dnd/createDraggableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDropState.d.ts +0 -80
- package/src/dnd/createDropState.d.ts.map +0 -1
- package/src/dnd/createDroppableCollectionState.d.ts +0 -107
- package/src/dnd/createDroppableCollectionState.d.ts.map +0 -1
- package/src/dnd/index.d.ts +0 -60
- package/src/dnd/index.d.ts.map +0 -1
- package/src/dnd/types.d.ts +0 -277
- package/src/dnd/types.d.ts.map +0 -1
- package/src/form/createFormValidationState.d.ts +0 -102
- package/src/form/index.d.ts +0 -16
- package/src/form/index.d.ts.map +0 -1
- package/src/grid/createGridState.d.ts +0 -15
- package/src/grid/createGridState.d.ts.map +0 -1
- package/src/grid/index.d.ts +0 -7
- package/src/grid/index.d.ts.map +0 -1
- package/src/grid/types.d.ts +0 -163
- package/src/grid/types.d.ts.map +0 -1
- package/src/index.d.ts +0 -311
- package/src/index.d.ts.map +0 -1
- package/src/numberfield/createNumberFieldState.d.ts +0 -67
- package/src/numberfield/createNumberFieldState.d.ts.map +0 -1
- package/src/numberfield/index.d.ts +0 -6
- package/src/numberfield/index.d.ts.map +0 -1
- package/src/overlays/createOverlayTriggerState.d.ts +0 -34
- package/src/overlays/createOverlayTriggerState.d.ts.map +0 -1
- package/src/overlays/index.d.ts +0 -6
- package/src/overlays/index.d.ts.map +0 -1
- package/src/radio/createRadioGroupState.d.ts +0 -79
- package/src/radio/createRadioGroupState.d.ts.map +0 -1
- package/src/radio/index.d.ts +0 -7
- package/src/radio/index.d.ts.map +0 -1
- package/src/searchfield/createSearchFieldState.d.ts +0 -27
- package/src/searchfield/createSearchFieldState.d.ts.map +0 -1
- package/src/searchfield/index.d.ts +0 -3
- package/src/searchfield/index.d.ts.map +0 -1
- package/src/select/createSelectState.d.ts +0 -75
- package/src/select/createSelectState.d.ts.map +0 -1
- package/src/select/index.d.ts +0 -2
- package/src/select/index.d.ts.map +0 -1
- package/src/slider/createSliderState.d.ts +0 -72
- package/src/slider/createSliderState.d.ts.map +0 -1
- package/src/slider/index.d.ts +0 -3
- package/src/slider/index.d.ts.map +0 -1
- package/src/ssr/index.d.ts +0 -28
- package/src/ssr/index.d.ts.map +0 -1
- package/src/table/TableCollection.d.ts +0 -54
- package/src/table/TableCollection.d.ts.map +0 -1
- package/src/table/createTableState.d.ts +0 -15
- package/src/table/createTableState.d.ts.map +0 -1
- package/src/table/index.d.ts +0 -18
- package/src/table/index.d.ts.map +0 -1
- package/src/table/types.d.ts +0 -145
- package/src/table/types.d.ts.map +0 -1
- package/src/tabs/createTabListState.d.ts +0 -70
- package/src/tabs/createTabListState.d.ts.map +0 -1
- package/src/tabs/index.d.ts +0 -8
- package/src/tabs/index.d.ts.map +0 -1
- package/src/textfield/createTextFieldState.d.ts +0 -32
- package/src/textfield/createTextFieldState.d.ts.map +0 -1
- package/src/textfield/index.d.ts +0 -6
- package/src/textfield/index.d.ts.map +0 -1
- package/src/toast/createToastState.d.ts +0 -129
- package/src/toast/createToastState.d.ts.map +0 -1
- package/src/toast/index.d.ts +0 -12
- package/src/toast/index.d.ts.map +0 -1
- package/src/toggle/createToggleState.d.ts +0 -34
- package/src/toggle/createToggleState.d.ts.map +0 -1
- package/src/toggle/index.d.ts +0 -2
- package/src/toggle/index.d.ts.map +0 -1
- package/src/tooltip/createTooltipTriggerState.d.ts +0 -39
- package/src/tooltip/createTooltipTriggerState.d.ts.map +0 -1
- package/src/tooltip/index.d.ts +0 -7
- package/src/tooltip/index.d.ts.map +0 -1
- package/src/tree/TreeCollection.d.ts +0 -43
- package/src/tree/TreeCollection.d.ts.map +0 -1
- package/src/tree/createTreeState.d.ts +0 -17
- package/src/tree/createTreeState.d.ts.map +0 -1
- package/src/tree/index.d.ts +0 -13
- package/src/tree/index.d.ts.map +0 -1
- package/src/tree/types.d.ts +0 -162
- package/src/tree/types.d.ts.map +0 -1
- package/src/utils/index.d.ts +0 -2
- package/src/utils/index.d.ts.map +0 -1
- package/src/utils/reactivity.d.ts +0 -28
- package/src/utils/reactivity.d.ts.map +0 -1
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CalendarState for Solid-Stately
|
|
3
|
-
*
|
|
4
|
-
* Provides state management for calendar components.
|
|
5
|
-
* Based on @react-stately/calendar useCalendarState
|
|
6
|
-
*/
|
|
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";
|
|
19
|
-
export interface CalendarStateProps<T extends DateValue = DateValue> {
|
|
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;
|
|
64
|
-
}
|
|
65
|
-
export interface CalendarState<T extends DateValue = DateValue> {
|
|
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>;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Provides state management for a calendar component.
|
|
148
|
-
*/
|
|
149
|
-
export declare function createCalendarState<T extends DateValue = CalendarDate>(
|
|
150
|
-
props?: CalendarStateProps<T>,
|
|
151
|
-
): CalendarState<T>;
|
|
152
|
-
//# sourceMappingURL=createCalendarState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createCalendarState.d.ts","sourceRoot":"","sources":["createCalendarState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAYf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMtD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACjE,sCAAsC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAChC,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAChD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAChD,wCAAwC;IACxC,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpC,yCAAyC;IACzC,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpC,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IACpD,+CAA+C;IAC/C,mBAAmB,CAAC,EAAE,S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9B,+BAA+B;IAC/B,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,sDAAsD;IACtD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7B,iDAAiD;IACjD,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,sDAAsD;IACtD,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,YAAY,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9F,2CAA2C;IAC3C,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IACjD,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7B,6DAA6D;IAC7D,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,oCAAoC;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACjC;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,GAAG,YAAY,EACpE,KAAK,GAAE,kBAAkB,CAAC,CAAC,CAAM,GAChC,aAAa,CAAC,CAAC,CAAC,CAsSlB"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DateFieldState for Solid-Stately
|
|
3
|
-
*
|
|
4
|
-
* Provides state management for date field components with segment-based editing.
|
|
5
|
-
* Based on @react-stately/datepicker useDateFieldState
|
|
6
|
-
*/
|
|
7
|
-
import { type Accessor } from "solid-js";
|
|
8
|
-
import { type CalendarDate, type DateValue } from "@internationalized/date";
|
|
9
|
-
import { type MaybeAccessor } from "../utils";
|
|
10
|
-
import type { ValidationState } from "./createCalendarState";
|
|
11
|
-
import { type ValidationBehavior, type ValidationFunction, type ValidationResult } from "../form";
|
|
12
|
-
export type DateSegmentType =
|
|
13
|
-
| "year"
|
|
14
|
-
| "month"
|
|
15
|
-
| "day"
|
|
16
|
-
| "hour"
|
|
17
|
-
| "minute"
|
|
18
|
-
| "second"
|
|
19
|
-
| "dayPeriod"
|
|
20
|
-
| "era"
|
|
21
|
-
| "timeZoneName"
|
|
22
|
-
| "literal";
|
|
23
|
-
export interface DateSegment {
|
|
24
|
-
/** The type of segment. */
|
|
25
|
-
type: DateSegmentType;
|
|
26
|
-
/** The text content of the segment. */
|
|
27
|
-
text: string;
|
|
28
|
-
/** The numeric value of the segment (if applicable). */
|
|
29
|
-
value?: number;
|
|
30
|
-
/** The minimum value for the segment. */
|
|
31
|
-
minValue?: number;
|
|
32
|
-
/** The maximum value for the segment. */
|
|
33
|
-
maxValue?: number;
|
|
34
|
-
/** Whether this segment is editable. */
|
|
35
|
-
isEditable: boolean;
|
|
36
|
-
/** Whether this segment is a placeholder. */
|
|
37
|
-
isPlaceholder: boolean;
|
|
38
|
-
/** A placeholder string for the segment. */
|
|
39
|
-
placeholder: string;
|
|
40
|
-
}
|
|
41
|
-
export interface DateFieldStateProps<T extends DateValue = DateValue> {
|
|
42
|
-
/** The current value (controlled). */
|
|
43
|
-
value?: MaybeAccessor<T | null>;
|
|
44
|
-
/** The default value (uncontrolled). */
|
|
45
|
-
defaultValue?: T | null;
|
|
46
|
-
/** Handler called when the value changes. */
|
|
47
|
-
onChange?: (value: T | null) => void;
|
|
48
|
-
/** The minimum allowed date. */
|
|
49
|
-
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
50
|
-
/** The maximum allowed date. */
|
|
51
|
-
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
52
|
-
/** Whether the field is disabled. */
|
|
53
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
54
|
-
/** Whether the field is read-only. */
|
|
55
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
56
|
-
/** Whether the field is required. */
|
|
57
|
-
isRequired?: MaybeAccessor<boolean>;
|
|
58
|
-
/** Whether the value is invalid (controlled). */
|
|
59
|
-
isInvalid?: boolean;
|
|
60
|
-
/** The locale to use for formatting. */
|
|
61
|
-
locale?: string;
|
|
62
|
-
/** The granularity of the date/time (day, hour, minute, second). */
|
|
63
|
-
granularity?: "day" | "hour" | "minute" | "second";
|
|
64
|
-
/** Whether to show the hour in 12 or 24 hour format. */
|
|
65
|
-
hourCycle?: 12 | 24;
|
|
66
|
-
/** Whether to hide the time zone. */
|
|
67
|
-
hideTimeZone?: boolean;
|
|
68
|
-
/** The placeholder date (determines segment structure). */
|
|
69
|
-
placeholderValue?: DateValue;
|
|
70
|
-
/** Whether to force leading zeroes in month/day segments. */
|
|
71
|
-
shouldForceLeadingZeros?: boolean;
|
|
72
|
-
/** Validation state. */
|
|
73
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
74
|
-
/** Validation behavior mode. */
|
|
75
|
-
validationBehavior?: ValidationBehavior;
|
|
76
|
-
/** Custom validation function. */
|
|
77
|
-
validate?: ValidationFunction<T>;
|
|
78
|
-
/** Description text. */
|
|
79
|
-
description?: string;
|
|
80
|
-
/** Error message. */
|
|
81
|
-
errorMessage?: string;
|
|
82
|
-
/** Whether dates outside the min/max range are allowed. */
|
|
83
|
-
allowsNonContiguousRanges?: boolean;
|
|
84
|
-
/** Whether to create a date or datetime. */
|
|
85
|
-
createCalendar?: (name: string) => unknown;
|
|
86
|
-
/** Whether a date is unavailable. */
|
|
87
|
-
isDateUnavailable?: (date: DateValue) => boolean;
|
|
88
|
-
}
|
|
89
|
-
export interface DateFieldState<T extends DateValue = DateValue> {
|
|
90
|
-
/** The current value. */
|
|
91
|
-
value: Accessor<T | null>;
|
|
92
|
-
/** The date value (may be partial during editing). */
|
|
93
|
-
dateValue: Accessor<DateValue | null>;
|
|
94
|
-
/** Sets the date value. */
|
|
95
|
-
setValue: (value: T | null) => void;
|
|
96
|
-
/** The segments that make up the date. */
|
|
97
|
-
segments: Accessor<DateSegment[]>;
|
|
98
|
-
/** The format string. */
|
|
99
|
-
formatValue: (fieldOptions?: Intl.DateTimeFormatOptions) => string;
|
|
100
|
-
/** Sets a segment value. */
|
|
101
|
-
setSegment: (type: DateSegmentType, value: number) => void;
|
|
102
|
-
/** Increments a segment. */
|
|
103
|
-
incrementSegment: (type: DateSegmentType) => void;
|
|
104
|
-
/** Decrements a segment. */
|
|
105
|
-
decrementSegment: (type: DateSegmentType) => void;
|
|
106
|
-
/** Clears a segment. */
|
|
107
|
-
clearSegment: (type: DateSegmentType) => void;
|
|
108
|
-
/** Confirms the value (after typing). */
|
|
109
|
-
confirmPlaceholder: () => void;
|
|
110
|
-
/** Whether the field is disabled. */
|
|
111
|
-
isDisabled: Accessor<boolean>;
|
|
112
|
-
/** Whether the field is read-only. */
|
|
113
|
-
isReadOnly: Accessor<boolean>;
|
|
114
|
-
/** Whether the field is required. */
|
|
115
|
-
isRequired: Accessor<boolean>;
|
|
116
|
-
/** The validation state. */
|
|
117
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
118
|
-
/** The granularity. */
|
|
119
|
-
granularity: "day" | "hour" | "minute" | "second";
|
|
120
|
-
/** Whether the value is invalid. */
|
|
121
|
-
isInvalid: Accessor<boolean>;
|
|
122
|
-
/** Realtime validation results, including native and custom constraints. */
|
|
123
|
-
realtimeValidation: Accessor<ValidationResult>;
|
|
124
|
-
/** Currently displayed validation results. */
|
|
125
|
-
displayValidation: Accessor<ValidationResult>;
|
|
126
|
-
/** Updates the current validation result. */
|
|
127
|
-
updateValidation: (result: ValidationResult) => void;
|
|
128
|
-
/** Resets displayed validation to valid. */
|
|
129
|
-
resetValidation: () => void;
|
|
130
|
-
/** Commits realtime validation to displayed validation. */
|
|
131
|
-
commitValidation: () => void;
|
|
132
|
-
/** The locale. */
|
|
133
|
-
locale: string;
|
|
134
|
-
/** The time zone. */
|
|
135
|
-
timeZone: string;
|
|
136
|
-
/** The default value. */
|
|
137
|
-
defaultValue: T | null;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Provides state management for a date field component.
|
|
141
|
-
*/
|
|
142
|
-
export declare function createDateFieldState<T extends DateValue = CalendarDate>(
|
|
143
|
-
props?: DateFieldStateProps<T>,
|
|
144
|
-
): DateFieldState<T>;
|
|
145
|
-
//# sourceMappingURL=createDateFieldState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDateFieldState.d.ts","sourceRoot":"","sources":["createDateFieldState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,SAAS,EAMf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,KAAK,GACL,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,aAAa,EAAE,OAAO,CAAC;IACvB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAClE,sCAAsC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,GAAG,IAA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B;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,GAAG,YAAY,EACrE,KAAK,GAAE,mBAAmB,CAAC,CAAC,CAAM,GACjC,cAAc,CAAC,CAAC,CAAC,CAkRnB"}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RangeCalendarState for Solid-Stately
|
|
3
|
-
*
|
|
4
|
-
* Provides state management for range calendar components.
|
|
5
|
-
* Based on @react-stately/calendar useRangeCalendarState
|
|
6
|
-
*/
|
|
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
|
-
import type { CalendarDayOfWeek, ValidationState } from "./createCalendarState";
|
|
16
|
-
type RangeCalendarSelectionAlignment = "start" | "center" | "end";
|
|
17
|
-
type RangeCalendarPageBehavior = "single" | "visible";
|
|
18
|
-
export interface DateRange {
|
|
19
|
-
start: CalendarDate;
|
|
20
|
-
end: CalendarDate;
|
|
21
|
-
}
|
|
22
|
-
export interface RangeValue<T> {
|
|
23
|
-
start: T;
|
|
24
|
-
end: T;
|
|
25
|
-
}
|
|
26
|
-
export interface RangeCalendarStateProps<T extends DateValue = DateValue> {
|
|
27
|
-
/** The current value (controlled). */
|
|
28
|
-
value?: MaybeAccessor<RangeValue<T> | null>;
|
|
29
|
-
/** The default value (uncontrolled). */
|
|
30
|
-
defaultValue?: RangeValue<T> | null;
|
|
31
|
-
/** Handler called when the value changes. */
|
|
32
|
-
onChange?: (value: RangeValue<T> | null) => void;
|
|
33
|
-
/** The minimum allowed date. */
|
|
34
|
-
minValue?: MaybeAccessor<DateValue | undefined>;
|
|
35
|
-
/** The maximum allowed date. */
|
|
36
|
-
maxValue?: MaybeAccessor<DateValue | undefined>;
|
|
37
|
-
/** Whether the calendar is disabled. */
|
|
38
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
39
|
-
/** Whether the calendar is read-only. */
|
|
40
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
41
|
-
/** The date that is focused when the calendar first mounts. */
|
|
42
|
-
focusedValue?: MaybeAccessor<DateValue | null | undefined>;
|
|
43
|
-
/** The default focused date (uncontrolled). */
|
|
44
|
-
defaultFocusedValue?: DateValue;
|
|
45
|
-
/** Handler called when the focused date changes. */
|
|
46
|
-
onFocusChange?: (date: CalendarDate) => void;
|
|
47
|
-
/** The locale to use for formatting. */
|
|
48
|
-
locale?: MaybeAccessor<string | undefined>;
|
|
49
|
-
/** Creates a calendar object for a locale calendar identifier. */
|
|
50
|
-
createCalendar?: (identifier: CalendarIdentifier) => InternationalizedCalendar;
|
|
51
|
-
/** Callback to determine if a date is unavailable. */
|
|
52
|
-
isDateUnavailable?: (date: DateValue) => boolean;
|
|
53
|
-
/** The number of months to display at once. */
|
|
54
|
-
visibleMonths?: MaybeAccessor<number | undefined>;
|
|
55
|
-
/** Controls how the initial visible months are aligned around the current value. */
|
|
56
|
-
selectionAlignment?: MaybeAccessor<RangeCalendarSelectionAlignment | undefined>;
|
|
57
|
-
/** Controls whether pagination moves by one month or the visible month count. */
|
|
58
|
-
pageBehavior?: MaybeAccessor<RangeCalendarPageBehavior | undefined>;
|
|
59
|
-
/** Controls which days are disabled. */
|
|
60
|
-
isDateDisabled?: (date: DateValue) => boolean;
|
|
61
|
-
/** Validation state. */
|
|
62
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
63
|
-
/** Whether to allow selecting the same date for start and end. */
|
|
64
|
-
allowsNonContiguousRanges?: boolean;
|
|
65
|
-
/** The first day of the week (0 = Sunday, 1 = Monday, etc.). */
|
|
66
|
-
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
67
|
-
}
|
|
68
|
-
export interface RangeCalendarState<T extends DateValue = DateValue> {
|
|
69
|
-
/** The currently selected date range. */
|
|
70
|
-
value: Accessor<RangeValue<T> | null>;
|
|
71
|
-
/** Sets the selected date range. */
|
|
72
|
-
setValue: (value: RangeValue<T> | null) => void;
|
|
73
|
-
/** The currently focused date. */
|
|
74
|
-
focusedDate: Accessor<CalendarDate>;
|
|
75
|
-
/** Sets the focused date. */
|
|
76
|
-
setFocusedDate: (date: CalendarDate) => void;
|
|
77
|
-
/** The anchor date when selecting a range (first click). */
|
|
78
|
-
anchorDate: Accessor<CalendarDate | null>;
|
|
79
|
-
/** Sets the anchor date. */
|
|
80
|
-
setAnchorDate: (date: CalendarDate | null) => void;
|
|
81
|
-
/** The highlighted range during selection. */
|
|
82
|
-
highlightedRange: Accessor<RangeValue<CalendarDate> | null>;
|
|
83
|
-
/** Whether the calendar is disabled. */
|
|
84
|
-
isDisabled: Accessor<boolean>;
|
|
85
|
-
/** Whether the calendar is read-only. */
|
|
86
|
-
isReadOnly: Accessor<boolean>;
|
|
87
|
-
/** The visible date range (first and last day of visible month(s)). */
|
|
88
|
-
visibleRange: Accessor<{
|
|
89
|
-
start: CalendarDate;
|
|
90
|
-
end: CalendarDate;
|
|
91
|
-
}>;
|
|
92
|
-
/** The timezone used for date calculations. */
|
|
93
|
-
timeZone: string;
|
|
94
|
-
/** The locale used for formatting and locale-specific week starts. */
|
|
95
|
-
locale: Accessor<string>;
|
|
96
|
-
/** The explicitly requested first weekday, or undefined for the locale default. */
|
|
97
|
-
firstDayOfWeek: Accessor<CalendarDayOfWeek | undefined>;
|
|
98
|
-
/** The validation state. */
|
|
99
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
100
|
-
/** Whether the current value is invalid according to validation state. */
|
|
101
|
-
isValueInvalid: Accessor<boolean>;
|
|
102
|
-
/** Whether a date is within the selected range. */
|
|
103
|
-
isSelected: (date: DateValue) => boolean;
|
|
104
|
-
/** Whether a date is the start of the selection. */
|
|
105
|
-
isSelectionStart: (date: DateValue) => boolean;
|
|
106
|
-
/** Whether a date is the end of the selection. */
|
|
107
|
-
isSelectionEnd: (date: DateValue) => boolean;
|
|
108
|
-
/** Whether a date is focused. */
|
|
109
|
-
isCellFocused: (date: DateValue) => boolean;
|
|
110
|
-
/** Whether a date is unavailable. */
|
|
111
|
-
isCellUnavailable: (date: DateValue) => boolean;
|
|
112
|
-
/** Whether a date is disabled. */
|
|
113
|
-
isCellDisabled: (date: DateValue) => boolean;
|
|
114
|
-
/** Whether a date is outside the visible range. */
|
|
115
|
-
isOutsideVisibleRange: (date: DateValue) => boolean;
|
|
116
|
-
/** Whether a date is invalid. */
|
|
117
|
-
isInvalid: (date: DateValue) => boolean;
|
|
118
|
-
/** Moves focus to the previous page (month). */
|
|
119
|
-
focusPreviousPage: () => void;
|
|
120
|
-
/** Moves focus to the next page (month). */
|
|
121
|
-
focusNextPage: () => void;
|
|
122
|
-
/** Moves focus to the previous section (year). */
|
|
123
|
-
focusPreviousSection: () => void;
|
|
124
|
-
/** Moves focus to the next section (year). */
|
|
125
|
-
focusNextSection: () => void;
|
|
126
|
-
/** Whether the previous visible range would be outside the allowed date range. */
|
|
127
|
-
isPreviousVisibleRangeInvalid: () => boolean;
|
|
128
|
-
/** Whether the next visible range would be outside the allowed date range. */
|
|
129
|
-
isNextVisibleRangeInvalid: () => boolean;
|
|
130
|
-
/** Moves focus to the previous day. */
|
|
131
|
-
focusPreviousDay: () => void;
|
|
132
|
-
/** Moves focus to the next day. */
|
|
133
|
-
focusNextDay: () => void;
|
|
134
|
-
/** Moves focus to the previous week. */
|
|
135
|
-
focusPreviousWeek: () => void;
|
|
136
|
-
/** Moves focus to the next week. */
|
|
137
|
-
focusNextWeek: () => void;
|
|
138
|
-
/** Moves focus to the start of the month. */
|
|
139
|
-
focusPageStart: () => void;
|
|
140
|
-
/** Moves focus to the end of the month. */
|
|
141
|
-
focusPageEnd: () => void;
|
|
142
|
-
/** Selects the focused date. */
|
|
143
|
-
selectFocusedDate: () => void;
|
|
144
|
-
/** Selects a specific date. */
|
|
145
|
-
selectDate: (date: CalendarDate) => void;
|
|
146
|
-
/** Whether focus is currently within the calendar. */
|
|
147
|
-
isFocused: Accessor<boolean>;
|
|
148
|
-
/** Sets whether focus is within the calendar. */
|
|
149
|
-
setFocused: (focused: boolean) => void;
|
|
150
|
-
/** Gets the dates for a week in the visible range. */
|
|
151
|
-
getDatesInWeek: (weekIndex: number, monthStartDate?: CalendarDate) => (CalendarDate | null)[];
|
|
152
|
-
/** Gets the number of weeks in a month. */
|
|
153
|
-
getWeeksInMonth: (date?: CalendarDate) => number;
|
|
154
|
-
/** The week day headers. */
|
|
155
|
-
weekDays: Accessor<string[]>;
|
|
156
|
-
/** The title for the calendar (formatted month and year). */
|
|
157
|
-
title: Accessor<string>;
|
|
158
|
-
/** The number of visible months. */
|
|
159
|
-
visibleMonths: number;
|
|
160
|
-
/** Whether the user is currently selecting a range. */
|
|
161
|
-
isDragging: Accessor<boolean>;
|
|
162
|
-
/** Sets whether the user is dragging to select. */
|
|
163
|
-
setDragging: (dragging: boolean) => void;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Provides state management for a range calendar component.
|
|
167
|
-
*/
|
|
168
|
-
export declare function createRangeCalendarState<T extends DateValue = CalendarDate>(
|
|
169
|
-
props?: RangeCalendarStateProps<T>,
|
|
170
|
-
): RangeCalendarState<T>;
|
|
171
|
-
//# sourceMappingURL=createRangeCalendarState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createRangeCalendarState.d.ts","sourceRoot":"","sources":["createRangeCalendarState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAYf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EA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
*
|
|
4
|
-
* Provides state management for time field components with segment-based editing.
|
|
5
|
-
* Based on @react-stately/datepicker useTimeFieldState
|
|
6
|
-
*/
|
|
7
|
-
import { type Accessor } from "solid-js";
|
|
8
|
-
import { type Time, type CalendarDateTime, type ZonedDateTime } from "@internationalized/date";
|
|
9
|
-
import { type MaybeAccessor } from "../utils";
|
|
10
|
-
import type { ValidationState } from "./createCalendarState";
|
|
11
|
-
export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
|
12
|
-
export type TimeSegmentType = "hour" | "minute" | "second" | "dayPeriod" | "literal";
|
|
13
|
-
export interface TimeSegment {
|
|
14
|
-
/** The type of segment. */
|
|
15
|
-
type: TimeSegmentType;
|
|
16
|
-
/** The text content of the segment. */
|
|
17
|
-
text: string;
|
|
18
|
-
/** The numeric value of the segment (if applicable). */
|
|
19
|
-
value?: number;
|
|
20
|
-
/** The minimum value for the segment. */
|
|
21
|
-
minValue?: number;
|
|
22
|
-
/** The maximum value for the segment. */
|
|
23
|
-
maxValue?: number;
|
|
24
|
-
/** Whether this segment is editable. */
|
|
25
|
-
isEditable: boolean;
|
|
26
|
-
/** Whether this segment is a placeholder. */
|
|
27
|
-
isPlaceholder: boolean;
|
|
28
|
-
/** A placeholder string for the segment. */
|
|
29
|
-
placeholder: string;
|
|
30
|
-
}
|
|
31
|
-
export interface TimeFieldStateProps<T extends TimeValue = Time> {
|
|
32
|
-
/** The current value (controlled). */
|
|
33
|
-
value?: MaybeAccessor<T | null>;
|
|
34
|
-
/** The default value (uncontrolled). */
|
|
35
|
-
defaultValue?: T | null;
|
|
36
|
-
/** Handler called when the value changes. */
|
|
37
|
-
onChange?: (value: T | null) => void;
|
|
38
|
-
/** The minimum allowed time. */
|
|
39
|
-
minValue?: MaybeAccessor<TimeValue | undefined>;
|
|
40
|
-
/** The maximum allowed time. */
|
|
41
|
-
maxValue?: MaybeAccessor<TimeValue | undefined>;
|
|
42
|
-
/** Whether the field is disabled. */
|
|
43
|
-
isDisabled?: MaybeAccessor<boolean>;
|
|
44
|
-
/** Whether the field is read-only. */
|
|
45
|
-
isReadOnly?: MaybeAccessor<boolean>;
|
|
46
|
-
/** Whether the field is required. */
|
|
47
|
-
isRequired?: MaybeAccessor<boolean>;
|
|
48
|
-
/** The locale to use for formatting. */
|
|
49
|
-
locale?: string;
|
|
50
|
-
/** The granularity (hour, minute, second). */
|
|
51
|
-
granularity?: "hour" | "minute" | "second";
|
|
52
|
-
/** Whether to show 12 or 24 hour format. */
|
|
53
|
-
hourCycle?: 12 | 24;
|
|
54
|
-
/** Validation state. */
|
|
55
|
-
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
56
|
-
/** The placeholder value. */
|
|
57
|
-
placeholderValue?: T;
|
|
58
|
-
}
|
|
59
|
-
export interface TimeFieldState<T extends TimeValue = Time> {
|
|
60
|
-
/** The current value. */
|
|
61
|
-
value: Accessor<T | null>;
|
|
62
|
-
/** Sets the value. */
|
|
63
|
-
setValue: (value: T | null) => void;
|
|
64
|
-
/** The segments that make up the time. */
|
|
65
|
-
segments: Accessor<TimeSegment[]>;
|
|
66
|
-
/** Sets a segment value. */
|
|
67
|
-
setSegment: (type: TimeSegmentType, value: number) => void;
|
|
68
|
-
/** Increments a segment. */
|
|
69
|
-
incrementSegment: (type: TimeSegmentType) => void;
|
|
70
|
-
/** Decrements a segment. */
|
|
71
|
-
decrementSegment: (type: TimeSegmentType) => void;
|
|
72
|
-
/** Clears a segment. */
|
|
73
|
-
clearSegment: (type: TimeSegmentType) => void;
|
|
74
|
-
/** Whether the field is disabled. */
|
|
75
|
-
isDisabled: Accessor<boolean>;
|
|
76
|
-
/** Whether the field is read-only. */
|
|
77
|
-
isReadOnly: Accessor<boolean>;
|
|
78
|
-
/** Whether the field is required. */
|
|
79
|
-
isRequired: Accessor<boolean>;
|
|
80
|
-
/** The validation state. */
|
|
81
|
-
validationState: Accessor<ValidationState | undefined>;
|
|
82
|
-
/** The granularity. */
|
|
83
|
-
granularity: "hour" | "minute" | "second";
|
|
84
|
-
/** Whether the value is invalid. */
|
|
85
|
-
isInvalid: Accessor<boolean>;
|
|
86
|
-
/** The locale. */
|
|
87
|
-
locale: string;
|
|
88
|
-
/** The hour cycle. */
|
|
89
|
-
hourCycle: 12 | 24;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Provides state management for a time field component.
|
|
93
|
-
*/
|
|
94
|
-
export declare function createTimeFieldState<T extends TimeValue = Time>(
|
|
95
|
-
props?: TimeFieldStateProps<T>,
|
|
96
|
-
): TimeFieldState<T>;
|
|
97
|
-
//# sourceMappingURL=createTimeFieldState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTimeFieldState.d.ts","sourceRoot":"","sources":["createTimeFieldState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEhE,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,UAAU,EAAE,OAAO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