@salesforce/design-system-react 11.0.0-rc.0 → 11.0.0-rc.1
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/README.md +18 -0
- package/dist/cjs/components/alert/index.cjs +1 -1
- package/dist/cjs/components/alert/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
- package/dist/cjs/components/button/check-props.cjs +1 -1
- package/dist/cjs/components/button/check-props.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs +1 -1
- package/dist/cjs/components/button/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
- 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/carousel/private/carousel-indicators.cjs.map +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.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/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
- 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/color-picker/private/swatch-option.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch.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/combobox/index.cjs.map +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs +1 -1
- package/dist/cjs/components/combobox/private/menu.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/private/calendar.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/day.cjs +1 -1
- package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
- package/dist/cjs/components/files/file.cjs +1 -8
- package/dist/cjs/components/files/file.cjs.map +1 -1
- package/dist/cjs/components/files/private/file-actions.cjs +1 -1
- package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
- package/dist/cjs/components/files/private/file-figure.cjs +1 -1
- package/dist/cjs/components/files/private/file-figure.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/check-props.cjs +1 -1
- package/dist/cjs/components/icon/check-props.cjs.map +1 -1
- package/dist/cjs/components/icon/index.cjs +1 -1
- package/dist/cjs/components/icon/index.cjs.map +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.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/input/search.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/index.cjs +1 -1
- package/dist/cjs/components/pill-container/index.cjs.map +1 -1
- package/dist/cjs/components/popover/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/step.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-group/index.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/cell.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/interactive-element.cjs +1 -1
- package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
- package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
- 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/link.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/link.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/simple-data-table/row-actions.cjs +1 -1
- package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/private/tab.cjs +1 -1
- package/dist/cjs/components/tabs/private/tab.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/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +1 -3
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/private/branch.cjs.map +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/utilities/dialog/index.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
- package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
- package/dist/cjs/utilities/color.cjs +1 -1
- package/dist/cjs/utilities/color.cjs.map +1 -1
- package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
- package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
- package/dist/cjs/utilities/get-aria-props.cjs +1 -1
- package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
- package/dist/cjs/utilities/get-data-props.cjs +1 -1
- package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
- package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
- package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
- package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
- package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
- package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
- package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
- package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
- package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
- package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
- package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
- package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
- package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
- package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
- package/dist/cjs/utilities/warning/required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
- package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
- package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
- package/dist/es/components/alert/index.js +4 -5
- package/dist/es/components/alert/index.js.map +1 -1
- package/dist/es/components/builder-header/nav-link.js.map +1 -1
- package/dist/es/components/button/check-props.js +1 -1
- package/dist/es/components/button/check-props.js.map +1 -1
- package/dist/es/components/button/index.js +50 -50
- package/dist/es/components/button/index.js.map +1 -1
- package/dist/es/components/button-stateful/check-props.js +1 -1
- package/dist/es/components/button-stateful/check-props.js.map +1 -1
- package/dist/es/components/button-stateful/index.js +3 -2
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/carousel/index.js +155 -129
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-item.js +1 -1
- package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +1 -1
- package/dist/es/components/checkbox/check-props.js.map +1 -1
- package/dist/es/components/checkbox/index.js +102 -100
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +150 -151
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
- package/dist/es/components/color-picker/private/hsv-color.js +16 -20
- package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
- package/dist/es/components/color-picker/private/swatch-option.js +2 -2
- package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
- package/dist/es/components/color-picker/private/swatch.js +1 -1
- package/dist/es/components/color-picker/private/swatch.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +565 -580
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/index.js +6 -19
- package/dist/es/components/combobox/index.js.map +1 -1
- package/dist/es/components/combobox/private/menu.js +3 -3
- package/dist/es/components/combobox/private/menu.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +101 -102
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/private/calendar.js.map +1 -1
- package/dist/es/components/date-picker/private/day.js +1 -1
- package/dist/es/components/date-picker/private/day.js.map +1 -1
- package/dist/es/components/files/file.js +5 -6
- package/dist/es/components/files/file.js.map +1 -1
- package/dist/es/components/files/private/file-actions.js +2 -2
- package/dist/es/components/files/private/file-actions.js.map +1 -1
- package/dist/es/components/files/private/file-figure.js +1 -1
- package/dist/es/components/files/private/file-figure.js.map +1 -1
- package/dist/es/components/filter/filter.js +5 -1
- package/dist/es/components/filter/filter.js.map +1 -1
- package/dist/es/components/icon/check-props.js +9 -7
- package/dist/es/components/icon/check-props.js.map +1 -1
- package/dist/es/components/icon/index.js +13 -10
- package/dist/es/components/icon/index.js.map +1 -1
- package/dist/es/components/input/check-props.js +14 -13
- package/dist/es/components/input/check-props.js.map +1 -1
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/input/search.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js +1 -2
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/pill-container/index.js +10 -6
- package/dist/es/components/pill-container/index.js.map +1 -1
- package/dist/es/components/popover/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +181 -177
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/private/step.js.map +1 -1
- package/dist/es/components/radio/index.js +1 -1
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/simple-data-table/cell.js +8 -5
- package/dist/es/components/simple-data-table/cell.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +97 -91
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/simple-data-table/interactive-element.js +31 -28
- package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
- package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
- package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
- package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
- package/dist/es/components/simple-data-table/private/head.js +65 -42
- package/dist/es/components/simple-data-table/private/head.js.map +1 -1
- package/dist/es/components/simple-data-table/private/header-cell.js +2 -1
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
- package/dist/es/components/simple-data-table/private/link.js.map +1 -1
- package/dist/es/components/simple-data-table/private/row.js +96 -60
- package/dist/es/components/simple-data-table/private/row.js.map +1 -1
- package/dist/es/components/simple-data-table/row-actions.js +4 -1
- package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
- package/dist/es/components/tabs/index.js.map +1 -1
- package/dist/es/components/tabs/private/tab.js +1 -1
- package/dist/es/components/tabs/private/tab.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 +4 -2
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/toast/index.js.map +1 -1
- package/dist/es/components/tooltip/index.js +107 -88
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/private/branch.js.map +1 -1
- package/dist/es/components/tree/private/item.js.map +1 -1
- package/dist/es/components/tree/private/render-branch.js +14 -19
- package/dist/es/components/tree/private/render-branch.js.map +1 -1
- package/dist/es/components/utilities/dialog/index.js +2 -1
- package/dist/es/components/utilities/dialog/index.js.map +1 -1
- package/dist/es/components/utilities/dialog/portal.js +5 -3
- package/dist/es/components/utilities/dialog/portal.js.map +1 -1
- package/dist/es/components/utilities/menu-list/index.js +6 -6
- package/dist/es/components/utilities/menu-list/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item.js +42 -18
- package/dist/es/components/utilities/menu-list/item.js.map +1 -1
- package/dist/es/components/utilities/utility-icon/index.js +32 -52
- package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
- package/dist/es/utilities/color.js +1 -1
- package/dist/es/utilities/color.js.map +1 -1
- package/dist/es/utilities/dom-element-focus.js.map +1 -1
- package/dist/es/utilities/execution-environment.js.map +1 -1
- package/dist/es/utilities/get-aria-props.js +1 -1
- package/dist/es/utilities/get-aria-props.js.map +1 -1
- package/dist/es/utilities/get-data-props.js +1 -1
- package/dist/es/utilities/get-data-props.js.map +1 -1
- package/dist/es/utilities/keyboard-navigable-dialog.js +7 -7
- package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
- package/dist/es/utilities/keyboard-navigate.js +1 -1
- package/dist/es/utilities/keyboard-navigate.js.map +1 -1
- package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
- package/dist/es/utilities/warning/children-as-trigger.js +8 -7
- package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property.js +8 -7
- package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
- package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
- package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
- package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
- package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
- package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
- package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
- package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
- package/dist/es/utilities/warning/one-of-required-property.js +11 -10
- package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
- package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
- package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
- package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
- package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
- package/dist/es/utilities/warning/required-property.js +8 -7
- package/dist/es/utilities/warning/required-property.js.map +1 -1
- package/dist/es/utilities/warning/sunset-property.js +8 -7
- package/dist/es/utilities/warning/sunset-property.js.map +1 -1
- package/dist/es/utilities/warning/warned-registry.js +10 -0
- package/dist/es/utilities/warning/warned-registry.js.map +1 -0
- package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +14 -4
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +5 -2
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/carousel/index.d.ts +7 -1
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +4 -1
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +1 -1
- package/dist/types/components/combobox/index.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/files/file.d.ts +5 -0
- package/dist/types/components/files/file.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +7 -1
- package/dist/types/components/icon/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +9 -6
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/input/search.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +9 -3
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/modal/index.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/popover/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +9 -2
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/index.d.ts +3 -3
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
- package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +10 -2
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +2 -2
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +9 -6
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/toast/index.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
- package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
- package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
- package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
- package/dist/types/types/common.d.ts.map +1 -1
- package/dist/types/types/components.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/cjs/icons/action/index.cjs +0 -2
- package/dist/cjs/icons/action/index.cjs.map +0 -1
- package/dist/cjs/icons/custom/index.cjs +0 -2
- package/dist/cjs/icons/custom/index.cjs.map +0 -1
- package/dist/cjs/icons/doctype/index.cjs +0 -2
- package/dist/cjs/icons/doctype/index.cjs.map +0 -1
- package/dist/cjs/icons/standard/index.cjs +0 -2
- package/dist/cjs/icons/standard/index.cjs.map +0 -1
- package/dist/cjs/icons/utility/index.cjs +0 -2
- package/dist/cjs/icons/utility/index.cjs.map +0 -1
- package/dist/es/icons/action/index.js +0 -6
- package/dist/es/icons/action/index.js.map +0 -1
- package/dist/es/icons/custom/index.js +0 -6
- package/dist/es/icons/custom/index.js.map +0 -1
- package/dist/es/icons/doctype/index.js +0 -6
- package/dist/es/icons/doctype/index.js.map +0 -1
- package/dist/es/icons/standard/index.js +0 -6
- package/dist/es/icons/standard/index.js.map +0 -1
- package/dist/es/icons/utility/index.js +0 -6
- package/dist/es/icons/utility/index.js.map +0 -1
- package/dist/types/icons/action/index.d.ts +0 -3
- package/dist/types/icons/action/index.d.ts.map +0 -1
- package/dist/types/icons/custom/index.d.ts +0 -3
- package/dist/types/icons/custom/index.d.ts.map +0 -1
- package/dist/types/icons/doctype/index.d.ts +0 -3
- package/dist/types/icons/doctype/index.d.ts.map +0 -1
- package/dist/types/icons/standard/index.d.ts +0 -3
- package/dist/types/icons/standard/index.d.ts.map +0 -1
- package/dist/types/icons/utility/index.d.ts +0 -3
- package/dist/types/icons/utility/index.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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';\nimport type { InputIconProps } from '../icon/input-icon';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\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}\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 shared by every Input variant and label form\n */\nexport interface InputBaseProps {\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/** 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/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned `InputIcon`. The input sets its `iconPosition` to `left` unless the element sets one. */\n\ticonLeft?: ReactElement<InputIconProps> | null;\n\t/** Right-aligned `InputIcon`. The input sets its `iconPosition` to `right` unless the element sets one. */\n\ticonRight?: ReactElement<InputIconProps> | null;\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/** Maximum character length */\n\tmaxLength?: number;\n\t/** Minimum character length */\n\tminLength?: 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/** Tab index */\n\ttabIndex?: 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}\n\n/** The plain input, and the default. Counter-only props are not accepted. */\ninterface InputBaseVariantProps {\n\t/** Input variant */\n\tvariant?: 'base';\n\tmaxValue?: never;\n\tminValue?: never;\n\tstep?: never;\n}\n\n/** A number input with increment and decrement buttons. Its `type` is always `number`. */\ninterface InputCounterVariantProps {\n\t/** Input variant */\n\tvariant: 'counter';\n\t/** Maximum value */\n\tmaxValue?: number;\n\t/** Minimum value */\n\tminValue?: number;\n\t/** Step size */\n\tstep?: number;\n}\n\n/** A visible `label`, or `assistiveText.label` for a visually hidden one, not both. */\ntype InputLabelProps =\n\t| {\n\t\t\t/** Label text above input */\n\t\t\tlabel?: string;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText & { label?: never };\n\t }\n\t| {\n\t\t\tlabel?: undefined;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText;\n\t };\n\n/** Fixed text on one side of the input, not both. */\ntype InputFixedTextProps =\n\t| {\n\t\t\t/** Fixed text/node on the left */\n\t\t\tfixedTextLeft?: ReactNode;\n\t\t\tfixedTextRight?: never;\n\t }\n\t| {\n\t\t\tfixedTextLeft?: never;\n\t\t\t/** Fixed text/node on the right */\n\t\t\tfixedTextRight?: ReactNode;\n\t };\n\n/**\n * Props for the Input component: a union on `variant` (counter-only props),\n * with `label`/`assistiveText.label` and `fixedTextLeft`/`fixedTextRight`\n * exclusive.\n */\nexport type InputProps = InputBaseProps &\n\t(InputBaseVariantProps | InputCounterVariantProps) &\n\tInputLabelProps &\n\tInputFixedTextProps;\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.key === KEYS.ENTER) {\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<InputIconProps>(propIconLeft)\n\t\t\t\t? React.cloneElement(propIconLeft, {\n\t\t\t\t\t\ticonPosition: propIconLeft.props.iconPosition ?? 'left',\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<InputIconProps>(propIconRight)\n\t\t\t\t? React.cloneElement(propIconRight, {\n\t\t\t\t\t\ticonPosition: propIconRight.props.iconPosition ?? 'right',\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\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":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","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 InputEvent,\n\ttype SubmitEvent,\n\ttype SyntheticEvent,\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';\nimport type { InputIconProps } from '../icon/input-icon';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\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}\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 shared by every Input variant and label form\n */\nexport interface InputBaseProps {\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/** 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/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned `InputIcon`. The input sets its `iconPosition` to `left` unless the element sets one. */\n\ticonLeft?: ReactElement<InputIconProps> | null;\n\t/** Right-aligned `InputIcon`. The input sets its `iconPosition` to `right` unless the element sets one. */\n\ticonRight?: ReactElement<InputIconProps> | null;\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/** Maximum character length */\n\tmaxLength?: number;\n\t/** Minimum character length */\n\tminLength?: 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: InputEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Still works, and warns.\n\t */\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: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: SubmitEvent<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/** Tab index */\n\ttabIndex?: 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}\n\n/** The plain input, and the default. Counter-only props are not accepted. */\ninterface InputBaseVariantProps {\n\t/** Input variant */\n\tvariant?: 'base';\n\tmaxValue?: never;\n\tminValue?: never;\n\tstep?: never;\n}\n\n/** A number input with increment and decrement buttons. Its `type` is always `number`. */\ninterface InputCounterVariantProps {\n\t/** Input variant */\n\tvariant: 'counter';\n\t/** Maximum value */\n\tmaxValue?: number;\n\t/** Minimum value */\n\tminValue?: number;\n\t/** Step size */\n\tstep?: number;\n}\n\n/** A visible `label`, or `assistiveText.label` for a visually hidden one, not both. */\ntype InputLabelProps =\n\t| {\n\t\t\t/** Label text above input */\n\t\t\tlabel?: string;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText & { label?: never };\n\t }\n\t| {\n\t\t\tlabel?: undefined;\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: InputAssistiveText;\n\t };\n\n/** Fixed text on one side of the input, not both. */\ntype InputFixedTextProps =\n\t| {\n\t\t\t/** Fixed text/node on the left */\n\t\t\tfixedTextLeft?: ReactNode;\n\t\t\tfixedTextRight?: never;\n\t }\n\t| {\n\t\t\tfixedTextLeft?: never;\n\t\t\t/** Fixed text/node on the right */\n\t\t\tfixedTextRight?: ReactNode;\n\t };\n\n/**\n * Props for the Input component: a union on `variant` (counter-only props),\n * with `label`/`assistiveText.label` and `fixedTextLeft`/`fixedTextRight`\n * exclusive.\n */\nexport type InputProps = InputBaseProps &\n\t(InputBaseVariantProps | InputCounterVariantProps) &\n\tInputLabelProps &\n\tInputFixedTextProps;\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.key === KEYS.ENTER) {\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<InputIconProps>(propIconLeft)\n\t\t\t\t? React.cloneElement(propIconLeft, {\n\t\t\t\t\t\ticonPosition: propIconLeft.props.iconPosition ?? 'left',\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<InputIconProps>(propIconRight)\n\t\t\t\t? React.cloneElement(propIconRight, {\n\t\t\t\t\t\ticonPosition: propIconRight.props.iconPosition ?? 'right',\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\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":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-input.js","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\tplacement=\"input\"\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":";;;;;AAkBA,IAAM,IAAU,WAsJV,KAAgD,EACrD,SAAS,cACV,GAmBM,KAAc,EACnB,yBAAyB,GACzB,qBAAqB,IACrB,iBAAiB,IACjB,oBAAoB,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,iBACA,cACA,uBACA,qBAAiB,CAAC,GAClB,cACA,kBACA,mBACA,eACA,aACA,cACA,OACA,sBACA,aACA,aACA,cACA,aACA,cACA,aACA,SACA,WACA,aACA,YACA,YACA,aACA,cACA,cACA,eACA,YACA,aACA,aACA,gBACA,aACA,aACA,SACA,SACA,UACA,aACA,UAAO,QACP,UACA,iBACsB;CACtB,IAAM,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAEhE,IAA6B,EAAa;EAC/C,yBAAyB;EACzB,qBAAqB;EACrB,iBAAiB;EACjB,oBAAoB;EACpB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;EACb,iBAAiB;EACjB;EACA;CACD,CAAC,GAEK,IAAsB,GAAG,EAAG;CAGlC,AAAI,KAAc,EAAU,sBAC3B,EAAU,sBACT,GAAG,EAAoB,GAAG,EAAU,wBAC3B,MACV,EAAU,sBAAsB;CAGjC,IAAM,EAAE,WAAW,IAAyB,GAAG,OAC9C;CAED,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,IAAyB,GAAoB;GAClE,uBAAuB,MAAY,MAAY,KAAY;GAC3D,4BAA4B,KAAY,CAAC;GACzC,6BAA6B,CAAC,KAAY;GAC1C,kCACC,MAAY,KAAW,KAAY;GACpC,8BAA8B,KAAiB;GAC/C,2BAA2B;EAC5B,CAAC;EACD,GAAI;EAVL,UAAA;GAYE;GACA,KACA,kBAAC,QAAD;IAAM,WAAU;IAA4B,UAAA;GAAoB,CAAA;GAGhE,CAAC,KACD,kBAAC,SAAD;IACe;IACd,WAAW,EACV,cACA,EACC,wBAAwB,MAAY,KAAW,EAChD,GACA,CACD;IACU;IACN;IACJ,KAAK;IACL,WAAW,MAAc,KAAA,IAAgC,KAAA,IAApB,OAAO,CAAS;IACrD,KAAK;IACL,WAAW,MAAc,KAAA,IAAgC,KAAA,IAApB,OAAO,CAAS;IAC/C;IACE;IACE;IACD;IACA;IACA;IACE;IACA;IACC;IACH;IACC;IACA;IACG;IACH;IACV,KAAK;IACK;IACJ;IACA;IACC;IACP,UAAU,MAAa,KAAA,IAA+B,KAAA,IAAnB,OAAO,CAAQ;IAC5C;IACN,GAAI;IACG;GACP,CAAA;GAGD,IACA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,GAAD;KACC,eAAe,EAAE,OAAO,EAAc,QAAQ;KAC9C,IAAI;KACJ,WAAU;KACV,MAAK;KACL,SAAQ;IACR,CAAA,GACA,CACG;GAEL,CAAA,IAAA;GAGA,KACA,kBAAC,QAAD;IAAM,WAAU;IAA4B,UAAA;GAAqB,CAAA;GAGjE,KACA,kBAAC,QAAD;IACC,WAAW,EAAW,6BAA6B,aAAa,EAC/D,0BAA0B,MAAY,EACvC,CAAC;IAEA;IALF,UAAA,CAQE,GACA,CACI;;EAEH;;AAEP;AAEA,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"inner-input.js","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\tInputEvent,\n\tSubmitEvent,\n\tSyntheticEvent,\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: InputEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * @deprecated `keypress` is a deprecated DOM event. Use `onKeyDown` and read\n\t * `event.key` instead. Still works, and warns.\n\t */\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: SyntheticEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: SubmitEvent<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\t// eslint-disable-next-line local/no-deprecated -- forwards the deprecated `onKeyPress` prop until 11.0\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\tplacement=\"input\"\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// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- static display text; the inline edit trigger is the focusable control\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":";;;;;AAoBA,IAAM,IAAU,WAyJV,KAAgD,EACrD,SAAS,cACV,GAmBM,KAAc,EACnB,yBAAyB,GACzB,qBAAqB,IACrB,iBAAiB,IACjB,oBAAoB,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,iBACA,cACA,uBACA,qBAAiB,CAAC,GAClB,cACA,kBACA,mBACA,eACA,aACA,cACA,OACA,sBACA,aACA,aACA,cACA,aACA,cACA,aACA,SACA,WACA,aACA,YACA,YACA,aACA,cACA,cACA,eACA,YACA,aACA,aACA,gBACA,aACA,aACA,SACA,SACA,UACA,aACA,UAAO,QACP,UACA,iBACsB;CACtB,IAAM,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAEhE,IAA6B,EAAa;EAC/C,yBAAyB;EACzB,qBAAqB;EACrB,iBAAiB;EACjB,oBAAoB;EACpB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;EACb,iBAAiB;EACjB;EACA;CACD,CAAC,GAEK,IAAsB,GAAG,EAAG;CAGlC,AAAI,KAAc,EAAU,sBAC3B,EAAU,sBACT,GAAG,EAAoB,GAAG,EAAU,wBAC3B,MACV,EAAU,sBAAsB;CAGjC,IAAM,EAAE,WAAW,IAAyB,GAAG,OAC9C;CAED,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,IAAyB,GAAoB;GAClE,uBAAuB,MAAY,MAAY,KAAY;GAC3D,4BAA4B,KAAY,CAAC;GACzC,6BAA6B,CAAC,KAAY;GAC1C,kCACC,MAAY,KAAW,KAAY;GACpC,8BAA8B,KAAiB;GAC/C,2BAA2B;EAC5B,CAAC;EACD,GAAI;EAVL,UAAA;GAYE;GACA,KACA,kBAAC,QAAD;IAAM,WAAU;IAA4B,UAAA;GAAoB,CAAA;GAGhE,CAAC,KACD,kBAAC,SAAD;IACe;IACd,WAAW,EACV,cACA,EACC,wBAAwB,MAAY,KAAW,EAChD,GACA,CACD;IACU;IACN;IACJ,KAAK;IACL,WAAW,MAAc,KAAA,IAAgC,KAAA,IAApB,OAAO,CAAS;IACrD,KAAK;IACL,WAAW,MAAc,KAAA,IAAgC,KAAA,IAApB,OAAO,CAAS;IAC/C;IACE;IACE;IACD;IACA;IACA;IACE;IACA;IAEC;IACH;IACC;IACA;IACG;IACH;IACV,KAAK;IACK;IACJ;IACA;IACC;IACP,UAAU,MAAa,KAAA,IAA+B,KAAA,IAAnB,OAAO,CAAQ;IAC5C;IACN,GAAI;IACG;GACP,CAAA;GAGD,IACA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,GAAD;KACC,eAAe,EAAE,OAAO,EAAc,QAAQ;KAC9C,IAAI;KACJ,WAAU;KACV,MAAK;KACL,SAAQ;IACR,CAAA,GACA,CACG;GAEL,CAAA,IAAA;GAGA,KACA,kBAAC,QAAD;IAAM,WAAU;IAA4B,UAAA;GAAqB,CAAA;GAGjE,KAEA,kBAAC,QAAD;IACC,WAAW,EAAW,6BAA6B,aAAa,EAC/D,0BAA0B,MAAY,EACvC,CAAC;IAEA;IALF,UAAA,CAQE,GACA,CACI;;EAEH;;AAEP;AAEA,EAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","names":[],"sources":["../../../../components/input/search.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type KeyboardEvent } from 'react';\n\nimport Input, {
|
|
1
|
+
{"version":3,"file":"search.js","names":[],"sources":["../../../../components/input/search.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type KeyboardEvent } from 'react';\n\nimport Input, { type InputBaseProps, type InputAssistiveText } from './index';\nimport InputIcon from '../icon/input-icon/index';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\nimport { SEARCH } from '../../utilities/constants';\n\n/**\n * Assistive text for Search component\n */\nexport interface SearchAssistiveText extends InputAssistiveText {\n\t/** Label for the search input */\n\tlabel?: string;\n}\n\n/**\n * Props for the Search component\n */\nexport interface SearchProps extends Omit<\n\tInputBaseProps,\n\t'assistiveText' | 'iconLeft' | 'iconRight'\n> {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SearchAssistiveText;\n\t/** Adds a clear button to the right of the input */\n\tclearable?: boolean;\n\t/** Handler for clear button click */\n\tonClear?: (event: React.MouseEvent) => void;\n\t/** Handler for search (enter key or search icon click) */\n\tonSearch?: (\n\t\tevent: KeyboardEvent<HTMLInputElement> | React.MouseEvent\n\t) => void;\n}\n\nconst handleKeyDown = (\n\tevent: KeyboardEvent<HTMLInputElement>,\n\tonSearch?: (event: KeyboardEvent<HTMLInputElement> | React.MouseEvent) => void\n) => {\n\tif (event.key === KEYS.ENTER && onSearch && !EventUtil.isComposing(event)) {\n\t\tEventUtil.trapImmediate(event);\n\t\tonSearch(event);\n\t}\n};\n\n/**\n * A `Search` is an `Input` which renders the search icon by default.\n * It can be cleared, too. All `Input` props not specified as props\n * already may be used with this component and will override defaults.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Search = ({\n\tassistiveText,\n\tclearable = false,\n\tonClear,\n\tonSearch,\n\tplaceholder,\n\t...props\n}: SearchProps) => {\n\tcheckProps(\n\t\tSEARCH,\n\t\t{ assistiveText, clearable, onClear, onSearch, placeholder, ...props },\n\t\tcomponentDoc\n\t);\n\n\tconst mergedAssistiveText: InputAssistiveText = {\n\t\tlabel: assistiveText?.label,\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tassistiveText={mergedAssistiveText}\n\t\t\ticonLeft={\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{ icon: 'Search' }}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"search\"\n\t\t\t\t\tonClick={onSearch}\n\t\t\t\t/>\n\t\t\t}\n\t\t\ticonRight={\n\t\t\t\tclearable ? (\n\t\t\t\t\t<InputIcon\n\t\t\t\t\t\tassistiveText={{ icon: 'Clear' }}\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tname=\"clear\"\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t\t}\n\t\t\tonKeyDown={\n\t\t\t\tonSearch\n\t\t\t\t\t? (event) =>\n\t\t\t\t\t\t\thandleKeyDown(event as KeyboardEvent<HTMLInputElement>, onSearch)\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tplaceholder={placeholder}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nSearch.displayName = SEARCH;\n\nexport default Search;\n"],"mappings":";;;;;;;;;;AAwCA,IAAM,KACL,GACA,MACI;CACJ,AAAI,EAAM,QAAQ,EAAK,SAAS,KAAY,CAAC,EAAU,YAAY,CAAK,MACvE,EAAU,cAAc,CAAK,GAC7B,EAAS,CAAK;AAEhB,GASM,KAAU,EACf,kBACA,eAAY,IACZ,YACA,aACA,gBACA,GAAG,QACe;CAClB,EACC,GACA;EAAE;EAAe;EAAW;EAAS;EAAU;EAAa,GAAG;CAAM,GACrE,CACD;CAEA,IAAM,IAA0C,EAC/C,OAAO,GAAe,MACvB;CAEA,OACC,kBAAC,GAAD;EACC,eAAe;EACf,UACC,kBAAC,GAAD;GACC,eAAe,EAAE,MAAM,SAAS;GAChC,UAAS;GACT,MAAK;GACL,SAAS;EACT,CAAA;EAEF,WACC,IACC,kBAAC,GAAD;GACC,eAAe,EAAE,MAAM,QAAQ;GAC/B,UAAS;GACT,MAAK;GACL,SAAS;EACT,CAAA,IACE;EAEL,WACC,KACI,MACD,EAAc,GAA0C,CAAQ,IAChE,KAAA;EAES;EACb,GAAI;CACJ,CAAA;AAEH;AAEA,EAAO,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-trigger.js","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, { type ButtonProps } from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport mergeProps, { renderTrigger } from '../../utilities/merge-props';\nimport type { TriggerRender } from '../../types/common';\n\n/**\n * Props MenuDropdown passes to a `trigger` that isn't a `Button`. The trigger `div` handles\n * clicks, focus, keys and hover, so the trigger only needs to be focusable and take `ref`.\n */\nexport interface MenuDropdownTriggerProps {\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup': true;\n\t/** Includes the class MenuDropdown uses to ignore clicks on the trigger when closing */\n\tclassName?: string;\n\tdisabled?: boolean;\n\tref: (element: HTMLElement | null) => void;\n\ttabIndex?: number;\n}\n\n/**\n * Props MenuDropdown passes to its default trigger that aren't part of the public type.\n */\nexport interface ButtonTriggerInjectedProps {\n\t/** MenuDropdown's `trigger` */\n\ttrigger?: TriggerRender<MenuDropdownTriggerProps>;\n}\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** A `Button` element whose props override the ones MenuDropdown passes */\n\tchildren?: ReactElement<ButtonProps>;\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/** 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/** Tab index */\n\ttabIndex?: number;\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 a `Button` child, the child's props override the ones MenuDropdown passes.\n * Passing this component (or a custom trigger with its `displayName`) as a child of MenuDropdown\n * is deprecated: pass the `Button` or other element as MenuDropdown's `trigger` instead.\n */\nconst ButtonTrigger = forwardRef<\n\tHTMLDivElement,\n\tButtonTriggerProps & ButtonTriggerInjectedProps\n>((props, ref) => {\n\tconst {\n\t\tassistiveText,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinverse,\n\t\tisOpen,\n\t\tlabel,\n\t\tonBlur,\n\t\tmenu,\n\t\tonClick,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\topenOn: openOnProp,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttrigger,\n\t\ttriggerRef,\n\t\ttriggerClassName,\n\t\tvariant,\n\t} = props;\n\n\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t// The `trigger` element, or (deprecated) the Button child of this component\n\tconst buttonElement: ReactNode =\n\t\ttrigger === undefined\n\t\t\t? React.Children.toArray(children).find((child) =>\n\t\t\t\t\tisElementOfType<ButtonProps>(child, Button)\n\t\t\t\t)\n\t\t\t: (trigger as ReactNode);\n\n\tconst buttonDefaults: Record<string, unknown> = {\n\t\tassistiveText,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tinverse,\n\t\tlabel,\n\t\tstyle,\n\t\ttabIndex,\n\t\tvariant,\n\t\t'aria-expanded': isOpen,\n\t\t'aria-haspopup': true,\n\t};\n\n\tlet renderedTrigger: ReactNode;\n\tif (trigger !== undefined && !isElementOfType(trigger as ReactNode, Button)) {\n\t\trenderedTrigger = renderTrigger(trigger, {\n\t\t\t'aria-expanded': isOpen,\n\t\t\t'aria-haspopup': true,\n\t\t\tclassName: classnames(className as string) || undefined,\n\t\t\tdisabled,\n\t\t\tref: triggerRef as (element: HTMLElement | null) => void,\n\t\t\ttabIndex,\n\t\t});\n\t} else {\n\t\t// The Button's own props override MenuDropdown's\n\t\tconst childProps = isElementOfType<ButtonProps>(buttonElement, Button)\n\t\t\t? (buttonElement.props as Record<string, unknown>)\n\t\t\t: {};\n\t\t// A labelled Button keeps its label. Otherwise the Dropdown's\n\t\t// `assistiveText.icon` makes Button render icon-only.\n\t\tconst buttonProps =\n\t\t\tchildProps.label && childProps.assistiveText === undefined\n\t\t\t\t? { assistiveText: { icon: '' }, ...childProps }\n\t\t\t\t: childProps;\n\t\tconst consumerButtonRef = buttonProps.buttonRef as ButtonProps['buttonRef'];\n\t\trenderedTrigger = (\n\t\t\t<Button\n\t\t\t\t{...(mergeProps(buttonDefaults, buttonProps) as ButtonProps)}\n\t\t\t\tbuttonRef={\n\t\t\t\t\tconsumerButtonRef\n\t\t\t\t\t\t? (element: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\tconsumerButtonRef(element);\n\t\t\t\t\t\t\t\ttriggerRef?.(element);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: triggerRef\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classnames(\n\t\t\t\t`slds-dropdown-trigger slds-dropdown-trigger_${openOn}`,\n\t\t\t\t{\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t},\n\t\t\t\ttriggerClassName as string | string[] | Record<string, boolean>\n\t\t\t)}\n\t\t\tid={id}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={onClick}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonFocus={onFocus}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={onMouseLeave}\n\t\t>\n\t\t\t{renderedTrigger}\n\t\t\t{menu}\n\t\t</div>\n\t);\n});\n\nButtonTrigger.displayName = MENU_DROPDOWN_TRIGGER;\n\nexport default ButtonTrigger as React.ForwardRefExoticComponent<\n\tButtonTriggerProps & React.RefAttributes<HTMLDivElement>\n>;\n"],"mappings":";;;;;;;;AAqGA,IAAM,IAAgB,GAGnB,GAAO,MAAQ;CACjB,IAAM,EACL,kBACA,aACA,cACA,aACA,SACA,iBACA,aACA,iBACA,aACA,gBACA,OACA,YACA,WACA,UACA,WACA,SACA,YACA,YACA,cACA,gBACA,iBACA,iBACA,QAAQ,GACR,UACA,aACA,YACA,eACA,qBACA,eACG,GAEE,IAAS,MAAe,UAAU,UAAU,GAG5C,IACL,MAAY,KAAA,IACT,EAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,MAAM,MACvC,EAA6B,GAAO,CAAM,CAC3C,IACE,GAEC,IAA0C;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,iBAAiB;CAClB,GAEI;CACJ,IAAI,MAAY,KAAA,KAAa,CAAC,EAAgB,GAAsB,CAAM,GACzE,IAAkB,EAAc,GAAS;EACxC,iBAAiB;EACjB,iBAAiB;EACjB,WAAW,EAAW,CAAmB,KAAK,KAAA;EAC9C;EACA,KAAK;EACL;CACD,CAAC;MACK;EAEN,IAAM,IAAa,EAA6B,GAAe,CAAM,IACjE,EAAc,QACf,CAAC,GAGE,IACL,EAAW,SAAS,EAAW,kBAAkB,KAAA,IAC9C;GAAE,eAAe,EAAE,MAAM,GAAG;GAAG,GAAG;EAAW,IAC7C,GACE,IAAoB,EAAY;EACtC,IACC,kBAAC,GAAD;GACC,GAAK,EAAW,GAAgB,CAAW;GAC3C,WACC,KACI,MAAsC;IAEvC,AADA,EAAkB,CAAO,GACzB,IAAa,CAAO;GACrB,IACC;EAEJ,CAAA;CAEH;CAEA,
|
|
1
|
+
{"version":3,"file":"button-trigger.js","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, { type ButtonProps } from '../button';\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\nimport isElementOfType from '../../utilities/is-element-of-type';\nimport mergeProps, { renderTrigger } from '../../utilities/merge-props';\nimport type { TriggerRender } from '../../types/common';\n\n/**\n * Props MenuDropdown passes to a `trigger` that isn't a `Button`. The trigger `div` handles\n * clicks, focus, keys and hover, so the trigger only needs to be focusable and take `ref`.\n */\nexport interface MenuDropdownTriggerProps {\n\t'aria-expanded'?: boolean;\n\t'aria-haspopup': true;\n\t/** Includes the class MenuDropdown uses to ignore clicks on the trigger when closing */\n\tclassName?: string;\n\tdisabled?: boolean;\n\tref: (element: HTMLElement | null) => void;\n\ttabIndex?: number;\n}\n\n/**\n * Props MenuDropdown passes to its default trigger that aren't part of the public type.\n */\nexport interface ButtonTriggerInjectedProps {\n\t/** MenuDropdown's `trigger` */\n\ttrigger?: TriggerRender<MenuDropdownTriggerProps>;\n}\n\nexport interface ButtonTriggerProps {\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** A `Button` element whose props override the ones MenuDropdown passes */\n\tchildren?: ReactElement<ButtonProps>;\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/** 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/** Tab index */\n\ttabIndex?: number;\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 a `Button` child, the child's props override the ones MenuDropdown passes.\n * Passing this component (or a custom trigger with its `displayName`) as a child of MenuDropdown\n * is deprecated: pass the `Button` or other element as MenuDropdown's `trigger` instead.\n */\nconst ButtonTrigger = forwardRef<\n\tHTMLDivElement,\n\tButtonTriggerProps & ButtonTriggerInjectedProps\n>((props, ref) => {\n\tconst {\n\t\tassistiveText,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinverse,\n\t\tisOpen,\n\t\tlabel,\n\t\tonBlur,\n\t\tmenu,\n\t\tonClick,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\topenOn: openOnProp,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttrigger,\n\t\ttriggerRef,\n\t\ttriggerClassName,\n\t\tvariant,\n\t} = props;\n\n\tconst openOn = openOnProp === 'hover' ? 'click' : openOnProp;\n\n\t// The `trigger` element, or (deprecated) the Button child of this component\n\tconst buttonElement: ReactNode =\n\t\ttrigger === undefined\n\t\t\t? React.Children.toArray(children).find((child) =>\n\t\t\t\t\tisElementOfType<ButtonProps>(child, Button)\n\t\t\t\t)\n\t\t\t: (trigger as ReactNode);\n\n\tconst buttonDefaults: Record<string, unknown> = {\n\t\tassistiveText,\n\t\tclassName,\n\t\tdisabled,\n\t\thint,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tinverse,\n\t\tlabel,\n\t\tstyle,\n\t\ttabIndex,\n\t\tvariant,\n\t\t'aria-expanded': isOpen,\n\t\t'aria-haspopup': true,\n\t};\n\n\tlet renderedTrigger: ReactNode;\n\tif (trigger !== undefined && !isElementOfType(trigger as ReactNode, Button)) {\n\t\trenderedTrigger = renderTrigger(trigger, {\n\t\t\t'aria-expanded': isOpen,\n\t\t\t'aria-haspopup': true,\n\t\t\tclassName: classnames(className as string) || undefined,\n\t\t\tdisabled,\n\t\t\tref: triggerRef as (element: HTMLElement | null) => void,\n\t\t\ttabIndex,\n\t\t});\n\t} else {\n\t\t// The Button's own props override MenuDropdown's\n\t\tconst childProps = isElementOfType<ButtonProps>(buttonElement, Button)\n\t\t\t? (buttonElement.props as Record<string, unknown>)\n\t\t\t: {};\n\t\t// A labelled Button keeps its label. Otherwise the Dropdown's\n\t\t// `assistiveText.icon` makes Button render icon-only.\n\t\tconst buttonProps =\n\t\t\tchildProps.label && childProps.assistiveText === undefined\n\t\t\t\t? { assistiveText: { icon: '' }, ...childProps }\n\t\t\t\t: childProps;\n\t\tconst consumerButtonRef = buttonProps.buttonRef as ButtonProps['buttonRef'];\n\t\trenderedTrigger = (\n\t\t\t<Button\n\t\t\t\t{...(mergeProps(buttonDefaults, buttonProps) as ButtonProps)}\n\t\t\t\tbuttonRef={\n\t\t\t\t\tconsumerButtonRef\n\t\t\t\t\t\t? (element: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\tconsumerButtonRef(element);\n\t\t\t\t\t\t\t\ttriggerRef?.(element);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: triggerRef\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- wrapper delegates events from the focusable trigger it contains\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classnames(\n\t\t\t\t`slds-dropdown-trigger slds-dropdown-trigger_${openOn}`,\n\t\t\t\t{\n\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t},\n\t\t\t\ttriggerClassName as string | string[] | Record<string, boolean>\n\t\t\t)}\n\t\t\tid={id}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={onClick}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonFocus={onFocus}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={onMouseLeave}\n\t\t>\n\t\t\t{renderedTrigger}\n\t\t\t{menu}\n\t\t</div>\n\t);\n});\n\nButtonTrigger.displayName = MENU_DROPDOWN_TRIGGER;\n\nexport default ButtonTrigger as React.ForwardRefExoticComponent<\n\tButtonTriggerProps & React.RefAttributes<HTMLDivElement>\n>;\n"],"mappings":";;;;;;;;AAqGA,IAAM,IAAgB,GAGnB,GAAO,MAAQ;CACjB,IAAM,EACL,kBACA,aACA,cACA,aACA,SACA,iBACA,aACA,iBACA,aACA,gBACA,OACA,YACA,WACA,UACA,WACA,SACA,YACA,YACA,cACA,gBACA,iBACA,iBACA,QAAQ,GACR,UACA,aACA,YACA,eACA,qBACA,eACG,GAEE,IAAS,MAAe,UAAU,UAAU,GAG5C,IACL,MAAY,KAAA,IACT,EAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,MAAM,MACvC,EAA6B,GAAO,CAAM,CAC3C,IACE,GAEC,IAA0C;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,iBAAiB;CAClB,GAEI;CACJ,IAAI,MAAY,KAAA,KAAa,CAAC,EAAgB,GAAsB,CAAM,GACzE,IAAkB,EAAc,GAAS;EACxC,iBAAiB;EACjB,iBAAiB;EACjB,WAAW,EAAW,CAAmB,KAAK,KAAA;EAC9C;EACA,KAAK;EACL;CACD,CAAC;MACK;EAEN,IAAM,IAAa,EAA6B,GAAe,CAAM,IACjE,EAAc,QACf,CAAC,GAGE,IACL,EAAW,SAAS,EAAW,kBAAkB,KAAA,IAC9C;GAAE,eAAe,EAAE,MAAM,GAAG;GAAG,GAAG;EAAW,IAC7C,GACE,IAAoB,EAAY;EACtC,IACC,kBAAC,GAAD;GACC,GAAK,EAAW,GAAgB,CAAW;GAC3C,WACC,KACI,MAAsC;IAEvC,AADA,EAAkB,CAAO,GACzB,IAAa,CAAO;GACrB,IACC;EAEJ,CAAA;CAEH;CAEA,OAEC,kBAAC,OAAD;EACM;EACL,WAAW,EACV,+CAA+C,KAC/C,EACC,gBAAgB,EACjB,GACA,CACD;EACI;EACI;EACC;EACE;EACF;EACI;EACC;EACA;EAhBf,UAAA,CAkBE,GACA,CACG;;AAEP,CAAC;AAED,EAAc,cAAc"}
|