@proyecto-viviana/solidaria-components 0.5.0 → 0.7.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/README.md +4 -7
- package/dist/ActionBar.d.ts +2 -10
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +95 -59
- package/dist/ActionBar.js.map +1 -1
- package/dist/ActionBar.jsx +42 -15
- package/dist/ActionBar.jsx.map +1 -1
- package/dist/ActionGroup.d.ts +1 -12
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +66 -44
- package/dist/ActionGroup.js.map +1 -1
- package/dist/ActionGroup.jsx +25 -10
- package/dist/ActionGroup.jsx.map +1 -1
- package/dist/Alert.d.ts +4 -1
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +25 -17
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.jsx +9 -5
- package/dist/Alert.jsx.map +1 -1
- package/dist/Autocomplete.d.ts +2 -9
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +18 -5
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +20 -7
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts +2 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +71 -51
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +25 -12
- package/dist/Breadcrumbs.jsx.map +1 -1
- package/dist/Button.d.ts +1 -7
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +125 -72
- package/dist/Button.js.map +1 -1
- package/dist/Button.jsx +105 -43
- package/dist/Button.jsx.map +1 -1
- package/dist/Calendar.d.ts +1 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +297 -221
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +52 -32
- package/dist/Calendar.jsx.map +1 -1
- package/dist/CalendarPicker.d.ts +1 -10
- package/dist/CalendarPicker.d.ts.map +1 -1
- package/dist/CalendarPicker.js +12 -0
- package/dist/CalendarPicker.js.map +1 -1
- package/dist/CalendarPicker.jsx +12 -0
- package/dist/CalendarPicker.jsx.map +1 -1
- package/dist/Checkbox.d.ts +2 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +332 -270
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.jsx +70 -77
- package/dist/Checkbox.jsx.map +1 -1
- package/dist/Collection.d.ts +33 -7
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +128 -74
- package/dist/Collection.js.map +1 -1
- package/dist/Collection.jsx +46 -7
- package/dist/Collection.jsx.map +1 -1
- package/dist/Color.d.ts +15 -20
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +572 -334
- package/dist/Color.js.map +1 -1
- package/dist/Color.jsx +205 -85
- package/dist/Color.jsx.map +1 -1
- package/dist/ColorEditor.d.ts +3 -1
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ColorEditor.js +147 -124
- package/dist/ColorEditor.js.map +1 -1
- package/dist/ColorEditor.jsx +4 -1
- package/dist/ColorEditor.jsx.map +1 -1
- package/dist/ComboBox.d.ts +31 -10
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +539 -274
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +213 -70
- package/dist/ComboBox.jsx.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +1 -7
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.js +102 -72
- package/dist/ContextualHelpTrigger.js.map +1 -1
- package/dist/ContextualHelpTrigger.jsx +36 -16
- package/dist/ContextualHelpTrigger.jsx.map +1 -1
- package/dist/DateField.d.ts +2 -7
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +0 -2
- package/dist/DateField.jsx +0 -2
- package/dist/DateField2.js +194 -179
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +58 -55
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +7 -7
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.jsx +2 -2
- package/dist/DatePicker2.js +357 -435
- package/dist/DatePicker2.js.map +1 -1
- package/dist/DatePicker2.jsx +109 -178
- package/dist/DatePicker2.jsx.map +1 -1
- package/dist/DateRangePickerContext.d.ts +7 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Dialog.d.ts +4 -9
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +168 -101
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.jsx +75 -27
- package/dist/Dialog.jsx.map +1 -1
- package/dist/Disclosure.d.ts +1 -9
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +121 -79
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +32 -19
- package/dist/Disclosure.jsx.map +1 -1
- package/dist/DragAndDrop.d.ts +9 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +37 -22
- package/dist/DragAndDrop.js.map +1 -1
- package/dist/DragAndDrop.jsx +20 -4
- package/dist/DragAndDrop.jsx.map +1 -1
- package/dist/DragPreview.d.ts +1 -1
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +1 -7
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +74 -40
- package/dist/DropZone.js.map +1 -1
- package/dist/DropZone.jsx +24 -8
- package/dist/DropZone.jsx.map +1 -1
- package/dist/ElementTag.d.ts +9 -20
- package/dist/ElementTag.d.ts.map +1 -1
- package/dist/ElementTag.js +8 -210
- package/dist/ElementTag.js.map +1 -1
- package/dist/ElementTag.jsx +8 -57
- package/dist/ElementTag.jsx.map +1 -1
- package/dist/FieldError.d.ts +8 -7
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FieldError.js +33 -13
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldError.jsx +20 -5
- package/dist/FieldError.jsx.map +1 -1
- package/dist/FileTrigger.d.ts +1 -7
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/FileTrigger.js +30 -12
- package/dist/FileTrigger.js.map +1 -1
- package/dist/FileTrigger.jsx +15 -2
- package/dist/FileTrigger.jsx.map +1 -1
- package/dist/Focusable.d.ts +2 -8
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Focusable.js +23 -6
- package/dist/Focusable.js.map +1 -1
- package/dist/Focusable.jsx +22 -5
- package/dist/Focusable.jsx.map +1 -1
- package/dist/Form.d.ts +9 -8
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +66 -43
- package/dist/Form.js.map +1 -1
- package/dist/Form.jsx +36 -16
- package/dist/Form.jsx.map +1 -1
- package/dist/GridList.d.ts +5 -10
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +372 -243
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +177 -99
- package/dist/GridList.jsx.map +1 -1
- package/dist/HiddenDateInput.d.ts +1 -7
- package/dist/HiddenDateInput.d.ts.map +1 -1
- package/dist/Icon.d.ts +4 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +41 -37
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.jsx +7 -3
- package/dist/Icon.jsx.map +1 -1
- package/dist/Keyboard.d.ts +1 -7
- package/dist/Keyboard.d.ts.map +1 -1
- package/dist/Keyboard.js +24 -11
- package/dist/Keyboard.js.map +1 -1
- package/dist/Keyboard.jsx +15 -2
- package/dist/Keyboard.jsx.map +1 -1
- package/dist/Label.d.ts +20 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +60 -0
- package/dist/Label.js.map +1 -0
- package/dist/Label.jsx +47 -0
- package/dist/Label.jsx.map +1 -0
- package/dist/Landmark.d.ts +4 -1
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Landmark.js +10 -4
- package/dist/Landmark.js.map +1 -1
- package/dist/Landmark.jsx +5 -1
- package/dist/Landmark.jsx.map +1 -1
- package/dist/Link.d.ts +2 -7
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +56 -36
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +52 -10
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +17 -13
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +647 -348
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +339 -236
- package/dist/ListBox.jsx.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +3 -0
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +39 -30
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +547 -368
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.jsx +328 -230
- package/dist/Menu.jsx.map +1 -1
- package/dist/Meter.d.ts +6 -13
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +55 -18
- package/dist/Meter.js.map +1 -1
- package/dist/Meter.jsx +33 -8
- package/dist/Meter.jsx.map +1 -1
- package/dist/Modal.d.ts +1 -7
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +104 -56
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +68 -38
- package/dist/Modal.jsx.map +1 -1
- package/dist/NumberField.d.ts +4 -7
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +243 -124
- package/dist/NumberField.js.map +1 -1
- package/dist/NumberField.jsx +115 -26
- package/dist/NumberField.jsx.map +1 -1
- package/dist/Popover.d.ts +15 -7
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +370 -181
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +215 -82
- package/dist/Popover.jsx.map +1 -1
- package/dist/Pressable.d.ts +2 -8
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/Pressable.js +23 -6
- package/dist/Pressable.js.map +1 -1
- package/dist/Pressable.jsx +22 -5
- package/dist/Pressable.jsx.map +1 -1
- package/dist/PreviewTrigger.d.ts +24 -0
- package/dist/PreviewTrigger.d.ts.map +1 -0
- package/dist/PreviewTrigger.js +128 -0
- package/dist/PreviewTrigger.js.map +1 -0
- package/dist/PreviewTrigger.jsx +117 -0
- package/dist/PreviewTrigger.jsx.map +1 -0
- package/dist/ProgressBar.d.ts +1 -7
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +34 -14
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressBar.jsx +17 -3
- package/dist/ProgressBar.jsx.map +1 -1
- package/dist/RadioGroup.d.ts +2 -7
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +388 -269
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.jsx +110 -99
- package/dist/RadioGroup.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts +3 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +271 -202
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +56 -37
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/RouterProvider.d.ts +3 -9
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/RouterProvider.js +15 -14
- package/dist/RouterProvider.js.map +1 -1
- package/dist/RouterProvider.jsx +14 -13
- package/dist/RouterProvider.jsx.map +1 -1
- package/dist/SearchField.d.ts +4 -7
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +191 -164
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +69 -62
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +5 -10
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +565 -359
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +281 -161
- package/dist/Select.jsx.map +1 -1
- package/dist/SelectionIndicator.d.ts +1 -4
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +29 -13
- package/dist/SelectionIndicator.js.map +1 -1
- package/dist/SelectionIndicator.jsx +18 -4
- package/dist/SelectionIndicator.jsx.map +1 -1
- package/dist/Separator.d.ts +1 -7
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +22 -6
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +16 -3
- package/dist/Separator.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts +1 -10
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +68 -40
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx +49 -25
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/Slider.d.ts +2 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +155 -97
- package/dist/Slider.js.map +1 -1
- package/dist/Slider.jsx +25 -12
- package/dist/Slider.jsx.map +1 -1
- package/dist/StepList.d.ts +1 -7
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +112 -68
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +58 -20
- package/dist/StepList.jsx.map +1 -1
- package/dist/Switch.d.ts +2 -9
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +164 -114
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.jsx +26 -13
- package/dist/Switch.jsx.map +1 -1
- package/dist/Table.d.ts +2 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +689 -592
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +317 -237
- package/dist/Table.jsx.map +1 -1
- package/dist/Tabs.d.ts +2 -7
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +278 -293
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +68 -66
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +4 -11
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +153 -115
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +37 -24
- package/dist/TagGroup.jsx.map +1 -1
- package/dist/Text.d.ts +3 -3
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +24 -7
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +17 -5
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.d.ts +3 -16
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +104 -129
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +76 -102
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +2 -15
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +86 -102
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +32 -49
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Toast.d.ts +10 -13
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +209 -108
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.jsx +127 -22
- package/dist/Toast.jsx.map +1 -1
- package/dist/ToggleButton.d.ts +1 -7
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +57 -35
- package/dist/ToggleButton.js.map +1 -1
- package/dist/ToggleButton.jsx +26 -12
- package/dist/ToggleButton.jsx.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +1 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +59 -44
- package/dist/ToggleButtonGroup.js.map +1 -1
- package/dist/ToggleButtonGroup.jsx +25 -12
- package/dist/ToggleButtonGroup.jsx.map +1 -1
- package/dist/TokenField.d.ts +52 -0
- package/dist/TokenField.d.ts.map +1 -0
- package/dist/TokenField.js +301 -0
- package/dist/TokenField.js.map +1 -0
- package/dist/TokenField.jsx +197 -0
- package/dist/TokenField.jsx.map +1 -0
- package/dist/Toolbar.d.ts +2 -7
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +35 -16
- package/dist/Toolbar.js.map +1 -1
- package/dist/Toolbar.jsx +15 -2
- package/dist/Toolbar.jsx.map +1 -1
- package/dist/Tooltip.d.ts +2 -7
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +105 -68
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.jsx +60 -36
- package/dist/Tooltip.jsx.map +1 -1
- package/dist/Tree.d.ts +8 -11
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +486 -339
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +155 -107
- package/dist/Tree.jsx.map +1 -1
- package/dist/Virtualizer.d.ts +39 -9
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -2
- package/dist/Virtualizer.jsx +2 -2
- package/dist/Virtualizer2.js +491 -136
- package/dist/Virtualizer2.js.map +1 -1
- package/dist/Virtualizer2.jsx +455 -122
- package/dist/Virtualizer2.jsx.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +55 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +4 -3
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +18 -11
- package/dist/VisuallyHidden.js.map +1 -1
- package/dist/VisuallyHidden.jsx +15 -9
- package/dist/VisuallyHidden.jsx.map +1 -1
- package/dist/contexts.d.ts +25 -0
- package/dist/contexts.d.ts.map +1 -1
- package/dist/contexts.js +3 -0
- package/dist/contexts.js.map +1 -1
- package/dist/contexts.jsx +3 -0
- package/dist/contexts.jsx.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.jsx +14 -11
- package/dist/intl/index.d.ts +16 -0
- package/dist/intl/index.d.ts.map +1 -0
- package/dist/intl.js +212 -0
- package/dist/intl.js.map +1 -0
- package/dist/intl.jsx +212 -0
- package/dist/intl.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +4 -2
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop2.js +39 -21
- package/dist/useDragAndDrop2.js.map +1 -1
- package/dist/useDragAndDrop2.jsx +39 -21
- package/dist/useDragAndDrop2.jsx.map +1 -1
- package/dist/utils.d.ts +28 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +96 -24
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +81 -24
- package/dist/utils.jsx.map +1 -1
- package/dist/virtualizer/Layout.d.ts +9 -0
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/dist/virtualizer/Layout.js +23 -2
- package/dist/virtualizer/Layout.js.map +1 -1
- package/dist/virtualizer/Layout.jsx +23 -2
- package/dist/virtualizer/Layout.jsx.map +1 -1
- package/package.json +29 -10
- package/src/ActionBar.tsx +50 -24
- package/src/ActionGroup.tsx +31 -19
- package/src/Alert.tsx +10 -4
- package/src/Autocomplete.tsx +24 -15
- package/src/Breadcrumbs.tsx +32 -16
- package/src/Button.tsx +182 -67
- package/src/Calendar.tsx +65 -47
- package/src/CalendarPicker.tsx +16 -1
- package/src/Checkbox.tsx +84 -116
- package/src/Collection.tsx +84 -3
- package/src/Color.tsx +282 -104
- package/src/ColorEditor.tsx +5 -1
- package/src/ComboBox.tsx +384 -109
- package/src/ContextualHelpTrigger.tsx +47 -41
- package/src/DateField.tsx +74 -106
- package/src/DatePicker.tsx +156 -352
- package/src/DateRangePickerContext.tsx +8 -0
- package/src/Dialog.tsx +105 -38
- package/src/Disclosure.tsx +29 -19
- package/src/DragAndDrop.tsx +43 -8
- package/src/DragPreview.tsx +20 -1
- package/src/DropZone.tsx +32 -18
- package/src/ElementTag.tsx +14 -104
- package/src/FieldError.tsx +39 -7
- package/src/FileTrigger.tsx +18 -3
- package/src/Focusable.tsx +27 -6
- package/src/Form.tsx +57 -11
- package/src/GridList.tsx +233 -141
- package/src/HiddenDateInput.tsx +19 -3
- package/src/Icon.tsx +8 -2
- package/src/Keyboard.tsx +18 -2
- package/src/Label.tsx +77 -0
- package/src/Landmark.tsx +6 -1
- package/src/Link.tsx +65 -19
- package/src/ListBox.tsx +645 -468
- package/src/ListDropTargetDelegate.ts +4 -0
- package/src/Menu.tsx +512 -349
- package/src/Meter.tsx +42 -8
- package/src/Modal.tsx +85 -42
- package/src/NumberField.tsx +161 -48
- package/src/Popover.tsx +424 -148
- package/src/Pressable.tsx +27 -6
- package/src/PreviewTrigger.tsx +171 -0
- package/src/ProgressBar.tsx +25 -3
- package/src/RadioGroup.tsx +230 -161
- package/src/RangeCalendar.tsx +75 -63
- package/src/RouterProvider.tsx +24 -14
- package/src/SearchField.tsx +118 -121
- package/src/Select.tsx +454 -274
- package/src/SelectionIndicator.tsx +21 -3
- package/src/Separator.tsx +17 -1
- package/src/SharedElementTransition.tsx +115 -97
- package/src/Slider.tsx +35 -17
- package/src/StepList.tsx +71 -32
- package/src/Switch.tsx +45 -29
- package/src/Table.tsx +446 -380
- package/src/Tabs.tsx +132 -155
- package/src/TagGroup.tsx +53 -40
- package/src/Text.tsx +23 -6
- package/src/TextField.tsx +118 -159
- package/src/TimeField.tsx +34 -95
- package/src/Toast.tsx +141 -67
- package/src/ToggleButton.tsx +33 -15
- package/src/ToggleButtonGroup.tsx +27 -9
- package/src/TokenField.tsx +379 -0
- package/src/Toolbar.tsx +19 -9
- package/src/Tooltip.tsx +126 -84
- package/src/Tree.tsx +233 -173
- package/src/Virtualizer.tsx +400 -138
- package/src/VirtualizerLayouts.ts +211 -26
- package/src/VisuallyHidden.tsx +22 -8
- package/src/contexts.ts +13 -0
- package/src/index.ts +32 -11
- package/src/intl/ar-AE.json +6 -0
- package/src/intl/bg-BG.json +6 -0
- package/src/intl/cs-CZ.json +6 -0
- package/src/intl/da-DK.json +6 -0
- package/src/intl/de-DE.json +6 -0
- package/src/intl/el-GR.json +6 -0
- package/src/intl/en-US.json +6 -0
- package/src/intl/es-ES.json +6 -0
- package/src/intl/et-EE.json +6 -0
- package/src/intl/fi-FI.json +6 -0
- package/src/intl/fr-FR.json +6 -0
- package/src/intl/he-IL.json +6 -0
- package/src/intl/hr-HR.json +6 -0
- package/src/intl/hu-HU.json +6 -0
- package/src/intl/index.ts +125 -0
- package/src/intl/it-IT.json +6 -0
- package/src/intl/ja-JP.json +6 -0
- package/src/intl/ko-KR.json +6 -0
- package/src/intl/lt-LT.json +6 -0
- package/src/intl/lv-LV.json +6 -0
- package/src/intl/nb-NO.json +6 -0
- package/src/intl/nl-NL.json +6 -0
- package/src/intl/pl-PL.json +6 -0
- package/src/intl/pt-BR.json +6 -0
- package/src/intl/pt-PT.json +6 -0
- package/src/intl/ro-RO.json +6 -0
- package/src/intl/ru-RU.json +6 -0
- package/src/intl/sk-SK.json +6 -0
- package/src/intl/sl-SI.json +6 -0
- package/src/intl/sr-SP.json +6 -0
- package/src/intl/sv-SE.json +6 -0
- package/src/intl/tr-TR.json +6 -0
- package/src/intl/uk-UA.json +6 -0
- package/src/intl/zh-CN.json +6 -0
- package/src/intl/zh-TW.json +6 -0
- package/src/useDragAndDrop.ts +30 -32
- package/src/utils.tsx +124 -68
- package/src/virtualizer/Layout.ts +29 -0
package/dist/ListBox.js
CHANGED
|
@@ -1,23 +1,44 @@
|
|
|
1
|
-
|
|
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
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ListBox.tsx
|
|
13
|
+
import { DEFAULT_SLOT, OptionContent, Provider, dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
|
|
14
|
+
import { TextContext } from "./Text.js";
|
|
2
15
|
import { SharedElementTransition } from "./SharedElementTransition.js";
|
|
3
16
|
import { SelectionIndicatorContext } from "./SelectionIndicator.js";
|
|
4
|
-
import { CollectionRendererContext, Group, Header, Section, flattenCollectionEntries, isCollectionSection, useCollectionRenderer } from "./Collection.js";
|
|
5
|
-
import {
|
|
17
|
+
import { CollectionRendererContext, Group, Header, Section, flattenCollectionEntries, isCollectionSection, useCollectionRenderer, useCollectionRoot } from "./Collection.js";
|
|
18
|
+
import { i as VirtualizerItem, o as useVirtualizerContext, t as PersistedVirtualItem } from "./Virtualizer2.js";
|
|
6
19
|
import { useAutocompleteCollection } from "./Autocomplete.js";
|
|
7
|
-
import { DropIndicatorContext, getNormalizedDropTargetKey, mergePersistedKeysIntoVirtualRange, useDndPersistedKeys, useRenderDropIndicator } from "./DragAndDrop.js";
|
|
8
|
-
import { className, createComponent, effect, getNextElement, getNextMarker, insert, memo,
|
|
9
|
-
import { For, Show, createContext, createEffect, createMemo,
|
|
10
|
-
import { CLEAR_FOCUS_EVENT, FOCUS_EVENT,
|
|
20
|
+
import { DropIndicatorContext, getNormalizedDropTargetKey, indexesOutsideRange, mergePersistedKeysIntoVirtualRange, useDndPersistedKeys, useRenderDropIndicator } from "./DragAndDrop.js";
|
|
21
|
+
import { className, createComponent, effect, getNextElement, getNextMarker, insert, memo, readShallow, ref, runHydrationEvents, scope, setAttribute, spread, style, template } from "@solidjs/web";
|
|
22
|
+
import { For, Show, createContext, createEffect, createMemo, createRenderEffect, createSignal, createTrackedEffect, untrack, useContext } from "solid-js";
|
|
23
|
+
import { CLEAR_FOCUS_EVENT, FOCUS_EVENT, createFocusRing, createListBox, createOption, createScrollIntoViewOnFocus, createStringFormatter, dndIntlStrings, mergeProps as mergeProps$1, moveVirtualFocus, useLocale } from "@proyecto-viviana/solidaria";
|
|
24
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
11
25
|
import { createFilteredListState, createListState } from "@proyecto-viviana/solid-stately";
|
|
12
26
|
//#region src/ListBox.tsx
|
|
13
27
|
/**
|
|
14
28
|
* ListBox component for solidaria-components
|
|
15
29
|
*
|
|
16
30
|
* A pre-wired headless listbox that combines state + aria hooks.
|
|
17
|
-
*
|
|
31
|
+
* Solid adaptation of the pinned ListBox component.
|
|
18
32
|
*/
|
|
19
|
-
var _tmpl$ =
|
|
20
|
-
|
|
33
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
34
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span>`);
|
|
35
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div><!$><!/><!$><!/>`);
|
|
36
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div role=option data-empty-state style=display:contents>`);
|
|
37
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<div role=group>`);
|
|
38
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div role=presentation data-section-wrapper>`);
|
|
39
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div inert style=position:relative;width:0;height:0;overflow:hidden><div data-testid=loadMoreSentinel style=position:absolute;height:1px;width:1px>`);
|
|
40
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div role=option tabindex=-1 data-loading>`);
|
|
41
|
+
function assignRef$1(ref, el) {
|
|
21
42
|
if (!ref) return;
|
|
22
43
|
if (typeof ref === "function") ref(el);
|
|
23
44
|
else ref.current = el;
|
|
@@ -25,12 +46,141 @@ function assignRef(ref, el) {
|
|
|
25
46
|
const ListBoxContext = createContext(null);
|
|
26
47
|
const ListBoxStateContext = createContext(null);
|
|
27
48
|
const ListStateContext = ListBoxStateContext;
|
|
49
|
+
function dropIndicatorLabel(target, collection, format) {
|
|
50
|
+
const getText = (key) => {
|
|
51
|
+
if (key == null) return "";
|
|
52
|
+
return collection.getTextValue(key) ?? collection.getItem(key)?.textValue ?? "";
|
|
53
|
+
};
|
|
54
|
+
if (target.dropPosition === "on") return format("dropOnItem", { itemText: getText(target.key) });
|
|
55
|
+
let before;
|
|
56
|
+
let after;
|
|
57
|
+
if (target.dropPosition === "before") {
|
|
58
|
+
const prevKey = collection.getKeyBefore(target.key);
|
|
59
|
+
const prevNode = prevKey != null ? collection.getItem(prevKey) : null;
|
|
60
|
+
before = prevNode?.type === "item" ? prevNode.key : null;
|
|
61
|
+
} else before = target.key;
|
|
62
|
+
if (target.dropPosition === "after") {
|
|
63
|
+
const nextKey = collection.getKeyAfter(target.key);
|
|
64
|
+
const nextNode = nextKey != null ? collection.getItem(nextKey) : null;
|
|
65
|
+
after = nextNode?.type === "item" ? nextNode.key : null;
|
|
66
|
+
} else after = target.key;
|
|
67
|
+
if (before != null && after != null) return format("insertBetween", {
|
|
68
|
+
beforeItemText: getText(before),
|
|
69
|
+
afterItemText: getText(after)
|
|
70
|
+
});
|
|
71
|
+
if (before != null) return format("insertAfter", { itemText: getText(before) });
|
|
72
|
+
if (after != null) return format("insertBefore", { itemText: getText(after) });
|
|
73
|
+
return "";
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* RAC `ListBox.tsx:662-717` `ListBoxDropIndicatorWrapper` — a stable module-level
|
|
77
|
+
* component so Solid does not remount (and unregister) the indicator on every
|
|
78
|
+
* parent ListBox re-render. `useDropIndicator` owns register + focus
|
|
79
|
+
* (`useDroppableItem.ts:49-88`).
|
|
80
|
+
*/
|
|
81
|
+
function ListBoxDropIndicatorWrapper(props) {
|
|
82
|
+
const listContext = useContext(ListBoxContext);
|
|
83
|
+
const listState = useContext(ListBoxStateContext);
|
|
84
|
+
const [el, setEl] = createSignal(null);
|
|
85
|
+
const dndFormatter = createStringFormatter(dndIntlStrings);
|
|
86
|
+
const dropState = listContext?.dropState;
|
|
87
|
+
const indicator = listContext?.dragAndDropHooks?.useDropIndicator?.({ target: props.target }, dropState, el);
|
|
88
|
+
return createComponent(Show, {
|
|
89
|
+
get when() {
|
|
90
|
+
return indicator && !indicator.isHidden;
|
|
91
|
+
},
|
|
92
|
+
get children() {
|
|
93
|
+
var _el$ = getNextElement(_tmpl$);
|
|
94
|
+
ref(() => {
|
|
95
|
+
return setEl;
|
|
96
|
+
}, _el$);
|
|
97
|
+
spread(_el$, [() => {
|
|
98
|
+
return indicator?.dropIndicatorProps;
|
|
99
|
+
}, {
|
|
100
|
+
role: "option",
|
|
101
|
+
class: "solidaria-DropIndicator",
|
|
102
|
+
get "aria-label"() {
|
|
103
|
+
return listState ? dropIndicatorLabel(props.target, listState.collection(), (key, args) => dndFormatter().format(key, args)) : void 0;
|
|
104
|
+
},
|
|
105
|
+
get "data-drop-target"() {
|
|
106
|
+
return dataAttr(indicator?.isDropTarget);
|
|
107
|
+
}
|
|
108
|
+
}], false);
|
|
109
|
+
runHydrationEvents();
|
|
110
|
+
return _el$;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Owns only the collection item. Drop-indicator siblings live in their own
|
|
116
|
+
* components so their tracking cannot remount this node.
|
|
117
|
+
*
|
|
118
|
+
* Comparison hyperscript children (`hc` thunks) are one-shot: if the fragment
|
|
119
|
+
* insert that owns the option also tracks indicator `Show`, the effect
|
|
120
|
+
* re-runs, disposes the option, and Chromium maps focus to
|
|
121
|
+
* `listbox:Permissions`. RAC `ListBoxItem` stays mounted while Collection
|
|
122
|
+
* inserts indicator siblings (`react-aria-components/src/ListBox.tsx`).
|
|
123
|
+
*/
|
|
124
|
+
function ListBoxRenderedItem(props) {
|
|
125
|
+
return untrack(() => {
|
|
126
|
+
const rendered = props.renderItem(props.item);
|
|
127
|
+
return typeof rendered === "function" ? rendered() : rendered;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function ListBoxDropIndicatorSlot(props) {
|
|
131
|
+
const itemIndex = () => typeof props.itemIndex === "function" ? props.itemIndex() : props.itemIndex;
|
|
132
|
+
return memo(() => {
|
|
133
|
+
return props.renderDropIndicator?.(itemIndex(), props.position);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Stable per-item row so drop-indicator mount does not remount the option.
|
|
138
|
+
*/
|
|
139
|
+
function ListBoxItemWithDropIndicators(props) {
|
|
140
|
+
const isLast = () => typeof props.isLastInLevel === "function" ? props.isLastInLevel() : props.isLastInLevel;
|
|
141
|
+
return [
|
|
142
|
+
createComponent(ListBoxDropIndicatorSlot, {
|
|
143
|
+
get itemIndex() {
|
|
144
|
+
return props.itemIndex;
|
|
145
|
+
},
|
|
146
|
+
position: "before",
|
|
147
|
+
get renderDropIndicator() {
|
|
148
|
+
return props.renderDropIndicator;
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
createComponent(ListBoxRenderedItem, {
|
|
152
|
+
get item() {
|
|
153
|
+
return props.item;
|
|
154
|
+
},
|
|
155
|
+
get renderItem() {
|
|
156
|
+
return props.renderItem;
|
|
157
|
+
}
|
|
158
|
+
}),
|
|
159
|
+
createComponent(Show, {
|
|
160
|
+
get when() {
|
|
161
|
+
return isLast();
|
|
162
|
+
},
|
|
163
|
+
get children() {
|
|
164
|
+
return createComponent(ListBoxDropIndicatorSlot, {
|
|
165
|
+
get itemIndex() {
|
|
166
|
+
return props.itemIndex;
|
|
167
|
+
},
|
|
168
|
+
position: "after",
|
|
169
|
+
get renderDropIndicator() {
|
|
170
|
+
return props.renderDropIndicator;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
];
|
|
176
|
+
}
|
|
28
177
|
/**
|
|
29
178
|
* A listbox displays a list of options and allows a user to select one or more of them.
|
|
30
179
|
*/
|
|
31
180
|
function ListBox(props) {
|
|
32
|
-
const contextSlotProps = useContext(ListBoxContext)?.slots?.[props.slot
|
|
33
|
-
const
|
|
181
|
+
const contextSlotProps = useContext(ListBoxContext)?.slots?.[typeof props.slot === "string" ? props.slot : "default"];
|
|
182
|
+
const mergedListBoxProps = contextSlotProps ? mergeProps$1(contextSlotProps, props) : props;
|
|
183
|
+
const [local, stateProps, ariaProps] = splitProps(mergedListBoxProps, [
|
|
34
184
|
"children",
|
|
35
185
|
"class",
|
|
36
186
|
"style",
|
|
@@ -105,8 +255,7 @@ function ListBox(props) {
|
|
|
105
255
|
};
|
|
106
256
|
const locale = useLocale();
|
|
107
257
|
const parentCollectionRenderer = useCollectionRenderer();
|
|
108
|
-
const listBoxAria = createListBox({
|
|
109
|
-
...ariaProps,
|
|
258
|
+
const listBoxAria = createListBox(mergeProps$1(ariaProps, {
|
|
110
259
|
get isVirtualized() {
|
|
111
260
|
return parentCollectionRenderer?.isVirtualized ?? ariaProps.isVirtualized;
|
|
112
261
|
},
|
|
@@ -131,10 +280,10 @@ function ListBox(props) {
|
|
|
131
280
|
get direction() {
|
|
132
281
|
return locale().direction;
|
|
133
282
|
}
|
|
134
|
-
}, state, () => listRef());
|
|
283
|
+
}), state, () => listRef());
|
|
135
284
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
136
285
|
const renderValues = createMemo(() => ({
|
|
137
|
-
isFocused:
|
|
286
|
+
isFocused: isFocused(),
|
|
138
287
|
isFocusVisible: isFocusVisible(),
|
|
139
288
|
isDisabled: resolveDisabled(),
|
|
140
289
|
isEmpty: state.collection().size === 0
|
|
@@ -167,7 +316,8 @@ function ListBox(props) {
|
|
|
167
316
|
});
|
|
168
317
|
if (autocompleteCtx) {
|
|
169
318
|
let shouldVirtualFocusFirst = false;
|
|
170
|
-
|
|
319
|
+
createTrackedEffect(() => {
|
|
320
|
+
const _s2Cleanups = [];
|
|
171
321
|
const list = listRef();
|
|
172
322
|
if (!list) return;
|
|
173
323
|
const onFocusEvent = (e) => {
|
|
@@ -183,12 +333,15 @@ function ListBox(props) {
|
|
|
183
333
|
};
|
|
184
334
|
list.addEventListener(FOCUS_EVENT, onFocusEvent);
|
|
185
335
|
list.addEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);
|
|
186
|
-
|
|
336
|
+
_s2Cleanups.push(() => {
|
|
187
337
|
list.removeEventListener(FOCUS_EVENT, onFocusEvent);
|
|
188
338
|
list.removeEventListener(CLEAR_FOCUS_EVENT, onClearFocusEvent);
|
|
189
339
|
});
|
|
340
|
+
return () => {
|
|
341
|
+
for (const c of _s2Cleanups) c();
|
|
342
|
+
};
|
|
190
343
|
});
|
|
191
|
-
createEffect(
|
|
344
|
+
createEffect(() => [state.collection().getFirstKey?.() ?? null, state.collection().size], ([firstKey, size]) => {
|
|
192
345
|
if (!shouldVirtualFocusFirst) return;
|
|
193
346
|
if (firstKey == null) {
|
|
194
347
|
const list = listRef();
|
|
@@ -198,18 +351,27 @@ function ListBox(props) {
|
|
|
198
351
|
state.setFocusedKey(firstKey);
|
|
199
352
|
shouldVirtualFocusFirst = false;
|
|
200
353
|
}
|
|
201
|
-
}, { defer: true })
|
|
354
|
+
}, { defer: true });
|
|
202
355
|
createEffect(() => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
356
|
+
return {
|
|
357
|
+
key: state.focusedKey(),
|
|
358
|
+
list: listRef(),
|
|
359
|
+
focused: state.isFocused()
|
|
360
|
+
};
|
|
361
|
+
}, ({ key, list, focused }) => {
|
|
362
|
+
if (!list || !focused) return;
|
|
206
363
|
if (key == null) return;
|
|
207
364
|
const el = list.ownerDocument.getElementById(String(key));
|
|
208
365
|
if (el) moveVirtualFocus(el);
|
|
209
366
|
});
|
|
210
367
|
}
|
|
211
|
-
const isEmpty = () => stateProps.items.length === 0;
|
|
212
368
|
const getItemNodes = createMemo(() => Array.from(state.collection()).filter((node) => node.type === "item"));
|
|
369
|
+
const collectionItems = createMemo(() => getItemNodes().map((node) => node.value));
|
|
370
|
+
const isEmpty = () => state.collection().size === 0;
|
|
371
|
+
const isLastDropItem = (itemIndex) => {
|
|
372
|
+
const i = typeof itemIndex === "function" ? itemIndex() : itemIndex;
|
|
373
|
+
return getItemNodes().length > 0 && i === getItemNodes().length - 1;
|
|
374
|
+
};
|
|
213
375
|
const getDropTargetByIndex = (index, position) => {
|
|
214
376
|
const node = getItemNodes()[index];
|
|
215
377
|
if (!node) return null;
|
|
@@ -223,37 +385,27 @@ function ListBox(props) {
|
|
|
223
385
|
const hooks = local.dragAndDropHooks;
|
|
224
386
|
return Boolean(hooks?.useDroppableCollectionState && hooks.useDroppableCollection && (hooks.dropTargetDelegate || parentCollectionRenderer?.dropTargetDelegate || hooks.ListDropTargetDelegate));
|
|
225
387
|
});
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
388
|
+
const dropStateValue = hasDroppableDnd() ? local.dragAndDropHooks?.useDroppableCollectionState?.({ get collection() {
|
|
389
|
+
return state.collection();
|
|
390
|
+
} }) : void 0;
|
|
391
|
+
const dropState = () => dropStateValue;
|
|
392
|
+
const dragStateValue = createMemo(() => {
|
|
231
393
|
const hooks = local.dragAndDropHooks;
|
|
232
394
|
return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);
|
|
233
|
-
})
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (!hooks?.useDraggableCollection || !activeDragState) return;
|
|
243
|
-
hooks.useDraggableCollection({}, activeDragState, () => listRef());
|
|
244
|
-
});
|
|
245
|
-
const droppableCollection = createMemo(() => {
|
|
395
|
+
})() ? local.dragAndDropHooks?.useDraggableCollectionState?.({
|
|
396
|
+
items: flatItems(),
|
|
397
|
+
collection: state.collection(),
|
|
398
|
+
selectedKeys: state.selectionManager.selectedKeys,
|
|
399
|
+
isSelected: (key) => state.selectionManager.isSelected(key)
|
|
400
|
+
}) : void 0;
|
|
401
|
+
const dragState = () => dragStateValue;
|
|
402
|
+
if (local.dragAndDropHooks?.useDraggableCollection && dragStateValue) local.dragAndDropHooks.useDraggableCollection({}, dragStateValue, () => listRef());
|
|
403
|
+
const droppableCollectionValue = (() => {
|
|
246
404
|
if (!hasDroppableDnd()) return void 0;
|
|
247
405
|
const hooks = local.dragAndDropHooks;
|
|
248
|
-
const activeDropState =
|
|
406
|
+
const activeDropState = dropStateValue;
|
|
249
407
|
if (!hooks?.useDroppableCollection || !activeDropState) return void 0;
|
|
250
|
-
const resolveDirection = () =>
|
|
251
|
-
const el = listRef();
|
|
252
|
-
if (el && typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
253
|
-
if (window.getComputedStyle(el).direction === "rtl") return "rtl";
|
|
254
|
-
}
|
|
255
|
-
return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
|
|
256
|
-
};
|
|
408
|
+
const resolveDirection = () => locale().direction;
|
|
257
409
|
const dropTargetDelegate = hooks.dropTargetDelegate ?? parentCollectionRenderer?.dropTargetDelegate ?? (hooks.ListDropTargetDelegate ? new hooks.ListDropTargetDelegate(() => state.collection(), () => listRef(), {
|
|
258
410
|
layout: "stack",
|
|
259
411
|
orientation: "vertical",
|
|
@@ -270,12 +422,18 @@ function ListBox(props) {
|
|
|
270
422
|
getKeyPageBelow: (key) => state.collection().getKeyAfter(key),
|
|
271
423
|
getKeyPageAbove: (key) => state.collection().getKeyBefore(key)
|
|
272
424
|
},
|
|
273
|
-
|
|
274
|
-
|
|
425
|
+
get collection() {
|
|
426
|
+
return state.collection();
|
|
427
|
+
},
|
|
428
|
+
get selectedKeys() {
|
|
429
|
+
return state.selectionManager.selectedKeys;
|
|
430
|
+
},
|
|
275
431
|
setSelectedKeys: (keys) => state.selectionManager.setSelectedKeys(keys),
|
|
276
|
-
setFocusedKey: (key) => state.setFocusedKey(key)
|
|
432
|
+
setFocusedKey: (key) => state.setFocusedKey(key),
|
|
433
|
+
setFocused: (isFocused) => state.setFocused(isFocused)
|
|
277
434
|
}, activeDropState, () => listRef());
|
|
278
|
-
});
|
|
435
|
+
})();
|
|
436
|
+
const droppableCollection = () => droppableCollectionValue;
|
|
279
437
|
const isRootDropTarget = createMemo(() => {
|
|
280
438
|
return Boolean(dropState()?.target?.type === "root");
|
|
281
439
|
});
|
|
@@ -285,115 +443,32 @@ function ListBox(props) {
|
|
|
285
443
|
if (!target || target.type !== "item") return void 0;
|
|
286
444
|
return dndRenderDropIndicator()?.(target);
|
|
287
445
|
};
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const dropIndicatorTargetsEqual = (a, b) => !!a && a.type === "item" && a.key === b.key && a.dropPosition === b.dropPosition;
|
|
291
|
-
const dropIndicatorLabel = (target) => {
|
|
292
|
-
const collection = state.collection();
|
|
293
|
-
const getText = (key) => {
|
|
294
|
-
if (key == null) return "";
|
|
295
|
-
return collection.getTextValue(key) ?? collection.getItem(key)?.textValue ?? "";
|
|
296
|
-
};
|
|
297
|
-
if (target.dropPosition === "on") return dndFormatter().format("dropOnItem", { itemText: getText(target.key) });
|
|
298
|
-
let before;
|
|
299
|
-
let after;
|
|
300
|
-
if (target.dropPosition === "before") {
|
|
301
|
-
const prevKey = collection.getKeyBefore(target.key);
|
|
302
|
-
const prevNode = prevKey != null ? collection.getItem(prevKey) : null;
|
|
303
|
-
before = prevNode?.type === "item" ? prevNode.key : null;
|
|
304
|
-
} else before = target.key;
|
|
305
|
-
if (target.dropPosition === "after") {
|
|
306
|
-
const nextKey = collection.getKeyAfter(target.key);
|
|
307
|
-
const nextNode = nextKey != null ? collection.getItem(nextKey) : null;
|
|
308
|
-
after = nextNode?.type === "item" ? nextNode.key : null;
|
|
309
|
-
} else after = target.key;
|
|
310
|
-
if (before != null && after != null) return dndFormatter().format("insertBetween", {
|
|
311
|
-
beforeItemText: getText(before),
|
|
312
|
-
afterItemText: getText(after)
|
|
313
|
-
});
|
|
314
|
-
if (before != null) return dndFormatter().format("insertAfter", { itemText: getText(before) });
|
|
315
|
-
if (after != null) return dndFormatter().format("insertBefore", { itemText: getText(after) });
|
|
316
|
-
return "";
|
|
317
|
-
};
|
|
318
|
-
const wrapDropTypes = (types) => ({ has: (type) => {
|
|
319
|
-
if (typeof type === "string") return types.has(type);
|
|
320
|
-
if (Array.isArray(type)) return type.some((t) => typeof t === "string" && types.has(t));
|
|
321
|
-
return false;
|
|
322
|
-
} });
|
|
323
|
-
const ListBoxDropIndicator = (props) => {
|
|
324
|
-
const [indicatorRef, setIndicatorRef] = createSignal(null);
|
|
325
|
-
const isDropTarget = createMemo(() => dropIndicatorTargetsEqual(dropState()?.target, props.target));
|
|
326
|
-
const ariaHidden = createMemo(() => !dragSession() ? "true" : isDropTarget() ? void 0 : "true");
|
|
327
|
-
const isHidden = createMemo(() => !isDropTarget() && !!ariaHidden());
|
|
328
|
-
createEffect(() => {
|
|
329
|
-
const el = indicatorRef();
|
|
330
|
-
if (!el) return;
|
|
331
|
-
onCleanup(registerDropItem({
|
|
332
|
-
element: el,
|
|
333
|
-
target: props.target,
|
|
334
|
-
getDropOperation: (types, allowedOperations) => {
|
|
335
|
-
const st = dropState();
|
|
336
|
-
if (!st) return "cancel";
|
|
337
|
-
const isInternal = getGlobalDraggingCollectionRef() === listRef();
|
|
338
|
-
return st.getDropOperation(props.target, wrapDropTypes(types), allowedOperations, isInternal, getGlobalDraggingKeys());
|
|
339
|
-
}
|
|
340
|
-
}));
|
|
341
|
-
if (dragSession() && isDropTarget()) requestAnimationFrame(() => {
|
|
342
|
-
if (dragSession() && isDropTarget() && indicatorRef() === el) el.focus();
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
return createComponent(Show, {
|
|
346
|
-
get when() {
|
|
347
|
-
return !isHidden();
|
|
348
|
-
},
|
|
349
|
-
get children() {
|
|
350
|
-
var _el$ = getNextElement(_tmpl$);
|
|
351
|
-
use((el) => {
|
|
352
|
-
setIndicatorRef(el);
|
|
353
|
-
onCleanup(() => setIndicatorRef(null));
|
|
354
|
-
}, _el$);
|
|
355
|
-
effect((_p$) => {
|
|
356
|
-
var _v$ = dndFormatter().format("dropIndicator"), _v$2 = dropIndicatorLabel(props.target), _v$3 = ariaHidden(), _v$4 = isDropTarget() || void 0;
|
|
357
|
-
_v$ !== _p$.e && setAttribute(_el$, "aria-roledescription", _p$.e = _v$);
|
|
358
|
-
_v$2 !== _p$.t && setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
359
|
-
_v$3 !== _p$.a && setAttribute(_el$, "aria-hidden", _p$.a = _v$3);
|
|
360
|
-
_v$4 !== _p$.o && setAttribute(_el$, "data-drop-target", _p$.o = _v$4);
|
|
361
|
-
return _p$;
|
|
362
|
-
}, {
|
|
363
|
-
e: void 0,
|
|
364
|
-
t: void 0,
|
|
365
|
-
a: void 0,
|
|
366
|
-
o: void 0
|
|
367
|
-
});
|
|
368
|
-
return _el$;
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
|
-
const dropIndicatorContextValue = { render: (p) => createComponent(ListBoxDropIndicator, { get target() {
|
|
373
|
-
return p.target;
|
|
374
|
-
} }) };
|
|
446
|
+
const renderItemDropIndicator = (index, position) => dndDropIndicator(index, position) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position);
|
|
447
|
+
const dropIndicatorContextValue = { render: (p) => createComponent(ListBoxDropIndicatorWrapper, p) };
|
|
375
448
|
const virtualizer = useVirtualizerContext();
|
|
376
449
|
const persistedKeys = useDndPersistedKeys({ focusedKey: state.focusedKey }, local.dragAndDropHooks, dropState(), state.collection());
|
|
377
450
|
const virtualRange = createMemo(() => {
|
|
378
451
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;
|
|
379
|
-
const
|
|
452
|
+
const itemCount = getItemNodes().length;
|
|
453
|
+
const baseRange = virtualizer.getVisibleRange(itemCount);
|
|
380
454
|
const itemNodes = getItemNodes();
|
|
381
|
-
const persistedIndexes = Array.from(persistedKeys()).map((key) => itemNodes.findIndex((node) => node.key === key)).filter((index) => index >= 0);
|
|
382
455
|
const dropTarget = dropState()?.target;
|
|
383
456
|
const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
const forceIncludeIndexes = [
|
|
387
|
-
dropTarget?.type === "item" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,
|
|
388
|
-
normalizedDropKey != null ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1,
|
|
389
|
-
dropTarget?.type === "item" ? -1 : focusedIndex
|
|
390
|
-
].filter((index) => index >= 0);
|
|
391
|
-
return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, stateProps.items.length, virtualizer, 80, {
|
|
457
|
+
const forceIncludeIndexes = [dropTarget?.type === "item" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1, normalizedDropKey != null ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1].filter((index) => index >= 0);
|
|
458
|
+
return mergePersistedKeysIntoVirtualRange(baseRange, [], itemCount, virtualizer, 80, {
|
|
392
459
|
forceIncludeIndexes,
|
|
393
460
|
forceIncludeMaxSpan: 320
|
|
394
461
|
});
|
|
395
462
|
});
|
|
396
|
-
|
|
463
|
+
const persistedOutsideIndexes = createMemo(() => {
|
|
464
|
+
const range = virtualRange();
|
|
465
|
+
if (!range) return [];
|
|
466
|
+
const itemNodes = getItemNodes();
|
|
467
|
+
const persistedIndexes = Array.from(persistedKeys()).map((key) => itemNodes.findIndex((node) => node.key === key)).filter((index) => index >= 0);
|
|
468
|
+
return indexesOutsideRange(range, persistedIndexes);
|
|
469
|
+
});
|
|
470
|
+
createTrackedEffect(() => {
|
|
471
|
+
const _s2Cleanups = [];
|
|
397
472
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;
|
|
398
473
|
const getItemNodes = () => Array.from(state.collection()).filter((node) => node.type === "item");
|
|
399
474
|
virtualizer.setDropTargetItemCountResolver(() => getItemNodes().length);
|
|
@@ -409,44 +484,52 @@ function ListBox(props) {
|
|
|
409
484
|
key: typeof node.key === "string" || typeof node.key === "number" ? node.key : void 0
|
|
410
485
|
};
|
|
411
486
|
});
|
|
412
|
-
|
|
487
|
+
_s2Cleanups.push(() => {
|
|
413
488
|
virtualizer.setDropTargetIndexResolver(void 0);
|
|
414
489
|
virtualizer.setDropTargetItemCountResolver(void 0);
|
|
415
490
|
virtualizer.setDropTargetResolver(void 0);
|
|
416
491
|
});
|
|
492
|
+
return () => {
|
|
493
|
+
for (const c of _s2Cleanups) c();
|
|
494
|
+
};
|
|
417
495
|
});
|
|
418
496
|
const visibleItems = createMemo(() => {
|
|
419
497
|
const range = virtualRange();
|
|
420
|
-
|
|
421
|
-
|
|
498
|
+
const items = collectionItems();
|
|
499
|
+
if (!range) return items;
|
|
500
|
+
return items.slice(range.start, range.end);
|
|
422
501
|
});
|
|
423
|
-
const virtualSpacerStyle = (size) => virtualizer?.orientation === "horizontal" ? { width: `${size}px` } : { height: `${size}px` };
|
|
424
502
|
const sectionedRenderEntries = createMemo(() => {
|
|
503
|
+
const values = new Set(collectionItems());
|
|
425
504
|
let globalIndex = 0;
|
|
426
|
-
|
|
427
|
-
|
|
505
|
+
const entries = [];
|
|
506
|
+
for (const entry of stateProps.items) if (isCollectionSection(entry)) {
|
|
507
|
+
const sectionItems = entry.items.filter((item) => values.has(item)).map((item) => ({
|
|
508
|
+
item,
|
|
509
|
+
index: globalIndex++
|
|
510
|
+
}));
|
|
511
|
+
if (sectionItems.length === 0) continue;
|
|
512
|
+
entries.push({
|
|
428
513
|
type: "section",
|
|
429
514
|
section: entry,
|
|
430
|
-
items:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
item: entry,
|
|
439
|
-
index: globalIndex++
|
|
440
|
-
}
|
|
441
|
-
};
|
|
515
|
+
items: sectionItems
|
|
516
|
+
});
|
|
517
|
+
} else if (values.has(entry)) entries.push({
|
|
518
|
+
type: "item",
|
|
519
|
+
item: {
|
|
520
|
+
item: entry,
|
|
521
|
+
index: globalIndex++
|
|
522
|
+
}
|
|
442
523
|
});
|
|
524
|
+
return entries;
|
|
443
525
|
});
|
|
444
526
|
const collectionRenderer = createMemo(() => ({
|
|
445
527
|
...parentCollectionRenderer,
|
|
446
528
|
renderItem: (item) => local.children(item),
|
|
447
529
|
renderDropIndicator: (index, position) => dndDropIndicator(index, position) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position)
|
|
448
530
|
}));
|
|
449
|
-
|
|
531
|
+
const CollectionRoot = useCollectionRoot();
|
|
532
|
+
return createComponent(ListBoxContext, {
|
|
450
533
|
get value() {
|
|
451
534
|
return {
|
|
452
535
|
state,
|
|
@@ -458,15 +541,15 @@ function ListBox(props) {
|
|
|
458
541
|
};
|
|
459
542
|
},
|
|
460
543
|
get children() {
|
|
461
|
-
return createComponent(ListBoxStateContext
|
|
544
|
+
return createComponent(ListBoxStateContext, {
|
|
462
545
|
value: state,
|
|
463
546
|
get children() {
|
|
464
|
-
return createComponent(CollectionRendererContext
|
|
547
|
+
return createComponent(CollectionRendererContext, {
|
|
465
548
|
get value() {
|
|
466
549
|
return collectionRenderer();
|
|
467
550
|
},
|
|
468
551
|
get children() {
|
|
469
|
-
return createComponent(DropIndicatorContext
|
|
552
|
+
return createComponent(DropIndicatorContext, {
|
|
470
553
|
value: dropIndicatorContextValue,
|
|
471
554
|
get children() {
|
|
472
555
|
return [createComponent(Show, {
|
|
@@ -475,138 +558,306 @@ function ListBox(props) {
|
|
|
475
558
|
},
|
|
476
559
|
get children() {
|
|
477
560
|
var _el$2 = getNextElement(_tmpl$2);
|
|
478
|
-
spread(_el$2,
|
|
479
|
-
insert(_el$2, () =>
|
|
561
|
+
spread(_el$2, cleanLabelProps, true);
|
|
562
|
+
insert(_el$2, () => {
|
|
563
|
+
return ariaProps.label;
|
|
564
|
+
});
|
|
480
565
|
runHydrationEvents();
|
|
481
566
|
return _el$2;
|
|
482
567
|
}
|
|
483
568
|
}), (() => {
|
|
484
|
-
var _el$3 = getNextElement(_tmpl$3)
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
569
|
+
var _el$3 = getNextElement(_tmpl$3);
|
|
570
|
+
var _el$4 = _el$3.firstChild;
|
|
571
|
+
var [_el$5, _el$6] = getNextMarker(_el$4.nextSibling);
|
|
572
|
+
var _el$7 = _el$5.nextSibling;
|
|
573
|
+
var [_el$8, _el$9] = getNextMarker(_el$7.nextSibling);
|
|
574
|
+
ref(() => {
|
|
575
|
+
return (el) => {
|
|
576
|
+
setListRef(el);
|
|
577
|
+
assignRef$1(local.ref, el);
|
|
578
|
+
autocompleteCtx?.collectionRef(el);
|
|
579
|
+
};
|
|
489
580
|
}, _el$3);
|
|
490
|
-
spread(_el$3,
|
|
491
|
-
|
|
581
|
+
spread(_el$3, [() => {
|
|
582
|
+
return mergeProps$1(domProps(), cleanListBoxProps(), cleanFocusProps(), droppableCollection()?.collectionProps ?? {});
|
|
583
|
+
}, {
|
|
584
|
+
get "class"() {
|
|
492
585
|
return renderProps.class();
|
|
493
586
|
},
|
|
494
587
|
get style() {
|
|
495
588
|
return renderProps.style();
|
|
496
589
|
},
|
|
497
|
-
get
|
|
498
|
-
return
|
|
590
|
+
get "data-focused"() {
|
|
591
|
+
return dataAttr(isFocused());
|
|
499
592
|
},
|
|
500
|
-
get
|
|
501
|
-
return isFocusVisible()
|
|
593
|
+
get "data-focus-visible"() {
|
|
594
|
+
return dataAttr(isFocusVisible());
|
|
502
595
|
},
|
|
503
|
-
get
|
|
504
|
-
return resolveDisabled()
|
|
596
|
+
get "data-disabled"() {
|
|
597
|
+
return dataAttr(resolveDisabled());
|
|
505
598
|
},
|
|
506
|
-
get
|
|
507
|
-
return isEmpty()
|
|
599
|
+
get "data-empty"() {
|
|
600
|
+
return dataAttr(isEmpty());
|
|
508
601
|
},
|
|
509
|
-
get
|
|
510
|
-
return stateProps.layout;
|
|
602
|
+
get "data-layout"() {
|
|
603
|
+
return stateProps.layout || "stack";
|
|
511
604
|
},
|
|
512
|
-
get
|
|
513
|
-
return stateProps.orientation;
|
|
605
|
+
get "data-orientation"() {
|
|
606
|
+
return stateProps.orientation || "vertical";
|
|
514
607
|
},
|
|
515
|
-
get
|
|
516
|
-
return isRootDropTarget()
|
|
608
|
+
get "data-drop-target"() {
|
|
609
|
+
return dataAttr(isRootDropTarget());
|
|
517
610
|
},
|
|
518
611
|
get slot() {
|
|
519
612
|
return local.slot;
|
|
520
613
|
}
|
|
521
|
-
}
|
|
614
|
+
}], true);
|
|
522
615
|
insert(_el$3, createComponent(SharedElementTransition, { get children() {
|
|
523
|
-
return memo(() =>
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
616
|
+
return memo(() => {
|
|
617
|
+
return !!parentCollectionRenderer?.isVirtualized;
|
|
618
|
+
})() ? [createComponent(CollectionRoot, {
|
|
619
|
+
get collection() {
|
|
620
|
+
return memo(() => {
|
|
621
|
+
return !!virtualRange();
|
|
622
|
+
})() ? collectionItems() : [];
|
|
623
|
+
},
|
|
624
|
+
scrollRef: () => listRef(),
|
|
625
|
+
get persistedKeys() {
|
|
626
|
+
return persistedKeys();
|
|
627
|
+
},
|
|
628
|
+
get children() {
|
|
629
|
+
return memo(() => {
|
|
630
|
+
return !!(isEmpty() && local.renderEmptyState);
|
|
631
|
+
})() ? null : memo(() => {
|
|
632
|
+
return !!hasSections();
|
|
633
|
+
})() ? createComponent(For, {
|
|
634
|
+
get each() {
|
|
635
|
+
return sectionedRenderEntries();
|
|
636
|
+
},
|
|
637
|
+
children: (entry) => entry.type === "section" ? (() => {
|
|
638
|
+
var _el$11 = getNextElement(_tmpl$6);
|
|
639
|
+
insert(_el$11, createComponent(Section, {
|
|
640
|
+
class: "solidaria-ListBox-section",
|
|
641
|
+
get children() {
|
|
642
|
+
return [memo(() => {
|
|
643
|
+
return memo(() => {
|
|
644
|
+
return entry.section.title != null;
|
|
645
|
+
})() && createComponent(Header, {
|
|
646
|
+
class: "solidaria-ListBox-sectionHeader",
|
|
647
|
+
get children() {
|
|
648
|
+
return entry.section.title;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}), createComponent(Group, {
|
|
652
|
+
class: "solidaria-ListBox-sectionGroup",
|
|
653
|
+
get children() {
|
|
654
|
+
var _el$12 = getNextElement(_tmpl$5);
|
|
655
|
+
insert(_el$12, createComponent(For, {
|
|
656
|
+
get each() {
|
|
657
|
+
return entry.items;
|
|
658
|
+
},
|
|
659
|
+
children: (indexedItem) => createComponent(VirtualizerItem, {
|
|
660
|
+
get index() {
|
|
661
|
+
return indexedItem.index;
|
|
662
|
+
},
|
|
663
|
+
get children() {
|
|
664
|
+
return createComponent(ListBoxItemWithDropIndicators, {
|
|
665
|
+
get item() {
|
|
666
|
+
return indexedItem.item;
|
|
667
|
+
},
|
|
668
|
+
get itemIndex() {
|
|
669
|
+
return indexedItem.index;
|
|
670
|
+
},
|
|
671
|
+
isLastInLevel: () => isLastDropItem(indexedItem.index),
|
|
672
|
+
get renderItem() {
|
|
673
|
+
return local.children;
|
|
674
|
+
},
|
|
675
|
+
renderDropIndicator: renderItemDropIndicator
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
})
|
|
679
|
+
}));
|
|
680
|
+
effect(() => entry.section["aria-label"], (_v$) => {
|
|
681
|
+
setAttribute(_el$12, "aria-label", _v$);
|
|
682
|
+
});
|
|
683
|
+
return _el$12;
|
|
684
|
+
}
|
|
685
|
+
})];
|
|
686
|
+
}
|
|
687
|
+
}));
|
|
688
|
+
return _el$11;
|
|
689
|
+
})() : createComponent(VirtualizerItem, {
|
|
690
|
+
get index() {
|
|
691
|
+
return entry.item.index;
|
|
692
|
+
},
|
|
693
|
+
get children() {
|
|
694
|
+
return createComponent(ListBoxItemWithDropIndicators, {
|
|
695
|
+
get item() {
|
|
696
|
+
return entry.item.item;
|
|
697
|
+
},
|
|
698
|
+
get itemIndex() {
|
|
699
|
+
return entry.item.index;
|
|
700
|
+
},
|
|
701
|
+
isLastInLevel: () => isLastDropItem(entry.item.index),
|
|
702
|
+
get renderItem() {
|
|
703
|
+
return local.children;
|
|
704
|
+
},
|
|
705
|
+
renderDropIndicator: renderItemDropIndicator
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
})
|
|
709
|
+
}) : [createComponent(For, {
|
|
710
|
+
get each() {
|
|
711
|
+
return visibleItems();
|
|
712
|
+
},
|
|
713
|
+
children: (item, index) => createComponent(VirtualizerItem, {
|
|
714
|
+
index: () => (virtualRange()?.start ?? 0) + index(),
|
|
715
|
+
get children() {
|
|
716
|
+
return createComponent(ListBoxItemWithDropIndicators, {
|
|
717
|
+
item,
|
|
718
|
+
itemIndex: () => (virtualRange()?.start ?? 0) + index(),
|
|
719
|
+
isLastInLevel: () => isLastDropItem((virtualRange()?.start ?? 0) + index()),
|
|
720
|
+
get renderItem() {
|
|
721
|
+
return local.children;
|
|
722
|
+
},
|
|
723
|
+
renderDropIndicator: renderItemDropIndicator
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
})
|
|
727
|
+
}), createComponent(For, {
|
|
728
|
+
get each() {
|
|
729
|
+
return persistedOutsideIndexes();
|
|
730
|
+
},
|
|
731
|
+
children: (index) => createComponent(PersistedVirtualItem, {
|
|
732
|
+
index,
|
|
733
|
+
get children() {
|
|
734
|
+
return createComponent(ListBoxItemWithDropIndicators, {
|
|
735
|
+
get item() {
|
|
736
|
+
return collectionItems()[index];
|
|
737
|
+
},
|
|
738
|
+
itemIndex: () => index,
|
|
739
|
+
isLastInLevel: () => isLastDropItem(index),
|
|
740
|
+
get renderItem() {
|
|
741
|
+
return local.children;
|
|
742
|
+
},
|
|
743
|
+
renderDropIndicator: renderItemDropIndicator
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
})
|
|
747
|
+
})];
|
|
748
|
+
}
|
|
749
|
+
}), memo(() => {
|
|
750
|
+
return memo(() => {
|
|
751
|
+
return !!(isEmpty() && local.renderEmptyState);
|
|
752
|
+
})() ? (() => {
|
|
753
|
+
var _el$13 = getNextElement(_tmpl$4);
|
|
754
|
+
insert(_el$13, scope(() => {
|
|
755
|
+
return local.renderEmptyState();
|
|
756
|
+
}));
|
|
757
|
+
return _el$13;
|
|
758
|
+
})() : null;
|
|
759
|
+
})] : memo(() => {
|
|
760
|
+
return !!(isEmpty() && local.renderEmptyState);
|
|
761
|
+
})() ? (() => {
|
|
762
|
+
var _el$10 = getNextElement(_tmpl$4);
|
|
763
|
+
insert(_el$10, scope(() => {
|
|
764
|
+
return local.renderEmptyState();
|
|
765
|
+
}));
|
|
766
|
+
return _el$10;
|
|
767
|
+
})() : memo(() => {
|
|
768
|
+
return !!hasSections();
|
|
769
|
+
})() ? createComponent(For, {
|
|
528
770
|
get each() {
|
|
529
771
|
return sectionedRenderEntries();
|
|
530
772
|
},
|
|
531
773
|
children: (entry) => entry.type === "section" ? (() => {
|
|
532
|
-
var _el$
|
|
533
|
-
insert(_el$
|
|
534
|
-
|
|
774
|
+
var _el$14 = getNextElement(_tmpl$6);
|
|
775
|
+
insert(_el$14, createComponent(Section, {
|
|
776
|
+
class: "solidaria-ListBox-section",
|
|
535
777
|
get children() {
|
|
536
|
-
return [memo(() =>
|
|
537
|
-
|
|
778
|
+
return [memo(() => {
|
|
779
|
+
return memo(() => {
|
|
780
|
+
return entry.section.title != null;
|
|
781
|
+
})() && createComponent(Header, {
|
|
782
|
+
class: "solidaria-ListBox-sectionHeader",
|
|
783
|
+
get children() {
|
|
784
|
+
return entry.section.title;
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
}), createComponent(Group, {
|
|
788
|
+
class: "solidaria-ListBox-sectionGroup",
|
|
538
789
|
get children() {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
})), createComponent(Group, {
|
|
542
|
-
"class": "solidaria-ListBox-sectionGroup",
|
|
543
|
-
get children() {
|
|
544
|
-
var _el$0 = getNextElement(_tmpl$5);
|
|
545
|
-
insert(_el$0, createComponent(For, {
|
|
790
|
+
var _el$15 = getNextElement(_tmpl$5);
|
|
791
|
+
insert(_el$15, createComponent(For, {
|
|
546
792
|
get each() {
|
|
547
793
|
return entry.items;
|
|
548
794
|
},
|
|
549
|
-
children: (indexedItem) =>
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
795
|
+
children: (indexedItem) => createComponent(ListBoxItemWithDropIndicators, {
|
|
796
|
+
get item() {
|
|
797
|
+
return indexedItem.item;
|
|
798
|
+
},
|
|
799
|
+
get itemIndex() {
|
|
800
|
+
return indexedItem.index;
|
|
801
|
+
},
|
|
802
|
+
isLastInLevel: () => isLastDropItem(indexedItem.index),
|
|
803
|
+
get renderItem() {
|
|
804
|
+
return local.children;
|
|
805
|
+
},
|
|
806
|
+
renderDropIndicator: renderItemDropIndicator
|
|
807
|
+
})
|
|
555
808
|
}));
|
|
556
|
-
effect(() =>
|
|
557
|
-
|
|
809
|
+
effect(() => entry.section["aria-label"], (_v$) => {
|
|
810
|
+
setAttribute(_el$15, "aria-label", _v$);
|
|
811
|
+
});
|
|
812
|
+
return _el$15;
|
|
558
813
|
}
|
|
559
814
|
})];
|
|
560
815
|
}
|
|
561
816
|
}));
|
|
562
|
-
return _el$
|
|
563
|
-
})() :
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
memo(() => local.children(entry.item.item)),
|
|
567
|
-
memo(() => collectionRenderer().renderDropIndicator?.(entry.item.index, "after"))
|
|
568
|
-
]
|
|
569
|
-
}) : [
|
|
570
|
-
memo(() => memo(() => !!virtualRange()?.offsetTop)() ? (() => {
|
|
571
|
-
var _el$1 = getNextElement(_tmpl$7);
|
|
572
|
-
effect((_$p) => style(_el$1, virtualSpacerStyle(virtualRange().offsetTop), _$p));
|
|
573
|
-
return _el$1;
|
|
574
|
-
})() : null),
|
|
575
|
-
createComponent(For, {
|
|
576
|
-
get each() {
|
|
577
|
-
return visibleItems();
|
|
817
|
+
return _el$14;
|
|
818
|
+
})() : createComponent(ListBoxItemWithDropIndicators, {
|
|
819
|
+
get item() {
|
|
820
|
+
return entry.item.item;
|
|
578
821
|
},
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
return
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}),
|
|
592
|
-
memo(() => memo(() => !!virtualRange()?.offsetBottom)() ? (() => {
|
|
593
|
-
var _el$10 = getNextElement(_tmpl$8);
|
|
594
|
-
effect((_$p) => style(_el$10, virtualSpacerStyle(virtualRange().offsetBottom), _$p));
|
|
595
|
-
return _el$10;
|
|
596
|
-
})() : null)
|
|
597
|
-
];
|
|
598
|
-
} }), _el$5, _co$);
|
|
599
|
-
insert(_el$3, (() => {
|
|
600
|
-
var _c$ = memo(() => !!(local.hasMore && local.onLoadMore));
|
|
601
|
-
return () => _c$() && createComponent(ListBoxLoadMoreItem, {
|
|
602
|
-
get onLoadMore() {
|
|
603
|
-
return local.onLoadMore;
|
|
822
|
+
get itemIndex() {
|
|
823
|
+
return entry.item.index;
|
|
824
|
+
},
|
|
825
|
+
isLastInLevel: () => isLastDropItem(entry.item.index),
|
|
826
|
+
get renderItem() {
|
|
827
|
+
return local.children;
|
|
828
|
+
},
|
|
829
|
+
renderDropIndicator: renderItemDropIndicator
|
|
830
|
+
})
|
|
831
|
+
}) : createComponent(For, {
|
|
832
|
+
get each() {
|
|
833
|
+
return visibleItems();
|
|
604
834
|
},
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
835
|
+
children: (item, index) => createComponent(ListBoxItemWithDropIndicators, {
|
|
836
|
+
item,
|
|
837
|
+
itemIndex: () => (virtualRange()?.start ?? 0) + index(),
|
|
838
|
+
isLastInLevel: () => isLastDropItem((virtualRange()?.start ?? 0) + index()),
|
|
839
|
+
get renderItem() {
|
|
840
|
+
return local.children;
|
|
841
|
+
},
|
|
842
|
+
renderDropIndicator: renderItemDropIndicator
|
|
843
|
+
})
|
|
608
844
|
});
|
|
609
|
-
})
|
|
845
|
+
} }), _el$5, _el$6);
|
|
846
|
+
insert(_el$3, scope((() => {
|
|
847
|
+
var _c$ = memo(() => {
|
|
848
|
+
return !!(local.hasMore && local.onLoadMore);
|
|
849
|
+
});
|
|
850
|
+
return () => {
|
|
851
|
+
return _c$() ? createComponent(ListBoxLoadMoreItem, {
|
|
852
|
+
get onLoadMore() {
|
|
853
|
+
return local.onLoadMore;
|
|
854
|
+
},
|
|
855
|
+
get isLoading() {
|
|
856
|
+
return local.isLoading;
|
|
857
|
+
}
|
|
858
|
+
}) : local.hasMore && local.onLoadMore;
|
|
859
|
+
};
|
|
860
|
+
})()), _el$8, _el$9);
|
|
610
861
|
runHydrationEvents();
|
|
611
862
|
return _el$3;
|
|
612
863
|
})()];
|
|
@@ -620,9 +871,9 @@ function ListBox(props) {
|
|
|
620
871
|
});
|
|
621
872
|
}
|
|
622
873
|
/**
|
|
623
|
-
* An
|
|
874
|
+
* An item in a listbox.
|
|
624
875
|
*/
|
|
625
|
-
function
|
|
876
|
+
function ListBoxItem(props) {
|
|
626
877
|
const [local, ariaProps] = splitProps(props, [
|
|
627
878
|
"class",
|
|
628
879
|
"style",
|
|
@@ -633,17 +884,17 @@ function ListBoxOption(props) {
|
|
|
633
884
|
"ref"
|
|
634
885
|
]);
|
|
635
886
|
const context = useContext(ListBoxStateContext);
|
|
636
|
-
if (!context) throw new Error("
|
|
887
|
+
if (!context) throw new Error("ListBoxItem must be used within a ListBox");
|
|
637
888
|
const state = context;
|
|
638
889
|
const listContext = useContext(ListBoxContext);
|
|
639
|
-
const [ref, setRef] = createSignal(null);
|
|
890
|
+
const [ref$1, setRef] = createSignal(null);
|
|
640
891
|
const optionAria = createOption({
|
|
641
892
|
key: local.id,
|
|
642
893
|
get isDisabled() {
|
|
643
894
|
return Boolean(ariaProps.isDisabled || listContext?.isDisabled());
|
|
644
895
|
},
|
|
645
896
|
get "aria-label"() {
|
|
646
|
-
return ariaProps["aria-label"]
|
|
897
|
+
return ariaProps["aria-label"];
|
|
647
898
|
},
|
|
648
899
|
get shouldSelectOnPressUp() {
|
|
649
900
|
return ariaProps.shouldSelectOnPressUp;
|
|
@@ -660,7 +911,7 @@ function ListBoxOption(props) {
|
|
|
660
911
|
get onHoverChange() {
|
|
661
912
|
return ariaProps.onHoverChange;
|
|
662
913
|
}
|
|
663
|
-
}, state, ref);
|
|
914
|
+
}, state, ref$1);
|
|
664
915
|
const renderValues = createMemo(() => ({
|
|
665
916
|
isSelected: optionAria.isSelected(),
|
|
666
917
|
isFocused: optionAria.isFocused(),
|
|
@@ -677,9 +928,6 @@ function ListBoxOption(props) {
|
|
|
677
928
|
style: local.style,
|
|
678
929
|
defaultClassName: "solidaria-ListBox-option"
|
|
679
930
|
}, renderValues);
|
|
680
|
-
const hasPrimitiveLabel = () => {
|
|
681
|
-
return typeof props.children === "string" || typeof props.children === "number";
|
|
682
|
-
};
|
|
683
931
|
const selectionIndicatorContext = createMemo(() => ({ isSelected: optionAria.isSelected }));
|
|
684
932
|
const draggableItem = createMemo(() => {
|
|
685
933
|
if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState) return void 0;
|
|
@@ -690,71 +938,109 @@ function ListBoxOption(props) {
|
|
|
690
938
|
});
|
|
691
939
|
const droppableItem = createMemo(() => {
|
|
692
940
|
if (!listContext?.dragAndDropHooks?.useDroppableItem || !listContext.dropState) return void 0;
|
|
693
|
-
return listContext.dragAndDropHooks.useDroppableItem({ key: local.id }, listContext.dropState, () => ref());
|
|
941
|
+
return listContext.dragAndDropHooks.useDroppableItem({ key: local.id }, listContext.dropState, () => ref$1());
|
|
694
942
|
});
|
|
695
943
|
const cleanOptionProps = () => {
|
|
696
|
-
const { ref: _ref1,
|
|
697
|
-
if (!hasPrimitiveLabel() && rest["aria-label"] == null) delete rest["aria-labelledby"];
|
|
944
|
+
const { ref: _ref1, ...rest } = optionAria.optionProps;
|
|
698
945
|
return rest;
|
|
699
946
|
};
|
|
947
|
+
const optionTextSlots = { slots: {
|
|
948
|
+
get [DEFAULT_SLOT]() {
|
|
949
|
+
return optionAria.labelProps;
|
|
950
|
+
},
|
|
951
|
+
get label() {
|
|
952
|
+
return optionAria.labelProps;
|
|
953
|
+
},
|
|
954
|
+
get description() {
|
|
955
|
+
return optionAria.descriptionProps;
|
|
956
|
+
}
|
|
957
|
+
} };
|
|
958
|
+
createRenderEffect(() => ({
|
|
959
|
+
el: ref$1(),
|
|
960
|
+
labelId: optionAria.labelProps.id,
|
|
961
|
+
descriptionId: optionAria.descriptionProps.id
|
|
962
|
+
}), ({ el, labelId, descriptionId }) => {
|
|
963
|
+
if (!el) return;
|
|
964
|
+
if (labelId) {
|
|
965
|
+
const label = el.querySelector("[slot='label']");
|
|
966
|
+
if (label && !label.id) label.id = labelId;
|
|
967
|
+
}
|
|
968
|
+
if (descriptionId) {
|
|
969
|
+
const description = el.querySelector("[slot='description']");
|
|
970
|
+
if (description && !description.id) description.id = descriptionId;
|
|
971
|
+
}
|
|
972
|
+
});
|
|
700
973
|
const domProps = () => filterDOMProps(ariaProps, { global: true });
|
|
701
|
-
|
|
974
|
+
const selectionMode = () => state.selectionMode();
|
|
975
|
+
return createComponent(SelectionIndicatorContext, {
|
|
702
976
|
get value() {
|
|
703
977
|
return selectionIndicatorContext();
|
|
704
978
|
},
|
|
705
979
|
get children() {
|
|
706
|
-
var _el$
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
980
|
+
var _el$16 = getNextElement(_tmpl$);
|
|
981
|
+
ref(() => {
|
|
982
|
+
return (el) => {
|
|
983
|
+
setRef(el);
|
|
984
|
+
assignRef$1(local.ref, el);
|
|
985
|
+
const dragRef = (draggableItem()?.dragProps)?.ref;
|
|
986
|
+
if (typeof dragRef === "function") dragRef(el);
|
|
987
|
+
};
|
|
988
|
+
}, _el$16);
|
|
989
|
+
spread(_el$16, [() => {
|
|
990
|
+
return mergeProps$1(domProps(), cleanOptionProps(), draggableItem()?.dragProps ?? {}, droppableItem()?.dropProps ?? {});
|
|
991
|
+
}, {
|
|
992
|
+
get "class"() {
|
|
713
993
|
return renderProps.class();
|
|
714
994
|
},
|
|
715
995
|
get style() {
|
|
716
996
|
return renderProps.style();
|
|
717
997
|
},
|
|
718
|
-
get
|
|
719
|
-
return optionAria.isSelected()
|
|
998
|
+
get "data-selected"() {
|
|
999
|
+
return dataAttr(optionAria.isSelected());
|
|
720
1000
|
},
|
|
721
|
-
get
|
|
722
|
-
return optionAria.isFocused()
|
|
1001
|
+
get "data-focused"() {
|
|
1002
|
+
return dataAttr(optionAria.isFocused());
|
|
723
1003
|
},
|
|
724
|
-
get
|
|
725
|
-
return optionAria.isFocusVisible()
|
|
1004
|
+
get "data-focus-visible"() {
|
|
1005
|
+
return dataAttr(optionAria.isFocusVisible());
|
|
726
1006
|
},
|
|
727
|
-
get
|
|
728
|
-
return optionAria.isPressed()
|
|
1007
|
+
get "data-pressed"() {
|
|
1008
|
+
return dataAttr(optionAria.isPressed());
|
|
729
1009
|
},
|
|
730
|
-
get
|
|
731
|
-
return optionAria.isHovered()
|
|
1010
|
+
get "data-hovered"() {
|
|
1011
|
+
return dataAttr(optionAria.isHovered());
|
|
732
1012
|
},
|
|
733
|
-
get
|
|
734
|
-
return optionAria.isDisabled()
|
|
1013
|
+
get "data-disabled"() {
|
|
1014
|
+
return dataAttr(optionAria.isDisabled());
|
|
735
1015
|
},
|
|
736
|
-
get
|
|
737
|
-
return draggableItem()?.isDragging
|
|
1016
|
+
get "data-dragging"() {
|
|
1017
|
+
return dataAttr(draggableItem()?.isDragging);
|
|
738
1018
|
},
|
|
739
|
-
get
|
|
740
|
-
return droppableItem()?.isDropTarget
|
|
1019
|
+
get "data-drop-target"() {
|
|
1020
|
+
return dataAttr(droppableItem()?.isDropTarget);
|
|
1021
|
+
},
|
|
1022
|
+
get "data-selection-mode"() {
|
|
1023
|
+
return selectionMode() === "none" ? void 0 : selectionMode();
|
|
741
1024
|
},
|
|
742
1025
|
get slot() {
|
|
743
1026
|
return local.slot;
|
|
744
1027
|
}
|
|
745
|
-
}
|
|
746
|
-
insert(_el$
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
1028
|
+
}], true);
|
|
1029
|
+
insert(_el$16, createComponent(Provider, {
|
|
1030
|
+
values: [[TextContext, optionTextSlots]],
|
|
1031
|
+
get children() {
|
|
1032
|
+
return createComponent(OptionContent, {
|
|
1033
|
+
get render() {
|
|
1034
|
+
return renderProps.renderChildrenStable;
|
|
1035
|
+
},
|
|
1036
|
+
get labelProps() {
|
|
1037
|
+
return optionAria.labelProps;
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
}));
|
|
756
1042
|
runHydrationEvents();
|
|
757
|
-
return _el$
|
|
1043
|
+
return _el$16;
|
|
758
1044
|
}
|
|
759
1045
|
});
|
|
760
1046
|
}
|
|
@@ -762,8 +1048,9 @@ function ListBoxOption(props) {
|
|
|
762
1048
|
* Load more sentinel item for listbox collections.
|
|
763
1049
|
*/
|
|
764
1050
|
function ListBoxLoadMoreItem(props) {
|
|
765
|
-
|
|
1051
|
+
const [sentinel, setSentinel] = createSignal();
|
|
766
1052
|
const [isPending, setIsPending] = createSignal(false);
|
|
1053
|
+
const scrollOffsetValue = createMemo(() => props.scrollOffset ?? 1);
|
|
767
1054
|
const isLoading = () => !!props.isLoading || isPending();
|
|
768
1055
|
const triggerLoadMore = async () => {
|
|
769
1056
|
if (isLoading()) return;
|
|
@@ -774,48 +1061,56 @@ function ListBoxLoadMoreItem(props) {
|
|
|
774
1061
|
setIsPending(false);
|
|
775
1062
|
}
|
|
776
1063
|
};
|
|
777
|
-
createEffect(() => {
|
|
778
|
-
|
|
779
|
-
|
|
1064
|
+
createEffect(() => ({
|
|
1065
|
+
current: sentinel(),
|
|
1066
|
+
scrollOffset: scrollOffsetValue()
|
|
1067
|
+
}), ({ current, scrollOffset }) => {
|
|
1068
|
+
if (!current || typeof IntersectionObserver !== "function") return;
|
|
1069
|
+
const margin = `0px 0px ${100 * scrollOffset}% 0px`;
|
|
780
1070
|
const observer = new IntersectionObserver((entries) => {
|
|
781
1071
|
if (entries[0]?.isIntersecting) triggerLoadMore();
|
|
782
1072
|
}, { rootMargin: margin });
|
|
783
|
-
observer.observe(
|
|
1073
|
+
observer.observe(current);
|
|
784
1074
|
return () => observer.disconnect();
|
|
785
1075
|
});
|
|
786
1076
|
const renderProps = useRenderProps({
|
|
787
1077
|
get children() {
|
|
788
|
-
return props.children
|
|
1078
|
+
return props.children;
|
|
789
1079
|
},
|
|
790
1080
|
class: props.class,
|
|
791
1081
|
style: props.style,
|
|
792
1082
|
defaultClassName: "solidaria-ListBox-loadMore"
|
|
793
1083
|
}, () => ({ isLoading: isLoading() }));
|
|
794
1084
|
return [(() => {
|
|
795
|
-
var _el$
|
|
796
|
-
var
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1085
|
+
var _el$17 = getNextElement(_tmpl$7);
|
|
1086
|
+
var _el$18 = _el$17.firstChild;
|
|
1087
|
+
ref(() => {
|
|
1088
|
+
return setSentinel;
|
|
1089
|
+
}, _el$18);
|
|
1090
|
+
return _el$17;
|
|
1091
|
+
})(), createComponent(Show, {
|
|
1092
|
+
get when() {
|
|
1093
|
+
return memo(() => {
|
|
1094
|
+
return !!isLoading();
|
|
1095
|
+
})() ? props.children : isLoading();
|
|
1096
|
+
},
|
|
1097
|
+
get children() {
|
|
1098
|
+
var _el$19 = getNextElement(_tmpl$8);
|
|
1099
|
+
insert(_el$19, scope(() => {
|
|
1100
|
+
return renderProps.renderChildren();
|
|
1101
|
+
}));
|
|
1102
|
+
effect(() => {
|
|
1103
|
+
return {
|
|
1104
|
+
e: readShallow(renderProps.class()),
|
|
1105
|
+
t: readShallow(renderProps.style())
|
|
1106
|
+
};
|
|
1107
|
+
}, ({ e, t }, _p$) => {
|
|
1108
|
+
className(_el$19, e, _p$?.e);
|
|
1109
|
+
style(_el$19, t, _p$?.t);
|
|
1110
|
+
});
|
|
1111
|
+
return _el$19;
|
|
1112
|
+
}
|
|
1113
|
+
})];
|
|
819
1114
|
}
|
|
820
1115
|
/**
|
|
821
1116
|
* Section primitive alias for ListBox composition parity.
|
|
@@ -823,9 +1118,13 @@ function ListBoxLoadMoreItem(props) {
|
|
|
823
1118
|
function ListBoxSection(props) {
|
|
824
1119
|
return createComponent(Section, props);
|
|
825
1120
|
}
|
|
826
|
-
|
|
1121
|
+
/**
|
|
1122
|
+
* @deprecated Use {@link ListBoxItem}. Removed in a future minor.
|
|
1123
|
+
*/
|
|
1124
|
+
const ListBoxOption = ListBoxItem;
|
|
1125
|
+
ListBox.Option = ListBoxItem;
|
|
827
1126
|
ListBox.LoadMoreItem = ListBoxLoadMoreItem;
|
|
828
1127
|
//#endregion
|
|
829
|
-
export { ListBox, ListBoxContext, ListBoxLoadMoreItem, ListBoxOption, ListBoxSection, ListBoxStateContext, ListStateContext };
|
|
1128
|
+
export { ListBox, ListBoxContext, ListBoxItem, ListBoxLoadMoreItem, ListBoxOption, ListBoxSection, ListBoxStateContext, ListStateContext };
|
|
830
1129
|
|
|
831
1130
|
//# sourceMappingURL=ListBox.js.map
|