@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,146 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Selection from './selection';
|
|
4
|
+
function extractPropTypes({ propTypes }) {
|
|
5
|
+
if (propTypes == null) {
|
|
6
|
+
return propTypes;
|
|
7
|
+
}
|
|
8
|
+
const { selection, selectable, onSelect, shortcutsMap, ...restPropTypes } = propTypes;
|
|
9
|
+
return restPropTypes;
|
|
10
|
+
}
|
|
11
|
+
export default function selectionShortcutsHOC(ComposedComponent) {
|
|
12
|
+
class SelectionShortcuts extends PureComponent {
|
|
13
|
+
onUpPress = () => {
|
|
14
|
+
const { selection, onSelect } = this.props;
|
|
15
|
+
const newSelection = selection.moveUp();
|
|
16
|
+
if (newSelection) {
|
|
17
|
+
onSelect?.(newSelection);
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
onDownPress = () => {
|
|
22
|
+
const { selection, onSelect } = this.props;
|
|
23
|
+
const newSelection = selection.moveDown();
|
|
24
|
+
if (newSelection) {
|
|
25
|
+
onSelect?.(newSelection);
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
shiftSelectionMode;
|
|
30
|
+
onShiftKeyDown = () => {
|
|
31
|
+
const { selection } = this.props;
|
|
32
|
+
if (selection.isSelected(selection.getFocused())) {
|
|
33
|
+
this.shiftSelectionMode = 'deletion';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.shiftSelectionMode = 'addition';
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
shiftSelect = (selection) => {
|
|
40
|
+
if (this.shiftSelectionMode === 'addition') {
|
|
41
|
+
return selection.select();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return selection.deselect();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
onShiftUpPress = (e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
const { selectable, selection, onSelect } = this.props;
|
|
50
|
+
if (!selectable) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const newSelection = this.shiftSelect(selection);
|
|
54
|
+
const newMovedSelection = newSelection.moveUp();
|
|
55
|
+
if (newMovedSelection) {
|
|
56
|
+
onSelect?.(newMovedSelection);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
onSelect?.(newSelection);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
onShiftDownPress = (e) => {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
const { selectable, selection, onSelect } = this.props;
|
|
65
|
+
if (!selectable) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const newSelection = this.shiftSelect(selection);
|
|
69
|
+
const newMovedSelection = newSelection.moveDown();
|
|
70
|
+
if (newMovedSelection) {
|
|
71
|
+
onSelect?.(newMovedSelection);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
onSelect?.(newSelection);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
onHomePress = () => {
|
|
78
|
+
const { selection, onSelect } = this.props;
|
|
79
|
+
const newSelection = selection.moveStart();
|
|
80
|
+
if (newSelection) {
|
|
81
|
+
onSelect?.(newSelection);
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
};
|
|
85
|
+
onEndPress = () => {
|
|
86
|
+
const { selection, onSelect } = this.props;
|
|
87
|
+
const newSelection = selection.moveEnd();
|
|
88
|
+
if (newSelection) {
|
|
89
|
+
onSelect?.(newSelection);
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
};
|
|
93
|
+
onSpacePress = () => {
|
|
94
|
+
const { selectable, selection, onSelect } = this.props;
|
|
95
|
+
if (!selectable) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
onSelect?.(selection.toggleSelection());
|
|
99
|
+
return false;
|
|
100
|
+
};
|
|
101
|
+
onEscPress = () => {
|
|
102
|
+
const { selection, onSelect } = this.props;
|
|
103
|
+
onSelect?.(selection.reset());
|
|
104
|
+
//this.restoreFocusWithoutScroll();
|
|
105
|
+
};
|
|
106
|
+
onCmdAPress = () => {
|
|
107
|
+
const { selectable, selection, onSelect } = this.props;
|
|
108
|
+
if (!selectable) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
onSelect?.(selection.selectAll());
|
|
112
|
+
return false;
|
|
113
|
+
};
|
|
114
|
+
shortcutsMap = {
|
|
115
|
+
up: this.onUpPress,
|
|
116
|
+
down: this.onDownPress,
|
|
117
|
+
shift: this.onShiftKeyDown,
|
|
118
|
+
'shift+up': this.onShiftUpPress,
|
|
119
|
+
'shift+down': this.onShiftDownPress,
|
|
120
|
+
home: this.onHomePress,
|
|
121
|
+
end: this.onEndPress,
|
|
122
|
+
space: this.onSpacePress,
|
|
123
|
+
esc: this.onEscPress,
|
|
124
|
+
'command+a': this.onCmdAPress,
|
|
125
|
+
'ctrl+a': this.onCmdAPress
|
|
126
|
+
};
|
|
127
|
+
render() {
|
|
128
|
+
const { selection, selectable, onSelect, shortcuts, ...restProps } = this.props;
|
|
129
|
+
return (<ComposedComponent {...restProps} selection={selection} selectable={selectable} onSelect={onSelect} shortcutsMap={{ ...this.shortcutsMap, ...this.props.shortcuts }}/>);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
SelectionShortcuts.propTypes = {
|
|
133
|
+
...extractPropTypes(ComposedComponent),
|
|
134
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
|
135
|
+
selectable: PropTypes.bool,
|
|
136
|
+
onSelect: PropTypes.func,
|
|
137
|
+
shortcuts: PropTypes.object
|
|
138
|
+
};
|
|
139
|
+
SelectionShortcuts.defaultProps = {
|
|
140
|
+
...ComposedComponent.defaultProps,
|
|
141
|
+
selectable: true,
|
|
142
|
+
onSelect: () => { },
|
|
143
|
+
shortcuts: {}
|
|
144
|
+
};
|
|
145
|
+
return SelectionShortcuts;
|
|
146
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface SelectionItem {
|
|
2
|
+
id: string | number;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
export interface TableSelectionConfig<T extends SelectionItem> {
|
|
6
|
+
data?: readonly T[] | undefined;
|
|
7
|
+
selected?: Set<T> | undefined;
|
|
8
|
+
focused?: T | null | undefined;
|
|
9
|
+
getKey?: ((item: T) => string | number) | undefined;
|
|
10
|
+
isItemSelectable?: ((item: T) => boolean | undefined) | undefined;
|
|
11
|
+
getChildren?: ((item: T) => readonly T[]) | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface CloneWithConfig<T> {
|
|
14
|
+
data?: readonly T[] | null | undefined;
|
|
15
|
+
selected?: Set<T> | readonly T[] | null | undefined;
|
|
16
|
+
focused?: T | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
export default class Selection<T extends SelectionItem> {
|
|
19
|
+
private _rawData;
|
|
20
|
+
protected _getChildren: ((item: T) => readonly T[]);
|
|
21
|
+
protected _data: Set<T>;
|
|
22
|
+
protected _selected: Set<T>;
|
|
23
|
+
protected _focused: T | null;
|
|
24
|
+
private _getKey;
|
|
25
|
+
protected _isItemSelectable: (item: T) => boolean | undefined;
|
|
26
|
+
constructor({ data, selected, focused, getKey, getChildren, isItemSelectable }?: TableSelectionConfig<T>);
|
|
27
|
+
protected _buildData(data: readonly T[] | null | undefined): Set<T>;
|
|
28
|
+
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
|
29
|
+
cloneWith({ data, selected, focused }: CloneWithConfig<T>): Selection<T>;
|
|
30
|
+
focus(value: T | null | undefined): Selection<T>;
|
|
31
|
+
moveUp(): Selection<T> | undefined;
|
|
32
|
+
moveDown(): Selection<T> | undefined;
|
|
33
|
+
moveStart(): Selection<T> | undefined;
|
|
34
|
+
moveEnd(): Selection<T> | undefined;
|
|
35
|
+
select(value?: T | null): Selection<T>;
|
|
36
|
+
deselect(value?: T | null): Selection<T>;
|
|
37
|
+
toggleSelection(value?: T | null): Selection<T>;
|
|
38
|
+
selectAll(): Selection<T>;
|
|
39
|
+
resetFocus(): Selection<T>;
|
|
40
|
+
resetSelection(): Selection<T>;
|
|
41
|
+
reset(): Selection<T>;
|
|
42
|
+
isFocused(value: T | null): boolean;
|
|
43
|
+
isSelected(value: T | null): boolean;
|
|
44
|
+
getFocused(): T | null;
|
|
45
|
+
getSelected(): Set<T>;
|
|
46
|
+
getActive(): Set<T>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export default class Selection {
|
|
2
|
+
_rawData;
|
|
3
|
+
_getChildren;
|
|
4
|
+
_data;
|
|
5
|
+
_selected;
|
|
6
|
+
_focused;
|
|
7
|
+
_getKey;
|
|
8
|
+
_isItemSelectable;
|
|
9
|
+
constructor({ data = [], selected = new Set(), focused = null, getKey = item => item.id, getChildren = () => [], isItemSelectable = () => true } = {}) {
|
|
10
|
+
this._rawData = data;
|
|
11
|
+
this._getChildren = getChildren;
|
|
12
|
+
this._data = this._buildData(data);
|
|
13
|
+
this._selected = selected;
|
|
14
|
+
this._focused = focused;
|
|
15
|
+
this._getKey = getKey;
|
|
16
|
+
this._isItemSelectable = isItemSelectable;
|
|
17
|
+
}
|
|
18
|
+
_buildData(data) {
|
|
19
|
+
return new Set(data);
|
|
20
|
+
}
|
|
21
|
+
_buildSelected(data, selected) {
|
|
22
|
+
return new Set(selected);
|
|
23
|
+
}
|
|
24
|
+
cloneWith({ data, selected, focused }) {
|
|
25
|
+
const newData = data || this._rawData;
|
|
26
|
+
let newSelected;
|
|
27
|
+
if (data && !selected) {
|
|
28
|
+
newSelected = new Set([...this._buildData(newData)].
|
|
29
|
+
filter(item => [...this._selected].some(it => this._getKey(item) === this._getKey(it))));
|
|
30
|
+
newSelected = this._buildSelected(this._buildData(newData), newSelected);
|
|
31
|
+
}
|
|
32
|
+
else if (selected) {
|
|
33
|
+
newSelected = selected;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
newSelected = this._selected;
|
|
37
|
+
}
|
|
38
|
+
newSelected = new Set([...newSelected].filter(item => this._isItemSelectable(item)));
|
|
39
|
+
const cloneFocus = () => [...this._buildData(data)].filter(item => this._focused && this._getKey(item) === this._getKey(this._focused))[0];
|
|
40
|
+
const newFocused = focused === undefined ? this._focused : focused;
|
|
41
|
+
return new this.constructor({
|
|
42
|
+
data: newData,
|
|
43
|
+
selected: newSelected,
|
|
44
|
+
focused: (data && !focused) ? cloneFocus() : newFocused,
|
|
45
|
+
getKey: this._getKey,
|
|
46
|
+
getChildren: this._getChildren,
|
|
47
|
+
isItemSelectable: this._isItemSelectable
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
focus(value) {
|
|
51
|
+
return this.cloneWith({ focused: value });
|
|
52
|
+
}
|
|
53
|
+
moveUp() {
|
|
54
|
+
const focused = this._focused;
|
|
55
|
+
const data = [...this._data];
|
|
56
|
+
if (!focused) {
|
|
57
|
+
return this.cloneWith({ focused: data[data.length - 1] });
|
|
58
|
+
}
|
|
59
|
+
const nextItem = data[data.indexOf(focused) - 1];
|
|
60
|
+
if (nextItem) {
|
|
61
|
+
return this.cloneWith({ focused: nextItem });
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
moveDown() {
|
|
66
|
+
const focused = this._focused;
|
|
67
|
+
const data = [...this._data];
|
|
68
|
+
if (!focused) {
|
|
69
|
+
return this.cloneWith({ focused: data[0] });
|
|
70
|
+
}
|
|
71
|
+
const nextItem = data[data.indexOf(focused) + 1];
|
|
72
|
+
if (nextItem) {
|
|
73
|
+
return this.cloneWith({ focused: nextItem });
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
moveStart() {
|
|
78
|
+
const data = [...this._data];
|
|
79
|
+
if (data.length) {
|
|
80
|
+
return this.cloneWith({ focused: data[0] });
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
moveEnd() {
|
|
85
|
+
const data = [...this._data];
|
|
86
|
+
if (data.length) {
|
|
87
|
+
return this.cloneWith({ focused: data.pop() });
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
select(value = this._focused) {
|
|
92
|
+
if (!value || !this._isItemSelectable(value)) {
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
const selected = new Set(this._selected);
|
|
96
|
+
selected.add(value);
|
|
97
|
+
return this.cloneWith({ selected });
|
|
98
|
+
}
|
|
99
|
+
deselect(value = this._focused) {
|
|
100
|
+
if (!value || !this._isItemSelectable(value)) {
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
const selected = new Set(this._selected);
|
|
104
|
+
selected.delete(value);
|
|
105
|
+
return this.cloneWith({ selected });
|
|
106
|
+
}
|
|
107
|
+
toggleSelection(value = this._focused) {
|
|
108
|
+
if (this.isSelected(value)) {
|
|
109
|
+
return this.deselect(value);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return this.select(value);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
selectAll() {
|
|
116
|
+
return this.cloneWith({ selected: [...this._data] });
|
|
117
|
+
}
|
|
118
|
+
resetFocus() {
|
|
119
|
+
return this.cloneWith({ focused: null });
|
|
120
|
+
}
|
|
121
|
+
resetSelection() {
|
|
122
|
+
return this.cloneWith({ selected: new Set() });
|
|
123
|
+
}
|
|
124
|
+
reset() {
|
|
125
|
+
return this.resetFocus().resetSelection();
|
|
126
|
+
}
|
|
127
|
+
isFocused(value) {
|
|
128
|
+
return this._focused === value;
|
|
129
|
+
}
|
|
130
|
+
isSelected(value) {
|
|
131
|
+
return value != null && this._selected.has(value);
|
|
132
|
+
}
|
|
133
|
+
getFocused() {
|
|
134
|
+
return this._focused;
|
|
135
|
+
}
|
|
136
|
+
getSelected() {
|
|
137
|
+
return new Set(this._selected);
|
|
138
|
+
}
|
|
139
|
+
getActive() {
|
|
140
|
+
if (this._selected.size) {
|
|
141
|
+
return new Set(this._selected);
|
|
142
|
+
}
|
|
143
|
+
else if (this._focused) {
|
|
144
|
+
return new Set([this._focused]);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return new Set();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { TableAttrs } from './table';
|
|
4
|
+
import Selection, { SelectionItem } from './selection';
|
|
5
|
+
export interface SmartTableProps<T extends SelectionItem> extends Omit<TableAttrs<T>, 'selection' | 'onSelect'> {
|
|
6
|
+
onSelectionChange: (selection: Selection<T>) => void;
|
|
7
|
+
selection?: Selection<T>;
|
|
8
|
+
}
|
|
9
|
+
declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTableProps<T>> {
|
|
10
|
+
static propTypes: {
|
|
11
|
+
className?: React.Validator<string | null | undefined> | undefined;
|
|
12
|
+
onFocus?: React.Validator<(() => void) | null | undefined> | undefined;
|
|
13
|
+
onBlur?: React.Validator<(() => void) | null | undefined> | undefined;
|
|
14
|
+
caption?: React.Validator<string | null | undefined> | undefined;
|
|
15
|
+
data?: React.Validator<readonly SelectionItem[]> | undefined;
|
|
16
|
+
loading?: React.Validator<boolean | null | undefined> | undefined;
|
|
17
|
+
draggable?: React.Validator<boolean | null | undefined> | undefined;
|
|
18
|
+
columns?: React.Validator<readonly import("./header-cell").Column<SelectionItem>[]> | undefined;
|
|
19
|
+
focused?: React.Validator<boolean | null | undefined> | undefined;
|
|
20
|
+
isItemSelectable: PropTypes.Requireable<(...args: any[]) => any> | React.Validator<((item: SelectionItem) => boolean) | null | undefined>;
|
|
21
|
+
innerRef?: React.Validator<React.Ref<HTMLTableRowElement> | undefined> | undefined;
|
|
22
|
+
autofocus?: React.Validator<boolean | null | undefined> | undefined;
|
|
23
|
+
scrollOnTableFocus?: React.Validator<boolean | null | undefined> | undefined;
|
|
24
|
+
disabledHover?: React.Validator<boolean> | undefined;
|
|
25
|
+
remoteSelection?: React.Validator<boolean | null | undefined> | undefined;
|
|
26
|
+
onSort?: React.Validator<((params: import("./header-cell").SortParams) => void) | null | undefined> | undefined;
|
|
27
|
+
sortKey?: React.Validator<string | null | undefined> | undefined;
|
|
28
|
+
sortOrder?: React.Validator<boolean | null | undefined> | undefined;
|
|
29
|
+
alwaysShowDragHandle?: React.Validator<boolean | null | undefined> | undefined;
|
|
30
|
+
dragHandleTitle?: React.Validator<string | null | undefined> | undefined;
|
|
31
|
+
onReorder?: React.Validator<((params: import("./table").ReorderParams<SelectionItem>) => void) | null | undefined> | undefined;
|
|
32
|
+
getItemKey?: React.Validator<((item: SelectionItem) => string | number) | null | undefined> | undefined;
|
|
33
|
+
stickyHeader?: React.Validator<boolean | null | undefined> | undefined;
|
|
34
|
+
getItemLevel?: React.Validator<((item: SelectionItem) => number) | null | undefined> | undefined;
|
|
35
|
+
getItemClassName?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
|
36
|
+
getMetaColumnClassName?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
|
37
|
+
getItemDataTest?: React.Validator<((item: SelectionItem) => string | null | undefined) | null | undefined> | undefined;
|
|
38
|
+
isItemCollapsible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
|
39
|
+
isParentCollapsible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
|
40
|
+
isItemCollapsed?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
|
41
|
+
onItemCollapse?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
|
42
|
+
onItemExpand?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
|
43
|
+
onItemDoubleClick?: React.Validator<((item: SelectionItem) => void) | null | undefined> | undefined;
|
|
44
|
+
onItemClick?: React.Validator<((item: SelectionItem, e: React.MouseEvent<HTMLTableRowElement, MouseEvent>) => void) | null | undefined> | undefined;
|
|
45
|
+
isDisabledSelectionVisible?: React.Validator<((item: SelectionItem) => boolean) | null | undefined> | undefined;
|
|
46
|
+
getCheckboxTooltip?: React.Validator<((item: SelectionItem) => string | undefined) | null | undefined> | undefined;
|
|
47
|
+
loaderClassName?: React.Validator<string | null | undefined> | undefined;
|
|
48
|
+
stickyHeaderOffset?: React.Validator<string | null | undefined> | undefined;
|
|
49
|
+
renderEmpty?: React.Validator<(() => React.ReactNode) | null | undefined> | undefined;
|
|
50
|
+
selectable?: React.Validator<boolean | null | undefined> | undefined;
|
|
51
|
+
shortcuts?: React.Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
|
52
|
+
onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
+
};
|
|
54
|
+
static defaultProps: {
|
|
55
|
+
onSelectionChange: () => void;
|
|
56
|
+
};
|
|
57
|
+
state: {
|
|
58
|
+
selection: Selection<T>;
|
|
59
|
+
};
|
|
60
|
+
UNSAFE_componentWillReceiveProps(nextProps: SmartTableProps<T>): void;
|
|
61
|
+
onSelect: (selection: Selection<T>) => void;
|
|
62
|
+
render(): React.JSX.Element;
|
|
63
|
+
}
|
|
64
|
+
export default SmartTable;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Table from './table';
|
|
4
|
+
import Selection from './selection';
|
|
5
|
+
const { selection: __selection__, onSelect: __onSelect__, ...restPropTypes } = Table.propTypes ?? {};
|
|
6
|
+
class SmartTable extends PureComponent {
|
|
7
|
+
static propTypes = {
|
|
8
|
+
onSelectionChange: PropTypes.func,
|
|
9
|
+
isItemSelectable: PropTypes.func,
|
|
10
|
+
...restPropTypes
|
|
11
|
+
};
|
|
12
|
+
static defaultProps = {
|
|
13
|
+
onSelectionChange: () => { }
|
|
14
|
+
};
|
|
15
|
+
state = {
|
|
16
|
+
selection: new Selection({
|
|
17
|
+
data: this.props.data,
|
|
18
|
+
isItemSelectable: this.props.isItemSelectable
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
22
|
+
const { data, isItemSelectable, selection } = nextProps;
|
|
23
|
+
if (this.props.remoteSelection && this.props.selection !== selection) {
|
|
24
|
+
this.setState({ selection });
|
|
25
|
+
}
|
|
26
|
+
else if (this.props.data !== data || this.props.isItemSelectable !== isItemSelectable) {
|
|
27
|
+
this.setState({
|
|
28
|
+
selection: new Selection({ data, isItemSelectable })
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
onSelect = (selection) => {
|
|
33
|
+
this.setState({ selection });
|
|
34
|
+
this.props.onSelectionChange(selection);
|
|
35
|
+
};
|
|
36
|
+
render() {
|
|
37
|
+
return (<Table {...this.props} selection={this.state.selection} onSelect={this.onSelect}/>);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default SmartTable;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
@value compensate: 2px;
|
|
4
|
+
@value compensated: calc(calc(4 * var(--ring-unit)) - compensate);
|
|
5
|
+
|
|
6
|
+
.tableWrapper {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.table {
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
border-spacing: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.userSelectNone {
|
|
17
|
+
user-select: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.headerCell {
|
|
21
|
+
composes: font-smaller-lower from "../global/global.css";
|
|
22
|
+
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
height: calc(var(--ring-unit) * 3);
|
|
25
|
+
padding-right: calc(var(--ring-unit) * 5);
|
|
26
|
+
|
|
27
|
+
text-align: left;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
|
|
30
|
+
color: var(--ring-secondary-color);
|
|
31
|
+
|
|
32
|
+
font-weight: normal;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.headerCell:first-child {
|
|
36
|
+
padding-left: calc(var(--ring-unit) * 4);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.headerCell:last-child {
|
|
40
|
+
width: 100%;
|
|
41
|
+
padding-right: calc(var(--ring-unit) * 4);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.headerCell:first-child:only-child {
|
|
45
|
+
width: initial;
|
|
46
|
+
max-width: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.headerCell.headerCellSorted {
|
|
50
|
+
font-weight: bold;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.headerCell.headerCellSortable {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.headerCell .sorter {
|
|
58
|
+
position: absolute;
|
|
59
|
+
|
|
60
|
+
display: none;
|
|
61
|
+
|
|
62
|
+
margin-left: 6px;
|
|
63
|
+
|
|
64
|
+
user-select: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.headerCell.headerCellSortable .sorter {
|
|
68
|
+
display: inline-block;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sortedUp .icon {
|
|
72
|
+
transform: rotate(180deg);
|
|
73
|
+
transform-origin: center 53%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.caption {
|
|
77
|
+
padding-top: var(--ring-unit);
|
|
78
|
+
padding-bottom: 6px;
|
|
79
|
+
|
|
80
|
+
color: var(--ring-text-color);
|
|
81
|
+
border-bottom: none;
|
|
82
|
+
|
|
83
|
+
font-size: var(--ring-font-size);
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
line-height: var(--ring-line-height-lower);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.tableHead::after {
|
|
89
|
+
position: absolute;
|
|
90
|
+
|
|
91
|
+
width: 100%;
|
|
92
|
+
|
|
93
|
+
height: 1px;
|
|
94
|
+
|
|
95
|
+
content: "";
|
|
96
|
+
|
|
97
|
+
background-color: var(--ring-line-color);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.subHeaderSticky {
|
|
101
|
+
position: sticky;
|
|
102
|
+
|
|
103
|
+
z-index: var(--ring-fixed-z-index);
|
|
104
|
+
top: 0;
|
|
105
|
+
|
|
106
|
+
background-color: rgba(var(--ring-content-background-components), 0.9);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.row {
|
|
110
|
+
outline: none;
|
|
111
|
+
|
|
112
|
+
line-height: compensated;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
116
|
+
.table:not(.disabledHover) .row:hover {
|
|
117
|
+
background-color: var(--ring-hover-background-color);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.rowSelected {
|
|
121
|
+
background-color: var(--ring-selected-background-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.rowFocused {
|
|
125
|
+
background-color: var(--ring-hover-background-color);
|
|
126
|
+
}
|
|
127
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
128
|
+
.rowFocused .cell:nth-child(1) {
|
|
129
|
+
box-shadow: inset 2px 0 var(--ring-main-color);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.loadingOverlay {
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0;
|
|
135
|
+
right: 0;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
left: 0;
|
|
138
|
+
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
|
|
143
|
+
background-color: var(--ring-table-loader-background-color);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.cell {
|
|
147
|
+
composes: ellipsis from "../global/global.css";
|
|
148
|
+
|
|
149
|
+
box-sizing: content-box;
|
|
150
|
+
|
|
151
|
+
min-width: 0;
|
|
152
|
+
|
|
153
|
+
height: calc(4 * var(--ring-unit));
|
|
154
|
+
padding: 0;
|
|
155
|
+
padding-right: calc(var(--ring-unit) * 5);
|
|
156
|
+
|
|
157
|
+
color: var(--ring-text-color);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.cell:first-child {
|
|
161
|
+
padding-left: calc(var(--ring-unit) * 4);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.cell:last-child {
|
|
165
|
+
width: 100%;
|
|
166
|
+
|
|
167
|
+
/* Markup hack, allows cell to have content which is wider than cell and collapses it */
|
|
168
|
+
|
|
169
|
+
max-width: 0;
|
|
170
|
+
padding-right: calc(var(--ring-unit) * 4);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cell:first-child {
|
|
174
|
+
min-width: calc(var(--ring-unit) * 37);
|
|
175
|
+
max-width: calc(var(--ring-unit) * 77);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.cell:first-child:only-child {
|
|
179
|
+
width: initial;
|
|
180
|
+
max-width: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.cellUnlimited {
|
|
184
|
+
width: 100%;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.cellRight {
|
|
188
|
+
text-align: right;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.metaColumn {
|
|
192
|
+
position: relative;
|
|
193
|
+
|
|
194
|
+
float: left;
|
|
195
|
+
|
|
196
|
+
height: 16px;
|
|
197
|
+
padding-right: compensate;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.metaColumn.headerMetaColumn {
|
|
201
|
+
padding-top: 1px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@value top: -3px;
|
|
205
|
+
|
|
206
|
+
.dragHandle {
|
|
207
|
+
top: top;
|
|
208
|
+
left: calc(-2 * var(--ring-unit));
|
|
209
|
+
|
|
210
|
+
cursor: grab;
|
|
211
|
+
|
|
212
|
+
opacity: 0;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* override button */
|
|
216
|
+
.dragHandle.dragHandle {
|
|
217
|
+
position: absolute;
|
|
218
|
+
|
|
219
|
+
height: calc(calc(4 * var(--ring-unit)) - top);
|
|
220
|
+
padding: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.dragHandle.visibleDragHandle,
|
|
224
|
+
.row:hover .dragHandle {
|
|
225
|
+
opacity: 1;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.rowCollapseExpandButton {
|
|
229
|
+
padding-right: calc(var(--ring-unit) / 2);
|
|
230
|
+
padding-left: 7px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.draggingRow {
|
|
234
|
+
z-index: var(--ring-overlay-z-index);
|
|
235
|
+
|
|
236
|
+
background-color: var(--ring-hover-background-color);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.draggingRow .dragHandle {
|
|
240
|
+
cursor: grabbing;
|
|
241
|
+
|
|
242
|
+
opacity: 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.draggingRow .dragHandle svg {
|
|
246
|
+
color: var(--ring-main-color);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.draggingTable {
|
|
250
|
+
z-index: var(--ring-overlay-z-index);
|
|
251
|
+
|
|
252
|
+
border-spacing: 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.tableMessage {
|
|
256
|
+
padding: calc(var(--ring-unit) * 2) calc(var(--ring-unit) * 4);
|
|
257
|
+
|
|
258
|
+
color: var(--ring-secondary-color);
|
|
259
|
+
}
|