baseui 0.0.0-next-2aecb6f → 0.0.0-next-aad2baf
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/a11y/a11y.js.flow +12 -15
- package/a11y/index.js.flow +1 -1
- package/a11y/types.js.flow +2 -2
- package/accordion/accordion.js.flow +14 -29
- package/accordion/index.js.flow +6 -6
- package/accordion/panel.js.flow +22 -40
- package/accordion/stateful-panel-container.js.flow +7 -12
- package/accordion/stateful-panel.js.flow +2 -2
- package/accordion/stateless-accordion.js.flow +5 -5
- package/accordion/styled-components.js.flow +10 -10
- package/accordion/types.js.flow +9 -11
- package/app-nav-bar/app-nav-bar.js.flow +18 -34
- package/app-nav-bar/index.js.flow +3 -3
- package/app-nav-bar/mobile-menu.js.flow +26 -55
- package/app-nav-bar/styled-components.js.flow +37 -41
- package/app-nav-bar/types.js.flow +2 -2
- package/app-nav-bar/user-menu.js.flow +27 -51
- package/app-nav-bar/user-profile-tile.js.flow +18 -24
- package/app-nav-bar/utils.js.flow +6 -9
- package/aspect-ratio-box/aspect-ratio-box-body.js.flow +1 -1
- package/aspect-ratio-box/aspect-ratio-box.js.flow +8 -11
- package/aspect-ratio-box/index.js.flow +2 -2
- package/aspect-ratio-box/types.js.flow +1 -1
- package/avatar/avatar.js.flow +5 -16
- package/avatar/index.js.flow +1 -1
- package/avatar/styled-components.js.flow +4 -8
- package/avatar/types.js.flow +1 -1
- package/block/block.js.flow +7 -10
- package/block/index.js.flow +1 -1
- package/block/styled-components.js.flow +23 -23
- package/block/types.js.flow +2 -2
- package/breadcrumbs/breadcrumbs.js.flow +14 -33
- package/breadcrumbs/index.js.flow +1 -1
- package/breadcrumbs/styled-components.js.flow +5 -5
- package/breadcrumbs/types.js.flow +2 -2
- package/button/button-internals.js.flow +7 -10
- package/button/button.js.flow +26 -36
- package/button/default-props.js.flow +1 -1
- package/button/index.js.flow +2 -2
- package/button/styled-components.js.flow +49 -75
- package/button/types.js.flow +3 -3
- package/button/utils.js.flow +1 -1
- package/button-group/button-group.js.flow +10 -12
- package/button-group/index.js.flow +6 -6
- package/button-group/stateful-button-group.js.flow +3 -3
- package/button-group/stateful-container.js.flow +13 -25
- package/button-group/styled-components.js.flow +5 -5
- package/button-group/types.js.flow +8 -11
- package/card/card.js.flow +11 -29
- package/card/index.js.flow +1 -1
- package/card/styled-components.js.flow +8 -8
- package/card/types.js.flow +3 -3
- package/checkbox/checkbox.js.flow +21 -35
- package/checkbox/index.js.flow +4 -4
- package/checkbox/stateful-checkbox-container.js.flow +11 -14
- package/checkbox/stateful-checkbox.js.flow +3 -6
- package/checkbox/styled-components.js.flow +21 -44
- package/checkbox/types.js.flow +4 -4
- package/combobox/combobox.js.flow +18 -26
- package/combobox/index.js.flow +2 -2
- package/combobox/styled-components.js.flow +20 -24
- package/combobox/types.js.flow +4 -4
- package/data-table/column-anchor.js.flow +5 -5
- package/data-table/column-boolean.js.flow +8 -13
- package/data-table/column-categorical.js.flow +18 -23
- package/data-table/column-custom.js.flow +4 -9
- package/data-table/column-datetime.js.flow +41 -89
- package/data-table/column-numerical.js.flow +29 -37
- package/data-table/column-row-index.js.flow +3 -3
- package/data-table/column-string.js.flow +4 -4
- package/data-table/column.js.flow +6 -8
- package/data-table/constants.js.flow +1 -1
- package/data-table/data-table.js.flow +42 -92
- package/data-table/filter-menu.js.flow +17 -28
- package/data-table/filter-shell.js.flow +5 -5
- package/data-table/header-cell.js.flow +109 -119
- package/data-table/index.js.flow +15 -20
- package/data-table/measure-column-widths.js.flow +8 -16
- package/data-table/stateful-container.js.flow +11 -19
- package/data-table/stateful-data-table.js.flow +16 -22
- package/data-table/text-search.js.flow +3 -3
- package/data-table/types.js.flow +10 -13
- package/datepicker/calendar-header.js.flow +91 -156
- package/datepicker/calendar.js.flow +87 -127
- package/datepicker/datepicker.js.flow +57 -133
- package/datepicker/day.js.flow +48 -82
- package/datepicker/index.js.flow +8 -10
- package/datepicker/month.js.flow +9 -13
- package/datepicker/stateful-calendar.js.flow +1 -1
- package/datepicker/stateful-container.js.flow +9 -12
- package/datepicker/stateful-datepicker.js.flow +1 -1
- package/datepicker/styled-components.js.flow +128 -173
- package/datepicker/types.js.flow +32 -32
- package/datepicker/utils/calendar-header-helpers.js.flow +1 -1
- package/datepicker/utils/date-fns-adapter.js.flow +1 -1
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +63 -103
- package/datepicker/utils/day-state.js.flow +1 -1
- package/datepicker/utils/index.js.flow +2 -3
- package/datepicker/utils/types.js.flow +2 -2
- package/datepicker/week.js.flow +8 -11
- package/dnd-list/index.js.flow +7 -6
- package/dnd-list/list.js.flow +17 -44
- package/dnd-list/stateful-list-container.js.flow +6 -9
- package/dnd-list/stateful-list.js.flow +2 -2
- package/dnd-list/styled-components.js.flow +36 -45
- package/dnd-list/types.js.flow +6 -6
- package/drawer/close-icon.js.flow +1 -1
- package/drawer/constants.js.flow +3 -3
- package/drawer/drawer.js.flow +24 -41
- package/drawer/index.js.flow +2 -2
- package/drawer/styled-components.js.flow +30 -43
- package/drawer/types.js.flow +4 -7
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/map-marker/fixed-marker.js +2 -2
- package/es/pagination/index.js +1 -1
- package/es/popover/popover.js +3 -2
- package/es/select/styled-components.js +1 -2
- package/es/timezonepicker/tzdata.js +6 -1
- package/es/timezonepicker/update-tzdata.js +9 -4
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/map-marker/fixed-marker.js +2 -2
- package/esm/pagination/index.js +1 -1
- package/esm/popover/popover.js +3 -2
- package/esm/select/styled-components.js +1 -2
- package/esm/timezonepicker/tzdata.js +6 -1
- package/esm/timezonepicker/update-tzdata.js +11 -13
- package/file-uploader/file-uploader.js.flow +28 -60
- package/file-uploader/index.js.flow +1 -1
- package/file-uploader/styled-components.js.flow +6 -8
- package/file-uploader/types.js.flow +4 -6
- package/flex-grid/flex-grid-item.js.flow +21 -33
- package/flex-grid/flex-grid.js.flow +11 -14
- package/flex-grid/index.js.flow +2 -2
- package/flex-grid/types.js.flow +1 -1
- package/form-control/form-control.js.flow +11 -27
- package/form-control/index.js.flow +1 -1
- package/form-control/styled-components.js.flow +15 -18
- package/form-control/types.js.flow +2 -2
- package/header-navigation/header-navigation.js.flow +5 -10
- package/header-navigation/index.js.flow +2 -2
- package/header-navigation/styled-components.js.flow +36 -39
- package/header-navigation/types.js.flow +1 -1
- package/heading/heading-level.js.flow +3 -7
- package/heading/heading.js.flow +7 -22
- package/heading/index.js.flow +2 -2
- package/heading/types.js.flow +1 -1
- package/helper/constants.js.flow +1 -1
- package/helper/helper-steps.js.flow +8 -21
- package/helper/helper.js.flow +8 -8
- package/helper/index.js.flow +4 -4
- package/helper/stateful-helper.js.flow +4 -4
- package/helper/styled-components.js.flow +10 -22
- package/helpers/base-provider.js.flow +5 -5
- package/helpers/i18n-interpolation.js.flow +2 -2
- package/helpers/overrides.js.flow +17 -35
- package/helpers/react-helpers.js.flow +4 -4
- package/helpers/responsive-helpers.js.flow +1 -1
- package/helpers/strings.js.flow +1 -2
- package/helpers/types.js.flow +2 -2
- package/icon/alert.js.flow +6 -6
- package/icon/arrow-down.js.flow +7 -14
- package/icon/arrow-left.js.flow +7 -14
- package/icon/arrow-right.js.flow +7 -14
- package/icon/arrow-up.js.flow +7 -8
- package/icon/blank.js.flow +6 -6
- package/icon/build-icons.js.flow +9 -18
- package/icon/check-indeterminate.js.flow +7 -15
- package/icon/check.js.flow +6 -6
- package/icon/chevron-down.js.flow +7 -8
- package/icon/chevron-left.js.flow +7 -8
- package/icon/chevron-right.js.flow +7 -10
- package/icon/chevron-up.js.flow +7 -8
- package/icon/delete-alt.js.flow +7 -14
- package/icon/delete.js.flow +6 -6
- package/icon/filter.js.flow +6 -6
- package/icon/grab.js.flow +6 -6
- package/icon/hide.js.flow +6 -6
- package/icon/icon-exports.js.flow +28 -28
- package/icon/icon.js.flow +4 -4
- package/icon/index.js.flow +2 -2
- package/icon/menu.js.flow +6 -6
- package/icon/omit-dollar-prefixed-keys.js.flow +1 -1
- package/icon/overflow.js.flow +7 -8
- package/icon/plus.js.flow +6 -6
- package/icon/search.js.flow +6 -6
- package/icon/show.js.flow +6 -6
- package/icon/spinner.js.flow +7 -8
- package/icon/styled-components.js.flow +3 -3
- package/icon/triangle-down.js.flow +7 -16
- package/icon/triangle-left.js.flow +7 -16
- package/icon/triangle-right.js.flow +7 -16
- package/icon/triangle-up.js.flow +7 -14
- package/icon/types.js.flow +1 -1
- package/icon/upload.js.flow +6 -6
- package/index.js.flow +5 -5
- package/input/base-input.js.flow +29 -56
- package/input/index.js.flow +6 -11
- package/input/input.js.flow +13 -27
- package/input/masked-input.js.flow +5 -5
- package/input/stateful-container.js.flow +6 -11
- package/input/stateful-input.js.flow +1 -1
- package/input/styled-components.js.flow +31 -60
- package/input/types.js.flow +5 -12
- package/input/utils.js.flow +4 -9
- package/layer/index.js.flow +4 -4
- package/layer/layer.js.flow +16 -27
- package/layer/layers-manager.js.flow +17 -26
- package/layer/tether.js.flow +12 -14
- package/layer/types.js.flow +2 -2
- package/layer/utils.js.flow +2 -8
- package/layout-grid/cell.js.flow +5 -8
- package/layout-grid/grid.js.flow +11 -26
- package/layout-grid/index.js.flow +2 -2
- package/layout-grid/styled-components.js.flow +17 -41
- package/layout-grid/types.js.flow +3 -6
- package/link/index.js.flow +6 -6
- package/link/styled-components.js.flow +5 -7
- package/list/index.js.flow +5 -5
- package/list/list-heading.js.flow +76 -91
- package/list/list-item-label.js.flow +8 -12
- package/list/list-item.js.flow +64 -69
- package/list/menu-adapter.js.flow +31 -35
- package/list/styled-components.js.flow +52 -60
- package/list/types.js.flow +4 -4
- package/list/utils.js.flow +3 -6
- package/locale/es_AR.js.flow +1 -2
- package/locale/index.js.flow +5 -10
- package/locale/types.js.flow +12 -12
- package/map-marker/badge-enhancer.js.flow +12 -27
- package/map-marker/constants.js.flow +3 -3
- package/map-marker/drag-shadow.js.flow +8 -23
- package/map-marker/fixed-marker.js +2 -2
- package/map-marker/fixed-marker.js.flow +15 -26
- package/map-marker/floating-marker.js.flow +12 -17
- package/map-marker/index.js.flow +2 -2
- package/map-marker/label-enhancer.js.flow +6 -9
- package/map-marker/needle.js.flow +6 -12
- package/map-marker/pin-head.js.flow +14 -37
- package/map-marker/styled-components.js.flow +45 -60
- package/map-marker/types.js.flow +9 -11
- package/menu/index.js.flow +7 -7
- package/menu/maybe-child-menu.js.flow +8 -11
- package/menu/menu.js.flow +14 -23
- package/menu/nested-menus.js.flow +16 -17
- package/menu/option-list.js.flow +10 -15
- package/menu/option-profile.js.flow +13 -29
- package/menu/stateful-container.js.flow +34 -56
- package/menu/stateful-menu.js.flow +3 -3
- package/menu/styled-components.js.flow +42 -59
- package/menu/types.js.flow +21 -26
- package/menu/utils.js.flow +1 -1
- package/modal/close-icon.js.flow +2 -6
- package/modal/focus-once.js.flow +1 -1
- package/modal/index.js.flow +4 -4
- package/modal/modal-button.js.flow +9 -16
- package/modal/modal.js.flow +21 -36
- package/modal/styled-components.js.flow +13 -17
- package/modal/types.js.flow +5 -11
- package/notification/index.js.flow +2 -2
- package/notification/notification.js.flow +2 -2
- package/package.json +6 -2
- package/pagination/index.js +8 -8
- package/pagination/index.js.flow +8 -11
- package/pagination/pagination.js.flow +37 -60
- package/pagination/stateful-container.js.flow +12 -20
- package/pagination/stateful-pagination.js.flow +2 -4
- package/pagination/styled-components.js.flow +10 -14
- package/pagination/types.js.flow +7 -7
- package/payment-card/icons/amex.js.flow +2 -5
- package/payment-card/icons/dinersclub.js.flow +1 -1
- package/payment-card/icons/discover.js.flow +1 -1
- package/payment-card/icons/elo.js.flow +1 -1
- package/payment-card/icons/generic.js.flow +1 -1
- package/payment-card/icons/jcb.js.flow +4 -13
- package/payment-card/icons/maestro.js.flow +1 -1
- package/payment-card/icons/mastercard.js.flow +1 -1
- package/payment-card/icons/unionpay.js.flow +1 -1
- package/payment-card/icons/visa.js.flow +1 -1
- package/payment-card/index.js.flow +6 -6
- package/payment-card/payment-card.js.flow +12 -18
- package/payment-card/stateful-payment-card.js.flow +1 -1
- package/payment-card/styled-components.js.flow +5 -6
- package/payment-card/types.js.flow +2 -6
- package/payment-card/utils.js.flow +6 -18
- package/phone-input/base-country-picker.js.flow +22 -37
- package/phone-input/constants.js.flow +227 -227
- package/phone-input/country-picker.js.flow +17 -28
- package/phone-input/country-select-dropdown.js.flow +26 -41
- package/phone-input/country-select.js.flow +10 -22
- package/phone-input/default-props.js.flow +2 -6
- package/phone-input/flag.js.flow +6 -6
- package/phone-input/flags/index.js.flow +241 -241
- package/phone-input/index.js.flow +10 -10
- package/phone-input/phone-input-lite.js.flow +6 -6
- package/phone-input/phone-input-next.js.flow +13 -15
- package/phone-input/phone-input.js.flow +2 -2
- package/phone-input/stateful-phone-input-container.js.flow +4 -4
- package/phone-input/stateful-phone-input-next.js.flow +3 -5
- package/phone-input/stateful-phone-input.js.flow +1 -1
- package/phone-input/styled-components.js.flow +52 -62
- package/phone-input/types.js.flow +7 -11
- package/phone-input/utils.js.flow +2 -4
- package/pin-code/default-props.js.flow +1 -1
- package/pin-code/index.js.flow +4 -4
- package/pin-code/pin-code.js.flow +13 -25
- package/pin-code/stateful-pin-code-container.js.flow +6 -10
- package/pin-code/stateful-pin-code.js.flow +1 -1
- package/pin-code/styled-components.js.flow +19 -22
- package/pin-code/types.js.flow +4 -4
- package/popover/default-props.js.flow +2 -2
- package/popover/index.js.flow +3 -3
- package/popover/popover.js +3 -2
- package/popover/popover.js.flow +41 -69
- package/popover/stateful-container.js.flow +4 -7
- package/popover/stateful-popover.js.flow +3 -8
- package/popover/styled-components.js.flow +13 -26
- package/popover/types.js.flow +11 -25
- package/popover/utils.js.flow +8 -15
- package/progress-bar/index.js.flow +3 -3
- package/progress-bar/progressbar-rounded.js.flow +5 -6
- package/progress-bar/progressbar.js.flow +18 -35
- package/progress-bar/styled-components.js.flow +84 -103
- package/progress-bar/types.js.flow +3 -7
- package/progress-steps/index.js.flow +3 -3
- package/progress-steps/numbered-step.js.flow +6 -15
- package/progress-steps/progress-steps.js.flow +7 -14
- package/progress-steps/step.js.flow +7 -20
- package/progress-steps/styled-components.js.flow +25 -29
- package/progress-steps/types.js.flow +2 -2
- package/radio/index.js.flow +5 -5
- package/radio/radio.js.flow +11 -14
- package/radio/radiogroup.js.flow +19 -31
- package/radio/stateful-radiogroup-container.js.flow +7 -10
- package/radio/stateful-radiogroup.js.flow +3 -5
- package/radio/styled-components.js.flow +20 -26
- package/radio/types.js.flow +4 -4
- package/rating/emoticon-rating.js.flow +23 -37
- package/rating/index.js.flow +2 -2
- package/rating/star-rating.js.flow +20 -31
- package/rating/styled-components.js.flow +8 -27
- package/rating/types.js.flow +4 -4
- package/select/autosize-input.js.flow +10 -17
- package/select/constants.js.flow +1 -1
- package/select/default-props.js.flow +1 -1
- package/select/dropdown.js.flow +17 -22
- package/select/index.js.flow +11 -11
- package/select/multi-select.js.flow +2 -4
- package/select/multi-value.js.flow +5 -8
- package/select/select-component.js.flow +79 -159
- package/select/select.js.flow +1 -6
- package/select/single-select.js.flow +1 -1
- package/select/stateful-select-container.js.flow +5 -13
- package/select/stateful-select.js.flow +1 -1
- package/select/styled-components.js.flow +207 -267
- package/select/types.js.flow +8 -12
- package/select/utils/default-filter-options.js.flow +4 -5
- package/select/utils/index.js.flow +3 -6
- package/select/value.js.flow +4 -7
- package/side-navigation/index.js.flow +2 -2
- package/side-navigation/nav-item.js.flow +8 -9
- package/side-navigation/nav.js.flow +14 -28
- package/side-navigation/stateful-container.js.flow +8 -17
- package/side-navigation/stateful-nav.js.flow +1 -1
- package/side-navigation/styled-components.js.flow +13 -17
- package/side-navigation/types.js.flow +6 -6
- package/skeleton/index.js.flow +1 -1
- package/skeleton/skeleton.js.flow +4 -4
- package/skeleton/styled-components.js.flow +14 -17
- package/skeleton/types.js.flow +1 -1
- package/slider/index.js.flow +3 -3
- package/slider/slider.js.flow +17 -41
- package/slider/stateful-slider-container.js.flow +9 -12
- package/slider/stateful-slider.js.flow +1 -1
- package/slider/styled-components.js.flow +13 -13
- package/slider/types.js.flow +7 -11
- package/snackbar/index.js.flow +3 -3
- package/snackbar/snackbar-context.js.flow +13 -20
- package/snackbar/snackbar-element.js.flow +18 -30
- package/snackbar/styled-components.js.flow +18 -24
- package/snackbar/types.js.flow +2 -2
- package/spinner/index.js.flow +3 -2
- package/spinner/spinner.js.flow +8 -18
- package/spinner/styled-components.js.flow +6 -6
- package/spinner/types.js.flow +3 -3
- package/styles/as-primary-export-hoc.js.flow +1 -1
- package/styles/index.js.flow +3 -3
- package/styles/styled.js.flow +24 -33
- package/styles/theme-provider.js.flow +6 -9
- package/styles/types.js.flow +2 -2
- package/styles/util.js.flow +2 -2
- package/table/filter.js.flow +12 -28
- package/table/index.js.flow +4 -7
- package/table/sortable-head-cell.js.flow +9 -12
- package/table/styled-components.js.flow +60 -72
- package/table/table.js.flow +2 -2
- package/table/types.js.flow +2 -2
- package/table-grid/index.js.flow +3 -7
- package/table-grid/sortable-head-cell.js.flow +2 -2
- package/table-grid/styled-components.js.flow +19 -21
- package/table-semantic/index.js.flow +4 -4
- package/table-semantic/styled-components.js.flow +88 -128
- package/table-semantic/table-builder-column.js.flow +2 -4
- package/table-semantic/table-builder.js.flow +32 -66
- package/table-semantic/table.js.flow +13 -28
- package/table-semantic/types.js.flow +2 -2
- package/tabs/index.js.flow +4 -4
- package/tabs/stateful-tabs.js.flow +8 -24
- package/tabs/styled-components.js.flow +7 -7
- package/tabs/tab.js.flow +13 -16
- package/tabs/tabs.js.flow +15 -36
- package/tabs/types.js.flow +5 -5
- package/tabs-motion/stateful-tabs.js.flow +10 -23
- package/tabs-motion/styled-components.js.flow +59 -71
- package/tabs-motion/tab.js.flow +1 -1
- package/tabs-motion/tabs.js.flow +27 -55
- package/tabs-motion/types.js.flow +5 -5
- package/tabs-motion/utils.js.flow +6 -10
- package/tag/index.js.flow +2 -2
- package/tag/styled-components.js.flow +27 -39
- package/tag/tag.js.flow +9 -13
- package/tag/types.js.flow +2 -2
- package/tag/utils.js.flow +2 -4
- package/textarea/constants.js.flow +1 -1
- package/textarea/index.js.flow +5 -5
- package/textarea/stateful-container.js.flow +1 -0
- package/textarea/stateful-textarea.js.flow +1 -1
- package/textarea/styled-components.js.flow +10 -10
- package/textarea/textarea.js.flow +10 -10
- package/textarea/types.js.flow +3 -3
- package/themes/dark-theme/borders.js.flow +1 -1
- package/themes/dark-theme/color-component-tokens.js.flow +2 -4
- package/themes/dark-theme/color-deprecated-semantic-tokens.js.flow +1 -1
- package/themes/dark-theme/color-semantic-tokens.js.flow +2 -2
- package/themes/dark-theme/color-tokens.js.flow +2 -2
- package/themes/dark-theme/create-dark-theme.js.flow +5 -7
- package/themes/dark-theme/dark-theme.js.flow +1 -1
- package/themes/dark-theme/primitives.js.flow +2 -2
- package/themes/index.js.flow +4 -4
- package/themes/light-theme/color-component-tokens.js.flow +2 -4
- package/themes/light-theme/color-deprecated-semantic-tokens.js.flow +2 -4
- package/themes/light-theme/color-semantic-tokens.js.flow +2 -2
- package/themes/light-theme/color-tokens.js.flow +2 -2
- package/themes/light-theme/create-light-theme.js.flow +5 -7
- package/themes/light-theme/light-theme.js.flow +1 -1
- package/themes/light-theme/primitives.js.flow +2 -2
- package/themes/move-theme/dark-theme-with-move.js.flow +3 -6
- package/themes/move-theme/light-theme-with-move.js.flow +3 -6
- package/themes/move-theme/typography.js.flow +28 -29
- package/themes/shared/animation.js.flow +1 -1
- package/themes/shared/borders.js.flow +1 -1
- package/themes/shared/breakpoints.js.flow +1 -1
- package/themes/shared/grid.js.flow +1 -1
- package/themes/shared/lighting.js.flow +1 -1
- package/themes/shared/media-query.js.flow +2 -2
- package/themes/shared/sizing.js.flow +1 -1
- package/themes/shared/typography.js.flow +20 -21
- package/themes/types.js.flow +3 -8
- package/timepicker/index.js.flow +1 -1
- package/timepicker/timepicker.js.flow +36 -67
- package/timepicker/types.js.flow +4 -4
- package/timezonepicker/index.js.flow +1 -1
- package/timezonepicker/timezone-picker.js.flow +20 -30
- package/timezonepicker/types.js.flow +4 -4
- package/timezonepicker/tzdata.js +6 -1
- package/timezonepicker/tzdata.js.flow +6 -1
- package/timezonepicker/update-tzdata.js +11 -13
- package/timezonepicker/update-tzdata.js.flow +11 -6
- package/toast/index.js.flow +3 -3
- package/toast/styled-components.js.flow +14 -24
- package/toast/toast.js.flow +23 -35
- package/toast/toaster.js.flow +30 -48
- package/toast/types.js.flow +4 -4
- package/tokens/colors.js.flow +1 -1
- package/tokens/index.js.flow +1 -1
- package/tooltip/default-props.js.flow +2 -2
- package/tooltip/index.js.flow +4 -9
- package/tooltip/stateful-tooltip-container.js.flow +2 -2
- package/tooltip/stateful-tooltip.js.flow +2 -2
- package/tooltip/styled-components.js.flow +4 -8
- package/tooltip/tooltip.js.flow +5 -10
- package/tree-view/index.js.flow +5 -5
- package/tree-view/stateful-container.js.flow +10 -16
- package/tree-view/stateful-tree-view.js.flow +1 -1
- package/tree-view/styled-components.js.flow +25 -35
- package/tree-view/tree-label-interactable.js.flow +6 -7
- package/tree-view/tree-label.js.flow +10 -26
- package/tree-view/tree-node.js.flow +7 -8
- package/tree-view/tree-view.js.flow +9 -24
- package/tree-view/types.js.flow +2 -2
- package/tree-view/utils.js.flow +22 -53
- package/typography/index.js.flow +388 -468
- package/utils/create-event.js.flow +1 -1
- package/utils/deep-merge.js.flow +2 -5
- package/utils/deprecated-component.js.flow +1 -1
- package/utils/focusVisible.js.flow +3 -3
|
@@ -8,18 +8,18 @@ LICENSE file in the root directory of this source tree.
|
|
|
8
8
|
/* eslint-disable cup/no-undef */
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
|
|
11
|
-
import {getOverrides} from '../helpers/overrides.js';
|
|
11
|
+
import { getOverrides } from '../helpers/overrides.js';
|
|
12
12
|
import DeleteAlt from '../icon/delete-alt.js';
|
|
13
13
|
import TriangleDownIcon from '../icon/triangle-down.js';
|
|
14
14
|
import SearchIconComponent from '../icon/search.js';
|
|
15
|
-
import {LocaleContext} from '../locale/index.js';
|
|
16
|
-
import type {LocaleT} from '../locale/types.js';
|
|
17
|
-
import {Popover, PLACEMENT} from '../popover/index.js';
|
|
18
|
-
import {Spinner} from '../spinner/index.js';
|
|
19
|
-
import {UIDConsumer} from 'react-uid';
|
|
15
|
+
import { LocaleContext } from '../locale/index.js';
|
|
16
|
+
import type { LocaleT } from '../locale/types.js';
|
|
17
|
+
import { Popover, PLACEMENT } from '../popover/index.js';
|
|
18
|
+
import { Spinner } from '../spinner/index.js';
|
|
19
|
+
import { UIDConsumer } from 'react-uid';
|
|
20
20
|
|
|
21
21
|
import AutosizeInput from './autosize-input.js';
|
|
22
|
-
import {TYPE, STATE_CHANGE_TYPE} from './constants.js';
|
|
22
|
+
import { TYPE, STATE_CHANGE_TYPE } from './constants.js';
|
|
23
23
|
import defaultProps from './default-props.js';
|
|
24
24
|
import SelectDropdown from './dropdown.js';
|
|
25
25
|
import {
|
|
@@ -34,15 +34,8 @@ import {
|
|
|
34
34
|
getLoadingIconStyles,
|
|
35
35
|
StyledSearchIconContainer,
|
|
36
36
|
} from './styled-components.js';
|
|
37
|
-
import type {
|
|
38
|
-
|
|
39
|
-
SelectStateT,
|
|
40
|
-
ValueT,
|
|
41
|
-
OptionT,
|
|
42
|
-
ChangeActionT,
|
|
43
|
-
} from './types.js';
|
|
44
|
-
import {expandValue, normalizeOptions} from './utils/index.js';
|
|
45
|
-
import type {ReactRefT} from './types.js';
|
|
37
|
+
import type { PropsT, SelectStateT, ValueT, OptionT, ChangeActionT, ReactRefT } from './types.js';
|
|
38
|
+
import { expandValue, normalizeOptions } from './utils/index.js';
|
|
46
39
|
|
|
47
40
|
function Noop() {
|
|
48
41
|
return null;
|
|
@@ -126,7 +119,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
126
119
|
this.isItMounted = true;
|
|
127
120
|
|
|
128
121
|
if (this.props.methodsRef) {
|
|
129
|
-
const {methodsRef} = this.props;
|
|
122
|
+
const { methodsRef } = this.props;
|
|
130
123
|
|
|
131
124
|
methodsRef.current = {
|
|
132
125
|
setDropdownOpen: this.handleDropdownOpen.bind(this),
|
|
@@ -231,9 +224,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
231
224
|
if (!this.props.searchable) {
|
|
232
225
|
this.focus();
|
|
233
226
|
if (this.state.isOpen) {
|
|
234
|
-
this.setState({isOpen: false, isFocused: false});
|
|
227
|
+
this.setState({ isOpen: false, isFocused: false });
|
|
235
228
|
} else {
|
|
236
|
-
this.setState({isOpen: true, isFocused: true});
|
|
229
|
+
this.setState({ isOpen: true, isFocused: true });
|
|
237
230
|
}
|
|
238
231
|
|
|
239
232
|
return;
|
|
@@ -371,13 +364,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
371
364
|
}));
|
|
372
365
|
break;
|
|
373
366
|
case 27: // escape
|
|
374
|
-
if (
|
|
375
|
-
!this.state.isOpen &&
|
|
376
|
-
this.props.clearable &&
|
|
377
|
-
this.props.escapeClearsValue
|
|
378
|
-
) {
|
|
367
|
+
if (!this.state.isOpen && this.props.clearable && this.props.escapeClearsValue) {
|
|
379
368
|
this.clearValue(event);
|
|
380
|
-
this.setState({isFocused: false, isPseudoFocused: false});
|
|
369
|
+
this.setState({ isFocused: false, isPseudoFocused: false });
|
|
381
370
|
}
|
|
382
371
|
break;
|
|
383
372
|
case 32: // space
|
|
@@ -386,31 +375,31 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
386
375
|
}
|
|
387
376
|
event.preventDefault();
|
|
388
377
|
if (!this.state.isOpen) {
|
|
389
|
-
this.setState({isOpen: true});
|
|
378
|
+
this.setState({ isOpen: true });
|
|
390
379
|
}
|
|
391
380
|
break;
|
|
392
381
|
case 38: // up
|
|
393
382
|
event.preventDefault();
|
|
394
383
|
if (!this.state.isOpen) {
|
|
395
|
-
this.setState({isOpen: true});
|
|
384
|
+
this.setState({ isOpen: true });
|
|
396
385
|
}
|
|
397
386
|
break;
|
|
398
387
|
case 40: // down
|
|
399
388
|
event.preventDefault();
|
|
400
389
|
if (!this.state.isOpen) {
|
|
401
|
-
this.setState({isOpen: true});
|
|
390
|
+
this.setState({ isOpen: true });
|
|
402
391
|
}
|
|
403
392
|
break;
|
|
404
393
|
case 33: // page up
|
|
405
394
|
event.preventDefault();
|
|
406
395
|
if (!this.state.isOpen) {
|
|
407
|
-
this.setState({isOpen: true});
|
|
396
|
+
this.setState({ isOpen: true });
|
|
408
397
|
}
|
|
409
398
|
break;
|
|
410
399
|
case 34: // page down
|
|
411
400
|
event.preventDefault();
|
|
412
401
|
if (!this.state.isOpen) {
|
|
413
|
-
this.setState({isOpen: true});
|
|
402
|
+
this.setState({ isOpen: true });
|
|
414
403
|
}
|
|
415
404
|
break;
|
|
416
405
|
case 35: // end key
|
|
@@ -419,7 +408,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
419
408
|
}
|
|
420
409
|
event.preventDefault();
|
|
421
410
|
if (!this.state.isOpen) {
|
|
422
|
-
this.setState({isOpen: true});
|
|
411
|
+
this.setState({ isOpen: true });
|
|
423
412
|
}
|
|
424
413
|
break;
|
|
425
414
|
case 36: // home key
|
|
@@ -428,7 +417,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
428
417
|
}
|
|
429
418
|
event.preventDefault();
|
|
430
419
|
if (!this.state.isOpen) {
|
|
431
|
-
this.setState({isOpen: true});
|
|
420
|
+
this.setState({ isOpen: true });
|
|
432
421
|
}
|
|
433
422
|
break;
|
|
434
423
|
case 46: // delete
|
|
@@ -451,13 +440,13 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
451
440
|
$disabled: boolean,
|
|
452
441
|
$isHighlighted: boolean,
|
|
453
442
|
},
|
|
454
|
-
}
|
|
443
|
+
}
|
|
455
444
|
): React.Node =>
|
|
456
445
|
option.isCreatable
|
|
457
446
|
? `${locale.select.create} “${option[this.props.labelKey]}”`
|
|
458
447
|
: option[this.props.labelKey];
|
|
459
448
|
|
|
460
|
-
getValueLabel = ({option}: {option: OptionT}): React.Node => {
|
|
449
|
+
getValueLabel = ({ option }: { option: OptionT }): React.Node => {
|
|
461
450
|
return option[this.props.labelKey];
|
|
462
451
|
};
|
|
463
452
|
|
|
@@ -484,9 +473,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
484
473
|
|
|
485
474
|
handleActiveDescendantChange = (id?: string) => {
|
|
486
475
|
if (id) {
|
|
487
|
-
this.setState({activeDescendant: id});
|
|
476
|
+
this.setState({ activeDescendant: id });
|
|
488
477
|
} else {
|
|
489
|
-
this.setState({activeDescendant: null});
|
|
478
|
+
this.setState({ activeDescendant: null });
|
|
490
479
|
}
|
|
491
480
|
};
|
|
492
481
|
|
|
@@ -502,16 +491,14 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
502
491
|
}
|
|
503
492
|
};
|
|
504
493
|
|
|
505
|
-
selectValue = ({item}: {item: OptionT}) => {
|
|
494
|
+
selectValue = ({ item }: { item: OptionT }) => {
|
|
506
495
|
if (item.disabled) {
|
|
507
496
|
return;
|
|
508
497
|
}
|
|
509
498
|
this.justSelected = true;
|
|
510
499
|
// NOTE: we add/set the value in a callback to make sure the
|
|
511
500
|
// input value is empty to avoid styling issues in Chrome
|
|
512
|
-
const updatedValue = this.props.onSelectResetsInput
|
|
513
|
-
? ''
|
|
514
|
-
: this.state.inputValue;
|
|
501
|
+
const updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue;
|
|
515
502
|
if (this.props.multi) {
|
|
516
503
|
this.setState(
|
|
517
504
|
{
|
|
@@ -520,16 +507,12 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
520
507
|
},
|
|
521
508
|
() => {
|
|
522
509
|
const valueArray = this.props.value;
|
|
523
|
-
if (
|
|
524
|
-
valueArray.some(
|
|
525
|
-
(i) => i[this.props.valueKey] === item[this.props.valueKey],
|
|
526
|
-
)
|
|
527
|
-
) {
|
|
510
|
+
if (valueArray.some((i) => i[this.props.valueKey] === item[this.props.valueKey])) {
|
|
528
511
|
this.removeValue(item);
|
|
529
512
|
} else {
|
|
530
513
|
this.addValue(item);
|
|
531
514
|
}
|
|
532
|
-
}
|
|
515
|
+
}
|
|
533
516
|
);
|
|
534
517
|
} else {
|
|
535
518
|
this.focus();
|
|
@@ -542,7 +525,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
542
525
|
},
|
|
543
526
|
() => {
|
|
544
527
|
this.setValue([item], item, STATE_CHANGE_TYPE.select);
|
|
545
|
-
}
|
|
528
|
+
}
|
|
546
529
|
);
|
|
547
530
|
}
|
|
548
531
|
};
|
|
@@ -559,12 +542,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
559
542
|
}
|
|
560
543
|
const valueLength = this.props.value.length;
|
|
561
544
|
const renderLabel = this.props.getValueLabel || this.getValueLabel;
|
|
562
|
-
const labelForInput = renderLabel({option: item, index: valueLength - 1});
|
|
545
|
+
const labelForInput = renderLabel({ option: item, index: valueLength - 1 });
|
|
563
546
|
// label might not be a string, it might be a Node of another kind.
|
|
564
|
-
if (
|
|
565
|
-
!this.props.backspaceClearsInputValue &&
|
|
566
|
-
typeof labelForInput === 'string'
|
|
567
|
-
) {
|
|
547
|
+
if (!this.props.backspaceClearsInputValue && typeof labelForInput === 'string') {
|
|
568
548
|
const remainingInput = labelForInput.slice(0, -1);
|
|
569
549
|
this.setState({
|
|
570
550
|
inputValue: remainingInput,
|
|
@@ -586,11 +566,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
586
566
|
removeValue = (item: OptionT) => {
|
|
587
567
|
const valueArray = [...this.props.value];
|
|
588
568
|
this.setValue(
|
|
589
|
-
valueArray.filter(
|
|
590
|
-
(i) => i[this.props.valueKey] !== item[this.props.valueKey],
|
|
591
|
-
),
|
|
569
|
+
valueArray.filter((i) => i[this.props.valueKey] !== item[this.props.valueKey]),
|
|
592
570
|
item,
|
|
593
|
-
STATE_CHANGE_TYPE.remove
|
|
571
|
+
STATE_CHANGE_TYPE.remove
|
|
594
572
|
);
|
|
595
573
|
this.focus();
|
|
596
574
|
};
|
|
@@ -599,9 +577,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
599
577
|
if (isClick(event) && !isLeftClick(event)) return;
|
|
600
578
|
|
|
601
579
|
if (this.props.value) {
|
|
602
|
-
const resetValue = this.props.value.filter(
|
|
603
|
-
(item) => item.clearableValue === false,
|
|
604
|
-
);
|
|
580
|
+
const resetValue = this.props.value.filter((item) => item.clearableValue === false);
|
|
605
581
|
this.setValue(resetValue, null, STATE_CHANGE_TYPE.clear);
|
|
606
582
|
}
|
|
607
583
|
this.setState({
|
|
@@ -614,10 +590,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
614
590
|
};
|
|
615
591
|
|
|
616
592
|
shouldShowPlaceholder = () => {
|
|
617
|
-
return !(
|
|
618
|
-
this.state.inputValue ||
|
|
619
|
-
(this.props.value && this.props.value.length)
|
|
620
|
-
);
|
|
593
|
+
return !(this.state.inputValue || (this.props.value && this.props.value.length));
|
|
621
594
|
};
|
|
622
595
|
|
|
623
596
|
shouldShowValue = () => {
|
|
@@ -627,15 +600,15 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
627
600
|
renderLoading() {
|
|
628
601
|
if (!this.props.isLoading) return;
|
|
629
602
|
const sharedProps = this.getSharedProps();
|
|
630
|
-
const {overrides = {}} = this.props;
|
|
603
|
+
const { overrides = {} } = this.props;
|
|
631
604
|
const [LoadingIndicator, loadingIndicatorProps] = getOverrides(
|
|
632
605
|
overrides.LoadingIndicator,
|
|
633
|
-
Spinner
|
|
606
|
+
Spinner
|
|
634
607
|
);
|
|
635
608
|
return (
|
|
636
609
|
<LoadingIndicator
|
|
637
610
|
size={16}
|
|
638
|
-
overrides={{Svg: {style: getLoadingIconStyles}}}
|
|
611
|
+
overrides={{ Svg: { style: getLoadingIconStyles } }}
|
|
639
612
|
$silenceV11DeprecationWarning
|
|
640
613
|
{...sharedProps}
|
|
641
614
|
{...loadingIndicatorProps}
|
|
@@ -646,9 +619,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
646
619
|
renderValue(
|
|
647
620
|
valueArray: ValueT,
|
|
648
621
|
isOpen: boolean,
|
|
649
|
-
locale: LocaleT
|
|
622
|
+
locale: LocaleT
|
|
650
623
|
): ?React.Node | Array<?React.Node> {
|
|
651
|
-
const {overrides = {}} = this.props;
|
|
624
|
+
const { overrides = {} } = this.props;
|
|
652
625
|
const sharedProps = this.getSharedProps();
|
|
653
626
|
const renderLabel = this.props.getValueLabel || this.getValueLabel;
|
|
654
627
|
const Value = this.props.valueComponent || Noop;
|
|
@@ -657,19 +630,18 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
657
630
|
}
|
|
658
631
|
if (this.props.multi) {
|
|
659
632
|
return valueArray.map((value, i) => {
|
|
660
|
-
const disabled =
|
|
661
|
-
sharedProps.$disabled || value.clearableValue === false;
|
|
633
|
+
const disabled = sharedProps.$disabled || value.clearableValue === false;
|
|
662
634
|
return (
|
|
663
635
|
<Value
|
|
664
636
|
value={value}
|
|
665
637
|
key={`value-${i}-${value[this.props.valueKey]}`}
|
|
666
638
|
removeValue={() => this.removeValue(value)}
|
|
667
639
|
disabled={disabled}
|
|
668
|
-
overrides={{Tag: overrides.Tag, MultiValue: overrides.MultiValue}}
|
|
640
|
+
overrides={{ Tag: overrides.Tag, MultiValue: overrides.MultiValue }}
|
|
669
641
|
{...sharedProps}
|
|
670
642
|
$disabled={disabled}
|
|
671
643
|
>
|
|
672
|
-
{renderLabel({option: value, index: i})}
|
|
644
|
+
{renderLabel({ option: value, index: i })}
|
|
673
645
|
</Value>
|
|
674
646
|
);
|
|
675
647
|
});
|
|
@@ -678,20 +650,20 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
678
650
|
<Value
|
|
679
651
|
value={valueArray[0][this.props.valueKey]}
|
|
680
652
|
disabled={this.props.disabled}
|
|
681
|
-
overrides={{SingleValue: overrides.SingleValue}}
|
|
653
|
+
overrides={{ SingleValue: overrides.SingleValue }}
|
|
682
654
|
{...sharedProps}
|
|
683
655
|
>
|
|
684
|
-
{renderLabel({option: valueArray[0]})}
|
|
656
|
+
{renderLabel({ option: valueArray[0] })}
|
|
685
657
|
</Value>
|
|
686
658
|
);
|
|
687
659
|
}
|
|
688
660
|
}
|
|
689
661
|
|
|
690
662
|
renderInput(listboxId: string) {
|
|
691
|
-
const {overrides = {}} = this.props;
|
|
663
|
+
const { overrides = {} } = this.props;
|
|
692
664
|
const [InputContainer, inputContainerProps] = getOverrides(
|
|
693
665
|
overrides.InputContainer,
|
|
694
|
-
StyledInputContainer
|
|
666
|
+
StyledInputContainer
|
|
695
667
|
);
|
|
696
668
|
const sharedProps = this.getSharedProps();
|
|
697
669
|
const isOpen = this.state.isOpen;
|
|
@@ -762,7 +734,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
762
734
|
inputRef={this.handleInputRef}
|
|
763
735
|
onChange={this.handleInputChange}
|
|
764
736
|
onFocus={this.handleInputFocus}
|
|
765
|
-
overrides={{Input: overrides.Input}}
|
|
737
|
+
overrides={{ Input: overrides.Input }}
|
|
766
738
|
required={(this.props.required && !this.props.value.length) || null}
|
|
767
739
|
role="combobox"
|
|
768
740
|
value={this.state.inputValue}
|
|
@@ -775,24 +747,16 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
775
747
|
|
|
776
748
|
renderClear() {
|
|
777
749
|
const isValueEntered = Boolean(
|
|
778
|
-
(this.props.value && this.props.value.length) || this.state.inputValue
|
|
750
|
+
(this.props.value && this.props.value.length) || this.state.inputValue
|
|
779
751
|
);
|
|
780
752
|
|
|
781
|
-
if (
|
|
782
|
-
!this.props.clearable ||
|
|
783
|
-
this.props.disabled ||
|
|
784
|
-
this.props.isLoading ||
|
|
785
|
-
!isValueEntered
|
|
786
|
-
) {
|
|
753
|
+
if (!this.props.clearable || this.props.disabled || this.props.isLoading || !isValueEntered) {
|
|
787
754
|
return;
|
|
788
755
|
}
|
|
789
756
|
|
|
790
757
|
const sharedProps = this.getSharedProps();
|
|
791
|
-
const {overrides = {}} = this.props;
|
|
792
|
-
const [ClearIcon, clearIconProps] = getOverrides(
|
|
793
|
-
overrides.ClearIcon,
|
|
794
|
-
DeleteAlt,
|
|
795
|
-
);
|
|
758
|
+
const { overrides = {} } = this.props;
|
|
759
|
+
const [ClearIcon, clearIconProps] = getOverrides(overrides.ClearIcon, DeleteAlt);
|
|
796
760
|
const ariaLabel = this.props.multi ? 'Clear all' : 'Clear value';
|
|
797
761
|
|
|
798
762
|
return (
|
|
@@ -805,13 +769,9 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
805
769
|
Svg: {
|
|
806
770
|
component: StyledClearIcon,
|
|
807
771
|
props:
|
|
808
|
-
overrides.ClearIcon && overrides.ClearIcon.props
|
|
809
|
-
? overrides.ClearIcon.props
|
|
810
|
-
: {},
|
|
772
|
+
overrides.ClearIcon && overrides.ClearIcon.props ? overrides.ClearIcon.props : {},
|
|
811
773
|
style:
|
|
812
|
-
overrides.ClearIcon && overrides.ClearIcon.style
|
|
813
|
-
? overrides.ClearIcon.style
|
|
814
|
-
: {},
|
|
774
|
+
overrides.ClearIcon && overrides.ClearIcon.style ? overrides.ClearIcon.style : {},
|
|
815
775
|
},
|
|
816
776
|
}}
|
|
817
777
|
{...sharedProps}
|
|
@@ -824,11 +784,8 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
824
784
|
if (this.props.type !== TYPE.select) {
|
|
825
785
|
return null;
|
|
826
786
|
}
|
|
827
|
-
const {overrides = {}} = this.props;
|
|
828
|
-
const [SelectArrow, selectArrowProps] = getOverrides(
|
|
829
|
-
overrides.SelectArrow,
|
|
830
|
-
TriangleDownIcon,
|
|
831
|
-
);
|
|
787
|
+
const { overrides = {} } = this.props;
|
|
788
|
+
const [SelectArrow, selectArrowProps] = getOverrides(overrides.SelectArrow, TriangleDownIcon);
|
|
832
789
|
const sharedProps = this.getSharedProps();
|
|
833
790
|
return (
|
|
834
791
|
<SelectArrow
|
|
@@ -857,24 +814,17 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
857
814
|
if (this.props.type !== TYPE.search) {
|
|
858
815
|
return null;
|
|
859
816
|
}
|
|
860
|
-
const {overrides = {}} = this.props;
|
|
817
|
+
const { overrides = {} } = this.props;
|
|
861
818
|
const [SearchIconContainer, searchIconContainerProps] = getOverrides(
|
|
862
819
|
overrides.SearchIconContainer,
|
|
863
|
-
StyledSearchIconContainer
|
|
864
|
-
);
|
|
865
|
-
const [SearchIcon, searchIconProps] = getOverrides(
|
|
866
|
-
overrides.SearchIcon,
|
|
867
|
-
SearchIconComponent,
|
|
820
|
+
StyledSearchIconContainer
|
|
868
821
|
);
|
|
822
|
+
const [SearchIcon, searchIconProps] = getOverrides(overrides.SearchIcon, SearchIconComponent);
|
|
869
823
|
const sharedProps = this.getSharedProps();
|
|
870
824
|
|
|
871
825
|
return (
|
|
872
826
|
// TODO(v11): remove searchIconProps from SearchIconContainer
|
|
873
|
-
<SearchIconContainer
|
|
874
|
-
{...sharedProps}
|
|
875
|
-
{...searchIconProps}
|
|
876
|
-
{...searchIconContainerProps}
|
|
877
|
-
>
|
|
827
|
+
<SearchIconContainer {...sharedProps} {...searchIconProps} {...searchIconContainerProps}>
|
|
878
828
|
<SearchIcon size={16} title={'search'} {...searchIconProps} />
|
|
879
829
|
</SearchIconContainer>
|
|
880
830
|
);
|
|
@@ -884,21 +834,14 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
884
834
|
const filterValue = this.state.inputValue.trim();
|
|
885
835
|
// apply filter function
|
|
886
836
|
if (this.props.filterOptions) {
|
|
887
|
-
this.options = this.props.filterOptions(
|
|
888
|
-
this.
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
{
|
|
892
|
-
valueKey: this.props.valueKey,
|
|
893
|
-
labelKey: this.props.labelKey,
|
|
894
|
-
},
|
|
895
|
-
);
|
|
837
|
+
this.options = this.props.filterOptions(this.options, filterValue, excludeOptions, {
|
|
838
|
+
valueKey: this.props.valueKey,
|
|
839
|
+
labelKey: this.props.labelKey,
|
|
840
|
+
});
|
|
896
841
|
}
|
|
897
842
|
// can user create a new option + there's no exact match already
|
|
898
843
|
const filterDoesNotMatchOption = this.props.ignoreCase
|
|
899
|
-
? (opt) =>
|
|
900
|
-
opt[this.props.labelKey].toLowerCase() !==
|
|
901
|
-
filterValue.toLowerCase().trim()
|
|
844
|
+
? (opt) => opt[this.props.labelKey].toLowerCase() !== filterValue.toLowerCase().trim()
|
|
902
845
|
: (opt) => opt[this.props.labelKey] !== filterValue.trim();
|
|
903
846
|
if (
|
|
904
847
|
filterValue &&
|
|
@@ -931,7 +874,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
931
874
|
type,
|
|
932
875
|
value,
|
|
933
876
|
} = this.props;
|
|
934
|
-
const {isOpen, isFocused, isPseudoFocused} = this.state;
|
|
877
|
+
const { isOpen, isFocused, isPseudoFocused } = this.state;
|
|
935
878
|
return {
|
|
936
879
|
$clearable: clearable,
|
|
937
880
|
$creatable: creatable,
|
|
@@ -954,20 +897,13 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
954
897
|
render() {
|
|
955
898
|
this.options = normalizeOptions(this.props.options);
|
|
956
899
|
|
|
957
|
-
const {
|
|
958
|
-
overrides = {},
|
|
959
|
-
type,
|
|
960
|
-
multi,
|
|
961
|
-
noResultsMsg,
|
|
962
|
-
value,
|
|
963
|
-
filterOutSelected,
|
|
964
|
-
} = this.props;
|
|
900
|
+
const { overrides = {}, type, multi, noResultsMsg, value, filterOutSelected } = this.props;
|
|
965
901
|
|
|
966
902
|
if (__DEV__) {
|
|
967
903
|
// value may be nullish, only warn if value is defined
|
|
968
904
|
if (value && !Array.isArray(value)) {
|
|
969
905
|
console.warn(
|
|
970
|
-
'The Select component expects an array as the value prop. For more information, please visit the docs at https://baseweb.design/components/select/'
|
|
906
|
+
'The Select component expects an array as the value prop. For more information, please visit the docs at https://baseweb.design/components/select/'
|
|
971
907
|
);
|
|
972
908
|
}
|
|
973
909
|
}
|
|
@@ -975,30 +911,22 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
975
911
|
const [Root, rootProps] = getOverrides(overrides.Root, StyledRoot);
|
|
976
912
|
const [ControlContainer, controlContainerProps] = getOverrides(
|
|
977
913
|
overrides.ControlContainer,
|
|
978
|
-
StyledControlContainer
|
|
914
|
+
StyledControlContainer
|
|
979
915
|
);
|
|
980
916
|
const [ValueContainer, valueContainerProps] = getOverrides(
|
|
981
917
|
overrides.ValueContainer,
|
|
982
|
-
StyledValueContainer
|
|
918
|
+
StyledValueContainer
|
|
983
919
|
);
|
|
984
920
|
const [IconsContainer, iconsContainerProps] = getOverrides(
|
|
985
921
|
overrides.IconsContainer,
|
|
986
|
-
StyledIconsContainer
|
|
987
|
-
);
|
|
988
|
-
const [PopoverOverride, popoverProps] = getOverrides(
|
|
989
|
-
overrides.Popover,
|
|
990
|
-
Popover,
|
|
991
|
-
);
|
|
992
|
-
const [Placeholder, placeholderProps] = getOverrides(
|
|
993
|
-
overrides.Placeholder,
|
|
994
|
-
StyledPlaceholder,
|
|
922
|
+
StyledIconsContainer
|
|
995
923
|
);
|
|
924
|
+
const [PopoverOverride, popoverProps] = getOverrides(overrides.Popover, Popover);
|
|
925
|
+
const [Placeholder, placeholderProps] = getOverrides(overrides.Placeholder, StyledPlaceholder);
|
|
996
926
|
const sharedProps = this.getSharedProps();
|
|
997
927
|
|
|
998
928
|
const valueArray = this.getValueArray(value);
|
|
999
|
-
const options = this.filterOptions(
|
|
1000
|
-
multi && filterOutSelected ? valueArray : null,
|
|
1001
|
-
);
|
|
929
|
+
const options = this.filterOptions(multi && filterOutSelected ? valueArray : null);
|
|
1002
930
|
const isOpen = this.state.isOpen;
|
|
1003
931
|
sharedProps.$isOpen = isOpen;
|
|
1004
932
|
|
|
@@ -1006,7 +934,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
1006
934
|
if (this.props.error && this.props.positive) {
|
|
1007
935
|
// eslint-disable-next-line no-console
|
|
1008
936
|
console.warn(
|
|
1009
|
-
`[Select] \`error\` and \`positive\` are both set to \`true\`. \`error\` will take precedence but this may not be what you want
|
|
937
|
+
`[Select] \`error\` and \`positive\` are both set to \`true\`. \`error\` will take precedence but this may not be what you want.`
|
|
1010
938
|
);
|
|
1011
939
|
}
|
|
1012
940
|
}
|
|
@@ -1037,8 +965,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
1037
965
|
error: this.props.error,
|
|
1038
966
|
positive: this.props.positive,
|
|
1039
967
|
getOptionLabel:
|
|
1040
|
-
this.props.getOptionLabel ||
|
|
1041
|
-
this.getOptionLabel.bind(this, locale),
|
|
968
|
+
this.props.getOptionLabel || this.getOptionLabel.bind(this, locale),
|
|
1042
969
|
id: listboxId,
|
|
1043
970
|
isLoading: this.props.isLoading,
|
|
1044
971
|
labelKey: this.props.labelKey,
|
|
@@ -1055,18 +982,11 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
1055
982
|
type,
|
|
1056
983
|
value: valueArray,
|
|
1057
984
|
valueKey: this.props.valueKey,
|
|
1058
|
-
width: this.anchor.current
|
|
1059
|
-
? this.anchor.current.clientWidth
|
|
1060
|
-
: null,
|
|
985
|
+
width: this.anchor.current ? this.anchor.current.clientWidth : null,
|
|
1061
986
|
keyboardControlNode: this.anchor,
|
|
1062
987
|
};
|
|
1063
988
|
|
|
1064
|
-
return
|
|
1065
|
-
<SelectDropdown
|
|
1066
|
-
innerRef={this.dropdown}
|
|
1067
|
-
{...dropdownProps}
|
|
1068
|
-
/>
|
|
1069
|
-
);
|
|
989
|
+
return <SelectDropdown innerRef={this.dropdown} {...dropdownProps} />;
|
|
1070
990
|
}}
|
|
1071
991
|
placement={PLACEMENT.bottom}
|
|
1072
992
|
{...popoverProps}
|
package/select/select.js.flow
CHANGED
|
@@ -11,12 +11,7 @@ import MultiValue from './multi-value.js';
|
|
|
11
11
|
import SingleValue from './value.js';
|
|
12
12
|
|
|
13
13
|
function Select(props: React.ElementConfig<typeof SelectComponent>) {
|
|
14
|
-
return
|
|
15
|
-
<SelectComponent
|
|
16
|
-
{...props}
|
|
17
|
-
valueComponent={props.multi ? MultiValue : SingleValue}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
14
|
+
return <SelectComponent {...props} valueComponent={props.multi ? MultiValue : SingleValue} />;
|
|
20
15
|
}
|
|
21
16
|
|
|
22
17
|
export default Select;
|
|
@@ -8,7 +8,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import SelectComponent from './select-component.js';
|
|
10
10
|
import Value from './value.js';
|
|
11
|
-
import type {PropsT} from './types.js';
|
|
11
|
+
import type { PropsT } from './types.js';
|
|
12
12
|
|
|
13
13
|
function MultiSelect(props: $Shape<PropsT>) {
|
|
14
14
|
return <SelectComponent {...props} multi={false} valueComponent={Value} />;
|
|
@@ -6,19 +6,11 @@ LICENSE file in the root directory of this source tree.
|
|
|
6
6
|
*/
|
|
7
7
|
// @flow
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import type {
|
|
10
|
-
StatefulContainerPropsT,
|
|
11
|
-
StateReducerT,
|
|
12
|
-
StateT,
|
|
13
|
-
OnChangeParamsT,
|
|
14
|
-
} from './types.js';
|
|
9
|
+
import type { StatefulContainerPropsT, StateReducerT, StateT, OnChangeParamsT } from './types.js';
|
|
15
10
|
|
|
16
11
|
const defaultStateReducer: StateReducerT = (type, nextState) => nextState;
|
|
17
12
|
|
|
18
|
-
class StatefulSelectContainer extends React.Component<
|
|
19
|
-
StatefulContainerPropsT,
|
|
20
|
-
StateT,
|
|
21
|
-
> {
|
|
13
|
+
class StatefulSelectContainer extends React.Component<StatefulContainerPropsT, StateT> {
|
|
22
14
|
static defaultProps = {
|
|
23
15
|
initialState: {
|
|
24
16
|
value: [],
|
|
@@ -28,7 +20,7 @@ class StatefulSelectContainer extends React.Component<
|
|
|
28
20
|
stateReducer: defaultStateReducer,
|
|
29
21
|
};
|
|
30
22
|
|
|
31
|
-
state = {...this.props.initialState};
|
|
23
|
+
state = { ...this.props.initialState };
|
|
32
24
|
|
|
33
25
|
onChange = (params: OnChangeParamsT) => {
|
|
34
26
|
this.internalSetState(params);
|
|
@@ -36,8 +28,8 @@ class StatefulSelectContainer extends React.Component<
|
|
|
36
28
|
};
|
|
37
29
|
|
|
38
30
|
internalSetState = (params: OnChangeParamsT) => {
|
|
39
|
-
const {stateReducer} = this.props;
|
|
40
|
-
const nextState: StateT = {value: params.value};
|
|
31
|
+
const { stateReducer } = this.props;
|
|
32
|
+
const nextState: StateT = { value: params.value };
|
|
41
33
|
this.setState(stateReducer(params.type, nextState, this.state));
|
|
42
34
|
};
|
|
43
35
|
|
|
@@ -9,7 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
import StatefulContainer from './stateful-select-container.js';
|
|
10
10
|
import Select from './select.js';
|
|
11
11
|
import defaultProps from './default-props.js';
|
|
12
|
-
import type {PropsT, StatefulSelectPropsT} from './types.js';
|
|
12
|
+
import type { PropsT, StatefulSelectPropsT } from './types.js';
|
|
13
13
|
|
|
14
14
|
export default function StatefulSelect(props: StatefulSelectPropsT) {
|
|
15
15
|
return (
|