@jetbrains/ring-ui 6.0.6-beta.0 → 6.0.6
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 -1
- package/components/alert/alert.css +146 -0
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +186 -0
- package/components/alert/container.css +26 -0
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +30 -0
- package/components/alert-service/alert-service.d.ts +36 -0
- package/components/alert-service/alert-service.js +108 -0
- package/components/alert-service/alert-service.stories.css +17 -0
- package/components/analytics/analytics.d.ts +18 -0
- package/components/analytics/analytics.js +18 -0
- package/components/analytics/analytics__custom-plugin.d.ts +28 -0
- package/components/analytics/analytics__custom-plugin.js +58 -0
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +42 -0
- package/components/auth/auth__core.d.ts +236 -0
- package/components/auth/auth__core.js +834 -0
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +97 -0
- package/components/auth/down-notification.css +15 -0
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +52 -0
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +81 -0
- package/components/auth/request-builder.d.ts +48 -0
- package/components/auth/request-builder.js +64 -0
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +99 -0
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +224 -0
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +169 -0
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +102 -0
- package/components/auth-dialog/auth-dialog.css +54 -0
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +93 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +6 -0
- package/components/auth-dialog-service/auth-dialog-service.js +26 -0
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +24 -0
- package/components/avatar/avatar.css +27 -0
- package/components/avatar/avatar.d.ts +52 -0
- package/components/avatar/avatar.js +98 -0
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +113 -0
- package/components/badge/badge.css +42 -0
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +35 -0
- package/components/button/button.css +397 -0
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +70 -0
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +18 -0
- package/components/button-group/button-group.css +236 -0
- package/components/button-group/button-group.d.ts +18 -0
- package/components/button-group/button-group.js +21 -0
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +14 -0
- package/components/button-set/button-set.css +21 -0
- package/components/button-set/button-set.d.ts +16 -0
- package/components/button-set/button-set.js +22 -0
- package/components/button-toolbar/button-toolbar.css +25 -0
- package/components/button-toolbar/button-toolbar.d.ts +16 -0
- package/components/button-toolbar/button-toolbar.js +20 -0
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +216 -0
- package/components/checkbox/checkbox.css +146 -0
- package/components/checkbox/checkbox.d.ts +45 -0
- package/components/checkbox/checkbox.js +72 -0
- package/components/clipboard/clipboard-fallback.d.ts +2 -0
- package/components/clipboard/clipboard-fallback.js +44 -0
- package/components/clipboard/clipboard.d.ts +5 -0
- package/components/clipboard/clipboard.js +41 -0
- package/components/code/code.css +29 -0
- package/components/code/code.d.ts +44 -0
- package/components/code/code.js +94 -0
- package/components/code/highlight.css +112 -0
- package/components/collapse/collapse-content.d.ts +11 -0
- package/components/collapse/collapse-content.js +72 -0
- package/components/collapse/collapse-context.d.ts +10 -0
- package/components/collapse/collapse-context.js +10 -0
- package/components/collapse/collapse-control.d.ts +11 -0
- package/components/collapse/collapse-control.js +22 -0
- package/components/collapse/collapse.css +40 -0
- package/components/collapse/collapse.d.ts +12 -0
- package/components/collapse/collapse.js +26 -0
- package/components/collapse/collapse.stories.css +25 -0
- package/components/collapse/consts.d.ts +4 -0
- package/components/collapse/consts.js +4 -0
- package/components/collapse/utils.d.ts +1 -0
- package/components/collapse/utils.js +1 -0
- package/components/confirm/confirm.css +7 -0
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +59 -0
- package/components/confirm-service/confirm-service.d.ts +21 -0
- package/components/confirm-service/confirm-service.js +52 -0
- package/components/content-layout/content-layout.css +108 -0
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +45 -0
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +76 -0
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +47 -0
- 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 +97 -0
- package/components/data-list/data-list.d.ts +85 -0
- package/components/data-list/data-list.js +119 -0
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +207 -0
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +114 -0
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +81 -0
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +65 -0
- package/components/date-picker/consts.d.ts +98 -0
- package/components/date-picker/consts.js +44 -0
- package/components/date-picker/date-input.d.ts +47 -0
- package/components/date-picker/date-input.js +91 -0
- package/components/date-picker/date-picker.css +602 -0
- package/components/date-picker/date-picker.d.ts +77 -0
- package/components/date-picker/date-picker.js +218 -0
- package/components/date-picker/date-popup.d.ts +55 -0
- package/components/date-picker/date-popup.js +347 -0
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +88 -0
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/formats.js +1 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +62 -0
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +56 -0
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +33 -0
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +101 -0
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +24 -0
- package/components/date-picker/years.d.ts +25 -0
- package/components/date-picker/years.js +87 -0
- package/components/dialog/dialog.css +137 -0
- package/components/dialog/dialog.d.ts +64 -0
- package/components/dialog/dialog.js +128 -0
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +43 -0
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +16 -0
- package/components/dropdown/dropdown.css +18 -0
- package/components/dropdown/dropdown.d.ts +87 -0
- package/components/dropdown/dropdown.js +159 -0
- package/components/dropdown-menu/dropdown-menu.d.ts +36 -0
- package/components/dropdown-menu/dropdown-menu.js +56 -0
- package/components/editable-heading/editable-heading.css +198 -0
- package/components/editable-heading/editable-heading.d.ts +32 -0
- package/components/editable-heading/editable-heading.js +141 -0
- package/components/error-bubble/error-bubble-legacy.css +77 -0
- package/components/error-bubble/error-bubble.css +54 -0
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +28 -0
- package/components/error-message/error-message.css +37 -0
- package/components/error-message/error-message.d.ts +27 -0
- package/components/error-message/error-message.js +37 -0
- package/components/error-page/error-page.css +24 -0
- package/components/error-page/error-page.gif +0 -0
- package/components/footer/footer.css +83 -0
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +97 -0
- package/components/form/form.css +266 -0
- package/components/form/form.stories.js +138 -0
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +4 -0
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +8 -0
- package/components/global/controls-height.d.ts +9 -0
- package/components/global/controls-height.js +16 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +38 -0
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +17 -0
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +83 -0
- package/components/global/focus-sensor-hoc.d.ts +19 -0
- package/components/global/focus-sensor-hoc.js +102 -0
- package/components/global/fuzzy-highlight.d.ts +11 -0
- package/components/global/fuzzy-highlight.js +58 -0
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +100 -0
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +16 -0
- package/components/global/global.css +101 -0
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +12 -0
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +13 -0
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +27 -0
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +15 -0
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +30 -0
- package/components/global/promise-with-timeout.d.ts +5 -0
- package/components/global/promise-with-timeout.js +11 -0
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +4 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +25 -0
- package/components/global/react-render-adapter.d.ts +1 -0
- package/components/global/react-render-adapter.js +3 -0
- package/components/global/rerender-hoc.d.ts +10 -0
- package/components/global/rerender-hoc.js +14 -0
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +27 -0
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +4 -0
- package/components/global/theme.d.ts +21 -0
- package/components/global/theme.js +70 -0
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +9 -0
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +2 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +136 -0
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +14 -0
- package/components/global/variables.css +179 -0
- package/components/global/variables.d.ts +89 -0
- package/components/global/variables.js +1 -0
- package/components/global/variables_dark.css +132 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +49 -0
- package/components/grid/grid.css +915 -0
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +22 -0
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +51 -0
- package/components/group/group.css +7 -0
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +20 -0
- package/components/header/header.css +169 -0
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +46 -0
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +22 -0
- package/components/header/profile.d.ts +75 -0
- package/components/header/profile.js +119 -0
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +26 -0
- package/components/header/services.css +97 -0
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +62 -0
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +86 -0
- package/components/header/smart-services.d.ts +26 -0
- package/components/header/smart-services.js +49 -0
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +20 -0
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +18 -0
- package/components/heading/heading.css +68 -0
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +52 -0
- package/components/http/http.d.ts +61 -0
- package/components/http/http.js +192 -0
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +52 -0
- package/components/hub-source/hub-source.d.ts +44 -0
- package/components/hub-source/hub-source.js +107 -0
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +20 -0
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +53 -0
- 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.css +100 -0
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +69 -0
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +32 -0
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +58 -0
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +2 -0
- package/components/input/input-legacy.css +123 -0
- package/components/input/input.css +194 -0
- package/components/input/input.d.ts +77 -0
- package/components/input/input.js +165 -0
- package/components/input-size/input-size.css +82 -0
- package/components/input-size/input-size.stories.js +73 -0
- package/components/island/adaptive-island-hoc.d.ts +61 -0
- package/components/island/adaptive-island-hoc.js +28 -0
- package/components/island/content.d.ts +43 -0
- package/components/island/content.js +100 -0
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +78 -0
- package/components/island/island.css +131 -0
- package/components/island/island.d.ts +78 -0
- package/components/island/island.js +31 -0
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +17 -0
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +19 -0
- package/components/island-legacy/island-legacy.css +98 -0
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +19 -0
- package/components/line/line.css +14 -0
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +33 -0
- package/components/link/link.css +64 -0
- package/components/link/link.d.ts +138 -0
- package/components/link/link.js +44 -0
- package/components/list/consts.d.ts +77 -0
- package/components/list/consts.js +25 -0
- package/components/list/list.css +298 -0
- package/components/list/list.d.ts +205 -0
- package/components/list/list.js +590 -0
- package/components/list/list.stories.css +3 -0
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +52 -0
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +16 -0
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +130 -0
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +43 -0
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +21 -0
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +28 -0
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +74 -0
- package/components/loader/loader.css +27 -0
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +44 -0
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +219 -0
- package/components/loader-inline/loader-inline.css +73 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +27 -0
- package/components/loader-screen/loader-screen.css +29 -0
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +25 -0
- package/components/login-dialog/login-dialog.css +23 -0
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +84 -0
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +24 -0
- package/components/markdown/markdown.css +126 -0
- package/components/markdown/markdown.d.ts +12 -0
- package/components/markdown/markdown.js +25 -0
- package/components/message/message.css +61 -0
- package/components/message/message.d.ts +55 -0
- package/components/message/message.js +129 -0
- package/components/old-browsers-message/old-browsers-message.css +26 -0
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +83 -0
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +2 -0
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +25 -0
- package/components/pager/pager.css +19 -0
- package/components/pager/pager.d.ts +78 -0
- package/components/pager/pager.js +223 -0
- package/components/palette/palette.css +216 -0
- package/components/panel/panel.css +20 -0
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +20 -0
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +177 -0
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +228 -0
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +45 -0
- package/components/popup/popup.css +34 -0
- package/components/popup/popup.d.ts +147 -0
- package/components/popup/popup.js +312 -0
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +15 -0
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +202 -0
- package/components/popup-menu/popup-menu.d.ts +80 -0
- package/components/popup-menu/popup-menu.js +41 -0
- package/components/progress-bar/progress-bar.css +82 -0
- package/components/progress-bar/progress-bar.d.ts +64 -0
- package/components/progress-bar/progress-bar.js +76 -0
- package/components/query-assist/query-assist.css +275 -0
- package/components/query-assist/query-assist.d.ts +306 -0
- package/components/query-assist/query-assist.js +847 -0
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +60 -0
- package/components/radio/radio.css +122 -0
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +27 -0
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +41 -0
- package/components/select/select-popup.css +103 -0
- package/components/select/select.css +235 -0
- package/components/select/select.d.ts +276 -0
- package/components/select/select.js +957 -0
- package/components/select/select__filter.d.ts +19 -0
- package/components/select/select__filter.js +49 -0
- package/components/select/select__popup.d.ts +166 -0
- package/components/select/select__popup.js +408 -0
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +191 -0
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +50 -0
- package/components/shortcuts/shortcuts-hoc.d.ts +65 -0
- package/components/shortcuts/shortcuts-hoc.js +19 -0
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +50 -0
- package/components/sidebar/sidebar.css +157 -0
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +22 -0
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +181 -0
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +119 -0
- package/components/tab-trap/tab-trap.css +6 -0
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +125 -0
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +16 -0
- package/components/table/disable-hover-hoc.d.ts +64 -0
- package/components/table/disable-hover-hoc.js +32 -0
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +56 -0
- package/components/table/header.d.ts +56 -0
- package/components/table/header.js +67 -0
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +81 -0
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +25 -0
- package/components/table/row.d.ts +59 -0
- package/components/table/row.js +154 -0
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +10 -0
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +146 -0
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +150 -0
- package/components/table/smart-table.d.ts +64 -0
- package/components/table/smart-table.js +40 -0
- package/components/table/table.css +259 -0
- package/components/table/table.d.ts +159 -0
- package/components/table/table.examples2.json +19 -0
- package/components/table/table.js +231 -0
- package/components/table/table.stories.json +45 -0
- package/components/table-legacy/table-legacy.css +346 -0
- package/components/table-legacy/table-legacy__toolbar.css +25 -0
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +97 -0
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +34 -0
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +196 -0
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +5 -0
- package/components/tabs/dumb-tabs.d.ts +35 -0
- package/components/tabs/dumb-tabs.js +56 -0
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +25 -0
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +24 -0
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +19 -0
- package/components/tabs/tabs.css +223 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +7 -0
- package/components/tag/tag.css +184 -0
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +130 -0
- package/components/tags-input/tags-input.css +100 -0
- package/components/tags-input/tags-input.d.ts +138 -0
- package/components/tags-input/tags-input.js +275 -0
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +45 -0
- package/components/text/text.css +21 -0
- package/components/text/text.d.ts +23 -0
- package/components/text/text.js +31 -0
- package/components/toggle/toggle.css +198 -0
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +46 -0
- package/components/tooltip/tooltip.css +17 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +126 -0
- package/components/user-agreement/service.d.ts +69 -0
- package/components/user-agreement/service.js +242 -0
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/toolbox.eula.js +160 -0
- package/components/user-agreement/user-agreement.css +29 -0
- package/components/user-agreement/user-agreement.d.ts +60 -0
- package/components/user-agreement/user-agreement.js +80 -0
- package/components/user-card/card.d.ts +70 -0
- package/components/user-card/card.js +89 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +47 -0
- package/components/user-card/tooltip.d.ts +36 -0
- package/components/user-card/tooltip.js +43 -0
- package/components/user-card/user-card.css +123 -0
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +11 -0
- package/package.json +61 -61
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
export default function disableHoverHOC(ComposedComponent) {
|
|
3
|
+
return class DisableHover extends PureComponent {
|
|
4
|
+
static propTypes = ComposedComponent.propTypes;
|
|
5
|
+
static defaultProps = ComposedComponent.defaultProps;
|
|
6
|
+
state = {
|
|
7
|
+
disabledHover: false
|
|
8
|
+
};
|
|
9
|
+
componentDidMount() {
|
|
10
|
+
document.addEventListener('mousemove', this.onMouseMove);
|
|
11
|
+
document.addEventListener('keydown', this.onKeyDown, true);
|
|
12
|
+
}
|
|
13
|
+
componentWillUnmount() {
|
|
14
|
+
document.removeEventListener('mousemove', this.onMouseMove);
|
|
15
|
+
document.removeEventListener('keydown', this.onKeyDown, true);
|
|
16
|
+
}
|
|
17
|
+
onMouseMove = () => {
|
|
18
|
+
if (this.state.disabledHover) {
|
|
19
|
+
this.setState({ disabledHover: false });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
onKeyDown = (e) => {
|
|
23
|
+
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
24
|
+
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
25
|
+
this.setState({ disabledHover: true });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
render() {
|
|
29
|
+
return (<ComposedComponent {...this.props} disabledHover={this.state.disabledHover}/>);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { PureComponent, ReactNode, SyntheticEvent, ThHTMLAttributes } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export interface Column<T = never> {
|
|
4
|
+
id: string;
|
|
5
|
+
sortable?: boolean | null | undefined;
|
|
6
|
+
className?: string | null | undefined;
|
|
7
|
+
headerClassName?: string | null | undefined;
|
|
8
|
+
rightAlign?: boolean | null | undefined;
|
|
9
|
+
getHeaderValue?: (() => ReactNode) | null | undefined;
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
getValue?: ((item: T, column: Column) => ReactNode) | null | undefined;
|
|
12
|
+
getDataTest?: ((item: T, column: Column) => string) | null | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface SortParams {
|
|
15
|
+
column: Column;
|
|
16
|
+
order: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface HeaderCellProps extends ThHTMLAttributes<HTMLTableHeaderCellElement> {
|
|
19
|
+
column: Column;
|
|
20
|
+
onSort: (params: SortParams) => void;
|
|
21
|
+
sortKey?: string | null | undefined;
|
|
22
|
+
sortOrder?: boolean | null | undefined;
|
|
23
|
+
'data-test'?: string | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
export default class HeaderCell extends PureComponent<HeaderCellProps> {
|
|
26
|
+
static propTypes: {
|
|
27
|
+
children: PropTypes.Requireable<any>;
|
|
28
|
+
className: PropTypes.Requireable<string>;
|
|
29
|
+
column: PropTypes.Validator<object>;
|
|
30
|
+
onSort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
+
sortKey: PropTypes.Requireable<string>;
|
|
32
|
+
sortOrder: PropTypes.Requireable<boolean>;
|
|
33
|
+
'data-test': PropTypes.Requireable<string>;
|
|
34
|
+
};
|
|
35
|
+
static defaultProps: {
|
|
36
|
+
onSort: () => void;
|
|
37
|
+
};
|
|
38
|
+
sortable?: boolean;
|
|
39
|
+
sorted?: boolean;
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
onChildrenClick(e: SyntheticEvent): void;
|
|
42
|
+
render(): React.JSX.Element;
|
|
43
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import sortableIcon from '@jetbrains/icons/unsorted-10px';
|
|
5
|
+
import sortedIcon from '@jetbrains/icons/chevron-10px';
|
|
6
|
+
import Icon from '../icon/icon';
|
|
7
|
+
import dataTests from '../global/data-tests';
|
|
8
|
+
import style from './table.css';
|
|
9
|
+
export default class HeaderCell extends PureComponent {
|
|
10
|
+
static propTypes = {
|
|
11
|
+
children: PropTypes.any,
|
|
12
|
+
className: PropTypes.string,
|
|
13
|
+
column: PropTypes.object.isRequired,
|
|
14
|
+
onSort: PropTypes.func,
|
|
15
|
+
sortKey: PropTypes.string,
|
|
16
|
+
sortOrder: PropTypes.bool,
|
|
17
|
+
'data-test': PropTypes.string
|
|
18
|
+
};
|
|
19
|
+
static defaultProps = {
|
|
20
|
+
onSort: () => { }
|
|
21
|
+
};
|
|
22
|
+
sortable;
|
|
23
|
+
sorted;
|
|
24
|
+
onClick = () => {
|
|
25
|
+
if (this.sortable) {
|
|
26
|
+
const { column, onSort, sortOrder } = this.props;
|
|
27
|
+
onSort({ column, order: !(this.sorted && sortOrder) });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
onChildrenClick(e) {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const { className, column, onSort, sortKey, sortOrder, 'data-test': dataTest, ...restProps } = this.props;
|
|
35
|
+
this.sortable = column.sortable === true;
|
|
36
|
+
this.sorted = sortKey === column.id;
|
|
37
|
+
const glyph = this.sorted ? sortedIcon : sortableIcon;
|
|
38
|
+
const classes = classNames(className, column.headerClassName, {
|
|
39
|
+
[style.headerCell]: true,
|
|
40
|
+
[style.headerCellSortable]: this.sortable,
|
|
41
|
+
[style.headerCellSorted]: this.sorted,
|
|
42
|
+
[style.sortedUp]: sortOrder && this.sorted,
|
|
43
|
+
[style.cellRight]: column.rightAlign
|
|
44
|
+
});
|
|
45
|
+
return (<th {...restProps} className={classes} onClick={this.onClick} data-test={dataTests('ring-table-header-cell', dataTest)}>
|
|
46
|
+
{/* onClick only used to stop propagation */}
|
|
47
|
+
<span onClick={this.onChildrenClick} role="presentation">{this.props.children}</span>
|
|
48
|
+
|
|
49
|
+
{column.getHeaderValue ? column.getHeaderValue() : column.title}
|
|
50
|
+
|
|
51
|
+
{this.sortable && (<span className={style.sorter}>
|
|
52
|
+
<Icon glyph={glyph} className={style.icon}/>
|
|
53
|
+
</span>)}
|
|
54
|
+
</th>);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { ChangeEventHandler, PureComponent, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Column, SortParams } from './header-cell';
|
|
4
|
+
export interface HeaderProps {
|
|
5
|
+
columns: readonly Column[];
|
|
6
|
+
selectable: boolean;
|
|
7
|
+
draggable: boolean;
|
|
8
|
+
checked: boolean;
|
|
9
|
+
sticky: boolean;
|
|
10
|
+
topStickOffset: string;
|
|
11
|
+
onSort: (params: SortParams) => void;
|
|
12
|
+
onCheckboxChange: ChangeEventHandler<HTMLInputElement>;
|
|
13
|
+
sortKey: string;
|
|
14
|
+
sortOrder: boolean;
|
|
15
|
+
caption?: string | null | undefined;
|
|
16
|
+
checkboxDisabled?: boolean | undefined;
|
|
17
|
+
}
|
|
18
|
+
declare module 'react-waypoint' {
|
|
19
|
+
namespace Waypoint {
|
|
20
|
+
interface WaypointProps {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export default class Header extends PureComponent<HeaderProps> {
|
|
26
|
+
static propTypes: {
|
|
27
|
+
caption: PropTypes.Requireable<string>;
|
|
28
|
+
selectable: PropTypes.Requireable<boolean>;
|
|
29
|
+
draggable: PropTypes.Requireable<boolean>;
|
|
30
|
+
checked: PropTypes.Requireable<boolean>;
|
|
31
|
+
checkboxDisabled: PropTypes.Requireable<boolean>;
|
|
32
|
+
sticky: PropTypes.Requireable<boolean>;
|
|
33
|
+
topStickOffset: PropTypes.Requireable<string>;
|
|
34
|
+
onCheckboxChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
+
columns: PropTypes.Validator<any[]>;
|
|
36
|
+
onSort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
+
sortKey: PropTypes.Requireable<string>;
|
|
38
|
+
sortOrder: PropTypes.Requireable<boolean>;
|
|
39
|
+
};
|
|
40
|
+
static defaultProps: {
|
|
41
|
+
selectable: boolean;
|
|
42
|
+
draggable: boolean;
|
|
43
|
+
checked: boolean;
|
|
44
|
+
sticky: boolean;
|
|
45
|
+
topStickOffset: string;
|
|
46
|
+
onSort: () => void;
|
|
47
|
+
onCheckboxChange: () => void;
|
|
48
|
+
sortKey: string;
|
|
49
|
+
sortOrder: boolean;
|
|
50
|
+
};
|
|
51
|
+
id: string;
|
|
52
|
+
onCheckboxFocus: (event: SyntheticEvent<HTMLElement>) => void;
|
|
53
|
+
createCells(widths?: never[]): React.JSX.Element[];
|
|
54
|
+
render(): React.JSX.Element;
|
|
55
|
+
}
|
|
56
|
+
export type HeaderAttrs = JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Checkbox from '../checkbox/checkbox';
|
|
5
|
+
import getUID from '../global/get-uid';
|
|
6
|
+
import style from './table.css';
|
|
7
|
+
import HeaderCell from './header-cell';
|
|
8
|
+
export default class Header extends PureComponent {
|
|
9
|
+
static propTypes = {
|
|
10
|
+
caption: PropTypes.string,
|
|
11
|
+
selectable: PropTypes.bool,
|
|
12
|
+
draggable: PropTypes.bool,
|
|
13
|
+
checked: PropTypes.bool,
|
|
14
|
+
checkboxDisabled: PropTypes.bool,
|
|
15
|
+
sticky: PropTypes.bool,
|
|
16
|
+
topStickOffset: PropTypes.string,
|
|
17
|
+
onCheckboxChange: PropTypes.func,
|
|
18
|
+
columns: PropTypes.array.isRequired,
|
|
19
|
+
onSort: PropTypes.func,
|
|
20
|
+
sortKey: PropTypes.string,
|
|
21
|
+
sortOrder: PropTypes.bool
|
|
22
|
+
};
|
|
23
|
+
static defaultProps = {
|
|
24
|
+
selectable: true,
|
|
25
|
+
draggable: false,
|
|
26
|
+
checked: true,
|
|
27
|
+
sticky: true,
|
|
28
|
+
topStickOffset: '0px',
|
|
29
|
+
onSort: () => { },
|
|
30
|
+
onCheckboxChange: () => { },
|
|
31
|
+
sortKey: 'id',
|
|
32
|
+
sortOrder: true
|
|
33
|
+
};
|
|
34
|
+
id = getUID('table-header-');
|
|
35
|
+
onCheckboxFocus = (event) => {
|
|
36
|
+
event.currentTarget.blur();
|
|
37
|
+
};
|
|
38
|
+
createCells(widths = []) {
|
|
39
|
+
const { selectable, draggable, columns, checked, checkboxDisabled, onCheckboxChange, onSort, sortKey, sortOrder } = this.props;
|
|
40
|
+
const metaColumnClasses = classNames(style.metaColumn, style.headerMetaColumn);
|
|
41
|
+
const metaColumn = (<div className={metaColumnClasses}>
|
|
42
|
+
{selectable &&
|
|
43
|
+
(<Checkbox aria-labelledby={this.id} disabled={checkboxDisabled} checked={checked} onChange={onCheckboxChange} onFocus={this.onCheckboxFocus}/>)}
|
|
44
|
+
</div>);
|
|
45
|
+
return columns.map((column, index) => {
|
|
46
|
+
const columnStyle = widths[index] ? { width: widths[index] } : undefined;
|
|
47
|
+
const props = { column, onSort, sortKey, sortOrder, style: columnStyle };
|
|
48
|
+
return (<HeaderCell key={column.id} data-test={column.id} {...props}>
|
|
49
|
+
{index === 0 && (draggable || selectable) && metaColumn}
|
|
50
|
+
</HeaderCell>);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const { caption, sticky, topStickOffset } = this.props;
|
|
55
|
+
const regularCells = this.createCells();
|
|
56
|
+
return (<thead id={this.id} data-test="ring-table-header" style={{ top: topStickOffset }} className={classNames({
|
|
57
|
+
[style.tableHead]: true,
|
|
58
|
+
[style.subHeaderSticky]: sticky
|
|
59
|
+
})}>
|
|
60
|
+
{caption && (<tr data-test="ring-table-header-row">
|
|
61
|
+
<th className={classNames(style.headerCell, style.caption)} colSpan={regularCells.length + 1} data-test="ring-table-header-cell">{caption}</th>
|
|
62
|
+
</tr>)}
|
|
63
|
+
|
|
64
|
+
<tr className={style.subHeader} data-test="ring-table-header-row">{regularCells}</tr>
|
|
65
|
+
</thead>);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { PureComponent, ReactElement } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { TableAttrs } from './table';
|
|
4
|
+
import { SelectionItem } from './selection';
|
|
5
|
+
export interface MultiTableProps {
|
|
6
|
+
children: ReactElement<TableAttrs<SelectionItem>>[];
|
|
7
|
+
}
|
|
8
|
+
export default class MultiTable extends PureComponent<MultiTableProps> {
|
|
9
|
+
static propTypes: {
|
|
10
|
+
children: PropTypes.Validator<any>;
|
|
11
|
+
};
|
|
12
|
+
componentDidUpdate(prevProps: MultiTableProps): void;
|
|
13
|
+
onUpPress: () => boolean;
|
|
14
|
+
onDownPress: () => boolean;
|
|
15
|
+
onEscPress: () => void;
|
|
16
|
+
onCmdAPress: () => boolean;
|
|
17
|
+
shortcuts: {
|
|
18
|
+
up: () => boolean;
|
|
19
|
+
down: () => boolean;
|
|
20
|
+
esc: () => void;
|
|
21
|
+
'command+a': () => boolean;
|
|
22
|
+
'ctrl+a': () => boolean;
|
|
23
|
+
};
|
|
24
|
+
render(): React.JSX.Element;
|
|
25
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { PureComponent, Children, cloneElement } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export default class MultiTable extends PureComponent {
|
|
4
|
+
static propTypes = {
|
|
5
|
+
children: PropTypes.any.isRequired
|
|
6
|
+
};
|
|
7
|
+
componentDidUpdate(prevProps) {
|
|
8
|
+
if (prevProps.children) {
|
|
9
|
+
const prevSelections = prevProps.children.map(element => element.props.selection);
|
|
10
|
+
const prevFocusedIndex = prevSelections.findIndex(selection => selection.getFocused());
|
|
11
|
+
const prevFocused = prevSelections[prevFocusedIndex];
|
|
12
|
+
const currentSelections = this.props.children.map(element => element.props.selection);
|
|
13
|
+
const currentFocused = currentSelections.filter(selection => selection.getFocused());
|
|
14
|
+
if (currentFocused.includes(prevFocused)) {
|
|
15
|
+
prevProps.children[prevFocusedIndex].props.onSelect?.(prevFocused.resetFocus());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
onUpPress = () => {
|
|
20
|
+
const { children: tables } = this.props;
|
|
21
|
+
const tableIndex = tables.findIndex(({ props: { selection } }) => selection.getFocused());
|
|
22
|
+
const currentTable = tables[tableIndex].props;
|
|
23
|
+
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
24
|
+
let newSelection = currentTable.selection.moveUp();
|
|
25
|
+
if (newSelection) {
|
|
26
|
+
currentTable.onSelect?.(newSelection);
|
|
27
|
+
}
|
|
28
|
+
else if (prevTable) {
|
|
29
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
30
|
+
newSelection = prevTable.selection.moveUp();
|
|
31
|
+
if (newSelection) {
|
|
32
|
+
prevTable.onSelect?.(newSelection);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
onDownPress = () => {
|
|
38
|
+
const { children: tables } = this.props;
|
|
39
|
+
const tableIndex = tables.findIndex(({ props: { selection } }) => selection.getFocused());
|
|
40
|
+
const currentTable = tables[tableIndex].props;
|
|
41
|
+
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
42
|
+
let newSelection = currentTable.selection.moveDown();
|
|
43
|
+
if (newSelection) {
|
|
44
|
+
currentTable.onSelect?.(newSelection);
|
|
45
|
+
}
|
|
46
|
+
else if (nextTable) {
|
|
47
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
48
|
+
newSelection = nextTable.selection.moveDown();
|
|
49
|
+
if (newSelection) {
|
|
50
|
+
nextTable.onSelect?.(newSelection);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
};
|
|
55
|
+
onEscPress = () => {
|
|
56
|
+
const { children } = this.props;
|
|
57
|
+
Children.forEach(children, ({ props: { selection, onSelect } }) => {
|
|
58
|
+
onSelect(selection.reset());
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
onCmdAPress = () => {
|
|
62
|
+
const { children } = this.props;
|
|
63
|
+
Children.forEach(children, ({ props: { selection, onSelect } }) => {
|
|
64
|
+
onSelect(selection.selectAll());
|
|
65
|
+
});
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
shortcuts = {
|
|
69
|
+
up: this.onUpPress,
|
|
70
|
+
down: this.onDownPress,
|
|
71
|
+
esc: this.onEscPress,
|
|
72
|
+
'command+a': this.onCmdAPress,
|
|
73
|
+
'ctrl+a': this.onCmdAPress
|
|
74
|
+
};
|
|
75
|
+
render() {
|
|
76
|
+
return (<div data-test="ring-multitable">{Children.map(this.props.children, child => {
|
|
77
|
+
const props = { shortcuts: this.shortcuts };
|
|
78
|
+
return cloneElement(child, props);
|
|
79
|
+
})}</div>);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { FocusSensorProps } from '../global/focus-sensor-hoc';
|
|
3
|
+
import Row, { RowProps } from './row';
|
|
4
|
+
import { SelectionItem } from './selection';
|
|
5
|
+
export interface RowWithFocusSensorCallbacksProps<T extends SelectionItem> extends Omit<FocusSensorProps<RowProps<T>, HTMLTableRowElement, typeof Row>, 'onFocus'> {
|
|
6
|
+
onFocus?: (item: T) => void;
|
|
7
|
+
onSelect?: (item: T, selected: boolean) => void;
|
|
8
|
+
onCollapse?: (item: T) => void;
|
|
9
|
+
onExpand?: (item: T) => void;
|
|
10
|
+
}
|
|
11
|
+
export default class RowWithFocusSensorCallbacks<T extends SelectionItem> extends PureComponent<RowWithFocusSensorCallbacksProps<T>> {
|
|
12
|
+
RowWithFocusSensor: React.ComponentType<FocusSensorProps<RowProps<T>, HTMLDivElement, typeof Row>>;
|
|
13
|
+
onFocus: () => void;
|
|
14
|
+
onSelect: (item: T, selected: boolean) => void;
|
|
15
|
+
onCollapse: () => void;
|
|
16
|
+
onExpand: () => void;
|
|
17
|
+
render(): React.JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import focusSensorHOC from '../global/focus-sensor-hoc';
|
|
3
|
+
import Row from './row';
|
|
4
|
+
const getContainer = () => focusSensorHOC(Row);
|
|
5
|
+
export default class RowWithFocusSensorCallbacks extends PureComponent {
|
|
6
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
7
|
+
RowWithFocusSensor = getContainer();
|
|
8
|
+
onFocus = () => {
|
|
9
|
+
this.props.onFocus?.(this.props.item);
|
|
10
|
+
};
|
|
11
|
+
onSelect = (item, selected) => {
|
|
12
|
+
this.props.onSelect?.(item, selected);
|
|
13
|
+
};
|
|
14
|
+
onCollapse = () => {
|
|
15
|
+
this.props.onCollapse?.(this.props.item);
|
|
16
|
+
};
|
|
17
|
+
onExpand = () => {
|
|
18
|
+
this.props.onExpand?.(this.props.item);
|
|
19
|
+
};
|
|
20
|
+
render() {
|
|
21
|
+
return (<this.RowWithFocusSensor {...this.props} onFocus={this.onFocus} onSelect={this.onSelect} onCollapse={this.onCollapse} onExpand={this.onExpand}/>);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
RowWithFocusSensorCallbacks.propTypes =
|
|
25
|
+
Row.propTypes;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { HTMLAttributes, PureComponent } from 'react';
|
|
2
|
+
import { FocusSensorAddProps } from '../global/focus-sensor-hoc';
|
|
3
|
+
import { Column } from './header-cell';
|
|
4
|
+
import { SelectionItem } from './selection';
|
|
5
|
+
export interface RowProps<T extends SelectionItem> extends Omit<HTMLAttributes<HTMLTableRowElement>, 'onClick' | 'onDoubleClick' | 'onSelect'>, FocusSensorAddProps<HTMLTableRowElement> {
|
|
6
|
+
item: T;
|
|
7
|
+
columns: readonly Column<T>[];
|
|
8
|
+
selectable: boolean;
|
|
9
|
+
showFocus: boolean;
|
|
10
|
+
draggable: boolean;
|
|
11
|
+
alwaysShowDragHandle: boolean;
|
|
12
|
+
dragHandleTitle?: string;
|
|
13
|
+
selected: boolean;
|
|
14
|
+
onHover: (item: T, e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
15
|
+
onSelect: (item: T, selected: boolean) => void;
|
|
16
|
+
onDoubleClick: (item: T) => void;
|
|
17
|
+
onClick: (item: T, e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
18
|
+
level: number;
|
|
19
|
+
collapsible: boolean;
|
|
20
|
+
parentCollapsible: boolean;
|
|
21
|
+
collapsed: boolean;
|
|
22
|
+
onCollapse: (item: T) => void;
|
|
23
|
+
onExpand: (item: T) => void;
|
|
24
|
+
showDisabledSelection?: boolean | null | undefined;
|
|
25
|
+
checkboxTooltip?: string | undefined;
|
|
26
|
+
autofocus?: boolean | null | undefined;
|
|
27
|
+
'data-test'?: string | null | undefined;
|
|
28
|
+
metaColumnClassName?: string | null | undefined;
|
|
29
|
+
}
|
|
30
|
+
export default class Row<T extends SelectionItem> extends PureComponent<RowProps<T>> {
|
|
31
|
+
static defaultProps: {
|
|
32
|
+
selectable: boolean;
|
|
33
|
+
showFocus: boolean;
|
|
34
|
+
draggable: boolean;
|
|
35
|
+
alwaysShowDragHandle: boolean;
|
|
36
|
+
selected: boolean;
|
|
37
|
+
onHover: () => void;
|
|
38
|
+
onSelect: () => void;
|
|
39
|
+
onDoubleClick: () => void;
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
level: number;
|
|
42
|
+
collapsible: boolean;
|
|
43
|
+
parentCollapsible: boolean;
|
|
44
|
+
collapsed: boolean;
|
|
45
|
+
onCollapse: () => void;
|
|
46
|
+
onExpand: () => void;
|
|
47
|
+
};
|
|
48
|
+
id: string;
|
|
49
|
+
onMouseEnter: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
50
|
+
onClick: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
51
|
+
onCheckboxFocus: () => void;
|
|
52
|
+
onCheckboxChange: () => void;
|
|
53
|
+
toggleSelection(): void;
|
|
54
|
+
onDoubleClick: () => void;
|
|
55
|
+
row?: HTMLElement | null;
|
|
56
|
+
rowRef: (el: HTMLElement | null) => void;
|
|
57
|
+
render(): React.JSX.Element;
|
|
58
|
+
}
|
|
59
|
+
export type RowAttrs<T extends SelectionItem> = JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
5
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
6
|
+
import dragIcon from '@jetbrains/icons/drag';
|
|
7
|
+
import Checkbox from '../checkbox/checkbox';
|
|
8
|
+
import Button from '../button/button';
|
|
9
|
+
import Tooltip from '../tooltip/tooltip';
|
|
10
|
+
import dataTests from '../global/data-tests';
|
|
11
|
+
import getUID from '../global/get-uid';
|
|
12
|
+
import composeRefs from '../global/composeRefs';
|
|
13
|
+
import Cell from './cell';
|
|
14
|
+
import style from './table.css';
|
|
15
|
+
const DragHandle = ({ alwaysShowDragHandle, dragHandleTitle = 'Drag to reorder' }) => {
|
|
16
|
+
const classes = classNames(style.dragHandle, {
|
|
17
|
+
[style.visibleDragHandle]: alwaysShowDragHandle
|
|
18
|
+
});
|
|
19
|
+
return (<Button data-movable-handle title={dragHandleTitle} className={classes} icon={dragIcon}/>);
|
|
20
|
+
};
|
|
21
|
+
DragHandle.propTypes = {
|
|
22
|
+
alwaysShowDragHandle: PropTypes.bool,
|
|
23
|
+
dragHandleTitle: PropTypes.string
|
|
24
|
+
};
|
|
25
|
+
export default class Row extends PureComponent {
|
|
26
|
+
static defaultProps = {
|
|
27
|
+
selectable: true,
|
|
28
|
+
showFocus: false,
|
|
29
|
+
draggable: false,
|
|
30
|
+
alwaysShowDragHandle: false,
|
|
31
|
+
selected: false,
|
|
32
|
+
onHover: () => { },
|
|
33
|
+
onSelect: () => { },
|
|
34
|
+
onDoubleClick: () => { },
|
|
35
|
+
onClick: () => { },
|
|
36
|
+
level: 0,
|
|
37
|
+
collapsible: false,
|
|
38
|
+
parentCollapsible: false,
|
|
39
|
+
collapsed: false,
|
|
40
|
+
onCollapse: () => { },
|
|
41
|
+
onExpand: () => { }
|
|
42
|
+
};
|
|
43
|
+
id = getUID('table-row-');
|
|
44
|
+
onMouseEnter = (e) => {
|
|
45
|
+
const { item, onHover } = this.props;
|
|
46
|
+
onHover(item, e);
|
|
47
|
+
};
|
|
48
|
+
onClick = (e) => {
|
|
49
|
+
const { item } = this.props;
|
|
50
|
+
this.props.onClick(item, e);
|
|
51
|
+
if (e.shiftKey) {
|
|
52
|
+
this.toggleSelection();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
onCheckboxFocus = () => {
|
|
56
|
+
this.props.onFocusRestore();
|
|
57
|
+
};
|
|
58
|
+
onCheckboxChange = () => {
|
|
59
|
+
this.toggleSelection();
|
|
60
|
+
};
|
|
61
|
+
toggleSelection() {
|
|
62
|
+
const { selectable, selected, onSelect, item } = this.props;
|
|
63
|
+
if (selectable) {
|
|
64
|
+
onSelect(item, !selected);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
onDoubleClick = () => {
|
|
68
|
+
const { item } = this.props;
|
|
69
|
+
this.props.onDoubleClick(item);
|
|
70
|
+
};
|
|
71
|
+
row;
|
|
72
|
+
rowRef = (el) => {
|
|
73
|
+
this.row = el;
|
|
74
|
+
};
|
|
75
|
+
render() {
|
|
76
|
+
const { item, columns, selectable, selected, showFocus, draggable, alwaysShowDragHandle, dragHandleTitle, level, collapsible, parentCollapsible, collapsed, onCollapse, onExpand, showDisabledSelection, onSelect, checkboxTooltip, innerRef, focused, autofocus, onFocusReset, onFocusRestore, onHover, className, metaColumnClassName, 'data-test': dataTest, ...restProps } = this.props;
|
|
77
|
+
const classes = classNames(className, {
|
|
78
|
+
[style.row]: true,
|
|
79
|
+
[style.rowFocused]: showFocus,
|
|
80
|
+
[style.rowSelected]: selected
|
|
81
|
+
});
|
|
82
|
+
const testAttrs = {
|
|
83
|
+
'data-test-focused': showFocus || undefined,
|
|
84
|
+
'data-test-selected': selected || undefined
|
|
85
|
+
};
|
|
86
|
+
const metaColumnClasses = classNames(metaColumnClassName, style.metaColumn);
|
|
87
|
+
const SUBITEM_OFFSET = 30;
|
|
88
|
+
const COLLAPSIBLE_PARENT_OFFSET = 20;
|
|
89
|
+
const gap = level * SUBITEM_OFFSET + (parentCollapsible ? COLLAPSIBLE_PARENT_OFFSET : 0);
|
|
90
|
+
const metaColumnStyle = {
|
|
91
|
+
paddingLeft: `${gap}px`
|
|
92
|
+
};
|
|
93
|
+
const metaColumn = (<div className={metaColumnClasses} style={metaColumnStyle}>
|
|
94
|
+
{draggable && (<DragHandle alwaysShowDragHandle={alwaysShowDragHandle} dragHandleTitle={dragHandleTitle}/>)}
|
|
95
|
+
|
|
96
|
+
{selectable &&
|
|
97
|
+
(<Tooltip title={checkboxTooltip}>
|
|
98
|
+
<Checkbox aria-labelledby={this.id} className={showFocus ? 'ring-checkbox_focus' : ''} checked={selected} onFocus={this.onCheckboxFocus} onChange={this.onCheckboxChange} tabIndex={-1}/>
|
|
99
|
+
</Tooltip>)}
|
|
100
|
+
|
|
101
|
+
{!selectable && showDisabledSelection &&
|
|
102
|
+
(<Tooltip title={checkboxTooltip}>
|
|
103
|
+
<Checkbox aria-labelledby={this.id} checked={selected} disabled/>
|
|
104
|
+
</Tooltip>)}
|
|
105
|
+
|
|
106
|
+
{collapsible && collapsed &&
|
|
107
|
+
(<Button className={style.rowCollapseExpandButton} icon={chevronRightIcon} onClick={() => onExpand(item)}/>)}
|
|
108
|
+
|
|
109
|
+
{collapsible && !collapsed &&
|
|
110
|
+
(<Button className={style.rowCollapseExpandButton} icon={chevronDownIcon} onClick={() => onCollapse(item)}/>)}
|
|
111
|
+
</div>);
|
|
112
|
+
const cells = columns.map((column, index) => {
|
|
113
|
+
const getValue = column.getValue || (() => item[column.id]);
|
|
114
|
+
const getDataTest = column.getDataTest || (() => column.id);
|
|
115
|
+
const value = getValue(item, column);
|
|
116
|
+
const cellClasses = classNames({ [style.cellRight]: column.rightAlign }, column.className);
|
|
117
|
+
const showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
|
118
|
+
return (<Cell key={column.id} className={cellClasses} data-test={getDataTest(item, column)}>
|
|
119
|
+
{index === 0 && (showMetaColumn) && metaColumn}
|
|
120
|
+
{value}
|
|
121
|
+
</Cell>);
|
|
122
|
+
});
|
|
123
|
+
return (<tr id={this.id} ref={composeRefs(this.rowRef, innerRef)} className={classes} tabIndex={0} data-test={dataTests('ring-table-row', dataTest)} {...testAttrs} {...restProps} onMouseMove={this.onMouseEnter} onClick={this.onClick} onDoubleClick={this.onDoubleClick}>{cells}</tr>);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
Row.propTypes = {
|
|
127
|
+
className: PropTypes.string,
|
|
128
|
+
metaColumnClassName: PropTypes.string,
|
|
129
|
+
item: PropTypes.object.isRequired,
|
|
130
|
+
columns: PropTypes.array.isRequired,
|
|
131
|
+
selectable: PropTypes.bool,
|
|
132
|
+
showFocus: PropTypes.bool,
|
|
133
|
+
draggable: PropTypes.bool,
|
|
134
|
+
alwaysShowDragHandle: PropTypes.bool,
|
|
135
|
+
selected: PropTypes.bool,
|
|
136
|
+
onHover: PropTypes.func,
|
|
137
|
+
onSelect: PropTypes.func,
|
|
138
|
+
onDoubleClick: PropTypes.func,
|
|
139
|
+
onClick: PropTypes.func,
|
|
140
|
+
onFocusRestore: PropTypes.func,
|
|
141
|
+
level: PropTypes.number,
|
|
142
|
+
collapsible: PropTypes.bool,
|
|
143
|
+
parentCollapsible: PropTypes.bool,
|
|
144
|
+
collapsed: PropTypes.bool,
|
|
145
|
+
onCollapse: PropTypes.func,
|
|
146
|
+
onExpand: PropTypes.func,
|
|
147
|
+
showDisabledSelection: PropTypes.bool,
|
|
148
|
+
checkboxTooltip: PropTypes.string,
|
|
149
|
+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
150
|
+
focused: PropTypes.bool,
|
|
151
|
+
autofocus: PropTypes.bool,
|
|
152
|
+
onFocusReset: PropTypes.func,
|
|
153
|
+
'data-test': PropTypes.string
|
|
154
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { ShortcutsMap } from '../shortcuts/core';
|
|
3
|
+
import Selection, { SelectionItem } from './selection';
|
|
4
|
+
export interface SelectionShortcutsOuterProps<T extends SelectionItem> {
|
|
5
|
+
selection: Selection<T>;
|
|
6
|
+
selectable?: boolean | undefined;
|
|
7
|
+
onSelect?: ((selection: Selection<T>) => void) | undefined;
|
|
8
|
+
shortcuts?: ShortcutsMap | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface SelectionShortcutsAddProps<T extends SelectionItem> {
|
|
11
|
+
selection: Selection<T>;
|
|
12
|
+
selectable: boolean;
|
|
13
|
+
onSelect: (selection: Selection<T>) => void;
|
|
14
|
+
shortcutsMap: ShortcutsMap;
|
|
15
|
+
}
|
|
16
|
+
export type SelectionShortcutsProps<T extends SelectionItem, P> = Omit<P, keyof SelectionShortcutsAddProps<T>> & SelectionShortcutsOuterProps<T>;
|
|
17
|
+
export default function selectionShortcutsHOC<T extends SelectionItem, P extends SelectionShortcutsAddProps<T>>(ComposedComponent: ComponentType<P>): ComponentType<SelectionShortcutsProps<T, P>>;
|