@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,66 @@
|
|
1
|
+
export interface PositionParams {
|
2
|
+
avoidFocus?: boolean | null | undefined;
|
3
|
+
}
|
4
|
+
export interface Position {
|
5
|
+
startOffset: number;
|
6
|
+
endOffset: number;
|
7
|
+
position: number;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* @name Caret
|
11
|
+
*/
|
12
|
+
export default class Caret {
|
13
|
+
/**
|
14
|
+
* Line endings RegExp
|
15
|
+
* @type {RegExp}
|
16
|
+
*/
|
17
|
+
static returnRE: RegExp;
|
18
|
+
/**
|
19
|
+
* Line endings normalizer
|
20
|
+
* Borrowed from jQuery
|
21
|
+
* @see https://github.com/jquery/jquery/blob/master/src/attributes/val.js
|
22
|
+
* @param value {*}
|
23
|
+
* @return {*}
|
24
|
+
*/
|
25
|
+
static normalizeNewlines(value: string | undefined): string | undefined;
|
26
|
+
target: HTMLElement | HTMLInputElement;
|
27
|
+
constructor(target: HTMLElement);
|
28
|
+
isContentEditable(): boolean;
|
29
|
+
/**
|
30
|
+
* Set focus on target if possible
|
31
|
+
*/
|
32
|
+
focus(): void;
|
33
|
+
/**
|
34
|
+
* Get absolute caret position index
|
35
|
+
* @return {number}
|
36
|
+
*/
|
37
|
+
getAbsolutePosition(node: Node): number;
|
38
|
+
/**
|
39
|
+
* Get caret position index
|
40
|
+
* @param {Object} [params]
|
41
|
+
* @param {boolean} params.avoidFocus
|
42
|
+
* @return {number}
|
43
|
+
*/
|
44
|
+
getPosition(params?: PositionParams): number | Position;
|
45
|
+
/**
|
46
|
+
* Get relative position of query
|
47
|
+
* @param {Node} curNode
|
48
|
+
* @param {number} position
|
49
|
+
* @return {{_correctedPosition: number, _curNode: Node}}
|
50
|
+
*/
|
51
|
+
getRelativePosition(curNode: Node, position: number): {
|
52
|
+
_curNode: Node;
|
53
|
+
_correctedPosition: number;
|
54
|
+
};
|
55
|
+
/**
|
56
|
+
* Set caret position index
|
57
|
+
* @param {number} position
|
58
|
+
* @return {number}
|
59
|
+
*/
|
60
|
+
setPosition(position?: Position | number): number | Range | undefined;
|
61
|
+
/**
|
62
|
+
* Get caret position in pixels
|
63
|
+
* @return {number}
|
64
|
+
*/
|
65
|
+
getOffset(): number;
|
66
|
+
}
|
@@ -0,0 +1,259 @@
|
|
1
|
+
import { _ as _defineProperty, d as _createClass, c as _classCallCheck } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.object.to-string.js';
|
3
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
4
|
+
import 'core-js/modules/es.regexp.exec.js';
|
5
|
+
import 'core-js/modules/es.string.replace.js';
|
6
|
+
import { getRect } from '../global/dom.js';
|
7
|
+
import 'core-js/modules/es.object.assign.js';
|
8
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
9
|
+
import 'core-js/modules/es.array.filter.js';
|
10
|
+
import 'core-js/modules/es.string.split.js';
|
11
|
+
import 'core-js/modules/es.object.entries.js';
|
12
|
+
import 'core-js/modules/es.array.iterator.js';
|
13
|
+
import 'core-js/modules/es.set.js';
|
14
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @name Caret
|
18
|
+
*/
|
19
|
+
var Caret = /*#__PURE__*/function () {
|
20
|
+
function Caret(target) {
|
21
|
+
_classCallCheck(this, Caret);
|
22
|
+
_defineProperty(this, "target", void 0);
|
23
|
+
this.target = target;
|
24
|
+
}
|
25
|
+
_createClass(Caret, [{
|
26
|
+
key: "isContentEditable",
|
27
|
+
value: function isContentEditable() {
|
28
|
+
return this.target.contentEditable === 'true';
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Set focus on target if possible
|
32
|
+
*/
|
33
|
+
}, {
|
34
|
+
key: "focus",
|
35
|
+
value: function focus() {
|
36
|
+
if (!document.activeElement || document.activeElement !== this.target) {
|
37
|
+
this.target.focus();
|
38
|
+
}
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Get absolute caret position index
|
42
|
+
* @return {number}
|
43
|
+
*/
|
44
|
+
}, {
|
45
|
+
key: "getAbsolutePosition",
|
46
|
+
value: function getAbsolutePosition(node) {
|
47
|
+
var _curNode = node;
|
48
|
+
var curPos = 0;
|
49
|
+
while (_curNode != null && _curNode !== this.target) {
|
50
|
+
while (_curNode.previousSibling) {
|
51
|
+
var _curNode$previousSibl, _curNode$previousSibl2;
|
52
|
+
curPos += (_curNode$previousSibl = (_curNode$previousSibl2 = _curNode.previousSibling.textContent) === null || _curNode$previousSibl2 === void 0 ? void 0 : _curNode$previousSibl2.length) !== null && _curNode$previousSibl !== void 0 ? _curNode$previousSibl : 0;
|
53
|
+
_curNode = _curNode.previousSibling;
|
54
|
+
}
|
55
|
+
_curNode = _curNode.parentNode;
|
56
|
+
}
|
57
|
+
return curPos;
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* Get caret position index
|
61
|
+
* @param {Object} [params]
|
62
|
+
* @param {boolean} params.avoidFocus
|
63
|
+
* @return {number}
|
64
|
+
*/
|
65
|
+
}, {
|
66
|
+
key: "getPosition",
|
67
|
+
value: function getPosition() {
|
68
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
69
|
+
if (this.isContentEditable()) {
|
70
|
+
if (!params.avoidFocus) {
|
71
|
+
this.focus();
|
72
|
+
}
|
73
|
+
var selection = window.getSelection();
|
74
|
+
if (!(selection !== null && selection !== void 0 && selection.rangeCount)) {
|
75
|
+
return 0;
|
76
|
+
}
|
77
|
+
var range1 = selection.getRangeAt(0);
|
78
|
+
var range2 = range1.cloneRange();
|
79
|
+
range2.selectNodeContents(this.target);
|
80
|
+
range2.setEnd(range1.endContainer, range1.endOffset);
|
81
|
+
var _curNode = range1.startContainer;
|
82
|
+
if (this.target === _curNode) {
|
83
|
+
return range1.startOffset === 0 || _curNode.textContent == null ? 0 : _curNode.textContent.length;
|
84
|
+
} else if (!this.target.contains(_curNode)) {
|
85
|
+
return -1;
|
86
|
+
} else if (!_curNode) {
|
87
|
+
return 'selectionStart' in this.target && this.target.selectionStart || -1;
|
88
|
+
}
|
89
|
+
var curPos = this.getAbsolutePosition(_curNode);
|
90
|
+
if (range1.startContainer === range1.endContainer) {
|
91
|
+
if (range1.startOffset === range1.endOffset) {
|
92
|
+
return curPos + range1.startOffset;
|
93
|
+
} else {
|
94
|
+
return {
|
95
|
+
startOffset: curPos + range1.startOffset,
|
96
|
+
endOffset: curPos + range1.endOffset,
|
97
|
+
position: range2.toString().length
|
98
|
+
};
|
99
|
+
}
|
100
|
+
} else {
|
101
|
+
var startOffset = curPos + range1.startOffset;
|
102
|
+
var endPos = this.getAbsolutePosition(range1.endContainer);
|
103
|
+
var endOffset = endPos + range1.endOffset;
|
104
|
+
return {
|
105
|
+
startOffset,
|
106
|
+
endOffset,
|
107
|
+
position: range2.toString().length
|
108
|
+
};
|
109
|
+
}
|
110
|
+
}
|
111
|
+
return 'selectionStart' in this.target && this.target.selectionStart || -1;
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* Get relative position of query
|
115
|
+
* @param {Node} curNode
|
116
|
+
* @param {number} position
|
117
|
+
* @return {{_correctedPosition: number, _curNode: Node}}
|
118
|
+
*/
|
119
|
+
}, {
|
120
|
+
key: "getRelativePosition",
|
121
|
+
value: function getRelativePosition(curNode, position) {
|
122
|
+
var curPos = 0;
|
123
|
+
var _curNode = curNode;
|
124
|
+
var nodeTypeText = 3;
|
125
|
+
if (!_curNode) {
|
126
|
+
return {
|
127
|
+
_curNode: this.target,
|
128
|
+
_correctedPosition: position
|
129
|
+
};
|
130
|
+
}
|
131
|
+
if (position === 0) {
|
132
|
+
while (_curNode.nodeType !== nodeTypeText) {
|
133
|
+
_curNode = _curNode.childNodes[0];
|
134
|
+
}
|
135
|
+
var _correctedPosition2 = position;
|
136
|
+
return {
|
137
|
+
_curNode,
|
138
|
+
_correctedPosition: _correctedPosition2
|
139
|
+
};
|
140
|
+
}
|
141
|
+
var i = -1;
|
142
|
+
if (_curNode && _curNode.nodeType !== undefined) {
|
143
|
+
while (curPos < position && _curNode.nodeType !== nodeTypeText) {
|
144
|
+
i++;
|
145
|
+
if (_curNode.childNodes[i] != null) {
|
146
|
+
var _curNode$childNodes$i, _curNode$childNodes$i2;
|
147
|
+
curPos += (_curNode$childNodes$i = (_curNode$childNodes$i2 = _curNode.childNodes[i].textContent) === null || _curNode$childNodes$i2 === void 0 ? void 0 : _curNode$childNodes$i2.length) !== null && _curNode$childNodes$i !== void 0 ? _curNode$childNodes$i : 0;
|
148
|
+
if (curPos >= position) {
|
149
|
+
var _curNode$textContent$, _curNode$textContent;
|
150
|
+
_curNode = _curNode.childNodes[i];
|
151
|
+
curPos -= (_curNode$textContent$ = (_curNode$textContent = _curNode.textContent) === null || _curNode$textContent === void 0 ? void 0 : _curNode$textContent.length) !== null && _curNode$textContent$ !== void 0 ? _curNode$textContent$ : 0;
|
152
|
+
i = -1;
|
153
|
+
}
|
154
|
+
} else {
|
155
|
+
break;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
var _correctedPosition = position - curPos;
|
160
|
+
return {
|
161
|
+
_curNode,
|
162
|
+
_correctedPosition
|
163
|
+
};
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* Set caret position index
|
167
|
+
* @param {number} position
|
168
|
+
* @return {number}
|
169
|
+
*/
|
170
|
+
}, {
|
171
|
+
key: "setPosition",
|
172
|
+
value: function setPosition(position) {
|
173
|
+
var isContentEditable = this.isContentEditable();
|
174
|
+
var correctedPosition;
|
175
|
+
var curNode = this.target && this.target.childNodes[0];
|
176
|
+
if (position !== undefined) {
|
177
|
+
if (typeof position === 'object') {
|
178
|
+
var range = new Range();
|
179
|
+
var start = this.getRelativePosition(curNode, position.startOffset);
|
180
|
+
range.setStart(start._curNode, start._correctedPosition);
|
181
|
+
var end = this.getRelativePosition(curNode, position.endOffset);
|
182
|
+
range.setEnd(end._curNode, end._correctedPosition);
|
183
|
+
correctedPosition = range;
|
184
|
+
} else if (position === -1) {
|
185
|
+
var _value$length;
|
186
|
+
var value = isContentEditable ? this.target.textContent : Caret.normalizeNewlines('value' in this.target ? this.target.value : undefined);
|
187
|
+
correctedPosition = (_value$length = value === null || value === void 0 ? void 0 : value.length) !== null && _value$length !== void 0 ? _value$length : 0;
|
188
|
+
} else {
|
189
|
+
var _this$getRelativePosi = this.getRelativePosition(curNode, position),
|
190
|
+
_curNode = _this$getRelativePosi._curNode,
|
191
|
+
_correctedPosition = _this$getRelativePosi._correctedPosition;
|
192
|
+
curNode = _curNode;
|
193
|
+
correctedPosition = _correctedPosition;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
if (isContentEditable) {
|
197
|
+
this.focus();
|
198
|
+
try {
|
199
|
+
if (correctedPosition instanceof Range) {
|
200
|
+
var _window$getSelection, _window$getSelection2;
|
201
|
+
(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();
|
202
|
+
(_window$getSelection2 = window.getSelection()) === null || _window$getSelection2 === void 0 || _window$getSelection2.addRange(correctedPosition);
|
203
|
+
} else {
|
204
|
+
var _window$getSelection3;
|
205
|
+
(_window$getSelection3 = window.getSelection()) === null || _window$getSelection3 === void 0 || _window$getSelection3.collapse(curNode || this.target, correctedPosition);
|
206
|
+
}
|
207
|
+
} catch (e) {
|
208
|
+
// Do nothing
|
209
|
+
}
|
210
|
+
} else if ('setSelectionRange' in this.target && typeof correctedPosition === 'number') {
|
211
|
+
this.target.setSelectionRange(correctedPosition, correctedPosition);
|
212
|
+
}
|
213
|
+
return correctedPosition;
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* Get caret position in pixels
|
217
|
+
* @return {number}
|
218
|
+
*/
|
219
|
+
}, {
|
220
|
+
key: "getOffset",
|
221
|
+
value: function getOffset() {
|
222
|
+
var offset = 0;
|
223
|
+
var range;
|
224
|
+
try {
|
225
|
+
var _window$getSelection4, _range;
|
226
|
+
// Both statements may throw
|
227
|
+
range = (_window$getSelection4 = window.getSelection()) === null || _window$getSelection4 === void 0 ? void 0 : _window$getSelection4.getRangeAt(0).cloneRange();
|
228
|
+
(_range = range) === null || _range === void 0 || _range.setStart(range.startContainer, range.startOffset - 1);
|
229
|
+
} catch (e) {
|
230
|
+
return offset;
|
231
|
+
}
|
232
|
+
if (range && range.endOffset !== 0 && range.toString() !== '') {
|
233
|
+
offset = getRect(range).right - getRect(this.target).left - (range.startContainer instanceof HTMLElement && range.startContainer.offsetLeft || 0);
|
234
|
+
}
|
235
|
+
return offset;
|
236
|
+
}
|
237
|
+
}], [{
|
238
|
+
key: "normalizeNewlines",
|
239
|
+
value:
|
240
|
+
/**
|
241
|
+
* Line endings normalizer
|
242
|
+
* Borrowed from jQuery
|
243
|
+
* @see https://github.com/jquery/jquery/blob/master/src/attributes/val.js
|
244
|
+
* @param value {*}
|
245
|
+
* @return {*}
|
246
|
+
*/
|
247
|
+
function normalizeNewlines(value) {
|
248
|
+
return typeof value === 'string' ? value.replace(this.returnRE, '') : value;
|
249
|
+
}
|
250
|
+
}]);
|
251
|
+
return Caret;
|
252
|
+
}();
|
253
|
+
/**
|
254
|
+
* Line endings RegExp
|
255
|
+
* @type {RegExp}
|
256
|
+
*/
|
257
|
+
_defineProperty(Caret, "returnRE", /\r/g);
|
258
|
+
|
259
|
+
export { Caret as default };
|
@@ -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,130 @@
|
|
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, { PureComponent } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import checkmarkIcon from '@jetbrains/icons/checkmark-14px';
|
7
|
+
import minusIcon from '@jetbrains/icons/remove-14px';
|
8
|
+
import Icon from '../icon/icon.js';
|
9
|
+
import { refObject } from '../global/prop-types.js';
|
10
|
+
import composeRefs from '../global/composeRefs.js';
|
11
|
+
import 'util-deprecate';
|
12
|
+
import '../icon/icon__constants.js';
|
13
|
+
import '../_helpers/icon__svg.js';
|
14
|
+
import 'core-js/modules/es.regexp.exec.js';
|
15
|
+
import 'core-js/modules/es.string.replace.js';
|
16
|
+
import 'core-js/modules/es.string.starts-with.js';
|
17
|
+
import '../global/memoize.js';
|
18
|
+
import 'core-js/modules/es.array.iterator.js';
|
19
|
+
import 'core-js/modules/es.map.js';
|
20
|
+
import 'core-js/modules/es.object.to-string.js';
|
21
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
22
|
+
import 'core-js/modules/es.weak-map.js';
|
23
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
24
|
+
|
25
|
+
var modules_3199090e = {"checkboxSize":"14px","light":"light_rui_2ac4","checkbox":"checkbox_rui_d990","cell":"cell_rui_d990","icon":"icon_rui_d990","check":"check_rui_d990 icon_rui_d990","minus":"minus_rui_d990 icon_rui_d990","input":"input_rui_d990","focus":"focus_rui_d990","label":"label_rui_d990"};
|
26
|
+
|
27
|
+
var _excluded = ["children", "label", "className", "containerClassName", "containerStyle", "cellClassName", "labelClassName", "indeterminate", "inputRef"];
|
28
|
+
/**
|
29
|
+
* @name Checkbox
|
30
|
+
*/
|
31
|
+
/**
|
32
|
+
* Displays a checkbox.
|
33
|
+
*/
|
34
|
+
var Checkbox = /*#__PURE__*/function (_PureComponent) {
|
35
|
+
_inherits(Checkbox, _PureComponent);
|
36
|
+
var _super = _createSuper(Checkbox);
|
37
|
+
function Checkbox() {
|
38
|
+
var _this;
|
39
|
+
_classCallCheck(this, Checkbox);
|
40
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
41
|
+
args[_key] = arguments[_key];
|
42
|
+
}
|
43
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "input", void 0);
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "inputRef", function (el) {
|
46
|
+
if (el != null) {
|
47
|
+
el.indeterminate = _this.props.indeterminate;
|
48
|
+
}
|
49
|
+
_this.input = el;
|
50
|
+
});
|
51
|
+
return _this;
|
52
|
+
}
|
53
|
+
_createClass(Checkbox, [{
|
54
|
+
key: "componentDidMount",
|
55
|
+
value: function componentDidMount() {
|
56
|
+
if (this.input != null) {
|
57
|
+
this.input.indeterminate = this.props.indeterminate;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}, {
|
61
|
+
key: "componentDidUpdate",
|
62
|
+
value: function componentDidUpdate(prevProps) {
|
63
|
+
var indeterminate = this.props.indeterminate;
|
64
|
+
if (this.input != null && indeterminate !== prevProps.indeterminate) {
|
65
|
+
this.input.indeterminate = this.props.indeterminate;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}, {
|
69
|
+
key: "render",
|
70
|
+
value: function render() {
|
71
|
+
var _this$props = this.props,
|
72
|
+
children = _this$props.children,
|
73
|
+
label = _this$props.label,
|
74
|
+
className = _this$props.className,
|
75
|
+
containerClassName = _this$props.containerClassName,
|
76
|
+
containerStyle = _this$props.containerStyle,
|
77
|
+
cellClassName = _this$props.cellClassName,
|
78
|
+
labelClassName = _this$props.labelClassName;
|
79
|
+
_this$props.indeterminate;
|
80
|
+
var inputRef = _this$props.inputRef,
|
81
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
82
|
+
var classes = classNames(modules_3199090e.input, className);
|
83
|
+
var containerClasses = classNames(modules_3199090e.checkbox, containerClassName);
|
84
|
+
var cellClasses = classNames(modules_3199090e.cell, cellClassName);
|
85
|
+
var labelClasses = classNames(modules_3199090e.label, labelClassName);
|
86
|
+
return /*#__PURE__*/React.createElement("label", {
|
87
|
+
className: containerClasses,
|
88
|
+
style: containerStyle,
|
89
|
+
"data-test": "ring-checkbox"
|
90
|
+
}, /*#__PURE__*/React.createElement("input", _extends({}, restProps, {
|
91
|
+
"data-checked": restProps.checked,
|
92
|
+
ref: composeRefs(this.inputRef, inputRef),
|
93
|
+
type: "checkbox",
|
94
|
+
className: classes
|
95
|
+
})), /*#__PURE__*/React.createElement("span", {
|
96
|
+
className: cellClasses
|
97
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
98
|
+
glyph: checkmarkIcon,
|
99
|
+
className: modules_3199090e.check
|
100
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
101
|
+
glyph: minusIcon,
|
102
|
+
className: modules_3199090e.minus
|
103
|
+
})), /*#__PURE__*/React.createElement("span", {
|
104
|
+
className: labelClasses
|
105
|
+
}, label || children));
|
106
|
+
}
|
107
|
+
}]);
|
108
|
+
return Checkbox;
|
109
|
+
}(PureComponent);
|
110
|
+
_defineProperty(Checkbox, "propTypes", {
|
111
|
+
name: PropTypes.string,
|
112
|
+
label: PropTypes.string,
|
113
|
+
className: PropTypes.string,
|
114
|
+
containerClassName: PropTypes.string,
|
115
|
+
containerStyle: PropTypes.object,
|
116
|
+
cellClassName: PropTypes.string,
|
117
|
+
labelClassName: PropTypes.string,
|
118
|
+
defaultChecked: PropTypes.bool,
|
119
|
+
checked: PropTypes.bool,
|
120
|
+
indeterminate: PropTypes.bool,
|
121
|
+
disabled: PropTypes.bool,
|
122
|
+
onChange: PropTypes.func,
|
123
|
+
children: PropTypes.node,
|
124
|
+
inputRef: PropTypes.oneOfType([PropTypes.func, refObject(PropTypes.instanceOf(HTMLInputElement))])
|
125
|
+
});
|
126
|
+
_defineProperty(Checkbox, "defaultProps", {
|
127
|
+
indeterminate: false
|
128
|
+
});
|
129
|
+
|
130
|
+
export { Checkbox as default };
|
@@ -0,0 +1,42 @@
|
|
1
|
+
function copyTextToClipboard(str) {
|
2
|
+
var 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
|
+
var selection = document.getSelection();
|
9
|
+
// Should restore previous selection
|
10
|
+
var selected = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
11
|
+
el.select();
|
12
|
+
document.execCommand('copy');
|
13
|
+
document.body.removeChild(el);
|
14
|
+
if (selected && selection) {
|
15
|
+
selection.removeAllRanges();
|
16
|
+
selection.addRange(selected);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
function copyHTMLToClipboard(str) {
|
20
|
+
var el = document.createElement('div');
|
21
|
+
el.innerHTML = str;
|
22
|
+
el.setAttribute('readonly', '');
|
23
|
+
el.style.position = 'absolute';
|
24
|
+
el.style.left = '-9999px';
|
25
|
+
document.body.appendChild(el);
|
26
|
+
var selection = document.getSelection();
|
27
|
+
// Should restore previous selection
|
28
|
+
var selected = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
29
|
+
selection === null || selection === void 0 || selection.removeAllRanges();
|
30
|
+
var range = document.createRange();
|
31
|
+
range.selectNode(el);
|
32
|
+
selection === null || selection === void 0 || selection.addRange(range);
|
33
|
+
document.execCommand('copy');
|
34
|
+
selection === null || selection === void 0 || selection.removeAllRanges();
|
35
|
+
document.execCommand('copy');
|
36
|
+
document.body.removeChild(el);
|
37
|
+
if (selected && selection) {
|
38
|
+
selection.addRange(selected);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
export { copyHTMLToClipboard, copyTextToClipboard };
|
@@ -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;
|