@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,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name Data List
|
|
3
|
+
*/
|
|
4
|
+
import React, { PureComponent, Component } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import focusSensorHOC from '../global/focus-sensor-hoc';
|
|
8
|
+
import selectionShortcutsHOC from '../table/selection-shortcuts-hoc';
|
|
9
|
+
import disableHoverHOC from '../table/disable-hover-hoc';
|
|
10
|
+
import getUID from '../global/get-uid';
|
|
11
|
+
import Shortcuts from '../shortcuts/shortcuts';
|
|
12
|
+
import Loader from '../loader/loader';
|
|
13
|
+
import { refObject } from '../global/prop-types';
|
|
14
|
+
import Item, { moreLessButtonStates } from './item';
|
|
15
|
+
import styles from './data-list.css';
|
|
16
|
+
import Selection from './selection';
|
|
17
|
+
class DataList extends PureComponent {
|
|
18
|
+
static defaultProps = {
|
|
19
|
+
loading: false,
|
|
20
|
+
onItemMoreLess: () => { },
|
|
21
|
+
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
22
|
+
remoteSelection: false
|
|
23
|
+
};
|
|
24
|
+
componentDidUpdate(prevProps) {
|
|
25
|
+
const { data, selection, onSelect, selectable } = this.props;
|
|
26
|
+
if (data !== prevProps.data && !prevProps.remoteSelection) {
|
|
27
|
+
onSelect(selection.cloneWith({ data }));
|
|
28
|
+
}
|
|
29
|
+
if (!selectable && prevProps.selectable) {
|
|
30
|
+
onSelect(selection.resetSelection());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
shortcutsScope = getUID('ring-data-list-');
|
|
34
|
+
onItemFocus = (item) => {
|
|
35
|
+
const { selection, onSelect } = this.props;
|
|
36
|
+
onSelect(selection.focus(item));
|
|
37
|
+
};
|
|
38
|
+
onItemSelect = (item, selected) => {
|
|
39
|
+
const { selection, onSelect } = this.props;
|
|
40
|
+
if (selected) {
|
|
41
|
+
onSelect(selection.select(item));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
onSelect(selection.deselect(item));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
onEqualPress = () => {
|
|
48
|
+
const { selection, itemFormatter } = this.props;
|
|
49
|
+
const focused = selection.getFocused();
|
|
50
|
+
if (focused == null) {
|
|
51
|
+
throw new Error('No focused item');
|
|
52
|
+
}
|
|
53
|
+
const item = itemFormatter(focused);
|
|
54
|
+
if (item.collapsed) {
|
|
55
|
+
item.onExpand?.();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
item.onCollapse?.();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
shortcutsMap = {
|
|
62
|
+
'=': this.onEqualPress
|
|
63
|
+
};
|
|
64
|
+
render() {
|
|
65
|
+
const { data, className, loading, selection, disabledHover, itemFormatter, focused, innerRef } = this.props;
|
|
66
|
+
const shortcutsMap = { ...this.shortcutsMap, ...this.props.shortcutsMap };
|
|
67
|
+
const classes = classNames(className, {
|
|
68
|
+
[styles.dataList]: true,
|
|
69
|
+
[styles.disabledHover]: disabledHover,
|
|
70
|
+
[styles.multiSelection]: selection.getSelected().size > 0
|
|
71
|
+
});
|
|
72
|
+
return (<div className={styles.dataListWrapper} data-test="ring-data-list" ref={innerRef}>
|
|
73
|
+
{focused &&
|
|
74
|
+
(<Shortcuts map={shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
75
|
+
|
|
76
|
+
<ul className={classes}>
|
|
77
|
+
{data.map(model => {
|
|
78
|
+
const item = itemFormatter(model);
|
|
79
|
+
const { id, key, title, items } = item;
|
|
80
|
+
const showMoreLessButton = this.props.itemMoreLessState?.(item);
|
|
81
|
+
return (<Item key={key || id} item={model} title={title} items={items} itemFormatter={itemFormatter} collapsible={item.collapsible} collapsed={item.collapsed} onCollapse={item.onCollapse} onExpand={item.onExpand} showFocus={selection.isFocused(model)} onFocus={this.onItemFocus} selection={selection} selectable={item.selectable} selected={selection.isSelected(model)} onSelect={this.onItemSelect} showMoreLessButton={showMoreLessButton} onItemMoreLess={this.props.onItemMoreLess}/>);
|
|
82
|
+
})}
|
|
83
|
+
</ul>
|
|
84
|
+
|
|
85
|
+
{loading && (<div className={data.length > 0 ? styles.loadingOverlay : undefined}>
|
|
86
|
+
<Loader />
|
|
87
|
+
</div>)}
|
|
88
|
+
</div>);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
DataList.propTypes = {
|
|
92
|
+
className: PropTypes.string,
|
|
93
|
+
data: PropTypes.array.isRequired,
|
|
94
|
+
loading: PropTypes.bool,
|
|
95
|
+
focused: PropTypes.bool.isRequired,
|
|
96
|
+
disabledHover: PropTypes.bool,
|
|
97
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
|
98
|
+
selectable: PropTypes.bool.isRequired,
|
|
99
|
+
shortcutsMap: PropTypes.shape({}).isRequired,
|
|
100
|
+
innerRef: PropTypes.oneOfType([
|
|
101
|
+
refObject(PropTypes.instanceOf(HTMLDivElement)),
|
|
102
|
+
PropTypes.func
|
|
103
|
+
]),
|
|
104
|
+
itemFormatter: PropTypes.func.isRequired,
|
|
105
|
+
onItemMoreLess: PropTypes.func,
|
|
106
|
+
itemMoreLessState: PropTypes.func,
|
|
107
|
+
onSelect: PropTypes.func.isRequired,
|
|
108
|
+
remoteSelection: PropTypes.bool
|
|
109
|
+
};
|
|
110
|
+
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
|
111
|
+
// eslint-disable-next-line react/no-multi-comp
|
|
112
|
+
export default class DataListContainer extends Component {
|
|
113
|
+
static propTypes = getContainer().propTypes;
|
|
114
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
115
|
+
DataList = getContainer();
|
|
116
|
+
render() {
|
|
117
|
+
return <this.DataList {...this.props}/>;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { SelectionItem } from '../table/selection';
|
|
3
|
+
export interface Item extends SelectionItem {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
collapsible?: boolean;
|
|
6
|
+
selectable?: boolean;
|
|
7
|
+
items?: Item[];
|
|
8
|
+
}
|
|
9
|
+
declare const items: Item[];
|
|
10
|
+
export declare const moreItems: {
|
|
11
|
+
id: number;
|
|
12
|
+
selectable: boolean;
|
|
13
|
+
collapsible: boolean;
|
|
14
|
+
title: React.JSX.Element;
|
|
15
|
+
}[];
|
|
16
|
+
export default items;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-literals */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Link from '../link/link';
|
|
4
|
+
import Badge from '../badge/badge';
|
|
5
|
+
const items = [
|
|
6
|
+
{
|
|
7
|
+
id: 1,
|
|
8
|
+
title: <span><strong>Assigner</strong> in 60 projects</span>,
|
|
9
|
+
collapsible: true,
|
|
10
|
+
selectable: true,
|
|
11
|
+
items: [
|
|
12
|
+
{
|
|
13
|
+
id: 11,
|
|
14
|
+
title: '6 projects: as a member of jetbrains-team',
|
|
15
|
+
collapsible: true,
|
|
16
|
+
selectable: true,
|
|
17
|
+
items: [
|
|
18
|
+
{
|
|
19
|
+
id: 111,
|
|
20
|
+
selectable: true,
|
|
21
|
+
title: <Link href="#">TeamCity</Link>
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 112,
|
|
25
|
+
selectable: true,
|
|
26
|
+
title: <Link href="#">YouTrack</Link>
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 113,
|
|
30
|
+
selectable: true,
|
|
31
|
+
title: <Link href="#">Sandbox</Link>
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 114,
|
|
35
|
+
selectable: true,
|
|
36
|
+
title: <Link href="#">Exception Analyzer</Link>
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 115,
|
|
40
|
+
selectable: true,
|
|
41
|
+
title: <Link href="#">MPS</Link>
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 2,
|
|
49
|
+
title: <span><strong>Code Reviewer</strong> in 5 projects</span>,
|
|
50
|
+
selectable: true,
|
|
51
|
+
collapsible: true,
|
|
52
|
+
items: [
|
|
53
|
+
{
|
|
54
|
+
id: 21,
|
|
55
|
+
selectable: true,
|
|
56
|
+
title: (<span>
|
|
57
|
+
<Link href="#">JetProfile</Link>
|
|
58
|
+
<span> </span>
|
|
59
|
+
<Badge gray>duplicate</Badge>
|
|
60
|
+
</span>)
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 22,
|
|
64
|
+
title: '6 projects: as a member of jetbrains-team',
|
|
65
|
+
collapsible: true,
|
|
66
|
+
items: [
|
|
67
|
+
{
|
|
68
|
+
id: 221,
|
|
69
|
+
collapsible: true,
|
|
70
|
+
title: <Link href="#">TeamCity</Link>
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 222,
|
|
74
|
+
collapsible: true,
|
|
75
|
+
title: <Link href="#">YouTrack</Link>
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 223,
|
|
79
|
+
collapsible: true,
|
|
80
|
+
title: <Link href="#">Sandbox</Link>
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 224,
|
|
84
|
+
collapsible: true,
|
|
85
|
+
title: <Link href="#">Exception Analyzer</Link>
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 225,
|
|
89
|
+
collapsible: true,
|
|
90
|
+
title: <Link href="#">MPS</Link>
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 23,
|
|
96
|
+
collapsible: true,
|
|
97
|
+
title: (<span>
|
|
98
|
+
<Link href="#">CustomJDK</Link>
|
|
99
|
+
<span>: as a member of ide-developers</span>
|
|
100
|
+
</span>)
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 3,
|
|
106
|
+
title: <span><strong>Code Viewer</strong> in 5 projects</span>,
|
|
107
|
+
selectable: true,
|
|
108
|
+
collapsible: true,
|
|
109
|
+
items: [
|
|
110
|
+
{
|
|
111
|
+
id: 31,
|
|
112
|
+
collapsible: true,
|
|
113
|
+
title: (<span>
|
|
114
|
+
<Link href="#">ide-frontend</Link>
|
|
115
|
+
<span>: as a member of ide-developers</span>
|
|
116
|
+
</span>)
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 32,
|
|
120
|
+
collapsible: true,
|
|
121
|
+
title: (<span>
|
|
122
|
+
<Link href="#">ide-frontend</Link>
|
|
123
|
+
<span>: as a member of ide-frontend Code Viewers</span>
|
|
124
|
+
</span>)
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 4,
|
|
130
|
+
title: <span><strong>Commenter</strong> in 12 projects</span>,
|
|
131
|
+
collapsible: true,
|
|
132
|
+
items: [
|
|
133
|
+
{
|
|
134
|
+
id: 41,
|
|
135
|
+
collapsible: true,
|
|
136
|
+
title: (<span>
|
|
137
|
+
<Link href="#">Intellij IDEA</Link>
|
|
138
|
+
<span>: as a member of Registered Users</span>
|
|
139
|
+
</span>)
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 42,
|
|
143
|
+
collapsible: true,
|
|
144
|
+
title: (<span>
|
|
145
|
+
<Link href="#">YouTrack Backlog</Link>
|
|
146
|
+
<span>: as a member of jetbrains-team</span>
|
|
147
|
+
</span>)
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 5,
|
|
153
|
+
collapsible: true,
|
|
154
|
+
title: (<span>
|
|
155
|
+
<strong>Developer</strong>
|
|
156
|
+
<span> in 57 projects </span>
|
|
157
|
+
<Badge>team role</Badge>
|
|
158
|
+
</span>),
|
|
159
|
+
items: [
|
|
160
|
+
{
|
|
161
|
+
id: 51,
|
|
162
|
+
selectable: true,
|
|
163
|
+
collapsible: true,
|
|
164
|
+
title: <Link href="#">Wasabi</Link>
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 6,
|
|
170
|
+
collapsible: true,
|
|
171
|
+
title: (<span>
|
|
172
|
+
<strong>Git Hosting Admin</strong>
|
|
173
|
+
<span> in project </span>
|
|
174
|
+
<Link href="#">Hackathon 2016</Link>
|
|
175
|
+
<span>: as a member of jetbrains-team</span>
|
|
176
|
+
</span>)
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 7,
|
|
180
|
+
title: <span><strong>Git Hosting Checkout</strong> in 7 projects</span>,
|
|
181
|
+
selectable: true,
|
|
182
|
+
collapsible: true
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
export const moreItems = [
|
|
186
|
+
{
|
|
187
|
+
id: 91,
|
|
188
|
+
selectable: true,
|
|
189
|
+
collapsible: true,
|
|
190
|
+
title: (<span>
|
|
191
|
+
<Link href="#">More item 1</Link>
|
|
192
|
+
<span> </span>
|
|
193
|
+
<Badge gray>duplicate</Badge>
|
|
194
|
+
</span>)
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 92,
|
|
198
|
+
selectable: true,
|
|
199
|
+
collapsible: true,
|
|
200
|
+
title: (<span>
|
|
201
|
+
<Link href="#">More item 2</Link>
|
|
202
|
+
<span> </span>
|
|
203
|
+
<Badge gray>duplicate</Badge>
|
|
204
|
+
</span>)
|
|
205
|
+
}
|
|
206
|
+
];
|
|
207
|
+
export default items;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { PureComponent, ReactNode } from 'react';
|
|
2
|
+
import Selection, { SelectionItem } from '../table/selection';
|
|
3
|
+
export declare enum moreLessButtonStates {
|
|
4
|
+
UNUSED = 0,
|
|
5
|
+
MORE = 1,
|
|
6
|
+
MORE_LOADING = 2,
|
|
7
|
+
LESS = 3
|
|
8
|
+
}
|
|
9
|
+
export interface BaseFormattedItem<T> {
|
|
10
|
+
items?: readonly T[];
|
|
11
|
+
title?: ReactNode;
|
|
12
|
+
collapsible?: boolean | null | undefined;
|
|
13
|
+
collapsed?: boolean | null | undefined;
|
|
14
|
+
onCollapse?: () => void;
|
|
15
|
+
onExpand?: () => void;
|
|
16
|
+
selectable?: boolean | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface FormattedItem<T> extends BaseFormattedItem<T> {
|
|
19
|
+
key?: string | null | undefined;
|
|
20
|
+
id?: string | number | null | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface ItemProps<T extends SelectionItem> extends BaseFormattedItem<T> {
|
|
23
|
+
item: T;
|
|
24
|
+
onFocus: (item: T) => void;
|
|
25
|
+
onSelect: (item: T, selected: boolean) => void;
|
|
26
|
+
itemFormatter: (item: T) => FormattedItem<T>;
|
|
27
|
+
level: number;
|
|
28
|
+
parentShift: number;
|
|
29
|
+
showMoreLessButton: moreLessButtonStates;
|
|
30
|
+
onItemMoreLess: (item: T, more: boolean) => void;
|
|
31
|
+
className?: string | null | undefined;
|
|
32
|
+
showFocus?: boolean | undefined;
|
|
33
|
+
selection: Selection<T>;
|
|
34
|
+
selected?: boolean | undefined;
|
|
35
|
+
}
|
|
36
|
+
export default class Item<T extends SelectionItem> extends PureComponent<ItemProps<T>> {
|
|
37
|
+
static defaultProps: {
|
|
38
|
+
items: never[];
|
|
39
|
+
level: number;
|
|
40
|
+
parentShift: number;
|
|
41
|
+
showMoreLessButton: moreLessButtonStates;
|
|
42
|
+
onItemMoreLess: () => void;
|
|
43
|
+
};
|
|
44
|
+
onShowMore: () => void;
|
|
45
|
+
onShowLess: () => void;
|
|
46
|
+
onFocus: () => void;
|
|
47
|
+
onSelect: (selected: boolean) => void;
|
|
48
|
+
renderItem: (model: T, parentShift: number) => React.JSX.Element;
|
|
49
|
+
render(): React.JSX.Element;
|
|
50
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
4
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
5
|
+
import Link from '../link/link';
|
|
6
|
+
import Text from '../text/text';
|
|
7
|
+
import LoaderInline from '../loader-inline/loader-inline';
|
|
8
|
+
import Button from '../button/button';
|
|
9
|
+
import Selection from '../table/selection';
|
|
10
|
+
import Title from './title';
|
|
11
|
+
import styles from './data-list.css';
|
|
12
|
+
export var moreLessButtonStates;
|
|
13
|
+
(function (moreLessButtonStates) {
|
|
14
|
+
moreLessButtonStates[moreLessButtonStates["UNUSED"] = 0] = "UNUSED";
|
|
15
|
+
moreLessButtonStates[moreLessButtonStates["MORE"] = 1] = "MORE";
|
|
16
|
+
moreLessButtonStates[moreLessButtonStates["MORE_LOADING"] = 2] = "MORE_LOADING";
|
|
17
|
+
moreLessButtonStates[moreLessButtonStates["LESS"] = 3] = "LESS";
|
|
18
|
+
})(moreLessButtonStates || (moreLessButtonStates = {}));
|
|
19
|
+
const ITEM_LEFT_OFFSET = 32;
|
|
20
|
+
const LIST_LEFT_OFFSET = 24;
|
|
21
|
+
export default class Item extends PureComponent {
|
|
22
|
+
static defaultProps = {
|
|
23
|
+
items: [],
|
|
24
|
+
level: 0,
|
|
25
|
+
parentShift: 0,
|
|
26
|
+
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
27
|
+
onItemMoreLess: () => { }
|
|
28
|
+
};
|
|
29
|
+
onShowMore = () => {
|
|
30
|
+
const { onItemMoreLess, item } = this.props;
|
|
31
|
+
onItemMoreLess(item, true);
|
|
32
|
+
};
|
|
33
|
+
onShowLess = () => {
|
|
34
|
+
const { onItemMoreLess, item } = this.props;
|
|
35
|
+
onItemMoreLess(item, false);
|
|
36
|
+
};
|
|
37
|
+
onFocus = () => {
|
|
38
|
+
const { onFocus, item } = this.props;
|
|
39
|
+
onFocus(item);
|
|
40
|
+
};
|
|
41
|
+
onSelect = (selected) => {
|
|
42
|
+
const { onSelect, item } = this.props;
|
|
43
|
+
onSelect(item, selected);
|
|
44
|
+
};
|
|
45
|
+
renderItem = (model, parentShift) => {
|
|
46
|
+
const { onFocus, onSelect, selection, level, itemFormatter } = this.props;
|
|
47
|
+
const item = itemFormatter(model);
|
|
48
|
+
return (<Item key={item.key || item.id} item={model} title={item.title} items={item.items} level={level + 1} parentShift={parentShift} itemFormatter={itemFormatter} collapsible={item.collapsible} collapsed={item.collapsed} onCollapse={item.onCollapse} onExpand={item.onExpand} showFocus={selection.isFocused(model)} onFocus={onFocus} selection={selection} selectable={item.selectable} selected={selection.isSelected(model)} onSelect={onSelect}/>);
|
|
49
|
+
};
|
|
50
|
+
render() {
|
|
51
|
+
const { title, items, showMoreLessButton, level, parentShift, showFocus, selectable, selected, collapsible, collapsed, onCollapse, onExpand } = this.props;
|
|
52
|
+
let moreLessButton;
|
|
53
|
+
if (showMoreLessButton === moreLessButtonStates.MORE ||
|
|
54
|
+
showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
|
55
|
+
moreLessButton = (<Text info>
|
|
56
|
+
<Link inherit pseudo onClick={this.onShowMore}>{'Show more'}</Link>
|
|
57
|
+
{showMoreLessButton === moreLessButtonStates.MORE_LOADING &&
|
|
58
|
+
<LoaderInline className={styles.showMoreLoader}/>}
|
|
59
|
+
</Text>);
|
|
60
|
+
}
|
|
61
|
+
else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
|
62
|
+
moreLessButton = (<Text info>
|
|
63
|
+
<Link inherit pseudo onClick={this.onShowLess}>{'Show less'}</Link>
|
|
64
|
+
</Text>);
|
|
65
|
+
}
|
|
66
|
+
let collapserExpander = null;
|
|
67
|
+
if (collapsible) {
|
|
68
|
+
if (collapsed) {
|
|
69
|
+
collapserExpander = (<Button title="Expand" onClick={onExpand} icon={chevronRightIcon} className={styles.collapseButton} iconClassName={styles.collapseIcon} data-test="ring-data-list-expand"/>);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
collapserExpander = (<Button title="Collapse" onClick={onCollapse} icon={chevronDownIcon} className={styles.collapseButton} iconClassName={styles.collapseIcon} data-test="ring-data-list-collapse"/>);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const itemIsEmpty = !items?.length || (collapsible && collapsed);
|
|
76
|
+
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
|
77
|
+
return (<li>
|
|
78
|
+
<Title title={title} focused={showFocus} showFocus={showFocus} selectable={selectable} selected={selected} collapserExpander={collapserExpander} onFocus={this.onFocus} onSelect={this.onSelect} offset={offset}/>
|
|
79
|
+
|
|
80
|
+
{!itemIsEmpty
|
|
81
|
+
? (<ul className={styles.itemContent}>
|
|
82
|
+
{items.map(model => this.renderItem(model, parentShift))}
|
|
83
|
+
|
|
84
|
+
{showMoreLessButton !== moreLessButtonStates.UNUSED
|
|
85
|
+
? <li className={styles.showMore}>{moreLessButton}</li>
|
|
86
|
+
: null}
|
|
87
|
+
</ul>)
|
|
88
|
+
: null}
|
|
89
|
+
</li>);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
Item.propTypes = {
|
|
93
|
+
item: PropTypes.shape({
|
|
94
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
95
|
+
}).isRequired,
|
|
96
|
+
title: PropTypes.node,
|
|
97
|
+
items: PropTypes.array,
|
|
98
|
+
className: PropTypes.string,
|
|
99
|
+
level: PropTypes.number,
|
|
100
|
+
parentShift: PropTypes.number,
|
|
101
|
+
itemFormatter: PropTypes.func.isRequired,
|
|
102
|
+
collapsible: PropTypes.bool,
|
|
103
|
+
collapsed: PropTypes.bool,
|
|
104
|
+
onCollapse: PropTypes.func,
|
|
105
|
+
onExpand: PropTypes.func,
|
|
106
|
+
showFocus: PropTypes.bool,
|
|
107
|
+
onFocus: PropTypes.func.isRequired,
|
|
108
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
|
109
|
+
selectable: PropTypes.bool,
|
|
110
|
+
selected: PropTypes.bool,
|
|
111
|
+
onSelect: PropTypes.func.isRequired,
|
|
112
|
+
showMoreLessButton: PropTypes.number,
|
|
113
|
+
onItemMoreLess: PropTypes.func
|
|
114
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import TableSelection, { CloneWithConfig, SelectionItem } from '../table/selection';
|
|
2
|
+
export default class Selection<T extends SelectionItem> extends TableSelection<T> {
|
|
3
|
+
protected _buildData(data: T[]): Set<T>;
|
|
4
|
+
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
|
5
|
+
private _getDescendants;
|
|
6
|
+
private _getAncestors;
|
|
7
|
+
private _selectDescendants;
|
|
8
|
+
private _deselectDescendants;
|
|
9
|
+
private _selectAncestors;
|
|
10
|
+
private _deselectAncestors;
|
|
11
|
+
select(value?: T | null): Selection<T>;
|
|
12
|
+
focus(value: T | null | undefined): Selection<T>;
|
|
13
|
+
resetSelection(): Selection<T>;
|
|
14
|
+
cloneWith(config: CloneWithConfig<T>): Selection<T>;
|
|
15
|
+
deselect(value?: T | null): Selection<T>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import TableSelection from '../table/selection';
|
|
2
|
+
export default class Selection extends TableSelection {
|
|
3
|
+
_buildData(data) {
|
|
4
|
+
return new Set(this._getDescendants(data));
|
|
5
|
+
}
|
|
6
|
+
_buildSelected(data, selected) {
|
|
7
|
+
const _selected = new Set(selected);
|
|
8
|
+
[...data].forEach(item => {
|
|
9
|
+
if (_selected.has(item)) {
|
|
10
|
+
this._selectDescendants(item, _selected);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return _selected;
|
|
14
|
+
}
|
|
15
|
+
_getDescendants(items) {
|
|
16
|
+
let result = [];
|
|
17
|
+
items.forEach(item => {
|
|
18
|
+
result.push(item);
|
|
19
|
+
result = [...result, ...this._getDescendants(this._getChildren(item))];
|
|
20
|
+
});
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
_getAncestors(item) {
|
|
24
|
+
let result = [];
|
|
25
|
+
const parent = [...this._data].find(it => this._getChildren(it).includes(item));
|
|
26
|
+
if (parent) {
|
|
27
|
+
result = [parent, ...this._getAncestors(parent)];
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
_selectDescendants(item, selected) {
|
|
32
|
+
this._getDescendants(this._getChildren(item)).
|
|
33
|
+
forEach(it => selected.add(it));
|
|
34
|
+
}
|
|
35
|
+
_deselectDescendants(item, selected) {
|
|
36
|
+
this._getDescendants(this._getChildren(item)).
|
|
37
|
+
forEach(it => selected.delete(it));
|
|
38
|
+
}
|
|
39
|
+
_selectAncestors(item, selected) {
|
|
40
|
+
this._getAncestors(item).forEach(ancestor => {
|
|
41
|
+
const groupIsSelected = this._getChildren(ancestor).
|
|
42
|
+
filter(it => this._isItemSelectable(it)).
|
|
43
|
+
every(it => selected.has(it));
|
|
44
|
+
if (groupIsSelected) {
|
|
45
|
+
selected.add(ancestor);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
_deselectAncestors(item, selected) {
|
|
50
|
+
this._getAncestors(item).forEach(it => selected.delete(it));
|
|
51
|
+
}
|
|
52
|
+
select(value = this._focused) {
|
|
53
|
+
if (!value || !this._isItemSelectable(value)) {
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
const selected = new Set(this._selected);
|
|
57
|
+
selected.add(value);
|
|
58
|
+
this._selectDescendants(value, selected);
|
|
59
|
+
this._selectAncestors(value, selected);
|
|
60
|
+
return this.cloneWith({ selected });
|
|
61
|
+
}
|
|
62
|
+
focus(value) {
|
|
63
|
+
return super.focus(value);
|
|
64
|
+
}
|
|
65
|
+
resetSelection() {
|
|
66
|
+
return super.resetSelection();
|
|
67
|
+
}
|
|
68
|
+
cloneWith(config) {
|
|
69
|
+
return super.cloneWith(config);
|
|
70
|
+
}
|
|
71
|
+
deselect(value = this._focused) {
|
|
72
|
+
if (!value || !this._isItemSelectable(value)) {
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
const selected = new Set(this._selected);
|
|
76
|
+
selected.delete(value);
|
|
77
|
+
this._deselectDescendants(value, selected);
|
|
78
|
+
this._deselectAncestors(value, selected);
|
|
79
|
+
return this.cloneWith({ selected });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { PureComponent, ReactNode } from 'react';
|
|
2
|
+
import { FocusSensorAddProps } from '../global/focus-sensor-hoc';
|
|
3
|
+
export interface TitleProps extends FocusSensorAddProps<HTMLDivElement> {
|
|
4
|
+
onSelect: (selected: boolean) => void;
|
|
5
|
+
selectable?: boolean | undefined;
|
|
6
|
+
selected?: boolean | undefined;
|
|
7
|
+
showFocus?: boolean | undefined;
|
|
8
|
+
offset?: number | undefined;
|
|
9
|
+
className?: string | null | undefined;
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
collapserExpander?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare class Title extends PureComponent<TitleProps> {
|
|
14
|
+
static defaultProps: {
|
|
15
|
+
selectable: boolean;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
showFocus: boolean;
|
|
18
|
+
};
|
|
19
|
+
id: string;
|
|
20
|
+
onCheckboxFocus: () => void;
|
|
21
|
+
onCheckboxChange: () => void;
|
|
22
|
+
toggleSelection(): void;
|
|
23
|
+
render(): React.JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: React.ComponentType<import("../global/focus-sensor-hoc").FocusSensorProps<TitleProps, HTMLDivElement, typeof Title>>;
|
|
26
|
+
export default _default;
|