@jetbrains/ring-ui 5.1.1 → 5.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -6
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/container.css +3 -0
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/analytics/analytics.d.ts +21 -7
- package/components/analytics/analytics.js +19 -24
- package/components/analytics/analytics__custom-plugin.d.ts +6 -16
- package/components/analytics/analytics__custom-plugin.js +12 -52
- package/components/analytics/analytics__fus-plugin.d.ts +15 -25
- package/components/analytics/analytics__fus-plugin.js +15 -73
- package/components/analytics/analytics__ga-plugin.d.ts +13 -3
- package/components/analytics/analytics__ga-plugin.js +35 -5
- package/components/analytics/analytics__plugin-utils.d.ts +16 -0
- package/components/analytics/analytics__plugin-utils.js +26 -1
- package/components/auth/auth__core.d.ts +5 -4
- package/components/auth/auth__core.js +44 -27
- package/components/auth-dialog/auth-dialog.d.ts +2 -2
- package/components/auth-dialog/auth-dialog.js +3 -1
- package/components/auth-dialog-service/auth-dialog-service.js +4 -1
- package/components/avatar/avatar.d.ts +3 -3
- package/components/avatar/fallback-avatar.d.ts +2 -2
- package/components/avatar/fallback-avatar.js +2 -1
- package/components/avatar-editor-ng/avatar-editor-ng.css +1 -1
- package/components/badge/badge.d.ts +2 -2
- package/components/button/button.css +7 -7
- package/components/button/button.d.ts +3 -4
- package/components/button/button.js +0 -1
- package/components/button-group/button-group.css +2 -2
- package/components/button-group/button-group.d.ts +2 -2
- package/components/button-group/caption.d.ts +2 -2
- package/components/button-ng/button-ng.js +1 -1
- package/components/button-ng/{button-ng.examples.js → button-ng.stories.js} +2 -2
- package/components/button-set/button-set.d.ts +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +2 -2
- package/components/checkbox/checkbox.css +2 -2
- package/components/checkbox/checkbox.d.ts +2 -2
- package/components/code/code.d.ts +1 -1
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +3 -3
- package/components/confirm-ng/{confirm-ng.examples.js → confirm-ng.stories.js} +1 -1
- package/components/confirm-service/confirm-service.js +2 -2
- package/components/content-layout/content-layout.d.ts +2 -2
- package/components/content-layout/sidebar.d.ts +2 -2
- package/components/contenteditable/contenteditable.d.ts +3 -3
- package/components/control-label/control-label.css +23 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +22 -0
- package/components/data-list/data-list.css +2 -1
- package/components/data-list/data-list.d.ts +3 -3
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/title.d.ts +1 -1
- package/components/date-picker/consts.d.ts +5 -5
- package/components/date-picker/date-input.d.ts +3 -12
- package/components/date-picker/date-input.js +9 -15
- package/components/date-picker/date-picker.css +1 -1
- package/components/date-picker/date-picker.d.ts +8 -6
- package/components/date-picker/date-picker.js +9 -15
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.d.ts +2 -2
- package/components/date-picker/month-names.d.ts +2 -2
- package/components/date-picker/month-names.js +2 -2
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month.d.ts +2 -2
- package/components/date-picker/months.d.ts +2 -2
- package/components/date-picker/months.js +46 -29
- package/components/date-picker/weekdays.d.ts +2 -2
- package/components/date-picker/years.d.ts +6 -2
- package/components/date-picker/years.js +26 -14
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +4 -2
- package/components/dialog-ng/dialog-ng.js +4 -5
- package/components/dialog-ng/{dialog-ng.examples.js → dialog-ng.stories.js} +1 -1
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/dropdown.d.ts +8 -1
- package/components/editable-heading/editable-heading.css +20 -7
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +39 -12
- package/components/error-bubble/error-bubble.d.ts +2 -2
- package/components/error-message/error-message.d.ts +2 -2
- package/components/footer/footer.js +1 -0
- package/components/form/{form.examples.js → form.stories.js} +1 -0
- package/components/global/angular-component-factory.js +13 -7
- package/components/global/angular-component-factory.test.js +30 -10
- package/components/global/controls-height.d.ts +2 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/focus-sensor-hoc.d.ts +1 -0
- package/components/global/focus-sensor-hoc.js +5 -4
- package/components/global/react-dom-renderer.d.ts +4 -4
- package/components/global/react-dom-renderer.js +5 -5
- package/components/global/react-render-adapter.js +19 -31
- package/components/global/ring-angular-component.js +1 -3
- package/components/global/ring-angular-component.test.js +2 -1
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +14 -0
- package/components/global/variables_dark.css +2 -2
- package/components/grid/col.d.ts +2 -2
- package/components/grid/grid.d.ts +2 -2
- package/components/grid/row.d.ts +2 -2
- package/components/group/group.d.ts +2 -2
- package/components/header/header.d.ts +2 -2
- package/components/header/logo.d.ts +2 -2
- package/components/header/profile.d.ts +4 -2
- package/components/header/profile.js +15 -11
- package/components/header/services-link.d.ts +2 -2
- package/components/header/services.d.ts +2 -2
- package/components/header/smart-profile.d.ts +2 -2
- package/components/header/smart-services.d.ts +2 -2
- package/components/header/tray-icon.d.ts +2 -2
- package/components/header/tray.d.ts +2 -2
- package/components/heading/heading.css +8 -8
- package/components/http/http.d.ts +16 -6
- package/components/http/http.js +26 -0
- package/components/hub-source/hub-source__users-groups.d.ts +1 -1
- package/components/i18n/README.md +46 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +14 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +26 -0
- package/components/i18n/messages.json +53 -0
- package/components/icon/icon.d.ts +3 -3
- package/components/icon/icon__svg.d.ts +1 -1
- package/components/input/input-legacy.css +3 -3
- package/components/input/input.css +8 -21
- package/components/input/input.d.ts +7 -1
- package/components/input/input.js +18 -14
- package/components/input-ng/input-ng.js +3 -2
- package/components/input-ng/{input-ng.examples.js → input-ng.stories.js} +3 -1
- package/components/input-size/{input-size.examples.js → input-size.stories.js} +1 -0
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/content.d.ts +1 -1
- package/components/island/header.d.ts +2 -2
- package/components/island/island.css +1 -1
- package/components/island/island.d.ts +3 -3
- package/components/island-legacy/content-legacy.d.ts +2 -2
- package/components/island-legacy/header-legacy.d.ts +2 -2
- package/components/island-legacy/island-legacy.d.ts +2 -2
- package/components/island-ng/island-ng.js +3 -3
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/link.css +1 -1
- package/components/link/link.d.ts +8 -9
- package/components/link/link.js +0 -1
- package/components/list/consts.js +3 -0
- package/components/list/list.css +2 -2
- package/components/list/list.d.ts +7 -7
- package/components/list/list.js +4 -1
- package/components/list/list__custom.d.ts +1 -1
- package/components/list/list__hint.d.ts +2 -2
- package/components/list/list__item.d.ts +2 -2
- package/components/list/list__link.d.ts +2 -2
- package/components/list/list__separator.d.ts +2 -2
- package/components/list/list__title.d.ts +2 -2
- package/components/loader/loader.d.ts +2 -2
- package/components/loader-inline/loader-inline.d.ts +2 -2
- package/components/loader-ng/loader-ng.js +1 -1
- package/components/loader-screen/loader-screen.d.ts +2 -2
- package/components/login-dialog/login-dialog.d.ts +2 -2
- package/components/login-dialog/service.js +4 -1
- package/components/markdown/code.d.ts +2 -2
- package/components/markdown/heading.d.ts +2 -2
- package/components/markdown/link.d.ts +2 -2
- package/components/markdown/markdown.d.ts +2 -2
- package/components/message/message.d.ts +3 -7
- package/components/message/message.js +17 -16
- package/components/pager/pager.d.ts +8 -13
- package/components/pager/pager.js +12 -14
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +2 -2
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +1 -1
- package/components/popup/position.d.ts +1 -1
- package/components/popup/position.js +43 -33
- package/components/popup-menu/popup-menu.d.ts +2 -2
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/promised-click-ng/promised-click-ng.js +1 -1
- package/components/query-assist/query-assist.css +16 -11
- package/components/query-assist/query-assist.d.ts +3 -7
- package/components/query-assist/query-assist.js +50 -31
- package/components/query-assist/query-assist__suggestions.d.ts +2 -2
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/radio__item.d.ts +1 -1
- package/components/select/select-popup.css +2 -2
- package/components/select/select.css +9 -5
- package/components/select/select.d.ts +21 -9
- package/components/select/select.js +53 -29
- package/components/select/select__filter.d.ts +2 -3
- package/components/select/select__filter.js +4 -2
- package/components/select/select__popup.d.ts +48 -8
- package/components/select/select__popup.js +29 -8
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +1 -2
- package/components/sidebar-ng/sidebar-ng.js +1 -2
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/table/cell.d.ts +2 -2
- package/components/table/disable-hover-hoc.d.ts +2 -2
- package/components/table/header-cell.d.ts +2 -2
- package/components/table/header.d.ts +3 -14
- package/components/table/header.js +5 -49
- package/components/table/multitable.d.ts +2 -2
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/row.d.ts +2 -1
- package/components/table/row.js +4 -3
- package/components/table/smart-table.d.ts +3 -1
- package/components/table/table.css +9 -26
- package/components/table/table.d.ts +6 -4
- package/components/table/table.js +5 -3
- package/components/table-ng/{table-ng.examples.js → table-ng.stories.js} +1 -1
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +2 -2
- package/components/tabs/dumb-tabs.d.ts +5 -3
- package/components/tabs/dumb-tabs.js +3 -2
- package/components/tabs/smart-tabs.d.ts +2 -2
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tab.js +3 -3
- package/components/tabs/tabs.css +4 -1
- package/components/tag/tag.css +3 -3
- package/components/tag/tag.d.ts +5 -5
- package/components/tags-input/tags-input.css +1 -1
- package/components/tags-input/tags-input.d.ts +11 -4
- package/components/tags-input/tags-input.js +11 -8
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/template-ng/template-ng.js +1 -2
- package/components/text/text.css +12 -0
- package/components/text/text.d.ts +8 -2
- package/components/text/text.js +12 -2
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.d.ts +2 -2
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/user-agreement/service.js +4 -1
- package/components/user-agreement/user-agreement.d.ts +3 -11
- package/components/user-agreement/user-agreement.js +31 -30
- package/components/user-card/card.d.ts +22 -21
- package/components/user-card/card.js +29 -29
- package/components/user-card/smart-user-card-tooltip.d.ts +3 -3
- package/components/user-card/tooltip.d.ts +11 -6
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.css +10 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +614 -1
- package/dist/_helpers/anchor.js +7 -8
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button-group.js +1 -1
- package/dist/_helpers/button-set.js +1 -1
- package/dist/_helpers/button-toolbar.js +1 -1
- package/dist/_helpers/button__classes.js +17 -29
- package/dist/_helpers/card.js +100 -91
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/control-label.js +3 -0
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +21 -12
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +31 -35
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/group.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon.js +1 -1
- package/dist/_helpers/input.js +1 -1
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/link.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/loader-inline.js +1 -1
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +92 -75
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +69 -42
- package/dist/_helpers/services-link.js +33 -21
- package/dist/_helpers/sidebar.js +87 -86
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +43 -36
- package/dist/_helpers/title.js +66 -56
- package/dist/alert/alert.d.ts +1 -1
- package/dist/alert/alert.js +164 -127
- package/dist/alert/container.js +40 -29
- package/dist/alert-service/alert-service.d.ts +2 -2
- package/dist/alert-service/alert-service.js +169 -103
- package/dist/analytics/analytics.d.ts +21 -7
- package/dist/analytics/analytics.js +90 -71
- package/dist/analytics/analytics__custom-plugin.d.ts +6 -16
- package/dist/analytics/analytics__custom-plugin.js +74 -87
- package/dist/analytics/analytics__fus-plugin.d.ts +15 -25
- package/dist/analytics/analytics__fus-plugin.js +31 -89
- package/dist/analytics/analytics__ga-plugin.d.ts +13 -3
- package/dist/analytics/analytics__ga-plugin.js +76 -25
- package/dist/analytics/analytics__plugin-utils.d.ts +16 -0
- package/dist/analytics/analytics__plugin-utils.js +52 -21
- package/dist/auth/auth.js +39 -5
- package/dist/auth/auth__core.d.ts +5 -4
- package/dist/auth/auth__core.js +1459 -719
- package/dist/auth/background-flow.js +125 -84
- package/dist/auth/down-notification.js +76 -32
- package/dist/auth/iframe-flow.js +129 -69
- package/dist/auth/landing.js +93 -31
- package/dist/auth/request-builder.js +79 -45
- package/dist/auth/response-parser.js +117 -85
- package/dist/auth/storage.js +322 -161
- package/dist/auth/token-validator.js +239 -128
- package/dist/auth/window-flow.js +126 -83
- package/dist/auth-dialog/auth-dialog.d.ts +2 -2
- package/dist/auth-dialog/auth-dialog.js +152 -94
- package/dist/auth-dialog-service/auth-dialog-service.js +36 -10
- package/dist/auth-ng/auth-ng.js +73 -35
- package/dist/auth-ng/auth-ng.mock.js +6 -6
- package/dist/autofocus-ng/autofocus-ng.js +23 -8
- package/dist/avatar/avatar-example-datauri.js +1 -23
- package/dist/avatar/avatar.d.ts +3 -3
- package/dist/avatar/avatar.js +132 -99
- package/dist/avatar/fallback-avatar.d.ts +2 -2
- package/dist/avatar/fallback-avatar.js +44 -24
- package/dist/avatar-editor-ng/avatar-editor-ng.js +57 -25
- package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
- package/dist/avatar-ng/avatar-ng.js +22 -0
- package/dist/badge/badge.d.ts +2 -2
- package/dist/badge/badge.js +34 -26
- package/dist/badge-ng/badge-ng.js +12 -0
- package/dist/breadcrumb-ng/breadcrumb-ng.js +17 -32
- package/dist/button/button.d.ts +3 -4
- package/dist/button/button.js +89 -69
- package/dist/button/button__classes.js +1 -0
- package/dist/button-group/button-group.d.ts +2 -2
- package/dist/button-group/button-group.js +31 -15
- package/dist/button-group/caption.d.ts +2 -2
- package/dist/button-group/caption.js +19 -11
- package/dist/button-group-ng/button-group-ng.js +13 -7
- package/dist/button-ng/button-ng.js +132 -112
- package/dist/button-set/button-set.d.ts +2 -2
- package/dist/button-set/button-set.js +29 -15
- package/dist/button-set-ng/button-set-ng.js +2 -2
- package/dist/button-toolbar/button-toolbar.d.ts +2 -2
- package/dist/button-toolbar/button-toolbar.js +28 -14
- package/dist/button-toolbar-ng/button-toolbar-ng.js +5 -3
- package/dist/caret/caret.js +223 -188
- package/dist/checkbox/checkbox.d.ts +2 -2
- package/dist/checkbox/checkbox.js +83 -58
- package/dist/checkbox-ng/checkbox-ng.js +18 -28
- package/dist/clipboard/clipboard-fallback.js +10 -10
- package/dist/clipboard/clipboard.js +131 -35
- package/dist/code/code.d.ts +1 -1
- package/dist/code/code.js +153 -81
- package/dist/compiler-ng/compiler-ng.js +18 -15
- package/dist/confirm/confirm.d.ts +1 -1
- package/dist/confirm/confirm.js +85 -47
- package/dist/confirm-ng/confirm-ng.js +34 -6
- package/dist/confirm-service/confirm-service.js +67 -44
- package/dist/content-layout/content-layout.d.ts +2 -2
- package/dist/content-layout/content-layout.js +53 -35
- package/dist/content-layout/sidebar.d.ts +2 -2
- package/dist/content-layout/sidebar.js +1 -0
- package/dist/contenteditable/contenteditable.d.ts +3 -3
- package/dist/contenteditable/contenteditable.js +54 -43
- package/dist/control-label/control-label.d.ts +11 -0
- package/dist/control-label/control-label.js +31 -0
- package/dist/data-list/data-list.d.ts +3 -3
- package/dist/data-list/data-list.js +164 -114
- package/dist/data-list/data-list.mock.d.ts +2 -2
- package/dist/data-list/data-list.mock.js +11 -3
- package/dist/data-list/item.d.ts +3 -3
- package/dist/data-list/item.js +140 -113
- package/dist/data-list/selection.js +139 -77
- package/dist/data-list/title.d.ts +1 -1
- package/dist/data-list/title.js +12 -0
- package/dist/data-list-ng/data-list-ng.js +30 -1
- package/dist/date-picker/consts.d.ts +5 -5
- package/dist/date-picker/consts.js +18 -15
- package/dist/date-picker/date-input.d.ts +3 -12
- package/dist/date-picker/date-input.js +131 -107
- package/dist/date-picker/date-picker.d.ts +8 -6
- package/dist/date-picker/date-picker.js +214 -160
- package/dist/date-picker/date-popup.d.ts +1 -1
- package/dist/date-picker/date-popup.js +340 -297
- package/dist/date-picker/day.d.ts +2 -2
- package/dist/date-picker/day.js +78 -68
- package/dist/date-picker/month-names.d.ts +2 -2
- package/dist/date-picker/month-names.js +59 -41
- package/dist/date-picker/month-slider.d.ts +2 -2
- package/dist/date-picker/month-slider.js +59 -40
- package/dist/date-picker/month.d.ts +2 -2
- package/dist/date-picker/month.js +21 -15
- package/dist/date-picker/months.d.ts +2 -2
- package/dist/date-picker/months.js +80 -56
- package/dist/date-picker/weekdays.d.ts +2 -2
- package/dist/date-picker/weekdays.js +18 -12
- package/dist/date-picker/years.d.ts +6 -2
- package/dist/date-picker/years.js +102 -66
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +148 -98
- package/dist/dialog/dialog__body-scroll-preventer.js +5 -0
- package/dist/dialog-ng/dialog-ng.js +404 -291
- package/dist/dialog-ng/dialog-ng__template.js +1 -70
- package/dist/docked-panel-ng/docked-panel-ng.js +33 -19
- package/dist/dropdown/anchor.d.ts +1 -1
- package/dist/dropdown/anchor.js +10 -1
- package/dist/dropdown/dropdown.d.ts +8 -1
- package/dist/dropdown/dropdown.js +158 -130
- package/dist/dropdown-menu/dropdown-menu.js +102 -73
- package/dist/editable-heading/editable-heading.d.ts +2 -2
- package/dist/editable-heading/editable-heading.js +133 -62
- package/dist/error-bubble/error-bubble.d.ts +2 -2
- package/dist/error-bubble/error-bubble.js +60 -27
- package/dist/error-message/error-message.d.ts +2 -2
- package/dist/error-message/error-message.js +52 -29
- package/dist/error-message-ng/error-message-ng.js +12 -24
- package/dist/footer/footer.js +11 -2
- package/dist/footer-ng/footer-ng.js +52 -27
- package/dist/form-ng/form-ng.js +67 -57
- package/dist/global/angular-component-factory.js +78 -50
- package/dist/global/compose.js +10 -1
- package/dist/global/composeRefs.js +12 -7
- package/dist/global/controls-height.d.ts +2 -0
- package/dist/global/controls-height.js +10 -2
- package/dist/global/create-stateful-context.d.ts +1 -1
- package/dist/global/create-stateful-context.js +19 -19
- package/dist/global/data-tests.js +15 -7
- package/dist/global/dom.js +93 -55
- package/dist/global/focus-sensor-hoc.d.ts +1 -0
- package/dist/global/focus-sensor-hoc.js +118 -102
- package/dist/global/fuzzy-highlight.js +41 -27
- package/dist/global/get-event-key.js +8 -8
- package/dist/global/get-uid.js +8 -4
- package/dist/global/inject-styles.js +15 -10
- package/dist/global/linear-function.js +2 -2
- package/dist/global/listeners.js +50 -28
- package/dist/global/memoize.js +13 -6
- package/dist/global/normalize-indent.js +51 -19
- package/dist/global/promise-with-timeout.js +8 -6
- package/dist/global/prop-types.js +5 -3
- package/dist/global/react-dom-renderer.d.ts +4 -4
- package/dist/global/react-dom-renderer.js +44 -28
- package/dist/global/react-render-adapter.js +21 -15
- package/dist/global/rerender-hoc.js +40 -19
- package/dist/global/ring-angular-component.js +18 -10
- package/dist/global/schedule-raf.js +6 -5
- package/dist/global/sniffer.js +1 -1
- package/dist/global/theme.js +24 -0
- package/dist/global/trivial-template-tag.js +10 -3
- package/dist/global/typescript-utils.js +6 -2
- package/dist/global/url.js +27 -21
- package/dist/global/use-event-callback.d.ts +1 -0
- package/dist/global/use-event-callback.js +17 -0
- package/dist/grid/col.d.ts +2 -2
- package/dist/grid/col.js +42 -23
- package/dist/grid/grid.d.ts +2 -2
- package/dist/grid/grid.js +32 -13
- package/dist/grid/row.d.ts +2 -2
- package/dist/grid/row.js +32 -20
- package/dist/group/group.d.ts +2 -2
- package/dist/group/group.js +23 -13
- package/dist/group-ng/group-ng.js +2 -2
- package/dist/header/header.d.ts +2 -2
- package/dist/header/header.js +75 -25
- package/dist/header/logo.d.ts +2 -2
- package/dist/header/logo.js +31 -12
- package/dist/header/profile.d.ts +4 -2
- package/dist/header/profile.js +154 -105
- package/dist/header/services-link.d.ts +2 -2
- package/dist/header/services-link.js +9 -1
- package/dist/header/services.d.ts +2 -2
- package/dist/header/services.js +104 -63
- package/dist/header/smart-profile.d.ts +2 -2
- package/dist/header/smart-profile.js +194 -98
- package/dist/header/smart-services.d.ts +2 -2
- package/dist/header/smart-services.js +104 -52
- package/dist/header/tray-icon.d.ts +2 -2
- package/dist/header/tray-icon.js +36 -20
- package/dist/header/tray.d.ts +2 -2
- package/dist/header/tray.js +30 -17
- package/dist/heading/heading.js +26 -27
- package/dist/heading-ng/heading-ng.js +10 -0
- package/dist/http/http.d.ts +16 -6
- package/dist/http/http.js +357 -170
- package/dist/http/http.mock.js +105 -50
- package/dist/hub-source/hub-source.js +183 -77
- package/dist/hub-source/hub-source__user.js +45 -12
- package/dist/hub-source/hub-source__users-groups.d.ts +1 -1
- package/dist/hub-source/hub-source__users-groups.js +63 -34
- package/dist/i18n/i18n-context.d.ts +13 -0
- package/dist/i18n/i18n-context.js +28 -0
- package/dist/i18n/i18n.d.ts +59 -0
- package/dist/i18n/i18n.js +140 -0
- package/dist/icon/icon.d.ts +3 -3
- package/dist/icon/icon.js +77 -59
- package/dist/icon/icon__svg.d.ts +1 -1
- package/dist/icon/icon__svg.js +31 -24
- package/dist/icon/index.js +9 -0
- package/dist/icon-ng/icon-ng.js +27 -16
- package/dist/input/input.d.ts +7 -1
- package/dist/input/input.js +178 -131
- package/dist/input-ng/input-ng.js +77 -99
- package/dist/island/adaptive-island-hoc.d.ts +2 -2
- package/dist/island/adaptive-island-hoc.js +38 -27
- package/dist/island/content.d.ts +1 -1
- package/dist/island/content.js +104 -92
- package/dist/island/header.d.ts +2 -2
- package/dist/island/header.js +60 -47
- package/dist/island/island.d.ts +3 -3
- package/dist/island/island.js +33 -21
- package/dist/island-legacy/content-legacy.d.ts +2 -2
- package/dist/island-legacy/content-legacy.js +23 -13
- package/dist/island-legacy/header-legacy.d.ts +2 -2
- package/dist/island-legacy/header-legacy.js +25 -15
- package/dist/island-legacy/island-legacy.d.ts +2 -2
- package/dist/island-legacy/island-legacy.js +23 -13
- package/dist/island-ng/island-content-ng.js +17 -26
- package/dist/island-ng/island-header-ng.js +9 -12
- package/dist/island-ng/island-ng-class-fixer.js +3 -0
- package/dist/island-ng/island-ng.js +6 -10
- package/dist/link/clickableLink.d.ts +1 -1
- package/dist/link/clickableLink.js +43 -29
- package/dist/link/link.d.ts +8 -9
- package/dist/link/link.js +72 -62
- package/dist/link-ng/link-ng.js +5 -7
- package/dist/list/consts.js +4 -1
- package/dist/list/list.d.ts +7 -7
- package/dist/list/list.js +499 -402
- package/dist/list/list__custom.d.ts +1 -1
- package/dist/list/list__custom.js +60 -47
- package/dist/list/list__hint.d.ts +2 -2
- package/dist/list/list__hint.js +18 -8
- package/dist/list/list__item.d.ts +2 -2
- package/dist/list/list__item.js +167 -132
- package/dist/list/list__link.d.ts +2 -2
- package/dist/list/list__link.js +54 -38
- package/dist/list/list__separator.d.ts +2 -2
- package/dist/list/list__separator.js +24 -14
- package/dist/list/list__title.d.ts +2 -2
- package/dist/list/list__title.js +32 -22
- package/dist/list/list__users-groups-source.js +130 -54
- package/dist/loader/loader.d.ts +2 -2
- package/dist/loader/loader.js +66 -34
- package/dist/loader/loader__core.js +197 -129
- package/dist/loader-inline/loader-inline.d.ts +2 -2
- package/dist/loader-inline/loader-inline.js +32 -18
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -2
- package/dist/loader-ng/loader-ng.js +44 -18
- package/dist/loader-screen/loader-screen.d.ts +2 -2
- package/dist/loader-screen/loader-screen.js +43 -20
- package/dist/loader-screen-ng/loader-screen-ng.js +45 -30
- package/dist/login-dialog/login-dialog.d.ts +2 -2
- package/dist/login-dialog/login-dialog.js +125 -78
- package/dist/login-dialog/service.js +39 -10
- package/dist/markdown/code.d.ts +2 -2
- package/dist/markdown/code.js +30 -9
- package/dist/markdown/heading.d.ts +2 -2
- package/dist/markdown/heading.js +3 -5
- package/dist/markdown/link.d.ts +2 -2
- package/dist/markdown/link.js +13 -7
- package/dist/markdown/markdown.d.ts +2 -2
- package/dist/markdown/markdown.js +67 -35
- package/dist/message/message.d.ts +3 -7
- package/dist/message/message.js +153 -119
- package/dist/message-bundle-ng/message-bundle-ng.js +130 -46
- package/dist/old-browsers-message/old-browsers-message.js +19 -11
- package/dist/old-browsers-message/old-browsers-message__stop.js +8 -0
- package/dist/old-browsers-message/white-list.js +17 -10
- package/dist/pager/pager.d.ts +8 -13
- package/dist/pager/pager.js +259 -188
- package/dist/pager-ng/pager-ng.js +39 -2
- package/dist/panel/panel.d.ts +2 -2
- package/dist/panel/panel.js +23 -13
- package/dist/panel-ng/panel-ng.js +13 -1
- package/dist/permissions/permissions.js +166 -122
- package/dist/permissions/permissions__cache.js +220 -191
- package/dist/permissions-ng/permissions-ng.js +89 -36
- package/dist/place-under-ng/place-under-ng.js +67 -45
- package/dist/popup/popup.consts.js +1 -1
- package/dist/popup/popup.d.ts +2 -2
- package/dist/popup/popup.js +299 -236
- package/dist/popup/popup.target.js +8 -9
- package/dist/popup/position.d.ts +1 -1
- package/dist/popup/position.js +175 -154
- package/dist/popup-menu/popup-menu.d.ts +2 -2
- package/dist/popup-menu/popup-menu.js +80 -42
- package/dist/progress-bar/progress-bar.d.ts +2 -2
- package/dist/progress-bar/progress-bar.js +66 -52
- package/dist/progress-bar-ng/progress-bar-ng.js +10 -0
- package/dist/promised-click-ng/promised-click-ng.js +93 -60
- package/dist/proxy-attrs/proxy-attrs.js +18 -9
- package/dist/query-assist/query-assist.d.ts +3 -7
- package/dist/query-assist/query-assist.js +677 -567
- package/dist/query-assist/query-assist__suggestions.d.ts +2 -2
- package/dist/query-assist/query-assist__suggestions.js +33 -2
- package/dist/query-assist-ng/query-assist-ng.js +41 -2
- package/dist/radio/radio.d.ts +1 -1
- package/dist/radio/radio.js +28 -14
- package/dist/radio/radio__item.d.ts +1 -1
- package/dist/radio/radio__item.js +60 -44
- package/dist/radio-ng/radio-ng.js +14 -25
- package/dist/save-field-ng/save-field-ng.js +90 -56
- package/dist/save-field-ng/save-field-ng__template.js +1 -32
- package/dist/select/select.d.ts +21 -9
- package/dist/select/select.js +833 -699
- package/dist/select/select__filter.d.ts +2 -3
- package/dist/select/select__filter.js +37 -2
- package/dist/select/select__popup.d.ts +48 -8
- package/dist/select/select__popup.js +430 -293
- package/dist/select-ng/select-ng.js +130 -77
- package/dist/select-ng/select-ng__lazy.js +104 -51
- package/dist/select-ng/select-ng__options.js +93 -68
- package/dist/shortcuts/core.js +197 -146
- package/dist/shortcuts/shortcut-title.js +11 -6
- package/dist/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/dist/shortcuts/shortcuts-hoc.js +43 -19
- package/dist/shortcuts/shortcuts.d.ts +1 -1
- package/dist/shortcuts/shortcuts.js +69 -43
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +109 -58
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
- package/dist/shortcuts-ng/shortcuts-ng.js +110 -76
- package/dist/sidebar-ng/sidebar-ng.js +55 -25
- package/dist/sidebar-ng/sidebar-ng__button-template.js +1 -18
- package/dist/sidebar-ng/sidebar-ng__template.js +1 -10
- package/dist/storage/storage.js +34 -4
- package/dist/storage/storage__fallback.js +217 -143
- package/dist/storage/storage__local.js +155 -90
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.d.ts +1 -1
- package/dist/tab-trap/tab-trap.js +117 -84
- package/dist/table/cell.d.ts +2 -2
- package/dist/table/cell.js +23 -9
- package/dist/table/disable-hover-hoc.d.ts +2 -2
- package/dist/table/disable-hover-hoc.js +44 -26
- package/dist/table/header-cell.d.ts +2 -2
- package/dist/table/header-cell.js +74 -54
- package/dist/table/header.d.ts +3 -14
- package/dist/table/header.js +102 -131
- package/dist/table/multitable.d.ts +2 -2
- package/dist/table/multitable.js +102 -86
- package/dist/table/row-with-focus-sensor.d.ts +1 -1
- package/dist/table/row-with-focus-sensor.js +69 -24
- package/dist/table/row.d.ts +2 -1
- package/dist/table/row.js +191 -155
- package/dist/table/selection-adapter.js +3 -1
- package/dist/table/selection-shortcuts-hoc.js +132 -131
- package/dist/table/selection.js +220 -150
- package/dist/table/smart-table.d.ts +3 -1
- package/dist/table/smart-table.js +87 -50
- package/dist/table/table.d.ts +6 -4
- package/dist/table/table.js +311 -247
- package/dist/table-legacy-ng/table-legacy-ng.js +120 -103
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +46 -12
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +92 -69
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +167 -119
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +35 -21
- package/dist/table-ng/smart-table-ng.js +30 -2
- package/dist/table-ng/table-ng.js +30 -2
- package/dist/tabs/collapsible-more.d.ts +3 -3
- package/dist/tabs/collapsible-more.js +92 -56
- package/dist/tabs/collapsible-tab.d.ts +1 -1
- package/dist/tabs/collapsible-tab.js +45 -39
- package/dist/tabs/collapsible-tabs.d.ts +2 -2
- package/dist/tabs/collapsible-tabs.js +164 -96
- package/dist/tabs/custom-item.js +2 -4
- package/dist/tabs/dumb-tabs.d.ts +5 -3
- package/dist/tabs/dumb-tabs.js +101 -56
- package/dist/tabs/smart-tabs.d.ts +2 -2
- package/dist/tabs/smart-tabs.js +70 -25
- package/dist/tabs/tab-link.d.ts +1 -1
- package/dist/tabs/tab-link.js +29 -20
- package/dist/tabs/tab.d.ts +2 -2
- package/dist/tabs/tab.js +26 -15
- package/dist/tabs/tabs.js +35 -1
- package/dist/tabs-ng/tabs-ng.js +38 -24
- package/dist/tabs-ng/tabs-ng__template.js +1 -38
- package/dist/tag/tag.d.ts +5 -5
- package/dist/tag/tag.js +146 -113
- package/dist/tags-input/tags-input.d.ts +11 -4
- package/dist/tags-input/tags-input.js +330 -220
- package/dist/tags-input-ng/tags-input-ng.js +40 -2
- package/dist/tags-list/tags-list.d.ts +2 -2
- package/dist/tags-list/tags-list.js +61 -38
- package/dist/template-ng/template-ng.js +45 -35
- package/dist/text/text.d.ts +8 -2
- package/dist/text/text.js +38 -17
- package/dist/title-ng/title-ng.js +28 -23
- package/dist/toggle/toggle.d.ts +2 -2
- package/dist/toggle/toggle.js +55 -39
- package/dist/toggle-ng/toggle-ng.js +13 -0
- package/dist/tooltip/tooltip.d.ts +1 -1
- package/dist/tooltip/tooltip.js +145 -102
- package/dist/tooltip-ng/tooltip-ng.js +51 -25
- package/dist/user-agreement/service.js +411 -259
- package/dist/user-agreement/toolbox.eula.js +1 -160
- package/dist/user-agreement/user-agreement.d.ts +3 -11
- package/dist/user-agreement/user-agreement.js +106 -68
- package/dist/user-card/card.d.ts +22 -21
- package/dist/user-card/card.js +34 -1
- package/dist/user-card/smart-user-card-tooltip.d.ts +3 -3
- package/dist/user-card/smart-user-card-tooltip.js +139 -76
- package/dist/user-card/tooltip.d.ts +11 -6
- package/dist/user-card/tooltip.js +75 -32
- package/dist/user-card/user-card.js +34 -1
- package/dist/user-card-ng/user-card-ng.js +39 -6
- package/package.json +89 -85
- package/components/input/input-label.d.ts +0 -10
- package/components/input/input-label.js +0 -18
- package/components/loader/__mocks__/loader__core.js +0 -5
- package/components/old-browsers-message/__mocks__/old-browsers-message.js +0 -1
- package/dist/input/input-label.d.ts +0 -10
- package/dist/input/input-label.js +0 -27
- /package/components/alert-service/{alert-service.examples.css → alert-service.stories.css} +0 -0
- /package/components/auth-ng/{auth-ng.examples.js → auth-ng.stories.js} +0 -0
- /package/components/autofocus-ng/{autofocus-ng.examples.js → autofocus-ng.stories.js} +0 -0
- /package/components/avatar-editor-ng/{avatar-editor-ng.examples.js → avatar-editor-ng.stories.js} +0 -0
- /package/components/avatar-ng/{avatar-ng.examples.js → avatar-ng.stories.js} +0 -0
- /package/components/badge-ng/{badge-ng.examples.js → badge-ng.stories.js} +0 -0
- /package/components/breadcrumb-ng/{breadcrumb-ng.examples.js → breadcrumb-ng.stories.js} +0 -0
- /package/components/button-group-ng/{button-group-ng.examples.js → button-group-ng.stories.js} +0 -0
- /package/components/button-set-ng/{button-set-ng.examples.js → button-set-ng.stories.js} +0 -0
- /package/components/button-toolbar-ng/{button-toolbar-ng.examples.js → button-toolbar-ng.stories.js} +0 -0
- /package/components/checkbox-ng/{checkbox-ng.examples.js → checkbox-ng.stories.js} +0 -0
- /package/components/compiler-ng/{compiler-ng.examples.js → compiler-ng.stories.js} +0 -0
- /package/components/data-list-ng/{data-list-ng.examples.js → data-list-ng.stories.js} +0 -0
- /package/components/docked-panel-ng/{docked-panel-ng.examples.js → docked-panel-ng.stories.js} +0 -0
- /package/components/error-message-ng/{error-message-ng.examples.js → error-message-ng.stories.js} +0 -0
- /package/components/error-page-ng/{error-page-ng.examples.js → error-page-ng.stories.js} +0 -0
- /package/components/footer-ng/{footer-ng.examples.js → footer-ng.stories.js} +0 -0
- /package/components/form-ng/{form-ng.examples.js → form-ng.stories.js} +0 -0
- /package/components/group-ng/{group.examples.js → group.stories.js} +0 -0
- /package/components/heading-ng/{heading-ng.examples.js → heading-ng.stories.js} +0 -0
- /package/components/icon-ng/{icon-ng.examples.js → icon-ng.stories.js} +0 -0
- /package/components/island-ng/{island-ng.examples.js → island-ng.stories.js} +0 -0
- /package/components/link-ng/{link-ng.examples.js → link-ng.stories.js} +0 -0
- /package/components/list/{list.examples.css → list.stories.css} +0 -0
- /package/components/loader-inline-ng/{loader-inline-ng.examples.js → loader-inline-ng.stories.js} +0 -0
- /package/components/loader-ng/{loader-ng.examples.js → loader-ng.stories.js} +0 -0
- /package/components/loader-screen-ng/{loader-screen-ng.examples.js → loader-screen-ng.stories.js} +0 -0
- /package/components/pager-ng/{pager-ng.examples.js → pager-ng.stories.js} +0 -0
- /package/components/palette/{palette.examples.js → palette.stories.js} +0 -0
- /package/components/permissions-ng/{permissions-ng.examples.js → permissions-ng.stories.js} +0 -0
- /package/components/place-under-ng/{place-under-ng.examples.js → place-under-ng.stories.js} +0 -0
- /package/components/progress-bar-ng/{progress-bar-ng.examples.js → progress-bar-ng.stories.js} +0 -0
- /package/components/promised-click-ng/{promised-click-ng.examples.js → promised-click-ng.stories.js} +0 -0
- /package/components/query-assist-ng/{query-assist-ng.examples.js → query-assist-ng.stories.js} +0 -0
- /package/components/radio-ng/{radio-ng.examples.js → radio-ng.stories.js} +0 -0
- /package/components/save-field-ng/{save-field-ng.examples.js → save-field-ng.stories.js} +0 -0
- /package/components/select-ng/{select-ng.examples.js → select-ng.stories.js} +0 -0
- /package/components/shortcuts-hint-ng/{shortcuts-hint-ng.examples.js → shortcuts-hint-ng.stories.js} +0 -0
- /package/components/sidebar-ng/{sidebar-ng.examples.js → sidebar-ng.stories.js} +0 -0
- /package/components/table/{table.examples.json → table.stories.json} +0 -0
- /package/components/table-legacy-ng/{table-legacy-ng.examples.js → table-legacy-ng.stories.js} +0 -0
- /package/components/tabs-ng/{tabs-ng.examples.js → tabs-ng.stories.js} +0 -0
- /package/components/tags-input-ng/{tags-input-ng.examples.js → tags-input-ng.stories.js} +0 -0
- /package/components/template-ng/{template-ng.examples.js → template-ng.stories.js} +0 -0
- /package/components/title-ng/{title-ng.examples.js → title-ng.stories.js} +0 -0
- /package/components/toggle-ng/{toggle-ng.examples.js → toggle-ng.stories.js} +0 -0
- /package/components/tooltip-ng/{tooltip-ng.examples.js → tooltip-ng.stories.js} +0 -0
- /package/components/user-card-ng/{user-card-ng.examples.js → user-card-ng.stories.js} +0 -0
package/dist/select/select.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, l as _typeof, k as _assertThisInitialized, g as _objectSpread2, e as _objectWithoutProperties, q as _toPropertyKey, d as _createClass, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import 'core-js/modules/es.array.index-of.js';
|
|
3
|
+
import 'core-js/modules/es.array.reduce.js';
|
|
4
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
5
|
+
import 'core-js/modules/es.string.trim.js';
|
|
6
|
+
import 'core-js/modules/es.array.filter.js';
|
|
7
|
+
import 'core-js/modules/es.regexp.exec.js';
|
|
8
|
+
import 'core-js/modules/es.array.find.js';
|
|
9
|
+
import 'core-js/modules/es.array.concat.js';
|
|
10
|
+
import 'core-js/modules/es.string.replace.js';
|
|
11
|
+
import 'core-js/modules/es.array.map.js';
|
|
12
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
13
|
+
import 'core-js/modules/es.array.slice.js';
|
|
14
|
+
import 'core-js/modules/es.object.keys.js';
|
|
15
|
+
import 'core-js/modules/es.object.assign.js';
|
|
16
|
+
import 'core-js/modules/es.object.values.js';
|
|
17
|
+
import React, { Fragment, Component } from 'react';
|
|
3
18
|
import classNames from 'classnames';
|
|
4
19
|
import PropTypes from 'prop-types';
|
|
5
20
|
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
@@ -10,7 +25,7 @@ import Avatar, { Size as Size$1 } from '../avatar/avatar.js';
|
|
|
10
25
|
import Popup from '../popup/popup.js';
|
|
11
26
|
import List, { ActiveItemContext } from '../list/list.js';
|
|
12
27
|
import { Size, Input } from '../input/input.js';
|
|
13
|
-
import {
|
|
28
|
+
import { ControlLabel } from '../control-label/control-label.js';
|
|
14
29
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
|
15
30
|
import { Button } from '../button/button.js';
|
|
16
31
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
@@ -18,33 +33,55 @@ import getUID from '../global/get-uid.js';
|
|
|
18
33
|
import rerenderHOC from '../global/rerender-hoc.js';
|
|
19
34
|
import fuzzyHighlight from '../global/fuzzy-highlight.js';
|
|
20
35
|
import memoize from '../global/memoize.js';
|
|
36
|
+
import { I18nContext } from '../i18n/i18n-context.js';
|
|
37
|
+
import composeRefs from '../global/composeRefs.js';
|
|
38
|
+
import { refObject } from '../global/prop-types.js';
|
|
21
39
|
import { isArray } from '../global/typescript-utils.js';
|
|
22
40
|
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height.js';
|
|
23
41
|
import { m as modules_88cfaf40 } from '../_helpers/input.js';
|
|
24
42
|
import SelectPopup from './select__popup.js';
|
|
25
43
|
import { A as Anchor } from '../_helpers/anchor.js';
|
|
44
|
+
import 'core-js/modules/es.object.entries.js';
|
|
26
45
|
import '@jetbrains/icons/chevron-10px';
|
|
27
46
|
import '../icon/icon.js';
|
|
28
47
|
import 'util-deprecate';
|
|
29
48
|
import '../icon/icon__constants.js';
|
|
30
49
|
import '../_helpers/icon.js';
|
|
31
50
|
import '../icon/icon__svg.js';
|
|
32
|
-
import '
|
|
51
|
+
import 'core-js/modules/es.string.starts-with.js';
|
|
52
|
+
import 'core-js/modules/es.array.iterator.js';
|
|
53
|
+
import 'core-js/modules/es.map.js';
|
|
54
|
+
import 'core-js/modules/es.string.iterator.js';
|
|
55
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
56
|
+
import 'core-js/modules/es.weak-map.js';
|
|
33
57
|
import '../link/clickableLink.js';
|
|
34
58
|
import '../_helpers/button__classes.js';
|
|
35
59
|
import '../global/url.js';
|
|
60
|
+
import 'core-js/modules/es.string.match.js';
|
|
36
61
|
import '../global/dom.js';
|
|
62
|
+
import 'core-js/modules/es.string.split.js';
|
|
63
|
+
import 'core-js/modules/es.set.js';
|
|
37
64
|
import '../avatar/fallback-avatar.js';
|
|
65
|
+
import 'core-js/modules/es.number.constructor.js';
|
|
66
|
+
import 'core-js/modules/es.array.from.js';
|
|
67
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
|
38
68
|
import 'react-dom';
|
|
39
69
|
import '../global/schedule-raf.js';
|
|
40
70
|
import '../tab-trap/tab-trap.js';
|
|
41
71
|
import '../popup/position.js';
|
|
72
|
+
import 'core-js/modules/es.array.includes.js';
|
|
73
|
+
import 'core-js/modules/es.string.includes.js';
|
|
74
|
+
import 'core-js/modules/es.array.sort.js';
|
|
42
75
|
import '../popup/popup.consts.js';
|
|
43
76
|
import '../popup/popup.target.js';
|
|
44
77
|
import '../shortcuts/core.js';
|
|
78
|
+
import 'core-js/modules/es.array.splice.js';
|
|
79
|
+
import 'core-js/modules/es.array.find-index.js';
|
|
45
80
|
import 'combokeys';
|
|
46
81
|
import '../global/sniffer.js';
|
|
47
82
|
import 'sniffr';
|
|
83
|
+
import 'core-js/modules/es.symbol.js';
|
|
84
|
+
import 'core-js/modules/es.symbol.description.js';
|
|
48
85
|
import 'react-virtualized/dist/es/List';
|
|
49
86
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
50
87
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -59,8 +96,6 @@ import '../list/list__item.js';
|
|
|
59
96
|
import '../checkbox/checkbox.js';
|
|
60
97
|
import '@jetbrains/icons/checkmark-14px';
|
|
61
98
|
import '@jetbrains/icons/remove-14px';
|
|
62
|
-
import '../global/prop-types.js';
|
|
63
|
-
import '../global/composeRefs.js';
|
|
64
99
|
import '../_helpers/checkbox.js';
|
|
65
100
|
import '../list/list__custom.js';
|
|
66
101
|
import '../global/get-event-key.js';
|
|
@@ -68,6 +103,8 @@ import '../list/list__title.js';
|
|
|
68
103
|
import '../list/list__separator.js';
|
|
69
104
|
import '../list/list__hint.js';
|
|
70
105
|
import '../list/consts.js';
|
|
106
|
+
import '../i18n/i18n.js';
|
|
107
|
+
import '../_helpers/control-label.js';
|
|
71
108
|
import '../global/react-render-adapter.js';
|
|
72
109
|
import '@jetbrains/icons/search';
|
|
73
110
|
import '../loader-inline/loader-inline.js';
|
|
@@ -79,7 +116,7 @@ import '../caret/caret.js';
|
|
|
79
116
|
import '../text/text.js';
|
|
80
117
|
import '../_helpers/select__filter.js';
|
|
81
118
|
|
|
82
|
-
var modules_9d0de074 = {"unit":"
|
|
119
|
+
var modules_9d0de074 = {"unit":"i__const_unit_0","button-shadow":"i__const_button_shadow_1","select":"select_rui_11de","value":"value_rui_11de ellipsis_rui_8bff font_rui_8bff","icons":"icons_rui_11de","light":"light_rui_2ac4","toolbar":"toolbar_rui_11de","button":"button_rui_11de","buttonSpaced":"buttonSpaced_rui_11de","inputMode":"inputMode_rui_11de","selectedIcon":"selectedIcon_rui_11de resetButton_rui_8bff","clearIcon":"clearIcon_rui_11de","sizeS":"sizeS_rui_11de","sizeM":"sizeM_rui_11de","sizeL":"sizeL_rui_11de","sizeFULL":"sizeFULL_rui_11de","sizeAUTO":"sizeAUTO_rui_11de","buttonMode":"buttonMode_rui_11de","open":"open_rui_11de","buttonContainer":"buttonContainer_rui_11de","buttonValue":"buttonValue_rui_11de ellipsis_rui_8bff","buttonValueOpen":"buttonValueOpen_rui_11de","buttonValueEmpty":"buttonValueEmpty_rui_11de","heightS":"heightS_rui_11de","label":"label_rui_11de","disabled":"disabled_rui_11de","avatar":"avatar_rui_11de","popup":"popup_rui_11de","chevron":"chevron_rui_11de","chevronIcon":"chevronIcon_rui_11de"};
|
|
83
120
|
|
|
84
121
|
/**
|
|
85
122
|
* @name Select
|
|
@@ -96,12 +133,16 @@ var Type;
|
|
|
96
133
|
Type["INLINE"] = "INLINE";
|
|
97
134
|
Type["INPUT_WITHOUT_CONTROLS"] = "INPUT_WITHOUT_CONTROLS";
|
|
98
135
|
})(Type || (Type = {}));
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
136
|
+
var ICONS_OFFSET = 5;
|
|
137
|
+
var ICON_WIDTH = 20;
|
|
138
|
+
var getStyle = memoize(function (iconsLength) {
|
|
139
|
+
return {
|
|
140
|
+
paddingRight: ICONS_OFFSET + iconsLength * ICON_WIDTH
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
var _isInputMode = function isInputMode(type) {
|
|
144
|
+
return type === Type.INPUT || type === Type.INPUT_WITHOUT_CONTROLS;
|
|
145
|
+
};
|
|
105
146
|
function getLowerCaseLabel(item) {
|
|
106
147
|
if (List.isItemType(List.ListProps.Type.SEPARATOR, item) || List.isItemType(List.ListProps.Type.HINT, item) || typeof item.label !== 'string') {
|
|
107
148
|
return null;
|
|
@@ -109,66 +150,77 @@ function getLowerCaseLabel(item) {
|
|
|
109
150
|
return item.label.toLowerCase();
|
|
110
151
|
}
|
|
111
152
|
function doesLabelMatch(itemToCheck, fn) {
|
|
112
|
-
|
|
153
|
+
var lowerCaseLabel = getLowerCaseLabel(itemToCheck);
|
|
113
154
|
if (lowerCaseLabel == null) {
|
|
114
155
|
return true;
|
|
115
156
|
}
|
|
116
157
|
return fn(lowerCaseLabel);
|
|
117
158
|
}
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
159
|
+
function _getFilterFn(filter) {
|
|
160
|
+
if (_typeof(filter) === 'object') {
|
|
120
161
|
if (filter.fn) {
|
|
121
162
|
return filter.fn;
|
|
122
163
|
}
|
|
123
164
|
if (filter.fuzzy) {
|
|
124
|
-
return (itemToCheck, checkString)
|
|
165
|
+
return function (itemToCheck, checkString) {
|
|
166
|
+
return doesLabelMatch(itemToCheck, function (lowerCaseLabel) {
|
|
167
|
+
return fuzzyHighlight(checkString, lowerCaseLabel).matched;
|
|
168
|
+
});
|
|
169
|
+
};
|
|
125
170
|
}
|
|
126
171
|
}
|
|
127
|
-
return
|
|
172
|
+
return function (itemToCheck, checkString) {
|
|
173
|
+
return doesLabelMatch(itemToCheck, function (lowerCaseLabel) {
|
|
174
|
+
return lowerCaseLabel.indexOf(checkString) >= 0;
|
|
175
|
+
});
|
|
176
|
+
};
|
|
128
177
|
}
|
|
129
178
|
function buildMultipleMap(selected) {
|
|
130
|
-
return selected.reduce((acc, item)
|
|
179
|
+
return selected.reduce(function (acc, item) {
|
|
131
180
|
acc[item.key] = true;
|
|
132
181
|
return acc;
|
|
133
182
|
}, {});
|
|
134
183
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (
|
|
184
|
+
function _getListItems(props, state, rawFilterString) {
|
|
185
|
+
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : props.data;
|
|
186
|
+
var filterString = rawFilterString.trim();
|
|
187
|
+
if (_isInputMode(props.type) && !props.allowAny && state.selected && !Array.isArray(state.selected) && filterString === state.selected.label) {
|
|
139
188
|
filterString = ''; // ignore multiple if it is exactly the selected item
|
|
140
189
|
}
|
|
141
190
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
...data[i]
|
|
149
|
-
};
|
|
191
|
+
var lowerCaseString = filterString.toLowerCase();
|
|
192
|
+
var filteredData = [];
|
|
193
|
+
var exactMatch = false;
|
|
194
|
+
var check = _getFilterFn(props.filter);
|
|
195
|
+
var _loop = function _loop() {
|
|
196
|
+
var item = _objectSpread2({}, data[i]);
|
|
150
197
|
if (check(item, lowerCaseString, data)) {
|
|
198
|
+
var _state$multipleMap2;
|
|
151
199
|
exactMatch = item.label === filterString;
|
|
152
|
-
if (props.multiple && !(
|
|
153
|
-
|
|
200
|
+
if (props.multiple && !(_typeof(props.multiple) === 'object' && props.multiple.removeSelectedItems)) {
|
|
201
|
+
var _state$multipleMap;
|
|
202
|
+
item.checkbox = !!((_state$multipleMap = state.multipleMap) !== null && _state$multipleMap !== void 0 && _state$multipleMap[item.key]);
|
|
154
203
|
}
|
|
155
|
-
if (props.multiple &&
|
|
156
|
-
item.disabled = props.multiple.limit === state.selected.length && !state.selected.find(
|
|
204
|
+
if (props.multiple && _typeof(props.multiple) === 'object' && props.multiple.limit && Array.isArray(state.selected)) {
|
|
205
|
+
item.disabled = props.multiple.limit === state.selected.length && !state.selected.find(function (selectedItem) {
|
|
206
|
+
return selectedItem.key === item.key;
|
|
207
|
+
});
|
|
157
208
|
}
|
|
158
209
|
// Ignore item if it's multiple and is already selected
|
|
159
|
-
if (!(props.multiple &&
|
|
210
|
+
if (!(props.multiple && _typeof(props.multiple) === 'object' && props.multiple.removeSelectedItems && (_state$multipleMap2 = state.multipleMap) !== null && _state$multipleMap2 !== void 0 && _state$multipleMap2[item.key])) {
|
|
160
211
|
filteredData.push(item);
|
|
161
212
|
}
|
|
162
213
|
}
|
|
214
|
+
};
|
|
215
|
+
for (var i = 0; i < data.length; i++) {
|
|
216
|
+
_loop();
|
|
163
217
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
add
|
|
167
|
-
} = props;
|
|
218
|
+
var addButton = null;
|
|
219
|
+
var add = props.add;
|
|
168
220
|
if (add && filterString && !exactMatch || add && add.alwaysVisible) {
|
|
169
221
|
if (!(add.regexp && !add.regexp.test(filterString)) && !(add.minlength && filterString.length < +add.minlength) || add.alwaysVisible) {
|
|
170
222
|
var _add$delayed;
|
|
171
|
-
|
|
223
|
+
var label;
|
|
172
224
|
if (add.label) {
|
|
173
225
|
label = typeof add.label === 'function' ? add.label(filterString) : add.label;
|
|
174
226
|
} else {
|
|
@@ -176,23 +228,23 @@ function getListItems(props, state, rawFilterString) {
|
|
|
176
228
|
}
|
|
177
229
|
addButton = {
|
|
178
230
|
prefix: add.prefix,
|
|
179
|
-
label,
|
|
231
|
+
label: label,
|
|
180
232
|
delayed: (_add$delayed = add.delayed) !== null && _add$delayed !== void 0 ? _add$delayed : true
|
|
181
233
|
};
|
|
182
234
|
}
|
|
183
235
|
}
|
|
184
236
|
return {
|
|
185
|
-
filteredData,
|
|
186
|
-
addButton
|
|
237
|
+
filteredData: filteredData,
|
|
238
|
+
addButton: addButton
|
|
187
239
|
};
|
|
188
240
|
}
|
|
189
241
|
function getSelectedIndex(selected, data) {
|
|
190
|
-
|
|
242
|
+
var firstSelected = Array.isArray(selected) ? selected[0] : selected;
|
|
191
243
|
if (firstSelected == null) {
|
|
192
244
|
return null;
|
|
193
245
|
}
|
|
194
|
-
for (
|
|
195
|
-
|
|
246
|
+
for (var i = 0; i < data.length; i++) {
|
|
247
|
+
var item = data[i];
|
|
196
248
|
if (item.key === undefined) {
|
|
197
249
|
continue;
|
|
198
250
|
}
|
|
@@ -202,26 +254,28 @@ function getSelectedIndex(selected, data) {
|
|
|
202
254
|
}
|
|
203
255
|
return null;
|
|
204
256
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
label
|
|
209
|
-
} = _ref;
|
|
257
|
+
var getItemLabel = function getItemLabel(_ref) {
|
|
258
|
+
var selectedLabel = _ref.selectedLabel,
|
|
259
|
+
label = _ref.label;
|
|
210
260
|
if (selectedLabel != null) {
|
|
211
261
|
return selectedLabel;
|
|
212
262
|
}
|
|
213
263
|
return typeof label === 'string' ? label : '';
|
|
214
264
|
};
|
|
215
|
-
|
|
265
|
+
var _getValueForFilter = function getValueForFilter(selected, type, filterValue) {
|
|
266
|
+
return selected && !isArray(selected) && _isInputMode(type) ? getItemLabel(selected) : filterValue;
|
|
267
|
+
};
|
|
216
268
|
function isSameSelected(prevSelected, selected) {
|
|
217
269
|
if (!prevSelected || !selected || prevSelected.length !== selected.length) {
|
|
218
270
|
return false;
|
|
219
271
|
}
|
|
220
|
-
|
|
272
|
+
var keysMap = selected.reduce(function (result, item) {
|
|
221
273
|
result[item.key] = true;
|
|
222
274
|
return result;
|
|
223
275
|
}, {});
|
|
224
|
-
return prevSelected.every(
|
|
276
|
+
return prevSelected.every(function (it) {
|
|
277
|
+
return keysMap[it.key];
|
|
278
|
+
});
|
|
225
279
|
}
|
|
226
280
|
/**
|
|
227
281
|
* @name Select
|
|
@@ -231,255 +285,285 @@ function isSameSelected(prevSelected, selected) {
|
|
|
231
285
|
/**
|
|
232
286
|
* Displays a select.
|
|
233
287
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
288
|
+
var Select = /*#__PURE__*/function (_Component) {
|
|
289
|
+
_inherits(Select, _Component);
|
|
290
|
+
var _super = _createSuper(Select);
|
|
291
|
+
function Select() {
|
|
236
292
|
var _this;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
293
|
+
_classCallCheck(this, Select);
|
|
294
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
295
|
+
args[_key] = arguments[_key];
|
|
296
|
+
}
|
|
297
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
298
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
240
299
|
data: [],
|
|
241
300
|
shownData: [],
|
|
242
|
-
selected:
|
|
301
|
+
selected: _this.props.multiple ? [] : null,
|
|
243
302
|
selectedIndex: null,
|
|
244
|
-
filterValue:
|
|
303
|
+
filterValue: _this.props.filter && _typeof(_this.props.filter) === 'object' && _this.props.filter.value || '',
|
|
245
304
|
shortcutsEnabled: false,
|
|
246
305
|
popupShortcuts: false,
|
|
247
|
-
showPopup:
|
|
248
|
-
prevData:
|
|
306
|
+
showPopup: _this.props.showPopup,
|
|
307
|
+
prevData: _this.props.data,
|
|
249
308
|
prevSelected: null,
|
|
250
|
-
prevMultiple:
|
|
309
|
+
prevMultiple: _this.props.multiple,
|
|
251
310
|
multipleMap: {},
|
|
252
311
|
addButton: null
|
|
253
312
|
});
|
|
254
|
-
_defineProperty(
|
|
255
|
-
_defineProperty(
|
|
256
|
-
_defineProperty(
|
|
257
|
-
_defineProperty(
|
|
258
|
-
|
|
259
|
-
|
|
313
|
+
_defineProperty(_assertThisInitialized(_this), "id", getUID('select-'));
|
|
314
|
+
_defineProperty(_assertThisInitialized(_this), "shortcutsScope", _this.id);
|
|
315
|
+
_defineProperty(_assertThisInitialized(_this), "listId", "".concat(_this.id, ":list"));
|
|
316
|
+
_defineProperty(_assertThisInitialized(_this), "_focusHandler", function (e) {
|
|
317
|
+
_this.props.onFocus(e);
|
|
318
|
+
_this.setState({
|
|
260
319
|
shortcutsEnabled: true,
|
|
261
320
|
focused: true
|
|
262
321
|
});
|
|
263
322
|
});
|
|
264
|
-
_defineProperty(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
323
|
+
_defineProperty(_assertThisInitialized(_this), "_blurHandler", function () {
|
|
324
|
+
var _this$_popup;
|
|
325
|
+
_this.props.onBlur();
|
|
326
|
+
if (_this._popup && _this._popup.isVisible() && !_this._popup.isClickingPopup) {
|
|
327
|
+
window.setTimeout(function () {
|
|
328
|
+
_this.setState({
|
|
269
329
|
showPopup: false
|
|
270
330
|
});
|
|
271
331
|
});
|
|
272
332
|
}
|
|
273
|
-
if (!
|
|
274
|
-
|
|
333
|
+
if (!((_this$_popup = _this._popup) !== null && _this$_popup !== void 0 && _this$_popup.isClickingPopup)) {
|
|
334
|
+
_this.setState({
|
|
275
335
|
shortcutsEnabled: false,
|
|
276
336
|
focused: false
|
|
277
337
|
});
|
|
278
338
|
}
|
|
279
339
|
});
|
|
280
|
-
_defineProperty(
|
|
281
|
-
_defineProperty(
|
|
282
|
-
|
|
340
|
+
_defineProperty(_assertThisInitialized(_this), "node", void 0);
|
|
341
|
+
_defineProperty(_assertThisInitialized(_this), "nodeRef", function (el) {
|
|
342
|
+
_this.node = el;
|
|
283
343
|
});
|
|
284
|
-
_defineProperty(
|
|
285
|
-
_defineProperty(
|
|
286
|
-
if (
|
|
287
|
-
|
|
344
|
+
_defineProperty(_assertThisInitialized(_this), "_popup", null);
|
|
345
|
+
_defineProperty(_assertThisInitialized(_this), "onEmptyPopupEnter", function () {
|
|
346
|
+
if (_this.state.addButton) {
|
|
347
|
+
_this.addHandler();
|
|
288
348
|
}
|
|
289
349
|
});
|
|
290
|
-
_defineProperty(
|
|
291
|
-
|
|
292
|
-
|
|
350
|
+
_defineProperty(_assertThisInitialized(_this), "focus", function () {
|
|
351
|
+
var _this$node;
|
|
352
|
+
var focusableSelectExists = (_this$node = _this.node) === null || _this$node === void 0 ? void 0 : _this$node.querySelector('[data-test~=ring-select__focus]');
|
|
353
|
+
var restoreFocusNode = _this.props.targetElement || focusableSelectExists;
|
|
354
|
+
restoreFocusNode === null || restoreFocusNode === void 0 ? void 0 : restoreFocusNode.focus();
|
|
355
|
+
});
|
|
356
|
+
_defineProperty(_assertThisInitialized(_this), "_onEnter", function () {
|
|
357
|
+
var _this$_popup2;
|
|
358
|
+
if (_this.state.addButton && _this.state.shownData.length === 0) {
|
|
359
|
+
_this.addHandler();
|
|
293
360
|
}
|
|
294
|
-
|
|
295
|
-
if (!
|
|
361
|
+
_this.props.onDone();
|
|
362
|
+
if (!((_this$_popup2 = _this._popup) !== null && _this$_popup2 !== void 0 && _this$_popup2.isVisible()) && _this.props.allowAny) {
|
|
296
363
|
return true;
|
|
297
364
|
}
|
|
298
365
|
return undefined;
|
|
299
366
|
});
|
|
300
|
-
_defineProperty(
|
|
301
|
-
|
|
367
|
+
_defineProperty(_assertThisInitialized(_this), "_onEsc", function (event) {
|
|
368
|
+
var _this$_popup3;
|
|
369
|
+
if (!((_this$_popup3 = _this._popup) !== null && _this$_popup3 !== void 0 && _this$_popup3.isVisible())) {
|
|
302
370
|
return true;
|
|
303
|
-
} else if (
|
|
371
|
+
} else if (_this.props.multiple || !_this.props.getInitial) {
|
|
304
372
|
return false;
|
|
305
373
|
}
|
|
306
|
-
|
|
374
|
+
var selected = {
|
|
307
375
|
key: Math.random(),
|
|
308
|
-
label:
|
|
376
|
+
label: _this.props.getInitial()
|
|
309
377
|
};
|
|
310
|
-
|
|
311
|
-
selected,
|
|
312
|
-
filterValue:
|
|
313
|
-
}, ()
|
|
314
|
-
|
|
315
|
-
|
|
378
|
+
_this.setState({
|
|
379
|
+
selected: selected,
|
|
380
|
+
filterValue: _this.getValueForFilter(selected)
|
|
381
|
+
}, function () {
|
|
382
|
+
_this.props.onChange(selected, event);
|
|
383
|
+
_this.props.onReset();
|
|
316
384
|
});
|
|
317
385
|
return undefined;
|
|
318
386
|
});
|
|
319
|
-
_defineProperty(
|
|
320
|
-
if (
|
|
321
|
-
|
|
387
|
+
_defineProperty(_assertThisInitialized(_this), "_inputShortcutHandler", function () {
|
|
388
|
+
if (_this.state.focused && _this._popup && !_this._popup.isVisible()) {
|
|
389
|
+
_this._clickHandler();
|
|
322
390
|
}
|
|
323
391
|
});
|
|
324
|
-
_defineProperty(
|
|
325
|
-
|
|
392
|
+
_defineProperty(_assertThisInitialized(_this), "popupRef", function (el) {
|
|
393
|
+
_this._popup = el;
|
|
326
394
|
});
|
|
327
|
-
_defineProperty(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
395
|
+
_defineProperty(_assertThisInitialized(_this), "addHandler", function () {
|
|
396
|
+
var value = _this.filterValue();
|
|
397
|
+
_this._hidePopup();
|
|
398
|
+
_this.props.onAdd(value);
|
|
331
399
|
});
|
|
332
|
-
_defineProperty(
|
|
333
|
-
_defineProperty(
|
|
334
|
-
_defineProperty(
|
|
335
|
-
if (!
|
|
336
|
-
if (
|
|
337
|
-
|
|
400
|
+
_defineProperty(_assertThisInitialized(_this), "getLowerCaseLabel", getLowerCaseLabel);
|
|
401
|
+
_defineProperty(_assertThisInitialized(_this), "doesLabelMatch", doesLabelMatch);
|
|
402
|
+
_defineProperty(_assertThisInitialized(_this), "_clickHandler", function () {
|
|
403
|
+
if (!_this.props.disabled) {
|
|
404
|
+
if (_this.state.showPopup) {
|
|
405
|
+
_this._hidePopup();
|
|
338
406
|
} else {
|
|
339
|
-
|
|
340
|
-
|
|
407
|
+
_this.props.onBeforeOpen();
|
|
408
|
+
_this._showPopup();
|
|
341
409
|
}
|
|
342
410
|
}
|
|
343
411
|
});
|
|
344
|
-
_defineProperty(
|
|
345
|
-
if (
|
|
412
|
+
_defineProperty(_assertThisInitialized(_this), "_openPopupIfClosed", function () {
|
|
413
|
+
if (_this.props.disabled || _this.state.showPopup) {
|
|
346
414
|
return;
|
|
347
415
|
}
|
|
348
|
-
|
|
349
|
-
|
|
416
|
+
_this.props.onBeforeOpen();
|
|
417
|
+
_this._showPopup();
|
|
350
418
|
});
|
|
351
|
-
_defineProperty(
|
|
352
|
-
|
|
419
|
+
_defineProperty(_assertThisInitialized(_this), "_filterChangeHandler", function (e) {
|
|
420
|
+
_this._setFilter(e.currentTarget.value, e);
|
|
353
421
|
});
|
|
354
|
-
_defineProperty(
|
|
355
|
-
|
|
422
|
+
_defineProperty(_assertThisInitialized(_this), "_setFilter", function (value, event) {
|
|
423
|
+
var _this$_popup4;
|
|
424
|
+
if (_this.isInputMode() && !_this.state.focused) {
|
|
356
425
|
return;
|
|
357
426
|
}
|
|
358
|
-
if (value ===
|
|
427
|
+
if (value === _this.state.filterValue) {
|
|
359
428
|
return;
|
|
360
429
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (
|
|
364
|
-
|
|
430
|
+
var filterValue = value.replace(/^\s+/g, '');
|
|
431
|
+
_this.props.onFilter(filterValue);
|
|
432
|
+
if (_this.props.allowAny) {
|
|
433
|
+
var fakeSelected = {
|
|
365
434
|
key: Math.random(),
|
|
366
435
|
label: filterValue
|
|
367
436
|
};
|
|
368
|
-
|
|
437
|
+
_this.setState({
|
|
369
438
|
selected: filterValue === '' ? null : fakeSelected,
|
|
370
439
|
selectedIndex: null
|
|
371
|
-
}, ()
|
|
372
|
-
|
|
373
|
-
|
|
440
|
+
}, function () {
|
|
441
|
+
_this.props.onSelect(fakeSelected, event);
|
|
442
|
+
_this.props.onChange(fakeSelected, event);
|
|
374
443
|
});
|
|
375
444
|
}
|
|
376
|
-
!
|
|
377
|
-
|
|
378
|
-
filterValue
|
|
379
|
-
}, ()
|
|
380
|
-
|
|
445
|
+
!((_this$_popup4 = _this._popup) !== null && _this$_popup4 !== void 0 && _this$_popup4.isVisible()) && _this.props.onBeforeOpen();
|
|
446
|
+
_this.setState({
|
|
447
|
+
filterValue: filterValue
|
|
448
|
+
}, function () {
|
|
449
|
+
_this._showPopup();
|
|
381
450
|
});
|
|
382
451
|
});
|
|
383
|
-
_defineProperty(
|
|
384
|
-
if (
|
|
385
|
-
setTimeout(()
|
|
386
|
-
|
|
387
|
-
|
|
452
|
+
_defineProperty(_assertThisInitialized(_this), "_redrawPopup", function () {
|
|
453
|
+
if (_this.props.multiple) {
|
|
454
|
+
setTimeout(function () {
|
|
455
|
+
_this.isInputMode() && _this.clearFilter();
|
|
456
|
+
_this._showPopup();
|
|
388
457
|
}, 0);
|
|
389
458
|
}
|
|
390
459
|
});
|
|
391
|
-
_defineProperty(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
460
|
+
_defineProperty(_assertThisInitialized(_this), "_listSelectHandler", function (selected, event) {
|
|
461
|
+
var _this$props$tryKeepOp;
|
|
462
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
463
|
+
var isItem = function isItem(item) {
|
|
464
|
+
return List.isItemType(List.ListProps.Type.ITEM, item);
|
|
465
|
+
};
|
|
466
|
+
var isCustomItem = function isCustomItem(item) {
|
|
467
|
+
return List.isItemType(List.ListProps.Type.CUSTOM, item);
|
|
468
|
+
};
|
|
469
|
+
var isSelectItemEvent = event && (event.type === 'select' || event.type === 'keydown');
|
|
396
470
|
if (isSelectItemEvent) {
|
|
397
471
|
event.preventDefault();
|
|
398
472
|
}
|
|
399
473
|
if (!isItem(selected) && !isCustomItem(selected) || selected.disabled || selected.isResetItem) {
|
|
400
474
|
return;
|
|
401
475
|
}
|
|
476
|
+
var tryKeepOpen = (_this$props$tryKeepOp = _this.props.tryKeepOpen) !== null && _this$props$tryKeepOp !== void 0 ? _this$props$tryKeepOp : opts.tryKeepOpen;
|
|
402
477
|
if (!_this.props.multiple) {
|
|
403
|
-
|
|
478
|
+
if (!tryKeepOpen) {
|
|
479
|
+
_this._hidePopup(isSelectItemEvent);
|
|
480
|
+
}
|
|
404
481
|
_this.setState({
|
|
405
|
-
selected,
|
|
482
|
+
selected: selected,
|
|
406
483
|
selectedIndex: _this._getSelectedIndex(selected, _this.props.data)
|
|
407
|
-
}, ()
|
|
408
|
-
|
|
484
|
+
}, function () {
|
|
485
|
+
var newFilterValue = _this.isInputMode() && !_this.props.hideSelected ? getItemLabel(selected) : '';
|
|
409
486
|
_this.filterValue(newFilterValue);
|
|
410
487
|
_this.props.onFilter(newFilterValue);
|
|
411
488
|
_this.props.onSelect(selected, event);
|
|
412
489
|
_this.props.onChange(selected, event);
|
|
413
490
|
});
|
|
414
491
|
} else {
|
|
415
|
-
const {
|
|
416
|
-
tryKeepOpen
|
|
417
|
-
} = opts;
|
|
418
492
|
if (!tryKeepOpen) {
|
|
419
493
|
_this._hidePopup(isSelectItemEvent);
|
|
420
494
|
}
|
|
421
495
|
if (selected.key == null) {
|
|
422
496
|
throw new Error('Multiple selection requires each item to have the "key" property');
|
|
423
497
|
}
|
|
424
|
-
_this.setState(prevState
|
|
425
|
-
|
|
426
|
-
|
|
498
|
+
_this.setState(function (prevState) {
|
|
499
|
+
var currentSelection = prevState.selected;
|
|
500
|
+
var nextSelection;
|
|
427
501
|
if (!prevState.multipleMap[selected.key]) {
|
|
428
502
|
nextSelection = currentSelection.concat(selected);
|
|
429
503
|
_this.props.onSelect && _this.props.onSelect(selected, event);
|
|
430
504
|
} else {
|
|
431
|
-
nextSelection = currentSelection.filter(
|
|
505
|
+
nextSelection = currentSelection.filter(function (item) {
|
|
506
|
+
return item.key !== selected.key;
|
|
507
|
+
});
|
|
432
508
|
_this.props.onDeselect && _this.props.onDeselect(selected);
|
|
433
509
|
}
|
|
434
510
|
_this.props.onChange(nextSelection, event);
|
|
435
|
-
|
|
511
|
+
var nextState = {
|
|
512
|
+
filterValue: '',
|
|
436
513
|
selected: nextSelection,
|
|
437
514
|
selectedIndex: _this._getSelectedIndex(selected, _this.props.data)
|
|
438
515
|
};
|
|
439
|
-
if (
|
|
440
|
-
nextState.shownData = prevState.shownData.map(
|
|
441
|
-
|
|
442
|
-
|
|
516
|
+
if (_typeof(_this.props.multiple) === 'object' && _this.props.multiple.limit && nextSelection.length === _this.props.multiple.limit) {
|
|
517
|
+
nextState.shownData = prevState.shownData.map(function (item) {
|
|
518
|
+
return nextSelection.find(function (selectedItem) {
|
|
519
|
+
return selectedItem.key === item.key;
|
|
520
|
+
}) ? item : _objectSpread2(_objectSpread2({}, item), {}, {
|
|
521
|
+
disabled: true
|
|
522
|
+
});
|
|
443
523
|
});
|
|
444
524
|
}
|
|
445
525
|
if (!prevState.multipleMap[selected.key]) {
|
|
446
|
-
nextState.multipleMap = {
|
|
447
|
-
...prevState.multipleMap,
|
|
448
|
-
[selected.key]: true
|
|
449
|
-
};
|
|
526
|
+
nextState.multipleMap = _objectSpread2(_objectSpread2({}, prevState.multipleMap), {}, _defineProperty({}, selected.key, true));
|
|
450
527
|
} else {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
528
|
+
var _prevState$multipleMa = prevState.multipleMap,
|
|
529
|
+
_selected$key = selected.key;
|
|
530
|
+
_prevState$multipleMa[_selected$key];
|
|
531
|
+
var restMultipleMap = _objectWithoutProperties(_prevState$multipleMa, [_selected$key].map(_toPropertyKey));
|
|
455
532
|
nextState.multipleMap = restMultipleMap;
|
|
456
533
|
}
|
|
457
|
-
return {
|
|
458
|
-
|
|
459
|
-
...nextState
|
|
460
|
-
};
|
|
461
|
-
}, () => {
|
|
534
|
+
return _objectSpread2(_objectSpread2({}, prevState), nextState);
|
|
535
|
+
}, function () {
|
|
462
536
|
if (tryKeepOpen) {
|
|
463
537
|
_this._redrawPopup();
|
|
464
538
|
}
|
|
465
539
|
});
|
|
466
540
|
}
|
|
467
541
|
});
|
|
468
|
-
_defineProperty(
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
542
|
+
_defineProperty(_assertThisInitialized(_this), "_listSelectAllHandler", function () {
|
|
543
|
+
var isSelectAll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
544
|
+
var isItem = function isItem(item) {
|
|
545
|
+
return List.isItemType(List.ListProps.Type.ITEM, item);
|
|
546
|
+
};
|
|
547
|
+
var isCustomItem = function isCustomItem(item) {
|
|
548
|
+
return List.isItemType(List.ListProps.Type.CUSTOM, item);
|
|
549
|
+
};
|
|
550
|
+
_this.setState(function (prevState) {
|
|
551
|
+
var currentSelection = prevState.selected;
|
|
552
|
+
var nextSelection;
|
|
475
553
|
if (isSelectAll) {
|
|
476
|
-
nextSelection = _this.props.data.filter(
|
|
477
|
-
|
|
554
|
+
nextSelection = _this.props.data.filter(function (item) {
|
|
555
|
+
return (isItem(item) || isCustomItem(item)) && !item.disabled;
|
|
556
|
+
});
|
|
557
|
+
nextSelection.filter(function (item) {
|
|
558
|
+
return !_this.props.selected.find(function (selectedItem) {
|
|
559
|
+
return item.key === selectedItem.key;
|
|
560
|
+
});
|
|
561
|
+
}).forEach(function (item) {
|
|
478
562
|
_this.props.onSelect && _this.props.onSelect(item);
|
|
479
563
|
});
|
|
480
564
|
} else {
|
|
481
565
|
nextSelection = [];
|
|
482
|
-
currentSelection.forEach(item
|
|
566
|
+
currentSelection.forEach(function (item) {
|
|
483
567
|
_this.props.onDeselect && _this.props.onDeselect(item);
|
|
484
568
|
});
|
|
485
569
|
}
|
|
@@ -488,582 +572,626 @@ class Select extends Component {
|
|
|
488
572
|
filterValue: '',
|
|
489
573
|
selected: nextSelection,
|
|
490
574
|
selectedIndex: isSelectAll ? _this._getSelectedIndex(nextSelection, _this.props.data) : null,
|
|
491
|
-
shownData: prevState.shownData.map(item
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
575
|
+
shownData: prevState.shownData.map(function (item) {
|
|
576
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
577
|
+
checkbox: isSelectAll
|
|
578
|
+
});
|
|
579
|
+
}),
|
|
580
|
+
multipleMap: isSelectAll ? buildMultipleMap(_this.props.data.filter(function (item) {
|
|
581
|
+
return !item.disabled;
|
|
582
|
+
})) : {}
|
|
496
583
|
};
|
|
497
584
|
}, _this._redrawPopup);
|
|
498
585
|
});
|
|
499
|
-
_defineProperty(
|
|
500
|
-
if (
|
|
501
|
-
if (!
|
|
502
|
-
if (
|
|
503
|
-
|
|
504
|
-
} else if (
|
|
505
|
-
|
|
586
|
+
_defineProperty(_assertThisInitialized(_this), "_onCloseAttempt", function (event, isEsc) {
|
|
587
|
+
if (_this.isInputMode()) {
|
|
588
|
+
if (!_this.props.allowAny) {
|
|
589
|
+
if (_this.props.hideSelected || !_this.state.selected || _this.props.multiple) {
|
|
590
|
+
_this.clearFilter();
|
|
591
|
+
} else if (_this.state.selected && !Array.isArray(_this.state.selected)) {
|
|
592
|
+
_this.filterValue(getItemLabel(_this.state.selected));
|
|
506
593
|
}
|
|
507
594
|
}
|
|
508
595
|
}
|
|
509
|
-
|
|
596
|
+
var isTagRemoved = _this.props.tags && event && event.target && event.target instanceof Element && event.target.matches('[data-test="ring-tag-remove"]');
|
|
510
597
|
if (!isTagRemoved) {
|
|
511
|
-
|
|
598
|
+
_this._hidePopup(isEsc);
|
|
512
599
|
}
|
|
513
600
|
});
|
|
514
|
-
_defineProperty(
|
|
515
|
-
|
|
601
|
+
_defineProperty(_assertThisInitialized(_this), "clearFilter", function (e) {
|
|
602
|
+
_this._setFilter('', e);
|
|
516
603
|
});
|
|
517
|
-
_defineProperty(
|
|
604
|
+
_defineProperty(_assertThisInitialized(_this), "clear", function (event) {
|
|
518
605
|
if (event) {
|
|
519
606
|
event.stopPropagation();
|
|
520
607
|
}
|
|
521
|
-
|
|
522
|
-
|
|
608
|
+
var empty = _this.props.multiple ? [] : null;
|
|
609
|
+
_this.setState({
|
|
523
610
|
selected: empty,
|
|
524
611
|
selectedIndex: null,
|
|
525
612
|
filterValue: ''
|
|
526
|
-
}, ()
|
|
527
|
-
if (
|
|
528
|
-
|
|
613
|
+
}, function () {
|
|
614
|
+
if (_this.props.onChange) {
|
|
615
|
+
_this.props.onChange(empty, event);
|
|
529
616
|
}
|
|
530
617
|
});
|
|
531
618
|
return false;
|
|
532
619
|
});
|
|
533
|
-
_defineProperty(
|
|
534
|
-
_defineProperty(
|
|
535
|
-
|
|
620
|
+
_defineProperty(_assertThisInitialized(_this), "filter", void 0);
|
|
621
|
+
_defineProperty(_assertThisInitialized(_this), "filterRef", function (el) {
|
|
622
|
+
_this.filter = el;
|
|
536
623
|
});
|
|
624
|
+
return _this;
|
|
537
625
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
prevMultiple: multiple
|
|
554
|
-
};
|
|
555
|
-
if ('data' in nextProps && data !== prevData) {
|
|
556
|
-
const {
|
|
557
|
-
filteredData,
|
|
558
|
-
addButton
|
|
559
|
-
} = getListItems(nextProps, prevState, filterValue, data);
|
|
560
|
-
Object.assign(nextState, {
|
|
561
|
-
shownData: filteredData,
|
|
562
|
-
addButton
|
|
563
|
-
});
|
|
564
|
-
if (prevState.selected) {
|
|
565
|
-
Object.assign(nextState, {
|
|
566
|
-
selectedIndex: getSelectedIndex(prevState.selected, data),
|
|
567
|
-
prevFilterValue: getValueForFilter(prevState.selected, type, filterValue)
|
|
568
|
-
});
|
|
626
|
+
_createClass(Select, [{
|
|
627
|
+
key: "componentDidUpdate",
|
|
628
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
629
|
+
var _this$state = this.state,
|
|
630
|
+
showPopup = _this$state.showPopup,
|
|
631
|
+
selected = _this$state.selected;
|
|
632
|
+
var _this$props = this.props,
|
|
633
|
+
onClose = _this$props.onClose,
|
|
634
|
+
onOpen = _this$props.onOpen,
|
|
635
|
+
onChange = _this$props.onChange,
|
|
636
|
+
multiple = _this$props.multiple;
|
|
637
|
+
if (prevState.showPopup && !showPopup) {
|
|
638
|
+
onClose(selected);
|
|
639
|
+
} else if (!prevState.showPopup && showPopup) {
|
|
640
|
+
onOpen();
|
|
569
641
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const selected = nextProps.selected || (multiple ? [] : null);
|
|
573
|
-
const selectedIndex = getSelectedIndex(selected, data || prevData);
|
|
574
|
-
Object.assign(nextState, {
|
|
575
|
-
selected,
|
|
576
|
-
prevFilterValue: getValueForFilter(selected, type, filterValue)
|
|
577
|
-
});
|
|
578
|
-
if (!Array.isArray(prevSelected) || !Array.isArray(selected) || !isSameSelected(prevSelected, selected)) {
|
|
579
|
-
Object.assign(nextState, {
|
|
580
|
-
selectedIndex
|
|
581
|
-
});
|
|
642
|
+
if (multiple !== prevProps.multiple && !deepEqual(multiple, prevProps.multiple)) {
|
|
643
|
+
onChange(selected);
|
|
582
644
|
}
|
|
583
645
|
}
|
|
584
|
-
|
|
585
|
-
|
|
646
|
+
}, {
|
|
647
|
+
key: "getValueForFilter",
|
|
648
|
+
value: function getValueForFilter(selected) {
|
|
649
|
+
return _getValueForFilter(selected, this.props.type, this.state.filterValue);
|
|
586
650
|
}
|
|
587
|
-
|
|
588
|
-
|
|
651
|
+
}, {
|
|
652
|
+
key: "_getSelectedIndex",
|
|
653
|
+
value: function _getSelectedIndex(selected, data) {
|
|
654
|
+
return getSelectedIndex(selected, data);
|
|
589
655
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
656
|
+
}, {
|
|
657
|
+
key: "_getResetOption",
|
|
658
|
+
value: function _getResetOption() {
|
|
659
|
+
var _this2 = this;
|
|
660
|
+
var isOptionsSelected = Array.isArray(this.state.selected) && this.state.selected.length;
|
|
661
|
+
var reset = this.props.tags && _typeof(this.props.tags) === 'object' ? this.props.tags.reset : null;
|
|
662
|
+
if (!isOptionsSelected || !reset) {
|
|
663
|
+
return null;
|
|
664
|
+
}
|
|
665
|
+
var resetHandler = function resetHandler(item, event) {
|
|
666
|
+
_this2.clear(event);
|
|
667
|
+
_this2.clearFilter();
|
|
668
|
+
_this2.props.onFilter('');
|
|
669
|
+
_this2.setState(function (prevState) {
|
|
670
|
+
return {
|
|
671
|
+
shownData: prevState.shownData.slice(reset.separator ? 2 : 1),
|
|
672
|
+
multipleMap: {}
|
|
673
|
+
};
|
|
674
|
+
});
|
|
675
|
+
_this2._redrawPopup();
|
|
676
|
+
};
|
|
677
|
+
return {
|
|
678
|
+
isResetItem: true,
|
|
679
|
+
separator: reset.separator,
|
|
680
|
+
key: reset.label,
|
|
681
|
+
rgItemType: List.ListProps.Type.CUSTOM,
|
|
682
|
+
template: /*#__PURE__*/React.createElement(Button, {
|
|
683
|
+
text: true,
|
|
684
|
+
className: modules_9d0de074.button,
|
|
685
|
+
"data-test": "ring-select-reset-tags-button",
|
|
686
|
+
height: ControlsHeight.S
|
|
687
|
+
}, reset.label),
|
|
688
|
+
glyph: reset.glyph,
|
|
689
|
+
onClick: resetHandler
|
|
690
|
+
};
|
|
606
691
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
onClose(selected);
|
|
622
|
-
} else if (!prevState.showPopup && showPopup) {
|
|
623
|
-
onOpen();
|
|
692
|
+
}, {
|
|
693
|
+
key: "_prependResetOption",
|
|
694
|
+
value: function _prependResetOption(shownData) {
|
|
695
|
+
var resetOption = this._getResetOption();
|
|
696
|
+
if (resetOption) {
|
|
697
|
+
var resetItems = [resetOption];
|
|
698
|
+
if (resetOption.separator) {
|
|
699
|
+
resetItems.push({
|
|
700
|
+
rgItemType: List.ListProps.Type.SEPARATOR
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
return resetItems.concat(shownData);
|
|
704
|
+
}
|
|
705
|
+
return shownData;
|
|
624
706
|
}
|
|
625
|
-
|
|
626
|
-
|
|
707
|
+
}, {
|
|
708
|
+
key: "_renderPopup",
|
|
709
|
+
value: function _renderPopup() {
|
|
710
|
+
var _this3 = this;
|
|
711
|
+
var anchorElement = this.props.targetElement || this.node;
|
|
712
|
+
var _this$state2 = this.state,
|
|
713
|
+
showPopup = _this$state2.showPopup,
|
|
714
|
+
shownData = _this$state2.shownData;
|
|
715
|
+
var _shownData = this._prependResetOption(shownData);
|
|
716
|
+
return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, function (_ref2) {
|
|
717
|
+
var translate = _ref2.translate;
|
|
718
|
+
var message;
|
|
719
|
+
if (_this3.props.loading) {
|
|
720
|
+
var _this3$props$loadingM;
|
|
721
|
+
message = (_this3$props$loadingM = _this3.props.loadingMessage) !== null && _this3$props$loadingM !== void 0 ? _this3$props$loadingM : translate('loading');
|
|
722
|
+
} else if (!shownData.length) {
|
|
723
|
+
var _this3$props$notFound;
|
|
724
|
+
message = (_this3$props$notFound = _this3.props.notFoundMessage) !== null && _this3$props$notFound !== void 0 ? _this3$props$notFound : translate('noOptionsFound');
|
|
725
|
+
}
|
|
726
|
+
return /*#__PURE__*/React.createElement(SelectPopup, {
|
|
727
|
+
data: _shownData,
|
|
728
|
+
message: message,
|
|
729
|
+
toolbar: showPopup && _this3.getToolbar(),
|
|
730
|
+
topbar: _this3.getTopbar(),
|
|
731
|
+
loading: _this3.props.loading,
|
|
732
|
+
activeIndex: _this3.state.selectedIndex,
|
|
733
|
+
hidden: !showPopup,
|
|
734
|
+
ref: _this3.popupRef,
|
|
735
|
+
maxHeight: _this3.props.maxHeight,
|
|
736
|
+
minWidth: _this3.props.minWidth,
|
|
737
|
+
directions: _this3.props.directions,
|
|
738
|
+
className: _this3.props.popupClassName,
|
|
739
|
+
style: _this3.props.popupStyle,
|
|
740
|
+
top: _this3.props.top,
|
|
741
|
+
left: _this3.props.left,
|
|
742
|
+
filter: _this3.isInputMode() ? false : _this3.props.filter // disable popup filter in INPUT mode
|
|
743
|
+
,
|
|
744
|
+
filterIcon: _this3.props.filterIcon,
|
|
745
|
+
filterRef: _this3.props.filterRef,
|
|
746
|
+
multiple: _this3.props.multiple,
|
|
747
|
+
filterValue: _this3.state.filterValue,
|
|
748
|
+
anchorElement: anchorElement,
|
|
749
|
+
onCloseAttempt: _this3._onCloseAttempt,
|
|
750
|
+
onOutsideClick: _this3.props.onOutsideClick,
|
|
751
|
+
onSelect: _this3._listSelectHandler,
|
|
752
|
+
onSelectAll: _this3._listSelectAllHandler,
|
|
753
|
+
onFilter: _this3._filterChangeHandler,
|
|
754
|
+
onClear: _this3.clearFilter,
|
|
755
|
+
onLoadMore: _this3.props.onLoadMore,
|
|
756
|
+
isInputMode: _this3.isInputMode(),
|
|
757
|
+
selected: _this3.state.selected,
|
|
758
|
+
tags: _this3.props.tags,
|
|
759
|
+
compact: _this3.props.compact,
|
|
760
|
+
renderOptimization: _this3.props.renderOptimization,
|
|
761
|
+
ringPopupTarget: _this3.props.ringPopupTarget,
|
|
762
|
+
disableMoveOverflow: _this3.props.disableMoveOverflow,
|
|
763
|
+
disableScrollToActive: _this3.props.disableScrollToActive,
|
|
764
|
+
dir: _this3.props.dir,
|
|
765
|
+
onEmptyPopupEnter: _this3.onEmptyPopupEnter,
|
|
766
|
+
listId: _this3.listId
|
|
767
|
+
});
|
|
768
|
+
});
|
|
627
769
|
}
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
return null;
|
|
770
|
+
}, {
|
|
771
|
+
key: "_showPopup",
|
|
772
|
+
value: function _showPopup() {
|
|
773
|
+
if (!this.node) {
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
var shownData = this.getListItems(this.filterValue());
|
|
777
|
+
this.setState({
|
|
778
|
+
showPopup: true,
|
|
779
|
+
shownData: shownData
|
|
780
|
+
});
|
|
640
781
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
this
|
|
645
|
-
this.
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return {
|
|
652
|
-
isResetItem: true,
|
|
653
|
-
separator: reset.separator,
|
|
654
|
-
key: reset.label,
|
|
655
|
-
rgItemType: List.ListProps.Type.CUSTOM,
|
|
656
|
-
template: /*#__PURE__*/React.createElement(Button, {
|
|
657
|
-
text: true,
|
|
658
|
-
className: modules_9d0de074.button,
|
|
659
|
-
"data-test": "ring-select-reset-tags-button",
|
|
660
|
-
height: ControlsHeight.S
|
|
661
|
-
}, reset.label),
|
|
662
|
-
glyph: reset.glyph,
|
|
663
|
-
onClick: resetHandler
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
_prependResetOption(shownData) {
|
|
667
|
-
const resetOption = this._getResetOption();
|
|
668
|
-
if (resetOption) {
|
|
669
|
-
const resetItems = [resetOption];
|
|
670
|
-
if (resetOption.separator) {
|
|
671
|
-
resetItems.push({
|
|
672
|
-
rgItemType: List.ListProps.Type.SEPARATOR
|
|
782
|
+
}, {
|
|
783
|
+
key: "_hidePopup",
|
|
784
|
+
value: function _hidePopup(tryFocusAnchor) {
|
|
785
|
+
var _this4 = this;
|
|
786
|
+
if (this.node && this.state.showPopup) {
|
|
787
|
+
this.setState(function (prevState) {
|
|
788
|
+
return {
|
|
789
|
+
showPopup: false,
|
|
790
|
+
filterValue: _this4.props.allowAny ? prevState.filterValue : ''
|
|
791
|
+
};
|
|
673
792
|
});
|
|
793
|
+
if (tryFocusAnchor) {
|
|
794
|
+
this.focus();
|
|
795
|
+
}
|
|
674
796
|
}
|
|
675
|
-
return resetItems.concat(shownData);
|
|
676
797
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
message = this.props.notFoundMessage;
|
|
691
|
-
}
|
|
692
|
-
return /*#__PURE__*/React.createElement(SelectPopup, {
|
|
693
|
-
data: _shownData,
|
|
694
|
-
message: message,
|
|
695
|
-
toolbar: showPopup && this.getToolbar(),
|
|
696
|
-
loading: this.props.loading,
|
|
697
|
-
activeIndex: this.state.selectedIndex,
|
|
698
|
-
hidden: !showPopup,
|
|
699
|
-
ref: this.popupRef,
|
|
700
|
-
maxHeight: this.props.maxHeight,
|
|
701
|
-
minWidth: this.props.minWidth,
|
|
702
|
-
directions: this.props.directions,
|
|
703
|
-
className: this.props.popupClassName,
|
|
704
|
-
style: this.props.popupStyle,
|
|
705
|
-
top: this.props.top,
|
|
706
|
-
left: this.props.left,
|
|
707
|
-
filter: this.isInputMode() ? false : this.props.filter // disable popup filter in INPUT mode
|
|
708
|
-
,
|
|
709
|
-
multiple: this.props.multiple,
|
|
710
|
-
filterValue: this.state.filterValue,
|
|
711
|
-
anchorElement: anchorElement,
|
|
712
|
-
onCloseAttempt: this._onCloseAttempt,
|
|
713
|
-
onSelect: this._listSelectHandler,
|
|
714
|
-
onSelectAll: this._listSelectAllHandler,
|
|
715
|
-
onFilter: this._filterChangeHandler,
|
|
716
|
-
onClear: this.clearFilter,
|
|
717
|
-
onLoadMore: this.props.onLoadMore,
|
|
718
|
-
isInputMode: this.isInputMode(),
|
|
719
|
-
selected: this.state.selected,
|
|
720
|
-
tags: this.props.tags,
|
|
721
|
-
compact: this.props.compact,
|
|
722
|
-
renderOptimization: this.props.renderOptimization,
|
|
723
|
-
ringPopupTarget: this.props.ringPopupTarget,
|
|
724
|
-
disableMoveOverflow: this.props.disableMoveOverflow,
|
|
725
|
-
disableScrollToActive: this.props.disableScrollToActive,
|
|
726
|
-
dir: this.props.dir,
|
|
727
|
-
onEmptyPopupEnter: this.onEmptyPopupEnter,
|
|
728
|
-
listId: this.listId
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
_showPopup() {
|
|
732
|
-
if (!this.node) {
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
const shownData = this.getListItems(this.filterValue());
|
|
736
|
-
this.setState({
|
|
737
|
-
showPopup: !!shownData.length || !this.props.allowAny,
|
|
738
|
-
shownData
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
_hidePopup(tryFocusAnchor) {
|
|
742
|
-
if (this.node && this.state.showPopup) {
|
|
743
|
-
this.setState(prevState => ({
|
|
744
|
-
showPopup: false,
|
|
745
|
-
filterValue: this.props.allowAny ? prevState.filterValue : ''
|
|
746
|
-
}));
|
|
747
|
-
if (tryFocusAnchor) {
|
|
748
|
-
const focusableSelectExists = this.node && this.node.querySelector('[data-test~=ring-select__focus]');
|
|
749
|
-
const restoreFocusNode = this.props.targetElement || focusableSelectExists;
|
|
750
|
-
if (restoreFocusNode) {
|
|
751
|
-
restoreFocusNode.focus();
|
|
752
|
-
}
|
|
798
|
+
}, {
|
|
799
|
+
key: "getToolbar",
|
|
800
|
+
value: function getToolbar() {
|
|
801
|
+
var _this$props2 = this.props,
|
|
802
|
+
hint = _this$props2.hint,
|
|
803
|
+
renderBottomToolbar = _this$props2.renderBottomToolbar;
|
|
804
|
+
var _ref3 = this.state.addButton || {},
|
|
805
|
+
prefix = _ref3.prefix,
|
|
806
|
+
label = _ref3.label,
|
|
807
|
+
delayed = _ref3.delayed;
|
|
808
|
+
var isToolbarHasElements = this.state.addButton || hint || renderBottomToolbar;
|
|
809
|
+
if (!isToolbarHasElements) {
|
|
810
|
+
return null;
|
|
753
811
|
}
|
|
812
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
813
|
+
className: classNames(_defineProperty({}, modules_9d0de074.toolbar, Boolean(this.state.addButton || renderBottomToolbar))),
|
|
814
|
+
"data-test": "ring-select-toolbar"
|
|
815
|
+
}, renderBottomToolbar && renderBottomToolbar(), this.state.addButton && /*#__PURE__*/React.createElement(Button, {
|
|
816
|
+
text: true,
|
|
817
|
+
delayed: delayed,
|
|
818
|
+
className: classNames(modules_9d0de074.button, modules_9d0de074.buttonSpaced),
|
|
819
|
+
onClick: this.addHandler,
|
|
820
|
+
"data-test": "ring-select-toolbar-button"
|
|
821
|
+
}, prefix ? "".concat(prefix, " ").concat(label) : label), hint && /*#__PURE__*/React.createElement(List.ListHint, {
|
|
822
|
+
label: hint,
|
|
823
|
+
"data-test": "ring-select-toolbar-hint"
|
|
824
|
+
}));
|
|
754
825
|
}
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
} = this.props;
|
|
761
|
-
const {
|
|
762
|
-
prefix,
|
|
763
|
-
label,
|
|
764
|
-
delayed
|
|
765
|
-
} = this.state.addButton || {};
|
|
766
|
-
const isToolbarHasElements = this.state.addButton || hint || renderBottomToolbar;
|
|
767
|
-
if (!isToolbarHasElements) {
|
|
768
|
-
return null;
|
|
826
|
+
}, {
|
|
827
|
+
key: "getTopbar",
|
|
828
|
+
value: function getTopbar() {
|
|
829
|
+
var _this$props$renderTop, _this$props3;
|
|
830
|
+
return (_this$props$renderTop = (_this$props3 = this.props).renderTopToolbar) === null || _this$props$renderTop === void 0 ? void 0 : _this$props$renderTop.call(_this$props3);
|
|
769
831
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
"data-test": "ring-select-toolbar"
|
|
775
|
-
}, renderBottomToolbar && renderBottomToolbar(), this.state.addButton && /*#__PURE__*/React.createElement(Button, {
|
|
776
|
-
text: true,
|
|
777
|
-
delayed: delayed,
|
|
778
|
-
className: classNames(modules_9d0de074.button, modules_9d0de074.buttonSpaced),
|
|
779
|
-
onClick: this.addHandler,
|
|
780
|
-
"data-test": "ring-select-toolbar-button"
|
|
781
|
-
}, prefix ? `${prefix} ${label}` : label), hint && /*#__PURE__*/React.createElement(List.ListHint, {
|
|
782
|
-
label: hint,
|
|
783
|
-
"data-test": "ring-select-toolbar-hint"
|
|
784
|
-
}));
|
|
785
|
-
}
|
|
786
|
-
getFilterFn() {
|
|
787
|
-
return getFilterFn(this.props.filter);
|
|
788
|
-
}
|
|
789
|
-
getListItems(rawFilterString, data) {
|
|
790
|
-
const {
|
|
791
|
-
filteredData,
|
|
792
|
-
addButton
|
|
793
|
-
} = getListItems(this.props, this.state, rawFilterString, data);
|
|
794
|
-
this.setState({
|
|
795
|
-
addButton
|
|
796
|
-
});
|
|
797
|
-
return filteredData;
|
|
798
|
-
}
|
|
799
|
-
filterValue(setValue) {
|
|
800
|
-
if (typeof setValue === 'string' || typeof setValue === 'number') {
|
|
801
|
-
this.setState({
|
|
802
|
-
filterValue: setValue
|
|
803
|
-
});
|
|
804
|
-
return undefined;
|
|
805
|
-
} else {
|
|
806
|
-
return this.state.filterValue;
|
|
832
|
+
}, {
|
|
833
|
+
key: "getFilterFn",
|
|
834
|
+
value: function getFilterFn() {
|
|
835
|
+
return _getFilterFn(this.props.filter);
|
|
807
836
|
}
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
837
|
+
}, {
|
|
838
|
+
key: "getListItems",
|
|
839
|
+
value: function getListItems(rawFilterString, data) {
|
|
840
|
+
var _getListItems2 = _getListItems(this.props, this.state, rawFilterString, data),
|
|
841
|
+
filteredData = _getListItems2.filteredData,
|
|
842
|
+
addButton = _getListItems2.addButton;
|
|
814
843
|
this.setState({
|
|
815
|
-
|
|
844
|
+
addButton: addButton
|
|
816
845
|
});
|
|
846
|
+
return filteredData;
|
|
817
847
|
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return (_this$props$label2 = this.props.label) !== null && _this$props$label2 !== void 0 ? _this$props$label2 : 'Select an option';
|
|
848
|
+
}, {
|
|
849
|
+
key: "filterValue",
|
|
850
|
+
value: function filterValue(setValue) {
|
|
851
|
+
if (typeof setValue === 'string' || typeof setValue === 'number') {
|
|
852
|
+
this.setState({
|
|
853
|
+
filterValue: setValue
|
|
854
|
+
});
|
|
855
|
+
return undefined;
|
|
856
|
+
} else {
|
|
857
|
+
return this.state.filterValue;
|
|
858
|
+
}
|
|
830
859
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
860
|
+
}, {
|
|
861
|
+
key: "isInputMode",
|
|
862
|
+
value: function isInputMode() {
|
|
863
|
+
return _isInputMode(this.props.type);
|
|
864
|
+
}
|
|
865
|
+
}, {
|
|
866
|
+
key: "_rebuildMultipleMap",
|
|
867
|
+
value: function _rebuildMultipleMap(selected) {
|
|
868
|
+
if (Array.isArray(selected)) {
|
|
869
|
+
this.setState({
|
|
870
|
+
multipleMap: buildMultipleMap(selected)
|
|
871
|
+
});
|
|
838
872
|
}
|
|
839
|
-
return labels.filter(Boolean).join(', ');
|
|
840
|
-
} else {
|
|
841
|
-
return this.state.selected != null ? getItemLabel(this.state.selected) : null;
|
|
842
873
|
}
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
selected
|
|
847
|
-
} = this.state;
|
|
848
|
-
const {
|
|
849
|
-
disabled,
|
|
850
|
-
clear,
|
|
851
|
-
hideArrow
|
|
852
|
-
} = this.props;
|
|
853
|
-
const icons = [];
|
|
854
|
-
const height = this.props.height || this.context;
|
|
855
|
-
if (!Array.isArray(selected) && selected?.icon) {
|
|
856
|
-
icons.push( /*#__PURE__*/React.createElement("button", {
|
|
857
|
-
title: "Toggle options popup",
|
|
858
|
-
type: "button",
|
|
859
|
-
className: modules_9d0de074.selectedIcon,
|
|
860
|
-
key: "selected",
|
|
861
|
-
disabled: this.props.disabled,
|
|
862
|
-
onClick: this._clickHandler,
|
|
863
|
-
style: {
|
|
864
|
-
backgroundImage: `url(${selected.icon})`
|
|
865
|
-
}
|
|
866
|
-
}));
|
|
874
|
+
}, {
|
|
875
|
+
key: "_selectionIsEmpty",
|
|
876
|
+
value: function _selectionIsEmpty() {
|
|
877
|
+
return Array.isArray(this.state.selected) && !this.state.selected.length || !this.state.selected;
|
|
867
878
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
key: "close",
|
|
874
|
-
disabled: this.props.disabled,
|
|
875
|
-
onClick: this.clear,
|
|
876
|
-
height: height,
|
|
877
|
-
icon: closeIcon
|
|
878
|
-
}));
|
|
879
|
+
}, {
|
|
880
|
+
key: "_getLabel",
|
|
881
|
+
value: function _getLabel() {
|
|
882
|
+
var _ref4, _this$props$label;
|
|
883
|
+
return (_ref4 = (_this$props$label = this.props.label) !== null && _this$props$label !== void 0 ? _this$props$label : this.props.selectedLabel) !== null && _ref4 !== void 0 ? _ref4 : 'Select an option';
|
|
879
884
|
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
height: height,
|
|
889
|
-
onClick: this._clickHandler
|
|
890
|
-
}));
|
|
885
|
+
}, {
|
|
886
|
+
key: "_getPlaceholder",
|
|
887
|
+
value: function _getPlaceholder() {
|
|
888
|
+
if (this._selectionIsEmpty()) {
|
|
889
|
+
var _this$props$label2;
|
|
890
|
+
return (_this$props$label2 = this.props.label) !== null && _this$props$label2 !== void 0 ? _this$props$label2 : 'Select an option';
|
|
891
|
+
}
|
|
892
|
+
return this._getSelectedString();
|
|
891
893
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
const {
|
|
922
|
-
shortcutsEnabled
|
|
923
|
-
} = this.state;
|
|
924
|
-
const classes = classNames(modules_9d0de074.select, 'ring-js-shortcuts', this.props.className, modules_9d0de074[`height${this.props.height || this.context}`], {
|
|
925
|
-
[modules_9d0de074[`size${this.props.size}`]]: this.props.type !== Type.INLINE,
|
|
926
|
-
[modules_9d0de074.disabled]: this.props.disabled
|
|
927
|
-
});
|
|
928
|
-
const icons = this._getIcons();
|
|
929
|
-
const style = getStyle(icons.length);
|
|
930
|
-
const iconsNode = /*#__PURE__*/React.createElement("div", {
|
|
931
|
-
className: modules_9d0de074.icons
|
|
932
|
-
}, icons);
|
|
933
|
-
const ariaProps = this.state.showPopup ? {
|
|
934
|
-
'aria-owns': this.listId,
|
|
935
|
-
'aria-activedescendant': activeItemId,
|
|
936
|
-
'aria-label': (_this$props$label3 = this.props.label) !== null && _this$props$label3 !== void 0 ? _this$props$label3 : undefined
|
|
937
|
-
} : {
|
|
938
|
-
'aria-label': (_this$props$label4 = this.props.label) !== null && _this$props$label4 !== void 0 ? _this$props$label4 : undefined
|
|
939
|
-
};
|
|
940
|
-
switch (this.props.type) {
|
|
941
|
-
case Type.INPUT_WITHOUT_CONTROLS:
|
|
942
|
-
case Type.INPUT:
|
|
943
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
944
|
-
ref: this.nodeRef,
|
|
945
|
-
className: classNames(classes, modules_9d0de074.inputMode),
|
|
946
|
-
"data-test": joinDataTestAttributes('ring-select', dataTest)
|
|
947
|
-
}, shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
948
|
-
map: this.getShortcutsMap(),
|
|
949
|
-
scope: this.shortcutsScope
|
|
950
|
-
}), /*#__PURE__*/React.createElement(Input, _extends({}, ariaProps, {
|
|
951
|
-
height: this.props.height,
|
|
952
|
-
autoComplete: "off",
|
|
953
|
-
id: this.props.id,
|
|
954
|
-
onClick: this._clickHandler,
|
|
955
|
-
inputRef: this.filterRef,
|
|
956
|
-
disabled: this.props.disabled,
|
|
957
|
-
value: this.state.filterValue,
|
|
958
|
-
borderless: this.props.type === Type.INPUT_WITHOUT_CONTROLS,
|
|
959
|
-
style: style,
|
|
960
|
-
size: Size.FULL,
|
|
961
|
-
onChange: this._filterChangeHandler,
|
|
962
|
-
onFocus: this._focusHandler,
|
|
963
|
-
onBlur: this._blurHandler
|
|
964
|
-
// Input with error style without description
|
|
965
|
-
,
|
|
966
|
-
error: this.props.error != null ? '' : null,
|
|
967
|
-
label: this.props.type === Type.INPUT ? this._getLabel() : null,
|
|
968
|
-
placeholder: this.props.inputPlaceholder,
|
|
969
|
-
onKeyDown: this.props.onKeyDown,
|
|
970
|
-
"data-test": "ring-select__focus",
|
|
971
|
-
enableShortcuts: shortcutsEnabled ? Object.keys({
|
|
972
|
-
...this.getShortcutsMap(),
|
|
973
|
-
...this._popup?.list?.shortcutsMap
|
|
974
|
-
}) : undefined,
|
|
975
|
-
afterInput: this.props.type === Type.INPUT && iconsNode
|
|
976
|
-
})), this._renderPopup()), this.props.error && /*#__PURE__*/React.createElement("div", {
|
|
977
|
-
className: classNames(modules_88cfaf40.errorText, modules_88cfaf40[`size${this.props.size}`])
|
|
978
|
-
}, this.props.error));
|
|
979
|
-
case Type.BUTTON:
|
|
980
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
981
|
-
ref: this.nodeRef,
|
|
982
|
-
className: classNames(classes, modules_9d0de074.buttonMode),
|
|
983
|
-
"data-test": joinDataTestAttributes('ring-select', dataTest)
|
|
984
|
-
}, selectedLabel && /*#__PURE__*/React.createElement(InputLabel, {
|
|
985
|
-
label: selectedLabel,
|
|
894
|
+
}, {
|
|
895
|
+
key: "_getSelectedString",
|
|
896
|
+
value: function _getSelectedString() {
|
|
897
|
+
if (Array.isArray(this.state.selected)) {
|
|
898
|
+
var labels = [];
|
|
899
|
+
for (var i = 0; i < this.state.selected.length; i++) {
|
|
900
|
+
labels.push(getItemLabel(this.state.selected[i]));
|
|
901
|
+
}
|
|
902
|
+
return labels.filter(Boolean).join(', ');
|
|
903
|
+
} else {
|
|
904
|
+
return this.state.selected != null ? getItemLabel(this.state.selected) : null;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}, {
|
|
908
|
+
key: "_getIcons",
|
|
909
|
+
value: function _getIcons() {
|
|
910
|
+
var selected = this.state.selected;
|
|
911
|
+
var _this$props4 = this.props,
|
|
912
|
+
disabled = _this$props4.disabled,
|
|
913
|
+
clear = _this$props4.clear,
|
|
914
|
+
hideArrow = _this$props4.hideArrow;
|
|
915
|
+
var icons = [];
|
|
916
|
+
var height = this.props.height || this.context;
|
|
917
|
+
if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {
|
|
918
|
+
icons.push( /*#__PURE__*/React.createElement("button", {
|
|
919
|
+
title: "Toggle options popup",
|
|
920
|
+
type: "button",
|
|
921
|
+
className: modules_9d0de074.selectedIcon,
|
|
922
|
+
key: "selected",
|
|
986
923
|
disabled: this.props.disabled,
|
|
987
|
-
htmlFor: this.props.id
|
|
988
|
-
}), shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
989
|
-
map: this.getShortcutsMap(),
|
|
990
|
-
scope: this.shortcutsScope
|
|
991
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
992
|
-
className: modules_9d0de074.buttonContainer
|
|
993
|
-
}, /*#__PURE__*/React.createElement(Button, _extends({}, ariaProps, {
|
|
994
|
-
height: this.props.height,
|
|
995
|
-
id: this.props.id,
|
|
996
924
|
onClick: this._clickHandler,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}
|
|
925
|
+
style: {
|
|
926
|
+
backgroundImage: "url(".concat(selected.icon, ")")
|
|
927
|
+
}
|
|
928
|
+
}));
|
|
929
|
+
}
|
|
930
|
+
if (clear && !disabled && !this._selectionIsEmpty()) {
|
|
931
|
+
icons.push( /*#__PURE__*/React.createElement(Button, {
|
|
932
|
+
title: "Clear selection",
|
|
933
|
+
"data-test": "ring-clear-select",
|
|
934
|
+
className: modules_9d0de074.clearIcon,
|
|
935
|
+
key: "close",
|
|
1000
936
|
disabled: this.props.disabled,
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
"
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
className: (_this$props$buttonCla = this.props.buttonClassName) !== null && _this$props$buttonCla !== void 0 ? _this$props$buttonCla : undefined,
|
|
1014
|
-
id: this.props.id,
|
|
1015
|
-
onClick: this._clickHandler,
|
|
1016
|
-
"data-test": "ring-select__focus",
|
|
937
|
+
onClick: this.clear,
|
|
938
|
+
height: height,
|
|
939
|
+
icon: closeIcon
|
|
940
|
+
}));
|
|
941
|
+
}
|
|
942
|
+
if (!hideArrow) {
|
|
943
|
+
icons.push( /*#__PURE__*/React.createElement(Button, {
|
|
944
|
+
title: "Toggle options popup",
|
|
945
|
+
className: modules_9d0de074.chevron,
|
|
946
|
+
iconClassName: modules_9d0de074.chevronIcon,
|
|
947
|
+
icon: chevronDownIcon,
|
|
948
|
+
key: "hide",
|
|
1017
949
|
disabled: this.props.disabled,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
950
|
+
height: height,
|
|
951
|
+
onClick: this._clickHandler
|
|
952
|
+
}));
|
|
953
|
+
}
|
|
954
|
+
return icons;
|
|
955
|
+
}
|
|
956
|
+
}, {
|
|
957
|
+
key: "_getAvatar",
|
|
958
|
+
value: function _getAvatar() {
|
|
959
|
+
var _this$state$selected, _this$state$selected2;
|
|
960
|
+
return !Array.isArray(this.state.selected) && (((_this$state$selected = this.state.selected) === null || _this$state$selected === void 0 ? void 0 : _this$state$selected.avatar) || ((_this$state$selected2 = this.state.selected) === null || _this$state$selected2 === void 0 ? void 0 : _this$state$selected2.showGeneratedAvatar)) && /*#__PURE__*/React.createElement(Avatar, {
|
|
961
|
+
className: modules_9d0de074.avatar,
|
|
962
|
+
url: this.state.selected.avatar,
|
|
963
|
+
username: this.state.selected.username,
|
|
964
|
+
size: Size$1.Size20
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}, {
|
|
968
|
+
key: "getShortcutsMap",
|
|
969
|
+
value: function getShortcutsMap() {
|
|
970
|
+
return {
|
|
971
|
+
enter: this._onEnter,
|
|
972
|
+
esc: this._onEsc,
|
|
973
|
+
up: this._inputShortcutHandler,
|
|
974
|
+
down: this._inputShortcutHandler,
|
|
975
|
+
right: noop,
|
|
976
|
+
left: noop,
|
|
977
|
+
'shift+up': noop,
|
|
978
|
+
'shift+down': noop,
|
|
979
|
+
space: noop
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
}, {
|
|
983
|
+
key: "renderSelect",
|
|
984
|
+
value: function renderSelect(activeItemId) {
|
|
985
|
+
var _classNames2, _this$props$label3, _this$props$label4, _this$_popup5, _classNames3, _this$props$buttonCla;
|
|
986
|
+
var dataTest = this.props['data-test'];
|
|
987
|
+
var selectedLabel = this.props.selectedLabel;
|
|
988
|
+
var shortcutsEnabled = this.state.shortcutsEnabled;
|
|
989
|
+
var classes = classNames(modules_9d0de074.select, 'ring-js-shortcuts', this.props.className, modules_9d0de074["height".concat(this.props.height || this.context)], (_classNames2 = {}, _defineProperty(_classNames2, modules_9d0de074["size".concat(this.props.size)], this.props.type !== Type.INLINE), _defineProperty(_classNames2, modules_9d0de074.disabled, this.props.disabled), _classNames2));
|
|
990
|
+
var icons = this._getIcons();
|
|
991
|
+
var style = getStyle(icons.length);
|
|
992
|
+
var iconsNode = /*#__PURE__*/React.createElement("div", {
|
|
993
|
+
className: modules_9d0de074.icons
|
|
994
|
+
}, icons);
|
|
995
|
+
var ariaProps = this.state.showPopup ? {
|
|
996
|
+
'aria-owns': this.listId,
|
|
997
|
+
'aria-activedescendant': activeItemId,
|
|
998
|
+
'aria-label': (_this$props$label3 = this.props.label) !== null && _this$props$label3 !== void 0 ? _this$props$label3 : undefined
|
|
999
|
+
} : {
|
|
1000
|
+
'aria-label': (_this$props$label4 = this.props.label) !== null && _this$props$label4 !== void 0 ? _this$props$label4 : undefined
|
|
1001
|
+
};
|
|
1002
|
+
switch (this.props.type) {
|
|
1003
|
+
case Type.INPUT_WITHOUT_CONTROLS:
|
|
1004
|
+
case Type.INPUT:
|
|
1005
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1006
|
+
ref: this.nodeRef,
|
|
1007
|
+
className: classNames(classes, modules_9d0de074.inputMode),
|
|
1008
|
+
"data-test": joinDataTestAttributes('ring-select', dataTest)
|
|
1009
|
+
}, shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
1010
|
+
map: this.getShortcutsMap(),
|
|
1011
|
+
scope: this.shortcutsScope
|
|
1012
|
+
}), /*#__PURE__*/React.createElement(Input, _extends({}, ariaProps, {
|
|
1013
|
+
height: this.props.height,
|
|
1014
|
+
autoComplete: "off",
|
|
1015
|
+
id: this.props.id,
|
|
1016
|
+
onClick: this._clickHandler,
|
|
1017
|
+
inputRef: composeRefs(this.filterRef, this.props.filterRef),
|
|
1018
|
+
disabled: this.props.disabled,
|
|
1019
|
+
value: this.state.filterValue,
|
|
1020
|
+
borderless: this.props.type === Type.INPUT_WITHOUT_CONTROLS,
|
|
1021
|
+
style: style,
|
|
1022
|
+
size: Size.FULL,
|
|
1023
|
+
onChange: this._filterChangeHandler,
|
|
1024
|
+
onFocus: this._focusHandler,
|
|
1025
|
+
onBlur: this._blurHandler
|
|
1026
|
+
// Input with error style without description
|
|
1027
|
+
,
|
|
1028
|
+
error: this.props.error != null ? '' : null,
|
|
1029
|
+
label: this.props.type === Type.INPUT ? this._getLabel() : null,
|
|
1030
|
+
placeholder: this.props.inputPlaceholder,
|
|
1031
|
+
onKeyDown: this.props.onKeyDown,
|
|
1032
|
+
"data-test": "ring-select__focus",
|
|
1033
|
+
enableShortcuts: shortcutsEnabled ? Object.keys(_objectSpread2(_objectSpread2({}, this.getShortcutsMap()), (_this$_popup5 = this._popup) === null || _this$_popup5 === void 0 || (_this$_popup5 = _this$_popup5.list) === null || _this$_popup5 === void 0 ? void 0 : _this$_popup5.shortcutsMap)) : undefined,
|
|
1034
|
+
icon: this.props.filterIcon,
|
|
1035
|
+
afterInput: this.props.type === Type.INPUT && iconsNode
|
|
1036
|
+
})), this._renderPopup()), this.props.error && /*#__PURE__*/React.createElement("div", {
|
|
1037
|
+
className: classNames(modules_88cfaf40.errorText, modules_88cfaf40["size".concat(this.props.size)])
|
|
1038
|
+
}, this.props.error));
|
|
1039
|
+
case Type.BUTTON:
|
|
1040
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1041
|
+
ref: this.nodeRef,
|
|
1042
|
+
className: classNames(classes, modules_9d0de074.buttonMode),
|
|
1043
|
+
"data-test": joinDataTestAttributes('ring-select', dataTest)
|
|
1044
|
+
}, selectedLabel && /*#__PURE__*/React.createElement(ControlLabel, {
|
|
1045
|
+
type: this.props.labelType,
|
|
1046
|
+
disabled: this.props.disabled,
|
|
1047
|
+
htmlFor: this.props.id
|
|
1048
|
+
}, selectedLabel), shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
1049
|
+
map: this.getShortcutsMap(),
|
|
1050
|
+
scope: this.shortcutsScope
|
|
1051
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1052
|
+
className: modules_9d0de074.buttonContainer
|
|
1053
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({}, ariaProps, {
|
|
1054
|
+
height: this.props.height,
|
|
1055
|
+
id: this.props.id,
|
|
1056
|
+
onClick: this._clickHandler,
|
|
1057
|
+
className: classNames(this.props.buttonClassName, modules_9d0de074.buttonValue, (_classNames3 = {}, _defineProperty(_classNames3, modules_9d0de074.buttonValueOpen, this.state.showPopup), _defineProperty(_classNames3, modules_9d0de074.buttonValueEmpty, this._selectionIsEmpty()), _classNames3)),
|
|
1058
|
+
disabled: this.props.disabled,
|
|
1059
|
+
style: style,
|
|
1060
|
+
"data-test": "ring-select__button ring-select__focus"
|
|
1061
|
+
}), this._getAvatar(), this._getPlaceholder()), iconsNode), this._renderPopup());
|
|
1062
|
+
case Type.INLINE:
|
|
1063
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1064
|
+
className: classes,
|
|
1065
|
+
ref: this.nodeRef,
|
|
1066
|
+
"data-test": joinDataTestAttributes('ring-select', dataTest)
|
|
1067
|
+
}, shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
1023
1068
|
map: this.getShortcutsMap(),
|
|
1024
1069
|
scope: this.shortcutsScope
|
|
1025
|
-
}),
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1070
|
+
}), /*#__PURE__*/React.createElement(Anchor, _extends({}, ariaProps, {
|
|
1071
|
+
className: (_this$props$buttonCla = this.props.buttonClassName) !== null && _this$props$buttonCla !== void 0 ? _this$props$buttonCla : undefined,
|
|
1072
|
+
id: this.props.id,
|
|
1073
|
+
onClick: this._clickHandler,
|
|
1074
|
+
"data-test": "ring-select__focus",
|
|
1075
|
+
disabled: this.props.disabled,
|
|
1076
|
+
active: this.state.showPopup
|
|
1077
|
+
}), this._getPlaceholder()), this._renderPopup());
|
|
1078
|
+
default:
|
|
1079
|
+
if (this.props.customAnchor) {
|
|
1080
|
+
return /*#__PURE__*/React.createElement(Fragment, null, shortcutsEnabled && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
1081
|
+
map: this.getShortcutsMap(),
|
|
1082
|
+
scope: this.shortcutsScope
|
|
1083
|
+
}), this.props.customAnchor({
|
|
1084
|
+
wrapperProps: {
|
|
1085
|
+
ref: this.nodeRef,
|
|
1086
|
+
'data-test': joinDataTestAttributes('ring-select', dataTest)
|
|
1087
|
+
},
|
|
1088
|
+
buttonProps: _objectSpread2(_objectSpread2({}, ariaProps), {}, {
|
|
1089
|
+
id: this.props.id,
|
|
1090
|
+
onClick: this._clickHandler,
|
|
1091
|
+
disabled: this.props.disabled,
|
|
1092
|
+
children: this._getPlaceholder(),
|
|
1093
|
+
'data-test': 'ring-select_focus'
|
|
1094
|
+
}),
|
|
1095
|
+
popup: this._renderPopup()
|
|
1096
|
+
}));
|
|
1097
|
+
}
|
|
1098
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
1099
|
+
id: this.props.id,
|
|
1100
|
+
ref: this.nodeRef,
|
|
1101
|
+
"data-test": "ring-select"
|
|
1102
|
+
}, this._renderPopup());
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}, {
|
|
1106
|
+
key: "render",
|
|
1107
|
+
value: function render() {
|
|
1108
|
+
var _this5 = this;
|
|
1109
|
+
return /*#__PURE__*/React.createElement(ActiveItemContext.Provider, null, /*#__PURE__*/React.createElement(ActiveItemContext.ValueContext.Consumer, null, function (activeItemId) {
|
|
1110
|
+
return _this5.renderSelect(activeItemId);
|
|
1111
|
+
}));
|
|
1112
|
+
}
|
|
1113
|
+
}], [{
|
|
1114
|
+
key: "getDerivedStateFromProps",
|
|
1115
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
1116
|
+
var multiple = nextProps.multiple,
|
|
1117
|
+
data = nextProps.data,
|
|
1118
|
+
type = nextProps.type;
|
|
1119
|
+
var prevSelected = prevState.prevSelected,
|
|
1120
|
+
prevData = prevState.prevData,
|
|
1121
|
+
prevMultiple = prevState.prevMultiple,
|
|
1122
|
+
filterValue = prevState.filterValue;
|
|
1123
|
+
var nextState = {
|
|
1124
|
+
prevData: data,
|
|
1125
|
+
prevSelected: nextProps.selected,
|
|
1126
|
+
prevMultiple: multiple
|
|
1127
|
+
};
|
|
1128
|
+
if ('data' in nextProps && data !== prevData) {
|
|
1129
|
+
var _getListItems3 = _getListItems(nextProps, prevState, filterValue, data),
|
|
1130
|
+
filteredData = _getListItems3.filteredData,
|
|
1131
|
+
addButton = _getListItems3.addButton;
|
|
1132
|
+
Object.assign(nextState, {
|
|
1133
|
+
shownData: filteredData,
|
|
1134
|
+
addButton: addButton
|
|
1135
|
+
});
|
|
1136
|
+
if (prevState.selected) {
|
|
1137
|
+
Object.assign(nextState, {
|
|
1138
|
+
selectedIndex: getSelectedIndex(prevState.selected, data),
|
|
1139
|
+
filterValue: _getValueForFilter(prevState.selected, type, filterValue)
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
if ('selected' in nextProps && nextProps.selected !== prevSelected) {
|
|
1144
|
+
var _selected = nextProps.selected || (multiple ? [] : null);
|
|
1145
|
+
var selectedIndex = getSelectedIndex(_selected, data || prevData);
|
|
1146
|
+
Object.assign(nextState, {
|
|
1147
|
+
selected: _selected,
|
|
1148
|
+
filterValue: _getValueForFilter(_selected, type, filterValue)
|
|
1149
|
+
});
|
|
1150
|
+
if (!Array.isArray(prevSelected) || !Array.isArray(_selected) || !isSameSelected(prevSelected, _selected)) {
|
|
1151
|
+
Object.assign(nextState, {
|
|
1152
|
+
selectedIndex: selectedIndex
|
|
1153
|
+
});
|
|
1040
1154
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1155
|
+
}
|
|
1156
|
+
if (prevMultiple !== multiple && !deepEqual(prevMultiple, multiple)) {
|
|
1157
|
+
nextState.selected = multiple ? [] : null;
|
|
1158
|
+
}
|
|
1159
|
+
if (multiple && !nextState.selected) {
|
|
1160
|
+
nextState.selected = prevState.selected;
|
|
1161
|
+
}
|
|
1162
|
+
var _prevState$nextState = _objectSpread2(_objectSpread2({}, prevState), nextState),
|
|
1163
|
+
selected = _prevState$nextState.selected;
|
|
1164
|
+
if (selected && Array.isArray(selected)) {
|
|
1165
|
+
nextState.multipleMap = buildMultipleMap(selected);
|
|
1166
|
+
var _getListItems4 = _getListItems(nextProps, nextState, filterValue, data),
|
|
1167
|
+
_filteredData = _getListItems4.filteredData,
|
|
1168
|
+
_addButton = _getListItems4.addButton;
|
|
1169
|
+
Object.assign(nextState, {
|
|
1170
|
+
shownData: _filteredData,
|
|
1171
|
+
addButton: _addButton
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
return nextState;
|
|
1046
1175
|
}
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1176
|
+
}]);
|
|
1177
|
+
return Select;
|
|
1178
|
+
}(Component);
|
|
1052
1179
|
_defineProperty(Select, "defaultProps", {
|
|
1053
1180
|
data: [],
|
|
1054
1181
|
filter: false,
|
|
1182
|
+
filterIcon: null,
|
|
1183
|
+
filterRef: noop,
|
|
1055
1184
|
multiple: false,
|
|
1056
1185
|
clear: false,
|
|
1057
1186
|
loading: false,
|
|
1058
1187
|
disabled: false,
|
|
1059
|
-
loadingMessage: 'Loading...',
|
|
1060
|
-
notFoundMessage: 'No options found',
|
|
1061
1188
|
type: Type.BUTTON,
|
|
1062
1189
|
size: Size.M,
|
|
1063
1190
|
targetElement: null,
|
|
1064
1191
|
hideSelected: false,
|
|
1065
1192
|
allowAny: false,
|
|
1066
1193
|
hideArrow: false,
|
|
1194
|
+
showPopup: false,
|
|
1067
1195
|
maxHeight: 600,
|
|
1068
1196
|
directions: [Popup.PopupProps.Directions.BOTTOM_RIGHT, Popup.PopupProps.Directions.BOTTOM_LEFT, Popup.PopupProps.Directions.TOP_LEFT, Popup.PopupProps.Directions.TOP_RIGHT],
|
|
1069
1197
|
selected: null,
|
|
@@ -1082,6 +1210,7 @@ _defineProperty(Select, "defaultProps", {
|
|
|
1082
1210
|
onKeyDown: noop,
|
|
1083
1211
|
onSelect: noop,
|
|
1084
1212
|
onDeselect: noop,
|
|
1213
|
+
onOutsideClick: noop,
|
|
1085
1214
|
onChange: noop,
|
|
1086
1215
|
onAdd: noop,
|
|
1087
1216
|
onDone: noop,
|
|
@@ -1100,6 +1229,8 @@ Select.propTypes = {
|
|
|
1100
1229
|
multiple: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
1101
1230
|
allowAny: PropTypes.bool,
|
|
1102
1231
|
filter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
1232
|
+
filterIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
1233
|
+
filterRef: PropTypes.oneOfType([PropTypes.func, refObject(PropTypes.instanceOf(HTMLInputElement))]),
|
|
1103
1234
|
getInitial: PropTypes.func,
|
|
1104
1235
|
onClose: PropTypes.func,
|
|
1105
1236
|
onOpen: PropTypes.func,
|
|
@@ -1112,6 +1243,7 @@ Select.propTypes = {
|
|
|
1112
1243
|
onBeforeOpen: PropTypes.func,
|
|
1113
1244
|
onSelect: PropTypes.func,
|
|
1114
1245
|
onDeselect: PropTypes.func,
|
|
1246
|
+
onOutsideClick: PropTypes.func,
|
|
1115
1247
|
onFocus: PropTypes.func,
|
|
1116
1248
|
onBlur: PropTypes.func,
|
|
1117
1249
|
onKeyDown: PropTypes.func,
|
|
@@ -1142,6 +1274,8 @@ Select.propTypes = {
|
|
|
1142
1274
|
inputPlaceholder: PropTypes.string,
|
|
1143
1275
|
clear: PropTypes.bool,
|
|
1144
1276
|
hideArrow: PropTypes.bool,
|
|
1277
|
+
showPopup: PropTypes.bool,
|
|
1278
|
+
tryKeepOpen: PropTypes.bool,
|
|
1145
1279
|
compact: PropTypes.bool,
|
|
1146
1280
|
size: PropTypes.oneOf(Object.values(Size)),
|
|
1147
1281
|
customAnchor: PropTypes.func,
|
|
@@ -1150,6 +1284,6 @@ Select.propTypes = {
|
|
|
1150
1284
|
dir: PropTypes.oneOf(['ltr', 'rtl']),
|
|
1151
1285
|
'data-test': PropTypes.string
|
|
1152
1286
|
};
|
|
1153
|
-
|
|
1287
|
+
var RerenderableSelect = rerenderHOC(Select);
|
|
1154
1288
|
|
|
1155
|
-
export { RerenderableSelect, Select as default };
|
|
1289
|
+
export { RerenderableSelect, Type, Select as default };
|