@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,217 @@
|
|
1
|
+
import { _ as _defineProperty, d as _createClass, c as _classCallCheck, h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'core-js/modules/es.object.assign.js';
|
4
|
+
import 'core-js/modules/es.array.index-of.js';
|
5
|
+
import 'core-js/modules/es.array.slice.js';
|
6
|
+
import 'core-js/modules/es.array.filter.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
|
9
|
+
var defaultOptions = {
|
10
|
+
searchMax: 20,
|
11
|
+
searchSideThreshold: 100,
|
12
|
+
queryFormatter: function queryFormatter(query) {
|
13
|
+
return "".concat(query, " or ").concat(query, "*");
|
14
|
+
}
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* HubSource is designed to speed up search requests for small installations.
|
18
|
+
* If there are less than "searchSideThreshold" items, it uses client-side filtering
|
19
|
+
* of cached results to greatly increase search speed. Useful for completion and
|
20
|
+
* select data source.
|
21
|
+
*/
|
22
|
+
var HubSource = /*#__PURE__*/function () {
|
23
|
+
function HubSource(auth, relativeUrl, options) {
|
24
|
+
_classCallCheck(this, HubSource);
|
25
|
+
_defineProperty(this, "http", void 0);
|
26
|
+
_defineProperty(this, "relativeUrl", void 0);
|
27
|
+
_defineProperty(this, "options", void 0);
|
28
|
+
_defineProperty(this, "storedData", void 0);
|
29
|
+
_defineProperty(this, "isClientSideSearch", void 0);
|
30
|
+
_defineProperty(this, "filterFn", void 0);
|
31
|
+
this.http = auth.http;
|
32
|
+
this.relativeUrl = relativeUrl;
|
33
|
+
this.options = Object.assign({}, defaultOptions, options);
|
34
|
+
this.storedData = null;
|
35
|
+
this.isClientSideSearch = null;
|
36
|
+
this.filterFn = function () {
|
37
|
+
return true;
|
38
|
+
};
|
39
|
+
}
|
40
|
+
_createClass(HubSource, [{
|
41
|
+
key: "makeRequest",
|
42
|
+
value: function makeRequest(queryParams) {
|
43
|
+
return this.http.get(this.relativeUrl, {
|
44
|
+
query: queryParams
|
45
|
+
});
|
46
|
+
}
|
47
|
+
}, {
|
48
|
+
key: "makeCachedRequest",
|
49
|
+
value: function () {
|
50
|
+
var _makeCachedRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
51
|
+
var res;
|
52
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
54
|
+
case 0:
|
55
|
+
if (!this.storedData) {
|
56
|
+
_context.next = 2;
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
return _context.abrupt("return", this.storedData);
|
60
|
+
case 2:
|
61
|
+
_context.next = 4;
|
62
|
+
return this.makeRequest(params);
|
63
|
+
case 4:
|
64
|
+
res = _context.sent;
|
65
|
+
this.storedData = res;
|
66
|
+
return _context.abrupt("return", res);
|
67
|
+
case 7:
|
68
|
+
case "end":
|
69
|
+
return _context.stop();
|
70
|
+
}
|
71
|
+
}, _callee, this);
|
72
|
+
}));
|
73
|
+
function makeCachedRequest(_x) {
|
74
|
+
return _makeCachedRequest.apply(this, arguments);
|
75
|
+
}
|
76
|
+
return makeCachedRequest;
|
77
|
+
}()
|
78
|
+
}, {
|
79
|
+
key: "checkIsClientSideSearch",
|
80
|
+
value: function checkIsClientSideSearch(res) {
|
81
|
+
return res.total <= this.options.searchSideThreshold;
|
82
|
+
}
|
83
|
+
}, {
|
84
|
+
key: "getDefaultFilterFn",
|
85
|
+
value: function getDefaultFilterFn(query) {
|
86
|
+
if (!query) {
|
87
|
+
return function () {
|
88
|
+
return true;
|
89
|
+
};
|
90
|
+
}
|
91
|
+
return function (it) {
|
92
|
+
return it.name.toLowerCase().indexOf(query.toLowerCase()) !== -1;
|
93
|
+
};
|
94
|
+
}
|
95
|
+
}, {
|
96
|
+
key: "formatQuery",
|
97
|
+
value: function formatQuery(query) {
|
98
|
+
return query ? this.options.queryFormatter(query) : '';
|
99
|
+
}
|
100
|
+
}, {
|
101
|
+
key: "processResults",
|
102
|
+
value: function processResults(res) {
|
103
|
+
var _this = this;
|
104
|
+
var items = res[this.relativeUrl] || [];
|
105
|
+
if (this.isClientSideSearch) {
|
106
|
+
return items.filter(function (it) {
|
107
|
+
return _this.filterFn(it);
|
108
|
+
}).slice(0, this.options.searchMax);
|
109
|
+
}
|
110
|
+
return items;
|
111
|
+
}
|
112
|
+
}, {
|
113
|
+
key: "sideDetectionRequest",
|
114
|
+
value: function () {
|
115
|
+
var _sideDetectionRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params, query) {
|
116
|
+
var res;
|
117
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
118
|
+
while (1) switch (_context2.prev = _context2.next) {
|
119
|
+
case 0:
|
120
|
+
_context2.next = 2;
|
121
|
+
return this.makeCachedRequest(HubSource.mergeParams(params, {
|
122
|
+
$top: this.options.searchSideThreshold
|
123
|
+
}));
|
124
|
+
case 2:
|
125
|
+
res = _context2.sent;
|
126
|
+
this.isClientSideSearch = this.checkIsClientSideSearch(res);
|
127
|
+
if (this.isClientSideSearch) {
|
128
|
+
_context2.next = 6;
|
129
|
+
break;
|
130
|
+
}
|
131
|
+
return _context2.abrupt("return", this.doServerSideSearch(params, query));
|
132
|
+
case 6:
|
133
|
+
return _context2.abrupt("return", res);
|
134
|
+
case 7:
|
135
|
+
case "end":
|
136
|
+
return _context2.stop();
|
137
|
+
}
|
138
|
+
}, _callee2, this);
|
139
|
+
}));
|
140
|
+
function sideDetectionRequest(_x2, _x3) {
|
141
|
+
return _sideDetectionRequest.apply(this, arguments);
|
142
|
+
}
|
143
|
+
return sideDetectionRequest;
|
144
|
+
}()
|
145
|
+
}, {
|
146
|
+
key: "doClientSideSearch",
|
147
|
+
value: function doClientSideSearch(params) {
|
148
|
+
return this.makeCachedRequest(HubSource.mergeParams(params, {
|
149
|
+
$top: this.constructor.TOP_ALL
|
150
|
+
}));
|
151
|
+
}
|
152
|
+
}, {
|
153
|
+
key: "doServerSideSearch",
|
154
|
+
value: function doServerSideSearch(params, query) {
|
155
|
+
return this.makeRequest(HubSource.mergeParams(params, {
|
156
|
+
query: this.formatQuery(query),
|
157
|
+
$top: this.options.searchMax
|
158
|
+
}));
|
159
|
+
}
|
160
|
+
}, {
|
161
|
+
key: "getValueFromSuitableSource",
|
162
|
+
value: function getValueFromSuitableSource(query, params) {
|
163
|
+
if (this.isClientSideSearch === null) {
|
164
|
+
return this.sideDetectionRequest(params, query);
|
165
|
+
}
|
166
|
+
if (this.isClientSideSearch) {
|
167
|
+
return this.doClientSideSearch(params);
|
168
|
+
}
|
169
|
+
return this.doServerSideSearch(params, query);
|
170
|
+
}
|
171
|
+
}, {
|
172
|
+
key: "get",
|
173
|
+
value: function () {
|
174
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, params, filterFn) {
|
175
|
+
var res;
|
176
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
177
|
+
while (1) switch (_context3.prev = _context3.next) {
|
178
|
+
case 0:
|
179
|
+
HubSource.validateInputParams(params);
|
180
|
+
this.filterFn = filterFn || this.getDefaultFilterFn(query);
|
181
|
+
_context3.next = 4;
|
182
|
+
return this.getValueFromSuitableSource(query, params);
|
183
|
+
case 4:
|
184
|
+
res = _context3.sent;
|
185
|
+
return _context3.abrupt("return", this.processResults(res));
|
186
|
+
case 6:
|
187
|
+
case "end":
|
188
|
+
return _context3.stop();
|
189
|
+
}
|
190
|
+
}, _callee3, this);
|
191
|
+
}));
|
192
|
+
function get(_x4, _x5, _x6) {
|
193
|
+
return _get.apply(this, arguments);
|
194
|
+
}
|
195
|
+
return get;
|
196
|
+
}()
|
197
|
+
}], [{
|
198
|
+
key: "mergeParams",
|
199
|
+
value: function mergeParams(params, toMerge) {
|
200
|
+
return Object.assign({}, params, toMerge);
|
201
|
+
}
|
202
|
+
}, {
|
203
|
+
key: "validateInputParams",
|
204
|
+
value: function validateInputParams(params) {
|
205
|
+
if (params.top) {
|
206
|
+
throw new Error('HubSource: params.top should not be filled, configure "options.searchMax" instead');
|
207
|
+
}
|
208
|
+
if (params.query) {
|
209
|
+
throw new Error('HubSource: params.query should not be filled, configure "options.queryFormatter" instead');
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}]);
|
213
|
+
return HubSource;
|
214
|
+
}();
|
215
|
+
_defineProperty(HubSource, "TOP_ALL", -1);
|
216
|
+
|
217
|
+
export { HubSource as default };
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import Auth, { AuthUser } from '../auth/auth';
|
2
|
+
import { UserCardUser } from '../user-card/card';
|
3
|
+
export declare function convertUserForCard(hubUser: AuthUser, serverUri?: string): UserCardUser;
|
4
|
+
export declare function createHubUserCardSource(auth: Auth, userId: string | number, fields?: string): () => Promise<UserCardUser>;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import HTTP from '../http/http.js';
|
4
|
+
import 'core-js/modules/es.array.iterator.js';
|
5
|
+
import 'core-js/modules/es.object.to-string.js';
|
6
|
+
import 'core-js/modules/es.weak-map.js';
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
8
|
+
import 'core-js/modules/es.promise.js';
|
9
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
10
|
+
import 'core-js/modules/es.object.entries.js';
|
11
|
+
import 'core-js/modules/es.reflect.delete-property.js';
|
12
|
+
import 'core-js/modules/es.array.index-of.js';
|
13
|
+
import 'es6-error';
|
14
|
+
import '../global/url.js';
|
15
|
+
import 'core-js/modules/es.regexp.exec.js';
|
16
|
+
import 'core-js/modules/es.string.match.js';
|
17
|
+
import 'core-js/modules/es.string.replace.js';
|
18
|
+
|
19
|
+
var DEFAULT_FIELDS = 'id,name,login,banned,banReason,profile(email/email,avatar/url)';
|
20
|
+
function convertUserForCard(hubUser) {
|
21
|
+
var _hubUser$profile, _hubUser$profile2;
|
22
|
+
var serverUri = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
23
|
+
return {
|
24
|
+
name: hubUser.name,
|
25
|
+
login: hubUser.login,
|
26
|
+
banned: hubUser.banned,
|
27
|
+
banReason: hubUser.banReason,
|
28
|
+
email: (_hubUser$profile = hubUser.profile) === null || _hubUser$profile === void 0 || (_hubUser$profile = _hubUser$profile.email) === null || _hubUser$profile === void 0 ? void 0 : _hubUser$profile.email,
|
29
|
+
avatarUrl: (_hubUser$profile2 = hubUser.profile) === null || _hubUser$profile2 === void 0 || (_hubUser$profile2 = _hubUser$profile2.avatar) === null || _hubUser$profile2 === void 0 ? void 0 : _hubUser$profile2.url,
|
30
|
+
href: "".concat(serverUri, "users/").concat(hubUser.id)
|
31
|
+
};
|
32
|
+
}
|
33
|
+
function createHubUserCardSource(auth, userId) {
|
34
|
+
var fields = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_FIELDS;
|
35
|
+
var http = new HTTP(auth);
|
36
|
+
return /*#__PURE__*/function () {
|
37
|
+
var _getHubUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
38
|
+
var hubUser;
|
39
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
41
|
+
case 0:
|
42
|
+
_context.next = 2;
|
43
|
+
return http.get("".concat(auth.config.serverUri, "api/rest/users/").concat(userId, "?fields=").concat(fields));
|
44
|
+
case 2:
|
45
|
+
hubUser = _context.sent;
|
46
|
+
return _context.abrupt("return", convertUserForCard(hubUser, auth.config.serverUri));
|
47
|
+
case 4:
|
48
|
+
case "end":
|
49
|
+
return _context.stop();
|
50
|
+
}
|
51
|
+
}, _callee);
|
52
|
+
}));
|
53
|
+
function getHubUser() {
|
54
|
+
return _getHubUser.apply(this, arguments);
|
55
|
+
}
|
56
|
+
return getHubUser;
|
57
|
+
}();
|
58
|
+
}
|
59
|
+
|
60
|
+
export { convertUserForCard, createHubUserCardSource };
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import Auth, { AuthUser } from '../auth/auth';
|
2
|
+
import HubSource, { Item } from './hub-source';
|
3
|
+
export interface HubSourceUsersGroupsOptions {
|
4
|
+
searchMax: number;
|
5
|
+
searchSideThreshold: number;
|
6
|
+
}
|
7
|
+
export interface UserGroup extends Item {
|
8
|
+
id: string;
|
9
|
+
total?: number;
|
10
|
+
userCount: number;
|
11
|
+
iconUrl?: string;
|
12
|
+
}
|
13
|
+
export default class HubSourceUsersGroups {
|
14
|
+
auth: Auth;
|
15
|
+
options: HubSourceUsersGroupsOptions;
|
16
|
+
usersSource: HubSource<AuthUser, 'users'>;
|
17
|
+
groupsSource: HubSource<UserGroup, 'usergroups'>;
|
18
|
+
constructor(auth: Auth, options?: Partial<HubSourceUsersGroupsOptions>);
|
19
|
+
static wrapMultiwordQuery(query?: string): string | undefined;
|
20
|
+
createUsersFilterFn(query?: string): (it: AuthUser) => boolean;
|
21
|
+
getUsers(query?: string): Promise<AuthUser[]>;
|
22
|
+
getGroups(query?: string): Promise<UserGroup[]>;
|
23
|
+
getUserAndGroups(query?: string): Promise<[AuthUser[], UserGroup[]]>;
|
24
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { d as _createClass, c as _classCallCheck, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.object.assign.js';
|
3
|
+
import 'core-js/modules/es.array.concat.js';
|
4
|
+
import 'core-js/modules/es.array.index-of.js';
|
5
|
+
import 'core-js/modules/es.array.iterator.js';
|
6
|
+
import 'core-js/modules/es.object.to-string.js';
|
7
|
+
import 'core-js/modules/es.promise.js';
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
9
|
+
import HubSource from './hub-source.js';
|
10
|
+
import 'core-js/modules/es.array.slice.js';
|
11
|
+
import 'core-js/modules/es.array.filter.js';
|
12
|
+
|
13
|
+
var defaultOptions = {
|
14
|
+
searchMax: 20,
|
15
|
+
searchSideThreshold: 200
|
16
|
+
};
|
17
|
+
var HubSourceUsersGroups = /*#__PURE__*/function () {
|
18
|
+
function HubSourceUsersGroups(auth, options) {
|
19
|
+
_classCallCheck(this, HubSourceUsersGroups);
|
20
|
+
_defineProperty(this, "auth", void 0);
|
21
|
+
_defineProperty(this, "options", void 0);
|
22
|
+
_defineProperty(this, "usersSource", void 0);
|
23
|
+
_defineProperty(this, "groupsSource", void 0);
|
24
|
+
this.auth = auth;
|
25
|
+
this.options = Object.assign({}, defaultOptions, options);
|
26
|
+
this.usersSource = new HubSource(auth, 'users', {
|
27
|
+
searchMax: this.options.searchMax,
|
28
|
+
searchSideThreshold: this.options.searchSideThreshold,
|
29
|
+
queryFormatter: function queryFormatter(query) {
|
30
|
+
return "nameStartsWith: ".concat(HubSourceUsersGroups.wrapMultiwordQuery(query), " or loginStartsWith: ").concat(HubSourceUsersGroups.wrapMultiwordQuery(query));
|
31
|
+
}
|
32
|
+
});
|
33
|
+
this.groupsSource = new HubSource(auth, 'usergroups', {
|
34
|
+
searchMax: this.options.searchMax,
|
35
|
+
searchSideThreshold: this.options.searchSideThreshold
|
36
|
+
});
|
37
|
+
}
|
38
|
+
_createClass(HubSourceUsersGroups, [{
|
39
|
+
key: "createUsersFilterFn",
|
40
|
+
value: function createUsersFilterFn(query) {
|
41
|
+
if (!query) {
|
42
|
+
return function () {
|
43
|
+
return true;
|
44
|
+
};
|
45
|
+
}
|
46
|
+
var normalizedQuery = query.toLowerCase();
|
47
|
+
return function (it) {
|
48
|
+
return it.name.toLowerCase().indexOf(normalizedQuery) !== -1 || it.login.toLowerCase().indexOf(normalizedQuery) !== -1;
|
49
|
+
};
|
50
|
+
}
|
51
|
+
}, {
|
52
|
+
key: "getUsers",
|
53
|
+
value: function getUsers() {
|
54
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
55
|
+
return this.usersSource.get(query, {
|
56
|
+
fields: 'id,name,login,total,profile/avatar/url',
|
57
|
+
orderBy: 'name'
|
58
|
+
}, this.createUsersFilterFn(query));
|
59
|
+
}
|
60
|
+
}, {
|
61
|
+
key: "getGroups",
|
62
|
+
value: function getGroups() {
|
63
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
64
|
+
return this.groupsSource.get(query, {
|
65
|
+
fields: 'id,name,total,userCount,iconUrl',
|
66
|
+
orderBy: 'name'
|
67
|
+
});
|
68
|
+
}
|
69
|
+
}, {
|
70
|
+
key: "getUserAndGroups",
|
71
|
+
value: function getUserAndGroups(query) {
|
72
|
+
return Promise.all([this.getUsers(query), this.getGroups(query)]);
|
73
|
+
}
|
74
|
+
}], [{
|
75
|
+
key: "wrapMultiwordQuery",
|
76
|
+
value: function wrapMultiwordQuery(query) {
|
77
|
+
if (query && query.indexOf(' ') !== -1) {
|
78
|
+
return "{".concat(query, "}");
|
79
|
+
}
|
80
|
+
return query;
|
81
|
+
}
|
82
|
+
}]);
|
83
|
+
return HubSourceUsersGroups;
|
84
|
+
}();
|
85
|
+
|
86
|
+
export { HubSourceUsersGroups as default };
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { type Messages } from './i18n';
|
3
|
+
export interface I18nContextProps {
|
4
|
+
translate(key: keyof Messages): string;
|
5
|
+
messages: Messages;
|
6
|
+
}
|
7
|
+
export declare const I18nContext: React.Context<I18nContextProps>;
|
8
|
+
interface I18nContextHolderProps {
|
9
|
+
messages: Messages;
|
10
|
+
children?: React.ReactNode;
|
11
|
+
}
|
12
|
+
export declare const I18nContextHolder: React.FC<I18nContextHolderProps>;
|
13
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import { getTranslations, translate, setTranslations } from './i18n.js';
|
3
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
4
|
+
import 'core-js/modules/es.array.iterator.js';
|
5
|
+
import 'core-js/modules/es.object.to-string.js';
|
6
|
+
import 'core-js/modules/es.set.js';
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
8
|
+
|
9
|
+
var I18nContext = /*#__PURE__*/React.createContext({
|
10
|
+
messages: getTranslations(),
|
11
|
+
translate
|
12
|
+
});
|
13
|
+
var I18nContextHolder = function I18nContextHolder(_ref) {
|
14
|
+
var children = _ref.children,
|
15
|
+
messages = _ref.messages;
|
16
|
+
useEffect(function () {
|
17
|
+
setTranslations(messages);
|
18
|
+
}, [messages]);
|
19
|
+
return /*#__PURE__*/React.createElement(I18nContext.Provider, {
|
20
|
+
value: {
|
21
|
+
messages,
|
22
|
+
translate
|
23
|
+
}
|
24
|
+
}, children);
|
25
|
+
};
|
26
|
+
|
27
|
+
export { I18nContext, I18nContextHolder };
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import defaultMessages from './messages.json';
|
2
|
+
export type MessagesStrict = typeof defaultMessages;
|
3
|
+
export type Messages = Partial<MessagesStrict>;
|
4
|
+
export declare function setTranslations(newMessages: Messages): void;
|
5
|
+
export declare function getTranslations(): Partial<{
|
6
|
+
login: string;
|
7
|
+
logout: string;
|
8
|
+
loginTo: string;
|
9
|
+
ok: string;
|
10
|
+
cancel: string;
|
11
|
+
tryAgainLabel: string;
|
12
|
+
postpone: string;
|
13
|
+
youHaveLoggedInAs: string;
|
14
|
+
applyChange: string;
|
15
|
+
backendIsNotAvailable: string;
|
16
|
+
checkAgain: string;
|
17
|
+
nothingHappensLink: string;
|
18
|
+
errorMessage: string;
|
19
|
+
applyChangedUser: string;
|
20
|
+
profile: string;
|
21
|
+
switchUser: string;
|
22
|
+
addFirstDate: string;
|
23
|
+
addSecondDate: string;
|
24
|
+
addTime: string;
|
25
|
+
selectName: string;
|
26
|
+
setDate: string;
|
27
|
+
setDateTime: string;
|
28
|
+
setPeriod: string;
|
29
|
+
clear: string;
|
30
|
+
gotIt: string;
|
31
|
+
dismiss: string;
|
32
|
+
perPage: string;
|
33
|
+
firstPage: string;
|
34
|
+
lastPage: string;
|
35
|
+
nextPage: string;
|
36
|
+
previousPage: string;
|
37
|
+
searchTitle: string;
|
38
|
+
clearTitle: string;
|
39
|
+
userAgreement: string;
|
40
|
+
accept: string;
|
41
|
+
decline: string;
|
42
|
+
close: string;
|
43
|
+
scrollToAccept: string;
|
44
|
+
remindLater: string;
|
45
|
+
filterItems: string;
|
46
|
+
selectOption: string;
|
47
|
+
progress: string;
|
48
|
+
loading: string;
|
49
|
+
noOptionsFound: string;
|
50
|
+
banned: string;
|
51
|
+
online: string;
|
52
|
+
offline: string;
|
53
|
+
copyToClipboard: string;
|
54
|
+
copiedToClipboard: string;
|
55
|
+
copingToClipboardError: string;
|
56
|
+
unverified: string;
|
57
|
+
}>;
|
58
|
+
export declare function getTranslationsWithFallback(): MessagesStrict;
|
59
|
+
export declare function translate(key: keyof MessagesStrict): string;
|
@@ -0,0 +1,139 @@
|
|
1
|
+
import { g as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.iterator.js';
|
3
|
+
import 'core-js/modules/es.object.to-string.js';
|
4
|
+
import 'core-js/modules/es.set.js';
|
5
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
6
|
+
|
7
|
+
var login = "Log in";
|
8
|
+
var logout = "Log out";
|
9
|
+
var loginTo = "Log in to {{serviceName}}";
|
10
|
+
var ok = "OK";
|
11
|
+
var cancel = "Cancel";
|
12
|
+
var tryAgainLabel = "Try again";
|
13
|
+
var postpone = "Postpone";
|
14
|
+
var youHaveLoggedInAs = "You have logged in as another user: {{userName}}";
|
15
|
+
var applyChange = "Apply change";
|
16
|
+
var backendIsNotAvailable = "Connection lost";
|
17
|
+
var checkAgain = "try again";
|
18
|
+
var nothingHappensLink = "Click here if nothing happens";
|
19
|
+
var errorMessage = "There may be a problem with your network connection. Make sure that you are online and";
|
20
|
+
var applyChangedUser = "Apply changed user";
|
21
|
+
var profile = "Profile";
|
22
|
+
var switchUser = "Switch user";
|
23
|
+
var addFirstDate = "Add first date";
|
24
|
+
var addSecondDate = "Add second date";
|
25
|
+
var addTime = "Add time";
|
26
|
+
var selectName = "Select {{name}}";
|
27
|
+
var setDate = "Set a date";
|
28
|
+
var setDateTime = "Set date and time";
|
29
|
+
var setPeriod = "Set a period";
|
30
|
+
var clear = "Clear input";
|
31
|
+
var gotIt = "Got it";
|
32
|
+
var dismiss = "Dismiss";
|
33
|
+
var perPage = "per page";
|
34
|
+
var firstPage = "First page";
|
35
|
+
var lastPage = "Last page";
|
36
|
+
var nextPage = "Next page";
|
37
|
+
var previousPage = "Previous";
|
38
|
+
var searchTitle = "Search";
|
39
|
+
var clearTitle = "Clear search input";
|
40
|
+
var userAgreement = "User Agreement";
|
41
|
+
var accept = "Accept";
|
42
|
+
var decline = "Decline";
|
43
|
+
var close = "Close";
|
44
|
+
var scrollToAccept = "View the entire agreement to continue";
|
45
|
+
var remindLater = "Remind me later";
|
46
|
+
var filterItems = "Filter items";
|
47
|
+
var selectOption = "Select an option";
|
48
|
+
var progress = "Progress";
|
49
|
+
var loading = "Loading...";
|
50
|
+
var noOptionsFound = "No options found";
|
51
|
+
var banned = "banned";
|
52
|
+
var online = "online";
|
53
|
+
var offline = "offline";
|
54
|
+
var copyToClipboard = "Copy email to clipboard";
|
55
|
+
var copiedToClipboard = "Email was copied to clipboard";
|
56
|
+
var copingToClipboardError = "Failed to copy to clipboard";
|
57
|
+
var unverified = "Unverified";
|
58
|
+
var defaultMessages = {
|
59
|
+
login: login,
|
60
|
+
logout: logout,
|
61
|
+
loginTo: loginTo,
|
62
|
+
ok: ok,
|
63
|
+
cancel: cancel,
|
64
|
+
tryAgainLabel: tryAgainLabel,
|
65
|
+
postpone: postpone,
|
66
|
+
youHaveLoggedInAs: youHaveLoggedInAs,
|
67
|
+
applyChange: applyChange,
|
68
|
+
backendIsNotAvailable: backendIsNotAvailable,
|
69
|
+
checkAgain: checkAgain,
|
70
|
+
nothingHappensLink: nothingHappensLink,
|
71
|
+
errorMessage: errorMessage,
|
72
|
+
applyChangedUser: applyChangedUser,
|
73
|
+
profile: profile,
|
74
|
+
switchUser: switchUser,
|
75
|
+
addFirstDate: addFirstDate,
|
76
|
+
addSecondDate: addSecondDate,
|
77
|
+
addTime: addTime,
|
78
|
+
selectName: selectName,
|
79
|
+
setDate: setDate,
|
80
|
+
setDateTime: setDateTime,
|
81
|
+
setPeriod: setPeriod,
|
82
|
+
clear: clear,
|
83
|
+
gotIt: gotIt,
|
84
|
+
dismiss: dismiss,
|
85
|
+
perPage: perPage,
|
86
|
+
firstPage: firstPage,
|
87
|
+
lastPage: lastPage,
|
88
|
+
nextPage: nextPage,
|
89
|
+
previousPage: previousPage,
|
90
|
+
searchTitle: searchTitle,
|
91
|
+
clearTitle: clearTitle,
|
92
|
+
userAgreement: userAgreement,
|
93
|
+
accept: accept,
|
94
|
+
decline: decline,
|
95
|
+
close: close,
|
96
|
+
scrollToAccept: scrollToAccept,
|
97
|
+
remindLater: remindLater,
|
98
|
+
filterItems: filterItems,
|
99
|
+
selectOption: selectOption,
|
100
|
+
progress: progress,
|
101
|
+
loading: loading,
|
102
|
+
noOptionsFound: noOptionsFound,
|
103
|
+
banned: banned,
|
104
|
+
online: online,
|
105
|
+
offline: offline,
|
106
|
+
copyToClipboard: copyToClipboard,
|
107
|
+
copiedToClipboard: copiedToClipboard,
|
108
|
+
copingToClipboardError: copingToClipboardError,
|
109
|
+
unverified: unverified
|
110
|
+
};
|
111
|
+
|
112
|
+
var messages = defaultMessages;
|
113
|
+
var warned = new Set();
|
114
|
+
function warnMissedKeyOnce(key) {
|
115
|
+
if (warned.has(key)) {
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
warned.add(key);
|
119
|
+
// eslint-disable-next-line no-console
|
120
|
+
console.warn("Missing localisation for key \"".concat(key, "\""));
|
121
|
+
}
|
122
|
+
function setTranslations(newMessages) {
|
123
|
+
messages = newMessages;
|
124
|
+
}
|
125
|
+
function getTranslations() {
|
126
|
+
return messages;
|
127
|
+
}
|
128
|
+
function getTranslationsWithFallback() {
|
129
|
+
return _objectSpread2(_objectSpread2({}, defaultMessages), messages);
|
130
|
+
}
|
131
|
+
function translate(key) {
|
132
|
+
var _messages$key;
|
133
|
+
if (!(key in messages)) {
|
134
|
+
warnMissedKeyOnce(key);
|
135
|
+
}
|
136
|
+
return (_messages$key = messages[key]) !== null && _messages$key !== void 0 ? _messages$key : defaultMessages[key];
|
137
|
+
}
|
138
|
+
|
139
|
+
export { getTranslations, getTranslationsWithFallback, setTranslations, translate };
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
* @name Icon
|
3
|
+
*/
|
4
|
+
import React, { PureComponent, ComponentType, SVGAttributes, HTMLAttributes } from 'react';
|
5
|
+
import PropTypes from 'prop-types';
|
6
|
+
import { Color, Size } from './icon__constants';
|
7
|
+
export type IconType = ComponentType<SVGAttributes<SVGSVGElement>>;
|
8
|
+
export interface IconProps extends HTMLAttributes<HTMLElement> {
|
9
|
+
color: Color;
|
10
|
+
glyph: string | IconType | null;
|
11
|
+
height?: number | undefined;
|
12
|
+
size?: Size | number | null | undefined;
|
13
|
+
width?: number | undefined;
|
14
|
+
loading?: boolean | null | undefined;
|
15
|
+
suppressSizeWarning?: boolean | null | undefined;
|
16
|
+
}
|
17
|
+
export default class Icon extends PureComponent<IconProps> {
|
18
|
+
static propTypes: {
|
19
|
+
className: PropTypes.Requireable<string>;
|
20
|
+
color: PropTypes.Requireable<string>;
|
21
|
+
glyph: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactComponentLike | null | undefined>>>;
|
22
|
+
height: PropTypes.Requireable<number>;
|
23
|
+
size: PropTypes.Requireable<number>;
|
24
|
+
width: PropTypes.Requireable<number>;
|
25
|
+
loading: PropTypes.Requireable<boolean>;
|
26
|
+
suppressSizeWarning: PropTypes.Requireable<boolean>;
|
27
|
+
};
|
28
|
+
static defaultProps: {
|
29
|
+
className: string;
|
30
|
+
color: Color;
|
31
|
+
glyph: string;
|
32
|
+
};
|
33
|
+
static Color: typeof Color;
|
34
|
+
static Size: typeof Size;
|
35
|
+
warnSize(): void;
|
36
|
+
getStyle(): {
|
37
|
+
width: number | undefined;
|
38
|
+
height: number | undefined;
|
39
|
+
} | undefined;
|
40
|
+
render(): React.JSX.Element | null;
|
41
|
+
}
|
42
|
+
export type IconAttrs = JSX.LibraryManagedAttributes<typeof Icon, IconProps>;
|
43
|
+
export { Color, Size };
|