@atlaskit/react-select 3.14.3 → 3.14.5
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/CHANGELOG.md +16 -0
- package/dist/cjs/compiled/components/containers.compiled.css +6 -6
- package/dist/cjs/compiled/components/containers.js +7 -17
- package/dist/cjs/components/containers/indicators-container.compiled.css +5 -0
- package/dist/cjs/components/containers/indicators-container.js +36 -0
- package/dist/cjs/components/containers/multi-value-container.compiled.css +19 -0
- package/dist/cjs/components/containers/multi-value-container.js +34 -0
- package/dist/cjs/components/containers/select-container.compiled.css +6 -0
- package/dist/cjs/components/containers/select-container.js +43 -0
- package/dist/cjs/components/containers/value-container.compiled.css +17 -0
- package/dist/cjs/components/containers/value-container.js +46 -0
- package/dist/cjs/components/control.js +3 -6
- package/dist/cjs/components/{internal/dummy-input.js → dummy-input.js} +22 -5
- package/dist/cjs/components/group-heading.compiled.css +9 -0
- package/dist/cjs/components/group-heading.js +40 -0
- package/dist/cjs/components/group.compiled.css +2 -11
- package/dist/cjs/components/group.js +4 -33
- package/dist/cjs/components/index.js +31 -21
- package/dist/{esm/components/indicators.compiled.css → cjs/components/indicators/clear-indicator.compiled.css} +0 -6
- package/dist/cjs/components/indicators/clear-indicator.js +55 -0
- package/dist/cjs/components/indicators/dropdown-indicator.compiled.css +13 -0
- package/dist/cjs/components/indicators/dropdown-indicator.js +55 -0
- package/dist/cjs/components/indicators/loading-indicator.compiled.css +6 -0
- package/dist/cjs/components/indicators/loading-indicator.js +55 -0
- package/dist/cjs/components/input.js +5 -7
- package/dist/cjs/components/live-region.js +1 -1
- package/dist/cjs/components/menu-list.compiled.css +5 -0
- package/dist/cjs/components/menu-list.js +48 -0
- package/dist/cjs/components/menu-loading-message.compiled.css +5 -0
- package/dist/cjs/components/menu-loading-message.js +53 -0
- package/dist/cjs/components/menu-no-options-message.compiled.css +5 -0
- package/dist/cjs/components/menu-no-options-message.js +52 -0
- package/dist/cjs/components/menu-placer.js +301 -0
- package/dist/cjs/components/menu-portal.compiled.css +5 -0
- package/dist/cjs/components/menu-portal.js +132 -0
- package/dist/cjs/components/menu.compiled.css +3 -15
- package/dist/cjs/components/menu.js +6 -450
- package/dist/cjs/components/multi-value-label.compiled.css +10 -0
- package/dist/cjs/components/multi-value-label.js +34 -0
- package/dist/cjs/components/multi-value-remove.compiled.css +24 -0
- package/dist/cjs/components/multi-value-remove.js +40 -0
- package/dist/cjs/components/multi-value.compiled.css +2 -32
- package/dist/cjs/components/multi-value.js +11 -83
- package/dist/cjs/components/option.js +3 -6
- package/dist/cjs/components/placeholder.compiled.css +4 -4
- package/dist/cjs/components/placeholder.js +4 -7
- package/dist/cjs/components/single-value.compiled.css +5 -5
- package/dist/cjs/components/single-value.js +4 -7
- package/dist/cjs/get-style-props.js +16 -0
- package/dist/cjs/internal/classnames.js +42 -0
- package/dist/cjs/internal/clean-common-props.js +34 -0
- package/dist/cjs/internal/clean-value.js +17 -0
- package/dist/cjs/internal/is-document-el.js +9 -0
- package/dist/cjs/internal/multi-value-as-value.js +9 -0
- package/dist/cjs/internal/passive-event-detector.js +30 -0
- package/dist/cjs/internal/portal-placement-context.js +19 -0
- package/dist/cjs/internal/scroll-to.js +15 -0
- package/dist/cjs/internal/single-value-as-value.js +9 -0
- package/dist/cjs/{components/internal → internal}/use-scroll-capture.js +2 -2
- package/dist/cjs/internal/value-ternary.js +9 -0
- package/dist/cjs/select.compiled.css +3 -0
- package/dist/cjs/select.js +132 -35
- package/dist/cjs/styles.js +0 -34
- package/dist/cjs/use-async.js +10 -2
- package/dist/cjs/use-creatable.js +4 -3
- package/dist/es2019/compiled/components/containers.compiled.css +6 -6
- package/dist/es2019/compiled/components/containers.js +3 -7
- package/dist/es2019/components/containers/indicators-container.compiled.css +5 -0
- package/dist/es2019/components/containers/indicators-container.js +30 -0
- package/dist/es2019/components/containers/multi-value-container.compiled.css +19 -0
- package/dist/es2019/components/containers/multi-value-container.js +26 -0
- package/dist/es2019/components/containers/select-container.compiled.css +6 -0
- package/dist/es2019/components/containers/select-container.js +37 -0
- package/dist/es2019/components/containers/value-container.compiled.css +17 -0
- package/dist/es2019/components/containers/value-container.js +42 -0
- package/dist/es2019/components/control.js +1 -2
- package/dist/es2019/components/{internal/dummy-input.js → dummy-input.js} +7 -1
- package/dist/es2019/components/group-heading.compiled.css +9 -0
- package/dist/es2019/components/group-heading.js +33 -0
- package/dist/es2019/components/group.compiled.css +2 -11
- package/dist/es2019/components/group.js +2 -29
- package/dist/es2019/components/index.js +17 -5
- package/dist/{cjs/components/indicators.compiled.css → es2019/components/indicators/clear-indicator.compiled.css} +0 -6
- package/dist/es2019/components/indicators/clear-indicator.js +48 -0
- package/dist/es2019/components/indicators/dropdown-indicator.compiled.css +13 -0
- package/dist/es2019/components/indicators/dropdown-indicator.js +49 -0
- package/dist/es2019/components/indicators/loading-indicator.compiled.css +6 -0
- package/dist/es2019/components/indicators/loading-indicator.js +43 -0
- package/dist/es2019/components/input.js +2 -2
- package/dist/es2019/components/live-region.js +1 -1
- package/dist/es2019/components/menu-list.compiled.css +5 -0
- package/dist/es2019/components/menu-list.js +40 -0
- package/dist/es2019/components/menu-loading-message.compiled.css +5 -0
- package/dist/es2019/components/menu-loading-message.js +41 -0
- package/dist/es2019/components/menu-no-options-message.compiled.css +5 -0
- package/dist/es2019/components/menu-no-options-message.js +40 -0
- package/dist/es2019/components/menu-placer.js +288 -0
- package/dist/es2019/components/menu-portal.compiled.css +5 -0
- package/dist/es2019/components/menu-portal.js +115 -0
- package/dist/es2019/components/menu.compiled.css +3 -15
- package/dist/es2019/components/menu.js +3 -442
- package/dist/es2019/components/multi-value-label.compiled.css +10 -0
- package/dist/es2019/components/multi-value-label.js +26 -0
- package/dist/es2019/components/multi-value-remove.compiled.css +24 -0
- package/dist/es2019/components/multi-value-remove.js +32 -0
- package/dist/es2019/components/multi-value.compiled.css +2 -32
- package/dist/es2019/components/multi-value.js +3 -70
- package/dist/es2019/components/option.js +1 -2
- package/dist/es2019/components/placeholder.compiled.css +4 -4
- package/dist/es2019/components/placeholder.js +2 -3
- package/dist/es2019/components/single-value.compiled.css +5 -5
- package/dist/es2019/components/single-value.js +2 -3
- package/dist/es2019/get-style-props.js +12 -0
- package/dist/es2019/internal/classnames.js +29 -0
- package/dist/es2019/internal/clean-common-props.js +28 -0
- package/dist/es2019/internal/clean-value.js +9 -0
- package/dist/es2019/internal/is-document-el.js +3 -0
- package/dist/es2019/internal/multi-value-as-value.js +3 -0
- package/dist/es2019/internal/passive-event-detector.js +22 -0
- package/dist/es2019/internal/portal-placement-context.js +13 -0
- package/dist/es2019/internal/scroll-to.js +9 -0
- package/dist/es2019/internal/single-value-as-value.js +3 -0
- package/dist/es2019/{components/internal → internal}/use-scroll-capture.js +1 -1
- package/dist/es2019/internal/value-ternary.js +3 -0
- package/dist/es2019/select.compiled.css +3 -0
- package/dist/es2019/select.js +110 -15
- package/dist/es2019/styles.js +0 -33
- package/dist/es2019/use-async.js +9 -1
- package/dist/es2019/use-creatable.js +2 -1
- package/dist/esm/compiled/components/containers.compiled.css +6 -6
- package/dist/esm/compiled/components/containers.js +3 -13
- package/dist/esm/components/containers/indicators-container.compiled.css +5 -0
- package/dist/esm/components/containers/indicators-container.js +27 -0
- package/dist/esm/components/containers/multi-value-container.compiled.css +19 -0
- package/dist/esm/components/containers/multi-value-container.js +25 -0
- package/dist/esm/components/containers/select-container.compiled.css +6 -0
- package/dist/esm/components/containers/select-container.js +34 -0
- package/dist/esm/components/containers/value-container.compiled.css +17 -0
- package/dist/esm/components/containers/value-container.js +37 -0
- package/dist/esm/components/control.js +1 -4
- package/dist/esm/components/{internal/dummy-input.js → dummy-input.js} +21 -4
- package/dist/esm/components/group-heading.compiled.css +9 -0
- package/dist/esm/components/group-heading.js +31 -0
- package/dist/esm/components/group.compiled.css +2 -11
- package/dist/esm/components/group.js +2 -31
- package/dist/esm/components/index.js +17 -5
- package/dist/{es2019/components/indicators.compiled.css → esm/components/indicators/clear-indicator.compiled.css} +0 -6
- package/dist/esm/components/indicators/clear-indicator.js +46 -0
- package/dist/esm/components/indicators/dropdown-indicator.compiled.css +13 -0
- package/dist/esm/components/indicators/dropdown-indicator.js +46 -0
- package/dist/esm/components/indicators/loading-indicator.compiled.css +6 -0
- package/dist/esm/components/indicators/loading-indicator.js +47 -0
- package/dist/esm/components/input.js +2 -4
- package/dist/esm/components/live-region.js +1 -1
- package/dist/esm/components/menu-list.compiled.css +5 -0
- package/dist/esm/components/menu-list.js +39 -0
- package/dist/esm/components/menu-loading-message.compiled.css +5 -0
- package/dist/esm/components/menu-loading-message.js +45 -0
- package/dist/esm/components/menu-no-options-message.compiled.css +5 -0
- package/dist/esm/components/menu-no-options-message.js +44 -0
- package/dist/esm/components/menu-placer.js +294 -0
- package/dist/esm/components/menu-portal.compiled.css +5 -0
- package/dist/esm/components/menu-portal.js +123 -0
- package/dist/esm/components/menu.compiled.css +3 -15
- package/dist/esm/components/menu.js +3 -452
- package/dist/esm/components/multi-value-label.compiled.css +10 -0
- package/dist/esm/components/multi-value-label.js +25 -0
- package/dist/esm/components/multi-value-remove.compiled.css +24 -0
- package/dist/esm/components/multi-value-remove.js +31 -0
- package/dist/esm/components/multi-value.compiled.css +2 -32
- package/dist/esm/components/multi-value.js +6 -76
- package/dist/esm/components/option.js +1 -4
- package/dist/esm/components/placeholder.compiled.css +4 -4
- package/dist/esm/components/placeholder.js +2 -5
- package/dist/esm/components/single-value.compiled.css +5 -5
- package/dist/esm/components/single-value.js +2 -5
- package/dist/esm/get-style-props.js +10 -0
- package/dist/esm/internal/classnames.js +36 -0
- package/dist/esm/internal/clean-common-props.js +27 -0
- package/dist/esm/internal/clean-value.js +10 -0
- package/dist/esm/internal/is-document-el.js +3 -0
- package/dist/esm/internal/multi-value-as-value.js +3 -0
- package/dist/esm/internal/passive-event-detector.js +22 -0
- package/dist/esm/internal/portal-placement-context.js +13 -0
- package/dist/esm/internal/scroll-to.js +9 -0
- package/dist/esm/internal/single-value-as-value.js +3 -0
- package/dist/esm/{components/internal → internal}/use-scroll-capture.js +1 -1
- package/dist/esm/internal/value-ternary.js +3 -0
- package/dist/esm/select.compiled.css +3 -0
- package/dist/esm/select.js +112 -15
- package/dist/esm/styles.js +0 -33
- package/dist/esm/use-async.js +9 -1
- package/dist/esm/use-creatable.js +2 -1
- package/dist/types/async-creatable.d.ts +1 -1
- package/dist/types/async.d.ts +1 -1
- package/dist/types/builtins.d.ts +1 -1
- package/dist/types/compiled/components/containers.d.ts +0 -3
- package/dist/types/components/containers/indicators-container.d.ts +18 -0
- package/dist/types/components/containers/multi-value-container.d.ts +6 -0
- package/dist/types/components/containers/select-container.d.ts +22 -0
- package/dist/types/components/containers/value-container.d.ts +22 -0
- package/dist/types/components/control.d.ts +0 -1
- package/dist/types/components/{internal/dummy-input.d.ts → dummy-input.d.ts} +1 -1
- package/dist/types/components/group-heading.d.ts +19 -0
- package/dist/types/components/group.d.ts +3 -21
- package/dist/types/components/index.d.ts +20 -7
- package/dist/types/components/indicators/clear-indicator.d.ts +29 -0
- package/dist/types/components/indicators/dropdown-indicator.d.ts +26 -0
- package/dist/types/components/indicators/loading-indicator.d.ts +25 -0
- package/dist/types/components/input.d.ts +0 -1
- package/dist/types/components/menu-list.d.ts +29 -0
- package/dist/types/components/menu-loading-message.d.ts +2 -0
- package/dist/types/components/menu-no-options-message.d.ts +2 -0
- package/dist/types/components/menu-placer.d.ts +49 -0
- package/dist/types/components/menu-portal.d.ts +23 -0
- package/dist/types/components/menu.d.ts +3 -96
- package/dist/types/components/multi-value-label.d.ts +6 -0
- package/dist/types/components/multi-value-remove.d.ts +20 -0
- package/dist/types/components/multi-value.d.ts +3 -35
- package/dist/types/components/option.d.ts +0 -1
- package/dist/types/components/placeholder.d.ts +0 -1
- package/dist/types/components/single-value.d.ts +0 -1
- package/dist/types/creatable.d.ts +1 -1
- package/dist/types/get-style-props.d.ts +6 -0
- package/dist/types/index.d.ts +14 -5
- package/dist/types/internal/classnames.d.ts +2 -0
- package/dist/types/internal/clean-common-props.d.ts +2 -0
- package/dist/types/internal/clean-value.d.ts +2 -0
- package/dist/types/internal/is-document-el.d.ts +1 -0
- package/dist/types/internal/multi-value-as-value.d.ts +2 -0
- package/dist/types/internal/passive-event-detector.d.ts +1 -0
- package/dist/types/internal/portal-placement-context.d.ts +13 -0
- package/dist/types/internal/scroll-to.d.ts +1 -0
- package/dist/types/internal/single-value-as-value.d.ts +2 -0
- package/dist/types/internal/value-ternary.d.ts +2 -0
- package/dist/types/select.d.ts +4 -0
- package/dist/types/state-manager.d.ts +1 -1
- package/dist/types/styles.d.ts +12 -8
- package/dist/types/theme.d.ts +1 -1
- package/dist/types/types.d.ts +28 -3
- package/dist/types/use-async.d.ts +2 -2
- package/dist/types/use-creatable.d.ts +1 -1
- package/dist/types/use-state-manager.d.ts +2 -2
- package/dist/types-ts4.5/async-creatable.d.ts +1 -1
- package/dist/types-ts4.5/async.d.ts +1 -1
- package/dist/types-ts4.5/builtins.d.ts +1 -1
- package/dist/types-ts4.5/compiled/components/containers.d.ts +0 -3
- package/dist/types-ts4.5/components/containers/indicators-container.d.ts +18 -0
- package/dist/types-ts4.5/components/containers/multi-value-container.d.ts +6 -0
- package/dist/types-ts4.5/components/containers/select-container.d.ts +22 -0
- package/dist/types-ts4.5/components/containers/value-container.d.ts +22 -0
- package/dist/types-ts4.5/components/control.d.ts +0 -1
- package/dist/types-ts4.5/components/{internal/dummy-input.d.ts → dummy-input.d.ts} +1 -1
- package/dist/types-ts4.5/components/group-heading.d.ts +19 -0
- package/dist/types-ts4.5/components/group.d.ts +3 -21
- package/dist/types-ts4.5/components/index.d.ts +20 -7
- package/dist/types-ts4.5/components/indicators/clear-indicator.d.ts +29 -0
- package/dist/types-ts4.5/components/indicators/dropdown-indicator.d.ts +26 -0
- package/dist/types-ts4.5/components/indicators/loading-indicator.d.ts +25 -0
- package/dist/types-ts4.5/components/input.d.ts +0 -1
- package/dist/types-ts4.5/components/menu-list.d.ts +29 -0
- package/dist/types-ts4.5/components/menu-loading-message.d.ts +2 -0
- package/dist/types-ts4.5/components/menu-no-options-message.d.ts +2 -0
- package/dist/types-ts4.5/components/menu-placer.d.ts +49 -0
- package/dist/types-ts4.5/components/menu-portal.d.ts +23 -0
- package/dist/types-ts4.5/components/menu.d.ts +3 -96
- package/dist/types-ts4.5/components/multi-value-label.d.ts +6 -0
- package/dist/types-ts4.5/components/multi-value-remove.d.ts +20 -0
- package/dist/types-ts4.5/components/multi-value.d.ts +3 -35
- package/dist/types-ts4.5/components/option.d.ts +0 -1
- package/dist/types-ts4.5/components/placeholder.d.ts +0 -1
- package/dist/types-ts4.5/components/single-value.d.ts +0 -1
- package/dist/types-ts4.5/creatable.d.ts +1 -1
- package/dist/types-ts4.5/get-style-props.d.ts +6 -0
- package/dist/types-ts4.5/index.d.ts +14 -5
- package/dist/types-ts4.5/internal/classnames.d.ts +2 -0
- package/dist/types-ts4.5/internal/clean-common-props.d.ts +2 -0
- package/dist/types-ts4.5/internal/clean-value.d.ts +2 -0
- package/dist/types-ts4.5/internal/is-document-el.d.ts +1 -0
- package/dist/types-ts4.5/internal/multi-value-as-value.d.ts +2 -0
- package/dist/types-ts4.5/internal/passive-event-detector.d.ts +1 -0
- package/dist/types-ts4.5/internal/portal-placement-context.d.ts +13 -0
- package/dist/types-ts4.5/internal/scroll-to.d.ts +1 -0
- package/dist/types-ts4.5/internal/single-value-as-value.d.ts +2 -0
- package/dist/types-ts4.5/internal/value-ternary.d.ts +2 -0
- package/dist/types-ts4.5/select.d.ts +4 -0
- package/dist/types-ts4.5/state-manager.d.ts +1 -1
- package/dist/types-ts4.5/styles.d.ts +12 -8
- package/dist/types-ts4.5/theme.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +28 -3
- package/dist/types-ts4.5/use-async.d.ts +2 -2
- package/dist/types-ts4.5/use-creatable.d.ts +1 -1
- package/dist/types-ts4.5/use-state-manager.d.ts +2 -2
- package/package.json +6 -6
- package/dist/cjs/components/containers.compiled.css +0 -25
- package/dist/cjs/components/containers.js +0 -116
- package/dist/cjs/components/indicators.js +0 -155
- package/dist/cjs/utils.js +0 -391
- package/dist/es2019/components/containers.compiled.css +0 -25
- package/dist/es2019/components/containers.js +0 -113
- package/dist/es2019/components/indicators.js +0 -143
- package/dist/es2019/utils.js +0 -344
- package/dist/esm/components/containers.compiled.css +0 -25
- package/dist/esm/components/containers.js +0 -108
- package/dist/esm/components/indicators.js +0 -148
- package/dist/esm/utils.js +0 -364
- package/dist/types/components/containers.d.ts +0 -53
- package/dist/types/components/indicators.d.ts +0 -72
- package/dist/types/utils.d.ts +0 -40
- package/dist/types-ts4.5/components/containers.d.ts +0 -53
- package/dist/types-ts4.5/components/indicators.d.ts +0 -72
- package/dist/types-ts4.5/utils.d.ts +0 -40
- /package/dist/cjs/components/{internal/dummy-input.compiled.css → dummy-input.compiled.css} +0 -0
- /package/dist/cjs/{components/internal → internal}/a11y-text.compiled.css +0 -0
- /package/dist/cjs/{components/internal → internal}/a11y-text.js +0 -0
- /package/dist/cjs/{components/internal → internal}/notify-open-layer-observer.js +0 -0
- /package/dist/cjs/{components/internal → internal}/required-input.compiled.css +0 -0
- /package/dist/cjs/{components/internal → internal}/required-input.js +0 -0
- /package/dist/cjs/{components/internal → internal}/scroll-manager.js +0 -0
- /package/dist/cjs/{components/internal → internal}/use-scroll-lock.js +0 -0
- /package/dist/es2019/components/{internal/dummy-input.compiled.css → dummy-input.compiled.css} +0 -0
- /package/dist/es2019/{components/internal → internal}/a11y-text.compiled.css +0 -0
- /package/dist/es2019/{components/internal → internal}/a11y-text.js +0 -0
- /package/dist/es2019/{components/internal → internal}/notify-open-layer-observer.js +0 -0
- /package/dist/es2019/{components/internal → internal}/required-input.compiled.css +0 -0
- /package/dist/es2019/{components/internal → internal}/required-input.js +0 -0
- /package/dist/es2019/{components/internal → internal}/scroll-manager.js +0 -0
- /package/dist/es2019/{components/internal → internal}/use-scroll-lock.js +0 -0
- /package/dist/esm/components/{internal/dummy-input.compiled.css → dummy-input.compiled.css} +0 -0
- /package/dist/esm/{components/internal → internal}/a11y-text.compiled.css +0 -0
- /package/dist/esm/{components/internal → internal}/a11y-text.js +0 -0
- /package/dist/esm/{components/internal → internal}/notify-open-layer-observer.js +0 -0
- /package/dist/esm/{components/internal → internal}/required-input.compiled.css +0 -0
- /package/dist/esm/{components/internal → internal}/required-input.js +0 -0
- /package/dist/esm/{components/internal → internal}/scroll-manager.js +0 -0
- /package/dist/esm/{components/internal → internal}/use-scroll-lock.js +0 -0
- /package/dist/types/{components/internal → internal}/a11y-text.d.ts +0 -0
- /package/dist/types/{components/internal → internal}/notify-open-layer-observer.d.ts +0 -0
- /package/dist/types/{components/internal → internal}/required-input.d.ts +0 -0
- /package/dist/types/{components/internal → internal}/scroll-manager.d.ts +0 -0
- /package/dist/types/{components/internal → internal}/use-scroll-capture.d.ts +0 -0
- /package/dist/types/{components/internal → internal}/use-scroll-lock.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/a11y-text.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/notify-open-layer-observer.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/required-input.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/scroll-manager.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/use-scroll-capture.d.ts +0 -0
- /package/dist/types-ts4.5/{components/internal → internal}/use-scroll-lock.d.ts +0 -0
|
@@ -4,10 +4,10 @@ import "./multi-value.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
|
-
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import Tag from '@atlaskit/tag';
|
|
10
|
-
import { getStyleProps } from '../
|
|
9
|
+
import { getStyleProps } from '../get-style-props';
|
|
10
|
+
import { MultiValueLabel } from './multi-value-label';
|
|
11
11
|
// Tag wrapper: Tag has built-in margin; cancel the inline margin so we control spacing
|
|
12
12
|
const tagMarginToken = "var(--ds-space-050, 4px)";
|
|
13
13
|
const multiValueTagWrapperStyles = {
|
|
@@ -40,75 +40,8 @@ const multiValueTagLikeStyles = {
|
|
|
40
40
|
root: "_1reo15vq _18m915vq _2rko12b0 _11c8wadc _1mouv77o _195gv77o _1dqonqa1 _189ee4h9 _1e0c116y _vchhusvi _kqswh2mm _4cvr1h6o _1ul9idpf _p12ff6dh _4t3i1k92 _bfhksm61 _syazi7uo _80om73ad _3yq3glyw",
|
|
41
41
|
labelWrapper: "_16jlidpf _1o9zkb7n _i0dl1wug _1reo15vq _18m915vq _11c8wadc _1e0c1txw _4cvr1h6o _1ul9ze3t _1tkeidpf _2a9v1kw7",
|
|
42
42
|
disabled: "_syaz1gmx _bfhki8nm",
|
|
43
|
-
focused: "
|
|
43
|
+
focused: "_syaz6x5g _bfhk1dpa _16qs1xv8 _1aewe4h9 _6up51j28 _1xdnnqa1"
|
|
44
44
|
};
|
|
45
|
-
const multiValueStyles = {
|
|
46
|
-
root: "_2rko12b0 _1h6d14je _1dqonqa1 _189ee4h9 _1e0c1txw _1ul9ze3t _1pfhv77o _12l2v77o _6rthv77o _ahbqv77o _bfhk1j9a _p12f1osq _syazjpor _3yq3glyw",
|
|
47
|
-
disabled: "_syaz1gmx _bfhki8nm",
|
|
48
|
-
focused: "_syaz1wum _bfhk15s3 _16qs7ex6 _1aewe4h9 _6up51j28 _1xdnnqa1"
|
|
49
|
-
};
|
|
50
|
-
export const multiValueCSS = () => ({});
|
|
51
|
-
export const multiValueLabelCSS = () => ({});
|
|
52
|
-
const multiValueLabelStyles = {
|
|
53
|
-
root: "_1reo15vq _18m915vq _2rkolb4i _11c8fhey _o5721q9c _y4tiv77o _bozg1b66 _syaz1kw7",
|
|
54
|
-
disabled: "_syaz1gmx",
|
|
55
|
-
ellipsis: "_1bto1l2s"
|
|
56
|
-
};
|
|
57
|
-
export const multiValueRemoveCSS = () => ({});
|
|
58
|
-
const multiValueRemoveStyles = {
|
|
59
|
-
focused: "_bfhkb1q9 _lswu1rrc",
|
|
60
|
-
root: "_19itglyw _2rko12b0 _4cvr1h6o _1bah1h6o _1wpz1h6o _r06hglyw _bfhksm61 _syazi7uo _1e0c1txw _lswu1dx5 _1q51v77o _y4tiv77o _85i5v77o _bozgv77o _12l2v77o _1ah312gs _irr31dpa _13br1jjn _1di6fcek _i5f81jjn"
|
|
61
|
-
};
|
|
62
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
63
|
-
export const MultiValueContainer = ({
|
|
64
|
-
children,
|
|
65
|
-
innerProps,
|
|
66
|
-
isFocused,
|
|
67
|
-
isDisabled,
|
|
68
|
-
className,
|
|
69
|
-
xcss
|
|
70
|
-
}) => {
|
|
71
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
72
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
73
|
-
className: ax([multiValueStyles.root, isDisabled && multiValueStyles.disabled, isFocused && multiValueStyles.focused, cx(className, xcss, '-multiValue')])
|
|
74
|
-
}), children);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
78
|
-
export const MultiValueLabel = ({
|
|
79
|
-
children,
|
|
80
|
-
innerProps,
|
|
81
|
-
isDisabled,
|
|
82
|
-
hasEllipsis,
|
|
83
|
-
className,
|
|
84
|
-
xcss
|
|
85
|
-
}) => {
|
|
86
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
87
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
88
|
-
className: ax([multiValueLabelStyles.root, isDisabled && multiValueLabelStyles.disabled, hasEllipsis && multiValueLabelStyles.ellipsis, cx(className, xcss, '-MultiValueLabel')])
|
|
89
|
-
}), children);
|
|
90
|
-
};
|
|
91
|
-
const disabledStyles = null;
|
|
92
|
-
const enabledStyles = null;
|
|
93
|
-
export function MultiValueRemove({
|
|
94
|
-
isDisabled,
|
|
95
|
-
isFocused,
|
|
96
|
-
innerProps,
|
|
97
|
-
className,
|
|
98
|
-
xcss
|
|
99
|
-
}) {
|
|
100
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
101
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
102
|
-
className: ax([multiValueRemoveStyles.root, isFocused && multiValueRemoveStyles.focused, cx(className, xcss, '-MultiValueRemove')])
|
|
103
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
|
|
105
|
-
className: ax([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
|
|
106
|
-
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
107
|
-
label: "",
|
|
108
|
-
color: "currentColor",
|
|
109
|
-
size: "small"
|
|
110
|
-
})));
|
|
111
|
-
}
|
|
112
45
|
const getMultiValueLabelText = (children, data) => {
|
|
113
46
|
if (typeof children === 'string') {
|
|
114
47
|
return children;
|
|
@@ -4,8 +4,7 @@ import "./option.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
|
-
import { getStyleProps } from '../
|
|
8
|
-
export const optionCSS = () => ({});
|
|
7
|
+
import { getStyleProps } from '../get-style-props';
|
|
9
8
|
const optionStyles = {
|
|
10
9
|
root: "_1rjc12x7 _18zrutpp _syazi7uo _80om73ad _1e0c1ule _1wyb1kw7 _1bsb1osq _uiztglyw _18ql1j7p _1di6fcek",
|
|
11
10
|
disabled: "_syaz1gmx _80om13gf _bfhk1j28 _16qsglyw _1di61j28 _112eglyw",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
._nd5l1sux{grid-area:1/1/2/3}.
|
|
3
|
-
.
|
|
4
|
-
.
|
|
5
|
-
.
|
|
2
|
+
._nd5l1sux{grid-area:1/1/2/3}._12l2v77o{margin-inline-end:var(--ds-space-025,2px)}
|
|
3
|
+
._1pfhidpf{margin-block-start:0}
|
|
4
|
+
._6rthidpf{margin-block-end:0}
|
|
5
|
+
._ahbqv77o{margin-inline-start:var(--ds-space-025,2px)}
|
|
6
6
|
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
7
7
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
@@ -4,10 +4,9 @@ import "./placeholder.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
|
-
import { getStyleProps } from '../
|
|
8
|
-
export const placeholderCSS = () => ({});
|
|
7
|
+
import { getStyleProps } from '../get-style-props';
|
|
9
8
|
const placeholderStyles = {
|
|
10
|
-
root: "_nd5l1sux
|
|
9
|
+
root: "_nd5l1sux _1pfhidpf _12l2v77o _6rthidpf _ahbqv77o _syaz1rpy",
|
|
11
10
|
disabled: "_syaz1gmx"
|
|
12
11
|
};
|
|
13
12
|
const Placeholder = props => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
._nd5l1sux{grid-area:1/1/2/3}.
|
|
3
|
-
.
|
|
4
|
-
._19pkidpf{margin-top:0}
|
|
2
|
+
._nd5l1sux{grid-area:1/1/2/3}._12l2v77o{margin-inline-end:var(--ds-space-025,2px)}
|
|
3
|
+
._18m915vq{overflow-y:hidden}
|
|
5
4
|
._1bto1l2s{text-overflow:ellipsis}
|
|
5
|
+
._1pfhidpf{margin-block-start:0}
|
|
6
6
|
._1reo15vq{overflow-x:hidden}
|
|
7
|
-
.
|
|
7
|
+
._6rthidpf{margin-block-end:0}
|
|
8
|
+
._ahbqv77o{margin-inline-start:var(--ds-space-025,2px)}
|
|
8
9
|
._o5721q9c{white-space:nowrap}
|
|
9
|
-
._otyridpf{margin-bottom:0}
|
|
10
10
|
._p12f1osq{max-width:100%}
|
|
11
11
|
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
12
12
|
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
@@ -4,10 +4,9 @@ import "./single-value.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
|
-
import { getStyleProps } from '../
|
|
8
|
-
export const css = () => ({});
|
|
7
|
+
import { getStyleProps } from '../get-style-props';
|
|
9
8
|
const styles = {
|
|
10
|
-
root: "_nd5l1sux _1reo15vq _18m915vq _p12f1osq _1bto1l2s _o5721q9c
|
|
9
|
+
root: "_nd5l1sux _1reo15vq _18m915vq _p12f1osq _1bto1l2s _o5721q9c _1pfhidpf _12l2v77o _6rthidpf _ahbqv77o _syazi7uo",
|
|
11
10
|
disalbed: "_syaz1gmx"
|
|
12
11
|
};
|
|
13
12
|
const SingleValue = props => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const getStyleProps = (props, name, classNamesState) => {
|
|
2
|
+
const {
|
|
3
|
+
cx,
|
|
4
|
+
getStyles,
|
|
5
|
+
getClassNames,
|
|
6
|
+
className
|
|
7
|
+
} = props;
|
|
8
|
+
return {
|
|
9
|
+
css: getStyles(name, props),
|
|
10
|
+
className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className)
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String representation of component state for styling with class names.
|
|
3
|
+
*
|
|
4
|
+
* Expects an array of strings OR a string/object pair:
|
|
5
|
+
* - className(['comp', 'comp-arg', 'comp-arg-2'])
|
|
6
|
+
* @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'
|
|
7
|
+
* - className('comp', { some: true, state: false })
|
|
8
|
+
* @returns 'react-select__comp react-select__comp--some'
|
|
9
|
+
*/
|
|
10
|
+
function applyPrefixToName(prefix, name) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
return prefix;
|
|
13
|
+
} else if (name[0] === '-') {
|
|
14
|
+
return prefix + name;
|
|
15
|
+
} else {
|
|
16
|
+
return prefix + '__' + name;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function classNames(prefix, state, ...classNameList) {
|
|
20
|
+
const arr = [...classNameList];
|
|
21
|
+
if (state && prefix) {
|
|
22
|
+
for (let key in state) {
|
|
23
|
+
if (state.hasOwnProperty(key) && state[key]) {
|
|
24
|
+
arr.push(`${applyPrefixToName(prefix, key)}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return arr.filter(i => i).map(i => String(i).trim()).join(' ');
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Clean Common Props
|
|
2
|
+
// ==============================
|
|
3
|
+
|
|
4
|
+
export const cleanCommonProps = props => {
|
|
5
|
+
//className
|
|
6
|
+
const {
|
|
7
|
+
className,
|
|
8
|
+
// not listed in commonProps documentation, needs to be removed to allow Emotion to generate classNames
|
|
9
|
+
clearValue,
|
|
10
|
+
cx,
|
|
11
|
+
xcss,
|
|
12
|
+
getStyles,
|
|
13
|
+
getClassNames,
|
|
14
|
+
getValue,
|
|
15
|
+
hasValue,
|
|
16
|
+
isMulti,
|
|
17
|
+
isRtl,
|
|
18
|
+
options,
|
|
19
|
+
// not listed in commonProps documentation
|
|
20
|
+
selectOption,
|
|
21
|
+
selectProps,
|
|
22
|
+
setValue,
|
|
23
|
+
...innerProps
|
|
24
|
+
} = props;
|
|
25
|
+
return {
|
|
26
|
+
...innerProps
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// ==============================
|
|
2
|
+
// Passive Event Detector
|
|
3
|
+
// ==============================
|
|
4
|
+
import __noop from '@atlaskit/ds-lib/noop';
|
|
5
|
+
const noop = __noop;
|
|
6
|
+
|
|
7
|
+
// https://github.com/rafgraph/detect-it/blob/main/src/index.ts#L19-L36
|
|
8
|
+
let passiveOptionAccessed = false;
|
|
9
|
+
const options = {
|
|
10
|
+
get passive() {
|
|
11
|
+
return passiveOptionAccessed = true;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
// check for SSR
|
|
15
|
+
const w = typeof window !== 'undefined' ? window : {};
|
|
16
|
+
if (w.addEventListener && w.removeEventListener) {
|
|
17
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
18
|
+
w.addEventListener('p', noop, options);
|
|
19
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
20
|
+
w.removeEventListener('p', noop, false);
|
|
21
|
+
}
|
|
22
|
+
export const supportsPassiveEvents = passiveOptionAccessed;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
3
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
4
|
+
/**
|
|
5
|
+
* __Portal placement context__
|
|
6
|
+
*
|
|
7
|
+
* A portal placement context {description}.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
10
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
11
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
12
|
+
*/
|
|
13
|
+
export const PortalPlacementContext = /*#__PURE__*/createContext(null);
|
package/dist/es2019/select.js
CHANGED
|
@@ -1,19 +1,102 @@
|
|
|
1
|
+
/* select.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import "./select.compiled.css";
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
3
6
|
import React, { Component } from 'react';
|
|
4
7
|
import { isAppleDevice, isSafari } from '@atlaskit/ds-lib/device-check';
|
|
8
|
+
import __noop from '@atlaskit/ds-lib/noop';
|
|
5
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
10
|
import { formatGroupLabel as formatGroupLabelBuiltin, getOptionLabel as getOptionLabelBuiltin, getOptionValue as getOptionValueBuiltin, isOptionDisabled as isOptionDisabledBuiltin } from './builtins';
|
|
7
11
|
import { defaultComponents } from './components';
|
|
8
|
-
import DummyInput from './components/
|
|
9
|
-
import { NotifyOpenLayerObserver } from './components/internal/notify-open-layer-observer';
|
|
10
|
-
import RequiredInput from './components/internal/required-input';
|
|
11
|
-
import ScrollManager from './components/internal/scroll-manager';
|
|
12
|
+
import DummyInput from './components/dummy-input';
|
|
12
13
|
import LiveRegion from './components/live-region';
|
|
13
|
-
import
|
|
14
|
+
import MenuPlacer from './components/menu-placer';
|
|
14
15
|
import { createFilter } from './filters';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
16
|
+
import { classNames } from './internal/classnames';
|
|
17
|
+
import { cleanValue } from './internal/clean-value';
|
|
18
|
+
import { isDocumentElement } from './internal/is-document-el';
|
|
19
|
+
import { multiValueAsValue } from './internal/multi-value-as-value';
|
|
20
|
+
import { NotifyOpenLayerObserver } from './internal/notify-open-layer-observer';
|
|
21
|
+
import RequiredInput from './internal/required-input';
|
|
22
|
+
import ScrollManager from './internal/scroll-manager';
|
|
23
|
+
import { scrollTo } from './internal/scroll-to';
|
|
24
|
+
import { singleValueAsValue } from './internal/single-value-as-value';
|
|
25
|
+
import { valueTernary } from './internal/value-ternary';
|
|
26
|
+
const noop = __noop;
|
|
27
|
+
function notNullish(item) {
|
|
28
|
+
return item != null;
|
|
29
|
+
}
|
|
30
|
+
function scrollIntoView(menuEl, focusedEl) {
|
|
31
|
+
const menuRect = menuEl.getBoundingClientRect();
|
|
32
|
+
const focusedRect = focusedEl.getBoundingClientRect();
|
|
33
|
+
const overScroll = focusedEl.offsetHeight / 3;
|
|
34
|
+
if (focusedRect.bottom + overScroll > menuRect.bottom) {
|
|
35
|
+
scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));
|
|
36
|
+
} else if (focusedRect.top - overScroll < menuRect.top) {
|
|
37
|
+
scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function isMobileDevice() {
|
|
41
|
+
try {
|
|
42
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function isTouchCapable() {
|
|
48
|
+
try {
|
|
49
|
+
document.createEvent('TouchEvent');
|
|
50
|
+
return true;
|
|
51
|
+
} catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
|
|
58
|
+
* @param styles - The styles object to filter.
|
|
59
|
+
* @returns A new object containing only supported styles.
|
|
60
|
+
*/
|
|
61
|
+
const filterUnsupportedSelectors = styles => {
|
|
62
|
+
const unsupportedSelectors = [':',
|
|
63
|
+
// pseudo-classes/elements
|
|
64
|
+
'[',
|
|
65
|
+
// attribute selectors
|
|
66
|
+
'>',
|
|
67
|
+
// child combinator
|
|
68
|
+
'+',
|
|
69
|
+
// adjacent sibling combinator
|
|
70
|
+
'~',
|
|
71
|
+
// general sibling combinator
|
|
72
|
+
' ',
|
|
73
|
+
// descendant combinator
|
|
74
|
+
'*',
|
|
75
|
+
// universal selector
|
|
76
|
+
'#',
|
|
77
|
+
// ID selector
|
|
78
|
+
'.',
|
|
79
|
+
// class selector
|
|
80
|
+
'@',
|
|
81
|
+
// at-rules
|
|
82
|
+
'&',
|
|
83
|
+
// parent selector
|
|
84
|
+
'|',
|
|
85
|
+
// namespace separator
|
|
86
|
+
'^',
|
|
87
|
+
// starts with
|
|
88
|
+
'$',
|
|
89
|
+
// ends with
|
|
90
|
+
'=' // equals
|
|
91
|
+
];
|
|
92
|
+
return Object.keys(styles).reduce((filteredStyles, key) => {
|
|
93
|
+
if (!unsupportedSelectors.some(selector => key.includes(selector))) {
|
|
94
|
+
filteredStyles[key] = styles[key];
|
|
95
|
+
}
|
|
96
|
+
return filteredStyles;
|
|
97
|
+
}, {});
|
|
98
|
+
};
|
|
99
|
+
const elemBeforeCSS = null;
|
|
17
100
|
export const defaultProps = {
|
|
18
101
|
backspaceRemovesValue: true,
|
|
19
102
|
blurInputOnSelect: isTouchCapable(),
|
|
@@ -385,14 +468,14 @@ export default class Select extends Component {
|
|
|
385
468
|
return getOptionValue(this.props, data);
|
|
386
469
|
});
|
|
387
470
|
_defineProperty(this, "getStyles", (key, props) => {
|
|
388
|
-
const base =
|
|
389
|
-
|
|
471
|
+
const base = {
|
|
472
|
+
boxSizing: 'border-box'
|
|
473
|
+
};
|
|
390
474
|
const custom = this.props.styles[key];
|
|
391
|
-
if (
|
|
392
|
-
return base;
|
|
475
|
+
if (custom) {
|
|
476
|
+
return filterUnsupportedSelectors(custom(base, props));
|
|
393
477
|
}
|
|
394
|
-
|
|
395
|
-
return customStyles;
|
|
478
|
+
return base;
|
|
396
479
|
});
|
|
397
480
|
_defineProperty(this, "getClassNames", (key, props) => {
|
|
398
481
|
var _this$props$className, _this$props$className2;
|
|
@@ -1219,6 +1302,7 @@ export default class Select extends Component {
|
|
|
1219
1302
|
return filterOption(this.props, option, inputValue);
|
|
1220
1303
|
}
|
|
1221
1304
|
formatOptionLabel(data, context) {
|
|
1305
|
+
var _this$props$component;
|
|
1222
1306
|
if (typeof this.props.formatOptionLabel === 'function') {
|
|
1223
1307
|
const {
|
|
1224
1308
|
inputValue
|
|
@@ -1231,9 +1315,20 @@ export default class Select extends Component {
|
|
|
1231
1315
|
inputValue,
|
|
1232
1316
|
selectValue
|
|
1233
1317
|
});
|
|
1234
|
-
} else {
|
|
1235
|
-
return this.getOptionLabel(data);
|
|
1236
1318
|
}
|
|
1319
|
+
// Auto-render elemBefore in dropdown menu only if formatOptionLabel is not provided
|
|
1320
|
+
// and no custom Option component is provided (custom Option components may already
|
|
1321
|
+
// render elemBefore themselves, causing it to appear twice)
|
|
1322
|
+
if (context === 'menu' && !this.props.formatOptionLabel && !((_this$props$component = this.props.components) !== null && _this$props$component !== void 0 && _this$props$component.Option) && fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
|
|
1323
|
+
const elemBefore = data.elemBefore;
|
|
1324
|
+
if (elemBefore) {
|
|
1325
|
+
const label = this.getOptionLabel(data);
|
|
1326
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1327
|
+
className: ax(["_zulpu2gc _1e0c1txw _4cvr1h6o"])
|
|
1328
|
+
}, elemBefore, /*#__PURE__*/React.createElement("span", null, label));
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
return this.getOptionLabel(data);
|
|
1237
1332
|
}
|
|
1238
1333
|
formatGroupLabel(data) {
|
|
1239
1334
|
return this.props.formatGroupLabel(data);
|
package/dist/es2019/styles.js
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
import { containerCSS, indicatorsContainerCSS, valueContainerCSS } from './components/containers';
|
|
2
|
-
import { css as controlCSS } from './components/control';
|
|
3
|
-
import { groupCSS, groupHeadingCSS } from './components/group';
|
|
4
|
-
import { clearIndicatorCSS, dropdownIndicatorCSS, loadingIndicatorCSS } from './components/indicators';
|
|
5
|
-
import { inputCSS } from './components/input';
|
|
6
|
-
import { loadingMessageCSS, menuCSS, menuListCSS, menuPortalCSS, noOptionsMessageCSS } from './components/menu';
|
|
7
|
-
import { multiValueCSS, multiValueLabelCSS, multiValueRemoveCSS } from './components/multi-value';
|
|
8
|
-
import { optionCSS } from './components/option';
|
|
9
|
-
import { placeholderCSS } from './components/placeholder';
|
|
10
|
-
import { css as singleValueCSS } from './components/single-value';
|
|
11
|
-
export const defaultStyles = {
|
|
12
|
-
clearIndicator: clearIndicatorCSS,
|
|
13
|
-
container: containerCSS,
|
|
14
|
-
control: controlCSS,
|
|
15
|
-
dropdownIndicator: dropdownIndicatorCSS,
|
|
16
|
-
group: groupCSS,
|
|
17
|
-
groupHeading: groupHeadingCSS,
|
|
18
|
-
indicatorsContainer: indicatorsContainerCSS,
|
|
19
|
-
input: inputCSS,
|
|
20
|
-
loadingIndicator: loadingIndicatorCSS,
|
|
21
|
-
loadingMessage: loadingMessageCSS,
|
|
22
|
-
menu: menuCSS,
|
|
23
|
-
menuList: menuListCSS,
|
|
24
|
-
menuPortal: menuPortalCSS,
|
|
25
|
-
multiValue: multiValueCSS,
|
|
26
|
-
multiValueLabel: multiValueLabelCSS,
|
|
27
|
-
multiValueRemove: multiValueRemoveCSS,
|
|
28
|
-
noOptionsMessage: noOptionsMessageCSS,
|
|
29
|
-
option: optionCSS,
|
|
30
|
-
placeholder: placeholderCSS,
|
|
31
|
-
singleValue: singleValueCSS,
|
|
32
|
-
valueContainer: valueContainerCSS
|
|
33
|
-
};
|
|
34
1
|
// Merge Utility
|
|
35
2
|
// Allows consumers to extend a base Select with additional styles
|
|
36
3
|
export function mergeStyles(source, target = {}) {
|
package/dist/es2019/use-async.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
2
|
+
function handleInputChange(inputValue, actionMeta, onInputChange) {
|
|
3
|
+
if (onInputChange) {
|
|
4
|
+
const newValue = onInputChange(inputValue, actionMeta);
|
|
5
|
+
if (typeof newValue === 'string') {
|
|
6
|
+
return newValue;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return inputValue;
|
|
10
|
+
}
|
|
3
11
|
// TODO: Fill in the hook {description}.
|
|
4
12
|
/**
|
|
5
13
|
* {description}.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import { getOptionLabel as baseGetOptionLabel, getOptionValue as baseGetOptionValue } from './builtins';
|
|
3
|
-
import { cleanValue
|
|
3
|
+
import { cleanValue } from './internal/clean-value';
|
|
4
|
+
import { valueTernary } from './internal/value-ternary';
|
|
4
5
|
const compareOption = (inputValue = '', option, accessors) => {
|
|
5
6
|
const candidate = String(inputValue).toLowerCase();
|
|
6
7
|
const optionValue = String(accessors.getOptionValue(option)).toLowerCase();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
._11c81d4k{font:var(--ds-font-body-large,normal 400 1pc/24px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._16jlkb7n{flex-grow:1}
|
|
3
3
|
._18m915vq{overflow-y:hidden}
|
|
4
|
-
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
4
|
._1e0c11p5{display:grid}
|
|
6
5
|
._1e0c1txw{display:flex}
|
|
7
6
|
._1eim1xrj{direction:rtl}
|
|
8
7
|
._1n261g80{flex-wrap:wrap}
|
|
9
8
|
._1o9zidpf{flex-shrink:0}
|
|
10
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1q51v77o{padding-block-start:var(--ds-space-025,2px)}
|
|
11
|
+
._1q51ze3t{padding-block-start:var(--ds-space-0,0)}
|
|
11
12
|
._1reo15vq{overflow-x:hidden}
|
|
12
13
|
._1wpz1fhb{align-self:stretch}
|
|
13
14
|
._4cvr1h6o{align-items:center}
|
|
14
15
|
._80om13gf{cursor:not-allowed}
|
|
16
|
+
._85i5v77o{padding-block-end:var(--ds-space-025,2px)}
|
|
17
|
+
._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
|
|
15
18
|
._8am5i4x0{-webkit-overflow-scrolling:touch}
|
|
16
|
-
.
|
|
17
|
-
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
19
|
+
._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
|
|
18
20
|
._i0dlf1ug{flex-basis:0%}
|
|
19
21
|
._kqswh2mm{position:relative}
|
|
20
22
|
._lcxv1rj4{pointer-events:all}
|
|
21
|
-
.
|
|
22
|
-
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
23
|
-
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
23
|
+
._y4ti12x7{padding-inline-end:var(--ds-space-075,6px)}
|
|
24
24
|
._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
|
|
25
25
|
@media (min-width:30rem){._1tn2fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}}
|
|
@@ -4,16 +4,12 @@ import "./containers.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
|
-
import { getStyleProps } from '../../
|
|
7
|
+
import { getStyleProps } from '../../get-style-props';
|
|
8
8
|
|
|
9
9
|
// ==============================
|
|
10
10
|
// Root Container
|
|
11
11
|
// ==============================
|
|
12
12
|
|
|
13
|
-
export var containerCSS = function containerCSS() {
|
|
14
|
-
return {};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
13
|
// iOS Safari automatically zooms into form inputs on focus when the font size is less than 16px.
|
|
18
14
|
// To prevent this zoom behaviour on mobile devices, the select container uses font.body.large (16px) by default,
|
|
19
15
|
// then switches to the smaller font.body on screens wider than 30rem (desktop).
|
|
@@ -51,13 +47,10 @@ export var SelectContainer = function SelectContainer(props) {
|
|
|
51
47
|
// Value Container
|
|
52
48
|
// ==============================
|
|
53
49
|
|
|
54
|
-
export var valueContainerCSS = function valueContainerCSS() {
|
|
55
|
-
return {};
|
|
56
|
-
};
|
|
57
50
|
var valueContainerStyles = {
|
|
58
|
-
default: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _4cvr1h6o _1e0c11p5 _1n261g80 _8am5i4x0 _kqswh2mm
|
|
51
|
+
default: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _4cvr1h6o _1e0c11p5 _1n261g80 _8am5i4x0 _kqswh2mm _1q51v77o _y4ti12x7 _85i5v77o _bozg12x7",
|
|
59
52
|
flex: "_1e0c1txw",
|
|
60
|
-
compact: "
|
|
53
|
+
compact: "_1q51ze3t _y4ti12x7 _85i5ze3t _bozg12x7"
|
|
61
54
|
};
|
|
62
55
|
|
|
63
56
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
@@ -89,9 +82,6 @@ export var ValueContainer = function ValueContainer(props) {
|
|
|
89
82
|
// Indicator Container
|
|
90
83
|
// ==============================
|
|
91
84
|
|
|
92
|
-
export var indicatorsContainerCSS = function indicatorsContainerCSS() {
|
|
93
|
-
return {};
|
|
94
|
-
};
|
|
95
85
|
var indicatorContainerStyles = null;
|
|
96
86
|
|
|
97
87
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|