@solid2-aria/stately 0.0.0-stage → 0.0.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 +21 -0
- package/README.md +45 -2
- package/dist/LICENSES/Apache-2.0.txt +201 -0
- package/dist/LICENSES/react-spectrum-NOTICE.txt +242 -0
- package/dist/NOTICE.txt +636 -0
- package/dist/autocomplete/create-autocomplete-state.d.ts +46 -0
- package/dist/autocomplete/create-autocomplete-state.js +41 -0
- package/dist/autocomplete/create-autocomplete-state.js.map +1 -0
- package/dist/calendar/create-calendar-state.d.ts +62 -0
- package/dist/calendar/create-calendar-state.js +357 -0
- package/dist/calendar/create-calendar-state.js.map +1 -0
- package/dist/calendar/create-range-calendar-state.d.ts +63 -0
- package/dist/calendar/create-range-calendar-state.js +204 -0
- package/dist/calendar/create-range-calendar-state.js.map +1 -0
- package/dist/calendar/types.d.ts +222 -0
- package/dist/calendar/types.js +16 -0
- package/dist/calendar/utils.d.ts +27 -0
- package/dist/calendar/utils.js +81 -0
- package/dist/calendar/utils.js.map +1 -0
- package/dist/checkbox/create-checkbox-group-state.d.ts +60 -0
- package/dist/checkbox/create-checkbox-group-state.js +88 -0
- package/dist/checkbox/create-checkbox-group-state.js.map +1 -0
- package/dist/collections/collection-builder.d.ts +28 -0
- package/dist/collections/collection-builder.js +164 -0
- package/dist/collections/collection-builder.js.map +1 -0
- package/dist/collections/create-collection.d.ts +24 -0
- package/dist/collections/create-collection.js +35 -0
- package/dist/collections/create-collection.js.map +1 -0
- package/dist/collections/get-child-nodes.d.ts +25 -0
- package/dist/collections/get-child-nodes.js +67 -0
- package/dist/collections/get-child-nodes.js.map +1 -0
- package/dist/collections/get-item-count.d.ts +19 -0
- package/dist/collections/get-item-count.js +34 -0
- package/dist/collections/get-item-count.js.map +1 -0
- package/dist/collections/item.d.ts +29 -0
- package/dist/collections/item.js +68 -0
- package/dist/collections/item.js.map +1 -0
- package/dist/collections/section.d.ts +29 -0
- package/dist/collections/section.js +60 -0
- package/dist/collections/section.js.map +1 -0
- package/dist/collections/types.d.ts +46 -0
- package/dist/collections/types.js +29 -0
- package/dist/collections/types.js.map +1 -0
- package/dist/color/color/base-color.d.ts +40 -0
- package/dist/color/color/base-color.js +122 -0
- package/dist/color/color/base-color.js.map +1 -0
- package/dist/color/color/color-classes.d.ts +27 -0
- package/dist/color/color/color-classes.js +29 -0
- package/dist/color/color/color-classes.js.map +1 -0
- package/dist/color/color/color-constructors.d.ts +23 -0
- package/dist/color/color/color-constructors.js +16 -0
- package/dist/color/color/color.d.ts +3 -0
- package/dist/color/color/color.js +2 -0
- package/dist/color/color/hsb-color.d.ts +24 -0
- package/dist/color/color/hsb-color.js +183 -0
- package/dist/color/color/hsb-color.js.map +1 -0
- package/dist/color/color/hsl-color.d.ts +24 -0
- package/dist/color/color/hsl-color.js +184 -0
- package/dist/color/color/hsl-color.js.map +1 -0
- package/dist/color/color/normalize-hue.d.ts +18 -0
- package/dist/color/color/normalize-hue.js +24 -0
- package/dist/color/color/normalize-hue.js.map +1 -0
- package/dist/color/color/oklch.d.ts +19 -0
- package/dist/color/color/oklch.js +97 -0
- package/dist/color/color/oklch.js.map +1 -0
- package/dist/color/color/rgb-color.d.ts +24 -0
- package/dist/color/color/rgb-color.js +230 -0
- package/dist/color/color/rgb-color.js.map +1 -0
- package/dist/color/color.d.ts +25 -0
- package/dist/color/color.js +41 -0
- package/dist/color/color.js.map +1 -0
- package/dist/color/create-color-area-state.d.ts +105 -0
- package/dist/color/create-color-area-state.js +138 -0
- package/dist/color/create-color-area-state.js.map +1 -0
- package/dist/color/create-color-channel-field-state.d.ts +29 -0
- package/dist/color/create-color-channel-field-state.js +69 -0
- package/dist/color/create-color-channel-field-state.js.map +1 -0
- package/dist/color/create-color-field-state.d.ts +61 -0
- package/dist/color/create-color-field-state.js +113 -0
- package/dist/color/create-color-field-state.js.map +1 -0
- package/dist/color/create-color-picker-state.d.ts +16 -0
- package/dist/color/create-color-picker-state.js +26 -0
- package/dist/color/create-color-picker-state.js.map +1 -0
- package/dist/color/create-color-slider-state.d.ts +50 -0
- package/dist/color/create-color-slider-state.js +93 -0
- package/dist/color/create-color-slider-state.js.map +1 -0
- package/dist/color/create-color-wheel-state.d.ts +76 -0
- package/dist/color/create-color-wheel-state.js +130 -0
- package/dist/color/create-color-wheel-state.js.map +1 -0
- package/dist/color/create-color.d.ts +20 -0
- package/dist/color/create-color.js +33 -0
- package/dist/color/create-color.js.map +1 -0
- package/dist/color/types.d.ts +87 -0
- package/dist/color/types.js +5 -0
- package/dist/combobox/create-combo-box-state.d.ts +157 -0
- package/dist/combobox/create-combo-box-state.js +450 -0
- package/dist/combobox/create-combo-box-state.js.map +1 -0
- package/dist/data/create-async-list.d.ts +88 -0
- package/dist/data/create-async-list.js +276 -0
- package/dist/data/create-async-list.js.map +1 -0
- package/dist/data/create-list-data.d.ts +140 -0
- package/dist/data/create-list-data.js +250 -0
- package/dist/data/create-list-data.js.map +1 -0
- package/dist/data/create-tree-data.d.ts +134 -0
- package/dist/data/create-tree-data.js +364 -0
- package/dist/data/create-tree-data.js.map +1 -0
- package/dist/datepicker/create-date-field-state.d.ts +138 -0
- package/dist/datepicker/create-date-field-state.js +449 -0
- package/dist/datepicker/create-date-field-state.js.map +1 -0
- package/dist/datepicker/create-date-picker-state.d.ts +82 -0
- package/dist/datepicker/create-date-picker-state.js +191 -0
- package/dist/datepicker/create-date-picker-state.js.map +1 -0
- package/dist/datepicker/create-date-range-picker-state.d.ts +97 -0
- package/dist/datepicker/create-date-range-picker-state.js +305 -0
- package/dist/datepicker/create-date-range-picker-state.js.map +1 -0
- package/dist/datepicker/create-time-field-state.d.ts +34 -0
- package/dist/datepicker/create-time-field-state.js +128 -0
- package/dist/datepicker/create-time-field-state.js.map +1 -0
- package/dist/datepicker/incomplete-date.d.ts +71 -0
- package/dist/datepicker/incomplete-date.js +324 -0
- package/dist/datepicker/incomplete-date.js.map +1 -0
- package/dist/datepicker/placeholders.d.ts +18 -0
- package/dist/datepicker/placeholders.js +418 -0
- package/dist/datepicker/placeholders.js.map +1 -0
- package/dist/datepicker/types.d.ts +131 -0
- package/dist/datepicker/types.js +16 -0
- package/dist/datepicker/utils.d.ts +37 -0
- package/dist/datepicker/utils.js +168 -0
- package/dist/datepicker/utils.js.map +1 -0
- package/dist/disclosure/create-disclosure-group-state.d.ts +47 -0
- package/dist/disclosure/create-disclosure-group-state.js +62 -0
- package/dist/disclosure/create-disclosure-group-state.js.map +1 -0
- package/dist/disclosure/create-disclosure-state.d.ts +42 -0
- package/dist/disclosure/create-disclosure-state.js +49 -0
- package/dist/disclosure/create-disclosure-state.js.map +1 -0
- package/dist/dnd/create-draggable-collection-state.d.ts +63 -0
- package/dist/dnd/create-draggable-collection-state.js +136 -0
- package/dist/dnd/create-draggable-collection-state.js.map +1 -0
- package/dist/dnd/create-droppable-collection-state.d.ts +55 -0
- package/dist/dnd/create-droppable-collection-state.js +155 -0
- package/dist/dnd/create-droppable-collection-state.js.map +1 -0
- package/dist/flags/flags.d.ts +21 -0
- package/dist/flags/flags.js +34 -0
- package/dist/flags/flags.js.map +1 -0
- package/dist/form/create-form-validation-state.d.ts +37 -0
- package/dist/form/create-form-validation-state.js +152 -0
- package/dist/form/create-form-validation-state.js.map +1 -0
- package/dist/grid/create-grid-state.d.ts +38 -0
- package/dist/grid/create-grid-state.js +85 -0
- package/dist/grid/create-grid-state.js.map +1 -0
- package/dist/grid/grid-collection.d.ts +68 -0
- package/dist/grid/grid-collection.js +133 -0
- package/dist/grid/grid-collection.js.map +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +86 -0
- package/dist/intl/color/ar-AE.js +44 -0
- package/dist/intl/color/ar-AE.js.map +1 -0
- package/dist/intl/color/bg-BG.js +44 -0
- package/dist/intl/color/bg-BG.js.map +1 -0
- package/dist/intl/color/cs-CZ.js +44 -0
- package/dist/intl/color/cs-CZ.js.map +1 -0
- package/dist/intl/color/da-DK.js +44 -0
- package/dist/intl/color/da-DK.js.map +1 -0
- package/dist/intl/color/de-DE.js +44 -0
- package/dist/intl/color/de-DE.js.map +1 -0
- package/dist/intl/color/el-GR.js +44 -0
- package/dist/intl/color/el-GR.js.map +1 -0
- package/dist/intl/color/en-US.js +44 -0
- package/dist/intl/color/en-US.js.map +1 -0
- package/dist/intl/color/es-ES.js +44 -0
- package/dist/intl/color/es-ES.js.map +1 -0
- package/dist/intl/color/et-EE.js +44 -0
- package/dist/intl/color/et-EE.js.map +1 -0
- package/dist/intl/color/fi-FI.js +44 -0
- package/dist/intl/color/fi-FI.js.map +1 -0
- package/dist/intl/color/fr-FR.js +44 -0
- package/dist/intl/color/fr-FR.js.map +1 -0
- package/dist/intl/color/he-IL.js +44 -0
- package/dist/intl/color/he-IL.js.map +1 -0
- package/dist/intl/color/hr-HR.js +44 -0
- package/dist/intl/color/hr-HR.js.map +1 -0
- package/dist/intl/color/hu-HU.js +44 -0
- package/dist/intl/color/hu-HU.js.map +1 -0
- package/dist/intl/color/index.js +75 -0
- package/dist/intl/color/index.js.map +1 -0
- package/dist/intl/color/it-IT.js +44 -0
- package/dist/intl/color/it-IT.js.map +1 -0
- package/dist/intl/color/ja-JP.js +44 -0
- package/dist/intl/color/ja-JP.js.map +1 -0
- package/dist/intl/color/ko-KR.js +44 -0
- package/dist/intl/color/ko-KR.js.map +1 -0
- package/dist/intl/color/lt-LT.js +44 -0
- package/dist/intl/color/lt-LT.js.map +1 -0
- package/dist/intl/color/lv-LV.js +44 -0
- package/dist/intl/color/lv-LV.js.map +1 -0
- package/dist/intl/color/nb-NO.js +44 -0
- package/dist/intl/color/nb-NO.js.map +1 -0
- package/dist/intl/color/nl-NL.js +44 -0
- package/dist/intl/color/nl-NL.js.map +1 -0
- package/dist/intl/color/pl-PL.js +44 -0
- package/dist/intl/color/pl-PL.js.map +1 -0
- package/dist/intl/color/pt-BR.js +44 -0
- package/dist/intl/color/pt-BR.js.map +1 -0
- package/dist/intl/color/pt-PT.js +44 -0
- package/dist/intl/color/pt-PT.js.map +1 -0
- package/dist/intl/color/ro-RO.js +44 -0
- package/dist/intl/color/ro-RO.js.map +1 -0
- package/dist/intl/color/ru-RU.js +44 -0
- package/dist/intl/color/ru-RU.js.map +1 -0
- package/dist/intl/color/sk-SK.js +44 -0
- package/dist/intl/color/sk-SK.js.map +1 -0
- package/dist/intl/color/sl-SI.js +44 -0
- package/dist/intl/color/sl-SI.js.map +1 -0
- package/dist/intl/color/sr-SP.js +44 -0
- package/dist/intl/color/sr-SP.js.map +1 -0
- package/dist/intl/color/sv-SE.js +44 -0
- package/dist/intl/color/sv-SE.js.map +1 -0
- package/dist/intl/color/tr-TR.js +44 -0
- package/dist/intl/color/tr-TR.js.map +1 -0
- package/dist/intl/color/uk-UA.js +44 -0
- package/dist/intl/color/uk-UA.js.map +1 -0
- package/dist/intl/color/zh-CN.js +44 -0
- package/dist/intl/color/zh-CN.js.map +1 -0
- package/dist/intl/color/zh-TW.js +44 -0
- package/dist/intl/color/zh-TW.js.map +1 -0
- package/dist/intl/datepicker/ar-AE.js +11 -0
- package/dist/intl/datepicker/ar-AE.js.map +1 -0
- package/dist/intl/datepicker/bg-BG.js +11 -0
- package/dist/intl/datepicker/bg-BG.js.map +1 -0
- package/dist/intl/datepicker/cs-CZ.js +11 -0
- package/dist/intl/datepicker/cs-CZ.js.map +1 -0
- package/dist/intl/datepicker/da-DK.js +11 -0
- package/dist/intl/datepicker/da-DK.js.map +1 -0
- package/dist/intl/datepicker/de-DE.js +11 -0
- package/dist/intl/datepicker/de-DE.js.map +1 -0
- package/dist/intl/datepicker/el-GR.js +11 -0
- package/dist/intl/datepicker/el-GR.js.map +1 -0
- package/dist/intl/datepicker/en-US.js +11 -0
- package/dist/intl/datepicker/en-US.js.map +1 -0
- package/dist/intl/datepicker/es-ES.js +11 -0
- package/dist/intl/datepicker/es-ES.js.map +1 -0
- package/dist/intl/datepicker/et-EE.js +11 -0
- package/dist/intl/datepicker/et-EE.js.map +1 -0
- package/dist/intl/datepicker/fi-FI.js +11 -0
- package/dist/intl/datepicker/fi-FI.js.map +1 -0
- package/dist/intl/datepicker/fr-FR.js +11 -0
- package/dist/intl/datepicker/fr-FR.js.map +1 -0
- package/dist/intl/datepicker/he-IL.js +11 -0
- package/dist/intl/datepicker/he-IL.js.map +1 -0
- package/dist/intl/datepicker/hr-HR.js +11 -0
- package/dist/intl/datepicker/hr-HR.js.map +1 -0
- package/dist/intl/datepicker/hu-HU.js +11 -0
- package/dist/intl/datepicker/hu-HU.js.map +1 -0
- package/dist/intl/datepicker/index.js +75 -0
- package/dist/intl/datepicker/index.js.map +1 -0
- package/dist/intl/datepicker/it-IT.js +11 -0
- package/dist/intl/datepicker/it-IT.js.map +1 -0
- package/dist/intl/datepicker/ja-JP.js +11 -0
- package/dist/intl/datepicker/ja-JP.js.map +1 -0
- package/dist/intl/datepicker/ko-KR.js +11 -0
- package/dist/intl/datepicker/ko-KR.js.map +1 -0
- package/dist/intl/datepicker/lt-LT.js +11 -0
- package/dist/intl/datepicker/lt-LT.js.map +1 -0
- package/dist/intl/datepicker/lv-LV.js +11 -0
- package/dist/intl/datepicker/lv-LV.js.map +1 -0
- package/dist/intl/datepicker/nb-NO.js +11 -0
- package/dist/intl/datepicker/nb-NO.js.map +1 -0
- package/dist/intl/datepicker/nl-NL.js +11 -0
- package/dist/intl/datepicker/nl-NL.js.map +1 -0
- package/dist/intl/datepicker/pl-PL.js +11 -0
- package/dist/intl/datepicker/pl-PL.js.map +1 -0
- package/dist/intl/datepicker/pt-BR.js +11 -0
- package/dist/intl/datepicker/pt-BR.js.map +1 -0
- package/dist/intl/datepicker/pt-PT.js +11 -0
- package/dist/intl/datepicker/pt-PT.js.map +1 -0
- package/dist/intl/datepicker/ro-RO.js +11 -0
- package/dist/intl/datepicker/ro-RO.js.map +1 -0
- package/dist/intl/datepicker/ru-RU.js +11 -0
- package/dist/intl/datepicker/ru-RU.js.map +1 -0
- package/dist/intl/datepicker/sk-SK.js +11 -0
- package/dist/intl/datepicker/sk-SK.js.map +1 -0
- package/dist/intl/datepicker/sl-SI.js +11 -0
- package/dist/intl/datepicker/sl-SI.js.map +1 -0
- package/dist/intl/datepicker/sr-SP.js +11 -0
- package/dist/intl/datepicker/sr-SP.js.map +1 -0
- package/dist/intl/datepicker/sv-SE.js +11 -0
- package/dist/intl/datepicker/sv-SE.js.map +1 -0
- package/dist/intl/datepicker/tr-TR.js +11 -0
- package/dist/intl/datepicker/tr-TR.js.map +1 -0
- package/dist/intl/datepicker/uk-UA.js +11 -0
- package/dist/intl/datepicker/uk-UA.js.map +1 -0
- package/dist/intl/datepicker/zh-CN.js +11 -0
- package/dist/intl/datepicker/zh-CN.js.map +1 -0
- package/dist/intl/datepicker/zh-TW.js +11 -0
- package/dist/intl/datepicker/zh-TW.js.map +1 -0
- package/dist/layout/grid-layout.d.ts +107 -0
- package/dist/layout/grid-layout.js +253 -0
- package/dist/layout/grid-layout.js.map +1 -0
- package/dist/layout/list-layout.d.ts +187 -0
- package/dist/layout/list-layout.js +488 -0
- package/dist/layout/list-layout.js.map +1 -0
- package/dist/layout/table-layout.d.ts +98 -0
- package/dist/layout/table-layout.js +476 -0
- package/dist/layout/table-layout.js.map +1 -0
- package/dist/layout/waterfall-layout.d.ts +85 -0
- package/dist/layout/waterfall-layout.js +225 -0
- package/dist/layout/waterfall-layout.js.map +1 -0
- package/dist/list/create-list-state.d.ts +48 -0
- package/dist/list/create-list-state.js +123 -0
- package/dist/list/create-list-state.js.map +1 -0
- package/dist/list/create-single-select-list-state.d.ts +38 -0
- package/dist/list/create-single-select-list-state.js +55 -0
- package/dist/list/create-single-select-list-state.js.map +1 -0
- package/dist/list/list-collection.d.ts +36 -0
- package/dist/list/list-collection.js +91 -0
- package/dist/list/list-collection.js.map +1 -0
- package/dist/menu/create-menu-trigger-state.d.ts +55 -0
- package/dist/menu/create-menu-trigger-state.js +58 -0
- package/dist/menu/create-menu-trigger-state.js.map +1 -0
- package/dist/menu/create-submenu-trigger-state.d.ts +47 -0
- package/dist/menu/create-submenu-trigger-state.js +59 -0
- package/dist/menu/create-submenu-trigger-state.js.map +1 -0
- package/dist/numberfield/create-number-field-state.d.ts +93 -0
- package/dist/numberfield/create-number-field-state.js +139 -0
- package/dist/numberfield/create-number-field-state.js.map +1 -0
- package/dist/overlays/create-overlay-trigger-state.d.ts +51 -0
- package/dist/overlays/create-overlay-trigger-state.js +56 -0
- package/dist/overlays/create-overlay-trigger-state.js.map +1 -0
- package/dist/radio/create-radio-group-state.d.ts +61 -0
- package/dist/radio/create-radio-group-state.js +71 -0
- package/dist/radio/create-radio-group-state.js.map +1 -0
- package/dist/searchfield/create-search-field-state.d.ts +35 -0
- package/dist/searchfield/create-search-field-state.js +34 -0
- package/dist/searchfield/create-search-field-state.js.map +1 -0
- package/dist/select/create-select-state.d.ts +116 -0
- package/dist/select/create-select-state.js +151 -0
- package/dist/select/create-select-state.js.map +1 -0
- package/dist/selection/create-multiple-selection-state.d.ts +39 -0
- package/dist/selection/create-multiple-selection-state.js +114 -0
- package/dist/selection/create-multiple-selection-state.js.map +1 -0
- package/dist/selection/selection-manager.d.ts +139 -0
- package/dist/selection/selection-manager.js +334 -0
- package/dist/selection/selection-manager.js.map +1 -0
- package/dist/selection/selection.d.ts +27 -0
- package/dist/selection/selection.js +38 -0
- package/dist/selection/selection.js.map +1 -0
- package/dist/selection/types.d.ts +116 -0
- package/dist/selection/types.js +16 -0
- package/dist/slider/create-slider-state.d.ts +182 -0
- package/dist/slider/create-slider-state.js +131 -0
- package/dist/slider/create-slider-state.js.map +1 -0
- package/dist/steplist/create-step-list-state.d.ts +40 -0
- package/dist/steplist/create-step-list-state.js +132 -0
- package/dist/steplist/create-step-list-state.js.map +1 -0
- package/dist/table/cell.d.ts +37 -0
- package/dist/table/cell.js +47 -0
- package/dist/table/cell.js.map +1 -0
- package/dist/table/collection-context.d.ts +4 -0
- package/dist/table/collection-context.js +8 -0
- package/dist/table/collection-context.js.map +1 -0
- package/dist/table/column.d.ts +66 -0
- package/dist/table/column.js +71 -0
- package/dist/table/column.js.map +1 -0
- package/dist/table/create-table-column-resize-state.d.ts +65 -0
- package/dist/table/create-table-column-resize-state.js +100 -0
- package/dist/table/create-table-column-resize-state.js.map +1 -0
- package/dist/table/create-table-state.d.ts +112 -0
- package/dist/table/create-table-state.js +122 -0
- package/dist/table/create-table-state.js.map +1 -0
- package/dist/table/create-tree-grid-state.d.ts +44 -0
- package/dist/table/create-tree-grid-state.js +145 -0
- package/dist/table/create-tree-grid-state.js.map +1 -0
- package/dist/table/row.d.ts +44 -0
- package/dist/table/row.js +91 -0
- package/dist/table/row.js.map +1 -0
- package/dist/table/table-body.d.ts +36 -0
- package/dist/table/table-body.js +57 -0
- package/dist/table/table-body.js.map +1 -0
- package/dist/table/table-collection.d.ts +62 -0
- package/dist/table/table-collection.js +274 -0
- package/dist/table/table-collection.js.map +1 -0
- package/dist/table/table-column-layout.d.ts +47 -0
- package/dist/table/table-column-layout.js +94 -0
- package/dist/table/table-column-layout.js.map +1 -0
- package/dist/table/table-header.d.ts +37 -0
- package/dist/table/table-header.js +52 -0
- package/dist/table/table-header.js.map +1 -0
- package/dist/table/table-utils.d.ts +60 -0
- package/dist/table/table-utils.js +203 -0
- package/dist/table/table-utils.js.map +1 -0
- package/dist/tabs/create-tab-list-state.d.ts +42 -0
- package/dist/tabs/create-tab-list-state.js +78 -0
- package/dist/tabs/create-tab-list-state.js.map +1 -0
- package/dist/toast/create-toast-state.d.ts +97 -0
- package/dist/toast/create-toast-state.js +166 -0
- package/dist/toast/create-toast-state.js.map +1 -0
- package/dist/toggle/create-toggle-group-state.d.ts +55 -0
- package/dist/toggle/create-toggle-group-state.js +62 -0
- package/dist/toggle/create-toggle-group-state.js.map +1 -0
- package/dist/toggle/create-toggle-state.d.ts +58 -0
- package/dist/toggle/create-toggle-state.js +43 -0
- package/dist/toggle/create-toggle-state.js.map +1 -0
- package/dist/tokenfield/create-token-field-state.d.ts +39 -0
- package/dist/tokenfield/create-token-field-state.js +44 -0
- package/dist/tokenfield/create-token-field-state.js.map +1 -0
- package/dist/tokenfield/token-field-value.d.ts +111 -0
- package/dist/tokenfield/token-field-value.js +327 -0
- package/dist/tokenfield/token-field-value.js.map +1 -0
- package/dist/tooltip/create-tooltip-trigger-state.d.ts +73 -0
- package/dist/tooltip/create-tooltip-trigger-state.js +136 -0
- package/dist/tooltip/create-tooltip-trigger-state.js.map +1 -0
- package/dist/tree/create-tree-state.d.ts +42 -0
- package/dist/tree/create-tree-state.js +75 -0
- package/dist/tree/create-tree-state.js.map +1 -0
- package/dist/tree/tree-collection.d.ts +36 -0
- package/dist/tree/tree-collection.js +84 -0
- package/dist/tree/tree-collection.js.map +1 -0
- package/dist/utils/create-controlled-signal.d.ts +23 -0
- package/dist/utils/create-controlled-signal.js +54 -0
- package/dist/utils/create-controlled-signal.js.map +1 -0
- package/dist/utils/get-item-key.d.ts +5 -0
- package/dist/utils/get-item-key.js +12 -0
- package/dist/utils/get-item-key.js.map +1 -0
- package/dist/utils/get-node-props.d.ts +23 -0
- package/dist/utils/get-node-props.js +38 -0
- package/dist/utils/get-node-props.js.map +1 -0
- package/dist/utils/has-content.d.ts +5 -0
- package/dist/utils/has-content.js +7 -0
- package/dist/utils/has-content.js.map +1 -0
- package/dist/utils/legacy-props.d.ts +10 -0
- package/dist/utils/legacy-props.js +17 -0
- package/dist/utils/legacy-props.js.map +1 -0
- package/dist/utils/number.d.ts +25 -0
- package/dist/utils/number.js +59 -0
- package/dist/utils/number.js.map +1 -0
- package/dist/utils/parse-calendar-identifier.d.ts +5 -0
- package/dist/utils/parse-calendar-identifier.js +31 -0
- package/dist/utils/parse-calendar-identifier.js.map +1 -0
- package/dist/utils/require-value.d.ts +4 -0
- package/dist/utils/require-value.js +10 -0
- package/dist/utils/require-value.js.map +1 -0
- package/dist/virtualizer/create-virtualizer-state.d.ts +44 -0
- package/dist/virtualizer/create-virtualizer-state.js +92 -0
- package/dist/virtualizer/create-virtualizer-state.js.map +1 -0
- package/dist/virtualizer/layout-info.d.ts +94 -0
- package/dist/virtualizer/layout-info.js +118 -0
- package/dist/virtualizer/layout-info.js.map +1 -0
- package/dist/virtualizer/layout.d.ts +91 -0
- package/dist/virtualizer/layout.js +71 -0
- package/dist/virtualizer/layout.js.map +1 -0
- package/dist/virtualizer/overscan-manager.d.ts +25 -0
- package/dist/virtualizer/overscan-manager.js +46 -0
- package/dist/virtualizer/overscan-manager.js.map +1 -0
- package/dist/virtualizer/point.d.ts +36 -0
- package/dist/virtualizer/point.js +48 -0
- package/dist/virtualizer/point.js.map +1 -0
- package/dist/virtualizer/rect.d.ts +103 -0
- package/dist/virtualizer/rect.js +156 -0
- package/dist/virtualizer/rect.js.map +1 -0
- package/dist/virtualizer/reusable-view.d.ts +51 -0
- package/dist/virtualizer/reusable-view.js +81 -0
- package/dist/virtualizer/reusable-view.js.map +1 -0
- package/dist/virtualizer/scroll-anchor.d.ts +98 -0
- package/dist/virtualizer/scroll-anchor.js +150 -0
- package/dist/virtualizer/scroll-anchor.js.map +1 -0
- package/dist/virtualizer/size.d.ts +34 -0
- package/dist/virtualizer/size.js +46 -0
- package/dist/virtualizer/size.js.map +1 -0
- package/dist/virtualizer/types.d.ts +47 -0
- package/dist/virtualizer/types.js +16 -0
- package/dist/virtualizer/utils.d.ts +19 -0
- package/dist/virtualizer/utils.js +27 -0
- package/dist/virtualizer/utils.js.map +1 -0
- package/dist/virtualizer/virtualizer.d.ts +99 -0
- package/dist/virtualizer/virtualizer.js +314 -0
- package/dist/virtualizer/virtualizer.js.map +1 -0
- package/package.json +174 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-select-state.js","names":[],"sources":["../../src/select/create-select-state.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/select/useSelectState.ts.\n * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type {\n CollectionBase,\n CollectionStateBase,\n FocusableProps,\n FocusStrategy,\n HelpTextProps,\n InputBase,\n Key,\n LabelableProps,\n Node,\n Selection,\n TextInputBase,\n Validation,\n ValueBase,\n} from \"@solid2-aria/types-shared\";\nimport { createMemo, createSignal, merge, omit, untrack } from \"solid-js\";\n\nimport { createFormValidationState } from \"../form/create-form-validation-state\";\nimport type { FormValidationState } from \"../form/create-form-validation-state\";\nimport { createListState } from \"../list/create-list-state\";\nimport type { ListState } from \"../list/create-list-state\";\nimport { createOverlayTriggerState } from \"../overlays/create-overlay-trigger-state\";\nimport type { OverlayTriggerState } from \"../overlays/create-overlay-trigger-state\";\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\nimport {\n getLegacyDefaultSelectedKey,\n getLegacySelectedKey,\n notifyLegacySelectionChange,\n} from \"../utils/legacy-props\";\n\nexport type SelectionMode = \"single\" | \"multiple\";\n\nexport type ValueType<M extends SelectionMode> = M extends \"single\"\n ? Key | null\n : readonly Key[];\n\nexport type ChangeValueType<M extends SelectionMode> = M extends \"single\"\n ? Key | null\n : Key[];\n\ntype ValidationType<M extends SelectionMode> = M extends \"single\" ? Key : Key[];\n\nexport interface SelectProps<T, M extends SelectionMode = \"single\">\n extends\n CollectionBase<T>,\n Omit<InputBase, \"isReadOnly\">,\n ValueBase<ValueType<M>, ChangeValueType<M>>,\n Validation<ValidationType<M>>,\n HelpTextProps,\n LabelableProps,\n TextInputBase,\n FocusableProps {\n /**\n * Whether single or multiple selection is enabled.\n *\n * @default 'single'\n */\n selectionMode?: M;\n /**\n * The currently selected key in the collection (controlled).\n *\n * @deprecated\n */\n selectedKey?: Key | null;\n /**\n * The initial selected key in the collection (uncontrolled).\n *\n * @deprecated\n */\n defaultSelectedKey?: Key | null;\n /**\n * Handler that is called when the selection changes.\n *\n * @deprecated\n */\n onSelectionChange?: (key: Key | null) => void;\n /** Sets the open state of the menu. */\n isOpen?: boolean;\n /** Sets the default open state of the menu. */\n defaultOpen?: boolean;\n /** Method that is called when the open state of the menu changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * Whether the Select should close when an item is selected. Defaults to true if selectionMode is\n * single, false otherwise.\n */\n shouldCloseOnSelect?: boolean;\n /** Whether the select should be allowed to be open when the collection is empty. */\n allowsEmptyCollection?: boolean;\n}\n\nexport interface SelectStateOptions<T, M extends SelectionMode = \"single\">\n extends Omit<SelectProps<T, M>, \"children\">, CollectionStateBase<T> {}\n\nexport interface SelectState<T, M extends SelectionMode = \"single\">\n extends ListState<T>, OverlayTriggerState, FormValidationState {\n /**\n * The key for the first selected item.\n *\n * @deprecated\n */\n readonly selectedKey: Key | null;\n /**\n * The default selected key.\n *\n * @deprecated\n */\n readonly defaultSelectedKey: Key | null;\n /**\n * Sets the selected key.\n *\n * @deprecated\n */\n setSelectedKey: (key: Key | null) => void;\n /** The current select value. */\n readonly value: ValueType<M>;\n /** The default select value. */\n readonly defaultValue: ValueType<M>;\n /** Sets the select value. */\n setValue: (value: Key | readonly Key[] | null) => void;\n /**\n * The value of the first selected item.\n *\n * @deprecated\n */\n readonly selectedItem: Node<T> | null;\n /** The value of the selected items. */\n readonly selectedItems: Node<T>[];\n /** Whether the select is currently focused. */\n readonly isFocused: boolean;\n /** Sets whether the select is focused. */\n setFocused: (isFocused: boolean) => void;\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy | null;\n /** Opens the menu. */\n open: (focusStrategy?: FocusStrategy | null) => void;\n /** Toggles the menu. */\n toggle: (focusStrategy?: FocusStrategy | null) => void;\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function createSelectState<\n T extends object,\n M extends SelectionMode = \"single\",\n>(props: SelectStateOptions<T, M>): SelectState<T, M> {\n const triggerState = createOverlayTriggerState(props);\n\n const [focusStrategy, setFocusStrategy] = createSignal<FocusStrategy | null>(\n null,\n { ownedWrite: true }\n );\n\n const defaultValue = createMemo(\n () =>\n props.defaultValue ??\n ((props.selectionMode ?? \"single\") === \"single\"\n ? (getLegacyDefaultSelectedKey(props) ?? null)\n : [])\n );\n\n const value = createMemo(\n () =>\n props.value ??\n ((props.selectionMode ?? \"single\") === \"single\"\n ? getLegacySelectedKey(props)\n : undefined)\n );\n\n const [controlledValue, setControlledValue] = createControlledSignal<\n Key | readonly Key[] | null\n >(\n () => value(),\n untrack(() => defaultValue()),\n (nextValue) => {\n const change = isKeyArray(nextValue) ? [...nextValue] : nextValue;\n // SAFETY: setValue normalizes the change to the active selection mode before dispatch.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n props.onChange?.(change as ChangeValueType<M>);\n }\n );\n\n // Only display the first selected item if in single selection mode but the value is an array.\n const displayValue = createMemo(() => {\n const current = controlledValue();\n\n return (props.selectionMode ?? \"single\") === \"single\" && isKeyArray(current)\n ? (current[0] ?? null)\n : current;\n });\n\n const setValue = (localValue: Key | readonly Key[] | null) => {\n if ((props.selectionMode ?? \"single\") === \"single\") {\n const key = isKeyArray(localValue) ? (localValue[0] ?? null) : localValue;\n\n setControlledValue(key);\n\n if (key !== displayValue()) {\n notifyLegacySelectionChange(props, key);\n }\n } else {\n let keys: Key[] = [];\n\n if (isKeyArray(localValue)) {\n keys = [...localValue];\n } else if (localValue !== null && localValue !== undefined) {\n keys =\n typeof localValue === \"string\" || typeof localValue === \"number\"\n ? [localValue]\n : [...localValue];\n }\n\n setControlledValue(keys);\n }\n };\n\n const validationState = createFormValidationState(\n merge(omit(props, \"value\"), {\n get value() {\n const current = displayValue();\n let validationValue: Key | Key[] | null = null;\n\n if (isKeyArray(current)) {\n validationValue = current.length === 0 ? null : [...current];\n } else {\n validationValue = current;\n }\n\n // SAFETY: displayValue follows selectionMode, which also determines the validation value type.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return validationValue as ValidationType<M> | null;\n },\n })\n );\n\n const listState = createListState(\n merge(props, {\n get allowDuplicateSelectionEvents() {\n return true;\n },\n get disallowEmptySelection() {\n return (props.selectionMode ?? \"single\") === \"single\";\n },\n get onSelectionChange() {\n return (keys: Selection) => {\n // impossible, but TS doesn't know that\n if (keys === \"all\") {\n return;\n }\n\n if ((props.selectionMode ?? \"single\") === \"single\") {\n const key = keys.values().next().value ?? null;\n setValue(key);\n } else {\n setValue([...keys]);\n }\n\n if (\n props.shouldCloseOnSelect ??\n (props.selectionMode ?? \"single\") === \"single\"\n ) {\n triggerState.close();\n }\n\n validationState.commitValidation();\n };\n },\n get selectedKeys() {\n return convertValue(displayValue());\n },\n get selectionMode() {\n return props.selectionMode ?? \"single\";\n },\n })\n );\n\n const selectedKey = createMemo(\n () => listState.selectionManager.firstSelectedKey\n );\n\n const selectedItems = createMemo(() =>\n [...listState.selectionManager.selectedKeys].flatMap((key) => {\n const item = listState.collection.getItem(key);\n\n return item === null || item === undefined ? [] : [item];\n })\n );\n\n const [isFocused, setFocused] = createSignal(false, { ownedWrite: true });\n\n const initialValue = untrack(() => displayValue());\n\n return merge(validationState, listState, triggerState, {\n get defaultSelectedKey() {\n return (\n getLegacyDefaultSelectedKey(props) ??\n (props.selectionMode === \"single\" &&\n (typeof initialValue === \"string\" || typeof initialValue === \"number\")\n ? initialValue\n : null)\n );\n },\n get defaultValue() {\n // SAFETY: defaults use the same active mode as the state returned to the caller.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return (defaultValue() ?? initialValue) as ValueType<M>;\n },\n get focusStrategy() {\n return focusStrategy();\n },\n get isFocused() {\n return isFocused();\n },\n open(localFocusStrategy: FocusStrategy | null = null) {\n // Don't open if the collection is empty.\n if (\n listState.collection.size !== 0 ||\n props.allowsEmptyCollection === true\n ) {\n setFocusStrategy(localFocusStrategy);\n triggerState.open();\n }\n },\n get selectedItem() {\n return selectedItems()[0] ?? null;\n },\n get selectedItems() {\n return selectedItems();\n },\n get selectedKey() {\n return selectedKey();\n },\n get setFocused() {\n return setFocused;\n },\n get setSelectedKey() {\n return setValue;\n },\n get setValue() {\n return setValue;\n },\n toggle(localFocusStrategy: FocusStrategy | null = null) {\n if (\n listState.collection.size !== 0 ||\n props.allowsEmptyCollection === true\n ) {\n setFocusStrategy(localFocusStrategy);\n triggerState.toggle();\n }\n },\n get value() {\n // SAFETY: single mode exposes a key; multiple mode exposes the normalized key array.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return displayValue() as ValueType<M>;\n },\n });\n}\n\nfunction convertValue(value: Key | readonly Key[] | null | undefined) {\n if (value === undefined) {\n return value;\n }\n\n if (value === null) {\n return [];\n }\n\n return isKeyArray(value) ? value : [value];\n}\n\nfunction isKeyArray(\n value: Key | readonly Key[] | null | undefined\n): value is readonly Key[] {\n return Array.isArray(value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkKA,SAAgB,kBAGd,OAAoD;CACpD,MAAM,eAAe,0BAA0B,KAAK;CAEpD,MAAM,CAAC,eAAe,oBAAoB,aACxC,MACA,EAAE,YAAY,KAAK,CACrB;CAEA,MAAM,eAAe,iBAEjB,MAAM,kBACJ,MAAM,iBAAiB,cAAc,WAClC,4BAA4B,KAAK,KAAK,OACvC,CAAC,EACT;CAEA,MAAM,QAAQ,iBAEV,MAAM,WACJ,MAAM,iBAAiB,cAAc,WACnC,qBAAqB,KAAK,IAC1B,KAAA,EACR;CAEA,MAAM,CAAC,iBAAiB,sBAAsB,6BAGtC,MAAM,GACZ,cAAc,aAAa,CAAC,IAC3B,cAAc;EACb,MAAM,SAAS,WAAW,SAAS,IAAI,CAAC,GAAG,SAAS,IAAI;EAGxD,MAAM,WAAW,MAA4B;CAC/C,CACF;CAGA,MAAM,eAAe,iBAAiB;EACpC,MAAM,UAAU,gBAAgB;EAEhC,QAAQ,MAAM,iBAAiB,cAAc,YAAY,WAAW,OAAO,IACtE,QAAQ,MAAM,OACf;CACN,CAAC;CAED,MAAM,YAAY,eAA4C;EAC5D,KAAK,MAAM,iBAAiB,cAAc,UAAU;GAClD,MAAM,MAAM,WAAW,UAAU,IAAK,WAAW,MAAM,OAAQ;GAE/D,mBAAmB,GAAG;GAEtB,IAAI,QAAQ,aAAa,GACvB,4BAA4B,OAAO,GAAG;EAE1C,OAAO;GACL,IAAI,OAAc,CAAC;GAEnB,IAAI,WAAW,UAAU,GACvB,OAAO,CAAC,GAAG,UAAU;QAChB,IAAI,eAAe,QAAQ,eAAe,KAAA,GAC/C,OACE,OAAO,eAAe,YAAY,OAAO,eAAe,WACpD,CAAC,UAAU,IACX,CAAC,GAAG,UAAU;GAGtB,mBAAmB,IAAI;EACzB;CACF;CAEA,MAAM,kBAAkB,0BACtB,MAAM,KAAK,OAAO,OAAO,GAAG,EAC1B,IAAI,QAAQ;EACV,MAAM,UAAU,aAAa;EAC7B,IAAI,kBAAsC;EAE1C,IAAI,WAAW,OAAO,GACpB,kBAAkB,QAAQ,WAAW,IAAI,OAAO,CAAC,GAAG,OAAO;OAE3D,kBAAkB;EAKpB,OAAO;CACT,EACF,CAAC,CACH;CAEA,MAAM,YAAY,gBAChB,MAAM,OAAO;EACX,IAAI,gCAAgC;GAClC,OAAO;EACT;EACA,IAAI,yBAAyB;GAC3B,QAAQ,MAAM,iBAAiB,cAAc;EAC/C;EACA,IAAI,oBAAoB;GACtB,QAAQ,SAAoB;IAE1B,IAAI,SAAS,OACX;IAGF,KAAK,MAAM,iBAAiB,cAAc,UAAU;KAClD,MAAM,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS;KAC1C,SAAS,GAAG;IACd,OACE,SAAS,CAAC,GAAG,IAAI,CAAC;IAGpB,IACE,MAAM,wBACL,MAAM,iBAAiB,cAAc,UAEtC,aAAa,MAAM;IAGrB,gBAAgB,iBAAiB;GACnC;EACF;EACA,IAAI,eAAe;GACjB,OAAO,aAAa,aAAa,CAAC;EACpC;EACA,IAAI,gBAAgB;GAClB,OAAO,MAAM,iBAAiB;EAChC;CACF,CAAC,CACH;CAEA,MAAM,cAAc,iBACZ,UAAU,iBAAiB,gBACnC;CAEA,MAAM,gBAAgB,iBACpB,CAAC,GAAG,UAAU,iBAAiB,YAAY,CAAC,CAAC,SAAS,QAAQ;EAC5D,MAAM,OAAO,UAAU,WAAW,QAAQ,GAAG;EAE7C,OAAO,SAAS,QAAQ,SAAS,KAAA,IAAY,CAAC,IAAI,CAAC,IAAI;CACzD,CAAC,CACH;CAEA,MAAM,CAAC,WAAW,cAAc,aAAa,OAAO,EAAE,YAAY,KAAK,CAAC;CAExE,MAAM,eAAe,cAAc,aAAa,CAAC;CAEjD,OAAO,MAAM,iBAAiB,WAAW,cAAc;EACrD,IAAI,qBAAqB;GACvB,OACE,4BAA4B,KAAK,MAChC,MAAM,kBAAkB,aACxB,OAAO,iBAAiB,YAAY,OAAO,iBAAiB,YACzD,eACA;EAER;EACA,IAAI,eAAe;GAGjB,OAAQ,aAAa,KAAK;EAC5B;EACA,IAAI,gBAAgB;GAClB,OAAO,cAAc;EACvB;EACA,IAAI,YAAY;GACd,OAAO,UAAU;EACnB;EACA,KAAK,qBAA2C,MAAM;GAEpD,IACE,UAAU,WAAW,SAAS,KAC9B,MAAM,0BAA0B,MAChC;IACA,iBAAiB,kBAAkB;IACnC,aAAa,KAAK;GACpB;EACF;EACA,IAAI,eAAe;GACjB,OAAO,cAAc,CAAC,CAAC,MAAM;EAC/B;EACA,IAAI,gBAAgB;GAClB,OAAO,cAAc;EACvB;EACA,IAAI,cAAc;GAChB,OAAO,YAAY;EACrB;EACA,IAAI,aAAa;GACf,OAAO;EACT;EACA,IAAI,iBAAiB;GACnB,OAAO;EACT;EACA,IAAI,WAAW;GACb,OAAO;EACT;EACA,OAAO,qBAA2C,MAAM;GACtD,IACE,UAAU,WAAW,SAAS,KAC9B,MAAM,0BAA0B,MAChC;IACA,iBAAiB,kBAAkB;IACnC,aAAa,OAAO;GACtB;EACF;EACA,IAAI,QAAQ;GAGV,OAAO,aAAa;EACtB;CACF,CAAC;AACH;AAEA,SAAS,aAAa,OAAgD;CACpE,IAAI,UAAU,KAAA,GACZ,OAAO;CAGT,IAAI,UAAU,MACZ,OAAO,CAAC;CAGV,OAAO,WAAW,KAAK,IAAI,QAAQ,CAAC,KAAK;AAC3C;AAEA,SAAS,WACP,OACyB;CACzB,OAAO,MAAM,QAAQ,KAAK;AAC5B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/selection/useMultipleSelectionState.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted reactive state, getters, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { MultipleSelectionState } from "./types.js";
|
|
18
|
+
import { DisabledBehavior, MultipleSelection, SelectionBehavior } from "@solid2-aria/types-shared";
|
|
19
|
+
export interface MultipleSelectionStateProps extends MultipleSelection {
|
|
20
|
+
/**
|
|
21
|
+
* How multiple selection should behave in the collection.
|
|
22
|
+
*
|
|
23
|
+
* @default 'toggle'
|
|
24
|
+
*/
|
|
25
|
+
selectionBehavior?: SelectionBehavior;
|
|
26
|
+
/** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */
|
|
27
|
+
allowDuplicateSelectionEvents?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether `disabledKeys` applies to all interactions, or only selection.
|
|
30
|
+
*
|
|
31
|
+
* @default 'all'
|
|
32
|
+
*/
|
|
33
|
+
disabledBehavior?: DisabledBehavior;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Manages state for multiple selection and focus in a collection.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createMultipleSelectionState(props: MultipleSelectionStateProps): MultipleSelectionState;
|
|
39
|
+
//# sourceMappingURL=create-multiple-selection-state.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/selection/useMultipleSelectionState.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted reactive state, getters, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { createControlledSignal } from "../utils/create-controlled-signal.js";
|
|
18
|
+
import { Selection } from "./selection.js";
|
|
19
|
+
import { createMemo, createRenderEffect, createSignal, untrack } from "solid-js";
|
|
20
|
+
// src/selection/create-multiple-selection-state.ts
|
|
21
|
+
function equalSets(setA, setB) {
|
|
22
|
+
if (setA === "all" || setB === "all") return setA === setB;
|
|
23
|
+
if (setA.size !== setB.size) return false;
|
|
24
|
+
for (const item of setA) if (!setB.has(item)) return false;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Manages state for multiple selection and focus in a collection.
|
|
29
|
+
*/
|
|
30
|
+
function createMultipleSelectionState(props) {
|
|
31
|
+
const selectionMode = createMemo(() => props.selectionMode ?? "none");
|
|
32
|
+
const disallowEmptySelection = createMemo(() => props.disallowEmptySelection ?? false);
|
|
33
|
+
const allowDuplicateSelectionEvents = createMemo(() => props.allowDuplicateSelectionEvents);
|
|
34
|
+
const selectionBehaviorProp = createMemo(() => props.selectionBehavior ?? "toggle");
|
|
35
|
+
const disabledBehavior = createMemo(() => props.disabledBehavior ?? "all");
|
|
36
|
+
let isFocusedRef = false;
|
|
37
|
+
const [focused, setFocused] = createSignal(false, { ownedWrite: true });
|
|
38
|
+
let focusedKeyRef = null;
|
|
39
|
+
let childFocusStrategyRef = null;
|
|
40
|
+
const [focusedKey, setFocusedKey] = createSignal(0, { ownedWrite: true });
|
|
41
|
+
const selectedKeysProp = createMemo(() => convertSelection(props.selectedKeys));
|
|
42
|
+
const defaultSelectedKeys = createMemo(() => convertSelection(props.defaultSelectedKeys) ?? new Selection());
|
|
43
|
+
const [selectedKeys, setSelectedKeys] = createControlledSignal(() => selectedKeysProp(), untrack(() => {
|
|
44
|
+
return defaultSelectedKeys();
|
|
45
|
+
}), (value) => {
|
|
46
|
+
props.onSelectionChange?.(value);
|
|
47
|
+
});
|
|
48
|
+
const disabledKeysProp = createMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set());
|
|
49
|
+
const [selectionBehavior, setSelectionBehavior] = createSignal(untrack(() => selectionBehaviorProp()), { ownedWrite: true });
|
|
50
|
+
createRenderEffect(() => ({
|
|
51
|
+
behavior: selectionBehavior(),
|
|
52
|
+
keys: selectedKeys(),
|
|
53
|
+
preferredBehavior: selectionBehaviorProp()
|
|
54
|
+
}), ({ behavior, keys, preferredBehavior }) => {
|
|
55
|
+
if (preferredBehavior === "replace" && behavior === "toggle" && typeof keys === "object" && keys.size === 0) setSelectionBehavior("replace");
|
|
56
|
+
});
|
|
57
|
+
createRenderEffect(selectionBehaviorProp, setSelectionBehavior, { defer: true });
|
|
58
|
+
return {
|
|
59
|
+
get childFocusStrategy() {
|
|
60
|
+
focusedKey();
|
|
61
|
+
return childFocusStrategyRef;
|
|
62
|
+
},
|
|
63
|
+
get disabledBehavior() {
|
|
64
|
+
return disabledBehavior();
|
|
65
|
+
},
|
|
66
|
+
get disabledKeys() {
|
|
67
|
+
return disabledKeysProp();
|
|
68
|
+
},
|
|
69
|
+
get disallowEmptySelection() {
|
|
70
|
+
return disallowEmptySelection();
|
|
71
|
+
},
|
|
72
|
+
get focusedKey() {
|
|
73
|
+
focusedKey();
|
|
74
|
+
return focusedKeyRef;
|
|
75
|
+
},
|
|
76
|
+
get isFocused() {
|
|
77
|
+
focused();
|
|
78
|
+
return isFocusedRef;
|
|
79
|
+
},
|
|
80
|
+
get selectedKeys() {
|
|
81
|
+
return selectedKeys() ?? new Selection();
|
|
82
|
+
},
|
|
83
|
+
get selectionBehavior() {
|
|
84
|
+
return selectionBehavior();
|
|
85
|
+
},
|
|
86
|
+
get selectionMode() {
|
|
87
|
+
return selectionMode();
|
|
88
|
+
},
|
|
89
|
+
setFocused(f) {
|
|
90
|
+
isFocusedRef = f;
|
|
91
|
+
setFocused(f);
|
|
92
|
+
},
|
|
93
|
+
setFocusedKey(k, childFocusStrategy = "first") {
|
|
94
|
+
focusedKeyRef = k;
|
|
95
|
+
childFocusStrategyRef = childFocusStrategy;
|
|
96
|
+
setFocusedKey((previous) => previous + 1);
|
|
97
|
+
},
|
|
98
|
+
setSelectedKeys(keys) {
|
|
99
|
+
const currentAllowDuplicateSelectionEvents = allowDuplicateSelectionEvents();
|
|
100
|
+
const currentSelectedKeys = selectedKeys();
|
|
101
|
+
if (currentAllowDuplicateSelectionEvents === true || !equalSets(keys, currentSelectedKeys)) setSelectedKeys(keys);
|
|
102
|
+
},
|
|
103
|
+
setSelectionBehavior: (value) => {
|
|
104
|
+
setSelectionBehavior(value);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function convertSelection(selection, defaultValue) {
|
|
109
|
+
if (selection === null || selection === void 0) return defaultValue;
|
|
110
|
+
return selection === "all" ? "all" : new Selection(selection);
|
|
111
|
+
}
|
|
112
|
+
export { createMultipleSelectionState };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=create-multiple-selection-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-multiple-selection-state.js","names":[],"sources":["../../src/selection/create-multiple-selection-state.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/selection/useMultipleSelectionState.ts.\n * Modified for Solid Aria: adapted reactive state, getters, imports, and APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type {\n DisabledBehavior,\n FocusStrategy,\n Key,\n MultipleSelection,\n SelectionBehavior,\n} from \"@solid2-aria/types-shared\";\nimport {\n createMemo,\n createSignal,\n createRenderEffect,\n untrack,\n} from \"solid-js\";\n\nimport { createControlledSignal } from \"../utils/create-controlled-signal\";\nimport { Selection } from \"./selection\";\nimport type { MultipleSelectionState } from \"./types\";\n\nfunction equalSets(setA: \"all\" | Set<Key>, setB: \"all\" | Set<Key>) {\n if (setA === \"all\" || setB === \"all\") {\n return setA === setB;\n }\n\n if (setA.size !== setB.size) {\n return false;\n }\n\n for (const item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport interface MultipleSelectionStateProps extends MultipleSelection {\n /**\n * How multiple selection should behave in the collection.\n *\n * @default 'toggle'\n */\n selectionBehavior?: SelectionBehavior;\n /** Whether onSelectionChange should fire even if the new set of keys is the same as the last. */\n allowDuplicateSelectionEvents?: boolean;\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n *\n * @default 'all'\n */\n disabledBehavior?: DisabledBehavior;\n}\n\n/**\n * Manages state for multiple selection and focus in a collection.\n */\nexport function createMultipleSelectionState(\n props: MultipleSelectionStateProps\n): MultipleSelectionState {\n const selectionMode = createMemo(() => props.selectionMode ?? \"none\");\n\n const disallowEmptySelection = createMemo(\n () => props.disallowEmptySelection ?? false\n );\n\n const allowDuplicateSelectionEvents = createMemo(\n () => props.allowDuplicateSelectionEvents\n );\n\n const selectionBehaviorProp = createMemo(\n () => props.selectionBehavior ?? \"toggle\"\n );\n\n const disabledBehavior = createMemo(() => props.disabledBehavior ?? \"all\");\n // We want synchronous updates to `isFocused` and `focusedKey` after their setters are called.\n // But we also need to trigger a react re-render. So, we have both a ref (sync) and state (async).\n let isFocusedRef = false;\n\n const [focused, setFocused] = createSignal(false, { ownedWrite: true });\n\n let focusedKeyRef: Key | null = null;\n let childFocusStrategyRef: FocusStrategy | null = null;\n\n const [focusedKey, setFocusedKey] = createSignal<number>(0, {\n ownedWrite: true,\n });\n\n const selectedKeysProp = createMemo(() =>\n convertSelection(props.selectedKeys)\n );\n\n const defaultSelectedKeys = createMemo(\n () => convertSelection(props.defaultSelectedKeys) ?? new Selection()\n );\n\n const [selectedKeys, setSelectedKeys] = createControlledSignal(\n () => selectedKeysProp(),\n untrack(() => {\n const currentDefaultSelectedKeys = defaultSelectedKeys();\n\n return currentDefaultSelectedKeys;\n }),\n (value) => {\n props.onSelectionChange?.(value);\n }\n );\n\n const disabledKeysProp = createMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n );\n\n const [selectionBehavior, setSelectionBehavior] = createSignal(\n untrack(() => selectionBehaviorProp()),\n { ownedWrite: true }\n );\n\n createRenderEffect(\n () => ({\n behavior: selectionBehavior(),\n keys: selectedKeys(),\n preferredBehavior: selectionBehaviorProp(),\n }),\n ({ behavior, keys, preferredBehavior }) => {\n if (\n preferredBehavior === \"replace\" &&\n behavior === \"toggle\" &&\n typeof keys === \"object\" &&\n keys.size === 0\n ) {\n setSelectionBehavior(\"replace\");\n }\n }\n );\n createRenderEffect(selectionBehaviorProp, setSelectionBehavior, {\n defer: true,\n });\n\n return {\n get childFocusStrategy() {\n focusedKey();\n\n return childFocusStrategyRef;\n },\n get disabledBehavior() {\n return disabledBehavior();\n },\n get disabledKeys() {\n return disabledKeysProp();\n },\n get disallowEmptySelection() {\n return disallowEmptySelection();\n },\n get focusedKey() {\n focusedKey();\n\n return focusedKeyRef;\n },\n get isFocused() {\n focused();\n\n return isFocusedRef;\n },\n get selectedKeys() {\n return selectedKeys() ?? new Selection();\n },\n get selectionBehavior() {\n return selectionBehavior();\n },\n get selectionMode() {\n return selectionMode();\n },\n setFocused(f) {\n isFocusedRef = f;\n setFocused(f);\n },\n setFocusedKey(k, childFocusStrategy = \"first\") {\n focusedKeyRef = k;\n childFocusStrategyRef = childFocusStrategy;\n setFocusedKey((previous) => previous + 1);\n },\n setSelectedKeys(keys) {\n const currentAllowDuplicateSelectionEvents =\n allowDuplicateSelectionEvents();\n\n const currentSelectedKeys = selectedKeys();\n\n if (\n currentAllowDuplicateSelectionEvents === true ||\n !equalSets(keys, currentSelectedKeys)\n ) {\n setSelectedKeys(keys);\n }\n },\n setSelectionBehavior: (value) => {\n setSelectionBehavior(value);\n },\n };\n}\n\nfunction convertSelection(\n selection: \"all\" | Iterable<Key> | null | undefined,\n defaultValue?: Selection\n): \"all\" | Set<Key> | undefined {\n if (selection === null || selection === undefined) {\n return defaultValue;\n }\n\n return selection === \"all\" ? \"all\" : new Selection(selection);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
* Derived from Adobe React Spectrum: packages/react-stately/src/selection/SelectionManager.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted reactive state, getters, imports, and APIs for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
import { MultipleSelectionManager, MultipleSelectionState } from "./types.js";
|
|
18
|
+
import { Collection, DisabledBehavior, FocusStrategy, Key, LayoutDelegate, LongPressEvent, Node, PressEvent, Selection, SelectionBehavior, SelectionMode } from "@solid2-aria/types-shared";
|
|
19
|
+
interface SelectionManagerOptions {
|
|
20
|
+
allowsCellSelection?: boolean;
|
|
21
|
+
layoutDelegate?: LayoutDelegate;
|
|
22
|
+
fullCollection?: Collection<Node<unknown>>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* An interface for reading and updating multiple selection state.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SelectionManager implements MultipleSelectionManager {
|
|
28
|
+
collection: Collection<Node<unknown>>;
|
|
29
|
+
private readonly state;
|
|
30
|
+
private readonly allowsCellSelection;
|
|
31
|
+
private _isSelectAll;
|
|
32
|
+
private readonly layoutDelegate;
|
|
33
|
+
private readonly fullCollection;
|
|
34
|
+
constructor(collection: Collection<Node<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions);
|
|
35
|
+
/**
|
|
36
|
+
* The type of selection that is allowed in the collection.
|
|
37
|
+
*/
|
|
38
|
+
get selectionMode(): SelectionMode;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the collection allows empty selection.
|
|
41
|
+
*/
|
|
42
|
+
get disallowEmptySelection(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The selection behavior for the collection.
|
|
45
|
+
*/
|
|
46
|
+
get selectionBehavior(): SelectionBehavior;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the selection behavior for the collection.
|
|
49
|
+
*/
|
|
50
|
+
setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the collection is currently focused.
|
|
53
|
+
*/
|
|
54
|
+
get isFocused(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Sets whether the collection is focused.
|
|
57
|
+
*/
|
|
58
|
+
setFocused(isFocused: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* The current focused key in the collection.
|
|
61
|
+
*/
|
|
62
|
+
get focusedKey(): Key | null;
|
|
63
|
+
/** Whether the first or last child of the focused key should receive focus. */
|
|
64
|
+
get childFocusStrategy(): FocusStrategy | null;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the focused key.
|
|
67
|
+
*/
|
|
68
|
+
setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;
|
|
69
|
+
/**
|
|
70
|
+
* The currently selected keys in the collection.
|
|
71
|
+
*/
|
|
72
|
+
get selectedKeys(): Set<Key>;
|
|
73
|
+
/**
|
|
74
|
+
* The raw selection value for the collection.
|
|
75
|
+
* Either 'all' for select all, or a set of keys.
|
|
76
|
+
*/
|
|
77
|
+
get rawSelection(): Selection;
|
|
78
|
+
/**
|
|
79
|
+
* Returns whether a key is selected.
|
|
80
|
+
*/
|
|
81
|
+
isSelected(key: Key): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the selection is empty.
|
|
84
|
+
*/
|
|
85
|
+
get isEmpty(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether all items in the collection are selected.
|
|
88
|
+
*/
|
|
89
|
+
get isSelectAll(): boolean;
|
|
90
|
+
get firstSelectedKey(): Key | null;
|
|
91
|
+
get lastSelectedKey(): Key | null;
|
|
92
|
+
get disabledKeys(): Set<Key>;
|
|
93
|
+
get disabledBehavior(): DisabledBehavior;
|
|
94
|
+
/**
|
|
95
|
+
* Extends the selection to the given key.
|
|
96
|
+
*/
|
|
97
|
+
extendSelection(toKey: Key): void;
|
|
98
|
+
private getKeyRange;
|
|
99
|
+
private getKeyRangeInternal;
|
|
100
|
+
private getKey;
|
|
101
|
+
/**
|
|
102
|
+
* Toggles whether the given key is selected.
|
|
103
|
+
*/
|
|
104
|
+
toggleSelection(key: Key): void;
|
|
105
|
+
/**
|
|
106
|
+
* Replaces the selection with only the given key.
|
|
107
|
+
*/
|
|
108
|
+
replaceSelection(key: Key): void;
|
|
109
|
+
/**
|
|
110
|
+
* Replaces the selection with the given keys.
|
|
111
|
+
*/
|
|
112
|
+
setSelectedKeys(keys: Iterable<Key>): void;
|
|
113
|
+
private getSelectAllKeys;
|
|
114
|
+
/**
|
|
115
|
+
* Selects all items in the collection.
|
|
116
|
+
*/
|
|
117
|
+
selectAll(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Removes all keys from the selection.
|
|
120
|
+
*/
|
|
121
|
+
clearSelection(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Toggles between select all and an empty selection.
|
|
124
|
+
*/
|
|
125
|
+
toggleSelectAll(): void;
|
|
126
|
+
select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void;
|
|
127
|
+
/**
|
|
128
|
+
* Returns whether the current selection is equal to the given selection.
|
|
129
|
+
*/
|
|
130
|
+
isSelectionEqual(selection: Set<Key>): boolean;
|
|
131
|
+
canSelectItem(key: Key): boolean;
|
|
132
|
+
private canSelectItemIn;
|
|
133
|
+
isDisabled(key: Key): boolean;
|
|
134
|
+
isLink(key: Key): boolean;
|
|
135
|
+
getItemProps(key: Key): Node<unknown>["props"];
|
|
136
|
+
withCollection(collection: Collection<Node<unknown>>): SelectionManager;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=selection-manager.d.ts.map
|