@salesforce/design-system-react 11.0.0-alpha.8 → 11.0.0-alpha.9
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/cjs/components/accordion/index.cjs +1 -1
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/alert/container.cjs +1 -1
- package/dist/cjs/components/alert/container.cjs.map +1 -1
- package/dist/cjs/components/avatar/index.cjs +1 -1
- package/dist/cjs/components/avatar/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
- package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
- package/dist/cjs/components/button-stateful/component.cjs +2 -0
- package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
- package/dist/cjs/components/button-stateful/index.cjs +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
- package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
- package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
- package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
- package/dist/cjs/components/combobox/check-props.cjs +1 -1
- package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/combobox/index.cjs +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
- package/dist/cjs/components/expandable-section/index.cjs +1 -1
- package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/popover/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/radio/check-props.cjs +1 -1
- package/dist/cjs/components/radio/check-props.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
- package/dist/cjs/components/radio-group/check-props.cjs +2 -0
- package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
- package/dist/cjs/components/radio-group/component.cjs +2 -0
- package/dist/cjs/components/radio-group/component.cjs.map +1 -0
- package/dist/cjs/components/radio-group/index.cjs +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
- package/dist/cjs/components/slider/check-props.cjs +1 -1
- package/dist/cjs/components/slider/check-props.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/index.cjs +1 -1
- package/dist/cjs/components/split-view/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
- package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox.cjs +1 -1
- package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
- package/dist/cjs/components/tabs/check-props.cjs +2 -0
- package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
- package/dist/cjs/components/tabs/component.cjs +2 -0
- package/dist/cjs/components/tabs/component.cjs.map +1 -0
- package/dist/cjs/components/tabs/index.cjs +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/panel.cjs.map +1 -1
- package/dist/cjs/components/textarea/check-props.cjs +1 -1
- package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/toast/container.cjs +1 -1
- package/dist/cjs/components/toast/container.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +2 -2
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/check-props.cjs.map +1 -1
- package/dist/cjs/components/tree/private/branch.cjs +1 -1
- package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
- package/dist/cjs/components/tree/private/item.cjs +1 -1
- package/dist/cjs/components/tree/private/item.cjs.map +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
- package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
- package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
- package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
- package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/index.cjs +1 -1
- package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
- package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
- package/dist/cjs/utilities/warning/required-property.cjs +2 -0
- package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
- package/dist/es/components/accordion/index.js +10 -8
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/alert/container.js +1 -1
- package/dist/es/components/alert/container.js.map +1 -1
- package/dist/es/components/avatar/index.js +2 -1
- package/dist/es/components/avatar/index.js.map +1 -1
- package/dist/es/components/button-stateful/check-props.js +14 -0
- package/dist/es/components/button-stateful/check-props.js.map +1 -0
- package/dist/es/components/button-stateful/component.js +20 -0
- package/dist/es/components/button-stateful/component.js.map +1 -0
- package/dist/es/components/button-stateful/index.js +102 -94
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/carousel/index.js +112 -130
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +14 -8
- package/dist/es/components/checkbox/check-props.js.map +1 -1
- package/dist/es/components/checkbox/index.js +40 -33
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/check-props.js +16 -11
- package/dist/es/components/color-picker/check-props.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +185 -169
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
- package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
- package/dist/es/components/color-picker/private/hsv-color.js +1 -0
- package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
- package/dist/es/components/combobox/check-props.js +15 -14
- package/dist/es/components/combobox/check-props.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +399 -399
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/index.js +4 -4
- package/dist/es/components/date-picker/check-props.js +15 -9
- package/dist/es/components/date-picker/check-props.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +144 -138
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
- package/dist/es/components/expandable-section/index.js +32 -26
- package/dist/es/components/expandable-section/index.js.map +1 -1
- package/dist/es/components/icon/input-icon/index.js +7 -2
- package/dist/es/components/icon/input-icon/index.js.map +1 -1
- package/dist/es/components/index.js +3 -3
- package/dist/es/components/input/check-props.js +19 -17
- package/dist/es/components/input/check-props.js.map +1 -1
- package/dist/es/components/input/index.js +153 -156
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js +18 -18
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js +1 -1
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/popover/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +209 -205
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/radio/check-props.js +8 -8
- package/dist/es/components/radio/check-props.js.map +1 -1
- package/dist/es/components/radio/index.js +15 -13
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-button-group/index.js.map +1 -1
- package/dist/es/components/radio-button-group/radio.js.map +1 -1
- package/dist/es/components/radio-group/check-props.js +14 -0
- package/dist/es/components/radio-group/check-props.js.map +1 -0
- package/dist/es/components/radio-group/component.js +21 -0
- package/dist/es/components/radio-group/component.js.map +1 -0
- package/dist/es/components/radio-group/index.js +62 -38
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js +5 -4
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/check-props.js +7 -6
- package/dist/es/components/simple-data-table/check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/column.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +67 -49
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/simple-data-table/private/head.js +1 -1
- package/dist/es/components/simple-data-table/private/head.js.map +1 -1
- package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
- package/dist/es/components/simple-data-table/private/row.js +43 -57
- package/dist/es/components/simple-data-table/private/row.js.map +1 -1
- package/dist/es/components/slider/check-props.js +14 -12
- package/dist/es/components/slider/check-props.js.map +1 -1
- package/dist/es/components/slider/index.js +54 -48
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/split-view/index.js +23 -22
- package/dist/es/components/split-view/index.js.map +1 -1
- package/dist/es/components/split-view/listbox-check-props.js +10 -2
- package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
- package/dist/es/components/split-view/listbox.js +67 -50
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/tabs/check-props.js +15 -0
- package/dist/es/components/tabs/check-props.js.map +1 -0
- package/dist/es/components/tabs/component.js +28 -0
- package/dist/es/components/tabs/component.js.map +1 -0
- package/dist/es/components/tabs/index.js +84 -69
- package/dist/es/components/tabs/index.js.map +1 -1
- package/dist/es/components/tabs/panel.js.map +1 -1
- package/dist/es/components/textarea/check-props.js +1 -1
- package/dist/es/components/textarea/check-props.js.map +1 -1
- package/dist/es/components/textarea/index.js +3 -2
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/toast/container.js +1 -1
- package/dist/es/components/toast/container.js.map +1 -1
- package/dist/es/components/tooltip/index.js +120 -109
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/check-props.js +14 -9
- package/dist/es/components/tree/check-props.js.map +1 -1
- package/dist/es/components/tree/private/branch.js +38 -35
- package/dist/es/components/tree/private/branch.js.map +1 -1
- package/dist/es/components/tree/private/item.js +6 -8
- package/dist/es/components/tree/private/item.js.map +1 -1
- package/dist/es/components/tree/private/render-branch.js +9 -10
- package/dist/es/components/tree/private/render-branch.js.map +1 -1
- package/dist/es/components/tree/tree.js +126 -97
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/vertical-navigation/check-props.js +13 -0
- package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
- package/dist/es/components/vertical-navigation/component.js +27 -0
- package/dist/es/components/vertical-navigation/component.js.map +1 -0
- package/dist/es/components/vertical-navigation/index.js +27 -26
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/welcome-mat/info-badge.js +14 -4
- package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
- package/dist/es/utilities/hooks/index.js +2 -1
- package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
- package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
- package/dist/es/utilities/warning/required-property.js +15 -0
- package/dist/es/utilities/warning/required-property.js.map +1 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/avatar/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/check-props.d.ts +3 -0
- package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
- package/dist/types/components/button-stateful/index.d.ts +34 -6
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/carousel/index.d.ts +26 -7
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/checkbox/check-props.d.ts +1 -0
- package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +38 -9
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +50 -11
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/color-picker/index.d.ts +2 -2
- package/dist/types/components/color-picker/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
- package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
- package/dist/types/components/color-picker/types.d.ts +9 -5
- package/dist/types/components/color-picker/types.d.ts.map +1 -1
- package/dist/types/components/combobox/check-props.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts +41 -6
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +52 -17
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +1 -1
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
- package/dist/types/components/expandable-section/index.d.ts +15 -3
- package/dist/types/components/expandable-section/index.d.ts.map +1 -1
- package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
- package/dist/types/components/input/check-props.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +10 -4
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/input/private/inner-input.d.ts +2 -4
- package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/popover/index.d.ts +1 -1
- package/dist/types/components/popover/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +30 -3
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/radio/check-props.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +42 -9
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/index.d.ts +20 -10
- package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/radio.d.ts +7 -2
- package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
- package/dist/types/components/radio-group/check-props.d.ts +3 -0
- package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
- package/dist/types/components/radio-group/index.d.ts +51 -8
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/radio.d.ts +7 -2
- package/dist/types/components/radio-group/radio.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +10 -2
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/column.d.ts +4 -1
- package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts +10 -2
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
- package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +40 -13
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/check-props.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +23 -10
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/split-view/index.d.ts +12 -3
- package/dist/types/components/split-view/index.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
- package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox.d.ts +41 -10
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/tabs/check-props.d.ts +3 -0
- package/dist/types/components/tabs/check-props.d.ts.map +1 -0
- package/dist/types/components/tabs/index.d.ts +46 -12
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +4 -0
- package/dist/types/components/tabs/panel.d.ts.map +1 -1
- package/dist/types/components/textarea/check-props.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +14 -6
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/toast/container.d.ts +1 -1
- package/dist/types/components/tooltip/index.d.ts +49 -3
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/tree/check-props.d.ts +1 -0
- package/dist/types/components/tree/check-props.d.ts.map +1 -1
- package/dist/types/components/tree/private/branch.d.ts +6 -1
- package/dist/types/components/tree/private/branch.d.ts.map +1 -1
- package/dist/types/components/tree/private/item.d.ts +3 -1
- package/dist/types/components/tree/private/item.d.ts.map +1 -1
- package/dist/types/components/tree/private/render-branch.d.ts +3 -1
- package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +33 -6
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/tree/types.d.ts +23 -4
- package/dist/types/components/tree/types.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
- package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/index.d.ts +9 -4
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
- package/dist/types/types/components.d.ts +0 -2
- package/dist/types/types/components.d.ts.map +1 -1
- package/dist/types/utilities/hooks/index.d.ts +1 -0
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
- package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/types/utilities/warning/required-property.d.ts +3 -0
- package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -6,8 +6,16 @@ process.env.NODE_ENV !== "production" && (n = function(n, r, i) {
|
|
|
6
6
|
let a = e(i);
|
|
7
7
|
t(n, r.listItem, "listItem", "renderListItem", `\`renderListItem\` is a function called with \`{ isFocused, isSelected, isUnread, item }\`, not a component. ${a("renderListItem")}`);
|
|
8
8
|
});
|
|
9
|
-
var r =
|
|
9
|
+
var r = function() {};
|
|
10
|
+
if (process.env.NODE_ENV !== "production") {
|
|
11
|
+
let n = (e) => Array.isArray(e) && e.some((e) => typeof e == "object" && !!e);
|
|
12
|
+
r = function(r, i, a) {
|
|
13
|
+
let o = e(a);
|
|
14
|
+
t(r, n(i.selection) ? !0 : void 0, "selection={[item]}", "selection={[item.id]}", `\`selection\` is a list of item ids. Item objects are still matched by \`id\`, or by identity when an item has no \`id\`. \`events.onSelect\` reports the requested ids as \`data.selection\`. ${o("selection")}`), t(r, n(i.unread) ? !0 : void 0, "unread={[item]}", "unread={[item.id]}", `\`unread\` is a list of item ids. Item objects are still matched by \`id\`, or by identity when an item has no \`id\`. ${o("unread")}`);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var i = n;
|
|
10
18
|
//#endregion
|
|
11
|
-
export { r as default };
|
|
19
|
+
export { r as checkSelectionProps, i as default };
|
|
12
20
|
|
|
13
21
|
//# sourceMappingURL=listbox-check-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-check-props.js","names":[],"sources":["../../../../components/split-view/listbox-check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listItem,\n\t\t\t'listItem',\n\t\t\t'renderListItem',\n\t\t\t`\\`renderListItem\\` is a function called with \\`{ isFocused, isSelected, isUnread, item }\\`, not a component. ${createDocUrl('renderListItem')}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAE9C,EACC,GACA,EAAM,UACN,YACA,kBACA,gHAAgH,EAAa,gBAAgB,GAC9I;AACD;
|
|
1
|
+
{"version":3,"file":"listbox-check-props.js","names":[],"sources":["../../../../components/split-view/listbox-check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listItem,\n\t\t\t'listItem',\n\t\t\t'renderListItem',\n\t\t\t`\\`renderListItem\\` is a function called with \\`{ isFocused, isSelected, isUnread, item }\\`, not a component. ${createDocUrl('renderListItem')}`\n\t\t);\n\t};\n}\n\n// `selection` and `unread` of item objects. Exported separately because it runs on every update:\n// consumers usually pass `[]` first and the first item object only after a click.\nexport let checkSelectionProps = function checkSelectionPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasItemObjects = (entries) =>\n\t\tArray.isArray(entries) &&\n\t\tentries.some((entry) => entry !== null && typeof entry === 'object');\n\n\tcheckSelectionProps = function checkSelectionPropsFunction(\n\t\tCOMPONENT,\n\t\tprops,\n\t\tjsonDoc\n\t) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t/* eslint-disable max-len */\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\thasItemObjects(props.selection) ? true : undefined,\n\t\t\t'selection={[item]}',\n\t\t\t'selection={[item.id]}',\n\t\t\t`\\`selection\\` is a list of item ids. Item objects are still matched by \\`id\\`, or by identity when an item has no \\`id\\`. \\`events.onSelect\\` reports the requested ids as \\`data.selection\\`. ${createDocUrl('selection')}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\thasItemObjects(props.unread) ? true : undefined,\n\t\t\t'unread={[item]}',\n\t\t\t'unread={[item.id]}',\n\t\t\t`\\`unread\\` is a list of item ids. Item objects are still matched by \\`id\\`, or by identity when an item has no \\`id\\`. ${createDocUrl('unread')}`\n\t\t);\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAE9C,EACC,GACA,EAAM,UACN,YACA,kBACA,gHAAgH,EAAa,gBAAgB,GAC9I;AACD;AAKD,IAAW,IAAsB,WAAuC,CAAC;AAEzE,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,KAAkB,MACvB,MAAM,QAAQ,CAAO,KACrB,EAAQ,MAAM,MAA4B,OAAO,KAAU,cAAnC,CAA2C;CAEpE,IAAsB,SACrB,GACA,GACA,GACC;EACD,IAAM,IAAe,EAAkB,CAAO;EAU9C,AAPA,EACC,GACA,EAAe,EAAM,SAAS,IAAI,KAAO,KAAA,GACzC,sBACA,yBACA,kMAAkM,EAAa,WAAW,GAC3N,GACA,EACC,GACA,EAAe,EAAM,MAAM,IAAI,KAAO,KAAA,GACtC,mBACA,sBACA,0HAA0H,EAAa,QAAQ,GAChJ;CAED;AACD;AAEA,IAAA,IAAe"}
|
|
@@ -4,15 +4,15 @@ import n from "../icon/index.js";
|
|
|
4
4
|
import r from "./component.js";
|
|
5
5
|
import i from "./private/list-item-content.js";
|
|
6
6
|
import a from "./private/list-item-with-content.js";
|
|
7
|
-
import o from "./listbox-check-props.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { jsx as
|
|
7
|
+
import o, { checkSelectionProps as s } from "./listbox-check-props.js";
|
|
8
|
+
import c from "react";
|
|
9
|
+
import l from "classnames";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
11
|
//#region components/split-view/listbox.tsx
|
|
12
|
-
var
|
|
12
|
+
var f = Object.freeze({
|
|
13
13
|
UP: "up",
|
|
14
14
|
DOWN: "down"
|
|
15
|
-
}),
|
|
15
|
+
}), p = {
|
|
16
16
|
assistiveText: {
|
|
17
17
|
list: "Select an item to open it in a new workspace tab.",
|
|
18
18
|
sort: {
|
|
@@ -21,18 +21,15 @@ var d = Object.freeze({
|
|
|
21
21
|
ascending: "Ascending"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
selection: [],
|
|
27
|
-
unread: []
|
|
28
|
-
}, p = class extends s.Component {
|
|
24
|
+
labels: {}
|
|
25
|
+
}, m = [], h = (e) => typeof e == "object" && e ? e.id ?? e : e, g = class extends c.Component {
|
|
29
26
|
static displayName = e;
|
|
30
|
-
static defaultProps =
|
|
27
|
+
static defaultProps = p;
|
|
31
28
|
listItemComponents;
|
|
32
29
|
ListItemWithContent;
|
|
33
30
|
constructor(t) {
|
|
34
31
|
super(t), this.listItemComponents = {}, this.state = {
|
|
35
|
-
|
|
32
|
+
anchorItem: null,
|
|
36
33
|
currentFocusedListItem: {
|
|
37
34
|
index: 0,
|
|
38
35
|
item: null
|
|
@@ -40,19 +37,43 @@ var d = Object.freeze({
|
|
|
40
37
|
}, o(e, t, r), this.ListItemWithContent = a(t.listItem || i);
|
|
41
38
|
}
|
|
42
39
|
componentDidMount() {
|
|
43
|
-
this.focusFirstItem();
|
|
40
|
+
s(e, this.props, r), this.focusFirstItem();
|
|
41
|
+
}
|
|
42
|
+
componentDidUpdate() {
|
|
43
|
+
s(e, this.props, r);
|
|
44
44
|
}
|
|
45
45
|
isListItemFocused(e) {
|
|
46
|
-
|
|
46
|
+
let t = this.state.currentFocusedListItem.item;
|
|
47
|
+
return t !== null && h(t) === h(e);
|
|
47
48
|
}
|
|
48
49
|
isSelected(e) {
|
|
49
|
-
|
|
50
|
+
let t = h(e);
|
|
51
|
+
return (this.props.selection || m).some((e) => h(e) === t);
|
|
50
52
|
}
|
|
51
53
|
isUnread(e) {
|
|
52
|
-
|
|
54
|
+
let t = h(e);
|
|
55
|
+
return (this.props.unread || m).some((e) => h(e) === t);
|
|
56
|
+
}
|
|
57
|
+
selectedItems() {
|
|
58
|
+
return this.props.options.filter((e) => this.isSelected(e));
|
|
59
|
+
}
|
|
60
|
+
indexOfItem(e) {
|
|
61
|
+
let t = e === null ? void 0 : h(e);
|
|
62
|
+
return t === void 0 ? -1 : this.props.options.findIndex((e) => h(e) === t);
|
|
63
|
+
}
|
|
64
|
+
reportSelection(e, t, n) {
|
|
65
|
+
this.props.events?.onSelect?.(e, {
|
|
66
|
+
selection: t.map((e) => e.id),
|
|
67
|
+
selectedItems: t,
|
|
68
|
+
item: n
|
|
69
|
+
});
|
|
53
70
|
}
|
|
54
71
|
handleKeyDown(e) {
|
|
55
|
-
this.props.multiple && e.key === "a" && e.ctrlKey
|
|
72
|
+
if (this.props.multiple && e.key === "a" && e.ctrlKey) {
|
|
73
|
+
t.trap(e);
|
|
74
|
+
let { options: n } = this.props;
|
|
75
|
+
n.length > 0 && n.every((e) => this.isSelected(e)) ? this.deselectAllListItems(e) : this.selectAllListItems(e);
|
|
76
|
+
} else e.key === "ArrowUp" ? (t.trap(e), this.moveToPreviousItem(e)) : e.key === "ArrowDown" && (t.trap(e), this.moveToNextItem(e));
|
|
56
77
|
}
|
|
57
78
|
moveToNextItem(e) {
|
|
58
79
|
let t = this.state.currentFocusedListItem.index === this.props.options.length - 1 ? 0 : this.state.currentFocusedListItem.index + 1;
|
|
@@ -67,7 +88,7 @@ var d = Object.freeze({
|
|
|
67
88
|
this.focusItem(n);
|
|
68
89
|
}
|
|
69
90
|
focusFirstItem() {
|
|
70
|
-
let e = this.props.options.find((e) =>
|
|
91
|
+
let e = this.props.options.find((e) => this.isSelected(e)) || this.props.options[0];
|
|
71
92
|
e && this.focusItem(e, !0);
|
|
72
93
|
}
|
|
73
94
|
focusItem(e, t) {
|
|
@@ -78,44 +99,40 @@ var d = Object.freeze({
|
|
|
78
99
|
} });
|
|
79
100
|
}
|
|
80
101
|
deselectAllListItems(e) {
|
|
81
|
-
this.setState({
|
|
82
|
-
selectedItems: [],
|
|
83
|
-
item: null
|
|
84
|
-
});
|
|
102
|
+
this.setState({ anchorItem: null }), this.reportSelection(e, [], null);
|
|
85
103
|
}
|
|
86
104
|
selectAllListItems(e) {
|
|
87
|
-
this.
|
|
88
|
-
selectedItems: this.props.options,
|
|
89
|
-
item: this.state.currentSelectedItem
|
|
90
|
-
});
|
|
105
|
+
this.reportSelection(e, [...this.props.options], this.state.anchorItem);
|
|
91
106
|
}
|
|
92
107
|
selectListItem(e, t) {
|
|
93
|
-
let n = [e]
|
|
108
|
+
let n = [e];
|
|
94
109
|
if (this.props.multiple) {
|
|
95
|
-
|
|
110
|
+
let r = this.selectedItems();
|
|
111
|
+
if (t.metaKey) n = this.isSelected(e) ? r.filter((t) => h(t) !== h(e)) : [e, ...r];
|
|
96
112
|
else if (t.shiftKey) {
|
|
97
|
-
let
|
|
98
|
-
|
|
113
|
+
let t = this.indexOfItem(e), i = [
|
|
114
|
+
this.indexOfItem(this.state.anchorItem),
|
|
115
|
+
this.indexOfItem(r[0] ?? null),
|
|
116
|
+
t
|
|
117
|
+
].find((e) => e !== -1), a = Math.min(i, t), o = Math.max(i, t), s = this.props.options.slice(a, o + 1), c = s.map(h);
|
|
118
|
+
n = [...s, ...r.filter((e) => !c.includes(h(e)))];
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
|
-
this.setState({
|
|
102
|
-
selectedItems: n,
|
|
103
|
-
item: e
|
|
104
|
-
});
|
|
121
|
+
this.setState({ anchorItem: e }), this.reportSelection(t, n, e);
|
|
105
122
|
}
|
|
106
123
|
handleOnSelect(e, { item: t }) {
|
|
107
124
|
this.selectListItem(t, e), this.focusItem(t);
|
|
108
125
|
}
|
|
109
126
|
sortDirection() {
|
|
110
|
-
return this.props.sortDirection ? /* @__PURE__ */
|
|
127
|
+
return this.props.sortDirection ? /* @__PURE__ */ u(n, {
|
|
111
128
|
category: "utility",
|
|
112
|
-
name: this.props.sortDirection ===
|
|
129
|
+
name: this.props.sortDirection === f.DOWN ? "arrowdown" : "arrowup",
|
|
113
130
|
size: "xx-small",
|
|
114
131
|
className: "slds-align-top"
|
|
115
132
|
}) : null;
|
|
116
133
|
}
|
|
117
134
|
headerWrapper(e) {
|
|
118
|
-
return this.props.events?.onSort ? /* @__PURE__ */
|
|
135
|
+
return this.props.events?.onSort ? /* @__PURE__ */ u("a", {
|
|
119
136
|
"aria-live": "polite",
|
|
120
137
|
style: { borderTop: "0" },
|
|
121
138
|
href: "#",
|
|
@@ -123,7 +140,7 @@ var d = Object.freeze({
|
|
|
123
140
|
className: "slds-split-view__list-header slds-grid slds-text-link_reset",
|
|
124
141
|
onClick: t.trappedHandler(this.props.events.onSort),
|
|
125
142
|
children: e
|
|
126
|
-
}) : /* @__PURE__ */
|
|
143
|
+
}) : /* @__PURE__ */ u("div", {
|
|
127
144
|
style: { borderTop: "0" },
|
|
128
145
|
className: "slds-split-view__list-header slds-grid",
|
|
129
146
|
children: e
|
|
@@ -131,17 +148,17 @@ var d = Object.freeze({
|
|
|
131
148
|
}
|
|
132
149
|
header() {
|
|
133
150
|
let e = this.props.assistiveText?.sort || {};
|
|
134
|
-
return this.props.labels?.header ? this.headerWrapper(/* @__PURE__ */
|
|
135
|
-
"aria-sort": this.props.sortDirection ===
|
|
151
|
+
return this.props.labels?.header ? this.headerWrapper(/* @__PURE__ */ d("span", {
|
|
152
|
+
"aria-sort": this.props.sortDirection === f.DOWN ? e.descending : e.ascending,
|
|
136
153
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ d("span", {
|
|
138
155
|
className: "slds-assistive-text",
|
|
139
156
|
children: [e.sortedBy, ": "]
|
|
140
157
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ d("span", { children: [this.props.labels.header, this.sortDirection()] }),
|
|
159
|
+
/* @__PURE__ */ d("span", {
|
|
143
160
|
className: "slds-assistive-text",
|
|
144
|
-
children: ["- ", this.props.sortDirection ===
|
|
161
|
+
children: ["- ", this.props.sortDirection === f.DOWN ? e.descending : e.ascending]
|
|
145
162
|
})
|
|
146
163
|
]
|
|
147
164
|
})) : null;
|
|
@@ -151,7 +168,7 @@ var d = Object.freeze({
|
|
|
151
168
|
}
|
|
152
169
|
listItems() {
|
|
153
170
|
let { ListItemWithContent: e } = this, { renderListItem: t } = this.props;
|
|
154
|
-
return this.props.options.map((n, r) => /* @__PURE__ */
|
|
171
|
+
return this.props.options.map((n, r) => /* @__PURE__ */ u(e, {
|
|
155
172
|
assistiveText: { unreadItem: this.props.assistiveText?.unreadItem },
|
|
156
173
|
listItemRef: (e) => {
|
|
157
174
|
e && this.addListItemComponent(e, r);
|
|
@@ -169,10 +186,10 @@ var d = Object.freeze({
|
|
|
169
186
|
}, n.id || r));
|
|
170
187
|
}
|
|
171
188
|
render() {
|
|
172
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ d("div", {
|
|
173
190
|
id: this.props.id,
|
|
174
|
-
className:
|
|
175
|
-
children: [this.header(), /* @__PURE__ */
|
|
191
|
+
className: l("slds-grid slds-grid_vertical slds-scrollable_none", this.props.className),
|
|
192
|
+
children: [this.header(), /* @__PURE__ */ u("ul", {
|
|
176
193
|
className: "slds-scrollable_y",
|
|
177
194
|
"aria-label": this.props.assistiveText?.list,
|
|
178
195
|
"aria-multiselectable": this.props.multiple,
|
|
@@ -184,6 +201,6 @@ var d = Object.freeze({
|
|
|
184
201
|
}
|
|
185
202
|
};
|
|
186
203
|
//#endregion
|
|
187
|
-
export {
|
|
204
|
+
export { f as SORT_OPTIONS, g as default };
|
|
188
205
|
|
|
189
206
|
//# sourceMappingURL=listbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../components/split-view/listbox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, { type ReactNode, type SyntheticEvent } from 'react';\nimport classNames from 'classnames';\nimport eventUtil from '../../utilities/event';\n\nimport { SPLIT_VIEW_LISTBOX } from '../../utilities/constants';\n\nimport Icon from '../icon';\nimport SplitViewListItemContent, {\n\ttype SplitViewListItem,\n} from './private/list-item-content';\nimport listItemWithContent from './private/list-item-with-content';\nimport checkProps from './listbox-check-props';\nimport componentDoc from './component.json';\n\nexport const SORT_OPTIONS = Object.freeze({\n\tUP: 'up',\n\tDOWN: 'down',\n});\n\nexport interface SplitViewListboxSortAssistiveText {\n\tsortedBy?: string;\n\tdescending?: string;\n\tascending?: string;\n}\n\nexport interface SplitViewListboxAssistiveText {\n\tlist?: string;\n\tsort?: SplitViewListboxSortAssistiveText;\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListboxSelectData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\tselectedItems: T[];\n\titem: T | null;\n}\n\nexport interface SplitViewListboxEvents<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * Called when a list item is selected.\n\t */\n\tonSelect: (\n\t\tevent: SyntheticEvent,\n\t\tdata: SplitViewListboxSelectData<T>\n\t) => void;\n\t/**\n\t * Called when the list is sorted.\n\t */\n\tonSort?: (event: SyntheticEvent) => void;\n}\n\nexport interface SplitViewListboxLabels {\n\t/** This is the header of the list. */\n\theader?: string;\n}\n\n/**\n * Fields read by the default list item. Items with other fields are typed by\n * the `SplitViewListbox` type parameter, which flows to `renderListItem`, `listItem` and `onSelect`.\n */\nexport type SplitViewListboxItem = SplitViewListItem & {\n\tid?: string | number;\n};\n\n/**\n * Data passed to `renderListItem`\n */\nexport interface SplitViewListboxRenderListItemData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** Whether the item has keyboard focus (is the list's tab stop) */\n\tisFocused: boolean;\n\t/** Whether the item is in `selection` */\n\tisSelected: boolean;\n\t/** Whether the item is in `unread` */\n\tisUnread: boolean;\n\t/** The item from `options` */\n\titem: T;\n}\n\nexport interface SplitViewListboxProps<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `list`: aria label for the list\n\t * * `sort`\n\t * * `sortedBy`: Clickable sort header for the list.\n\t * * `descending`: Descending sorting.\n\t * * `ascending`: Ascending sorting.\n\t */\n\tassistiveText?: SplitViewListboxAssistiveText;\n\t/**\n\t * CSS classes to be added to the parent `div` tag.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Event Callbacks\n\t * * `onSelect`: Called when a list item is selected.\n\t * * `onSort`: Called when the list is sorted.\n\t */\n\tevents?: SplitViewListboxEvents<T>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `header`: This is the header of the list.\n\t */\n\tlabels?: SplitViewListboxLabels;\n\t/**\n\t * The direction of the sort arrow. Option are:\n\t * * SORT_OPTIONS.UP: `up`\n\t * * SORT_OPTIONS.DOWN: `down`\n\t */\n\tsortDirection?: 'up' | 'down';\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * The list of items.\n\t * It is recommended that you have a unique `id` for each item.\n\t */\n\toptions: T[];\n\t/**\n\t * Accepts an array of item objects. For single selection, pass in an array of one object.\n\t */\n\tselection?: T[];\n\t/**\n\t * Accepts an array of item objects. For single unread, pass in an array of one object.\n\t */\n\tunread?: T[];\n\t/**\n\t * @deprecated Use `renderListItem` instead, which is called as a function with `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\tlistItem?: React.ComponentType<{ item: T }>;\n\t/**\n\t * Renders the content of each list item in place of the default label and text. The listbox still renders the option, its selection and the unread indicator around it. Receives `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\trenderListItem?: (data: SplitViewListboxRenderListItemData<T>) => ReactNode;\n}\n\ninterface SplitViewListboxState<T extends SplitViewListboxItem> {\n\tcurrentSelectedItem: T | null;\n\tcurrentFocusedListItem: {\n\t\tindex: number;\n\t\titem: T | null;\n\t};\n}\n\nconst defaultProps: Partial<SplitViewListboxProps> = {\n\tassistiveText: {\n\t\tlist: 'Select an item to open it in a new workspace tab.',\n\t\tsort: {\n\t\t\tsortedBy: 'Sorted by',\n\t\t\tdescending: 'Descending',\n\t\t\tascending: 'Ascending',\n\t\t},\n\t},\n\tevents: {} as SplitViewListboxEvents,\n\tlabels: {},\n\tselection: [],\n\tunread: [],\n};\n\n/**\n * The menu with the ARIA role of a listbox.\n */\nclass SplitViewListbox<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> extends React.Component<SplitViewListboxProps<T>, SplitViewListboxState<T>> {\n\tstatic displayName = SPLIT_VIEW_LISTBOX;\n\n\tstatic defaultProps = defaultProps;\n\n\tlistItemComponents: Record<number, HTMLAnchorElement>;\n\n\tListItemWithContent: ReturnType<typeof listItemWithContent>;\n\n\tconstructor(props: SplitViewListboxProps<T>) {\n\t\tsuper(props);\n\n\t\tthis.listItemComponents = {};\n\n\t\tthis.state = {\n\t\t\tcurrentSelectedItem: null,\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex: 0,\n\t\t\t\titem: null,\n\t\t\t},\n\t\t};\n\n\t\tcheckProps(SPLIT_VIEW_LISTBOX, props, componentDoc);\n\n\t\t// Generates the list item template\n\t\tthis.ListItemWithContent = listItemWithContent(\n\t\t\t(props.listItem as unknown as React.ComponentType<\n\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t>) ||\n\t\t\t\t(SplitViewListItemContent as unknown as React.ComponentType<\n\t\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t\t>)\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.focusFirstItem();\n\t}\n\n\tisListItemFocused(item: T) {\n\t\treturn this.state.currentFocusedListItem.item === item;\n\t}\n\n\tisSelected(item: T) {\n\t\treturn (this.props.selection || []).includes(item);\n\t}\n\n\tisUnread(item: T) {\n\t\treturn (this.props.unread || []).includes(item);\n\t}\n\n\thandleKeyDown(event: React.KeyboardEvent) {\n\t\tif (this.props.multiple && event.key === 'a' && event.ctrlKey) {\n\t\t\t// select / deselect all\n\t\t\teventUtil.trap(event);\n\t\t\tif (this.props.options === this.props.selection) {\n\t\t\t\tthis.deselectAllListItems(event);\n\t\t\t} else {\n\t\t\t\tthis.selectAllListItems(event);\n\t\t\t}\n\t\t} else if (event.key === 'ArrowUp') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToPreviousItem(event);\n\t\t} else if (event.key === 'ArrowDown') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToNextItem(event);\n\t\t}\n\t}\n\n\tmoveToNextItem(event: SyntheticEvent) {\n\t\tconst nextFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === this.props.options.length - 1\n\t\t\t\t? 0\n\t\t\t\t: this.state.currentFocusedListItem.index + 1;\n\n\t\tthis.moveToIndex(event, nextFocusIndex);\n\t}\n\n\tmoveToPreviousItem(event: SyntheticEvent) {\n\t\tconst previousFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === 0\n\t\t\t\t? this.props.options.length - 1\n\t\t\t\t: this.state.currentFocusedListItem.index - 1;\n\n\t\tthis.moveToIndex(event, previousFocusIndex);\n\t}\n\n\tmoveToIndex(event: SyntheticEvent, index: number) {\n\t\tconst item = this.props.options[index];\n\n\t\tthis.focusItem(item);\n\t}\n\n\tfocusFirstItem() {\n\t\tconst firstSelectedItem =\n\t\t\tthis.props.options.find((item) =>\n\t\t\t\t(this.props.selection || []).includes(item)\n\t\t\t) || this.props.options[0];\n\n\t\tif (firstSelectedItem) {\n\t\t\tthis.focusItem(firstSelectedItem, true);\n\t\t}\n\t}\n\n\tfocusItem(item: T, setDataOnly?: boolean) {\n\t\tconst index = this.props.options.indexOf(item);\n\n\t\tif (!setDataOnly) {\n\t\t\tthis.listItemComponents[index].focus();\n\t\t}\n\n\t\tthis.setState({\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex,\n\t\t\t\titem,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeselectAllListItems(event: SyntheticEvent) {\n\t\tthis.setState({ currentSelectedItem: null });\n\t\tthis.props.events?.onSelect(event, {\n\t\t\tselectedItems: [],\n\t\t\titem: null,\n\t\t});\n\t}\n\n\tselectAllListItems(event: SyntheticEvent) {\n\t\tthis.props.events?.onSelect(event, {\n\t\t\tselectedItems: this.props.options,\n\t\t\titem: this.state.currentSelectedItem,\n\t\t});\n\t}\n\n\tselectListItem(item: T, event: React.MouseEvent) {\n\t\tlet selectedItems = [item];\n\t\tconst selection = this.props.selection || [];\n\n\t\tif (this.props.multiple) {\n\t\t\tif (event.metaKey) {\n\t\t\t\tselectedItems = selection.includes(item)\n\t\t\t\t\t? selection.filter((i) => i !== item)\n\t\t\t\t\t: [item, ...selection];\n\t\t\t} else if (event.shiftKey) {\n\t\t\t\tconst [begin, end] = [\n\t\t\t\t\tthis.props.options.indexOf(this.state.currentSelectedItem as T),\n\t\t\t\t\tthis.props.options.indexOf(item),\n\t\t\t\t].sort();\n\n\t\t\t\tconst addToSelection = this.props.options.slice(begin, end + 1);\n\n\t\t\t\tselectedItems = [\n\t\t\t\t\t...addToSelection,\n\t\t\t\t\t...selection.filter((i) => !addToSelection.includes(i)),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({ currentSelectedItem: item });\n\n\t\tthis.props.events?.onSelect(event, { selectedItems, item });\n\t}\n\n\thandleOnSelect(event: React.MouseEvent, { item }: { item: T }) {\n\t\tthis.selectListItem(item, event);\n\t\tthis.focusItem(item);\n\t}\n\n\tsortDirection(): ReactNode {\n\t\treturn this.props.sortDirection ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={\n\t\t\t\t\tthis.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t? 'arrowdown'\n\t\t\t\t\t\t: 'arrowup'\n\t\t\t\t}\n\t\t\t\tsize=\"xx-small\"\n\t\t\t\tclassName=\"slds-align-top\"\n\t\t\t/>\n\t\t) : null;\n\t}\n\n\theaderWrapper(children: ReactNode): ReactNode {\n\t\treturn this.props.events?.onSort ? (\n\t\t\t<a\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\thref=\"#\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid slds-text-link_reset\"\n\t\t\t\tonClick={eventUtil.trappedHandler(this.props.events.onSort)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t) : (\n\t\t\t<div\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n\n\theader(): ReactNode {\n\t\tconst sort = this.props.assistiveText?.sort || {};\n\t\treturn this.props.labels?.header\n\t\t\t? this.headerWrapper(\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-sort={\n\t\t\t\t\t\t\t(this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending) as React.AriaAttributes['aria-sort']\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{sort.sortedBy}\n\t\t\t\t\t\t\t{': '}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{this.props.labels.header}\n\t\t\t\t\t\t\t{this.sortDirection()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{'- '}\n\t\t\t\t\t\t\t{this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t: null;\n\t}\n\n\taddListItemComponent(component: HTMLAnchorElement, index: number) {\n\t\tthis.listItemComponents[index] = component;\n\t}\n\n\tlistItems(): ReactNode {\n\t\tconst { ListItemWithContent } = this;\n\t\tconst { renderListItem } = this.props;\n\n\t\treturn this.props.options.map((item, index) => (\n\t\t\t<ListItemWithContent\n\t\t\t\tkey={item.id || index}\n\t\t\t\tassistiveText={{\n\t\t\t\t\tunreadItem: this.props.assistiveText?.unreadItem,\n\t\t\t\t}}\n\t\t\t\tlistItemRef={(component: HTMLAnchorElement | null) => {\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\tthis.addListItemComponent(component, index);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\titem={item}\n\t\t\t\tisFocused={this.isListItemFocused(item)}\n\t\t\t\tisSelected={this.isSelected(item)}\n\t\t\t\tisUnread={this.isUnread(item)}\n\t\t\t\tevents={{\n\t\t\t\t\tonClick: (event, meta) =>\n\t\t\t\t\t\tthis.handleOnSelect(event, {\n\t\t\t\t\t\t\titem: meta.item as T,\n\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t\tmultiple={this.props.multiple}\n\t\t\t\trenderContent={\n\t\t\t\t\trenderListItem\n\t\t\t\t\t\t? (data) => renderListItem({ ...data, item })\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t));\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.props.id}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-grid slds-grid_vertical slds-scrollable_none',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.header()}\n\t\t\t\t<ul\n\t\t\t\t\tclassName=\"slds-scrollable_y\"\n\t\t\t\t\taria-label={this.props.assistiveText?.list}\n\t\t\t\t\taria-multiselectable={this.props.multiple}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\tonKeyDown={(event) => this.handleKeyDown(event)}\n\t\t\t\t>\n\t\t\t\t\t{this.listItems()}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default SplitViewListbox;\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,IAAe,OAAO,OAAO;CACzC,IAAI;CACJ,MAAM;AACP,CAAC,GA0IK,IAA+C;CACpD,eAAe;EACd,MAAM;EACN,MAAM;GACL,UAAU;GACV,YAAY;GACZ,WAAW;EACZ;CACD;CACA,QAAQ,CAAC;CACT,QAAQ,CAAC;CACT,WAAW,CAAC;CACZ,QAAQ,CAAC;AACV,GAKM,IAAN,cAEU,EAAM,UAA8D;CAC7E,OAAO,cAAc;CAErB,OAAO,eAAe;CAEtB;CAEA;CAEA,YAAY,GAAiC;EAgB5C,AAfA,MAAM,CAAK,GAEX,KAAK,qBAAqB,CAAC,GAE3B,KAAK,QAAQ;GACZ,qBAAqB;GACrB,wBAAwB;IACvB,OAAO;IACP,MAAM;GACP;EACD,GAEA,EAAW,GAAoB,GAAO,CAAY,GAGlD,KAAK,sBAAsB,EACzB,EAAM,Y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,cAAc,MAAwC;IACrD,AAAI,KACH,KAAK,qBAAqB,GAAW,CAAK;GAE5C;GACM;GACN,WAAW,KAAK,kBAAkB,CAAI;GACtC,YAAY,KAAK,WAAW,CAAI;GAChC,UAAU,KAAK,SAAS,CAAI;GAC5B,QAAQ,EACP,UAAU,GAAO,MAChB,KAAK,eAAe,GAAO,EAC1B,MAAM,EAAK,KACZ,CAAC,EACH;GACA,UAAU,KAAK,MAAM;GACrB,eACC,KACI,MAAS,EAAe;IAAE,GAAG;IAAM;GAAK,CAAC,IAC1C,KAAA;EAEJ,GAzBK,EAAK,MAAM,CAyBhB,CACD;CACF;CAEA,SAAS;EACR,OACC,kBAAC,OAAD;GACC,IAAI,KAAK,MAAM;GACf,WAAW,EACV,qDACA,KAAK,MAAM,SACZ;GALD,UAAA,CAOE,KAAK,OAAO,GACb,kBAAC,MAAD;IACC,WAAU;IACV,cAAY,KAAK,MAAM,eAAe;IACtC,wBAAsB,KAAK,MAAM;IACjC,MAAK;IACL,YAAY,MAAU,KAAK,cAAc,CAAK;IAE7C,UAAA,KAAK,UAAU;GACb,CAAA,CACA;;CAEP;AACD"}
|
|
1
|
+
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../components/split-view/listbox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, { type ReactNode, type SyntheticEvent } from 'react';\nimport classNames from 'classnames';\nimport eventUtil from '../../utilities/event';\n\nimport { SPLIT_VIEW_LISTBOX } from '../../utilities/constants';\n\nimport Icon from '../icon';\nimport SplitViewListItemContent, {\n\ttype SplitViewListItem,\n} from './private/list-item-content';\nimport listItemWithContent from './private/list-item-with-content';\nimport checkProps, { checkSelectionProps } from './listbox-check-props';\nimport componentDoc from './component.json';\n\nexport const SORT_OPTIONS = Object.freeze({\n\tUP: 'up',\n\tDOWN: 'down',\n});\n\nexport interface SplitViewListboxSortAssistiveText {\n\tsortedBy?: string;\n\tdescending?: string;\n\tascending?: string;\n}\n\nexport interface SplitViewListboxAssistiveText {\n\tlist?: string;\n\tsort?: SplitViewListboxSortAssistiveText;\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListboxSelectData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** The requested selection, as item ids. Pass it back as `selection`. */\n\tselection: SplitViewListboxItemId[];\n\t/** The items of the requested selection */\n\tselectedItems: T[];\n\t/** The item that was clicked, or the range anchor for select-all (`null` when deselecting all) */\n\titem: T | null;\n}\n\nexport interface SplitViewListboxEvents<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * Called when the selection is asked to change (click, meta/shift-click, Ctrl+A).\n\t * `data.selection` is the requested selection; update `selection` to apply it.\n\t */\n\tonSelect: (\n\t\tevent: SyntheticEvent,\n\t\tdata: SplitViewListboxSelectData<T>\n\t) => void;\n\t/**\n\t * Called when the list is sorted.\n\t */\n\tonSort?: (event: SyntheticEvent) => void;\n}\n\nexport interface SplitViewListboxLabels {\n\t/** This is the header of the list. */\n\theader?: string;\n}\n\n/** An item's `id`, as used in `selection` and `unread` */\nexport type SplitViewListboxItemId = string | number;\n\n/**\n * Fields read by the default list item. Items with other fields are typed by\n * the `SplitViewListbox` type parameter, which flows to `renderListItem`, `listItem` and `onSelect`.\n */\nexport type SplitViewListboxItem = SplitViewListItem & {\n\t/** Unique id of the item, matched against `selection` and `unread` */\n\tid: SplitViewListboxItemId;\n};\n\n/**\n * Data passed to `renderListItem`\n */\nexport interface SplitViewListboxRenderListItemData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** Whether the item has keyboard focus (is the list's tab stop) */\n\tisFocused: boolean;\n\t/** Whether the item is in `selection` */\n\tisSelected: boolean;\n\t/** Whether the item is in `unread` */\n\tisUnread: boolean;\n\t/** The item from `options` */\n\titem: T;\n}\n\nexport interface SplitViewListboxProps<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `list`: aria label for the list\n\t * * `sort`\n\t * * `sortedBy`: Clickable sort header for the list.\n\t * * `descending`: Descending sorting.\n\t * * `ascending`: Ascending sorting.\n\t */\n\tassistiveText?: SplitViewListboxAssistiveText;\n\t/**\n\t * CSS classes to be added to the parent `div` tag.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Event Callbacks\n\t * * `onSelect` (required): Called with `(event, { selection, selectedItems, item })` when the selection is asked to change. `selection` is the requested selection as item ids.\n\t * * `onSort`: Called when the list is sorted.\n\t */\n\tevents: SplitViewListboxEvents<T>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `header`: This is the header of the list.\n\t */\n\tlabels?: SplitViewListboxLabels;\n\t/**\n\t * The direction of the sort arrow. Option are:\n\t * * SORT_OPTIONS.UP: `up`\n\t * * SORT_OPTIONS.DOWN: `down`\n\t */\n\tsortDirection?: 'up' | 'down';\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * The list of items.\n\t * It is recommended that you have a unique `id` for each item.\n\t */\n\toptions: T[];\n\t/**\n\t * Ids (`item.id`) of the selected items (`[]` for none). The listbox is controlled: it renders this\n\t * selection and reports changes through `events.onSelect`. For single selection, pass an array of one id.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tselection: SplitViewListboxItemId[] | T[];\n\t/**\n\t * Ids (`item.id`) of the unread items.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tunread?: SplitViewListboxItemId[] | T[];\n\t/**\n\t * @deprecated Use `renderListItem` instead, which is called as a function with `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\tlistItem?: React.ComponentType<{ item: T }>;\n\t/**\n\t * Renders the content of each list item in place of the default label and text. The listbox still renders the option, its selection and the unread indicator around it. Receives `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\trenderListItem?: (data: SplitViewListboxRenderListItemData<T>) => ReactNode;\n}\n\ninterface SplitViewListboxState<T extends SplitViewListboxItem> {\n\t/** Anchor of shift-click range selection: the last clicked item (ephemeral, not the selection) */\n\tanchorItem: T | null;\n\tcurrentFocusedListItem: {\n\t\tindex: number;\n\t\titem: T | null;\n\t};\n}\n\n// Typed by its keys (not `Partial<SplitViewListboxProps>`) so JSX still requires the other props\nconst defaultProps = {\n\tassistiveText: {\n\t\tlist: 'Select an item to open it in a new workspace tab.',\n\t\tsort: {\n\t\t\tsortedBy: 'Sorted by',\n\t\t\tdescending: 'Descending',\n\t\t\tascending: 'Ascending',\n\t\t},\n\t},\n\tlabels: {},\n} satisfies Partial<SplitViewListboxProps>;\n\nconst EMPTY: never[] = [];\n\n/**\n * Key an item, or an entry of `selection`/`unread`, is matched by: the id, or for an item object\n * without an `id` (deprecated object entries only), the object itself.\n */\nconst toKey = (entry: unknown): unknown =>\n\tentry !== null && typeof entry === 'object'\n\t\t? ((entry as { id?: unknown }).id ?? entry)\n\t\t: entry;\n\n/**\n * The menu with the ARIA role of a listbox.\n */\nclass SplitViewListbox<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> extends React.Component<SplitViewListboxProps<T>, SplitViewListboxState<T>> {\n\tstatic displayName = SPLIT_VIEW_LISTBOX;\n\n\tstatic defaultProps = defaultProps;\n\n\tlistItemComponents: Record<number, HTMLAnchorElement>;\n\n\tListItemWithContent: ReturnType<typeof listItemWithContent>;\n\n\tconstructor(props: SplitViewListboxProps<T>) {\n\t\tsuper(props);\n\n\t\tthis.listItemComponents = {};\n\n\t\tthis.state = {\n\t\t\tanchorItem: null,\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex: 0,\n\t\t\t\titem: null,\n\t\t\t},\n\t\t};\n\n\t\tcheckProps(SPLIT_VIEW_LISTBOX, props, componentDoc);\n\n\t\t// Generates the list item template\n\t\tthis.ListItemWithContent = listItemWithContent(\n\t\t\t(props.listItem as unknown as React.ComponentType<\n\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t>) ||\n\t\t\t\t(SplitViewListItemContent as unknown as React.ComponentType<\n\t\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t\t>)\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t\tthis.focusFirstItem();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t}\n\n\tisListItemFocused(item: T) {\n\t\tconst focusedItem = this.state.currentFocusedListItem.item;\n\t\treturn focusedItem !== null && toKey(focusedItem) === toKey(item);\n\t}\n\n\tisSelected(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.selection || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\tisUnread(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.unread || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\t/** The selected items, in `options` order */\n\tselectedItems(): T[] {\n\t\treturn this.props.options.filter((item) => this.isSelected(item));\n\t}\n\n\tindexOfItem(item: T | null): number {\n\t\tconst key = item === null ? undefined : toKey(item);\n\t\treturn key === undefined\n\t\t\t? -1\n\t\t\t: this.props.options.findIndex((option) => toKey(option) === key);\n\t}\n\n\treportSelection(event: SyntheticEvent, selectedItems: T[], item: T | null) {\n\t\tthis.props.events?.onSelect?.(event, {\n\t\t\tselection: selectedItems.map((selectedItem) => selectedItem.id),\n\t\t\tselectedItems,\n\t\t\titem,\n\t\t});\n\t}\n\n\thandleKeyDown(event: React.KeyboardEvent) {\n\t\tif (this.props.multiple && event.key === 'a' && event.ctrlKey) {\n\t\t\t// select / deselect all\n\t\t\teventUtil.trap(event);\n\t\t\tconst { options } = this.props;\n\t\t\tif (\n\t\t\t\toptions.length > 0 &&\n\t\t\t\toptions.every((option) => this.isSelected(option))\n\t\t\t) {\n\t\t\t\tthis.deselectAllListItems(event);\n\t\t\t} else {\n\t\t\t\tthis.selectAllListItems(event);\n\t\t\t}\n\t\t} else if (event.key === 'ArrowUp') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToPreviousItem(event);\n\t\t} else if (event.key === 'ArrowDown') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToNextItem(event);\n\t\t}\n\t}\n\n\tmoveToNextItem(event: SyntheticEvent) {\n\t\tconst nextFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === this.props.options.length - 1\n\t\t\t\t? 0\n\t\t\t\t: this.state.currentFocusedListItem.index + 1;\n\n\t\tthis.moveToIndex(event, nextFocusIndex);\n\t}\n\n\tmoveToPreviousItem(event: SyntheticEvent) {\n\t\tconst previousFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === 0\n\t\t\t\t? this.props.options.length - 1\n\t\t\t\t: this.state.currentFocusedListItem.index - 1;\n\n\t\tthis.moveToIndex(event, previousFocusIndex);\n\t}\n\n\tmoveToIndex(event: SyntheticEvent, index: number) {\n\t\tconst item = this.props.options[index];\n\n\t\tthis.focusItem(item);\n\t}\n\n\tfocusFirstItem() {\n\t\tconst firstSelectedItem =\n\t\t\tthis.props.options.find((item) => this.isSelected(item)) ||\n\t\t\tthis.props.options[0];\n\n\t\tif (firstSelectedItem) {\n\t\t\tthis.focusItem(firstSelectedItem, true);\n\t\t}\n\t}\n\n\tfocusItem(item: T, setDataOnly?: boolean) {\n\t\tconst index = this.props.options.indexOf(item);\n\n\t\tif (!setDataOnly) {\n\t\t\tthis.listItemComponents[index].focus();\n\t\t}\n\n\t\tthis.setState({\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex,\n\t\t\t\titem,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeselectAllListItems(event: SyntheticEvent) {\n\t\tthis.setState({ anchorItem: null });\n\t\tthis.reportSelection(event, [], null);\n\t}\n\n\tselectAllListItems(event: SyntheticEvent) {\n\t\tthis.reportSelection(event, [...this.props.options], this.state.anchorItem);\n\t}\n\n\t// Reports the requested selection. The rendered selection only changes when `selection` does.\n\tselectListItem(item: T, event: React.MouseEvent) {\n\t\tlet selectedItems = [item];\n\n\t\tif (this.props.multiple) {\n\t\t\tconst currentItems = this.selectedItems();\n\t\t\tif (event.metaKey) {\n\t\t\t\tselectedItems = this.isSelected(item)\n\t\t\t\t\t? currentItems.filter((i) => toKey(i) !== toKey(item))\n\t\t\t\t\t: [item, ...currentItems];\n\t\t\t} else if (event.shiftKey) {\n\t\t\t\tconst itemIndex = this.indexOfItem(item);\n\t\t\t\t// Without an earlier click, the range starts at the first selected item\n\t\t\t\tconst anchorIndex = [\n\t\t\t\t\tthis.indexOfItem(this.state.anchorItem),\n\t\t\t\t\tthis.indexOfItem(currentItems[0] ?? null),\n\t\t\t\t\titemIndex,\n\t\t\t\t].find((index) => index !== -1) as number;\n\t\t\t\tconst begin = Math.min(anchorIndex, itemIndex);\n\t\t\t\tconst end = Math.max(anchorIndex, itemIndex);\n\n\t\t\t\tconst addToSelection = this.props.options.slice(begin, end + 1);\n\t\t\t\tconst addedKeys = addToSelection.map(toKey);\n\n\t\t\t\tselectedItems = [\n\t\t\t\t\t...addToSelection,\n\t\t\t\t\t...currentItems.filter((i) => !addedKeys.includes(toKey(i))),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({ anchorItem: item });\n\n\t\tthis.reportSelection(event, selectedItems, item);\n\t}\n\n\thandleOnSelect(event: React.MouseEvent, { item }: { item: T }) {\n\t\tthis.selectListItem(item, event);\n\t\tthis.focusItem(item);\n\t}\n\n\tsortDirection(): ReactNode {\n\t\treturn this.props.sortDirection ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={\n\t\t\t\t\tthis.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t? 'arrowdown'\n\t\t\t\t\t\t: 'arrowup'\n\t\t\t\t}\n\t\t\t\tsize=\"xx-small\"\n\t\t\t\tclassName=\"slds-align-top\"\n\t\t\t/>\n\t\t) : null;\n\t}\n\n\theaderWrapper(children: ReactNode): ReactNode {\n\t\treturn this.props.events?.onSort ? (\n\t\t\t<a\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\thref=\"#\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid slds-text-link_reset\"\n\t\t\t\tonClick={eventUtil.trappedHandler(this.props.events.onSort)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t) : (\n\t\t\t<div\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n\n\theader(): ReactNode {\n\t\tconst sort = this.props.assistiveText?.sort || {};\n\t\treturn this.props.labels?.header\n\t\t\t? this.headerWrapper(\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-sort={\n\t\t\t\t\t\t\t(this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending) as React.AriaAttributes['aria-sort']\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{sort.sortedBy}\n\t\t\t\t\t\t\t{': '}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{this.props.labels.header}\n\t\t\t\t\t\t\t{this.sortDirection()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{'- '}\n\t\t\t\t\t\t\t{this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t: null;\n\t}\n\n\taddListItemComponent(component: HTMLAnchorElement, index: number) {\n\t\tthis.listItemComponents[index] = component;\n\t}\n\n\tlistItems(): ReactNode {\n\t\tconst { ListItemWithContent } = this;\n\t\tconst { renderListItem } = this.props;\n\n\t\treturn this.props.options.map((item, index) => (\n\t\t\t<ListItemWithContent\n\t\t\t\tkey={item.id || index}\n\t\t\t\tassistiveText={{\n\t\t\t\t\tunreadItem: this.props.assistiveText?.unreadItem,\n\t\t\t\t}}\n\t\t\t\tlistItemRef={(component: HTMLAnchorElement | null) => {\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\tthis.addListItemComponent(component, index);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\titem={item}\n\t\t\t\tisFocused={this.isListItemFocused(item)}\n\t\t\t\tisSelected={this.isSelected(item)}\n\t\t\t\tisUnread={this.isUnread(item)}\n\t\t\t\tevents={{\n\t\t\t\t\tonClick: (event, meta) =>\n\t\t\t\t\t\tthis.handleOnSelect(event, {\n\t\t\t\t\t\t\titem: meta.item as T,\n\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t\tmultiple={this.props.multiple}\n\t\t\t\trenderContent={\n\t\t\t\t\trenderListItem\n\t\t\t\t\t\t? (data) => renderListItem({ ...data, item })\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t));\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.props.id}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-grid slds-grid_vertical slds-scrollable_none',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.header()}\n\t\t\t\t<ul\n\t\t\t\t\tclassName=\"slds-scrollable_y\"\n\t\t\t\t\taria-label={this.props.assistiveText?.list}\n\t\t\t\t\taria-multiselectable={this.props.multiple}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\tonKeyDown={(event) => this.handleKeyDown(event)}\n\t\t\t\t>\n\t\t\t\t\t{this.listItems()}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default SplitViewListbox;\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,IAAe,OAAO,OAAO;CACzC,IAAI;CACJ,MAAM;AACP,CAAC,GA4JK,IAAe;CACpB,eAAe;EACd,MAAM;EACN,MAAM;GACL,UAAU;GACV,YAAY;GACZ,WAAW;EACZ;CACD;CACA,QAAQ,CAAC;AACV,GAEM,IAAiB,CAAC,GAMlB,KAAS,MACI,OAAO,KAAU,YAAnC,IACK,EAA2B,MAAM,IACnC,GAKE,IAAN,cAEU,EAAM,UAA8D;CAC7E,OAAO,cAAc;CAErB,OAAO,eAAe;CAEtB;CAEA;CAEA,YAAY,GAAiC;EAgB5C,AAfA,MAAM,CAAK,GAEX,KAAK,qBAAqB,CAAC,GAE3B,KAAK,QAAQ;GACZ,YAAY;GACZ,wBAAwB;IACvB,OAAO;IACP,MAAM;GACP;EACD,GAEA,EAAW,GAAoB,GAAO,CAAY,GAGlD,KAAK,sBAAsB,EACzB,EAAM,YAGL,CAGH;CACD;CAEA,oBAAoB;EAEnB,AADA,EAAoB,GAAoB,KAAK,OAAO,CAAY,GAChE,KAAK,eAAe;CACrB;CAEA,qBAAqB;EACpB,EAAoB,GAAoB,KAAK,OAAO,CAAY;CACjE;CAEA,kBAAkB,GAAS;EAC1B,IAAM,IAAc,KAAK,MAAM,uBAAuB;EACtD,OAAO,MAAgB,QAAQ,EAAM,CAAW,MAAM,EAAM,CAAI;CACjE;CAEA,WAAW,GAAS;EACnB,IAAM,IAAM,EAAM,CAAI;EACtB,QAAQ,KAAK,MAAM,aAAa,EAAA,CAAO,MACrC,MAA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B,KAAK,cAAc,CACf,EAAA,CAAA;IACN,kBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CACE,MACA,KAAK,MAAM,kBAAkB,EAAa,OACxC,EAAK,aACL,EAAK,SACH;;GACD;EACP,CAAA,CAAA,IACC;CACJ;CAEA,qBAAqB,GAA8B,GAAe;EACjE,KAAK,mBAAmB,KAAS;CAClC;CAEA,YAAuB;EACtB,IAAM,EAAE,2BAAwB,MAC1B,EAAE,sBAAmB,KAAK;EAEhC,OAAO,KAAK,MAAM,QAAQ,KAAK,GAAM,MACpC,kBAAC,GAAD;GAEC,eAAe,EACd,YAAY,KAAK,MAAM,eAAe,WACvC;GACA,cAAc,MAAwC;IACrD,AAAI,KACH,KAAK,qBAAqB,GAAW,CAAK;GAE5C;GACM;GACN,WAAW,KAAK,kBAAkB,CAAI;GACtC,YAAY,KAAK,WAAW,CAAI;GAChC,UAAU,KAAK,SAAS,CAAI;GAC5B,QAAQ,EACP,UAAU,GAAO,MAChB,KAAK,eAAe,GAAO,EAC1B,MAAM,EAAK,KACZ,CAAC,EACH;GACA,UAAU,KAAK,MAAM;GACrB,eACC,KACI,MAAS,EAAe;IAAE,GAAG;IAAM;GAAK,CAAC,IAC1C,KAAA;EAEJ,GAzBK,EAAK,MAAM,CAyBhB,CACD;CACF;CAEA,SAAS;EACR,OACC,kBAAC,OAAD;GACC,IAAI,KAAK,MAAM;GACf,WAAW,EACV,qDACA,KAAK,MAAM,SACZ;GALD,UAAA,CAOE,KAAK,OAAO,GACb,kBAAC,MAAD;IACC,WAAU;IACV,cAAY,KAAK,MAAM,eAAe;IACtC,wBAAsB,KAAK,MAAM;IACjC,MAAK;IACL,YAAY,MAAU,KAAK,cAAc,CAAK;IAE7C,UAAA,KAAK,UAAU;GACb,CAAA,CACA;;CAEP;AACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "../../utilities/warning/sunset-property.js";
|
|
2
|
+
import t from "../../utilities/get-component-doc.js";
|
|
3
|
+
import n from "../../utilities/warning/deprecated-property.js";
|
|
4
|
+
import r from "../../utilities/warning/required-property.js";
|
|
5
|
+
//#region components/tabs/check-props.js
|
|
6
|
+
var i = function() {};
|
|
7
|
+
process.env.NODE_ENV !== "production" && (i = function(i, a, o) {
|
|
8
|
+
let s = t(o);
|
|
9
|
+
e(i, a.defaultSelectedIndex !== void 0, "defaultSelectedIndex", `Tabs is controlled: pass \`value\` and update it in \`onSelect\`. ${s("value")}`), n(i, a.selectedIndex, "selectedIndex", "value", `Set \`value\` on each \`TabsPanel\` (a panel without one is matched by its index as a string) and read \`value\` in \`onSelect\`. ${s("value")}`), r(i, a.value !== void 0 || a.selectedIndex !== void 0, "value", `Tabs is controlled: without \`value\` no tab is selected. Pass \`value\` and update it in \`onSelect\`. ${s("value")}`);
|
|
10
|
+
});
|
|
11
|
+
var a = i;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { a as default };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=check-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/tabs/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport requiredProperty from '../../utilities/warning/required-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultSelectedIndex !== undefined,\n\t\t\t'defaultSelectedIndex',\n\t\t\t`Tabs is controlled: pass \\`value\\` and update it in \\`onSelect\\`. ${createDocUrl('value')}`\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.selectedIndex,\n\t\t\t'selectedIndex',\n\t\t\t'value',\n\t\t\t`Set \\`value\\` on each \\`TabsPanel\\` (a panel without one is matched by its index as a string) and read \\`value\\` in \\`onSelect\\`. ${createDocUrl('value')}`\n\t\t);\n\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.value !== undefined || props.selectedIndex !== undefined,\n\t\t\t'value',\n\t\t\t`Tabs is controlled: without \\`value\\` no tab is selected. Pass \\`value\\` and update it in \\`onSelect\\`. ${createDocUrl('value')}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AASA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAiB9C,AAfA,EACC,GACA,EAAM,yBAAyB,KAAA,GAC/B,wBACA,qEAAqE,EAAa,OAAO,GAC1F,GAEA,EACC,GACA,EAAM,eACN,iBACA,SACA,qIAAqI,EAAa,OAAO,GAC1J,GAEA,EACC,GACA,EAAM,UAAU,KAAA,KAAa,EAAM,kBAAkB,KAAA,GACrD,SACA,2GAA2G,EAAa,OAAO,GAChI;AACD;AAGD,IAAA,IAAe"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region components/tabs/component.json
|
|
2
|
+
var e = "tabs", t = "prod", n = "Tabs", r = [{
|
|
3
|
+
component: "panel",
|
|
4
|
+
classKey: "TabsPanel"
|
|
5
|
+
}], i = {
|
|
6
|
+
component: e,
|
|
7
|
+
status: t,
|
|
8
|
+
"display-name": "Tabs",
|
|
9
|
+
classKey: n,
|
|
10
|
+
"last-accessibility-review": {
|
|
11
|
+
"date-iso-8601": "2018/01/18",
|
|
12
|
+
"commit-sha": "ad6b6c6523ee21cada11be5f7ea4d99abc530726"
|
|
13
|
+
},
|
|
14
|
+
"SLDS-component-path": "/components/tabs",
|
|
15
|
+
dependencies: r,
|
|
16
|
+
"site-stories": [{
|
|
17
|
+
heading: "Default",
|
|
18
|
+
path: "/__examples__/default.jsx"
|
|
19
|
+
}, {
|
|
20
|
+
heading: "Scoped",
|
|
21
|
+
path: "/__examples__/scoped.jsx"
|
|
22
|
+
}],
|
|
23
|
+
"url-slug": "tabs"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { n as classKey, e as component, i as default, r as dependencies, t as status };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","names":[],"sources":["../../../../components/tabs/component.json"],"sourcesContent":["{\n\t\"component\": \"tabs\",\n\t\"status\": \"prod\",\n\t\"display-name\": \"Tabs\",\n\t\"classKey\": \"Tabs\",\n\t\"last-accessibility-review\": {\n\t\t\"date-iso-8601\": \"2018/01/18\",\n\t\t\"commit-sha\": \"ad6b6c6523ee21cada11be5f7ea4d99abc530726\"\n\t},\n\t\"SLDS-component-path\": \"/components/tabs\",\n\t\"dependencies\": [\n\t\t{\n\t\t\t\"component\": \"panel\",\n\t\t\t\"classKey\": \"TabsPanel\"\n\t\t}\n\t],\n\t\"site-stories\": [\n\t\t{\n\t\t\t\"heading\": \"Default\",\n\t\t\t\"path\": \"/__examples__/default.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Scoped\",\n\t\t\t\"path\": \"/__examples__/scoped.jsx\"\n\t\t}\n\t],\n\t\"url-slug\": \"tabs\"\n}\n"],"mappings":""}
|
|
@@ -4,132 +4,147 @@ import n from "../../utilities/key-code.js";
|
|
|
4
4
|
import r from "./private/tabs-list.js";
|
|
5
5
|
import i from "./private/tab.js";
|
|
6
6
|
import a from "./private/tab-panel.js";
|
|
7
|
-
import o
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
7
|
+
import o from "./check-props.js";
|
|
8
|
+
import s from "./component.js";
|
|
9
|
+
import c, { useCallback as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
|
|
10
|
+
import m from "classnames";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
12
|
//#region components/tabs/index.tsx
|
|
11
|
-
|
|
13
|
+
var _ = (e, t) => e.props.value ?? String(t);
|
|
14
|
+
function v(e) {
|
|
12
15
|
return e.nodeName === "A" && e.getAttribute("role") === "tab" || e.nodeName === "LI" && (e.classList.contains("slds-tabs_default__item") || e.classList.contains("slds-tabs_scoped__item") || e.classList.contains("slds-vertical-tabs__nav-item"));
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function y(e) {
|
|
15
18
|
return !!(e.classList?.contains("slds-disabled") || e.getAttribute?.("aria-disabled") === "true");
|
|
16
19
|
}
|
|
17
|
-
function
|
|
20
|
+
function b(e) {
|
|
18
21
|
return !!e.props?.disabled;
|
|
19
22
|
}
|
|
20
|
-
var
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
var x = (x) => {
|
|
24
|
+
let { children: S, className: C, id: w, onSelect: T, selectedIndex: E, value: D, variant: O = "default" } = x, k = d(), A = w || k;
|
|
25
|
+
u(() => {
|
|
26
|
+
o(e, {
|
|
27
|
+
defaultSelectedIndex: x.defaultSelectedIndex,
|
|
28
|
+
selectedIndex: E,
|
|
29
|
+
value: D
|
|
30
|
+
}, s);
|
|
31
|
+
});
|
|
32
|
+
let [j, M] = p(!1), N = f([]), P = f(null), F = c.Children.toArray(S), I = F.length, L = D === void 0 ? Number.isInteger(E) ? E : -1 : F.findIndex((e, t) => _(e, t) === D), R = l((e) => {
|
|
33
|
+
for (let t = e + 1; t < I; t++) {
|
|
34
|
+
let e = N.current[t];
|
|
35
|
+
if (e && !b(e.tab)) return t;
|
|
25
36
|
}
|
|
26
37
|
for (let t = 0; t < e; t++) {
|
|
27
|
-
let e =
|
|
28
|
-
if (e && !
|
|
38
|
+
let e = N.current[t];
|
|
39
|
+
if (e && !b(e.tab)) return t;
|
|
29
40
|
}
|
|
30
41
|
return e;
|
|
31
|
-
}, [
|
|
42
|
+
}, [I]), z = l((e) => {
|
|
32
43
|
for (let t = e - 1; t >= 0; t--) {
|
|
33
|
-
let e =
|
|
34
|
-
if (e && !
|
|
44
|
+
let e = N.current[t];
|
|
45
|
+
if (e && !b(e.tab)) return t;
|
|
35
46
|
}
|
|
36
|
-
for (let t =
|
|
37
|
-
let e =
|
|
38
|
-
if (e && !
|
|
47
|
+
for (let t = I - 1; t > e; t--) {
|
|
48
|
+
let e = N.current[t];
|
|
49
|
+
if (e && !b(e.tab)) return t;
|
|
39
50
|
}
|
|
40
51
|
return e;
|
|
41
|
-
}, [
|
|
42
|
-
t < 0 || t >=
|
|
52
|
+
}, [I]), B = l((e, t, n) => {
|
|
53
|
+
if (t < 0 || t >= I || t === L) return;
|
|
54
|
+
let r = L >= 0 ? F[L] : void 0;
|
|
55
|
+
T?.(e, {
|
|
56
|
+
value: _(F[t], t),
|
|
57
|
+
previousValue: r ? _(r, L) : void 0,
|
|
43
58
|
selectedIndex: t,
|
|
44
|
-
previousIndex:
|
|
45
|
-
}),
|
|
59
|
+
previousIndex: L
|
|
60
|
+
}), M(n === !0);
|
|
46
61
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
]),
|
|
52
|
-
if (!
|
|
62
|
+
I,
|
|
63
|
+
T,
|
|
64
|
+
L,
|
|
65
|
+
F
|
|
66
|
+
]), V = l((e) => {
|
|
67
|
+
if (!v(e)) return !1;
|
|
53
68
|
let t = e.parentElement;
|
|
54
69
|
for (; t;) {
|
|
55
|
-
if (t ===
|
|
70
|
+
if (t === P.current) return !0;
|
|
56
71
|
if (t.getAttribute("data-tabs")) break;
|
|
57
72
|
t = t.parentElement;
|
|
58
73
|
}
|
|
59
74
|
return !1;
|
|
60
|
-
}, []),
|
|
75
|
+
}, []), H = l((e) => {
|
|
61
76
|
let t = e.target;
|
|
62
77
|
do {
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
78
|
+
if (V(t)) {
|
|
79
|
+
if (y(t)) return;
|
|
65
80
|
let n = t.parentNode;
|
|
66
81
|
n?.nodeName === "LI" && (t = n, n = t.parentNode);
|
|
67
82
|
let r = Array.from(n.children).indexOf(t);
|
|
68
|
-
|
|
83
|
+
B(e, r);
|
|
69
84
|
return;
|
|
70
85
|
}
|
|
71
86
|
t = t.parentNode;
|
|
72
87
|
} while (t !== null);
|
|
73
|
-
}, [
|
|
74
|
-
if (
|
|
75
|
-
let r =
|
|
76
|
-
e.keyCode === n.LEFT || e.keyCode === n.UP ? (r =
|
|
88
|
+
}, [V, B]), U = l((e) => {
|
|
89
|
+
if (V(e.target)) {
|
|
90
|
+
let r = L, i = !1;
|
|
91
|
+
e.keyCode === n.LEFT || e.keyCode === n.UP ? (r = z(r), i = !0) : (e.keyCode === n.RIGHT || e.keyCode === n.DOWN) && (r = R(r), i = !0), i && t.trap(e), B(e, r, !0);
|
|
77
92
|
}
|
|
78
93
|
}, [
|
|
94
|
+
V,
|
|
79
95
|
L,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
I
|
|
96
|
+
z,
|
|
97
|
+
R,
|
|
98
|
+
B
|
|
84
99
|
]);
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
id:
|
|
87
|
-
className:
|
|
88
|
-
"slds-tabs_default":
|
|
89
|
-
"slds-tabs_scoped":
|
|
90
|
-
"slds-vertical-tabs":
|
|
91
|
-
},
|
|
92
|
-
onClick:
|
|
93
|
-
onKeyDown:
|
|
100
|
+
return /* @__PURE__ */ g("div", {
|
|
101
|
+
id: A,
|
|
102
|
+
className: m({
|
|
103
|
+
"slds-tabs_default": O === "default",
|
|
104
|
+
"slds-tabs_scoped": O === "scoped",
|
|
105
|
+
"slds-vertical-tabs": O === "vertical"
|
|
106
|
+
}, C),
|
|
107
|
+
onClick: H,
|
|
108
|
+
onKeyDown: U,
|
|
94
109
|
"data-tabs": !0,
|
|
95
|
-
ref:
|
|
96
|
-
children: [/* @__PURE__ */
|
|
97
|
-
id:
|
|
98
|
-
variant:
|
|
99
|
-
children:
|
|
100
|
-
let n = `${
|
|
101
|
-
return /* @__PURE__ */
|
|
110
|
+
ref: P,
|
|
111
|
+
children: [/* @__PURE__ */ h(r, {
|
|
112
|
+
id: A,
|
|
113
|
+
variant: O,
|
|
114
|
+
children: F.map((e, t) => {
|
|
115
|
+
let n = `${A}-slds-tabs_tab-${t}`, r = `${A}-slds-tabs_panel-${t}`, a = L === t;
|
|
116
|
+
return /* @__PURE__ */ h(i, {
|
|
102
117
|
ref: (n) => {
|
|
103
|
-
|
|
118
|
+
N.current[t] = {
|
|
104
119
|
tab: e,
|
|
105
120
|
node: n
|
|
106
|
-
},
|
|
121
|
+
}, j && M(!1);
|
|
107
122
|
},
|
|
108
|
-
focus: a &&
|
|
123
|
+
focus: a && j,
|
|
109
124
|
selected: a,
|
|
110
125
|
id: n,
|
|
111
126
|
panelId: r,
|
|
112
127
|
disabled: e.props.disabled,
|
|
113
|
-
variant:
|
|
128
|
+
variant: O,
|
|
114
129
|
hasError: e.props.hasError,
|
|
115
130
|
assistiveText: e.props.assistiveText,
|
|
116
131
|
children: e.props.label
|
|
117
132
|
}, e.key ?? t);
|
|
118
133
|
})
|
|
119
|
-
}),
|
|
120
|
-
let n = `${
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
selected:
|
|
134
|
+
}), F.map((e, t) => {
|
|
135
|
+
let n = `${A}-slds-tabs_tab-${t}`, r = `${A}-slds-tabs_panel-${t}`;
|
|
136
|
+
return /* @__PURE__ */ h(a, {
|
|
137
|
+
selected: L === t,
|
|
123
138
|
id: r,
|
|
124
139
|
tabId: n,
|
|
125
|
-
variant:
|
|
140
|
+
variant: O,
|
|
126
141
|
children: e
|
|
127
142
|
}, e.key ?? t);
|
|
128
143
|
})]
|
|
129
144
|
});
|
|
130
145
|
};
|
|
131
|
-
|
|
146
|
+
x.displayName = e;
|
|
132
147
|
//#endregion
|
|
133
|
-
export {
|
|
148
|
+
export { x as default };
|
|
134
149
|
|
|
135
150
|
//# sourceMappingURL=index.js.map
|