@salesforce/design-system-react 11.0.0-alpha.6 → 11.0.0-alpha.7
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/panel.cjs +1 -1
- package/dist/cjs/components/accordion/panel.cjs.map +1 -1
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/badge/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/check-props.cjs +2 -0
- package/dist/cjs/components/builder-header/check-props.cjs.map +1 -0
- package/dist/cjs/components/builder-header/component.cjs +2 -0
- package/dist/cjs/components/builder-header/component.cjs.map +1 -0
- package/dist/cjs/components/builder-header/toolbar.cjs +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
- package/dist/cjs/components/carousel/check-props.cjs +2 -0
- package/dist/cjs/components/carousel/check-props.cjs.map +1 -0
- package/dist/cjs/components/carousel/component.cjs +2 -0
- package/dist/cjs/components/carousel/component.cjs.map +1 -0
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs +2 -0
- package/dist/cjs/components/checkbox/check-props.cjs.map +1 -0
- package/dist/cjs/components/checkbox/component.cjs +2 -0
- package/dist/cjs/components/checkbox/component.cjs.map +1 -0
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.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.map +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
- package/dist/cjs/components/dynamic-icon/index.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/menu-dropdown/check-props.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/check-props.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/page-header/check-props.cjs +2 -0
- package/dist/cjs/components/page-header/check-props.cjs.map +1 -0
- package/dist/cjs/components/page-header/component.cjs +2 -0
- package/dist/cjs/components/page-header/component.cjs.map +1 -0
- package/dist/cjs/components/page-header/index.cjs +1 -1
- package/dist/cjs/components/page-header/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/component.cjs +2 -0
- package/dist/cjs/components/progress-indicator/component.cjs.map +1 -0
- package/dist/cjs/components/progress-indicator/index.cjs +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs.map +1 -1
- package/dist/cjs/components/radio/check-props.cjs +2 -0
- package/dist/cjs/components/radio/check-props.cjs.map +1 -0
- package/dist/cjs/components/radio/component.cjs +2 -0
- package/dist/cjs/components/radio/component.cjs.map +1 -0
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/check-props.cjs +1 -1
- package/dist/cjs/components/setup-assistant/check-props.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/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/slider/check-props.cjs +2 -0
- package/dist/cjs/components/slider/check-props.cjs.map +1 -0
- package/dist/cjs/components/slider/component.cjs +2 -0
- package/dist/cjs/components/slider/component.cjs.map +1 -0
- 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/check-props.cjs +1 -1
- package/dist/cjs/components/split-view/check-props.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 +2 -0
- package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -0
- 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/split-view/private/list-item-content.cjs +1 -1
- package/dist/cjs/components/split-view/private/list-item-content.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/toggle-button.cjs +1 -1
- package/dist/cjs/components/split-view/private/toggle-button.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/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/check-props.cjs.map +1 -1
- package/dist/cjs/components/tree/component.cjs +2 -0
- package/dist/cjs/components/tree/component.cjs.map +1 -0
- package/dist/cjs/components/tree/tree.cjs +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/check-props.cjs +2 -0
- package/dist/cjs/components/trial-bar/check-props.cjs.map +1 -0
- package/dist/cjs/components/trial-bar/component.cjs +2 -0
- package/dist/cjs/components/trial-bar/component.cjs.map +1 -0
- package/dist/cjs/components/trial-bar/index.cjs +1 -1
- package/dist/cjs/components/trial-bar/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/check-props.cjs +2 -0
- package/dist/cjs/components/welcome-mat/check-props.cjs.map +1 -0
- package/dist/cjs/components/welcome-mat/component.cjs +2 -0
- package/dist/cjs/components/welcome-mat/component.cjs.map +1 -0
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs +2 -0
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -0
- package/dist/es/components/accordion/panel.js +1 -1
- package/dist/es/components/accordion/panel.js.map +1 -1
- package/dist/es/components/badge/index.js +6 -5
- package/dist/es/components/badge/index.js.map +1 -1
- package/dist/es/components/builder-header/check-props.js +13 -0
- package/dist/es/components/builder-header/check-props.js.map +1 -0
- package/dist/es/components/builder-header/component.js +65 -0
- package/dist/es/components/builder-header/component.js.map +1 -0
- package/dist/es/components/builder-header/toolbar.js +18 -13
- package/dist/es/components/builder-header/toolbar.js.map +1 -1
- package/dist/es/components/carousel/check-props.js +13 -0
- package/dist/es/components/carousel/check-props.js.map +1 -0
- package/dist/es/components/carousel/component.js +27 -0
- package/dist/es/components/carousel/component.js.map +1 -0
- package/dist/es/components/carousel/index.js +121 -109
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-item.js +1 -2
- package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +14 -0
- package/dist/es/components/checkbox/check-props.js.map +1 -0
- package/dist/es/components/checkbox/component.js +35 -0
- package/dist/es/components/checkbox/component.js.map +1 -0
- package/dist/es/components/checkbox/index.js +124 -112
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/combobox/check-props.js +1 -1
- package/dist/es/components/combobox/check-props.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +208 -200
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/index.js.map +1 -1
- package/dist/es/components/combobox/private/menu.js +5 -7
- package/dist/es/components/combobox/private/menu.js.map +1 -1
- package/dist/es/components/dynamic-icon/index.js +1 -1
- package/dist/es/components/dynamic-icon/index.js.map +1 -1
- package/dist/es/components/input/index.js +138 -136
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/check-props.js +1 -1
- package/dist/es/components/menu-dropdown/check-props.js.map +1 -1
- package/dist/es/components/menu-dropdown/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +192 -185
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/page-header/check-props.js +31 -0
- package/dist/es/components/page-header/check-props.js.map +1 -0
- package/dist/es/components/page-header/component.js +35 -0
- package/dist/es/components/page-header/component.js.map +1 -0
- package/dist/es/components/page-header/index.js +56 -38
- package/dist/es/components/page-header/index.js.map +1 -1
- package/dist/es/components/page-header/private/base/index.js +1 -1
- package/dist/es/components/page-header/private/base/index.js.map +1 -1
- package/dist/es/components/page-header/private/controls.js +1 -1
- package/dist/es/components/page-header/private/controls.js.map +1 -1
- package/dist/es/components/page-header/private/object-home/index.js +4 -4
- package/dist/es/components/page-header/private/object-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/record-home/index.js +1 -1
- package/dist/es/components/page-header/private/record-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/related-list/index.js +2 -2
- package/dist/es/components/page-header/private/related-list/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +130 -130
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/check-props.js +11 -8
- package/dist/es/components/progress-indicator/check-props.js.map +1 -1
- package/dist/es/components/progress-indicator/component.js +35 -0
- package/dist/es/components/progress-indicator/component.js.map +1 -0
- package/dist/es/components/progress-indicator/index.js +74 -71
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-indicator/private/step-vertical.js +23 -20
- package/dist/es/components/progress-indicator/private/step-vertical.js.map +1 -1
- package/dist/es/components/radio/check-props.js +13 -0
- package/dist/es/components/radio/check-props.js.map +1 -0
- package/dist/es/components/radio/component.js +24 -0
- package/dist/es/components/radio/component.js.map +1 -0
- package/dist/es/components/radio/index.js +94 -80
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/setup-assistant/check-props.js +12 -7
- package/dist/es/components/setup-assistant/check-props.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js +7 -7
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/check-props.js +1 -1
- package/dist/es/components/simple-data-table/check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +17 -10
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/slider/check-props.js +17 -0
- package/dist/es/components/slider/check-props.js.map +1 -0
- package/dist/es/components/slider/component.js +35 -0
- package/dist/es/components/slider/component.js.map +1 -0
- package/dist/es/components/slider/index.js +69 -53
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/split-view/check-props.js +2 -2
- package/dist/es/components/split-view/check-props.js.map +1 -1
- package/dist/es/components/split-view/index.js +8 -5
- package/dist/es/components/split-view/index.js.map +1 -1
- package/dist/es/components/split-view/listbox-check-props.js +13 -0
- package/dist/es/components/split-view/listbox-check-props.js.map +1 -0
- package/dist/es/components/split-view/listbox.js +41 -35
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-content.js +1 -1
- package/dist/es/components/split-view/private/list-item-content.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-with-content.js +6 -1
- package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
- package/dist/es/components/split-view/private/toggle-button.js +2 -2
- package/dist/es/components/split-view/private/toggle-button.js.map +1 -1
- package/dist/es/components/tabs/panel.js.map +1 -1
- package/dist/es/components/textarea/check-props.js +11 -10
- package/dist/es/components/textarea/check-props.js.map +1 -1
- package/dist/es/components/textarea/index.js +59 -47
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/tree/check-props.js +10 -9
- package/dist/es/components/tree/check-props.js.map +1 -1
- package/dist/es/components/tree/component.js +25 -0
- package/dist/es/components/tree/component.js.map +1 -0
- package/dist/es/components/tree/tree.js +76 -74
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/trial-bar/check-props.js +13 -0
- package/dist/es/components/trial-bar/check-props.js.map +1 -0
- package/dist/es/components/trial-bar/component.js +24 -0
- package/dist/es/components/trial-bar/component.js.map +1 -0
- package/dist/es/components/trial-bar/index.js +27 -21
- package/dist/es/components/trial-bar/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/index.js +1 -0
- package/dist/es/components/utilities/menu-list/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item.js +5 -3
- package/dist/es/components/utilities/menu-list/item.js.map +1 -1
- package/dist/es/components/utilities/utility-icon/index.js +2 -1
- package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
- package/dist/es/components/vertical-navigation/private/item.js +1 -1
- package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
- package/dist/es/components/welcome-mat/check-props.js +13 -0
- package/dist/es/components/welcome-mat/check-props.js.map +1 -0
- package/dist/es/components/welcome-mat/component.js +46 -0
- package/dist/es/components/welcome-mat/component.js.map +1 -0
- package/dist/es/components/welcome-mat/index.js +61 -55
- package/dist/es/components/welcome-mat/index.js.map +1 -1
- package/dist/es/components/welcome-mat/info-badge.js +19 -11
- package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property-value.js +18 -0
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -0
- package/dist/types/components/accordion/panel.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +4 -2
- package/dist/types/components/badge/index.d.ts.map +1 -1
- package/dist/types/components/builder-header/check-props.d.ts +3 -0
- package/dist/types/components/builder-header/check-props.d.ts.map +1 -0
- package/dist/types/components/builder-header/toolbar.d.ts +6 -4
- package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
- package/dist/types/components/carousel/check-props.d.ts +3 -0
- package/dist/types/components/carousel/check-props.d.ts.map +1 -0
- package/dist/types/components/carousel/index.d.ts +9 -7
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/carousel/private/carousel-item.d.ts +4 -4
- package/dist/types/components/carousel/private/carousel-item.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 +9 -3
- package/dist/types/components/checkbox/index.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 +29 -15
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +1 -1
- package/dist/types/components/combobox/index.d.ts.map +1 -1
- package/dist/types/components/combobox/private/menu.d.ts +11 -6
- package/dist/types/components/combobox/private/menu.d.ts.map +1 -1
- package/dist/types/components/dynamic-icon/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/check-props.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 +22 -3
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/page-header/check-props.d.ts.map +1 -1
- package/dist/types/components/page-header/index.d.ts +15 -4
- package/dist/types/components/page-header/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/base/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/controls.d.ts +4 -4
- package/dist/types/components/page-header/private/controls.d.ts.map +1 -1
- package/dist/types/components/page-header/private/object-home/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/record-home/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/types.d.ts +6 -6
- package/dist/types/components/page-header/private/types.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/index.d.ts +7 -1
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts +4 -7
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts.map +1 -1
- package/dist/types/components/radio/check-props.d.ts +1 -0
- package/dist/types/components/radio/check-props.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +10 -4
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/check-props.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +12 -6
- 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/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +21 -8
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/check-props.d.ts +3 -0
- package/dist/types/components/slider/check-props.d.ts.map +1 -0
- package/dist/types/components/slider/index.d.ts +26 -5
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/split-view/check-props.d.ts.map +1 -1
- package/dist/types/components/split-view/index.d.ts +9 -5
- package/dist/types/components/split-view/index.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox-check-props.d.ts +3 -0
- package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -0
- package/dist/types/components/split-view/listbox.d.ts +19 -3
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts +10 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
- package/dist/types/components/split-view/private/toggle-button.d.ts +3 -3
- package/dist/types/components/split-view/private/toggle-button.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +5 -1
- 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 +23 -3
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/tree/check-props.d.ts.map +1 -1
- package/dist/types/components/tree/index.d.ts +1 -1
- package/dist/types/components/tree/index.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +12 -4
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/tree/types.d.ts +7 -1
- package/dist/types/components/tree/types.d.ts.map +1 -1
- package/dist/types/components/trial-bar/check-props.d.ts +3 -0
- package/dist/types/components/trial-bar/check-props.d.ts.map +1 -0
- package/dist/types/components/trial-bar/index.d.ts +15 -7
- package/dist/types/components/trial-bar/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/index.d.ts +5 -1
- package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/item.d.ts +3 -1
- package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/check-props.d.ts +3 -0
- package/dist/types/components/welcome-mat/check-props.d.ts.map +1 -0
- package/dist/types/components/welcome-mat/index.d.ts +9 -3
- package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/info-badge.d.ts +7 -3
- package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.cjs","names":[],"sources":["../../../../../components/combobox/private/menu.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\ttype ReactNode,\n\ttype ReactElement,\n\ttype CSSProperties,\n} from 'react';\nimport { dequal as isEqual } from 'dequal';\nimport classNames from 'classnames';\n\nimport Icon from '../../icon';\nimport Spinner from '../../spinner';\n\ntype ComboboxOptionLabelRenderer = (searchTerm: string) => ReactNode;\n\n/**\n * A selectable option. Group items under a `subheadings` entry from\n * `comboboxAddSubheadings` with `category`.\n */\nexport interface ComboboxItemOption {\n\t/** Structural rows set `type`; selectable items leave it unset. */\n\ttype?: undefined;\n\tid: string;\n\t/** Matches the `id` of a subheading passed to `comboboxAddSubheadings` */\n\tcategory?: string;\n\tlabel?: string;\n\tsubTitle?: string;\n\ttitle?: string;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n\ttooltipContent?: ReactNode;\n\tvalue?: string;\n\tonClick?: never;\n}\n\n/** A non-interactive group label. Without a `label` it renders as a divider. */\nexport interface ComboboxSeparatorOption {\n\ttype: 'separator';\n\tid: string;\n\tlabel?: string | ComboboxOptionLabelRenderer;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ticon?: never;\n\tdisabled?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n\tonClick?: never;\n}\n\ninterface ComboboxActionOptionFields {\n\tid: string;\n\tlabel?: string | ComboboxOptionLabelRenderer;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n\t/** @deprecated Only called on Enter, for `type: 'header' | 'footer'` rows\n\t * passed directly in `options`. Use `optionsSearchEntity`/`optionsAddItem`\n\t * with `events.onSelectActionItem` instead. */\n\tonClick?: (event: React.MouseEvent) => void;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\n/**\n * An action row above (`header`) or below (`footer`) the options. Usually\n * created from `optionsSearchEntity` and `optionsAddItem`.\n */\nexport type ComboboxActionOption =\n\t| (ComboboxActionOptionFields & { type: 'header' })\n\t| (ComboboxActionOptionFields & { type: 'footer' });\n\n/** The \"clear selection\" row added by `hasDeselect`. */\nexport interface ComboboxDeselectOption {\n\ttype: 'deselect';\n\tid: string;\n\tlabel?: string;\n\tvalue?: string;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ticon?: never;\n\tdisabled?: never;\n\ttooltipContent?: never;\n\tonClick?: never;\n}\n\nexport type ComboboxOption =\n\t| ComboboxItemOption\n\t| ComboboxSeparatorOption\n\t| ComboboxActionOption\n\t| ComboboxDeselectOption;\n\nexport interface MenuAssistiveText {\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n}\n\nexport interface MenuLabels {\n\tnoOptionsFound: ReactNode | string;\n}\n\nexport interface MenuProps {\n\t/** Active descendant in menu */\n\tactiveOption?: ComboboxOption;\n\t/** Index of active descendant in menu */\n\tactiveOptionIndex?: number;\n\t/** Assistive text for accessibility */\n\tassistiveText?: MenuAssistiveText;\n\t/** CSS classes to be added to menu sub header span tag */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Sets the dialog width */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Id used for assistive technology */\n\tinputId?: string;\n\t/** Input value for bolding matches */\n\tinputValue?: string;\n\t/** Function to check if option is selected */\n\tisSelected: (params: {\n\t\tselection: ComboboxOption[];\n\t\toption: ComboboxOption;\n\t}) => boolean;\n\t/** Determines the height of the menu */\n\titemVisibleLength?: 5 | 7 | 10 | null;\n\t/** Text labels */\n\tlabels: MenuLabels;\n\t/** Adds loading spinner below the options */\n\thasMenuSpinner?: boolean;\n\t/** Sets a maximum width for menu */\n\tmaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Ref for menu element */\n\tmenuRef?:\n\t\tReact.RefCallback<HTMLUListElement> | React.RefObject<HTMLUListElement>;\n\t/** Custom menu item renderer */\n\tonRenderMenuItem?: React.ComponentType<{\n\t\tassistiveText?: MenuAssistiveText;\n\t\tselected: boolean;\n\t\toption: ComboboxItemOption | ComboboxDeselectOption;\n\t}>;\n\t/** Callback when option is selected */\n\tonSelect: (\n\t\tevent: React.MouseEvent,\n\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t) => void;\n\t/** Menu options */\n\toptions: ComboboxOption[];\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement;\n\t/** Menu variant */\n\tvariant?: 'icon-title-subtitle' | 'checkbox';\n}\n\nconst setBold = (label: string | undefined, searchTerm: string): ReactNode => {\n\tif (!label || label.length === 0 || !searchTerm || searchTerm.length === 0) {\n\t\treturn label;\n\t}\n\tconst position = label.toLowerCase().indexOf(searchTerm.toLowerCase());\n\tif (position > -1) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{label.substr(0, position)}\n\t\t\t\t<span key=\"bold\" className=\"slds-text-title_bold\">{`${label.substr(\n\t\t\t\t\tposition,\n\t\t\t\t\tsearchTerm.length\n\t\t\t\t)}`}</span>\n\t\t\t\t{label.substr(position + searchTerm.length)}\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn label;\n};\n\nconst renderLabel = (\n\tlabelProp: string | ((searchTerm: string) => ReactNode) | undefined,\n\tsearchTerm: string\n): ReactNode => {\n\tif (labelProp == null || typeof labelProp === 'string') {\n\t\treturn labelProp;\n\t}\n\treturn labelProp(searchTerm);\n};\n\n// Entity icons in a combobox listbox option render at \"small\" per SLDS. `Icon`\n// defaults to \"medium\", so an option icon passed without an explicit size shows\n// oversized in the menu (SLDS 2 no longer shrinks it via CSS the way SLDS 1\n// did). Clone the icon to enforce \"small\" unless the consumer set a size\n// themselves. Leaves non-<Icon> nodes untouched.\nconst sizeOptionIcon = (icon: ReactNode): ReactNode => {\n\tif (!React.isValidElement(icon)) {\n\t\treturn icon;\n\t}\n\tconst iconProps = icon.props as { size?: unknown };\n\tif (iconProps.size != null) {\n\t\treturn icon;\n\t}\n\treturn React.cloneElement(icon, { size: 'small' } as Record<string, unknown>);\n};\n\nconst Menu: React.FC<MenuProps> = ({\n\tactiveOption,\n\tactiveOptionIndex = -1,\n\tassistiveText = {},\n\tclassNameMenuSubHeader,\n\tclassNameMenu,\n\tinheritWidthOf,\n\tinputId,\n\tinputValue = '',\n\tisSelected,\n\titemVisibleLength,\n\tlabels,\n\thasMenuSpinner,\n\tmaxWidth,\n\tmenuPosition,\n\tmenuRef,\n\tonRenderMenuItem: MenuItem,\n\tonSelect,\n\toptions,\n\tselection,\n\ttooltipMenuItemDisabled,\n\tvariant = 'icon-title-subtitle',\n}) => {\n\tlet menuMaxWidth: string | undefined =\n\t\tinheritWidthOf === 'menu' ? 'inherit' : undefined;\n\tmenuMaxWidth =\n\t\tinheritWidthOf === 'menu' && maxWidth ? maxWidth : menuMaxWidth;\n\n\tconst menuOptions = options.map((optionData, index) => {\n\t\tconst active =\n\t\t\tindex === activeOptionIndex &&\n\t\t\tactiveOption &&\n\t\t\tisEqual(optionData.id, activeOption.id);\n\t\tconst selected =\n\t\t\tisSelected({\n\t\t\t\tselection,\n\t\t\t\toption: optionData,\n\t\t\t}) &&\n\t\t\toptionData.type !== 'header' &&\n\t\t\toptionData.type !== 'footer';\n\n\t\tif (optionData.type === 'separator') {\n\t\t\treturn optionData.label ? (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-dropdown__header slds-truncate\"\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined\n\t\t\t\t\t}\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-listbox__option-header',\n\t\t\t\t\t\t\tclassNameMenuSubHeader\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof optionData.label === 'string'\n\t\t\t\t\t\t\t? optionData.label\n\t\t\t\t\t\t\t: optionData.label?.(inputValue)}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-has-divider_top-space\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'header') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-header-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'footer') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-footer-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tconst disabledProps: {\n\t\t\t'aria-describedby'?: string;\n\t\t\t'aria-disabled'?: boolean;\n\t\t\tstyle?: CSSProperties;\n\t\t} = {};\n\t\tconst tooltipId = `${inputId}-listbox-option-help-${optionData.id}`;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled && active) {\n\t\t\tdisabledProps['aria-describedby'] = tooltipId;\n\t\t}\n\t\tif (optionData.disabled) {\n\t\t\tdisabledProps['aria-disabled'] = true;\n\t\t\tdisabledProps.style = { cursor: 'default' };\n\t\t}\n\n\t\tconst labelString =\n\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined;\n\n\t\tconst menuItem: Record<string, ReactNode> = {\n\t\t\t'icon-title-subtitle': (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-subtitle-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_has-meta',\n\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t{optionData.icon && !MenuItem ? (\n\t\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{MenuItem ? (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\t\toption={optionData}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text',\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(labelString, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-meta slds-listbox__option-meta_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={optionData.subTitle}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(optionData.subTitle, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t),\n\t\t\tcheckbox: (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-checkbox-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t' slds-listbox__option_plain slds-media_small slds-media_center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-has-focus': active,\n\t\t\t\t\t\t\t'slds-is-selected': selected,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, {\n\t\t\t\t\t\t\t\t\t\tselection,\n\t\t\t\t\t\t\t\t\t\toption: optionData,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"slds-listbox__icon-selected\"\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t{MenuItem ? (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\t\t\toption={optionData}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames('slds-truncate', {\n\t\t\t\t\t\t\t\t\t'slds-disabled-text': optionData.disabled,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t\t{assistiveText.optionSelectedInMenu}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\t\t{optionData.type === 'deselect' ? (\n\t\t\t\t\t\t\t\t\t<em>{labelString}</em>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tlabelString\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t),\n\t\t};\n\n\t\tlet item: ReactNode;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled) {\n\t\t\tconst tooltipPropsFromElement = tooltipMenuItemDisabled.props as {\n\t\t\t\tcontent?: ReactNode;\n\t\t\t\t[key: string]: unknown;\n\t\t\t};\n\t\t\tconst { content, ...userDefinedTooltipProps } = tooltipPropsFromElement;\n\t\t\tconst tooltipProps: Record<string, unknown> = {\n\t\t\t\talign: 'top',\n\t\t\t\tcontent: optionData.tooltipContent || content,\n\t\t\t\tid: tooltipId,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tsilenceTriggerTabbableWarning: true,\n\t\t\t\ttriggerStyle: { width: '100%' },\n\t\t\t\t...userDefinedTooltipProps,\n\t\t\t};\n\t\t\tif (active) {\n\t\t\t\ttooltipProps.isOpen = true;\n\t\t\t}\n\t\t\titem = React.cloneElement(\n\t\t\t\ttooltipMenuItemDisabled,\n\t\t\t\ttooltipProps,\n\t\t\t\tmenuItem[variant]\n\t\t\t);\n\t\t} else {\n\t\t\titem = menuItem[variant];\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\tkey={`menu-option-${optionData.id}`}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{item}\n\t\t\t</li>\n\t\t);\n\t});\n\n\treturn (\n\t\t<ul\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_length-with-icon-5': itemVisibleLength === 5,\n\t\t\t\t\t'slds-dropdown_length-with-icon-7': itemVisibleLength === 7,\n\t\t\t\t\t'slds-dropdown_length-with-icon-10': itemVisibleLength === 10,\n\t\t\t\t},\n\t\t\t\tclassNameMenu\n\t\t\t)}\n\t\t\tref={menuRef}\n\t\t\trole=\"presentation\"\n\t\t\tstyle={{\n\t\t\t\twidth: inheritWidthOf === 'menu' ? 'auto' : undefined,\n\t\t\t\tmaxWidth: menuMaxWidth,\n\t\t\t\tposition: menuPosition !== 'relative' ? 'relative' : undefined,\n\t\t\t}}\n\t\t>\n\t\t\t{menuOptions.length ? (\n\t\t\t\tmenuOptions\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-listbox__item slds-listbox__status\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-m-left_x-large slds-p-vertical_medium\">\n\t\t\t\t\t\t{labels.noOptionsFound}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t\t{hasMenuSpinner && (\n\t\t\t\t<li role=\"presentation\" className=\"slds-listbox__item\">\n\t\t\t\t\t<div className=\"slds-align_absolute-center slds-p-top_medium\">\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.loadingMenuItems }}\n\t\t\t\t\t\t\thasContainer={false}\n\t\t\t\t\t\t\tisInline\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t</ul>\n\t);\n};\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":"8QAiKA,IAAM,GAAW,EAA2B,IAAkC,CAC7E,GAAI,CAAC,GAAS,EAAM,SAAW,GAAK,CAAC,GAAc,EAAW,SAAW,EACxE,OAAO,EAER,IAAM,EAAW,EAAM,YAAY,CAAC,CAAC,QAAQ,EAAW,YAAY,CAAC,EAarE,OAZI,EAAW,IAEb,EAAA,EAAA,KAAA,CAAC,EAAA,QAAM,SAAP,CAAA,SAAA,CACE,EAAM,OAAO,EAAG,CAAQ,GACzB,EAAA,EAAA,IAAA,CAAC,OAAD,CAAiB,UAAU,uBAAwB,SAAA,GAAG,EAAM,OAC3D,EACA,EAAW,MACZ,GAAU,EAHA,MAGA,EACT,EAAM,OAAO,EAAW,EAAW,MAAM,CAC3B,CAAA,CAAA,EAGX,CACR,EAEM,GACL,EACA,IAEI,GAAa,MAAQ,OAAO,GAAc,SACtC,EAED,EAAU,CAAU,EAQtB,EAAkB,GACnB,CAAC,EAAA,QAAM,eAAe,CAAI,GAGZ,EAAK,MACT,MAAQ,KACd,EAED,EAAA,QAAM,aAAa,EAAM,CAAE,KAAM,OAAQ,CAA4B,EAGvE,GAA6B,CAClC,eACA,oBAAoB,GACpB,gBAAgB,CAAC,EACjB,yBACA,gBACA,iBACA,UACA,aAAa,GACb,aACA,oBACA,SACA,iBACA,WACA,eACA,UACA,iBAAkB,EAClB,WACA,UACA,YACA,0BACA,UAAU,yBACL,CACL,IAAI,EACH,IAAmB,OAAS,UAAY,IAAA,GACzC,EACC,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,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,6CACd,SAAA,EAAO,cACH,CAAA,CACH,CAAA,EAEJ,IACA,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,KAAK,eAAe,UAAU,qBACjC,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,+CACd,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,gBAAiB,EACvD,aAAc,GACd,SAAA,GACA,KAAK,SACL,CAAA,CACG,CAAA,CACF,CAAA,CAEF,GAEN,EAEA,EAAK,YAAc"}
|
|
1
|
+
{"version":3,"file":"menu.cjs","names":[],"sources":["../../../../../components/combobox/private/menu.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\ttype ReactNode,\n\ttype ReactElement,\n\ttype CSSProperties,\n} from 'react';\nimport { dequal as isEqual } from 'dequal';\nimport classNames from 'classnames';\n\nimport Icon from '../../icon';\nimport Spinner from '../../spinner';\n\ntype ComboboxOptionLabelRenderer = (searchTerm: string) => ReactNode;\n\n/**\n * A selectable option. Group items under a `subheadings` entry from\n * `comboboxAddSubheadings` with `category`.\n */\nexport interface ComboboxItemOption {\n\t/** Structural rows set `type`; selectable items leave it unset. */\n\ttype?: undefined;\n\tid: string;\n\t/** Matches the `id` of a subheading passed to `comboboxAddSubheadings` */\n\tcategory?: string;\n\tlabel?: string;\n\tsubTitle?: string;\n\ttitle?: string;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n\ttooltipContent?: ReactNode;\n\tvalue?: string;\n\tonClick?: never;\n}\n\n/** A non-interactive group label. Without a `label` it renders as a divider. */\nexport interface ComboboxSeparatorOption {\n\ttype: 'separator';\n\tid: string;\n\tlabel?: string | ComboboxOptionLabelRenderer;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ticon?: never;\n\tdisabled?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n\tonClick?: never;\n}\n\ninterface ComboboxActionOptionFields {\n\tid: string;\n\tlabel?: string | ComboboxOptionLabelRenderer;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n\t/** @deprecated Only called on Enter, for `type: 'header' | 'footer'` rows\n\t * passed directly in `options`. Use `optionsSearchEntity`/`optionsAddItem`\n\t * with `events.onSelectActionItem` instead. */\n\tonClick?: (event: React.MouseEvent) => void;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\n/**\n * An action row above (`header`) or below (`footer`) the options. Usually\n * created from `optionsSearchEntity` and `optionsAddItem`.\n */\nexport type ComboboxActionOption =\n\t| (ComboboxActionOptionFields & { type: 'header' })\n\t| (ComboboxActionOptionFields & { type: 'footer' });\n\n/** The \"clear selection\" row added by `hasDeselect`. */\nexport interface ComboboxDeselectOption {\n\ttype: 'deselect';\n\tid: string;\n\tlabel?: string;\n\tvalue?: string;\n\tcategory?: never;\n\tsubTitle?: never;\n\ttitle?: never;\n\ticon?: never;\n\tdisabled?: never;\n\ttooltipContent?: never;\n\tonClick?: never;\n}\n\nexport type ComboboxOption =\n\t| ComboboxItemOption\n\t| ComboboxSeparatorOption\n\t| ComboboxActionOption\n\t| ComboboxDeselectOption;\n\nexport interface MenuAssistiveText {\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n}\n\n/**\n * Argument passed to the menu's `renderMenuItem`\n */\nexport interface MenuRenderMenuItemData {\n\t/** Whether the option is selected */\n\tisSelected: boolean;\n\t/** The option to render. Custom renderers only receive selectable rows */\n\toption: ComboboxItemOption | ComboboxDeselectOption;\n}\n\nexport interface MenuLabels {\n\tnoOptionsFound: ReactNode | string;\n}\n\nexport interface MenuProps {\n\t/** Active descendant in menu */\n\tactiveOption?: ComboboxOption;\n\t/** Index of active descendant in menu */\n\tactiveOptionIndex?: number;\n\t/** Assistive text for accessibility */\n\tassistiveText?: MenuAssistiveText;\n\t/** CSS classes to be added to menu sub header span tag */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Sets the dialog width */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/** Id used for assistive technology */\n\tinputId?: string;\n\t/** Input value for bolding matches */\n\tinputValue?: string;\n\t/** Function to check if option is selected */\n\tisSelected: (params: {\n\t\tselection: ComboboxOption[];\n\t\toption: ComboboxOption;\n\t}) => boolean;\n\t/** Determines the height of the menu */\n\titemVisibleLength?: 5 | 7 | 10 | null;\n\t/** Text labels */\n\tlabels: MenuLabels;\n\t/** Adds loading spinner below the options */\n\thasMenuSpinner?: boolean;\n\t/** Sets a maximum width for menu */\n\tmaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Ref for menu element */\n\tmenuRef?:\n\t\tReact.RefCallback<HTMLUListElement> | React.RefObject<HTMLUListElement>;\n\t/** Renders an option's content in place of the default label and icon */\n\trenderMenuItem?: (data: MenuRenderMenuItemData) => ReactNode;\n\t/** Callback when option is selected */\n\tonSelect: (\n\t\tevent: React.MouseEvent,\n\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t) => void;\n\t/** Menu options */\n\toptions: ComboboxOption[];\n\t/** Selected options */\n\tselection: ComboboxOption[];\n\t/** Tooltip for disabled menu items */\n\ttooltipMenuItemDisabled?: ReactElement;\n\t/** Menu variant */\n\tvariant?: 'icon-title-subtitle' | 'checkbox';\n}\n\nconst setBold = (label: string | undefined, searchTerm: string): ReactNode => {\n\tif (!label || label.length === 0 || !searchTerm || searchTerm.length === 0) {\n\t\treturn label;\n\t}\n\tconst position = label.toLowerCase().indexOf(searchTerm.toLowerCase());\n\tif (position > -1) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{label.substr(0, position)}\n\t\t\t\t<span key=\"bold\" className=\"slds-text-title_bold\">{`${label.substr(\n\t\t\t\t\tposition,\n\t\t\t\t\tsearchTerm.length\n\t\t\t\t)}`}</span>\n\t\t\t\t{label.substr(position + searchTerm.length)}\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn label;\n};\n\nconst renderLabel = (\n\tlabelProp: string | ((searchTerm: string) => ReactNode) | undefined,\n\tsearchTerm: string\n): ReactNode => {\n\tif (labelProp == null || typeof labelProp === 'string') {\n\t\treturn labelProp;\n\t}\n\treturn labelProp(searchTerm);\n};\n\n// Entity icons in a combobox listbox option render at \"small\" per SLDS. `Icon`\n// defaults to \"medium\", so an option icon passed without an explicit size shows\n// oversized in the menu (SLDS 2 no longer shrinks it via CSS the way SLDS 1\n// did). Clone the icon to enforce \"small\" unless the consumer set a size\n// themselves. Leaves non-<Icon> nodes untouched.\nconst sizeOptionIcon = (icon: ReactNode): ReactNode => {\n\tif (!React.isValidElement(icon)) {\n\t\treturn icon;\n\t}\n\tconst iconProps = icon.props as { size?: unknown };\n\tif (iconProps.size != null) {\n\t\treturn icon;\n\t}\n\treturn React.cloneElement(icon, { size: 'small' } as Record<string, unknown>);\n};\n\nconst Menu: React.FC<MenuProps> = ({\n\tactiveOption,\n\tactiveOptionIndex = -1,\n\tassistiveText = {},\n\tclassNameMenuSubHeader,\n\tclassNameMenu,\n\tinheritWidthOf,\n\tinputId,\n\tinputValue = '',\n\tisSelected,\n\titemVisibleLength,\n\tlabels,\n\thasMenuSpinner,\n\tmaxWidth,\n\tmenuPosition,\n\tmenuRef,\n\trenderMenuItem,\n\tonSelect,\n\toptions,\n\tselection,\n\ttooltipMenuItemDisabled,\n\tvariant = 'icon-title-subtitle',\n}) => {\n\tlet menuMaxWidth: string | undefined =\n\t\tinheritWidthOf === 'menu' ? 'inherit' : undefined;\n\tmenuMaxWidth =\n\t\tinheritWidthOf === 'menu' && maxWidth ? maxWidth : menuMaxWidth;\n\n\tconst menuOptions = options.map((optionData, index) => {\n\t\tconst active =\n\t\t\tindex === activeOptionIndex &&\n\t\t\tactiveOption &&\n\t\t\tisEqual(optionData.id, activeOption.id);\n\t\tconst selected =\n\t\t\tisSelected({\n\t\t\t\tselection,\n\t\t\t\toption: optionData,\n\t\t\t}) &&\n\t\t\toptionData.type !== 'header' &&\n\t\t\toptionData.type !== 'footer';\n\n\t\tif (optionData.type === 'separator') {\n\t\t\treturn optionData.label ? (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-dropdown__header slds-truncate\"\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined\n\t\t\t\t\t}\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-listbox__option-header',\n\t\t\t\t\t\t\tclassNameMenuSubHeader\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof optionData.label === 'string'\n\t\t\t\t\t\t\t? optionData.label\n\t\t\t\t\t\t\t: optionData.label?.(inputValue)}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-has-divider_top-space\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\tkey={`menu-separator-${optionData.id}`}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'header') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-header-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tif (optionData.type === 'footer') {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tkey={`menu-footer-${optionData.id}}`}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-selected={active}\n\t\t\t\t\t\taria-disabled={optionData.disabled || undefined}\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_term',\n\t\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t\t)}\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-media__figure slds-listbox__option-icon\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t{renderLabel(optionData.label, inputValue)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\n\t\tconst disabledProps: {\n\t\t\t'aria-describedby'?: string;\n\t\t\t'aria-disabled'?: boolean;\n\t\t\tstyle?: CSSProperties;\n\t\t} = {};\n\t\tconst tooltipId = `${inputId}-listbox-option-help-${optionData.id}`;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled && active) {\n\t\t\tdisabledProps['aria-describedby'] = tooltipId;\n\t\t}\n\t\tif (optionData.disabled) {\n\t\t\tdisabledProps['aria-disabled'] = true;\n\t\t\tdisabledProps.style = { cursor: 'default' };\n\t\t}\n\n\t\tconst labelString =\n\t\t\ttypeof optionData.label === 'string' ? optionData.label : undefined;\n\n\t\tconst menuItem: Record<string, ReactNode> = {\n\t\t\t'icon-title-subtitle': (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-subtitle-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t'slds-listbox__option_entity slds-listbox__option_has-meta',\n\t\t\t\t\t\t{ 'slds-has-focus': active }\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, { option: optionData });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t{optionData.icon && !renderMenuItem ? (\n\t\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{sizeOptionIcon(optionData.icon)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text',\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-text_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(labelString, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-listbox__option-meta slds-listbox__option-meta_entity',\n\t\t\t\t\t\t\t\t\t{ 'slds-disabled-text': optionData.disabled }\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\ttitle={optionData.subTitle}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{setBold(optionData.subTitle, inputValue)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t),\n\t\t\tcheckbox: (\n\t\t\t\t<span\n\t\t\t\t\taria-selected={active}\n\t\t\t\t\t{...disabledProps}\n\t\t\t\t\tid={`${inputId}-listbox-option-${optionData.id}`}\n\t\t\t\t\tkey={`menu-checkbox-${optionData.id}`}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-media slds-listbox__option',\n\t\t\t\t\t\t' slds-listbox__option_plain slds-media_small slds-media_center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-has-focus': active,\n\t\t\t\t\t\t\t'slds-is-selected': selected,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tonClick={\n\t\t\t\t\t\toptionData.disabled\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (event) => {\n\t\t\t\t\t\t\t\t\tonSelect(event, {\n\t\t\t\t\t\t\t\t\t\tselection,\n\t\t\t\t\t\t\t\t\t\toption: optionData,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trole=\"option\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-media__figure\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"slds-listbox__icon-selected\"\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"slds-media__body\">\n\t\t\t\t\t\t{renderMenuItem ? (\n\t\t\t\t\t\t\trenderMenuItem({ isSelected: selected, option: optionData })\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={classNames('slds-truncate', {\n\t\t\t\t\t\t\t\t\t'slds-disabled-text': optionData.disabled,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\ttitle={labelString}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t\t{assistiveText.optionSelectedInMenu}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\t\t{optionData.type === 'deselect' ? (\n\t\t\t\t\t\t\t\t\t<em>{labelString}</em>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tlabelString\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t),\n\t\t};\n\n\t\tlet item: ReactNode;\n\t\tif (optionData.disabled && tooltipMenuItemDisabled) {\n\t\t\tconst tooltipPropsFromElement = tooltipMenuItemDisabled.props as {\n\t\t\t\tcontent?: ReactNode;\n\t\t\t\t[key: string]: unknown;\n\t\t\t};\n\t\t\tconst { content, ...userDefinedTooltipProps } = tooltipPropsFromElement;\n\t\t\tconst tooltipProps: Record<string, unknown> = {\n\t\t\t\talign: 'top',\n\t\t\t\tcontent: optionData.tooltipContent || content,\n\t\t\t\tid: tooltipId,\n\t\t\t\tposition: 'absolute',\n\t\t\t\tsilenceTriggerTabbableWarning: true,\n\t\t\t\ttriggerStyle: { width: '100%' },\n\t\t\t\t...userDefinedTooltipProps,\n\t\t\t};\n\t\t\tif (active) {\n\t\t\t\ttooltipProps.isOpen = true;\n\t\t\t}\n\t\t\titem = React.cloneElement(\n\t\t\t\ttooltipMenuItemDisabled,\n\t\t\t\ttooltipProps,\n\t\t\t\tmenuItem[variant]\n\t\t\t);\n\t\t} else {\n\t\t\titem = menuItem[variant];\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName=\"slds-listbox__item\"\n\t\t\t\tkey={`menu-option-${optionData.id}`}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{item}\n\t\t\t</li>\n\t\t);\n\t});\n\n\treturn (\n\t\t<ul\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_length-with-icon-5': itemVisibleLength === 5,\n\t\t\t\t\t'slds-dropdown_length-with-icon-7': itemVisibleLength === 7,\n\t\t\t\t\t'slds-dropdown_length-with-icon-10': itemVisibleLength === 10,\n\t\t\t\t},\n\t\t\t\tclassNameMenu\n\t\t\t)}\n\t\t\tref={menuRef}\n\t\t\trole=\"presentation\"\n\t\t\tstyle={{\n\t\t\t\twidth: inheritWidthOf === 'menu' ? 'auto' : undefined,\n\t\t\t\tmaxWidth: menuMaxWidth,\n\t\t\t\tposition: menuPosition !== 'relative' ? 'relative' : undefined,\n\t\t\t}}\n\t\t>\n\t\t\t{menuOptions.length ? (\n\t\t\t\tmenuOptions\n\t\t\t) : (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"slds-listbox__item slds-listbox__status\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-m-left_x-large slds-p-vertical_medium\">\n\t\t\t\t\t\t{labels.noOptionsFound}\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t\t{hasMenuSpinner && (\n\t\t\t\t<li role=\"presentation\" className=\"slds-listbox__item\">\n\t\t\t\t\t<div className=\"slds-align_absolute-center slds-p-top_medium\">\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.loadingMenuItems }}\n\t\t\t\t\t\t\thasContainer={false}\n\t\t\t\t\t\t\tisInline\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t)}\n\t\t</ul>\n\t);\n};\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":"8QAuKA,IAAM,GAAW,EAA2B,IAAkC,CAC7E,GAAI,CAAC,GAAS,EAAM,SAAW,GAAK,CAAC,GAAc,EAAW,SAAW,EACxE,OAAO,EAER,IAAM,EAAW,EAAM,YAAY,CAAC,CAAC,QAAQ,EAAW,YAAY,CAAC,EAarE,OAZI,EAAW,IAEb,EAAA,EAAA,KA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AO,EAC9B,GAAG,CACJ,EACI,IACH,EAAa,OAAS,IAEvB,EAAO,EAAA,QAAM,aACZ,EACA,EACA,EAAS,EACV,CACD,KACC,GAAO,EAAS,GAGjB,OACC,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,UAAU,qBAEV,KAAK,eAEJ,SAAA,CACE,EAJE,eAAe,EAAW,IAI5B,CAEN,CAAC,EAED,OACC,EAAA,EAAA,KAAA,CAAC,KAAD,CACC,WAAA,EAAW,EAAA,QAAA,CACV,uEACA,CACC,mCAAoC,IAAsB,EAC1D,mCAAoC,IAAsB,EAC1D,oCAAqC,IAAsB,EAC5D,EACA,CACD,EACA,IAAK,EACL,KAAK,eACL,MAAO,CACN,MAAO,IAAmB,OAAS,OAAS,IAAA,GAC5C,SAAU,EACV,SAAU,IAAiB,WAA0B,IAAA,GAAb,UACzC,EAhBD,SAAA,CAkBE,EAAY,OACZ,GAEA,EAAA,EAAA,IAAA,CAAC,KAAD,CACC,UAAU,0CACV,KAAK,SACL,YAAU,SAEV,UAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,6CACd,SAAA,EAAO,cACH,CAAA,CACH,CAAA,EAEJ,IACA,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,KAAK,eAAe,UAAU,qBACjC,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,+CACd,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,cAAe,CAAE,MAAO,EAAc,gBAAiB,EACvD,aAAc,GACd,SAAA,GACA,KAAK,SACL,CAAA,CACG,CAAA,CACF,CAAA,CAEF,GAEN,EAEA,EAAK,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/class-names.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({assistiveText:e,className:t,isPaused:a,isStatic:o,scorePolarity:s,strengthLevel:c,title:l,trendDirection:u,variant:d})=>{let f=(()=>{let t=[],n=l||`${d.charAt(0).toUpperCase()}${d.slice(1)}`;return d===`ellie`?t.push((0,i.jsx)(`svg`,{viewBox:`0 0 280 14`,"aria-hidden":`true`,children:Array.from({length:20},(e,t)=>{let n=7+t*14;return(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`circle`,{cx:n,cy:`7`,r:`4`}),(0,i.jsx)(`circle`,{cx:n,cy:`7`,r:`3`})]},t)})},`ellie-svg`)):d===`eq`?t.push((0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-1`),(0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-2`),(0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-3`)):d===`score`?t.push((0,i.jsx)(`svg`,{viewBox:`0 0 5 5`,className:`slds-icon-score__positive`,"aria-hidden":`true`,children:(0,i.jsx)(`circle`,{cx:`50%`,cy:`50%`,r:`1.875`})},`score-pos`),(0,i.jsx)(`svg`,{viewBox:`0 0 5 5`,className:`slds-icon-score__negative`,"aria-hidden":`true`,children:(0,i.jsx)(`circle`,{cx:`50%`,cy:`50%`,r:`1.875`})},`score-neg`)):d===`strength`?t.push((0,i.jsxs)(`svg`,{viewBox:`0 0 27 7`,"aria-hidden":`true`,children:[(0,i.jsx)(`circle`,{r:`3.025`,cx:`3.5`,cy:`3.5`}),(0,i.jsx)(`circle`,{r:`3.025`,cx:`13.5`,cy:`3.5`}),(0,i.jsx)(`circle`,{r:`3.025`,cx:`23.5`,cy:`3.5`})]},`strength-svg`)):d===`trend`?t.push((0,i.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,i.jsx)(`path`,{className:`slds-icon-trend__arrow`,d:`M.75 8H11M8 4.5L11.5 8 8 11.5`}),(0,i.jsx)(`circle`,{className:`slds-icon-trend__circle`,cy:`8`,cx:`8`,r:`7.375`,transform:`rotate(-28 8 8) scale(-1 1) translate(-16 0)`})]},`trend-svg`)):d===`typing`?(t.push((0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-1`),(0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-2`),(0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-3`)),l||(n=`User is typing`)):d===`waffle`&&(t.push((0,i.jsxs)(`span`,{className:`slds-icon-waffle`,children:[(0,i.jsx)(`span`,{className:`slds-r1`}),(0,i.jsx)(`span`,{className:`slds-r2`}),(0,i.jsx)(`span`,{className:`slds-r3`}),(0,i.jsx)(`span`,{className:`slds-r4`}),(0,i.jsx)(`span`,{className:`slds-r5`}),(0,i.jsx)(`span`,{className:`slds-r6`}),(0,i.jsx)(`span`,{className:`slds-r7`}),(0,i.jsx)(`span`,{className:`slds-r8`}),(0,i.jsx)(`span`,{className:`slds-r9`})]},`waffle`)),l||(n=`Open App Launcher`)),t.push((0,i.jsx)(`span`,{className:`slds-assistive-text`,children:e?.label||n},`assistive`)),t})(),p=[{"slds-is-animated":!o,"slds-is-paused":a}],m={title:l},h=`span`;return d===`waffle`?(p.unshift(`slds-button`,`slds-icon-waffle_container`),h=`button`):(p.unshift(`slds-icon-${d}`),d===`eq`?h=`div`:d===`score`?m[`data-slds-state`]=s||`positive`:d===`strength`?m[`data-slds-strength`]=c===void 0?`0`:`${c}`:d===`trend`&&(m[`data-slds-trend`]=u||`neutral`)),m.className=n.default(p,t),r.default.createElement(h,m,...f)};a.displayName=t.DYNAMIC_ICON,exports.default=a;
|
|
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/class-names.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({assistiveText:e,className:t,isPaused:a,isStatic:o,scorePolarity:s,strengthLevel:c,title:l,trendDirection:u,variant:d})=>{let f=(()=>{let t=[],n=l||`${d.charAt(0).toUpperCase()}${d.slice(1)}`;return d===`ellie`?t.push((0,i.jsx)(`svg`,{viewBox:`0 0 280 14`,"aria-hidden":`true`,children:Array.from({length:20},(e,t)=>{let n=7+t*14;return(0,i.jsxs)(r.default.Fragment,{children:[(0,i.jsx)(`circle`,{cx:n,cy:`7`,r:`4`}),(0,i.jsx)(`circle`,{cx:n,cy:`7`,r:`3`})]},t)})},`ellie-svg`)):d===`eq`?t.push((0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-1`),(0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-2`),(0,i.jsx)(`div`,{className:`slds-icon-eq__bar`},`eq-bar-3`)):d===`score`?t.push((0,i.jsx)(`svg`,{viewBox:`0 0 5 5`,className:`slds-icon-score__positive`,"aria-hidden":`true`,children:(0,i.jsx)(`circle`,{cx:`50%`,cy:`50%`,r:`1.875`})},`score-pos`),(0,i.jsx)(`svg`,{viewBox:`0 0 5 5`,className:`slds-icon-score__negative`,"aria-hidden":`true`,children:(0,i.jsx)(`circle`,{cx:`50%`,cy:`50%`,r:`1.875`})},`score-neg`)):d===`strength`?t.push((0,i.jsxs)(`svg`,{viewBox:`0 0 27 7`,"aria-hidden":`true`,children:[(0,i.jsx)(`circle`,{r:`3.025`,cx:`3.5`,cy:`3.5`}),(0,i.jsx)(`circle`,{r:`3.025`,cx:`13.5`,cy:`3.5`}),(0,i.jsx)(`circle`,{r:`3.025`,cx:`23.5`,cy:`3.5`})]},`strength-svg`)):d===`trend`?t.push((0,i.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,i.jsx)(`path`,{className:`slds-icon-trend__arrow`,d:`M.75 8H11M8 4.5L11.5 8 8 11.5`}),(0,i.jsx)(`circle`,{className:`slds-icon-trend__circle`,cy:`8`,cx:`8`,r:`7.375`,transform:`rotate(-28 8 8) scale(-1 1) translate(-16 0)`})]},`trend-svg`)):d===`typing`?(t.push((0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-1`),(0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-2`),(0,i.jsx)(`span`,{className:`slds-icon-typing__dot`},`typing-3`)),l||(n=`User is typing`)):d===`waffle`&&(t.push((0,i.jsxs)(`span`,{className:`slds-icon-waffle`,children:[(0,i.jsx)(`span`,{className:`slds-r1`}),(0,i.jsx)(`span`,{className:`slds-r2`}),(0,i.jsx)(`span`,{className:`slds-r3`}),(0,i.jsx)(`span`,{className:`slds-r4`}),(0,i.jsx)(`span`,{className:`slds-r5`}),(0,i.jsx)(`span`,{className:`slds-r6`}),(0,i.jsx)(`span`,{className:`slds-r7`}),(0,i.jsx)(`span`,{className:`slds-r8`}),(0,i.jsx)(`span`,{className:`slds-r9`})]},`waffle`)),l||(n=`Open App Launcher`)),t.push((0,i.jsx)(`span`,{className:`slds-assistive-text`,children:e?.label||n},`assistive`)),t})(),p=[{"slds-is-animated":!o,"slds-is-paused":a}],m={title:l},h=`span`;return d===`waffle`?(p.unshift(`slds-button`,`slds-icon-waffle_container`),h=`button`,m.type=`button`):(p.unshift(`slds-icon-${d}`),d===`eq`?h=`div`:d===`score`?m[`data-slds-state`]=s||`positive`:d===`strength`?m[`data-slds-strength`]=c===void 0?`0`:`${c}`:d===`trend`&&(m[`data-slds-trend`]=u||`neutral`)),m.className=n.default(p,t),r.default.createElement(h,m,...f)};a.displayName=t.DYNAMIC_ICON,exports.default=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/dynamic-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\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { DYNAMIC_ICON } from '../../utilities/constants';\n\n/**\n * Dynamic icon variant types\n */\nexport type DynamicIconVariant
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/dynamic-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\nimport React, { type ReactNode } from 'react';\nimport classNames from '../../utilities/class-names';\nimport { DYNAMIC_ICON } from '../../utilities/constants';\n\n/**\n * Dynamic icon variant types\n */\nexport type DynamicIconVariant =\n\t'ellie' | 'eq' | 'score' | 'strength' | 'trend' | 'typing' | 'waffle';\n\n/**\n * Score polarity options\n */\nexport type ScorePolarity = 'positive' | 'negative';\n\n/**\n * Strength level options\n */\nexport type StrengthLevel =\n\t'-3' | '-2' | '-1' | '0' | '1' | '2' | '3' | -3 | -2 | -1 | 0 | 1 | 2 | 3;\n\n/**\n * Trend direction options\n */\nexport type TrendDirection = 'down' | 'up' | 'neutral';\n\n/**\n * Assistive text for DynamicIcon\n */\nexport interface DynamicIconAssistiveText {\n\t/** Label for the icon */\n\tlabel?: string;\n}\n\n/**\n * Props for the DynamicIcon component\n */\nexport interface DynamicIconProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DynamicIconAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Pauses animation */\n\tisPaused?: boolean;\n\t/** Disables animation */\n\tisStatic?: boolean;\n\t/** Polarity for score variant */\n\tscorePolarity?: ScorePolarity;\n\t/** Strength level for strength variant */\n\tstrengthLevel?: StrengthLevel;\n\t/** Title attribute (required) */\n\ttitle: string;\n\t/** Trend direction for trend variant */\n\ttrendDirection?: TrendDirection;\n\t/** Icon variant (required) */\n\tvariant: DynamicIconVariant;\n}\n\n/**\n * A set of delightful animated icons.\n */\nconst DynamicIcon = ({\n\tassistiveText,\n\tclassName,\n\tisPaused,\n\tisStatic,\n\tscorePolarity,\n\tstrengthLevel,\n\ttitle,\n\ttrendDirection,\n\tvariant,\n}: DynamicIconProps): React.ReactElement => {\n\tconst getIconChildren = (): ReactNode[] => {\n\t\tconst children: ReactNode[] = [];\n\t\tlet defaultAssistiveText =\n\t\t\ttitle || `${variant.charAt(0).toUpperCase()}${variant.slice(1)}`;\n\n\t\tif (variant === 'ellie') {\n\t\t\tchildren.push(\n\t\t\t\t<svg key=\"ellie-svg\" viewBox=\"0 0 280 14\" aria-hidden=\"true\">\n\t\t\t\t\t{Array.from({ length: 20 }, (_, i) => {\n\t\t\t\t\t\tconst cx = 7 + i * 14;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<React.Fragment key={i}>\n\t\t\t\t\t\t\t\t<circle cx={cx} cy=\"7\" r=\"4\" />\n\t\t\t\t\t\t\t\t<circle cx={cx} cy=\"7\" r=\"3\" />\n\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</svg>\n\t\t\t);\n\t\t} else if (variant === 'eq') {\n\t\t\tchildren.push(\n\t\t\t\t<div key=\"eq-bar-1\" className=\"slds-icon-eq__bar\" />,\n\t\t\t\t<div key=\"eq-bar-2\" className=\"slds-icon-eq__bar\" />,\n\t\t\t\t<div key=\"eq-bar-3\" className=\"slds-icon-eq__bar\" />\n\t\t\t);\n\t\t} else if (variant === 'score') {\n\t\t\tchildren.push(\n\t\t\t\t<svg\n\t\t\t\t\tkey=\"score-pos\"\n\t\t\t\t\tviewBox=\"0 0 5 5\"\n\t\t\t\t\tclassName=\"slds-icon-score__positive\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<circle cx=\"50%\" cy=\"50%\" r=\"1.875\" />\n\t\t\t\t</svg>,\n\t\t\t\t<svg\n\t\t\t\t\tkey=\"score-neg\"\n\t\t\t\t\tviewBox=\"0 0 5 5\"\n\t\t\t\t\tclassName=\"slds-icon-score__negative\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<circle cx=\"50%\" cy=\"50%\" r=\"1.875\" />\n\t\t\t\t</svg>\n\t\t\t);\n\t\t} else if (variant === 'strength') {\n\t\t\tchildren.push(\n\t\t\t\t<svg key=\"strength-svg\" viewBox=\"0 0 27 7\" aria-hidden=\"true\">\n\t\t\t\t\t<circle r=\"3.025\" cx=\"3.5\" cy=\"3.5\" />\n\t\t\t\t\t<circle r=\"3.025\" cx=\"13.5\" cy=\"3.5\" />\n\t\t\t\t\t<circle r=\"3.025\" cx=\"23.5\" cy=\"3.5\" />\n\t\t\t\t</svg>\n\t\t\t);\n\t\t} else if (variant === 'trend') {\n\t\t\tchildren.push(\n\t\t\t\t<svg key=\"trend-svg\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n\t\t\t\t\t<path\n\t\t\t\t\t\tclassName=\"slds-icon-trend__arrow\"\n\t\t\t\t\t\td=\"M.75 8H11M8 4.5L11.5 8 8 11.5\"\n\t\t\t\t\t/>\n\t\t\t\t\t<circle\n\t\t\t\t\t\tclassName=\"slds-icon-trend__circle\"\n\t\t\t\t\t\tcy=\"8\"\n\t\t\t\t\t\tcx=\"8\"\n\t\t\t\t\t\tr=\"7.375\"\n\t\t\t\t\t\ttransform=\"rotate(-28 8 8) scale(-1 1) translate(-16 0)\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t);\n\t\t} else if (variant === 'typing') {\n\t\t\tchildren.push(\n\t\t\t\t<span key=\"typing-1\" className=\"slds-icon-typing__dot\" />,\n\t\t\t\t<span key=\"typing-2\" className=\"slds-icon-typing__dot\" />,\n\t\t\t\t<span key=\"typing-3\" className=\"slds-icon-typing__dot\" />\n\t\t\t);\n\t\t\tif (!title) {\n\t\t\t\tdefaultAssistiveText = 'User is typing';\n\t\t\t}\n\t\t} else if (variant === 'waffle') {\n\t\t\tchildren.push(\n\t\t\t\t<span key=\"waffle\" className=\"slds-icon-waffle\">\n\t\t\t\t\t<span className=\"slds-r1\" />\n\t\t\t\t\t<span className=\"slds-r2\" />\n\t\t\t\t\t<span className=\"slds-r3\" />\n\t\t\t\t\t<span className=\"slds-r4\" />\n\t\t\t\t\t<span className=\"slds-r5\" />\n\t\t\t\t\t<span className=\"slds-r6\" />\n\t\t\t\t\t<span className=\"slds-r7\" />\n\t\t\t\t\t<span className=\"slds-r8\" />\n\t\t\t\t\t<span className=\"slds-r9\" />\n\t\t\t\t</span>\n\t\t\t);\n\t\t\tif (!title) {\n\t\t\t\tdefaultAssistiveText = 'Open App Launcher';\n\t\t\t}\n\t\t}\n\n\t\tchildren.push(\n\t\t\t<span key=\"assistive\" className=\"slds-assistive-text\">\n\t\t\t\t{assistiveText?.label || defaultAssistiveText}\n\t\t\t</span>\n\t\t);\n\n\t\treturn children;\n\t};\n\n\tconst children = getIconChildren();\n\tconst classes: (string | Record<string, boolean | undefined>)[] = [\n\t\t{\n\t\t\t'slds-is-animated': !isStatic,\n\t\t\t'slds-is-paused': isPaused,\n\t\t},\n\t];\n\n\tconst iconProps: Record<string, unknown> = {\n\t\ttitle,\n\t};\n\n\tlet element: 'span' | 'div' | 'button' = 'span';\n\n\tif (variant === 'waffle') {\n\t\tclasses.unshift('slds-button', 'slds-icon-waffle_container');\n\t\telement = 'button';\n\t\ticonProps.type = 'button';\n\t} else {\n\t\tclasses.unshift(`slds-icon-${variant}`);\n\n\t\tif (variant === 'eq') {\n\t\t\telement = 'div';\n\t\t} else if (variant === 'score') {\n\t\t\ticonProps['data-slds-state'] = scorePolarity || 'positive';\n\t\t} else if (variant === 'strength') {\n\t\t\ticonProps['data-slds-strength'] =\n\t\t\t\tstrengthLevel !== undefined ? `${strengthLevel}` : '0';\n\t\t} else if (variant === 'trend') {\n\t\t\ticonProps['data-slds-trend'] = trendDirection || 'neutral';\n\t\t}\n\t}\n\n\ticonProps.className = classNames(classes, className);\n\n\treturn React.createElement(element, iconProps, ...children);\n};\n\nDynamicIcon.displayName = DYNAMIC_ICON;\n\nexport default DynamicIcon;\n"],"mappings":"0TAgEA,IAAM,GAA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s"),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":oe,"aria-labelledby":se,"aria-owns":p,"aria-required":ce,assistiveText:le,autoComplete:ue,children:de,className:fe,defaultValue:pe,disabled:m=!1,errorText:h,fieldLevelHelpTooltip:g,fixedTextLeft:me,fixedTextRight:he,hasSpinner:ge=!1,iconLeft:_,iconRight:v,id:_e,inlineHelpText:y,inlineEditTrigger:ve,inputRef:b,isStatic:x=!1,label:S,maxLength:C,maxValue:w,minLength:T,minValue:E,name:D,onBlur:O,onChange:k,onClick:A,onFocus:j,onInput:M,onInvalid:N,onKeyDown:P,onKeyPress:F,onKeyUp:I,onSelect:L,onSubmit:ye,placeholder:R,readOnly:z=!1,required:B=!1,role:be,step:V,tabIndex:xe,styleContainer:Se,styleInput:Ce,type:we=`text`,value:H,variant:U=`base`},Te)=>{let Ee=(0,o.useId)(),De=(0,o.useId)(),Oe=(0,o.useId)(),W=_e||Ee,ke=h?De:void 0,Ae=y?Oe:void 0,je=[ie,Ae,ke].filter(e=>!!e).join(` `)||void 0,G=(0,o.useRef)(null),K=(0,o.useRef)({currentDelay:500,initialDelay:500,speedDelay:75,timeout:null}),q=(0,o.useRef)(null),Me=(0,o.useRef)(()=>{}),[,Ne]=(0,o.useReducer)(e=>e+1,0),J={...ne,...le};ee.default(t.INPUT,{"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-describedby":ie,"aria-expanded":ae,"aria-haspopup":oe,"aria-labelledby":se,"aria-owns":p,"aria-required":ce,assistiveText:J,autoComplete:ue,children:de,className:fe,defaultValue:pe,disabled:m,errorText:h,fieldLevelHelpTooltip:g,fixedTextLeft:me,fixedTextRight:he,hasSpinner:ge,iconLeft:_,iconRight:v,id:W,inlineHelpText:y,inlineEditTrigger:ve,inputRef:b,isStatic:x,label:S,maxLength:C,maxValue:w,minLength:T,minValue:E,name:D,onBlur:O,onChange:k,onClick:A,onFocus:j,onInput:M,onInvalid:N,onKeyDown:P,onKeyPress:F,onKeyUp:I,onSelect:L,onSubmit:ye,placeholder:R,readOnly:z,required:B,role:be,step:V,tabIndex:xe,styleContainer:Se,styleInput:Ce,type:we,value:H,variant:U},te.default);let Y=(0,o.useCallback)(()=>H===void 0?G.current?Number(G.current.value):0:Number(H),[H]),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=V===void 0?1:Number(V),i=Y(),a=!1;if(e===u&&w!==void 0&&i>w)i=Number(w),a=!0;else if(e===d&&E!==void 0&&i<E)i=Number(E),a=!0;else{let t=String(r).search(/\./)>=0?String(r).split(`.`)[1].length:0,n=0;E!==void 0&&(n=(i-E)%r),i=n>0?e===u?i-n:i+(r-n):e===u?i-r:i+r,i=Number(i.toFixed(t)),!(w!==void 0&&i>w)&&!(E!==void 0&&i<E)&&(a=!0)}a&&(H===void 0&&G.current&&(G.current.value=String(i),Ne()),k&&n&&k(n,{number:i,value:String(i)})),e===d&&w!==void 0&&i>=w||e===u&&E!==void 0&&i<=E?X():K.current.timeout=setTimeout(()=>{K.current.currentDelay=K.current.speedDelay,Me.current(e)},K.current.currentDelay)},[Y,w,E,k,V,X,H]);Me.current=Z;let Pe=(0,o.useCallback)(e=>{G.current=e,b&&b(e)},[b]),Fe=(0,o.useCallback)(e=>{if(k){let t={value:e.target.value};U===l&&(t.number=Number(t.value)),k(e,t)}},[k,U]),Ie=e=>{let t=Y(),r=!1;return(m||e===d&&w!==void 0&&t>=w||e===u&&E!==void 0&&t<=E)&&(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;_?Q=o.default.isValidElement(_)?o.default.cloneElement(_,{iconPosition:`left`}):_:U===l&&!x&&!z&&(Q=Ie(u)),v?$=o.default.isValidElement(v)?o.default.cloneElement(v,{iconPosition:`right`}):v:U===l&&!x&&!z&&($=Ie(d));let Le=S||J?.label,Re=U===l?Pe:b;return(0,c.jsxs)(`div`,{className:(0,s.default)(`slds-form-element`,{"slds-has-error":h},fe),style:Se,ref:Te,children:[(0,c.jsx)(i.default,{assistiveText:J,htmlFor:x?void 0:W,label:S,required:B,variant:x?`static`:`base`}),g&&Le?(0,c.jsx)(a.default,{assistiveText:{triggerLearnMoreIcon:J.fieldLevelHelpButton},fieldLevelHelpTooltip:g}):null,(0,c.jsx)(r.default,{"aria-activedescendant":e,"aria-autocomplete":f,"aria-controls":re,"aria-labelledby":se,"aria-describedby":je,"aria-expanded":ae,"aria-haspopup":oe,"aria-owns":p,"aria-required":ce,autoComplete:ue,className:(0,s.default)({"slds-input_counter":U===l,"slds-p-horizontal_none":U===l&&z}),containerProps:{className:`slds-form-element__control`},defaultValue:pe,disabled:m,fixedTextLeft:me,fixedTextRight:he,hasSpinner:ge,id:W,iconLeft:Q,iconRight:$,inlineEditTrigger:ve,isStatic:x,minLength:T,minValue:E,maxLength:C,maxValue:w,name:D,onBlur:O,onChange:Fe,onClick:A,onFocus:j,onInput:M,onInvalid:N,onKeyDown:P,onKeyPress:F,onKeyUp:I,onSelect:L,onSubmit:ye,placeholder:R,inputRef:Re,readOnly:z,required:B,role:be,assistiveText:J,type:U===l?`number`:we,value:H,variant:U,step:V,tabIndex:xe,style:Ce}),y&&(0,c.jsx)(`div`,{id:Ae,className:`slds-form-element__help`,children:y}),h&&(0,c.jsx)(`div`,{id:ke,className:`slds-form-element__help`,children:h}),de]})});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\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?: (event: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent, data: InputChangeData) => 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].filter((v): v is string => Boolean(v)).join(' ') ||\n\t\t\tundefined;\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\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(INPUT, {\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,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic,\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,\n\t\t\trequired,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\tvariant,\n\t\t}, componentDoc);\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(direction: typeof INCREMENT | typeof DECREMENT, event?: MouseEvent | KeyboardEvent) => {\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 (direction === DECREMENT && maxValue !== undefined && currentValue > maxValue) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (direction === INCREMENT && minValue !== undefined && currentValue < minValue) {\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 ? String(stepSize).split('.')[1].length : 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 = direction === DECREMENT ? currentValue - stepSize : 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}\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 && maxValue !== undefined && currentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT && minValue !== undefined && currentValue <= 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[getValueAsNumber, maxValue, minValue, onChange, step, stopStepping, value]\n\t\t);\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 = (direction: typeof INCREMENT | typeof DECREMENT) => {\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 && maxValue !== undefined && currentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT && minValue !== undefined && currentValue <= 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[direction.toLowerCase() as 'decrement' | 'increment'],\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(propIconLeft as React.ReactElement<{ iconPosition?: string }>, {\n\t\t\t\t\t\ticonPosition: 'left',\n\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(propIconRight as React.ReactElement<{ iconPosition?: string }>, {\n\t\t\t\t\t\ticonPosition: 'right',\n\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":"uiBA8BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YAwKZ,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,YAA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K,iBACC,kBACJ,cACR,KACM,WACC,YACQ,qBACT,WACC,YACD,WACC,YACD,WACJ,OACE,SACR,SAAU,GACD,UACA,UACA,UACE,YACA,YACC,aACH,WACC,YACA,YACG,eACb,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\tuseReducer,\n\tuseCallback,\n\tforwardRef,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype MouseEvent,\n\ttype FormEvent,\n\ttype CSSProperties,\n\ttype AriaAttributes,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport InnerInput from './private/inner-input';\nimport Label from '../utilities/label/index';\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport type { TooltipProps } from '../tooltip/index';\n\nimport checkProps from './check-props';\nimport { INPUT } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nconst COUNTER = 'counter';\nconst DECREMENT = 'Decrement';\nconst INCREMENT = 'Increment';\n\n/**\n * Input type options\n */\nexport type InputType =\n\t| 'text'\n\t| 'password'\n\t| 'datetime'\n\t| 'datetime-local'\n\t| 'date'\n\t| 'month'\n\t| 'time'\n\t| 'week'\n\t| 'number'\n\t| 'email'\n\t| 'url'\n\t| 'search'\n\t| 'tel'\n\t| 'color';\n\n/**\n * Input variant options\n */\nexport type InputVariant = 'base' | 'counter';\n\n/**\n * Assistive text for Input accessibility\n */\nexport interface InputAssistiveText {\n\t/** Visually hidden label for screen readers */\n\tlabel?: string;\n\t/** Text for loading spinner icon */\n\tspinner?: string;\n\t/** Text for decrement button in counter variant */\n\tdecrement?: string;\n\t/** Text for increment button in counter variant */\n\tincrement?: string;\n\t/** Text for field level help button */\n\tfieldLevelHelpButton?: string;\n}\n\n/**\n * Data passed to onChange callback\n */\nexport interface InputChangeData {\n\t/** The input value as string */\n\tvalue: string;\n\t/** The input value as number (only for counter variant) */\n\tnumber?: number;\n}\n\n/**\n * Props for the Input component\n */\nexport interface InputProps {\n\t/** ID of the currently active child in a composite widget */\n\t'aria-activedescendant'?: string;\n\t/** Indicates if suggestions complete the textbox input */\n\t'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';\n\t/** ID of element controlled by this input */\n\t'aria-controls'?: string;\n\t/** ID of element(s) that describe this input */\n\t'aria-describedby'?: string;\n\t/** Whether a collapsible region is expanded */\n\t'aria-expanded'?: boolean;\n\t/** Indicates the input has a popup */\n\t'aria-haspopup'?: AriaAttributes['aria-haspopup'];\n\t/** ID of element(s) that label this input */\n\t'aria-labelledby'?: string;\n\t/** ID of element(s) owned by this input */\n\t'aria-owns'?: string;\n\t/** Whether input is required */\n\t'aria-required'?: boolean;\n\t/** Assistive text for accessibility */\n\tassistiveText?: InputAssistiveText;\n\t/** Browser autocomplete attribute */\n\tautoComplete?: string;\n\t/** Elements added after the input */\n\tchildren?: ReactNode;\n\t/** CSS classes for the outer container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Initial value for uncontrolled usage */\n\tdefaultValue?: string | number;\n\t/** Disables the input */\n\tdisabled?: boolean;\n\t/** Error message (highlights input as error) */\n\terrorText?: ReactNode;\n\t/** Tooltip component for field-level help */\n\tfieldLevelHelpTooltip?: ReactElement<TooltipProps> | null;\n\t/** Fixed text/node on the left */\n\tfixedTextLeft?: ReactNode;\n\t/** Fixed text/node on the right */\n\tfixedTextRight?: ReactNode;\n\t/** Shows loading spinner inside input */\n\thasSpinner?: boolean;\n\t/** Left-aligned icon (InputIcon instance) */\n\ticonLeft?: ReactNode;\n\t/** Right-aligned icon (InputIcon instance) */\n\ticonRight?: ReactNode;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Help text below the input */\n\tinlineHelpText?: ReactNode;\n\t/** Inline edit trigger element */\n\tinlineEditTrigger?: ReactNode;\n\t/** Ref callback for the input element */\n\tinputRef?: (element: HTMLInputElement | null) => void;\n\t/** Displays value statically (static input pattern) */\n\tisStatic?: boolean;\n\t/** Label text above input */\n\tlabel?: string;\n\t/** Maximum character length */\n\tmaxLength?: string | number;\n\t/** Maximum value for counter variant */\n\tmaxValue?: number;\n\t/** Minimum character length */\n\tminLength?: string | number;\n\t/** Minimum value for counter variant */\n\tminValue?: number;\n\t/** Form parameter name */\n\tname?: string;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Change event handler */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement> | MouseEvent | KeyboardEvent,\n\t\tdata: InputChangeData\n\t) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLInputElement>) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLInputElement>) => void;\n\t/** Input event handler */\n\tonInput?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Invalid event handler */\n\tonInvalid?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n\t/** Select event handler */\n\tonSelect?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Submit event handler */\n\tonSubmit?: (event: FormEvent<HTMLInputElement>) => void;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Makes input read-only */\n\treadOnly?: boolean;\n\t/** Highlights as required field */\n\trequired?: boolean;\n\t/** ARIA role */\n\trole?: string;\n\t/** Step size for counter variant */\n\tstep?: number;\n\t/** Tab index */\n\ttabIndex?: string | number;\n\t/** Custom styles for container */\n\tstyleContainer?: CSSProperties;\n\t/** Custom styles for input element */\n\tstyleInput?: CSSProperties;\n\t/** Input type */\n\ttype?: InputType;\n\t/** Controlled value */\n\tvalue?: string | number;\n\t/** Input variant */\n\tvariant?: InputVariant;\n}\n\nconst defaultAssistiveText: InputAssistiveText = {\n\tdecrement: `${DECREMENT} ${COUNTER}`,\n\tincrement: `${INCREMENT} ${COUNTER}`,\n};\n\n/**\n * The HTML `input` with a label and error messaging.\n *\n * @see https://lightningdesignsystem.com/components/input/\n */\nconst Input = forwardRef<HTMLDivElement, InputProps>(\n\t(\n\t\t{\n\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t'aria-controls': ariaControls,\n\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t'aria-owns': ariaOwns,\n\t\t\t'aria-required': ariaRequired,\n\t\t\tassistiveText: propAssistiveText,\n\t\t\tautoComplete,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdefaultValue,\n\t\t\tdisabled = false,\n\t\t\terrorText,\n\t\t\tfieldLevelHelpTooltip,\n\t\t\tfixedTextLeft,\n\t\t\tfixedTextRight,\n\t\t\thasSpinner = false,\n\t\t\ticonLeft: propIconLeft,\n\t\t\ticonRight: propIconRight,\n\t\t\tid: propId,\n\t\t\tinlineHelpText,\n\t\t\tinlineEditTrigger,\n\t\t\tinputRef: propInputRef,\n\t\t\tisStatic = false,\n\t\t\tlabel,\n\t\t\tmaxLength,\n\t\t\tmaxValue,\n\t\t\tminLength,\n\t\t\tminValue,\n\t\t\tname,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonInput,\n\t\t\tonInvalid,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonSelect,\n\t\t\tonSubmit,\n\t\t\tplaceholder,\n\t\t\treadOnly = false,\n\t\t\trequired = false,\n\t\t\trole,\n\t\t\tstep,\n\t\t\ttabIndex,\n\t\t\tstyleContainer,\n\t\t\tstyleInput,\n\t\t\ttype = 'text',\n\t\t\tvalue,\n\t\t\tvariant = 'base',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst generatedErrorId = useId();\n\t\tconst generatedInlineHelpId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst errorId = errorText ? generatedErrorId : undefined;\n\t\tconst inlineHelpId = inlineHelpText ? generatedInlineHelpId : undefined;\n\t\tconst describedby =\n\t\t\t[ariaDescribedby, inlineHelpId, errorId]\n\t\t\t\t.filter((v): v is string => Boolean(v))\n\t\t\t\t.join(' ') || undefined;\n\n\t\tconst inputElementRef = useRef<HTMLInputElement | null>(null);\n\t\tconst steppingRef = useRef({\n\t\t\tcurrentDelay: 500,\n\t\t\tinitialDelay: 500,\n\t\t\tspeedDelay: 75,\n\t\t\ttimeout: null as ReturnType<typeof setTimeout> | null,\n\t\t});\n\t\tconst lastStepEventRef = useRef<MouseEvent | KeyboardEvent | null>(null);\n\t\t// Latest `performStep`, so the repeat timer of a held counter button\n\t\t// reads current props (such as a controlled `value`) on every step.\n\t\tconst performStepRef = useRef<\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => void\n\t\t>(() => {});\n\t\t// Re-renders after an uncontrolled step, so the counter buttons' disabled\n\t\t// state reflects the value written directly to the input element.\n\t\tconst [, forceRender] = useReducer((count: number) => count + 1, 0);\n\n\t\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t\t// Check props in development\n\t\tcheckProps(\n\t\t\tINPUT,\n\t\t\t{\n\t\t\t\t'aria-activedescendant': ariaActivedescendant,\n\t\t\t\t'aria-autocomplete': ariaAutocomplete,\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-describedby': ariaDescribedby,\n\t\t\t\t'aria-expanded': ariaExpanded,\n\t\t\t\t'aria-haspopup': ariaHaspopup,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t\t'aria-owns': ariaOwns,\n\t\t\t\t'aria-required': ariaRequired,\n\t\t\t\tassistiveText,\n\t\t\t\tautoComplete,\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tfieldLevelHelpTooltip,\n\t\t\t\tfixedTextLeft,\n\t\t\t\tfixedTextRight,\n\t\t\t\thasSpinner,\n\t\t\t\ticonLeft: propIconLeft,\n\t\t\t\ticonRight: propIconRight,\n\t\t\t\tid,\n\t\t\t\tinlineHelpText,\n\t\t\t\tinlineEditTrigger,\n\t\t\t\tinputRef: propInputRef,\n\t\t\t\tisStatic,\n\t\t\t\tlabel,\n\t\t\t\tmaxLength,\n\t\t\t\tmaxValue,\n\t\t\t\tminLength,\n\t\t\t\tminValue,\n\t\t\t\tname,\n\t\t\t\tonBlur,\n\t\t\t\tonChange,\n\t\t\t\tonClick,\n\t\t\t\tonFocus,\n\t\t\t\tonInput,\n\t\t\t\tonInvalid,\n\t\t\t\tonKeyDown,\n\t\t\t\tonKeyPress,\n\t\t\t\tonKeyUp,\n\t\t\t\tonSelect,\n\t\t\t\tonSubmit,\n\t\t\t\tplaceholder,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\trole,\n\t\t\t\tstep,\n\t\t\t\ttabIndex,\n\t\t\t\tstyleContainer,\n\t\t\t\tstyleInput,\n\t\t\t\ttype,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\n\t\tconst getValueAsNumber = useCallback((): number => {\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn Number(value);\n\t\t\t}\n\t\t\tif (inputElementRef.current) {\n\t\t\t\treturn Number(inputElementRef.current.value);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}, [value]);\n\n\t\tconst stopStepping = useCallback(() => {\n\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t}\n\t\t\tsteppingRef.current.currentDelay = steppingRef.current.initialDelay;\n\t\t\tlastStepEventRef.current = null;\n\t\t}, []);\n\n\t\tconst performStep = useCallback(\n\t\t\t(\n\t\t\t\tdirection: typeof INCREMENT | typeof DECREMENT,\n\t\t\t\tevent?: MouseEvent | KeyboardEvent\n\t\t\t) => {\n\t\t\t\tif (steppingRef.current.timeout) {\n\t\t\t\t\tclearTimeout(steppingRef.current.timeout);\n\t\t\t\t}\n\n\t\t\t\tif (event) {\n\t\t\t\t\tlastStepEventRef.current = event;\n\t\t\t\t}\n\t\t\t\tconst stepEvent = event ?? lastStepEventRef.current ?? undefined;\n\n\t\t\t\tconst stepSize = step !== undefined ? Number(step) : 1;\n\t\t\t\tlet currentValue = getValueAsNumber();\n\t\t\t\tlet valueChanged = false;\n\n\t\t\t\tif (\n\t\t\t\t\tdirection === DECREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue > maxValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(maxValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else if (\n\t\t\t\t\tdirection === INCREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue < minValue\n\t\t\t\t) {\n\t\t\t\t\tcurrentValue = Number(minValue);\n\t\t\t\t\tvalueChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst decimalPlaces =\n\t\t\t\t\t\tString(stepSize).search(/\\./) >= 0\n\t\t\t\t\t\t\t? String(stepSize).split('.')[1].length\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tlet minOverflow = 0;\n\n\t\t\t\t\tif (minValue !== undefined) {\n\t\t\t\t\t\tminOverflow = (currentValue - minValue) % stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (minOverflow > 0) {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - minOverflow\n\t\t\t\t\t\t\t\t: currentValue + (stepSize - minOverflow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentValue =\n\t\t\t\t\t\t\tdirection === DECREMENT\n\t\t\t\t\t\t\t\t? currentValue - stepSize\n\t\t\t\t\t\t\t\t: currentValue + stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentValue = Number(currentValue.toFixed(decimalPlaces));\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(maxValue !== undefined && currentValue > maxValue) &&\n\t\t\t\t\t\t!(minValue !== undefined && currentValue < minValue)\n\t\t\t\t\t) {\n\t\t\t\t\t\tvalueChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (valueChanged) {\n\t\t\t\t\tif (value === undefined && inputElementRef.current) {\n\t\t\t\t\t\t// Uncontrolled mode\n\t\t\t\t\t\tinputElementRef.current.value = String(currentValue);\n\t\t\t\t\t\tforceRender();\n\t\t\t\t\t}\n\t\t\t\t\tif (onChange && stepEvent) {\n\t\t\t\t\t\tonChange(stepEvent, {\n\t\t\t\t\t\t\tnumber: currentValue,\n\t\t\t\t\t\t\tvalue: String(currentValue),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t\t) {\n\t\t\t\t\tstopStepping();\n\t\t\t\t} else {\n\t\t\t\t\tsteppingRef.current.timeout = setTimeout(() => {\n\t\t\t\t\t\tsteppingRef.current.currentDelay = steppingRef.current.speedDelay;\n\t\t\t\t\t\tperformStepRef.current(direction);\n\t\t\t\t\t}, steppingRef.current.currentDelay);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetValueAsNumber,\n\t\t\t\tmaxValue,\n\t\t\t\tminValue,\n\t\t\t\tonChange,\n\t\t\t\tstep,\n\t\t\t\tstopStepping,\n\t\t\t\tvalue,\n\t\t\t]\n\t\t);\n\t\tperformStepRef.current = performStep;\n\n\t\tconst setInputRef = useCallback(\n\t\t\t(element: HTMLInputElement | null) => {\n\t\t\t\tinputElementRef.current = element;\n\t\t\t\tif (propInputRef) {\n\t\t\t\t\tpropInputRef(element);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[propInputRef]\n\t\t);\n\n\t\tconst handleChange = useCallback(\n\t\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tconst data: InputChangeData = {\n\t\t\t\t\t\tvalue: event.target.value,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (variant === COUNTER) {\n\t\t\t\t\t\tdata.number = Number(data.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tonChange(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onChange, variant]\n\t\t);\n\n\t\tconst getCounterButtonIcon = (\n\t\t\tdirection: typeof INCREMENT | typeof DECREMENT\n\t\t) => {\n\t\t\tconst currentValue = getValueAsNumber();\n\t\t\tlet isDisabled = false;\n\n\t\t\tif (\n\t\t\t\tdisabled ||\n\t\t\t\t(direction === INCREMENT &&\n\t\t\t\t\tmaxValue !== undefined &&\n\t\t\t\t\tcurrentValue >= maxValue) ||\n\t\t\t\t(direction === DECREMENT &&\n\t\t\t\t\tminValue !== undefined &&\n\t\t\t\t\tcurrentValue <= minValue)\n\t\t\t) {\n\t\t\t\tisDisabled = true;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveText[\n\t\t\t\t\t\t\tdirection.toLowerCase() as 'decrement' | 'increment'\n\t\t\t\t\t\t],\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-button_icon-small',\n\t\t\t\t\t\t`slds-input__button_${direction.toLowerCase()}`\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName={direction === DECREMENT ? 'ban' : 'new'}\n\t\t\t\t\tonKeyDown={(event: KeyboardEvent) => {\n\t\t\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyUp={stopStepping}\n\t\t\t\t\tonMouseDown={(event: MouseEvent) => {\n\t\t\t\t\t\tperformStep(direction, event);\n\t\t\t\t\t}}\n\t\t\t\t\tonMouseLeave={stopStepping}\n\t\t\t\t\tonMouseUp={stopStepping}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\t// Compute icon rendering\n\t\tlet iconLeft: ReactNode = null;\n\t\tlet iconRight: ReactNode = null;\n\n\t\tif (propIconLeft) {\n\t\t\ticonLeft = React.isValidElement(propIconLeft)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconLeft as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'left',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconLeft;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonLeft = getCounterButtonIcon(DECREMENT);\n\t\t}\n\n\t\tif (propIconRight) {\n\t\t\ticonRight = React.isValidElement(propIconRight)\n\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\tpropIconRight as React.ReactElement<{ iconPosition?: string }>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticonPosition: 'right',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t: propIconRight;\n\t\t} else if (variant === COUNTER && !isStatic && !readOnly) {\n\t\t\ticonRight = getCounterButtonIcon(INCREMENT);\n\t\t}\n\n\t\tconst hasRenderedLabel = label || assistiveText?.label;\n\t\tconst inputRefToUse = variant === COUNTER ? setInputRef : propInputRef;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-form-element',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t},\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tstyle={styleContainer}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thtmlFor={isStatic ? undefined : id}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tvariant={isStatic ? 'static' : 'base'}\n\t\t\t\t/>\n\t\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\ttriggerLearnMoreIcon: assistiveText.fieldLevelHelpButton,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<InnerInput\n\t\t\t\t\taria-activedescendant={ariaActivedescendant}\n\t\t\t\t\taria-autocomplete={ariaAutocomplete}\n\t\t\t\t\taria-controls={ariaControls}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={describedby}\n\t\t\t\t\taria-expanded={ariaExpanded}\n\t\t\t\t\taria-haspopup={ariaHaspopup}\n\t\t\t\t\taria-owns={ariaOwns}\n\t\t\t\t\taria-required={ariaRequired}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-input_counter': variant === COUNTER,\n\t\t\t\t\t\t'slds-p-horizontal_none': variant === COUNTER && readOnly,\n\t\t\t\t\t})}\n\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\tclassName: 'slds-form-element__control',\n\t\t\t\t\t}}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tfixedTextLeft={fixedTextLeft}\n\t\t\t\t\tfixedTextRight={fixedTextRight}\n\t\t\t\t\thasSpinner={hasSpinner}\n\t\t\t\t\tid={id}\n\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\ticonRight={iconRight}\n\t\t\t\t\tinlineEditTrigger={inlineEditTrigger}\n\t\t\t\t\tisStatic={isStatic}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tminValue={minValue}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tmaxValue={maxValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonInput={onInput}\n\t\t\t\t\tonInvalid={onInvalid}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tinputRef={inputRefToUse}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\trequired={required}\n\t\t\t\t\trole={role}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\ttype={variant === COUNTER ? 'number' : type}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\tstyle={styleInput}\n\t\t\t\t/>\n\t\t\t\t{inlineHelpText && (\n\t\t\t\t\t<div id={inlineHelpId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{inlineHelpText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nInput.displayName = INPUT;\n\nexport default Input;\n"],"mappings":"uiBA+BA,IAAM,EAAU,UACV,EAAY,YACZ,EAAY,YA2KZ,GAA2C,CAChD,UAAW,GAAG,EAAU,GAAG,IAC3B,UAAW,GAAG,EAAU,GAAG,GAC5B,EAOM,GAAA,EAAQ,EAAA,WAAA,EAEZ,CACC,wBAAyB,EACzB,oBAAqB,EACrB,gBAAiB,GACjB,mBAAoB,GACpB,gBAAiB,GACjB,gBAAiB,GACjB,kBAAmB,GACnB,YAAa,EACb,gBAAiB,GACjB,cAAe,GACf,gBACA,YACA,aACA,gBACA,WAAW,GACX,YACA,wBACA,iBACA,kBACA,cAAa,GACb,SAAU,EACV,UAAW,EACX,GAAI,GACJ,iBACA,qBACA,SAAU,EACV,WAAW,GACX,QACA,YACA,WACA,YACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,aACA,UACA,WACA,YACA,cACA,WAAW,GACX,WAAW,GACX,QACA,OACA,YACA,kBACA,cACA,QAAO,OACP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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,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/one-of-required-property.cjs"),r=require("../../utilities/warning/deprecated-property.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a,o){let s=t.default(o);e.default(i,a.forceOpen,`forceOpen`,`Please use \`isOpen\` instead. It provides a consistent prop that aligns with other componenents. ${s(`isOpen`)}`),e.default(i,a.tooltip,`tooltip`,s()),r.default(i,a.offset,`offset`,void 0,`The manual setting of positional offset of dialog components has been deemed unreliable. Position logic has been re-written to deliver better and more reliable positioning. Please create an issue if you have an edge case not covered by the built-in logic. ${s()}`),n.default(i,{options:a.options,children:a.children},s()),r.default(i,a.isInline,`isInline`,`menuPosition="relative"`,s(`menuPosition`))});var a=i;exports.default=a;
|
|
1
|
+
const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/one-of-required-property.cjs"),r=require("../../utilities/warning/deprecated-property.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a,o){let s=t.default(o);e.default(i,a.forceOpen,`forceOpen`,`Please use \`isOpen\` instead. It provides a consistent prop that aligns with other componenents. ${s(`isOpen`)}`),e.default(i,a.tooltip,`tooltip`,s()),r.default(i,a.offset,`offset`,void 0,`The manual setting of positional offset of dialog components has been deemed unreliable. Position logic has been re-written to deliver better and more reliable positioning. Please create an issue if you have an edge case not covered by the built-in logic. ${s()}`),n.default(i,{options:a.options,children:a.children},s()),r.default(i,a.listItemRenderer,`listItemRenderer`,`renderMenuItem`,`\`renderMenuItem\` is a function called with \`{ icon, isSelected, option, optionIndex }\`, not a component. ${s(`renderMenuItem`)}`),r.default(i,a.isInline,`isInline`,`menuPosition="relative"`,s(`menuPosition`))});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/menu-dropdown/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.forceOpen,\n\t\t\t'forceOpen',\n\t\t\t`Please use \\`isOpen\\` instead. It provides a consistent prop that aligns with other componenents. ${createDocUrl(\n\t\t\t\t'isOpen'\n\t\t\t)}`\n\t\t);\n\n\t\tsunsetProperty(COMPONENT, props.tooltip, 'tooltip', createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.offset,\n\t\t\t'offset',\n\t\t\tundefined,\n\t\t\t`The manual setting of positional offset of dialog components has been deemed unreliable. Position logic has been re-written to deliver better and more reliable positioning. Please create an issue if you have an edge case not covered by the built-in logic. ${createDocUrl()}`\n\t\t);\n\n\t\toneOfRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\toptions: props.options,\n\t\t\t\tchildren: props.children,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'menuPosition=\"relative\"',\n\t\t\tcreateDocUrl('menuPosition')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"iPASA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,UACN,YACA,qGAAqG,EACpG,QACD,GACD,EAEA,EAAA,QAAe,EAAW,EAAM,QAAS,UAAW,EAAa,CAAC,EAElE,EAAA,QACC,EACA,EAAM,OACN,SACA,IAAA,GACA,mQAAmQ,EAAa,GACjR,EAEA,EAAA,QACC,EACA,CACC,QAAS,EAAM,QACf,SAAU,EAAM,QACjB,EACA,EAAa,CACd,EAEA,EAAA,QACC,EACA,EAAM,SACN,WACA,0BACA,EAAa,cAAc,CAC5B,CACD,GAGD,IAAA,EAAe"}
|
|
1
|
+
{"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/menu-dropdown/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.forceOpen,\n\t\t\t'forceOpen',\n\t\t\t`Please use \\`isOpen\\` instead. It provides a consistent prop that aligns with other componenents. ${createDocUrl(\n\t\t\t\t'isOpen'\n\t\t\t)}`\n\t\t);\n\n\t\tsunsetProperty(COMPONENT, props.tooltip, 'tooltip', createDocUrl());\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.offset,\n\t\t\t'offset',\n\t\t\tundefined,\n\t\t\t`The manual setting of positional offset of dialog components has been deemed unreliable. Position logic has been re-written to deliver better and more reliable positioning. Please create an issue if you have an edge case not covered by the built-in logic. ${createDocUrl()}`\n\t\t);\n\n\t\toneOfRequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\toptions: props.options,\n\t\t\t\tchildren: props.children,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.listItemRenderer,\n\t\t\t'listItemRenderer',\n\t\t\t'renderMenuItem',\n\t\t\t`\\`renderMenuItem\\` is a function called with \\`{ icon, isSelected, option, optionIndex }\\`, not a component. ${createDocUrl('renderMenuItem')}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'menuPosition=\"relative\"',\n\t\t\tcreateDocUrl('menuPosition')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"iPASA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,UACN,YACA,qGAAqG,EACpG,QACD,GACD,EAEA,EAAA,QAAe,EAAW,EAAM,QAAS,UAAW,EAAa,CAAC,EAElE,EAAA,QACC,EACA,EAAM,OACN,SACA,IAAA,GACA,mQAAmQ,EAAa,GACjR,EAEA,EAAA,QACC,EACA,CACC,QAAS,EAAM,QACf,SAAU,EAAM,QACjB,EACA,EAAa,CACd,EAEA,EAAA,QACC,EACA,EAAM,iBACN,mBACA,iBACA,gHAAgH,EAAa,gBAAgB,GAC9I,EACA,EAAA,QACC,EACA,EAAM,SACN,WACA,0BACA,EAAa,cAAc,CAC5B,CACD,GAGD,IAAA,EAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/menu-dropdown/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// MenuDropdown is now a React 19 compatible functional component\n// that handles click outside detection internally without react-onclickoutside\n\nimport MenuDropdown from './menu-dropdown';\n\nexport default MenuDropdown;\nexport type {\n\tMenuDropdownProps,\n\tMenuDropdownOption,\n\tMenuDropdownItemOption,\n\tMenuDropdownHeaderOption,\n\tMenuDropdownDividerOption,\n\tMenuDropdownOptionIcon,\n\tDropdownNubbinPosition,\n\tMenuDropdownSelectData,\n\tMenuDropdownOpenData,\n\tMenuDropdownOpenEvent,\n\tMenuDropdownCloseData,\n\tMenuDropdownCloseEvent,\n} from './menu-dropdown';\nexport {\n\tDropdownNubbinPositions,\n\tListItem,\n\tListItemLabel,\n} from './menu-dropdown';\n"],"mappings":"sOAQA,IAAA,EAAe,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../components/menu-dropdown/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// MenuDropdown is now a React 19 compatible functional component\n// that handles click outside detection internally without react-onclickoutside\n\nimport MenuDropdown from './menu-dropdown';\n\nexport default MenuDropdown;\nexport type {\n\tMenuDropdownProps,\n\tMenuDropdownOption,\n\tMenuDropdownItemOption,\n\tMenuDropdownHeaderOption,\n\tMenuDropdownDividerOption,\n\tMenuDropdownOptionIcon,\n\tDropdownNubbinPosition,\n\tMenuDropdownRenderMenuItemData,\n\tMenuDropdownSelectData,\n\tMenuDropdownOpenData,\n\tMenuDropdownOpenEvent,\n\tMenuDropdownCloseData,\n\tMenuDropdownCloseEvent,\n} from './menu-dropdown';\nexport {\n\tDropdownNubbinPositions,\n\tListItem,\n\tListItemLabel,\n} from './menu-dropdown';\n"],"mappings":"sOAQA,IAAA,EAAe,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/event.cjs"),i=require("../../utilities/generate-id.cjs"),a=require("../../utilities/key-code.cjs"),o=require("../utilities/dialog/index.cjs"),s=require("../utilities/menu-list/item-label.cjs"),c=require("../utilities/menu-list/item.cjs"),l=require("../utilities/menu-list/index.cjs"),ee=require("./button-trigger.cjs"),te=require("./check-props.cjs"),ne=require("./component.cjs"),re=require("../../utilities/keyboard-navigate.cjs"),ie=require("../../utilities/key-buffer.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime"),p=require("lodash.isfunction");p=e.__toESM(p,1);var ae=l.default,m=typeof document<`u`,h=m?document.createElement(`span`):{style:{}};m&&(h.style.top=`0`,h.style.left=`0`,h.style.width=`100%`,h.style.height=`100%`,h.style.position=`absolute`);var g,oe=[`top left`,`top`,`top right`,`bottom left`,`bottom`,`bottom right`],se=()=>{},ce=e=>e.type!==`header`&&e.type!==`divider`&&!e.disabled,le=e=>{let t=[];return t.indexes=[],t.keyBuffer=new ie.default,Array.isArray(e)&&e.forEach((e,n)=>{ce(e)&&(t.push({index:n,text:`${e.label}`.toLowerCase()}),t.indexes.push(n))}),t},ue={top:`bottom`,"top left":`bottom left`,"top right":`bottom right`,bottom:`top`,"bottom left":`top left`,"bottom right":`top right`},_=e=>{let{align:c=`left`,assistiveText:l,buttonClassName:ie,buttonInverse:oe,buttonVariant:ce,checkmark:_,children:de,className:fe,containerClassName:pe,disabled:me,hasStaticAlignment:he,hint:ge,hoverCloseDelay:_e=300,iconCategory:ve,iconName:ye,iconPosition:be,iconSize:xe,iconVariant:v,id:Se,inheritTargetWidth:Ce,inverse:we=!1,isInline:Te,isOpen:y,label:Ee,length:De=`5`,listItemRenderer:Oe,menuPosition:ke=`absolute`,menuStyle:Ae,multiple:
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/event.cjs"),i=require("../../utilities/generate-id.cjs"),a=require("../../utilities/key-code.cjs"),o=require("../utilities/dialog/index.cjs"),s=require("../utilities/menu-list/item-label.cjs"),c=require("../utilities/menu-list/item.cjs"),l=require("../utilities/menu-list/index.cjs"),ee=require("./button-trigger.cjs"),te=require("./check-props.cjs"),ne=require("./component.cjs"),re=require("../../utilities/keyboard-navigate.cjs"),ie=require("../../utilities/key-buffer.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime"),p=require("lodash.isfunction");p=e.__toESM(p,1);var ae=l.default,m=typeof document<`u`,h=m?document.createElement(`span`):{style:{}};m&&(h.style.top=`0`,h.style.left=`0`,h.style.width=`100%`,h.style.height=`100%`,h.style.position=`absolute`);var g,oe=[`top left`,`top`,`top right`,`bottom left`,`bottom`,`bottom right`],se=()=>{},ce=e=>e.type!==`header`&&e.type!==`divider`&&!e.disabled,le=e=>{let t=[];return t.indexes=[],t.keyBuffer=new ie.default,Array.isArray(e)&&e.forEach((e,n)=>{ce(e)&&(t.push({index:n,text:`${e.label}`.toLowerCase()}),t.indexes.push(n))}),t},ue={top:`bottom`,"top left":`bottom left`,"top right":`bottom right`,bottom:`top`,"bottom left":`top left`,"bottom right":`top right`},_=e=>{let{align:c=`left`,assistiveText:l,buttonClassName:ie,buttonInverse:oe,buttonVariant:ce,checkmark:_,children:de,className:fe,containerClassName:pe,disabled:me,hasStaticAlignment:he,hint:ge,hoverCloseDelay:_e=300,iconCategory:ve,iconName:ye,iconPosition:be,iconSize:xe,iconVariant:v,id:Se,inheritTargetWidth:Ce,inverse:we=!1,isInline:Te,isOpen:y,label:Ee,length:De=`5`,listItemRenderer:Oe,renderMenuItem:b,menuPosition:ke=`absolute`,menuStyle:Ae,multiple:x,nubbinPosition:S,offset:je,onBlur:Me,onClick:C,onClose:Ne,onFocus:Pe,onKeyDown:Fe,onMouseDown:Ie,onMouseEnter:Le,onMouseLeave:Re,onOpen:ze,onSelect:w,openOn:T=`click`,options:E,overlay:D,requestFocus:Be,onRequestFocus:O,style:Ve,tabIndex:He,tooltip:Ue,tooltipMenuItem:We,triggerClassName:Ge,value:k,width:Ke=`medium`}=e,qe=(0,u.useContext)(n.IconSettingsContext),Je=(0,u.useMemo)(()=>i.default(),[]),A=(0,u.useCallback)(()=>Se||Je,[Se,Je]),[Ye,Xe]=(0,u.useState)(!1),[j,Ze]=(0,u.useState)(-1),[Qe,$e]=(0,u.useState)(-1),[M,N]=(0,u.useState)([]),[P,et]=(0,u.useState)(!1),F=(0,u.useRef)(null),tt=(0,u.useRef)(null),nt=(0,u.useRef)(null),I=(0,u.useRef)({}),L=(0,u.useRef)(!1),rt=(0,u.useRef)(!1),R=(0,u.useRef)(null),z=(0,u.useRef)(null),it=(0,u.useMemo)(()=>le(E),[E]);(0,u.useEffect)(()=>{te.default(t.MENU_DROPDOWN,e,ne.default)},[e]);let B=(0,u.useCallback)(()=>!!(typeof y==`boolean`?y:Ye),[y,Ye]),V=!me&&B()&&P,H=(0,u.useCallback)((e,t)=>{let n=-1;return t&&t.length&&t.some((t,r)=>t&&t.value===e?(n=r,!0):!1),n},[]);(0,u.useEffect)(()=>{if(x){let e=[];Array.isArray(k)?e=k:k!==void 0&&(e=[k]),e=e.filter(e=>H(e,E)!==-1);let t=e.map(e=>H(e,E));N(t)}else $e(H(k,E))},[k,E,x,H]);let at=Te?`relative`:ke,ot=(0,u.useCallback)(e=>{if(e!==void 0)return`${A()}-item-${e}`},[A]),st=(0,u.useCallback)(()=>Oe||s.default,[Oe]),ct=(0,u.useMemo)(()=>b?({data:e,icon:t,index:n,isSelected:r})=>b({icon:t,isSelected:!!r,option:e,optionIndex:n??0}):void 0,[b]),U=(0,u.useCallback)(()=>{!L.current&&!rt.current&&F.current&&F.current.focus()},[]),lt=(0,u.useCallback)(()=>nt.current,[]),ut=(0,u.useCallback)(e=>e!==void 0&&I.current&&I.current[e]||null,[]),dt=(0,u.useRef)(()=>{}),W=(0,u.useRef)({handleClose:e=>dt.current(e)}),ft=(0,u.useRef)(!1),G=(0,u.useCallback)(e=>{B()&&(g===W.current&&(g=void 0),Xe(!1),L.current=!1,ft.current=!0,Ne?.(e,{}))},[B,Ne]),pt=(0,u.useCallback)((e,t)=>{t?.componentWillUnmount&&!ft.current&&G(e)},[G]);dt.current=G;let K=(0,u.useCallback)(e=>{B()||(g&&(0,p.default)(g.handleClose)&&g.handleClose(e),g=W.current,Xe(!0),ze?.(e,{}))},[B,G,ze]),q=(0,u.useCallback)(e=>{let t=e.target,n=tt.current;if(n&&!n.contains(t)){let n=`ignore-click-${A()}`;if(t instanceof Element&&(t.classList?.contains(n)||t.closest(`.${n}`)||t.closest(`.ignore-react-onclickoutside`)))return;G(e)}},[A,G]);(0,u.useEffect)(()=>(V&&(document.addEventListener(`mousedown`,q),document.addEventListener(`touchstart`,q)),()=>{document.removeEventListener(`mousedown`,q),document.removeEventListener(`touchstart`,q)}),[V,q]);let mt=(0,u.useCallback)(e=>{U(),B()?G(e):K(e)},[B,G,K,U]),ht=(0,u.useCallback)(e=>{B()?G(e):(K(e),U()),C?.(e)},[B,K,G,U,C]),gt=(0,u.useCallback)(e=>{Pe?.(e)},[Pe]),_t=(0,u.useCallback)(e=>{L.current=!0,!B()&&T===`hover`?K(e):R.current&&clearTimeout(R.current),Le?.(e)},[B,T,K,Le]),vt=(0,u.useCallback)(e=>{B()&&(R.current=setTimeout(()=>{G()},_e)),Re?.(e)},[B,_e,G,Re]),J=(0,u.useCallback)((e,t)=>{if(x?M.indexOf(e)===-1?N(t=>[...t,e]):N(t=>t.filter(t=>t!==e)):($e(e),G(t),U()),w&&E){let n=E[e];w(t,{option:n,optionIndex:e})}},[x,M,G,U,w,E]),yt=(0,u.useCallback)(e=>{let t=e.getElementsByTagName(`a`)[0];t&&t.focus()},[]),bt=(0,u.useCallback)((e,t)=>{if(e&&t){let n=e.offsetHeight,r=e.scrollTop,i=t.offsetTop-e.offsetTop;if(i<r)e.scrollTop=i;else{let a=r+n+e.offsetTop,o=i+t.offsetHeight+e.offsetTop;o>a&&(e.scrollTop=o-n-e.offsetTop)}}},[]),Y=(0,u.useCallback)(e=>{j!==e&&e!==void 0&&Ze(e);let t=lt(),n=ut(e??-1);n&&(yt(n),bt(t,n))},[j,lt,ut,yt,bt]),xt=(0,u.useMemo)(()=>({trigger:F.current,handleClick:e=>{ht(e)}}),[ht]),St=(0,u.useCallback)(({event:e,isOpen:t=!0,keyCode:n,onFocus:r=Y,onSelect:i,target:a,toggleOpen:o=se})=>{re.default({componentContext:xt,currentFocusedIndex:j,event:e,isOpen:t,key:e.key,keyCode:n,navigableItems:it,onFocus:r,onSelect:i,target:a,toggleOpen:o})},[xt,j,Y,it]),X=(0,u.useCallback)(e=>{U(),G(e)},[U,G]),Ct=(0,u.useCallback)(e=>{e.keyCode&&(e.keyCode===a.default.TAB?X(e):(e.keyCode===a.default.ENTER||e.keyCode===a.default.SPACE||e.keyCode===a.default.DOWN||e.keyCode===a.default.UP||e.keyCode===a.default.ESCAPE)&&(r.default.trap(e),St({event:e,isOpen:B(),keyCode:e.keyCode,onSelect:t=>J(t,e),target:e.target,toggleOpen:()=>mt(e)})),Fe?.(e))},[X,St,B,J,mt,Fe]),wt=(0,u.useCallback)(e=>{U(),G(e)},[U,G]),Tt=(0,u.useCallback)(e=>{F.current=e,!P&&e&&et(!0),e&&Be&&O&&O(e)},[P,Be,O]),Et=(0,u.useCallback)(e=>{tt.current=e,F.current||=e?.querySelector(`button`)||null},[]),Dt=(0,u.useCallback)(e=>{nt.current=e},[]),Ot=(0,u.useCallback)((e,t)=>{I.current[t]=e,t===j&&e&&Y(j)},[j,Y]),Z=(0,u.useCallback)(e=>{(0,p.default)(D)&&m?D(e,h):D&&e&&!z.current&&m?(z.current=h,document.querySelector(`body`)?.appendChild(h)):!e&&z.current?.parentNode&&(z.current.parentNode.removeChild(z.current),z.current=null)},[D]);(0,u.useEffect)(()=>{Z(V)},[V,Z]),(0,u.useEffect)(()=>{V&&(ft.current=!1)},[V]),(0,u.useEffect)(()=>()=>{rt.current=!0,g===W.current&&(g=void 0),Z(!1),R.current&&clearTimeout(R.current)},[Z]);let Q=(0,u.useCallback)(e=>(0,f.jsx)(ae,{checkmark:_,getListItemId:ot,itemRefs:Ot,itemRenderer:st(),renderItemLabel:ct,onCancel:X,onSelect:J,options:E,ref:Dt,selectedIndex:x?void 0:Qe,selectedIndices:x?M:void 0,tooltipMenuItem:We,triggerId:A(),length:De,...e},`${A()}-dropdown-list`),[A,_,ot,Ot,st,ct,X,J,E,Dt,x,Qe,M,We,De]),kt=(0,u.useCallback)(e=>{let t=[];return e&&u.default.Children.forEach(e,e=>{if(e&&typeof e==`object`&&`type`in e&&e.type?.displayName===`SLDSList`)t.push(Q(e.props));else if(e){let n=u.default.cloneElement(e,{onClick:wt,key:i.default()});t.push(n)}}),t.length>0?t:Q()},[Q,wt]),At=(0,u.useCallback)((e,t,n)=>{let r=`bottom`,i=!1,a=``;S?(i=!0,r=ue[S]):c&&(r=c===`center`?`bottom`:`bottom ${c}`);let s=ue[r]?.split(` `)||[];a=(0,d.default)(s.map(e=>`slds-dropdown_${e}`));let l={};return c===`center`&&!i&&(l.transform=`none`),t?(0,f.jsx)(o.default,{align:r,className:(0,d.default)(pe),closeOnTabKey:!0,contentsClassName:(0,d.default)(`slds-dropdown`,`slds-dropdown_${Ke}`,`slds-text-align_left`,`ignore-react-onclickoutside`,fe,a,{"slds-dropdown_inverse":we}),context:qe,hasNubbin:i,hasStaticAlignment:he,inheritWidthOf:Ce?`target`:`none`,offset:je,onClose:pt,onKeyDown:Ct,outsideClickIgnoreClass:n,position:at,style:{...l,...Ae},onRequestTargetElement:()=>F.current,children:kt(e)}):null},[S,c,pe,fe,we,qe,he,Ce,je,pt,Ct,at,Ae,Ke,kt]),jt=ee.default,Mt={},$=[];u.default.Children.forEach(de,e=>{e&&typeof e==`object`&&`type`in e&&e.type?.displayName===`SLDSMenuDropdownTrigger`?(Mt=e.props,jt=e.type):e&&$.push(e)});let Nt=`ignore-click-${A()}`,Pt=v===`bare-inverse`||v===`border-inverse`,Ft=v===`bare-inverse`?`bare`:v===`border-inverse`?`border`:v;return(0,f.jsx)(jt,{ref:Et,"aria-haspopup":!0,assistiveText:l,className:(0,d.default)(Nt,ie),disabled:me,hint:ge,iconCategory:ve,iconName:ye,iconPosition:be,iconSize:xe,iconVariant:Ft,id:A(),inverse:oe||Pt,isOpen:V,label:Ee,menu:At($.length>0?$:null,V,Nt),onBlur:Me,onClick:T===`click`||T===`hybrid`?ht:C,onFocus:gt,onKeyDown:Ct,onMouseDown:Ie,onMouseEnter:T===`hover`||T===`hybrid`?_t:void 0,onMouseLeave:T===`hover`||T===`hybrid`?vt:void 0,openOn:T,style:Ve,tabIndex:He||(V?`-1`:`0`),tooltip:Ue,triggerClassName:Ge,triggerRef:Tt,variant:ce,...Mt})};_.displayName=t.MENU_DROPDOWN,exports.DropdownNubbinPositions=oe,exports.ListItem=c.default,exports.ListItemLabel=s.default,exports.default=_;
|
|
2
2
|
//# sourceMappingURL=menu-dropdown.cjs.map
|