@react-spectrum/s2 1.3.1 → 1.5.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/dist/exports/Accordion.cjs.map +1 -1
- package/dist/exports/Accordion.mjs.map +1 -1
- package/dist/exports/ActionMenu.cjs.map +1 -1
- package/dist/exports/ActionMenu.mjs.map +1 -1
- package/dist/exports/Card.cjs.map +1 -1
- package/dist/exports/Card.mjs.map +1 -1
- package/dist/exports/CardView.cjs.map +1 -1
- package/dist/exports/CardView.mjs.map +1 -1
- package/dist/exports/CenterBaseline.cjs +12 -0
- package/dist/exports/CenterBaseline.cjs.map +1 -0
- package/dist/exports/CenterBaseline.mjs +7 -0
- package/dist/exports/CenterBaseline.mjs.map +1 -0
- package/dist/exports/ColorArea.cjs.map +1 -1
- package/dist/exports/ColorArea.mjs.map +1 -1
- package/dist/exports/ColorField.cjs.map +1 -1
- package/dist/exports/ColorField.mjs.map +1 -1
- package/dist/exports/ColorSlider.cjs.map +1 -1
- package/dist/exports/ColorSlider.mjs.map +1 -1
- package/dist/exports/ColorSwatch.cjs.map +1 -1
- package/dist/exports/ColorSwatch.mjs.map +1 -1
- package/dist/exports/ColorSwatchPicker.cjs.map +1 -1
- package/dist/exports/ColorSwatchPicker.mjs.map +1 -1
- package/dist/exports/ColorWheel.cjs.map +1 -1
- package/dist/exports/ColorWheel.mjs.map +1 -1
- package/dist/exports/ContextualHelp.cjs.map +1 -1
- package/dist/exports/ContextualHelp.mjs.map +1 -1
- package/dist/exports/Disclosure.cjs.map +1 -1
- package/dist/exports/Disclosure.mjs.map +1 -1
- package/dist/exports/DragPreview.cjs +12 -0
- package/dist/exports/DragPreview.cjs.map +1 -0
- package/dist/exports/DragPreview.mjs +7 -0
- package/dist/exports/DragPreview.mjs.map +1 -0
- package/dist/exports/Icon.cjs.map +1 -1
- package/dist/exports/Icon.mjs.map +1 -1
- package/dist/exports/LabeledValue.cjs +13 -0
- package/dist/exports/LabeledValue.cjs.map +1 -0
- package/dist/exports/LabeledValue.mjs +7 -0
- package/dist/exports/LabeledValue.mjs.map +1 -0
- package/dist/exports/Menu.cjs.map +1 -1
- package/dist/exports/Menu.mjs.map +1 -1
- package/dist/exports/SegmentedControl.cjs.map +1 -1
- package/dist/exports/SegmentedControl.mjs.map +1 -1
- package/dist/exports/Skeleton.cjs +1 -0
- package/dist/exports/Skeleton.cjs.map +1 -1
- package/dist/exports/Skeleton.mjs +2 -2
- package/dist/exports/Skeleton.mjs.map +1 -1
- package/dist/exports/TableView.cjs +1 -0
- package/dist/exports/TableView.cjs.map +1 -1
- package/dist/exports/TableView.mjs +2 -2
- package/dist/exports/TableView.mjs.map +1 -1
- package/dist/exports/TreeView.cjs.map +1 -1
- package/dist/exports/TreeView.mjs.map +1 -1
- package/dist/exports/index.cjs +20 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.mjs +12 -2
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/useAsyncList.cjs.map +1 -1
- package/dist/exports/useAsyncList.mjs.map +1 -1
- package/dist/exports/useDragAndDrop.cjs +21 -0
- package/dist/exports/useDragAndDrop.cjs.map +1 -0
- package/dist/exports/useDragAndDrop.mjs +11 -0
- package/dist/exports/useDragAndDrop.mjs.map +1 -0
- package/dist/private/Accordion.cjs +2 -2
- package/dist/private/Accordion.cjs.map +1 -1
- package/dist/private/Accordion.css +2 -2
- package/dist/private/Accordion.css.map +1 -1
- package/dist/private/Accordion.mjs +2 -2
- package/dist/private/Accordion.mjs.map +1 -1
- package/dist/private/ActionBar.cjs +61 -61
- package/dist/private/ActionBar.cjs.map +1 -1
- package/dist/private/ActionBar.css +58 -58
- package/dist/private/ActionBar.css.map +1 -1
- package/dist/private/ActionBar.mjs +61 -61
- package/dist/private/ActionBar.mjs.map +1 -1
- package/dist/private/ActionButton.cjs +350 -323
- package/dist/private/ActionButton.cjs.map +1 -1
- package/dist/private/ActionButton.css +203 -167
- package/dist/private/ActionButton.css.map +1 -1
- package/dist/private/ActionButton.mjs +351 -324
- package/dist/private/ActionButton.mjs.map +1 -1
- package/dist/private/ActionButtonGroup.cjs +15 -15
- package/dist/private/ActionButtonGroup.cjs.map +1 -1
- package/dist/private/ActionButtonGroup.css +9 -9
- package/dist/private/ActionButtonGroup.css.map +1 -1
- package/dist/private/ActionButtonGroup.mjs +15 -15
- package/dist/private/ActionButtonGroup.mjs.map +1 -1
- package/dist/private/ActionMenu.cjs.map +1 -1
- package/dist/private/ActionMenu.mjs.map +1 -1
- package/dist/private/Add.cjs +10 -10
- package/dist/private/Add.cjs.map +1 -1
- package/dist/private/Add.css +6 -6
- package/dist/private/Add.css.map +1 -1
- package/dist/private/Add.mjs +10 -10
- package/dist/private/Add.mjs.map +1 -1
- package/dist/private/AlertDialog.cjs +3 -3
- package/dist/private/AlertDialog.cjs.map +1 -1
- package/dist/private/AlertDialog.css +3 -3
- package/dist/private/AlertDialog.css.map +1 -1
- package/dist/private/AlertDialog.mjs +3 -3
- package/dist/private/AlertDialog.mjs.map +1 -1
- package/dist/private/Asterisk.cjs +6 -6
- package/dist/private/Asterisk.cjs.map +1 -1
- package/dist/private/Asterisk.css +4 -4
- package/dist/private/Asterisk.css.map +1 -1
- package/dist/private/Asterisk.mjs +6 -6
- package/dist/private/Asterisk.mjs.map +1 -1
- package/dist/private/Avatar.cjs +16 -16
- package/dist/private/Avatar.cjs.map +1 -1
- package/dist/private/Avatar.css +16 -16
- package/dist/private/Avatar.css.map +1 -1
- package/dist/private/Avatar.mjs +16 -16
- package/dist/private/Avatar.mjs.map +1 -1
- package/dist/private/AvatarGroup.cjs +120 -120
- package/dist/private/AvatarGroup.cjs.map +1 -1
- package/dist/private/AvatarGroup.css +31 -31
- package/dist/private/AvatarGroup.css.map +1 -1
- package/dist/private/AvatarGroup.mjs +120 -120
- package/dist/private/AvatarGroup.mjs.map +1 -1
- package/dist/private/Badge.cjs +197 -197
- package/dist/private/Badge.cjs.map +1 -1
- package/dist/private/Badge.css +125 -125
- package/dist/private/Badge.css.map +1 -1
- package/dist/private/Badge.mjs +197 -197
- package/dist/private/Badge.mjs.map +1 -1
- package/dist/private/Breadcrumbs.cjs +234 -234
- package/dist/private/Breadcrumbs.cjs.map +1 -1
- package/dist/private/Breadcrumbs.css +100 -100
- package/dist/private/Breadcrumbs.css.map +1 -1
- package/dist/private/Breadcrumbs.mjs +234 -234
- package/dist/private/Breadcrumbs.mjs.map +1 -1
- package/dist/private/Button.cjs +326 -335
- package/dist/private/Button.cjs.map +1 -1
- package/dist/private/Button.css +172 -180
- package/dist/private/Button.css.map +1 -1
- package/dist/private/Button.mjs +326 -335
- package/dist/private/Button.mjs.map +1 -1
- package/dist/private/ButtonGroup.cjs +23 -20
- package/dist/private/ButtonGroup.cjs.map +1 -1
- package/dist/private/ButtonGroup.css +19 -15
- package/dist/private/ButtonGroup.css.map +1 -1
- package/dist/private/ButtonGroup.mjs +23 -20
- package/dist/private/ButtonGroup.mjs.map +1 -1
- package/dist/private/Calendar.cjs +263 -312
- package/dist/private/Calendar.cjs.map +1 -1
- package/dist/private/Calendar.css +155 -167
- package/dist/private/Calendar.css.map +1 -1
- package/dist/private/Calendar.mjs +266 -315
- package/dist/private/Calendar.mjs.map +1 -1
- package/dist/private/Card.cjs +309 -309
- package/dist/private/Card.cjs.map +1 -1
- package/dist/private/Card.css +206 -206
- package/dist/private/Card.css.map +1 -1
- package/dist/private/Card.mjs +309 -309
- package/dist/private/Card.mjs.map +1 -1
- package/dist/private/CardView.cjs +17 -17
- package/dist/private/CardView.cjs.map +1 -1
- package/dist/private/CardView.css +17 -17
- package/dist/private/CardView.css.map +1 -1
- package/dist/private/CardView.mjs +17 -17
- package/dist/private/CardView.mjs.map +1 -1
- package/dist/private/CenterBaseline.cjs +5 -1
- package/dist/private/CenterBaseline.cjs.map +1 -1
- package/dist/private/CenterBaseline.css +2 -2
- package/dist/private/CenterBaseline.css.map +1 -1
- package/dist/private/CenterBaseline.mjs +5 -1
- package/dist/private/CenterBaseline.mjs.map +1 -1
- package/dist/private/Checkbox.cjs +268 -208
- package/dist/private/Checkbox.cjs.map +1 -1
- package/dist/private/Checkbox.css +170 -98
- package/dist/private/Checkbox.css.map +1 -1
- package/dist/private/Checkbox.mjs +269 -209
- package/dist/private/Checkbox.mjs.map +1 -1
- package/dist/private/CheckboxGroup.cjs +44 -43
- package/dist/private/CheckboxGroup.cjs.map +1 -1
- package/dist/private/CheckboxGroup.css +37 -37
- package/dist/private/CheckboxGroup.css.map +1 -1
- package/dist/private/CheckboxGroup.mjs +44 -43
- package/dist/private/CheckboxGroup.mjs.map +1 -1
- package/dist/private/Checkmark.cjs +12 -12
- package/dist/private/Checkmark.cjs.map +1 -1
- package/dist/private/Checkmark.css +8 -8
- package/dist/private/Checkmark.css.map +1 -1
- package/dist/private/Checkmark.mjs +12 -12
- package/dist/private/Checkmark.mjs.map +1 -1
- package/dist/private/Chevron.cjs +12 -12
- package/dist/private/Chevron.cjs.map +1 -1
- package/dist/private/Chevron.css +10 -10
- package/dist/private/Chevron.css.map +1 -1
- package/dist/private/Chevron.mjs +12 -12
- package/dist/private/Chevron.mjs.map +1 -1
- package/dist/private/ClearButton.cjs +30 -30
- package/dist/private/ClearButton.cjs.map +1 -1
- package/dist/private/ClearButton.css +30 -30
- package/dist/private/ClearButton.css.map +1 -1
- package/dist/private/ClearButton.mjs +30 -30
- package/dist/private/ClearButton.mjs.map +1 -1
- package/dist/private/CloseButton.cjs +52 -57
- package/dist/private/CloseButton.cjs.map +1 -1
- package/dist/private/CloseButton.css +47 -51
- package/dist/private/CloseButton.css.map +1 -1
- package/dist/private/CloseButton.mjs +52 -57
- package/dist/private/CloseButton.mjs.map +1 -1
- package/dist/private/ColorArea.cjs +16 -16
- package/dist/private/ColorArea.cjs.map +1 -1
- package/dist/private/ColorArea.css +16 -16
- package/dist/private/ColorArea.css.map +1 -1
- package/dist/private/ColorArea.mjs +16 -16
- package/dist/private/ColorArea.mjs.map +1 -1
- package/dist/private/ColorField.cjs +44 -33
- package/dist/private/ColorField.cjs.map +1 -1
- package/dist/private/ColorField.css +27 -27
- package/dist/private/ColorField.css.map +1 -1
- package/dist/private/ColorField.mjs +44 -33
- package/dist/private/ColorField.mjs.map +1 -1
- package/dist/private/ColorHandle.cjs +27 -27
- package/dist/private/ColorHandle.cjs.map +1 -1
- package/dist/private/ColorHandle.css +42 -42
- package/dist/private/ColorHandle.css.map +1 -1
- package/dist/private/ColorHandle.mjs +27 -27
- package/dist/private/ColorHandle.mjs.map +1 -1
- package/dist/private/ColorSlider.cjs +113 -109
- package/dist/private/ColorSlider.cjs.map +1 -1
- package/dist/private/ColorSlider.css +52 -52
- package/dist/private/ColorSlider.css.map +1 -1
- package/dist/private/ColorSlider.mjs +113 -109
- package/dist/private/ColorSlider.mjs.map +1 -1
- package/dist/private/ColorSwatch.cjs +29 -29
- package/dist/private/ColorSwatch.cjs.map +1 -1
- package/dist/private/ColorSwatch.css +29 -29
- package/dist/private/ColorSwatch.css.map +1 -1
- package/dist/private/ColorSwatch.mjs +29 -29
- package/dist/private/ColorSwatch.mjs.map +1 -1
- package/dist/private/ColorSwatchPicker.cjs +29 -29
- package/dist/private/ColorSwatchPicker.cjs.map +1 -1
- package/dist/private/ColorSwatchPicker.css +48 -48
- package/dist/private/ColorSwatchPicker.css.map +1 -1
- package/dist/private/ColorSwatchPicker.mjs +29 -29
- package/dist/private/ColorSwatchPicker.mjs.map +1 -1
- package/dist/private/ColorWheel.cjs +26 -26
- package/dist/private/ColorWheel.cjs.map +1 -1
- package/dist/private/ColorWheel.css +17 -17
- package/dist/private/ColorWheel.css.map +1 -1
- package/dist/private/ColorWheel.mjs +26 -26
- package/dist/private/ColorWheel.mjs.map +1 -1
- package/dist/private/ComboBox.cjs +384 -405
- package/dist/private/ComboBox.cjs.map +1 -1
- package/dist/private/ComboBox.css +192 -188
- package/dist/private/ComboBox.css.map +1 -1
- package/dist/private/ComboBox.mjs +385 -406
- package/dist/private/ComboBox.mjs.map +1 -1
- package/dist/private/Content.cjs +2 -1
- package/dist/private/Content.cjs.map +1 -1
- package/dist/private/Content.mjs +2 -1
- package/dist/private/Content.mjs.map +1 -1
- package/dist/private/ContextualHelp.cjs +5 -5
- package/dist/private/ContextualHelp.cjs.map +1 -1
- package/dist/private/ContextualHelp.css +50 -50
- package/dist/private/ContextualHelp.css.map +1 -1
- package/dist/private/ContextualHelp.mjs +5 -5
- package/dist/private/ContextualHelp.mjs.map +1 -1
- package/dist/private/CornerTriangle.cjs +76 -0
- package/dist/private/CornerTriangle.cjs.map +1 -0
- package/dist/private/CornerTriangle.css +26 -0
- package/dist/private/CornerTriangle.css.map +1 -0
- package/dist/private/CornerTriangle.mjs +71 -0
- package/dist/private/CornerTriangle.mjs.map +1 -0
- package/dist/private/Cross.cjs +14 -14
- package/dist/private/Cross.cjs.map +1 -1
- package/dist/private/Cross.css +10 -10
- package/dist/private/Cross.css.map +1 -1
- package/dist/private/Cross.mjs +14 -14
- package/dist/private/Cross.mjs.map +1 -1
- package/dist/private/CustomDialog.cjs +27 -26
- package/dist/private/CustomDialog.cjs.map +1 -1
- package/dist/private/CustomDialog.css +25 -25
- package/dist/private/CustomDialog.css.map +1 -1
- package/dist/private/CustomDialog.mjs +27 -26
- package/dist/private/CustomDialog.mjs.map +1 -1
- package/dist/private/Dash.cjs +10 -10
- package/dist/private/Dash.cjs.map +1 -1
- package/dist/private/Dash.css +6 -6
- package/dist/private/Dash.css.map +1 -1
- package/dist/private/Dash.mjs +10 -10
- package/dist/private/Dash.mjs.map +1 -1
- package/dist/private/DateField.cjs +73 -73
- package/dist/private/DateField.cjs.map +1 -1
- package/dist/private/DateField.css +77 -77
- package/dist/private/DateField.css.map +1 -1
- package/dist/private/DateField.mjs +73 -73
- package/dist/private/DateField.mjs.map +1 -1
- package/dist/private/DatePicker.cjs +172 -172
- package/dist/private/DatePicker.cjs.map +1 -1
- package/dist/private/DatePicker.css +128 -128
- package/dist/private/DatePicker.css.map +1 -1
- package/dist/private/DatePicker.mjs +172 -172
- package/dist/private/DatePicker.mjs.map +1 -1
- package/dist/private/DateRangePicker.cjs +55 -55
- package/dist/private/DateRangePicker.cjs.map +1 -1
- package/dist/private/DateRangePicker.css +59 -59
- package/dist/private/DateRangePicker.css.map +1 -1
- package/dist/private/DateRangePicker.mjs +55 -55
- package/dist/private/DateRangePicker.mjs.map +1 -1
- package/dist/private/Dialog.cjs +21 -18
- package/dist/private/Dialog.cjs.map +1 -1
- package/dist/private/Dialog.css +70 -70
- package/dist/private/Dialog.css.map +1 -1
- package/dist/private/Dialog.mjs +21 -18
- package/dist/private/Dialog.mjs.map +1 -1
- package/dist/private/DialogContainer.cjs.map +1 -1
- package/dist/private/DialogContainer.mjs.map +1 -1
- package/dist/private/DialogTrigger.cjs.map +1 -1
- package/dist/private/DialogTrigger.mjs.map +1 -1
- package/dist/private/Disclosure.cjs +144 -122
- package/dist/private/Disclosure.cjs.map +1 -1
- package/dist/private/Disclosure.css +112 -112
- package/dist/private/Disclosure.css.map +1 -1
- package/dist/private/Disclosure.mjs +144 -122
- package/dist/private/Disclosure.mjs.map +1 -1
- package/dist/private/Divider.cjs +25 -25
- package/dist/private/Divider.cjs.map +1 -1
- package/dist/private/Divider.css +25 -25
- package/dist/private/Divider.css.map +1 -1
- package/dist/private/Divider.mjs +25 -25
- package/dist/private/Divider.mjs.map +1 -1
- package/dist/private/DragHandle.cjs +76 -0
- package/dist/private/DragHandle.cjs.map +1 -0
- package/dist/private/DragHandle.css +26 -0
- package/dist/private/DragHandle.css.map +1 -0
- package/dist/private/DragHandle.mjs +71 -0
- package/dist/private/DragHandle.mjs.map +1 -0
- package/dist/private/DragPreview.cjs +297 -0
- package/dist/private/DragPreview.cjs.map +1 -0
- package/dist/private/DragPreview.css +459 -0
- package/dist/private/DragPreview.css.map +1 -0
- package/dist/private/DragPreview.mjs +288 -0
- package/dist/private/DragPreview.mjs.map +1 -0
- package/dist/private/DropZone.cjs +61 -61
- package/dist/private/DropZone.cjs.map +1 -1
- package/dist/private/DropZone.css +57 -57
- package/dist/private/DropZone.css.map +1 -1
- package/dist/private/DropZone.mjs +61 -61
- package/dist/private/DropZone.mjs.map +1 -1
- package/dist/private/Field.cjs +421 -372
- package/dist/private/Field.cjs.map +1 -1
- package/dist/private/Field.css +206 -154
- package/dist/private/Field.css.map +1 -1
- package/dist/private/Field.mjs +422 -373
- package/dist/private/Field.mjs.map +1 -1
- package/dist/private/Fonts.cjs.map +1 -1
- package/dist/private/Fonts.mjs.map +1 -1
- package/dist/private/Form.cjs +9 -9
- package/dist/private/Form.cjs.map +1 -1
- package/dist/private/Form.css +9 -9
- package/dist/private/Form.css.map +1 -1
- package/dist/private/Form.mjs +9 -9
- package/dist/private/Form.mjs.map +1 -1
- package/dist/private/FullscreenDialog.cjs +7 -6
- package/dist/private/FullscreenDialog.cjs.map +1 -1
- package/dist/private/FullscreenDialog.css +78 -78
- package/dist/private/FullscreenDialog.css.map +1 -1
- package/dist/private/FullscreenDialog.mjs +7 -6
- package/dist/private/FullscreenDialog.mjs.map +1 -1
- package/dist/private/IllustratedMessage.cjs +228 -228
- package/dist/private/IllustratedMessage.cjs.map +1 -1
- package/dist/private/IllustratedMessage.css +72 -72
- package/dist/private/IllustratedMessage.css.map +1 -1
- package/dist/private/IllustratedMessage.mjs +228 -228
- package/dist/private/IllustratedMessage.mjs.map +1 -1
- package/dist/private/Image.cjs +16 -16
- package/dist/private/Image.cjs.map +1 -1
- package/dist/private/Image.css +14 -14
- package/dist/private/Image.css.map +1 -1
- package/dist/private/Image.mjs +16 -16
- package/dist/private/Image.mjs.map +1 -1
- package/dist/private/ImageCoordinator.cjs.map +1 -1
- package/dist/private/ImageCoordinator.mjs.map +1 -1
- package/dist/private/InlineAlert.cjs +100 -100
- package/dist/private/InlineAlert.cjs.map +1 -1
- package/dist/private/InlineAlert.css +76 -76
- package/dist/private/InlineAlert.css.map +1 -1
- package/dist/private/InlineAlert.mjs +100 -100
- package/dist/private/InlineAlert.mjs.map +1 -1
- package/dist/private/LabeledValue.cjs +359 -0
- package/dist/private/LabeledValue.cjs.map +1 -0
- package/dist/private/LabeledValue.css +285 -0
- package/dist/private/LabeledValue.css.map +1 -0
- package/dist/private/LabeledValue.mjs +353 -0
- package/dist/private/LabeledValue.mjs.map +1 -0
- package/dist/private/Link.cjs +49 -49
- package/dist/private/Link.cjs.map +1 -1
- package/dist/private/Link.css +41 -41
- package/dist/private/Link.css.map +1 -1
- package/dist/private/Link.mjs +49 -49
- package/dist/private/Link.mjs.map +1 -1
- package/dist/private/LinkOut.cjs +8 -8
- package/dist/private/LinkOut.cjs.map +1 -1
- package/dist/private/LinkOut.css +8 -8
- package/dist/private/LinkOut.css.map +1 -1
- package/dist/private/LinkOut.mjs +8 -8
- package/dist/private/LinkOut.mjs.map +1 -1
- package/dist/private/ListView.cjs +422 -489
- package/dist/private/ListView.cjs.map +1 -1
- package/dist/private/ListView.css +276 -348
- package/dist/private/ListView.css.map +1 -1
- package/dist/private/ListView.mjs +422 -488
- package/dist/private/ListView.mjs.map +1 -1
- package/dist/private/Menu.cjs +489 -471
- package/dist/private/Menu.cjs.map +1 -1
- package/dist/private/Menu.css +205 -205
- package/dist/private/Menu.css.map +1 -1
- package/dist/private/Menu.mjs +489 -471
- package/dist/private/Menu.mjs.map +1 -1
- package/dist/private/Meter.cjs +153 -153
- package/dist/private/Meter.cjs.map +1 -1
- package/dist/private/Meter.css +91 -91
- package/dist/private/Meter.css.map +1 -1
- package/dist/private/Meter.mjs +153 -153
- package/dist/private/Meter.mjs.map +1 -1
- package/dist/private/Modal.cjs +74 -74
- package/dist/private/Modal.cjs.map +1 -1
- package/dist/private/Modal.css +59 -59
- package/dist/private/Modal.css.map +1 -1
- package/dist/private/Modal.mjs +74 -74
- package/dist/private/Modal.mjs.map +1 -1
- package/dist/private/NotificationBadge.cjs +56 -56
- package/dist/private/NotificationBadge.cjs.map +1 -1
- package/dist/private/NotificationBadge.css +49 -49
- package/dist/private/NotificationBadge.css.map +1 -1
- package/dist/private/NotificationBadge.mjs +56 -56
- package/dist/private/NotificationBadge.mjs.map +1 -1
- package/dist/private/NumberField.cjs +115 -114
- package/dist/private/NumberField.cjs.map +1 -1
- package/dist/private/NumberField.css +99 -99
- package/dist/private/NumberField.css.map +1 -1
- package/dist/private/NumberField.mjs +115 -114
- package/dist/private/NumberField.mjs.map +1 -1
- package/dist/private/Picker.cjs +277 -277
- package/dist/private/Picker.cjs.map +1 -1
- package/dist/private/Picker.css +173 -173
- package/dist/private/Picker.css.map +1 -1
- package/dist/private/Picker.mjs +277 -277
- package/dist/private/Picker.mjs.map +1 -1
- package/dist/private/Popover.cjs +95 -95
- package/dist/private/Popover.cjs.map +1 -1
- package/dist/private/Popover.css +75 -75
- package/dist/private/Popover.css.map +1 -1
- package/dist/private/Popover.mjs +95 -95
- package/dist/private/Popover.mjs.map +1 -1
- package/dist/private/ProgressBar.cjs +163 -163
- package/dist/private/ProgressBar.cjs.map +1 -1
- package/dist/private/ProgressBar.css +99 -99
- package/dist/private/ProgressBar.css.map +1 -1
- package/dist/private/ProgressBar.mjs +163 -163
- package/dist/private/ProgressBar.mjs.map +1 -1
- package/dist/private/ProgressCircle.cjs +34 -31
- package/dist/private/ProgressCircle.cjs.map +1 -1
- package/dist/private/ProgressCircle.css +24 -24
- package/dist/private/ProgressCircle.css.map +1 -1
- package/dist/private/ProgressCircle.mjs +34 -31
- package/dist/private/ProgressCircle.mjs.map +1 -1
- package/dist/private/Provider.cjs +19 -19
- package/dist/private/Provider.cjs.map +1 -1
- package/dist/private/Provider.css +15 -15
- package/dist/private/Provider.css.map +1 -1
- package/dist/private/Provider.mjs +19 -19
- package/dist/private/Provider.mjs.map +1 -1
- package/dist/private/RadioGroup.cjs +251 -203
- package/dist/private/RadioGroup.cjs.map +1 -1
- package/dist/private/RadioGroup.css +167 -135
- package/dist/private/RadioGroup.css.map +1 -1
- package/dist/private/RadioGroup.mjs +252 -204
- package/dist/private/RadioGroup.mjs.map +1 -1
- package/dist/private/RangeCalendar.cjs +19 -17
- package/dist/private/RangeCalendar.cjs.map +1 -1
- package/dist/private/RangeCalendar.css +17 -17
- package/dist/private/RangeCalendar.css.map +1 -1
- package/dist/private/RangeCalendar.mjs +19 -17
- package/dist/private/RangeCalendar.mjs.map +1 -1
- package/dist/private/RangeSlider.cjs +7 -15
- package/dist/private/RangeSlider.cjs.map +1 -1
- package/dist/private/RangeSlider.mjs +8 -16
- package/dist/private/RangeSlider.mjs.map +1 -1
- package/dist/private/S2_CornerTriangleSize100.cjs +26 -0
- package/dist/private/S2_CornerTriangleSize100.cjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize100.mjs +21 -0
- package/dist/private/S2_CornerTriangleSize100.mjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize200.cjs +26 -0
- package/dist/private/S2_CornerTriangleSize200.cjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize200.mjs +21 -0
- package/dist/private/S2_CornerTriangleSize200.mjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize300.cjs +26 -0
- package/dist/private/S2_CornerTriangleSize300.cjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize300.mjs +21 -0
- package/dist/private/S2_CornerTriangleSize300.mjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize75.cjs +26 -0
- package/dist/private/S2_CornerTriangleSize75.cjs.map +1 -0
- package/dist/private/S2_CornerTriangleSize75.mjs +21 -0
- package/dist/private/S2_CornerTriangleSize75.mjs.map +1 -0
- package/dist/private/S2_DragHandleSize100.cjs +60 -0
- package/dist/private/S2_DragHandleSize100.cjs.map +1 -0
- package/dist/private/S2_DragHandleSize100.mjs +55 -0
- package/dist/private/S2_DragHandleSize100.mjs.map +1 -0
- package/dist/private/S2_DragHandleSize200.cjs +60 -0
- package/dist/private/S2_DragHandleSize200.cjs.map +1 -0
- package/dist/private/S2_DragHandleSize200.mjs +55 -0
- package/dist/private/S2_DragHandleSize200.mjs.map +1 -0
- package/dist/private/S2_DragHandleSize300.cjs +60 -0
- package/dist/private/S2_DragHandleSize300.cjs.map +1 -0
- package/dist/private/S2_DragHandleSize300.mjs +55 -0
- package/dist/private/S2_DragHandleSize300.mjs.map +1 -0
- package/dist/private/S2_DragHandleSize75.cjs +60 -0
- package/dist/private/S2_DragHandleSize75.cjs.map +1 -0
- package/dist/private/S2_DragHandleSize75.mjs +55 -0
- package/dist/private/S2_DragHandleSize75.mjs.map +1 -0
- package/dist/private/SearchField.cjs +41 -41
- package/dist/private/SearchField.cjs.map +1 -1
- package/dist/private/SearchField.css +45 -45
- package/dist/private/SearchField.css.map +1 -1
- package/dist/private/SearchField.mjs +41 -41
- package/dist/private/SearchField.mjs.map +1 -1
- package/dist/private/SegmentedControl.cjs +178 -178
- package/dist/private/SegmentedControl.cjs.map +1 -1
- package/dist/private/SegmentedControl.css +123 -123
- package/dist/private/SegmentedControl.css.map +1 -1
- package/dist/private/SegmentedControl.mjs +178 -178
- package/dist/private/SegmentedControl.mjs.map +1 -1
- package/dist/private/SelectBoxGroup.cjs +142 -142
- package/dist/private/SelectBoxGroup.cjs.map +1 -1
- package/dist/private/SelectBoxGroup.css +120 -120
- package/dist/private/SelectBoxGroup.css.map +1 -1
- package/dist/private/SelectBoxGroup.mjs +142 -142
- package/dist/private/SelectBoxGroup.mjs.map +1 -1
- package/dist/private/SkeletonCollection.cjs.map +1 -1
- package/dist/private/SkeletonCollection.mjs.map +1 -1
- package/dist/private/Slider.cjs +318 -332
- package/dist/private/Slider.cjs.map +1 -1
- package/dist/private/Slider.css +177 -157
- package/dist/private/Slider.css.map +1 -1
- package/dist/private/Slider.mjs +319 -333
- package/dist/private/Slider.mjs.map +1 -1
- package/dist/private/StatusLight.cjs +115 -115
- package/dist/private/StatusLight.cjs.map +1 -1
- package/dist/private/StatusLight.css +59 -59
- package/dist/private/StatusLight.css.map +1 -1
- package/dist/private/StatusLight.mjs +115 -115
- package/dist/private/StatusLight.mjs.map +1 -1
- package/dist/private/Switch.cjs +219 -176
- package/dist/private/Switch.cjs.map +1 -1
- package/dist/private/Switch.css +128 -84
- package/dist/private/Switch.css.map +1 -1
- package/dist/private/Switch.mjs +219 -176
- package/dist/private/Switch.mjs.map +1 -1
- package/dist/private/TableView.cjs +752 -518
- package/dist/private/TableView.cjs.map +1 -1
- package/dist/private/TableView.css +554 -308
- package/dist/private/TableView.css.map +1 -1
- package/dist/private/TableView.mjs +754 -521
- package/dist/private/TableView.mjs.map +1 -1
- package/dist/private/Tabs.cjs +131 -125
- package/dist/private/Tabs.cjs.map +1 -1
- package/dist/private/Tabs.css +105 -105
- package/dist/private/Tabs.css.map +1 -1
- package/dist/private/Tabs.mjs +131 -125
- package/dist/private/Tabs.mjs.map +1 -1
- package/dist/private/TabsPicker.cjs +130 -129
- package/dist/private/TabsPicker.cjs.map +1 -1
- package/dist/private/TabsPicker.css +108 -108
- package/dist/private/TabsPicker.css.map +1 -1
- package/dist/private/TabsPicker.mjs +130 -129
- package/dist/private/TabsPicker.mjs.map +1 -1
- package/dist/private/TagGroup.cjs +203 -203
- package/dist/private/TagGroup.cjs.map +1 -1
- package/dist/private/TagGroup.css +146 -146
- package/dist/private/TagGroup.css.map +1 -1
- package/dist/private/TagGroup.mjs +203 -203
- package/dist/private/TagGroup.mjs.map +1 -1
- package/dist/private/TextField.cjs +84 -73
- package/dist/private/TextField.cjs.map +1 -1
- package/dist/private/TextField.css +54 -54
- package/dist/private/TextField.css.map +1 -1
- package/dist/private/TextField.mjs +85 -74
- package/dist/private/TextField.mjs.map +1 -1
- package/dist/private/TimeField.cjs +51 -51
- package/dist/private/TimeField.cjs.map +1 -1
- package/dist/private/TimeField.css +47 -47
- package/dist/private/TimeField.css.map +1 -1
- package/dist/private/TimeField.mjs +51 -51
- package/dist/private/TimeField.mjs.map +1 -1
- package/dist/private/Toast.cjs +122 -121
- package/dist/private/Toast.cjs.map +1 -1
- package/dist/private/Toast.css +110 -110
- package/dist/private/Toast.css.map +1 -1
- package/dist/private/Toast.mjs +122 -121
- package/dist/private/Toast.mjs.map +1 -1
- package/dist/private/Toast.module_css.cjs +21 -21
- package/dist/private/Toast.module_css.cjs.map +1 -1
- package/dist/private/Toast.module_css.mjs +21 -21
- package/dist/private/Toast.module_css.mjs.map +1 -1
- package/dist/private/Toast_module.css +44 -44
- package/dist/private/Toast_module.css.map +1 -1
- package/dist/private/ToggleButton.cjs +59 -26
- package/dist/private/ToggleButton.cjs.map +1 -1
- package/dist/private/ToggleButton.css +56 -12
- package/dist/private/ToggleButton.css.map +1 -1
- package/dist/private/ToggleButton.mjs +60 -27
- package/dist/private/ToggleButton.mjs.map +1 -1
- package/dist/private/ToggleButtonGroup.cjs.map +1 -1
- package/dist/private/ToggleButtonGroup.mjs.map +1 -1
- package/dist/private/Tooltip.cjs +86 -86
- package/dist/private/Tooltip.cjs.map +1 -1
- package/dist/private/Tooltip.css +70 -70
- package/dist/private/Tooltip.css.map +1 -1
- package/dist/private/Tooltip.mjs +86 -86
- package/dist/private/Tooltip.mjs.map +1 -1
- package/dist/private/TreeView.cjs +300 -233
- package/dist/private/TreeView.cjs.map +1 -1
- package/dist/private/TreeView.css +243 -181
- package/dist/private/TreeView.css.map +1 -1
- package/dist/private/TreeView.mjs +301 -234
- package/dist/private/TreeView.mjs.map +1 -1
- package/dist/private/dnd-utils.cjs +149 -0
- package/dist/private/dnd-utils.cjs.map +1 -0
- package/dist/private/dnd-utils.css +164 -0
- package/dist/private/dnd-utils.css.map +1 -0
- package/dist/private/dnd-utils.mjs +143 -0
- package/dist/private/dnd-utils.mjs.map +1 -0
- package/dist/private/font-faces.css.map +1 -1
- package/dist/private/intl/ar-AE.cjs +1 -0
- package/dist/private/intl/ar-AE.cjs.map +1 -1
- package/dist/private/intl/ar-AE.mjs +1 -0
- package/dist/private/intl/ar-AE.mjs.map +1 -1
- package/dist/private/intl/bg-BG.cjs +1 -0
- package/dist/private/intl/bg-BG.cjs.map +1 -1
- package/dist/private/intl/bg-BG.mjs +1 -0
- package/dist/private/intl/bg-BG.mjs.map +1 -1
- package/dist/private/intl/cs-CZ.cjs +1 -0
- package/dist/private/intl/cs-CZ.cjs.map +1 -1
- package/dist/private/intl/cs-CZ.mjs +1 -0
- package/dist/private/intl/cs-CZ.mjs.map +1 -1
- package/dist/private/intl/da-DK.cjs +1 -0
- package/dist/private/intl/da-DK.cjs.map +1 -1
- package/dist/private/intl/da-DK.mjs +1 -0
- package/dist/private/intl/da-DK.mjs.map +1 -1
- package/dist/private/intl/de-DE.cjs +1 -0
- package/dist/private/intl/de-DE.cjs.map +1 -1
- package/dist/private/intl/de-DE.mjs +1 -0
- package/dist/private/intl/de-DE.mjs.map +1 -1
- package/dist/private/intl/el-GR.cjs +1 -0
- package/dist/private/intl/el-GR.cjs.map +1 -1
- package/dist/private/intl/el-GR.mjs +1 -0
- package/dist/private/intl/el-GR.mjs.map +1 -1
- package/dist/private/intl/en-US.cjs +1 -0
- package/dist/private/intl/en-US.cjs.map +1 -1
- package/dist/private/intl/en-US.mjs +1 -0
- package/dist/private/intl/en-US.mjs.map +1 -1
- package/dist/private/intl/es-ES.cjs +1 -0
- package/dist/private/intl/es-ES.cjs.map +1 -1
- package/dist/private/intl/es-ES.mjs +1 -0
- package/dist/private/intl/es-ES.mjs.map +1 -1
- package/dist/private/intl/et-EE.cjs +1 -0
- package/dist/private/intl/et-EE.cjs.map +1 -1
- package/dist/private/intl/et-EE.mjs +1 -0
- package/dist/private/intl/et-EE.mjs.map +1 -1
- package/dist/private/intl/fi-FI.cjs +1 -0
- package/dist/private/intl/fi-FI.cjs.map +1 -1
- package/dist/private/intl/fi-FI.mjs +1 -0
- package/dist/private/intl/fi-FI.mjs.map +1 -1
- package/dist/private/intl/fr-FR.cjs +1 -0
- package/dist/private/intl/fr-FR.cjs.map +1 -1
- package/dist/private/intl/fr-FR.mjs +1 -0
- package/dist/private/intl/fr-FR.mjs.map +1 -1
- package/dist/private/intl/he-IL.cjs +1 -0
- package/dist/private/intl/he-IL.cjs.map +1 -1
- package/dist/private/intl/he-IL.mjs +1 -0
- package/dist/private/intl/he-IL.mjs.map +1 -1
- package/dist/private/intl/hr-HR.cjs +1 -0
- package/dist/private/intl/hr-HR.cjs.map +1 -1
- package/dist/private/intl/hr-HR.mjs +1 -0
- package/dist/private/intl/hr-HR.mjs.map +1 -1
- package/dist/private/intl/hu-HU.cjs +1 -0
- package/dist/private/intl/hu-HU.cjs.map +1 -1
- package/dist/private/intl/hu-HU.mjs +1 -0
- package/dist/private/intl/hu-HU.mjs.map +1 -1
- package/dist/private/intl/it-IT.cjs +1 -0
- package/dist/private/intl/it-IT.cjs.map +1 -1
- package/dist/private/intl/it-IT.mjs +1 -0
- package/dist/private/intl/it-IT.mjs.map +1 -1
- package/dist/private/intl/ja-JP.cjs +1 -0
- package/dist/private/intl/ja-JP.cjs.map +1 -1
- package/dist/private/intl/ja-JP.mjs +1 -0
- package/dist/private/intl/ja-JP.mjs.map +1 -1
- package/dist/private/intl/ko-KR.cjs +1 -0
- package/dist/private/intl/ko-KR.cjs.map +1 -1
- package/dist/private/intl/ko-KR.mjs +1 -0
- package/dist/private/intl/ko-KR.mjs.map +1 -1
- package/dist/private/intl/lt-LT.cjs +1 -0
- package/dist/private/intl/lt-LT.cjs.map +1 -1
- package/dist/private/intl/lt-LT.mjs +1 -0
- package/dist/private/intl/lt-LT.mjs.map +1 -1
- package/dist/private/intl/lv-LV.cjs +1 -0
- package/dist/private/intl/lv-LV.cjs.map +1 -1
- package/dist/private/intl/lv-LV.mjs +1 -0
- package/dist/private/intl/lv-LV.mjs.map +1 -1
- package/dist/private/intl/nb-NO.cjs +1 -0
- package/dist/private/intl/nb-NO.cjs.map +1 -1
- package/dist/private/intl/nb-NO.mjs +1 -0
- package/dist/private/intl/nb-NO.mjs.map +1 -1
- package/dist/private/intl/nl-NL.cjs +1 -0
- package/dist/private/intl/nl-NL.cjs.map +1 -1
- package/dist/private/intl/nl-NL.mjs +1 -0
- package/dist/private/intl/nl-NL.mjs.map +1 -1
- package/dist/private/intl/pl-PL.cjs +1 -0
- package/dist/private/intl/pl-PL.cjs.map +1 -1
- package/dist/private/intl/pl-PL.mjs +1 -0
- package/dist/private/intl/pl-PL.mjs.map +1 -1
- package/dist/private/intl/pt-BR.cjs +1 -0
- package/dist/private/intl/pt-BR.cjs.map +1 -1
- package/dist/private/intl/pt-BR.mjs +1 -0
- package/dist/private/intl/pt-BR.mjs.map +1 -1
- package/dist/private/intl/pt-PT.cjs +1 -0
- package/dist/private/intl/pt-PT.cjs.map +1 -1
- package/dist/private/intl/pt-PT.mjs +1 -0
- package/dist/private/intl/pt-PT.mjs.map +1 -1
- package/dist/private/intl/ro-RO.cjs +1 -0
- package/dist/private/intl/ro-RO.cjs.map +1 -1
- package/dist/private/intl/ro-RO.mjs +1 -0
- package/dist/private/intl/ro-RO.mjs.map +1 -1
- package/dist/private/intl/ru-RU.cjs +1 -0
- package/dist/private/intl/ru-RU.cjs.map +1 -1
- package/dist/private/intl/ru-RU.mjs +1 -0
- package/dist/private/intl/ru-RU.mjs.map +1 -1
- package/dist/private/intl/sk-SK.cjs +1 -0
- package/dist/private/intl/sk-SK.cjs.map +1 -1
- package/dist/private/intl/sk-SK.mjs +1 -0
- package/dist/private/intl/sk-SK.mjs.map +1 -1
- package/dist/private/intl/sl-SI.cjs +1 -0
- package/dist/private/intl/sl-SI.cjs.map +1 -1
- package/dist/private/intl/sl-SI.mjs +1 -0
- package/dist/private/intl/sl-SI.mjs.map +1 -1
- package/dist/private/intl/sr-SP.cjs +1 -0
- package/dist/private/intl/sr-SP.cjs.map +1 -1
- package/dist/private/intl/sr-SP.mjs +1 -0
- package/dist/private/intl/sr-SP.mjs.map +1 -1
- package/dist/private/intl/sv-SE.cjs +1 -0
- package/dist/private/intl/sv-SE.cjs.map +1 -1
- package/dist/private/intl/sv-SE.mjs +1 -0
- package/dist/private/intl/sv-SE.mjs.map +1 -1
- package/dist/private/intl/tr-TR.cjs +1 -0
- package/dist/private/intl/tr-TR.cjs.map +1 -1
- package/dist/private/intl/tr-TR.mjs +1 -0
- package/dist/private/intl/tr-TR.mjs.map +1 -1
- package/dist/private/intl/uk-UA.cjs +1 -0
- package/dist/private/intl/uk-UA.cjs.map +1 -1
- package/dist/private/intl/uk-UA.mjs +1 -0
- package/dist/private/intl/uk-UA.mjs.map +1 -1
- package/dist/private/intl/zh-CN.cjs +1 -0
- package/dist/private/intl/zh-CN.cjs.map +1 -1
- package/dist/private/intl/zh-CN.mjs +1 -0
- package/dist/private/intl/zh-CN.mjs.map +1 -1
- package/dist/private/intl/zh-TW.cjs +1 -0
- package/dist/private/intl/zh-TW.cjs.map +1 -1
- package/dist/private/intl/zh-TW.mjs +1 -0
- package/dist/private/intl/zh-TW.mjs.map +1 -1
- package/dist/private/pressScale.cjs.map +1 -1
- package/dist/private/pressScale.mjs.map +1 -1
- package/dist/private/useDOMRef.cjs +3 -2
- package/dist/private/useDOMRef.cjs.map +1 -1
- package/dist/private/useDOMRef.mjs +3 -2
- package/dist/private/useDOMRef.mjs.map +1 -1
- package/dist/private/useDragAndDrop.cjs +25 -0
- package/dist/private/useDragAndDrop.cjs.map +1 -0
- package/dist/private/useDragAndDrop.mjs +20 -0
- package/dist/private/useDragAndDrop.mjs.map +1 -0
- package/dist/types/exports/CenterBaseline.d.ts +1 -0
- package/dist/types/exports/DragPreview.d.ts +2 -0
- package/dist/types/exports/LabeledValue.d.ts +2 -0
- package/dist/types/exports/Skeleton.d.ts +1 -1
- package/dist/types/exports/TableView.d.ts +2 -2
- package/dist/types/exports/index.d.ts +12 -2
- package/dist/types/exports/useDragAndDrop.d.ts +8 -0
- package/dist/types/src/Accordion.d.ts +22 -6
- package/dist/types/src/ActionBar.d.ts +6 -2
- package/dist/types/src/ActionButton.d.ts +15 -5
- package/dist/types/src/ActionButtonGroup.d.ts +13 -4
- package/dist/types/src/ActionMenu.d.ts +1 -1
- package/dist/types/src/AlertDialog.d.ts +3 -1
- package/dist/types/src/Avatar.d.ts +1 -0
- package/dist/types/src/AvatarGroup.d.ts +1 -0
- package/dist/types/src/Badge.d.ts +6 -2
- package/dist/types/src/Breadcrumbs.d.ts +1 -1
- package/dist/types/src/Button.d.ts +2 -1
- package/dist/types/src/Calendar.d.ts +8 -5
- package/dist/types/src/Card.d.ts +4 -1
- package/dist/types/src/CardView.d.ts +6 -1
- package/dist/types/src/CenterBaseline.d.ts +19 -1
- package/dist/types/src/Checkbox.d.ts +5 -5
- package/dist/types/src/CoachMark.d.ts +3 -3
- package/dist/types/src/ColorArea.d.ts +2 -1
- package/dist/types/src/ColorField.d.ts +6 -0
- package/dist/types/src/ColorSwatch.d.ts +2 -0
- package/dist/types/src/ColorSwatchPicker.d.ts +3 -0
- package/dist/types/src/ComboBox.d.ts +18 -7
- package/dist/types/src/ContextualHelp.d.ts +6 -3
- package/dist/types/src/CustomDialog.d.ts +1 -0
- package/dist/types/src/DatePicker.d.ts +5 -2
- package/dist/types/src/DateRangePicker.d.ts +3 -1
- package/dist/types/src/Dialog.d.ts +3 -2
- package/dist/types/src/DialogTrigger.d.ts +3 -3
- package/dist/types/src/Disclosure.d.ts +16 -5
- package/dist/types/src/Divider.d.ts +2 -0
- package/dist/types/src/DragPreview.d.ts +42 -0
- package/dist/types/src/DropZone.d.ts +1 -0
- package/dist/types/src/Field.d.ts +5 -3
- package/dist/types/src/Form.d.ts +3 -1
- package/dist/types/src/FullscreenDialog.d.ts +4 -2
- package/dist/types/src/Image.d.ts +6 -5
- package/dist/types/src/ImageCoordinator.d.ts +3 -1
- package/dist/types/src/InlineAlert.d.ts +4 -2
- package/dist/types/src/LabeledValue.d.ts +61 -0
- package/dist/types/src/Link.d.ts +1 -0
- package/dist/types/src/ListBox.d.ts +1 -1
- package/dist/types/src/ListView.d.ts +12 -24
- package/dist/types/src/Menu.d.ts +9 -7
- package/dist/types/src/Meter.d.ts +4 -1
- package/dist/types/src/NumberField.d.ts +9 -1
- package/dist/types/src/Picker.d.ts +12 -7
- package/dist/types/src/Popover.d.ts +4 -3
- package/dist/types/src/ProgressBar.d.ts +3 -2
- package/dist/types/src/ProgressCircle.d.ts +2 -2
- package/dist/types/src/Provider.d.ts +6 -3
- package/dist/types/src/RadioGroup.d.ts +2 -2
- package/dist/types/src/RangeCalendar.d.ts +4 -2
- package/dist/types/src/RangeSlider.d.ts +6 -3
- package/dist/types/src/SelectBoxGroup.d.ts +3 -1
- package/dist/types/src/SkeletonCollection.d.ts +2 -1
- package/dist/types/src/Slider.d.ts +2 -1
- package/dist/types/src/Switch.d.ts +5 -5
- package/dist/types/src/TableView.d.ts +29 -9
- package/dist/types/src/Tabs.d.ts +5 -2
- package/dist/types/src/TabsPicker.d.ts +9 -4
- package/dist/types/src/TagGroup.d.ts +10 -4
- package/dist/types/src/TextField.d.ts +5 -0
- package/dist/types/src/Toast.d.ts +2 -1
- package/dist/types/src/ToggleButton.d.ts +9 -2
- package/dist/types/src/ToggleButtonGroup.d.ts +4 -1
- package/dist/types/src/TreeView.d.ts +6 -3
- package/dist/types/src/dnd-utils.d.ts +8 -0
- package/dist/types/src/pressScale.d.ts +20 -0
- package/dist/types/src/style-utils.d.ts +34 -27
- package/dist/types/src/useDOMRef.d.ts +3 -3
- package/dist/types/src/useDragAndDrop.d.ts +9 -0
- package/dist/types/style/index.d.ts +27 -33
- package/dist/types/style/runtime.d.ts +6 -8
- package/dist/types/style/spectrum-theme.d.ts +42 -50
- package/dist/types/style/style-macro.d.ts +7 -9
- package/dist/types/style/tokens.d.ts +2 -2
- package/dist/types/ui-icons/CornerTriangle.d.ts +4 -0
- package/dist/types/ui-icons/DragHandle.d.ts +4 -0
- package/exports/Accordion.ts +17 -2
- package/exports/ActionMenu.ts +14 -2
- package/exports/Card.ts +16 -2
- package/exports/CardView.ts +16 -2
- package/exports/CenterBaseline.ts +1 -0
- package/exports/ColorArea.ts +8 -1
- package/exports/ColorField.ts +8 -1
- package/exports/ColorSlider.ts +8 -1
- package/exports/ColorSwatch.ts +8 -1
- package/exports/ColorSwatchPicker.ts +8 -1
- package/exports/ColorWheel.ts +8 -1
- package/exports/ContextualHelp.ts +5 -1
- package/exports/Disclosure.ts +7 -1
- package/exports/DragPreview.ts +2 -0
- package/exports/Icon.ts +6 -1
- package/exports/LabeledValue.ts +2 -0
- package/exports/Menu.ts +17 -2
- package/exports/SegmentedControl.ts +5 -1
- package/exports/Skeleton.ts +1 -1
- package/exports/TableView.ts +27 -3
- package/exports/TreeView.ts +6 -1
- package/exports/index.ts +176 -17
- package/exports/useAsyncList.ts +7 -1
- package/exports/useDragAndDrop.ts +36 -0
- package/icons/Icon.cjs +10 -10
- package/icons/Icon.cjs.map +1 -1
- package/icons/Icon.css +9 -9
- package/icons/Icon.css.map +1 -1
- package/icons/Icon.mjs +10 -10
- package/icons/Icon.mjs.map +1 -1
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs +2 -2
- package/icons/Skeleton.mjs.map +1 -1
- package/icons/runtime.cjs.map +1 -1
- package/icons/runtime.mjs.map +1 -1
- package/icons/useMediaQuery.cjs.map +1 -1
- package/icons/useMediaQuery.mjs.map +1 -1
- package/icons/useSpectrumContextProps.cjs.map +1 -1
- package/icons/useSpectrumContextProps.mjs.map +1 -1
- package/illustrations/gradient/generic1/Conversationbubbles.cjs.map +1 -1
- package/illustrations/gradient/generic1/Conversationbubbles.mjs.map +1 -1
- package/illustrations/gradient/generic2/Conversationbubbles.cjs.map +1 -1
- package/illustrations/gradient/generic2/Conversationbubbles.mjs.map +1 -1
- package/illustrations/linear/BrowserNotCompatible.cjs.map +1 -1
- package/illustrations/linear/BrowserNotCompatible.mjs.map +1 -1
- package/illustrations/linear/CloudStateDisconnected.cjs.map +1 -1
- package/illustrations/linear/CloudStateDisconnected.mjs.map +1 -1
- package/illustrations/linear/ConfettiCelebration.cjs.map +1 -1
- package/illustrations/linear/ConfettiCelebration.mjs.map +1 -1
- package/illustrations/linear/Conversationbubbles.cjs.map +1 -1
- package/illustrations/linear/Conversationbubbles.mjs.map +1 -1
- package/illustrations/linear/MegaphonePromoteExpressive.cjs.map +1 -1
- package/illustrations/linear/MegaphonePromoteExpressive.mjs.map +1 -1
- package/illustrations/linear/NoInternetConnection.cjs.map +1 -1
- package/illustrations/linear/NoInternetConnection.mjs.map +1 -1
- package/package.json +30 -30
- package/src/Accordion.tsx +97 -59
- package/src/ActionBar.tsx +102 -45
- package/src/ActionButton.tsx +358 -252
- package/src/ActionButtonGroup.tsx +59 -38
- package/src/ActionMenu.tsx +21 -10
- package/src/AlertDialog.tsx +28 -26
- package/src/Avatar.tsx +41 -28
- package/src/AvatarGroup.tsx +34 -16
- package/src/Badge.tsx +167 -129
- package/src/Breadcrumbs.tsx +173 -100
- package/src/Button.tsx +390 -289
- package/src/ButtonGroup.tsx +71 -52
- package/src/Calendar.tsx +230 -174
- package/src/Card.tsx +395 -303
- package/src/CardView.tsx +126 -61
- package/src/CenterBaseline.tsx +32 -7
- package/src/Checkbox.tsx +152 -57
- package/src/CheckboxGroup.tsx +96 -63
- package/src/ClearButton.tsx +6 -3
- package/src/CloseButton.tsx +71 -45
- package/src/CoachMark.tsx +204 -192
- package/src/ColorArea.tsx +49 -28
- package/src/ColorField.tsx +83 -36
- package/src/ColorHandle.tsx +36 -25
- package/src/ColorSlider.tsx +123 -90
- package/src/ColorSwatch.tsx +71 -43
- package/src/ColorSwatchPicker.tsx +71 -52
- package/src/ColorWheel.tsx +75 -54
- package/src/ComboBox.tsx +310 -187
- package/src/Content.tsx +59 -38
- package/src/ContextualHelp.tsx +83 -51
- package/src/CustomDialog.tsx +41 -33
- package/src/DateField.tsx +57 -27
- package/src/DatePicker.tsx +117 -66
- package/src/DateRangePicker.tsx +209 -158
- package/src/Dialog.tsx +24 -16
- package/src/DialogContainer.tsx +4 -7
- package/src/DialogTrigger.tsx +4 -6
- package/src/Disclosure.tsx +192 -157
- package/src/Divider.tsx +71 -49
- package/src/DragPreview.tsx +193 -0
- package/src/DropZone.tsx +71 -41
- package/src/Field.tsx +239 -108
- package/src/Fonts.tsx +18 -11
- package/src/Form.tsx +42 -27
- package/src/FullscreenDialog.tsx +24 -39
- package/src/Icon.tsx +70 -33
- package/src/IllustratedMessage.tsx +98 -69
- package/src/Image.tsx +105 -49
- package/src/ImageCoordinator.tsx +39 -24
- package/src/InlineAlert.tsx +90 -81
- package/src/LabeledValue.tsx +344 -0
- package/src/Link.tsx +99 -45
- package/src/ListBox.tsx +2 -9
- package/src/ListView.tsx +484 -280
- package/src/Menu.tsx +306 -180
- package/src/Meter.tsx +51 -21
- package/src/Modal.tsx +90 -81
- package/src/NotificationBadge.tsx +98 -74
- package/src/NumberField.tsx +160 -90
- package/src/Picker.tsx +311 -172
- package/src/Popover.tsx +196 -149
- package/src/ProgressBar.tsx +81 -56
- package/src/ProgressCircle.tsx +70 -48
- package/src/Provider.tsx +16 -16
- package/src/RadioGroup.tsx +164 -55
- package/src/RangeCalendar.tsx +63 -42
- package/src/RangeSlider.tsx +47 -35
- package/src/SearchField.tsx +110 -75
- package/src/SegmentedControl.tsx +101 -76
- package/src/SelectBoxGroup.tsx +231 -191
- package/src/Skeleton.tsx +75 -49
- package/src/SkeletonCollection.tsx +16 -16
- package/src/Slider.tsx +135 -83
- package/src/StatusLight.tsx +61 -22
- package/src/Switch.tsx +122 -38
- package/src/TableView.tsx +1040 -356
- package/src/Tabs.tsx +336 -185
- package/src/TabsPicker.tsx +152 -107
- package/src/TagGroup.tsx +175 -81
- package/src/TextField.tsx +120 -54
- package/src/TimeField.tsx +48 -23
- package/src/Toast.module.css +11 -5
- package/src/Toast.tsx +119 -87
- package/src/ToggleButton.tsx +99 -25
- package/src/ToggleButtonGroup.tsx +22 -6
- package/src/Toolbar.tsx +0 -1
- package/src/Tooltip.tsx +64 -26
- package/src/TreeView.tsx +345 -91
- package/src/bar-utils.ts +65 -68
- package/src/dnd-utils.tsx +127 -0
- package/src/font-faces.css +129 -33
- package/src/page.macro.ts +2 -2
- package/src/pressScale.ts +24 -1
- package/src/progress-utils.tsx +1 -1
- package/src/style-utils.ts +225 -212
- package/src/useDOMRef.ts +26 -11
- package/src/useDragAndDrop.ts +32 -0
- package/src/useMediaQuery.ts +2 -4
- package/src/useSpectrumContextProps.ts +5 -1
- package/style/__tests__/mergeStyles.test.ts +15 -4
- package/style/__tests__/style-macro.test.js +81 -71
- package/style/dist/main.cjs +25 -25
- package/style/dist/main.cjs.map +1 -1
- package/style/dist/module.mjs +13 -13
- package/style/dist/module.mjs.map +1 -1
- package/style/dist/properties.mjs +3 -3
- package/style/dist/spectrum-theme.cjs +227 -228
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +220 -221
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/style-macro.cjs +102 -101
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +96 -95
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/dist/style-utils.cjs +51 -39
- package/style/dist/style-utils.cjs.map +1 -1
- package/style/dist/style-utils.mjs +50 -38
- package/style/dist/style-utils.mjs.map +1 -1
- package/style/index.ts +105 -74
- package/style/package.json +2 -2
- package/style/runtime.ts +6 -8
- package/style/spectrum-theme.ts +482 -194
- package/style/style-macro.ts +310 -121
- package/style/tokens.ts +79 -41
- package/style/types.ts +146 -70
package/src/TableView.tsx
CHANGED
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {ActionButton, ActionButtonContext} from './ActionButton';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
baseColor,
|
|
16
|
+
centerPadding,
|
|
17
|
+
color,
|
|
18
|
+
colorMix,
|
|
19
|
+
focusRing,
|
|
20
|
+
fontRelative,
|
|
21
|
+
lightDark,
|
|
22
|
+
setColorScheme,
|
|
23
|
+
space,
|
|
24
|
+
style
|
|
25
|
+
} from '../style' with {type: 'macro'};
|
|
15
26
|
import {Button, ButtonContext} from 'react-aria-components/Button';
|
|
16
27
|
import {ButtonGroup} from './ButtonGroup';
|
|
17
28
|
import {
|
|
@@ -27,6 +38,8 @@ import {
|
|
|
27
38
|
Table as RACTable,
|
|
28
39
|
TableBody as RACTableBody,
|
|
29
40
|
TableBodyProps as RACTableBodyProps,
|
|
41
|
+
TableFooter as RACTableFooter,
|
|
42
|
+
TableFooterProps as RACTableFooterProps,
|
|
30
43
|
TableHeader as RACTableHeader,
|
|
31
44
|
TableHeaderProps as RACTableHeaderProps,
|
|
32
45
|
TableProps as RACTableProps,
|
|
@@ -42,34 +55,74 @@ import Checkmark from '../s2wf-icons/S2_Icon_Checkmark_20_N.svg';
|
|
|
42
55
|
import Chevron from '../ui-icons/Chevron';
|
|
43
56
|
import Close from '../s2wf-icons/S2_Icon_Close_20_N.svg';
|
|
44
57
|
import {Collection} from 'react-aria/Collection';
|
|
45
|
-
import {
|
|
58
|
+
import {
|
|
59
|
+
CollectionRendererContext,
|
|
60
|
+
DefaultCollectionRenderer
|
|
61
|
+
} from 'react-aria-components/CollectionBuilder';
|
|
46
62
|
import {ColumnSize} from 'react-stately/useTableState';
|
|
47
63
|
import {ContextValue, DEFAULT_SLOT, Provider, useSlottedContext} from 'react-aria-components/slots';
|
|
48
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
controlFont,
|
|
66
|
+
getAllowedOverrides,
|
|
67
|
+
StylesPropWithHeight,
|
|
68
|
+
UnsafeStyles
|
|
69
|
+
} from './style-utils' with {type: 'macro'};
|
|
49
70
|
import {css} from '../style/style-macro' with {type: 'macro'};
|
|
50
71
|
import {CustomDialog} from './CustomDialog';
|
|
51
72
|
import {DialogContainer} from './DialogContainer';
|
|
52
|
-
import {
|
|
73
|
+
import {
|
|
74
|
+
DOMProps,
|
|
75
|
+
DOMRef,
|
|
76
|
+
DOMRefValue,
|
|
77
|
+
forwardRefType,
|
|
78
|
+
GlobalDOMAttributes,
|
|
79
|
+
ItemDropTarget,
|
|
80
|
+
LinkDOMProps,
|
|
81
|
+
LoadingState,
|
|
82
|
+
Node
|
|
83
|
+
} from '@react-types/shared';
|
|
84
|
+
import {DragHandleButton, InsertionIndicator} from './dnd-utils';
|
|
85
|
+
import {DragPreview} from './DragPreview';
|
|
53
86
|
import {Form} from 'react-aria-components/Form';
|
|
54
|
-
import {
|
|
87
|
+
import {
|
|
88
|
+
getActiveElement,
|
|
89
|
+
isFocusWithin,
|
|
90
|
+
nodeContains
|
|
91
|
+
} from 'react-aria/private/utils/shadowdom/DOMFunctions';
|
|
55
92
|
import {getOwnerDocument} from 'react-aria/private/utils/domHelpers';
|
|
56
93
|
import {GridNode} from 'react-stately/private/grid/GridCollection';
|
|
57
94
|
import {IconContext} from './Icon';
|
|
58
95
|
import intlMessages from '../intl/*.json';
|
|
59
96
|
import {Key} from '@react-types/shared';
|
|
97
|
+
import {LayoutInfo, Rect, TableLayout, Virtualizer} from 'react-aria-components/Virtualizer';
|
|
60
98
|
import {LayoutNode} from 'react-stately/useVirtualizerState';
|
|
61
99
|
import {Menu, MenuItem, MenuSection, MenuTrigger} from './Menu';
|
|
62
100
|
import Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';
|
|
63
101
|
import {OverlayTriggerStateContext} from 'react-aria-components/Dialog';
|
|
64
102
|
import {ProgressCircle} from './ProgressCircle';
|
|
65
103
|
import {CheckboxContext as RACCheckboxContext} from 'react-aria-components/Checkbox';
|
|
66
|
-
// @ts-ignore
|
|
67
104
|
import {Popover as RACPopover} from 'react-aria-components/Popover';
|
|
68
|
-
import React, {
|
|
69
|
-
|
|
105
|
+
import React, {
|
|
106
|
+
createContext,
|
|
107
|
+
CSSProperties,
|
|
108
|
+
FormEvent,
|
|
109
|
+
FormHTMLAttributes,
|
|
110
|
+
ForwardedRef,
|
|
111
|
+
forwardRef,
|
|
112
|
+
ReactElement,
|
|
113
|
+
ReactNode,
|
|
114
|
+
RefObject,
|
|
115
|
+
useCallback,
|
|
116
|
+
useContext,
|
|
117
|
+
useEffect,
|
|
118
|
+
useMemo,
|
|
119
|
+
useRef,
|
|
120
|
+
useState
|
|
121
|
+
} from 'react';
|
|
70
122
|
import SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';
|
|
71
123
|
import SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';
|
|
72
124
|
import {Button as SpectrumButton} from './Button';
|
|
125
|
+
import type {TableState} from 'react-stately/useTableState';
|
|
73
126
|
import {useActionBarContainer} from './ActionBar';
|
|
74
127
|
import {useDOMRef} from './useDOMRef';
|
|
75
128
|
import {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';
|
|
@@ -83,63 +136,119 @@ import {VisuallyHidden} from 'react-aria/VisuallyHidden';
|
|
|
83
136
|
|
|
84
137
|
interface S2TableProps {
|
|
85
138
|
/** Whether the Table should be displayed with a quiet style. */
|
|
86
|
-
isQuiet?: boolean
|
|
139
|
+
isQuiet?: boolean;
|
|
87
140
|
/**
|
|
88
141
|
* Sets the amount of vertical padding within each cell.
|
|
142
|
+
*
|
|
89
143
|
* @default 'regular'
|
|
90
144
|
*/
|
|
91
|
-
density?: 'compact' | 'spacious' | 'regular'
|
|
145
|
+
density?: 'compact' | 'spacious' | 'regular';
|
|
92
146
|
/**
|
|
93
147
|
* Sets the overflow behavior for the cell contents.
|
|
148
|
+
*
|
|
94
149
|
* @default 'truncate'
|
|
95
150
|
*/
|
|
96
|
-
overflowMode?: 'wrap' | 'truncate'
|
|
151
|
+
overflowMode?: 'wrap' | 'truncate';
|
|
97
152
|
// TODO: will we contine with onAction or rename to onRowAction like it is in RAC?
|
|
98
153
|
/** Handler that is called when a user performs an action on a row. */
|
|
99
|
-
onAction?: (key: Key) => void
|
|
154
|
+
onAction?: (key: Key) => void;
|
|
100
155
|
/**
|
|
101
156
|
* Handler that is called when a user starts a column resize.
|
|
102
157
|
*/
|
|
103
|
-
onResizeStart?: (widths: Map<Key, ColumnSize>) => void
|
|
158
|
+
onResizeStart?: (widths: Map<Key, ColumnSize>) => void;
|
|
104
159
|
/**
|
|
105
160
|
* Handler that is called when a user performs a column resize.
|
|
106
161
|
* Can be used with the width property on columns to put the column widths into
|
|
107
162
|
* a controlled state.
|
|
108
163
|
*/
|
|
109
|
-
onResize?: (widths: Map<Key, ColumnSize>) => void
|
|
164
|
+
onResize?: (widths: Map<Key, ColumnSize>) => void;
|
|
110
165
|
/**
|
|
111
166
|
* Handler that is called after a user performs a column resize.
|
|
112
167
|
* Can be used to store the widths of columns for another future session.
|
|
113
168
|
*/
|
|
114
|
-
onResizeEnd?: (widths: Map<Key, ColumnSize>) => void
|
|
169
|
+
onResizeEnd?: (widths: Map<Key, ColumnSize>) => void;
|
|
115
170
|
/** The current loading state of the table. */
|
|
116
|
-
loadingState?: LoadingState
|
|
171
|
+
loadingState?: LoadingState;
|
|
117
172
|
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
|
|
118
|
-
onLoadMore?: () => any
|
|
173
|
+
onLoadMore?: () => any;
|
|
119
174
|
/** Provides the ActionBar to display when rows are selected in the TableView. */
|
|
120
|
-
renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement
|
|
175
|
+
renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement;
|
|
176
|
+
/**
|
|
177
|
+
* How selection should be displayed.
|
|
178
|
+
*
|
|
179
|
+
* @default 'checkbox'
|
|
180
|
+
*/
|
|
181
|
+
selectionStyle?: 'checkbox' | 'highlight';
|
|
121
182
|
}
|
|
122
183
|
|
|
123
184
|
// TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody
|
|
124
|
-
export interface TableViewProps
|
|
185
|
+
export interface TableViewProps
|
|
186
|
+
extends
|
|
187
|
+
Omit<
|
|
188
|
+
RACTableProps,
|
|
189
|
+
| 'style'
|
|
190
|
+
| 'className'
|
|
191
|
+
| 'render'
|
|
192
|
+
| 'onRowAction'
|
|
193
|
+
| 'selectionBehavior'
|
|
194
|
+
| 'onScroll'
|
|
195
|
+
| 'onCellAction'
|
|
196
|
+
| keyof GlobalDOMAttributes
|
|
197
|
+
>,
|
|
198
|
+
DOMProps,
|
|
199
|
+
UnsafeStyles,
|
|
200
|
+
S2TableProps {
|
|
125
201
|
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
126
|
-
styles?: StylesPropWithHeight
|
|
202
|
+
styles?: StylesPropWithHeight;
|
|
127
203
|
}
|
|
128
204
|
|
|
129
|
-
let InternalTableContext = createContext<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
205
|
+
let InternalTableContext = createContext<
|
|
206
|
+
TableViewProps & {
|
|
207
|
+
layout?: S2TableLayout<unknown>;
|
|
208
|
+
setIsInResizeMode?: (val: boolean) => void;
|
|
209
|
+
isInResizeMode?: boolean;
|
|
210
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
|
211
|
+
selectionStyle?: 'checkbox' | 'highlight';
|
|
212
|
+
}
|
|
213
|
+
>({});
|
|
214
|
+
|
|
215
|
+
const tableWrapper = style(
|
|
216
|
+
{
|
|
217
|
+
minHeight: 0,
|
|
218
|
+
minWidth: 0,
|
|
219
|
+
display: 'flex',
|
|
220
|
+
isolation: 'isolate',
|
|
221
|
+
disableTapHighlight: true,
|
|
222
|
+
position: 'relative',
|
|
223
|
+
// Clip ActionBar animation.
|
|
224
|
+
overflow: 'clip'
|
|
225
|
+
},
|
|
226
|
+
getAllowedOverrides({height: true})
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
// due to the overflow: clip for actionbar, render the outline via a pseudo element so it isn't
|
|
230
|
+
// clipped. 6px radius matches the table's border radius
|
|
231
|
+
const rootDropOutline = css(`
|
|
232
|
+
&:has([role="grid"][data-drop-target])::after {
|
|
233
|
+
content: "";
|
|
234
|
+
position: absolute;
|
|
235
|
+
inset: 0;
|
|
236
|
+
pointer-events: none;
|
|
237
|
+
border: 2px solid ${color('blue-800')};
|
|
238
|
+
border-radius: 6px;
|
|
239
|
+
z-index: 2;
|
|
240
|
+
}
|
|
241
|
+
@media (forced-colors: active) {
|
|
242
|
+
&:has([role="grid"][data-drop-target])::after {
|
|
243
|
+
border-color: Highlight;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
`);
|
|
141
247
|
|
|
142
|
-
const
|
|
248
|
+
const dropTargetBackground = colorMix('gray-25', 'blue-900', 10);
|
|
249
|
+
const table = style<
|
|
250
|
+
TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean; isDragAndDrop?: boolean}
|
|
251
|
+
>({
|
|
143
252
|
width: 'full',
|
|
144
253
|
height: 'full',
|
|
145
254
|
boxSizing: 'border-box',
|
|
@@ -152,16 +261,23 @@ const table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boo
|
|
|
152
261
|
backgroundColor: {
|
|
153
262
|
default: 'gray-25',
|
|
154
263
|
isQuiet: 'transparent',
|
|
264
|
+
isDropTarget: dropTargetBackground,
|
|
155
265
|
forcedColors: 'Background'
|
|
156
266
|
},
|
|
157
|
-
borderColor:
|
|
267
|
+
borderColor: {
|
|
268
|
+
default: 'gray-300',
|
|
269
|
+
isDropTarget: 'blue-800',
|
|
270
|
+
forcedColors: {
|
|
271
|
+
default: 'ButtonBorder',
|
|
272
|
+
isDropTarget: 'Highlight'
|
|
273
|
+
}
|
|
274
|
+
},
|
|
158
275
|
borderStyle: 'solid',
|
|
159
276
|
borderWidth: {
|
|
160
277
|
default: 1,
|
|
161
278
|
isQuiet: 0
|
|
162
279
|
},
|
|
163
280
|
...focusRing(),
|
|
164
|
-
outlineOffset: -1, // Cover the border
|
|
165
281
|
borderRadius: {
|
|
166
282
|
default: '[6px]',
|
|
167
283
|
isQuiet: 'none'
|
|
@@ -175,7 +291,24 @@ const table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boo
|
|
|
175
291
|
// Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW
|
|
176
292
|
scrollPaddingTop: 32,
|
|
177
293
|
scrollPaddingStart: {
|
|
178
|
-
isCheckboxSelection: 40
|
|
294
|
+
isCheckboxSelection: 40,
|
|
295
|
+
isDragAndDrop: {
|
|
296
|
+
default: 16,
|
|
297
|
+
isCheckboxSelection: 56
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
forcedColorAdjust: 'none',
|
|
301
|
+
'--indicator-level-padding': {
|
|
302
|
+
type: 'width',
|
|
303
|
+
value: {
|
|
304
|
+
// 16 (drag cell width) + 14 (chevron start padding + half of chevron (5) - radius of drop indicator circle (6) - 1 (fudge factor)) + 40 (checkbox cell width)
|
|
305
|
+
default: 30,
|
|
306
|
+
isCheckboxSelection: 71
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
'--indent': {
|
|
310
|
+
type: 'width',
|
|
311
|
+
value: 16
|
|
179
312
|
}
|
|
180
313
|
});
|
|
181
314
|
|
|
@@ -206,11 +339,11 @@ export class S2TableLayout<T> extends TableLayout<T> {
|
|
|
206
339
|
}
|
|
207
340
|
|
|
208
341
|
protected buildCollection(): LayoutNode[] {
|
|
209
|
-
let
|
|
210
|
-
if (
|
|
342
|
+
let rowGroups = super.buildCollection();
|
|
343
|
+
if (rowGroups.length < 2) {
|
|
211
344
|
return [];
|
|
212
345
|
}
|
|
213
|
-
let {layoutInfo} =
|
|
346
|
+
let {layoutInfo} = rowGroups[1];
|
|
214
347
|
// TableLayout's buildCollection always sets the body width to the max width between the header width, but
|
|
215
348
|
// we want the body to be sticky and only as wide as the table so it is always in view if loading/empty
|
|
216
349
|
let isEmptyOrLoading = this.virtualizer?.collection.size === 0;
|
|
@@ -218,10 +351,7 @@ export class S2TableLayout<T> extends TableLayout<T> {
|
|
|
218
351
|
layoutInfo.rect.width = this.virtualizer!.size.width - 80;
|
|
219
352
|
}
|
|
220
353
|
|
|
221
|
-
return
|
|
222
|
-
header,
|
|
223
|
-
body
|
|
224
|
-
];
|
|
354
|
+
return rowGroups;
|
|
225
355
|
}
|
|
226
356
|
|
|
227
357
|
protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {
|
|
@@ -237,16 +367,23 @@ export class S2TableLayout<T> extends TableLayout<T> {
|
|
|
237
367
|
return layoutNode;
|
|
238
368
|
}
|
|
239
369
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
370
|
+
protected buildRowGroup(y: number, node: GridNode<T>): LayoutNode {
|
|
371
|
+
let layoutNode = super.buildRowGroup(y, node);
|
|
372
|
+
if (node.type !== 'tablebody') {
|
|
373
|
+
return layoutNode;
|
|
374
|
+
}
|
|
243
375
|
let {layoutInfo} = layoutNode;
|
|
244
376
|
// Needs overflow for sticky loader
|
|
245
377
|
layoutInfo.allowOverflow = true;
|
|
246
378
|
// If loading or empty, we'll want the body to be sticky and centered
|
|
247
379
|
let isEmptyOrLoading = this.virtualizer?.collection.size === 0;
|
|
248
380
|
if (isEmptyOrLoading) {
|
|
249
|
-
layoutInfo.rect = new Rect(
|
|
381
|
+
layoutInfo.rect = new Rect(
|
|
382
|
+
40,
|
|
383
|
+
40,
|
|
384
|
+
this.virtualizer!.size.width - 80,
|
|
385
|
+
this.virtualizer!.size.height - 80
|
|
386
|
+
);
|
|
250
387
|
layoutInfo.isSticky = true;
|
|
251
388
|
}
|
|
252
389
|
|
|
@@ -273,14 +410,26 @@ export class S2TableLayout<T> extends TableLayout<T> {
|
|
|
273
410
|
layoutNode.layoutInfo.allowOverflow = true;
|
|
274
411
|
return layoutNode;
|
|
275
412
|
}
|
|
413
|
+
|
|
414
|
+
getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {
|
|
415
|
+
let layoutInfo = super.getDropTargetLayoutInfo(target);
|
|
416
|
+
layoutInfo.zIndex = 1;
|
|
417
|
+
layoutInfo.allowOverflow = true;
|
|
418
|
+
return layoutInfo;
|
|
419
|
+
}
|
|
276
420
|
}
|
|
277
421
|
|
|
278
|
-
export const TableContext =
|
|
422
|
+
export const TableContext =
|
|
423
|
+
createContext<ContextValue<Partial<TableViewProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
279
424
|
|
|
280
425
|
/**
|
|
281
|
-
* Tables are containers for displaying information. They allow users to quickly scan, sort,
|
|
426
|
+
* Tables are containers for displaying information. They allow users to quickly scan, sort,
|
|
427
|
+
* compare, and take action on large amounts of data.
|
|
282
428
|
*/
|
|
283
|
-
export const TableView = forwardRef(function TableView(
|
|
429
|
+
export const TableView = forwardRef(function TableView(
|
|
430
|
+
props: TableViewProps,
|
|
431
|
+
ref: DOMRef<HTMLDivElement>
|
|
432
|
+
) {
|
|
284
433
|
[props, ref] = useSpectrumContextProps(props, ref, TableContext);
|
|
285
434
|
let {
|
|
286
435
|
UNSAFE_style,
|
|
@@ -296,38 +445,78 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
|
|
|
296
445
|
onAction,
|
|
297
446
|
onLoadMore,
|
|
298
447
|
selectionMode = 'none',
|
|
448
|
+
selectionStyle = 'checkbox',
|
|
449
|
+
dragAndDropHooks,
|
|
450
|
+
disabledBehavior = 'all',
|
|
299
451
|
...otherProps
|
|
300
452
|
} = props;
|
|
301
453
|
|
|
454
|
+
if (dragAndDropHooks && dragAndDropHooks.renderDragPreview == null) {
|
|
455
|
+
dragAndDropHooks.renderDragPreview = items => (
|
|
456
|
+
<DragPreview items={items} overflowMode={overflowMode} />
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (dragAndDropHooks) {
|
|
461
|
+
dragAndDropHooks.renderDropIndicator = target => (
|
|
462
|
+
<InsertionIndicator target={target as ItemDropTarget} />
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
|
|
302
466
|
let domRef = useDOMRef(ref);
|
|
303
467
|
let scale = useScale();
|
|
304
468
|
|
|
305
469
|
// Starts when the user selects resize from the menu, ends when resizing ends
|
|
306
470
|
// used to control the visibility of the resizer Nubbin
|
|
307
471
|
let [isInResizeMode, setIsInResizeMode] = useState(false);
|
|
308
|
-
let onResizeStart = useCallback(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
472
|
+
let onResizeStart = useCallback(
|
|
473
|
+
widths => {
|
|
474
|
+
propsOnResizeStart?.(widths);
|
|
475
|
+
},
|
|
476
|
+
[propsOnResizeStart]
|
|
477
|
+
);
|
|
478
|
+
let onResizeEnd = useCallback(
|
|
479
|
+
widths => {
|
|
480
|
+
setIsInResizeMode(false);
|
|
481
|
+
propsOnResizeEnd?.(widths);
|
|
482
|
+
},
|
|
483
|
+
[propsOnResizeEnd, setIsInResizeMode]
|
|
484
|
+
);
|
|
485
|
+
|
|
486
|
+
let context = useMemo(
|
|
487
|
+
() => ({
|
|
488
|
+
isQuiet,
|
|
489
|
+
density,
|
|
490
|
+
overflowMode,
|
|
491
|
+
loadingState,
|
|
492
|
+
onLoadMore,
|
|
493
|
+
isInResizeMode,
|
|
494
|
+
setIsInResizeMode,
|
|
495
|
+
selectionMode,
|
|
496
|
+
selectionStyle,
|
|
497
|
+
disabledBehavior
|
|
498
|
+
}),
|
|
499
|
+
[
|
|
500
|
+
isQuiet,
|
|
501
|
+
density,
|
|
502
|
+
overflowMode,
|
|
503
|
+
loadingState,
|
|
504
|
+
onLoadMore,
|
|
505
|
+
isInResizeMode,
|
|
506
|
+
setIsInResizeMode,
|
|
507
|
+
selectionMode,
|
|
508
|
+
selectionStyle,
|
|
509
|
+
disabledBehavior
|
|
510
|
+
]
|
|
511
|
+
);
|
|
326
512
|
|
|
327
513
|
let scrollRef = useRef<HTMLElement | null>(null);
|
|
328
514
|
let isCheckboxSelection = selectionMode === 'multiple' || selectionMode === 'single';
|
|
329
|
-
|
|
330
|
-
let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({
|
|
515
|
+
let isDragAndDrop = !!dragAndDropHooks?.useDraggableCollectionState;
|
|
516
|
+
let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({
|
|
517
|
+
...props,
|
|
518
|
+
scrollRef
|
|
519
|
+
});
|
|
331
520
|
|
|
332
521
|
return (
|
|
333
522
|
<ResizableTableContainer
|
|
@@ -336,20 +525,17 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
|
|
|
336
525
|
onResize={propsOnResize}
|
|
337
526
|
onResizeEnd={onResizeEnd}
|
|
338
527
|
onResizeStart={onResizeStart}
|
|
339
|
-
className={(UNSAFE_className || '') + tableWrapper(null, styles)}
|
|
528
|
+
className={(UNSAFE_className || '') + tableWrapper(null, styles) + ' ' + rootDropOutline}
|
|
340
529
|
style={UNSAFE_style}>
|
|
341
530
|
<Virtualizer
|
|
342
531
|
layout={S2TableLayout}
|
|
343
532
|
layoutOptions={{
|
|
344
|
-
rowHeight: overflowMode === 'wrap'
|
|
345
|
-
|
|
346
|
-
: ROW_HEIGHTS[density][scale],
|
|
347
|
-
estimatedRowHeight: overflowMode === 'wrap'
|
|
348
|
-
? ROW_HEIGHTS[density][scale]
|
|
349
|
-
: undefined,
|
|
533
|
+
rowHeight: overflowMode === 'wrap' ? undefined : ROW_HEIGHTS[density][scale],
|
|
534
|
+
estimatedRowHeight: overflowMode === 'wrap' ? ROW_HEIGHTS[density][scale] : undefined,
|
|
350
535
|
// No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap
|
|
351
536
|
headingHeight: DEFAULT_HEADER_HEIGHT[scale],
|
|
352
|
-
loaderHeight: 60
|
|
537
|
+
loaderHeight: 60,
|
|
538
|
+
dropIndicatorThickness: 0
|
|
353
539
|
}}>
|
|
354
540
|
<InternalTableContext.Provider value={context}>
|
|
355
541
|
<RACTable
|
|
@@ -362,18 +548,24 @@ export const TableView = forwardRef(function TableView(props: TableViewProps, re
|
|
|
362
548
|
paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,
|
|
363
549
|
scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0
|
|
364
550
|
}}
|
|
365
|
-
className={renderProps =>
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
551
|
+
className={renderProps =>
|
|
552
|
+
table({
|
|
553
|
+
...renderProps,
|
|
554
|
+
isCheckboxSelection,
|
|
555
|
+
isDragAndDrop,
|
|
556
|
+
isQuiet
|
|
557
|
+
})
|
|
558
|
+
}
|
|
559
|
+
selectionBehavior={selectionStyle === 'highlight' ? 'replace' : 'toggle'}
|
|
371
560
|
selectionMode={selectionMode}
|
|
372
561
|
onRowAction={onAction}
|
|
562
|
+
dragAndDropHooks={dragAndDropHooks}
|
|
563
|
+
disabledBehavior={disabledBehavior}
|
|
373
564
|
{...otherProps}
|
|
374
565
|
selectedKeys={selectedKeys}
|
|
375
566
|
defaultSelectedKeys={undefined}
|
|
376
|
-
onSelectionChange={onSelectionChange}
|
|
567
|
+
onSelectionChange={onSelectionChange}
|
|
568
|
+
/>
|
|
377
569
|
</InternalTableContext.Provider>
|
|
378
570
|
</Virtualizer>
|
|
379
571
|
{actionBar}
|
|
@@ -389,12 +581,18 @@ const centeredWrapper = style({
|
|
|
389
581
|
height: 'full'
|
|
390
582
|
});
|
|
391
583
|
|
|
392
|
-
export interface TableBodyProps<T> extends Omit<
|
|
584
|
+
export interface TableBodyProps<T> extends Omit<
|
|
585
|
+
RACTableBodyProps<T>,
|
|
586
|
+
'style' | 'className' | 'render' | keyof GlobalDOMAttributes
|
|
587
|
+
> {}
|
|
393
588
|
|
|
394
589
|
/**
|
|
395
590
|
* The body of a `<Table>`, containing the table rows.
|
|
396
591
|
*/
|
|
397
|
-
export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T
|
|
592
|
+
export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T>(
|
|
593
|
+
props: TableBodyProps<T>,
|
|
594
|
+
ref: DOMRef<HTMLDivElement>
|
|
595
|
+
) {
|
|
398
596
|
let {items, renderEmptyState, children, dependencies = []} = props;
|
|
399
597
|
let domRef = useDOMRef(ref);
|
|
400
598
|
let {loadingState, onLoadMore} = useContext(InternalTableContext);
|
|
@@ -406,11 +604,12 @@ export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
|
|
|
406
604
|
// This is because we don't distinguish between loadingMore and loading in the layout, resulting in a different rect being used to build the body. Perhaps can be considered as a user error
|
|
407
605
|
// if they pass loadingMore without having any other items in the table. Alternatively, could update the layout so it knows the current loading state.
|
|
408
606
|
let loadMoreSpinner = (
|
|
409
|
-
<TableLoadMoreItem
|
|
607
|
+
<TableLoadMoreItem
|
|
608
|
+
isLoading={loadingState === 'loadingMore'}
|
|
609
|
+
onLoadMore={onLoadMore}
|
|
610
|
+
className={style({height: 'full', width: 'full'})}>
|
|
410
611
|
<div className={centeredWrapper}>
|
|
411
|
-
<ProgressCircle
|
|
412
|
-
isIndeterminate
|
|
413
|
-
aria-label={stringFormatter.format('table.loadingMore')} />
|
|
612
|
+
<ProgressCircle isIndeterminate aria-label={stringFormatter.format('table.loadingMore')} />
|
|
414
613
|
</div>
|
|
415
614
|
</TableLoadMoreItem>
|
|
416
615
|
);
|
|
@@ -448,9 +647,7 @@ export const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
|
|
|
448
647
|
} else if (loadingState === 'loading') {
|
|
449
648
|
emptyRender = () => (
|
|
450
649
|
<div className={centeredWrapper}>
|
|
451
|
-
<ProgressCircle
|
|
452
|
-
isIndeterminate
|
|
453
|
-
aria-label={stringFormatter.format('table.loading')} />
|
|
650
|
+
<ProgressCircle isIndeterminate aria-label={stringFormatter.format('table.loading')} />
|
|
454
651
|
</div>
|
|
455
652
|
);
|
|
456
653
|
}
|
|
@@ -477,13 +674,32 @@ const cellFocus = {
|
|
|
477
674
|
outlineWidth: 2,
|
|
478
675
|
outlineColor: {
|
|
479
676
|
default: 'focus-ring',
|
|
480
|
-
forcedColors:
|
|
677
|
+
forcedColors: {
|
|
678
|
+
default: 'Highlight'
|
|
679
|
+
}
|
|
481
680
|
},
|
|
482
|
-
borderRadius: '[
|
|
681
|
+
borderRadius: '[5px]',
|
|
682
|
+
// We need to render the cell focus ring on top of the cell divider if there is one. The divider has a z-index of 1.
|
|
683
|
+
zIndex: 2
|
|
483
684
|
} as const;
|
|
484
685
|
|
|
485
686
|
function CellFocusRing() {
|
|
486
|
-
return
|
|
687
|
+
return (
|
|
688
|
+
<div
|
|
689
|
+
role="presentation"
|
|
690
|
+
className={style({
|
|
691
|
+
...cellFocus,
|
|
692
|
+
position: 'absolute',
|
|
693
|
+
top: 'var(--topFocusRing, 0)',
|
|
694
|
+
bottom: 0,
|
|
695
|
+
insetStart: 0,
|
|
696
|
+
insetEnd: 0,
|
|
697
|
+
pointerEvents: 'none'
|
|
698
|
+
})({
|
|
699
|
+
isFocusVisible: true
|
|
700
|
+
})}
|
|
701
|
+
/>
|
|
702
|
+
);
|
|
487
703
|
}
|
|
488
704
|
|
|
489
705
|
const columnStyles = style({
|
|
@@ -528,20 +744,24 @@ const columnStyles = style({
|
|
|
528
744
|
forcedColorAdjust: 'none'
|
|
529
745
|
});
|
|
530
746
|
|
|
531
|
-
export interface ColumnProps extends Omit<
|
|
747
|
+
export interface ColumnProps extends Omit<
|
|
748
|
+
RACColumnProps,
|
|
749
|
+
'style' | 'className' | 'render' | keyof GlobalDOMAttributes
|
|
750
|
+
> {
|
|
532
751
|
/** Whether the column should render a divider between it and the next column. */
|
|
533
|
-
showDivider?: boolean
|
|
752
|
+
showDivider?: boolean;
|
|
534
753
|
/** Whether the column allows resizing. */
|
|
535
|
-
allowsResizing?: boolean
|
|
754
|
+
allowsResizing?: boolean;
|
|
536
755
|
/**
|
|
537
756
|
* The alignment of the column's contents relative to its allotted width.
|
|
757
|
+
*
|
|
538
758
|
* @default 'start'
|
|
539
759
|
*/
|
|
540
|
-
align?: 'start' | 'center' | 'end'
|
|
760
|
+
align?: 'start' | 'center' | 'end';
|
|
541
761
|
/** The content to render as the column header. */
|
|
542
|
-
children: ReactNode
|
|
762
|
+
children: ReactNode;
|
|
543
763
|
/** Menu fragment to be rendered inside the column header's menu. */
|
|
544
|
-
menuItems?: ReactNode
|
|
764
|
+
menuItems?: ReactNode;
|
|
545
765
|
}
|
|
546
766
|
|
|
547
767
|
/**
|
|
@@ -553,26 +773,37 @@ export const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef
|
|
|
553
773
|
let domRef = useDOMRef(ref);
|
|
554
774
|
let isMenu = allowsResizing || !!props.menuItems;
|
|
555
775
|
|
|
556
|
-
|
|
557
776
|
return (
|
|
558
|
-
<RACColumn
|
|
777
|
+
<RACColumn
|
|
778
|
+
{...props}
|
|
779
|
+
ref={domRef}
|
|
780
|
+
style={{borderInlineEndColor: 'transparent'}}
|
|
781
|
+
className={renderProps => columnStyles({...renderProps, isMenu, align, isQuiet})}>
|
|
559
782
|
{({allowsSorting, sortDirection, isFocusVisible, sort, startResize}) => (
|
|
560
783
|
<>
|
|
561
784
|
{/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity
|
|
562
785
|
(no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}
|
|
563
786
|
{/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}
|
|
564
787
|
{isFocusVisible && <CellFocusRing />}
|
|
565
|
-
{isMenu ?
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
788
|
+
{isMenu ? (
|
|
789
|
+
<ColumnWithMenu
|
|
790
|
+
isColumnResizable={allowsResizing}
|
|
791
|
+
menuItems={props.menuItems}
|
|
792
|
+
allowsSorting={allowsSorting}
|
|
793
|
+
sortDirection={sortDirection}
|
|
794
|
+
sort={sort}
|
|
795
|
+
startResize={startResize}
|
|
796
|
+
align={align}>
|
|
797
|
+
{children}
|
|
798
|
+
</ColumnWithMenu>
|
|
799
|
+
) : (
|
|
800
|
+
<ColumnContents
|
|
801
|
+
align={align}
|
|
802
|
+
allowsSorting={allowsSorting}
|
|
803
|
+
sortDirection={sortDirection}>
|
|
804
|
+
{children}
|
|
805
|
+
</ColumnContents>
|
|
806
|
+
)}
|
|
576
807
|
</>
|
|
577
808
|
)}
|
|
578
809
|
</RACColumn>
|
|
@@ -607,7 +838,10 @@ const sortIcon = style({
|
|
|
607
838
|
}
|
|
608
839
|
});
|
|
609
840
|
|
|
610
|
-
interface ColumnContentProps
|
|
841
|
+
interface ColumnContentProps
|
|
842
|
+
extends
|
|
843
|
+
Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>,
|
|
844
|
+
Pick<ColumnProps, 'align' | 'children'> {}
|
|
611
845
|
|
|
612
846
|
function ColumnContents(props: ColumnContentProps) {
|
|
613
847
|
let {align, allowsSorting, sortDirection, children} = props;
|
|
@@ -617,18 +851,18 @@ function ColumnContents(props: ColumnContentProps) {
|
|
|
617
851
|
{allowsSorting && (
|
|
618
852
|
<Provider
|
|
619
853
|
values={[
|
|
620
|
-
[
|
|
621
|
-
|
|
622
|
-
|
|
854
|
+
[
|
|
855
|
+
IconContext,
|
|
856
|
+
{
|
|
857
|
+
styles: sortIcon({})
|
|
858
|
+
}
|
|
859
|
+
]
|
|
623
860
|
]}>
|
|
624
|
-
{sortDirection != null &&
|
|
625
|
-
sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />
|
|
626
|
-
)}
|
|
861
|
+
{sortDirection != null &&
|
|
862
|
+
(sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
|
|
627
863
|
</Provider>
|
|
628
864
|
)}
|
|
629
|
-
<span className={columnHeaderText}>
|
|
630
|
-
{children}
|
|
631
|
-
</span>
|
|
865
|
+
<span className={columnHeaderText}>{children}</span>
|
|
632
866
|
</div>
|
|
633
867
|
);
|
|
634
868
|
}
|
|
@@ -671,14 +905,14 @@ const resizerHandleContainer = style({
|
|
|
671
905
|
cursor: {
|
|
672
906
|
default: 'none',
|
|
673
907
|
resizableDirection: {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
908
|
+
left: 'e-resize',
|
|
909
|
+
right: 'w-resize',
|
|
910
|
+
both: 'ew-resize'
|
|
677
911
|
}
|
|
678
912
|
}
|
|
679
913
|
});
|
|
680
914
|
|
|
681
|
-
const resizerHandle = style<{isFocusVisible: boolean
|
|
915
|
+
const resizerHandle = style<{isFocusVisible: boolean; isResizing: boolean}>({
|
|
682
916
|
backgroundColor: {
|
|
683
917
|
default: 'gray-300',
|
|
684
918
|
isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version
|
|
@@ -739,16 +973,28 @@ const nubbin = style({
|
|
|
739
973
|
}
|
|
740
974
|
});
|
|
741
975
|
|
|
742
|
-
interface ColumnWithMenuProps
|
|
743
|
-
|
|
744
|
-
|
|
976
|
+
interface ColumnWithMenuProps
|
|
977
|
+
extends
|
|
978
|
+
Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize'>,
|
|
979
|
+
Pick<ColumnProps, 'align' | 'children'> {
|
|
980
|
+
isColumnResizable?: boolean;
|
|
981
|
+
menuItems?: ReactNode;
|
|
745
982
|
}
|
|
746
983
|
|
|
747
984
|
function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
748
|
-
let {
|
|
985
|
+
let {
|
|
986
|
+
allowsSorting,
|
|
987
|
+
sortDirection,
|
|
988
|
+
sort,
|
|
989
|
+
startResize,
|
|
990
|
+
children,
|
|
991
|
+
align,
|
|
992
|
+
isColumnResizable,
|
|
993
|
+
menuItems
|
|
994
|
+
} = props;
|
|
749
995
|
let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);
|
|
750
996
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
|
751
|
-
const onMenuSelect =
|
|
997
|
+
const onMenuSelect = key => {
|
|
752
998
|
switch (key) {
|
|
753
999
|
case 'sort-asc':
|
|
754
1000
|
sort('ascending');
|
|
@@ -764,12 +1010,14 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
|
764
1010
|
};
|
|
765
1011
|
|
|
766
1012
|
let items = useMemo(() => {
|
|
767
|
-
let options: Array<{label: string
|
|
1013
|
+
let options: Array<{label: string; id: string}> = [];
|
|
768
1014
|
if (isColumnResizable) {
|
|
769
|
-
options = [
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1015
|
+
options = [
|
|
1016
|
+
{
|
|
1017
|
+
label: stringFormatter.format('table.resizeColumn'),
|
|
1018
|
+
id: 'resize'
|
|
1019
|
+
}
|
|
1020
|
+
];
|
|
773
1021
|
}
|
|
774
1022
|
if (allowsSorting) {
|
|
775
1023
|
options = [
|
|
@@ -785,7 +1033,7 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
|
785
1033
|
];
|
|
786
1034
|
}
|
|
787
1035
|
return options;
|
|
788
|
-
|
|
1036
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
789
1037
|
}, [allowsSorting, isColumnResizable]);
|
|
790
1038
|
|
|
791
1039
|
let buttonAlignment = 'start';
|
|
@@ -800,30 +1048,31 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
|
800
1048
|
return (
|
|
801
1049
|
<>
|
|
802
1050
|
<MenuTrigger align={menuAlign}>
|
|
803
|
-
<Button
|
|
1051
|
+
<Button
|
|
1052
|
+
className={renderProps =>
|
|
1053
|
+
resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})
|
|
1054
|
+
}>
|
|
804
1055
|
{allowsSorting && (
|
|
805
1056
|
<Provider
|
|
806
1057
|
values={[
|
|
807
|
-
[
|
|
808
|
-
|
|
809
|
-
|
|
1058
|
+
[
|
|
1059
|
+
IconContext,
|
|
1060
|
+
{
|
|
1061
|
+
styles: sortIcon({isButton: true})
|
|
1062
|
+
}
|
|
1063
|
+
]
|
|
810
1064
|
]}>
|
|
811
|
-
{sortDirection != null &&
|
|
812
|
-
sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />
|
|
813
|
-
)}
|
|
1065
|
+
{sortDirection != null &&
|
|
1066
|
+
(sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
|
|
814
1067
|
</Provider>
|
|
815
1068
|
)}
|
|
816
|
-
<div className={columnHeaderText}>
|
|
817
|
-
{children}
|
|
818
|
-
</div>
|
|
1069
|
+
<div className={columnHeaderText}>{children}</div>
|
|
819
1070
|
<Chevron size="M" className={chevronIcon} />
|
|
820
1071
|
</Button>
|
|
821
1072
|
<Menu onAction={onMenuSelect} styles={style({minWidth: 128})}>
|
|
822
1073
|
{items.length > 0 && (
|
|
823
1074
|
<MenuSection>
|
|
824
|
-
<Collection items={items}>
|
|
825
|
-
{(item) => <MenuItem>{item?.label}</MenuItem>}
|
|
826
|
-
</Collection>
|
|
1075
|
+
<Collection items={items}>{item => <MenuItem>{item?.label}</MenuItem>}</Collection>
|
|
827
1076
|
</MenuSection>
|
|
828
1077
|
)}
|
|
829
1078
|
{menuItems}
|
|
@@ -831,13 +1080,21 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
|
831
1080
|
</MenuTrigger>
|
|
832
1081
|
{isColumnResizable && (
|
|
833
1082
|
<div data-react-aria-prevent-focus="true">
|
|
834
|
-
<ColumnResizer
|
|
1083
|
+
<ColumnResizer
|
|
1084
|
+
data-react-aria-prevent-focus="true"
|
|
1085
|
+
className={({resizableDirection, isResizing}) =>
|
|
1086
|
+
resizerHandleContainer({resizableDirection, isResizing, isInResizeMode})
|
|
1087
|
+
}>
|
|
835
1088
|
{({isFocusVisible, isResizing}) => (
|
|
836
1089
|
<>
|
|
837
1090
|
<ResizerIndicator isFocusVisible={isFocusVisible} isResizing={isResizing} />
|
|
838
|
-
{(isFocusVisible || isInResizeMode) && isResizing &&
|
|
1091
|
+
{(isFocusVisible || isInResizeMode) && isResizing && (
|
|
1092
|
+
<div className={nubbin}>
|
|
1093
|
+
<Nubbin />
|
|
1094
|
+
</div>
|
|
1095
|
+
)}
|
|
839
1096
|
</>
|
|
840
|
-
|
|
1097
|
+
)}
|
|
841
1098
|
</ColumnResizer>
|
|
842
1099
|
</div>
|
|
843
1100
|
)}
|
|
@@ -846,15 +1103,16 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
|
|
|
846
1103
|
}
|
|
847
1104
|
|
|
848
1105
|
function ResizerIndicator({isFocusVisible, isResizing}) {
|
|
849
|
-
return (
|
|
850
|
-
<div className={resizerHandle({isFocusVisible, isResizing})} />
|
|
851
|
-
);
|
|
1106
|
+
return <div className={resizerHandle({isFocusVisible, isResizing})} />;
|
|
852
1107
|
}
|
|
853
1108
|
|
|
854
1109
|
const tableHeader = style({
|
|
855
1110
|
height: 'full',
|
|
856
1111
|
width: 'full',
|
|
857
|
-
backgroundColor:
|
|
1112
|
+
backgroundColor: {
|
|
1113
|
+
default: 'gray-75',
|
|
1114
|
+
forcedColors: 'transparent'
|
|
1115
|
+
},
|
|
858
1116
|
// Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header
|
|
859
1117
|
marginTop: '[-1px]',
|
|
860
1118
|
'--resizerDisplay': {
|
|
@@ -866,8 +1124,7 @@ const tableHeader = style({
|
|
|
866
1124
|
}
|
|
867
1125
|
});
|
|
868
1126
|
|
|
869
|
-
const selectAllCheckbox = style({
|
|
870
|
-
});
|
|
1127
|
+
const selectAllCheckbox = style({});
|
|
871
1128
|
|
|
872
1129
|
const selectAllCheckboxColumn = style({
|
|
873
1130
|
paddingStart: {
|
|
@@ -898,66 +1155,94 @@ const selectAllCheckboxColumn = style({
|
|
|
898
1155
|
},
|
|
899
1156
|
borderBottomWidth: 1,
|
|
900
1157
|
borderStyle: 'solid',
|
|
901
|
-
backgroundColor:
|
|
1158
|
+
backgroundColor: {
|
|
1159
|
+
default: 'gray-75',
|
|
1160
|
+
forcedColors: 'transparent'
|
|
1161
|
+
}
|
|
902
1162
|
});
|
|
903
1163
|
|
|
904
|
-
export interface TableHeaderProps<T> extends Omit<
|
|
1164
|
+
export interface TableHeaderProps<T> extends Omit<
|
|
1165
|
+
RACTableHeaderProps<T>,
|
|
1166
|
+
| 'style'
|
|
1167
|
+
| 'className'
|
|
1168
|
+
| 'render'
|
|
1169
|
+
| 'onHoverChange'
|
|
1170
|
+
| 'onHoverStart'
|
|
1171
|
+
| 'onHoverEnd'
|
|
1172
|
+
| keyof GlobalDOMAttributes
|
|
1173
|
+
> {}
|
|
905
1174
|
|
|
906
1175
|
/**
|
|
907
1176
|
* A header within a `<Table>`, containing the table columns.
|
|
908
1177
|
*/
|
|
909
|
-
export const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T
|
|
1178
|
+
export const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T>(
|
|
1179
|
+
{columns, dependencies, children}: TableHeaderProps<T>,
|
|
1180
|
+
ref: DOMRef<HTMLDivElement>
|
|
1181
|
+
) {
|
|
910
1182
|
let scale = useScale();
|
|
911
|
-
let {selectionBehavior, selectionMode} = useTableOptions();
|
|
912
|
-
let {isQuiet} = useContext(InternalTableContext);
|
|
1183
|
+
let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
|
|
1184
|
+
let {isQuiet, selectionStyle} = useContext(InternalTableContext);
|
|
913
1185
|
let domRef = useDOMRef(ref);
|
|
1186
|
+
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
|
914
1187
|
|
|
915
1188
|
return (
|
|
916
|
-
|
|
1189
|
+
<RACTableHeader
|
|
917
1190
|
// @ts-ignore
|
|
918
1191
|
ref={domRef}
|
|
919
1192
|
className={tableHeader}>
|
|
1193
|
+
{allowsDragging && (
|
|
1194
|
+
<RACColumn
|
|
1195
|
+
// @ts-ignore
|
|
1196
|
+
isSticky
|
|
1197
|
+
width={scale === 'medium' ? 16 : 20}
|
|
1198
|
+
minWidth={scale === 'medium' ? 16 : 20}
|
|
1199
|
+
className={selectAllCheckboxColumn({isQuiet})}>
|
|
1200
|
+
{({isFocusVisible}) => (
|
|
1201
|
+
<>
|
|
1202
|
+
{isFocusVisible && <CellFocusRing />}
|
|
1203
|
+
<VisuallyHidden>{stringFormatter.format('table.drag')}</VisuallyHidden>
|
|
1204
|
+
</>
|
|
1205
|
+
)}
|
|
1206
|
+
</RACColumn>
|
|
1207
|
+
)}
|
|
920
1208
|
{/* Add extra columns for selection. */}
|
|
921
|
-
{selectionBehavior === 'toggle' && (
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1209
|
+
{selectionBehavior === 'toggle' && selectionStyle === 'checkbox' && (
|
|
1210
|
+
<RACColumn
|
|
1211
|
+
// Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
|
|
1212
|
+
// @ts-ignore
|
|
1213
|
+
isSticky
|
|
1214
|
+
width={scale === 'medium' ? 40 : 52}
|
|
1215
|
+
minWidth={scale === 'medium' ? 40 : 52}
|
|
1216
|
+
className={selectAllCheckboxColumn({isQuiet})}>
|
|
925
1217
|
{({isFocusVisible}) => (
|
|
926
1218
|
<>
|
|
927
|
-
{selectionMode === 'single' &&
|
|
1219
|
+
{selectionMode === 'single' && (
|
|
928
1220
|
<>
|
|
929
1221
|
{isFocusVisible && <CellFocusRing />}
|
|
930
1222
|
<VisuallyHiddenSelectAllLabel />
|
|
931
1223
|
</>
|
|
932
|
-
}
|
|
933
|
-
{selectionMode === 'multiple' &&
|
|
1224
|
+
)}
|
|
1225
|
+
{selectionMode === 'multiple' && (
|
|
934
1226
|
<Checkbox styles={selectAllCheckbox} slot="selection" />
|
|
935
|
-
}
|
|
1227
|
+
)}
|
|
936
1228
|
</>
|
|
937
1229
|
)}
|
|
938
|
-
</RACColumn>
|
|
1230
|
+
</RACColumn>
|
|
939
1231
|
)}
|
|
940
1232
|
<Collection items={columns} dependencies={dependencies}>
|
|
941
1233
|
{children}
|
|
942
1234
|
</Collection>
|
|
943
|
-
</RACTableHeader>
|
|
1235
|
+
</RACTableHeader>
|
|
944
1236
|
);
|
|
945
1237
|
});
|
|
946
1238
|
|
|
947
1239
|
function VisuallyHiddenSelectAllLabel() {
|
|
948
1240
|
let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');
|
|
949
1241
|
|
|
950
|
-
return
|
|
951
|
-
<VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>
|
|
952
|
-
);
|
|
1242
|
+
return <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>;
|
|
953
1243
|
}
|
|
954
1244
|
|
|
955
1245
|
const commonCellStyles = {
|
|
956
|
-
borderColor: 'transparent',
|
|
957
|
-
borderBottomWidth: 1,
|
|
958
|
-
borderTopWidth: 0,
|
|
959
|
-
borderXWidth: 0,
|
|
960
|
-
borderStyle: 'solid',
|
|
961
1246
|
position: 'relative',
|
|
962
1247
|
color: '--rowTextColor',
|
|
963
1248
|
outlineStyle: 'none',
|
|
@@ -965,10 +1250,6 @@ const commonCellStyles = {
|
|
|
965
1250
|
} as const;
|
|
966
1251
|
|
|
967
1252
|
const treeColumnStyles = {
|
|
968
|
-
'--indent': {
|
|
969
|
-
type: 'width',
|
|
970
|
-
value: 16
|
|
971
|
-
},
|
|
972
1253
|
'--treeColumnPadding': {
|
|
973
1254
|
type: 'width',
|
|
974
1255
|
value: {
|
|
@@ -982,7 +1263,9 @@ const treeColumnStyles = {
|
|
|
982
1263
|
}
|
|
983
1264
|
} as const;
|
|
984
1265
|
|
|
985
|
-
const cell = style<
|
|
1266
|
+
const cell = style<
|
|
1267
|
+
CellRenderProps & S2TableProps & {isDivider: boolean; isTreeColumnWithNoChildren: boolean}
|
|
1268
|
+
>({
|
|
986
1269
|
...commonCellStyles,
|
|
987
1270
|
...treeColumnStyles,
|
|
988
1271
|
minHeight: {
|
|
@@ -997,19 +1280,18 @@ const cell = style<CellRenderProps & S2TableProps & {isDivider: boolean, isTreeC
|
|
|
997
1280
|
width: 'full',
|
|
998
1281
|
fontSize: controlFont(),
|
|
999
1282
|
alignItems: 'center',
|
|
1000
|
-
display: 'flex'
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
}
|
|
1283
|
+
display: 'flex'
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
const divider = style({
|
|
1287
|
+
display: 'block',
|
|
1288
|
+
position: 'absolute',
|
|
1289
|
+
width: '[1px]',
|
|
1290
|
+
height: 'full',
|
|
1291
|
+
insetEnd: 0,
|
|
1292
|
+
backgroundColor: 'var(--borderColorGray)',
|
|
1293
|
+
// set a z index on the divider so the highlight selection border and focus ring can override it
|
|
1294
|
+
zIndex: 1
|
|
1013
1295
|
});
|
|
1014
1296
|
|
|
1015
1297
|
const stickyCell = {
|
|
@@ -1030,6 +1312,17 @@ const checkboxCellStyle = style({
|
|
|
1030
1312
|
backgroundColor: '--rowBackgroundColor'
|
|
1031
1313
|
});
|
|
1032
1314
|
|
|
1315
|
+
const dragCellStyle = style({
|
|
1316
|
+
...commonCellStyles,
|
|
1317
|
+
...stickyCell,
|
|
1318
|
+
paddingStart: 4,
|
|
1319
|
+
paddingEnd: 4,
|
|
1320
|
+
alignContent: 'center',
|
|
1321
|
+
height: 'calc(100% - 1px)',
|
|
1322
|
+
borderBottomWidth: 0,
|
|
1323
|
+
backgroundColor: '--rowBackgroundColor'
|
|
1324
|
+
});
|
|
1325
|
+
|
|
1033
1326
|
const cellContent = style({
|
|
1034
1327
|
truncate: {
|
|
1035
1328
|
default: true,
|
|
@@ -1067,25 +1360,21 @@ const cellContent = style({
|
|
|
1067
1360
|
}
|
|
1068
1361
|
});
|
|
1069
1362
|
|
|
1070
|
-
export interface CellProps
|
|
1363
|
+
export interface CellProps
|
|
1364
|
+
extends
|
|
1365
|
+
Omit<RACCellProps, 'style' | 'className' | 'render' | keyof GlobalDOMAttributes>,
|
|
1366
|
+
Pick<ColumnProps, 'align' | 'showDivider'> {
|
|
1071
1367
|
/** @private */
|
|
1072
|
-
isSticky?: boolean
|
|
1368
|
+
isSticky?: boolean;
|
|
1073
1369
|
/** The content to render as the cell children. */
|
|
1074
|
-
children: ReactNode
|
|
1370
|
+
children: ReactNode;
|
|
1075
1371
|
}
|
|
1076
1372
|
|
|
1077
1373
|
/**
|
|
1078
1374
|
* A cell within a table row.
|
|
1079
1375
|
*/
|
|
1080
1376
|
export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {
|
|
1081
|
-
let {
|
|
1082
|
-
children,
|
|
1083
|
-
isSticky,
|
|
1084
|
-
showDivider = false,
|
|
1085
|
-
align,
|
|
1086
|
-
textValue,
|
|
1087
|
-
...otherProps
|
|
1088
|
-
} = props;
|
|
1377
|
+
let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;
|
|
1089
1378
|
let domRef = useDOMRef(ref);
|
|
1090
1379
|
let tableVisualOptions = useContext(InternalTableContext);
|
|
1091
1380
|
textValue ||= typeof children === 'string' ? children : undefined;
|
|
@@ -1096,20 +1385,25 @@ export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLD
|
|
|
1096
1385
|
// Also isSticky prop is applied just for the layout, will decide what the RAC api should be later
|
|
1097
1386
|
// @ts-ignore
|
|
1098
1387
|
isSticky={isSticky}
|
|
1099
|
-
className={renderProps =>
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1388
|
+
className={renderProps =>
|
|
1389
|
+
cell({
|
|
1390
|
+
...renderProps,
|
|
1391
|
+
...tableVisualOptions,
|
|
1392
|
+
isDivider: showDivider,
|
|
1393
|
+
isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
|
|
1394
|
+
})
|
|
1395
|
+
}
|
|
1105
1396
|
textValue={textValue}
|
|
1106
1397
|
{...otherProps}>
|
|
1107
1398
|
{({id, isFocusVisible, hasChildItems, isTreeColumn, isExpanded, isDisabled}) => (
|
|
1108
1399
|
<>
|
|
1109
|
-
{
|
|
1400
|
+
{showDivider && <div className={divider} />}
|
|
1401
|
+
{hasChildItems && isTreeColumn && (
|
|
1110
1402
|
<ExpandableRowChevron key={id} isDisabled={isDisabled} isExpanded={isExpanded} />
|
|
1111
|
-
}
|
|
1112
|
-
<span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>
|
|
1403
|
+
)}
|
|
1404
|
+
<span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>
|
|
1405
|
+
{children}
|
|
1406
|
+
</span>
|
|
1113
1407
|
{isFocusVisible && <CellFocusRing />}
|
|
1114
1408
|
</>
|
|
1115
1409
|
)}
|
|
@@ -1118,10 +1412,10 @@ export const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLD
|
|
|
1118
1412
|
});
|
|
1119
1413
|
|
|
1120
1414
|
interface ExpandableRowChevronProps {
|
|
1121
|
-
isExpanded?: boolean
|
|
1122
|
-
isDisabled?: boolean
|
|
1123
|
-
isRTL?: boolean
|
|
1124
|
-
isHidden?: boolean
|
|
1415
|
+
isExpanded?: boolean;
|
|
1416
|
+
isDisabled?: boolean;
|
|
1417
|
+
isRTL?: boolean;
|
|
1418
|
+
isHidden?: boolean;
|
|
1125
1419
|
}
|
|
1126
1420
|
|
|
1127
1421
|
const expandButton = style<ExpandableRowChevronProps>({
|
|
@@ -1168,7 +1462,9 @@ function ExpandableRowChevron(props: ExpandableRowChevronProps) {
|
|
|
1168
1462
|
{...props}
|
|
1169
1463
|
ref={ref}
|
|
1170
1464
|
slot="chevron"
|
|
1171
|
-
className={renderProps =>
|
|
1465
|
+
className={renderProps =>
|
|
1466
|
+
expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', isHidden})
|
|
1467
|
+
}>
|
|
1172
1468
|
<Chevron
|
|
1173
1469
|
className={style({
|
|
1174
1470
|
scale: {
|
|
@@ -1181,17 +1477,31 @@ function ExpandableRowChevron(props: ExpandableRowChevronProps) {
|
|
|
1181
1477
|
type: 'fill',
|
|
1182
1478
|
value: 'currentColor'
|
|
1183
1479
|
}
|
|
1184
|
-
})({direction})}
|
|
1480
|
+
})({direction})}
|
|
1481
|
+
/>
|
|
1185
1482
|
</Button>
|
|
1186
1483
|
);
|
|
1187
1484
|
}
|
|
1188
1485
|
|
|
1189
|
-
const editableCell = style<
|
|
1486
|
+
const editableCell = style<
|
|
1487
|
+
CellRenderProps &
|
|
1488
|
+
S2TableProps & {
|
|
1489
|
+
isDivider: boolean;
|
|
1490
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
|
1491
|
+
isSaving?: boolean;
|
|
1492
|
+
isTreeColumnWithNoChildren: boolean;
|
|
1493
|
+
}
|
|
1494
|
+
>({
|
|
1190
1495
|
...commonCellStyles,
|
|
1191
1496
|
...treeColumnStyles,
|
|
1192
1497
|
color: {
|
|
1193
1498
|
default: baseColor('neutral'),
|
|
1194
|
-
isSaving: baseColor('neutral-subdued')
|
|
1499
|
+
isSaving: baseColor('neutral-subdued'),
|
|
1500
|
+
forcedColors: 'ButtonText',
|
|
1501
|
+
isDisabled: {
|
|
1502
|
+
default: 'disabled',
|
|
1503
|
+
forcedColors: 'GrayText'
|
|
1504
|
+
}
|
|
1195
1505
|
},
|
|
1196
1506
|
paddingY: centerPadding(),
|
|
1197
1507
|
boxSizing: 'border-box',
|
|
@@ -1214,52 +1524,58 @@ const editableCell = style<CellRenderProps & S2TableProps & {isDivider: boolean,
|
|
|
1214
1524
|
}
|
|
1215
1525
|
});
|
|
1216
1526
|
|
|
1217
|
-
let editPopover = style(
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1527
|
+
let editPopover = style(
|
|
1528
|
+
{
|
|
1529
|
+
...setColorScheme(),
|
|
1530
|
+
'--s2-container-bg': {
|
|
1531
|
+
type: 'backgroundColor',
|
|
1532
|
+
value: 'layer-2'
|
|
1533
|
+
},
|
|
1534
|
+
backgroundColor: '--s2-container-bg',
|
|
1535
|
+
borderBottomRadius: 'default',
|
|
1536
|
+
// Use box-shadow instead of filter when an arrow is not shown.
|
|
1537
|
+
// This fixes the shadow stacking problem with submenus.
|
|
1538
|
+
boxShadow: 'elevated',
|
|
1539
|
+
borderStyle: 'solid',
|
|
1540
|
+
borderWidth: 1,
|
|
1541
|
+
borderColor: {
|
|
1542
|
+
default: 'gray-200',
|
|
1543
|
+
forcedColors: 'ButtonBorder'
|
|
1544
|
+
},
|
|
1545
|
+
boxSizing: 'content-box',
|
|
1546
|
+
isolation: 'isolate',
|
|
1547
|
+
pointerEvents: {
|
|
1548
|
+
isExiting: 'none'
|
|
1549
|
+
},
|
|
1550
|
+
outlineStyle: 'none',
|
|
1551
|
+
minWidth: '--trigger-width',
|
|
1552
|
+
padding: 8,
|
|
1553
|
+
display: 'flex',
|
|
1554
|
+
alignItems: 'center'
|
|
1233
1555
|
},
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
pointerEvents: {
|
|
1237
|
-
isExiting: 'none'
|
|
1238
|
-
},
|
|
1239
|
-
outlineStyle: 'none',
|
|
1240
|
-
minWidth: '--trigger-width',
|
|
1241
|
-
padding: 8,
|
|
1242
|
-
display: 'flex',
|
|
1243
|
-
alignItems: 'center'
|
|
1244
|
-
}, getAllowedOverrides());
|
|
1556
|
+
getAllowedOverrides()
|
|
1557
|
+
);
|
|
1245
1558
|
|
|
1246
1559
|
interface EditableCellProps extends Omit<CellProps, 'isSticky'> {
|
|
1247
1560
|
/** The component which will handle editing the cell. For example, a `TextField` or a `Picker`. */
|
|
1248
|
-
renderEditing: () => ReactNode
|
|
1561
|
+
renderEditing: () => ReactNode;
|
|
1249
1562
|
/** Whether the cell is currently being saved. */
|
|
1250
|
-
isSaving?: boolean
|
|
1563
|
+
isSaving?: boolean;
|
|
1251
1564
|
/** Handler that is called when the value has been changed and is ready to be saved. */
|
|
1252
|
-
onSubmit?: (e: FormEvent<HTMLFormElement>) => void
|
|
1565
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
|
|
1253
1566
|
/** Handler that is called when the user cancels the edit. */
|
|
1254
|
-
onCancel?: () => void
|
|
1567
|
+
onCancel?: () => void;
|
|
1255
1568
|
/** The action to submit the form to. Only available in React 19+. */
|
|
1256
|
-
action?: string | FormHTMLAttributes<HTMLFormElement>['action']
|
|
1569
|
+
action?: string | FormHTMLAttributes<HTMLFormElement>['action'];
|
|
1257
1570
|
}
|
|
1258
1571
|
|
|
1259
1572
|
/**
|
|
1260
1573
|
* An editable cell within a table row.
|
|
1261
1574
|
*/
|
|
1262
|
-
export const EditableCell = forwardRef(function EditableCell(
|
|
1575
|
+
export const EditableCell = forwardRef(function EditableCell(
|
|
1576
|
+
props: EditableCellProps,
|
|
1577
|
+
ref: ForwardedRef<HTMLDivElement>
|
|
1578
|
+
) {
|
|
1263
1579
|
let {children, showDivider = false, textValue, isSaving, ...otherProps} = props;
|
|
1264
1580
|
let tableVisualOptions = useContext(InternalTableContext);
|
|
1265
1581
|
let domRef = useObjectRef(ref);
|
|
@@ -1268,21 +1584,27 @@ export const EditableCell = forwardRef(function EditableCell(props: EditableCell
|
|
|
1268
1584
|
return (
|
|
1269
1585
|
<RACCell
|
|
1270
1586
|
ref={domRef}
|
|
1271
|
-
className={renderProps =>
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1587
|
+
className={renderProps =>
|
|
1588
|
+
editableCell({
|
|
1589
|
+
...renderProps,
|
|
1590
|
+
...tableVisualOptions,
|
|
1591
|
+
isDivider: showDivider,
|
|
1592
|
+
isSaving,
|
|
1593
|
+
isTreeColumnWithNoChildren: renderProps.isTreeColumn && !renderProps.hasChildItems
|
|
1594
|
+
})
|
|
1595
|
+
}
|
|
1278
1596
|
textValue={textValue}
|
|
1279
1597
|
{...otherProps}>
|
|
1280
1598
|
{({id, isFocusVisible, hasChildItems, isTreeColumn, isExpanded, isDisabled}) => (
|
|
1281
1599
|
<>
|
|
1282
|
-
{hasChildItems && isTreeColumn &&
|
|
1600
|
+
{hasChildItems && isTreeColumn && (
|
|
1283
1601
|
<ExpandableRowChevron key={id} isDisabled={isDisabled} isExpanded={isExpanded} />
|
|
1284
|
-
}
|
|
1285
|
-
<EditableCellInner
|
|
1602
|
+
)}
|
|
1603
|
+
<EditableCellInner
|
|
1604
|
+
{...props}
|
|
1605
|
+
isFocusVisible={isFocusVisible}
|
|
1606
|
+
cellRef={domRef as RefObject<HTMLDivElement>}
|
|
1607
|
+
/>
|
|
1286
1608
|
</>
|
|
1287
1609
|
)}
|
|
1288
1610
|
</RACCell>
|
|
@@ -1301,8 +1623,20 @@ const nonTextInputTypes = new Set([
|
|
|
1301
1623
|
'reset'
|
|
1302
1624
|
]);
|
|
1303
1625
|
|
|
1304
|
-
function EditableCellInner(
|
|
1305
|
-
|
|
1626
|
+
function EditableCellInner(
|
|
1627
|
+
props: EditableCellProps & {isFocusVisible: boolean; cellRef: RefObject<HTMLDivElement>}
|
|
1628
|
+
) {
|
|
1629
|
+
let {
|
|
1630
|
+
children,
|
|
1631
|
+
align,
|
|
1632
|
+
renderEditing,
|
|
1633
|
+
isSaving,
|
|
1634
|
+
onSubmit,
|
|
1635
|
+
isFocusVisible,
|
|
1636
|
+
cellRef,
|
|
1637
|
+
action,
|
|
1638
|
+
onCancel
|
|
1639
|
+
} = props;
|
|
1306
1640
|
let [isOpen, setIsOpen] = useState(false);
|
|
1307
1641
|
let popoverRef = useRef<HTMLDivElement>(null);
|
|
1308
1642
|
let formRef = useRef<HTMLFormElement>(null);
|
|
@@ -1342,14 +1676,16 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
|
|
|
1342
1676
|
useEffect(() => {
|
|
1343
1677
|
if (isOpen) {
|
|
1344
1678
|
let activeElement = getActiveElement(getOwnerDocument(formRef.current));
|
|
1345
|
-
if (
|
|
1346
|
-
&&
|
|
1679
|
+
if (
|
|
1680
|
+
activeElement &&
|
|
1681
|
+
nodeContains(formRef.current, activeElement) &&
|
|
1347
1682
|
// not going to handle contenteditable https://stackoverflow.com/questions/6139107/programmatically-select-text-in-a-contenteditable-html-element
|
|
1348
1683
|
// seems like an edge case anyways
|
|
1349
|
-
&&
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1684
|
+
((activeElement instanceof HTMLInputElement &&
|
|
1685
|
+
!nonTextInputTypes.has(activeElement.type)) ||
|
|
1686
|
+
activeElement instanceof HTMLTextAreaElement) &&
|
|
1687
|
+
typeof activeElement.select === 'function'
|
|
1688
|
+
) {
|
|
1353
1689
|
activeElement.select();
|
|
1354
1690
|
}
|
|
1355
1691
|
}
|
|
@@ -1386,38 +1722,40 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
|
|
|
1386
1722
|
<Provider
|
|
1387
1723
|
values={[
|
|
1388
1724
|
[ButtonContext, null],
|
|
1389
|
-
[
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1725
|
+
[
|
|
1726
|
+
ActionButtonContext,
|
|
1727
|
+
{
|
|
1728
|
+
slots: {
|
|
1729
|
+
[DEFAULT_SLOT]: {},
|
|
1730
|
+
edit: {
|
|
1731
|
+
onPress: () => setIsOpen(true),
|
|
1732
|
+
isPending: isSaving,
|
|
1733
|
+
isQuiet: !isSaving,
|
|
1734
|
+
size,
|
|
1735
|
+
excludeFromTabOrder: true,
|
|
1736
|
+
styles: style({
|
|
1737
|
+
// TODO: really need access to display here instead, but not possible right now
|
|
1738
|
+
// will be addressable with displayOuter
|
|
1739
|
+
// Could use `hidden` attribute instead of css, but I don't have access to much of this state at the moment
|
|
1740
|
+
visibility: {
|
|
1741
|
+
default: 'hidden',
|
|
1742
|
+
isForcedVisible: 'visible',
|
|
1743
|
+
':is([role="row"]:hover *)': 'visible',
|
|
1744
|
+
':is([role="row"][data-focus-visible-within] *)': 'visible',
|
|
1745
|
+
'@media not ((hover: hover) and (pointer: fine))': 'visible'
|
|
1746
|
+
}
|
|
1747
|
+
})({isForcedVisible: isOpen || !!isSaving})
|
|
1748
|
+
}
|
|
1410
1749
|
}
|
|
1411
1750
|
}
|
|
1412
|
-
|
|
1751
|
+
]
|
|
1413
1752
|
]}>
|
|
1414
|
-
<span className={cellContent({...tableVisualOptions, align: align || 'start'})}>
|
|
1753
|
+
<span className={cellContent({...tableVisualOptions, align: align || 'start'})}>
|
|
1754
|
+
{children}
|
|
1755
|
+
</span>
|
|
1415
1756
|
{isFocusVisible && <CellFocusRing />}
|
|
1416
1757
|
|
|
1417
|
-
<Provider
|
|
1418
|
-
values={[
|
|
1419
|
-
[ActionButtonContext, null]
|
|
1420
|
-
]}>
|
|
1758
|
+
<Provider values={[[ActionButtonContext, null]]}>
|
|
1421
1759
|
{!isMobile && (
|
|
1422
1760
|
<RACPopover
|
|
1423
1761
|
isOpen={isOpen}
|
|
@@ -1441,23 +1779,37 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
|
|
|
1441
1779
|
zIndex: undefined
|
|
1442
1780
|
}}
|
|
1443
1781
|
className={editPopover}>
|
|
1444
|
-
<Provider
|
|
1445
|
-
values={[
|
|
1446
|
-
[OverlayTriggerStateContext, null]
|
|
1447
|
-
]}>
|
|
1782
|
+
<Provider values={[[OverlayTriggerStateContext, null]]}>
|
|
1448
1783
|
<Form
|
|
1449
1784
|
ref={formRef}
|
|
1450
1785
|
action={action}
|
|
1451
|
-
onSubmit={
|
|
1786
|
+
onSubmit={e => {
|
|
1452
1787
|
onSubmit?.(e);
|
|
1453
1788
|
setIsOpen(false);
|
|
1454
1789
|
}}
|
|
1455
1790
|
className={style({width: 'full', display: 'flex', alignItems: 'start', gap: 16})}
|
|
1456
1791
|
style={{'--input-width': `calc(${triggerWidth}px - 32px)`} as CSSProperties}>
|
|
1457
1792
|
{renderEditing()}
|
|
1458
|
-
<div
|
|
1459
|
-
|
|
1460
|
-
|
|
1793
|
+
<div
|
|
1794
|
+
className={style({
|
|
1795
|
+
display: 'flex',
|
|
1796
|
+
flexDirection: 'row',
|
|
1797
|
+
alignItems: 'baseline',
|
|
1798
|
+
flexShrink: 0,
|
|
1799
|
+
flexGrow: 0
|
|
1800
|
+
})}>
|
|
1801
|
+
<ActionButton
|
|
1802
|
+
isQuiet
|
|
1803
|
+
onPress={cancel}
|
|
1804
|
+
aria-label={stringFormatter.format('table.cancel')}>
|
|
1805
|
+
<Close />
|
|
1806
|
+
</ActionButton>
|
|
1807
|
+
<ActionButton
|
|
1808
|
+
isQuiet
|
|
1809
|
+
type="submit"
|
|
1810
|
+
aria-label={stringFormatter.format('table.save')}>
|
|
1811
|
+
<Checkmark />
|
|
1812
|
+
</ActionButton>
|
|
1461
1813
|
</div>
|
|
1462
1814
|
</Form>
|
|
1463
1815
|
</Provider>
|
|
@@ -1474,15 +1826,25 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
|
|
|
1474
1826
|
<Form
|
|
1475
1827
|
ref={formRef}
|
|
1476
1828
|
action={action}
|
|
1477
|
-
onSubmit={
|
|
1829
|
+
onSubmit={e => {
|
|
1478
1830
|
onSubmit?.(e);
|
|
1479
1831
|
setIsOpen(false);
|
|
1480
1832
|
}}
|
|
1481
|
-
className={style({
|
|
1833
|
+
className={style({
|
|
1834
|
+
width: 'full',
|
|
1835
|
+
display: 'flex',
|
|
1836
|
+
flexDirection: 'column',
|
|
1837
|
+
alignItems: 'start',
|
|
1838
|
+
gap: 16
|
|
1839
|
+
})}>
|
|
1482
1840
|
{renderEditing()}
|
|
1483
1841
|
<ButtonGroup align="end" styles={style({alignSelf: 'end'})}>
|
|
1484
|
-
<SpectrumButton onPress={cancel} variant="secondary" fillStyle="outline">
|
|
1485
|
-
|
|
1842
|
+
<SpectrumButton onPress={cancel} variant="secondary" fillStyle="outline">
|
|
1843
|
+
Cancel
|
|
1844
|
+
</SpectrumButton>
|
|
1845
|
+
<SpectrumButton type="submit" variant="accent">
|
|
1846
|
+
Save
|
|
1847
|
+
</SpectrumButton>
|
|
1486
1848
|
</ButtonGroup>
|
|
1487
1849
|
</Form>
|
|
1488
1850
|
</CustomDialog>
|
|
@@ -1497,12 +1859,33 @@ function EditableCellInner(props: EditableCellProps & {isFocusVisible: boolean,
|
|
|
1497
1859
|
// Use color-mix instead of transparency so sticky cells work correctly.
|
|
1498
1860
|
const selectedBackground = colorMix('gray-25', 'gray-900', 7);
|
|
1499
1861
|
const selectedActiveBackground = colorMix('gray-25', 'gray-900', 10);
|
|
1862
|
+
// TODO: I made these up, not sure if there is a great way to go from v3 values to
|
|
1863
|
+
// S2. Overall the root drop color should be lighter than the row color during a root drop
|
|
1864
|
+
// which should be lighter than a selected row during root drop. Those root drop row colors should also be darker
|
|
1865
|
+
// than if the row is the drop target itself
|
|
1866
|
+
const rootDropRowBackground = colorMix('gray-25', 'blue-900', 17);
|
|
1867
|
+
const rootDropSelectedRowBackground = colorMix('gray-25', 'blue-900', 28);
|
|
1868
|
+
const rowDropBackground = colorMix('gray-25', 'blue-900', 10);
|
|
1869
|
+
const rowDropSelectedBackground = colorMix('gray-25', 'blue-900', 15);
|
|
1870
|
+
const rootRowDropStyles = {
|
|
1871
|
+
default: rootDropRowBackground,
|
|
1872
|
+
isSelected: rootDropSelectedRowBackground,
|
|
1873
|
+
forcedColors: 'Background'
|
|
1874
|
+
} as const;
|
|
1875
|
+
const rowDropStyles = {
|
|
1876
|
+
default: rowDropBackground,
|
|
1877
|
+
isSelected: rowDropSelectedBackground,
|
|
1878
|
+
forcedColors: 'Background'
|
|
1879
|
+
} as const;
|
|
1880
|
+
|
|
1500
1881
|
const rowBackgroundColor = {
|
|
1501
1882
|
default: {
|
|
1502
1883
|
default: 'gray-25',
|
|
1503
1884
|
isQuiet: '--s2-container-bg'
|
|
1504
1885
|
},
|
|
1505
|
-
|
|
1886
|
+
forcedColors: {
|
|
1887
|
+
default: 'Background'
|
|
1888
|
+
},
|
|
1506
1889
|
isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
|
|
1507
1890
|
isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color
|
|
1508
1891
|
isSelected: {
|
|
@@ -1511,22 +1894,52 @@ const rowBackgroundColor = {
|
|
|
1511
1894
|
isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15
|
|
1512
1895
|
isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15
|
|
1513
1896
|
},
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1897
|
+
selectionStyle: {
|
|
1898
|
+
highlight: {
|
|
1899
|
+
default: 'gray-25',
|
|
1900
|
+
isQuiet: '--s2-container-bg',
|
|
1901
|
+
isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color
|
|
1902
|
+
isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color
|
|
1903
|
+
isSelected: {
|
|
1904
|
+
default: colorMix('gray-25', 'blue-900', 10),
|
|
1905
|
+
isHovered: colorMix('gray-25', 'blue-900', 15),
|
|
1906
|
+
isPressed: colorMix('gray-25', 'blue-900', 15),
|
|
1907
|
+
forcedColors: 'Highlight'
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
},
|
|
1911
|
+
isInFooter: 'gray-200',
|
|
1912
|
+
':is([role="grid"][data-drop-target] *)': rootRowDropStyles,
|
|
1913
|
+
isDropTarget: rowDropStyles
|
|
1517
1914
|
} as const;
|
|
1518
1915
|
|
|
1519
1916
|
const rowTextColor = {
|
|
1520
1917
|
default: baseColor('neutral-subdued'),
|
|
1521
1918
|
isSelected: baseColor('neutral'),
|
|
1919
|
+
forcedColors: {
|
|
1920
|
+
default: 'ButtonText',
|
|
1921
|
+
isSelected: {
|
|
1922
|
+
selectionStyle: {
|
|
1923
|
+
highlight: 'HighlightText'
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1522
1927
|
isDisabled: {
|
|
1523
1928
|
default: 'disabled',
|
|
1524
1929
|
forcedColors: 'GrayText'
|
|
1525
1930
|
},
|
|
1526
|
-
|
|
1931
|
+
isInFooter: 'neutral'
|
|
1527
1932
|
} as const;
|
|
1528
1933
|
|
|
1529
|
-
const row = style<
|
|
1934
|
+
const row = style<
|
|
1935
|
+
RowRenderProps &
|
|
1936
|
+
S2TableProps & {
|
|
1937
|
+
isInFooter?: boolean;
|
|
1938
|
+
isNextSelected?: boolean;
|
|
1939
|
+
isPrevSelected?: boolean;
|
|
1940
|
+
isFirstItem?: boolean;
|
|
1941
|
+
}
|
|
1942
|
+
>({
|
|
1530
1943
|
height: 'full',
|
|
1531
1944
|
position: 'relative',
|
|
1532
1945
|
boxSizing: 'border-box',
|
|
@@ -1539,13 +1952,6 @@ const row = style<RowRenderProps & S2TableProps>({
|
|
|
1539
1952
|
type: 'color',
|
|
1540
1953
|
value: rowTextColor
|
|
1541
1954
|
},
|
|
1542
|
-
'--rowFocusIndicatorColor': {
|
|
1543
|
-
type: 'outlineColor',
|
|
1544
|
-
value: {
|
|
1545
|
-
default: 'focus-ring',
|
|
1546
|
-
forcedColors: 'Highlight'
|
|
1547
|
-
}
|
|
1548
|
-
},
|
|
1549
1955
|
// TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline
|
|
1550
1956
|
// This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more
|
|
1551
1957
|
// and offset it by margin top but that messes up the checkbox centering a bit
|
|
@@ -1571,18 +1977,202 @@ const row = style<RowRenderProps & S2TableProps>({
|
|
|
1571
1977
|
// }
|
|
1572
1978
|
// },
|
|
1573
1979
|
outlineStyle: 'none',
|
|
1980
|
+
'--borderBottomRadius': {
|
|
1981
|
+
type: 'borderBottomStartRadius',
|
|
1982
|
+
value: {
|
|
1983
|
+
default: 'none',
|
|
1984
|
+
selectionStyle: {
|
|
1985
|
+
highlight: {
|
|
1986
|
+
default: 'none',
|
|
1987
|
+
isSelected: '[5px]',
|
|
1988
|
+
isNextSelected: 'none'
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1993
|
+
'--borderTopRadius': {
|
|
1994
|
+
type: 'borderTopStartRadius',
|
|
1995
|
+
value: {
|
|
1996
|
+
default: 'none',
|
|
1997
|
+
selectionStyle: {
|
|
1998
|
+
highlight: {
|
|
1999
|
+
default: 'none',
|
|
2000
|
+
isSelected: '[5px]',
|
|
2001
|
+
isPrevSelected: 'none'
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2006
|
+
borderBottomRadius: 'var(--borderBottomRadius)',
|
|
2007
|
+
borderTopRadius: 'var(--borderTopRadius)',
|
|
2008
|
+
// We will only use these border values when it is highlight selection
|
|
2009
|
+
'--borderTopWidth': {
|
|
2010
|
+
type: 'width',
|
|
2011
|
+
value: {
|
|
2012
|
+
default: {
|
|
2013
|
+
selectionStyle: {
|
|
2014
|
+
checkbox: 0,
|
|
2015
|
+
highlight: 1
|
|
2016
|
+
}
|
|
2017
|
+
},
|
|
2018
|
+
isPrevSelected: 0
|
|
2019
|
+
}
|
|
2020
|
+
},
|
|
2021
|
+
'--borderBottomWidth': {
|
|
2022
|
+
type: 'width',
|
|
2023
|
+
value: {
|
|
2024
|
+
default: {
|
|
2025
|
+
selectionStyle: {
|
|
2026
|
+
checkbox: 0,
|
|
2027
|
+
highlight: 1
|
|
2028
|
+
}
|
|
2029
|
+
},
|
|
2030
|
+
isNextSelected: 0
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
'--borderStartEndWidth': {
|
|
2034
|
+
type: 'width',
|
|
2035
|
+
value: {
|
|
2036
|
+
default: {
|
|
2037
|
+
selectionStyle: {
|
|
2038
|
+
checkbox: 0,
|
|
2039
|
+
highlight: 1
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
},
|
|
1574
2044
|
borderTopWidth: 0,
|
|
1575
2045
|
borderBottomWidth: 1,
|
|
1576
2046
|
borderStartWidth: 0,
|
|
1577
2047
|
borderEndWidth: 0,
|
|
1578
2048
|
borderStyle: 'solid',
|
|
1579
2049
|
borderColor: {
|
|
1580
|
-
|
|
1581
|
-
|
|
2050
|
+
selectionStyle: {
|
|
2051
|
+
highlight: {
|
|
2052
|
+
default: 'gray-300',
|
|
2053
|
+
isSelected: 'transparent',
|
|
2054
|
+
isNextSelected: 'transparent'
|
|
2055
|
+
},
|
|
2056
|
+
checkbox: {
|
|
2057
|
+
default: 'gray-300',
|
|
2058
|
+
forcedColors: 'ButtonBorder'
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
1582
2061
|
},
|
|
1583
|
-
|
|
2062
|
+
'--borderColorGray': {
|
|
2063
|
+
type: 'borderColor',
|
|
2064
|
+
value: {
|
|
2065
|
+
default: 'gray-300',
|
|
2066
|
+
forcedColors: {
|
|
2067
|
+
default: 'ButtonBorder',
|
|
2068
|
+
isSelected: 'Highlight'
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
'--borderColorBlue': {
|
|
2073
|
+
type: 'borderColor',
|
|
2074
|
+
value: {
|
|
2075
|
+
default: 'blue-900',
|
|
2076
|
+
forcedColors: 'Highlight'
|
|
2077
|
+
}
|
|
2078
|
+
},
|
|
2079
|
+
'--borderColor': {
|
|
2080
|
+
type: 'borderColor',
|
|
2081
|
+
value: {
|
|
2082
|
+
default: 'transparent',
|
|
2083
|
+
isSelected: '--borderColorBlue'
|
|
2084
|
+
}
|
|
2085
|
+
},
|
|
2086
|
+
'--focusRingColor': {
|
|
2087
|
+
type: 'outlineColor',
|
|
2088
|
+
value: {
|
|
2089
|
+
default: 'focus-ring',
|
|
2090
|
+
forcedColors: 'Highlight'
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
fontWeight: {
|
|
2094
|
+
default: 'normal',
|
|
2095
|
+
isInFooter: 'bold'
|
|
2096
|
+
},
|
|
2097
|
+
isolation: 'isolate',
|
|
2098
|
+
forcedColorAdjust: 'none',
|
|
2099
|
+
'--topFocusRing': {
|
|
2100
|
+
type: 'top',
|
|
2101
|
+
value: {
|
|
2102
|
+
default: '[-1px]',
|
|
2103
|
+
isFirstItem: 0
|
|
2104
|
+
}
|
|
2105
|
+
},
|
|
2106
|
+
'--topHighlightBorder': {
|
|
2107
|
+
type: 'top',
|
|
2108
|
+
value: {
|
|
2109
|
+
default: 0,
|
|
2110
|
+
isSelected: '[-1px]',
|
|
2111
|
+
// Don't overlap focus ring of row above.
|
|
2112
|
+
isPrevSelected: 0,
|
|
2113
|
+
isFirstItem: 0,
|
|
2114
|
+
forcedColors: 0
|
|
2115
|
+
}
|
|
2116
|
+
},
|
|
2117
|
+
'--bottomPosition': {
|
|
2118
|
+
type: 'bottom',
|
|
2119
|
+
value: {
|
|
2120
|
+
selectionStyle: {
|
|
2121
|
+
checkbox: {
|
|
2122
|
+
default: '[-1px]',
|
|
2123
|
+
// Avoid the next row's selected background covering this row's focus ring.
|
|
2124
|
+
isNextSelected: 0
|
|
2125
|
+
},
|
|
2126
|
+
highlight: '[-1px]'
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
1584
2130
|
});
|
|
1585
2131
|
|
|
2132
|
+
// Sticky cells (the drag cell, and the checkbox cell when present) get an inline z-index=2 applied by the virtualizer's layout
|
|
2133
|
+
// To ensure that the highlight selection border is painted above the sticky cells, set z-index to 3
|
|
2134
|
+
const highlightSelectionBorder = css(
|
|
2135
|
+
`&:before {
|
|
2136
|
+
content: "";
|
|
2137
|
+
top: var(--topHighlightBorder);
|
|
2138
|
+
bottom: -1px;
|
|
2139
|
+
inset-inline: 0;
|
|
2140
|
+
position: absolute;
|
|
2141
|
+
z-index: 3;
|
|
2142
|
+
border-style: solid;
|
|
2143
|
+
border-color: var(--borderColor);
|
|
2144
|
+
border-top-width: var(--borderTopWidth);
|
|
2145
|
+
border-bottom-width: var(--borderBottomWidth);
|
|
2146
|
+
border-inline-start-width: var(--borderStartEndWidth);
|
|
2147
|
+
border-inline-end-width: var(--borderStartEndWidth);
|
|
2148
|
+
border-bottom-left-radius: var(--borderBottomRadius);
|
|
2149
|
+
border-bottom-right-radius: var(--borderBottomRadius);
|
|
2150
|
+
border-top-left-radius: var(--borderTopRadius);
|
|
2151
|
+
border-top-right-radius: var(--borderTopRadius);
|
|
2152
|
+
pointer-events: none;
|
|
2153
|
+
}
|
|
2154
|
+
`
|
|
2155
|
+
);
|
|
2156
|
+
|
|
2157
|
+
const focusIndicator = css(
|
|
2158
|
+
`&:after {
|
|
2159
|
+
content: "";
|
|
2160
|
+
top: var(--topFocusRing);
|
|
2161
|
+
bottom: var(--bottomPosition);
|
|
2162
|
+
z-index: 3;
|
|
2163
|
+
inset-inline-start: 0;
|
|
2164
|
+
inset-inline-end: 0;
|
|
2165
|
+
border-radius: 5px;
|
|
2166
|
+
position: absolute;
|
|
2167
|
+
outline-style: solid;
|
|
2168
|
+
outline-color: var(--focusRingColor);
|
|
2169
|
+
outline-width: 2px;
|
|
2170
|
+
outline-offset: -2px;
|
|
2171
|
+
pointer-events: none;
|
|
2172
|
+
}
|
|
2173
|
+
`
|
|
2174
|
+
);
|
|
2175
|
+
|
|
1586
2176
|
const selectionCheckbox = style({
|
|
1587
2177
|
visibility: {
|
|
1588
2178
|
default: 'visible',
|
|
@@ -1590,38 +2180,132 @@ const selectionCheckbox = style({
|
|
|
1590
2180
|
}
|
|
1591
2181
|
});
|
|
1592
2182
|
|
|
1593
|
-
export interface RowProps<T>
|
|
2183
|
+
export interface RowProps<T>
|
|
2184
|
+
extends
|
|
2185
|
+
Pick<
|
|
2186
|
+
RACRowProps<T>,
|
|
2187
|
+
| 'id'
|
|
2188
|
+
| 'columns'
|
|
2189
|
+
| 'isDisabled'
|
|
2190
|
+
| 'onAction'
|
|
2191
|
+
| 'children'
|
|
2192
|
+
| 'textValue'
|
|
2193
|
+
| 'dependencies'
|
|
2194
|
+
| keyof GlobalDOMAttributes
|
|
2195
|
+
>,
|
|
2196
|
+
LinkDOMProps {}
|
|
1594
2197
|
|
|
1595
2198
|
/**
|
|
1596
2199
|
* A row within a `<Table>`.
|
|
1597
2200
|
*/
|
|
1598
|
-
export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T
|
|
1599
|
-
|
|
1600
|
-
|
|
2201
|
+
export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T>(
|
|
2202
|
+
{id, columns, children, dependencies = [], ...otherProps}: RowProps<T>,
|
|
2203
|
+
ref: DOMRef<HTMLDivElement>
|
|
2204
|
+
) {
|
|
2205
|
+
let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
|
|
2206
|
+
let {selectionStyle, ...tableVisualOptions} = useContext(InternalTableContext);
|
|
1601
2207
|
let domRef = useDOMRef(ref);
|
|
2208
|
+
let isInFooter = useContext(FooterContext);
|
|
1602
2209
|
|
|
1603
2210
|
return (
|
|
1604
|
-
|
|
2211
|
+
<RACRow
|
|
1605
2212
|
// @ts-ignore
|
|
1606
2213
|
ref={domRef}
|
|
1607
2214
|
id={id}
|
|
1608
2215
|
dependencies={[...dependencies, columns]}
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
2216
|
+
isDisabled={isInFooter}
|
|
2217
|
+
disabledBehavior={isInFooter ? 'selection' : undefined}
|
|
2218
|
+
className={renderProps =>
|
|
2219
|
+
row({
|
|
2220
|
+
...renderProps,
|
|
2221
|
+
...tableVisualOptions,
|
|
2222
|
+
selectionStyle,
|
|
2223
|
+
isInFooter,
|
|
2224
|
+
isFirstItem: isFirstItem(renderProps.id, renderProps.state),
|
|
2225
|
+
isNextSelected: isNextSelected(renderProps.id, renderProps.state),
|
|
2226
|
+
isPrevSelected: isPrevSelected(renderProps.id, renderProps.state)
|
|
2227
|
+
}) +
|
|
2228
|
+
(renderProps.isFocusVisible || renderProps.isDropTarget ? ' ' + focusIndicator : '') +
|
|
2229
|
+
(selectionStyle === 'highlight' ? ' ' + highlightSelectionBorder : '')
|
|
2230
|
+
}
|
|
1613
2231
|
{...otherProps}>
|
|
1614
|
-
{
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
2232
|
+
{allowsDragging && (
|
|
2233
|
+
<RACCell
|
|
2234
|
+
// @ts-ignore
|
|
2235
|
+
isSticky
|
|
2236
|
+
className={dragCellStyle}>
|
|
2237
|
+
{({isFocusVisibleWithinRow}) =>
|
|
2238
|
+
!(otherProps.isDisabled && tableVisualOptions.disabledBehavior === 'all') && (
|
|
2239
|
+
<DragHandleButton isFocusVisibleWithin={isFocusVisibleWithinRow} />
|
|
2240
|
+
)
|
|
2241
|
+
}
|
|
2242
|
+
</RACCell>
|
|
1621
2243
|
)}
|
|
2244
|
+
{selectionMode !== 'none' &&
|
|
2245
|
+
selectionBehavior === 'toggle' &&
|
|
2246
|
+
selectionStyle === 'checkbox' && (
|
|
2247
|
+
// Not sure what we want to do with this className, in Cell it currently overrides the className that would have been applied.
|
|
2248
|
+
// The `spread` otherProps must be after className in Cell.
|
|
2249
|
+
// @ts-ignore
|
|
2250
|
+
<Cell isSticky className={checkboxCellStyle}>
|
|
2251
|
+
<Checkbox slot="selection" styles={selectionCheckbox} />
|
|
2252
|
+
</Cell>
|
|
2253
|
+
)}
|
|
1622
2254
|
<Collection items={columns} dependencies={[...dependencies, columns]}>
|
|
1623
2255
|
{children}
|
|
1624
2256
|
</Collection>
|
|
1625
|
-
</RACRow>
|
|
2257
|
+
</RACRow>
|
|
1626
2258
|
);
|
|
1627
2259
|
});
|
|
2260
|
+
|
|
2261
|
+
export interface TableFooterProps<T> extends Omit<
|
|
2262
|
+
RACTableFooterProps<T>,
|
|
2263
|
+
| 'style'
|
|
2264
|
+
| 'className'
|
|
2265
|
+
| 'render'
|
|
2266
|
+
| 'onHoverChange'
|
|
2267
|
+
| 'onHoverStart'
|
|
2268
|
+
| 'onHoverEnd'
|
|
2269
|
+
| keyof GlobalDOMAttributes
|
|
2270
|
+
> {}
|
|
2271
|
+
|
|
2272
|
+
const FooterContext = createContext(false);
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* A footer within a `<Table>`, containing summary rows.
|
|
2276
|
+
*/
|
|
2277
|
+
export const TableFooter = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableFooter<T>(
|
|
2278
|
+
props: TableFooterProps<T>,
|
|
2279
|
+
ref: DOMRef<HTMLDivElement>
|
|
2280
|
+
) {
|
|
2281
|
+
let domRef = useDOMRef(ref);
|
|
2282
|
+
|
|
2283
|
+
return (
|
|
2284
|
+
<FooterContext.Provider value>
|
|
2285
|
+
<RACTableFooter {...props} ref={domRef} />
|
|
2286
|
+
</FooterContext.Provider>
|
|
2287
|
+
);
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
export function isNextSelected(id: Key | undefined, state: TableState<unknown>) {
|
|
2291
|
+
if (id == null || !state) {
|
|
2292
|
+
return false;
|
|
2293
|
+
}
|
|
2294
|
+
let keyAfter = state.collection.getKeyAfter(id);
|
|
2295
|
+
return keyAfter != null && state.selectionManager.isSelected(keyAfter);
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
export function isPrevSelected(id: Key | undefined, state: TableState<unknown>) {
|
|
2299
|
+
if (id == null || !state) {
|
|
2300
|
+
return false;
|
|
2301
|
+
}
|
|
2302
|
+
let keyBefore = state.collection.getKeyBefore(id);
|
|
2303
|
+
return keyBefore != null && state.selectionManager.isSelected(keyBefore);
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
function isFirstItem(id: Key | undefined, state: TableState<unknown>) {
|
|
2307
|
+
if (id == null || !state) {
|
|
2308
|
+
return false;
|
|
2309
|
+
}
|
|
2310
|
+
return state.collection.getFirstKey() === id;
|
|
2311
|
+
}
|