@jetbrains/ring-ui 5.1.1 → 6.0.1-beta.0
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.examples.js +2 -2
- package/components/button-ng/button-ng.js +1 -1
- 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 +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.examples.js +1 -1
- package/components/dialog-ng/dialog-ng.js +4 -5
- 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 +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.examples.js +3 -1
- package/components/input-ng/input-ng.js +3 -2
- package/components/input-size/input-size.examples.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 +20 -9
- package/components/select/select.js +47 -23
- 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/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/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 +9 -4
- package/components/tags-input/tags-input.js +7 -7
- 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 +20 -9
- package/dist/select/select.js +831 -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 +161 -95
- 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 +9 -4
- package/dist/tags-input/tags-input.js +327 -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 +86 -82
- package/components/input/input-label.d.ts +0 -10
- package/components/input/input-label.js +0 -18
- package/dist/input/input-label.d.ts +0 -10
- package/dist/input/input-label.js +0 -27
package/dist/list/list.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, e as _objectWithoutProperties, d as _createClass, g as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import 'core-js/modules/es.array.includes.js';
|
|
3
|
+
import 'core-js/modules/es.string.includes.js';
|
|
4
|
+
import 'core-js/modules/es.array.map.js';
|
|
5
|
+
import 'core-js/modules/es.array.concat.js';
|
|
6
|
+
import 'core-js/modules/es.symbol.js';
|
|
7
|
+
import 'core-js/modules/es.symbol.description.js';
|
|
8
|
+
import 'core-js/modules/es.object.to-string.js';
|
|
9
|
+
import 'core-js/modules/es.array.find-index.js';
|
|
10
|
+
import 'core-js/modules/es.object.assign.js';
|
|
11
|
+
import 'core-js/modules/es.object.keys.js';
|
|
12
|
+
import 'core-js/modules/es.array.find.js';
|
|
13
|
+
import React, { cloneElement, Component } from 'react';
|
|
3
14
|
import PropTypes from 'prop-types';
|
|
4
15
|
import classNames from 'classnames';
|
|
5
16
|
import VirtualizedList from 'react-virtualized/dist/es/List';
|
|
@@ -23,17 +34,36 @@ import ListSeparator from './list__separator.js';
|
|
|
23
34
|
import ListHint from './list__hint.js';
|
|
24
35
|
import { Type, Dimension, DEFAULT_ITEM_TYPE } from './consts.js';
|
|
25
36
|
import { m as modules_3b67a421 } from '../_helpers/list.js';
|
|
37
|
+
import 'core-js/modules/es.array.reduce.js';
|
|
38
|
+
import 'core-js/modules/es.object.entries.js';
|
|
39
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
|
40
|
+
import 'core-js/modules/es.array.iterator.js';
|
|
41
|
+
import 'core-js/modules/es.map.js';
|
|
42
|
+
import 'core-js/modules/es.string.iterator.js';
|
|
43
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
44
|
+
import 'core-js/modules/es.weak-map.js';
|
|
45
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
46
|
+
import 'core-js/modules/es.array.filter.js';
|
|
47
|
+
import 'core-js/modules/es.regexp.exec.js';
|
|
48
|
+
import 'core-js/modules/es.string.split.js';
|
|
49
|
+
import 'core-js/modules/es.set.js';
|
|
26
50
|
import '../shortcuts/core.js';
|
|
51
|
+
import 'core-js/modules/es.array.slice.js';
|
|
52
|
+
import 'core-js/modules/es.array.splice.js';
|
|
53
|
+
import 'core-js/modules/es.string.match.js';
|
|
27
54
|
import 'combokeys';
|
|
28
55
|
import '../global/sniffer.js';
|
|
29
56
|
import 'sniffr';
|
|
30
57
|
import '../link/link.js';
|
|
31
|
-
import 'focus-visible';
|
|
32
58
|
import '../link/clickableLink.js';
|
|
33
59
|
import '../_helpers/link.js';
|
|
60
|
+
import 'core-js/modules/es.number.constructor.js';
|
|
61
|
+
import 'core-js/modules/es.array.index-of.js';
|
|
34
62
|
import '../avatar/avatar.js';
|
|
35
63
|
import '../global/url.js';
|
|
64
|
+
import 'core-js/modules/es.string.replace.js';
|
|
36
65
|
import '../avatar/fallback-avatar.js';
|
|
66
|
+
import 'core-js/modules/es.array.from.js';
|
|
37
67
|
import '../checkbox/checkbox.js';
|
|
38
68
|
import '@jetbrains/icons/checkmark-14px';
|
|
39
69
|
import '@jetbrains/icons/remove-14px';
|
|
@@ -41,30 +71,39 @@ import '../icon/icon.js';
|
|
|
41
71
|
import '../icon/icon__constants.js';
|
|
42
72
|
import '../_helpers/icon.js';
|
|
43
73
|
import '../icon/icon__svg.js';
|
|
74
|
+
import 'core-js/modules/es.string.starts-with.js';
|
|
44
75
|
import '../global/prop-types.js';
|
|
45
76
|
import '../global/composeRefs.js';
|
|
46
77
|
import '../_helpers/checkbox.js';
|
|
47
78
|
import '../global/get-event-key.js';
|
|
48
79
|
|
|
80
|
+
var _excluded = ["selectedLabel", "originalModel"];
|
|
49
81
|
function noop() {}
|
|
50
|
-
|
|
82
|
+
var warnEmptyKey = deprecate(function () {}, 'No key passed for list item with non-string label. It is considered as a bad practice and has been deprecated, please provide a key.');
|
|
51
83
|
/**
|
|
52
84
|
* @param {Type} listItemType
|
|
53
85
|
* @param {Object} item list item
|
|
54
86
|
*/
|
|
55
87
|
function isItemType(listItemType, item) {
|
|
56
|
-
|
|
88
|
+
var type = item.rgItemType;
|
|
57
89
|
if (type == null) {
|
|
58
90
|
type = DEFAULT_ITEM_TYPE;
|
|
59
91
|
}
|
|
60
92
|
return type === listItemType;
|
|
61
93
|
}
|
|
62
|
-
|
|
94
|
+
var nonActivatableTypes = [Type.SEPARATOR, Type.TITLE, Type.MARGIN];
|
|
63
95
|
function isActivatable(item) {
|
|
64
96
|
return item != null && !nonActivatableTypes.includes(item.rgItemType) && !item.disabled;
|
|
65
97
|
}
|
|
66
|
-
|
|
67
|
-
|
|
98
|
+
function getDataHash(data) {
|
|
99
|
+
return data.map(function (it) {
|
|
100
|
+
return "".concat(it.key, "-").concat(it.disabled);
|
|
101
|
+
}).join('-');
|
|
102
|
+
}
|
|
103
|
+
var shouldActivateFirstItem = function shouldActivateFirstItem(props) {
|
|
104
|
+
return props.activateFirstItem || props.activateSingleItem && props.data.length === 1;
|
|
105
|
+
};
|
|
106
|
+
var ActiveItemContext = createStatefulContext(undefined, 'ActiveItem');
|
|
68
107
|
/**
|
|
69
108
|
* @name List
|
|
70
109
|
* @constructor
|
|
@@ -73,12 +112,17 @@ const ActiveItemContext = createStatefulContext(undefined, 'ActiveItem');
|
|
|
73
112
|
/**
|
|
74
113
|
* Displays a list of items.
|
|
75
114
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
115
|
+
var List = /*#__PURE__*/function (_Component) {
|
|
116
|
+
_inherits(List, _Component);
|
|
117
|
+
var _super = _createSuper(List);
|
|
118
|
+
function List() {
|
|
78
119
|
var _this;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
120
|
+
_classCallCheck(this, List);
|
|
121
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
122
|
+
args[_key] = arguments[_key];
|
|
123
|
+
}
|
|
124
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
125
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
82
126
|
activeIndex: null,
|
|
83
127
|
prevActiveIndex: null,
|
|
84
128
|
prevData: [],
|
|
@@ -89,86 +133,100 @@ class List extends Component {
|
|
|
89
133
|
disabledHover: false,
|
|
90
134
|
scrolledToBottom: false
|
|
91
135
|
});
|
|
92
|
-
_defineProperty(
|
|
93
|
-
_defineProperty(
|
|
94
|
-
_defineProperty(
|
|
95
|
-
_defineProperty(
|
|
96
|
-
_defineProperty(
|
|
97
|
-
_defineProperty(
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleScrollListener", scheduleRAF());
|
|
137
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleHoverListener", scheduleRAF());
|
|
138
|
+
_defineProperty(_assertThisInitialized(_this), "virtualizedList", void 0);
|
|
139
|
+
_defineProperty(_assertThisInitialized(_this), "unmounted", void 0);
|
|
140
|
+
_defineProperty(_assertThisInitialized(_this), "container", void 0);
|
|
141
|
+
_defineProperty(_assertThisInitialized(_this), "hoverHandler", memoize(function (index) {
|
|
142
|
+
return function () {
|
|
143
|
+
return _this.scheduleHoverListener(function () {
|
|
144
|
+
if (_this.state.disabledHover) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (_this.container) {
|
|
148
|
+
_this.setState({
|
|
149
|
+
activeIndex: index,
|
|
150
|
+
activeItem: _this.props.data[index],
|
|
151
|
+
needScrollToActive: false
|
|
152
|
+
});
|
|
153
|
+
}
|
|
106
154
|
});
|
|
107
|
-
}
|
|
108
|
-
}))
|
|
109
|
-
_defineProperty(
|
|
110
|
-
|
|
111
|
-
_defineProperty(
|
|
112
|
-
|
|
155
|
+
};
|
|
156
|
+
}));
|
|
157
|
+
_defineProperty(_assertThisInitialized(_this), "_activatableItems", false);
|
|
158
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
159
|
+
_defineProperty(_assertThisInitialized(_this), "_bufferSize", 10);
|
|
160
|
+
// keep X items above and below of the visible area
|
|
161
|
+
// reuse size cache for similar items
|
|
162
|
+
_defineProperty(_assertThisInitialized(_this), "sizeCacheKey", function (index) {
|
|
163
|
+
if (index === 0 || index === _this.props.data.length + 1) {
|
|
113
164
|
return Type.MARGIN;
|
|
114
165
|
}
|
|
115
|
-
|
|
116
|
-
|
|
166
|
+
var item = _this.props.data[index - 1];
|
|
167
|
+
var isFirst = index === 1;
|
|
117
168
|
switch (item.rgItemType) {
|
|
118
169
|
case Type.SEPARATOR:
|
|
119
170
|
case Type.TITLE:
|
|
120
|
-
return
|
|
171
|
+
return "".concat(item.rgItemType).concat(isFirst ? '_first' : '').concat(item.description ? '_desc' : '');
|
|
121
172
|
case Type.MARGIN:
|
|
122
173
|
return Type.MARGIN;
|
|
123
174
|
case Type.CUSTOM:
|
|
124
|
-
return
|
|
175
|
+
return "".concat(Type.CUSTOM, "_").concat(item.key);
|
|
125
176
|
case Type.ITEM:
|
|
126
177
|
case Type.LINK:
|
|
127
178
|
default:
|
|
128
179
|
if (item.details) {
|
|
129
|
-
return
|
|
180
|
+
return "".concat(Type.ITEM, "_").concat(item.details);
|
|
130
181
|
}
|
|
131
182
|
return Type.ITEM;
|
|
132
183
|
}
|
|
133
184
|
});
|
|
134
|
-
_defineProperty(
|
|
135
|
-
defaultHeight:
|
|
185
|
+
_defineProperty(_assertThisInitialized(_this), "_cache", new CellMeasurerCache({
|
|
186
|
+
defaultHeight: _this.defaultItemHeight(),
|
|
136
187
|
fixedWidth: true,
|
|
137
|
-
keyMapper:
|
|
188
|
+
keyMapper: _this.sizeCacheKey
|
|
189
|
+
}));
|
|
190
|
+
_defineProperty(_assertThisInitialized(_this), "_hasActivatableItems", memoizeOne(function (items) {
|
|
191
|
+
return items.some(isActivatable);
|
|
138
192
|
}));
|
|
139
|
-
_defineProperty(
|
|
140
|
-
|
|
141
|
-
const firstActivatableIndex = this.props.data.findIndex(isActivatable);
|
|
193
|
+
_defineProperty(_assertThisInitialized(_this), "activateFirst", function () {
|
|
194
|
+
var firstActivatableIndex = _this.props.data.findIndex(isActivatable);
|
|
142
195
|
if (firstActivatableIndex >= 0) {
|
|
143
|
-
|
|
196
|
+
_this.setState({
|
|
144
197
|
activeIndex: firstActivatableIndex,
|
|
145
|
-
activeItem:
|
|
198
|
+
activeItem: _this.props.data[firstActivatableIndex],
|
|
146
199
|
needScrollToActive: true
|
|
147
200
|
});
|
|
148
201
|
}
|
|
149
202
|
});
|
|
150
|
-
_defineProperty(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
item.onClick
|
|
155
|
-
|
|
156
|
-
item.onMouseUp
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
_this.props.onSelect
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
203
|
+
_defineProperty(_assertThisInitialized(_this), "selectHandler", memoize(function (index) {
|
|
204
|
+
return function (event) {
|
|
205
|
+
var tryKeepOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
206
|
+
var item = _this.props.data[index];
|
|
207
|
+
if (!_this.props.useMouseUp && item.onClick) {
|
|
208
|
+
item.onClick(item, event);
|
|
209
|
+
} else if (_this.props.useMouseUp && item.onMouseUp) {
|
|
210
|
+
item.onMouseUp(item, event);
|
|
211
|
+
}
|
|
212
|
+
if (_this.props.onSelect) {
|
|
213
|
+
_this.props.onSelect(item, event, {
|
|
214
|
+
tryKeepOpen: tryKeepOpen
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
};
|
|
163
218
|
}));
|
|
164
|
-
_defineProperty(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
219
|
+
_defineProperty(_assertThisInitialized(_this), "checkboxHandler", memoize(function (index) {
|
|
220
|
+
return function (event) {
|
|
221
|
+
return _this.selectHandler(index)(event, true);
|
|
222
|
+
};
|
|
223
|
+
}));
|
|
224
|
+
_defineProperty(_assertThisInitialized(_this), "upHandler", function (e) {
|
|
225
|
+
var _this$props = _this.props,
|
|
226
|
+
data = _this$props.data,
|
|
227
|
+
disableMoveOverflow = _this$props.disableMoveOverflow;
|
|
228
|
+
var index = _this.state.activeIndex;
|
|
229
|
+
var newIndex;
|
|
172
230
|
if (index === null || index === 0) {
|
|
173
231
|
if (!disableMoveOverflow) {
|
|
174
232
|
newIndex = data.length - 1;
|
|
@@ -178,16 +236,15 @@ class List extends Component {
|
|
|
178
236
|
} else {
|
|
179
237
|
newIndex = index - 1;
|
|
180
238
|
}
|
|
181
|
-
|
|
239
|
+
_this.moveHandler(newIndex, _this.upHandler, e);
|
|
182
240
|
});
|
|
183
|
-
_defineProperty(
|
|
184
|
-
|
|
185
|
-
data,
|
|
186
|
-
disableMoveOverflow,
|
|
187
|
-
disableMoveDownOverflow
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
let newIndex;
|
|
241
|
+
_defineProperty(_assertThisInitialized(_this), "downHandler", function (e) {
|
|
242
|
+
var _this$props2 = _this.props,
|
|
243
|
+
data = _this$props2.data,
|
|
244
|
+
disableMoveOverflow = _this$props2.disableMoveOverflow,
|
|
245
|
+
disableMoveDownOverflow = _this$props2.disableMoveDownOverflow;
|
|
246
|
+
var index = _this.state.activeIndex;
|
|
247
|
+
var newIndex;
|
|
191
248
|
if (index === null) {
|
|
192
249
|
newIndex = 0;
|
|
193
250
|
} else if (index + 1 === data.length) {
|
|
@@ -199,43 +256,43 @@ class List extends Component {
|
|
|
199
256
|
} else {
|
|
200
257
|
newIndex = index + 1;
|
|
201
258
|
}
|
|
202
|
-
|
|
259
|
+
_this.moveHandler(newIndex, _this.downHandler, e);
|
|
203
260
|
});
|
|
204
|
-
_defineProperty(
|
|
205
|
-
|
|
261
|
+
_defineProperty(_assertThisInitialized(_this), "homeHandler", function (e) {
|
|
262
|
+
_this.moveHandler(0, _this.downHandler, e);
|
|
206
263
|
});
|
|
207
|
-
_defineProperty(
|
|
208
|
-
|
|
264
|
+
_defineProperty(_assertThisInitialized(_this), "endHandler", function (e) {
|
|
265
|
+
_this.moveHandler(_this.props.data.length - 1, _this.upHandler, e);
|
|
209
266
|
});
|
|
210
|
-
_defineProperty(
|
|
211
|
-
if (
|
|
212
|
-
|
|
267
|
+
_defineProperty(_assertThisInitialized(_this), "onDocumentMouseMove", function () {
|
|
268
|
+
if (_this.state.disabledHover) {
|
|
269
|
+
_this.setState({
|
|
213
270
|
disabledHover: false
|
|
214
271
|
});
|
|
215
272
|
}
|
|
216
273
|
});
|
|
217
|
-
_defineProperty(
|
|
218
|
-
|
|
219
|
-
if (!
|
|
220
|
-
|
|
274
|
+
_defineProperty(_assertThisInitialized(_this), "onDocumentKeyDown", function (e) {
|
|
275
|
+
var metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
276
|
+
if (!_this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
277
|
+
_this.setState({
|
|
221
278
|
disabledHover: true
|
|
222
279
|
});
|
|
223
280
|
}
|
|
224
281
|
});
|
|
225
|
-
_defineProperty(
|
|
226
|
-
|
|
282
|
+
_defineProperty(_assertThisInitialized(_this), "mouseHandler", function () {
|
|
283
|
+
_this.setState({
|
|
227
284
|
scrolling: false
|
|
228
285
|
});
|
|
229
286
|
});
|
|
230
|
-
_defineProperty(
|
|
231
|
-
|
|
287
|
+
_defineProperty(_assertThisInitialized(_this), "scrollHandler", function () {
|
|
288
|
+
_this.setState({
|
|
232
289
|
scrolling: true
|
|
233
|
-
},
|
|
290
|
+
}, _this.scrollEndHandler);
|
|
234
291
|
});
|
|
235
|
-
_defineProperty(
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
|
|
292
|
+
_defineProperty(_assertThisInitialized(_this), "enterHandler", function (event, shortcut) {
|
|
293
|
+
if (_this.state.activeIndex !== null) {
|
|
294
|
+
var item = _this.props.data[_this.state.activeIndex];
|
|
295
|
+
_this.selectHandler(_this.state.activeIndex)(event);
|
|
239
296
|
if (item.href && !event.defaultPrevented) {
|
|
240
297
|
if (shortcut != null && ['command+enter', 'ctrl+enter'].includes(shortcut)) {
|
|
241
298
|
window.open(item.href, '_blank');
|
|
@@ -250,52 +307,54 @@ class List extends Component {
|
|
|
250
307
|
return true; // propagate event to the parent component (e.g., QueryAssist)
|
|
251
308
|
}
|
|
252
309
|
});
|
|
253
|
-
_defineProperty(
|
|
254
|
-
|
|
310
|
+
_defineProperty(_assertThisInitialized(_this), "clearSelected", function () {
|
|
311
|
+
_this.setState({
|
|
255
312
|
activeIndex: null,
|
|
256
313
|
needScrollToActive: false
|
|
257
314
|
});
|
|
258
315
|
});
|
|
259
|
-
_defineProperty(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
316
|
+
_defineProperty(_assertThisInitialized(_this), "scrollEndHandler", function () {
|
|
317
|
+
return _this.scheduleScrollListener(function () {
|
|
318
|
+
var innerContainer = _this.inner;
|
|
319
|
+
if (innerContainer) {
|
|
320
|
+
var maxScrollingPosition = innerContainer.scrollHeight;
|
|
321
|
+
var sensitivity = _this.defaultItemHeight() / 2;
|
|
322
|
+
var currentScrollingPosition = innerContainer.scrollTop + innerContainer.clientHeight + sensitivity;
|
|
323
|
+
var scrolledToBottom = maxScrollingPosition > 0 && currentScrollingPosition >= maxScrollingPosition;
|
|
324
|
+
if (!_this.unmounted) {
|
|
325
|
+
_this.setState({
|
|
326
|
+
scrolledToBottom: scrolledToBottom
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (scrolledToBottom) {
|
|
330
|
+
_this.props.onScrollToBottom();
|
|
331
|
+
}
|
|
273
332
|
}
|
|
274
|
-
}
|
|
275
|
-
})
|
|
276
|
-
_defineProperty(
|
|
277
|
-
if (
|
|
278
|
-
|
|
279
|
-
hasOverflow:
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
_defineProperty(_assertThisInitialized(_this), "checkOverflow", function () {
|
|
336
|
+
if (_this.inner) {
|
|
337
|
+
_this.setState({
|
|
338
|
+
hasOverflow: _this.inner.scrollHeight - _this.inner.clientHeight > 1
|
|
280
339
|
});
|
|
281
340
|
}
|
|
282
341
|
});
|
|
283
|
-
_defineProperty(
|
|
284
|
-
|
|
285
|
-
index = 1,
|
|
286
|
-
style,
|
|
287
|
-
isScrolling =
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
342
|
+
_defineProperty(_assertThisInitialized(_this), "renderItem", function (_ref) {
|
|
343
|
+
var _ref$index = _ref.index,
|
|
344
|
+
index = _ref$index === void 0 ? 1 : _ref$index,
|
|
345
|
+
style = _ref.style,
|
|
346
|
+
_ref$isScrolling = _ref.isScrolling,
|
|
347
|
+
isScrolling = _ref$isScrolling === void 0 ? false : _ref$isScrolling,
|
|
348
|
+
parent = _ref.parent,
|
|
349
|
+
key = _ref.key;
|
|
350
|
+
var itemKey;
|
|
351
|
+
var el;
|
|
352
|
+
var realIndex = index - 1;
|
|
353
|
+
var item = _this.props.data[realIndex];
|
|
354
|
+
var itemId = _this.getId(item);
|
|
296
355
|
// top and bottom margins
|
|
297
|
-
if (index === 0 || index ===
|
|
298
|
-
itemKey = key ||
|
|
356
|
+
if (index === 0 || index === _this.props.data.length + 1 || item.rgItemType === Type.MARGIN) {
|
|
357
|
+
itemKey = key || "".concat(Type.MARGIN, "_").concat(index);
|
|
299
358
|
el = /*#__PURE__*/React.createElement("div", {
|
|
300
359
|
style: {
|
|
301
360
|
height: Dimension.MARGIN
|
|
@@ -303,41 +362,39 @@ class List extends Component {
|
|
|
303
362
|
});
|
|
304
363
|
} else {
|
|
305
364
|
// Hack around SelectNG implementation
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
} = item;
|
|
311
|
-
const cleanedProps = restProps;
|
|
365
|
+
item.selectedLabel;
|
|
366
|
+
item.originalModel;
|
|
367
|
+
var restProps = _objectWithoutProperties(item, _excluded);
|
|
368
|
+
var cleanedProps = restProps;
|
|
312
369
|
if (cleanedProps.url) {
|
|
313
370
|
cleanedProps.href = cleanedProps.url;
|
|
314
371
|
}
|
|
315
372
|
if (cleanedProps.href) {
|
|
316
373
|
cleanedProps.rgItemType = Type.LINK;
|
|
317
374
|
}
|
|
318
|
-
|
|
375
|
+
var itemProps = Object.assign({
|
|
319
376
|
rgItemType: DEFAULT_ITEM_TYPE
|
|
320
377
|
}, restProps);
|
|
321
378
|
itemKey = key || itemId;
|
|
322
|
-
itemProps.hover = realIndex ===
|
|
379
|
+
itemProps.hover = realIndex === _this.state.activeIndex;
|
|
323
380
|
if (itemProps.hoverClassName != null && itemProps.hover) {
|
|
324
381
|
itemProps.className = classNames(itemProps.className, itemProps.hoverClassName);
|
|
325
382
|
}
|
|
326
|
-
itemProps.onMouseOver =
|
|
383
|
+
itemProps.onMouseOver = _this.hoverHandler(realIndex);
|
|
327
384
|
itemProps.tabIndex = -1;
|
|
328
385
|
itemProps.scrolling = isScrolling;
|
|
329
|
-
|
|
330
|
-
if (
|
|
386
|
+
var selectHandler = _this.selectHandler(realIndex);
|
|
387
|
+
if (_this.props.useMouseUp) {
|
|
331
388
|
itemProps.onMouseUp = selectHandler;
|
|
332
389
|
} else {
|
|
333
390
|
itemProps.onClick = selectHandler;
|
|
334
391
|
}
|
|
335
|
-
itemProps.onCheckboxChange =
|
|
392
|
+
itemProps.onCheckboxChange = _this.checkboxHandler(realIndex);
|
|
336
393
|
if (itemProps.compact == null) {
|
|
337
|
-
itemProps.compact =
|
|
394
|
+
itemProps.compact = _this.props.compact;
|
|
338
395
|
}
|
|
339
|
-
|
|
340
|
-
|
|
396
|
+
var ItemComponent;
|
|
397
|
+
var isFirst = index === 1;
|
|
341
398
|
switch (itemProps.rgItemType) {
|
|
342
399
|
case Type.SEPARATOR:
|
|
343
400
|
ItemComponent = ListSeparator;
|
|
@@ -345,35 +402,33 @@ class List extends Component {
|
|
|
345
402
|
break;
|
|
346
403
|
case Type.LINK:
|
|
347
404
|
ItemComponent = ListLink;
|
|
348
|
-
|
|
405
|
+
_this.addItemDataTestToProp(itemProps);
|
|
349
406
|
break;
|
|
350
407
|
case Type.ITEM:
|
|
351
408
|
ItemComponent = ListItem;
|
|
352
|
-
|
|
409
|
+
_this.addItemDataTestToProp(itemProps);
|
|
353
410
|
break;
|
|
354
411
|
case Type.CUSTOM:
|
|
355
412
|
ItemComponent = ListCustom;
|
|
356
|
-
|
|
413
|
+
_this.addItemDataTestToProp(itemProps);
|
|
357
414
|
break;
|
|
358
415
|
case Type.TITLE:
|
|
359
416
|
itemProps.isFirst = isFirst;
|
|
360
417
|
ItemComponent = ListTitle;
|
|
361
418
|
break;
|
|
362
419
|
default:
|
|
363
|
-
throw new Error(
|
|
420
|
+
throw new Error("Unknown menu element type: ".concat(itemProps.rgItemType));
|
|
364
421
|
}
|
|
365
422
|
el = /*#__PURE__*/React.createElement(ItemComponent, itemProps);
|
|
366
423
|
}
|
|
367
424
|
return parent ? /*#__PURE__*/React.createElement(CellMeasurer, {
|
|
368
|
-
cache:
|
|
425
|
+
cache: _this._cache,
|
|
369
426
|
key: itemKey,
|
|
370
427
|
parent: parent,
|
|
371
428
|
rowIndex: index,
|
|
372
429
|
columnIndex: 0
|
|
373
|
-
}, _ref2
|
|
374
|
-
|
|
375
|
-
registerChild
|
|
376
|
-
} = _ref2;
|
|
430
|
+
}, function (_ref2) {
|
|
431
|
+
var registerChild = _ref2.registerChild;
|
|
377
432
|
return /*#__PURE__*/React.createElement("div", {
|
|
378
433
|
ref: registerChild,
|
|
379
434
|
style: style,
|
|
@@ -390,273 +445,315 @@ class List extends Component {
|
|
|
390
445
|
role: "cell"
|
|
391
446
|
}, /*#__PURE__*/cloneElement(el)));
|
|
392
447
|
});
|
|
393
|
-
_defineProperty(
|
|
448
|
+
_defineProperty(_assertThisInitialized(_this), "addItemDataTestToProp", function (props) {
|
|
394
449
|
props['data-test'] = joinDataTestAttributes('ring-list-item', props['data-test']);
|
|
395
450
|
return props;
|
|
396
451
|
});
|
|
397
|
-
_defineProperty(
|
|
398
|
-
|
|
452
|
+
_defineProperty(_assertThisInitialized(_this), "virtualizedListRef", function (el) {
|
|
453
|
+
_this.virtualizedList = el;
|
|
399
454
|
});
|
|
400
|
-
_defineProperty(
|
|
401
|
-
|
|
455
|
+
_defineProperty(_assertThisInitialized(_this), "containerRef", function (el) {
|
|
456
|
+
_this.container = el;
|
|
402
457
|
});
|
|
403
|
-
_defineProperty(
|
|
404
|
-
_defineProperty(
|
|
405
|
-
_defineProperty(
|
|
406
|
-
_defineProperty(
|
|
407
|
-
up:
|
|
408
|
-
down:
|
|
409
|
-
home:
|
|
410
|
-
end:
|
|
411
|
-
enter:
|
|
412
|
-
'meta+enter':
|
|
413
|
-
'ctrl+enter':
|
|
414
|
-
'command+enter':
|
|
415
|
-
'shift+enter':
|
|
458
|
+
_defineProperty(_assertThisInitialized(_this), "_inner", void 0);
|
|
459
|
+
_defineProperty(_assertThisInitialized(_this), "id", getUID('list-'));
|
|
460
|
+
_defineProperty(_assertThisInitialized(_this), "shortcutsScope", _this.id);
|
|
461
|
+
_defineProperty(_assertThisInitialized(_this), "shortcutsMap", {
|
|
462
|
+
up: _this.upHandler,
|
|
463
|
+
down: _this.downHandler,
|
|
464
|
+
home: _this.homeHandler,
|
|
465
|
+
end: _this.endHandler,
|
|
466
|
+
enter: _this.enterHandler,
|
|
467
|
+
'meta+enter': _this.enterHandler,
|
|
468
|
+
'ctrl+enter': _this.enterHandler,
|
|
469
|
+
'command+enter': _this.enterHandler,
|
|
470
|
+
'shift+enter': _this.enterHandler
|
|
416
471
|
});
|
|
472
|
+
return _this;
|
|
417
473
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
if (data !== prevData) {
|
|
434
|
-
Object.assign(nextState, {
|
|
435
|
-
activeIndex: null,
|
|
436
|
-
activeItem: null
|
|
474
|
+
_createClass(List, [{
|
|
475
|
+
key: "componentDidMount",
|
|
476
|
+
value: function componentDidMount() {
|
|
477
|
+
document.addEventListener('mousemove', this.onDocumentMouseMove);
|
|
478
|
+
document.addEventListener('keydown', this.onDocumentKeyDown, true);
|
|
479
|
+
if (this.props.activeIndex == null && shouldActivateFirstItem(this.props)) {
|
|
480
|
+
this.activateFirst();
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}, {
|
|
484
|
+
key: "shouldComponentUpdate",
|
|
485
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
486
|
+
var _this2 = this;
|
|
487
|
+
return nextProps !== this.props || Object.keys(nextState).some(function (key) {
|
|
488
|
+
return nextState[key] !== _this2.state[key];
|
|
437
489
|
});
|
|
438
490
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
491
|
+
}, {
|
|
492
|
+
key: "componentDidUpdate",
|
|
493
|
+
value: function componentDidUpdate(prevProps) {
|
|
494
|
+
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
495
|
+
this.virtualizedList.recomputeRowHeights();
|
|
496
|
+
}
|
|
497
|
+
if (this.props.activeIndex == null && getDataHash(this.props.data) !== getDataHash(prevProps.data) && shouldActivateFirstItem(this.props)) {
|
|
498
|
+
this.activateFirst();
|
|
499
|
+
}
|
|
500
|
+
this.checkOverflow();
|
|
501
|
+
}
|
|
502
|
+
}, {
|
|
503
|
+
key: "componentWillUnmount",
|
|
504
|
+
value: function componentWillUnmount() {
|
|
505
|
+
this.unmounted = true;
|
|
506
|
+
document.removeEventListener('mousemove', this.onDocumentMouseMove);
|
|
507
|
+
document.removeEventListener('keydown', this.onDocumentKeyDown, true);
|
|
508
|
+
}
|
|
509
|
+
}, {
|
|
510
|
+
key: "hasActivatableItems",
|
|
511
|
+
value: function hasActivatableItems() {
|
|
512
|
+
return this._hasActivatableItems(this.props.data);
|
|
513
|
+
}
|
|
514
|
+
}, {
|
|
515
|
+
key: "moveHandler",
|
|
516
|
+
value: function moveHandler(index, retryCallback, e) {
|
|
517
|
+
var correctedIndex;
|
|
518
|
+
if (this.props.data.length === 0 || !this.hasActivatableItems()) {
|
|
519
|
+
return;
|
|
520
|
+
} else if (this.props.data.length < index) {
|
|
521
|
+
correctedIndex = 0;
|
|
522
|
+
} else {
|
|
523
|
+
correctedIndex = index;
|
|
524
|
+
}
|
|
525
|
+
var item = this.props.data[correctedIndex];
|
|
526
|
+
this.setState({
|
|
527
|
+
activeIndex: correctedIndex,
|
|
528
|
+
activeItem: item,
|
|
443
529
|
needScrollToActive: true
|
|
530
|
+
}, function onSet() {
|
|
531
|
+
if (!isActivatable(item)) {
|
|
532
|
+
retryCallback(e);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (e.key !== 'Home' && e.key !== 'End') {
|
|
536
|
+
preventDefault(e);
|
|
537
|
+
}
|
|
444
538
|
});
|
|
445
|
-
} else if (data !== prevData && restoreActiveIndex && activeItem != null && activeItem.key != null) {
|
|
446
|
-
// Restore active index if there is an item with the same "key" property
|
|
447
|
-
const index = data.findIndex(item => item.key === activeItem.key);
|
|
448
|
-
if (index >= 0) {
|
|
449
|
-
Object.assign(nextState, {
|
|
450
|
-
activeIndex: index,
|
|
451
|
-
activeItem: data[index]
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
539
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
this.activateFirst();
|
|
540
|
+
}, {
|
|
541
|
+
key: "getFirst",
|
|
542
|
+
value: function getFirst() {
|
|
543
|
+
return this.props.data.find(function (item) {
|
|
544
|
+
return item.rgItemType === Type.ITEM || item.rgItemType === Type.CUSTOM;
|
|
545
|
+
});
|
|
462
546
|
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
componentDidUpdate(prevProps) {
|
|
468
|
-
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
469
|
-
this.virtualizedList.recomputeRowHeights();
|
|
547
|
+
}, {
|
|
548
|
+
key: "getSelected",
|
|
549
|
+
value: function getSelected() {
|
|
550
|
+
return this.state.activeIndex != null ? this.props.data[this.state.activeIndex] : null;
|
|
470
551
|
}
|
|
471
|
-
|
|
472
|
-
|
|
552
|
+
}, {
|
|
553
|
+
key: "defaultItemHeight",
|
|
554
|
+
value: function defaultItemHeight() {
|
|
555
|
+
return this.props.compact ? Dimension.COMPACT_ITEM_HEIGHT : Dimension.ITEM_HEIGHT;
|
|
473
556
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
document.removeEventListener('mousemove', this.onDocumentMouseMove);
|
|
479
|
-
document.removeEventListener('keydown', this.onDocumentKeyDown, true);
|
|
480
|
-
}
|
|
481
|
-
hasActivatableItems() {
|
|
482
|
-
return this._hasActivatableItems(this.props.data);
|
|
483
|
-
}
|
|
484
|
-
moveHandler(index, retryCallback, e) {
|
|
485
|
-
let correctedIndex;
|
|
486
|
-
if (this.props.data.length === 0 || !this.hasActivatableItems()) {
|
|
487
|
-
return;
|
|
488
|
-
} else if (this.props.data.length < index) {
|
|
489
|
-
correctedIndex = 0;
|
|
490
|
-
} else {
|
|
491
|
-
correctedIndex = index;
|
|
557
|
+
}, {
|
|
558
|
+
key: "getVisibleListHeight",
|
|
559
|
+
value: function getVisibleListHeight(maxHeight) {
|
|
560
|
+
return maxHeight - this.defaultItemHeight() - Dimension.INNER_PADDING;
|
|
492
561
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return;
|
|
562
|
+
}, {
|
|
563
|
+
key: "_deprecatedGenerateKeyFromContent",
|
|
564
|
+
value: function _deprecatedGenerateKeyFromContent(itemProps) {
|
|
565
|
+
var identificator = itemProps.label || itemProps.description;
|
|
566
|
+
var isString = typeof identificator === 'string' || identificator instanceof String;
|
|
567
|
+
if (identificator && !isString) {
|
|
568
|
+
warnEmptyKey();
|
|
569
|
+
"".concat(itemProps.rgItemType, "_").concat(JSON.stringify(identificator));
|
|
502
570
|
}
|
|
503
|
-
|
|
504
|
-
|
|
571
|
+
return "".concat(itemProps.rgItemType, "_").concat(identificator);
|
|
572
|
+
}
|
|
573
|
+
}, {
|
|
574
|
+
key: "getId",
|
|
575
|
+
value: function getId(item) {
|
|
576
|
+
return item != null ? "".concat(this.id, ":").concat(item.key || this._deprecatedGenerateKeyFromContent(item)) : undefined;
|
|
577
|
+
}
|
|
578
|
+
}, {
|
|
579
|
+
key: "inner",
|
|
580
|
+
get: function get() {
|
|
581
|
+
if (!this._inner) {
|
|
582
|
+
this._inner = this.container && this.container.querySelector('.ring-list__i');
|
|
505
583
|
}
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
getFirst() {
|
|
509
|
-
return this.props.data.find(item => item.rgItemType === Type.ITEM || item.rgItemType === Type.CUSTOM);
|
|
510
|
-
}
|
|
511
|
-
getSelected() {
|
|
512
|
-
return this.state.activeIndex != null ? this.props.data[this.state.activeIndex] : null;
|
|
513
|
-
}
|
|
514
|
-
defaultItemHeight() {
|
|
515
|
-
return this.props.compact ? Dimension.COMPACT_ITEM_HEIGHT : Dimension.ITEM_HEIGHT;
|
|
516
|
-
}
|
|
517
|
-
getVisibleListHeight(maxHeight) {
|
|
518
|
-
return maxHeight - this.defaultItemHeight() - Dimension.INNER_PADDING;
|
|
519
|
-
}
|
|
520
|
-
_deprecatedGenerateKeyFromContent(itemProps) {
|
|
521
|
-
const identificator = itemProps.label || itemProps.description;
|
|
522
|
-
const isString = typeof identificator === 'string' || identificator instanceof String;
|
|
523
|
-
if (identificator && !isString) {
|
|
524
|
-
warnEmptyKey();
|
|
525
|
-
`${itemProps.rgItemType}_${JSON.stringify(identificator)}`;
|
|
584
|
+
return this._inner;
|
|
526
585
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
586
|
+
}, {
|
|
587
|
+
key: "renderVirtualizedInner",
|
|
588
|
+
value: function renderVirtualizedInner(_ref3) {
|
|
589
|
+
var _this3 = this;
|
|
590
|
+
var height = _ref3.height,
|
|
591
|
+
maxHeight = _ref3.maxHeight,
|
|
592
|
+
_ref3$autoHeight = _ref3.autoHeight,
|
|
593
|
+
autoHeight = _ref3$autoHeight === void 0 ? false : _ref3$autoHeight,
|
|
594
|
+
rowCount = _ref3.rowCount,
|
|
595
|
+
isScrolling = _ref3.isScrolling,
|
|
596
|
+
_ref3$onChildScroll = _ref3.onChildScroll,
|
|
597
|
+
onChildScroll = _ref3$onChildScroll === void 0 ? noop : _ref3$onChildScroll,
|
|
598
|
+
scrollTop = _ref3.scrollTop,
|
|
599
|
+
registerChild = _ref3.registerChild;
|
|
600
|
+
var dirOverride = {
|
|
601
|
+
direction: 'inherit'
|
|
602
|
+
}; // Virtualized sets "direction: ltr" by default https://github.com/bvaughn/react-virtualized/issues/457
|
|
603
|
+
return /*#__PURE__*/React.createElement(AutoSizer, {
|
|
604
|
+
disableHeight: true,
|
|
605
|
+
onResize: this.props.onResize
|
|
606
|
+
}, function (_ref4) {
|
|
607
|
+
var width = _ref4.width;
|
|
608
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
609
|
+
ref: registerChild
|
|
610
|
+
}, /*#__PURE__*/React.createElement(VirtualizedList, {
|
|
611
|
+
"aria-label": _this3.props.ariaLabel,
|
|
612
|
+
ref: _this3.virtualizedListRef,
|
|
613
|
+
className: "ring-list__i",
|
|
614
|
+
autoHeight: autoHeight,
|
|
615
|
+
style: maxHeight ? _objectSpread2({
|
|
616
|
+
maxHeight: maxHeight,
|
|
617
|
+
height: 'auto'
|
|
618
|
+
}, dirOverride) : dirOverride,
|
|
619
|
+
autoContainerWidth: true,
|
|
620
|
+
height: height,
|
|
621
|
+
width: width,
|
|
622
|
+
isScrolling: isScrolling,
|
|
623
|
+
onScroll: function onScroll(e) {
|
|
624
|
+
onChildScroll(e);
|
|
625
|
+
_this3.scrollEndHandler();
|
|
626
|
+
},
|
|
627
|
+
scrollTop: scrollTop,
|
|
628
|
+
rowCount: rowCount,
|
|
629
|
+
estimatedRowSize: _this3.defaultItemHeight(),
|
|
630
|
+
rowHeight: _this3._cache.rowHeight,
|
|
631
|
+
rowRenderer: _this3.renderItem,
|
|
632
|
+
overscanRowCount: _this3._bufferSize
|
|
633
|
+
// ensure rerendering
|
|
634
|
+
,
|
|
635
|
+
noop: function noop() {},
|
|
636
|
+
scrollToIndex: !_this3.props.disableScrollToActive && _this3.state.needScrollToActive && _this3.state.activeIndex != null ? _this3.state.activeIndex + 1 : undefined,
|
|
637
|
+
scrollToAlignment: "center",
|
|
638
|
+
deferredMeasurementCache: _this3._cache,
|
|
639
|
+
onRowsRendered: _this3.checkOverflow
|
|
640
|
+
}));
|
|
641
|
+
});
|
|
535
642
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
643
|
+
}, {
|
|
644
|
+
key: "renderVirtualized",
|
|
645
|
+
value: function renderVirtualized(maxHeight, rowCount) {
|
|
646
|
+
var _this4 = this;
|
|
647
|
+
if (maxHeight) {
|
|
648
|
+
return this.renderVirtualizedInner({
|
|
649
|
+
height: maxHeight,
|
|
650
|
+
maxHeight: maxHeight,
|
|
651
|
+
rowCount: rowCount
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
return /*#__PURE__*/React.createElement(WindowScroller, null, function (props) {
|
|
655
|
+
return _this4.renderVirtualizedInner(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
656
|
+
rowCount: rowCount,
|
|
657
|
+
autoHeight: true
|
|
658
|
+
}));
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
}, {
|
|
662
|
+
key: "renderSimple",
|
|
663
|
+
value: function renderSimple(maxHeight, rowCount) {
|
|
664
|
+
var items = [];
|
|
665
|
+
for (var index = 0; index < rowCount; index++) {
|
|
666
|
+
items.push(this.renderItem({
|
|
667
|
+
index: index,
|
|
668
|
+
isScrolling: this.state.scrolling
|
|
669
|
+
}));
|
|
670
|
+
}
|
|
559
671
|
return /*#__PURE__*/React.createElement("div", {
|
|
560
|
-
|
|
561
|
-
|
|
672
|
+
className: classNames('ring-list__i', modules_3b67a421.simpleInner),
|
|
673
|
+
onScroll: this.scrollHandler,
|
|
674
|
+
onMouseMove: this.mouseHandler
|
|
675
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
562
676
|
"aria-label": this.props.ariaLabel,
|
|
563
|
-
|
|
564
|
-
className: "ring-list__i",
|
|
565
|
-
autoHeight: autoHeight,
|
|
677
|
+
role: "grid",
|
|
566
678
|
style: maxHeight ? {
|
|
567
|
-
maxHeight
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
} : dirOverride,
|
|
571
|
-
autoContainerWidth: true,
|
|
572
|
-
height: height,
|
|
573
|
-
width: width,
|
|
574
|
-
isScrolling: isScrolling,
|
|
575
|
-
onScroll: e => {
|
|
576
|
-
onChildScroll(e);
|
|
577
|
-
this.scrollEndHandler();
|
|
578
|
-
},
|
|
579
|
-
scrollTop: scrollTop,
|
|
580
|
-
rowCount: rowCount,
|
|
581
|
-
estimatedRowSize: this.defaultItemHeight(),
|
|
582
|
-
rowHeight: this._cache.rowHeight,
|
|
583
|
-
rowRenderer: this.renderItem,
|
|
584
|
-
overscanRowCount: this._bufferSize
|
|
585
|
-
// ensure rerendering
|
|
586
|
-
,
|
|
587
|
-
noop: () => {},
|
|
588
|
-
scrollToIndex: !this.props.disableScrollToActive && this.state.needScrollToActive && this.state.activeIndex != null ? this.state.activeIndex + 1 : undefined,
|
|
589
|
-
scrollToAlignment: "center",
|
|
590
|
-
deferredMeasurementCache: this._cache,
|
|
591
|
-
onRowsRendered: this.checkOverflow
|
|
592
|
-
}));
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
renderVirtualized(maxHeight, rowCount) {
|
|
596
|
-
if (maxHeight) {
|
|
597
|
-
return this.renderVirtualizedInner({
|
|
598
|
-
height: maxHeight,
|
|
599
|
-
maxHeight,
|
|
600
|
-
rowCount
|
|
601
|
-
});
|
|
679
|
+
maxHeight: this.getVisibleListHeight(maxHeight)
|
|
680
|
+
} : undefined
|
|
681
|
+
}, items));
|
|
602
682
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
683
|
+
}, {
|
|
684
|
+
key: "render",
|
|
685
|
+
value: /** @override */
|
|
686
|
+
function render() {
|
|
687
|
+
var hint = this.getSelected() && this.props.hintOnSelection || this.props.hint;
|
|
688
|
+
var fadeStyles = hint ? {
|
|
689
|
+
bottom: Dimension.ITEM_HEIGHT
|
|
690
|
+
} : undefined;
|
|
691
|
+
var rowCount = this.props.data.length + 2;
|
|
692
|
+
var maxHeight = this.props.maxHeight && this.getVisibleListHeight(this.props.maxHeight);
|
|
693
|
+
var classes = classNames(modules_3b67a421.list, this.props.className);
|
|
694
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActiveItemContext.Updater, {
|
|
695
|
+
value: this.getId(this.state.activeItem),
|
|
696
|
+
skipUpdate: this.props.hidden || !isActivatable(this.state.activeItem)
|
|
697
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
698
|
+
id: this.props.id,
|
|
699
|
+
ref: this.containerRef,
|
|
700
|
+
className: classes,
|
|
701
|
+
onMouseOut: this.props.onMouseOut,
|
|
702
|
+
onBlur: this.props.onMouseOut,
|
|
703
|
+
onMouseLeave: this.clearSelected,
|
|
704
|
+
"data-test": "ring-list"
|
|
705
|
+
}, this.props.shortcuts && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
706
|
+
map: this.shortcutsMap,
|
|
707
|
+
scope: this.shortcutsScope
|
|
708
|
+
}), this.props.renderOptimization ? this.renderVirtualized(maxHeight, rowCount) : this.renderSimple(maxHeight, rowCount), this.state.hasOverflow && !this.state.scrolledToBottom && /*#__PURE__*/React.createElement("div", {
|
|
709
|
+
className: modules_3b67a421.fade,
|
|
710
|
+
style: fadeStyles
|
|
711
|
+
}), hint && /*#__PURE__*/React.createElement(ListHint, {
|
|
712
|
+
label: hint
|
|
713
|
+
})));
|
|
616
714
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
715
|
+
}], [{
|
|
716
|
+
key: "getDerivedStateFromProps",
|
|
717
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
718
|
+
var prevActiveIndex = prevState.prevActiveIndex,
|
|
719
|
+
prevData = prevState.prevData,
|
|
720
|
+
activeItem = prevState.activeItem;
|
|
721
|
+
var data = nextProps.data,
|
|
722
|
+
activeIndex = nextProps.activeIndex,
|
|
723
|
+
restoreActiveIndex = nextProps.restoreActiveIndex;
|
|
724
|
+
var nextState = {
|
|
725
|
+
prevActiveIndex: activeIndex,
|
|
726
|
+
prevData: data
|
|
727
|
+
};
|
|
728
|
+
if (data !== prevData) {
|
|
729
|
+
Object.assign(nextState, {
|
|
730
|
+
activeIndex: null,
|
|
731
|
+
activeItem: null
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
if (activeIndex != null && activeIndex !== prevActiveIndex && data[activeIndex] != null) {
|
|
735
|
+
Object.assign(nextState, {
|
|
736
|
+
activeIndex: activeIndex,
|
|
737
|
+
activeItem: data[activeIndex],
|
|
738
|
+
needScrollToActive: true
|
|
739
|
+
});
|
|
740
|
+
} else if (data !== prevData && restoreActiveIndex && activeItem != null && activeItem.key != null) {
|
|
741
|
+
// Restore active index if there is an item with the same "key" property
|
|
742
|
+
var index = data.findIndex(function (item) {
|
|
743
|
+
return item.key === activeItem.key;
|
|
744
|
+
});
|
|
745
|
+
if (index >= 0) {
|
|
746
|
+
Object.assign(nextState, {
|
|
747
|
+
activeIndex: index,
|
|
748
|
+
activeItem: data[index]
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return nextState;
|
|
753
|
+
}
|
|
754
|
+
}]);
|
|
755
|
+
return List;
|
|
756
|
+
}(Component);
|
|
660
757
|
_defineProperty(List, "propTypes", {
|
|
661
758
|
id: PropTypes.string,
|
|
662
759
|
className: PropTypes.string,
|
|
@@ -700,8 +797,8 @@ _defineProperty(List, "defaultProps", {
|
|
|
700
797
|
_defineProperty(List, "isItemType", isItemType);
|
|
701
798
|
_defineProperty(List, "ListHint", ListHint);
|
|
702
799
|
_defineProperty(List, "ListProps", {
|
|
703
|
-
Type,
|
|
704
|
-
Dimension
|
|
800
|
+
Type: Type,
|
|
801
|
+
Dimension: Dimension
|
|
705
802
|
});
|
|
706
803
|
|
|
707
804
|
export { ActiveItemContext, List as default };
|