@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,216 @@
|
|
|
1
|
+
import { getRect } from '../global/dom';
|
|
2
|
+
/**
|
|
3
|
+
* @name Caret
|
|
4
|
+
*/
|
|
5
|
+
export default class Caret {
|
|
6
|
+
/**
|
|
7
|
+
* Line endings RegExp
|
|
8
|
+
* @type {RegExp}
|
|
9
|
+
*/
|
|
10
|
+
static returnRE = /\r/g;
|
|
11
|
+
/**
|
|
12
|
+
* Line endings normalizer
|
|
13
|
+
* Borrowed from jQuery
|
|
14
|
+
* @see https://github.com/jquery/jquery/blob/master/src/attributes/val.js
|
|
15
|
+
* @param value {*}
|
|
16
|
+
* @return {*}
|
|
17
|
+
*/
|
|
18
|
+
static normalizeNewlines(value) {
|
|
19
|
+
return typeof value === 'string' ? value.replace(this.returnRE, '') : value;
|
|
20
|
+
}
|
|
21
|
+
target;
|
|
22
|
+
constructor(target) {
|
|
23
|
+
this.target = target;
|
|
24
|
+
}
|
|
25
|
+
isContentEditable() {
|
|
26
|
+
return this.target.contentEditable === 'true';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Set focus on target if possible
|
|
30
|
+
*/
|
|
31
|
+
focus() {
|
|
32
|
+
if (!document.activeElement || document.activeElement !== this.target) {
|
|
33
|
+
this.target.focus();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get absolute caret position index
|
|
38
|
+
* @return {number}
|
|
39
|
+
*/
|
|
40
|
+
getAbsolutePosition(node) {
|
|
41
|
+
let _curNode = node;
|
|
42
|
+
let curPos = 0;
|
|
43
|
+
while (_curNode != null && _curNode !== this.target) {
|
|
44
|
+
while (_curNode.previousSibling) {
|
|
45
|
+
curPos += _curNode.previousSibling.textContent?.length ?? 0;
|
|
46
|
+
_curNode = _curNode.previousSibling;
|
|
47
|
+
}
|
|
48
|
+
_curNode = _curNode.parentNode;
|
|
49
|
+
}
|
|
50
|
+
return curPos;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get caret position index
|
|
54
|
+
* @param {Object} [params]
|
|
55
|
+
* @param {boolean} params.avoidFocus
|
|
56
|
+
* @return {number}
|
|
57
|
+
*/
|
|
58
|
+
getPosition(params = {}) {
|
|
59
|
+
if (this.isContentEditable()) {
|
|
60
|
+
if (!params.avoidFocus) {
|
|
61
|
+
this.focus();
|
|
62
|
+
}
|
|
63
|
+
const selection = window.getSelection();
|
|
64
|
+
if (!selection?.rangeCount) {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
const range1 = selection.getRangeAt(0);
|
|
68
|
+
const range2 = range1.cloneRange();
|
|
69
|
+
range2.selectNodeContents(this.target);
|
|
70
|
+
range2.setEnd(range1.endContainer, range1.endOffset);
|
|
71
|
+
const _curNode = range1.startContainer;
|
|
72
|
+
if (this.target === _curNode) {
|
|
73
|
+
return range1.startOffset === 0 || _curNode.textContent == null
|
|
74
|
+
? 0
|
|
75
|
+
: _curNode.textContent.length;
|
|
76
|
+
}
|
|
77
|
+
else if (!this.target.contains(_curNode)) {
|
|
78
|
+
return -1;
|
|
79
|
+
}
|
|
80
|
+
else if (!_curNode) {
|
|
81
|
+
return 'selectionStart' in this.target && this.target.selectionStart || -1;
|
|
82
|
+
}
|
|
83
|
+
const curPos = this.getAbsolutePosition(_curNode);
|
|
84
|
+
if (range1.startContainer === range1.endContainer) {
|
|
85
|
+
if (range1.startOffset === range1.endOffset) {
|
|
86
|
+
return curPos + range1.startOffset;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return { startOffset: curPos + range1.startOffset,
|
|
90
|
+
endOffset: curPos + range1.endOffset,
|
|
91
|
+
position: range2.toString().length };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const startOffset = curPos + range1.startOffset;
|
|
96
|
+
const endPos = this.getAbsolutePosition(range1.endContainer);
|
|
97
|
+
const endOffset = endPos + range1.endOffset;
|
|
98
|
+
return { startOffset, endOffset, position: range2.toString().length };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return 'selectionStart' in this.target && this.target.selectionStart || -1;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get relative position of query
|
|
105
|
+
* @param {Node} curNode
|
|
106
|
+
* @param {number} position
|
|
107
|
+
* @return {{_correctedPosition: number, _curNode: Node}}
|
|
108
|
+
*/
|
|
109
|
+
getRelativePosition(curNode, position) {
|
|
110
|
+
let curPos = 0;
|
|
111
|
+
let _curNode = curNode;
|
|
112
|
+
const nodeTypeText = 3;
|
|
113
|
+
if (!_curNode) {
|
|
114
|
+
return { _curNode: this.target, _correctedPosition: position };
|
|
115
|
+
}
|
|
116
|
+
if (position === 0) {
|
|
117
|
+
while (_curNode.nodeType !== nodeTypeText) {
|
|
118
|
+
_curNode = _curNode.childNodes[0];
|
|
119
|
+
}
|
|
120
|
+
const _correctedPosition = position;
|
|
121
|
+
return { _curNode, _correctedPosition };
|
|
122
|
+
}
|
|
123
|
+
let i = -1;
|
|
124
|
+
if (_curNode && _curNode.nodeType !== undefined) {
|
|
125
|
+
while (curPos < position && _curNode.nodeType !== nodeTypeText) {
|
|
126
|
+
i++;
|
|
127
|
+
if (_curNode.childNodes[i] != null) {
|
|
128
|
+
curPos += _curNode.childNodes[i].textContent?.length ?? 0;
|
|
129
|
+
if (curPos >= position) {
|
|
130
|
+
_curNode = _curNode.childNodes[i];
|
|
131
|
+
curPos -= _curNode.textContent?.length ?? 0;
|
|
132
|
+
i = -1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const _correctedPosition = position - curPos;
|
|
141
|
+
return { _curNode, _correctedPosition };
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Set caret position index
|
|
145
|
+
* @param {number} position
|
|
146
|
+
* @return {number}
|
|
147
|
+
*/
|
|
148
|
+
setPosition(position) {
|
|
149
|
+
const isContentEditable = this.isContentEditable();
|
|
150
|
+
let correctedPosition;
|
|
151
|
+
let curNode = this.target && this.target.childNodes[0];
|
|
152
|
+
if (position !== undefined) {
|
|
153
|
+
if (typeof position === 'object') {
|
|
154
|
+
const range = new Range();
|
|
155
|
+
const start = this.getRelativePosition(curNode, position.startOffset);
|
|
156
|
+
range.setStart(start._curNode, start._correctedPosition);
|
|
157
|
+
const end = this.getRelativePosition(curNode, position.endOffset);
|
|
158
|
+
range.setEnd(end._curNode, end._correctedPosition);
|
|
159
|
+
correctedPosition = range;
|
|
160
|
+
}
|
|
161
|
+
else if (position === -1) {
|
|
162
|
+
const value = isContentEditable
|
|
163
|
+
? this.target.textContent
|
|
164
|
+
: Caret.normalizeNewlines('value' in this.target ? this.target.value : undefined);
|
|
165
|
+
correctedPosition = value?.length ?? 0;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const { _curNode, _correctedPosition } = this.getRelativePosition(curNode, position);
|
|
169
|
+
curNode = _curNode;
|
|
170
|
+
correctedPosition = _correctedPosition;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (isContentEditable) {
|
|
174
|
+
this.focus();
|
|
175
|
+
try {
|
|
176
|
+
if (correctedPosition instanceof Range) {
|
|
177
|
+
window.getSelection()?.removeAllRanges();
|
|
178
|
+
window.getSelection()?.addRange(correctedPosition);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
window.getSelection()?.collapse(curNode || this.target, correctedPosition);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
// Do nothing
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else if ('setSelectionRange' in this.target && typeof correctedPosition === 'number') {
|
|
189
|
+
this.target.setSelectionRange(correctedPosition, correctedPosition);
|
|
190
|
+
}
|
|
191
|
+
return correctedPosition;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Get caret position in pixels
|
|
195
|
+
* @return {number}
|
|
196
|
+
*/
|
|
197
|
+
getOffset() {
|
|
198
|
+
let offset = 0;
|
|
199
|
+
let range;
|
|
200
|
+
try {
|
|
201
|
+
// Both statements may throw
|
|
202
|
+
range = window.getSelection()?.getRangeAt(0).cloneRange();
|
|
203
|
+
range?.setStart(range.startContainer, range.startOffset - 1);
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
return offset;
|
|
207
|
+
}
|
|
208
|
+
if (range && range.endOffset !== 0 && range.toString() !== '') {
|
|
209
|
+
offset =
|
|
210
|
+
getRect(range).right -
|
|
211
|
+
getRect(this.target).left -
|
|
212
|
+
(range.startContainer instanceof HTMLElement && range.startContainer.offsetLeft || 0);
|
|
213
|
+
}
|
|
214
|
+
return offset;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
@value checkboxSize: 14px;
|
|
4
|
+
|
|
5
|
+
.checkbox {
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
display: inline-block;
|
|
9
|
+
|
|
10
|
+
text-align: left;
|
|
11
|
+
|
|
12
|
+
color: var(--ring-text-color);
|
|
13
|
+
outline: none;
|
|
14
|
+
|
|
15
|
+
&:hover .cell {
|
|
16
|
+
transition: background-color var(--ring-ease);
|
|
17
|
+
|
|
18
|
+
border-color: var(--ring-border-hover-color);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cell {
|
|
23
|
+
position: relative;
|
|
24
|
+
top: -2px;
|
|
25
|
+
|
|
26
|
+
display: inline-block;
|
|
27
|
+
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
width: checkboxSize;
|
|
30
|
+
height: checkboxSize;
|
|
31
|
+
|
|
32
|
+
user-select: none;
|
|
33
|
+
transition: border-color var(--ring-ease), background-color var(--ring-ease), box-shadow var(--ring-ease);
|
|
34
|
+
vertical-align: middle;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
|
|
37
|
+
border: 1px solid var(--ring-borders-color);
|
|
38
|
+
border-radius: var(--ring-border-radius-small);
|
|
39
|
+
background-color: var(--ring-content-background-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon.icon {
|
|
43
|
+
position: absolute;
|
|
44
|
+
|
|
45
|
+
top: -1px;
|
|
46
|
+
left: -1px;
|
|
47
|
+
|
|
48
|
+
width: calc(var(--ring-unit) * 2);
|
|
49
|
+
height: calc(var(--ring-unit) * 2);
|
|
50
|
+
|
|
51
|
+
opacity: 0;
|
|
52
|
+
color: var(--ring-white-text-color);
|
|
53
|
+
|
|
54
|
+
& svg {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.check {
|
|
62
|
+
composes: icon;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.minus {
|
|
66
|
+
composes: icon;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 0;
|
|
72
|
+
left: 0;
|
|
73
|
+
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
margin: 0;
|
|
77
|
+
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
|
|
80
|
+
opacity: 0;
|
|
81
|
+
|
|
82
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
83
|
+
&:checked + .cell,
|
|
84
|
+
&:indeterminate + .cell {
|
|
85
|
+
border-color: transparent;
|
|
86
|
+
background-color: var(--ring-main-color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
90
|
+
&:checked + .cell .check {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:focus-visible + .cell,
|
|
95
|
+
&.focus + .cell {
|
|
96
|
+
transition: background-color var(--ring-ease);
|
|
97
|
+
|
|
98
|
+
border-color: var(--ring-border-hover-color);
|
|
99
|
+
box-shadow: 0 0 0 1px var(--ring-border-hover-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
103
|
+
&:indeterminate + .cell .minus {
|
|
104
|
+
opacity: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&[disabled] {
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
112
|
+
&[disabled][disabled] + .cell {
|
|
113
|
+
border-color: var(--ring-border-disabled-color);
|
|
114
|
+
background-color: var(--ring-disabled-background-color);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
118
|
+
&[disabled]:checked + .cell,
|
|
119
|
+
&[disabled]:indeterminate + .cell {
|
|
120
|
+
border-color: var(--ring-border-selected-disabled-color);
|
|
121
|
+
background-color: var(--ring-border-selected-disabled-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
125
|
+
&[disabled]:checked + .cell .check,
|
|
126
|
+
&[disabled]:indeterminate + .cell .minus {
|
|
127
|
+
color: var(--ring-disabled-background-color);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
131
|
+
&:indeterminate:indeterminate + .cell .check {
|
|
132
|
+
transition: none;
|
|
133
|
+
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&[disabled] ~ .label {
|
|
138
|
+
color: var(--ring-disabled-color);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.label {
|
|
143
|
+
margin-left: var(--ring-unit);
|
|
144
|
+
|
|
145
|
+
line-height: normal;
|
|
146
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { PureComponent, InputHTMLAttributes, CSSProperties, Ref } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
label?: string | null | undefined;
|
|
5
|
+
containerClassName?: string | null | undefined;
|
|
6
|
+
containerStyle?: CSSProperties | undefined;
|
|
7
|
+
cellClassName?: string | null | undefined;
|
|
8
|
+
labelClassName?: string | null | undefined;
|
|
9
|
+
indeterminate: boolean;
|
|
10
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @name Checkbox
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Displays a checkbox.
|
|
17
|
+
*/
|
|
18
|
+
export default class Checkbox extends PureComponent<CheckboxProps> {
|
|
19
|
+
static propTypes: {
|
|
20
|
+
name: PropTypes.Requireable<string>;
|
|
21
|
+
label: PropTypes.Requireable<string>;
|
|
22
|
+
className: PropTypes.Requireable<string>;
|
|
23
|
+
containerClassName: PropTypes.Requireable<string>;
|
|
24
|
+
containerStyle: PropTypes.Requireable<object>;
|
|
25
|
+
cellClassName: PropTypes.Requireable<string>;
|
|
26
|
+
labelClassName: PropTypes.Requireable<string>;
|
|
27
|
+
defaultChecked: PropTypes.Requireable<boolean>;
|
|
28
|
+
checked: PropTypes.Requireable<boolean>;
|
|
29
|
+
indeterminate: PropTypes.Requireable<boolean>;
|
|
30
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
31
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
33
|
+
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
34
|
+
current: PropTypes.Validator<HTMLInputElement | null | undefined>;
|
|
35
|
+
}> | null | undefined>>;
|
|
36
|
+
};
|
|
37
|
+
static defaultProps: {
|
|
38
|
+
indeterminate: boolean;
|
|
39
|
+
};
|
|
40
|
+
componentDidMount(): void;
|
|
41
|
+
componentDidUpdate(prevProps: CheckboxProps): void;
|
|
42
|
+
input?: HTMLInputElement | null;
|
|
43
|
+
inputRef: (el: HTMLInputElement | null) => void;
|
|
44
|
+
render(): React.JSX.Element;
|
|
45
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import checkmarkIcon from '@jetbrains/icons/checkmark-14px';
|
|
5
|
+
import minusIcon from '@jetbrains/icons/remove-14px';
|
|
6
|
+
import Icon from '../icon/icon';
|
|
7
|
+
import { refObject } from '../global/prop-types';
|
|
8
|
+
import composeRefs from '../global/composeRefs';
|
|
9
|
+
import styles from './checkbox.css';
|
|
10
|
+
/**
|
|
11
|
+
* @name Checkbox
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Displays a checkbox.
|
|
15
|
+
*/
|
|
16
|
+
export default class Checkbox extends PureComponent {
|
|
17
|
+
static propTypes = {
|
|
18
|
+
name: PropTypes.string,
|
|
19
|
+
label: PropTypes.string,
|
|
20
|
+
className: PropTypes.string,
|
|
21
|
+
containerClassName: PropTypes.string,
|
|
22
|
+
containerStyle: PropTypes.object,
|
|
23
|
+
cellClassName: PropTypes.string,
|
|
24
|
+
labelClassName: PropTypes.string,
|
|
25
|
+
defaultChecked: PropTypes.bool,
|
|
26
|
+
checked: PropTypes.bool,
|
|
27
|
+
indeterminate: PropTypes.bool,
|
|
28
|
+
disabled: PropTypes.bool,
|
|
29
|
+
onChange: PropTypes.func,
|
|
30
|
+
children: PropTypes.node,
|
|
31
|
+
inputRef: PropTypes.oneOfType([
|
|
32
|
+
PropTypes.func,
|
|
33
|
+
refObject(PropTypes.instanceOf(HTMLInputElement))
|
|
34
|
+
])
|
|
35
|
+
};
|
|
36
|
+
static defaultProps = {
|
|
37
|
+
indeterminate: false
|
|
38
|
+
};
|
|
39
|
+
componentDidMount() {
|
|
40
|
+
if (this.input != null) {
|
|
41
|
+
this.input.indeterminate = this.props.indeterminate;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
componentDidUpdate(prevProps) {
|
|
45
|
+
const { indeterminate } = this.props;
|
|
46
|
+
if (this.input != null && indeterminate !== prevProps.indeterminate) {
|
|
47
|
+
this.input.indeterminate = this.props.indeterminate;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
input;
|
|
51
|
+
inputRef = (el) => {
|
|
52
|
+
if (el != null) {
|
|
53
|
+
el.indeterminate = this.props.indeterminate;
|
|
54
|
+
}
|
|
55
|
+
this.input = el;
|
|
56
|
+
};
|
|
57
|
+
render() {
|
|
58
|
+
const { children, label, className, containerClassName, containerStyle, cellClassName, labelClassName, indeterminate, inputRef, ...restProps } = this.props;
|
|
59
|
+
const classes = classNames(styles.input, className);
|
|
60
|
+
const containerClasses = classNames(styles.checkbox, containerClassName);
|
|
61
|
+
const cellClasses = classNames(styles.cell, cellClassName);
|
|
62
|
+
const labelClasses = classNames(styles.label, labelClassName);
|
|
63
|
+
return (<label className={containerClasses} style={containerStyle} data-test="ring-checkbox">
|
|
64
|
+
<input {...restProps} data-checked={restProps.checked} ref={composeRefs(this.inputRef, inputRef)} type="checkbox" className={classes}/>
|
|
65
|
+
<span className={cellClasses}>
|
|
66
|
+
<Icon glyph={checkmarkIcon} className={styles.check}/>
|
|
67
|
+
<Icon glyph={minusIcon} className={styles.minus}/>
|
|
68
|
+
</span>
|
|
69
|
+
<span className={labelClasses}>{label || children}</span>
|
|
70
|
+
</label>);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function copyTextToClipboard(str) {
|
|
2
|
+
const el = document.createElement('textarea');
|
|
3
|
+
el.value = str;
|
|
4
|
+
el.setAttribute('readonly', '');
|
|
5
|
+
el.style.position = 'absolute';
|
|
6
|
+
el.style.left = '-9999px';
|
|
7
|
+
document.body.appendChild(el);
|
|
8
|
+
const selection = document.getSelection();
|
|
9
|
+
// Should restore previous selection
|
|
10
|
+
const selected = (selection && selection.rangeCount > 0)
|
|
11
|
+
? selection.getRangeAt(0)
|
|
12
|
+
: false;
|
|
13
|
+
el.select();
|
|
14
|
+
document.execCommand('copy');
|
|
15
|
+
document.body.removeChild(el);
|
|
16
|
+
if (selected && selection) {
|
|
17
|
+
selection.removeAllRanges();
|
|
18
|
+
selection.addRange(selected);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function copyHTMLToClipboard(str) {
|
|
22
|
+
const el = document.createElement('div');
|
|
23
|
+
el.innerHTML = str;
|
|
24
|
+
el.setAttribute('readonly', '');
|
|
25
|
+
el.style.position = 'absolute';
|
|
26
|
+
el.style.left = '-9999px';
|
|
27
|
+
document.body.appendChild(el);
|
|
28
|
+
const selection = document.getSelection();
|
|
29
|
+
// Should restore previous selection
|
|
30
|
+
const selected = (selection && selection.rangeCount > 0)
|
|
31
|
+
? selection.getRangeAt(0)
|
|
32
|
+
: false;
|
|
33
|
+
selection?.removeAllRanges();
|
|
34
|
+
const range = document.createRange();
|
|
35
|
+
range.selectNode(el);
|
|
36
|
+
selection?.addRange(range);
|
|
37
|
+
document.execCommand('copy');
|
|
38
|
+
selection?.removeAllRanges();
|
|
39
|
+
document.execCommand('copy');
|
|
40
|
+
document.body.removeChild(el);
|
|
41
|
+
if (selected && selection) {
|
|
42
|
+
selection.addRange(selected);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const clipboard: {
|
|
2
|
+
copyText: (text: string, successMessage?: string | undefined, errorMessage?: string | undefined, delay?: number) => Promise<void>;
|
|
3
|
+
copyHTML: (html: string, successMessage?: string | undefined, errorMessage?: string | undefined, delay?: number) => Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
export default clipboard;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import alertService from '../alert-service/alert-service';
|
|
2
|
+
import { copyHTMLToClipboard, copyTextToClipboard } from './clipboard-fallback';
|
|
3
|
+
const ALERT_DELAY = 1000;
|
|
4
|
+
function getClipboardImplementation() {
|
|
5
|
+
if (navigator.clipboard && !window.isSecureContext) {
|
|
6
|
+
return {
|
|
7
|
+
copy: (text) => navigator.clipboard.writeText(text),
|
|
8
|
+
copyHTML: (html) => navigator.clipboard.write([
|
|
9
|
+
new ClipboardItem({
|
|
10
|
+
['text/html']: new Blob([html], { type: 'text/html' })
|
|
11
|
+
})
|
|
12
|
+
])
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
copy: (str) => Promise.resolve(copyTextToClipboard(str)),
|
|
17
|
+
copyHTML: (html) => Promise.resolve(copyHTMLToClipboard(html))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function copy(text, successMessage, errorMessage, delay = ALERT_DELAY, isHtml = false) {
|
|
21
|
+
try {
|
|
22
|
+
const clipboardImpl = getClipboardImplementation();
|
|
23
|
+
const copyMethod = isHtml ? clipboardImpl.copyHTML : clipboardImpl.copy;
|
|
24
|
+
await copyMethod(text);
|
|
25
|
+
if (successMessage) {
|
|
26
|
+
alertService.successMessage(successMessage, delay);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
if (errorMessage) {
|
|
31
|
+
alertService.error(errorMessage, delay);
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.error(e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const clipboard = {
|
|
38
|
+
copyText: async (text, successMessage, errorMessage, delay = ALERT_DELAY) => await copy(text, successMessage, errorMessage, delay),
|
|
39
|
+
copyHTML: async (html, successMessage, errorMessage, delay = ALERT_DELAY) => await copy(html, successMessage, errorMessage, delay, true)
|
|
40
|
+
};
|
|
41
|
+
export default clipboard;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
.code {
|
|
4
|
+
margin: calc(var(--ring-unit) * 2) 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* override hljs */
|
|
8
|
+
.code code {
|
|
9
|
+
display: block;
|
|
10
|
+
|
|
11
|
+
padding: calc(var(--ring-unit) * 1.5) calc(var(--ring-unit) * 2) calc(var(--ring-unit) * 2);
|
|
12
|
+
|
|
13
|
+
border-radius: var(--ring-border-radius);
|
|
14
|
+
background-color: var(--ring-sidebar-background-color);
|
|
15
|
+
|
|
16
|
+
font-family: var(--ring-font-family-monospace);
|
|
17
|
+
font-size: var(--ring-font-size-smaller);
|
|
18
|
+
line-height: var(--ring-line-height-lowest);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.inline code {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
|
|
24
|
+
padding: 0 calc(var(--ring-unit) / 2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.softWrap code {
|
|
28
|
+
white-space: pre-wrap;
|
|
29
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="highlight.js" />
|
|
2
|
+
import React, { PureComponent, Ref } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import highlight from 'highlight.js/lib/core';
|
|
5
|
+
declare function noop(): void;
|
|
6
|
+
export interface CodeProps {
|
|
7
|
+
code: string;
|
|
8
|
+
inline: boolean;
|
|
9
|
+
softWrap: boolean;
|
|
10
|
+
replacer: ((element: HTMLElement | null) => void);
|
|
11
|
+
className?: string | null | undefined;
|
|
12
|
+
language?: string | null | undefined;
|
|
13
|
+
codeRef?: Ref<HTMLElement> | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @name Code
|
|
17
|
+
*/
|
|
18
|
+
export default class Code extends PureComponent<CodeProps> {
|
|
19
|
+
static propTypes: {
|
|
20
|
+
className: PropTypes.Requireable<string>;
|
|
21
|
+
code: PropTypes.Validator<string>;
|
|
22
|
+
inline: PropTypes.Requireable<boolean>;
|
|
23
|
+
softWrap: PropTypes.Requireable<boolean>;
|
|
24
|
+
language: PropTypes.Requireable<string>;
|
|
25
|
+
replacer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
|
+
codeRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
27
|
+
current: PropTypes.Requireable<Element>;
|
|
28
|
+
}> | null | undefined>>;
|
|
29
|
+
};
|
|
30
|
+
static defaultProps: {
|
|
31
|
+
inline: boolean;
|
|
32
|
+
softWrap: boolean;
|
|
33
|
+
replacer: typeof noop;
|
|
34
|
+
};
|
|
35
|
+
componentDidMount(): void;
|
|
36
|
+
componentDidUpdate(): void;
|
|
37
|
+
code?: HTMLElement | null;
|
|
38
|
+
highlight(): Promise<void>;
|
|
39
|
+
get codeRef(): HTMLElement | null | undefined;
|
|
40
|
+
get initCodeRef(): React.RefObject<HTMLElement> | ((ref: HTMLElement | null) => void);
|
|
41
|
+
render(): React.JSX.Element;
|
|
42
|
+
}
|
|
43
|
+
declare const code: (strings: TemplateStringsArray, ...interpolations: unknown[]) => void;
|
|
44
|
+
export { code, highlight };
|