@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`tabs`,t=`prod`,n=`Tabs`,r=[{component:`panel`,classKey:`TabsPanel`}],i={component:e,status:t,"display-name":`Tabs`,classKey:n,"last-accessibility-review":{"date-iso-8601":`2018/01/18`,"commit-sha":`ad6b6c6523ee21cada11be5f7ea4d99abc530726`},"SLDS-component-path":`/components/tabs`,dependencies:r,"site-stories":[{heading:`Default`,path:`/__examples__/default.jsx`},{heading:`Scoped`,path:`/__examples__/scoped.jsx`}],"url-slug":`tabs`};exports.classKey=n,exports.component=e,exports.default=i,exports.dependencies=r,exports.status=t;
|
|
2
|
+
//# sourceMappingURL=component.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.cjs","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":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/event.cjs"),r=require("../../utilities/key-code.cjs"),i=require("./private/tabs-list.cjs"),a=require("./private/tab.cjs"),o=require("./private/tab-panel.cjs");let
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/event.cjs"),r=require("../../utilities/key-code.cjs"),i=require("./private/tabs-list.cjs"),a=require("./private/tab.cjs"),o=require("./private/tab-panel.cjs"),s=require("./check-props.cjs"),c=require("./component.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=(e,t)=>e.props.value??String(t);function p(e){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`))}function m(e){return!!(e.classList?.contains(`slds-disabled`)||e.getAttribute?.(`aria-disabled`)===`true`)}function h(e){return!!e.props?.disabled}var g=e=>{let{children:g,className:_,id:v,onSelect:y,selectedIndex:b,value:x,variant:S=`default`}=e,C=(0,l.useId)(),w=v||C;(0,l.useEffect)(()=>{s.default(t.TABS,{defaultSelectedIndex:e.defaultSelectedIndex,selectedIndex:b,value:x},c.default)});let[T,E]=(0,l.useState)(!1),D=(0,l.useRef)([]),O=(0,l.useRef)(null),k=l.default.Children.toArray(g),A=k.length,j=x===void 0?Number.isInteger(b)?b:-1:k.findIndex((e,t)=>f(e,t)===x),M=(0,l.useCallback)(e=>{for(let t=e+1;t<A;t++){let e=D.current[t];if(e&&!h(e.tab))return t}for(let t=0;t<e;t++){let e=D.current[t];if(e&&!h(e.tab))return t}return e},[A]),N=(0,l.useCallback)(e=>{for(let t=e-1;t>=0;t--){let e=D.current[t];if(e&&!h(e.tab))return t}for(let t=A-1;t>e;t--){let e=D.current[t];if(e&&!h(e.tab))return t}return e},[A]),P=(0,l.useCallback)((e,t,n)=>{if(t<0||t>=A||t===j)return;let r=j>=0?k[j]:void 0;y?.(e,{value:f(k[t],t),previousValue:r?f(r,j):void 0,selectedIndex:t,previousIndex:j}),E(n===!0)},[A,y,j,k]),F=(0,l.useCallback)(e=>{if(!p(e))return!1;let t=e.parentElement;for(;t;){if(t===O.current)return!0;if(t.getAttribute(`data-tabs`))break;t=t.parentElement}return!1},[]),I=(0,l.useCallback)(e=>{let t=e.target;do{if(F(t)){if(m(t))return;let n=t.parentNode;n?.nodeName===`LI`&&(t=n,n=t.parentNode);let r=Array.from(n.children).indexOf(t);P(e,r);return}t=t.parentNode}while(t!==null)},[F,P]),L=(0,l.useCallback)(e=>{if(F(e.target)){let t=j,i=!1;e.keyCode===r.default.LEFT||e.keyCode===r.default.UP?(t=N(t),i=!0):(e.keyCode===r.default.RIGHT||e.keyCode===r.default.DOWN)&&(t=M(t),i=!0),i&&n.default.trap(e),P(e,t,!0)}},[F,j,N,M,P]);return(0,d.jsxs)(`div`,{id:w,className:(0,u.default)({"slds-tabs_default":S==="default","slds-tabs_scoped":S===`scoped`,"slds-vertical-tabs":S===`vertical`},_),onClick:I,onKeyDown:L,"data-tabs":!0,ref:O,children:[(0,d.jsx)(i.default,{id:w,variant:S,children:k.map((e,t)=>{let n=`${w}-slds-tabs_tab-${t}`,r=`${w}-slds-tabs_panel-${t}`,i=j===t;return(0,d.jsx)(a.default,{ref:n=>{D.current[t]={tab:e,node:n},T&&E(!1)},focus:i&&T,selected:i,id:n,panelId:r,disabled:e.props.disabled,variant:S,hasError:e.props.hasError,assistiveText:e.props.assistiveText,children:e.props.label},e.key??t)})}),k.map((e,t)=>{let n=`${w}-slds-tabs_tab-${t}`,r=`${w}-slds-tabs_panel-${t}`;return(0,d.jsx)(o.default,{selected:j===t,id:r,tabId:n,variant:S,children:e},e.key??t)})]})};g.displayName=t.TABS,exports.default=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/tabs/index.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\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/**\n * Tab child props (TabsPanel)\n */\nexport interface TabChildProps {\n\tlabel: ReactNode;\n\tdisabled?: boolean;\n\thasError?: boolean;\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\tchildren?: ReactNode;\n\tkey?: string | number;\n}\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection */\n\tpreviousIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport interface TabsProps {\n\t/** TabsPanel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Default selected tab index */\n\tdefaultSelectedIndex?: number;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is selected by click or keyboard. Receives the triggering event and\n\t * `{ selectedIndex, previousIndex }`. When `selectedIndex` is not passed, the selection always\n\t * changes; when it is passed (controlled), update it from this callback to change tabs.\n\t */\n\tonSelect?: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Currently selected tab index (controlled) */\n\tselectedIndex?: number;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabChildProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = ({\n\tchildren,\n\tclassName,\n\tdefaultSelectedIndex = 0,\n\tid: propId,\n\tonSelect,\n\tselectedIndex: controlledSelectedIndex,\n\tvariant = 'default',\n}: TabsProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst [internalSelectedIndex, setInternalSelectedIndex] =\n\t\tuseState(defaultSelectedIndex);\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabChildProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabChildProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Use controlled or internal state\n\tconst selectedIndex = Number.isInteger(controlledSelectedIndex)\n\t\t? controlledSelectedIndex!\n\t\t: internalSelectedIndex;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount) return;\n\n\t\t\tonSelect?.(event, { selectedIndex: index, previousIndex: selectedIndex });\n\n\t\t\tif (index !== internalSelectedIndex) {\n\t\t\t\tsetInternalSelectedIndex(index);\n\t\t\t\tsetFocus(shouldFocus === true);\n\t\t\t}\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, internalSelectedIndex]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.keyCode === KEYS.LEFT || event.keyCode === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.RIGHT ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN\n\t\t\t\t) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":"ofAgFA,SAAS,EAAU,EAA4B,CAC9C,OACE,EAAK,WAAa,KAAO,EAAK,aAAa,MAAM,IAAM,OACvD,EAAK,WAAa,OACjB,EAAK,UAAU,SAAS,yBAAyB,GACjD,EAAK,UAAU,SAAS,wBAAwB,GAChD,EAAK,UAAU,SAAS,8BAA8B,EAE1D,CAGA,SAAS,EAAkB,EAA4B,CAOtD,MAHA,GAHI,EAAK,WAAW,SAAS,eAAe,GAGxC,EAAK,eAAe,eAAe,IAAM,OAI9C,CAGA,SAAS,EAAc,EAAiD,CACvE,MAAO,EAAQ,EAAI,OAAO,QAC3B,CAKA,IAAM,GAAQ,CACb,WACA,YACA,uBAAuB,EACvB,GAAI,EACJ,WACA,cAAe,EACf,UAAU,aAC0B,CACpC,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,EAAK,GAAU,EAEf,CAAC,EAAuB,IAAA,EAC7B,EAAA,SAAA,CAAS,CAAoB,EACxB,CAAC,EAAO,IAAA,EAAY,EAAA,SAAA,CAAS,EAAK,EAClC,GAAA,EAAU,EAAA,OAAA,CAEd,CAAC,CAAC,EACE,GAAA,EAAc,EAAA,OAAA,CAAuB,IAAI,EAEzC,EAAa,EAAA,QAAM,SAAS,QACjC,CACD,EACM,EAAY,EAAW,OAGvB,EAAgB,OAAO,UAAU,CAAuB,EAC3D,EACA,EAEG,GAAA,EAAa,EAAA,YAAA,CACj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AAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAEC,IAAM,GAA6B,CAClC,EAAQ,QAAQ,GAAS,CAAE,IAAK,EAAO,MAAK,EACxC,GACH,EAAS,EAAK,CAEhB,EACA,MAXkB,GAAc,EAYhC,SAAU,EACV,GAAI,EACK,UACT,SAAU,EAAM,MAAM,SACb,UACT,SAAU,EAAM,MAAM,SACtB,cAAe,EAAM,MAAM,cAE1B,SAAA,EAAM,MAAM,KACT,EAjBC,EAAM,KAAO,CAiBd,CAEP,CAAC,CACQ,CAAA,EAIV,EAAW,KAAK,EAAO,IAAU,CAChC,IAAM,EAAQ,GAAG,EAAG,iBAAiB,IAC/B,EAAU,GAAG,EAAG,mBAAmB,IAGzC,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAEC,SALiB,IAAkB,EAMnC,GAAI,EACG,QACE,UAER,SAAA,CACQ,EAPJ,EAAM,KAAO,CAOT,CAEZ,CAAC,CAoBI,GAEP,EAEA,EAAK,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/tabs/index.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\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/**\n * Tab child props (TabsPanel)\n */\nexport interface TabChildProps {\n\tlabel: ReactNode;\n\tvalue?: string;\n\tdisabled?: boolean;\n\thasError?: boolean;\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\tchildren?: ReactNode;\n\tkey?: string | number;\n}\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/**\n\t * `value` of the tab being selected: the panel's `value`, or its index as a\n\t * string (`'0'`, `'1'`, ...) when the panel has no `value`.\n\t */\n\tvalue: string;\n\t/**\n\t * `value` of the tab that was selected before this selection, or `undefined`\n\t * when no tab was selected.\n\t */\n\tpreviousValue: string | undefined;\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection, or `-1` when no tab was selected */\n\tpreviousIndex: number;\n}\n\n/**\n * Props shared by both ways of controlling the selected tab\n */\ninterface TabsBaseProps {\n\t/** TabsPanel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is requested by click or arrow key. Receives the triggering event and\n\t * `{ value, previousValue, selectedIndex, previousIndex }`. Tabs is controlled: update `value`\n\t * from this callback to change tabs. It is not called for a disabled tab or for the tab that is\n\t * already selected.\n\t */\n\tonSelect: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n/**\n * Select the tab by the `value` of its `TabsPanel`.\n */\ninterface TabsValueProps {\n\t/**\n\t * `value` of the selected `TabsPanel` (required, controlled). A panel without a `value` is\n\t * matched by its index as a string (`'0'`, `'1'`, ...). When no panel matches, no tab is selected.\n\t */\n\tvalue: string;\n\tselectedIndex?: never;\n}\n\n/**\n * Select the tab by index (deprecated).\n */\ninterface TabsSelectedIndexProps {\n\tvalue?: undefined;\n\t/**\n\t * @deprecated Use `value` instead (set `value` on each `TabsPanel`, or use the index as a\n\t * string). Index of the selected tab, controlled. Used only when `value` is not passed.\n\t */\n\tselectedIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport type TabsProps = TabsBaseProps &\n\t(TabsValueProps | TabsSelectedIndexProps);\n\n// The value a panel is matched by: its `value`, or its index as a string.\nconst getPanelValue = (\n\tchild: React.ReactElement<TabChildProps>,\n\tindex: number\n): string => child.props.value ?? String(index);\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabChildProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = (props: TabsProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tid: propId,\n\t\tonSelect,\n\t\tselectedIndex: selectedIndexProp,\n\t\tvalue,\n\t\tvariant = 'default',\n\t} = props;\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tTABS,\n\t\t\t{\n\t\t\t\tdefaultSelectedIndex: (props as { defaultSelectedIndex?: number })\n\t\t\t\t\t.defaultSelectedIndex,\n\t\t\t\tselectedIndex: selectedIndexProp,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t});\n\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabChildProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabChildProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Selection is controlled: derived from `value`, or from the deprecated\n\t// `selectedIndex` when `value` is not passed. There is no internal copy.\n\tconst selectedIndex =\n\t\tvalue !== undefined\n\t\t\t? childArray.findIndex(\n\t\t\t\t\t(child, index) => getPanelValue(child, index) === value\n\t\t\t\t)\n\t\t\t: Number.isInteger(selectedIndexProp)\n\t\t\t\t? (selectedIndexProp as number)\n\t\t\t\t: -1;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount || index === selectedIndex) return;\n\n\t\t\tconst previous =\n\t\t\t\tselectedIndex >= 0 ? childArray[selectedIndex] : undefined;\n\t\t\tonSelect?.(event, {\n\t\t\t\tvalue: getPanelValue(childArray[index], index),\n\t\t\t\tpreviousValue: previous\n\t\t\t\t\t? getPanelValue(previous, selectedIndex)\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedIndex: index,\n\t\t\t\tpreviousIndex: selectedIndex,\n\t\t\t});\n\t\t\t// Focus follows the selection once the parent updates `value`.\n\t\t\tsetFocus(shouldFocus === true);\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, childArray]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.keyCode === KEYS.LEFT || event.keyCode === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.RIGHT ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN\n\t\t\t\t) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":"gjBA0HA,IAAM,GACL,EACA,IACY,EAAM,MAAM,O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AE,IAAK,EAAO,MAAK,EACxC,GACH,EAAS,EAAK,CAEhB,EACA,MAXkB,GAAc,EAYhC,SAAU,EACV,GAAI,EACK,UACT,SAAU,EAAM,MAAM,SACb,UACT,SAAU,EAAM,MAAM,SACtB,cAAe,EAAM,MAAM,cAE1B,SAAA,EAAM,MAAM,KACT,EAjBC,EAAM,KAAO,CAiBd,CAEP,CAAC,CACQ,CAAA,EAIV,EAAW,KAAK,EAAO,IAAU,CAChC,IAAM,EAAQ,GAAG,EAAG,iBAAiB,IAC/B,EAAU,GAAG,EAAG,mBAAmB,IAGzC,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAEC,SALiB,IAAkB,EAMnC,GAAI,EACG,QACE,UAER,SAAA,CACQ,EAPJ,EAAM,KAAO,CAOT,CAEZ,CAAC,CAoBI,GAEP,EAEA,EAAK,YAAc,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.cjs","names":[],"sources":["../../../../components/tabs/panel.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\nimport React, { type ReactNode } from 'react';\n\nimport { TABS_PANEL } from '../../utilities/constants';\n\nexport interface TabsPanelProps {\n\t/**\n\t * The string or element that is handed off to the `<Tab />` component, ends up being the title and the label for the tab associated with its tab panel.\n\t */\n\tlabel: ReactNode;\n\t/**\n\t * The `children` are the actual tab panels to be rendered. They get created by [tabs/index.jsx](./index.jsx) in the `renderTabPanels` function.\n\t *\n\t * Note that the `<TabsPanel />` component inserts a `div` element around the children, because React requires exactly one \"parent\" element returned. The `<TabPanel />` component simply dips down into `children` to get the children of this wrapping `div` so that it does not get rendered in the DOM.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Disables the `<Tab />` associated with this panel so it cannot be selected.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Show an icon on the `<Tab />` next to the title that can be used to communicate when a tab contains a validation error that needs attention\n\t */\n\thasError?: boolean;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `withErrorIcon`: This text is for the error icon that will be placed next to the `<Tab />` title\n\t */\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n}\n\n/**\n * The `<TabsPanel />` component allows us to simplify the structure of the `<Tabs />` component.\n\n * Rather than require different (deeply nested) children for tabslist, with its tab(s) as well as tabpanel(s), we provide this `TabsPanel` component which takes a `label` property that will become what is shown on the `<Tab />` that will be associated with it.\n\n * The `children` of the Panel will be fed to the `<TabPanel />` component, while its `label` is handled in `<Tab />`, via `<TabsList />`.\n *\n * ```\n * <TabsPanel label=\"Tab 1\">\n * \t<div>\n * \t\t<h2 className=\"slds-text-heading_medium\">This is my tab 1 contents!</h2>\n * \t\t<p>They show when you click the first tab.</p>\n * \t</div>\n * </TabsPanel>\n * ```\n */\nconst Panel = ({ children }: TabsPanelProps) => (\n\t<div>{React.Children.toArray(children)}</div>\n);\n\nPanel.displayName = TABS_PANEL;\n\nexport default Panel;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel.cjs","names":[],"sources":["../../../../components/tabs/panel.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\nimport React, { type ReactNode } from 'react';\n\nimport { TABS_PANEL } from '../../utilities/constants';\n\nexport interface TabsPanelProps {\n\t/**\n\t * The string or element that is handed off to the `<Tab />` component, ends up being the title and the label for the tab associated with its tab panel.\n\t */\n\tlabel: ReactNode;\n\t/**\n\t * Identifies this panel for the `value` prop of `<Tabs />` and the `value`/`previousValue` reported by its `onSelect`. When omitted, the panel is identified by its index as a string (`'0'`, `'1'`, ...). Rendered `id`s are always index-based.\n\t */\n\tvalue?: string;\n\t/**\n\t * The `children` are the actual tab panels to be rendered. They get created by [tabs/index.jsx](./index.jsx) in the `renderTabPanels` function.\n\t *\n\t * Note that the `<TabsPanel />` component inserts a `div` element around the children, because React requires exactly one \"parent\" element returned. The `<TabPanel />` component simply dips down into `children` to get the children of this wrapping `div` so that it does not get rendered in the DOM.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Disables the `<Tab />` associated with this panel so it cannot be selected.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Show an icon on the `<Tab />` next to the title that can be used to communicate when a tab contains a validation error that needs attention\n\t */\n\thasError?: boolean;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `withErrorIcon`: This text is for the error icon that will be placed next to the `<Tab />` title\n\t */\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n}\n\n/**\n * The `<TabsPanel />` component allows us to simplify the structure of the `<Tabs />` component.\n\n * Rather than require different (deeply nested) children for tabslist, with its tab(s) as well as tabpanel(s), we provide this `TabsPanel` component which takes a `label` property that will become what is shown on the `<Tab />` that will be associated with it.\n\n * The `children` of the Panel will be fed to the `<TabPanel />` component, while its `label` is handled in `<Tab />`, via `<TabsList />`.\n *\n * ```\n * <TabsPanel label=\"Tab 1\" value=\"tab-1\">\n * \t<div>\n * \t\t<h2 className=\"slds-text-heading_medium\">This is my tab 1 contents!</h2>\n * \t\t<p>They show when you click the first tab.</p>\n * \t</div>\n * </TabsPanel>\n * ```\n */\nconst Panel = ({ children }: TabsPanelProps) => (\n\t<div>{React.Children.toArray(children)}</div>\n);\n\nPanel.displayName = TABS_PANEL;\n\nexport default Panel;\n"],"mappings":"8KAwDA,IAAM,GAAS,CAAE,eAChB,EAAA,EAAA,IAAA,CAAC,MAAD,CAAA,SAAM,EAAA,QAAM,SAAS,QAAQ,CAAQ,CAAO,CAAA,EAG7C,EAAM,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/only-one-of-properties.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a,o){let s=t.default(o);r.default(i,{"labels.label":a.labels?.label??a.label,"assistiveText.label":a.assistiveText?.label},s()),typeof a.maxLength==`string`&&e.default(i,a.maxLength,`maxLength`,`\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s(`maxLength`)}`),n.default(i,a.errorText,`errorText`,"labels.error` and `hasError",s(`labels`)),n.default(i,a.label,`label`,`labels.label`,s(`labels`))});var a=i;exports.default=a;
|
|
1
|
+
const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/only-one-of-properties.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a,o){let s=t.default(o);r.default(i,{"labels.label":a.labels?.label??a.label,"assistiveText.label":a.assistiveText?.label},s()),e.default(i,a.defaultValue!==void 0,`defaultValue`,"Textarea is controlled: pass `value` and update it in `onChange`."),typeof a.maxLength==`string`&&e.default(i,a.maxLength,`maxLength`,`\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s(`maxLength`)}`),n.default(i,a.errorText,`errorText`,"labels.error` and `hasError",s(`labels`)),n.default(i,a.label,`label`,`labels.label`,s(`labels`))});var a=i;exports.default=a;
|
|
2
2
|
//# sourceMappingURL=check-props.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/textarea/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/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\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\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"+OAUA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,CACC,eAAgB,EAAM,QAAQ,OAAS,EAAM,MAC7C,sBAAuB,EAAM,eAAe,KAC7C,EACA,EAAa,CACd,EAEI,OAAO,EAAM,WAAc,UAC9B,EAAA,QACC,EACA,EAAM,UACN,YACA,gFAAgF,EAC/E,WACD,GACD,EAGD,EAAA,QACC,EACA,EAAM,UACN,YACA,8BACA,EAAa,QAAQ,CACtB,EACA,EAAA,QACC,EACA,EAAM,MACN,QACA,eACA,EAAa,QAAQ,CACtB,CACD,GAGD,IAAA,EAAe"}
|
|
1
|
+
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/textarea/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/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\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\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultValue !== undefined,\n\t\t\t'defaultValue',\n\t\t\t'Textarea is controlled: pass `value` and update it in `onChange`.'\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"+OAUA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,CACC,eAAgB,EAAM,QAAQ,OAAS,EAAM,MAC7C,sBAAuB,EAAM,eAAe,KAC7C,EACA,EAAa,CACd,EAEA,EAAA,QACC,EACA,EAAM,eAAiB,IAAA,GACvB,eACA,mEACD,EAEI,OAAO,EAAM,WAAc,UAC9B,EAAA,QACC,EACA,EAAM,UACN,YACA,gFAAgF,EAC/E,WACD,GACD,EAGD,EAAA,QACC,EACA,EAAM,UACN,YACA,8BACA,EAAa,QAAQ,CACtB,EACA,EAAA,QACC,EACA,EAAM,MACN,QACA,eACA,EAAa,QAAQ,CACtB,CACD,GAGD,IAAA,EAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/get-aria-props.cjs"),r=require("./check-props.cjs"),i=require("./component.cjs");let a=require("react"),o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=(0,a.forwardRef)((e,c)=>{let{assistiveText:l,autoFocus:u,children:d,className:f,classNameContainer:p,disabled:m,errorText:h,hasError:g,id:_,label:v,labels:y,maxLength:b,name:x,onBlur:S,onChange:C,onClick:w,onFocus:T,onInput:E,onInvalid:D,onKeyDown:O,onKeyPress:k,onKeyUp:A,onSelect:j,onSubmit:M,placeholder:N,required:P,role:F,value:I,defaultValue:L,wrap:R,...z}=e;r.default(t.TEXTAREA,{...e},i.default);let B=(0,a.useId)(),V=(0,a.useId)(),H=()=>_||B,U=()=>z[`aria-describedby`]||V,W=n.default(z),G=l?.label,K=y?.label??v,q=K||G,J=g??!!h,Y=J?y?.error??h:void 0;return(0,a.useEffect)(()=>{r.default(t.TEXTAREA,{assistiveText:l,errorText:h,label:v,labels:y},i.default)},[l,h,v,y]),(0,s.jsxs)(`div`,{className:(0,o.default)(`slds-form-element`,{"slds-has-error":J},p),children:[q&&(0,s.jsxs)(`label`,{className:(0,o.default)(`slds-form-element__label`,{"slds-assistive-text":G&&!K}),htmlFor:H(),children:[P&&(0,s.jsx)(`abbr`,{className:`slds-required`,title:`required`,children:`*`}),q]}),(0,s.jsx)(`div`,{className:`slds-form-element__control`,children:(0,s.jsx)(`textarea`,{className:(0,o.default)(`slds-textarea`,f),autoFocus:u,disabled:m,id:H(),maxLength:typeof b==`string`?parseInt(b,10):b,name:x,onBlur:S,onChange:C,onClick:w,onFocus:T,onInput:E,onInvalid:D,onKeyDown:O,onKeyPress:k,onKeyUp:A,onSelect:j,onSubmit:M,placeholder:N,ref:c,role:F,required:P,wrap:R,value:I,
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/get-aria-props.cjs"),r=require("./check-props.cjs"),i=require("./component.cjs");let a=require("react"),o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=(0,a.forwardRef)((e,c)=>{let{assistiveText:l,autoFocus:u,children:d,className:f,classNameContainer:p,disabled:m,errorText:h,hasError:g,id:_,label:v,labels:y,maxLength:b,name:x,onBlur:S,onChange:C,onClick:w,onFocus:T,onInput:E,onInvalid:D,onKeyDown:O,onKeyPress:k,onKeyUp:A,onSelect:j,onSubmit:M,placeholder:N,required:P,role:F,value:I,defaultValue:L,wrap:R,...z}=e;r.default(t.TEXTAREA,{...e},i.default);let B=(0,a.useId)(),V=(0,a.useId)(),H=()=>_||B,U=()=>z[`aria-describedby`]||V,W=n.default(z),G=l?.label,K=y?.label??v,q=K||G,J=g??!!h,Y=J?y?.error??h:void 0;return(0,a.useEffect)(()=>{r.default(t.TEXTAREA,{assistiveText:l,errorText:h,label:v,labels:y},i.default)},[l,h,v,y]),(0,s.jsxs)(`div`,{className:(0,o.default)(`slds-form-element`,{"slds-has-error":J},p),children:[q&&(0,s.jsxs)(`label`,{className:(0,o.default)(`slds-form-element__label`,{"slds-assistive-text":G&&!K}),htmlFor:H(),children:[P&&(0,s.jsx)(`abbr`,{className:`slds-required`,title:`required`,children:`*`}),q]}),(0,s.jsx)(`div`,{className:`slds-form-element__control`,children:(0,s.jsx)(`textarea`,{className:(0,o.default)(`slds-textarea`,f),autoFocus:u,disabled:m,id:H(),maxLength:typeof b==`string`?parseInt(b,10):b,name:x,onBlur:S,onChange:e=>{C?.(e,{value:e.target.value})},onClick:w,onFocus:T,onInput:E,onInvalid:D,onKeyDown:O,onKeyPress:k,onKeyUp:A,onSelect:j,onSubmit:M,placeholder:N,ref:c,role:F,required:P,wrap:R,value:I,"aria-describedby":Y?U():W[`aria-describedby`],...W})}),Y&&(0,s.jsx)(`div`,{id:U(),className:`slds-form-element__help`,children:Y}),d]})});c.displayName=t.TEXTAREA,exports.default=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/textarea/index.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\nimport {\n\tuseId,\n\tuseEffect,\n\tforwardRef,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n} from 'react';\nimport classNames from 'classnames';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { TEXTAREA } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Assistive text for Textarea\n */\nexport interface TextareaAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n}\n\n/**\n * Labels for Textarea\n */\nexport interface TextareaLabels {\n\t/** Error message shown below the textarea while `hasError` is true */\n\terror?: ReactNode;\n\t/** Visible label above the textarea */\n\tlabel?: ReactNode;\n}\n\n/**\n * Props for the Textarea component\n */\nexport interface TextareaProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `label`: Visually hidden label. Use instead of `labels.label`.\n\t */\n\tassistiveText?: TextareaAssistiveText;\n\t/** aria-activedescendant for composite widgets */\n\t'aria-activedescendant'?: string;\n\t/** aria-autocomplete for suggestions */\n\t'aria-autocomplete'?: string;\n\t/** aria-controls to relate with another region */\n\t'aria-controls'?: string;\n\t/** aria-describedby for descriptions */\n\t'aria-describedby'?: string;\n\t/** aria-expanded for collapsible content */\n\t'aria-expanded'?: boolean;\n\t/** aria-haspopup for popup menus */\n\t'aria-haspopup'?: boolean;\n\t/** aria-labelledby for labels */\n\t'aria-labelledby'?: string;\n\t/** aria-owns for related elements */\n\t'aria-owns'?: string;\n\t/** aria-required for form validation */\n\t'aria-required'?: boolean;\n\t/** Autofocus on load (poor UX) */\n\tautoFocus?: boolean;\n\t/** Elements added after textarea */\n\tchildren?: ReactNode;\n\t/** CSS class for textarea element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS class for container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** Disable the textarea */\n\tdisabled?: boolean;\n\t/** @deprecated Use `labels.error` and `hasError` instead. */\n\terrorText?: string;\n\t/** Puts the textarea in an error state and shows `labels.error` */\n\thasError?: boolean;\n\t/** Unique ID */\n\tid?: string;\n\t/** @deprecated Use `labels.label` instead. */\n\tlabel?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `error`: Error message shown below the textarea while `hasError` is true\n\t * * `label`: Visible label. Use `assistiveText.label` for a visually hidden label.\n\t */\n\tlabels?: TextareaLabels;\n\t/** Maximum character count */\n\tmaxLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLTextAreaElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Mark as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Controlled value */\n\tvalue?: string;\n\t/** Initial uncontrolled value */\n\tdefaultValue?: string;\n\t/** Text wrapping mode */\n\twrap?: 'soft' | 'hard';\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\n/**\n * A multi-line plain-text editing control.\n */\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tautoFocus,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tclassNameContainer,\n\t\t\tdisabled,\n\t\t\terrorText,\n\t\t\thasError: hasErrorProp,\n\t\t\tid: propId,\n\t\t\tlabel: labelProp,\n\t\t\tlabels,\n\t\t\tmaxLength,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\trole,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\twrap,\n\t\t\t...restProps\n\t\t} = props;\n\n\t\tcheckProps(TEXTAREA, { ...props }, componentDoc);\n\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\n\t\tconst getId = () => propId || generatedId;\n\t\tconst getErrorId = () => restProps['aria-describedby'] || generatedErrorId;\n\n\t\tconst ariaProps = getAriaProps(restProps);\n\n\t\tconst assistiveTextLabel = assistiveText?.label;\n\n\t\t// `label` is deprecated\n\t\tconst label = labels?.label ?? labelProp;\n\t\tconst labelText = label || assistiveTextLabel;\n\n\t\t// `errorText` is deprecated: it sets both the error state and the message\n\t\tconst hasError = hasErrorProp ?? !!errorText;\n\t\tconst errorMessage = hasError ? (labels?.error ?? errorText) : undefined;\n\n\t\tuseEffect(() => {\n\t\t\tcheckProps(\n\t\t\t\tTEXTAREA,\n\t\t\t\t{ assistiveText, errorText, label: labelProp, labels },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [assistiveText, errorText, labelProp, labels]);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t},\n\t\t\t\t\tclassNameContainer as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{labelText && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName={classNames('slds-form-element__label', {\n\t\t\t\t\t\t\t'slds-assistive-text': assistiveTextLabel && !label,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{required && (\n\t\t\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{labelText}\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclassName={classNames('slds-textarea', className as string)}\n\t\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tmaxLength={\n\t\t\t\t\t\t\t// Strings are still accepted at runtime for untyped callers; check-props warns.\n\t\t\t\t\t\t\ttypeof maxLength === 'string'\n\t\t\t\t\t\t\t\t? parseInt(maxLength, 10)\n\t\t\t\t\t\t\t\t: maxLength\n\t\t\t\t\t\t}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\twrap={wrap}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\terrorMessage\n\t\t\t\t\t\t\t\t? getErrorId()\n\t\t\t\t\t\t\t\t: ((ariaProps as Record<string, unknown>)[\n\t\t\t\t\t\t\t\t\t\t'aria-describedby'\n\t\t\t\t\t\t\t\t\t] as string | undefined)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{errorMessage && (\n\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nTextarea.displayName = TEXTAREA;\n\nexport default Textarea;\n"],"mappings":"iZAuIA,IAAM,GAAA,EAAW,EAAA,WAAA,EACf,EAAO,IAAQ,CACf,GAAM,CACL,gBACA,YACA,WACA,YACA,qBACA,WACA,YACA,SAAU,EACV,GAAI,EACJ,MAAO,EACP,SACA,YACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,OACA,QACA,eACA,OACA,GAAG,GACA,EAEJ,EAAA,QAAW,EAAA,SAAU,CAAE,GAAG,CAAM,EAAG,EAAA,OAAY,EAE/C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,GAAA,EAAmB,EAAA,MAAA,CAAM,EAEzB,MAAc,GAAU,EACxB,MAAmB,EAAU,qBAAuB,EAEpD,EAAY,EAAA,QAAa,CAAS,EAElC,EAAqB,GAAe,MAGpC,EAAQ,GAAQ,OAAS,EACzB,EAAY,GAAS,EAGrB,EAAW,GAAgB,CAAC,CAAC,EAC7B,EAAe,EAAY,GAAQ,OAAS,EAAa,IAAA,GAU/D,OARA,EAAA,EAAA,UAAA,KAAgB,CACf,EAAA,QACC,EAAA,SACA,CAAE,gBAAe,YAAW,MAAO,EAAW,QAAO,EACrD,EAAA,OACD,CACD,EAAG,CAAC,EAAe,EAAW,EAAW,CAAM,CAAC,GAG/C,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,oBACA,CACC,iBAAkB,CACnB,EACA,CACD,EAPD,SAAA,CASE,IACA,EAAA,EAAA,KAAA,CAAC,QAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,2BAA4B,CACjD,sBAAuB,GAAsB,CAAC,CAC/C,CAAC,EACD,QAAS,EAAM,EAJhB,SAAA,CAME,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gBAAgB,MAAM,WAAW,SAAA,GAE3C,CAAA,EAEN,CACK,KAER,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACd,UAAA,EAAA,EAAA,IAAA,CAAC,WAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,gBAAiB,CAAmB,EAC/C,YACD,WACV,GAAI,EAAM,EACV,UAEC,OAAO,GAAc,SAClB,SAAS,EAAW,EAAE,EACtB,EAEE,OACE,SACE,WACD,UACA,UACA,UACE,YACA,YACC,aACH,UACC,WACA,WACG,cACR,MACC,OACI,WACJ,OACC,QACO,eACd,mBACC,EACG,EAAW,EACT,EACF,oBAGJ,GAAI,CACJ,CAAA,CACG,CAAA,EACJ,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,EAAW,EAAG,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,CACG,GAEP,CACD,EAEA,EAAS,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/textarea/index.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\nimport {\n\tuseId,\n\tuseEffect,\n\tforwardRef,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n} from 'react';\nimport classNames from 'classnames';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { TEXTAREA } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Assistive text for Textarea\n */\nexport interface TextareaAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n}\n\n/**\n * Labels for Textarea\n */\nexport interface TextareaLabels {\n\t/** Error message shown below the textarea while `hasError` is true */\n\terror?: ReactNode;\n\t/** Visible label above the textarea */\n\tlabel?: ReactNode;\n}\n\n/**\n * Data passed to `onChange`\n */\nexport interface TextareaChangeData {\n\t/** The new text */\n\tvalue: string;\n}\n\n/**\n * Props removed in v11. They are ignored at runtime and warn in development.\n */\ninterface TextareaRemovedProps {\n\t/** @removed Textarea is controlled: pass `value` and update it in `onChange`. */\n\tdefaultValue?: unknown;\n}\n\n/**\n * Props for the Textarea component\n */\nexport interface TextareaProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `label`: Visually hidden label. Use instead of `labels.label`.\n\t */\n\tassistiveText?: TextareaAssistiveText;\n\t/** aria-activedescendant for composite widgets */\n\t'aria-activedescendant'?: string;\n\t/** aria-autocomplete for suggestions */\n\t'aria-autocomplete'?: string;\n\t/** aria-controls to relate with another region */\n\t'aria-controls'?: string;\n\t/** aria-describedby for descriptions */\n\t'aria-describedby'?: string;\n\t/** aria-expanded for collapsible content */\n\t'aria-expanded'?: boolean;\n\t/** aria-haspopup for popup menus */\n\t'aria-haspopup'?: boolean;\n\t/** aria-labelledby for labels */\n\t'aria-labelledby'?: string;\n\t/** aria-owns for related elements */\n\t'aria-owns'?: string;\n\t/** aria-required for form validation */\n\t'aria-required'?: boolean;\n\t/** Autofocus on load (poor UX) */\n\tautoFocus?: boolean;\n\t/** Elements added after textarea */\n\tchildren?: ReactNode;\n\t/** CSS class for textarea element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS class for container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** Disable the textarea */\n\tdisabled?: boolean;\n\t/** @deprecated Use `labels.error` and `hasError` instead. */\n\terrorText?: string;\n\t/** Puts the textarea in an error state and shows `labels.error` */\n\thasError?: boolean;\n\t/** Unique ID */\n\tid?: string;\n\t/** @deprecated Use `labels.label` instead. */\n\tlabel?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `error`: Error message shown below the textarea while `hasError` is true\n\t * * `label`: Visible label. Use `assistiveText.label` for a visually hidden label.\n\t */\n\tlabels?: TextareaLabels;\n\t/** Maximum character count */\n\tmaxLength?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/**\n\t * Called when the text changes. Textarea is controlled: update `value` from\n\t * `data.value`, or the text won't change.\n\t */\n\tonChange: (\n\t\tevent: ChangeEvent<HTMLTextAreaElement>,\n\t\tdata: TextareaChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLTextAreaElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLTextAreaElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Mark as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** The text in the textarea. Required: Textarea is controlled. */\n\tvalue: string;\n\t/** Text wrapping mode */\n\twrap?: 'soft' | 'hard';\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\n/**\n * A multi-line plain-text editing control.\n */\nconst Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tautoFocus,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tclassNameContainer,\n\t\t\tdisabled,\n\t\t\terrorText,\n\t\t\thasError: hasErrorProp,\n\t\t\tid: propId,\n\t\t\tlabel: labelProp,\n\t\t\tlabels,\n\t\t\tmaxLength,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\trole,\n\t\t\tvalue,\n\t\t\t// Removed in v11: destructured so it doesn't reach the DOM. check-props warns.\n\t\t\tdefaultValue: _defaultValue,\n\t\t\twrap,\n\t\t\t...restProps\n\t\t} = props as TextareaProps & TextareaRemovedProps;\n\n\t\tcheckProps(TEXTAREA, { ...props }, componentDoc);\n\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\n\t\tconst getId = () => propId || generatedId;\n\t\tconst getErrorId = () => restProps['aria-describedby'] || generatedErrorId;\n\n\t\tconst ariaProps = getAriaProps(restProps);\n\n\t\tconst assistiveTextLabel = assistiveText?.label;\n\n\t\t// `label` is deprecated\n\t\tconst label = labels?.label ?? labelProp;\n\t\tconst labelText = label || assistiveTextLabel;\n\n\t\t// `errorText` is deprecated: it sets both the error state and the message\n\t\tconst hasError = hasErrorProp ?? !!errorText;\n\t\tconst errorMessage = hasError ? (labels?.error ?? errorText) : undefined;\n\n\t\tuseEffect(() => {\n\t\t\tcheckProps(\n\t\t\t\tTEXTAREA,\n\t\t\t\t{ assistiveText, errorText, label: labelProp, labels },\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}, [assistiveText, errorText, labelProp, labels]);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t},\n\t\t\t\t\tclassNameContainer as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{labelText && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName={classNames('slds-form-element__label', {\n\t\t\t\t\t\t\t'slds-assistive-text': assistiveTextLabel && !label,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{required && (\n\t\t\t\t\t\t\t<abbr className=\"slds-required\" title=\"required\">\n\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{labelText}\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclassName={classNames('slds-textarea', className as string)}\n\t\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tmaxLength={\n\t\t\t\t\t\t\t// Strings are still accepted at runtime for untyped callers; check-props warns.\n\t\t\t\t\t\t\ttypeof maxLength === 'string'\n\t\t\t\t\t\t\t\t? parseInt(maxLength, 10)\n\t\t\t\t\t\t\t\t: maxLength\n\t\t\t\t\t\t}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\tonChange?.(event, { value: event.target.value });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\twrap={wrap}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\terrorMessage\n\t\t\t\t\t\t\t\t? getErrorId()\n\t\t\t\t\t\t\t\t: ((ariaProps as Record<string, unknown>)[\n\t\t\t\t\t\t\t\t\t\t'aria-describedby'\n\t\t\t\t\t\t\t\t\t] as string | undefined)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{errorMessage && (\n\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nTextarea.displayName = TEXTAREA;\n\nexport default Textarea;\n"],"mappings":"iZA2JA,IAAM,GAAA,EAAW,EAAA,WAAA,EACf,EAAO,IAAQ,CACf,GAAM,CACL,gBACA,YACA,WACA,YACA,qBACA,WACA,YACA,SAAU,EACV,GAAI,EACJ,MAAO,EACP,SACA,YACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,OACA,QAEA,aAAc,EACd,OACA,GAAG,GACA,EAEJ,EAAA,QAAW,EAAA,SAAU,CAAE,GAAG,CAAM,EAAG,EAAA,OAAY,EAE/C,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,GAAA,EAAmB,EAAA,MAAA,CAAM,EAEzB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,CAAC,MAAD,CAAK,GAAI,EAAW,EAAG,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,CACG,GAEP,CACD,EAEA,EAAS,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/class-names.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=class extends r.default.Component{static displayName=t.TOAST_CONTAINER;render(){return(0,i.jsx)(`div`,{className:n.default(`slds-
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/class-names.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=class extends r.default.Component{static displayName=t.TOAST_CONTAINER;render(){return(0,i.jsx)(`div`,{className:n.default(`slds-notify_container`,this.props.className),children:this.props.children})}};exports.default=a;
|
|
2
2
|
//# sourceMappingURL=container.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.cjs","names":[],"sources":["../../../../components/toast/container.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// # Toast Container Component\n\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { TOAST_CONTAINER } from '../../utilities/constants';\n\nexport interface ToastContainerProps {\n\t/**\n\t * CSS classes to be added to tag with `.slds-
|
|
1
|
+
{"version":3,"file":"container.cjs","names":[],"sources":["../../../../components/toast/container.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// # Toast Container Component\n\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { TOAST_CONTAINER } from '../../utilities/constants';\n\nexport interface ToastContainerProps {\n\t/**\n\t * CSS classes to be added to tag with `.slds-notify_container`. Uses `classNames` [API](https://github.com/JedWatson/classnames).\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Toast components\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * A fixed container for toast banners.\n */\n\nclass ToastContainer extends React.Component<ToastContainerProps> {\n\tstatic displayName = TOAST_CONTAINER;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-notify_container',\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.props.children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default ToastContainer;\n"],"mappings":"2NAwBA,IAAM,EAAN,cAA6B,EAAA,QAAM,SAA+B,CACjE,OAAO,YAAc,EAAA,gBAErB,QAAS,CACR,OACC,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,UAAW,EAAA,QACV,wBACA,KAAK,MAAM,SACZ,EAEC,SAAA,KAAK,MAAM,QACR,CAAA,CAEP,CACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/event.cjs"),i=require("../../utilities/generate-id.cjs"),a=require("../utilities/dialog/index.cjs"),o=require("../icon/index.cjs"),
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/event.cjs"),i=require("../../utilities/hooks/use-controllable-state.cjs"),ee=require("../../utilities/generate-id.cjs"),a=require("../utilities/dialog/index.cjs"),o=require("../icon/index.cjs"),te=require("./check-props.cjs"),s=require("./component.cjs"),ne=require("../button/index.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d={tooltipTipLearnMoreIcon:`this link`,triggerLearnMoreIcon:`Help`},f={learnMoreAfter:`to learn more.`,learnMoreBefore:`Click`},p=({align:e=`top`,assistiveText:p,children:m,content:h=(0,u.jsx)(`span`,{children:`Tooltip`}),dialogClassName:g,hasAnchoredNubbin:_=!1,hasStaticAlignment:v=!1,hoverCloseDelay:y=50,hoverOpenDelay:b=0,iconVariant:x=`bare`,id:S,labels:re,isOpen:C,defaultIsOpen:w=!1,onRequestOpen:T,onRequestClose:E,onRequestTargetElement:D,onClickTrigger:O,triggerClassName:k,position:A=`absolute`,triggerStyle:j,theme:M=`info`,variant:N=`base`})=>{let P={...d,...p},F={...f,...re},I=(0,c.useContext)(n.IconSettingsContext),[L,R]=i.useControllableState(C,w),[z,ie]=(0,c.useState)(!1),B=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)(ee.default()),U=(0,c.useRef)(!1),W=(0,c.useRef)(L);(0,c.useEffect)(()=>{W.current=L},[L]),(0,c.useEffect)(()=>{te.default(t.POPOVER_TOOLTIP,{align:e,assistiveText:P,children:m,content:h,dialogClassName:g,hasAnchoredNubbin:_,hasStaticAlignment:v,hoverCloseDelay:y,hoverOpenDelay:b,iconVariant:x,id:S,labels:F,isOpen:C,onRequestTargetElement:D,onClickTrigger:O,triggerClassName:k,position:A,triggerStyle:j,theme:M,variant:N},s.default)},[]),(0,c.useEffect)(()=>()=>{U.current=!0,V.current&&clearTimeout(V.current)},[]);let G=(0,c.useCallback)(()=>S||H.current,[S]),K=(0,c.useCallback)(()=>L,[L]),q=(0,c.useCallback)(()=>D?D():B.current,[D]),J=()=>{V.current&&clearTimeout(V.current)},Y=(0,c.useCallback)((e,t)=>{U.current||W.current||(T?.(e,{trigger:t}),R(!0))},[T,R]),X=(0,c.useCallback)((e,t)=>{U.current||!W.current||(E?.(e,{trigger:t}),R(!1))},[E,R]),ae=(0,c.useCallback)((e,t)=>{J(),!t?.componentWillUnmount&&X(e,e?`blur`:`clickOutside`)},[X]),oe=(0,c.useCallback)(e=>{J(),X(e,`mouseLeave`)},[X]),Z=(0,c.useCallback)((e,t)=>{J(),V.current=setTimeout(()=>{Y(e,t)},b)},[b,Y]),se=(0,c.useCallback)(e=>Z(e,`mouseEnter`),[Z]),ce=(0,c.useCallback)(e=>Z(e,`focus`),[Z]),Q=(0,c.useCallback)((e,t)=>{e.stopPropagation(),J(),V.current=setTimeout(()=>{let n=e.relatedTarget;n?.classList?.contains(`slds-popover_tooltip`)||n?.classList?.contains(`slds-popover__body`)||X(e,t)},y)},[y,X]),le=(0,c.useCallback)(e=>Q(e,`mouseLeave`),[Q]),ue=(0,c.useCallback)(e=>Q(e,`blur`),[Q]),de=(0,c.useCallback)(e=>{e.stopPropagation(),V.current=setTimeout(()=>{e.key===`Escape`&&X(e,`cancel`)},y)},[y,X]),$=(0,c.useCallback)(e=>{e&&B.current!==e&&(B.current=e,z||ie(!0))},[z]),fe=()=>{if(!_)return null;let t=e.split(` `)[0],n={height:`0`,position:`relative`,width:`0`},r={backgroundColor:`#16325c`,content:`""`,height:`1rem`,position:`absolute`,transform:`rotate(45deg)`,width:`1rem`},i={height:B.current?B.current.getBoundingClientRect().height:0,width:B.current?B.current.getBoundingClientRect().width:0};switch(t){case`bottom`:n.left=`${i.width/2}px`,n.top=`${i.height}px`,r.left=`-8px`,r.top=`3px`;break;case`left`:n.left=`0`,n.top=`${i.height/2}px`,r.left=`-19px`,r.top=`-9px`;break;case`right`:n.left=`${i.width}px`,n.top=`${i.height/2}px`,r.left=`3px`,r.top=`-9px`;break;default:n.left=`${i.width/2}px`,n.top=`0`,r.left=`-8px`,r.top=`-19px`}return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`style`,{children:`#${G()}:after, #${G()}:before {
|
|
2
2
|
display: none;
|
|
3
|
-
}`}),K()?(0,
|
|
3
|
+
}`}),K()?(0,u.jsx)(`div`,{style:n,children:(0,u.jsx)(`div`,{style:r})}):null]})},pe=()=>{let e,t=c.default.Children.count(m)===0,n=x===`inverse`,i=x===`error`||x===`warning`?x:void 0;return e=t&&O?(0,u.jsx)(`a`,{href:`#`,onClick:r.default.trappedHandler(O),children:(0,u.jsx)(o.default,{category:`utility`,colorVariant:i,inverse:n,name:`info`,assistiveText:{label:P.triggerLearnMoreIcon},size:`x-small`})}):t?(0,u.jsx)(ne.default,{"aria-disabled":!0,assistiveText:{icon:P.triggerLearnMoreIcon},iconCategory:`utility`,iconClassName:i&&`slds-icon-text-${i}`,iconName:`info`,iconVariant:n?`bare`:void 0,inverse:n,variant:`icon`}):m,c.default.Children.map(e,(e,t)=>c.default.isValidElement(e)?c.default.cloneElement(e,{key:t,"aria-describedby":K()?G():void 0,onBlur:ue,onFocus:ce,onMouseEnter:se,onMouseLeave:le,onKeyDown:de}):e)},me=()=>(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-popover__body`,{"slds-text-color_inverse":M===`error`}),children:[h,N===`learnMore`&&O?(0,u.jsxs)(`div`,{className:`slds-m-top_x-small`,"aria-hidden":`true`,children:[F.learnMoreBefore,` `,(0,u.jsx)(o.default,{assistiveText:{label:P.tooltipTipLearnMoreIcon},category:`utility`,inverse:!0,name:`info`,size:`x-small`}),` `,F.learnMoreAfter,` `]}):null]}),he=()=>K()?(0,u.jsx)(a.default,{closeOnTabKey:!0,hasNubbin:!0,contentsClassName:(0,l.default)(`slds-popover`,`slds-popover_tooltip`,{"slds-theme_error":M===`error`},g),align:e,context:I,hasStaticAlignment:v,onClose:ae,onRequestTargetElement:q,onMouseLeave:oe,position:A,variant:`tooltip`,containerProps:{id:G()},children:me()}):(0,u.jsx)(`span`,{}),ge={display:`inline-block`,lineHeight:`1`,...j};return(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-tooltip-trigger`,k),style:ge,ref:$,children:[fe(),pe(),he()]})};p.displayName=t.POPOVER_TOOLTIP,exports.default=p;
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/tooltip/index.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// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Forces tooltip to be open. A value of `false` will disable any interaction with the tooltip.\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn isOpenProp === undefined ? isOpenState : isOpenProp;\n\t}, [isOpenProp, isOpenState]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Event handlers\n\tconst handleCancel = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\tsetIsOpenState(false);\n\t}, []);\n\n\tconst handleMouseEnter = useCallback(() => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\n\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\tif (!isUnmountingRef.current) {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t}, hoverOpenDelay);\n\t}, [hoverOpenDelay]);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isUnmountingRef.current && !isHoveringTooltip) {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (!isUnmountingRef.current && e.key === 'Escape') {\n\t\t\t\t\tsetIsOpenState(false);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: () => void;\n\t\t\t\t\tonMouseEnter?: () => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleMouseLeave,\n\t\t\t\t\tonFocus: handleMouseEnter,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\tconst isErrorTheme = theme === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\tconst isOpen = getIsOpen();\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error',\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleCancel}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleCancel}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPOVER_TOOLTIP;\n\nexport default Tooltip;\n"],"mappings":"6lBAoKA,IAAM,EAA6C,CAClD,wBAAyB,YACzB,qBAAsB,MACvB,EAEM,EAA+B,CACpC,eAAgB,iBAChB,gBAAiB,OAClB,EAOM,GAAW,CAChB,QAAQ,MACR,cAAe,EACf,WACA,WAAU,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAM,SAAa,CAAA,EAC7B,kBACA,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,EACjB,cAAc,OACd,GAAI,EACJ,OAAQ,EACR,OAAQ,EACR,yBACA,iBACA,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,CAAC,OAAD,CAAO,CAAA,EAIH,GAAiC,CACtC,QAAS,eACT,WAAY,IACZ,GAAG,CACJ,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,uBAAwB,CAAgB,EAC9D,MAAO,GACP,IAAK,EAHN,SAAA,CAKE,EAAwB,EACxB,GAAW,EACX,GAAW,CACR,GAEP,EAEA,EAAQ,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/tooltip/index.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// # Tooltip\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseContext,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\n\nimport EventUtil from '../../utilities/event';\nimport { useControllableState } from '../../utilities/hooks';\nimport { POPOVER_TOOLTIP } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport Dialog from '../utilities/dialog';\nimport Icon from '../icon';\n// eslint-disable-next-line import/no-cycle\nimport Button from '../button';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ### Types\n\nexport type TooltipAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\nexport type TooltipTheme = 'info' | 'error';\n\nexport type TooltipIconVariant = 'bare' | 'error' | 'inverse' | 'warning';\n\nexport type TooltipVariant = 'base' | 'learnMore' | 'list-item';\n\nexport interface TooltipAssistiveText {\n\t/** This text is inside the info icon within the tooltip content and exists to \"complete the sentence\" for assistive tech users. */\n\ttooltipTipLearnMoreIcon?: string;\n\t/** This text is inside the info icon that triggers the tooltip in order to have text within the link. */\n\ttriggerLearnMoreIcon?: string;\n}\n\nexport interface TooltipLabels {\n\t/** This label appears in the tooltip after the info icon. */\n\tlearnMoreAfter?: string;\n\t/** This label appears in the tooltip before the info icon. */\n\tlearnMoreBefore?: string;\n}\n\n/**\n * What caused `onRequestOpen` to fire:\n * * `focus`: the trigger received focus\n * * `mouseEnter`: the mouse entered the trigger\n */\nexport type TooltipRequestOpenTrigger = 'focus' | 'mouseEnter';\n\n/**\n * Data passed to `onRequestOpen`\n */\nexport interface TooltipRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: TooltipRequestOpenTrigger;\n}\n\n/**\n * What caused `onRequestClose` to fire:\n * * `blur`: focus left the trigger (including Tab from the tooltip)\n * * `cancel`: Escape was pressed on the trigger\n * * `clickOutside`: a click landed outside the tooltip\n * * `mouseLeave`: the mouse left the trigger or the tooltip\n */\nexport type TooltipRequestCloseTrigger =\n\t'blur' | 'cancel' | 'clickOutside' | 'mouseLeave';\n\n/**\n * Data passed to `onRequestClose`\n */\nexport interface TooltipRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: TooltipRequestCloseTrigger;\n}\n\nexport interface TooltipProps {\n\t/**\n\t * Alignment of the Tooltip relative to the element that triggers it.\n\t */\n\talign?: TooltipAlign;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t */\n\tassistiveText?: TooltipAssistiveText;\n\t/**\n\t * Pass the one element that triggers the Tooltip as a child. It must be an element with `tabIndex` or an element that already has a `tabIndex` set such as an anchor or a button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Content inside Tooltip.\n\t */\n\tcontent?: ReactNode;\n\t/**\n\t * CSS classes to be added to the popover dialog. That is the element with `.slds-popover` on it.\n\t */\n\tdialogClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Enabling this hides the default nubbin, replacing it with one attached directly to the tooltip trigger.\n\t */\n\thasAnchoredNubbin?: boolean;\n\t/**\n\t * By default, dialogs will flip their alignment if they extend beyond a boundary element.\n\t * `hasStaticAlignment` disables this behavior.\n\t */\n\thasStaticAlignment?: boolean;\n\t/**\n\t * Styles the default info icon trigger that renders when no children are passed. Matches `icon-variant` on `lightning-helptext`.\n\t * * `bare` - (default) Default icon color.\n\t * * `error` - Red icon, to call out an error.\n\t * * `inverse` - White icon, for dark backgrounds.\n\t * * `warning` - Yellow icon, to advise caution.\n\t */\n\ticonVariant?: TooltipIconVariant;\n\t/**\n\t * Delay on Tooltip closing in milliseconds. Defaults to 50\n\t */\n\thoverCloseDelay?: number;\n\t/**\n\t * Delay on Tooltip opening in milliseconds. Defaults to 0\n\t */\n\thoverOpenDelay?: number;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering element.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t */\n\tlabels?: TooltipLabels;\n\t/**\n\t * Open state when the tooltip is controlled. When set, the tooltip only opens and closes when this\n\t * prop changes: `isOpen={false}` keeps it closed and `isOpen={true}` keeps it open, whatever the\n\t * user does. Handle `onRequestOpen`/`onRequestClose` to update it. Leave it `undefined` for an\n\t * uncontrolled tooltip that opens on hover and focus (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Initial open state of an uncontrolled tooltip (`isOpen` is `undefined`). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Called when the tooltip requests to open (hover after `hoverOpenDelay`, or focus), controlled or\n\t * not. `data.trigger` says why. A controlled tooltip opens only if the parent sets `isOpen` to `true`.\n\t */\n\tonRequestOpen?: (\n\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\tdata: TooltipRequestOpenData\n\t) => void;\n\t/**\n\t * Called when the tooltip requests to close (mouse leave, blur, Escape, click outside), controlled\n\t * or not. `data.trigger` says why. `event` is `undefined` for `clickOutside`. A controlled tooltip\n\t * closes only if the parent sets `isOpen` to `false`.\n\t */\n\tonRequestClose?: (\n\t\tevent:\n\t\t\t| MouseEvent<HTMLElement>\n\t\t\t| FocusEvent<HTMLElement>\n\t\t\t| KeyboardEvent<HTMLElement>\n\t\t\t| undefined,\n\t\tdata: TooltipRequestCloseData\n\t) => void;\n\t/**\n\t * Callback that returns an element or React `ref` to align the Tooltip with.\n\t */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/**\n\t * Callback when the info icon in learn more variant is clicked\n\t */\n\tonClickTrigger?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t/**\n\t * CSS classes to be added to tag with `slds-tooltip-trigger`.\n\t */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents.\n\t * * `relative` - No styling or portals will be used.\n\t */\n\tposition?: TooltipPosition;\n\t/**\n\t * Custom styles to be added to wrapping triggering `div`.\n\t */\n\ttriggerStyle?: CSSProperties;\n\t/**\n\t * Determines the theme of tooltip: for informative purpose (blue background) or warning purpose (red background).\n\t */\n\ttheme?: TooltipTheme;\n\t/**\n\t * Determines the type of the tooltip.\n\t */\n\tvariant?: TooltipVariant;\n}\n\nconst defaultAssistiveText: TooltipAssistiveText = {\n\ttooltipTipLearnMoreIcon: 'this link',\n\ttriggerLearnMoreIcon: 'Help',\n};\n\nconst defaultLabels: TooltipLabels = {\n\tlearnMoreAfter: 'to learn more.',\n\tlearnMoreBefore: 'Click',\n};\n\n/**\n * The PopoverTooltip component is variant of the Lightning Design System Popover component.\n * This component wraps an element that triggers it to open. It must be a focusable child element\n * (either a button or an anchor), so that keyboard users can navigate to it.\n */\nconst Tooltip = ({\n\talign = 'top',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tcontent = <span>Tooltip</span>,\n\tdialogClassName,\n\thasAnchoredNubbin = false,\n\thasStaticAlignment = false,\n\thoverCloseDelay = 50,\n\thoverOpenDelay = 0,\n\ticonVariant = 'bare',\n\tid: idProp,\n\tlabels: labelsProp,\n\tisOpen: isOpenProp,\n\tdefaultIsOpen = false,\n\tonRequestOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\tonClickTrigger,\n\ttriggerClassName,\n\tposition = 'absolute',\n\ttriggerStyle,\n\ttheme = 'info',\n\tvariant = 'base',\n}: TooltipProps): React.ReactElement => {\n\t// Merge assistive text and labels with defaults\n\tconst assistiveText = { ...defaultAssistiveText, ...assistiveTextProp };\n\tconst labels = { ...defaultLabels, ...labelsProp };\n\n\t// Context\n\tconst iconSettings = useContext(IconSettingsContext);\n\n\t// State\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst tooltipTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst generatedIdRef = useRef(generateId());\n\tconst isUnmountingRef = useRef(false);\n\t// Latest open state, read by the hover/blur/Escape timers\n\tconst isOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tisOpenRef.current = isOpen;\n\t}, [isOpen]);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tPOPOVER_TOOLTIP,\n\t\t\t{\n\t\t\t\talign,\n\t\t\t\tassistiveText,\n\t\t\t\tchildren,\n\t\t\t\tcontent,\n\t\t\t\tdialogClassName,\n\t\t\t\thasAnchoredNubbin,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thoverCloseDelay,\n\t\t\t\thoverOpenDelay,\n\t\t\t\ticonVariant,\n\t\t\t\tid: idProp,\n\t\t\t\tlabels,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tonRequestTargetElement,\n\t\t\t\tonClickTrigger,\n\t\t\t\ttriggerClassName,\n\t\t\t\tposition,\n\t\t\t\ttriggerStyle,\n\t\t\t\ttheme,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (tooltipTimeoutRef.current) {\n\t\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Get computed values\n\tconst getId = useCallback(() => {\n\t\treturn idProp || generatedIdRef.current;\n\t}, [idProp]);\n\n\tconst getIsOpen = useCallback(() => isOpen, [isOpen]);\n\n\tconst getTooltipTarget = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\treturn onRequestTargetElement();\n\t\t}\n\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Event handlers\n\tconst clearTooltipTimeout = () => {\n\t\tif (tooltipTimeoutRef.current) {\n\t\t\tclearTimeout(tooltipTimeoutRef.current);\n\t\t}\n\t};\n\n\tconst requestOpen = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestOpenTrigger\n\t\t) => {\n\t\t\tif (isUnmountingRef.current || isOpenRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonRequestOpen?.(event, { trigger });\n\t\t\tsetIsOpen(true);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst requestClose = useCallback(\n\t\t(\n\t\t\tevent:\n\t\t\t\t| MouseEvent<HTMLElement>\n\t\t\t\t| FocusEvent<HTMLElement>\n\t\t\t\t| KeyboardEvent<HTMLElement>\n\t\t\t\t| undefined,\n\t\t\ttrigger: TooltipRequestCloseTrigger\n\t\t) => {\n\t\t\tif (isUnmountingRef.current || !isOpenRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonRequestClose?.(event, { trigger });\n\t\t\tsetIsOpen(false);\n\t\t},\n\t\t[onRequestClose, setIsOpen]\n\t);\n\n\t// Called by the Dialog on click outside, Tab and unmount\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent?: KeyboardEvent<HTMLElement>,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tclearTooltipTimeout();\n\t\t\t// The dialog unmounts because the tooltip already closed: nothing to request\n\t\t\tif (data?.componentWillUnmount) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestClose(event, event ? 'blur' : 'clickOutside');\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst handleDialogMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tclearTooltipTimeout();\n\t\t\trequestClose(event as MouseEvent<HTMLElement>, 'mouseLeave');\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst scheduleOpen = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestOpenTrigger\n\t\t) => {\n\t\t\tclearTooltipTimeout();\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\trequestOpen(event, trigger);\n\t\t\t}, hoverOpenDelay);\n\t\t},\n\t\t[hoverOpenDelay, requestOpen]\n\t);\n\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent<HTMLElement>) => scheduleOpen(event, 'mouseEnter'),\n\t\t[scheduleOpen]\n\t);\n\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent<HTMLElement>) => scheduleOpen(event, 'focus'),\n\t\t[scheduleOpen]\n\t);\n\n\tconst scheduleClose = useCallback(\n\t\t(\n\t\t\te: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>,\n\t\t\ttrigger: TooltipRequestCloseTrigger\n\t\t) => {\n\t\t\te.stopPropagation();\n\t\t\tclearTooltipTimeout();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tconst relatedTarget = (e as MouseEvent<HTMLElement>)\n\t\t\t\t\t.relatedTarget as HTMLElement | null;\n\t\t\t\tconst isHoveringTooltip =\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover_tooltip') ||\n\t\t\t\t\trelatedTarget?.classList?.contains('slds-popover__body');\n\n\t\t\t\tif (!isHoveringTooltip) {\n\t\t\t\t\trequestClose(e, trigger);\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay, requestClose]\n\t);\n\n\tconst handleMouseLeave = useCallback(\n\t\t(e: MouseEvent<HTMLElement>) => scheduleClose(e, 'mouseLeave'),\n\t\t[scheduleClose]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLElement>) => scheduleClose(e, 'blur'),\n\t\t[scheduleClose]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent<HTMLElement>) => {\n\t\t\te.stopPropagation();\n\n\t\t\ttooltipTimeoutRef.current = setTimeout(() => {\n\t\t\t\tif (e.key === 'Escape') {\n\t\t\t\t\trequestClose(e, 'cancel');\n\t\t\t\t}\n\t\t\t}, hoverCloseDelay);\n\t\t},\n\t\t[hoverCloseDelay, requestClose]\n\t);\n\n\t// Save trigger ref and trigger re-render once mounted\n\tconst saveTriggerRef = useCallback(\n\t\t(component: HTMLDivElement | null) => {\n\t\t\tif (component && triggerRef.current !== component) {\n\t\t\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\tcomponent;\n\t\t\t\t// Dialog/Popper.js cannot place the popover until\n\t\t\t\t// the trigger/target DOM node is mounted.\n\t\t\t\tif (!triggerRendered) {\n\t\t\t\t\tsetTriggerRendered(true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[triggerRendered]\n\t);\n\n\t// Render helpers\n\tconst getAnchoredNubbinStyles = () => {\n\t\tif (!hasAnchoredNubbin) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst alignment = align.split(' ')[0] as\n\t\t\t'top' | 'bottom' | 'left' | 'right';\n\t\tconst nubbinContainerStyles: CSSProperties = {\n\t\t\theight: '0',\n\t\t\tposition: 'relative',\n\t\t\twidth: '0',\n\t\t};\n\t\tconst nubbinStyles: CSSProperties = {\n\t\t\tbackgroundColor: '#16325c',\n\t\t\tcontent: '\"\"',\n\t\t\theight: '1rem',\n\t\t\tposition: 'absolute',\n\t\t\ttransform: 'rotate(45deg)',\n\t\t\twidth: '1rem',\n\t\t};\n\t\tconst triggerDimensions = {\n\t\t\theight: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().height\n\t\t\t\t: 0,\n\t\t\twidth: triggerRef.current\n\t\t\t\t? triggerRef.current.getBoundingClientRect().width\n\t\t\t\t: 0,\n\t\t};\n\n\t\tswitch (alignment) {\n\t\t\tcase 'bottom': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height}px`;\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '3px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'left': {\n\t\t\t\tnubbinContainerStyles.left = '0';\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '-19px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'right': {\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width}px`;\n\t\t\t\tnubbinContainerStyles.top = `${triggerDimensions.height / 2}px`;\n\t\t\t\tnubbinStyles.left = '3px';\n\t\t\t\tnubbinStyles.top = '-9px';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// top\n\t\t\t\tnubbinContainerStyles.left = `${triggerDimensions.width / 2}px`;\n\t\t\t\tnubbinContainerStyles.top = '0';\n\t\t\t\tnubbinStyles.left = '-8px';\n\t\t\t\tnubbinStyles.top = '-19px';\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{`#${getId()}:after, #${getId()}:before {\n\tdisplay: none;\n}`}</style>\n\t\t\t\t{getIsOpen() ? (\n\t\t\t\t\t<div style={nubbinContainerStyles}>\n\t\t\t\t\t\t<div style={nubbinStyles} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst getContent = () => {\n\t\tlet childrenToRender: ReactNode;\n\t\tconst noChildrenProvided = React.Children.count(children) === 0;\n\t\tconst isInverseIcon = iconVariant === 'inverse';\n\t\tconst iconColorVariant =\n\t\t\ticonVariant === 'error' || iconVariant === 'warning'\n\t\t\t\t? iconVariant\n\t\t\t\t: undefined;\n\n\t\tif (noChildrenProvided && onClickTrigger) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#\"\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tEventUtil.trappedHandler(\n\t\t\t\t\t\t\tonClickTrigger\n\t\t\t\t\t\t) as React.MouseEventHandler<HTMLAnchorElement>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tcolorVariant={iconColorVariant}\n\t\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\tlabel: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t);\n\t\t} else if (noChildrenProvided) {\n\t\t\tchildrenToRender = (\n\t\t\t\t<Button\n\t\t\t\t\taria-disabled\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText.triggerLearnMoreIcon,\n\t\t\t\t\t}}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName={\n\t\t\t\t\t\ticonColorVariant && `slds-icon-text-${iconColorVariant}`\n\t\t\t\t\t}\n\t\t\t\t\ticonName=\"info\"\n\t\t\t\t\t// `bare` keeps `slds-button_icon`, which Button drops for `inverse` alone\n\t\t\t\t\ticonVariant={isInverseIcon ? 'bare' : undefined}\n\t\t\t\t\tinverse={isInverseIcon}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\tchildrenToRender = children;\n\t\t}\n\n\t\treturn React.Children.map(childrenToRender, (child, i) => {\n\t\t\tif (!React.isValidElement(child)) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\treturn React.cloneElement(\n\t\t\t\tchild as React.ReactElement<{\n\t\t\t\t\tkey?: React.Key;\n\t\t\t\t\t'aria-describedby'?: string;\n\t\t\t\t\tonBlur?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonFocus?: (e: FocusEvent<HTMLElement>) => void;\n\t\t\t\t\tonMouseEnter?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonMouseLeave?: (e: MouseEvent<HTMLElement>) => void;\n\t\t\t\t\tonKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;\n\t\t\t\t}>,\n\t\t\t\t{\n\t\t\t\t\tkey: i,\n\t\t\t\t\t'aria-describedby': getIsOpen() ? getId() : undefined,\n\t\t\t\t\tonBlur: handleBlur,\n\t\t\t\t\tonFocus: handleFocus,\n\t\t\t\t\tonMouseEnter: handleMouseEnter,\n\t\t\t\t\tonMouseLeave: handleMouseLeave,\n\t\t\t\t\tonKeyDown: handleKeyDown,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t};\n\n\tconst getTooltipContent = () => {\n\t\tconst isErrorTheme = theme === 'error';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-popover__body', {\n\t\t\t\t\t// Ensure text contrast on error theme (red background needs white text)\n\t\t\t\t\t'slds-text-color_inverse': isErrorTheme,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t\t{variant === 'learnMore' && onClickTrigger ? (\n\t\t\t\t\t<div className=\"slds-m-top_x-small\" aria-hidden=\"true\">\n\t\t\t\t\t\t{labels.learnMoreBefore}{' '}\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.tooltipTipLearnMoreIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tinverse\n\t\t\t\t\t\t\tname=\"info\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>{' '}\n\t\t\t\t\t\t{labels.learnMoreAfter}{' '}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst getTooltip = () => {\n\t\treturn getIsOpen() ? (\n\t\t\t<Dialog\n\t\t\t\tcloseOnTabKey\n\t\t\t\thasNubbin\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t'slds-popover_tooltip',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-theme_error': theme === 'error',\n\t\t\t\t\t},\n\t\t\t\t\tdialogClassName\n\t\t\t\t)}\n\t\t\t\talign={align}\n\t\t\t\tcontext={iconSettings}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonRequestTargetElement={getTooltipTarget}\n\t\t\t\tonMouseLeave={handleDialogMouseLeave}\n\t\t\t\tposition={position}\n\t\t\t\tvariant=\"tooltip\"\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: getId(),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{getTooltipContent()}\n\t\t\t</Dialog>\n\t\t) : (\n\t\t\t<span />\n\t\t);\n\t};\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: 'inline-block',\n\t\tlineHeight: '1',\n\t\t...triggerStyle,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-tooltip-trigger', triggerClassName)}\n\t\t\tstyle={containerStyles}\n\t\t\tref={saveTriggerRef}\n\t\t>\n\t\t\t{getAnchoredNubbinStyles()}\n\t\t\t{getContent()}\n\t\t\t{getTooltip()}\n\t\t</div>\n\t);\n};\n\nTooltip.displayName = POPOVER_TOOLTIP;\n\nexport default Tooltip;\n"],"mappings":"8pBAkOA,IAAM,EAA6C,CAClD,wBAAyB,YACzB,qBAAsB,MACvB,EAEM,EAA+B,CACpC,eAAgB,iBAChB,gBAAiB,OAClB,EAOM,GAAW,CAChB,QAAQ,MACR,cAAe,EACf,WACA,WAAU,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAM,SAAa,CAAA,EAC7B,kBACA,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,EACjB,cAAc,OACd,GAAI,EACJ,OAAQ,GACR,OAAQ,EACR,gBAAgB,GAChB,gBACA,iBACA,yBACA,iBACA,mBACA,WAAW,WACX,eACA,QAAQ,OACR,UAAU,UAC6B,CAEvC,IAAM,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAChE,EAAS,CAAE,GAAG,EAAe,GAAG,EAAW,EAG3C,GAAA,EAAe,EAAA,WAAA,CAAW,EAAA,mBAAmB,EAG7C,CAAC,EAAQ,GAAa,EAAA,qBAAqB,EAAY,CAAa,EACpE,CAAC,EAAiB,KAAA,EAAsB,EAAA,SAAA,CAAS,EAAK,EAGtD,GAAA,EAAa,EAAA,OAAA,CAAuB,IAAI,EACxC,GAAA,EAAoB,EAAA,OAAA,CAA6C,IAAI,EACrE,GAAA,EAAiB,EAAA,OAAA,CAAO,GAAA,QAAW,CAAC,EACpC,GAAA,EAAkB,EAAA,OAAA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ACT,QAAA,GACA,KAAK,OACL,KAAK,SACL,CAAA,EAAE,IACF,EAAO,eAAgB,GACpB,CACF,CAAA,EAAA,IACA,IAID,OACE,EAAU,GAChB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACA,UAAA,GACA,mBAAA,EAAmB,EAAA,QAAA,CAClB,eACA,uBACA,CACC,mBAAoB,IAAU,OAC/B,EACA,CACD,EACO,QACP,QAAS,EACW,qBACpB,QAAS,GACT,uBAAwB,EACxB,aAAc,GACJ,WACV,QAAQ,UACR,eAAgB,CACf,GAAI,EAAM,CACX,EAEC,SAAA,GAAkB,CACZ,CAAA,GAER,EAAA,EAAA,IAAA,CAAC,OAAD,CAAO,CAAA,EAIH,GAAiC,CACtC,QAAS,eACT,WAAY,IACZ,GAAG,CACJ,EAEA,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,uBAAwB,CAAgB,EAC9D,MAAO,GACP,IAAK,EAHN,SAAA,CAKE,GAAwB,EACxB,GAAW,EACX,GAAW,CACR,GAEP,EAEA,EAAQ,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../utilities/get-component-doc.cjs"),t=require("../../utilities/warning/one-of-required-property.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/only-one-of-properties.cjs");var
|
|
1
|
+
const e=require("../../utilities/get-component-doc.cjs"),t=require("../../utilities/warning/one-of-required-property.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/required-property.cjs"),i=require("../../utilities/warning/only-one-of-properties.cjs");var a=function(){};process.env.NODE_ENV!==`production`&&(a=function(a,o,s){let c=e.default(s),l=o.assistiveText||{},u={"labels.heading":o.labels?.heading??o.heading,"assistiveText.heading":l.heading??l.label};t.default(a,u,c()),i.default(a,u,c()),n.default(a,o.heading,`heading`,`labels.heading`,c(`labels`)),n.default(a,l.label,`assistiveText.label`,`assistiveText.heading`,c(`assistiveText`)),n.default(a,o.onClick,`onClick`,`onSelect`,"`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state."),r.default(a,o.onSelect!==void 0||o.onClick!==void 0,`onSelect`,`Tree selection is controlled: without \`onSelect\`, selecting a node does nothing. Update \`selectedIds\` from \`data.selectedIds\` in \`onSelect\`. ${c(`onSelect`)}`),n.default(a,o.onExpandClick,`onExpandClick`,`onRequestToggle`,"`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead."),n.default(a,o.selectedIds===void 0||void 0,`node.selected`,`selectedIds`,"`selectedIds` is not set, so Tree reads selection from the deprecated `selected` field of each node. Tree never writes to `nodes`; pass `selectedIds` and update it from `data.selectedIds` in `onSelect`."),n.default(a,o.listClassName,`listClassName`,`classNameList`),n.default(a,o.listStyle,`listStyle`,`styleList`)});var o=function(){};process.env.NODE_ENV!==`production`&&(o=function(e,{hasExpandedField:t}){n.default(e,t?!0:void 0,`node.expanded`,`expandedIds`,"Tree reads the deprecated `expanded` field of each node only when neither `expandedIds` nor `defaultExpandedIds` is passed, and never writes to `nodes`. Pass `expandedIds` and update it from `data.expandedIds` in `onRequestToggle`, or pass `defaultExpandedIds` and let Tree manage expansion.")});var s=a;Object.defineProperty(exports,"checkLegacyNodeFields",{enumerable:!0,get:function(){return o}}),exports.default=s;
|
|
2
2
|
//# sourceMappingURL=check-props.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/tree/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 oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\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\t\tconst assistiveText = props.assistiveText || {};\n\n\t\tconst headingProps = {\n\t\t\t'labels.heading': props.labels?.heading ?? props.heading,\n\t\t\t'assistiveText.heading': assistiveText.heading ?? assistiveText.label,\n\t\t};\n\t\toneOfRequiredProperty(COMPONENT, headingProps, createDocUrl());\n\t\tonlyOneOfProperties(COMPONENT, headingProps, createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.heading,\n\t\t\t'heading',\n\t\t\t'labels.heading',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tassistiveText.label,\n\t\t\t'assistiveText.label',\n\t\t\t'assistiveText.heading',\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\n\t\t/* eslint-disable max-len */\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick,\n\t\t\t'onClick',\n\t\t\t'onSelect',\n\t\t\t'`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onExpandClick,\n\t\t\t'onExpandClick',\n\t\t\t'onRequestToggle',\n\t\t\t'`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listClassName,\n\t\t\t'listClassName',\n\t\t\t'classNameList'\n\t\t);\n\t\tdeprecatedProperty(COMPONENT, props.listStyle, 'listStyle', 'styleList');\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/tree/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 oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport requiredProperty from '../../utilities/warning/required-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\t\tconst assistiveText = props.assistiveText || {};\n\n\t\tconst headingProps = {\n\t\t\t'labels.heading': props.labels?.heading ?? props.heading,\n\t\t\t'assistiveText.heading': assistiveText.heading ?? assistiveText.label,\n\t\t};\n\t\toneOfRequiredProperty(COMPONENT, headingProps, createDocUrl());\n\t\tonlyOneOfProperties(COMPONENT, headingProps, createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.heading,\n\t\t\t'heading',\n\t\t\t'labels.heading',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tassistiveText.label,\n\t\t\t'assistiveText.label',\n\t\t\t'assistiveText.heading',\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\n\t\t/* eslint-disable max-len */\n\t\t// Deprecated and changed to another property\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onClick,\n\t\t\t'onClick',\n\t\t\t'onSelect',\n\t\t\t'`onSelect` receives `(event, { node, isSelected })`, where `isSelected` is the requested selection state.'\n\t\t);\n\t\t// The deprecated `onClick` still fires, so it satisfies the requirement at runtime.\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onSelect !== undefined || props.onClick !== undefined,\n\t\t\t'onSelect',\n\t\t\t`Tree selection is controlled: without \\`onSelect\\`, selecting a node does nothing. Update \\`selectedIds\\` from \\`data.selectedIds\\` in \\`onSelect\\`. ${createDocUrl(\n\t\t\t\t'onSelect'\n\t\t\t)}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onExpandClick,\n\t\t\t'onExpandClick',\n\t\t\t'onRequestToggle',\n\t\t\t'`onRequestToggle` receives `(event, { node, isExpanded })`, where `isExpanded` is the requested expansion state. Left arrow on a collapsed branch or item selects the parent through `onSelect` instead.'\n\t\t);\n\n\t\t// Selection is controlled data: without `selectedIds`, Tree falls back to `node.selected`\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.selectedIds === undefined ? true : undefined,\n\t\t\t'node.selected',\n\t\t\t'selectedIds',\n\t\t\t'`selectedIds` is not set, so Tree reads selection from the deprecated `selected` field of each node. Tree never writes to `nodes`; pass `selectedIds` and update it from `data.selectedIds` in `onSelect`.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listClassName,\n\t\t\t'listClassName',\n\t\t\t'classNameList'\n\t\t);\n\t\tdeprecatedProperty(COMPONENT, props.listStyle, 'listStyle', 'styleList');\n\t\t/* eslint-enable max-len */\n\t};\n}\n\n// The deprecated `node.expanded` fallback. Called whenever the visible nodes change, because\n// consumers usually add the field later, in their expand handler.\nexport let checkLegacyNodeFields = function checkLegacyNodeFieldsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckLegacyNodeFields = function checkLegacyNodeFieldsFunction(\n\t\tCOMPONENT,\n\t\t{ hasExpandedField }\n\t) {\n\t\t/* eslint-disable max-len */\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\thasExpandedField ? true : undefined,\n\t\t\t'node.expanded',\n\t\t\t'expandedIds',\n\t\t\t'Tree reads the deprecated `expanded` field of each node only when neither `expandedIds` nor `defaultExpandedIds` is passed, and never writes to `nodes`. Pass `expandedIds` and update it from `data.expandedIds` in `onRequestToggle`, or pass `defaultExpandedIds` and let Tree manage expansion.'\n\t\t);\n\t\t/* eslint-enable max-len */\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"mTAUA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EACxC,EAAgB,EAAM,eAAiB,CAAC,EAExC,EAAe,CACpB,iBAAkB,EAAM,QAAQ,SAAW,EAAM,QACjD,wBAAyB,EAAc,SAAW,EAAc,KACjE,EACA,EAAA,QAAsB,EAAW,EAAc,EAAa,CAAC,EAC7D,EAAA,QAAoB,EAAW,EAAc,EAAa,CAAC,EAE3D,EAAA,QACC,EACA,EAAM,QACN,UACA,iBACA,EAAa,QAAQ,CACtB,EACA,EAAA,QACC,EACA,EAAc,MACd,sBACA,wBACA,EAAa,eAAe,CAC7B,EAIA,EAAA,QACC,EACA,EAAM,QACN,UACA,WACA,2GACD,EAEA,EAAA,QACC,EACA,EAAM,WAAa,IAAA,IAAa,EAAM,UAAY,IAAA,GAClD,WACA,wJAAwJ,EACvJ,UACD,GACD,EACA,EAAA,QACC,EACA,EAAM,cACN,gBACA,kBACA,0MACD,EAGA,EAAA,QACC,EACA,EAAM,cAAgB,IAAA,IAAmB,IAAA,GACzC,gBACA,cACA,4MACD,EACA,EAAA,QACC,EACA,EAAM,cACN,gBACA,eACD,EACA,EAAA,QAAmB,EAAW,EAAM,UAAW,YAAa,WAAW,CAExE,GAKD,IAAW,EAAwB,UAAyC,CAAC,EAE7E,QAAA,IAAA,WAA6B,eAC5B,EAAwB,SACvB,EACA,CAAE,oBACD,CAED,EAAA,QACC,EACA,EAAmB,GAAO,IAAA,GAC1B,gBACA,cACA,qSACD,CAED,GAGD,IAAA,EAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/generate-id.cjs"),r=require("./item.cjs"),i=require("./render-initial-branch.cjs"),a=require("./render-branch.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>e.nodes,l=({level:e=0,label:t=``,treeIndex:o=``,
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/generate-id.cjs"),r=require("./item.cjs"),i=require("./render-initial-branch.cjs"),a=require("./render-branch.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>e.nodes,l=({level:e=0,label:t=``,treeIndex:o=``,getNodes:u=c,...d})=>{let f={level:e,label:t,treeIndex:o,getNodes:u,...d},{treeId:p,onExpand:m,searchTerm:h,node:g}=f,_=``,v=null,y=u(g);return Array.isArray(y)&&(v=y.map((t,i)=>{let a,c=`${p}-${t.id}`;return _=`${i}`,o&&(_=`${o}-${_}`),a=t.type===`branch`?(0,s.jsx)(l,{getNodes:u,htmlId:c,label:t.label,level:e+1,node:t,flattenedNodes:f.flattenedNodes,isNodeSelected:f.isNodeSelected,isNodeExpanded:f.isNodeExpanded,tabStopIndex:f.tabStopIndex,focusedNodeIndex:f.focusedNodeIndex,treeHasFocus:f.treeHasFocus,onNodeBlur:f.onNodeBlur,nodes:t.nodes,onSelect:f.onSelect,onExpand:m,searchTerm:h,treeId:p,treeIndex:_,parent:g},t.id):(0,s.jsx)(r.default,{label:t.label,htmlId:c,level:e+1,node:t,flattenedNodes:f.flattenedNodes,isNodeSelected:f.isNodeSelected,isNodeExpanded:f.isNodeExpanded,tabStopIndex:f.tabStopIndex,focusedNodeIndex:f.focusedNodeIndex,treeHasFocus:f.treeHasFocus,onNodeBlur:f.onNodeBlur,onSelect:f.onSelect,onExpand:m,searchTerm:h,treeIndex:_,treeId:p,parent:g},n.default()),a})),e===0?i.default(v,f):a.default(v,{...f,node:g,treeIndex:o})};l.displayName=t.TREE_BRANCH,exports.default=l;
|
|
2
2
|
//# sourceMappingURL=branch.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch.cjs","names":[],"sources":["../../../../../components/tree/private/branch.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\nimport React, { ReactNode } from 'react';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode, TreeScrollData } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: string;\n\ttreeIndex?: string;\n\tflattenedNodes: FlattenedNode[];\n\
|
|
1
|
+
{"version":3,"file":"branch.cjs","names":[],"sources":["../../../../../components/tree/private/branch.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\nimport React, { ReactNode } from 'react';\n\nimport Item from './item';\nimport RenderInitialBranch from './render-initial-branch';\nimport RenderBranch from './render-branch';\n\nimport { TREE_BRANCH } from '../../../utilities/constants';\nimport generateId from '../../../utilities/generate-id';\nimport { TreeNode, FlattenedNode, TreeScrollData } from '../types';\n\nexport interface BranchProps {\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\thtmlId: string | number;\n\tindex?: number;\n\tinitial?: boolean;\n\tinitalClassName?: string | string[] | Record<string, boolean>;\n\tinitialStyle?: React.CSSProperties;\n\tlabel?: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode | { nodes?: TreeNode[] };\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t\tselect?: boolean;\n\t\t};\n\t}) => void;\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\tsearchTerm?: string;\n\ttreeId: string;\n\ttreeIndex?: string;\n\tflattenedNodes: FlattenedNode[];\n\t/** Whether a node is selected (from `selectedIds`, or the deprecated `node.selected`) */\n\tisNodeSelected: (node: TreeNode) => boolean;\n\t/** Whether a branch is expanded (from expansion state, or the deprecated `node.expanded`) */\n\tisNodeExpanded: (node: TreeNode) => boolean;\n\t/** Tree index of the node that is the tree's tab stop */\n\ttabStopIndex?: string;\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n\tnodes?: TreeNode[];\n}\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A Tree Branch is an expandable node in a hierarchical list.\n */\nconst Branch: React.FC<BranchProps> = ({\n\tlevel = 0,\n\tlabel = '',\n\ttreeIndex = '',\n\tgetNodes = defaultGetNodes,\n\t...rest\n}) => {\n\tconst props = {\n\t\tlevel,\n\t\tlabel,\n\t\ttreeIndex,\n\t\tgetNodes,\n\t\t...rest,\n\t};\n\n\tconst { treeId, onExpand, searchTerm, node } = props;\n\tlet resolvedTreeIndex = '';\n\tlet children: ReactNode = null;\n\n\tconst nodeChildren = getNodes(node);\n\tif (Array.isArray(nodeChildren)) {\n\t\tchildren = nodeChildren.map((childNode, index) => {\n\t\t\tlet child: ReactNode;\n\t\t\tconst htmlId = `${treeId}-${childNode.id}`;\n\t\t\tresolvedTreeIndex = `${index}`;\n\t\t\tif (treeIndex) {\n\t\t\t\tresolvedTreeIndex = `${treeIndex}-${resolvedTreeIndex}`;\n\t\t\t}\n\n\t\t\tif (childNode.type === 'branch') {\n\t\t\t\tchild = (\n\t\t\t\t\t<Branch\n\t\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={childNode.id}\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tisNodeSelected={props.isNodeSelected}\n\t\t\t\t\t\tisNodeExpanded={props.isNodeExpanded}\n\t\t\t\t\t\ttabStopIndex={props.tabStopIndex}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tnodes={childNode.nodes}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchild = (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tlabel={childNode.label}\n\t\t\t\t\t\thtmlId={htmlId}\n\t\t\t\t\t\tkey={generateId()}\n\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\tnode={childNode}\n\t\t\t\t\t\tflattenedNodes={props.flattenedNodes}\n\t\t\t\t\t\tisNodeSelected={props.isNodeSelected}\n\t\t\t\t\t\tisNodeExpanded={props.isNodeExpanded}\n\t\t\t\t\t\ttabStopIndex={props.tabStopIndex}\n\t\t\t\t\t\tfocusedNodeIndex={props.focusedNodeIndex}\n\t\t\t\t\t\ttreeHasFocus={props.treeHasFocus}\n\t\t\t\t\t\tonNodeBlur={props.onNodeBlur}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tonExpand={onExpand}\n\t\t\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\t\t\ttreeIndex={resolvedTreeIndex}\n\t\t\t\t\t\ttreeId={treeId}\n\t\t\t\t\t\tparent={node}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t}\n\n\tconst branch =\n\t\tlevel === 0\n\t\t\t? RenderInitialBranch(children, props)\n\t\t\t: RenderBranch(children, {\n\t\t\t\t\t...props,\n\t\t\t\t\tnode: node as TreeNode,\n\t\t\t\t\ttreeIndex,\n\t\t\t\t});\n\n\treturn branch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EAAA,QAAa,EAAU,CACvB,GAAG,EACG,OACN,WACD,CAAC,CAGL,EAEA,EAAO,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/event.cjs"),r=require("../../../utilities/key-code.cjs"),i=require("../../button/index.cjs"),a=require("../../../utilities/key-callbacks.cjs"),o=require("../../utilities/highlighter/index.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime"),u=require("lodash.isfunction");u=e.__toESM(u,1);let d=require("lodash.findindex");d=e.__toESM(d,1);var f=({event:e,props:t,fromFocus:r})=>{n.default.trap(e),(0,u.default)(t.onSelect)&&t.onSelect({event:e,data:{node:t.node,select:!t.node
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../../utilities/event.cjs"),r=require("../../../utilities/key-code.cjs"),i=require("../../button/index.cjs"),a=require("../../../utilities/key-callbacks.cjs"),o=require("../../utilities/highlighter/index.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime"),u=require("lodash.isfunction");u=e.__toESM(u,1);let d=require("lodash.findindex");d=e.__toESM(d,1);var f=({event:e,props:t,fromFocus:r})=>{n.default.trap(e),(0,u.default)(t.onSelect)&&t.onSelect({event:e,data:{node:t.node,select:!t.isNodeSelected(t.node),treeIndex:t.treeIndex},fromFocus:r})},p=(e,t)=>{let n=e.map(e=>e.node);return e[((0,d.default)(n,{id:t.id})+1)%e.length]},m=(e,t)=>{let n=e.map(e=>e.node),r=(0,d.default)(n,{id:t.id})-1;return r<0&&(r+=e.length),e[r]},h=(e,t)=>{if(t.focusedNodeIndex===t.treeIndex){let n=p(t.flattenedNodes,t.node);t.onSelect?.({event:e,data:{node:n.node,select:!0,treeIndex:n.treeIndex},clearSelectedNodes:!0})}},g=(e,t)=>{if(t.focusedNodeIndex===t.treeIndex){let n=m(t.flattenedNodes,t.node);t.onSelect?.({event:e,data:{node:n.node,select:!0,treeIndex:n.treeIndex},clearSelectedNodes:!0})}},_=(e,t)=>{let n=t.flattenedNodes.map(e=>e.node),r=t.parent,i=(0,d.default)(n,{id:r?.id});i!==-1&&t.onExpand({event:e,data:{node:r,select:!0,expand:!t.isNodeExpanded(r),treeIndex:t.flattenedNodes[i].treeIndex}})},v=(e,t)=>{f({event:e,props:t})},y=(e,t)=>{a.default(e,{callbacks:{[r.default.DOWN]:{callback:e=>h(e,t)},[r.default.UP]:{callback:e=>g(e,t)},[r.default.LEFT]:{callback:e=>_(e,t)},[r.default.ENTER]:{callback:e=>v(e,t)}}})},b=(e,t)=>{!t.treeHasFocus&&!t.focusedNodeIndex&&e.target===e.currentTarget&&f({event:e,props:t})},x=e=>e.treeIndex===e.tabStopIndex?0:-1,S=e=>{let t=e.isNodeSelected(e.node),n=e.treeIndex===e.focusedNodeIndex;return(0,l.jsx)(`li`,{id:`${e.treeId}-${e.node.id}`,role:`treeitem`,"aria-level":e.level,"aria-selected":t?`true`:`false`,tabIndex:x(e),onKeyDown:t=>y(t,e),onFocus:t=>b(t,e),onBlur:e.onNodeBlur,ref:t=>{e.treeHasFocus&&t&&n&&t.focus()},children:(0,l.jsxs)(`div`,{className:(0,c.default)(`slds-tree__item`,{"slds-is-selected":t}),onClick:t=>f({event:t,props:e}),children:[(0,l.jsx)(i.default,{"aria-hidden":!0,tabIndex:-1,assistiveText:{icon:``},iconCategory:`utility`,iconName:`chevronright`,iconSize:`small`,variant:`icon`,className:`slds-m-right_small slds-is-disabled slds-hidden`,disabled:!0}),(0,l.jsx)(`span`,{className:`slds-size_1-of-1`,children:(0,l.jsx)(o.default,{search:e.searchTerm,className:`slds-tree__item-label slds-truncate`,children:e.label})})]})})};S.displayName=t.TREE_ITEM,exports.default=S;
|
|
2
2
|
//# sourceMappingURL=item.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/tree/private/item.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\nimport React, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\n\tlabel: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeId?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\
|
|
1
|
+
{"version":3,"file":"item.cjs","names":[],"sources":["../../../../../components/tree/private/item.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\nimport React, { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport findIndex from 'lodash.findindex';\nimport isFunction from 'lodash.isfunction';\n\nimport Button from '../../button';\nimport Highlighter from '../../utilities/highlighter';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\nimport mapKeyEventCallbacks from '../../../utilities/key-callbacks';\nimport { TREE_ITEM } from '../../../utilities/constants';\nimport { TreeNode, FlattenedNode } from '../types';\n\nexport interface ItemProps {\n\thtmlId: string;\n\tlabel: ReactNode | string;\n\tlevel: number;\n\tnode: TreeNode;\n\tonExpand: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect?: boolean;\n\t\t\texpand: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t}) => void;\n\tonSelect?: (params: {\n\t\tevent: React.SyntheticEvent;\n\t\tdata: {\n\t\t\tnode: TreeNode;\n\t\t\tselect: boolean;\n\t\t\ttreeIndex: string;\n\t\t};\n\t\tfromFocus?: boolean;\n\t\tclearSelectedNodes?: boolean;\n\t}) => void;\n\tsearchTerm?: string;\n\ttreeId?: string;\n\ttreeIndex: string;\n\tflattenedNodes: FlattenedNode[];\n\tisNodeSelected: (node: TreeNode) => boolean;\n\tisNodeExpanded: (node: TreeNode) => boolean;\n\ttabStopIndex?: string;\n\tfocusedNodeIndex?: string;\n\tonNodeBlur?: () => void;\n\ttreeHasFocus?: boolean;\n\tparent?: TreeNode | { nodes?: TreeNode[] };\n}\n\nconst handleSelect = ({\n\tevent,\n\tprops,\n\tfromFocus,\n}: {\n\tevent: React.SyntheticEvent;\n\tprops: ItemProps;\n\tfromFocus?: boolean;\n}) => {\n\tEventUtil.trap(event);\n\tif (isFunction(props.onSelect)) {\n\t\tprops.onSelect({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: props.node,\n\t\t\t\tselect: !props.isNodeSelected(props.node),\n\t\t\t\ttreeIndex: props.treeIndex,\n\t\t\t},\n\t\t\tfromFocus,\n\t\t});\n\t}\n};\n\nconst findNextNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst index = findIndex(nodes, { id: node.id });\n\treturn flattenedNodes[(index + 1) % flattenedNodes.length];\n};\n\nconst findPreviousNode = (flattenedNodes: FlattenedNode[], node: TreeNode) => {\n\tconst nodes = flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tlet index = findIndex(nodes, { id: node.id }) - 1;\n\tif (index < 0) {\n\t\tindex += flattenedNodes.length;\n\t}\n\treturn flattenedNodes[index];\n};\n\nconst handleKeyDownDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findNextNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownUp = (event: React.KeyboardEvent, props: ItemProps) => {\n\tif (props.focusedNodeIndex === props.treeIndex) {\n\t\tconst flattenedNode = findPreviousNode(props.flattenedNodes, props.node);\n\t\tprops.onSelect?.({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: flattenedNode.node,\n\t\t\t\tselect: true,\n\t\t\t\ttreeIndex: flattenedNode.treeIndex,\n\t\t\t},\n\t\t\tclearSelectedNodes: true,\n\t\t});\n\t}\n};\n\nconst handleKeyDownLeft = (event: React.KeyboardEvent, props: ItemProps) => {\n\tconst nodes = props.flattenedNodes.map((flattenedNode) => flattenedNode.node);\n\tconst parent = props.parent as TreeNode;\n\tconst index = findIndex(nodes, { id: parent?.id });\n\tif (index !== -1) {\n\t\t// `select: true` marks a move to the parent node, not an expand/collapse request.\n\t\t// Tree routes it to `onSelect` (or to the deprecated `onExpandClick`).\n\t\tprops.onExpand({\n\t\t\tevent,\n\t\t\tdata: {\n\t\t\t\tnode: parent,\n\t\t\t\tselect: true,\n\t\t\t\texpand: !props.isNodeExpanded(parent),\n\t\t\t\ttreeIndex: props.flattenedNodes[index].treeIndex,\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst handleKeyDownEnter = (event: React.KeyboardEvent, props: ItemProps) => {\n\thandleSelect({ event, props });\n};\n\nconst handleKeyDown = (event: React.KeyboardEvent, props: ItemProps) => {\n\tmapKeyEventCallbacks(event, {\n\t\tcallbacks: {\n\t\t\t[KEYS.DOWN]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownDown(evt, props),\n\t\t\t},\n\t\t\t[KEYS.UP]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownUp(evt, props),\n\t\t\t},\n\t\t\t[KEYS.LEFT]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownLeft(evt, props),\n\t\t\t},\n\t\t\t[KEYS.ENTER]: {\n\t\t\t\tcallback: (evt: React.KeyboardEvent) => handleKeyDownEnter(evt, props),\n\t\t\t},\n\t\t},\n\t});\n};\n\nconst handleFocus = (event: React.FocusEvent, props: ItemProps) => {\n\tif (\n\t\t!props.treeHasFocus &&\n\t\t!props.focusedNodeIndex &&\n\t\tevent.target === event.currentTarget\n\t) {\n\t\thandleSelect({ event, props });\n\t}\n};\n\nconst getTabIndex = (props: ItemProps): number =>\n\tprops.treeIndex === props.tabStopIndex ? 0 : -1;\n\n/**\n * A Tree Item is a non-branching node in a hierarchical list.\n */\nconst Item: React.FC<ItemProps> = (props) => {\n\tconst isSelected = props.isNodeSelected(props.node);\n\tconst isFocused = props.treeIndex === props.focusedNodeIndex;\n\n\treturn (\n\t\t<li\n\t\t\tid={`${props.treeId}-${props.node.id}`}\n\t\t\trole=\"treeitem\"\n\t\t\taria-level={props.level}\n\t\t\taria-selected={isSelected ? 'true' : 'false'}\n\t\t\ttabIndex={getTabIndex(props)}\n\t\t\tonKeyDown={(event) => handleKeyDown(event, props)}\n\t\t\tonFocus={(event) => handleFocus(event, props)}\n\t\t\tonBlur={props.onNodeBlur}\n\t\t\tref={(component) => {\n\t\t\t\tif (props.treeHasFocus && component && isFocused) {\n\t\t\t\t\tcomponent.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-tree__item', {\n\t\t\t\t\t'slds-is-selected': isSelected,\n\t\t\t\t})}\n\t\t\t\tonClick={(event) => handleSelect({ event, props })}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\tassistiveText={{ icon: '' }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"chevronright\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t// `slds-hidden` keeps the chevron's space so leaf labels align with\n\t\t\t\t\t// branch labels; SLDS 2 no longer hides `.slds-is-disabled` here.\n\t\t\t\t\tclassName=\"slds-m-right_small slds-is-disabled slds-hidden\"\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t\t<span className=\"slds-size_1-of-1\">\n\t\t\t\t\t<Highlighter\n\t\t\t\t\t\tsearch={props.searchTerm}\n\t\t\t\t\t\tclassName=\"slds-tree__item-label slds-truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</Highlighter>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</li>\n\t);\n};\n\nItem.displayName = TREE_ITEM;\n\nexport default Item;\n"],"mappings":"oiBAsDA,IAAM,GAAgB,CACrB,QACA,QACA,eAKK,CACL,EAAA,QAAU,KAAK,CAAK,GACpB,EAAI,EAAA,QAAA,CAAW,EAAM,QAAQ,GAC5B,EAAM,SAAS,CACd,QACA,KAAM,CACL,KAAM,EAAM,KACZ,OAAQ,CAAC,EAAM,eAAe,EAAM,IAAI,EACxC,UAAW,EAAM,SAClB,EACA,WACD,CAAC,CAEH,EAEM,GAAgB,EAAiC,IAAmB,CACzE,IAAM,EAAQ,EAAe,IA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