@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/ComboBox.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
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/ComboBox.tsx
|
|
13
|
+
import { DEFAULT_SLOT, OptionContent, Provider, dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
14
|
import { TextContext } from "./Text.js";
|
|
15
|
+
import { FieldErrorContext } from "./FieldError.js";
|
|
3
16
|
import { SelectionIndicatorContext } from "./SelectionIndicator.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
17
|
+
import { useCollectionRenderer, useCollectionRoot } from "./Collection.js";
|
|
18
|
+
import { i as VirtualizerItem } from "./Virtualizer2.js";
|
|
19
|
+
import { ListBoxLoadMoreItem } from "./ListBox.js";
|
|
20
|
+
import { className, createComponent, delegateEvents, effect, getNextElement, getNextMarker, insert, memo, readShallow, ref, runHydrationEvents, scope, setAttribute, setProperty, spread, style, template } from "@solidjs/web";
|
|
21
|
+
import { For, Show, createContext, createEffect, createMemo, createRenderEffect, createSignal, createTrackedEffect, onCleanup, useContext } from "solid-js";
|
|
22
|
+
import { createComboBox, createFilter, createFocusRing, createHover, createInteractOutside, createListBox, createOption, createPress, createScrollIntoViewOnFocus, getComboBoxData, isFocusVisible, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
|
|
23
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
7
24
|
import { createComboBoxState, defaultContainsFilter } from "@proyecto-viviana/solid-stately";
|
|
8
25
|
//#region src/ComboBox.tsx
|
|
9
26
|
/**
|
|
@@ -12,8 +29,18 @@ import { createComboBoxState, defaultContainsFilter } from "@proyecto-viviana/so
|
|
|
12
29
|
* A pre-wired headless combobox that combines state + aria hooks.
|
|
13
30
|
* Port of react-aria-components/src/ComboBox.tsx
|
|
14
31
|
*/
|
|
15
|
-
var _tmpl$ =
|
|
16
|
-
|
|
32
|
+
var _tmpl$ = /* @__PURE__ */ template(`<input type=hidden>`);
|
|
33
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div><!$><!/><!$><!/>`);
|
|
34
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<label>`);
|
|
35
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<span>`);
|
|
36
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<input>`);
|
|
37
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<button>`);
|
|
38
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div><!$><!/><!$><!/><!$><!/>`);
|
|
39
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div role=option data-empty-state style=display:contents>`);
|
|
40
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
41
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div role=group aria-label="Selected items">`);
|
|
42
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<span><!$><!/><button type=button class=solidaria-ComboBox-tag-remove tabindex=-1>×`);
|
|
43
|
+
function assignRef$1(ref, el) {
|
|
17
44
|
if (!ref) return;
|
|
18
45
|
if (typeof ref === "function") ref(el);
|
|
19
46
|
else ref.current = el;
|
|
@@ -29,8 +56,9 @@ function callInputKeyDown(handler, event) {
|
|
|
29
56
|
* A combobox combines a text input with a listbox, allowing users to filter a list of options.
|
|
30
57
|
*/
|
|
31
58
|
function ComboBox(props) {
|
|
32
|
-
const contextSlotProps = useContext(ComboBoxContext)?.slots?.[props.slot
|
|
33
|
-
const
|
|
59
|
+
const contextSlotProps = useContext(ComboBoxContext)?.slots?.[typeof props.slot === "string" ? props.slot : "default"];
|
|
60
|
+
const mergedComboBoxProps = contextSlotProps ? mergeProps$1(contextSlotProps, props) : props;
|
|
61
|
+
const [local, stateProps, ariaProps] = splitProps(mergedComboBoxProps, [
|
|
34
62
|
"class",
|
|
35
63
|
"style",
|
|
36
64
|
"slot",
|
|
@@ -65,14 +93,16 @@ function ComboBox(props) {
|
|
|
65
93
|
"name",
|
|
66
94
|
"formValue"
|
|
67
95
|
]);
|
|
68
|
-
|
|
96
|
+
const [inputEl, setInputEl] = createSignal(null, { ownedWrite: true });
|
|
69
97
|
let buttonRef = null;
|
|
70
98
|
let triggerRef = null;
|
|
71
99
|
let listBoxRef = null;
|
|
100
|
+
const [popoverRef, setPopoverRef] = createSignal(null);
|
|
72
101
|
const optionActions = /* @__PURE__ */ new Map();
|
|
73
102
|
const runOptionAction = (key) => {
|
|
74
103
|
optionActions.get(key)?.();
|
|
75
104
|
};
|
|
105
|
+
const intlFilter = createFilter({ sensitivity: "base" });
|
|
76
106
|
const state = createComboBoxState({
|
|
77
107
|
get items() {
|
|
78
108
|
return stateProps.items;
|
|
@@ -132,7 +162,7 @@ function ComboBox(props) {
|
|
|
132
162
|
return stateProps.onOpenChange;
|
|
133
163
|
},
|
|
134
164
|
get defaultFilter() {
|
|
135
|
-
return stateProps.defaultFilter;
|
|
165
|
+
return stateProps.defaultFilter ?? intlFilter().contains;
|
|
136
166
|
},
|
|
137
167
|
get allowsCustomValue() {
|
|
138
168
|
return stateProps.allowsCustomValue;
|
|
@@ -167,8 +197,11 @@ function ComboBox(props) {
|
|
|
167
197
|
...comboBoxAriaProps(),
|
|
168
198
|
get name() {
|
|
169
199
|
return effectiveFormValue() === "text" ? stateProps.name : void 0;
|
|
200
|
+
},
|
|
201
|
+
get allowsCustomValue() {
|
|
202
|
+
return stateProps.allowsCustomValue;
|
|
170
203
|
}
|
|
171
|
-
}), state, () =>
|
|
204
|
+
}), state, () => inputEl(), () => buttonRef, () => listBoxRef, () => popoverRef());
|
|
172
205
|
const getInputProps = () => {
|
|
173
206
|
const inputProps = comboBoxAria.inputProps;
|
|
174
207
|
const originalOnKeyDown = inputProps.onKeyDown;
|
|
@@ -182,16 +215,13 @@ function ComboBox(props) {
|
|
|
182
215
|
}
|
|
183
216
|
};
|
|
184
217
|
};
|
|
185
|
-
const { isHovered, hoverProps } = createHover({ get isDisabled() {
|
|
186
|
-
return ariaProps.isDisabled;
|
|
187
|
-
} });
|
|
188
218
|
const renderValues = createMemo(() => ({
|
|
189
219
|
isOpen: comboBoxAria.isOpen(),
|
|
190
220
|
isFocused: comboBoxAria.isFocused(),
|
|
191
221
|
isFocusVisible: comboBoxAria.isFocusVisible(),
|
|
192
222
|
isDisabled: !!ariaProps.isDisabled,
|
|
193
223
|
isRequired: !!ariaProps.isRequired,
|
|
194
|
-
isInvalid:
|
|
224
|
+
isInvalid: comboBoxAria.isInvalid,
|
|
195
225
|
isReadOnly: !!ariaProps.isReadOnly,
|
|
196
226
|
isSelected: state.selectedKey() != null,
|
|
197
227
|
inputValue: state.inputValue()
|
|
@@ -204,10 +234,6 @@ function ComboBox(props) {
|
|
|
204
234
|
const domProps = createMemo(() => {
|
|
205
235
|
return filterDOMProps(ariaProps, { global: true });
|
|
206
236
|
});
|
|
207
|
-
const cleanHoverProps = () => {
|
|
208
|
-
const { ref: _ref, ...rest } = hoverProps;
|
|
209
|
-
return rest;
|
|
210
|
-
};
|
|
211
237
|
const ComboBoxChildren = () => typeof local.children === "function" ? local.children(renderValues()) : local.children;
|
|
212
238
|
const textSlots = { slots: {
|
|
213
239
|
get description() {
|
|
@@ -217,7 +243,19 @@ function ComboBox(props) {
|
|
|
217
243
|
return comboBoxAria.errorMessageProps;
|
|
218
244
|
}
|
|
219
245
|
} };
|
|
220
|
-
|
|
246
|
+
const fieldErrorContext = {
|
|
247
|
+
get validation() {
|
|
248
|
+
return {
|
|
249
|
+
isInvalid: comboBoxAria.isInvalid,
|
|
250
|
+
validationErrors: comboBoxAria.validationErrors,
|
|
251
|
+
validationDetails: comboBoxAria.validationDetails
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
get errorMessageProps() {
|
|
255
|
+
return comboBoxAria.errorMessageProps;
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
return createComponent(ComboBoxContext, {
|
|
221
259
|
get value() {
|
|
222
260
|
return {
|
|
223
261
|
state,
|
|
@@ -240,9 +278,9 @@ function ComboBox(props) {
|
|
|
240
278
|
isFocused: comboBoxAria.isFocused,
|
|
241
279
|
isFocusVisible: comboBoxAria.isFocusVisible,
|
|
242
280
|
items: stateProps.items ?? stateProps.defaultItems ?? [],
|
|
243
|
-
inputRef: () =>
|
|
281
|
+
inputRef: () => inputEl(),
|
|
244
282
|
setInputRef: (el) => {
|
|
245
|
-
|
|
283
|
+
setInputEl(el);
|
|
246
284
|
},
|
|
247
285
|
buttonRef: () => buttonRef,
|
|
248
286
|
setButtonRef: (el) => {
|
|
@@ -256,6 +294,8 @@ function ComboBox(props) {
|
|
|
256
294
|
setListBoxRef: (el) => {
|
|
257
295
|
listBoxRef = el;
|
|
258
296
|
},
|
|
297
|
+
popoverRef,
|
|
298
|
+
setPopoverRef,
|
|
259
299
|
registerOptionAction: (key, action) => {
|
|
260
300
|
if (action) optionActions.set(key, action);
|
|
261
301
|
else optionActions.delete(key);
|
|
@@ -265,74 +305,77 @@ function ComboBox(props) {
|
|
|
265
305
|
};
|
|
266
306
|
},
|
|
267
307
|
get children() {
|
|
268
|
-
return createComponent(ComboBoxStateContext
|
|
308
|
+
return createComponent(ComboBoxStateContext, {
|
|
269
309
|
value: state,
|
|
270
310
|
get children() {
|
|
271
|
-
var _el$ = getNextElement(_tmpl$2)
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
311
|
+
var _el$ = getNextElement(_tmpl$2);
|
|
312
|
+
var _el$2 = _el$.firstChild;
|
|
313
|
+
var [_el$3, _el$4] = getNextMarker(_el$2.nextSibling);
|
|
314
|
+
var _el$6 = _el$3.nextSibling;
|
|
315
|
+
var [_el$7, _el$8] = getNextMarker(_el$6.nextSibling);
|
|
316
|
+
ref(() => {
|
|
317
|
+
return (el) => {
|
|
318
|
+
assignRef$1(local.ref, el);
|
|
319
|
+
assignRef$1(local.rootRef, el);
|
|
320
|
+
};
|
|
275
321
|
}, _el$);
|
|
276
|
-
spread(_el$,
|
|
277
|
-
get
|
|
322
|
+
spread(_el$, [domProps, {
|
|
323
|
+
get "class"() {
|
|
278
324
|
return renderProps.class();
|
|
279
325
|
},
|
|
280
326
|
get style() {
|
|
281
327
|
return renderProps.style();
|
|
282
328
|
},
|
|
283
|
-
get
|
|
284
|
-
return comboBoxAria.isOpen()
|
|
329
|
+
get "data-open"() {
|
|
330
|
+
return dataAttr(comboBoxAria.isOpen());
|
|
285
331
|
},
|
|
286
|
-
get
|
|
287
|
-
return comboBoxAria.isFocused()
|
|
332
|
+
get "data-focused"() {
|
|
333
|
+
return dataAttr(comboBoxAria.isFocused());
|
|
288
334
|
},
|
|
289
|
-
get
|
|
290
|
-
return
|
|
335
|
+
get "data-disabled"() {
|
|
336
|
+
return dataAttr(ariaProps.isDisabled);
|
|
291
337
|
},
|
|
292
|
-
get
|
|
293
|
-
return ariaProps.
|
|
338
|
+
get "data-required"() {
|
|
339
|
+
return dataAttr(ariaProps.isRequired);
|
|
294
340
|
},
|
|
295
|
-
get
|
|
296
|
-
return
|
|
341
|
+
get "data-invalid"() {
|
|
342
|
+
return dataAttr(comboBoxAria.isInvalid);
|
|
297
343
|
},
|
|
298
|
-
get
|
|
299
|
-
return ariaProps.
|
|
300
|
-
},
|
|
301
|
-
get ["data-readonly"]() {
|
|
302
|
-
return ariaProps.isReadOnly || void 0;
|
|
303
|
-
},
|
|
304
|
-
get ["data-hovered"]() {
|
|
305
|
-
return isHovered() || void 0;
|
|
344
|
+
get "data-readonly"() {
|
|
345
|
+
return dataAttr(ariaProps.isReadOnly);
|
|
306
346
|
},
|
|
307
347
|
get slot() {
|
|
308
348
|
return local.slot;
|
|
309
349
|
}
|
|
310
|
-
}
|
|
350
|
+
}], true);
|
|
351
|
+
insert(_el$, createComponent(Provider, {
|
|
352
|
+
values: [[TextContext, textSlots], [FieldErrorContext, fieldErrorContext]],
|
|
353
|
+
get children() {
|
|
354
|
+
return createComponent(ComboBoxChildren, {});
|
|
355
|
+
}
|
|
356
|
+
}), _el$3, _el$4);
|
|
311
357
|
insert(_el$, createComponent(Show, {
|
|
312
358
|
get when() {
|
|
313
|
-
return memo(() =>
|
|
359
|
+
return memo(() => {
|
|
360
|
+
return !!stateProps.name;
|
|
361
|
+
})() ? effectiveFormValue() === "key" : stateProps.name;
|
|
314
362
|
},
|
|
315
363
|
get children() {
|
|
316
|
-
var _el$
|
|
317
|
-
effect((
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
364
|
+
var _el$5 = getNextElement(_tmpl$);
|
|
365
|
+
effect(() => {
|
|
366
|
+
return {
|
|
367
|
+
e: stateProps.name,
|
|
368
|
+
t: ariaProps.form,
|
|
369
|
+
a: state.selectedKey()?.toString() ?? ""
|
|
370
|
+
};
|
|
371
|
+
}, ({ e, t, a }, _p$) => {
|
|
372
|
+
e !== _p$?.e && setAttribute(_el$5, "name", e);
|
|
373
|
+
t !== _p$?.t && setAttribute(_el$5, "form", t);
|
|
374
|
+
setProperty(_el$5, "value", a);
|
|
325
375
|
});
|
|
326
|
-
|
|
327
|
-
return _el$2;
|
|
376
|
+
return _el$5;
|
|
328
377
|
}
|
|
329
|
-
}), _el$
|
|
330
|
-
insert(_el$, createComponent(Provider, {
|
|
331
|
-
values: [[TextContext, textSlots]],
|
|
332
|
-
get children() {
|
|
333
|
-
return createComponent(ComboBoxChildren, {});
|
|
334
|
-
}
|
|
335
|
-
}), _el$6, _co$2);
|
|
378
|
+
}), _el$7, _el$8);
|
|
336
379
|
runHydrationEvents();
|
|
337
380
|
return _el$;
|
|
338
381
|
}
|
|
@@ -356,20 +399,24 @@ function ComboBoxLabel(props) {
|
|
|
356
399
|
const { ref: _ref, ...rest } = context.labelProps();
|
|
357
400
|
return rest;
|
|
358
401
|
};
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
402
|
+
var _el$9 = getNextElement(_tmpl$3);
|
|
403
|
+
spread(_el$9, [
|
|
404
|
+
domProps,
|
|
405
|
+
cleanLabelProps,
|
|
406
|
+
{
|
|
407
|
+
get "class"() {
|
|
363
408
|
return local.class;
|
|
364
409
|
},
|
|
365
410
|
get style() {
|
|
366
411
|
return local.style;
|
|
367
412
|
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return
|
|
372
|
-
})
|
|
413
|
+
}
|
|
414
|
+
], true);
|
|
415
|
+
insert(_el$9, scope(() => {
|
|
416
|
+
return local.children;
|
|
417
|
+
}));
|
|
418
|
+
runHydrationEvents();
|
|
419
|
+
return _el$9;
|
|
373
420
|
}
|
|
374
421
|
/**
|
|
375
422
|
* Description element for a combobox.
|
|
@@ -387,20 +434,27 @@ function ComboBoxDescription(props) {
|
|
|
387
434
|
const { ref: _ref, ...rest } = context.descriptionProps();
|
|
388
435
|
return rest;
|
|
389
436
|
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
437
|
+
var _el$10 = getNextElement(_tmpl$4);
|
|
438
|
+
spread(_el$10, [
|
|
439
|
+
domProps,
|
|
440
|
+
cleanDescriptionProps,
|
|
441
|
+
{
|
|
442
|
+
get slot() {
|
|
443
|
+
return local.slot ?? "description";
|
|
444
|
+
},
|
|
445
|
+
get "class"() {
|
|
394
446
|
return local.class;
|
|
395
447
|
},
|
|
396
448
|
get style() {
|
|
397
449
|
return local.style;
|
|
398
450
|
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
return
|
|
403
|
-
})
|
|
451
|
+
}
|
|
452
|
+
], true);
|
|
453
|
+
insert(_el$10, scope(() => {
|
|
454
|
+
return local.children;
|
|
455
|
+
}));
|
|
456
|
+
runHydrationEvents();
|
|
457
|
+
return _el$10;
|
|
404
458
|
}
|
|
405
459
|
/**
|
|
406
460
|
* Error message element for a combobox.
|
|
@@ -418,20 +472,27 @@ function ComboBoxErrorMessage(props) {
|
|
|
418
472
|
const { ref: _ref, ...rest } = context.errorMessageProps();
|
|
419
473
|
return rest;
|
|
420
474
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
475
|
+
var _el$11 = getNextElement(_tmpl$4);
|
|
476
|
+
spread(_el$11, [
|
|
477
|
+
domProps,
|
|
478
|
+
cleanErrorMessageProps,
|
|
479
|
+
{
|
|
480
|
+
get slot() {
|
|
481
|
+
return local.slot ?? "errorMessage";
|
|
482
|
+
},
|
|
483
|
+
get "class"() {
|
|
425
484
|
return local.class;
|
|
426
485
|
},
|
|
427
486
|
get style() {
|
|
428
487
|
return local.style;
|
|
429
488
|
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
return
|
|
434
|
-
})
|
|
489
|
+
}
|
|
490
|
+
], true);
|
|
491
|
+
insert(_el$11, scope(() => {
|
|
492
|
+
return local.children;
|
|
493
|
+
}));
|
|
494
|
+
runHydrationEvents();
|
|
495
|
+
return _el$11;
|
|
435
496
|
}
|
|
436
497
|
/**
|
|
437
498
|
* The text input for a combobox.
|
|
@@ -466,45 +527,47 @@ function ComboBoxInput(props) {
|
|
|
466
527
|
defaultClassName: "solidaria-ComboBox-input"
|
|
467
528
|
}, renderValues);
|
|
468
529
|
const cleanInputProps = () => {
|
|
469
|
-
const { ref: _ref1, value: _value, ...rest } = context.inputProps();
|
|
530
|
+
const { ref: _ref1, value: _value, "data-open": _dataOpen, ...rest } = context.inputProps();
|
|
470
531
|
return rest;
|
|
471
532
|
};
|
|
472
533
|
const cleanHoverProps = () => {
|
|
473
534
|
const { ref: _ref2, ...rest } = hoverProps;
|
|
474
535
|
return rest;
|
|
475
536
|
};
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
537
|
+
var _el$12 = getNextElement(_tmpl$5);
|
|
538
|
+
ref(() => {
|
|
539
|
+
return (el) => setInputRef(el);
|
|
540
|
+
}, _el$12);
|
|
541
|
+
spread(_el$12, [
|
|
542
|
+
domProps,
|
|
543
|
+
cleanInputProps,
|
|
544
|
+
cleanHoverProps,
|
|
545
|
+
{
|
|
480
546
|
get value() {
|
|
481
547
|
return state.inputValue();
|
|
482
548
|
},
|
|
483
|
-
get
|
|
549
|
+
get "class"() {
|
|
484
550
|
return renderProps.class();
|
|
485
551
|
},
|
|
486
552
|
get style() {
|
|
487
553
|
return renderProps.style();
|
|
488
554
|
},
|
|
489
|
-
get
|
|
490
|
-
return
|
|
491
|
-
},
|
|
492
|
-
get ["data-focused"]() {
|
|
493
|
-
return isFocused() || void 0;
|
|
555
|
+
get "data-focused"() {
|
|
556
|
+
return dataAttr(isFocused());
|
|
494
557
|
},
|
|
495
|
-
get
|
|
496
|
-
return isFocusVisible()
|
|
558
|
+
get "data-focus-visible"() {
|
|
559
|
+
return dataAttr(isFocusVisible());
|
|
497
560
|
},
|
|
498
|
-
get
|
|
499
|
-
return isHovered()
|
|
561
|
+
get "data-hovered"() {
|
|
562
|
+
return dataAttr(isHovered());
|
|
500
563
|
},
|
|
501
|
-
get
|
|
502
|
-
return state.isDisabled
|
|
564
|
+
get "data-disabled"() {
|
|
565
|
+
return dataAttr(state.isDisabled);
|
|
503
566
|
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
567
|
+
}
|
|
568
|
+
], false);
|
|
569
|
+
runHydrationEvents();
|
|
570
|
+
return _el$12;
|
|
508
571
|
}
|
|
509
572
|
function ComboBoxValue(props) {
|
|
510
573
|
const context = useContext(ComboBoxContext);
|
|
@@ -537,25 +600,29 @@ function ComboBoxValue(props) {
|
|
|
537
600
|
selectedText: selectedText(),
|
|
538
601
|
state
|
|
539
602
|
}));
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
return () => _c$() ? renderProps.renderChildren() : memo(() => !!isPlaceholder())() ? props.placeholder : textValue();
|
|
545
|
-
})());
|
|
546
|
-
effect((_p$) => {
|
|
547
|
-
var _v$3 = renderProps.class(), _v$4 = renderProps.style(), _v$5 = isPlaceholder() || void 0;
|
|
548
|
-
_v$3 !== _p$.e && className(_el$1, _p$.e = _v$3);
|
|
549
|
-
_p$.t = style(_el$1, _v$4, _p$.t);
|
|
550
|
-
_v$5 !== _p$.a && setAttribute(_el$1, "data-placeholder", _p$.a = _v$5);
|
|
551
|
-
return _p$;
|
|
552
|
-
}, {
|
|
553
|
-
e: void 0,
|
|
554
|
-
t: void 0,
|
|
555
|
-
a: void 0
|
|
603
|
+
var _el$13 = getNextElement(_tmpl$4);
|
|
604
|
+
insert(_el$13, scope((() => {
|
|
605
|
+
var _c$ = memo(() => {
|
|
606
|
+
return !!props.children;
|
|
556
607
|
});
|
|
557
|
-
return
|
|
558
|
-
|
|
608
|
+
return () => {
|
|
609
|
+
return _c$() ? renderProps.renderChildren() : memo(() => {
|
|
610
|
+
return !!isPlaceholder();
|
|
611
|
+
})() ? props.placeholder : textValue();
|
|
612
|
+
};
|
|
613
|
+
})()));
|
|
614
|
+
effect(() => {
|
|
615
|
+
return {
|
|
616
|
+
e: readShallow(renderProps.class()),
|
|
617
|
+
t: readShallow(renderProps.style()),
|
|
618
|
+
a: dataAttr(isPlaceholder())
|
|
619
|
+
};
|
|
620
|
+
}, ({ e, t, a }, _p$) => {
|
|
621
|
+
className(_el$13, e, _p$?.e);
|
|
622
|
+
style(_el$13, t, _p$?.t);
|
|
623
|
+
a !== _p$?.a && setAttribute(_el$13, "data-placeholder", a);
|
|
624
|
+
});
|
|
625
|
+
return _el$13;
|
|
559
626
|
}
|
|
560
627
|
/**
|
|
561
628
|
* The trigger button for a combobox.
|
|
@@ -570,15 +637,22 @@ function ComboBoxButton(props) {
|
|
|
570
637
|
]);
|
|
571
638
|
const context = useContext(ComboBoxContext);
|
|
572
639
|
if (!context) throw new Error("ComboBoxButton must be used within a ComboBox");
|
|
573
|
-
const { isOpen,
|
|
640
|
+
const { isOpen, state, setButtonRef } = context;
|
|
574
641
|
const { isHovered, hoverProps } = createHover({ get isDisabled() {
|
|
575
642
|
return state.isDisabled;
|
|
576
643
|
} });
|
|
644
|
+
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
645
|
+
const { isPressed, pressProps } = createPress({
|
|
646
|
+
get isDisabled() {
|
|
647
|
+
return state.isDisabled || state.isReadOnly;
|
|
648
|
+
},
|
|
649
|
+
preventFocusOnPress: true
|
|
650
|
+
});
|
|
577
651
|
const renderValues = createMemo(() => ({
|
|
578
652
|
isOpen: isOpen(),
|
|
579
653
|
isFocused: isFocused(),
|
|
580
654
|
isHovered: isHovered(),
|
|
581
|
-
isPressed:
|
|
655
|
+
isPressed: isPressed(),
|
|
582
656
|
isDisabled: state.isDisabled
|
|
583
657
|
}));
|
|
584
658
|
const renderProps = useRenderProps({
|
|
@@ -590,46 +664,57 @@ function ComboBoxButton(props) {
|
|
|
590
664
|
defaultClassName: "solidaria-ComboBox-button"
|
|
591
665
|
}, renderValues);
|
|
592
666
|
const cleanButtonProps = () => {
|
|
593
|
-
const { ref: _ref1, ...rest } = context.buttonProps();
|
|
667
|
+
const { ref: _ref1, "data-open": _dataOpen, ...rest } = context.buttonProps();
|
|
594
668
|
return rest;
|
|
595
669
|
};
|
|
596
670
|
const cleanHoverProps = () => {
|
|
597
671
|
const { ref: _ref2, ...rest } = hoverProps;
|
|
598
672
|
return rest;
|
|
599
673
|
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
674
|
+
const cleanFocusProps = () => {
|
|
675
|
+
const { ref: _ref3, ...rest } = focusProps;
|
|
676
|
+
return rest;
|
|
677
|
+
};
|
|
678
|
+
const cleanPressProps = () => {
|
|
679
|
+
const { ref: _ref4, ...rest } = pressProps;
|
|
680
|
+
return rest;
|
|
681
|
+
};
|
|
682
|
+
const mergedButtonProps = () => mergeProps$1(domProps, cleanButtonProps(), cleanHoverProps(), cleanFocusProps(), cleanPressProps());
|
|
683
|
+
var _el$14 = getNextElement(_tmpl$6);
|
|
684
|
+
ref(() => {
|
|
685
|
+
return (el) => {
|
|
603
686
|
setButtonRef(el);
|
|
604
|
-
assignRef(local.ref, el);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return
|
|
632
|
-
})
|
|
687
|
+
assignRef$1(local.ref, el);
|
|
688
|
+
};
|
|
689
|
+
}, _el$14);
|
|
690
|
+
spread(_el$14, [mergedButtonProps, {
|
|
691
|
+
get "class"() {
|
|
692
|
+
return renderProps.class();
|
|
693
|
+
},
|
|
694
|
+
get style() {
|
|
695
|
+
return renderProps.style();
|
|
696
|
+
},
|
|
697
|
+
get "data-pressed"() {
|
|
698
|
+
return dataAttr(isPressed());
|
|
699
|
+
},
|
|
700
|
+
get "data-focused"() {
|
|
701
|
+
return dataAttr(isFocused());
|
|
702
|
+
},
|
|
703
|
+
get "data-focus-visible"() {
|
|
704
|
+
return dataAttr(isFocusVisible());
|
|
705
|
+
},
|
|
706
|
+
get "data-hovered"() {
|
|
707
|
+
return dataAttr(isHovered());
|
|
708
|
+
},
|
|
709
|
+
get "data-disabled"() {
|
|
710
|
+
return dataAttr(state.isDisabled);
|
|
711
|
+
}
|
|
712
|
+
}], true);
|
|
713
|
+
insert(_el$14, scope(() => {
|
|
714
|
+
return renderProps.renderChildren();
|
|
715
|
+
}));
|
|
716
|
+
runHydrationEvents();
|
|
717
|
+
return _el$14;
|
|
633
718
|
}
|
|
634
719
|
/**
|
|
635
720
|
* The listbox popup for a combobox.
|
|
@@ -639,12 +724,17 @@ function ComboBoxListBox(props) {
|
|
|
639
724
|
"class",
|
|
640
725
|
"style",
|
|
641
726
|
"slot",
|
|
642
|
-
"children"
|
|
727
|
+
"children",
|
|
728
|
+
"renderEmptyState",
|
|
729
|
+
"onLoadMore",
|
|
730
|
+
"isLoading",
|
|
731
|
+
"renderLoadMore",
|
|
732
|
+
"loadMoreClass"
|
|
643
733
|
]);
|
|
644
734
|
const rawContext = useContext(ComboBoxContext);
|
|
645
735
|
if (!rawContext) throw new Error("ComboBoxListBox must be used within a ComboBox");
|
|
646
736
|
const context = rawContext;
|
|
647
|
-
const { state: comboBoxState, listState, isOpen, inputRef, buttonRef, setListBoxRef } = context;
|
|
737
|
+
const { state: comboBoxState, listState, isOpen, inputRef, buttonRef, setListBoxRef, setPopoverRef } = context;
|
|
648
738
|
const state = comboBoxState;
|
|
649
739
|
let listBoxRef;
|
|
650
740
|
createScrollIntoViewOnFocus({
|
|
@@ -660,14 +750,22 @@ function ComboBoxListBox(props) {
|
|
|
660
750
|
const button = buttonRef();
|
|
661
751
|
if (input?.contains(target)) return;
|
|
662
752
|
if (button?.contains(target)) return;
|
|
753
|
+
if (target.closest("[role=\"listbox\"]") || target.closest("[role=\"option\"]")) return;
|
|
663
754
|
if (isOpen()) state.close();
|
|
664
755
|
},
|
|
665
756
|
get isDisabled() {
|
|
666
757
|
return !isOpen();
|
|
667
758
|
}
|
|
668
759
|
});
|
|
669
|
-
const
|
|
670
|
-
const
|
|
760
|
+
const parentCollectionRenderer = useCollectionRenderer();
|
|
761
|
+
const CollectionRoot = useCollectionRoot();
|
|
762
|
+
const isVirtualized = () => parentCollectionRenderer?.isVirtualized === true;
|
|
763
|
+
const { listBoxProps } = createListBox(() => ({
|
|
764
|
+
...context.listBoxProps(),
|
|
765
|
+
isVirtualized: parentCollectionRenderer?.isVirtualized
|
|
766
|
+
}), listState);
|
|
767
|
+
const { isFocused: isListBoxFocused, isFocusVisible: isListBoxFocusVisible, focusProps } = createFocusRing();
|
|
768
|
+
const renderValues = createMemo(() => ({ isFocused: isListBoxFocused() }));
|
|
671
769
|
const renderProps = useRenderProps({
|
|
672
770
|
class: local.class,
|
|
673
771
|
style: local.style,
|
|
@@ -681,6 +779,10 @@ function ComboBoxListBox(props) {
|
|
|
681
779
|
const { ref: _ref2, ...rest } = listBoxProps;
|
|
682
780
|
return rest;
|
|
683
781
|
};
|
|
782
|
+
const cleanFocusProps = () => {
|
|
783
|
+
const { ref: _ref3, ...rest } = focusProps;
|
|
784
|
+
return rest;
|
|
785
|
+
};
|
|
684
786
|
const items = () => Array.from(state.collection());
|
|
685
787
|
const getNodeValue = (node) => {
|
|
686
788
|
if (node.value != null) return node.value;
|
|
@@ -689,71 +791,166 @@ function ComboBoxListBox(props) {
|
|
|
689
791
|
return (candidate.key ?? candidate.id ?? index) === node.key;
|
|
690
792
|
}) ?? null;
|
|
691
793
|
};
|
|
794
|
+
const [listBoxEl, setListBoxEl] = createSignal(null, { ownedWrite: true });
|
|
795
|
+
createEffect(() => listBoxEl(), (el) => {
|
|
796
|
+
if (!el) {
|
|
797
|
+
setPopoverRef(null);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const overlay = el.closest("[data-placement]");
|
|
801
|
+
setPopoverRef(overlay instanceof HTMLElement ? overlay : el);
|
|
802
|
+
});
|
|
692
803
|
const setListBoxElement = (el) => {
|
|
693
804
|
listBoxRef = el;
|
|
694
805
|
setListBoxRef(el);
|
|
806
|
+
setListBoxEl(el);
|
|
807
|
+
onCleanup(() => {
|
|
808
|
+
listBoxRef = void 0;
|
|
809
|
+
setListBoxRef(null);
|
|
810
|
+
setListBoxEl(null);
|
|
811
|
+
setPopoverRef(null);
|
|
812
|
+
});
|
|
695
813
|
};
|
|
696
|
-
onCleanup(() => {
|
|
697
|
-
setListBoxRef(null);
|
|
698
|
-
});
|
|
699
814
|
return createComponent(Show, {
|
|
700
815
|
get when() {
|
|
701
816
|
return isOpen();
|
|
702
817
|
},
|
|
703
818
|
get children() {
|
|
704
|
-
var _el$
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
819
|
+
var _el$15 = getNextElement(_tmpl$7);
|
|
820
|
+
var _el$16 = _el$15.firstChild;
|
|
821
|
+
var [_el$17, _el$18] = getNextMarker(_el$16.nextSibling);
|
|
822
|
+
var _el$19 = _el$17.nextSibling;
|
|
823
|
+
var [_el$20, _el$21] = getNextMarker(_el$19.nextSibling);
|
|
824
|
+
var _el$22 = _el$20.nextSibling;
|
|
825
|
+
var [_el$23, _el$24] = getNextMarker(_el$22.nextSibling);
|
|
826
|
+
ref(() => {
|
|
827
|
+
return setListBoxElement;
|
|
828
|
+
}, _el$15);
|
|
829
|
+
spread(_el$15, [
|
|
830
|
+
domProps,
|
|
831
|
+
cleanContextProps,
|
|
832
|
+
cleanListBoxProps,
|
|
833
|
+
cleanFocusProps,
|
|
834
|
+
{
|
|
835
|
+
get "class"() {
|
|
836
|
+
return renderProps.class();
|
|
837
|
+
},
|
|
838
|
+
get style() {
|
|
839
|
+
return renderProps.style();
|
|
840
|
+
},
|
|
841
|
+
get "data-focused"() {
|
|
842
|
+
return dataAttr(isListBoxFocused());
|
|
843
|
+
},
|
|
844
|
+
get "data-focus-visible"() {
|
|
845
|
+
return dataAttr(isListBoxFocusVisible());
|
|
846
|
+
},
|
|
847
|
+
get "data-empty"() {
|
|
848
|
+
return dataAttr(state.collection().size === 0);
|
|
849
|
+
},
|
|
850
|
+
"data-layout": "stack",
|
|
851
|
+
"data-orientation": "vertical"
|
|
715
852
|
}
|
|
716
|
-
|
|
717
|
-
insert(_el$
|
|
718
|
-
get
|
|
719
|
-
return
|
|
853
|
+
], true);
|
|
854
|
+
insert(_el$15, createComponent(CollectionRoot, {
|
|
855
|
+
get collection() {
|
|
856
|
+
return items();
|
|
720
857
|
},
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
858
|
+
scrollRef: () => listBoxEl(),
|
|
859
|
+
get children() {
|
|
860
|
+
return createComponent(Show, {
|
|
861
|
+
get when() {
|
|
862
|
+
return local.children;
|
|
725
863
|
},
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
864
|
+
get fallback() {
|
|
865
|
+
return createComponent(For, {
|
|
866
|
+
get each() {
|
|
867
|
+
return items();
|
|
868
|
+
},
|
|
869
|
+
children: (node, index) => {
|
|
870
|
+
const item = createComponent(ComboBoxItem, {
|
|
871
|
+
get id() {
|
|
872
|
+
return node.key;
|
|
873
|
+
},
|
|
874
|
+
get children() {
|
|
875
|
+
return node.textValue;
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
return isVirtualized() ? createComponent(VirtualizerItem, {
|
|
879
|
+
get index() {
|
|
880
|
+
return index();
|
|
881
|
+
},
|
|
882
|
+
children: item
|
|
883
|
+
}) : item;
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
},
|
|
887
|
+
get children() {
|
|
888
|
+
return createComponent(For, {
|
|
889
|
+
get each() {
|
|
890
|
+
return items();
|
|
891
|
+
},
|
|
892
|
+
children: (node, index) => {
|
|
893
|
+
const value = getNodeValue(node);
|
|
894
|
+
const child = value != null ? local.children(value) : null;
|
|
895
|
+
return isVirtualized() ? createComponent(VirtualizerItem, {
|
|
896
|
+
get index() {
|
|
897
|
+
return index();
|
|
898
|
+
},
|
|
899
|
+
children: child
|
|
900
|
+
}) : child;
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
}
|
|
734
904
|
});
|
|
905
|
+
}
|
|
906
|
+
}), _el$17, _el$18);
|
|
907
|
+
insert(_el$15, scope((() => {
|
|
908
|
+
var _c$2 = memo(() => {
|
|
909
|
+
return !!(state.collection().size === 0 && local.renderEmptyState);
|
|
910
|
+
});
|
|
911
|
+
return () => {
|
|
912
|
+
return _c$2() ? (() => {
|
|
913
|
+
var _el$25 = getNextElement(_tmpl$8);
|
|
914
|
+
insert(_el$25, scope(() => {
|
|
915
|
+
return local.renderEmptyState();
|
|
916
|
+
}));
|
|
917
|
+
return _el$25;
|
|
918
|
+
})() : null;
|
|
919
|
+
};
|
|
920
|
+
})()), _el$20, _el$21);
|
|
921
|
+
insert(_el$15, createComponent(Show, {
|
|
922
|
+
get when() {
|
|
923
|
+
return local.onLoadMore;
|
|
735
924
|
},
|
|
736
925
|
get children() {
|
|
737
|
-
return createComponent(
|
|
738
|
-
get
|
|
739
|
-
return
|
|
926
|
+
return createComponent(ListBoxLoadMoreItem, {
|
|
927
|
+
get onLoadMore() {
|
|
928
|
+
return local.onLoadMore;
|
|
929
|
+
},
|
|
930
|
+
get isLoading() {
|
|
931
|
+
return local.isLoading;
|
|
740
932
|
},
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
933
|
+
get "class"() {
|
|
934
|
+
return local.loadMoreClass;
|
|
935
|
+
},
|
|
936
|
+
get children() {
|
|
937
|
+
return local.renderLoadMore?.();
|
|
744
938
|
}
|
|
745
939
|
});
|
|
746
940
|
}
|
|
747
|
-
}));
|
|
941
|
+
}), _el$23, _el$24);
|
|
748
942
|
runHydrationEvents();
|
|
749
|
-
return _el$
|
|
943
|
+
return _el$15;
|
|
750
944
|
}
|
|
751
945
|
});
|
|
752
946
|
}
|
|
753
947
|
/**
|
|
754
|
-
* An
|
|
948
|
+
* An item in a combobox listbox.
|
|
949
|
+
*
|
|
950
|
+
* Local addition: RAC ComboBox uses {@link ListBoxItem}. Prefer that when
|
|
951
|
+
* composing the headless ComboBox. This wrapper stays for existing call sites.
|
|
755
952
|
*/
|
|
756
|
-
function
|
|
953
|
+
function ComboBoxItem(props) {
|
|
757
954
|
const [local, ariaProps] = splitProps(props, [
|
|
758
955
|
"class",
|
|
759
956
|
"style",
|
|
@@ -766,20 +963,24 @@ function ComboBoxOption(props) {
|
|
|
766
963
|
]);
|
|
767
964
|
const stateContext = useContext(ComboBoxStateContext);
|
|
768
965
|
const comboBoxContext = useContext(ComboBoxContext);
|
|
769
|
-
if (!stateContext || !comboBoxContext) throw new Error("
|
|
966
|
+
if (!stateContext || !comboBoxContext) throw new Error("ComboBoxItem must be used within a ComboBox");
|
|
770
967
|
const state = stateContext;
|
|
771
968
|
const listState = comboBoxContext.listState;
|
|
772
|
-
const [ref, setRef] = createSignal(null);
|
|
969
|
+
const [ref$1, setRef] = createSignal(null);
|
|
773
970
|
const optionId = () => {
|
|
774
971
|
const listBoxId = getComboBoxData(state)?.listBoxId;
|
|
775
972
|
return listBoxId ? `${listBoxId}-option-${local.id}` : String(local.id);
|
|
776
973
|
};
|
|
777
|
-
|
|
974
|
+
createTrackedEffect(() => {
|
|
975
|
+
const _s2Cleanups = [];
|
|
778
976
|
const key = local.id;
|
|
779
977
|
comboBoxContext?.registerOptionAction(key, local.onAction);
|
|
780
|
-
|
|
978
|
+
_s2Cleanups.push(() => {
|
|
781
979
|
comboBoxContext?.registerOptionAction(key, void 0);
|
|
782
980
|
});
|
|
981
|
+
return () => {
|
|
982
|
+
for (const c of _s2Cleanups) c();
|
|
983
|
+
};
|
|
783
984
|
});
|
|
784
985
|
const optionAria = createOption({
|
|
785
986
|
key: local.id,
|
|
@@ -808,7 +1009,7 @@ function ComboBoxOption(props) {
|
|
|
808
1009
|
get onAction() {
|
|
809
1010
|
return local.onAction;
|
|
810
1011
|
}
|
|
811
|
-
}, listState, () => ref());
|
|
1012
|
+
}, listState, () => ref$1());
|
|
812
1013
|
const isOptionFocusVisible = () => optionAria.isFocused() && isFocusVisible();
|
|
813
1014
|
const renderValues = createMemo(() => ({
|
|
814
1015
|
isSelected: optionAria.isSelected(),
|
|
@@ -831,45 +1032,98 @@ function ComboBoxOption(props) {
|
|
|
831
1032
|
const { ref: _ref1, ...rest } = optionAria.optionProps;
|
|
832
1033
|
return rest;
|
|
833
1034
|
};
|
|
834
|
-
|
|
1035
|
+
const optionTextSlots = { slots: {
|
|
1036
|
+
get [DEFAULT_SLOT]() {
|
|
1037
|
+
return optionAria.labelProps;
|
|
1038
|
+
},
|
|
1039
|
+
get label() {
|
|
1040
|
+
return optionAria.labelProps;
|
|
1041
|
+
},
|
|
1042
|
+
get description() {
|
|
1043
|
+
return optionAria.descriptionProps;
|
|
1044
|
+
}
|
|
1045
|
+
} };
|
|
1046
|
+
createRenderEffect(() => ({
|
|
1047
|
+
el: ref$1(),
|
|
1048
|
+
labelId: optionAria.labelProps.id,
|
|
1049
|
+
descriptionId: optionAria.descriptionProps.id
|
|
1050
|
+
}), ({ el, labelId, descriptionId }) => {
|
|
1051
|
+
if (!el) return;
|
|
1052
|
+
const stamp = () => {
|
|
1053
|
+
if (labelId) {
|
|
1054
|
+
const label = el.querySelector("[slot='label']");
|
|
1055
|
+
if (label && label.id !== labelId) label.id = labelId;
|
|
1056
|
+
}
|
|
1057
|
+
if (descriptionId) {
|
|
1058
|
+
const description = el.querySelector("[slot='description']");
|
|
1059
|
+
if (description && description.id !== descriptionId) description.id = descriptionId;
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
stamp();
|
|
1063
|
+
const observer = new MutationObserver(stamp);
|
|
1064
|
+
observer.observe(el, {
|
|
1065
|
+
childList: true,
|
|
1066
|
+
subtree: true
|
|
1067
|
+
});
|
|
1068
|
+
return () => observer.disconnect();
|
|
1069
|
+
});
|
|
1070
|
+
const selectionMode = () => listState.selectionMode();
|
|
1071
|
+
return createComponent(SelectionIndicatorContext, {
|
|
835
1072
|
get value() {
|
|
836
1073
|
return selectionIndicatorContext();
|
|
837
1074
|
},
|
|
838
1075
|
get children() {
|
|
839
|
-
var _el$
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1076
|
+
var _el$26 = getNextElement(_tmpl$9);
|
|
1077
|
+
ref(() => {
|
|
1078
|
+
return (el) => {
|
|
1079
|
+
setRef(el);
|
|
1080
|
+
assignRef$1(local.ref, el);
|
|
1081
|
+
};
|
|
1082
|
+
}, _el$26);
|
|
1083
|
+
spread(_el$26, [cleanOptionProps, {
|
|
1084
|
+
get "class"() {
|
|
846
1085
|
return renderProps.class();
|
|
847
1086
|
},
|
|
848
1087
|
get style() {
|
|
849
1088
|
return renderProps.style();
|
|
850
1089
|
},
|
|
851
|
-
get
|
|
852
|
-
return optionAria.isSelected()
|
|
1090
|
+
get "data-selected"() {
|
|
1091
|
+
return dataAttr(optionAria.isSelected());
|
|
1092
|
+
},
|
|
1093
|
+
get "data-focused"() {
|
|
1094
|
+
return dataAttr(optionAria.isFocused());
|
|
853
1095
|
},
|
|
854
|
-
get
|
|
855
|
-
return
|
|
1096
|
+
get "data-focus-visible"() {
|
|
1097
|
+
return dataAttr(isOptionFocusVisible());
|
|
856
1098
|
},
|
|
857
|
-
get
|
|
858
|
-
return
|
|
1099
|
+
get "data-pressed"() {
|
|
1100
|
+
return dataAttr(optionAria.isPressed());
|
|
859
1101
|
},
|
|
860
|
-
get
|
|
861
|
-
return optionAria.
|
|
1102
|
+
get "data-hovered"() {
|
|
1103
|
+
return dataAttr(optionAria.isHovered());
|
|
862
1104
|
},
|
|
863
|
-
get
|
|
864
|
-
return optionAria.
|
|
1105
|
+
get "data-disabled"() {
|
|
1106
|
+
return dataAttr(optionAria.isDisabled());
|
|
865
1107
|
},
|
|
866
|
-
get
|
|
867
|
-
return
|
|
1108
|
+
get "data-selection-mode"() {
|
|
1109
|
+
return selectionMode() === "none" ? void 0 : selectionMode();
|
|
1110
|
+
}
|
|
1111
|
+
}], true);
|
|
1112
|
+
insert(_el$26, createComponent(Provider, {
|
|
1113
|
+
values: [[TextContext, optionTextSlots]],
|
|
1114
|
+
get children() {
|
|
1115
|
+
return createComponent(OptionContent, {
|
|
1116
|
+
get render() {
|
|
1117
|
+
return renderProps.renderChildrenStable;
|
|
1118
|
+
},
|
|
1119
|
+
get labelProps() {
|
|
1120
|
+
return optionAria.labelProps;
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
868
1123
|
}
|
|
869
|
-
})
|
|
870
|
-
insert(_el$12, () => renderProps.renderChildren());
|
|
1124
|
+
}));
|
|
871
1125
|
runHydrationEvents();
|
|
872
|
-
return _el$
|
|
1126
|
+
return _el$26;
|
|
873
1127
|
}
|
|
874
1128
|
});
|
|
875
1129
|
}
|
|
@@ -889,23 +1143,23 @@ function ComboBoxTagGroup(props) {
|
|
|
889
1143
|
return items().length > 0;
|
|
890
1144
|
},
|
|
891
1145
|
get children() {
|
|
892
|
-
var _el$
|
|
893
|
-
insert(_el$
|
|
1146
|
+
var _el$27 = getNextElement(_tmpl$10);
|
|
1147
|
+
insert(_el$27, createComponent(For, {
|
|
894
1148
|
get each() {
|
|
895
1149
|
return items();
|
|
896
1150
|
},
|
|
897
1151
|
children: (item) => props.children(item)
|
|
898
1152
|
}));
|
|
899
|
-
effect((
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
}, {
|
|
905
|
-
e
|
|
906
|
-
t
|
|
1153
|
+
effect(() => {
|
|
1154
|
+
return {
|
|
1155
|
+
e: readShallow(props.class ?? "solidaria-ComboBox-tagGroup"),
|
|
1156
|
+
t: readShallow(props.style)
|
|
1157
|
+
};
|
|
1158
|
+
}, ({ e, t }, _p$) => {
|
|
1159
|
+
className(_el$27, e, _p$?.e);
|
|
1160
|
+
style(_el$27, t, _p$?.t);
|
|
907
1161
|
});
|
|
908
|
-
return _el$
|
|
1162
|
+
return _el$27;
|
|
909
1163
|
}
|
|
910
1164
|
});
|
|
911
1165
|
}
|
|
@@ -920,31 +1174,38 @@ function ComboBoxTag(props) {
|
|
|
920
1174
|
if (props.onRemove) props.onRemove();
|
|
921
1175
|
else state.removeSelectedKey(props.item.key);
|
|
922
1176
|
};
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1177
|
+
var _el$28 = getNextElement(_tmpl$11);
|
|
1178
|
+
var _el$29 = _el$28.firstChild;
|
|
1179
|
+
var [_el$30, _el$31] = getNextMarker(_el$29.nextSibling);
|
|
1180
|
+
var _el$32 = _el$30.nextSibling;
|
|
1181
|
+
insert(_el$28, () => {
|
|
1182
|
+
return props.children ?? props.item.label;
|
|
1183
|
+
}, _el$30, _el$31);
|
|
1184
|
+
_el$32._$$click = handleRemove;
|
|
1185
|
+
effect(() => {
|
|
1186
|
+
return {
|
|
1187
|
+
e: readShallow(props.class ?? "solidaria-ComboBox-tag"),
|
|
1188
|
+
t: readShallow(props.style),
|
|
1189
|
+
a: String(props.item.key),
|
|
1190
|
+
o: `Remove ${props.item.label}`
|
|
1191
|
+
};
|
|
1192
|
+
}, ({ e, t, a, o }, _p$) => {
|
|
1193
|
+
className(_el$28, e, _p$?.e);
|
|
1194
|
+
style(_el$28, t, _p$?.t);
|
|
1195
|
+
a !== _p$?.a && setAttribute(_el$28, "data-key", a);
|
|
1196
|
+
o !== _p$?.o && setAttribute(_el$32, "aria-label", o);
|
|
1197
|
+
});
|
|
1198
|
+
runHydrationEvents();
|
|
1199
|
+
return _el$28;
|
|
943
1200
|
}
|
|
944
1201
|
ComboBox.Input = ComboBoxInput;
|
|
945
1202
|
ComboBox.Button = ComboBoxButton;
|
|
946
1203
|
ComboBox.ListBox = ComboBoxListBox;
|
|
947
|
-
|
|
1204
|
+
/**
|
|
1205
|
+
* @deprecated Use {@link ComboBoxItem}. Local addition — RAC ComboBox uses ListBoxItem. Removed in a future minor.
|
|
1206
|
+
*/
|
|
1207
|
+
const ComboBoxOption = ComboBoxItem;
|
|
1208
|
+
ComboBox.Option = ComboBoxItem;
|
|
948
1209
|
ComboBox.Label = ComboBoxLabel;
|
|
949
1210
|
ComboBox.Description = ComboBoxDescription;
|
|
950
1211
|
ComboBox.ErrorMessage = ComboBoxErrorMessage;
|
|
@@ -954,7 +1215,7 @@ function createComboBoxListStateAdapter(state) {
|
|
|
954
1215
|
const selectedKeys = createMemo(() => {
|
|
955
1216
|
if (state.selectionMode() === "multiple") return state.selectedKeys();
|
|
956
1217
|
const key = state.selectedKey();
|
|
957
|
-
return key != null ? new Set([key]) : /* @__PURE__ */ new Set();
|
|
1218
|
+
return key != null ? /* @__PURE__ */ new Set([key]) : /* @__PURE__ */ new Set();
|
|
958
1219
|
});
|
|
959
1220
|
const disabledKeys = createMemo(() => {
|
|
960
1221
|
const keys = /* @__PURE__ */ new Set();
|
|
@@ -983,6 +1244,10 @@ function createComboBoxListStateAdapter(state) {
|
|
|
983
1244
|
toggleSelection: (key) => state.select(key),
|
|
984
1245
|
replaceSelection: (key) => state.select(key),
|
|
985
1246
|
setSelectedKeys: (keys) => {
|
|
1247
|
+
if (state.selectionMode() === "multiple") {
|
|
1248
|
+
state.setSelectedKeys(new Set(keys));
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
986
1251
|
const first = keys[Symbol.iterator]().next().value;
|
|
987
1252
|
state.setSelectedKey(first ?? null);
|
|
988
1253
|
},
|
|
@@ -995,6 +1260,6 @@ function createComboBoxListStateAdapter(state) {
|
|
|
995
1260
|
}
|
|
996
1261
|
delegateEvents(["click"]);
|
|
997
1262
|
//#endregion
|
|
998
|
-
export { ComboBox, ComboBoxButton, ComboBoxContext, ComboBoxDescription, ComboBoxErrorMessage, ComboBoxInput, ComboBoxLabel, ComboBoxListBox, ComboBoxOption, ComboBoxStateContext, ComboBoxTag, ComboBoxTagGroup, ComboBoxValue, ComboBoxValueContext, defaultContainsFilter };
|
|
1263
|
+
export { ComboBox, ComboBoxButton, ComboBoxContext, ComboBoxDescription, ComboBoxErrorMessage, ComboBoxInput, ComboBoxItem, ComboBoxLabel, ComboBoxListBox, ComboBoxOption, ComboBoxStateContext, ComboBoxTag, ComboBoxTagGroup, ComboBoxValue, ComboBoxValueContext, defaultContainsFilter };
|
|
999
1264
|
|
|
1000
1265
|
//# sourceMappingURL=ComboBox.js.map
|