@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/GridList.jsx
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
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/GridList.tsx
|
|
13
|
+
import { dataAttr, filterDOMProps, useRenderProps } from "./utils.jsx";
|
|
14
|
+
import { TextContext } from "./Text.jsx";
|
|
2
15
|
import { SharedElementTransition } from "./SharedElementTransition.jsx";
|
|
3
|
-
import { CollectionRendererContext, useCollectionRenderer } from "./Collection.jsx";
|
|
4
|
-
import {
|
|
5
|
-
import { getNormalizedDropTargetKey, mergePersistedKeysIntoVirtualRange, useDndPersistedKeys, useRenderDropIndicator } from "./DragAndDrop.jsx";
|
|
6
|
-
import { For, createContext, createEffect, createMemo, createSignal,
|
|
7
|
-
import { createFocusRing, createGridList, createGridListItem, createGridListSection, createGridListSelectionCheckbox, createHover, mergeProps
|
|
16
|
+
import { CollectionRendererContext, renderCollectionDropSlots, useCollectionRenderer, useCollectionRoot } from "./Collection.jsx";
|
|
17
|
+
import { o as useVirtualizerContext, t as PersistedVirtualItem } from "./Virtualizer2.jsx";
|
|
18
|
+
import { getNormalizedDropTargetKey, indexesOutsideRange, mergePersistedKeysIntoVirtualRange, useDndPersistedKeys, useRenderDropIndicator } from "./DragAndDrop.jsx";
|
|
19
|
+
import { For, createContext, createEffect, createMemo, createSignal, createTrackedEffect, useContext } from "solid-js";
|
|
20
|
+
import { createFocusRing, createGridList, createGridListItem, createGridListSection, createGridListSelectionCheckbox, createHover, mergeProps, useLocale } from "@proyecto-viviana/solidaria";
|
|
21
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
8
22
|
import { createGridState } from "@proyecto-viviana/solid-stately";
|
|
9
23
|
//#region src/GridList.tsx
|
|
10
24
|
/**
|
|
@@ -16,7 +30,7 @@ import { createGridState } from "@proyecto-viviana/solid-stately";
|
|
|
16
30
|
* GridList is similar to ListBox but supports interactive elements within items
|
|
17
31
|
* and uses grid keyboard navigation.
|
|
18
32
|
*/
|
|
19
|
-
function assignRef(ref, el) {
|
|
33
|
+
function assignRef$1(ref, el) {
|
|
20
34
|
if (!ref) return;
|
|
21
35
|
if (typeof ref === "function") ref(el);
|
|
22
36
|
else ref.current = el;
|
|
@@ -29,7 +43,8 @@ const GridListHeaderContext = createContext(null);
|
|
|
29
43
|
const GridListHeaderInnerContext = createContext(null);
|
|
30
44
|
function buildGridCollection(items, getKey, getTextValue, getDisabled) {
|
|
31
45
|
const nodes = items.map((item, index) => {
|
|
32
|
-
const
|
|
46
|
+
const record = item;
|
|
47
|
+
const key = getKey?.(item) ?? record.key ?? record.id ?? index;
|
|
33
48
|
return {
|
|
34
49
|
type: "item",
|
|
35
50
|
key,
|
|
@@ -112,7 +127,9 @@ function GridList(props) {
|
|
|
112
127
|
"isLoading",
|
|
113
128
|
"onLoadMore",
|
|
114
129
|
"dragAndDropHooks",
|
|
115
|
-
"orientation"
|
|
130
|
+
"orientation",
|
|
131
|
+
"layout",
|
|
132
|
+
"columnCount"
|
|
116
133
|
], [
|
|
117
134
|
"items",
|
|
118
135
|
"getKey",
|
|
@@ -126,7 +143,9 @@ function GridList(props) {
|
|
|
126
143
|
"onSelectionChange",
|
|
127
144
|
"selectionBehavior"
|
|
128
145
|
]);
|
|
129
|
-
const
|
|
146
|
+
const locale = useLocale();
|
|
147
|
+
const [ref, setRef] = createSignal(null, { ownedWrite: true });
|
|
148
|
+
const parentCollectionRenderer = useCollectionRenderer();
|
|
130
149
|
const collection = createMemo(() => buildGridCollection(stateProps.items, stateProps.getKey, stateProps.getTextValue, stateProps.getDisabled));
|
|
131
150
|
const allDisabledKeys = createMemo(() => {
|
|
132
151
|
const keys = /* @__PURE__ */ new Set();
|
|
@@ -135,35 +154,57 @@ function GridList(props) {
|
|
|
135
154
|
return keys;
|
|
136
155
|
});
|
|
137
156
|
const orientation = () => local.orientation ?? "vertical";
|
|
138
|
-
const resolveDirection = () =>
|
|
139
|
-
const el = ref();
|
|
140
|
-
if (el && typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
141
|
-
if (window.getComputedStyle(el).direction === "rtl") return "rtl";
|
|
142
|
-
}
|
|
143
|
-
return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
|
|
144
|
-
};
|
|
157
|
+
const resolveDirection = () => locale().direction;
|
|
145
158
|
const state = createGridState(() => ({
|
|
146
159
|
collection: collection(),
|
|
147
160
|
disabledKeys: allDisabledKeys(),
|
|
148
161
|
disabledBehavior: stateProps.disabledBehavior,
|
|
149
162
|
selectionMode: stateProps.selectionMode,
|
|
150
|
-
selectionBehavior: stateProps.selectionBehavior
|
|
163
|
+
selectionBehavior: stateProps.selectionBehavior,
|
|
151
164
|
selectedKeys: stateProps.selectedKeys,
|
|
152
165
|
defaultSelectedKeys: stateProps.defaultSelectedKeys,
|
|
153
166
|
onSelectionChange: stateProps.onSelectionChange
|
|
154
167
|
}));
|
|
155
168
|
const gridListAria = createGridList(() => ({
|
|
156
|
-
id
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"aria-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
get id() {
|
|
170
|
+
return ariaProps.id;
|
|
171
|
+
},
|
|
172
|
+
get "aria-label"() {
|
|
173
|
+
return ariaProps["aria-label"];
|
|
174
|
+
},
|
|
175
|
+
get "aria-labelledby"() {
|
|
176
|
+
return ariaProps["aria-labelledby"];
|
|
177
|
+
},
|
|
178
|
+
get "aria-describedby"() {
|
|
179
|
+
return ariaProps["aria-describedby"];
|
|
180
|
+
},
|
|
181
|
+
get isVirtualized() {
|
|
182
|
+
return ariaProps.isVirtualized ?? parentCollectionRenderer?.isVirtualized;
|
|
183
|
+
},
|
|
184
|
+
get onAction() {
|
|
185
|
+
return ariaProps.onAction;
|
|
186
|
+
},
|
|
187
|
+
get isDisabled() {
|
|
188
|
+
return ariaProps.isDisabled;
|
|
189
|
+
},
|
|
190
|
+
get selectionBehavior() {
|
|
191
|
+
return state.selectionBehavior;
|
|
192
|
+
},
|
|
193
|
+
get keyboardNavigationBehavior() {
|
|
194
|
+
return ariaProps.keyboardNavigationBehavior;
|
|
195
|
+
},
|
|
196
|
+
get orientation() {
|
|
197
|
+
return orientation();
|
|
198
|
+
},
|
|
199
|
+
get direction() {
|
|
200
|
+
return resolveDirection();
|
|
201
|
+
},
|
|
202
|
+
get layout() {
|
|
203
|
+
return local.layout;
|
|
204
|
+
},
|
|
205
|
+
get columnCount() {
|
|
206
|
+
return local.columnCount;
|
|
207
|
+
}
|
|
167
208
|
}), () => state, ref);
|
|
168
209
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
169
210
|
const renderValues = createMemo(() => ({
|
|
@@ -191,7 +232,6 @@ function GridList(props) {
|
|
|
191
232
|
};
|
|
192
233
|
const isEmpty = () => stateProps.items.length === 0;
|
|
193
234
|
const virtualizer = useVirtualizerContext();
|
|
194
|
-
const parentCollectionRenderer = useCollectionRenderer();
|
|
195
235
|
const getItemNodes = createMemo(() => Array.from(state.collection).filter((node) => node.type === "item"));
|
|
196
236
|
const getDropTargetByIndex = (index, position) => {
|
|
197
237
|
const node = getItemNodes()[index];
|
|
@@ -206,29 +246,25 @@ function GridList(props) {
|
|
|
206
246
|
const hooks = local.dragAndDropHooks;
|
|
207
247
|
return Boolean(hooks?.useDroppableCollectionState && hooks.useDroppableCollection && (hooks.dropTargetDelegate || parentCollectionRenderer?.dropTargetDelegate || hooks.ListDropTargetDelegate));
|
|
208
248
|
});
|
|
209
|
-
const
|
|
249
|
+
const dragStateValue = createMemo(() => {
|
|
210
250
|
const hooks = local.dragAndDropHooks;
|
|
211
251
|
return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (!hooks?.useDraggableCollection || !activeDragState) return;
|
|
226
|
-
hooks.useDraggableCollection({}, activeDragState, () => ref());
|
|
227
|
-
});
|
|
228
|
-
const droppableCollection = createMemo(() => {
|
|
252
|
+
})() ? local.dragAndDropHooks?.useDraggableCollectionState?.({
|
|
253
|
+
items: stateProps.items,
|
|
254
|
+
collection: state.collection,
|
|
255
|
+
selectedKeys: state.selectedKeys,
|
|
256
|
+
isSelected: (key) => state.isSelected(key)
|
|
257
|
+
}) : void 0;
|
|
258
|
+
const dragState = () => dragStateValue;
|
|
259
|
+
const dropStateValue = hasDroppableDnd() ? local.dragAndDropHooks?.useDroppableCollectionState?.({ get collection() {
|
|
260
|
+
return state.collection;
|
|
261
|
+
} }) : void 0;
|
|
262
|
+
const dropState = () => dropStateValue;
|
|
263
|
+
if (local.dragAndDropHooks?.useDraggableCollection && dragStateValue) local.dragAndDropHooks.useDraggableCollection({}, dragStateValue, () => ref());
|
|
264
|
+
const droppableCollectionValue = (() => {
|
|
229
265
|
if (!hasDroppableDnd()) return void 0;
|
|
230
266
|
const hooks = local.dragAndDropHooks;
|
|
231
|
-
const activeDropState =
|
|
267
|
+
const activeDropState = dropStateValue;
|
|
232
268
|
if (!hooks?.useDroppableCollection || !activeDropState) return void 0;
|
|
233
269
|
const dropTargetDelegate = hooks.dropTargetDelegate ?? parentCollectionRenderer?.dropTargetDelegate ?? (hooks.ListDropTargetDelegate ? new hooks.ListDropTargetDelegate(() => state.collection, () => ref(), {
|
|
234
270
|
layout: "grid",
|
|
@@ -249,7 +285,8 @@ function GridList(props) {
|
|
|
249
285
|
getKeyPageAbove: (key) => state.collection.getKeyBefore?.(key) ?? null
|
|
250
286
|
}
|
|
251
287
|
}, activeDropState, () => ref());
|
|
252
|
-
});
|
|
288
|
+
})();
|
|
289
|
+
const droppableCollection = () => droppableCollectionValue;
|
|
253
290
|
const isRootDropTarget = createMemo(() => {
|
|
254
291
|
return Boolean(dropState()?.target?.type === "root");
|
|
255
292
|
});
|
|
@@ -264,22 +301,23 @@ function GridList(props) {
|
|
|
264
301
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return null;
|
|
265
302
|
const baseRange = virtualizer.getVisibleRange(stateProps.items.length);
|
|
266
303
|
const itemNodes = getItemNodes();
|
|
267
|
-
const persistedIndexes = Array.from(persistedKeys()).map((key) => itemNodes.findIndex((node) => node.key === key)).filter((index) => index >= 0);
|
|
268
304
|
const dropTarget = dropState()?.target;
|
|
269
305
|
const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection);
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const forceIncludeIndexes = [
|
|
273
|
-
dropTarget?.type === "item" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,
|
|
274
|
-
normalizedDropKey != null ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1,
|
|
275
|
-
dropTarget?.type === "item" ? -1 : focusedIndex
|
|
276
|
-
].filter((index) => index >= 0);
|
|
277
|
-
return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, stateProps.items.length, virtualizer, 80, {
|
|
306
|
+
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);
|
|
307
|
+
return mergePersistedKeysIntoVirtualRange(baseRange, [], stateProps.items.length, virtualizer, 80, {
|
|
278
308
|
forceIncludeIndexes,
|
|
279
309
|
forceIncludeMaxSpan: 320
|
|
280
310
|
});
|
|
281
311
|
});
|
|
282
|
-
|
|
312
|
+
const persistedOutsideIndexes = createMemo(() => {
|
|
313
|
+
const range = virtualRange();
|
|
314
|
+
if (!range) return [];
|
|
315
|
+
const itemNodes = getItemNodes();
|
|
316
|
+
const persistedIndexes = Array.from(persistedKeys()).map((key) => itemNodes.findIndex((node) => node.key === key)).filter((index) => index >= 0);
|
|
317
|
+
return indexesOutsideRange(range, persistedIndexes);
|
|
318
|
+
});
|
|
319
|
+
createTrackedEffect(() => {
|
|
320
|
+
const _s2Cleanups = [];
|
|
283
321
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;
|
|
284
322
|
virtualizer.setDropTargetItemCountResolver(() => state.collection.size);
|
|
285
323
|
virtualizer.setDropTargetIndexResolver((key) => {
|
|
@@ -294,18 +332,20 @@ function GridList(props) {
|
|
|
294
332
|
key: typeof node.key === "string" || typeof node.key === "number" ? node.key : void 0
|
|
295
333
|
};
|
|
296
334
|
});
|
|
297
|
-
|
|
335
|
+
_s2Cleanups.push(() => {
|
|
298
336
|
virtualizer.setDropTargetIndexResolver(void 0);
|
|
299
337
|
virtualizer.setDropTargetItemCountResolver(void 0);
|
|
300
338
|
virtualizer.setDropTargetResolver(void 0);
|
|
301
339
|
});
|
|
340
|
+
return () => {
|
|
341
|
+
for (const c of _s2Cleanups) c();
|
|
342
|
+
};
|
|
302
343
|
});
|
|
303
344
|
const visibleItems = createMemo(() => {
|
|
304
345
|
const range = virtualRange();
|
|
305
346
|
if (!range) return stateProps.items;
|
|
306
347
|
return stateProps.items.slice(range.start, range.end);
|
|
307
348
|
});
|
|
308
|
-
const virtualSpacerStyle = (size) => virtualizer?.orientation === "horizontal" ? { width: `${size}px` } : { height: `${size}px` };
|
|
309
349
|
const contextValue = createMemo(() => ({
|
|
310
350
|
state,
|
|
311
351
|
collection: collection(),
|
|
@@ -320,38 +360,56 @@ function GridList(props) {
|
|
|
320
360
|
renderItem: (item) => props.children(item),
|
|
321
361
|
renderDropIndicator: (index, position) => dndDropIndicator(index, position) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position)
|
|
322
362
|
}));
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
363
|
+
const CollectionRoot = useCollectionRoot();
|
|
364
|
+
return <GridListContext value={contextValue()}>
|
|
365
|
+
<GridListStateContext value={state}>
|
|
366
|
+
<CollectionRendererContext value={collectionRenderer()}>
|
|
326
367
|
<div ref={(element) => {
|
|
327
368
|
setRef(element);
|
|
328
|
-
assignRef(local.ref, element);
|
|
329
|
-
}} {...mergeProps
|
|
369
|
+
assignRef$1(local.ref, element);
|
|
370
|
+
}} {...mergeProps(domProps(), cleanGridProps(), cleanFocusProps(), droppableCollection()?.collectionProps ?? {})} class={renderProps.class()} style={renderProps.style()} data-focused={dataAttr(state.isFocused)} data-focus-visible={dataAttr(isFocusVisible())} data-disabled={dataAttr(ariaProps.isDisabled)} data-empty={dataAttr(isEmpty())} data-drop-target={dataAttr(isRootDropTarget())} data-orientation={orientation()}>
|
|
330
371
|
<SharedElementTransition>
|
|
331
|
-
{isEmpty() && local.renderEmptyState ? local.renderEmptyState() :
|
|
332
|
-
|
|
372
|
+
{isEmpty() && local.renderEmptyState ? local.renderEmptyState() : parentCollectionRenderer?.isVirtualized ? <CollectionRoot collection={virtualRange() ? stateProps.items : []} scrollRef={() => ref()} persistedKeys={persistedKeys()}>
|
|
373
|
+
<For each={visibleItems()}>
|
|
374
|
+
{(item, index) => {
|
|
375
|
+
const itemIndex = () => (virtualRange()?.start ?? 0) + index();
|
|
376
|
+
return renderCollectionDropSlots({
|
|
377
|
+
index: itemIndex(),
|
|
378
|
+
lastIndex: getItemNodes().length - 1,
|
|
379
|
+
renderDropIndicator: (i, position) => collectionRenderer().renderDropIndicator?.(i, position),
|
|
380
|
+
children: props.children(item)
|
|
381
|
+
});
|
|
382
|
+
}}
|
|
383
|
+
</For>
|
|
384
|
+
<For each={persistedOutsideIndexes()}>
|
|
385
|
+
{(index) => <PersistedVirtualItem index={index}>
|
|
386
|
+
{renderCollectionDropSlots({
|
|
387
|
+
index,
|
|
388
|
+
lastIndex: getItemNodes().length - 1,
|
|
389
|
+
renderDropIndicator: (i, position) => collectionRenderer().renderDropIndicator?.(i, position),
|
|
390
|
+
children: props.children(stateProps.items[index])
|
|
391
|
+
})}
|
|
392
|
+
</PersistedVirtualItem>}
|
|
393
|
+
</For>
|
|
394
|
+
</CollectionRoot> : <>
|
|
333
395
|
<For each={visibleItems()}>
|
|
334
396
|
{(item, index) => {
|
|
335
397
|
const itemIndex = () => (virtualRange()?.start ?? 0) + index();
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
{props.children(item)}
|
|
343
|
-
{afterIndicator()}
|
|
344
|
-
</>;
|
|
398
|
+
return renderCollectionDropSlots({
|
|
399
|
+
index: itemIndex(),
|
|
400
|
+
lastIndex: getItemNodes().length - 1,
|
|
401
|
+
renderDropIndicator: (i, position) => collectionRenderer().renderDropIndicator?.(i, position),
|
|
402
|
+
children: props.children(item)
|
|
403
|
+
});
|
|
345
404
|
}}
|
|
346
405
|
</For>
|
|
347
|
-
{virtualRange()?.offsetBottom ? <div role="presentation" aria-hidden="true" style={virtualSpacerStyle(virtualRange().offsetBottom)} data-virtualizer-spacer="bottom" /> : null}
|
|
348
406
|
</>}
|
|
349
407
|
</SharedElementTransition>
|
|
350
408
|
{local.hasMore && local.onLoadMore && <GridListLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />}
|
|
351
409
|
</div>
|
|
352
|
-
</CollectionRendererContext
|
|
353
|
-
</GridListStateContext
|
|
354
|
-
</GridListContext
|
|
410
|
+
</CollectionRendererContext>
|
|
411
|
+
</GridListStateContext>
|
|
412
|
+
</GridListContext>;
|
|
355
413
|
}
|
|
356
414
|
/**
|
|
357
415
|
* An item in a grid list.
|
|
@@ -365,6 +423,7 @@ function GridListItem(props) {
|
|
|
365
423
|
"item",
|
|
366
424
|
"textValue",
|
|
367
425
|
"onAction",
|
|
426
|
+
"isDisabled",
|
|
368
427
|
"children",
|
|
369
428
|
"ref"
|
|
370
429
|
]);
|
|
@@ -372,7 +431,7 @@ function GridListItem(props) {
|
|
|
372
431
|
if (!context) throw new Error("GridListItem must be used within a GridList");
|
|
373
432
|
const state = context;
|
|
374
433
|
const listContext = useContext(GridListContext);
|
|
375
|
-
const [ref, setRef] = createSignal(null);
|
|
434
|
+
const [ref, setRef] = createSignal(null, { ownedWrite: true });
|
|
376
435
|
const itemNode = createMemo(() => {
|
|
377
436
|
const node = state.collection.getItem(local.id);
|
|
378
437
|
if (!node) return {
|
|
@@ -389,8 +448,10 @@ function GridListItem(props) {
|
|
|
389
448
|
});
|
|
390
449
|
const itemAria = createGridListItem(() => ({
|
|
391
450
|
node: itemNode(),
|
|
451
|
+
textValue: local.textValue,
|
|
392
452
|
onAction: local.onAction,
|
|
393
|
-
|
|
453
|
+
isDisabled: local.isDisabled,
|
|
454
|
+
selectionBehavior: listContext?.selectionBehavior ?? "toggle"
|
|
394
455
|
}), () => state, ref);
|
|
395
456
|
const isSelected = () => itemAria.isSelected;
|
|
396
457
|
const isDisabled = () => itemAria.isDisabled;
|
|
@@ -416,7 +477,8 @@ function GridListItem(props) {
|
|
|
416
477
|
isHovered: isHovered(),
|
|
417
478
|
isDisabled: isDisabled(),
|
|
418
479
|
selectionMode: state.selectionMode,
|
|
419
|
-
selectionBehavior: listContext?.selectionBehavior ?? "
|
|
480
|
+
selectionBehavior: listContext?.selectionBehavior ?? "toggle",
|
|
481
|
+
descriptionId: itemAria.descriptionProps.id
|
|
420
482
|
}));
|
|
421
483
|
const renderProps = useRenderProps({
|
|
422
484
|
get children() {
|
|
@@ -440,9 +502,13 @@ function GridListItem(props) {
|
|
|
440
502
|
};
|
|
441
503
|
return <div ref={(element) => {
|
|
442
504
|
setRef(element);
|
|
443
|
-
assignRef(local.ref, element);
|
|
444
|
-
|
|
445
|
-
|
|
505
|
+
assignRef$1(local.ref, element);
|
|
506
|
+
const dragRef = (draggableItem()?.dragProps)?.ref;
|
|
507
|
+
if (typeof dragRef === "function") dragRef(element);
|
|
508
|
+
}} {...domProps} {...mergeProps(cleanRowProps(), cleanHoverProps(), cleanFocusProps(), draggableItem()?.dragProps ?? {}, droppableItem()?.dropProps ?? {})} class={renderProps.class()} style={renderProps.style()} data-key={local.id} data-selected={dataAttr(isSelected())} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible() && isFocused())} data-pressed={dataAttr(isPressed())} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(isDisabled())} data-dragging={dataAttr(draggableItem()?.isDragging)} data-drop-target={dataAttr(droppableItem()?.isDropTarget)}>
|
|
509
|
+
<TextContext value={{ slots: { description: itemAria.descriptionProps } }}>
|
|
510
|
+
<div {...itemAria.gridCellProps}>{renderProps.renderChildren()}</div>
|
|
511
|
+
</TextContext>
|
|
446
512
|
</div>;
|
|
447
513
|
}
|
|
448
514
|
/**
|
|
@@ -453,11 +519,12 @@ function GridListSelectionCheckbox(props) {
|
|
|
453
519
|
if (!context) throw new Error("GridListSelectionCheckbox must be used within a GridList");
|
|
454
520
|
const state = context;
|
|
455
521
|
const checkboxAria = createGridListSelectionCheckbox(() => ({ key: props.itemKey }), () => state);
|
|
456
|
-
return <input {...checkboxAria.checkboxProps} class={props.class} style={props.style}
|
|
522
|
+
return <input {...checkboxAria.checkboxProps} class={props.class} style={props.style} tabindex={props.excludeFromTabOrder ? -1 : void 0} aria-label={props["aria-label"] ?? checkboxAria.checkboxProps["aria-label"]} />;
|
|
457
523
|
}
|
|
458
524
|
function GridListLoadMoreItem(props) {
|
|
459
|
-
|
|
525
|
+
const [sentinel, setSentinel] = createSignal();
|
|
460
526
|
const [isPending, setIsPending] = createSignal(false);
|
|
527
|
+
const scrollOffsetValue = createMemo(() => props.scrollOffset ?? 1);
|
|
461
528
|
const isLoading = () => !!props.isLoading || isPending();
|
|
462
529
|
const triggerLoadMore = async () => {
|
|
463
530
|
if (isLoading()) return;
|
|
@@ -468,7 +535,18 @@ function GridListLoadMoreItem(props) {
|
|
|
468
535
|
setIsPending(false);
|
|
469
536
|
}
|
|
470
537
|
};
|
|
471
|
-
createEffect(() => {
|
|
538
|
+
createEffect(() => ({
|
|
539
|
+
current: sentinel(),
|
|
540
|
+
scrollOffset: scrollOffsetValue()
|
|
541
|
+
}), ({ current, scrollOffset }) => {
|
|
542
|
+
if (!current || typeof IntersectionObserver !== "function") return;
|
|
543
|
+
const margin = `0px 0px ${100 * scrollOffset}% 0px`;
|
|
544
|
+
const observer = new IntersectionObserver((entries) => {
|
|
545
|
+
if (entries[0]?.isIntersecting) triggerLoadMore();
|
|
546
|
+
}, { rootMargin: margin });
|
|
547
|
+
observer.observe(current);
|
|
548
|
+
return () => observer.disconnect();
|
|
549
|
+
});
|
|
472
550
|
const renderProps = useRenderProps({
|
|
473
551
|
get children() {
|
|
474
552
|
return props.children ?? (() => isLoading() ? "Loading more..." : "Load more");
|
|
@@ -484,15 +562,15 @@ function GridListLoadMoreItem(props) {
|
|
|
484
562
|
height: 0,
|
|
485
563
|
overflow: "hidden"
|
|
486
564
|
}} inert>
|
|
487
|
-
<div ref={
|
|
565
|
+
<div ref={setSentinel} style={{
|
|
488
566
|
position: "absolute",
|
|
489
567
|
height: "1px",
|
|
490
568
|
width: "1px"
|
|
491
569
|
}} />
|
|
492
570
|
</div>
|
|
493
|
-
<div role="row"
|
|
571
|
+
<div role="row" tabindex={0} onFocus={() => {
|
|
494
572
|
triggerLoadMore();
|
|
495
|
-
}} class={renderProps.class()} style={renderProps.style()} data-loading={isLoading()
|
|
573
|
+
}} class={renderProps.class()} style={renderProps.style()} data-loading={dataAttr(isLoading())}>
|
|
496
574
|
{renderProps.renderChildren()}
|
|
497
575
|
</div>
|
|
498
576
|
</>;
|
|
@@ -535,12 +613,12 @@ function GridListSection(props) {
|
|
|
535
613
|
defaultClassName: "solidaria-GridListSection"
|
|
536
614
|
}, () => ({ hasChildren: true }));
|
|
537
615
|
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
538
|
-
return <div ref={(el) => assignRef(local.ref, el)} {...filteredDomProps()} {...section.rowGroupProps} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-section>
|
|
539
|
-
<GridListHeaderContext
|
|
540
|
-
<GridListHeaderInnerContext
|
|
616
|
+
return <div ref={(el) => assignRef$1(local.ref, el)} {...filteredDomProps()} {...section.rowGroupProps} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-section>
|
|
617
|
+
<GridListHeaderContext value={section.rowProps}>
|
|
618
|
+
<GridListHeaderInnerContext value={section.rowHeaderProps}>
|
|
541
619
|
{local.children}
|
|
542
|
-
</GridListHeaderInnerContext
|
|
543
|
-
</GridListHeaderContext
|
|
620
|
+
</GridListHeaderInnerContext>
|
|
621
|
+
</GridListHeaderContext>
|
|
544
622
|
</div>;
|
|
545
623
|
}
|
|
546
624
|
GridList.Item = GridListItem;
|