@jetbrains/ring-ui-built 6.0.1
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/LICENSE.txt +202 -0
- package/README.md +103 -0
- package/components/_helpers/_rollupPluginBabelHelpers.js +648 -0
- package/components/_helpers/anchor.js +31 -0
- package/components/_helpers/badge.js +3 -0
- package/components/_helpers/button__classes.js +34 -0
- package/components/_helpers/caption.js +31 -0
- package/components/_helpers/card.js +132 -0
- package/components/_helpers/date-picker.js +3 -0
- package/components/_helpers/dialog__body-scroll-preventer.js +54 -0
- package/components/_helpers/grid.js +3 -0
- package/components/_helpers/header.js +3 -0
- package/components/_helpers/heading.js +3 -0
- package/components/_helpers/icon__svg.js +75 -0
- package/components/_helpers/input.js +235 -0
- package/components/_helpers/island.js +3 -0
- package/components/_helpers/link.js +3 -0
- package/components/_helpers/list.js +3 -0
- package/components/_helpers/query-assist__suggestions.js +102 -0
- package/components/_helpers/select__filter.js +94 -0
- package/components/_helpers/services-link.js +48 -0
- package/components/_helpers/sidebar.js +123 -0
- package/components/_helpers/tab-link.js +34 -0
- package/components/_helpers/table.js +3 -0
- package/components/_helpers/theme.js +95 -0
- package/components/_helpers/title.js +103 -0
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +294 -0
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +52 -0
- package/components/alert-service/alert-service.d.ts +36 -0
- package/components/alert-service/alert-service.js +220 -0
- package/components/analytics/analytics.d.ts +18 -0
- package/components/analytics/analytics.js +31 -0
- package/components/analytics/analytics__custom-plugin.d.ts +28 -0
- package/components/analytics/analytics__custom-plugin.js +89 -0
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +133 -0
- package/components/auth/auth__core.d.ts +236 -0
- package/components/auth/auth__core.js +1653 -0
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +147 -0
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +157 -0
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +196 -0
- package/components/auth/request-builder.d.ts +48 -0
- package/components/auth/request-builder.js +104 -0
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +138 -0
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +429 -0
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +269 -0
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +154 -0
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +221 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +6 -0
- package/components/auth-dialog-service/auth-dialog-service.js +92 -0
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +4 -0
- package/components/avatar/avatar.d.ts +52 -0
- package/components/avatar/avatar.js +183 -0
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +151 -0
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +59 -0
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +131 -0
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +2 -0
- package/components/button-group/button-group.d.ts +18 -0
- package/components/button-group/button-group.js +48 -0
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +5 -0
- package/components/button-set/button-set.d.ts +16 -0
- package/components/button-set/button-set.js +47 -0
- package/components/button-toolbar/button-toolbar.d.ts +16 -0
- package/components/button-toolbar/button-toolbar.js +46 -0
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +259 -0
- package/components/checkbox/checkbox.d.ts +45 -0
- package/components/checkbox/checkbox.js +130 -0
- package/components/clipboard/clipboard-fallback.d.ts +2 -0
- package/components/clipboard/clipboard-fallback.js +42 -0
- package/components/clipboard/clipboard.d.ts +5 -0
- package/components/clipboard/clipboard.js +185 -0
- package/components/code/code.d.ts +44 -0
- package/components/code/code.js +191 -0
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +153 -0
- package/components/confirm-service/confirm-service.d.ts +21 -0
- package/components/confirm-service/confirm-service.js +141 -0
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +79 -0
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +7 -0
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +84 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +36 -0
- package/components/data-list/data-list.d.ts +85 -0
- package/components/data-list/data-list.js +251 -0
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +192 -0
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +235 -0
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +148 -0
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +28 -0
- package/components/date-picker/consts.d.ts +98 -0
- package/components/date-picker/consts.js +46 -0
- package/components/date-picker/date-input.d.ts +47 -0
- package/components/date-picker/date-input.js +177 -0
- package/components/date-picker/date-picker.d.ts +77 -0
- package/components/date-picker/date-picker.js +404 -0
- package/components/date-picker/date-popup.d.ts +55 -0
- package/components/date-picker/date-popup.js +488 -0
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +133 -0
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/formats.js +3 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +110 -0
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +93 -0
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +58 -0
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +133 -0
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +39 -0
- package/components/date-picker/years.d.ts +25 -0
- package/components/date-picker/years.js +134 -0
- package/components/dialog/dialog.d.ts +64 -0
- package/components/dialog/dialog.js +240 -0
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +6 -0
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +24 -0
- package/components/dropdown/dropdown.d.ts +87 -0
- package/components/dropdown/dropdown.js +247 -0
- package/components/dropdown-menu/dropdown-menu.d.ts +36 -0
- package/components/dropdown-menu/dropdown-menu.js +199 -0
- package/components/editable-heading/editable-heading.d.ts +32 -0
- package/components/editable-heading/editable-heading.js +276 -0
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +88 -0
- package/components/error-message/error-message.d.ts +27 -0
- package/components/error-message/error-message.js +78 -0
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +118 -0
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +17 -0
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +19 -0
- package/components/global/controls-height.d.ts +9 -0
- package/components/global/controls-height.js +19 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +49 -0
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +30 -0
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +151 -0
- package/components/global/focus-sensor-hoc.d.ts +19 -0
- package/components/global/focus-sensor-hoc.js +165 -0
- package/components/global/fuzzy-highlight.d.ts +11 -0
- package/components/global/fuzzy-highlight.js +90 -0
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +101 -0
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +22 -0
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +22 -0
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +15 -0
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +58 -0
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +23 -0
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +60 -0
- package/components/global/promise-with-timeout.d.ts +5 -0
- package/components/global/promise-with-timeout.js +19 -0
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +9 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +54 -0
- package/components/global/react-render-adapter.d.ts +1 -0
- package/components/global/react-render-adapter.js +6 -0
- package/components/global/rerender-hoc.d.ts +10 -0
- package/components/global/rerender-hoc.js +46 -0
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +28 -0
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +6 -0
- package/components/global/theme.d.ts +21 -0
- package/components/global/theme.js +42 -0
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +21 -0
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +8 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +142 -0
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +17 -0
- package/components/global/variables.d.ts +89 -0
- package/components/global/variables.js +1 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +80 -0
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +46 -0
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +75 -0
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +39 -0
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +189 -0
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +51 -0
- package/components/header/profile.d.ts +75 -0
- package/components/header/profile.js +258 -0
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +13 -0
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +174 -0
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +303 -0
- package/components/header/smart-services.d.ts +26 -0
- package/components/header/smart-services.js +192 -0
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +57 -0
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +41 -0
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +69 -0
- package/components/http/http.d.ts +61 -0
- package/components/http/http.js +386 -0
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +113 -0
- package/components/hub-source/hub-source.d.ts +44 -0
- package/components/hub-source/hub-source.js +217 -0
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +60 -0
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +86 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +27 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +139 -0
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +109 -0
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +34 -0
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +14 -0
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +17 -0
- package/components/input/input.d.ts +77 -0
- package/components/input/input.js +35 -0
- package/components/island/adaptive-island-hoc.d.ts +61 -0
- package/components/island/adaptive-island-hoc.js +53 -0
- package/components/island/content.d.ts +43 -0
- package/components/island/content.js +151 -0
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +100 -0
- package/components/island/island.d.ts +78 -0
- package/components/island/island.js +60 -0
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +34 -0
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +36 -0
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +36 -0
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +69 -0
- package/components/link/link.d.ts +138 -0
- package/components/link/link.js +86 -0
- package/components/list/consts.d.ts +77 -0
- package/components/list/consts.js +27 -0
- package/components/list/list.d.ts +205 -0
- package/components/list/list.js +802 -0
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +92 -0
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +33 -0
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +237 -0
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +76 -0
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +39 -0
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +48 -0
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +195 -0
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +93 -0
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +327 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +50 -0
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +64 -0
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +216 -0
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +98 -0
- package/components/markdown/markdown.d.ts +12 -0
- package/components/markdown/markdown.js +43 -0
- package/components/message/message.d.ts +55 -0
- package/components/message/message.js +267 -0
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +92 -0
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +11 -0
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +37 -0
- package/components/pager/pager.d.ts +78 -0
- package/components/pager/pager.js +390 -0
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +39 -0
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +221 -0
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +257 -0
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +44 -0
- package/components/popup/popup.d.ts +147 -0
- package/components/popup/popup.js +424 -0
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +24 -0
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +271 -0
- package/components/popup-menu/popup-menu.d.ts +80 -0
- package/components/popup-menu/popup-menu.js +141 -0
- package/components/progress-bar/progress-bar.d.ts +64 -0
- package/components/progress-bar/progress-bar.js +120 -0
- package/components/query-assist/query-assist.d.ts +306 -0
- package/components/query-assist/query-assist.js +1098 -0
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +75 -0
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +48 -0
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +88 -0
- package/components/select/select.d.ts +276 -0
- package/components/select/select.js +1310 -0
- package/components/select/select__filter.d.ts +19 -0
- package/components/select/select__filter.js +85 -0
- package/components/select/select__popup.d.ts +166 -0
- package/components/select/select__popup.js +631 -0
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +249 -0
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +56 -0
- package/components/shortcuts/shortcuts-hoc.d.ts +65 -0
- package/components/shortcuts/shortcuts-hoc.js +61 -0
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +92 -0
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +92 -0
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +254 -0
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +217 -0
- package/components/style.css +1 -0
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +180 -0
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +37 -0
- package/components/table/disable-hover-hoc.d.ts +64 -0
- package/components/table/disable-hover-hoc.js +62 -0
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +109 -0
- package/components/table/header.d.ts +56 -0
- package/components/table/header.js +151 -0
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +140 -0
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +117 -0
- package/components/table/row.d.ts +59 -0
- package/components/table/row.js +299 -0
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +14 -0
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +205 -0
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +257 -0
- package/components/table/smart-table.d.ts +64 -0
- package/components/table/smart-table.js +149 -0
- package/components/table/table.d.ts +159 -0
- package/components/table/table.js +463 -0
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +222 -0
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +88 -0
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +354 -0
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +11 -0
- package/components/tabs/dumb-tabs.d.ts +35 -0
- package/components/tabs/dumb-tabs.js +189 -0
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +141 -0
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +13 -0
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +41 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +99 -0
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +213 -0
- package/components/tags-input/tags-input.d.ts +138 -0
- package/components/tags-input/tags-input.js +534 -0
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +102 -0
- package/components/text/text.d.ts +23 -0
- package/components/text/text.js +57 -0
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +86 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +229 -0
- package/components/user-agreement/service.d.ts +69 -0
- package/components/user-agreement/service.js +487 -0
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/toolbox.eula.js +3 -0
- package/components/user-agreement/user-agreement.d.ts +60 -0
- package/components/user-agreement/user-agreement.js +172 -0
- package/components/user-card/card.d.ts +70 -0
- package/components/user-card/card.js +80 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +172 -0
- package/components/user-card/tooltip.d.ts +36 -0
- package/components/user-card/tooltip.js +144 -0
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +85 -0
- package/package.json +118 -0
- package/typings.d.ts +43 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
import React, { Component, ComponentType, HTMLAttributes, ReactNode } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { TagAttrs } from '../tag/tag';
|
4
|
+
declare function noop(): void;
|
5
|
+
export interface TagType extends Omit<TagAttrs, 'onClick' | 'children'> {
|
6
|
+
label?: ReactNode;
|
7
|
+
key?: string | number | null | undefined;
|
8
|
+
}
|
9
|
+
export interface TagsListProps<T extends TagType> extends HTMLAttributes<HTMLElement> {
|
10
|
+
tags: readonly T[];
|
11
|
+
customTagComponent: ComponentType<TagAttrs>;
|
12
|
+
canNotBeEmpty: boolean;
|
13
|
+
disabled: boolean;
|
14
|
+
handleClick: (tag: T) => (e: React.MouseEvent<HTMLElement>) => void;
|
15
|
+
handleRemove: (tag: T) => (e: React.MouseEvent<HTMLElement>) => void;
|
16
|
+
activeIndex?: number | null | undefined;
|
17
|
+
tagClassName?: string | null | undefined;
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* @name Tags List
|
21
|
+
*/
|
22
|
+
export default class TagsList<T extends TagType> extends Component<TagsListProps<T>> {
|
23
|
+
static propTypes: {
|
24
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
25
|
+
tags: PropTypes.Requireable<any[]>;
|
26
|
+
customTagComponent: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
27
|
+
activeIndex: PropTypes.Requireable<number>;
|
28
|
+
canNotBeEmpty: PropTypes.Requireable<boolean>;
|
29
|
+
disabled: PropTypes.Requireable<boolean>;
|
30
|
+
handleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
31
|
+
handleRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
32
|
+
className: PropTypes.Requireable<string>;
|
33
|
+
tagClassName: PropTypes.Requireable<string>;
|
34
|
+
};
|
35
|
+
static defaultProps: {
|
36
|
+
customTagComponent: null;
|
37
|
+
canNotBeEmpty: boolean;
|
38
|
+
disabled: boolean;
|
39
|
+
handleClick: typeof noop;
|
40
|
+
handleRemove: typeof noop;
|
41
|
+
};
|
42
|
+
renderTag(tag: T, focusTag: boolean): React.JSX.Element;
|
43
|
+
render(): React.JSX.Element;
|
44
|
+
}
|
45
|
+
export type TagsListAttrs<T extends TagType = TagType> = JSX.LibraryManagedAttributes<typeof TagsList, TagsListProps<T>>;
|
46
|
+
export {};
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, f as _extends, e as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.map.js';
|
3
|
+
import React, { Component } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import Tag from '../tag/tag.js';
|
7
|
+
import 'core-js/modules/es.array.concat.js';
|
8
|
+
import '@jetbrains/icons/close-12px';
|
9
|
+
import '../icon/icon.js';
|
10
|
+
import 'util-deprecate';
|
11
|
+
import '../icon/icon__constants.js';
|
12
|
+
import '../_helpers/icon__svg.js';
|
13
|
+
import 'core-js/modules/es.regexp.exec.js';
|
14
|
+
import 'core-js/modules/es.string.replace.js';
|
15
|
+
import 'core-js/modules/es.string.starts-with.js';
|
16
|
+
import '../global/memoize.js';
|
17
|
+
import 'core-js/modules/es.array.iterator.js';
|
18
|
+
import 'core-js/modules/es.map.js';
|
19
|
+
import 'core-js/modules/es.object.to-string.js';
|
20
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
21
|
+
import 'core-js/modules/es.weak-map.js';
|
22
|
+
import '../button/button.js';
|
23
|
+
import '@jetbrains/icons/chevron-10px';
|
24
|
+
import '../link/clickableLink.js';
|
25
|
+
import '../global/controls-height.js';
|
26
|
+
import '../_helpers/button__classes.js';
|
27
|
+
|
28
|
+
var _excluded = ["children", "className", "customTagComponent", "canNotBeEmpty", "handleClick", "tagClassName", "handleRemove", "tags", "activeIndex"];
|
29
|
+
function noop() {}
|
30
|
+
/**
|
31
|
+
* @name Tags List
|
32
|
+
*/
|
33
|
+
var TagsList = /*#__PURE__*/function (_Component) {
|
34
|
+
_inherits(TagsList, _Component);
|
35
|
+
var _super = _createSuper(TagsList);
|
36
|
+
function TagsList() {
|
37
|
+
_classCallCheck(this, TagsList);
|
38
|
+
return _super.apply(this, arguments);
|
39
|
+
}
|
40
|
+
_createClass(TagsList, [{
|
41
|
+
key: "renderTag",
|
42
|
+
value: function renderTag(tag, focusTag) {
|
43
|
+
var TagComponent = this.props.customTagComponent || Tag;
|
44
|
+
var readOnly = this.props.disabled || tag.readOnly || this.props.canNotBeEmpty && this.props.tags.length === 1;
|
45
|
+
var tagClassName = this.props.tagClassName;
|
46
|
+
return /*#__PURE__*/React.createElement(TagComponent, _extends({}, tag, {
|
47
|
+
readOnly: readOnly,
|
48
|
+
disabled: this.props.disabled || tag.disabled,
|
49
|
+
focused: focusTag,
|
50
|
+
onClick: this.props.handleClick(tag),
|
51
|
+
onRemove: this.props.handleRemove(tag),
|
52
|
+
className: tagClassName
|
53
|
+
}), tag.label);
|
54
|
+
}
|
55
|
+
}, {
|
56
|
+
key: "render",
|
57
|
+
value: function render() {
|
58
|
+
var _this = this;
|
59
|
+
var _this$props = this.props,
|
60
|
+
children = _this$props.children,
|
61
|
+
className = _this$props.className;
|
62
|
+
_this$props.customTagComponent;
|
63
|
+
_this$props.canNotBeEmpty;
|
64
|
+
_this$props.handleClick;
|
65
|
+
_this$props.tagClassName;
|
66
|
+
_this$props.handleRemove;
|
67
|
+
_this$props.tags;
|
68
|
+
_this$props.activeIndex;
|
69
|
+
var props = _objectWithoutProperties(_this$props, _excluded);
|
70
|
+
var classes = classNames('ring-js-shortcuts', className);
|
71
|
+
var tagsList = (this.props.tags || []).map(function (tag, index) {
|
72
|
+
return _this.renderTag(tag, _this.props.activeIndex === index);
|
73
|
+
});
|
74
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
75
|
+
"data-test": "ring-tags-list",
|
76
|
+
className: classes
|
77
|
+
}, props), tagsList, children);
|
78
|
+
}
|
79
|
+
}]);
|
80
|
+
return TagsList;
|
81
|
+
}(Component);
|
82
|
+
_defineProperty(TagsList, "propTypes", {
|
83
|
+
children: PropTypes.node,
|
84
|
+
tags: PropTypes.array,
|
85
|
+
customTagComponent: PropTypes.elementType,
|
86
|
+
activeIndex: PropTypes.number,
|
87
|
+
canNotBeEmpty: PropTypes.bool,
|
88
|
+
disabled: PropTypes.bool,
|
89
|
+
handleClick: PropTypes.func,
|
90
|
+
handleRemove: PropTypes.func,
|
91
|
+
className: PropTypes.string,
|
92
|
+
tagClassName: PropTypes.string
|
93
|
+
});
|
94
|
+
_defineProperty(TagsList, "defaultProps", {
|
95
|
+
customTagComponent: null,
|
96
|
+
canNotBeEmpty: false,
|
97
|
+
disabled: false,
|
98
|
+
handleClick: noop,
|
99
|
+
handleRemove: noop
|
100
|
+
});
|
101
|
+
|
102
|
+
export { TagsList as default };
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React, { Component, HTMLAttributes } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
type TextSize = 's' | 'm' | 'l';
|
4
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
5
|
+
info?: boolean | null | undefined;
|
6
|
+
size?: TextSize;
|
7
|
+
'data-test'?: string | null | undefined;
|
8
|
+
}
|
9
|
+
declare const TextSize: Record<string, TextSize>;
|
10
|
+
/**
|
11
|
+
* @name Text
|
12
|
+
*/
|
13
|
+
export default class Text extends Component<TextProps> {
|
14
|
+
static propTypes: {
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
16
|
+
info: PropTypes.Requireable<boolean>;
|
17
|
+
size: PropTypes.Requireable<TextSize>;
|
18
|
+
className: PropTypes.Requireable<string>;
|
19
|
+
};
|
20
|
+
static Size: Record<string, TextSize>;
|
21
|
+
render(): React.JSX.Element;
|
22
|
+
}
|
23
|
+
export {};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.map.js';
|
3
|
+
import React, { Component } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
|
7
|
+
var modules_78d1bce6 = {"light":"light_rui_2ac4","text":"text_rui_6f30","sizeS":"sizeS_rui_6f30","sizeM":"sizeM_rui_6f30","sizeL":"sizeL_rui_6f30","info":"info_rui_6f30"};
|
8
|
+
|
9
|
+
var _excluded = ["children", "className", "info", "size"];
|
10
|
+
var TextSize = {
|
11
|
+
S: 's',
|
12
|
+
M: 'm',
|
13
|
+
L: 'l'
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* @name Text
|
17
|
+
*/
|
18
|
+
var Text = /*#__PURE__*/function (_Component) {
|
19
|
+
_inherits(Text, _Component);
|
20
|
+
var _super = _createSuper(Text);
|
21
|
+
function Text() {
|
22
|
+
_classCallCheck(this, Text);
|
23
|
+
return _super.apply(this, arguments);
|
24
|
+
}
|
25
|
+
_createClass(Text, [{
|
26
|
+
key: "render",
|
27
|
+
value: function render() {
|
28
|
+
var _this$props = this.props,
|
29
|
+
children = _this$props.children,
|
30
|
+
className = _this$props.className,
|
31
|
+
info = _this$props.info,
|
32
|
+
size = _this$props.size,
|
33
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
34
|
+
var classes = classNames(modules_78d1bce6.text, className, {
|
35
|
+
[modules_78d1bce6.info]: info,
|
36
|
+
[modules_78d1bce6.sizeS]: size === Text.Size.S,
|
37
|
+
[modules_78d1bce6.sizeM]: size === Text.Size.M,
|
38
|
+
[modules_78d1bce6.sizeL]: size === Text.Size.L
|
39
|
+
});
|
40
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
41
|
+
className: classes
|
42
|
+
}, restProps), children);
|
43
|
+
}
|
44
|
+
}]);
|
45
|
+
return Text;
|
46
|
+
}(Component);
|
47
|
+
_defineProperty(Text, "propTypes", {
|
48
|
+
children: PropTypes.node,
|
49
|
+
info: PropTypes.bool,
|
50
|
+
size: PropTypes.oneOf(Object.keys(TextSize).map(function (it) {
|
51
|
+
return TextSize[it];
|
52
|
+
})),
|
53
|
+
className: PropTypes.string
|
54
|
+
});
|
55
|
+
_defineProperty(Text, "Size", TextSize);
|
56
|
+
|
57
|
+
export { Text as default };
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React, { InputHTMLAttributes, PureComponent, ReactNode } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
export declare const Size: {
|
4
|
+
Size14: string;
|
5
|
+
Size16: string;
|
6
|
+
Size20: string;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* @name Toggle
|
10
|
+
*/
|
11
|
+
export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
12
|
+
size: string;
|
13
|
+
pale?: boolean | null | undefined;
|
14
|
+
leftLabel?: ReactNode;
|
15
|
+
'data-test'?: string | null | undefined;
|
16
|
+
}
|
17
|
+
declare class Toggle extends PureComponent<ToggleProps> {
|
18
|
+
static propTypes: {
|
19
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
20
|
+
name: PropTypes.Requireable<string>;
|
21
|
+
className: PropTypes.Requireable<string>;
|
22
|
+
title: PropTypes.Requireable<string>;
|
23
|
+
leftLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
24
|
+
defaultChecked: PropTypes.Requireable<boolean>;
|
25
|
+
checked: PropTypes.Requireable<boolean>;
|
26
|
+
disabled: PropTypes.Requireable<boolean>;
|
27
|
+
pale: PropTypes.Requireable<boolean>;
|
28
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
29
|
+
onTransitionEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
30
|
+
size: PropTypes.Requireable<string>;
|
31
|
+
'data-test': PropTypes.Requireable<string>;
|
32
|
+
};
|
33
|
+
static defaultProps: {
|
34
|
+
size: string;
|
35
|
+
};
|
36
|
+
render(): React.JSX.Element;
|
37
|
+
}
|
38
|
+
export type ToggleAttrs = JSX.LibraryManagedAttributes<typeof Toggle, ToggleProps>;
|
39
|
+
export default Toggle;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.object.values.js';
|
3
|
+
import React, { PureComponent } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
7
|
+
import 'core-js/modules/es.array.reduce.js';
|
8
|
+
import 'core-js/modules/es.object.to-string.js';
|
9
|
+
import 'core-js/modules/es.object.entries.js';
|
10
|
+
import 'core-js/modules/es.array.concat.js';
|
11
|
+
|
12
|
+
var modules_331c5aa7 = {"padding":"2px","disabled-line-color":"rgba(255, 255, 255, 0.9)","duration":"300ms","timing-function":"cubic-bezier(0.23, 1, 0.32, 1)","light":"light_rui_2ac4","toggle":"toggle_rui_773f","switch":"switch_rui_773f","disabled":"disabled_rui_773f","label":"label_rui_773f","leftLabel":"leftLabel_rui_773f","switchWrapper":"switchWrapper_rui_773f","input":"input_rui_773f","size16":"size16_rui_773f","size14":"size14_rui_773f","size20":"size20_rui_773f","paleSwitch":"paleSwitch_rui_773f"};
|
13
|
+
|
14
|
+
var _excluded = ["className", "children", "disabled", "pale", "title", "leftLabel", "size", "data-test", "onTransitionEnd"];
|
15
|
+
var Size = {
|
16
|
+
Size14: modules_331c5aa7.size14,
|
17
|
+
Size16: modules_331c5aa7.size16,
|
18
|
+
Size20: modules_331c5aa7.size20
|
19
|
+
};
|
20
|
+
var Toggle = /*#__PURE__*/function (_PureComponent) {
|
21
|
+
_inherits(Toggle, _PureComponent);
|
22
|
+
var _super = _createSuper(Toggle);
|
23
|
+
function Toggle() {
|
24
|
+
_classCallCheck(this, Toggle);
|
25
|
+
return _super.apply(this, arguments);
|
26
|
+
}
|
27
|
+
_createClass(Toggle, [{
|
28
|
+
key: "render",
|
29
|
+
value: function render() {
|
30
|
+
var _this$props = this.props,
|
31
|
+
className = _this$props.className,
|
32
|
+
children = _this$props.children,
|
33
|
+
disabled = _this$props.disabled,
|
34
|
+
pale = _this$props.pale,
|
35
|
+
title = _this$props.title,
|
36
|
+
leftLabel = _this$props.leftLabel,
|
37
|
+
_this$props$size = _this$props.size,
|
38
|
+
size = _this$props$size === void 0 ? Size.Size16 : _this$props$size,
|
39
|
+
dataTest = _this$props['data-test'],
|
40
|
+
onTransitionEnd = _this$props.onTransitionEnd,
|
41
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
42
|
+
var classes = classNames(className, size, modules_331c5aa7.toggle, disabled && modules_331c5aa7.disabled);
|
43
|
+
return /*#__PURE__*/React.createElement("label", {
|
44
|
+
className: classes,
|
45
|
+
title: title,
|
46
|
+
"data-test": joinDataTestAttributes('ring-toggle', dataTest)
|
47
|
+
}, leftLabel && /*#__PURE__*/React.createElement("span", {
|
48
|
+
className: modules_331c5aa7.leftLabel
|
49
|
+
}, leftLabel), /*#__PURE__*/React.createElement("span", {
|
50
|
+
className: modules_331c5aa7.switchWrapper
|
51
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
52
|
+
"data-test": "ring-toggle-input"
|
53
|
+
}, restProps, {
|
54
|
+
type: "checkbox",
|
55
|
+
disabled: disabled,
|
56
|
+
className: modules_331c5aa7.input
|
57
|
+
})), /*#__PURE__*/React.createElement("span", {
|
58
|
+
className: classNames(modules_331c5aa7.switch, pale && modules_331c5aa7.paleSwitch),
|
59
|
+
onTransitionEnd: onTransitionEnd
|
60
|
+
})), children && /*#__PURE__*/React.createElement("span", {
|
61
|
+
className: modules_331c5aa7.label
|
62
|
+
}, children));
|
63
|
+
}
|
64
|
+
}]);
|
65
|
+
return Toggle;
|
66
|
+
}(PureComponent);
|
67
|
+
_defineProperty(Toggle, "propTypes", {
|
68
|
+
children: PropTypes.node,
|
69
|
+
name: PropTypes.string,
|
70
|
+
className: PropTypes.string,
|
71
|
+
title: PropTypes.string,
|
72
|
+
leftLabel: PropTypes.node,
|
73
|
+
defaultChecked: PropTypes.bool,
|
74
|
+
checked: PropTypes.bool,
|
75
|
+
disabled: PropTypes.bool,
|
76
|
+
pale: PropTypes.bool,
|
77
|
+
onChange: PropTypes.func,
|
78
|
+
onTransitionEnd: PropTypes.func,
|
79
|
+
size: PropTypes.oneOf(Object.values(Size)),
|
80
|
+
'data-test': PropTypes.string
|
81
|
+
});
|
82
|
+
_defineProperty(Toggle, "defaultProps", {
|
83
|
+
size: Size.Size14
|
84
|
+
});
|
85
|
+
|
86
|
+
export { Size, Toggle as default };
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React, { AllHTMLAttributes, Component, ReactNode } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import Popup, { PopupAttrs } from '../popup/popup';
|
4
|
+
import { Listeners } from '../global/dom';
|
5
|
+
interface Context {
|
6
|
+
onNestedTooltipShow: () => void;
|
7
|
+
onNestedTooltipHide: () => void;
|
8
|
+
}
|
9
|
+
declare const TooltipContext: React.Context<Context | undefined>;
|
10
|
+
export interface TooltipProps extends Omit<AllHTMLAttributes<HTMLSpanElement>, 'title'> {
|
11
|
+
delay?: number | null | undefined;
|
12
|
+
selfOverflowOnly?: boolean | null | undefined;
|
13
|
+
popupProps?: Partial<PopupAttrs> | null | undefined;
|
14
|
+
title?: ReactNode | null | undefined;
|
15
|
+
'data-test'?: string | null | undefined;
|
16
|
+
long?: boolean | null | undefined;
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* @name Tooltip
|
20
|
+
*/
|
21
|
+
export default class Tooltip extends Component<TooltipProps> {
|
22
|
+
static propTypes: {
|
23
|
+
delay: PropTypes.Requireable<number>;
|
24
|
+
selfOverflowOnly: PropTypes.Requireable<boolean>;
|
25
|
+
popupProps: PropTypes.Requireable<object>;
|
26
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
27
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
28
|
+
'data-test': PropTypes.Requireable<string>;
|
29
|
+
};
|
30
|
+
static defaultProps: {
|
31
|
+
title: string;
|
32
|
+
selfOverflowOnly: boolean;
|
33
|
+
popupProps: {};
|
34
|
+
};
|
35
|
+
state: {
|
36
|
+
showPopup: boolean;
|
37
|
+
showNestedPopup: boolean;
|
38
|
+
};
|
39
|
+
componentDidMount(): void;
|
40
|
+
componentDidUpdate(prevProps: TooltipProps): void;
|
41
|
+
componentWillUnmount(): void;
|
42
|
+
static PopupProps: {
|
43
|
+
Directions: typeof import("../popup/popup.consts").Directions;
|
44
|
+
Dimension: typeof import("../popup/popup.consts").Dimension;
|
45
|
+
MinWidth: typeof import("../popup/popup.consts").MinWidth;
|
46
|
+
MaxHeight: typeof import("../popup/popup.consts").MaxHeight;
|
47
|
+
};
|
48
|
+
static contextType: React.Context<Context | undefined>;
|
49
|
+
context: React.ContextType<typeof TooltipContext>;
|
50
|
+
timeout?: number;
|
51
|
+
listeners: Listeners;
|
52
|
+
containerNode?: HTMLElement | null;
|
53
|
+
containerRef: (el: HTMLElement | null) => void;
|
54
|
+
tryToShowPopup: () => void;
|
55
|
+
showPopup: () => void;
|
56
|
+
hidePopup: () => void;
|
57
|
+
addListeners(): void;
|
58
|
+
popup?: Popup | null;
|
59
|
+
popupRef: (el: Popup | null) => void;
|
60
|
+
onNestedTooltipShow: () => void;
|
61
|
+
onNestedTooltipHide: () => void;
|
62
|
+
render(): React.JSX.Element;
|
63
|
+
}
|
64
|
+
export type TooltipAttrs = JSX.LibraryManagedAttributes<typeof Tooltip, TooltipProps>;
|
65
|
+
export {};
|
@@ -0,0 +1,229 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import React, { Component, createContext } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import Popup from '../popup/popup.js';
|
7
|
+
import { Listeners } from '../global/dom.js';
|
8
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
9
|
+
import scheduleRAF from '../global/schedule-raf.js';
|
10
|
+
import 'core-js/modules/es.object.to-string.js';
|
11
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
12
|
+
import 'core-js/modules/es.object.entries.js';
|
13
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
14
|
+
import 'core-js/modules/es.regexp.exec.js';
|
15
|
+
import 'core-js/modules/es.string.replace.js';
|
16
|
+
import 'react-dom';
|
17
|
+
import '../global/get-uid.js';
|
18
|
+
import '../shortcuts/shortcuts.js';
|
19
|
+
import 'core-js/modules/es.array.map.js';
|
20
|
+
import '../shortcuts/core.js';
|
21
|
+
import 'core-js/modules/es.array.includes.js';
|
22
|
+
import 'core-js/modules/es.string.includes.js';
|
23
|
+
import 'core-js/modules/es.object.assign.js';
|
24
|
+
import 'core-js/modules/es.array.slice.js';
|
25
|
+
import 'core-js/modules/es.array.splice.js';
|
26
|
+
import 'core-js/modules/es.string.match.js';
|
27
|
+
import 'core-js/modules/es.array.find-index.js';
|
28
|
+
import 'combokeys';
|
29
|
+
import '../global/sniffer.js';
|
30
|
+
import 'sniffr';
|
31
|
+
import '../tab-trap/tab-trap.js';
|
32
|
+
import 'core-js/modules/es.array.filter.js';
|
33
|
+
import '../popup/position.js';
|
34
|
+
import 'core-js/modules/es.array.sort.js';
|
35
|
+
import '../popup/popup.consts.js';
|
36
|
+
import 'core-js/modules/es.string.split.js';
|
37
|
+
import 'core-js/modules/es.array.iterator.js';
|
38
|
+
import 'core-js/modules/es.set.js';
|
39
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
40
|
+
import '../popup/popup.target.js';
|
41
|
+
import 'core-js/modules/es.array.reduce.js';
|
42
|
+
|
43
|
+
var modules_cd5e45a9 = {"light":"light_rui_2ac4","tooltip":"tooltip_rui_64ba","long":"long_rui_64ba"};
|
44
|
+
|
45
|
+
var _excluded = ["children", "data-test", "title", "delay", "selfOverflowOnly", "popupProps", "long"];
|
46
|
+
var scheduleScroll = scheduleRAF();
|
47
|
+
var TooltipContext = /*#__PURE__*/createContext(undefined);
|
48
|
+
/**
|
49
|
+
* @name Tooltip
|
50
|
+
*/
|
51
|
+
var Tooltip = /*#__PURE__*/function (_Component) {
|
52
|
+
_inherits(Tooltip, _Component);
|
53
|
+
var _super = _createSuper(Tooltip);
|
54
|
+
function Tooltip() {
|
55
|
+
var _this;
|
56
|
+
_classCallCheck(this, Tooltip);
|
57
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
58
|
+
args[_key] = arguments[_key];
|
59
|
+
}
|
60
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
62
|
+
showPopup: false,
|
63
|
+
showNestedPopup: false
|
64
|
+
});
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "timeout", void 0);
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "listeners", new Listeners());
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "containerNode", void 0);
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "containerRef", function (el) {
|
69
|
+
_this.containerNode = el;
|
70
|
+
});
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "tryToShowPopup", function () {
|
72
|
+
var _this$props = _this.props,
|
73
|
+
delay = _this$props.delay,
|
74
|
+
title = _this$props.title;
|
75
|
+
if (!title) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
if (delay) {
|
79
|
+
_this.timeout = window.setTimeout(_this.showPopup, delay);
|
80
|
+
} else {
|
81
|
+
_this.showPopup();
|
82
|
+
}
|
83
|
+
});
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "showPopup", function () {
|
85
|
+
var _this$context;
|
86
|
+
if (_this.props.selfOverflowOnly) {
|
87
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
88
|
+
containerNode = _assertThisInitialize.containerNode;
|
89
|
+
// rare cases when containerNode is null are possible;
|
90
|
+
// probably the collision is due to the asynchronous nature of the code,
|
91
|
+
// i.e. this code runs after the component is unmounted,
|
92
|
+
// although at first glance it looks unlikely.
|
93
|
+
if (!containerNode) {
|
94
|
+
return;
|
95
|
+
}
|
96
|
+
// inline element?
|
97
|
+
if (containerNode.clientWidth === 0 && containerNode.clientHeight === 0) {
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
if (containerNode.scrollWidth <= containerNode.clientWidth && containerNode.scrollHeight <= containerNode.clientHeight) {
|
101
|
+
return;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
(_this$context = _this.context) === null || _this$context === void 0 || _this$context.onNestedTooltipShow();
|
105
|
+
_this.setState({
|
106
|
+
showPopup: true
|
107
|
+
});
|
108
|
+
});
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "hidePopup", function () {
|
110
|
+
var _this$context2;
|
111
|
+
clearTimeout(_this.timeout);
|
112
|
+
(_this$context2 = _this.context) === null || _this$context2 === void 0 || _this$context2.onNestedTooltipHide();
|
113
|
+
_this.setState({
|
114
|
+
showPopup: false
|
115
|
+
});
|
116
|
+
});
|
117
|
+
_defineProperty(_assertThisInitialized(_this), "popup", void 0);
|
118
|
+
_defineProperty(_assertThisInitialized(_this), "popupRef", function (el) {
|
119
|
+
_this.popup = el;
|
120
|
+
});
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "onNestedTooltipShow", function () {
|
122
|
+
_this.setState({
|
123
|
+
showNestedPopup: true
|
124
|
+
});
|
125
|
+
});
|
126
|
+
_defineProperty(_assertThisInitialized(_this), "onNestedTooltipHide", function () {
|
127
|
+
_this.setState({
|
128
|
+
showNestedPopup: false
|
129
|
+
});
|
130
|
+
});
|
131
|
+
return _this;
|
132
|
+
}
|
133
|
+
_createClass(Tooltip, [{
|
134
|
+
key: "componentDidMount",
|
135
|
+
value: function componentDidMount() {
|
136
|
+
if (this.props.title) {
|
137
|
+
this.addListeners();
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}, {
|
141
|
+
key: "componentDidUpdate",
|
142
|
+
value: function componentDidUpdate(prevProps) {
|
143
|
+
if (!prevProps.title && this.props.title) {
|
144
|
+
this.addListeners();
|
145
|
+
} else if (prevProps.title && !this.props.title) {
|
146
|
+
this.listeners.removeAll();
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}, {
|
150
|
+
key: "componentWillUnmount",
|
151
|
+
value: function componentWillUnmount() {
|
152
|
+
clearTimeout(this.timeout);
|
153
|
+
this.listeners.removeAll();
|
154
|
+
}
|
155
|
+
}, {
|
156
|
+
key: "addListeners",
|
157
|
+
value: function addListeners() {
|
158
|
+
var _this2 = this;
|
159
|
+
if (this.containerNode != null) {
|
160
|
+
this.listeners.add(this.containerNode, 'mouseover', this.tryToShowPopup);
|
161
|
+
this.listeners.add(this.containerNode, 'mouseout', this.hidePopup);
|
162
|
+
}
|
163
|
+
this.listeners.add(document, 'scroll', function () {
|
164
|
+
return scheduleScroll(_this2.hidePopup);
|
165
|
+
}, {
|
166
|
+
passive: true
|
167
|
+
});
|
168
|
+
}
|
169
|
+
}, {
|
170
|
+
key: "render",
|
171
|
+
value: function render() {
|
172
|
+
var _this$props2 = this.props,
|
173
|
+
children = _this$props2.children,
|
174
|
+
dataTest = _this$props2['data-test'],
|
175
|
+
title = _this$props2.title;
|
176
|
+
_this$props2.delay;
|
177
|
+
_this$props2.selfOverflowOnly;
|
178
|
+
var popupProps = _this$props2.popupProps,
|
179
|
+
long = _this$props2.long,
|
180
|
+
restProps = _objectWithoutProperties(_this$props2, _excluded);
|
181
|
+
var ariaProps = typeof title === 'string' && !!title ? {
|
182
|
+
'aria-label': title,
|
183
|
+
role: 'tooltip'
|
184
|
+
} : {};
|
185
|
+
var onNestedTooltipShow = this.onNestedTooltipShow,
|
186
|
+
onNestedTooltipHide = this.onNestedTooltipHide;
|
187
|
+
return /*#__PURE__*/React.createElement(TooltipContext.Provider, {
|
188
|
+
value: {
|
189
|
+
onNestedTooltipShow,
|
190
|
+
onNestedTooltipHide
|
191
|
+
}
|
192
|
+
}, /*#__PURE__*/React.createElement("span", _extends({}, ariaProps, restProps, {
|
193
|
+
ref: this.containerRef,
|
194
|
+
"data-test": joinDataTestAttributes('ring-tooltip', dataTest),
|
195
|
+
"data-test-title": typeof title === 'string' ? title : undefined
|
196
|
+
}), children, /*#__PURE__*/React.createElement(Popup, _extends({
|
197
|
+
trapFocus: false,
|
198
|
+
hidden: !this.state.showPopup || this.state.showNestedPopup,
|
199
|
+
onCloseAttempt: this.hidePopup,
|
200
|
+
maxHeight: 400,
|
201
|
+
className: classNames(modules_cd5e45a9.tooltip, {
|
202
|
+
[modules_cd5e45a9.long]: long
|
203
|
+
}),
|
204
|
+
attached: false,
|
205
|
+
top: 4,
|
206
|
+
dontCloseOnAnchorClick: true,
|
207
|
+
ref: this.popupRef
|
208
|
+
}, popupProps), title)));
|
209
|
+
}
|
210
|
+
}]);
|
211
|
+
return Tooltip;
|
212
|
+
}(Component);
|
213
|
+
_defineProperty(Tooltip, "propTypes", {
|
214
|
+
delay: PropTypes.number,
|
215
|
+
selfOverflowOnly: PropTypes.bool,
|
216
|
+
popupProps: PropTypes.object,
|
217
|
+
title: PropTypes.node,
|
218
|
+
children: PropTypes.node,
|
219
|
+
'data-test': PropTypes.string
|
220
|
+
});
|
221
|
+
_defineProperty(Tooltip, "defaultProps", {
|
222
|
+
title: '',
|
223
|
+
selfOverflowOnly: false,
|
224
|
+
popupProps: {}
|
225
|
+
});
|
226
|
+
_defineProperty(Tooltip, "PopupProps", Popup.PopupProps);
|
227
|
+
_defineProperty(Tooltip, "contextType", TooltipContext);
|
228
|
+
|
229
|
+
export { Tooltip as default };
|