@salesforce/design-system-react 11.0.0-alpha.7 → 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/filter/filter.cjs +1 -1
- package/dist/cjs/components/filter/filter.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/check-props.cjs +2 -0
- package/dist/cjs/components/modal/check-props.cjs.map +1 -0
- package/dist/cjs/components/modal/component.cjs +2 -0
- package/dist/cjs/components/modal/component.cjs.map +1 -0
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/popover/component.cjs +2 -0
- package/dist/cjs/components/popover/component.cjs.map +1 -0
- package/dist/cjs/components/popover/edit-dialog.cjs +1 -1
- package/dist/cjs/components/popover/edit-dialog.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/spinner/check-props.cjs +2 -0
- package/dist/cjs/components/spinner/check-props.cjs.map +1 -0
- package/dist/cjs/components/spinner/component.cjs +2 -0
- package/dist/cjs/components/spinner/component.cjs.map +1 -0
- package/dist/cjs/components/spinner/index.cjs +1 -1
- package/dist/cjs/components/spinner/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/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/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 +401 -401
- 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/filter/filter.js +1 -1
- package/dist/es/components/filter/filter.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/check-props.js +22 -0
- package/dist/es/components/modal/check-props.js.map +1 -0
- package/dist/es/components/modal/component.js +35 -0
- package/dist/es/components/modal/component.js.map +1 -0
- package/dist/es/components/modal/index.js +118 -104
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/popover/component.js +59 -0
- package/dist/es/components/popover/component.js.map +1 -0
- package/dist/es/components/popover/edit-dialog.js +1 -1
- package/dist/es/components/popover/edit-dialog.js.map +1 -1
- package/dist/es/components/popover/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +241 -193
- 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 +71 -62
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/spinner/check-props.js +13 -0
- package/dist/es/components/spinner/check-props.js.map +1 -0
- package/dist/es/components/spinner/component.js +17 -0
- package/dist/es/components/spinner/component.js.map +1 -0
- package/dist/es/components/spinner/index.js +43 -29
- package/dist/es/components/spinner/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 +128 -93
- 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 +28 -26
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/welcome-mat/index.js +51 -50
- package/dist/es/components/welcome-mat/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/modal/check-props.d.ts +3 -0
- package/dist/types/components/modal/check-props.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +21 -13
- package/dist/types/components/modal/index.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 +54 -17
- 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 +32 -17
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/spinner/check-props.d.ts +3 -0
- package/dist/types/components/spinner/check-props.d.ts.map +1 -0
- package/dist/types/components/spinner/index.d.ts +18 -9
- package/dist/types/components/spinner/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 +41 -10
- 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 +16 -11
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/index.d.ts +5 -6
- package/dist/types/components/welcome-mat/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/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\tuseId,\n\tuseRef,\n\tuseReducer,\n\tuseCallback,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n\t/** Text for field level help button */\n\tfieldLevelHelpButton?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props for the Input component\n */\nexport interface InputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Initial value for uncontrolled usage */\n\tdefaultValue?: string | number;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon (InputIcon instance) */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon (InputIcon instance) */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Label text above input */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for counter variant */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for counter variant */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for counter variant */\n\tstep?: number;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/** Controlled value */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InputVariant;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\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\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst inputElementRef = useRef<HTMLInputElement | null>(null);\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `performStep`, so the repeat timer of a held counter button\n\t\t// reads current props (such as a controlled `value`) on every step.\n\t\tconst performStepRef = useRef<\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => void\n\t\t>(() => {});\n\t\t// Re-renders after an uncontrolled step, so the counter buttons' disabled\n\t\t// state reflects the value written directly to the input element.\n\t\tconst [, forceRender] = useReducer((count: number) => count + 1, 0);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\tconst getValueAsNumber = useCallback((): number => {\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn Number(value);\n\t\t\t}\n\t\t\tif (inputElementRef.current) {\n\t\t\t\treturn Number(inputElementRef.current.value);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}, [value]);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = getValueAsNumber();\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (value === undefined && inputElementRef.current) {\n\t\t\t\t\t\t// Uncontrolled mode\n\t\t\t\t\t\tinputElementRef.current.value = String(currentValue);\n\t\t\t\t\t\tforceRender();\n\t\t\t\t\t}\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStepRef.current(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetValueAsNumber,\n\t\t\t\tmaxValue,\n\t\t\t\tminValue,\n\t\t\t\tonChange,\n\t\t\t\tstep,\n\t\t\t\tstopStepping,\n\t\t\t\tvalue,\n\t\t\t]\n\t\t);\n\t\tperformStepRef.current = performStep;\n\n\t\tconst setInputRef = useCallback(\n\t\t\t(element: HTMLInputElement | null) => {\n\t\t\t\tinputElementRef.current = element;\n\t\t\t\tif (propInputRef) {\n\t\t\t\t\tpropInputRef(element);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[propInputRef]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = getValueAsNumber();\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement(propIconLeft)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconLeft as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'left',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement(propIconRight)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconRight as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'right',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\n\t\tconst inputRefToUse = variant === COUNTER ? setInputRef : propInputRef;\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': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\ttriggerLearnMoreIcon: assistiveText.fieldLevelHelpButton,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={inputRefToUse}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\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\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"uiBA+BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YA2KZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,GACjB,gBAAiB,GACjB,kBAAmB,GACnB,YAAa,EACb,gBAAiB,GACjB,cAAe,GACf,gBACA,YACA,aACA,gBACA,WAAW,GACX,YACA,wBACA,iBACA,kBACA,cAAa,GACb,SAAU,EACV,UAAW,EACX,GAAI,GACJ,iBACA,qBACA,SAAU,EACV,WAAW,GACX,QACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,aACA,UACA,WACA,YACA,cACA,WAAW,GACX,WAAW,GACX,QACA,OACA,YACA,kBACA,cACA,QAAO,OACP,QACA,UAAU,QAEX,KACI,CACJ,IAAM,IAAA,EAAc,EAAA,MAAA,CAAM,EACpB,IAAA,EAAmB,EAAA,MAAA,CAAM,EACzB,IAAA,EAAwB,EAAA,MAAA,CAAM,EAC9B,EAAK,IAAU,GACf,GAAU,EAAY,GAAmB,IAAA,GACzC,GAAe,EAAiB,GAAwB,IAAA,GACxD,GACL,CAAC,GAAiB,GAAc,EAAO,CAAC,CACtC,OAAQ,GAAmB,EAAQ,CAAE,C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,GAAe,MAC3C,GAAgB,IAAY,EAAU,GAAc,EAE1D,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,oBACA,CACC,iBAAkB,CACnB,EACA,EACD,EACA,MAAO,GACF,OATN,SAAA,EAWC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACf,QAAS,EAAW,IAAA,GAAY,EACzB,QACG,WACV,QAAS,EAAW,SAAW,MAC/B,CAAA,EACA,GAAyB,IACzB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CACd,qBAAsB,EAAc,oBACrC,EACuB,uBACvB,CAAA,EACE,MACJ,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,wBAAuB,EACvB,oBAAmB,EACnB,gBAAe,GACf,kBAAiB,GACjB,mBAAkB,GAClB,gBAAe,GACf,gBAAe,GACf,YAAW,EACX,gBAAe,GACD,gBACd,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,qBAAsB,IAAY,EAClC,yBAA0B,IAAY,GAAW,CAClD,CAAC,EACD,eAAgB,CACf,UAAW,4BACZ,EACc,gBACJ,WACK,iBACC,kBACJ,cACR,KACM,WACC,YACQ,qBACT,WACC,YACD,WACC,YACD,WACJ,OACE,SACR,SAAU,GACD,UACA,UACA,UACE,YACA,YACC,aACH,UACC,WACA,YACG,cACb,SAAU,GACA,WACA,WACJ,QACS,gBACf,KAAM,IAAY,EAAU,SAAW,GAChC,QACE,UACH,OACI,YACV,MAAO,EACP,CAAA,EACA,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAc,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAS,UAAU,0BAC1B,SAAA,CACG,CAAA,EAEL,EACG,GAEP,CACD,EAEA,EAAM,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/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\tuseId,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n\t/** Text for field level help button */\n\tfieldLevelHelpButton?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props for the Input component\n */\nexport interface InputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon (InputIcon instance) */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon (InputIcon instance) */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Label text above input */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for counter variant */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for counter variant */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Called with the requested value when the user types or, for the counter\n\t * variant, presses the increment/decrement buttons. Input is controlled: set\n\t * `value` from `data.value` (or `data.number`) to accept the change.\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for counter variant */\n\tstep?: number;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/**\n\t * The input's value. Input is controlled: update `value` in `onChange`.\n\t * The counter variant steps from this value. (`defaultValue` was removed\n\t * in v11.)\n\t */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InputVariant;\n}\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface InputRemovedProps {\n\tdefaultValue?: unknown;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\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\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t}: InputProps & InputRemovedProps,\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `value`, so a held-down counter button steps from the value the\n\t\t// parent rendered after the previous step rather than a stale closure.\n\t\tconst valueRef = useRef(value);\n\t\tuseEffect(() => {\n\t\t\tvalueRef.current = value;\n\t\t}, [value]);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\t// The counter steps from the `value` prop only; it never reads or writes\n\t\t// the DOM value.\n\t\tconst toNumber = (currentValue: string | number | undefined): number =>\n\t\t\tcurrentValue === undefined || currentValue === ''\n\t\t\t\t? 0\n\t\t\t\t: Number(currentValue);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = toNumber(valueRef.current);\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStep(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[maxValue, minValue, onChange, step, stopStepping]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = toNumber(value);\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement(propIconLeft)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconLeft as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'left',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement(propIconRight)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconRight as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'right',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\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': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\ttriggerLearnMoreIcon: assistiveText.fieldLevelHelpButton,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={propInputRef}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\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\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"uiBA+BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YAyLZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,GACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,GACf,gBACA,YACA,aACA,gBACA,WAAW,GACX,YACA,wBACA,iBACA,kBACA,cAAa,GACb,SAAU,EACV,UAA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,UAAU,0BAC1B,SAAA,CACG,CAAA,EAEL,EACG,GAEP,CACD,EAEA,EAAM,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/get-aria-props.cjs"),ee=require("../../spinner/index.cjs");let n=require("classnames");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i=`counter`,te={spinner:`Loading ...`},a=({"aria-activedescendant":e,"aria-autocomplete":a,"aria-controls":ne,"aria-describedby":
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/get-aria-props.cjs"),ee=require("../../spinner/index.cjs");let n=require("classnames");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i=`counter`,te={spinner:`Loading ...`},a=({"aria-activedescendant":e,"aria-autocomplete":a,"aria-controls":ne,"aria-describedby":re,"aria-expanded":o,"aria-haspopup":s,"aria-labelledby":c,"aria-owns":l,"aria-required":u,assistiveText:d,autoComplete:f,className:p,containerClassName:m,containerProps:h={},disabled:g,fixedTextLeft:_,fixedTextRight:v,hasSpinner:y,iconLeft:b,iconRight:x,id:S,inlineEditTrigger:C,inputRef:w,isStatic:T,maxLength:E,maxValue:D,minLength:O,minValue:k,name:A,onBlur:j,onChange:M,onClick:N,onFocus:P,onInput:F,onInvalid:ie,onKeyDown:I,onKeyPress:L,onKeyUp:R,onSelect:z,onSubmit:B,placeholder:V,readOnly:H,required:U,role:W,step:G,style:K,tabIndex:q,type:J=`text`,value:Y,variant:X})=>{let Z={...te,...d},Q=t.default({"aria-activedescendant":e,"aria-autocomplete":a,"aria-controls":ne,"aria-describedby":re,"aria-expanded":o,"aria-haspopup":s,"aria-labelledby":c,"aria-owns":l,"aria-required":u,assistiveText:Z,type:J}),$=`${S}-loading-status-icon`;y&&Q[`aria-describedby`]?Q[`aria-describedby`]=`${$} ${Q[`aria-describedby`]}`:y&&(Q[`aria-describedby`]=$);let{className:ae,...oe}=h;return(0,r.jsxs)(`div`,{className:(0,n.default)(ae,m,{"slds-input-has-icon":X!==i&&(b||x),"slds-input-has-icon_left":b&&!x,"slds-input-has-icon_right":!b&&x,"slds-input-has-icon_left-right":X!==i&&b&&x,"slds-input-has-fixed-addon":_||v,"slds-has-divider_bottom":T}),...oe,children:[b,_&&(0,r.jsx)(`span`,{className:`slds-form-element__addon`,children:_}),!T&&(0,r.jsx)(`input`,{autoComplete:f,className:(0,n.default)(`slds-input`,{"slds-text-align_left":X===i&&H},p),disabled:g,id:S,min:k,minLength:O===void 0?void 0:Number(O),max:D,maxLength:E===void 0?void 0:Number(E),name:A,onBlur:j,onChange:M,onClick:N,onFocus:P,onInput:F,onInvalid:ie,onKeyDown:I,onKeyPress:L,onKeyUp:R,onSelect:z,onSubmit:B,placeholder:V,readOnly:H,ref:w,required:U,role:W,step:G,style:K,tabIndex:q===void 0?void 0:Number(q),type:J,...Q,value:Y}),y?(0,r.jsxs)(`div`,{className:`slds-input__icon-group slds-input__icon-group_right`,children:[(0,r.jsx)(ee.default,{assistiveText:{label:Z.spinner},id:$,isInput:!0,size:`x-small`,variant:`brand`}),x]}):x,v&&(0,r.jsx)(`span`,{className:`slds-form-element__addon`,children:v}),T&&(0,r.jsxs)(`span`,{className:(0,n.default)(`slds-form-element__static`,`slds-grid`,{"slds-grid_align-spread":X!==i}),onClick:N,children:[Y,C]})]})};a.displayName=`SLDSInnerInput`,exports.default=a;
|
|
2
2
|
//# sourceMappingURL=inner-input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-input.cjs","names":[],"sources":["../../../../../components/input/private/inner-input.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 type {\n\tReactNode,\n\tChangeEvent,\n\tFocusEvent,\n\tKeyboardEvent,\n\tMouseEvent,\n\tFormEvent,\n\tCSSProperties,\n\tAriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Spinner from '../../spinner';\nimport getAriaProps from '../../../utilities/get-aria-props';\n\nconst COUNTER = 'counter';\n\n/**\n * Input type options\n */\nexport type InnerInputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InnerInputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for InnerInput\n */\nexport interface InnerInputAssistiveText {\n\t/** Text for loading spinner */\n\tspinner?: string;\n}\n\n/**\n * Container props for the wrapper div\n */\nexport interface InnerInputContainerProps {\n\tclassName?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Props for the InnerInput component\n */\nexport interface InnerInputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InnerInputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** CSS classes for the input element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the container div */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Props for the container div */\n\tcontainerProps?: InnerInputContainerProps;\n\t/** Initial value for uncontrolled usage */\n\tdefaultValue?: string | number;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute (required) */\n\tid: string;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically */\n\tisStatic?: boolean;\n\t/** Label text */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for number input */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for number input */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for number input */\n\tstep?: number;\n\t/** Custom styles for input */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Input type */\n\ttype?: InnerInputType;\n\t/** Controlled value */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InnerInputVariant;\n}\n\nconst defaultAssistiveText: InnerInputAssistiveText = {\n\tspinner: 'Loading ...',\n};\n\n// Type for aria props returned from getAriaProps\ninterface AriaPropsResult {\n\t'aria-activedescendant'?: string;\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t'aria-controls'?: string;\n\t'aria-describedby'?: string;\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t'aria-labelledby'?: string;\n\t'aria-owns'?: string;\n\t'aria-required'?: boolean;\n}\n\n/**\n * Internal input component used by Input and Combobox.\n * This component's API is not public.\n */\nconst InnerInput = ({\n\t'aria-activedescendant': ariaActivedescendant,\n\t'aria-autocomplete': ariaAutocomplete,\n\t'aria-controls': ariaControls,\n\t'aria-describedby': ariaDescribedby,\n\t'aria-expanded': ariaExpanded,\n\t'aria-haspopup': ariaHaspopup,\n\t'aria-labelledby': ariaLabelledby,\n\t'aria-owns': ariaOwns,\n\t'aria-required': ariaRequired,\n\tassistiveText: propAssistiveText,\n\tautoComplete,\n\tclassName,\n\tcontainerClassName,\n\tcontainerProps = {},\n\tdefaultValue,\n\tdisabled,\n\tfixedTextLeft,\n\tfixedTextRight,\n\thasSpinner,\n\ticonLeft,\n\ticonRight,\n\tid,\n\tinlineEditTrigger,\n\tinputRef,\n\tisStatic,\n\tmaxLength,\n\tmaxValue,\n\tminLength,\n\tminValue,\n\tname,\n\tonBlur,\n\tonChange,\n\tonClick,\n\tonFocus,\n\tonInput,\n\tonInvalid,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonSelect,\n\tonSubmit,\n\tplaceholder,\n\treadOnly,\n\trequired,\n\trole,\n\tstep,\n\tstyle,\n\ttabIndex,\n\ttype = 'text',\n\tvalue,\n\tvariant,\n}: InnerInputProps) => {\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\tconst ariaProps: AriaPropsResult = getAriaProps({\n\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t'aria-controls': ariaControls,\n\t\t'aria-describedby': ariaDescribedby,\n\t\t'aria-expanded': ariaExpanded,\n\t\t'aria-haspopup': ariaHaspopup,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t'aria-owns': ariaOwns,\n\t\t'aria-required': ariaRequired,\n\t\tassistiveText,\n\t\ttype,\n\t});\n\n\tconst loadingStatusIconId = `${id}-loading-status-icon`;\n\n\t// Add spinner to aria-describedby if present\n\tif (hasSpinner && ariaProps['aria-describedby']) {\n\t\tariaProps['aria-describedby'] = `${loadingStatusIconId} ${ariaProps['aria-describedby']}`;\n\t} else if (hasSpinner) {\n\t\tariaProps['aria-describedby'] = loadingStatusIconId;\n\t}\n\n\tconst { className: containerPropsClassName, ...restContainerProps } = containerProps;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(containerPropsClassName, containerClassName, {\n\t\t\t\t'slds-input-has-icon': variant !== COUNTER && (iconLeft || iconRight),\n\t\t\t\t'slds-input-has-icon_left': iconLeft && !iconRight,\n\t\t\t\t'slds-input-has-icon_right': !iconLeft && iconRight,\n\t\t\t\t'slds-input-has-icon_left-right': variant !== COUNTER && iconLeft && iconRight,\n\t\t\t\t'slds-input-has-fixed-addon': fixedTextLeft || fixedTextRight,\n\t\t\t\t'slds-has-divider_bottom': isStatic,\n\t\t\t})}\n\t\t\t{...restContainerProps}\n\t\t>\n\t\t\t{iconLeft}\n\t\t\t{fixedTextLeft && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextLeft}</span>\n\t\t\t)}\n\n\t\t\t{!isStatic && (\n\t\t\t\t<input\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-input',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-text-align_left': variant === COUNTER && readOnly,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tmin={minValue}\n\t\t\t\t\tminLength={minLength !== undefined ? Number(minLength) : undefined}\n\t\t\t\t\tmax={maxValue}\n\t\t\t\t\tmaxLength={maxLength !== undefined ? Number(maxLength) : undefined}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tstep={step}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\ttabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined}\n\t\t\t\t\ttype={type}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t{...(value !== undefined\n\t\t\t\t\t\t? { value }\n\t\t\t\t\t\t: { defaultValue })}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{hasSpinner ? (\n\t\t\t\t<div className=\"slds-input__icon-group slds-input__icon-group_right\">\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tassistiveText={{ label: assistiveText.spinner }}\n\t\t\t\t\t\tid={loadingStatusIconId}\n\t\t\t\t\t\tisInput\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t/>\n\t\t\t\t\t{iconRight}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\ticonRight\n\t\t\t)}\n\n\t\t\t{fixedTextRight && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextRight}</span>\n\t\t\t)}\n\n\t\t\t{isStatic && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={classNames('slds-form-element__static', 'slds-grid', {\n\t\t\t\t\t\t'slds-grid_align-spread': variant !== COUNTER,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={onClick as unknown as (event: MouseEvent<HTMLSpanElement>) => void}\n\t\t\t\t>\n\t\t\t\t\t{value}\n\t\t\t\t\t{inlineEditTrigger}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nInnerInput.displayName = 'SLDSInnerInput';\n\nexport default InnerInput;\n"],"mappings":"oOAkBA,IAAM,EAAU,UAwJV,GAAgD,CACrD,QAAS,aACV,EAmBM,GAAc,CACnB,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,EACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,EACf,eACA,YACA,qBACA,iBAAiB,CAAC,EAClB,gBACA,YACA,gBACA,iBACA,aACA,WACA,YACA,KACA,oBACA,WACA,WACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,WACA,YACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,WACA,OACA,OACA,QACA,WACA,OAAO,OACP,QACA,aACsB,CACtB,IAAM,EAAgB,CAAE,GAAG,GAAsB,GAAG,CAAkB,EAEhE,EAA6B,EAAA,QAAa,CAC/C,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBA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EAAA,IAAA,CAAC,GAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,GAAI,EACJ,QAAA,GACA,KAAK,UACL,QAAQ,OACR,CAAA,EACA,CACG,CAEL,CAAA,EAAA,EAGA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAqB,CAAA,EAGjE,IACA,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,4BAA6B,YAAa,CAC/D,yBAA0B,IAAY,CACvC,CAAC,EACQ,UAJV,SAAA,CAME,EACA,CACI,GAEH,GAEP,EAEA,EAAW,YAAc"}
|
|
1
|
+
{"version":3,"file":"inner-input.cjs","names":[],"sources":["../../../../../components/input/private/inner-input.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 type {\n\tReactNode,\n\tChangeEvent,\n\tFocusEvent,\n\tKeyboardEvent,\n\tMouseEvent,\n\tFormEvent,\n\tCSSProperties,\n\tAriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Spinner from '../../spinner';\nimport getAriaProps from '../../../utilities/get-aria-props';\n\nconst COUNTER = 'counter';\n\n/**\n * Input type options\n */\nexport type InnerInputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InnerInputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for InnerInput\n */\nexport interface InnerInputAssistiveText {\n\t/** Text for loading spinner */\n\tspinner?: string;\n}\n\n/**\n * Container props for the wrapper div\n */\nexport interface InnerInputContainerProps {\n\tclassName?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Props for the InnerInput component\n */\nexport interface InnerInputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InnerInputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** CSS classes for the input element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the container div */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Props for the container div */\n\tcontainerProps?: InnerInputContainerProps;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute (required) */\n\tid: string;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically */\n\tisStatic?: boolean;\n\t/** Label text */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for number input */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for number input */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for number input */\n\tstep?: number;\n\t/** Custom styles for input */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Input type */\n\ttype?: InnerInputType;\n\t/** The input's value. Controlled: the parent updates it in `onChange`. */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InnerInputVariant;\n}\n\nconst defaultAssistiveText: InnerInputAssistiveText = {\n\tspinner: 'Loading ...',\n};\n\n// Type for aria props returned from getAriaProps\ninterface AriaPropsResult {\n\t'aria-activedescendant'?: string;\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t'aria-controls'?: string;\n\t'aria-describedby'?: string;\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t'aria-labelledby'?: string;\n\t'aria-owns'?: string;\n\t'aria-required'?: boolean;\n}\n\n/**\n * Internal input component used by Input and Combobox.\n * This component's API is not public.\n */\nconst InnerInput = ({\n\t'aria-activedescendant': ariaActivedescendant,\n\t'aria-autocomplete': ariaAutocomplete,\n\t'aria-controls': ariaControls,\n\t'aria-describedby': ariaDescribedby,\n\t'aria-expanded': ariaExpanded,\n\t'aria-haspopup': ariaHaspopup,\n\t'aria-labelledby': ariaLabelledby,\n\t'aria-owns': ariaOwns,\n\t'aria-required': ariaRequired,\n\tassistiveText: propAssistiveText,\n\tautoComplete,\n\tclassName,\n\tcontainerClassName,\n\tcontainerProps = {},\n\tdisabled,\n\tfixedTextLeft,\n\tfixedTextRight,\n\thasSpinner,\n\ticonLeft,\n\ticonRight,\n\tid,\n\tinlineEditTrigger,\n\tinputRef,\n\tisStatic,\n\tmaxLength,\n\tmaxValue,\n\tminLength,\n\tminValue,\n\tname,\n\tonBlur,\n\tonChange,\n\tonClick,\n\tonFocus,\n\tonInput,\n\tonInvalid,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonSelect,\n\tonSubmit,\n\tplaceholder,\n\treadOnly,\n\trequired,\n\trole,\n\tstep,\n\tstyle,\n\ttabIndex,\n\ttype = 'text',\n\tvalue,\n\tvariant,\n}: InnerInputProps) => {\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\tconst ariaProps: AriaPropsResult = getAriaProps({\n\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t'aria-controls': ariaControls,\n\t\t'aria-describedby': ariaDescribedby,\n\t\t'aria-expanded': ariaExpanded,\n\t\t'aria-haspopup': ariaHaspopup,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t'aria-owns': ariaOwns,\n\t\t'aria-required': ariaRequired,\n\t\tassistiveText,\n\t\ttype,\n\t});\n\n\tconst loadingStatusIconId = `${id}-loading-status-icon`;\n\n\t// Add spinner to aria-describedby if present\n\tif (hasSpinner && ariaProps['aria-describedby']) {\n\t\tariaProps['aria-describedby'] =\n\t\t\t`${loadingStatusIconId} ${ariaProps['aria-describedby']}`;\n\t} else if (hasSpinner) {\n\t\tariaProps['aria-describedby'] = loadingStatusIconId;\n\t}\n\n\tconst { className: containerPropsClassName, ...restContainerProps } =\n\t\tcontainerProps;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(containerPropsClassName, containerClassName, {\n\t\t\t\t'slds-input-has-icon': variant !== COUNTER && (iconLeft || iconRight),\n\t\t\t\t'slds-input-has-icon_left': iconLeft && !iconRight,\n\t\t\t\t'slds-input-has-icon_right': !iconLeft && iconRight,\n\t\t\t\t'slds-input-has-icon_left-right':\n\t\t\t\t\tvariant !== COUNTER && iconLeft && iconRight,\n\t\t\t\t'slds-input-has-fixed-addon': fixedTextLeft || fixedTextRight,\n\t\t\t\t'slds-has-divider_bottom': isStatic,\n\t\t\t})}\n\t\t\t{...restContainerProps}\n\t\t>\n\t\t\t{iconLeft}\n\t\t\t{fixedTextLeft && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextLeft}</span>\n\t\t\t)}\n\n\t\t\t{!isStatic && (\n\t\t\t\t<input\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-input',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-text-align_left': variant === COUNTER && readOnly,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tmin={minValue}\n\t\t\t\t\tminLength={minLength !== undefined ? Number(minLength) : undefined}\n\t\t\t\t\tmax={maxValue}\n\t\t\t\t\tmaxLength={maxLength !== undefined ? Number(maxLength) : undefined}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tstep={step}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\ttabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined}\n\t\t\t\t\ttype={type}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\tvalue={value}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{hasSpinner ? (\n\t\t\t\t<div className=\"slds-input__icon-group slds-input__icon-group_right\">\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tassistiveText={{ label: assistiveText.spinner }}\n\t\t\t\t\t\tid={loadingStatusIconId}\n\t\t\t\t\t\tisInput\n\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t/>\n\t\t\t\t\t{iconRight}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\ticonRight\n\t\t\t)}\n\n\t\t\t{fixedTextRight && (\n\t\t\t\t<span className=\"slds-form-element__addon\">{fixedTextRight}</span>\n\t\t\t)}\n\n\t\t\t{isStatic && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={classNames('slds-form-element__static', 'slds-grid', {\n\t\t\t\t\t\t'slds-grid_align-spread': variant !== COUNTER,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\tonClick as unknown as (event: MouseEvent<HTMLSpanElement>) => void\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{value}\n\t\t\t\t\t{inlineEditTrigger}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nInnerInput.displayName = 'SLDSInnerInput';\n\nexport default InnerInput;\n"],"mappings":"oOAkBA,IAAM,EAAU,UAsJV,GAAgD,CACrD,QAAS,aACV,EAmBM,GAAc,CACnB,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,EACf,eACA,YACA,qBACA,iBAAiB,CAAC,EAClB,WACA,gBACA,iBACA,aACA,WACA,YACA,KACA,oBACA,WACA,WACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,aACA,YACA,aACA,UACA,WACA,WACA,cACA,WACA,WACA,OACA,OACA,QACA,WACA,OAAO,OACP,QACA,aACsB,CACtB,IAAM,EAAgB,CAAE,GAAG,GAAsB,GAAG,CAAkB,EAEhE,EAA6B,EAAA,QAAa,CAC/C,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,EACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,gBACA,MACD,CAAC,EAEK,EAAsB,GAAG,EAAG,sBAG9B,GAAc,EAAU,oBAC3B,EAAU,oBACT,GAAG,EAAoB,GAAG,EAAU,sBAC3B,IACV,EAAU,oBAAsB,GAGjC,GAAM,CAAE,UAAW,GAAyB,GAAG,IAC9C,EAED,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,GAAyB,EAAoB,CAClE,sBAAuB,IAAY,IAAY,GAAY,GAC3D,2BAA4B,GAAY,CAAC,EACzC,4BAA6B,CAAC,GAAY,EAC1C,iCACC,IAAY,GAAW,GAAY,EACpC,6BAA8B,GAAiB,EAC/C,0BAA2B,CAC5B,CAAC,EACD,GAAI,GAVL,SAAA,CAYE,EACA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAoB,CAAA,EAGhE,CAAC,IACD,EAAA,EAAA,IAAA,CAAC,QAAD,CACe,eACd,WAAA,EAAW,EAAA,QAAA,CACV,aACA,CACC,uBAAwB,IAAY,GAAW,CAChD,EACA,CACD,EACU,WACN,KACJ,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EACrD,IAAK,EACL,UAAW,IAAc,IAAA,GAAgC,IAAA,GAApB,OAAO,CAAS,EAC/C,OACE,SACE,WACD,UACA,UACA,UACE,aACA,YACC,aACH,UACC,WACA,WACG,cACH,WACV,IAAK,EACK,WACJ,OACA,OACC,QACP,SAAU,IAAa,IAAA,GAA+B,IAAA,GAAnB,OAAO,CAAQ,EAC5C,OACN,GAAI,EACG,OACP,CAAA,EAGD,GACA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sDAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,OAAQ,EAC9C,GAAI,EACJ,QAAA,GACA,KAAK,UACL,QAAQ,OACR,CAAA,EACA,CACG,CAEL,CAAA,EAAA,EAGA,IACA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAA,CAAqB,CAAA,EAGjE,IACA,EAAA,EAAA,KAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,4BAA6B,YAAa,CAC/D,yBAA0B,IAAY,CACvC,CAAC,EAEA,UALF,SAAA,CAQE,EACA,CACI,GAEH,GAEP,EAEA,EAAW,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=(0,r.forwardRef)((e,t)=>{let{assistiveText:o,children:s,className:c,disabled:l,hint:u,iconCategory:d,iconName:f,iconPosition:p,iconSize:m,iconVariant:h,id:g,inverse:_,isInline:v,isOpen:y,label:b,onBlur:x,menu:S,onClick:C,onFocus:w,onKeyDown:T,onMouseDown:E,onMouseEnter:D,onMouseLeave:O,openOn:k,style:A,tabIndex:j,tooltip:M,triggerRef:N,triggerClassName:P,variant:F}=e,I=k===`hover`?`click`:k,L={};return r.default.Children.count(s)!==0&&r.default.Children.forEach(s,e=>{e&&r.default.isValidElement(e)&&e.type?.displayName===n.default.displayName
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=(0,r.forwardRef)((e,t)=>{let{assistiveText:o,children:s,className:c,disabled:l,hint:u,iconCategory:d,iconName:f,iconPosition:p,iconSize:m,iconVariant:h,id:g,inverse:_,isInline:v,isOpen:y,label:b,onBlur:x,menu:S,onClick:C,onFocus:w,onKeyDown:T,onMouseDown:E,onMouseEnter:D,onMouseLeave:O,openOn:k,style:A,tabIndex:j,tooltip:M,triggerRef:N,triggerClassName:P,variant:F}=e,I=k===`hover`?`click`:k,L={};return r.default.Children.count(s)!==0&&r.default.Children.forEach(s,e=>{if(e&&r.default.isValidElement(e)&&e.type?.displayName===n.default.displayName){let t=e.props;L=t.label&&t.assistiveText===void 0?{assistiveText:{icon:``},...t}:t}}),(0,a.jsxs)(`div`,{ref:t,className:(0,i.default)(`slds-dropdown-trigger slds-dropdown-trigger_${I}`,{"slds-is-open":y},P),id:g,onBlur:x,onClick:C,onKeyDown:T,onFocus:w,onMouseDown:E,onMouseEnter:D,onMouseLeave:O,children:[(0,a.jsx)(n.default,{assistiveText:o,className:c,disabled:l,hint:u,iconCategory:d,iconName:f,iconPosition:p,iconSize:m,iconVariant:h,inverse:_,label:b,style:A,tabIndex:j,tooltip:M,variant:F,"aria-expanded":y,"aria-haspopup":!0,...L,buttonRef:N}),S]})});o.displayName=t.MENU_DROPDOWN_TRIGGER,exports.default=o;
|
|
2
2
|
//# sourceMappingURL=button-trigger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-trigger.cjs","names":[],"sources":["../../../../components/menu-dropdown/button-trigger.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// # Dropdown Trigger Component (Simple Button Flavor) --- SLDS for React\n\nimport React, { forwardRef, type ReactElement, type ReactNode } from 'react';\nimport classnames from 'classnames';\n\nimport Button from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** Child elements (typically a Button) */\n\tchildren?: ReactElement;\n\t/** CSS classes to be added to triggering button */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** A unique ID for accessibility support */\n\tid?: string;\n\t/** Whether the dropdown is inline */\n\tisInline?: boolean;\n\t/** Informs the trigger on the open/close state of the dropdown menu */\n\tisOpen?: boolean;\n\t/** The dropdown menu to render */\n\tmenu?: ReactNode;\n\t/** Called when the trigger button loses focus */\n\tonBlur?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when the trigger button gains focus */\n\tonFocus?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Called when a key is pressed */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** The ref of the actual triggering button */\n\ttriggerRef?: (element: HTMLButtonElement | null) => void;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon category passed from MenuDropdown */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Icon name passed from MenuDropdown */\n\ticonName?: string;\n\t/** Icon position passed from MenuDropdown */\n\ticonPosition?: 'left' | 'right';\n\t/** Icon size passed from MenuDropdown */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** Icon variant passed from MenuDropdown */\n\ticonVariant?: 'bare' | 'container' | 'border' | 'border-filled' | 'more';\n\t/** Button variant passed from MenuDropdown */\n\tvariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** Whether to show hint styling */\n\thint?: boolean;\n\t/** Whether the button is inverse */\n\tinverse?: boolean;\n\t/** Button label */\n\tlabel?: string | ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Tooltip */\n\ttooltip?: ReactNode;\n\t/** Tab index */\n\ttabIndex?: string;\n\t/** Button style */\n\tstyle?: React.CSSProperties;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu.\n * If this component has children, it does not render itself to the DOM.\n * Instead, it renders its child element, `Button`, and all that child's properties.\n * This component may be used as a template to create custom triggers that do not use `Button`.\n */\nconst ButtonTrigger = forwardRef<HTMLDivElement, ButtonTriggerProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled,\n\t\t\thint,\n\t\t\ticonCategory,\n\t\t\ticonName,\n\t\t\ticonPosition,\n\t\t\ticonSize,\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tisInline: _isInline,\n\t\t\tisOpen,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tmenu,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\topenOn: openOnProp,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttooltip,\n\t\t\ttriggerRef,\n\t\t\ttriggerClassName,\n\t\t\tvariant,\n\t\t} = props;\n\n\t\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t\t// Trigger manipulation\n\t\tlet propsFromGrandchildButton: Record<string, unknown> = {};\n\n\t\t// If there are children, extract props from the Button child\n\t\tif (React.Children.count(children) !== 0) {\n\t\t\tReact.Children.forEach(children, (child) => {\n\t\t\t\tif (\n\t\t\t\t\tchild &&\n\t\t\t\t\tReact.isValidElement(child) &&\n\t\t\t\t\t(child.type as { displayName?: string })?.displayName ===\n\t\t\t\t\t\tButton.displayName\n\t\t\t\t) {\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"button-trigger.cjs","names":[],"sources":["../../../../components/menu-dropdown/button-trigger.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// # Dropdown Trigger Component (Simple Button Flavor) --- SLDS for React\n\nimport React, { forwardRef, type ReactElement, type ReactNode } from 'react';\nimport classnames from 'classnames';\n\nimport Button from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** Child elements (typically a Button) */\n\tchildren?: ReactElement;\n\t/** CSS classes to be added to triggering button */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** A unique ID for accessibility support */\n\tid?: string;\n\t/** Whether the dropdown is inline */\n\tisInline?: boolean;\n\t/** Informs the trigger on the open/close state of the dropdown menu */\n\tisOpen?: boolean;\n\t/** The dropdown menu to render */\n\tmenu?: ReactNode;\n\t/** Called when the trigger button loses focus */\n\tonBlur?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when the trigger button gains focus */\n\tonFocus?: React.FocusEventHandler<HTMLDivElement>;\n\t/** Called when a key is pressed */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: React.MouseEventHandler<HTMLDivElement>;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** The ref of the actual triggering button */\n\ttriggerRef?: (element: HTMLButtonElement | null) => void;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon category passed from MenuDropdown */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Icon name passed from MenuDropdown */\n\ticonName?: string;\n\t/** Icon position passed from MenuDropdown */\n\ticonPosition?: 'left' | 'right';\n\t/** Icon size passed from MenuDropdown */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** Icon variant passed from MenuDropdown */\n\ticonVariant?: 'bare' | 'container' | 'border' | 'border-filled' | 'more';\n\t/** Button variant passed from MenuDropdown */\n\tvariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** Whether to show hint styling */\n\thint?: boolean;\n\t/** Whether the button is inverse */\n\tinverse?: boolean;\n\t/** Button label */\n\tlabel?: string | ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Tooltip */\n\ttooltip?: ReactNode;\n\t/** Tab index */\n\ttabIndex?: string;\n\t/** Button style */\n\tstyle?: React.CSSProperties;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu.\n * If this component has children, it does not render itself to the DOM.\n * Instead, it renders its child element, `Button`, and all that child's properties.\n * This component may be used as a template to create custom triggers that do not use `Button`.\n */\nconst ButtonTrigger = forwardRef<HTMLDivElement, ButtonTriggerProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tassistiveText,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled,\n\t\t\thint,\n\t\t\ticonCategory,\n\t\t\ticonName,\n\t\t\ticonPosition,\n\t\t\ticonSize,\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tisInline: _isInline,\n\t\t\tisOpen,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tmenu,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\topenOn: openOnProp,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttooltip,\n\t\t\ttriggerRef,\n\t\t\ttriggerClassName,\n\t\t\tvariant,\n\t\t} = props;\n\n\t\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t\t// Trigger manipulation\n\t\tlet propsFromGrandchildButton: Record<string, unknown> = {};\n\n\t\t// If there are children, extract props from the Button child\n\t\tif (React.Children.count(children) !== 0) {\n\t\t\tReact.Children.forEach(children, (child) => {\n\t\t\t\tif (\n\t\t\t\t\tchild &&\n\t\t\t\t\tReact.isValidElement(child) &&\n\t\t\t\t\t(child.type as { displayName?: string })?.displayName ===\n\t\t\t\t\t\tButton.displayName\n\t\t\t\t) {\n\t\t\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\t\t\t// A labelled child Button keeps its label. Otherwise the\n\t\t\t\t\t// Dropdown's `assistiveText.icon` makes Button render icon-only.\n\t\t\t\t\tpropsFromGrandchildButton =\n\t\t\t\t\t\tchildProps.label && childProps.assistiveText === undefined\n\t\t\t\t\t\t\t? { assistiveText: { icon: '' }, ...childProps }\n\t\t\t\t\t\t\t: childProps;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// If Trigger has a Button child, then use the explicitly declared child's props\n\t\t// layered on top of those passed down by dropdown's props to allow manual override\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classnames(\n\t\t\t\t\t`slds-dropdown-trigger slds-dropdown-trigger_${openOn}`,\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t\t},\n\t\t\t\t\ttriggerClassName as string | string[] | Record<string, boolean>\n\t\t\t\t)}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tonClick={onClick}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\thint={hint}\n\t\t\t\t\ticonCategory={iconCategory}\n\t\t\t\t\ticonName={iconName}\n\t\t\t\t\ticonPosition={iconPosition}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\ticonVariant={iconVariant}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\ttooltip={tooltip}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\taria-expanded={isOpen}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\t{...propsFromGrandchildButton}\n\t\t\t\t\tbuttonRef={triggerRef}\n\t\t\t\t/>\n\t\t\t\t{menu}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nButtonTrigger.displayName = MENU_DROPDOWN_TRIGGER;\n\nexport default ButtonTrigger;\n"],"mappings":"4PAgFA,IAAM,GAAA,EAAgB,EAAA,WAAA,EACpB,EAAO,IAAQ,CACf,GAAM,CACL,gBACA,WACA,YACA,WACA,OACA,eACA,WACA,eACA,WACA,cACA,KACA,UACA,SAAU,EACV,SACA,QACA,SACA,OACA,UACA,UACA,YACA,cACA,eACA,eACA,OAAQ,EACR,QACA,WACA,UACA,aACA,mBACA,WACG,EAEE,EAAS,IAAe,QAAU,QAAU,EAG9C,EAAqD,CAAC,EAwB1D,OArBI,EAAA,QAAM,SAAS,MAAM,CAAQ,IAAM,GACtC,EAAA,QAAM,SAAS,QAAQ,EAAW,GAAU,CAC3C,GACC,GACA,EAAA,QAAM,eAAe,CAAK,GACzB,EAAM,MAAmC,cACzC,EAAA,QAAO,YACP,CACD,IAAM,EAAa,EAAM,MAGzB,EACC,EAAW,OAAS,EAAW,gBAAkB,IAAA,GAC9C,CAAE,cAAe,CAAE,KAAM,EAAG,EAAG,GAAG,CAAW,EAC7C,CACL,CACD,CAAC,GAMD,EAAA,EAAA,KAAA,CAAC,MAAD,CACM,MACL,WAAA,EAAW,EAAA,QAAA,CACV,+CAA+C,IAC/C,CACC,eAAgB,CACjB,EACA,CACD,EACI,KACI,SACC,UACE,YACF,UACI,cACC,eACA,eAhBf,SAAA,EAkBC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACgB,gBACJ,YACD,WACJ,OACQ,eACJ,WACI,eACJ,WACG,cACJ,UACF,QACA,QACG,WACD,UACA,UACT,gBAAe,EACf,gBAAA,GACA,GAAI,EACJ,UAAW,CACX,CAAA,EACA,CACG,GAEP,CACD,EAEA,EAAc,YAAc,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/menu-dropdown/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// MenuDropdown is now a React 19 compatible functional component\n// that handles click outside detection internally without react-onclickoutside\n\nimport MenuDropdown from './menu-dropdown';\n\nexport default MenuDropdown;\nexport type {\n\tMenuDropdownProps,\n\tMenuDropdownOption,\n\tMenuDropdownItemOption,\n\tMenuDropdownHeaderOption,\n\tMenuDropdownDividerOption,\n\tMenuDropdownOptionIcon,\n\tDropdownNubbinPosition,\n\tMenuDropdownRenderMenuItemData,\n\tMenuDropdownSelectData,\n\tMenuDropdownOpenData,\n\tMenuDropdownOpenEvent,\n\tMenuDropdownCloseData,\n\tMenuDropdownCloseEvent,\n} from './menu-dropdown';\nexport {\n\tDropdownNubbinPositions,\n\tListItem,\n\tListItemLabel,\n} from './menu-dropdown';\n"],"mappings":"sOAQA,IAAA,EAAe,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/menu-dropdown/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// MenuDropdown is now a React 19 compatible functional component\n// that handles click outside detection internally without react-onclickoutside\n\nimport MenuDropdown from './menu-dropdown';\n\nexport default MenuDropdown;\nexport type {\n\tMenuDropdownProps,\n\tMenuDropdownOption,\n\tMenuDropdownItemOption,\n\tMenuDropdownHeaderOption,\n\tMenuDropdownDividerOption,\n\tMenuDropdownOptionIcon,\n\tDropdownNubbinPosition,\n\tMenuDropdownRenderMenuItemData,\n\tMenuDropdownSelectData,\n\tMenuDropdownOpenData,\n\tMenuDropdownOpenEvent,\n\tMenuDropdownCloseData,\n\tMenuDropdownCloseEvent,\n\tMenuDropdownRequestOpenData,\n\tMenuDropdownRequestCloseData,\n\tMenuDropdownValue,\n} from './menu-dropdown';\nexport {\n\tDropdownNubbinPositions,\n\tListItem,\n\tListItemLabel,\n} from './menu-dropdown';\n"],"mappings":"sOAQA,IAAA,EAAe,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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"),
|
|
1
|
+
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"),a=require("../../utilities/generate-id.cjs"),o=require("../../utilities/key-code.cjs"),ee=require("../utilities/dialog/index.cjs"),s=require("../utilities/menu-list/item-label.cjs"),c=require("../utilities/menu-list/item.cjs"),te=require("../utilities/menu-list/index.cjs"),ne=require("./button-trigger.cjs"),re=require("./check-props.cjs"),ie=require("./component.cjs"),ae=require("../../utilities/keyboard-navigate.cjs"),oe=require("../../utilities/key-buffer.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"),f=require("lodash.isfunction");f=e.__toESM(f,1);var se=te.default,p=typeof document<`u`,m=p?document.createElement(`span`):{style:{}};p&&(m.style.top=`0`,m.style.left=`0`,m.style.width=`100%`,m.style.height=`100%`,m.style.position=`absolute`);var h,ce=[`top left`,`top`,`top right`,`bottom left`,`bottom`,`bottom right`],le=()=>{},ue=e=>e.type!==`header`&&e.type!==`divider`&&!e.disabled,de=e=>{let t=[];return t.indexes=[],t.keyBuffer=new oe.default,Array.isArray(e)&&e.forEach((e,n)=>{ue(e)&&(t.push({index:n,text:`${e.label}`.toLowerCase()}),t.indexes.push(n))}),t},fe={top:`bottom`,"top left":`bottom left`,"top right":`bottom right`,bottom:`top`,"bottom left":`top left`,"bottom right":`top right`},g=e=>{let{align:c=`left`,assistiveText:te,buttonClassName:oe,buttonInverse:ce,buttonVariant:ue,checkmark:g,children:pe,className:me,containerClassName:he,defaultIsOpen:ge,disabled:_e,hasStaticAlignment:ve,hint:ye,hoverCloseDelay:be=300,iconCategory:xe,iconName:Se,iconPosition:Ce,iconSize:we,iconVariant:_,id:Te,inheritTargetWidth:Ee,inverse:De=!1,isInline:Oe,isOpen:ke,label:Ae,length:je=`5`,listItemRenderer:Me,renderMenuItem:Ne,menuPosition:Pe=`absolute`,menuStyle:Fe,multiple:v,nubbinPosition:y,offset:Ie,onBlur:Le,onClick:b,onClose:x,onFocus:Re,onKeyDown:ze,onMouseDown:Be,onMouseEnter:Ve,onMouseLeave:He,onOpen:S,onRequestClose:Ue,onRequestOpen:We,onSelect:C,openOn:w=`click`,options:T,overlay:E,requestFocus:Ge,onRequestFocus:D,style:Ke,tabIndex:qe,tooltip:Je,tooltipMenuItem:Ye,triggerClassName:Xe,value:O,width:Ze=`medium`}=e,Qe=(0,l.useContext)(n.IconSettingsContext),$e=(0,l.useMemo)(()=>a.default(),[]),k=(0,l.useCallback)(()=>Te||$e,[Te,$e]),[A,j,M]=i.useControllableState(ke,ge??!1),[N,et]=(0,l.useState)(-1),[P,tt]=(0,l.useState)(!1),F=(0,l.useRef)(null),nt=(0,l.useRef)(null),rt=(0,l.useRef)(null),I=(0,l.useRef)({}),L=(0,l.useRef)(!1),it=(0,l.useRef)(!1),R=(0,l.useRef)(null),z=(0,l.useRef)(null),at=(0,l.useMemo)(()=>de(T),[T]);(0,l.useEffect)(()=>{re.default(t.MENU_DROPDOWN,e,ie.default)},[e]);let B=(0,l.useCallback)(()=>!!A,[A]),V=!_e&&B()&&P,H=(0,l.useCallback)((e,t)=>e===void 0||!t?-1:t.findIndex(t=>t&&t.value===e),[]),U=(0,l.useMemo)(()=>Array.isArray(O)?O:O===void 0?[]:[O],[O]),ot=!v&&!Array.isArray(O)?H(O,T):-1,st=(0,l.useMemo)(()=>v?U.map(e=>H(e,T)).filter(e=>e!==-1):[],[v,U,H,T]),ct=(0,l.useCallback)(e=>{let t=e?.value;return v?t===void 0?[...U]:U.includes(t)?U.filter(e=>e!==t):[...U,t]:t},[v,U]),lt=Oe?`relative`:Pe,ut=(0,l.useCallback)(e=>{if(e!==void 0)return`${k()}-item-${e}`},[k]),dt=(0,l.useCallback)(()=>Me||s.default,[Me]),ft=(0,l.useMemo)(()=>Ne?({data:e,icon:t,index:n,isSelected:r})=>Ne({icon:t,isSelected:!!r,option:e,optionIndex:n??0}):void 0,[Ne]),W=(0,l.useCallback)(()=>{!L.current&&!it.current&&F.current&&F.current.focus()},[]),pt=(0,l.useCallback)(()=>rt.current,[]),mt=(0,l.useCallback)(e=>e!==void 0&&I.current&&I.current[e]||null,[]),ht=(0,l.useRef)(()=>{}),gt=(0,l.useRef)(!!A&&!_e),G=(0,l.useRef)(null),_t=(0,l.useRef)(void 0),vt=(0,l.useRef)(S),yt=(0,l.useRef)(x);(0,l.useEffect)(()=>{vt.current=S,yt.current=x},[S,x]);let K=(0,l.useCallback)((e,t)=>{if(gt.current===e)return;let n=G.current,r=t??(n&&n.isOpen===e?n.event:void 0);G.current=null,gt.current=e,e?(_t.current=r,vt.current?.(r,{})):yt.current?.(r,{})},[]),q=(0,l.useCallback)(e=>{B()&&(L.current=!1,M&&(G.current={isOpen:!1,event:e}),Ue?.(e,{}),M||(j(!1),K(!1,e)))},[B,M,Ue,j,K]),bt=(0,l.useCallback)((e,t)=>{t?.componentWillUnmount&>.current&&(L.current=!1,j(!1),K(!1,e))},[j,K]);ht.current=q;let J=(0,l.useCallback)(e=>{B()||(M&&(G.current={isOpen:!0,event:e}),We?.(e,{}),M||(j(!0),K(!0,e)))},[B,M,We,j,K]);(0,l.useEffect)(()=>{V&&K(!0)},[V,K]);let xt=(0,l.useRef)({handleClose:e=>ht.current(e)});(0,l.useEffect)(()=>{let e=xt.current;V?(h&&h!==e&&h.handleClose(_t.current),h=e):h===e&&(h=void 0)},[V]);let Y=(0,l.useCallback)(e=>{let t=e.target,n=nt.current;if(n&&!n.contains(t)){let n=`ignore-click-${k()}`;if(t instanceof Element&&(t.classList?.contains(n)||t.closest(`.${n}`)||t.closest(`.ignore-react-onclickoutside`)))return;q(e)}},[k,q]);(0,l.useEffect)(()=>(V&&(document.addEventListener(`mousedown`,Y),document.addEventListener(`touchstart`,Y)),()=>{document.removeEventListener(`mousedown`,Y),document.removeEventListener(`touchstart`,Y)}),[V,Y]);let St=(0,l.useCallback)(e=>{W(),B()?q(e):J(e)},[B,q,J,W]),Ct=(0,l.useCallback)(e=>{B()?q(e):(J(e),W()),b?.(e)},[B,J,q,W,b]),wt=(0,l.useCallback)(e=>{Re?.(e)},[Re]),Tt=(0,l.useCallback)(e=>{L.current=!0,!B()&&w===`hover`?J(e):R.current&&clearTimeout(R.current),Ve?.(e)},[B,w,J,Ve]),Et=(0,l.useCallback)(e=>{B()&&(R.current=setTimeout(()=>{q()},be)),He?.(e)},[B,be,q,He]),X=(0,l.useCallback)((e,t)=>{if(v||(q(t),W()),C&&T){let n=T[e];C(t,{option:n,optionIndex:e,value:ct(n)})}},[v,q,W,C,T,ct]),Dt=(0,l.useCallback)(e=>{let t=e.getElementsByTagName(`a`)[0];t&&t.focus()},[]),Ot=(0,l.useCallback)((e,t)=>{if(e&&t){let n=e.offsetHeight,r=e.scrollTop,i=t.offsetTop-e.offsetTop;if(i<r)e.scrollTop=i;else{let a=r+n+e.offsetTop,o=i+t.offsetHeight+e.offsetTop;o>a&&(e.scrollTop=o-n-e.offsetTop)}}},[]),Z=(0,l.useCallback)(e=>{N!==e&&e!==void 0&&et(e);let t=pt(),n=mt(e??-1);n&&(Dt(n),Ot(t,n))},[N,pt,mt,Dt,Ot]),kt=(0,l.useMemo)(()=>({trigger:F.current,handleClick:e=>{Ct(e)}}),[Ct]),At=(0,l.useCallback)(({event:e,isOpen:t=!0,keyCode:n,onFocus:r=Z,onSelect:i,target:a,toggleOpen:o=le})=>{ae.default({componentContext:kt,currentFocusedIndex:N,event:e,isOpen:t,key:e.key,keyCode:n,navigableItems:at,onFocus:r,onSelect:i,target:a,toggleOpen:o})},[kt,N,Z,at]),Q=(0,l.useCallback)(e=>{W(),q(e)},[W,q]),jt=(0,l.useCallback)(e=>{e.keyCode&&(e.keyCode===o.default.TAB?Q(e):(e.keyCode===o.default.ENTER||e.keyCode===o.default.SPACE||e.keyCode===o.default.DOWN||e.keyCode===o.default.UP||e.keyCode===o.default.ESCAPE)&&(r.default.trap(e),At({event:e,isOpen:B(),keyCode:e.keyCode,onSelect:t=>X(t,e),target:e.target,toggleOpen:()=>St(e)})),ze?.(e))},[Q,At,B,X,St,ze]),Mt=(0,l.useCallback)(e=>{W(),q(e)},[W,q]),Nt=(0,l.useCallback)(e=>{F.current=e,!P&&e&&tt(!0),e&&Ge&&D&&D(e)},[P,Ge,D]),Pt=(0,l.useCallback)(e=>{nt.current=e,F.current||=e?.querySelector(`button`)||null},[]),Ft=(0,l.useCallback)(e=>{rt.current=e},[]),It=(0,l.useCallback)((e,t)=>{I.current[t]=e,t===N&&e&&Z(N)},[N,Z]),$=(0,l.useCallback)(e=>{(0,f.default)(E)&&p?E(e,m):E&&e&&!z.current&&p?(z.current=m,document.querySelector(`body`)?.appendChild(m)):!e&&z.current?.parentNode&&(z.current.parentNode.removeChild(z.current),z.current=null)},[E]);(0,l.useEffect)(()=>{$(V)},[V,$]),(0,l.useEffect)(()=>{let e=xt.current;return()=>{it.current=!0,h===e&&(h=void 0),$(!1),R.current&&clearTimeout(R.current)}},[$]);let Lt=(0,l.useCallback)(e=>(0,d.jsx)(se,{checkmark:g,getListItemId:ut,itemRefs:It,itemRenderer:dt(),renderItemLabel:ft,onCancel:Q,onSelect:X,options:T,ref:Ft,selectedIndex:v?void 0:ot,selectedIndices:v?st:void 0,tooltipMenuItem:Ye,triggerId:k(),length:je,...e},`${k()}-dropdown-list`),[k,g,ut,It,dt,ft,Q,X,T,Ft,v,ot,st,Ye,je]),Rt=(0,l.useCallback)(e=>{let t=[];return e&&l.default.Children.forEach(e,e=>{if(e&&typeof e==`object`&&`type`in e&&e.type?.displayName===`SLDSList`)t.push(Lt(e.props));else if(e){let n=l.default.cloneElement(e,{onClick:Mt,key:a.default()});t.push(n)}}),t.length>0?t:Lt()},[Lt,Mt]),zt=(0,l.useCallback)((e,t,n)=>{let r=`bottom`,i=!1,a=``;y?(i=!0,r=fe[y]):c&&(r=c===`center`?`bottom`:`bottom ${c}`);let o=fe[r]?.split(` `)||[];a=(0,u.default)(o.map(e=>`slds-dropdown_${e}`));let s={};return c===`center`&&!i&&(s.transform=`none`),t?(0,d.jsx)(ee.default,{align:r,className:(0,u.default)(he),closeOnTabKey:!0,contentsClassName:(0,u.default)(`slds-dropdown`,`slds-dropdown_${Ze}`,`slds-text-align_left`,`ignore-react-onclickoutside`,me,a,{"slds-dropdown_inverse":De}),context:Qe,hasNubbin:i,hasStaticAlignment:ve,inheritWidthOf:Ee?`target`:`none`,offset:Ie,onClose:bt,onKeyDown:jt,outsideClickIgnoreClass:n,position:lt,style:{...s,...Fe},onRequestTargetElement:()=>F.current,children:Rt(e)}):null},[y,c,he,me,De,Qe,ve,Ee,Ie,bt,jt,lt,Fe,Ze,Rt]),Bt=ne.default,Vt={},Ht=[];l.default.Children.forEach(pe,e=>{e&&typeof e==`object`&&`type`in e&&e.type?.displayName===`SLDSMenuDropdownTrigger`?(Vt=e.props,Bt=e.type):e&&Ht.push(e)});let Ut=`ignore-click-${k()}`,Wt=_===`bare-inverse`||_===`border-inverse`,Gt=_===`bare-inverse`?`bare`:_===`border-inverse`?`border`:_;return(0,d.jsx)(Bt,{ref:Pt,"aria-haspopup":!0,assistiveText:te,className:(0,u.default)(Ut,oe),disabled:_e,hint:ye,iconCategory:xe,iconName:Se,iconPosition:Ce,iconSize:we,iconVariant:Gt,id:k(),inverse:ce||Wt,isOpen:V,label:Ae,menu:zt(Ht.length>0?Ht:null,V,Ut),onBlur:Le,onClick:w===`click`||w===`hybrid`?Ct:b,onFocus:wt,onKeyDown:jt,onMouseDown:Be,onMouseEnter:w===`hover`||w===`hybrid`?Tt:void 0,onMouseLeave:w===`hover`||w===`hybrid`?Et:void 0,openOn:w,style:Ke,tabIndex:qe||(V?`-1`:`0`),tooltip:Je,triggerClassName:Xe,triggerRef:Nt,variant:ue,...Vt})};g.displayName=t.MENU_DROPDOWN,exports.DropdownNubbinPositions=ce,exports.ListItem=c.default,exports.ListItemLabel=s.default,exports.default=g;
|
|
2
2
|
//# sourceMappingURL=menu-dropdown.cjs.map
|