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