@proyecto-viviana/solid-stately 0.5.1 → 0.6.0-rc.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/LICENSE-APACHE-2.0 +201 -0
- package/NOTICE +91 -0
- 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 +7 -8
- 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 +2 -7
- package/dist/calendar/createDatePickerState.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendarState.d.ts +7 -7
- package/dist/calendar/createRangeCalendarState.d.ts.map +1 -0
- package/dist/calendar/createTimeFieldState.d.ts +4 -23
- 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 +1 -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 +30 -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 +2 -5
- package/dist/color/createColorAreaState.d.ts.map +1 -0
- package/dist/color/createColorFieldState.d.ts +2 -5
- package/dist/color/createColorFieldState.d.ts.map +1 -0
- package/dist/color/createColorSliderState.d.ts +2 -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 +4 -8
- package/dist/combobox/createComboBoxState.d.ts.map +1 -0
- package/dist/combobox/index.d.ts +1 -0
- 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 +39 -10
- 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 +28 -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/flags/flags.d.ts +5 -0
- package/dist/flags/flags.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 +3 -2
- 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 +4 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2030 -593
- package/dist/index.js.map +1 -1
- package/dist/menu/index.d.ts +2 -1
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/numberfield/createNumberFieldState.d.ts +31 -6
- 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.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 +17 -6
- package/dist/select/createSelectState.d.ts.map +1 -0
- package/dist/select/index.d.ts +1 -0
- 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 +2 -5
- 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 -7
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/steplist/createStepListState.d.ts +2 -5
- 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 +2 -5
- package/dist/table/createTableState.d.ts.map +1 -0
- package/dist/table/createTreeGridState.d.ts +2 -8
- 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 +35 -1
- 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 +72 -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 +2 -7
- package/{src → dist}/tree/createTreeState.d.ts.map +1 -1
- 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 +19 -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 +194 -79
- package/src/calendar/createDateFieldState.ts +45 -31
- package/src/calendar/createDatePickerState.ts +32 -14
- package/src/calendar/createRangeCalendarState.ts +134 -73
- package/src/calendar/createTimeFieldState.ts +25 -6
- package/src/calendar/intl/index.ts +37 -2
- package/src/checkbox/createCheckboxGroupState.ts +29 -13
- package/src/collections/ListCollection.ts +31 -0
- package/src/collections/createListState.ts +23 -6
- package/src/collections/createMenuState.ts +59 -14
- package/src/collections/createSelectionState.ts +32 -12
- package/src/collections/getChildNodes.ts +20 -3
- package/src/collections/index.ts +2 -0
- package/src/collections/types.ts +35 -2
- package/src/color/Color.ts +61 -22
- package/src/color/createColorAreaState.ts +29 -4
- package/src/color/createColorFieldState.ts +37 -11
- package/src/color/createColorSliderState.ts +36 -7
- package/src/color/createColorWheelState.ts +20 -4
- 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 +178 -195
- package/src/data/createAsyncList.ts +22 -2
- package/src/data/createListData.ts +19 -2
- package/src/data/createTreeData.ts +19 -3
- package/src/disclosure/createDisclosureState.ts +40 -19
- package/src/dnd/createDragState.ts +22 -4
- package/src/dnd/createDraggableCollectionState.ts +137 -10
- package/src/dnd/createDropState.ts +21 -3
- package/src/dnd/createDroppableCollectionState.ts +117 -11
- package/src/dnd/index.ts +4 -0
- package/src/dnd/types.ts +16 -0
- package/src/flags/flags.ts +25 -0
- package/src/form/createFormValidationState.ts +54 -36
- package/src/grid/createGridState.ts +187 -109
- package/src/grid/types.ts +22 -1
- package/src/index.ts +15 -0
- package/src/menu/index.ts +2 -0
- package/src/numberfield/createNumberFieldState.ts +153 -66
- package/src/overlays/createOverlayTriggerState.ts +31 -4
- package/src/radio/createRadioGroupState.ts +19 -5
- package/src/searchfield/createSearchFieldState.ts +18 -3
- package/src/select/createSelectState.ts +73 -8
- package/src/selection/Selection.ts +15 -1
- package/src/selection/SelectionManager.ts +14 -0
- package/src/selection/createMultipleSelectionState.ts +44 -25
- package/src/slider/createSliderState.ts +20 -5
- package/src/ssr/index.ts +27 -4
- package/src/steplist/createStepListState.ts +38 -17
- package/src/table/TableCollection.ts +14 -0
- package/src/table/createTableColumnResizeState.ts +20 -3
- package/src/table/createTableState.ts +22 -1
- package/src/table/createTreeGridState.ts +21 -4
- package/src/table/types.ts +36 -3
- package/src/tabs/createTabListState.ts +77 -34
- 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 +440 -0
- package/src/tokenfield/createTokenFieldState.ts +88 -0
- package/src/tokenfield/index.ts +14 -0
- package/src/tooltip/createTooltipTriggerState.ts +49 -13
- package/src/tree/TreeCollection.ts +14 -0
- package/src/tree/createTreeState.ts +62 -35
- package/src/tree/types.ts +18 -1
- package/src/utils/index.ts +9 -1
- package/src/utils/owner.ts +20 -0
- package/src/utils/reactivity.ts +45 -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/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,15 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/select/useSelectState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* State management for select components.
|
|
3
17
|
* Based on @react-stately/select useSelectState.
|
|
4
18
|
*/
|
|
5
19
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
20
|
+
import { createMemo } from "solid-js";
|
|
21
|
+
import type { Accessor } from "solid-js";
|
|
22
|
+
import { createInternalSignal, access, type MaybeAccessor } from "../utils";
|
|
8
23
|
import { createListState } from "../collections/createListState";
|
|
9
24
|
import { createOverlayTriggerState } from "../overlays";
|
|
10
25
|
import type { Key, CollectionNode, Collection } from "../collections/types";
|
|
11
26
|
import type { SelectionMode, Selection } from "../collections/types";
|
|
12
27
|
import type { SelectionManager } from "../selection/SelectionManager";
|
|
28
|
+
import {
|
|
29
|
+
createFormValidationState,
|
|
30
|
+
type FormValidationState,
|
|
31
|
+
type ValidationFunction,
|
|
32
|
+
} from "../form";
|
|
13
33
|
|
|
14
34
|
export interface SelectStateProps<T = unknown> {
|
|
15
35
|
/** The items to display in the select. */
|
|
@@ -46,9 +66,22 @@ export interface SelectStateProps<T = unknown> {
|
|
|
46
66
|
isDisabled?: boolean;
|
|
47
67
|
/** Whether the select is required. */
|
|
48
68
|
isRequired?: boolean;
|
|
69
|
+
/** Whether the select is invalid (controlled). */
|
|
70
|
+
isInvalid?: boolean;
|
|
71
|
+
/** @deprecated Use isInvalid instead. */
|
|
72
|
+
validationState?: "valid" | "invalid";
|
|
73
|
+
/** Custom validation function. */
|
|
74
|
+
validate?: ValidationFunction<Key | null | Selection>;
|
|
75
|
+
/**
|
|
76
|
+
* Whether to use native HTML form validation or ARIA validation semantics.
|
|
77
|
+
* @default "native"
|
|
78
|
+
*/
|
|
79
|
+
validationBehavior?: "aria" | "native";
|
|
80
|
+
/** Field name(s) for server error lookup. */
|
|
81
|
+
name?: string | string[];
|
|
49
82
|
}
|
|
50
83
|
|
|
51
|
-
export interface SelectState<T = unknown> {
|
|
84
|
+
export interface SelectState<T = unknown> extends FormValidationState {
|
|
52
85
|
/** The collection of items. */
|
|
53
86
|
readonly collection: Accessor<Collection<T>>;
|
|
54
87
|
/**
|
|
@@ -120,10 +153,10 @@ export function createSelectState<T = unknown>(
|
|
|
120
153
|
// Track selected key
|
|
121
154
|
const isControlledSingle = () => getProps().selectedKey !== undefined;
|
|
122
155
|
const isControlledMultiple = () => getProps().selectedKeys !== undefined;
|
|
123
|
-
const [internalSelectedKey, setInternalSelectedKey] =
|
|
156
|
+
const [internalSelectedKey, setInternalSelectedKey] = createInternalSignal<Key | null>(
|
|
124
157
|
getProps().defaultSelectedKey ?? null,
|
|
125
158
|
);
|
|
126
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
159
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = createInternalSignal<Selection>(
|
|
127
160
|
getProps().defaultSelectedKeys === "all"
|
|
128
161
|
? "all"
|
|
129
162
|
: new Set(getProps().defaultSelectedKeys ?? []),
|
|
@@ -193,6 +226,27 @@ export function createSelectState<T = unknown>(
|
|
|
193
226
|
setSelectedKey(key);
|
|
194
227
|
};
|
|
195
228
|
|
|
229
|
+
const validation = createFormValidationState({
|
|
230
|
+
get value() {
|
|
231
|
+
return selectionMode() === "multiple" ? selectedKeys() : selectedKey();
|
|
232
|
+
},
|
|
233
|
+
get isInvalid() {
|
|
234
|
+
return getProps().isInvalid;
|
|
235
|
+
},
|
|
236
|
+
get validationState() {
|
|
237
|
+
return getProps().validationState;
|
|
238
|
+
},
|
|
239
|
+
get validate() {
|
|
240
|
+
return getProps().validate;
|
|
241
|
+
},
|
|
242
|
+
get name() {
|
|
243
|
+
return getProps().name;
|
|
244
|
+
},
|
|
245
|
+
get validationBehavior() {
|
|
246
|
+
return getProps().validationBehavior ?? "native";
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
|
|
196
250
|
// Create list state with select selection mode
|
|
197
251
|
const listState = createListState<T>({
|
|
198
252
|
get items() {
|
|
@@ -213,7 +267,12 @@ export function createSelectState<T = unknown>(
|
|
|
213
267
|
get selectionMode() {
|
|
214
268
|
return selectionMode();
|
|
215
269
|
},
|
|
216
|
-
|
|
270
|
+
// Upstream only requires a value in single-selection mode. Multiple
|
|
271
|
+
// selection must permit toggling the last selected option off.
|
|
272
|
+
get disallowEmptySelection() {
|
|
273
|
+
return selectionMode() === "single";
|
|
274
|
+
},
|
|
275
|
+
allowDuplicateSelectionEvents: true,
|
|
217
276
|
get selectedKeys() {
|
|
218
277
|
const keys = selectedKeys();
|
|
219
278
|
if (keys === "all") return "all";
|
|
@@ -228,6 +287,7 @@ export function createSelectState<T = unknown>(
|
|
|
228
287
|
if (keys !== "all") {
|
|
229
288
|
getProps().onSelectionChange?.(keys.size > 0 ? Array.from(keys)[0] : null);
|
|
230
289
|
}
|
|
290
|
+
validation.commitValidation();
|
|
231
291
|
return;
|
|
232
292
|
}
|
|
233
293
|
|
|
@@ -235,8 +295,8 @@ export function createSelectState<T = unknown>(
|
|
|
235
295
|
if (keys === "all") return;
|
|
236
296
|
const key = keys.size > 0 ? Array.from(keys)[0] : null;
|
|
237
297
|
setSelectedKey(key);
|
|
238
|
-
// Close the dropdown after selection in single mode
|
|
239
298
|
overlayState.close();
|
|
299
|
+
validation.commitValidation();
|
|
240
300
|
},
|
|
241
301
|
});
|
|
242
302
|
|
|
@@ -244,7 +304,7 @@ export function createSelectState<T = unknown>(
|
|
|
244
304
|
// focus-within state on the selection manager — upstream useSelectState keeps
|
|
245
305
|
// these apart with a dedicated useState. Sharing the manager's signal makes
|
|
246
306
|
// trigger focus re-arm the item roving-focus effect and steal focus back.
|
|
247
|
-
const [isFocused, setFocused] =
|
|
307
|
+
const [isFocused, setFocused] = createInternalSignal(false);
|
|
248
308
|
|
|
249
309
|
// Get the selected item from the collection (memoized)
|
|
250
310
|
const selectedItem: Accessor<CollectionNode<T> | null> = createMemo(() => {
|
|
@@ -268,6 +328,11 @@ export function createSelectState<T = unknown>(
|
|
|
268
328
|
});
|
|
269
329
|
|
|
270
330
|
return {
|
|
331
|
+
realtimeValidation: validation.realtimeValidation,
|
|
332
|
+
displayValidation: validation.displayValidation,
|
|
333
|
+
updateValidation: validation.updateValidation,
|
|
334
|
+
resetValidation: validation.resetValidation,
|
|
335
|
+
commitValidation: validation.commitValidation,
|
|
271
336
|
// Collection
|
|
272
337
|
collection: listState.collection,
|
|
273
338
|
selectionManager: listState.selectionManager,
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/selection/Selection.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* A Selection is a special Set containing Keys, which also has an anchor
|
|
3
17
|
* and current selected key for use when range selecting.
|
|
4
18
|
*
|
|
5
|
-
*
|
|
19
|
+
* Ported from packages/react-stately/src/selection/Selection.ts.
|
|
6
20
|
*/
|
|
7
21
|
|
|
8
22
|
import type { Key } from "../collections/types";
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/selection/SelectionManager.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* An interface for reading and updating multiple selection state.
|
|
3
17
|
*
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/selection/useMultipleSelectionState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Raw multiple-selection + focus state for a collection.
|
|
3
17
|
*
|
|
4
18
|
* The lower of the two selection layers ported from upstream
|
|
5
|
-
* (
|
|
19
|
+
* (`packages/react-stately/src/selection/useMultipleSelectionState.ts`): it owns the
|
|
6
20
|
* selected keys, focus, selection behavior, and disabled keys, but is NOT
|
|
7
21
|
* collection-aware. The collection-aware operations (toggle, extend, select
|
|
8
22
|
* all, range, etc.) live in {@link SelectionManager}, which is built on top of
|
|
9
23
|
* this state.
|
|
10
|
-
*
|
|
11
|
-
* Based on @react-stately/selection.
|
|
12
24
|
*/
|
|
13
25
|
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
26
|
+
import { createMemo, createEffect } from "solid-js";
|
|
27
|
+
import type { Accessor } from "solid-js";
|
|
28
|
+
import { access, createInternalSignal, readNow, type MaybeAccessor } from "../utils";
|
|
16
29
|
import type { SelectionStateProps } from "../collections/createSelectionState";
|
|
17
30
|
import type {
|
|
18
31
|
DisabledBehavior,
|
|
@@ -105,16 +118,18 @@ export function createMultipleSelectionState(
|
|
|
105
118
|
|
|
106
119
|
// Focus is a plain signal in Solid; upstream needs a ref + state pair only
|
|
107
120
|
// because React requires both a synchronous read and a re-render trigger.
|
|
108
|
-
const [isFocused, setIsFocused] =
|
|
109
|
-
const [focusedKey, setFocusedKeySignal] =
|
|
110
|
-
const [childFocusStrategy, setChildFocusStrategy] =
|
|
121
|
+
const [isFocused, setIsFocused] = createInternalSignal(false);
|
|
122
|
+
const [focusedKey, setFocusedKeySignal] = createInternalSignal<Key | null>(null);
|
|
123
|
+
const [childFocusStrategy, setChildFocusStrategy] = createInternalSignal<FocusStrategy | null>(
|
|
124
|
+
null,
|
|
125
|
+
);
|
|
111
126
|
|
|
112
127
|
const defaultSelectedKeys = convertSelection(
|
|
113
128
|
getProps().defaultSelectedKeys,
|
|
114
129
|
new SelectionClass(),
|
|
115
130
|
);
|
|
116
131
|
const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] =
|
|
117
|
-
|
|
132
|
+
createInternalSignal<Selection>(defaultSelectedKeys);
|
|
118
133
|
|
|
119
134
|
const selectedKeys = createMemo<Selection>(() => {
|
|
120
135
|
const p = getProps();
|
|
@@ -130,27 +145,28 @@ export function createMultipleSelectionState(
|
|
|
130
145
|
const selectionBehaviorProp = (): SelectionBehavior => getProps().selectionBehavior ?? "toggle";
|
|
131
146
|
|
|
132
147
|
const [selectionBehavior, setSelectionBehaviorState] =
|
|
133
|
-
|
|
148
|
+
createInternalSignal<SelectionBehavior>(selectionBehaviorProp());
|
|
134
149
|
|
|
135
150
|
// If the selectionBehavior prop is 'replace' but the current state is 'toggle'
|
|
136
151
|
// (e.g. due to a long press to enter selection mode on touch) and the
|
|
137
152
|
// selection becomes empty, reset the behavior back to 'replace'.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
createEffect(
|
|
154
|
+
() => ({ keys: selectedKeys(), prop: selectionBehaviorProp() }),
|
|
155
|
+
({ keys, prop }) => {
|
|
156
|
+
if (
|
|
157
|
+
prop === "replace" &&
|
|
158
|
+
selectionBehavior() === "toggle" &&
|
|
159
|
+
typeof keys === "object" &&
|
|
160
|
+
keys.size === 0
|
|
161
|
+
) {
|
|
162
|
+
setSelectionBehaviorState("replace");
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
);
|
|
149
166
|
|
|
150
167
|
// If the selectionBehavior prop changes, sync it into state.
|
|
151
168
|
let lastSelectionBehavior = selectionBehaviorProp();
|
|
152
|
-
|
|
153
|
-
const prop = selectionBehaviorProp();
|
|
169
|
+
createEffect(selectionBehaviorProp, (prop) => {
|
|
154
170
|
if (prop !== lastSelectionBehavior) {
|
|
155
171
|
setSelectionBehaviorState(prop);
|
|
156
172
|
lastSelectionBehavior = prop;
|
|
@@ -169,9 +185,12 @@ export function createMultipleSelectionState(
|
|
|
169
185
|
getProps().onSelectionChange?.(keys);
|
|
170
186
|
};
|
|
171
187
|
|
|
188
|
+
const liveSelectedKeys = (): Selection =>
|
|
189
|
+
getProps().selectedKeys !== undefined ? selectedKeys() : readNow(uncontrolledSelectedKeys);
|
|
190
|
+
|
|
172
191
|
const setSelectedKeys = (keys: Selection) => {
|
|
173
192
|
const p = getProps();
|
|
174
|
-
const current =
|
|
193
|
+
const current = liveSelectedKeys();
|
|
175
194
|
const shouldUpdate =
|
|
176
195
|
p.allowDuplicateSelectionEvents ||
|
|
177
196
|
keys === "all" ||
|
|
@@ -227,7 +246,7 @@ export function createMultipleSelectionState(
|
|
|
227
246
|
setChildFocusStrategy(strategy);
|
|
228
247
|
},
|
|
229
248
|
get selectedKeys() {
|
|
230
|
-
return
|
|
249
|
+
return liveSelectedKeys();
|
|
231
250
|
},
|
|
232
251
|
get lastSelectionEvent() {
|
|
233
252
|
return lastSelectionEvent;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/slider/useSliderState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Creates state for a slider component.
|
|
3
17
|
* Based on @react-stately/slider useSliderState.
|
|
4
18
|
*/
|
|
5
19
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
20
|
+
import { createMemo } from "solid-js";
|
|
21
|
+
import type { Accessor } from "solid-js";
|
|
22
|
+
import { createInternalSignal, access, type MaybeAccessor } from "../utils";
|
|
8
23
|
|
|
9
24
|
export type SliderOrientation = "horizontal" | "vertical";
|
|
10
25
|
|
|
@@ -119,7 +134,7 @@ export function createSliderState(props: MaybeAccessor<SliderStateProps>): Slide
|
|
|
119
134
|
const isControlled = () => getProps().value !== undefined;
|
|
120
135
|
|
|
121
136
|
// Internal signal for uncontrolled mode
|
|
122
|
-
const [internalValue, setInternalValue] =
|
|
137
|
+
const [internalValue, setInternalValue] = createInternalSignal(
|
|
123
138
|
snapToStep(
|
|
124
139
|
initialProps.defaultValue ?? initialMinValue,
|
|
125
140
|
initialMinValue,
|
|
@@ -129,8 +144,8 @@ export function createSliderState(props: MaybeAccessor<SliderStateProps>): Slide
|
|
|
129
144
|
);
|
|
130
145
|
|
|
131
146
|
// Dragging and focus state
|
|
132
|
-
const [isDragging, setIsDragging] =
|
|
133
|
-
const [isFocused, setIsFocused] =
|
|
147
|
+
const [isDragging, setIsDragging] = createInternalSignal(false);
|
|
148
|
+
const [isFocused, setIsFocused] = createInternalSignal(false);
|
|
134
149
|
|
|
135
150
|
// Current value accessor
|
|
136
151
|
const value = createMemo(() => {
|
package/src/ssr/index.ts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/ssr/SSRProvider.tsx
|
|
14
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/utils/useId.ts
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
17
|
* SSR utilities for Solid Stately
|
|
3
18
|
*
|
|
4
19
|
* SolidJS has built-in SSR support with `isServer` and `createUniqueId()`.
|
|
5
|
-
* These utilities provide a consistent
|
|
20
|
+
* These utilities provide a consistent port of the upstream SSR API.
|
|
21
|
+
*
|
|
22
|
+
* Ported from:
|
|
23
|
+
* - packages/react-aria/src/ssr/SSRProvider.tsx
|
|
24
|
+
* - packages/react-aria/src/utils/useId.ts
|
|
6
25
|
*/
|
|
7
26
|
|
|
8
27
|
import { createUniqueId } from "solid-js";
|
|
9
|
-
import { isServer as _isServer } from "
|
|
28
|
+
import { isServer as _isServer } from "@solidjs/web";
|
|
10
29
|
|
|
11
30
|
/**
|
|
12
|
-
* Re-export isServer from
|
|
31
|
+
* Re-export isServer from @solidjs/web for convenience.
|
|
13
32
|
*/
|
|
14
33
|
export const isServer = _isServer;
|
|
15
34
|
|
|
@@ -28,10 +47,14 @@ export function createIsSSR(): boolean {
|
|
|
28
47
|
* @param defaultId - Optional default ID to use instead of generating one.
|
|
29
48
|
*/
|
|
30
49
|
export function createId(defaultId?: string): string {
|
|
50
|
+
// Generate first, choose second, like upstream `useId`: `createUniqueId` is
|
|
51
|
+
// order-dependent in both of its branches, so returning early on `defaultId`
|
|
52
|
+
// would shift every later id in the same render or hydration pass.
|
|
53
|
+
const uniqueId = createUniqueId();
|
|
31
54
|
if (defaultId) {
|
|
32
55
|
return defaultId;
|
|
33
56
|
}
|
|
34
|
-
return `solid-stately-${
|
|
57
|
+
return `solid-stately-${uniqueId}`;
|
|
35
58
|
}
|
|
36
59
|
|
|
37
60
|
/**
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/steplist/useStepListState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* State management for step list components.
|
|
3
17
|
* Tracks selected step, completion status, and selectability.
|
|
18
|
+
*
|
|
19
|
+
* Ported from packages/react-stately/src/steplist/useStepListState.ts.
|
|
4
20
|
*/
|
|
5
21
|
|
|
6
|
-
import { createEffect, createMemo
|
|
22
|
+
import { createEffect, createMemo } from "solid-js";
|
|
23
|
+
import type { Accessor } from "solid-js";
|
|
24
|
+
import { createInternalSignal } from "../utils";
|
|
25
|
+
|
|
7
26
|
import type { Key } from "../collections/types";
|
|
8
27
|
|
|
9
28
|
export interface StepListStateProps {
|
|
@@ -64,9 +83,8 @@ export function createStepListState(props: StepListStateProps): StepListState {
|
|
|
64
83
|
const isReadOnly: Accessor<boolean> = () => props.isReadOnly ?? false;
|
|
65
84
|
|
|
66
85
|
// Last completed step signal (uncontrolled)
|
|
67
|
-
const [lastCompletedStepInternal, setLastCompletedStepInternal] =
|
|
68
|
-
props.defaultLastCompletedStep ?? null
|
|
69
|
-
);
|
|
86
|
+
const [lastCompletedStepInternal, setLastCompletedStepInternal] =
|
|
87
|
+
createInternalSignal<Key | null>(props.defaultLastCompletedStep ?? null);
|
|
70
88
|
|
|
71
89
|
const lastCompletedStep: Accessor<Key | null> = () => {
|
|
72
90
|
if (props.lastCompletedStep !== undefined) {
|
|
@@ -144,7 +162,7 @@ export function createStepListState(props: StepListStateProps): StepListState {
|
|
|
144
162
|
};
|
|
145
163
|
|
|
146
164
|
// Selected key signal (uncontrolled)
|
|
147
|
-
const [selectedKeyInternal, setSelectedKeyInternal] =
|
|
165
|
+
const [selectedKeyInternal, setSelectedKeyInternal] = createInternalSignal<Key | null>(
|
|
148
166
|
props.defaultSelectedKey ?? findDefaultSelectedKey(),
|
|
149
167
|
);
|
|
150
168
|
|
|
@@ -187,18 +205,21 @@ export function createStepListState(props: StepListStateProps): StepListState {
|
|
|
187
205
|
// lastCompleted index), advancing `lastCompletedStep` to `selectedIdx - 1`
|
|
188
206
|
// marks every intermediate step complete. This runs regardless of
|
|
189
207
|
// `isDisabled` / `isReadOnly`, exactly as upstream (the effect is ungated).
|
|
190
|
-
createEffect(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
208
|
+
createEffect(
|
|
209
|
+
() => {
|
|
210
|
+
const selKey = selectedKey();
|
|
211
|
+
if (selKey === null) return null;
|
|
212
|
+
const selIdx = indexMap().get(selKey);
|
|
213
|
+
if (selIdx === undefined || selIdx <= 0) return null;
|
|
214
|
+
const completed = lastCompletedStep();
|
|
215
|
+
const lcs = completed !== null ? (indexMap().get(completed) ?? -1) : -1;
|
|
216
|
+
if (selIdx <= lcs + 1) return null;
|
|
217
|
+
return items()[selIdx - 1]?.key;
|
|
218
|
+
},
|
|
219
|
+
(prevKey) => {
|
|
220
|
+
if (prevKey !== undefined && prevKey !== null) setLastCompletedStep(prevKey);
|
|
221
|
+
},
|
|
222
|
+
);
|
|
202
223
|
|
|
203
224
|
return {
|
|
204
225
|
selectedKey,
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/table/TableCollection.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* TableCollection - A collection class for table data.
|
|
3
17
|
* Based on @react-stately/table/TableCollection.
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/table/useTableColumnResizeState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Table column resize state management.
|
|
3
17
|
* Based on @react-stately/table/useTableColumnResizeState.
|
|
@@ -7,7 +21,10 @@
|
|
|
7
21
|
* width distribution and clamping.
|
|
8
22
|
*/
|
|
9
23
|
|
|
10
|
-
import {
|
|
24
|
+
import { createMemo } from "solid-js";
|
|
25
|
+
import type { Accessor } from "solid-js";
|
|
26
|
+
import { createInternalSignal } from "../utils";
|
|
27
|
+
|
|
11
28
|
import type { Key } from "../collections/types";
|
|
12
29
|
|
|
13
30
|
/** Column size: a number (px) or a string ('100px', '50%', '1fr'). */
|
|
@@ -154,8 +171,8 @@ export function createTableColumnResizeState(
|
|
|
154
171
|
);
|
|
155
172
|
|
|
156
173
|
// User-overridden widths (set during/after resize)
|
|
157
|
-
const [overrides, setOverrides] =
|
|
158
|
-
const [resizingColumn, setResizingColumn] =
|
|
174
|
+
const [overrides, setOverrides] = createInternalSignal<Map<Key, number>>(new Map());
|
|
175
|
+
const [resizingColumn, setResizingColumn] = createInternalSignal<Key | null>(null);
|
|
159
176
|
|
|
160
177
|
// Computed widths: initial merged with overrides
|
|
161
178
|
const columnWidths = createMemo(() => {
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/table/useTableState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Table state management for Table components.
|
|
3
17
|
* Based on @react-stately/table/useTableState.
|
|
4
18
|
*/
|
|
5
19
|
|
|
6
|
-
import { createMemo
|
|
20
|
+
import { createMemo } from "solid-js";
|
|
21
|
+
import type { Accessor } from "solid-js";
|
|
7
22
|
import { createGridState } from "../grid/createGridState";
|
|
8
23
|
import type { Key } from "../collections/types";
|
|
9
24
|
import type {
|
|
@@ -111,6 +126,12 @@ export function createTableState<
|
|
|
111
126
|
get selectedKeys() {
|
|
112
127
|
return gridState.selectedKeys;
|
|
113
128
|
},
|
|
129
|
+
get isEmpty() {
|
|
130
|
+
return gridState.isEmpty;
|
|
131
|
+
},
|
|
132
|
+
get isSelectAll() {
|
|
133
|
+
return gridState.isSelectAll;
|
|
134
|
+
},
|
|
114
135
|
|
|
115
136
|
// Grid state methods
|
|
116
137
|
isSelected: gridState.isSelected,
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/table/useTreeGridState.ts
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Tree grid state management for expandable Table rows.
|
|
3
17
|
* Based on @react-stately/table/useTreeGridState (the `UNSTABLE_` tree-grid feature).
|
|
@@ -6,7 +20,10 @@
|
|
|
6
20
|
* collection from it, and layers the expansion API on top of {@link createTableState}.
|
|
7
21
|
*/
|
|
8
22
|
|
|
9
|
-
import { createMemo
|
|
23
|
+
import { createMemo } from "solid-js";
|
|
24
|
+
import type { Accessor } from "solid-js";
|
|
25
|
+
import { createInternalSignal } from "../utils";
|
|
26
|
+
|
|
10
27
|
import { createTableState } from "./createTableState";
|
|
11
28
|
import { createTableCollection, TableCollection } from "./TableCollection";
|
|
12
29
|
import type { Key } from "../collections/types";
|
|
@@ -24,17 +41,17 @@ export function createTreeGridState<
|
|
|
24
41
|
|
|
25
42
|
// Expanded keys: controlled via `UNSTABLE_expandedKeys`, otherwise the internal signal
|
|
26
43
|
// seeded from `UNSTABLE_defaultExpandedKeys`.
|
|
27
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
44
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = createInternalSignal<"all" | Set<Key>>(
|
|
28
45
|
getInitialExpanded(getOptions().UNSTABLE_defaultExpandedKeys),
|
|
29
46
|
);
|
|
30
47
|
|
|
31
|
-
const expandedKeys =
|
|
48
|
+
const expandedKeys = (): "all" | Set<Key> => {
|
|
32
49
|
const controlled = getOptions().UNSTABLE_expandedKeys;
|
|
33
50
|
if (controlled !== undefined) {
|
|
34
51
|
return convertExpanded(controlled);
|
|
35
52
|
}
|
|
36
53
|
return internalExpandedKeys();
|
|
37
|
-
}
|
|
54
|
+
};
|
|
38
55
|
|
|
39
56
|
// Rebuild the tree collection whenever the expanded keys (or the data) change.
|
|
40
57
|
const collection = createMemo(
|