@jetbrains/ring-ui 5.0.0-beta.2 → 5.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/babel.config.js +1 -12
- package/components/alert/alert.css +5 -15
- package/components/alert/alert.d.ts +3 -0
- package/components/alert/{alert.jsx → alert.js} +8 -7
- package/components/alert/container.css +0 -2
- package/components/alert/{container.jsx → container.js} +0 -0
- package/components/alert-service/alert-service.examples.css +5 -3
- package/components/alert-service/{alert-service.jsx → alert-service.js} +1 -1
- package/components/analytics/analytics__ga-plugin.d.ts +1 -1
- package/components/analytics/analytics__ga-plugin.js +11 -3
- package/components/auth/auth__core.d.ts +3 -1
- package/components/auth/auth__core.js +47 -16
- package/components/auth/down-notification.css +1 -1
- package/components/auth/{down-notification.jsx → down-notification.js} +0 -0
- package/components/auth/{iframe-flow.jsx → iframe-flow.js} +0 -0
- package/components/auth-dialog/auth-dialog.d.ts +11 -0
- package/components/auth-dialog/{auth-dialog.jsx → auth-dialog.js} +33 -2
- package/components/auth-dialog-service/{auth-dialog-service.jsx → auth-dialog-service.js} +1 -1
- package/components/autofocus-ng/autofocus-ng.js +1 -1
- package/components/autofocus-ng/autofocus-ng.test.js +1 -1
- package/components/avatar/{avatar-example-datauri.jsx → avatar-example-datauri.js} +0 -0
- package/components/avatar/avatar.d.ts +1 -0
- package/components/avatar/{avatar.jsx → avatar.js} +0 -0
- package/components/avatar/{fallback-avatar.jsx → fallback-avatar.js} +2 -2
- package/components/badge/{badge.jsx → badge.js} +0 -0
- package/components/button/button.css +95 -206
- package/components/button/button.d.ts +8 -8
- package/components/button/{button.jsx → button.js} +6 -8
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +4 -7
- package/components/button-group/button-group.css +138 -19
- package/components/button-group/button-group.d.ts +4 -1
- package/components/button-group/{button-group.jsx → button-group.js} +3 -3
- package/components/button-group/{caption.jsx → caption.js} +0 -0
- package/components/button-group-ng/button-group-ng.css +1 -0
- package/components/button-group-ng/button-group-ng.examples.js +1 -1
- package/components/button-ng/button-ng.examples.js +6 -7
- package/components/button-ng/button-ng.js +6 -25
- package/components/button-set/button-set.css +1 -0
- package/components/button-set/{button-set.jsx → button-set.js} +0 -0
- package/components/button-toolbar/button-toolbar.css +2 -0
- package/components/button-toolbar/{button-toolbar.jsx → button-toolbar.js} +0 -0
- package/components/checkbox/checkbox.css +16 -13
- package/components/checkbox/{checkbox.jsx → checkbox.js} +1 -1
- package/components/checkbox-ng/checkbox-ng.js +1 -1
- package/components/code/{code.jsx → code.js} +0 -0
- package/components/confirm/{confirm.jsx → confirm.js} +0 -0
- package/components/confirm-service/{confirm-service.jsx → confirm-service.js} +1 -1
- package/components/content-layout/{content-layout.jsx → content-layout.js} +0 -0
- package/components/content-layout/{sidebar.jsx → sidebar.js} +0 -0
- package/components/contenteditable/{contenteditable.jsx → contenteditable.js} +0 -0
- package/components/data-list/data-list.d.ts +4 -8
- package/components/data-list/{data-list.jsx → data-list.js} +0 -0
- package/components/data-list/{data-list.mock.jsx → data-list.mock.js} +0 -0
- package/components/data-list/{item.jsx → item.js} +0 -0
- package/components/data-list/{title.jsx → title.js} +0 -0
- package/components/date-picker/{date-input.jsx → date-input.js} +2 -1
- package/components/date-picker/date-picker.css +3 -1
- package/components/date-picker/{date-picker.jsx → date-picker.js} +0 -0
- package/components/date-picker/{date-popup.jsx → date-popup.js} +0 -1
- package/components/date-picker/{day.jsx → day.js} +0 -0
- package/components/date-picker/{month-names.jsx → month-names.js} +0 -0
- package/components/date-picker/{month-slider.jsx → month-slider.js} +0 -0
- package/components/date-picker/{month.jsx → month.js} +0 -0
- package/components/date-picker/{months.jsx → months.js} +0 -0
- package/components/date-picker/{weekdays.jsx → weekdays.js} +0 -0
- package/components/date-picker/{years.jsx → years.js} +0 -0
- package/components/dialog/dialog.css +10 -3
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/{dialog.jsx → dialog.js} +0 -0
- package/components/dialog-ng/dialog-ng__template.js +1 -0
- package/components/dropdown/{anchor.jsx → anchor.js} +0 -0
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/{dropdown.jsx → dropdown.js} +0 -0
- package/components/dropdown-menu/{dropdown-menu.jsx → dropdown-menu.js} +0 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/{error-bubble.jsx → error-bubble.js} +0 -0
- package/components/error-message/{error-message.jsx → error-message.js} +0 -0
- package/components/footer/{footer.jsx → footer.js} +0 -0
- package/components/global/angular-component-factory.js +1 -1
- package/components/global/controls-height.d.ts +7 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/{create-stateful-context.jsx → create-stateful-context.js} +0 -0
- package/components/global/{focus-sensor-hoc.jsx → focus-sensor-hoc.js} +0 -0
- package/components/global/promise-with-timeout.d.ts +2 -1
- package/components/global/promise-with-timeout.js +5 -2
- package/components/global/{react-dom-renderer.jsx → react-dom-renderer.js} +0 -0
- package/components/global/react-render-adapter.d.ts +29 -0
- package/components/global/react-render-adapter.js +36 -0
- package/components/global/rerender-hoc.d.ts +5 -9
- package/components/global/rerender-hoc.js +4 -2
- package/components/global/theme.d.ts +7 -20
- package/components/global/theme.js +40 -0
- package/components/global/variables.css +30 -26
- package/components/global/variables.d.ts +10 -9
- package/components/global/variables_dark.css +67 -0
- package/components/grid/{col.jsx → col.js} +0 -0
- package/components/grid/{grid.jsx → grid.js} +0 -0
- package/components/grid/{row.jsx → row.js} +0 -0
- package/components/group/{group.jsx → group.js} +0 -0
- package/components/header/header.css +19 -10
- package/components/header/header.d.ts +7 -69
- package/components/header/{header.jsx → header.js} +10 -9
- package/components/header/{logo.jsx → logo.js} +0 -0
- package/components/header/profile.d.ts +3 -3
- package/components/header/{profile.jsx → profile.js} +0 -0
- package/components/header/{services-link.jsx → services-link.js} +0 -0
- package/components/header/services.css +3 -3
- package/components/header/services.d.ts +5 -0
- package/components/header/{services.jsx → services.js} +8 -2
- package/components/header/{smart-profile.jsx → smart-profile.js} +0 -0
- package/components/header/{smart-services.jsx → smart-services.js} +0 -0
- package/components/header/tray-icon.d.ts +18 -575
- package/components/header/{tray-icon.jsx → tray-icon.js} +0 -0
- package/components/header/{tray.jsx → tray.js} +0 -0
- package/components/heading/heading.css +4 -1
- package/components/heading/{heading.jsx → heading.js} +0 -0
- package/components/icon/icon.css +1 -1
- package/components/icon/{icon.jsx → icon.js} +0 -0
- package/components/icon/{icon__svg.jsx → icon__svg.js} +0 -0
- package/components/input/input.css +86 -149
- package/components/input/input.d.ts +15 -17
- package/components/input/{input.jsx → input.js} +29 -33
- package/components/input-ng/input-ng.examples.js +1 -1
- package/components/input-ng/input-ng.js +45 -49
- package/components/island/adaptive-island-hoc.d.ts +6 -10
- package/components/island/{adaptive-island-hoc.jsx → adaptive-island-hoc.js} +2 -2
- package/components/island/content.d.ts +33 -2
- package/components/island/{content.jsx → content.js} +7 -11
- package/components/island/{header.jsx → header.js} +7 -4
- package/components/island/island.css +8 -5
- package/components/island/island.d.ts +6 -10
- package/components/island/{island.jsx → island.js} +0 -0
- package/components/island-legacy/{content-legacy.jsx → content-legacy.js} +0 -0
- package/components/island-legacy/{header-legacy.jsx → header-legacy.js} +0 -0
- package/components/island-legacy/island-legacy.css +1 -1
- package/components/island-legacy/{island-legacy.jsx → island-legacy.js} +0 -0
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/{clickableLink.jsx → clickableLink.js} +0 -0
- package/components/link/link.css +0 -2
- package/components/link/link.d.ts +14 -22
- package/components/link/{link.jsx → link.js} +0 -0
- package/components/list/consts.d.ts +3 -1
- package/components/list/list.css +1 -0
- package/components/list/list.d.ts +3 -1
- package/components/list/{list.jsx → list.js} +12 -13
- package/components/list/{list__custom.jsx → list__custom.js} +0 -0
- package/components/list/{list__hint.jsx → list__hint.js} +0 -0
- package/components/list/{list__item.jsx → list__item.js} +0 -0
- package/components/list/{list__link.jsx → list__link.js} +2 -2
- package/components/list/{list__separator.jsx → list__separator.js} +0 -0
- package/components/list/{list__title.jsx → list__title.js} +0 -0
- package/components/loader/{loader.jsx → loader.js} +0 -0
- package/components/loader-inline/loader-inline.css +14 -0
- package/components/loader-inline/loader-inline.d.ts +4 -41
- package/components/loader-inline/{loader-inline.jsx → loader-inline.js} +3 -11
- package/components/loader-inline-ng/loader-inline-ng.js +1 -17
- package/components/loader-inline-ng/loader-inline-ng.test.js +0 -11
- package/components/loader-screen/{loader-screen.jsx → loader-screen.js} +0 -0
- package/components/login-dialog/{login-dialog.jsx → login-dialog.js} +0 -0
- package/components/login-dialog/{service.jsx → service.js} +1 -1
- package/components/markdown/code.d.ts +6 -13
- package/components/markdown/{code.jsx → code.js} +2 -2
- package/components/markdown/heading.d.ts +5 -9
- package/components/markdown/{heading.jsx → heading.js} +2 -2
- package/components/markdown/link.d.ts +4 -8
- package/components/markdown/{link.jsx → link.js} +1 -1
- package/components/markdown/markdown.d.ts +2 -3
- package/components/markdown/{markdown.jsx → markdown.js} +14 -11
- package/components/message/message.css +18 -28
- package/components/message/message.d.ts +3 -0
- package/components/message/{message.jsx → message.js} +42 -22
- package/components/pager/{pager.jsx → pager.js} +2 -8
- package/components/panel/{panel.jsx → panel.js} +0 -0
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.d.ts +7 -1
- package/components/popup/{popup.jsx → popup.js} +4 -2
- package/components/popup/popup.target.d.ts +2 -1
- package/components/popup/{popup.target.jsx → popup.target.js} +0 -0
- package/components/popup/position.d.ts +1 -1
- package/components/popup/position.js +2 -2
- package/components/popup-menu/popup-menu.d.ts +1 -0
- package/components/popup-menu/{popup-menu.jsx → popup-menu.js} +0 -0
- package/components/progress-bar/progress-bar.css +8 -12
- package/components/progress-bar/progress-bar.d.ts +0 -4
- package/components/progress-bar/{progress-bar.jsx → progress-bar.js} +1 -6
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -2
- package/components/query-assist/query-assist.css +48 -64
- package/components/query-assist/query-assist.d.ts +5 -14
- package/components/query-assist/{query-assist.jsx → query-assist.js} +6 -12
- package/components/query-assist/{query-assist__suggestions.jsx → query-assist__suggestions.js} +0 -0
- package/components/radio/radio.css +10 -4
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/{radio.jsx → radio.js} +0 -0
- package/components/radio/{radio__item.jsx → radio__item.js} +0 -0
- package/components/select/select-popup.css +5 -1
- package/components/select/select.css +23 -38
- package/components/select/select.d.ts +16 -20
- package/components/select/{select.jsx → select.js} +37 -47
- package/components/select/{select__filter.jsx → select__filter.js} +2 -1
- package/components/select/select__popup.d.ts +1 -1
- package/components/select/{select__popup.jsx → select__popup.js} +1 -2
- package/components/select-ng/select-ng.examples.js +1 -0
- package/components/select-ng/select-ng.js +19 -6
- package/components/select-ng/select-ng.test.js +1 -1
- package/components/select-ng/select-ng__lazy.js +13 -9
- package/components/select-ng/select-ng__lazy.test.js +3 -1
- package/components/shortcuts/shortcuts-hoc.d.ts +4 -8
- package/components/shortcuts/{shortcuts-hoc.jsx → shortcuts-hoc.js} +0 -0
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/tab-trap/{tab-trap.jsx → tab-trap.js} +0 -0
- package/components/table/{cell.jsx → cell.js} +0 -0
- package/components/table/disable-hover-hoc.d.ts +4 -8
- package/components/table/{disable-hover-hoc.jsx → disable-hover-hoc.js} +0 -0
- package/components/table/{header-cell.jsx → header-cell.js} +0 -0
- package/components/table/header.d.ts +8 -1
- package/components/table/{header.jsx → header.js} +0 -0
- package/components/table/{multitable.jsx → multitable.js} +0 -0
- package/components/table/row-with-focus-sensor.d.ts +4 -4
- package/components/table/{row-with-focus-sensor.jsx → row-with-focus-sensor.js} +4 -4
- package/components/table/row.d.ts +1 -0
- package/components/table/{row.jsx → row.js} +0 -0
- package/components/table/{selection-shortcuts-hoc.jsx → selection-shortcuts-hoc.js} +0 -0
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/{smart-table.jsx → smart-table.js} +7 -3
- package/components/table/table.d.ts +4 -8
- package/components/table/{table.jsx → table.js} +0 -0
- package/components/tabs/{collapsible-more.jsx → collapsible-more.js} +2 -2
- package/components/tabs/{collapsible-tab.jsx → collapsible-tab.js} +2 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/{collapsible-tabs.jsx → collapsible-tabs.js} +1 -1
- package/components/tabs/custom-item.d.ts +1 -1
- package/components/tabs/{custom-item.jsx → custom-item.js} +0 -0
- package/components/tabs/dumb-tabs.d.ts +6 -109
- package/components/tabs/{dumb-tabs.jsx → dumb-tabs.js} +5 -9
- package/components/tabs/smart-tabs.d.ts +4 -4
- package/components/tabs/{smart-tabs.jsx → smart-tabs.js} +9 -3
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/{tab-link.jsx → tab-link.js} +0 -0
- package/components/tabs/tab.d.ts +3 -1
- package/components/tabs/{tab.jsx → tab.js} +0 -0
- package/components/tabs/tabs.css +17 -28
- package/components/tabs-ng/tabs-ng.examples.js +11 -3
- package/components/tabs-ng/tabs-ng.js +1 -4
- package/components/tabs-ng/tabs-ng__template.js +1 -1
- package/components/tag/tag.css +31 -8
- package/components/tag/tag.d.ts +1 -0
- package/components/tag/{tag.jsx → tag.js} +2 -2
- package/components/tags-input/tags-input.css +10 -4
- package/components/tags-input/tags-input.d.ts +4 -8
- package/components/tags-input/{tags-input.jsx → tags-input.js} +0 -0
- package/components/tags-list/tags-list.d.ts +1 -1
- package/components/tags-list/{tags-list.jsx → tags-list.js} +0 -0
- package/components/text/{text.jsx → text.js} +0 -0
- package/components/toggle/toggle.css +61 -35
- package/components/toggle/toggle.d.ts +9 -89
- package/components/toggle/{toggle.jsx → toggle.js} +7 -7
- package/components/tooltip/tooltip.css +7 -0
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/{tooltip.jsx → tooltip.js} +3 -2
- package/components/tooltip-ng/tooltip-ng.js +13 -10
- package/components/user-agreement/service.d.ts +14 -62
- package/components/user-agreement/{service.jsx → service.js} +1 -1
- package/components/user-agreement/{user-agreement.jsx → user-agreement.js} +1 -1
- package/components/user-card/{card.jsx → card.js} +0 -0
- package/components/user-card/{smart-user-card-tooltip.jsx → smart-user-card-tooltip.js} +0 -0
- package/components/user-card/{tooltip.jsx → tooltip.js} +0 -0
- package/dist/_helpers/anchor.js +3 -3
- 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 +5 -8
- package/dist/_helpers/card.js +1 -1
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +3 -2
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +1 -1
- 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 +3 -0
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +6 -3
- package/dist/_helpers/services-link.js +2 -2
- package/dist/_helpers/sidebar.js +3 -2
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +55 -0
- package/dist/_helpers/title.js +2 -1
- package/dist/alert/alert.d.ts +3 -0
- package/dist/alert/alert.js +35 -21
- package/dist/alert/container.js +1 -1
- package/dist/alert-service/alert-service.js +23 -8
- package/dist/analytics/analytics.js +4 -3
- package/dist/analytics/analytics__custom-plugin.js +2 -1
- package/dist/analytics/analytics__fus-plugin.js +1 -0
- package/dist/analytics/analytics__ga-plugin.d.ts +1 -1
- package/dist/analytics/analytics__ga-plugin.js +15 -7
- package/dist/analytics/analytics__plugin-utils.js +4 -3
- package/dist/analytics-ng/analytics-ng.js +3 -2
- package/dist/auth/auth.js +22 -9
- package/dist/auth/auth__core.d.ts +3 -1
- package/dist/auth/auth__core.js +87 -38
- package/dist/auth/background-flow.js +2 -1
- package/dist/auth/down-notification.js +21 -8
- package/dist/auth/iframe-flow.js +4 -1
- package/dist/auth/landing.js +26 -13
- package/dist/auth/request-builder.js +1 -0
- package/dist/auth/response-parser.js +1 -0
- package/dist/auth/storage.js +22 -7
- package/dist/auth/token-validator.js +2 -0
- package/dist/auth/window-flow.js +2 -1
- package/dist/auth-dialog/auth-dialog.d.ts +11 -0
- package/dist/auth-dialog/auth-dialog.js +55 -8
- package/dist/auth-dialog-service/auth-dialog-service.js +5 -2
- package/dist/auth-ng/auth-ng.js +23 -10
- package/dist/autofocus-ng/autofocus-ng.js +2 -1
- package/dist/avatar/avatar-example-datauri.js +1 -23
- package/dist/avatar/avatar.d.ts +1 -0
- package/dist/avatar/avatar.js +5 -3
- package/dist/avatar/fallback-avatar.js +6 -5
- package/dist/avatar-editor-ng/avatar-editor-ng.js +22 -7
- package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
- package/dist/avatar-ng/avatar-ng.js +3 -0
- package/dist/badge/badge.js +1 -0
- package/dist/badge-ng/badge-ng.js +2 -0
- package/dist/breadcrumb-ng/breadcrumb-ng.js +4 -28
- package/dist/button/button.d.ts +8 -8
- package/dist/button/button.js +8 -8
- package/dist/button/button__classes.d.ts +1 -1
- package/dist/button/button__classes.js +0 -3
- package/dist/button-group/button-group.d.ts +4 -1
- package/dist/button-group/button-group.js +5 -3
- package/dist/button-group-ng/button-group-ng.js +2 -1
- package/dist/button-ng/button-ng.js +9 -40
- package/dist/button-set-ng/button-set-ng.js +1 -1
- package/dist/button-toolbar-ng/button-toolbar-ng.js +1 -0
- package/dist/caret/caret.js +2 -0
- package/dist/checkbox/checkbox.js +3 -1
- package/dist/checkbox-ng/checkbox-ng.js +4 -21
- package/dist/code/code.js +4 -3
- package/dist/confirm/confirm.js +7 -5
- package/dist/confirm-ng/confirm-ng.js +4 -1
- package/dist/confirm-service/confirm-service.js +5 -2
- package/dist/content-layout/content-layout.js +1 -0
- package/dist/content-layout/sidebar.js +1 -0
- package/dist/data-list/data-list.d.ts +4 -8
- package/dist/data-list/data-list.js +5 -8
- package/dist/data-list/data-list.mock.js +1 -0
- package/dist/data-list/item.js +11 -14
- package/dist/data-list/selection.js +1 -0
- package/dist/data-list/title.js +3 -1
- package/dist/data-list-ng/data-list-ng.js +6 -8
- package/dist/date-picker/consts.js +1 -1
- package/dist/date-picker/date-input.js +8 -5
- package/dist/date-picker/date-picker.js +11 -9
- package/dist/date-picker/date-popup.js +5 -4
- package/dist/date-picker/day.js +1 -0
- package/dist/date-picker/month-names.js +1 -0
- package/dist/date-picker/month-slider.js +1 -0
- package/dist/date-picker/month.js +1 -0
- package/dist/date-picker/months.js +1 -0
- package/dist/date-picker/years.js +1 -0
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.js +5 -3
- package/dist/dialog/dialog__body-scroll-preventer.js +1 -0
- package/dist/dialog-ng/dialog-ng.js +9 -6
- package/dist/dialog-ng/dialog-ng__template.js +1 -69
- package/dist/docked-panel-ng/docked-panel-ng.js +2 -1
- package/dist/dropdown/anchor.js +3 -1
- package/dist/dropdown/dropdown.d.ts +2 -2
- package/dist/dropdown/dropdown.js +3 -1
- package/dist/dropdown-menu/dropdown-menu.js +5 -3
- package/dist/error-bubble/error-bubble.js +3 -1
- package/dist/error-message/error-message.js +3 -1
- package/dist/error-message-ng/error-message-ng.js +3 -21
- package/dist/footer/footer.js +1 -0
- package/dist/footer-ng/footer-ng.js +3 -14
- package/dist/form-ng/form-ng.js +2 -4
- package/dist/global/angular-component-factory.js +8 -6
- package/dist/global/controls-height.d.ts +7 -0
- package/dist/global/controls-height.js +13 -0
- package/dist/global/create-stateful-context.js +3 -2
- package/dist/global/data-tests.js +2 -0
- package/dist/global/dom.js +1 -0
- package/dist/global/focus-sensor-hoc.js +1 -0
- package/dist/global/fuzzy-highlight.js +1 -1
- package/dist/global/inject-styles.js +5 -7
- package/dist/global/listeners.js +1 -0
- package/dist/global/memoize.js +2 -0
- package/dist/global/normalize-indent.js +2 -0
- package/dist/global/promise-with-timeout.d.ts +2 -1
- package/dist/global/promise-with-timeout.js +6 -2
- package/dist/global/react-dom-renderer.js +1 -0
- package/dist/global/react-render-adapter.d.ts +29 -0
- package/dist/global/react-render-adapter.js +41 -0
- package/dist/global/rerender-hoc.d.ts +5 -9
- package/dist/global/rerender-hoc.js +7 -3
- package/dist/global/theme.d.ts +7 -20
- package/dist/global/theme.js +22 -62
- package/dist/global/trivial-template-tag.js +2 -0
- package/dist/global/url.js +3 -1
- package/dist/global/variables.d.ts +10 -9
- package/dist/grid/col.js +2 -1
- package/dist/grid/grid.js +1 -0
- package/dist/grid/row.js +1 -1
- package/dist/group-ng/group-ng.js +1 -1
- package/dist/header/header.d.ts +7 -69
- package/dist/header/header.js +31 -31
- package/dist/header/logo.js +2 -0
- package/dist/header/profile.d.ts +3 -3
- package/dist/header/profile.js +6 -4
- package/dist/header/services-link.js +1 -0
- package/dist/header/services.d.ts +5 -0
- package/dist/header/services.js +13 -3
- package/dist/header/smart-profile.js +27 -27
- package/dist/header/smart-services.js +23 -24
- package/dist/header/tray-icon.d.ts +18 -575
- package/dist/header/tray-icon.js +6 -4
- package/dist/heading/heading.js +3 -3
- package/dist/http/http.js +4 -2
- package/dist/http/http.mock.js +2 -0
- package/dist/hub-source/hub-source.js +1 -1
- package/dist/hub-source/hub-source__user.js +4 -2
- package/dist/hub-source/hub-source__users-groups.js +3 -2
- package/dist/icon/icon.js +3 -3
- package/dist/icon/icon__svg.js +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon-ng/icon-ng.js +7 -5
- package/dist/input/input.d.ts +15 -17
- package/dist/input/input.js +35 -42
- package/dist/input-ng/input-ng.js +8 -64
- package/dist/island/adaptive-island-hoc.d.ts +6 -10
- package/dist/island/adaptive-island-hoc.js +8 -5
- package/dist/island/content.d.ts +33 -2
- package/dist/island/content.js +10 -13
- package/dist/island/header.js +10 -6
- package/dist/island/island.d.ts +6 -10
- package/dist/island/island.js +1 -0
- package/dist/island-ng/island-content-ng.js +2 -16
- package/dist/island-ng/island-header-ng.js +2 -8
- package/dist/island-ng/island-ng-class-fixer.js +2 -0
- package/dist/island-ng/island-ng.js +2 -8
- package/dist/link/clickableLink.d.ts +1 -1
- package/dist/link/clickableLink.js +1 -0
- package/dist/link/link.d.ts +14 -22
- package/dist/link/link.js +4 -3
- package/dist/link-ng/link-ng.js +1 -4
- package/dist/list/consts.d.ts +3 -1
- package/dist/list/list.d.ts +3 -1
- package/dist/list/list.js +30 -23
- package/dist/list/list__custom.js +1 -0
- package/dist/list/list__item.js +6 -4
- package/dist/list/list__link.js +3 -1
- package/dist/list/list__users-groups-source.js +4 -2
- package/dist/loader/loader.js +1 -0
- package/dist/loader/loader__core.js +5 -4
- package/dist/loader-inline/loader-inline.d.ts +4 -41
- package/dist/loader-inline/loader-inline.js +4 -21
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -30
- package/dist/loader-ng/loader-ng.js +1 -0
- package/dist/loader-screen/loader-screen.js +1 -0
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -6
- package/dist/login-dialog/login-dialog.js +4 -2
- package/dist/login-dialog/service.js +5 -2
- package/dist/markdown/code.d.ts +6 -13
- package/dist/markdown/code.js +4 -3
- package/dist/markdown/heading.d.ts +5 -9
- package/dist/markdown/heading.js +2 -2
- package/dist/markdown/link.d.ts +4 -8
- package/dist/markdown/link.js +2 -1
- package/dist/markdown/markdown.d.ts +2 -3
- package/dist/markdown/markdown.js +17 -16
- package/dist/message/message.d.ts +3 -0
- package/dist/message/message.js +56 -42
- package/dist/old-browsers-message/old-browsers-message.js +2 -1
- package/dist/old-browsers-message/old-browsers-message__stop.js +1 -0
- package/dist/old-browsers-message/white-list.js +1 -0
- package/dist/pager/pager.js +14 -15
- package/dist/pager-ng/pager-ng.js +8 -9
- package/dist/panel-ng/panel-ng.js +1 -0
- package/dist/permissions/permissions.js +1 -1
- package/dist/permissions-ng/permissions-ng.js +23 -10
- package/dist/place-under-ng/place-under-ng.js +3 -2
- package/dist/popup/popup.d.ts +7 -1
- package/dist/popup/popup.js +11 -5
- package/dist/popup/popup.target.d.ts +2 -1
- package/dist/popup/position.d.ts +1 -1
- package/dist/popup/position.js +3 -2
- package/dist/popup-menu/popup-menu.d.ts +1 -0
- package/dist/popup-menu/popup-menu.js +3 -1
- package/dist/progress-bar/progress-bar.d.ts +0 -4
- package/dist/progress-bar/progress-bar.js +3 -8
- package/dist/progress-bar-ng/progress-bar-ng.js +2 -1
- package/dist/promised-click-ng/promised-click-ng.js +4 -2
- package/dist/proxy-attrs/proxy-attrs.js +5 -3
- package/dist/query-assist/query-assist.d.ts +5 -14
- package/dist/query-assist/query-assist.js +19 -31
- package/dist/query-assist/query-assist__suggestions.js +3 -1
- package/dist/query-assist-ng/query-assist-ng.js +9 -10
- package/dist/radio/radio.d.ts +1 -1
- package/dist/radio/radio.js +1 -0
- package/dist/radio/radio__item.js +1 -0
- package/dist/radio-ng/radio-ng.js +2 -18
- package/dist/save-field-ng/save-field-ng.js +5 -10
- package/dist/save-field-ng/save-field-ng__template.js +1 -32
- package/dist/select/select.d.ts +16 -20
- package/dist/select/select.js +65 -77
- package/dist/select/select__filter.js +5 -3
- package/dist/select/select__popup.d.ts +1 -1
- package/dist/select/select__popup.js +12 -16
- package/dist/select-ng/select-ng.js +28 -17
- package/dist/select-ng/select-ng__lazy.js +24 -20
- package/dist/select-ng/select-ng__options.js +2 -2
- package/dist/shortcuts/shortcuts-hoc.d.ts +4 -8
- package/dist/shortcuts/shortcuts-hoc.js +4 -3
- package/dist/shortcuts/shortcuts.d.ts +1 -1
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +5 -2
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
- package/dist/shortcuts-ng/shortcuts-ng.js +4 -3
- package/dist/sidebar-ng/sidebar-ng.js +4 -2
- 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 +22 -7
- package/dist/storage/storage__fallback.js +4 -3
- package/dist/storage/storage__local.js +22 -7
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.d.ts +1 -1
- package/dist/tab-trap/tab-trap.js +2 -1
- package/dist/table/cell.js +1 -0
- package/dist/table/disable-hover-hoc.d.ts +4 -8
- package/dist/table/disable-hover-hoc.js +4 -3
- package/dist/table/header-cell.js +2 -0
- package/dist/table/header.d.ts +8 -1
- package/dist/table/header.js +3 -1
- package/dist/table/multitable.js +1 -0
- package/dist/table/row-with-focus-sensor.d.ts +4 -4
- package/dist/table/row-with-focus-sensor.js +16 -6
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +9 -7
- package/dist/table/selection-adapter.js +2 -0
- package/dist/table/selection-shortcuts-hoc.js +1 -0
- package/dist/table/selection.js +1 -0
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +14 -8
- package/dist/table/table.d.ts +4 -8
- package/dist/table/table.js +4 -2
- package/dist/table-legacy-ng/table-legacy-ng.js +16 -54
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +9 -16
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -1
- package/dist/table-ng/smart-table-ng.js +5 -2
- package/dist/table-ng/table-ng.js +5 -2
- package/dist/tabs/collapsible-more.js +5 -3
- package/dist/tabs/collapsible-tab.js +4 -2
- package/dist/tabs/collapsible-tabs.d.ts +2 -2
- package/dist/tabs/collapsible-tabs.js +4 -2
- package/dist/tabs/custom-item.d.ts +1 -1
- package/dist/tabs/dumb-tabs.d.ts +6 -109
- package/dist/tabs/dumb-tabs.js +9 -13
- package/dist/tabs/smart-tabs.d.ts +4 -4
- package/dist/tabs/smart-tabs.js +13 -9
- package/dist/tabs/tab-link.d.ts +1 -1
- package/dist/tabs/tab-link.js +1 -0
- package/dist/tabs/tab.d.ts +3 -1
- package/dist/tabs/tab.js +1 -0
- package/dist/tabs/tabs.js +4 -2
- package/dist/tabs-ng/tabs-ng.js +2 -6
- package/dist/tabs-ng/tabs-ng__template.js +1 -38
- package/dist/tag/tag.d.ts +1 -0
- package/dist/tag/tag.js +8 -6
- package/dist/tags-input/tags-input.d.ts +4 -8
- package/dist/tags-input/tags-input.js +10 -11
- package/dist/tags-input-ng/tags-input-ng.js +9 -10
- package/dist/tags-list/tags-list.d.ts +1 -1
- package/dist/tags-list/tags-list.js +4 -2
- package/dist/template-ng/template-ng.js +1 -0
- package/dist/text/text.js +1 -1
- package/dist/theme-ng/theme-ng.js +1 -0
- package/dist/toggle/toggle.d.ts +9 -89
- package/dist/toggle/toggle.js +8 -8
- package/dist/toggle-ng/toggle-ng.js +4 -3
- package/dist/tooltip/tooltip.d.ts +1 -0
- package/dist/tooltip/tooltip.js +8 -3
- package/dist/tooltip-ng/tooltip-ng.js +12 -6
- package/dist/user-agreement/service.d.ts +14 -62
- package/dist/user-agreement/service.js +23 -21
- package/dist/user-agreement/toolbox.eula.js +1 -160
- package/dist/user-agreement/user-agreement.js +10 -10
- package/dist/user-card/card.js +2 -0
- package/dist/user-card/smart-user-card-tooltip.js +8 -11
- package/dist/user-card/tooltip.js +3 -1
- package/dist/user-card/user-card.js +4 -7
- package/dist/user-card-ng/user-card-ng.js +7 -9
- package/package.json +78 -69
- package/webpack.config.js +0 -11
- package/components/global/conic-gradient.d.ts +0 -796
- package/components/global/conic-gradient.js +0 -21
- package/components/global/radial-gradient-mask.d.ts +0 -9
- package/components/global/radial-gradient-mask.js +0 -39
- package/components/global/supports-css.d.ts +0 -2
- package/components/global/supports-css.js +0 -14
- package/components/global/theme.jsx +0 -39
- package/components/global/variables_dark.d.ts +0 -3
- package/components/global/variables_dark.js +0 -53
- package/components/loader-inline/inject-styles.d.ts +0 -2
- package/components/loader-inline/inject-styles.js +0 -17
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/global/conic-gradient.d.ts +0 -796
- package/dist/global/conic-gradient.js +0 -35
- package/dist/global/radial-gradient-mask.d.ts +0 -9
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/supports-css.d.ts +0 -2
- package/dist/global/supports-css.js +0 -20
- package/dist/global/variables_dark.d.ts +0 -3
- package/dist/global/variables_dark.js +0 -57
- package/dist/loader-inline/inject-styles.d.ts +0 -2
- package/dist/loader-inline/inject-styles.js +0 -11
|
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import debounce from 'just-debounce-it';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import deepEqual from 'deep-equal';
|
|
6
|
-
import searchIcon from '@jetbrains/icons/search';
|
|
7
|
-
import closeIcon from '@jetbrains/icons/close';
|
|
6
|
+
import searchIcon from '@jetbrains/icons/search-12px';
|
|
7
|
+
import closeIcon from '@jetbrains/icons/close-12px';
|
|
8
8
|
import getUID from '../global/get-uid';
|
|
9
9
|
import dataTests from '../global/data-tests';
|
|
10
10
|
import { getRect, preventDefault } from '../global/dom';
|
|
@@ -14,7 +14,6 @@ import PopupMenu from '../popup-menu/popup-menu';
|
|
|
14
14
|
import LoaderInline from '../loader-inline/loader-inline';
|
|
15
15
|
import Shortcuts from '../shortcuts/shortcuts';
|
|
16
16
|
import rerenderHOC from '../global/rerender-hoc';
|
|
17
|
-
import Theme from '../global/theme';
|
|
18
17
|
import Button from '../button/button';
|
|
19
18
|
import QueryAssistSuggestions from './query-assist__suggestions';
|
|
20
19
|
import styles from './query-assist.css';
|
|
@@ -66,7 +65,6 @@ function cleanText(text) {
|
|
|
66
65
|
*/
|
|
67
66
|
export default class QueryAssist extends Component {
|
|
68
67
|
static propTypes = {
|
|
69
|
-
theme: PropTypes.string,
|
|
70
68
|
/**
|
|
71
69
|
* Open suggestions popup during the initial render
|
|
72
70
|
*/
|
|
@@ -153,7 +151,6 @@ export default class QueryAssist extends Component {
|
|
|
153
151
|
'data-test': PropTypes.string
|
|
154
152
|
};
|
|
155
153
|
static defaultProps = {
|
|
156
|
-
theme: Theme.LIGHT,
|
|
157
154
|
onApply: noop,
|
|
158
155
|
onChange: noop,
|
|
159
156
|
onApplySuggestion: noop,
|
|
@@ -247,7 +244,6 @@ export default class QueryAssist extends Component {
|
|
|
247
244
|
}
|
|
248
245
|
}
|
|
249
246
|
static ngModelStateField = ngModelStateField;
|
|
250
|
-
static Theme = Theme;
|
|
251
247
|
immediateState;
|
|
252
248
|
requestData;
|
|
253
249
|
ngModelStateField = ngModelStateField;
|
|
@@ -756,11 +752,10 @@ export default class QueryAssist extends Component {
|
|
|
756
752
|
return actions;
|
|
757
753
|
}
|
|
758
754
|
render() {
|
|
759
|
-
const {
|
|
755
|
+
const { glass, 'data-test': dataTest, className, useCustomItemRender } = this.props;
|
|
760
756
|
const renderPlaceholder = !!this.props.placeholder && this.state.placeholderEnabled;
|
|
761
757
|
const renderLoader = this.props.loader !== false && this.state.loading;
|
|
762
758
|
const renderGlass = glass && !renderLoader;
|
|
763
|
-
const renderUnderline = theme === Theme.DARK;
|
|
764
759
|
const actions = this.renderActions();
|
|
765
760
|
const inputClasses = classNames({
|
|
766
761
|
[`${styles.input} ring-js-shortcuts`]: true,
|
|
@@ -769,7 +764,7 @@ export default class QueryAssist extends Component {
|
|
|
769
764
|
[styles.inputLeftGap]: this.isRenderingGlassOrLoader() && glass,
|
|
770
765
|
[styles.inputDisabled]: this.props.disabled
|
|
771
766
|
});
|
|
772
|
-
return (<div data-test={dataTests('ring-query-assist', dataTest)} className={classNames(className, styles.queryAssist
|
|
767
|
+
return (<div data-test={dataTests('ring-query-assist', dataTest)} className={classNames(className, styles.queryAssist)} role="presentation" ref={this.nodeRef}>
|
|
773
768
|
{this.state.shortcuts &&
|
|
774
769
|
(<Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
775
770
|
|
|
@@ -777,7 +772,7 @@ export default class QueryAssist extends Component {
|
|
|
777
772
|
{renderLoader && (<div className={classNames(styles.icon, styles.loader, {
|
|
778
773
|
[styles.loaderOnTheRight]: !glass
|
|
779
774
|
})} ref={this.loaderRef}>
|
|
780
|
-
<LoaderInline
|
|
775
|
+
<LoaderInline />
|
|
781
776
|
</div>)}
|
|
782
777
|
|
|
783
778
|
<ContentEditable aria-label={this.props.translations.searchTitle} className={inputClasses} data-test="ring-query-assist-input" inputRef={this.inputRef} disabled={this.props.disabled} onComponentUpdate={() => this.setCaretPosition({ fromContentEditable: true })} onBlur={this.handleFocusChange} onClick={this.handleCaretMove} onCompositionStart={this.trackCompositionState} onCompositionEnd={this.trackCompositionState} onFocus={this.handleFocusChange} onInput={this.handleInput} // To support IE use the same method
|
|
@@ -789,10 +784,9 @@ export default class QueryAssist extends Component {
|
|
|
789
784
|
})} ref={this.placeholderRef} onClick={this.handleCaretMove} data-test="query-assist-placeholder">
|
|
790
785
|
{this.props.placeholder}
|
|
791
786
|
</button>)}
|
|
792
|
-
{renderUnderline && <div className={styles.focusUnderline}/>}
|
|
793
787
|
{actions &&
|
|
794
788
|
<div data-test="ring-query-assist-actions" className={styles.actions}>{actions}</div>}
|
|
795
|
-
<PopupMenu hidden={!this.state.showPopup} onCloseAttempt={this.closePopup} ref={this.popupRef} anchorElement={this.node} keepMounted attached className={
|
|
789
|
+
<PopupMenu hidden={!this.state.showPopup} onCloseAttempt={this.closePopup} ref={this.popupRef} anchorElement={this.node} keepMounted attached className={this.props.popupClassName} directions={[PopupMenu.PopupProps.Directions.BOTTOM_RIGHT]} data={useCustomItemRender ? this.state.suggestions : this.renderSuggestions()} data-test="ring-query-assist-popup" hint={this.props.hint} hintOnSelection={this.props.hintOnSelection} left={this.getPopupOffset(this.state.suggestions)} maxHeight={PopupMenu.PopupProps.MaxHeight.SCREEN} onMouseDown={this.trackPopupMouseState} onMouseUp={this.trackPopupMouseState} onSelect={item => this.handleComplete(item)}/>
|
|
796
790
|
</div>);
|
|
797
791
|
}
|
|
798
792
|
}
|
package/components/query-assist/{query-assist__suggestions.jsx → query-assist__suggestions.js}
RENAMED
|
File without changes
|
|
@@ -74,11 +74,12 @@
|
|
|
74
74
|
opacity: 0;
|
|
75
75
|
|
|
76
76
|
&[disabled] + .circle {
|
|
77
|
-
border-color: var(--ring-
|
|
77
|
+
border-color: var(--ring-border-unselected-disabled-color);
|
|
78
|
+
background-color: var(--ring-disabled-background-color);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
&:checked + .circle {
|
|
81
|
-
border-color: var(--ring-
|
|
82
|
+
border-color: var(--ring-main-color);
|
|
82
83
|
|
|
83
84
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
84
85
|
&::after {
|
|
@@ -101,8 +102,13 @@
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
104
|
-
&[disabled]:checked + .circle
|
|
105
|
-
|
|
105
|
+
&[disabled]:checked + .circle {
|
|
106
|
+
border-color: var(--ring-border-disabled-color);
|
|
107
|
+
|
|
108
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
109
|
+
&::after {
|
|
110
|
+
background-color: var(--ring-border-disabled-color);
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
&[disabled] ~ .label {
|
|
@@ -10,7 +10,7 @@ export default class Radio extends Component<RadioProps> {
|
|
|
10
10
|
disabled: PropTypes.Requireable<boolean>;
|
|
11
11
|
value: PropTypes.Requireable<string | number | boolean>;
|
|
12
12
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
-
children: PropTypes.Validator<string | number | boolean |
|
|
13
|
+
children: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
14
14
|
};
|
|
15
15
|
static Item: React.ForwardRefExoticComponent<import("./radio__item").RadioItemProps & React.RefAttributes<import("./radio__item").Radio>>;
|
|
16
16
|
uid: string;
|
|
File without changes
|
|
File without changes
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.filter {
|
|
25
|
-
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
|
|
27
|
+
width: 0;
|
|
26
28
|
|
|
27
29
|
& input {
|
|
28
30
|
font-weight: 200;
|
|
@@ -32,6 +34,8 @@
|
|
|
32
34
|
.filterWrapper {
|
|
33
35
|
position: relative;
|
|
34
36
|
|
|
37
|
+
display: flex;
|
|
38
|
+
|
|
35
39
|
margin: 0;
|
|
36
40
|
padding-right: unit;
|
|
37
41
|
padding-left: calc(unit * 5.5);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
|
|
3
3
|
@value unit from "../global/global.css";
|
|
4
|
+
@value button-shadow from "../button/button.css";
|
|
4
5
|
|
|
5
6
|
.select {
|
|
6
7
|
position: relative;
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
|
|
40
41
|
.icons {
|
|
41
42
|
position: absolute;
|
|
42
|
-
top: -
|
|
43
|
-
right:
|
|
43
|
+
top: -3px;
|
|
44
|
+
right: calc(unit * 1.5);
|
|
44
45
|
|
|
45
46
|
transition: color var(--ring-ease);
|
|
46
47
|
|
|
@@ -55,20 +56,16 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
@nest .inputMode & {
|
|
58
|
-
top: 12px;
|
|
59
|
-
|
|
60
59
|
font-size: var(--ring-font-size);
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
@nest .buttonMode & {
|
|
64
|
-
top: -4px;
|
|
65
|
-
right: unit;
|
|
66
|
-
}
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
.selectedIcon {
|
|
70
64
|
composes: resetButton from "../global/global.css";
|
|
71
65
|
|
|
66
|
+
position: relative;
|
|
67
|
+
top: 3px;
|
|
68
|
+
|
|
72
69
|
display: inline-block;
|
|
73
70
|
|
|
74
71
|
width: calc(2 * unit);
|
|
@@ -84,11 +81,7 @@
|
|
|
84
81
|
.clearIcon {
|
|
85
82
|
padding: 0 3px;
|
|
86
83
|
|
|
87
|
-
vertical-align: -
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.clearIcon.clearIcon > span > span {
|
|
91
|
-
color: var(--ring-icon-secondary-color);
|
|
84
|
+
vertical-align: -2px;
|
|
92
85
|
}
|
|
93
86
|
|
|
94
87
|
.sizeS {
|
|
@@ -111,8 +104,7 @@
|
|
|
111
104
|
max-width: 100%;
|
|
112
105
|
}
|
|
113
106
|
|
|
114
|
-
.buttonMode
|
|
115
|
-
.materialMode {
|
|
107
|
+
.buttonMode {
|
|
116
108
|
position: relative;
|
|
117
109
|
|
|
118
110
|
cursor: pointer;
|
|
@@ -168,14 +160,18 @@
|
|
|
168
160
|
display: block;
|
|
169
161
|
|
|
170
162
|
width: 100%;
|
|
163
|
+
padding-left: unit;
|
|
171
164
|
|
|
172
165
|
text-align: left;
|
|
173
166
|
vertical-align: calc(0 - unit);
|
|
174
167
|
}
|
|
175
168
|
|
|
176
|
-
.
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
.buttonValue:global(.focus-visible) {
|
|
170
|
+
box-shadow: button-shadow var(--ring-main-color);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.buttonValueOpen.buttonValueOpen {
|
|
174
|
+
box-shadow: button-shadow var(--ring-main-color);
|
|
179
175
|
}
|
|
180
176
|
|
|
181
177
|
.label {
|
|
@@ -186,6 +182,7 @@
|
|
|
186
182
|
|
|
187
183
|
.select:hover .value,
|
|
188
184
|
.select:hover .icons,
|
|
185
|
+
:global(.focus-visible) + .icons,
|
|
189
186
|
.value:focus,
|
|
190
187
|
.value:focus + .icons,
|
|
191
188
|
.open,
|
|
@@ -207,23 +204,6 @@
|
|
|
207
204
|
}
|
|
208
205
|
}
|
|
209
206
|
|
|
210
|
-
.selectedLabel {
|
|
211
|
-
position: absolute;
|
|
212
|
-
top: calc(unit * -1.5);
|
|
213
|
-
left: 0;
|
|
214
|
-
|
|
215
|
-
overflow: hidden;
|
|
216
|
-
|
|
217
|
-
max-width: 100%;
|
|
218
|
-
|
|
219
|
-
text-overflow: ellipsis;
|
|
220
|
-
|
|
221
|
-
color: var(--ring-secondary-color);
|
|
222
|
-
|
|
223
|
-
font-size: var(--ring-font-size-smaller);
|
|
224
|
-
line-height: var(--ring-line-height-lowest);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
207
|
.avatar {
|
|
228
208
|
margin-right: 4px;
|
|
229
209
|
|
|
@@ -236,9 +216,10 @@
|
|
|
236
216
|
}
|
|
237
217
|
|
|
238
218
|
.chevron.chevron {
|
|
239
|
-
padding: 0;
|
|
219
|
+
padding: 0 3px;
|
|
240
220
|
|
|
241
221
|
transition: none;
|
|
222
|
+
vertical-align: -1px;
|
|
242
223
|
|
|
243
224
|
color: inherit;
|
|
244
225
|
}
|
|
@@ -249,6 +230,10 @@
|
|
|
249
230
|
color: inherit;
|
|
250
231
|
}
|
|
251
232
|
|
|
252
|
-
.avatar {
|
|
233
|
+
.heightS .avatar {
|
|
253
234
|
vertical-align: -6px;
|
|
254
235
|
}
|
|
236
|
+
|
|
237
|
+
.heightS .icons {
|
|
238
|
+
top: -5px;
|
|
239
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes, Component, CSSProperties, HTMLAttributes, ReactNode, RefCallback, SyntheticEvent } from 'react';
|
|
2
2
|
import { SelectHandlerParams } from '../list/list';
|
|
3
3
|
import { Size } from '../input/input';
|
|
4
|
-
import Theme from '../global/theme';
|
|
5
4
|
import { ListDataItem } from '../list/consts';
|
|
6
5
|
import { Directions } from '../popup/popup.consts';
|
|
6
|
+
import { ControlsHeight } from '../global/controls-height';
|
|
7
7
|
import SelectPopup, { Filter, FilterFn, Multiple, Tags } from './select__popup';
|
|
8
8
|
/**
|
|
9
9
|
* @name Select
|
|
@@ -17,7 +17,6 @@ declare enum Type {
|
|
|
17
17
|
INPUT = "INPUT",
|
|
18
18
|
CUSTOM = "CUSTOM",
|
|
19
19
|
INLINE = "INLINE",
|
|
20
|
-
MATERIAL = "MATERIAL",
|
|
21
20
|
INPUT_WITHOUT_CONTROLS = "INPUT_WITHOUT_CONTROLS"
|
|
22
21
|
}
|
|
23
22
|
declare type SelectItemData<T> = T & {
|
|
@@ -46,6 +45,7 @@ export interface CustomAnchorProps {
|
|
|
46
45
|
buttonProps: ButtonHTMLAttributes<HTMLButtonElement> & DataTestProps;
|
|
47
46
|
popup: ReactNode;
|
|
48
47
|
}
|
|
48
|
+
export declare type CustomAnchor = ((props: CustomAnchorProps) => ReactNode);
|
|
49
49
|
export interface BaseSelectProps<T = unknown> {
|
|
50
50
|
data: readonly SelectItem<T>[];
|
|
51
51
|
filter: boolean | Filter<T>;
|
|
@@ -61,7 +61,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
61
61
|
maxHeight: number;
|
|
62
62
|
hideArrow: boolean;
|
|
63
63
|
directions: readonly Directions[];
|
|
64
|
-
label: string;
|
|
64
|
+
label: string | null;
|
|
65
65
|
selectedLabel: ReactNode;
|
|
66
66
|
inputPlaceholder: string;
|
|
67
67
|
shortcutsEnabled: boolean;
|
|
@@ -69,7 +69,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
69
69
|
onLoadMore: () => void;
|
|
70
70
|
onOpen: () => void;
|
|
71
71
|
onFilter: (value: string) => void;
|
|
72
|
-
onFocus: () => void;
|
|
72
|
+
onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
73
73
|
onBlur: () => void;
|
|
74
74
|
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
75
75
|
onSelect: (selected: SelectItem<T> | null, event?: Event | SyntheticEvent) => void;
|
|
@@ -78,6 +78,8 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
78
78
|
onDone: () => void;
|
|
79
79
|
onReset: () => void;
|
|
80
80
|
dir: 'ltr' | 'rtl';
|
|
81
|
+
renderBottomToolbar?: () => ReactNode;
|
|
82
|
+
height?: ControlsHeight | undefined;
|
|
81
83
|
targetElement?: HTMLElement | null | undefined;
|
|
82
84
|
className?: string | null | undefined;
|
|
83
85
|
buttonClassName?: string | null | undefined;
|
|
@@ -93,8 +95,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
93
95
|
hint?: ReactNode;
|
|
94
96
|
add?: Add | null | undefined;
|
|
95
97
|
compact?: boolean | null | undefined;
|
|
96
|
-
|
|
97
|
-
customAnchor?: ((props: CustomAnchorProps) => ReactNode) | null | undefined;
|
|
98
|
+
customAnchor?: CustomAnchor | null | undefined;
|
|
98
99
|
disableMoveOverflow?: boolean | null | undefined;
|
|
99
100
|
disableScrollToActive?: boolean | null | undefined;
|
|
100
101
|
'data-test'?: string | null | undefined;
|
|
@@ -113,7 +114,7 @@ export interface MultipleSelectProps<T = unknown> extends BaseSelectProps<T> {
|
|
|
113
114
|
onChange: (selected: SelectItem<T>[], event?: Event | SyntheticEvent) => void;
|
|
114
115
|
tags?: Tags | boolean | null | undefined;
|
|
115
116
|
}
|
|
116
|
-
declare type SelectProps<T = unknown> = SingleSelectProps<T> | MultipleSelectProps<T>;
|
|
117
|
+
export declare type SelectProps<T = unknown> = SingleSelectProps<T> | MultipleSelectProps<T>;
|
|
117
118
|
interface AddButton {
|
|
118
119
|
prefix: string | null | undefined;
|
|
119
120
|
label: string;
|
|
@@ -162,8 +163,8 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
162
163
|
maxHeight: number;
|
|
163
164
|
directions: Directions[];
|
|
164
165
|
selected: null;
|
|
165
|
-
label:
|
|
166
|
-
selectedLabel:
|
|
166
|
+
label: null;
|
|
167
|
+
selectedLabel: null;
|
|
167
168
|
inputPlaceholder: string;
|
|
168
169
|
hint: null;
|
|
169
170
|
shortcutsEnabled: boolean;
|
|
@@ -188,9 +189,9 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
188
189
|
static getDerivedStateFromProps<T = unknown>(nextProps: SelectProps<T>, prevState: SelectState<T>): Partial<SelectState<T>>;
|
|
189
190
|
state: SelectState<T>;
|
|
190
191
|
componentDidUpdate(prevProps: SelectProps<T>, prevState: SelectState<T>): void;
|
|
192
|
+
static contextType: React.Context<ControlsHeight>;
|
|
191
193
|
static Type: typeof Type;
|
|
192
194
|
static Size: typeof Size;
|
|
193
|
-
static Theme: typeof Theme;
|
|
194
195
|
id: string;
|
|
195
196
|
shortcutsScope: string;
|
|
196
197
|
listId: string;
|
|
@@ -221,6 +222,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
221
222
|
filterValue(setValue: string): void;
|
|
222
223
|
isInputMode(): boolean;
|
|
223
224
|
_clickHandler: () => void;
|
|
225
|
+
_openPopupIfClosed: () => void;
|
|
224
226
|
_filterChangeHandler: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
225
227
|
private _setFilter;
|
|
226
228
|
private _rebuildMultipleMap;
|
|
@@ -235,8 +237,6 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
235
237
|
_getSelectedString(): string | null;
|
|
236
238
|
private _getIcons;
|
|
237
239
|
private _getAvatar;
|
|
238
|
-
button?: HTMLElement | null;
|
|
239
|
-
buttonRef: (el: HTMLElement | null) => void;
|
|
240
240
|
filter?: HTMLInputElement | null;
|
|
241
241
|
filterRef: (el: HTMLInputElement | null) => void;
|
|
242
242
|
getShortcutsMap(): {
|
|
@@ -258,18 +258,14 @@ export declare type MultipleSelectAttrs<T = unknown> = JSX.LibraryManagedAttribu
|
|
|
258
258
|
export declare type SelectAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof Select, SelectProps<T>>;
|
|
259
259
|
export declare const RerenderableSelect: {
|
|
260
260
|
new (props: SelectProps<unknown>): {
|
|
261
|
-
_propsCache:
|
|
262
|
-
|
|
263
|
-
}>;
|
|
264
|
-
rerender(props?: Partial<SelectProps<unknown>>, callback?: (() => void) | undefined): void | Element | React.Component<SelectProps<unknown>, any, any>;
|
|
261
|
+
_propsCache: SelectProps<unknown> & React.RefAttributes<unknown>;
|
|
262
|
+
rerender(props?: Partial<SelectProps<unknown>>, callback?: (() => void) | undefined): void;
|
|
265
263
|
node?: HTMLElement | null | undefined;
|
|
266
|
-
context:
|
|
264
|
+
context: unknown;
|
|
267
265
|
setState<K extends keyof SelectState<unknown>>(state: SelectState<unknown> | ((prevState: Readonly<SelectState<unknown>>, props: Readonly<SelectProps<unknown>>) => SelectState<unknown> | Pick<SelectState<unknown>, K> | null) | Pick<SelectState<unknown>, K> | null, callback?: (() => void) | undefined): void;
|
|
268
266
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
269
267
|
render(): React.ReactNode;
|
|
270
|
-
readonly props: Readonly<SelectProps<unknown
|
|
271
|
-
children?: React.ReactNode;
|
|
272
|
-
}>;
|
|
268
|
+
readonly props: Readonly<SelectProps<unknown>>;
|
|
273
269
|
state: Readonly<SelectState<unknown>>;
|
|
274
270
|
refs: {
|
|
275
271
|
[key: string]: React.ReactInstance;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Component, Fragment } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import chevronDownIcon from '@jetbrains/icons/chevron-
|
|
5
|
-
import closeIcon from '@jetbrains/icons/close';
|
|
4
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
5
|
+
import closeIcon from '@jetbrains/icons/close-12px';
|
|
6
6
|
import deepEqual from 'deep-equal';
|
|
7
7
|
import { Anchor } from '../dropdown/dropdown';
|
|
8
8
|
import Avatar, { Size as AvatarSize } from '../avatar/avatar';
|
|
@@ -15,9 +15,9 @@ import dataTests from '../global/data-tests';
|
|
|
15
15
|
import getUID from '../global/get-uid';
|
|
16
16
|
import rerenderHOC from '../global/rerender-hoc';
|
|
17
17
|
import fuzzyHighlight from '../global/fuzzy-highlight';
|
|
18
|
-
import Theme from '../global/theme';
|
|
19
18
|
import memoize from '../global/memoize';
|
|
20
19
|
import { isArray } from '../global/typescript-utils';
|
|
20
|
+
import { ControlsHeightContext } from '../global/controls-height';
|
|
21
21
|
import SelectPopup from './select__popup';
|
|
22
22
|
import styles from './select.css';
|
|
23
23
|
/**
|
|
@@ -33,12 +33,12 @@ var Type;
|
|
|
33
33
|
Type["INPUT"] = "INPUT";
|
|
34
34
|
Type["CUSTOM"] = "CUSTOM";
|
|
35
35
|
Type["INLINE"] = "INLINE";
|
|
36
|
-
Type["MATERIAL"] = "MATERIAL";
|
|
37
36
|
Type["INPUT_WITHOUT_CONTROLS"] = "INPUT_WITHOUT_CONTROLS";
|
|
38
37
|
})(Type || (Type = {}));
|
|
38
|
+
const ICONS_OFFSET = 12;
|
|
39
39
|
const ICON_WIDTH = 20;
|
|
40
40
|
const getStyle = memoize((iconsLength) => ({
|
|
41
|
-
paddingRight: iconsLength * ICON_WIDTH
|
|
41
|
+
paddingRight: ICONS_OFFSET + iconsLength * ICON_WIDTH
|
|
42
42
|
}));
|
|
43
43
|
const isInputMode = (type) => type === Type.INPUT || type === Type.INPUT_WITHOUT_CONTROLS;
|
|
44
44
|
function getLowerCaseLabel(item) {
|
|
@@ -75,8 +75,8 @@ function buildMultipleMap(selected) {
|
|
|
75
75
|
}
|
|
76
76
|
function getListItems(props, state, rawFilterString, data = props.data) {
|
|
77
77
|
let filterString = rawFilterString.trim();
|
|
78
|
-
if (isInputMode(props.type) &&
|
|
79
|
-
filterString === state.selected.label) {
|
|
78
|
+
if (isInputMode(props.type) && !props.allowAny && state.selected &&
|
|
79
|
+
!Array.isArray(state.selected) && filterString === state.selected.label) {
|
|
80
80
|
filterString = ''; // ignore multiple if it is exactly the selected item
|
|
81
81
|
}
|
|
82
82
|
const lowerCaseString = filterString.toLowerCase();
|
|
@@ -183,7 +183,7 @@ export default class Select extends Component {
|
|
|
183
183
|
disabled: false,
|
|
184
184
|
loadingMessage: 'Loading...',
|
|
185
185
|
notFoundMessage: 'No options found',
|
|
186
|
-
type: Type.
|
|
186
|
+
type: Type.BUTTON,
|
|
187
187
|
size: Size.M,
|
|
188
188
|
targetElement: null,
|
|
189
189
|
hideSelected: false,
|
|
@@ -197,8 +197,8 @@ export default class Select extends Component {
|
|
|
197
197
|
Popup.PopupProps.Directions.TOP_RIGHT
|
|
198
198
|
],
|
|
199
199
|
selected: null,
|
|
200
|
-
label:
|
|
201
|
-
selectedLabel:
|
|
200
|
+
label: null,
|
|
201
|
+
selectedLabel: null,
|
|
202
202
|
inputPlaceholder: '',
|
|
203
203
|
hint: null,
|
|
204
204
|
shortcutsEnabled: false,
|
|
@@ -253,6 +253,9 @@ export default class Select extends Component {
|
|
|
253
253
|
if (prevMultiple !== multiple && !deepEqual(prevMultiple, multiple)) {
|
|
254
254
|
nextState.selected = multiple ? [] : null;
|
|
255
255
|
}
|
|
256
|
+
if (multiple && !nextState.selected) {
|
|
257
|
+
nextState.selected = prevState.selected;
|
|
258
|
+
}
|
|
256
259
|
const { selected } = { ...prevState, ...nextState };
|
|
257
260
|
if (selected && Array.isArray(selected)) {
|
|
258
261
|
nextState.multipleMap = buildMultipleMap(selected);
|
|
@@ -290,14 +293,14 @@ export default class Select extends Component {
|
|
|
290
293
|
onChange(selected);
|
|
291
294
|
}
|
|
292
295
|
}
|
|
296
|
+
static contextType = ControlsHeightContext;
|
|
293
297
|
static Type = Type;
|
|
294
298
|
static Size = Size;
|
|
295
|
-
static Theme = Theme;
|
|
296
299
|
id = getUID('select-');
|
|
297
300
|
shortcutsScope = this.id;
|
|
298
301
|
listId = `${this.id}:list`;
|
|
299
|
-
_focusHandler = () => {
|
|
300
|
-
this.props.onFocus();
|
|
302
|
+
_focusHandler = (e) => {
|
|
303
|
+
this.props.onFocus(e);
|
|
301
304
|
this.setState({
|
|
302
305
|
shortcutsEnabled: true,
|
|
303
306
|
focused: true
|
|
@@ -441,13 +444,14 @@ export default class Select extends Component {
|
|
|
441
444
|
}
|
|
442
445
|
_hidePopup(tryFocusAnchor) {
|
|
443
446
|
if (this.node && this.state.showPopup) {
|
|
444
|
-
this.setState({
|
|
447
|
+
this.setState(prevState => ({
|
|
445
448
|
showPopup: false,
|
|
446
|
-
filterValue: ''
|
|
447
|
-
});
|
|
449
|
+
filterValue: this.props.allowAny ? prevState.filterValue : ''
|
|
450
|
+
}));
|
|
448
451
|
if (tryFocusAnchor) {
|
|
449
|
-
const
|
|
452
|
+
const focusableSelectExists = this.node &&
|
|
450
453
|
this.node.querySelector('[data-test~=ring-select__focus]');
|
|
454
|
+
const restoreFocusNode = this.props.targetElement || focusableSelectExists;
|
|
451
455
|
if (restoreFocusNode) {
|
|
452
456
|
restoreFocusNode.focus();
|
|
453
457
|
}
|
|
@@ -460,15 +464,16 @@ export default class Select extends Component {
|
|
|
460
464
|
this.props.onAdd(value);
|
|
461
465
|
};
|
|
462
466
|
getToolbar() {
|
|
463
|
-
const { hint } = this.props;
|
|
467
|
+
const { hint, renderBottomToolbar } = this.props;
|
|
464
468
|
const { prefix, label, delayed } = this.state.addButton || {};
|
|
465
|
-
const isToolbarHasElements = this.state.addButton || hint;
|
|
469
|
+
const isToolbarHasElements = this.state.addButton || hint || renderBottomToolbar;
|
|
466
470
|
if (!isToolbarHasElements) {
|
|
467
471
|
return null;
|
|
468
472
|
}
|
|
469
473
|
return (<div className={classNames({
|
|
470
|
-
[styles.toolbar]:
|
|
474
|
+
[styles.toolbar]: Boolean(this.state.addButton || renderBottomToolbar)
|
|
471
475
|
})} data-test="ring-select-toolbar">
|
|
476
|
+
{renderBottomToolbar && renderBottomToolbar()}
|
|
472
477
|
{this.state.addButton && (<Button text delayed={delayed} className={classNames(styles.button, styles.buttonSpaced)} onClick={this.addHandler} data-test="ring-select-toolbar-button">
|
|
473
478
|
{prefix ? `${prefix} ${label}` : label}
|
|
474
479
|
</Button>)}
|
|
@@ -508,6 +513,13 @@ export default class Select extends Component {
|
|
|
508
513
|
}
|
|
509
514
|
}
|
|
510
515
|
};
|
|
516
|
+
_openPopupIfClosed = () => {
|
|
517
|
+
if (this.props.disabled || this.state.showPopup) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
this.props.onBeforeOpen();
|
|
521
|
+
this._showPopup();
|
|
522
|
+
};
|
|
511
523
|
_filterChangeHandler = (e) => {
|
|
512
524
|
this._setFilter(e.currentTarget.value, e);
|
|
513
525
|
};
|
|
@@ -703,9 +715,7 @@ export default class Select extends Component {
|
|
|
703
715
|
!this.state.selected;
|
|
704
716
|
}
|
|
705
717
|
_getLabel() {
|
|
706
|
-
return this.props.label
|
|
707
|
-
(typeof this.props.selectedLabel === 'string' ? this.props.selectedLabel : null) ||
|
|
708
|
-
'Select an option';
|
|
718
|
+
return this.props.label ?? this.props.selectedLabel ?? 'Select an option';
|
|
709
719
|
}
|
|
710
720
|
_getSelectedString() {
|
|
711
721
|
if (Array.isArray(this.state.selected)) {
|
|
@@ -738,10 +748,6 @@ export default class Select extends Component {
|
|
|
738
748
|
return !Array.isArray(this.state.selected) &&
|
|
739
749
|
(this.state.selected?.avatar || this.state.selected?.showGeneratedAvatar) && (<Avatar className={styles.avatar} url={this.state.selected.avatar} username={this.state.selected.username} size={AvatarSize.Size20}/>);
|
|
740
750
|
}
|
|
741
|
-
button;
|
|
742
|
-
buttonRef = (el) => {
|
|
743
|
-
this.button = el;
|
|
744
|
-
};
|
|
745
751
|
filter;
|
|
746
752
|
filterRef = (el) => {
|
|
747
753
|
this.filter = el;
|
|
@@ -762,7 +768,7 @@ export default class Select extends Component {
|
|
|
762
768
|
renderSelect(activeItemId) {
|
|
763
769
|
const dataTest = this.props['data-test'];
|
|
764
770
|
const { shortcutsEnabled } = this.state;
|
|
765
|
-
const classes = classNames(styles.select, 'ring-js-shortcuts', this.props.className, {
|
|
771
|
+
const classes = classNames(styles.select, 'ring-js-shortcuts', this.props.className, styles[`height${this.props.height || this.context}`], {
|
|
766
772
|
[styles[`size${this.props.size}`]]: this.props.type !== Type.INLINE,
|
|
767
773
|
[styles.disabled]: this.props.disabled
|
|
768
774
|
});
|
|
@@ -779,20 +785,19 @@ export default class Select extends Component {
|
|
|
779
785
|
case Type.INPUT_WITHOUT_CONTROLS:
|
|
780
786
|
case Type.INPUT: return (<div ref={this.nodeRef} className={classNames(classes, styles.inputMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
781
787
|
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
782
|
-
<Input {...ariaProps} autoComplete="off" id={this.props.id} onClick={this._clickHandler} inputRef={this.filterRef} disabled={this.props.disabled} value={this.state.filterValue} borderless={this.props.type === Type.INPUT_WITHOUT_CONTROLS} style={style} size={Size.FULL} onChange={this._filterChangeHandler} onFocus={this._focusHandler} onBlur={this._blurHandler} label={this.props.type === Type.INPUT ? this._getLabel() : null} placeholder={this.props.inputPlaceholder} onKeyDown={this.props.onKeyDown} data-test="ring-select__focus" enableShortcuts={shortcutsEnabled
|
|
788
|
+
<Input {...ariaProps} height={this.props.height} autoComplete="off" id={this.props.id} onClick={this._clickHandler} inputRef={this.filterRef} disabled={this.props.disabled} value={this.state.filterValue} borderless={this.props.type === Type.INPUT_WITHOUT_CONTROLS} style={style} size={Size.FULL} onChange={this._filterChangeHandler} onFocus={this._focusHandler} onBlur={this._blurHandler} label={this.props.type === Type.INPUT ? this._getLabel() : null} placeholder={this.props.inputPlaceholder} onKeyDown={this.props.onKeyDown} data-test="ring-select__focus" enableShortcuts={shortcutsEnabled
|
|
783
789
|
? Object.keys({
|
|
784
790
|
...this.getShortcutsMap(),
|
|
785
791
|
...this._popup?.list?.shortcutsMap
|
|
786
792
|
})
|
|
787
|
-
: undefined}/>
|
|
788
|
-
{this.props.type === Type.INPUT && iconsNode}
|
|
793
|
+
: undefined} afterInput={this.props.type === Type.INPUT && iconsNode}/>
|
|
789
794
|
{this._renderPopup()}
|
|
790
795
|
</div>);
|
|
791
796
|
case Type.BUTTON:
|
|
792
797
|
return (<div ref={this.nodeRef} className={classNames(classes, styles.buttonMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
793
798
|
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
794
799
|
<div className={styles.buttonContainer}>
|
|
795
|
-
<Button {...ariaProps} id={this.props.id} onClick={this._clickHandler} className={classNames(this.props.buttonClassName, styles.buttonValue, {
|
|
800
|
+
<Button {...ariaProps} height={this.props.height} id={this.props.id} onClick={this._clickHandler} className={classNames(this.props.buttonClassName, styles.buttonValue, {
|
|
796
801
|
[styles.buttonValueOpen]: this.state.showPopup
|
|
797
802
|
})} disabled={this.props.disabled} style={style} data-test="ring-select__button ring-select__focus">
|
|
798
803
|
{this._getAvatar()}
|
|
@@ -801,20 +806,6 @@ export default class Select extends Component {
|
|
|
801
806
|
{iconsNode}
|
|
802
807
|
</div>
|
|
803
808
|
{this._renderPopup()}
|
|
804
|
-
</div>);
|
|
805
|
-
case Type.MATERIAL:
|
|
806
|
-
return (<div ref={this.nodeRef} className={classNames(classes, styles.materialMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
807
|
-
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
808
|
-
{!this._selectionIsEmpty() && this.props.selectedLabel && (<span className={styles.selectedLabel}>{this.props.selectedLabel}</span>)}
|
|
809
|
-
<button {...ariaProps} id={this.props.id} onClick={this._clickHandler} type="button" disabled={this.props.disabled} className={classNames(this.props.buttonClassName, styles.value, {
|
|
810
|
-
[styles.open]: this.state.showPopup,
|
|
811
|
-
[styles.label]: this._selectionIsEmpty()
|
|
812
|
-
})} aria-label={this._getLabel()} style={style} data-test="ring-select__focus" ref={this.buttonRef}>
|
|
813
|
-
{this._getAvatar()}
|
|
814
|
-
{this._selectionIsEmpty() ? this._getLabel() : this._getSelectedString()}
|
|
815
|
-
</button>
|
|
816
|
-
{iconsNode}
|
|
817
|
-
{this._renderPopup()}
|
|
818
809
|
</div>);
|
|
819
810
|
case Type.INLINE:
|
|
820
811
|
return (<div className={classes} ref={this.nodeRef} data-test={dataTests('ring-select', dataTest)}>
|
|
@@ -912,7 +903,6 @@ Select.propTypes = {
|
|
|
912
903
|
hideArrow: PropTypes.bool,
|
|
913
904
|
compact: PropTypes.bool,
|
|
914
905
|
size: PropTypes.oneOf(Object.values(Size)),
|
|
915
|
-
theme: PropTypes.string,
|
|
916
906
|
customAnchor: PropTypes.func,
|
|
917
907
|
disableMoveOverflow: PropTypes.bool,
|
|
918
908
|
disableScrollToActive: PropTypes.bool,
|
|
@@ -4,6 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import Input from '../input/input';
|
|
5
5
|
import sniffr from '../global/sniffer';
|
|
6
6
|
import { ActiveItemContext } from '../list/list';
|
|
7
|
+
import { ControlsHeight } from '../global/controls-height';
|
|
7
8
|
import styles from './select-popup.css';
|
|
8
9
|
function noop() { }
|
|
9
10
|
export default class SelectFilter extends Component {
|
|
@@ -34,7 +35,7 @@ export default class SelectFilter extends Component {
|
|
|
34
35
|
const { className, listId, ...restProps } = this.props;
|
|
35
36
|
const classes = classNames(styles.filter, className);
|
|
36
37
|
return (<ActiveItemContext.ValueContext.Consumer>
|
|
37
|
-
{activeItemId => (<Input {...restProps} aria-owns={listId} aria-activedescendant={activeItemId} autoComplete="off" autoFocus borderless inputRef={this.inputRef} className={classes}/>)}
|
|
38
|
+
{activeItemId => (<Input {...restProps} aria-owns={listId} aria-activedescendant={activeItemId} autoComplete="off" autoFocus borderless height={ControlsHeight.L} inputRef={this.inputRef} className={classes}/>)}
|
|
38
39
|
</ActiveItemContext.ValueContext.Consumer>);
|
|
39
40
|
}
|
|
40
41
|
}
|