@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/src/Tree.tsx
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Tree.tsx
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Tree component for solidaria-components
|
|
3
17
|
*
|
|
@@ -9,17 +23,17 @@
|
|
|
9
23
|
*/
|
|
10
24
|
|
|
11
25
|
import {
|
|
12
|
-
type JSX,
|
|
13
26
|
onCleanup,
|
|
14
27
|
createContext,
|
|
15
28
|
createEffect,
|
|
16
29
|
createMemo,
|
|
17
30
|
createSignal,
|
|
18
|
-
splitProps,
|
|
19
31
|
useContext,
|
|
20
32
|
For,
|
|
21
33
|
Show,
|
|
34
|
+
createTrackedEffect,
|
|
22
35
|
} from "solid-js";
|
|
36
|
+
import type { JSX } from "@solidjs/web";
|
|
23
37
|
import {
|
|
24
38
|
createTree,
|
|
25
39
|
createTreeItem,
|
|
@@ -29,6 +43,7 @@ import {
|
|
|
29
43
|
createHover,
|
|
30
44
|
mergeProps,
|
|
31
45
|
type AriaTreeProps,
|
|
46
|
+
useLocale,
|
|
32
47
|
} from "@proyecto-viviana/solidaria";
|
|
33
48
|
import {
|
|
34
49
|
createTreeState,
|
|
@@ -49,11 +64,13 @@ import {
|
|
|
49
64
|
type SlotProps,
|
|
50
65
|
useRenderProps,
|
|
51
66
|
filterDOMProps,
|
|
67
|
+
dataAttr,
|
|
52
68
|
} from "./utils";
|
|
53
69
|
import { SharedElementTransition } from "./SharedElementTransition";
|
|
54
70
|
import { type DragAndDropHooks } from "./useDragAndDrop";
|
|
55
71
|
import {
|
|
56
72
|
getNormalizedDropTargetKey,
|
|
73
|
+
indexesOutsideRange,
|
|
57
74
|
mergePersistedKeysIntoVirtualRange,
|
|
58
75
|
useDndPersistedKeys,
|
|
59
76
|
useRenderDropIndicator,
|
|
@@ -66,6 +83,7 @@ import {
|
|
|
66
83
|
type CollectionRendererContextValue,
|
|
67
84
|
type SectionProps,
|
|
68
85
|
useCollectionRenderer,
|
|
86
|
+
useCollectionRoot,
|
|
69
87
|
} from "./Collection";
|
|
70
88
|
import {
|
|
71
89
|
GridListHeader,
|
|
@@ -73,7 +91,8 @@ import {
|
|
|
73
91
|
GridListHeaderInnerContext,
|
|
74
92
|
type GridListHeaderProps,
|
|
75
93
|
} from "./GridList";
|
|
76
|
-
import { useVirtualizerContext } from "./Virtualizer";
|
|
94
|
+
import { useVirtualizerContext, PersistedVirtualItem } from "./Virtualizer";
|
|
95
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
77
96
|
import {
|
|
78
97
|
handleLinkClick,
|
|
79
98
|
type LinkDOMProps,
|
|
@@ -297,24 +316,7 @@ const EXPANSION_KEYS = {
|
|
|
297
316
|
collapse: { ltr: "ArrowLeft", rtl: "ArrowRight" },
|
|
298
317
|
} as const;
|
|
299
318
|
|
|
300
|
-
function
|
|
301
|
-
if (element) {
|
|
302
|
-
const dir = element.closest("[dir]")?.getAttribute("dir");
|
|
303
|
-
if (dir === "rtl") return "rtl";
|
|
304
|
-
if (dir === "ltr") return "ltr";
|
|
305
|
-
if (typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
306
|
-
const computedDirection = window.getComputedStyle(element).direction;
|
|
307
|
-
if (computedDirection === "rtl") return "rtl";
|
|
308
|
-
if (computedDirection === "ltr") return "ltr";
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
if (typeof document !== "undefined") {
|
|
312
|
-
return document.dir === "rtl" ? "rtl" : "ltr";
|
|
313
|
-
}
|
|
314
|
-
return "ltr";
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function createTreeDropTargetDelegate<T extends object>(
|
|
319
|
+
export function createTreeDropTargetDelegate<T extends object>(
|
|
318
320
|
delegate: TreeDropTargetDelegate,
|
|
319
321
|
state: TreeState<T, TreeCollection<T>>,
|
|
320
322
|
direction: "ltr" | "rtl",
|
|
@@ -396,14 +398,19 @@ function createTreeDropTargetDelegate<T extends object>(
|
|
|
396
398
|
const isLastChildAtLevel = !nextItem || nextItem.parentKey !== parentKey;
|
|
397
399
|
|
|
398
400
|
if (isLastChildAtLevel) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
// Only items can be drop targets. Ancestors such as a Table's <TableBody> or a
|
|
402
|
+
// <TreeSection> are part of the collection, but their keys are generated rather than
|
|
403
|
+
// provided by the user, so dropping "after" them is not something the user can handle.
|
|
404
|
+
if (parentItem?.type === "item") {
|
|
405
|
+
const afterParentTarget: ItemDropTarget = {
|
|
406
|
+
type: "item",
|
|
407
|
+
key: parentKey,
|
|
408
|
+
dropPosition: "after",
|
|
409
|
+
};
|
|
404
410
|
|
|
405
|
-
|
|
406
|
-
|
|
411
|
+
if (isValidDropTarget(afterParentTarget)) {
|
|
412
|
+
ancestorTargets.push(afterParentTarget);
|
|
413
|
+
}
|
|
407
414
|
}
|
|
408
415
|
if (nextItem) break;
|
|
409
416
|
}
|
|
@@ -848,7 +855,9 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
848
855
|
],
|
|
849
856
|
);
|
|
850
857
|
|
|
858
|
+
const locale = useLocale();
|
|
851
859
|
const [ref, setRef] = createSignal<HTMLDivElement | null>(null);
|
|
860
|
+
const parentCollectionRenderer = useCollectionRenderer<unknown>();
|
|
852
861
|
const flatItems = createMemo<TreeItemData<T>[]>(() =>
|
|
853
862
|
flattenCollectionEntries(stateProps.items ?? []),
|
|
854
863
|
);
|
|
@@ -874,7 +883,7 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
874
883
|
const [lastExpandedKeys, setLastExpandedKeys] = createSignal<Set<Key>>(new Set());
|
|
875
884
|
const [lastItemsLength, setLastItemsLength] = createSignal(flatItems().length);
|
|
876
885
|
const [collectionVersion, setCollectionVersion] = createSignal(0);
|
|
877
|
-
|
|
886
|
+
createTrackedEffect(() => {
|
|
878
887
|
const expanded = state.expandedKeys;
|
|
879
888
|
const items = flatItems();
|
|
880
889
|
if (!areSetsEqual(lastExpandedKeys(), expanded) || lastItemsLength() !== items.length) {
|
|
@@ -885,7 +894,7 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
885
894
|
});
|
|
886
895
|
|
|
887
896
|
// Resolve writing direction for keyboard expand/collapse parity
|
|
888
|
-
const treeDirection = createMemo(() => ariaProps.direction ??
|
|
897
|
+
const treeDirection = createMemo(() => ariaProps.direction ?? locale().direction);
|
|
889
898
|
|
|
890
899
|
// Keep the aria object (do NOT destructure `treeProps`): its `treeProps` getter
|
|
891
900
|
// wraps a memo carrying the reactive roving-container `tabIndex`, which rolls to
|
|
@@ -899,7 +908,7 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
899
908
|
"aria-label": ariaProps["aria-label"],
|
|
900
909
|
"aria-labelledby": ariaProps["aria-labelledby"],
|
|
901
910
|
"aria-describedby": ariaProps["aria-describedby"],
|
|
902
|
-
isVirtualized: ariaProps.isVirtualized,
|
|
911
|
+
isVirtualized: ariaProps.isVirtualized ?? parentCollectionRenderer?.isVirtualized,
|
|
903
912
|
onAction: ariaProps.onAction,
|
|
904
913
|
isDisabled: ariaProps.isDisabled,
|
|
905
914
|
keyboardNavigationBehavior: ariaProps.keyboardNavigationBehavior,
|
|
@@ -948,7 +957,6 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
948
957
|
return state.collection.rows;
|
|
949
958
|
});
|
|
950
959
|
const virtualizer = useVirtualizerContext();
|
|
951
|
-
const parentCollectionRenderer = useCollectionRenderer<TreeItemData<T>>();
|
|
952
960
|
const getDropTargetByIndex = (
|
|
953
961
|
index: number,
|
|
954
962
|
position: "before" | "after" | "on",
|
|
@@ -971,53 +979,58 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
971
979
|
const hooks = local.dragAndDropHooks;
|
|
972
980
|
return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);
|
|
973
981
|
});
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
if (
|
|
982
|
+
const dragStateValue = hasDraggableDnd()
|
|
983
|
+
? local.dragAndDropHooks?.useDraggableCollectionState?.({
|
|
984
|
+
items: visibleRows().map((node) => node.value as T),
|
|
985
|
+
collection: state.collection,
|
|
986
|
+
selectedKeys: state.selectedKeys,
|
|
987
|
+
isSelected: (key) => state.isSelected(key),
|
|
988
|
+
})
|
|
989
|
+
: undefined;
|
|
990
|
+
const dragState = () => dragStateValue;
|
|
991
|
+
const dropStateValue = hasDroppableDnd()
|
|
992
|
+
? local.dragAndDropHooks?.useDroppableCollectionState?.({
|
|
993
|
+
get collection() {
|
|
994
|
+
return state.collection;
|
|
995
|
+
},
|
|
996
|
+
})
|
|
997
|
+
: undefined;
|
|
998
|
+
const dropState = () => dropStateValue;
|
|
999
|
+
createEffect(
|
|
1000
|
+
() => dropState(),
|
|
1001
|
+
(activeDropState) => {
|
|
1002
|
+
if (!activeDropState) return;
|
|
1003
|
+
const originalGetDropOperation = activeDropState.getDropOperation.bind(activeDropState);
|
|
1004
|
+
|
|
1005
|
+
activeDropState.getDropOperation = (target, types, allowedOperations) => {
|
|
1006
|
+
const currentDraggingKeys = dragState()?.draggingKeys ?? new Set<string | number>();
|
|
1007
|
+
if (target.type === "item" && currentDraggingKeys.size > 0) {
|
|
1008
|
+
if (currentDraggingKeys.has(target.key) && target.dropPosition === "on") {
|
|
1001
1009
|
return "cancel";
|
|
1002
1010
|
}
|
|
1003
|
-
|
|
1011
|
+
|
|
1012
|
+
let currentKey: Key | null = target.key;
|
|
1013
|
+
while (currentKey != null) {
|
|
1014
|
+
const item = state.collection.getItem(currentKey);
|
|
1015
|
+
const parentKey = item?.parentKey;
|
|
1016
|
+
if (parentKey != null && currentDraggingKeys.has(parentKey)) {
|
|
1017
|
+
return "cancel";
|
|
1018
|
+
}
|
|
1019
|
+
currentKey = parentKey ?? null;
|
|
1020
|
+
}
|
|
1004
1021
|
}
|
|
1005
|
-
}
|
|
1006
1022
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1023
|
+
return originalGetDropOperation(target, types, allowedOperations);
|
|
1024
|
+
};
|
|
1009
1025
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
if (!hooks?.useDraggableCollection || !activeDragState) return;
|
|
1019
|
-
hooks.useDraggableCollection({}, activeDragState, () => ref());
|
|
1020
|
-
});
|
|
1026
|
+
return () => {
|
|
1027
|
+
activeDropState.getDropOperation = originalGetDropOperation;
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
);
|
|
1031
|
+
if (local.dragAndDropHooks?.useDraggableCollection && dragStateValue) {
|
|
1032
|
+
local.dragAndDropHooks.useDraggableCollection({}, dragStateValue, () => ref());
|
|
1033
|
+
}
|
|
1021
1034
|
const contextValue = createMemo<TreeContextValue<T>>(() => ({
|
|
1022
1035
|
state,
|
|
1023
1036
|
collection: state.collection,
|
|
@@ -1027,12 +1040,12 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1027
1040
|
dragState: dragState(),
|
|
1028
1041
|
dropState: dropState(),
|
|
1029
1042
|
}));
|
|
1030
|
-
const
|
|
1043
|
+
const droppableCollectionValue = (() => {
|
|
1031
1044
|
if (!hasDroppableDnd()) return undefined;
|
|
1032
1045
|
const hooks = local.dragAndDropHooks;
|
|
1033
|
-
const activeDropState =
|
|
1046
|
+
const activeDropState = dropStateValue;
|
|
1034
1047
|
if (!hooks?.useDroppableCollection || !activeDropState) return undefined;
|
|
1035
|
-
const direction =
|
|
1048
|
+
const direction = locale().direction;
|
|
1036
1049
|
const baseDropTargetDelegate =
|
|
1037
1050
|
hooks.dropTargetDelegate ??
|
|
1038
1051
|
parentCollectionRenderer?.dropTargetDelegate ??
|
|
@@ -1092,7 +1105,7 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1092
1105
|
if (!target || target.type !== "item" || target.dropPosition !== "on") return;
|
|
1093
1106
|
const item = state.collection.getItem(target.key);
|
|
1094
1107
|
if (!item?.hasChildNodes) return;
|
|
1095
|
-
const currentDirection = ariaProps.direction ??
|
|
1108
|
+
const currentDirection = ariaProps.direction ?? locale().direction;
|
|
1096
1109
|
const expandKey = EXPANSION_KEYS.expand[currentDirection];
|
|
1097
1110
|
const collapseKey = EXPANSION_KEYS.collapse[currentDirection];
|
|
1098
1111
|
if (event.key === expandKey && !state.isExpanded(target.key)) {
|
|
@@ -1105,7 +1118,8 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1105
1118
|
activeDropState,
|
|
1106
1119
|
() => ref(),
|
|
1107
1120
|
);
|
|
1108
|
-
});
|
|
1121
|
+
})();
|
|
1122
|
+
const droppableCollection = () => droppableCollectionValue;
|
|
1109
1123
|
const isRootDropTarget = createMemo(() => {
|
|
1110
1124
|
return Boolean(dropState()?.target?.type === "root");
|
|
1111
1125
|
});
|
|
@@ -1127,37 +1141,34 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1127
1141
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return null;
|
|
1128
1142
|
const rows = visibleRows();
|
|
1129
1143
|
const baseRange = virtualizer.getVisibleRange(rows.length);
|
|
1130
|
-
const persistedIndexes = Array.from(persistedKeys())
|
|
1131
|
-
.map((key) => rows.findIndex((node) => node.key === key))
|
|
1132
|
-
.filter((index) => index >= 0);
|
|
1133
1144
|
const dropTarget = dropState()?.target;
|
|
1134
1145
|
const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection);
|
|
1135
|
-
const focusedKey = state.focusedKey;
|
|
1136
|
-
const focusedIndex =
|
|
1137
|
-
focusedKey != null ? rows.findIndex((node) => node.key === focusedKey) : -1;
|
|
1138
1146
|
const forceIncludeIndexes = [
|
|
1139
1147
|
dropTarget?.type === "item" ? rows.findIndex((node) => node.key === dropTarget.key) : -1,
|
|
1140
1148
|
normalizedDropKey != null ? rows.findIndex((node) => node.key === normalizedDropKey) : -1,
|
|
1141
|
-
dropTarget?.type === "item" ? -1 : focusedIndex,
|
|
1142
1149
|
].filter((index) => index >= 0);
|
|
1143
|
-
return mergePersistedKeysIntoVirtualRange(
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1150
|
+
return mergePersistedKeysIntoVirtualRange(baseRange, [], rows.length, virtualizer, 80, {
|
|
1151
|
+
forceIncludeIndexes,
|
|
1152
|
+
forceIncludeMaxSpan: 320,
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
const persistedOutsideIndexes = createMemo(() => {
|
|
1156
|
+
const range = virtualRange();
|
|
1157
|
+
if (!range) return [] as number[];
|
|
1158
|
+
const rows = visibleRows();
|
|
1159
|
+
const persistedIndexes = Array.from(persistedKeys())
|
|
1160
|
+
.map((key) => rows.findIndex((node) => node.key === key))
|
|
1161
|
+
.filter((index) => index >= 0);
|
|
1162
|
+
return indexesOutsideRange(range, persistedIndexes);
|
|
1154
1163
|
});
|
|
1155
1164
|
const virtualizedVisibleRows = createMemo(() => {
|
|
1156
1165
|
const range = virtualRange();
|
|
1157
1166
|
if (!range) return visibleRows();
|
|
1158
1167
|
return visibleRows().slice(range.start, range.end);
|
|
1159
1168
|
});
|
|
1160
|
-
|
|
1169
|
+
createTrackedEffect(() => {
|
|
1170
|
+
const _s2Cleanups: Array<() => void> = [];
|
|
1171
|
+
|
|
1161
1172
|
if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;
|
|
1162
1173
|
virtualizer.setDropTargetItemCountResolver(() => visibleRows().length);
|
|
1163
1174
|
virtualizer.setDropTargetIndexResolver((key) => {
|
|
@@ -1180,11 +1191,15 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1180
1191
|
level: typeof node.level === "number" ? node.level : undefined,
|
|
1181
1192
|
};
|
|
1182
1193
|
});
|
|
1183
|
-
|
|
1194
|
+
_s2Cleanups.push(() => {
|
|
1184
1195
|
virtualizer.setDropTargetIndexResolver(undefined);
|
|
1185
1196
|
virtualizer.setDropTargetItemCountResolver(undefined);
|
|
1186
1197
|
virtualizer.setDropTargetResolver(undefined);
|
|
1187
1198
|
});
|
|
1199
|
+
|
|
1200
|
+
return () => {
|
|
1201
|
+
for (const c of _s2Cleanups) c();
|
|
1202
|
+
};
|
|
1188
1203
|
});
|
|
1189
1204
|
const rowIndexByKey = createMemo(() => {
|
|
1190
1205
|
const map = new Map<Key, number>();
|
|
@@ -1227,9 +1242,11 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1227
1242
|
// Install tree-aware keyboard navigation override into the Virtualizer (if present).
|
|
1228
1243
|
// This replaces the generic index-based navigation with collection-level semantics
|
|
1229
1244
|
// (tree branch traversal, level-aware wrapping — RAC parity item #36).
|
|
1230
|
-
|
|
1245
|
+
createTrackedEffect(() => {
|
|
1246
|
+
const _s2Cleanups: Array<() => void> = [];
|
|
1247
|
+
|
|
1231
1248
|
if (!virtualizer) return;
|
|
1232
|
-
const direction =
|
|
1249
|
+
const direction = locale().direction;
|
|
1233
1250
|
const parentDelegate: TreeDropTargetDelegate = {
|
|
1234
1251
|
getDropTargetFromPoint:
|
|
1235
1252
|
parentCollectionRenderer?.dropTargetDelegate?.getDropTargetFromPoint ??
|
|
@@ -1250,9 +1267,13 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1250
1267
|
? (target, dir, isValid) => treeDelegate.getKeyboardNavigationTarget!(target, dir, isValid)
|
|
1251
1268
|
: undefined,
|
|
1252
1269
|
);
|
|
1253
|
-
|
|
1270
|
+
_s2Cleanups.push(() => {
|
|
1254
1271
|
virtualizer.setKeyboardNavigationOverride(undefined);
|
|
1255
1272
|
});
|
|
1273
|
+
|
|
1274
|
+
return () => {
|
|
1275
|
+
for (const c of _s2Cleanups) c();
|
|
1276
|
+
};
|
|
1256
1277
|
});
|
|
1257
1278
|
const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({
|
|
1258
1279
|
...parentCollectionRenderer,
|
|
@@ -1261,6 +1282,7 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1261
1282
|
dndDropIndicator(index, position) ??
|
|
1262
1283
|
parentCollectionRenderer?.renderDropIndicator?.(index, position),
|
|
1263
1284
|
}));
|
|
1285
|
+
const CollectionRoot = useCollectionRoot();
|
|
1264
1286
|
const rootKeyByNodeKey = createMemo(() => {
|
|
1265
1287
|
const rootMap = new Map<Key, Key>();
|
|
1266
1288
|
for (const row of visibleRows()) {
|
|
@@ -1313,7 +1335,6 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1313
1335
|
});
|
|
1314
1336
|
const renderTreeRow = (node: TreeNode<T>, itemIndex: number) => {
|
|
1315
1337
|
const beforeIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex, "before");
|
|
1316
|
-
const onIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex, "on");
|
|
1317
1338
|
const afterIndicatorIndexes = () => getAfterIndicatorIndexes(itemIndex, renderRange());
|
|
1318
1339
|
const itemData = treeItemDataFromNode(node);
|
|
1319
1340
|
const itemState: TreeRenderItemState = {
|
|
@@ -1324,7 +1345,6 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1324
1345
|
return (
|
|
1325
1346
|
<>
|
|
1326
1347
|
{beforeIndicator()}
|
|
1327
|
-
{onIndicator()}
|
|
1328
1348
|
{props.children(itemData, itemState)}
|
|
1329
1349
|
<For each={afterIndicatorIndexes()}>
|
|
1330
1350
|
{(afterIndex) => collectionRenderer().renderDropIndicator?.(afterIndex, "after")}
|
|
@@ -1334,11 +1354,9 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1334
1354
|
};
|
|
1335
1355
|
|
|
1336
1356
|
return (
|
|
1337
|
-
<TreeContext
|
|
1338
|
-
<TreeStateContext
|
|
1339
|
-
value={
|
|
1340
|
-
>
|
|
1341
|
-
<CollectionRendererContext.Provider value={collectionRenderer()}>
|
|
1357
|
+
<TreeContext value={contextValue() as unknown as TreeContextValue<object>}>
|
|
1358
|
+
<TreeStateContext value={state as unknown as TreeState<object, TreeCollection<object>>}>
|
|
1359
|
+
<CollectionRendererContext value={collectionRenderer()}>
|
|
1342
1360
|
<div
|
|
1343
1361
|
ref={(element) => {
|
|
1344
1362
|
setRef(element);
|
|
@@ -1352,15 +1370,15 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1352
1370
|
)}
|
|
1353
1371
|
class={renderProps.class()}
|
|
1354
1372
|
style={renderProps.style()}
|
|
1355
|
-
data-focused={state.isFocused
|
|
1356
|
-
data-focus-visible={isFocusVisible()
|
|
1357
|
-
data-disabled={ariaProps.isDisabled
|
|
1358
|
-
data-empty={isEmpty()
|
|
1359
|
-
data-drop-target={isRootDropTarget()
|
|
1373
|
+
data-focused={dataAttr(state.isFocused)}
|
|
1374
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
1375
|
+
data-disabled={dataAttr(ariaProps.isDisabled)}
|
|
1376
|
+
data-empty={dataAttr(isEmpty())}
|
|
1377
|
+
data-drop-target={dataAttr(isRootDropTarget())}
|
|
1360
1378
|
data-selection-mode={
|
|
1361
1379
|
stateProps.selectionMode !== "none" ? stateProps.selectionMode : undefined
|
|
1362
1380
|
}
|
|
1363
|
-
data-allows-dragging={hasDraggableDnd()
|
|
1381
|
+
data-allows-dragging={dataAttr(hasDraggableDnd())}
|
|
1364
1382
|
>
|
|
1365
1383
|
<SharedElementTransition>
|
|
1366
1384
|
{isEmpty() && local.renderEmptyState ? (
|
|
@@ -1369,16 +1387,57 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1369
1387
|
{local.renderEmptyState()}
|
|
1370
1388
|
</div>
|
|
1371
1389
|
</div>
|
|
1390
|
+
) : parentCollectionRenderer?.isVirtualized ? (
|
|
1391
|
+
<CollectionRoot
|
|
1392
|
+
collection={virtualRange() ? visibleRows() : []}
|
|
1393
|
+
scrollRef={() => ref()}
|
|
1394
|
+
persistedKeys={persistedKeys()}
|
|
1395
|
+
>
|
|
1396
|
+
<Show
|
|
1397
|
+
when={hasSections()}
|
|
1398
|
+
fallback={
|
|
1399
|
+
<For each={renderableRows()}>
|
|
1400
|
+
{(row) => renderTreeRow(row.node, row.globalIndex)}
|
|
1401
|
+
</For>
|
|
1402
|
+
}
|
|
1403
|
+
>
|
|
1404
|
+
<For each={sectionedRenderableRows() ?? []}>
|
|
1405
|
+
{(entry) => (
|
|
1406
|
+
<Show when={entry.rows.length > 0}>
|
|
1407
|
+
<Show
|
|
1408
|
+
when={entry.type === "section"}
|
|
1409
|
+
fallback={
|
|
1410
|
+
<For each={entry.rows}>
|
|
1411
|
+
{(row) => renderTreeRow(row.node, row.globalIndex)}
|
|
1412
|
+
</For>
|
|
1413
|
+
}
|
|
1414
|
+
>
|
|
1415
|
+
<TreeSection>
|
|
1416
|
+
{entry.type === "section" && entry.section.title ? (
|
|
1417
|
+
<TreeHeader>{entry.section.title}</TreeHeader>
|
|
1418
|
+
) : null}
|
|
1419
|
+
<For each={entry.rows}>
|
|
1420
|
+
{(row) => renderTreeRow(row.node, row.globalIndex)}
|
|
1421
|
+
</For>
|
|
1422
|
+
</TreeSection>
|
|
1423
|
+
</Show>
|
|
1424
|
+
</Show>
|
|
1425
|
+
)}
|
|
1426
|
+
</For>
|
|
1427
|
+
</Show>
|
|
1428
|
+
<For each={persistedOutsideIndexes()}>
|
|
1429
|
+
{(index) => {
|
|
1430
|
+
const node = visibleRows()[index];
|
|
1431
|
+
return node ? (
|
|
1432
|
+
<PersistedVirtualItem index={index}>
|
|
1433
|
+
{renderTreeRow(node, index)}
|
|
1434
|
+
</PersistedVirtualItem>
|
|
1435
|
+
) : null;
|
|
1436
|
+
}}
|
|
1437
|
+
</For>
|
|
1438
|
+
</CollectionRoot>
|
|
1372
1439
|
) : (
|
|
1373
1440
|
<>
|
|
1374
|
-
{virtualRange()?.offsetTop ? (
|
|
1375
|
-
<div
|
|
1376
|
-
role="presentation"
|
|
1377
|
-
aria-hidden="true"
|
|
1378
|
-
style={{ height: `${virtualRange()!.offsetTop}px` }}
|
|
1379
|
-
data-virtualizer-spacer="top"
|
|
1380
|
-
/>
|
|
1381
|
-
) : null}
|
|
1382
1441
|
<Show
|
|
1383
1442
|
when={hasSections()}
|
|
1384
1443
|
fallback={
|
|
@@ -1411,14 +1470,6 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1411
1470
|
)}
|
|
1412
1471
|
</For>
|
|
1413
1472
|
</Show>
|
|
1414
|
-
{virtualRange()?.offsetBottom ? (
|
|
1415
|
-
<div
|
|
1416
|
-
role="presentation"
|
|
1417
|
-
aria-hidden="true"
|
|
1418
|
-
style={{ height: `${virtualRange()!.offsetBottom}px` }}
|
|
1419
|
-
data-virtualizer-spacer="bottom"
|
|
1420
|
-
/>
|
|
1421
|
-
) : null}
|
|
1422
1473
|
</>
|
|
1423
1474
|
)}
|
|
1424
1475
|
</SharedElementTransition>
|
|
@@ -1439,9 +1490,9 @@ export function Tree<T extends object>(props: TreeProps<T>): JSX.Element {
|
|
|
1439
1490
|
</TreeLoadMoreItem>
|
|
1440
1491
|
)}
|
|
1441
1492
|
</div>
|
|
1442
|
-
</CollectionRendererContext
|
|
1443
|
-
</TreeStateContext
|
|
1444
|
-
</TreeContext
|
|
1493
|
+
</CollectionRendererContext>
|
|
1494
|
+
</TreeStateContext>
|
|
1495
|
+
</TreeContext>
|
|
1445
1496
|
);
|
|
1446
1497
|
}
|
|
1447
1498
|
|
|
@@ -1493,6 +1544,9 @@ export function TreeItem<T extends object>(props: TreeItemProps<T>): JSX.Element
|
|
|
1493
1544
|
const setItemRef = (element: HTMLElement) => {
|
|
1494
1545
|
setRef(element);
|
|
1495
1546
|
assignRef(local.ref, element);
|
|
1547
|
+
const dragRef = (draggableItem()?.dragProps as { ref?: (el: HTMLElement) => void } | undefined)
|
|
1548
|
+
?.ref;
|
|
1549
|
+
if (typeof dragRef === "function") dragRef(element);
|
|
1496
1550
|
};
|
|
1497
1551
|
|
|
1498
1552
|
const itemNode = createMemo(() => {
|
|
@@ -1619,11 +1673,11 @@ export function TreeItem<T extends object>(props: TreeItemProps<T>): JSX.Element
|
|
|
1619
1673
|
});
|
|
1620
1674
|
|
|
1621
1675
|
const rowContent = () => (
|
|
1622
|
-
<TreeItemContentContext
|
|
1676
|
+
<TreeItemContentContext value={renderValues()}>
|
|
1623
1677
|
<div {...treeItemAria.gridCellProps} class="solidaria-Tree-item-content">
|
|
1624
1678
|
{renderProps.renderChildren()}
|
|
1625
1679
|
</div>
|
|
1626
|
-
</TreeItemContentContext
|
|
1680
|
+
</TreeItemContentContext>
|
|
1627
1681
|
);
|
|
1628
1682
|
|
|
1629
1683
|
const mergedRowProps = () =>
|
|
@@ -1662,7 +1716,7 @@ export function TreeItem<T extends object>(props: TreeItemProps<T>): JSX.Element
|
|
|
1662
1716
|
: {};
|
|
1663
1717
|
|
|
1664
1718
|
return (
|
|
1665
|
-
<TreeItemContext
|
|
1719
|
+
<TreeItemContext value={itemContextValue() as unknown as TreeItemContextValue<object>}>
|
|
1666
1720
|
<div
|
|
1667
1721
|
ref={setItemRef}
|
|
1668
1722
|
{...domProps}
|
|
@@ -1670,25 +1724,25 @@ export function TreeItem<T extends object>(props: TreeItemProps<T>): JSX.Element
|
|
|
1670
1724
|
{...linkedRowDomProps()}
|
|
1671
1725
|
class={renderProps.class()}
|
|
1672
1726
|
style={rowStyle()}
|
|
1673
|
-
data-selected={isSelected()
|
|
1674
|
-
data-focused={isFocused()
|
|
1675
|
-
data-focus-visible={(isFocusVisible() && isFocused())
|
|
1676
|
-
data-pressed={isPressed()
|
|
1677
|
-
data-hovered={isHovered()
|
|
1678
|
-
data-disabled={isDisabled()
|
|
1679
|
-
data-expanded={isExpanded()
|
|
1680
|
-
data-expandable={isExpandable()
|
|
1681
|
-
data-has-child-items={isExpandable()
|
|
1727
|
+
data-selected={dataAttr(isSelected())}
|
|
1728
|
+
data-focused={dataAttr(isFocused())}
|
|
1729
|
+
data-focus-visible={dataAttr(isFocusVisible() && isFocused())}
|
|
1730
|
+
data-pressed={dataAttr(isPressed())}
|
|
1731
|
+
data-hovered={dataAttr(isHovered())}
|
|
1732
|
+
data-disabled={dataAttr(isDisabled())}
|
|
1733
|
+
data-expanded={dataAttr(isExpanded())}
|
|
1734
|
+
data-expandable={dataAttr(isExpandable())}
|
|
1735
|
+
data-has-child-items={dataAttr(isExpandable())}
|
|
1682
1736
|
data-level={level()}
|
|
1683
1737
|
data-selection-mode={
|
|
1684
1738
|
treeContext?.state.selectionMode !== "none" ? treeContext?.state.selectionMode : undefined
|
|
1685
1739
|
}
|
|
1686
|
-
data-dragging={draggableItem()?.isDragging
|
|
1687
|
-
data-drop-target={droppableItem()?.isDropTarget
|
|
1740
|
+
data-dragging={dataAttr(draggableItem()?.isDragging)}
|
|
1741
|
+
data-drop-target={dataAttr(droppableItem()?.isDropTarget)}
|
|
1688
1742
|
>
|
|
1689
1743
|
{rowContent()}
|
|
1690
1744
|
</div>
|
|
1691
|
-
</TreeItemContext
|
|
1745
|
+
</TreeItemContext>
|
|
1692
1746
|
);
|
|
1693
1747
|
}
|
|
1694
1748
|
|
|
@@ -1744,7 +1798,7 @@ export function TreeExpandButton(props: TreeExpandButtonProps): JSX.Element {
|
|
|
1744
1798
|
{...dataProps()}
|
|
1745
1799
|
class={props.class ?? "solidaria-Tree-expand-button"}
|
|
1746
1800
|
style={props.style}
|
|
1747
|
-
data-expanded={isExpanded()
|
|
1801
|
+
data-expanded={dataAttr(isExpanded())}
|
|
1748
1802
|
>
|
|
1749
1803
|
{renderChildren()}
|
|
1750
1804
|
</button>
|
|
@@ -1779,15 +1833,16 @@ export function TreeSelectionCheckbox(props: {
|
|
|
1779
1833
|
{...treeSelectionCheckboxAria.checkboxProps}
|
|
1780
1834
|
class={props.class ?? "solidaria-Tree-checkbox"}
|
|
1781
1835
|
style={props.style}
|
|
1782
|
-
|
|
1836
|
+
tabindex={props.excludeFromTabOrder ? -1 : 0}
|
|
1783
1837
|
aria-label={props["aria-label"] ?? treeSelectionCheckboxAria.checkboxProps["aria-label"]}
|
|
1784
1838
|
/>
|
|
1785
1839
|
);
|
|
1786
1840
|
}
|
|
1787
1841
|
|
|
1788
1842
|
export function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {
|
|
1789
|
-
|
|
1843
|
+
const [sentinel, setSentinel] = createSignal<HTMLDivElement | undefined>();
|
|
1790
1844
|
const [isPending, setIsPending] = createSignal(false);
|
|
1845
|
+
const scrollOffsetValue = createMemo(() => props.scrollOffset ?? 1);
|
|
1791
1846
|
const isLoading = () =>
|
|
1792
1847
|
!!props.isLoading ||
|
|
1793
1848
|
props.loadingState === "loading" ||
|
|
@@ -1804,21 +1859,26 @@ export function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {
|
|
|
1804
1859
|
}
|
|
1805
1860
|
};
|
|
1806
1861
|
|
|
1807
|
-
createEffect(
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1862
|
+
createEffect(
|
|
1863
|
+
() => ({
|
|
1864
|
+
current: sentinel(),
|
|
1865
|
+
scrollOffset: scrollOffsetValue(),
|
|
1866
|
+
}),
|
|
1867
|
+
({ current, scrollOffset }) => {
|
|
1868
|
+
if (!current || typeof IntersectionObserver !== "function") return;
|
|
1869
|
+
const margin = `0px 0px ${100 * scrollOffset}% 0px`;
|
|
1870
|
+
const observer = new IntersectionObserver(
|
|
1871
|
+
(entries) => {
|
|
1872
|
+
if (entries[0]?.isIntersecting) {
|
|
1873
|
+
void triggerLoadMore();
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
{ rootMargin: margin },
|
|
1877
|
+
);
|
|
1878
|
+
observer.observe(current);
|
|
1879
|
+
return () => observer.disconnect();
|
|
1880
|
+
},
|
|
1881
|
+
);
|
|
1822
1882
|
|
|
1823
1883
|
const renderProps = useRenderProps(
|
|
1824
1884
|
{
|
|
@@ -1835,7 +1895,7 @@ export function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {
|
|
|
1835
1895
|
return (
|
|
1836
1896
|
<>
|
|
1837
1897
|
<div style={{ position: "relative", width: 0, height: 0, overflow: "hidden" }} inert>
|
|
1838
|
-
<div ref={
|
|
1898
|
+
<div ref={setSentinel} style={{ position: "absolute", height: "1px", width: "1px" }} />
|
|
1839
1899
|
</div>
|
|
1840
1900
|
<div
|
|
1841
1901
|
role="row"
|
|
@@ -1848,7 +1908,7 @@ export function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {
|
|
|
1848
1908
|
}}
|
|
1849
1909
|
class={renderProps.class()}
|
|
1850
1910
|
style={renderProps.style()}
|
|
1851
|
-
data-loading={isLoading()
|
|
1911
|
+
data-loading={dataAttr(isLoading())}
|
|
1852
1912
|
data-level={props.level ?? 1}
|
|
1853
1913
|
>
|
|
1854
1914
|
<div
|
|
@@ -1930,11 +1990,11 @@ export function TreeSection(props: TreeSectionProps): JSX.Element {
|
|
|
1930
1990
|
slot={local.slot}
|
|
1931
1991
|
data-section
|
|
1932
1992
|
>
|
|
1933
|
-
<GridListHeaderContext
|
|
1934
|
-
<GridListHeaderInnerContext
|
|
1993
|
+
<GridListHeaderContext value={section.rowProps}>
|
|
1994
|
+
<GridListHeaderInnerContext value={section.rowHeaderProps}>
|
|
1935
1995
|
{local.children}
|
|
1936
|
-
</GridListHeaderInnerContext
|
|
1937
|
-
</GridListHeaderContext
|
|
1996
|
+
</GridListHeaderInnerContext>
|
|
1997
|
+
</GridListHeaderContext>
|
|
1938
1998
|
</div>
|
|
1939
1999
|
);
|
|
1940
2000
|
}
|