@salesforce/design-system-react 11.0.0-alpha.8 → 11.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/accordion/index.cjs +1 -1
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/alert/container.cjs +1 -1
- package/dist/cjs/components/alert/container.cjs.map +1 -1
- package/dist/cjs/components/avatar/index.cjs +1 -1
- package/dist/cjs/components/avatar/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
- package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
- package/dist/cjs/components/button-stateful/component.cjs +2 -0
- package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
- package/dist/cjs/components/button-stateful/index.cjs +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
- package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
- package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
- package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
- package/dist/cjs/components/combobox/check-props.cjs +1 -1
- package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/combobox/index.cjs +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
- package/dist/cjs/components/expandable-section/index.cjs +1 -1
- package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/popover/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/radio/check-props.cjs +1 -1
- package/dist/cjs/components/radio/check-props.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
- package/dist/cjs/components/radio-group/check-props.cjs +2 -0
- package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
- package/dist/cjs/components/radio-group/component.cjs +2 -0
- package/dist/cjs/components/radio-group/component.cjs.map +1 -0
- package/dist/cjs/components/radio-group/index.cjs +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
- package/dist/cjs/components/slider/check-props.cjs +1 -1
- package/dist/cjs/components/slider/check-props.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/index.cjs +1 -1
- package/dist/cjs/components/split-view/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
- package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox.cjs +1 -1
- package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
- package/dist/cjs/components/tabs/check-props.cjs +2 -0
- package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
- package/dist/cjs/components/tabs/component.cjs +2 -0
- package/dist/cjs/components/tabs/component.cjs.map +1 -0
- package/dist/cjs/components/tabs/index.cjs +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/panel.cjs.map +1 -1
- package/dist/cjs/components/textarea/check-props.cjs +1 -1
- package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/toast/container.cjs +1 -1
- package/dist/cjs/components/toast/container.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +2 -2
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/check-props.cjs.map +1 -1
- package/dist/cjs/components/tree/private/branch.cjs +1 -1
- package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
- package/dist/cjs/components/tree/private/item.cjs +1 -1
- package/dist/cjs/components/tree/private/item.cjs.map +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
- package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
- package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
- package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
- package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/index.cjs +1 -1
- package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
- package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
- package/dist/cjs/utilities/warning/required-property.cjs +2 -0
- package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
- package/dist/es/components/accordion/index.js +10 -8
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/alert/container.js +1 -1
- package/dist/es/components/alert/container.js.map +1 -1
- package/dist/es/components/avatar/index.js +2 -1
- package/dist/es/components/avatar/index.js.map +1 -1
- package/dist/es/components/button-stateful/check-props.js +14 -0
- package/dist/es/components/button-stateful/check-props.js.map +1 -0
- package/dist/es/components/button-stateful/component.js +20 -0
- package/dist/es/components/button-stateful/component.js.map +1 -0
- package/dist/es/components/button-stateful/index.js +102 -94
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/carousel/index.js +112 -130
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +14 -8
- package/dist/es/components/checkbox/check-props.js.map +1 -1
- package/dist/es/components/checkbox/index.js +40 -33
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/check-props.js +16 -11
- package/dist/es/components/color-picker/check-props.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +185 -169
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
- package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
- package/dist/es/components/color-picker/private/hsv-color.js +1 -0
- package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
- package/dist/es/components/combobox/check-props.js +15 -14
- package/dist/es/components/combobox/check-props.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +399 -399
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/index.js +4 -4
- package/dist/es/components/date-picker/check-props.js +15 -9
- package/dist/es/components/date-picker/check-props.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +144 -138
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
- package/dist/es/components/expandable-section/index.js +32 -26
- package/dist/es/components/expandable-section/index.js.map +1 -1
- package/dist/es/components/icon/input-icon/index.js +7 -2
- package/dist/es/components/icon/input-icon/index.js.map +1 -1
- package/dist/es/components/index.js +3 -3
- package/dist/es/components/input/check-props.js +19 -17
- package/dist/es/components/input/check-props.js.map +1 -1
- package/dist/es/components/input/index.js +153 -156
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js +18 -18
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js +1 -1
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/popover/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +209 -205
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/radio/check-props.js +8 -8
- package/dist/es/components/radio/check-props.js.map +1 -1
- package/dist/es/components/radio/index.js +15 -13
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-button-group/index.js.map +1 -1
- package/dist/es/components/radio-button-group/radio.js.map +1 -1
- package/dist/es/components/radio-group/check-props.js +14 -0
- package/dist/es/components/radio-group/check-props.js.map +1 -0
- package/dist/es/components/radio-group/component.js +21 -0
- package/dist/es/components/radio-group/component.js.map +1 -0
- package/dist/es/components/radio-group/index.js +62 -38
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js +5 -4
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/check-props.js +7 -6
- package/dist/es/components/simple-data-table/check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/column.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +67 -49
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/simple-data-table/private/head.js +1 -1
- package/dist/es/components/simple-data-table/private/head.js.map +1 -1
- package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
- package/dist/es/components/simple-data-table/private/row.js +43 -57
- package/dist/es/components/simple-data-table/private/row.js.map +1 -1
- package/dist/es/components/slider/check-props.js +14 -12
- package/dist/es/components/slider/check-props.js.map +1 -1
- package/dist/es/components/slider/index.js +54 -48
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/split-view/index.js +23 -22
- package/dist/es/components/split-view/index.js.map +1 -1
- package/dist/es/components/split-view/listbox-check-props.js +10 -2
- package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
- package/dist/es/components/split-view/listbox.js +67 -50
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/tabs/check-props.js +15 -0
- package/dist/es/components/tabs/check-props.js.map +1 -0
- package/dist/es/components/tabs/component.js +28 -0
- package/dist/es/components/tabs/component.js.map +1 -0
- package/dist/es/components/tabs/index.js +84 -69
- package/dist/es/components/tabs/index.js.map +1 -1
- package/dist/es/components/tabs/panel.js.map +1 -1
- package/dist/es/components/textarea/check-props.js +1 -1
- package/dist/es/components/textarea/check-props.js.map +1 -1
- package/dist/es/components/textarea/index.js +3 -2
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/toast/container.js +1 -1
- package/dist/es/components/toast/container.js.map +1 -1
- package/dist/es/components/tooltip/index.js +120 -109
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/check-props.js +14 -9
- package/dist/es/components/tree/check-props.js.map +1 -1
- package/dist/es/components/tree/private/branch.js +38 -35
- package/dist/es/components/tree/private/branch.js.map +1 -1
- package/dist/es/components/tree/private/item.js +6 -8
- package/dist/es/components/tree/private/item.js.map +1 -1
- package/dist/es/components/tree/private/render-branch.js +9 -10
- package/dist/es/components/tree/private/render-branch.js.map +1 -1
- package/dist/es/components/tree/tree.js +126 -97
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/vertical-navigation/check-props.js +13 -0
- package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
- package/dist/es/components/vertical-navigation/component.js +27 -0
- package/dist/es/components/vertical-navigation/component.js.map +1 -0
- package/dist/es/components/vertical-navigation/index.js +27 -26
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/welcome-mat/info-badge.js +14 -4
- package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
- package/dist/es/utilities/hooks/index.js +2 -1
- package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
- package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
- package/dist/es/utilities/warning/required-property.js +15 -0
- package/dist/es/utilities/warning/required-property.js.map +1 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/avatar/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/check-props.d.ts +3 -0
- package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
- package/dist/types/components/button-stateful/index.d.ts +34 -6
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/carousel/index.d.ts +26 -7
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/checkbox/check-props.d.ts +1 -0
- package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +38 -9
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +50 -11
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/color-picker/index.d.ts +2 -2
- package/dist/types/components/color-picker/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
- package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
- package/dist/types/components/color-picker/types.d.ts +9 -5
- package/dist/types/components/color-picker/types.d.ts.map +1 -1
- package/dist/types/components/combobox/check-props.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts +41 -6
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +52 -17
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +1 -1
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
- package/dist/types/components/expandable-section/index.d.ts +15 -3
- package/dist/types/components/expandable-section/index.d.ts.map +1 -1
- package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
- package/dist/types/components/input/check-props.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +10 -4
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/input/private/inner-input.d.ts +2 -4
- package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/popover/index.d.ts +1 -1
- package/dist/types/components/popover/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +30 -3
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/radio/check-props.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +42 -9
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/index.d.ts +20 -10
- package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/radio.d.ts +7 -2
- package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
- package/dist/types/components/radio-group/check-props.d.ts +3 -0
- package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
- package/dist/types/components/radio-group/index.d.ts +51 -8
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/radio.d.ts +7 -2
- package/dist/types/components/radio-group/radio.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +10 -2
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/column.d.ts +4 -1
- package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts +10 -2
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
- package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +40 -13
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/check-props.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +23 -10
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/split-view/index.d.ts +12 -3
- package/dist/types/components/split-view/index.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
- package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox.d.ts +41 -10
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/tabs/check-props.d.ts +3 -0
- package/dist/types/components/tabs/check-props.d.ts.map +1 -0
- package/dist/types/components/tabs/index.d.ts +46 -12
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +4 -0
- package/dist/types/components/tabs/panel.d.ts.map +1 -1
- package/dist/types/components/textarea/check-props.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +14 -6
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/toast/container.d.ts +1 -1
- package/dist/types/components/tooltip/index.d.ts +49 -3
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/tree/check-props.d.ts +1 -0
- package/dist/types/components/tree/check-props.d.ts.map +1 -1
- package/dist/types/components/tree/private/branch.d.ts +6 -1
- package/dist/types/components/tree/private/branch.d.ts.map +1 -1
- package/dist/types/components/tree/private/item.d.ts +3 -1
- package/dist/types/components/tree/private/item.d.ts.map +1 -1
- package/dist/types/components/tree/private/render-branch.d.ts +3 -1
- package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +33 -6
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/tree/types.d.ts +23 -4
- package/dist/types/components/tree/types.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
- package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/index.d.ts +9 -4
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
- package/dist/types/types/components.d.ts +0 -2
- package/dist/types/types/components.d.ts.map +1 -1
- package/dist/types/utilities/hooks/index.d.ts +1 -0
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
- package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/types/utilities/warning/required-property.d.ts +3 -0
- package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.cjs","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside } from '../../utilities/hooks/use-click-outside';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\tdate: Date;\n\tformattedDate: string;\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input (or deprecated `children` input) was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport interface DatePickerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (date: Date) => boolean;\n\t/** Date formatting function */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Initial formatted value (deprecated) */\n\tformattedValue?: string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Whether dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when date changes */\n\tonChange?: (event: React.SyntheticEvent, data: DatePickerChangeData) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * In uncontrolled mode the calendar also closes itself; in controlled mode (`isOpen`)\n\t * set `isOpen` to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open. If provided, the calendar does not open\n\t * itself: set `isOpen` to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Selected date value */\n\tvalue?: Date;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tformatter = defaultFormatter,\n\t\tformattedValue: formattedValueProp,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\tconst [internalValue, setInternalValue] = useState<Date | undefined>(value);\n\tconst [formattedValue, setFormattedValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputValue, setInputValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (\n\t\t\t\tObject.prototype.toString.call(parsedDate) !== '[object Date]' ||\n\t\t\t\tisNaN(parsedDate.getTime())\n\t\t\t) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\tsetIsOpenState(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\t\t\tif (onRequestOpen) {\n\t\t\t\tonRequestOpen(event, data);\n\t\t\t} else {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t},\n\t\t[onRequestOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\tif (!value) {\n\t\t\t\tsetInternalValue(date);\n\t\t\t\tsetFormattedValue(formatter(date));\n\t\t\t\tsetInputValue(formatter(date));\n\t\t\t}\n\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[value, formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t// Typing in the input closes the calendar when it's used as an uncontrolled component\n\t\t\tif (typeof isOpenProp !== 'boolean' && isOpenState) {\n\t\t\t\tsetIsOpenState(false);\n\t\t\t}\n\n\t\t\tsetFormattedValue(event.target.value);\n\t\t\tsetInputValue(event.target.value);\n\n\t\t\tconst date = parser(event.target.value);\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: event.target.value,\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[isOpenProp, isOpenState, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.keyCode &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.keyCode === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\t// Use props if present. Otherwise, use state.\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = formattedValue\n\t\t\t\t? parseDate(formattedValue)\n\t\t\t\t: internalValue || new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tformattedValue,\n\t\tinternalValue,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: value ? formatter(value) : inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tvalue,\n\t\tformatter,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":"ywBA0MA,IAAM,GAA0D,CAC/D,UAAW,aACX,aAAc,gBACd,cAAe,iBACf,KAAM,MACP,EAEM,GAA4C,CACjD,oBAAqB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EACrE,MAAO,GACP,OAAQ,CACP,UACA,WACA,QACA,QACA,MACA,OACA,O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,EAAO,CAAE,QAAS,aAAc,CAAC,EACxC,OAAO,EAAc,SAAY,YACpC,EAAc,QAAQ,CAExB,CACD,EAEM,GAAmB,IAAO,OAAS,CAAC,EAE1C,MAAO,CACN,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACJ,CACD,EAAG,CACF,EACA,EAAc,aACd,EACA,GACA,GACA,EACA,GACA,EACA,GACA,EACA,EACA,GACA,EACA,EACA,EAAO,MACP,EAAO,YACP,EACA,EACA,EACA,EACA,EACA,EACD,CAImB,CAAA,CAAc,EAG3B,GAAgB,EACrB,EAAA,QAAM,aAAa,EAAU,EAAqC,GAGlE,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CAAO,GAAK,EAAqB,CAAA,EAGlC,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,IAAK,EACL,WAAA,EAAW,EAAA,QAAA,CACV,wBACA,8BACA,8BACA,CACC,iBAAkB,GAClB,eAAgB,EAAU,CAC3B,EACA,EACD,EAXD,SAAA,CAaE,GACA,GAAU,CACP,GAEP,EAEA,EAAW,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"date-picker.cjs","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside, useControllableState } from '../../utilities/hooks';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\t/**\n\t * The requested date: the selected calendar date, or the result of `parser` for typed text.\n\t * `null` when the input is cleared.\n\t */\n\tdate: Date | null;\n\t/** The formatted date, or the typed text */\n\tformattedDate: string;\n\t/** `date.getTimezoneOffset()`, or the current offset when `date` is `null` */\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input (or deprecated `children` input) was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n * - `input-change`: the user typed in the input\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside' | 'input-change';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport type DatePickerChangeHandler = (\n\tevent: React.SyntheticEvent,\n\tdata: DatePickerChangeData\n) => void;\n\n/**\n * `onChange` is required unless the date picker is `disabled`: DatePicker is\n * controlled, so without it picking a date does nothing.\n */\nexport type DatePickerChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a date in the calendar or types in the input. `value` is\n\t\t\t * controlled: set it to `data.date` here (or keep the old value to reject the change).\n\t\t\t * Clearing the input reports `date: null`. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: DatePickerChangeHandler;\n\t }\n\t| { disabled: true; onChange?: DatePickerChangeHandler };\n\ninterface DatePickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled. Receives `{ date }`. */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** Date formatting function. Called with `null` when there is no date. */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/**\n\t * Initial open state of the calendar when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the calendar is open. When set, the calendar is controlled: it never opens or closes\n\t * itself, so update it from `onRequestOpen` and `onRequestClose`. When `undefined`, the calendar\n\t * manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * When `isOpen` is `undefined` the calendar also closes itself; when `isOpen` is set,\n\t * set it to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open (input click, icon click, or Down/Up arrow).\n\t * When `isOpen` is `undefined` the calendar also opens itself; when `isOpen` is set, set it\n\t * to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Selected date, or `null` for no date. Required and controlled: the input and calendar\n\t * always reflect it, and the input's typed text is reset from it whenever it changes.\n\t * Update it from `onChange`. (`undefined` is treated as `null` and warns in development.)\n\t */\n\tvalue: Date | null;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\nexport type DatePickerProps = DatePickerBaseProps & DatePickerChangeProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\nconst isDate = (date: unknown): date is Date =>\n\tObject.prototype.toString.call(date) === '[object Date]';\n\n/**\n * Stable identity of a `value`, so a parent passing `new Date(...)` on every render does not\n * re-sync the typed text. Invalid dates share one key.\n */\nconst getDateKey = (date: Date | null): string =>\n\tdate ? String(date.getTime()) : 'null';\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tdefaultIsOpen = false,\n\t\tformatter = defaultFormatter,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue: valueProp,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// `value` is controlled data; `undefined` (warned in `checkProps`) means no date\n\tconst value = valueProp ?? null;\n\tconst valueKey = getDateKey(value);\n\n\t// State\n\t// The calendar's open state is ephemeral UI: controlled when `isOpen` is set\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\t// The input's text is a buffer so it can hold partial input. `valueKey` is the `value` it was\n\t// last synced from, and `typedKey` the date reported for the typed text.\n\tconst [inputBuffer, setInputBuffer] = useState<{\n\t\ttext: string;\n\t\tvalueKey: string;\n\t\ttypedKey: string | null;\n\t}>(() => ({ text: formatter(value), valueKey, typedKey: null }));\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Re-sync the typed text whenever `value` changes, unless the change is the parent accepting\n\t// the date that was just typed (so the user's text is not reformatted mid-typing)\n\tif (inputBuffer.valueKey !== valueKey) {\n\t\tsetInputBuffer({\n\t\t\ttext:\n\t\t\t\tinputBuffer.typedKey === valueKey ? inputBuffer.text : formatter(value),\n\t\t\tvalueKey,\n\t\t\ttypedKey: null,\n\t\t});\n\t}\n\tconst inputValue = inputBuffer.text;\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (!isDate(parsedDate) || isNaN(parsedDate.getTime())) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen, setIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(true);\n\t\t\tonRequestOpen?.(event, data);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst text = event.target.value;\n\t\t\t// Clearing the input requests no date. `parser` is typed to return a `Date`, but guard\n\t\t\t// against parsers that return `null` for partial input.\n\t\t\tconst parsedDate = text === '' ? null : parser(text);\n\t\t\tconst date = isDate(parsedDate) ? parsedDate : null;\n\n\t\t\tsetInputBuffer((buffer) => ({\n\t\t\t\t...buffer,\n\t\t\t\ttext,\n\t\t\t\ttypedKey: getDateKey(date),\n\t\t\t}));\n\n\t\t\t// Typing closes the calendar, through the same request path as the keyboard and mouse\n\t\t\thandleRequestClose(event, { trigger: 'input-change' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: text,\n\t\t\t\t\ttimezoneOffset: (date ?? new Date()).getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[handleRequestClose, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.keyCode &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.keyCode === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":"w0BAgPA,IAAM,GAA0D,CAC/D,UAAW,aACX,aAAc,gBACd,cAAe,iBACf,KAAM,MACP,EAEM,GAA4C,CACjD,oBAAqB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EACrE,MAAO,GACP,OAAQ,CACP,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,UACD,EACA,YAAa,cACb,MAAO,QACP,SAAU,CACT,SACA,SACA,UACA,YACA,WACA,SACA,UACD,CACD,EAEM,GAAoB,GAClB,EACJ,GAAG,EAAK,SAAS,EAAI,EAAE,GAAG,EAAK,QAAQ,EAAE,GAAG,EAAK,YAAY,IAC7D,GAGE,GAAiB,IACtB,GAAA,QACC,GACA,2JACD,EACO,IAAI,KAAK,CAAG,GAGd,EAAU,GACf,OAAO,UAAU,SAAS,KAAK,CAAI,IAAM,gBAMpC,EAAc,GACnB,EAAO,OAAO,EAAK,QAAQ,CAAC,EAAI,OAI3B,EAAyC,GAAU,CACxD,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,EAAqB,CAAA,EAGlC,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,IAAK,EACL,WAAA,EAAW,EAAA,QAAA,CACV,wBACA,8BACA,8BACA,CACC,iBAAkB,GAClB,eAAgB,EAAU,CAC3B,EACA,EACD,EAXD,SAAA,CAaE,GACA,GAAU,CACP,GAEP,EAEA,EAAW,YAAc,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/date-picker/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 { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerCloseData,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/date-picker/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 { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerChangeHandler,\n\tDatePickerChangeProps,\n\tDatePickerCloseData,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":"0LA4BA,IAAM,GAAA,EAA6B,EAAA,WAAA,EACjC,EAAO,KACP,EAAA,EAAA,IAAA,CAAC,MAAD,CAAA,UACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CAAY,GAAI,CAAQ,CAAA,CACpB,CAAA,CAEP,EAEA,EAA2B,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-wrapper.cjs","names":[],"sources":["../../../../../components/date-picker/private/calendar-wrapper.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 SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport Calendar
|
|
1
|
+
{"version":3,"file":"calendar-wrapper.cjs","names":[],"sources":["../../../../../components/date-picker/private/calendar-wrapper.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 SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport Calendar from './calendar';\nimport CalendarNavigation from './navigation';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\n\nexport interface CalendarWrapperProps {\n\t/** Label for button to go to the next month */\n\tassistiveTextNextMonth: string;\n\t/** Label for button to go to the previous month */\n\tassistiveTextPreviousMonth: string;\n\t/** Label for year picklist/combobox */\n\tassistiveTextYear: string;\n\t/** One letter abbreviations of the days of the week, starting on Sunday */\n\tabbreviatedWeekDayLabels: string[];\n\t/** Whether or not the CalendarWrapper can steal focus from the main Input */\n\tcanFocusCalendar: boolean;\n\t/** CSS classes for datepicker */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** HTML id for component */\n\tid?: string;\n\t/** Makes Monday the first day of the week */\n\tisIsoWeekday?: boolean;\n\t/** For use of datepicker outside of dropdown */\n\tisolated?: boolean;\n\t/** Names of the months */\n\tmonthLabels: string[];\n\t/** Called when keyboard moves focus on calendar */\n\tonCalendarFocus?: (\n\t\tevent: SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when calendar should close */\n\tonRequestClose: (\n\t\tevent?: SyntheticEvent,\n\t\tdata?: Record<string, unknown>\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo: number;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Full names of the days of the week */\n\tweekDayLabels: string[];\n}\n\ninterface CalendarWrapperState {\n\tinitialDateForCalendarRender: Date;\n}\n\nclass DatepickerCalendarWrapper extends React.Component<\n\tCalendarWrapperProps,\n\tCalendarWrapperState\n> {\n\tstatic displayName = 'DatepickerCalendarWrapper';\n\n\tstatic defaultProps = {\n\t\tselectedDate: new Date(),\n\t\tvalue: new Date(),\n\t};\n\n\tstate: CalendarWrapperState = {\n\t\tinitialDateForCalendarRender: this.props.selectedDate as Date,\n\t};\n\n\tpreviousMonthRef: HTMLButtonElement | null = null;\n\n\ttodayRef: HTMLAnchorElement | null = null;\n\n\thandleCalendarBlur = (\n\t\tevent: SyntheticEvent,\n\t\t{ direction }: { direction: string }\n\t) => {\n\t\tif (direction === 'next' && this.previousMonthRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.previousMonthRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.previousMonthRef.focus();\n\t\t} else if (direction === 'previous' && this.todayRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.todayRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.todayRef.focus();\n\t\t}\n\t};\n\n\thandleFirstFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t}\n\t};\n\n\thandleInitialDateForCalendarRenderChange = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tinitialDateForCalendarRender: Date\n\t) => {\n\t\tthis.setState({ initialDateForCalendarRender });\n\t};\n\n\thandleKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.keyCode === KEYS.ESCAPE) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleLastFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.previousMonthRef?.focus();\n\t\t}\n\t};\n\n\thandleRequestClose = (event?: SyntheticEvent) => {\n\t\tif (this.props.onRequestClose) {\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleRequestFocusDate = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => {\n\t\t// will be called three times, due to re-render\n\t\tif (data.ref && this.props.canFocusCalendar) {\n\t\t\tdata.ref.focus();\n\t\t}\n\n\t\t// only call on actual DOM event and not on re-render\n\t\tif (this.props.onCalendarFocus && data.triggerCallback) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\tconst { triggerCallback, ref, ...rest } = data;\n\t\t\tthis.props.onCalendarFocus(event ?? null, {\n\t\t\t\t...rest,\n\t\t\t\tref: ref ?? undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t<div // eslint-disable-line jsx-a11y/no-static-element-interactions\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-datepicker': this.props.isolated,\n\t\t\t\t\t},\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\taria-hidden=\"false\"\n\t\t\t\tdata-selection=\"single\"\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t>\n\t\t\t\t<CalendarNavigation\n\t\t\t\t\tassistiveTextNextMonth={this.props.assistiveTextNextMonth}\n\t\t\t\t\tassistiveTextPreviousMonth={this.props.assistiveTextPreviousMonth}\n\t\t\t\t\tassistiveTextYear={this.props.assistiveTextYear}\n\t\t\t\t\tid={this.props.id}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tmonthLabels={this.props.monthLabels}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tpreviousMonthRef={(component) => {\n\t\t\t\t\t\tthis.previousMonthRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonPreviousMonthKeyDown={this.handleFirstFocusableNodeKeyDown}\n\t\t\t\t\trelativeYearFrom={this.props.relativeYearFrom}\n\t\t\t\t\trelativeYearTo={this.props.relativeYearTo}\n\t\t\t\t/>\n\t\t\t\t<Calendar\n\t\t\t\t\tabbreviatedWeekDayLabels={this.props.abbreviatedWeekDayLabels}\n\t\t\t\t\tdateDisabled={this.props.dateDisabled}\n\t\t\t\t\tid={this.props.id as string}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tisIsoWeekday={this.props.isIsoWeekday}\n\t\t\t\t\tonCalendarBlur={this.handleCalendarBlur}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\t\tonRequestInternalFocusDate={this.handleRequestFocusDate}\n\t\t\t\t\tonSelectDate={this.props.onSelectDate}\n\t\t\t\t\tselectedDate={this.props.selectedDate}\n\t\t\t\t\tselectedDateRef={this.props.selectedDateRef}\n\t\t\t\t\ttodayLabel={this.props.todayLabel}\n\t\t\t\t\ttodayRef={(component) => {\n\t\t\t\t\t\tthis.todayRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonLastFocusableNodeKeyDown={this.handleLastFocusableNodeKeyDown}\n\t\t\t\t\tweekDayLabels={this.props.weekDayLabels}\n\t\t\t\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StringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs");let
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/hooks/use-controllable-state.cjs"),r=require("../button/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=!0,c={toggleSection:`Toggle visibility of section`},l=({assistiveText:e,children:t,className:l,id:u,isOpen:d,defaultIsOpen:f=s,nonCollapsible:p=!1,onToggleOpen:m,title:h})=>{let g=(0,i.useId)(),[_,v]=n.useControllableState(d,f),y=u||g,b={...c,...e},x=`${y}-expanded-section-content`,S=(0,i.useCallback)(e=>{let t=!_;v(t),m?.(e,{isOpen:t})},[_,m,v]),C={"aria-controls":x,"aria-expanded":!!_},w=(0,o.jsx)(`span`,{className:(0,a.default)(`slds-truncate`,{"slds-p-horizontal_small":p}),title:h,children:h});return(0,o.jsxs)(`div`,{className:(0,a.default)(`slds-section`,{"slds-is-open":_},l),children:[(0,o.jsx)(`h3`,{className:(0,a.default)(`slds-section__title`,{"slds-theme_shade":p}),children:p?w:(0,o.jsx)(r.default,{assistiveText:{icon:b.toggleSection},iconCategory:`utility`,iconClassName:`slds-section__title-action-icon slds-button__icon_left`,iconName:`switch`,onClick:S,className:`slds-section__title-action`,variant:`base`,...C,children:w})}),(0,o.jsx)(`div`,{"aria-hidden":!_,className:`slds-section__content`,id:x,children:t})]})};l.displayName=t.EXPANDABLE_SECTION,exports.default=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/expandable-section/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, {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/expandable-section/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\tuseCallback,\n\ttype ReactNode,\n\ttype MouseEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport Button from '../button';\nimport { EXPANDABLE_SECTION } from '../../utilities/constants';\nimport { useControllableState } from '../../utilities/hooks';\n\n/**\n * Open state of an uncontrolled section when `defaultIsOpen` is not set: sections start open.\n * This is a documented exception to the \"booleans must not default to `true`\" rule.\n */\nconst DEFAULT_IS_OPEN = true;\n\n/**\n * Assistive text for ExpandableSection\n */\nexport interface ExpandableSectionAssistiveText {\n\t/** Label for the toggle button */\n\ttoggleSection?: string;\n}\n\n/**\n * Props for the ExpandableSection component\n */\nexport interface ExpandableSectionProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ExpandableSectionAssistiveText;\n\t/** Content of the section */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Unique identifier */\n\tid?: string;\n\t/**\n\t * Open state when the section is controlled. When set, the section only expands and collapses when\n\t * this prop changes: update it from `onToggleOpen`. Leave it `undefined` for an uncontrolled section\n\t * (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Initial open state of an uncontrolled section (`isOpen` is `undefined`). Defaults to `true`\n\t * (sections start open); an exception to the boolean-default rule.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/** Whether section cannot be collapsed */\n\tnonCollapsible?: boolean;\n\t/**\n\t * Called when the toggle button is clicked, controlled or not. `data.isOpen` is the requested\n\t * (next) open state.\n\t */\n\tonToggleOpen?: (\n\t\tevent: MouseEvent<HTMLButtonElement>,\n\t\tdata: { isOpen: boolean }\n\t) => void;\n\t/** Section title (required) */\n\ttitle: string;\n}\n\nconst defaultAssistiveText: ExpandableSectionAssistiveText = {\n\ttoggleSection: 'Toggle visibility of section',\n};\n\n/**\n * Toggle visibility of section content with the Expandable Section\n */\nconst ExpandableSection = ({\n\tassistiveText: propAssistiveText,\n\tchildren,\n\tclassName,\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\tdefaultIsOpen = DEFAULT_IS_OPEN,\n\tnonCollapsible = false,\n\tonToggleOpen,\n\ttitle,\n}: ExpandableSectionProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst [isOpen, setIsOpen] = useControllableState(\n\t\tcontrolledIsOpen,\n\t\tdefaultIsOpen\n\t);\n\n\tconst id = propId || generatedId;\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\tconst contentId = `${id}-expanded-section-content`;\n\n\tconst handleToggle = useCallback(\n\t\t(event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tconst nextIsOpen = !isOpen;\n\t\t\tsetIsOpen(nextIsOpen);\n\t\t\tonToggleOpen?.(event, { isOpen: nextIsOpen });\n\t\t},\n\t\t[isOpen, onToggleOpen, setIsOpen]\n\t);\n\n\tconst buttonAriaProps = {\n\t\t'aria-controls': contentId,\n\t\t'aria-expanded': Boolean(isOpen),\n\t};\n\n\tconst titleNode = (\n\t\t<span\n\t\t\tclassName={classNames('slds-truncate', {\n\t\t\t\t'slds-p-horizontal_small': nonCollapsible,\n\t\t\t})}\n\t\t\ttitle={title}\n\t\t>\n\t\t\t{title}\n\t\t</span>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-section',\n\t\t\t\t{ 'slds-is-open': isOpen },\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t>\n\t\t\t<h3\n\t\t\t\tclassName={classNames('slds-section__title', {\n\t\t\t\t\t'slds-theme_shade': nonCollapsible,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{!nonCollapsible ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: assistiveText.toggleSection }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonClassName=\"slds-section__title-action-icon slds-button__icon_left\"\n\t\t\t\t\t\ticonName=\"switch\"\n\t\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t\t\tclassName=\"slds-section__title-action\"\n\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t{...buttonAriaProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t{titleNode}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\ttitleNode\n\t\t\t\t)}\n\t\t\t</h3>\n\t\t\t<div\n\t\t\t\taria-hidden={!isOpen}\n\t\t\t\tclassName=\"slds-section__content\"\n\t\t\t\tid={contentId}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nExpandableSection.displayName = EXPANDABLE_SECTION;\n\nexport default ExpandableSection;\n"],"mappings":"yZAkBA,IAAM,EAAkB,GA+ClB,EAAuD,CAC5D,cAAe,8BAChB,EAKM,GAAqB,CAC1B,cAAe,EACf,WACA,YACA,GAAI,EACJ,OAAQ,EACR,gBAAgB,EAChB,iBAAiB,GACjB,eACA,WACiD,CACjD,IAAM,GAAA,EAAc,EAAA,MAAA,CAAM,EACpB,CAAC,EAAQ,GAAa,EAAA,qBAC3B,EACA,CACD,EAEM,EAAK,GAAU,EACf,EAAgB,CAAE,GAAG,EAAsB,GAAG,CAAkB,EAEhE,EAAY,GAAG,EAAG,2BAElB,GAAA,EAAe,EAAA,YAAA,CACnB,GAAyC,CACzC,IAAM,EAAa,CAAC,EACpB,EAAU,CAAU,EACpB,IAAe,EAAO,CAAE,OAAQ,CAAW,CAAC,CAC7C,EACA,CAAC,EAAQ,EAAc,CAAS,CACjC,EAEM,EAAkB,CACvB,gBAAiB,EACjB,gBAAiB,EAAQ,CAC1B,EAEM,GACL,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,gBAAiB,CACtC,0BAA2B,CAC5B,CAAC,EACM,QAEN,SAAA,CACI,CAAA,EAGP,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,eACA,CAAE,eAAgB,CAAO,EACzB,CACD,EALD,SAAA,EAOC,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,sBAAuB,CAC5C,mBAAoB,CACrB,CAAC,EAEA,SAAC,EAcD,GAbA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,KAAM,EAAc,aAAc,EACnD,aAAa,UACb,cAAc,yDACd,SAAS,SACT,QAAS,EACT,UAAU,6BACV,QAAQ,OACR,GAAI,EAEH,SAAA,CACM,CAAA,CAIN,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,MAAD,CACC,cAAa,CAAC,EACd,UAAU,wBACV,GAAI,EAEH,UACG,CAAA,CACD,GAEP,EAEA,EAAkB,YAAc,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../utilities/utility-icon/index.cjs"),r=require("../../button/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime"),s=require("lodash.isfunction");s=e.__toESM(s,1);var c=({category:e=`utility`,variant:t=`base`,iconPosition:i,name:c,path:l,onClick:u,...d})=>{let f={combobox:(0,o.jsx)(`span`,{className:`slds-icon_container slds-input__icon slds-input__icon_right`,children:(0,o.jsx)(n.default,{"aria-hidden":!0,category:e,className:(0,a.default)(`slds-icon slds-icon_x-small slds-icon-text-default`),name:c,path:l,...d})}),base:(0,o.jsx)(n.default,{"aria-hidden":!0,category:e,className:(0,a.default)(`slds-input__icon slds-icon-text-default`,{[`slds-input__icon_${i}`]:i}),name:c,path:l,...d})};return(0,s.default)(u)?(0,o.jsx)(r.default,{className:(0,a.default)(`slds-input__icon`,{[`slds-input__icon_${i}`]:i}),iconCategory:e,iconName:c,iconPath:l,onClick:u,variant:`icon`,...d}):
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/constants.cjs"),n=require("../../utilities/utility-icon/index.cjs"),r=require("../../button/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime"),s=require("lodash.isfunction");s=e.__toESM(s,1);var c=({category:e=`utility`,variant:t=`base`,iconPosition:i,name:c,path:l,onClick:u,...d})=>{let f={pointerEvents:`none`,...d.style},p={combobox:(0,o.jsx)(`span`,{className:`slds-icon_container slds-input__icon slds-input__icon_right`,style:{pointerEvents:`none`},children:(0,o.jsx)(n.default,{"aria-hidden":!0,category:e,className:(0,a.default)(`slds-icon slds-icon_x-small slds-icon-text-default`),name:c,path:l,...d})}),base:(0,o.jsx)(n.default,{"aria-hidden":!0,category:e,className:(0,a.default)(`slds-input__icon slds-icon-text-default`,{[`slds-input__icon_${i}`]:i}),name:c,path:l,...d,style:f})};return(0,s.default)(u)?(0,o.jsx)(r.default,{className:(0,a.default)(`slds-input__icon`,{[`slds-input__icon_${i}`]:i}),iconCategory:e,iconName:c,iconPath:l,onClick:u,variant:`icon`,...d}):p[t]};c.displayName=t.ICON_INPUT,exports.default=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/icon/input-icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// ### React\nimport React, { type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\nexport interface InputIconProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: string;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * This event fires when the icon is clicked.\n\t */\n\tonClick?: (event: MouseEvent) => void;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n\t[key: string]: unknown;\n}\n\n/**\n * A wrapper for icons that will be rendered inside of an Input\n *\n * If the `onClick` function prop is provided, the `design-system-react/components/button` component is used.\n * If not, the icon will be an instance of `design-system-react/components/utilities/utility-icon`.\n * Checkout out the appropriate component to see what props can be passed along via the `{...props}` rest operator\n */\nconst InputIcon = ({\n\tcategory = 'utility',\n\tvariant = 'base',\n\ticonPosition,\n\tname,\n\tpath,\n\tonClick,\n\t...rest\n}: InputIconProps): React.ReactElement => {\n\t//
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../../components/icon/input-icon/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// ### React\nimport React, { type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\nexport interface InputIconProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: string;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * This event fires when the icon is clicked.\n\t */\n\tonClick?: (event: MouseEvent) => void;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n\t[key: string]: unknown;\n}\n\n/**\n * A wrapper for icons that will be rendered inside of an Input\n *\n * If the `onClick` function prop is provided, the `design-system-react/components/button` component is used.\n * If not, the icon will be an instance of `design-system-react/components/utilities/utility-icon`.\n * Checkout out the appropriate component to see what props can be passed along via the `{...props}` rest operator\n */\nconst InputIcon = ({\n\tcategory = 'utility',\n\tvariant = 'base',\n\ticonPosition,\n\tname,\n\tpath,\n\tonClick,\n\t...rest\n}: InputIconProps): React.ReactElement => {\n\t// SLDS 1 let clicks pass through a decorative icon to the input with\n\t// `.slds-input-has-icon .slds-input__icon:not(button)`; SLDS 2 dropped it.\n\tconst passThroughStyle = {\n\t\tpointerEvents: 'none' as const,\n\t\t...(rest.style as React.CSSProperties | undefined),\n\t};\n\n\tconst variants: Record<'combobox' | 'base', React.ReactElement> = {\n\t\tcombobox: (\n\t\t\t<span\n\t\t\t\tclassName=\"slds-icon_container slds-input__icon slds-input__icon_right\"\n\t\t\t\tstyle={{ pointerEvents: 'none' }}\n\t\t\t>\n\t\t\t\t<UtilityIcon\n\t\t\t\t\taria-hidden\n\t\t\t\t\tcategory={category as IconCategory}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-icon slds-icon_x-small slds-icon-text-default'\n\t\t\t\t\t)}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={path}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</span>\n\t\t),\n\t\tbase: (\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden\n\t\t\t\tcategory={category as IconCategory}\n\t\t\t\tclassName={classNames('slds-input__icon slds-icon-text-default', {\n\t\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t\t})}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={passThroughStyle}\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn isFunction(onClick) ? (\n\t\t<Button\n\t\t\tclassName={classNames('slds-input__icon', {\n\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t})}\n\t\t\ticonCategory={category as IconCategory}\n\t\t\ticonName={name}\n\t\t\ticonPath={path}\n\t\t\tonClick={onClick}\n\t\t\tvariant=\"icon\"\n\t\t\t{...rest}\n\t\t/>\n\t) : (\n\t\tvariants[variant]\n\t);\n};\n\nInputIcon.displayName = ICON_INPUT;\n\nexport default InputIcon;\n"],"mappings":"yWAyDA,IAAM,GAAa,CAClB,WAAW,UACX,UAAU,OACV,eACA,OACA,OACA,UACA,GAAG,KACsC,CAGzC,IAAM,EAAmB,CACxB,cAAe,OACf,GAAI,EAAK,KACV,EAEM,EAA4D,CACjE,UACC,EAAA,EAAA,IAAA,CAAC,OAAD,CACC,UAAU,8DACV,MAAO,CAAE,cAAe,MAAO,EAE/B,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CACV,oDACD,EACM,OACA,OACN,GAAI,CACJ,CAAA,CACI,CAAA,EAEP,MACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAA,GACU,WACV,WAAA,EAAW,EAAA,QAAA,CAAW,0CAA2C,EAC/D,oBAAoB,KAAiB,CACvC,CAAC,EACK,OACA,OACN,GAAI,EACJ,MAAO,CACP,CAAA,CAEH,EAEA,OAAA,EAAO,EAAA,QAAA,CAAW,CAAO,GACxB,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,WAAA,EAAW,EAAA,QAAA,CAAW,mBAAoB,EACxC,oBAAoB,KAAiB,CACvC,CAAC,EACD,aAAc,EACd,SAAU,EACV,SAAU,EACD,UACT,QAAQ,OACR,GAAI,CACJ,CAAA,EAED,EAAS,EAEX,EAEA,EAAU,YAAc,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const ee=require("./accordion/index.cjs"),te=require("./utilities/UNSAFE_direction/index.cjs"),e=require("./icon-settings/index.cjs"),t=require("./utilities/utility-icon/index.cjs"),n=require("./icon/button-icon/index.cjs"),r=require("./portal-settings/index.cjs"),i=require("./icon/index.cjs"),a=require("./tooltip/index.cjs"),o=require("./button/index.cjs"),ne=require("./accordion/panel.cjs"),re=require("./alert/index.cjs"),ie=require("./alert/container.cjs"),s=require("./avatar/index.cjs"),c=require("./badge/index.cjs"),l=require("./menu-dropdown/button-trigger.cjs"),u=require("./menu-dropdown/index.cjs"),d=require("./breadcrumb/index.cjs"),f=require("./builder-header/utilities.cjs"),p=require("./builder-header/nav-link.cjs"),m=require("./builder-header/index.cjs"),h=require("./builder-header/misc.cjs"),g=require("./builder-header/nav.cjs"),_=require("./builder-header/nav-dropdown.cjs"),v=require("./builder-header/toolbar.cjs"),y=require("./button-group/index.cjs"),b=require("./button-stateful/index.cjs"),x=require("./media-object/index.cjs"),S=require("./card/empty.cjs"),C=require("./card/index.cjs"),w=require("./spinner/index.cjs"),T=require("./input/index.cjs"),E=require("./icon/input-icon/index.cjs"),D=require("./card/filter.cjs"),O=require("./carousel/index.cjs"),k=require("./checkbox/index.cjs"),A=require("./radio-group/index.cjs"),j=require("./radio-button-group/index.cjs"),M=require("./radio/index.cjs"),N=require("./tabs/index.cjs"),P=require("./tabs/panel.cjs"),F=require("./popover/index.cjs"),I=require("./color-picker/color-picker.cjs"),L=require("./pill/index.cjs"),R=require("./combobox/index.cjs"),z=require("./combobox/filter.cjs"),B=require("./date-picker/index.cjs"),V=require("./docked-composer/index.cjs"),H=require("./dynamic-icon/index.cjs"),U=require("./popover/edit-dialog.cjs"),W=require("./expandable-section/index.cjs"),G=require("./files/file.cjs"),K=require("./files/index.cjs"),q=require("./files/more-files.cjs"),J=require("./filter/filter.cjs"),Y=require("./illustration/index.cjs"),X=require("./input/search.cjs"),ae=require("./settings.cjs"),oe=require("./modal/index.cjs"),Z=require("./vertical-navigation/index.cjs"),se=require("./page-header/index.cjs"),ce=require("./page-header/control.cjs"),le=require("./panel/index.cjs"),ue=require("./panel/filtering/group.cjs"),de=require("./panel/filtering/list.cjs"),fe=require("./panel/filtering/list-heading.cjs"),pe=require("./pill-container/index.cjs"),me=require("./progress-bar/index.cjs"),he=require("./progress-indicator/index.cjs"),ge=require("./progress-ring/index.cjs"),_e=require("./scoped-notification/index.cjs"),ve=require("./setup-assistant/index.cjs"),ye=require("./setup-assistant/step.cjs"),be=require("./simple-data-table/cell.cjs"),xe=require("./simple-data-table/column.cjs"),Se=require("./simple-data-table/interactive-element.cjs"),Ce=require("./simple-data-table/interactive-link.cjs"),we=require("./simple-data-table/row-actions.cjs"),Te=require("./simple-data-table/index.cjs"),Ee=require("./simple-data-table/highlight-cell.cjs"),De=require("./slider/index.cjs"),Q=require("./split-view/index.cjs"),Oe=require("./split-view/header.cjs"),ke=require("./split-view/listbox.cjs"),Ae=require("./textarea/index.cjs"),je=require("./toast/index.cjs"),Me=require("./toast/container.cjs"),Ne=require("./tree/tree.cjs"),Pe=require("./trial-bar/index.cjs"),$=require("./trial-bar/button.cjs"),Fe=require("./trial-bar/dropdown.cjs"),Ie=require("./visual-picker/index.cjs"),Le=require("./visual-picker/link.cjs"),Re=require("./welcome-mat/index.cjs"),ze=require("./welcome-mat/info-badge.cjs"),Be=require("./welcome-mat/tile.cjs"),Ve=require("./combobox/add-subheadings.cjs"),He=require("../utilities/log.cjs");exports.Accordion=ee.default,exports.AccordionPanel=ne.default,exports.Alert=re.default,exports.AlertContainer=ie.default,exports.Avatar=s.default,exports.Badge=c.default,exports.BreadCrumb=d.default,exports.Breadcrumb=d.default,exports.BuilderHeader=m.default,exports.BuilderHeaderMisc=h.default,exports.BuilderHeaderNav=g.default,exports.BuilderHeaderNavDropdown=_.default,exports.BuilderHeaderNavLink=p.default,exports.BuilderHeaderToolbar=v.default,exports.BuilderHeaderUtilities=f.default,exports.Button=o.default,exports.ButtonGroup=y.default,exports.ButtonIcon=n.default,exports.ButtonStateful=b.default,exports.Card=C.default,exports.CardEmpty=S.default,exports.CardFilter=D.default,exports.Carousel=O.default,exports.Checkbox=k.default,exports.ColorPicker=I.default,exports.Combobox=R.default,exports.DatePicker=B.default,exports.Datepicker=B.default,exports.DockedComposer=V.default,exports.Dropdown=u.default,exports.DropdownTrigger=l.default,exports.DynamicIcon=H.default,exports.EditDialog=U.default,exports.ExpandableSection=W.default,exports.File=G.default,exports.Files=K.default,exports.FilesFile=G.default,exports.FilesMoreFiles=q.default,exports.Filter=J.default,exports.Icon=i.default,exports.IconSettings=e.default,exports.Illustration=Y.default,exports.Input=T.default,exports.InputIcon=E.default,exports.InputSearch=X.default,exports.MediaObject=x.default,exports.MenuDropdown=u.default,exports.MenuDropdownButtonTrigger=l.default,exports.Modal=oe.default,exports.MoreFiles=q.default,exports.Navigation=Z.default,exports.PageHeader=se.default,exports.PageHeaderControl=ce.default,exports.Panel=le.default,exports.PanelFilterGroup=ue.default,exports.PanelFilterList=de.default,exports.PanelFilterListHeading=fe.default,exports.Pill=L.default,exports.PillContainer=pe.default,exports.Popover=F.default,exports.PopoverTooltip=a.default,exports.PortalSettings=r.default,exports.ProgressBar=me.default,exports.ProgressIndicator=he.default,exports.ProgressRing=ge.default,exports.Radio=M.default,exports.RadioButtonGroup=j.default,exports.RadioGroup=A.default,exports.SLDSAccordion=ee.default,exports.SLDSAccordionPanel=ne.default,exports.SLDSAlert=re.default,exports.SLDSAlertContainer=ie.default,exports.SLDSAvatar=s.default,exports.SLDSBadge=c.default,exports.SLDSBreadCrumb=d.default,exports.SLDSBreadcrumb=d.default,exports.SLDSBuilderHeader=m.default,exports.SLDSBuilderHeaderMisc=h.default,exports.SLDSBuilderHeaderNav=g.default,exports.SLDSBuilderHeaderNavDropdown=_.default,exports.SLDSBuilderHeaderNavLink=p.default,exports.SLDSBuilderHeaderToolbar=v.default,exports.SLDSBuilderHeaderUtilities=f.default,exports.SLDSButton=o.default,exports.SLDSButtonGroup=y.default,exports.SLDSButtonIcon=n.default,exports.SLDSButtonStateful=b.default,exports.SLDSCard=C.default,exports.SLDSCardEmpty=S.default,exports.SLDSCardFilter=D.default,exports.SLDSCarousel=O.default,exports.SLDSCheckbox=k.default,exports.SLDSColorPicker=I.default,exports.SLDSCombobox=R.default,exports.SLDSComboboxFilterAndLimit=z.default,exports.SLDSDatePicker=B.default,exports.SLDSDatepicker=B.default,exports.SLDSDockedComposer=V.default,exports.SLDSDropdownTrigger=l.default,exports.SLDSDynamicIcon=H.default,exports.SLDSEditDialog=U.default,exports.SLDSExpandableSection=W.default,exports.SLDSFile=G.default,exports.SLDSFiles=K.default,exports.SLDSFilesFile=G.default,exports.SLDSFilesMoreFiles=q.default,exports.SLDSFilter=J.default,exports.SLDSIcon=i.default,exports.SLDSIconSettings=e.default,exports.SLDSIllustration=Y.default,exports.SLDSInput=T.default,exports.SLDSInputIcon=E.default,exports.SLDSInputSearch=X.default,exports.SLDSMediaObject=x.default,exports.SLDSMenuDropdown=u.default,exports.SLDSMenuDropdownButtonTrigger=l.default,exports.SLDSModal=oe.default,exports.SLDSMoreFiles=q.default,exports.SLDSNavigation=Z.default,exports.SLDSPageHeader=se.default,exports.SLDSPageHeaderControl=ce.default,exports.SLDSPanel=le.default,exports.SLDSPanelFilterGroup=ue.default,exports.SLDSPanelFilterList=de.default,exports.SLDSPanelFilterListHeading=fe.default,exports.SLDSPill=L.default,exports.SLDSPillContainer=pe.default,exports.SLDSPopover=F.default,exports.SLDSPopoverTooltip=a.default,exports.SLDSPortalSettings=r.default,exports.SLDSProgressBar=me.default,exports.SLDSProgressIndicator=he.default,exports.SLDSProgressRing=ge.default,exports.SLDSRadio=M.default,exports.SLDSRadioButtonGroup=j.default,exports.SLDSRadioGroup=A.default,exports.SLDSScopedNotification=_e.default,exports.SLDSSearch=X.default,exports.SLDSSettings=ae.default,exports.SLDSSetupAssistant=ve.default,exports.SLDSSetupAssistantStep=ye.default,exports.SLDSSimpleDataTable=Te.default,exports.SLDSSimpleDataTableCell=be.default,exports.SLDSSimpleDataTableColumn=xe.default,exports.SLDSSimpleDataTableHighlightCell=Ee.default,exports.SLDSSimpleDataTableInteractiveElement=Se.default,exports.SLDSSimpleDataTableInteractiveLink=Ce.default,exports.SLDSSimpleDataTableRowActions=we.default,exports.SLDSSlider=De.default,exports.SLDSSpinner=w.default,exports.SLDSSplitView=Q.default,exports.SLDSSplitViewHeader=Oe.default,exports.SLDSSplitViewListbox=ke.default,exports.SLDSSplitview=Q.default,exports.SLDSTabs=N.default,exports.SLDSTabsPanel=P.default,exports.SLDSTextarea=Ae.default,exports.SLDSToast=je.default,exports.SLDSToastContainer=Me.default,exports.SLDSTooltip=a.default,exports.SLDSTree=Ne.default,exports.SLDSTrialBar=Pe.default,exports.SLDSTrialBarButton=$.default,exports.SLDSTrialBarDropdown=Fe.default,exports.SLDSUtilityIcon=t.default,exports.SLDSVerticalNavigation=Z.default,exports.SLDSVisualPicker=Ie.default,exports.SLDSVisualPickerLink=Le.default,exports.SLDSWelcomeMat=Re.default,exports.SLDSWelcomeMatInfoBadge=ze.default,exports.SLDSWelcomeMatTile=Be.default,exports.ScopedNotification=_e.default,exports.Search=X.default,exports.Settings=ae.default,exports.SetupAssistant=ve.default,exports.SetupAssistantStep=ye.default,exports.SimpleDataTable=Te.default,exports.SimpleDataTableCell=be.default,exports.SimpleDataTableColumn=xe.default,exports.SimpleDataTableHighlightCell=Ee.default,exports.SimpleDataTableInteractiveElement=Se.default,exports.SimpleDataTableInteractiveLink=Ce.default,exports.SimpleDataTableRowActions=we.default,exports.Slider=De.default,exports.Spinner=w.default,exports.SplitView=Q.default,exports.SplitViewHeader=Oe.default,exports.SplitViewListbox=ke.default,exports.Splitview=Q.default,exports.Tabs=N.default,exports.TabsPanel=P.default,exports.Textarea=Ae.default,exports.Toast=je.default,exports.ToastContainer=Me.default,exports.Tooltip=a.default,exports.Tree=Ne.default,exports.TrialBar=Pe.default,exports.TrialBarButton=$.default,exports.TrialBarDropdown=Fe.default,exports.UNSAFE_DirectionSettings=te.default,exports.UtilityIcon=t.default,exports.VerticalNavigation=Z.default,exports.VisualPicker=Ie.default,exports.VisualPickerLink=Le.default,exports.WelcomeMat=Re.default,exports.WelcomeMatInfoBadge=ze.default,exports.WelcomeMatTile=Be.default,exports.comboboxAddSubheadings=Ve.default,exports.comboboxFilterAndLimit=z.default,exports.log=He.default;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const ee=require("./accordion/index.cjs"),te=require("./utilities/UNSAFE_direction/index.cjs"),e=require("./icon-settings/index.cjs"),t=require("./utilities/utility-icon/index.cjs"),n=require("./icon/button-icon/index.cjs"),r=require("./portal-settings/index.cjs"),i=require("./icon/index.cjs"),a=require("./tooltip/index.cjs"),o=require("./button/index.cjs"),ne=require("./accordion/panel.cjs"),re=require("./alert/index.cjs"),ie=require("./alert/container.cjs"),s=require("./avatar/index.cjs"),c=require("./badge/index.cjs"),l=require("./menu-dropdown/button-trigger.cjs"),u=require("./menu-dropdown/index.cjs"),d=require("./breadcrumb/index.cjs"),f=require("./builder-header/utilities.cjs"),p=require("./builder-header/nav-link.cjs"),m=require("./builder-header/index.cjs"),h=require("./builder-header/misc.cjs"),g=require("./builder-header/nav.cjs"),_=require("./builder-header/nav-dropdown.cjs"),v=require("./builder-header/toolbar.cjs"),y=require("./button-group/index.cjs"),b=require("./button-stateful/index.cjs"),x=require("./media-object/index.cjs"),S=require("./card/empty.cjs"),C=require("./card/index.cjs"),w=require("./spinner/index.cjs"),T=require("./input/index.cjs"),E=require("./icon/input-icon/index.cjs"),D=require("./card/filter.cjs"),O=require("./carousel/index.cjs"),k=require("./checkbox/index.cjs"),A=require("./radio-group/index.cjs"),j=require("./radio-button-group/index.cjs"),M=require("./radio/index.cjs"),N=require("./tabs/panel.cjs"),P=require("./tabs/index.cjs"),F=require("./popover/index.cjs"),I=require("./color-picker/color-picker.cjs"),L=require("./pill/index.cjs"),R=require("./combobox/index.cjs"),z=require("./combobox/filter.cjs"),B=require("./date-picker/index.cjs"),V=require("./docked-composer/index.cjs"),H=require("./dynamic-icon/index.cjs"),U=require("./popover/edit-dialog.cjs"),W=require("./expandable-section/index.cjs"),G=require("./files/file.cjs"),K=require("./files/index.cjs"),q=require("./files/more-files.cjs"),J=require("./filter/filter.cjs"),Y=require("./illustration/index.cjs"),X=require("./input/search.cjs"),ae=require("./settings.cjs"),oe=require("./modal/index.cjs"),Z=require("./vertical-navigation/index.cjs"),se=require("./page-header/index.cjs"),ce=require("./page-header/control.cjs"),le=require("./panel/index.cjs"),ue=require("./panel/filtering/group.cjs"),de=require("./panel/filtering/list.cjs"),fe=require("./panel/filtering/list-heading.cjs"),pe=require("./pill-container/index.cjs"),me=require("./progress-bar/index.cjs"),he=require("./progress-indicator/index.cjs"),ge=require("./progress-ring/index.cjs"),_e=require("./scoped-notification/index.cjs"),ve=require("./setup-assistant/index.cjs"),ye=require("./setup-assistant/step.cjs"),be=require("./simple-data-table/cell.cjs"),xe=require("./simple-data-table/column.cjs"),Se=require("./simple-data-table/interactive-element.cjs"),Ce=require("./simple-data-table/interactive-link.cjs"),we=require("./simple-data-table/row-actions.cjs"),Te=require("./simple-data-table/index.cjs"),Ee=require("./simple-data-table/highlight-cell.cjs"),De=require("./slider/index.cjs"),Q=require("./split-view/index.cjs"),Oe=require("./split-view/header.cjs"),ke=require("./split-view/listbox.cjs"),Ae=require("./textarea/index.cjs"),je=require("./toast/index.cjs"),Me=require("./toast/container.cjs"),Ne=require("./tree/tree.cjs"),Pe=require("./trial-bar/index.cjs"),$=require("./trial-bar/button.cjs"),Fe=require("./trial-bar/dropdown.cjs"),Ie=require("./visual-picker/index.cjs"),Le=require("./visual-picker/link.cjs"),Re=require("./welcome-mat/index.cjs"),ze=require("./welcome-mat/info-badge.cjs"),Be=require("./welcome-mat/tile.cjs"),Ve=require("./combobox/add-subheadings.cjs"),He=require("../utilities/log.cjs");exports.Accordion=ee.default,exports.AccordionPanel=ne.default,exports.Alert=re.default,exports.AlertContainer=ie.default,exports.Avatar=s.default,exports.Badge=c.default,exports.BreadCrumb=d.default,exports.Breadcrumb=d.default,exports.BuilderHeader=m.default,exports.BuilderHeaderMisc=h.default,exports.BuilderHeaderNav=g.default,exports.BuilderHeaderNavDropdown=_.default,exports.BuilderHeaderNavLink=p.default,exports.BuilderHeaderToolbar=v.default,exports.BuilderHeaderUtilities=f.default,exports.Button=o.default,exports.ButtonGroup=y.default,exports.ButtonIcon=n.default,exports.ButtonStateful=b.default,exports.Card=C.default,exports.CardEmpty=S.default,exports.CardFilter=D.default,exports.Carousel=O.default,exports.Checkbox=k.default,exports.ColorPicker=I.default,exports.Combobox=R.default,exports.DatePicker=B.default,exports.Datepicker=B.default,exports.DockedComposer=V.default,exports.Dropdown=u.default,exports.DropdownTrigger=l.default,exports.DynamicIcon=H.default,exports.EditDialog=U.default,exports.ExpandableSection=W.default,exports.File=G.default,exports.Files=K.default,exports.FilesFile=G.default,exports.FilesMoreFiles=q.default,exports.Filter=J.default,exports.Icon=i.default,exports.IconSettings=e.default,exports.Illustration=Y.default,exports.Input=T.default,exports.InputIcon=E.default,exports.InputSearch=X.default,exports.MediaObject=x.default,exports.MenuDropdown=u.default,exports.MenuDropdownButtonTrigger=l.default,exports.Modal=oe.default,exports.MoreFiles=q.default,exports.Navigation=Z.default,exports.PageHeader=se.default,exports.PageHeaderControl=ce.default,exports.Panel=le.default,exports.PanelFilterGroup=ue.default,exports.PanelFilterList=de.default,exports.PanelFilterListHeading=fe.default,exports.Pill=L.default,exports.PillContainer=pe.default,exports.Popover=F.default,exports.PopoverTooltip=a.default,exports.PortalSettings=r.default,exports.ProgressBar=me.default,exports.ProgressIndicator=he.default,exports.ProgressRing=ge.default,exports.Radio=M.default,exports.RadioButtonGroup=j.default,exports.RadioGroup=A.default,exports.SLDSAccordion=ee.default,exports.SLDSAccordionPanel=ne.default,exports.SLDSAlert=re.default,exports.SLDSAlertContainer=ie.default,exports.SLDSAvatar=s.default,exports.SLDSBadge=c.default,exports.SLDSBreadCrumb=d.default,exports.SLDSBreadcrumb=d.default,exports.SLDSBuilderHeader=m.default,exports.SLDSBuilderHeaderMisc=h.default,exports.SLDSBuilderHeaderNav=g.default,exports.SLDSBuilderHeaderNavDropdown=_.default,exports.SLDSBuilderHeaderNavLink=p.default,exports.SLDSBuilderHeaderToolbar=v.default,exports.SLDSBuilderHeaderUtilities=f.default,exports.SLDSButton=o.default,exports.SLDSButtonGroup=y.default,exports.SLDSButtonIcon=n.default,exports.SLDSButtonStateful=b.default,exports.SLDSCard=C.default,exports.SLDSCardEmpty=S.default,exports.SLDSCardFilter=D.default,exports.SLDSCarousel=O.default,exports.SLDSCheckbox=k.default,exports.SLDSColorPicker=I.default,exports.SLDSCombobox=R.default,exports.SLDSComboboxFilterAndLimit=z.default,exports.SLDSDatePicker=B.default,exports.SLDSDatepicker=B.default,exports.SLDSDockedComposer=V.default,exports.SLDSDropdownTrigger=l.default,exports.SLDSDynamicIcon=H.default,exports.SLDSEditDialog=U.default,exports.SLDSExpandableSection=W.default,exports.SLDSFile=G.default,exports.SLDSFiles=K.default,exports.SLDSFilesFile=G.default,exports.SLDSFilesMoreFiles=q.default,exports.SLDSFilter=J.default,exports.SLDSIcon=i.default,exports.SLDSIconSettings=e.default,exports.SLDSIllustration=Y.default,exports.SLDSInput=T.default,exports.SLDSInputIcon=E.default,exports.SLDSInputSearch=X.default,exports.SLDSMediaObject=x.default,exports.SLDSMenuDropdown=u.default,exports.SLDSMenuDropdownButtonTrigger=l.default,exports.SLDSModal=oe.default,exports.SLDSMoreFiles=q.default,exports.SLDSNavigation=Z.default,exports.SLDSPageHeader=se.default,exports.SLDSPageHeaderControl=ce.default,exports.SLDSPanel=le.default,exports.SLDSPanelFilterGroup=ue.default,exports.SLDSPanelFilterList=de.default,exports.SLDSPanelFilterListHeading=fe.default,exports.SLDSPill=L.default,exports.SLDSPillContainer=pe.default,exports.SLDSPopover=F.default,exports.SLDSPopoverTooltip=a.default,exports.SLDSPortalSettings=r.default,exports.SLDSProgressBar=me.default,exports.SLDSProgressIndicator=he.default,exports.SLDSProgressRing=ge.default,exports.SLDSRadio=M.default,exports.SLDSRadioButtonGroup=j.default,exports.SLDSRadioGroup=A.default,exports.SLDSScopedNotification=_e.default,exports.SLDSSearch=X.default,exports.SLDSSettings=ae.default,exports.SLDSSetupAssistant=ve.default,exports.SLDSSetupAssistantStep=ye.default,exports.SLDSSimpleDataTable=Te.default,exports.SLDSSimpleDataTableCell=be.default,exports.SLDSSimpleDataTableColumn=xe.default,exports.SLDSSimpleDataTableHighlightCell=Ee.default,exports.SLDSSimpleDataTableInteractiveElement=Se.default,exports.SLDSSimpleDataTableInteractiveLink=Ce.default,exports.SLDSSimpleDataTableRowActions=we.default,exports.SLDSSlider=De.default,exports.SLDSSpinner=w.default,exports.SLDSSplitView=Q.default,exports.SLDSSplitViewHeader=Oe.default,exports.SLDSSplitViewListbox=ke.default,exports.SLDSSplitview=Q.default,exports.SLDSTabs=P.default,exports.SLDSTabsPanel=N.default,exports.SLDSTextarea=Ae.default,exports.SLDSToast=je.default,exports.SLDSToastContainer=Me.default,exports.SLDSTooltip=a.default,exports.SLDSTree=Ne.default,exports.SLDSTrialBar=Pe.default,exports.SLDSTrialBarButton=$.default,exports.SLDSTrialBarDropdown=Fe.default,exports.SLDSUtilityIcon=t.default,exports.SLDSVerticalNavigation=Z.default,exports.SLDSVisualPicker=Ie.default,exports.SLDSVisualPickerLink=Le.default,exports.SLDSWelcomeMat=Re.default,exports.SLDSWelcomeMatInfoBadge=ze.default,exports.SLDSWelcomeMatTile=Be.default,exports.ScopedNotification=_e.default,exports.Search=X.default,exports.Settings=ae.default,exports.SetupAssistant=ve.default,exports.SetupAssistantStep=ye.default,exports.SimpleDataTable=Te.default,exports.SimpleDataTableCell=be.default,exports.SimpleDataTableColumn=xe.default,exports.SimpleDataTableHighlightCell=Ee.default,exports.SimpleDataTableInteractiveElement=Se.default,exports.SimpleDataTableInteractiveLink=Ce.default,exports.SimpleDataTableRowActions=we.default,exports.Slider=De.default,exports.Spinner=w.default,exports.SplitView=Q.default,exports.SplitViewHeader=Oe.default,exports.SplitViewListbox=ke.default,exports.Splitview=Q.default,exports.Tabs=P.default,exports.TabsPanel=N.default,exports.Textarea=Ae.default,exports.Toast=je.default,exports.ToastContainer=Me.default,exports.Tooltip=a.default,exports.Tree=Ne.default,exports.TrialBar=Pe.default,exports.TrialBarButton=$.default,exports.TrialBarDropdown=Fe.default,exports.UNSAFE_DirectionSettings=te.default,exports.UtilityIcon=t.default,exports.VerticalNavigation=Z.default,exports.VisualPicker=Ie.default,exports.VisualPickerLink=Le.default,exports.WelcomeMat=Re.default,exports.WelcomeMatInfoBadge=ze.default,exports.WelcomeMatTile=Be.default,exports.comboboxAddSubheadings=Ve.default,exports.comboboxFilterAndLimit=z.default,exports.log=He.default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../utilities/constants.cjs");const e=require("../../utilities/get-component-doc.cjs"),
|
|
1
|
+
require("../../utilities/constants.cjs");const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/deprecated-property.cjs"),r=require("../../utilities/warning/only-one-of-properties.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a={},o){let s=t.default(o);if(i===`SLDSInput`){e.default(i,a.defaultValue!==void 0,`defaultValue`,"Input is controlled: pass `value` and update it in `onChange`.");let t=`Please use \`iconLeft\` and \`iconRight\` to pass in a customized <Icon> component. ${s()}`;n.default(i,a.assistiveText&&a.assistiveText.fieldLevelHelpButton,`assistiveText.fieldLevelHelpButton`,void 0,"Please pass a `Tooltip` component into `fieldLevelHelpTooltip` with `assistiveText.triggerLearnMoreIcon`."),n.default(i,a.iconCategory,`iconCategory`,void 0,t),n.default(i,a.iconName,`iconName`,void 0,t),n.default(i,a.iconPosition,`iconPosition`,void 0,t),n.default(i,a.iconAssistiveText,`iconAssistiveText`,void 0,t),n.default(i,a.onIconClick,`onIconClick`,void 0,t),r.default(i,{"assistiveText.label":a.assistiveText&&a.assistiveText.label,label:a.label},s(`assistiveText`)),r.default(i,{fixedTextLeft:a.fixedTextLeft,fixedTextRight:a.fixedTextRight},s(`assistiveText`))}});var a=i;exports.default=a;
|
|
2
2
|
//# sourceMappingURL=check-props.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/input/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\n// import oneOfRequiredProperty from '../../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nimport { INPUT } from '../../utilities/constants';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tif (COMPONENT === INPUT) {\n\t\t\tconst iconDeprecatedMessage = `Please use \\`iconLeft\\` and \\`iconRight\\` to pass in a customized <Icon> component. ${createDocUrl()}`;\n\n\t\t\t// Deprecated and changed to another property\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText && props.assistiveText.fieldLevelHelpButton,\n\t\t\t\t'assistiveText.fieldLevelHelpButton',\n\t\t\t\tundefined,\n\t\t\t\t`Please pass a \\`Tooltip\\` component into \\`fieldLevelHelpTooltip\\` with \\`assistiveText.triggerLearnMoreIcon\\`.`\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconCategory,\n\t\t\t\t'iconCategory',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconName,\n\t\t\t\t'iconName',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconPosition,\n\t\t\t\t'iconPosition',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconAssistiveText,\n\t\t\t\t'iconAssistiveText',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.onIconClick,\n\t\t\t\t'onIconClick',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t'assistiveText.label':\n\t\t\t\t\t\tprops.assistiveText && props.assistiveText.label,\n\t\t\t\t\tlabel: props.label,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\tfixedTextLeft: props.fixedTextLeft,\n\t\t\t\t\tfixedTextRight: props.fixedTextRight,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\t/*\n\t\t\t* Once we support horizontal labels, then I think we can enable this check\n\t\t\t*\n\t\t\tif (!props.inlineEditTrigger) {\n\t\t\t\toneOfRequiredProperty(COMPONENT, {\n\t\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\t\tlabel: props.label\n\t\t\t\t});\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/input/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\n// import oneOfRequiredProperty from '../../../utilities/warning/one-of-required-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nimport { INPUT } from '../../utilities/constants';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tif (COMPONENT === INPUT) {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.defaultValue !== undefined,\n\t\t\t\t'defaultValue',\n\t\t\t\t'Input is controlled: pass `value` and update it in `onChange`.'\n\t\t\t);\n\n\t\t\tconst iconDeprecatedMessage = `Please use \\`iconLeft\\` and \\`iconRight\\` to pass in a customized <Icon> component. ${createDocUrl()}`;\n\n\t\t\t// Deprecated and changed to another property\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText && props.assistiveText.fieldLevelHelpButton,\n\t\t\t\t'assistiveText.fieldLevelHelpButton',\n\t\t\t\tundefined,\n\t\t\t\t`Please pass a \\`Tooltip\\` component into \\`fieldLevelHelpTooltip\\` with \\`assistiveText.triggerLearnMoreIcon\\`.`\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconCategory,\n\t\t\t\t'iconCategory',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconName,\n\t\t\t\t'iconName',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconPosition,\n\t\t\t\t'iconPosition',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.iconAssistiveText,\n\t\t\t\t'iconAssistiveText',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.onIconClick,\n\t\t\t\t'onIconClick',\n\t\t\t\tundefined,\n\t\t\t\ticonDeprecatedMessage\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t'assistiveText.label':\n\t\t\t\t\t\tprops.assistiveText && props.assistiveText.label,\n\t\t\t\t\tlabel: props.label,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\tonlyOneOfProperties(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\tfixedTextLeft: props.fixedTextLeft,\n\t\t\t\t\tfixedTextRight: props.fixedTextRight,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\n\t\t\t/*\n\t\t\t* Once we support horizontal labels, then I think we can enable this check\n\t\t\t*\n\t\t\tif (!props.inlineEditTrigger) {\n\t\t\t\toneOfRequiredProperty(COMPONENT, {\n\t\t\t\t\tassistiveText: props.assistiveText,\n\t\t\t\t\tlabel: props.label\n\t\t\t\t});\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"wRAaA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAQ,CAAC,EAAG,EAAS,CACxE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,GAAI,IAAA,YAAqB,CACxB,EAAA,QACC,EACA,EAAM,eAAiB,IAAA,GACvB,eACA,gEACD,EAEA,IAAM,EAAwB,uFAAuF,EAAa,IAGlI,EAAA,QACC,EACA,EAAM,eAAiB,EAAM,cAAc,qBAC3C,qCACA,IAAA,GACA,2GACD,EACA,EAAA,QACC,EACA,EAAM,aACN,eACA,IAAA,GACA,CACD,EACA,EAAA,QACC,EACA,EAAM,SACN,WACA,IAAA,GACA,CACD,EACA,EAAA,QACC,EACA,EAAM,aACN,eACA,IAAA,GACA,CACD,EACA,EAAA,QACC,EACA,EAAM,kBACN,oBACA,IAAA,GACA,CACD,EACA,EAAA,QACC,EACA,EAAM,YACN,cACA,IAAA,GACA,CACD,EAEA,EAAA,QACC,EACA,CACC,sBACC,EAAM,eAAiB,EAAM,cAAc,MAC5C,MAAO,EAAM,KACd,EACA,EAAa,eAAe,CAC7B,EAEA,EAAA,QACC,EACA,CACC,cAAe,EAAM,cACrB,eAAgB,EAAM,cACvB,EACA,EAAa,eAAe,CAC7B,CAYD,CACD,GAGD,IAAA,EAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs"),r=require("./private/inner-input.cjs"),i=require("../utilities/label/index.cjs"),a=require("../tooltip/private/field-level-help-tooltip.cjs"),ee=require("./check-props.cjs"),te=require("./component.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=`counter`,u=`Decrement`,d=`Increment`,ne={decrement:`${u} ${l}`,increment:`${d} ${l}`},f=(0,o.forwardRef)(({"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-describedby":ie,"aria-expanded":ae,"aria-haspopup":
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../button/index.cjs"),r=require("./private/inner-input.cjs"),i=require("../utilities/label/index.cjs"),a=require("../tooltip/private/field-level-help-tooltip.cjs"),ee=require("./check-props.cjs"),te=require("./component.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=`counter`,u=`Decrement`,d=`Increment`,ne={decrement:`${u} ${l}`,increment:`${d} ${l}`},f=(0,o.forwardRef)(({"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-describedby":ie,"aria-expanded":ae,"aria-haspopup":p,"aria-labelledby":m,"aria-owns":h,"aria-required":g,assistiveText:oe,autoComplete:se,children:ce,className:le,defaultValue:ue,disabled:_=!1,errorText:v,fieldLevelHelpTooltip:y,fixedTextLeft:de,fixedTextRight:fe,hasSpinner:pe=!1,iconLeft:b,iconRight:x,id:me,inlineHelpText:S,inlineEditTrigger:he,inputRef:C,isStatic:w=!1,label:T,maxLength:E,maxValue:D,minLength:O,minValue:k,name:A,onBlur:j,onChange:M,onClick:N,onFocus:P,onInput:F,onInvalid:I,onKeyDown:L,onKeyPress:R,onKeyUp:z,onSelect:ge,onSubmit:_e,placeholder:ve,readOnly:B=!1,required:V=!1,role:ye,step:H,tabIndex:be,styleContainer:xe,styleInput:Se,type:Ce=`text`,value:U,variant:W=`base`},we)=>{let Te=(0,o.useId)(),Ee=(0,o.useId)(),De=(0,o.useId)(),G=me||Te,Oe=v?Ee:void 0,ke=S?De:void 0,Ae=[ie,ke,Oe].filter(e=>!!e).join(` `)||void 0,K=(0,o.useRef)({currentDelay:500,initialDelay:500,speedDelay:75,timeout:null}),q=(0,o.useRef)(null),je=(0,o.useRef)(U);(0,o.useEffect)(()=>{je.current=U},[U]);let J={...ne,...oe};ee.default(t.INPUT,{"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-describedby":ie,"aria-expanded":ae,"aria-haspopup":p,"aria-labelledby":m,"aria-owns":h,"aria-required":g,assistiveText:J,autoComplete:se,children:ce,className:le,defaultValue:ue,disabled:_,errorText:v,fieldLevelHelpTooltip:y,fixedTextLeft:de,fixedTextRight:fe,hasSpinner:pe,iconLeft:b,iconRight:x,id:G,inlineHelpText:S,inlineEditTrigger:he,inputRef:C,isStatic:w,label:T,maxLength:E,maxValue:D,minLength:O,minValue:k,name:A,onBlur:j,onChange:M,onClick:N,onFocus:P,onInput:F,onInvalid:I,onKeyDown:L,onKeyPress:R,onKeyUp:z,onSelect:ge,onSubmit:_e,placeholder:ve,readOnly:B,required:V,role:ye,step:H,tabIndex:be,styleContainer:xe,styleInput:Se,type:Ce,value:U,variant:W},te.default);let Y=e=>e===void 0||e===``?0:Number(e),X=(0,o.useCallback)(()=>{K.current.timeout&&clearTimeout(K.current.timeout),K.current.currentDelay=K.current.initialDelay,q.current=null},[]),Z=(0,o.useCallback)((e,t)=>{K.current.timeout&&clearTimeout(K.current.timeout),t&&(q.current=t);let n=t??q.current??void 0,r=H===void 0?1:Number(H),i=Y(je.current),a=!1;if(e===u&&D!==void 0&&i>D)i=Number(D),a=!0;else if(e===d&&k!==void 0&&i<k)i=Number(k),a=!0;else{let t=String(r).search(/\./)>=0?String(r).split(`.`)[1].length:0,n=0;k!==void 0&&(n=(i-k)%r),i=n>0?e===u?i-n:i+(r-n):e===u?i-r:i+r,i=Number(i.toFixed(t)),!(D!==void 0&&i>D)&&!(k!==void 0&&i<k)&&(a=!0)}a&&M&&n&&M(n,{number:i,value:String(i)}),e===d&&D!==void 0&&i>=D||e===u&&k!==void 0&&i<=k?X():K.current.timeout=setTimeout(()=>{K.current.currentDelay=K.current.speedDelay,Z(e)},K.current.currentDelay)},[D,k,M,H,X]),Me=(0,o.useCallback)(e=>{if(M){let t={value:e.target.value};W===l&&(t.number=Number(t.value)),M(e,t)}},[M,W]),Ne=e=>{let t=Y(U),r=!1;return(_||e===d&&D!==void 0&&t>=D||e===u&&k!==void 0&&t<=k)&&(r=!0),(0,c.jsx)(n.default,{assistiveText:{icon:J[e.toLowerCase()]},className:(0,s.default)(`slds-button_icon-small`,`slds-input__button_${e.toLowerCase()}`),disabled:r,iconCategory:`utility`,iconName:e===u?`ban`:`new`,onKeyDown:t=>{t.keyCode===13&&Z(e,t)},onKeyUp:X,onMouseDown:t=>{Z(e,t)},onMouseLeave:X,onMouseUp:X,variant:`icon`})},Q=null,$=null;b?Q=o.default.isValidElement(b)?o.default.cloneElement(b,{iconPosition:`left`}):b:W===l&&!w&&!B&&(Q=Ne(u)),x?$=o.default.isValidElement(x)?o.default.cloneElement(x,{iconPosition:`right`}):x:W===l&&!w&&!B&&($=Ne(d));let Pe=T||J?.label;return(0,c.jsxs)(`div`,{className:(0,s.default)(`slds-form-element`,{"slds-has-error":v},le),style:xe,ref:we,children:[(0,c.jsx)(i.default,{assistiveText:J,htmlFor:w?void 0:G,label:T,required:V,variant:w?`static`:`base`}),y&&Pe?(0,c.jsx)(a.default,{assistiveText:{triggerLearnMoreIcon:J.fieldLevelHelpButton},fieldLevelHelpTooltip:y}):null,(0,c.jsx)(r.default,{"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-labelledby":m,"aria-describedby":Ae,"aria-expanded":ae,"aria-haspopup":p,"aria-owns":h,"aria-required":g,autoComplete:se,className:(0,s.default)({"slds-input_counter":W===l,"slds-p-horizontal_none":W===l&&B}),containerProps:{className:`slds-form-element__control`},disabled:_,fixedTextLeft:de,fixedTextRight:fe,hasSpinner:pe,id:G,iconLeft:Q,iconRight:$,inlineEditTrigger:he,isStatic:w,minLength:O,minValue:k,maxLength:E,maxValue:D,name:A,onBlur:j,onChange:Me,onClick:N,onFocus:P,onInput:F,onInvalid:I,onKeyDown:L,onKeyPress:R,onKeyUp:z,onSelect:ge,onSubmit:_e,placeholder:ve,inputRef:C,readOnly:B,required:V,role:ye,assistiveText:J,type:W===l?`number`:Ce,value:U,variant:W,step:H,tabIndex:be,style:Se}),S&&(0,c.jsx)(`div`,{id:ke,className:`slds-form-element__help`,children:S}),v&&(0,c.jsx)(`div`,{id:Oe,className:`slds-form-element__help`,children:v}),ce]})});f.displayName=t.INPUT,exports.default=f;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseId,\n\tuseRef,\n\tuseReducer,\n\tuseCallback,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n\t/** Text for field level help button */\n\tfieldLevelHelpButton?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props for the Input component\n */\nexport interface InputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Initial value for uncontrolled usage */\n\tdefaultValue?: string | number;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon (InputIcon instance) */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon (InputIcon instance) */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Label text above input */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for counter variant */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for counter variant */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for counter variant */\n\tstep?: number;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/** Controlled value */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InputVariant;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst inputElementRef = useRef<HTMLInputElement | null>(null);\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `performStep`, so the repeat timer of a held counter button\n\t\t// reads current props (such as a controlled `value`) on every step.\n\t\tconst performStepRef = useRef<\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => void\n\t\t>(() => {});\n\t\t// Re-renders after an uncontrolled step, so the counter buttons' disabled\n\t\t// state reflects the value written directly to the input element.\n\t\tconst [, forceRender] = useReducer((count: number) => count + 1, 0);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\tconst getValueAsNumber = useCallback((): number => {\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn Number(value);\n\t\t\t}\n\t\t\tif (inputElementRef.current) {\n\t\t\t\treturn Number(inputElementRef.current.value);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}, [value]);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = getValueAsNumber();\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (value === undefined && inputElementRef.current) {\n\t\t\t\t\t\t// Uncontrolled mode\n\t\t\t\t\t\tinputElementRef.current.value = String(currentValue);\n\t\t\t\t\t\tforceRender();\n\t\t\t\t\t}\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStepRef.current(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetValueAsNumber,\n\t\t\t\tmaxValue,\n\t\t\t\tminValue,\n\t\t\t\tonChange,\n\t\t\t\tstep,\n\t\t\t\tstopStepping,\n\t\t\t\tvalue,\n\t\t\t]\n\t\t);\n\t\tperformStepRef.current = performStep;\n\n\t\tconst setInputRef = useCallback(\n\t\t\t(element: HTMLInputElement | null) => {\n\t\t\t\tinputElementRef.current = element;\n\t\t\t\tif (propInputRef) {\n\t\t\t\t\tpropInputRef(element);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[propInputRef]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = getValueAsNumber();\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement(propIconLeft)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconLeft as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'left',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement(propIconRight)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconRight as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'right',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\n\t\tconst inputRefToUse = variant === COUNTER ? setInputRef : propInputRef;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\ttriggerLearnMoreIcon: assistiveText.fieldLevelHelpButton,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={inputRefToUse}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"uiBA+BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YA2KZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB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,GAClB,gBAAe,GACf,gBAAe,GACf,YAAW,EACX,gBAAe,GACD,gBACd,WAAA,EAAW,EAAA,QAAA,CAAW,CACrB,qBAAsB,IAAY,EAClC,yBAA0B,IAAY,GAAW,CAClD,CAAC,EACD,eAAgB,CACf,UAAW,4BACZ,EACc,gBACJ,WACK,iBACC,kBACJ,cACR,KACM,WACC,YACQ,qBACT,WACC,YACD,WACC,YACD,WACJ,OACE,SACR,SAAU,GACD,UACA,UACA,UACE,YACA,YACC,aACH,UACC,WACA,YACG,cACb,SAAU,GACA,WACA,WACJ,QACS,gBACf,KAAM,IAAY,EAAU,SAAW,GAChC,QACE,UACH,OACI,YACV,MAAO,EACP,CAAA,EACA,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAc,UAAU,0BAC/B,SAAA,CACG,CAAA,EAEL,IACA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,GAAI,GAAS,UAAU,0BAC1B,SAAA,CACG,CAAA,EAEL,EACG,GAEP,CACD,EAEA,EAAM,YAAc,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/input/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseId,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n\t/** Text for field level help button */\n\tfieldLevelHelpButton?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props for the Input component\n */\nexport interface InputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon (InputIcon instance) */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon (InputIcon instance) */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Label text above input */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for counter variant */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for counter variant */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Called with the requested value when the user types or, for the counter\n\t * variant, presses the increment/decrement buttons. Input is controlled: set\n\t * `value` from `data.value` (or `data.number`) to accept the change.\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for counter variant */\n\tstep?: number;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/**\n\t * The input's value. Input is controlled: update `value` in `onChange`.\n\t * The counter variant steps from this value. (`defaultValue` was removed\n\t * in v11.)\n\t */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InputVariant;\n}\n\n/**\n * Props removed from the public API. Still destructured so they never reach\n * the DOM, and reported by `checkProps`.\n */\ninterface InputRemovedProps {\n\tdefaultValue?: unknown;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t}: InputProps & InputRemovedProps,\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `value`, so a held-down counter button steps from the value the\n\t\t// parent rendered after the previous step rather than a stale closure.\n\t\tconst valueRef = useRef(value);\n\t\tuseEffect(() => {\n\t\t\tvalueRef.current = value;\n\t\t}, [value]);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\t// The counter steps from the `value` prop only; it never reads or writes\n\t\t// the DOM value.\n\t\tconst toNumber = (currentValue: string | number | undefined): number =>\n\t\t\tcurrentValue === undefined || currentValue === ''\n\t\t\t\t? 0\n\t\t\t\t: Number(currentValue);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = toNumber(valueRef.current);\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStep(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[maxValue, minValue, onChange, step, stopStepping]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = toNumber(value);\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement(propIconLeft)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconLeft as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'left',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement(propIconRight)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconRight as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'right',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\ttriggerLearnMoreIcon: assistiveText.fieldLevelHelpButton,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={propInputRef}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"uiBA+BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YAyLZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,GACjB,gBAAiB,EACjB,kBAAmB,EACnB,YAAa,EACb,gBAAiB,EACjB,cAAe,GACf,gBACA,YACA,aACA,gBACA,WAAW,GACX,YACA,wBACA,iBACA,kBACA,cAAa,GACb,SAAU,EACV,UAAW,EACX,GAAI,GACJ,iBACA,qBACA,SAAU,EACV,WAAW,GACX,QACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,aACA,UACA,YACA,YACA,eACA,WAAW,GACX,WAAW,GACX,QACA,OACA,YACA,kBACA,cACA,QAAO,OACP,QACA,UAAU,QAEX,KACI,CACJ,IAAM,IAAA,EAAc,EAAA,MAAA,CAAM,EACpB,IAAA,EAAmB,EAAA,MAAA,CAAM,EACzB,IAAA,EAAwB,EAAA,MAAA,CAAM,EAC9B,EAAK,IAAU,GACf,GAAU,EAAY,GAAmB,IAAA,GACzC,GAAe,EAAiB,GAAwB,IAAA,GACxD,GACL,CAAC,GAAiB,GAAc,EAAO,CAAC,CACtC,OAAQ,GAAmB,EAAQ,CAAE,CAAC,CACtC,KAAK,GAAG,GAAK,IAA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