@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,271 @@
|
|
1
|
+
import { g as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.includes.js';
|
3
|
+
import 'core-js/modules/es.string.includes.js';
|
4
|
+
import 'core-js/modules/es.array.sort.js';
|
5
|
+
import 'core-js/modules/es.array.map.js';
|
6
|
+
import 'core-js/modules/es.array.filter.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/es.array.concat.js';
|
9
|
+
import { getRect, isMounted, getDocumentScrollTop, getDocumentScrollLeft, getWindowHeight } from '../global/dom.js';
|
10
|
+
import { MaxHeight, Dimension, MinWidth, Directions } from './popup.consts.js';
|
11
|
+
import 'core-js/modules/es.object.assign.js';
|
12
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
13
|
+
import 'core-js/modules/es.regexp.exec.js';
|
14
|
+
import 'core-js/modules/es.string.split.js';
|
15
|
+
import 'core-js/modules/es.object.entries.js';
|
16
|
+
import 'core-js/modules/es.array.iterator.js';
|
17
|
+
import 'core-js/modules/es.set.js';
|
18
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
19
|
+
|
20
|
+
function getScrollingCoordinates(container) {
|
21
|
+
if (container !== null) {
|
22
|
+
return {
|
23
|
+
top: container.scrollTop,
|
24
|
+
left: container.scrollLeft
|
25
|
+
};
|
26
|
+
}
|
27
|
+
return {
|
28
|
+
top: getDocumentScrollTop(),
|
29
|
+
left: getDocumentScrollLeft()
|
30
|
+
};
|
31
|
+
}
|
32
|
+
function getPositionStyles(popup, anchorRect, anchorLeft, anchorTop, offset) {
|
33
|
+
var popupWidth = popup.offsetWidth;
|
34
|
+
var popupHeight = popup.offsetHeight;
|
35
|
+
var anchorBottom = anchorTop + anchorRect.height;
|
36
|
+
var anchorRight = anchorLeft + anchorRect.width;
|
37
|
+
var popupLeft = anchorLeft - popupWidth;
|
38
|
+
var popupTop = anchorTop - popupHeight;
|
39
|
+
var popupRightToLeft = anchorRight - popupWidth;
|
40
|
+
var popupHorizontalCenter = anchorLeft + anchorRect.width / 2 - popupWidth / 2;
|
41
|
+
var popupVerticalCenter = anchorTop + anchorRect.height / 2 - popupHeight / 2;
|
42
|
+
var popupBottomToTop = anchorBottom - popupHeight;
|
43
|
+
return {
|
44
|
+
[Directions.BOTTOM_RIGHT]: {
|
45
|
+
left: anchorLeft,
|
46
|
+
top: anchorBottom + offset
|
47
|
+
},
|
48
|
+
[Directions.BOTTOM_LEFT]: {
|
49
|
+
left: popupRightToLeft,
|
50
|
+
top: anchorBottom + offset
|
51
|
+
},
|
52
|
+
[Directions.BOTTOM_CENTER]: {
|
53
|
+
left: popupHorizontalCenter,
|
54
|
+
top: anchorBottom + offset
|
55
|
+
},
|
56
|
+
[Directions.TOP_RIGHT]: {
|
57
|
+
left: anchorLeft,
|
58
|
+
top: popupTop - offset
|
59
|
+
},
|
60
|
+
[Directions.TOP_LEFT]: {
|
61
|
+
left: popupRightToLeft,
|
62
|
+
top: popupTop - offset
|
63
|
+
},
|
64
|
+
[Directions.TOP_CENTER]: {
|
65
|
+
left: popupHorizontalCenter,
|
66
|
+
top: popupTop - offset
|
67
|
+
},
|
68
|
+
[Directions.LEFT_BOTTOM]: {
|
69
|
+
left: popupLeft - offset,
|
70
|
+
top: anchorTop
|
71
|
+
},
|
72
|
+
[Directions.LEFT_TOP]: {
|
73
|
+
left: popupLeft - offset,
|
74
|
+
top: popupBottomToTop
|
75
|
+
},
|
76
|
+
[Directions.LEFT_CENTER]: {
|
77
|
+
left: popupLeft - offset,
|
78
|
+
top: popupVerticalCenter
|
79
|
+
},
|
80
|
+
[Directions.RIGHT_BOTTOM]: {
|
81
|
+
left: anchorRight + offset,
|
82
|
+
top: anchorTop
|
83
|
+
},
|
84
|
+
[Directions.RIGHT_TOP]: {
|
85
|
+
left: anchorRight + offset,
|
86
|
+
top: popupBottomToTop
|
87
|
+
},
|
88
|
+
[Directions.RIGHT_CENTER]: {
|
89
|
+
left: anchorRight + offset,
|
90
|
+
top: popupVerticalCenter
|
91
|
+
}
|
92
|
+
};
|
93
|
+
}
|
94
|
+
function verticalOverflow(styles, scrollingCoordinates, attrs) {
|
95
|
+
var containerHeight = attrs.container !== null ? attrs.container.clientHeight : getWindowHeight();
|
96
|
+
var viewportMinX = scrollingCoordinates.top + attrs.sidePadding;
|
97
|
+
var viewportMaxX = scrollingCoordinates.top + containerHeight - attrs.sidePadding;
|
98
|
+
var topOverflow = Math.max(viewportMinX - styles.top, 0);
|
99
|
+
var popupHeight = attrs.popup.clientHeight;
|
100
|
+
var verticalDiff = styles.top + popupHeight - viewportMaxX;
|
101
|
+
var bottomOverflow = Math.max(verticalDiff, 0);
|
102
|
+
return topOverflow + bottomOverflow;
|
103
|
+
}
|
104
|
+
function horizontalOverflow(styles, scrollingCoordinates, attrs) {
|
105
|
+
var containerWidth = attrs.container !== null ? attrs.container.clientWidth : window.innerWidth;
|
106
|
+
var viewportMinY = scrollingCoordinates.left + attrs.sidePadding;
|
107
|
+
var viewportMaxY = scrollingCoordinates.left + containerWidth - attrs.sidePadding;
|
108
|
+
var leftOverflow = Math.max(viewportMinY - styles.left, 0);
|
109
|
+
var popupWidth = attrs.popup.clientWidth;
|
110
|
+
var horizontalDiff = styles.left + popupWidth - viewportMaxY;
|
111
|
+
var rightOverflow = Math.max(horizontalDiff, 0);
|
112
|
+
return leftOverflow + rightOverflow;
|
113
|
+
}
|
114
|
+
var positionPropKeys = ['directions', 'autoPositioning', 'autoCorrectTopOverflow', 'sidePadding', 'top', 'left', 'offset', 'maxHeight', 'minWidth'];
|
115
|
+
var defaultcontainerRect = {
|
116
|
+
top: 0,
|
117
|
+
left: 0
|
118
|
+
};
|
119
|
+
function handleTopOffScreen(_ref) {
|
120
|
+
var sidePadding = _ref.sidePadding,
|
121
|
+
styles = _ref.styles,
|
122
|
+
anchorRect = _ref.anchorRect,
|
123
|
+
maxHeight = _ref.maxHeight,
|
124
|
+
popupScrollHeight = _ref.popupScrollHeight,
|
125
|
+
direction = _ref.direction,
|
126
|
+
scroll = _ref.scroll;
|
127
|
+
var BORDER_COMPENSATION = 1;
|
128
|
+
var TOP_LEFT = Directions.TOP_LEFT,
|
129
|
+
TOP_RIGHT = Directions.TOP_RIGHT,
|
130
|
+
TOP_CENTER = Directions.TOP_CENTER,
|
131
|
+
RIGHT_TOP = Directions.RIGHT_TOP,
|
132
|
+
LEFT_TOP = Directions.LEFT_TOP;
|
133
|
+
var openedToTop = direction != null && [TOP_LEFT, TOP_RIGHT, TOP_CENTER, RIGHT_TOP, LEFT_TOP].includes(direction);
|
134
|
+
if (!openedToTop) {
|
135
|
+
return styles;
|
136
|
+
}
|
137
|
+
var isAttachedToAnchorTop = direction != null && [TOP_LEFT, TOP_CENTER, TOP_RIGHT].includes(direction);
|
138
|
+
var attachingPointY = isAttachedToAnchorTop ? anchorRect.top : anchorRect.bottom;
|
139
|
+
var effectiveHeight = maxHeight && typeof maxHeight === 'number' ? Math.min(popupScrollHeight, maxHeight) : popupScrollHeight;
|
140
|
+
var hypotheticalTop = attachingPointY - effectiveHeight;
|
141
|
+
if (hypotheticalTop <= sidePadding) {
|
142
|
+
styles.top = sidePadding + scroll.top;
|
143
|
+
styles.maxHeight = attachingPointY - sidePadding + BORDER_COMPENSATION;
|
144
|
+
}
|
145
|
+
return styles;
|
146
|
+
}
|
147
|
+
function maxHeightForDirection(direction, anchorNode, containerNode) {
|
148
|
+
var container = containerNode || document.documentElement;
|
149
|
+
var domRect = anchorNode.getBoundingClientRect();
|
150
|
+
var containerRect = container.getBoundingClientRect();
|
151
|
+
var containerTop = domRect.top < 0 ? containerRect.top : Math.max(containerRect.top, 0);
|
152
|
+
var topMaxHeight = Math.max(domRect.top - containerTop, 0);
|
153
|
+
var containerHeight = Math.max(containerRect.height,
|
154
|
+
// XXX
|
155
|
+
// If container is the document element
|
156
|
+
// then we check client height too because we may have situation when
|
157
|
+
// "height" from "getBoundingClientRect" less then "clientHeight".
|
158
|
+
container === document.documentElement ? container.clientHeight : 0);
|
159
|
+
var bottomMaxHeight = Math.max(containerHeight - (topMaxHeight + domRect.height), 0);
|
160
|
+
switch (direction) {
|
161
|
+
case Directions.TOP_LEFT:
|
162
|
+
case Directions.TOP_CENTER:
|
163
|
+
case Directions.TOP_RIGHT:
|
164
|
+
return topMaxHeight;
|
165
|
+
case Directions.BOTTOM_LEFT:
|
166
|
+
case Directions.BOTTOM_CENTER:
|
167
|
+
case Directions.BOTTOM_RIGHT:
|
168
|
+
return bottomMaxHeight;
|
169
|
+
case Directions.LEFT_BOTTOM:
|
170
|
+
case Directions.RIGHT_BOTTOM:
|
171
|
+
return domRect.height + bottomMaxHeight;
|
172
|
+
case Directions.LEFT_TOP:
|
173
|
+
case Directions.RIGHT_TOP:
|
174
|
+
return domRect.height + topMaxHeight;
|
175
|
+
case Directions.RIGHT_CENTER:
|
176
|
+
case Directions.LEFT_CENTER:
|
177
|
+
return domRect.height / 2 + Math.min(bottomMaxHeight / 2, topMaxHeight / 2);
|
178
|
+
default:
|
179
|
+
return null;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
function position(attrs) {
|
183
|
+
var popup = attrs.popup,
|
184
|
+
anchor = attrs.anchor,
|
185
|
+
container = attrs.container,
|
186
|
+
directions = attrs.directions,
|
187
|
+
autoPositioning = attrs.autoPositioning,
|
188
|
+
sidePadding = attrs.sidePadding,
|
189
|
+
top = attrs.top,
|
190
|
+
left = attrs.left,
|
191
|
+
offset = attrs.offset,
|
192
|
+
maxHeight = attrs.maxHeight,
|
193
|
+
minWidth = attrs.minWidth,
|
194
|
+
_attrs$autoCorrectTop = attrs.autoCorrectTopOverflow,
|
195
|
+
autoCorrectTopOverflow = _attrs$autoCorrectTop === void 0 ? true : _attrs$autoCorrectTop;
|
196
|
+
var styles = {
|
197
|
+
top: 0,
|
198
|
+
left: 0
|
199
|
+
};
|
200
|
+
var chosenDirection = null;
|
201
|
+
var containerRect = container !== null ? getRect(container) : defaultcontainerRect;
|
202
|
+
var defaultAnchor = container !== null ? container : document.body;
|
203
|
+
var anchorRect = getRect(isMounted(anchor) ? anchor : defaultAnchor);
|
204
|
+
var scroll = getScrollingCoordinates(container);
|
205
|
+
var anchorLeft = anchorRect.left + scroll.left + left - containerRect.left;
|
206
|
+
var anchorTop = anchorRect.top + scroll.top + top - containerRect.top;
|
207
|
+
if (popup) {
|
208
|
+
var overflowAttrs = _objectSpread2(_objectSpread2({}, attrs), {}, {
|
209
|
+
popup
|
210
|
+
});
|
211
|
+
var directionsMatrix = getPositionStyles(popup, anchorRect, anchorLeft, anchorTop, offset);
|
212
|
+
if (!autoPositioning || directions.length === 1) {
|
213
|
+
styles = directionsMatrix[directions[0]];
|
214
|
+
chosenDirection = directions[0];
|
215
|
+
} else {
|
216
|
+
var sortedByIncreasingOverflow = directions.
|
217
|
+
// Fall back to the first option
|
218
|
+
concat(directions[0]).filter(function (direction) {
|
219
|
+
return directionsMatrix[direction];
|
220
|
+
}).map(function (direction) {
|
221
|
+
return {
|
222
|
+
styles: directionsMatrix[direction],
|
223
|
+
direction
|
224
|
+
};
|
225
|
+
}).sort(function (_ref2, _ref3) {
|
226
|
+
var stylesA = _ref2.styles;
|
227
|
+
var stylesB = _ref3.styles;
|
228
|
+
var overflowA = verticalOverflow(stylesA, scroll, overflowAttrs) + horizontalOverflow(stylesA, scroll, overflowAttrs);
|
229
|
+
var overflowB = verticalOverflow(stylesB, scroll, overflowAttrs) + horizontalOverflow(stylesB, scroll, overflowAttrs);
|
230
|
+
return overflowA - overflowB;
|
231
|
+
});
|
232
|
+
styles = sortedByIncreasingOverflow[0].styles;
|
233
|
+
chosenDirection = sortedByIncreasingOverflow[0].direction;
|
234
|
+
}
|
235
|
+
// because of the anchor negative margin top and left also may become negative
|
236
|
+
['left', 'top'].forEach(function (key) {
|
237
|
+
if (styles[key] < 0) {
|
238
|
+
styles[key] = 0;
|
239
|
+
}
|
240
|
+
});
|
241
|
+
}
|
242
|
+
if (maxHeight === MaxHeight.SCREEN || maxHeight === 'screen') {
|
243
|
+
// this feature works properly only when direction is BOTTOM_* or *_BOTTOM
|
244
|
+
styles.maxHeight = window.innerHeight + scroll.top - styles.top - Dimension.MARGIN;
|
245
|
+
} else if (maxHeight) {
|
246
|
+
styles.maxHeight = maxHeight;
|
247
|
+
}
|
248
|
+
if (autoCorrectTopOverflow) {
|
249
|
+
var _popup$scrollHeight;
|
250
|
+
styles = handleTopOffScreen({
|
251
|
+
sidePadding,
|
252
|
+
styles,
|
253
|
+
anchorRect,
|
254
|
+
maxHeight,
|
255
|
+
direction: chosenDirection,
|
256
|
+
popupScrollHeight: (_popup$scrollHeight = popup === null || popup === void 0 ? void 0 : popup.scrollHeight) !== null && _popup$scrollHeight !== void 0 ? _popup$scrollHeight : 0,
|
257
|
+
scroll
|
258
|
+
});
|
259
|
+
}
|
260
|
+
if (minWidth === MinWidth.TARGET || minWidth === 'target') {
|
261
|
+
styles.minWidth = anchorRect.width;
|
262
|
+
} else if (minWidth) {
|
263
|
+
styles.minWidth = anchorRect.width < minWidth ? minWidth : anchorRect.width;
|
264
|
+
}
|
265
|
+
return {
|
266
|
+
styles,
|
267
|
+
direction: chosenDirection
|
268
|
+
};
|
269
|
+
}
|
270
|
+
|
271
|
+
export { Dimension, Directions, MaxHeight, MinWidth, position as default, maxHeightForDirection, positionPropKeys };
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import React, { SyntheticEvent } from 'react';
|
2
|
+
import Popup, { BasePopupProps } from '../popup/popup';
|
3
|
+
import List, { ListProps as ListPropsType } from '../list/list';
|
4
|
+
import { ListDataItem } from '../list/consts';
|
5
|
+
export interface PopupMenuProps<T = unknown> extends Omit<ListPropsType<T>, 'maxHeight' | 'hidden'>, Omit<BasePopupProps, 'onMouseOut'> {
|
6
|
+
closeOnSelect: boolean;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* @name Popup Menu
|
10
|
+
*/
|
11
|
+
export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
|
12
|
+
static isItemType: <T_1>(listItemType: import("../list/consts").Type, item: ListDataItem<T_1>) => boolean;
|
13
|
+
static ListProps: {
|
14
|
+
Type: typeof import("../list/consts").Type;
|
15
|
+
Dimension: {
|
16
|
+
ITEM_PADDING: number;
|
17
|
+
ITEM_HEIGHT: number;
|
18
|
+
COMPACT_ITEM_HEIGHT: number;
|
19
|
+
SEPARATOR_HEIGHT: number;
|
20
|
+
SEPARATOR_FIRST_HEIGHT: number;
|
21
|
+
SEPARATOR_TEXT_HEIGHT: number;
|
22
|
+
TITLE_HEIGHT: number;
|
23
|
+
INNER_PADDING: number;
|
24
|
+
MARGIN: number;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
static defaultProps: {
|
28
|
+
renderOptimization: boolean;
|
29
|
+
closeOnSelect: boolean;
|
30
|
+
shortcuts: boolean;
|
31
|
+
hidden: boolean;
|
32
|
+
onOutsideClick(): void;
|
33
|
+
onEscPress(): void;
|
34
|
+
onCloseAttempt(): void;
|
35
|
+
dontCloseOnAnchorClick: boolean;
|
36
|
+
keepMounted: boolean;
|
37
|
+
directions: import("../popup/popup.consts").Directions[];
|
38
|
+
autoPositioning: boolean;
|
39
|
+
autoPositioningOnScroll: boolean;
|
40
|
+
autoCorrectTopOverflow: boolean;
|
41
|
+
left: number;
|
42
|
+
top: number;
|
43
|
+
offset: number;
|
44
|
+
sidePadding: number;
|
45
|
+
attached: boolean;
|
46
|
+
trapFocus: boolean;
|
47
|
+
autoFocusFirst: boolean;
|
48
|
+
legacy: boolean;
|
49
|
+
data: never[];
|
50
|
+
restoreActiveIndex: boolean;
|
51
|
+
activateSingleItem: boolean;
|
52
|
+
activateFirstItem: boolean;
|
53
|
+
onMouseOut: () => void;
|
54
|
+
onSelect: () => void;
|
55
|
+
onScrollToBottom: () => void;
|
56
|
+
onResize: () => void;
|
57
|
+
disableMoveDownOverflow: boolean;
|
58
|
+
ariaLabel: string;
|
59
|
+
};
|
60
|
+
onSelect: (item: ListDataItem<T>, event: Event | SyntheticEvent) => void;
|
61
|
+
list?: List<T> | null;
|
62
|
+
listRef: (el: List<T> | null) => void;
|
63
|
+
/** @override */
|
64
|
+
getInternalContent(): React.JSX.Element;
|
65
|
+
}
|
66
|
+
export type PopupMenuAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof PopupMenu, PopupMenuProps<T>>;
|
67
|
+
export declare const ListProps: {
|
68
|
+
Type: typeof import("../list/consts").Type;
|
69
|
+
Dimension: {
|
70
|
+
ITEM_PADDING: number;
|
71
|
+
ITEM_HEIGHT: number;
|
72
|
+
COMPACT_ITEM_HEIGHT: number;
|
73
|
+
SEPARATOR_HEIGHT: number;
|
74
|
+
SEPARATOR_FIRST_HEIGHT: number;
|
75
|
+
SEPARATOR_TEXT_HEIGHT: number;
|
76
|
+
TITLE_HEIGHT: number;
|
77
|
+
INNER_PADDING: number;
|
78
|
+
MARGIN: number;
|
79
|
+
};
|
80
|
+
};
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import { e as _objectWithoutProperties, _ as _defineProperty, g as _objectSpread2, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, d as _createClass, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import React from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import Popup from '../popup/popup.js';
|
6
|
+
import List from '../list/list.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
9
|
+
import 'core-js/modules/es.object.entries.js';
|
10
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
11
|
+
import 'core-js/modules/es.regexp.exec.js';
|
12
|
+
import 'core-js/modules/es.string.replace.js';
|
13
|
+
import 'react-dom';
|
14
|
+
import 'classnames';
|
15
|
+
import '../global/get-uid.js';
|
16
|
+
import '../global/schedule-raf.js';
|
17
|
+
import '../global/dom.js';
|
18
|
+
import 'core-js/modules/es.object.assign.js';
|
19
|
+
import 'core-js/modules/es.array.filter.js';
|
20
|
+
import 'core-js/modules/es.string.split.js';
|
21
|
+
import 'core-js/modules/es.array.iterator.js';
|
22
|
+
import 'core-js/modules/es.set.js';
|
23
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
24
|
+
import '../shortcuts/shortcuts.js';
|
25
|
+
import 'core-js/modules/es.array.map.js';
|
26
|
+
import '../shortcuts/core.js';
|
27
|
+
import 'core-js/modules/es.array.includes.js';
|
28
|
+
import 'core-js/modules/es.string.includes.js';
|
29
|
+
import 'core-js/modules/es.array.slice.js';
|
30
|
+
import 'core-js/modules/es.array.splice.js';
|
31
|
+
import 'core-js/modules/es.string.match.js';
|
32
|
+
import 'core-js/modules/es.array.find-index.js';
|
33
|
+
import 'combokeys';
|
34
|
+
import '../global/sniffer.js';
|
35
|
+
import 'sniffr';
|
36
|
+
import '../global/data-tests.js';
|
37
|
+
import 'core-js/modules/es.array.reduce.js';
|
38
|
+
import '../tab-trap/tab-trap.js';
|
39
|
+
import '../popup/position.js';
|
40
|
+
import 'core-js/modules/es.array.sort.js';
|
41
|
+
import '../popup/popup.consts.js';
|
42
|
+
import '../popup/popup.target.js';
|
43
|
+
import 'core-js/modules/es.symbol.js';
|
44
|
+
import 'core-js/modules/es.symbol.description.js';
|
45
|
+
import 'core-js/modules/es.array.find.js';
|
46
|
+
import 'react-virtualized/dist/es/List';
|
47
|
+
import 'react-virtualized/dist/es/AutoSizer';
|
48
|
+
import 'react-virtualized/dist/es/WindowScroller';
|
49
|
+
import 'react-virtualized/dist/es/CellMeasurer';
|
50
|
+
import 'util-deprecate';
|
51
|
+
import 'memoize-one';
|
52
|
+
import '../global/memoize.js';
|
53
|
+
import 'core-js/modules/es.map.js';
|
54
|
+
import 'core-js/modules/es.weak-map.js';
|
55
|
+
import '../global/create-stateful-context.js';
|
56
|
+
import '../list/list__link.js';
|
57
|
+
import '../link/link.js';
|
58
|
+
import '../link/clickableLink.js';
|
59
|
+
import '../_helpers/link.js';
|
60
|
+
import '../_helpers/list.js';
|
61
|
+
import '../list/list__item.js';
|
62
|
+
import 'core-js/modules/es.array.index-of.js';
|
63
|
+
import '../avatar/avatar.js';
|
64
|
+
import '../global/url.js';
|
65
|
+
import '../avatar/fallback-avatar.js';
|
66
|
+
import 'core-js/modules/es.array.from.js';
|
67
|
+
import '../checkbox/checkbox.js';
|
68
|
+
import '@jetbrains/icons/checkmark-14px';
|
69
|
+
import '@jetbrains/icons/remove-14px';
|
70
|
+
import '../icon/icon.js';
|
71
|
+
import '../icon/icon__constants.js';
|
72
|
+
import '../_helpers/icon__svg.js';
|
73
|
+
import 'core-js/modules/es.string.starts-with.js';
|
74
|
+
import '../global/prop-types.js';
|
75
|
+
import '../global/composeRefs.js';
|
76
|
+
import '../list/list__custom.js';
|
77
|
+
import '../global/get-event-key.js';
|
78
|
+
import '../list/list__title.js';
|
79
|
+
import '../list/list__separator.js';
|
80
|
+
import '../list/list__hint.js';
|
81
|
+
import '../list/consts.js';
|
82
|
+
|
83
|
+
var _excluded = ["className"];
|
84
|
+
var _ref = Popup.propTypes || {};
|
85
|
+
_ref.children;
|
86
|
+
var popupPropTypes = _objectWithoutProperties(_ref, ["children"]);
|
87
|
+
/**
|
88
|
+
* @name Popup Menu
|
89
|
+
*/
|
90
|
+
var PopupMenu = /*#__PURE__*/function (_Popup) {
|
91
|
+
_inherits(PopupMenu, _Popup);
|
92
|
+
var _super = _createSuper(PopupMenu);
|
93
|
+
function PopupMenu() {
|
94
|
+
var _this;
|
95
|
+
_classCallCheck(this, PopupMenu);
|
96
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
97
|
+
args[_key] = arguments[_key];
|
98
|
+
}
|
99
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
100
|
+
_defineProperty(_assertThisInitialized(_this), "onSelect", function (item, event) {
|
101
|
+
if (_this.props.closeOnSelect) {
|
102
|
+
_this._onCloseAttempt(event);
|
103
|
+
}
|
104
|
+
_this.props.onSelect(item, event);
|
105
|
+
});
|
106
|
+
_defineProperty(_assertThisInitialized(_this), "list", void 0);
|
107
|
+
_defineProperty(_assertThisInitialized(_this), "listRef", function (el) {
|
108
|
+
_this.list = el;
|
109
|
+
});
|
110
|
+
return _this;
|
111
|
+
}
|
112
|
+
_createClass(PopupMenu, [{
|
113
|
+
key: "getInternalContent",
|
114
|
+
value: /** @override */
|
115
|
+
function getInternalContent() {
|
116
|
+
var _this$props = this.props;
|
117
|
+
_this$props.className;
|
118
|
+
var props = _objectWithoutProperties(_this$props, _excluded);
|
119
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(List, _extends({
|
120
|
+
ref: this.listRef
|
121
|
+
}, props, {
|
122
|
+
maxHeight: this.popup && parseFloat(this.popup.style.maxHeight),
|
123
|
+
shortcuts: this.shouldUseShortcuts(),
|
124
|
+
onSelect: this.onSelect
|
125
|
+
})));
|
126
|
+
}
|
127
|
+
}]);
|
128
|
+
return PopupMenu;
|
129
|
+
}(Popup);
|
130
|
+
_defineProperty(PopupMenu, "isItemType", List.isItemType);
|
131
|
+
_defineProperty(PopupMenu, "ListProps", List.ListProps);
|
132
|
+
_defineProperty(PopupMenu, "defaultProps", _objectSpread2(_objectSpread2(_objectSpread2({}, List.defaultProps), Popup.defaultProps), {}, {
|
133
|
+
renderOptimization: false,
|
134
|
+
closeOnSelect: false
|
135
|
+
}));
|
136
|
+
PopupMenu.propTypes = _objectSpread2(_objectSpread2(_objectSpread2({}, popupPropTypes), List.propTypes), {}, {
|
137
|
+
closeOnSelect: PropTypes.bool
|
138
|
+
});
|
139
|
+
var ListProps = List.ListProps;
|
140
|
+
|
141
|
+
export { ListProps, PopupMenu as default };
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import React, { HTMLAttributes, PureComponent } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
export interface ProgressBarProps extends HTMLAttributes<HTMLElement> {
|
4
|
+
max: number;
|
5
|
+
value: number;
|
6
|
+
label: string;
|
7
|
+
global?: boolean | null | undefined;
|
8
|
+
staticColor?: boolean;
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* @name Progress Bar
|
12
|
+
*/
|
13
|
+
export default class ProgressBar extends PureComponent<ProgressBarProps> {
|
14
|
+
/**
|
15
|
+
* @param {number} value The progress task value
|
16
|
+
* @param {number} max The maximum value
|
17
|
+
* @return {number} The progress task value in percents
|
18
|
+
* @private
|
19
|
+
*/
|
20
|
+
static toPercent(value: number, max: number): number;
|
21
|
+
static propTypes: {
|
22
|
+
label: PropTypes.Requireable<string>;
|
23
|
+
/**
|
24
|
+
* Sets the ring-progress-bar_global class to position the progress bar on top of the screen.
|
25
|
+
* Should be placed directly inside body, will be positioned right below .ring-header
|
26
|
+
* if placed adjacent to it.
|
27
|
+
* @type {boolean}
|
28
|
+
*/
|
29
|
+
global: PropTypes.Requireable<boolean>;
|
30
|
+
/**
|
31
|
+
* Custom class
|
32
|
+
* @type {string}
|
33
|
+
*/
|
34
|
+
className: PropTypes.Requireable<string>;
|
35
|
+
style: PropTypes.Requireable<object>;
|
36
|
+
/**
|
37
|
+
* A floating point number that specifies minimum completion rate for a task to be considered
|
38
|
+
* complete. Default value is 1.0.
|
39
|
+
* @type {number}
|
40
|
+
*/
|
41
|
+
max: PropTypes.Requireable<number>;
|
42
|
+
/**
|
43
|
+
* A floating point number that specifies current task completion rate.
|
44
|
+
* @type {number}
|
45
|
+
*/
|
46
|
+
value: PropTypes.Requireable<number>;
|
47
|
+
/**
|
48
|
+
* Disables Disabled progress bar color animation and sets it to static color.
|
49
|
+
* @type {boolean}
|
50
|
+
*/
|
51
|
+
staticColor: PropTypes.Requireable<boolean>;
|
52
|
+
};
|
53
|
+
static defaultProps: {
|
54
|
+
max: number;
|
55
|
+
value: number;
|
56
|
+
label: string;
|
57
|
+
};
|
58
|
+
progressbarWrapper?: (HTMLElement | null);
|
59
|
+
progressbarWrapperRef: (el: HTMLElement | null) => void;
|
60
|
+
progressbar?: (HTMLElement | null);
|
61
|
+
progressbarRef: (el: HTMLElement | null) => void;
|
62
|
+
render(): React.JSX.Element;
|
63
|
+
}
|
64
|
+
export type ProgressBarAttrs = JSX.LibraryManagedAttributes<typeof ProgressBar, ProgressBarProps>;
|
@@ -0,0 +1,120 @@
|
|
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
|
+
|
7
|
+
var modules_fb7af416 = {"dark":"dark_rui_eb55","light":"light_rui_2ac4","progressBar":"progressBar_rui_5875","globalMode":"globalMode_rui_5875","line":"line_rui_5875","progress-bar":"progress-bar_rui_5875","staticLineColor":"staticLineColor_rui_5875"};
|
8
|
+
|
9
|
+
var _excluded = ["className", "global", "max", "value", "label", "staticColor"];
|
10
|
+
/**
|
11
|
+
* @name Progress Bar
|
12
|
+
*/
|
13
|
+
var ProgressBar = /*#__PURE__*/function (_PureComponent) {
|
14
|
+
_inherits(ProgressBar, _PureComponent);
|
15
|
+
var _super = _createSuper(ProgressBar);
|
16
|
+
function ProgressBar() {
|
17
|
+
var _this;
|
18
|
+
_classCallCheck(this, ProgressBar);
|
19
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
20
|
+
args[_key] = arguments[_key];
|
21
|
+
}
|
22
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
23
|
+
_defineProperty(_assertThisInitialized(_this), "progressbarWrapper", void 0);
|
24
|
+
_defineProperty(_assertThisInitialized(_this), "progressbarWrapperRef", function (el) {
|
25
|
+
_this.progressbarWrapper = el;
|
26
|
+
});
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "progressbar", void 0);
|
28
|
+
_defineProperty(_assertThisInitialized(_this), "progressbarRef", function (el) {
|
29
|
+
_this.progressbar = el;
|
30
|
+
});
|
31
|
+
return _this;
|
32
|
+
}
|
33
|
+
_createClass(ProgressBar, [{
|
34
|
+
key: "render",
|
35
|
+
value: function render() {
|
36
|
+
var _this$props = this.props,
|
37
|
+
className = _this$props.className,
|
38
|
+
global = _this$props.global,
|
39
|
+
max = _this$props.max,
|
40
|
+
value = _this$props.value,
|
41
|
+
label = _this$props.label,
|
42
|
+
staticColor = _this$props.staticColor,
|
43
|
+
otherProps = _objectWithoutProperties(_this$props, _excluded);
|
44
|
+
var width = value ? "".concat(ProgressBar.toPercent(value, max), "%") : undefined;
|
45
|
+
var classes = classNames(modules_fb7af416.progressBar, className, {
|
46
|
+
[modules_fb7af416.globalMode]: global,
|
47
|
+
[modules_fb7af416.staticLineColor]: staticColor
|
48
|
+
});
|
49
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, otherProps, {
|
50
|
+
className: classes,
|
51
|
+
ref: this.progressbarWrapperRef
|
52
|
+
}), /*#__PURE__*/React.createElement("div", {
|
53
|
+
className: modules_fb7af416.line,
|
54
|
+
ref: this.progressbarRef,
|
55
|
+
role: "progressbar",
|
56
|
+
"aria-label": label,
|
57
|
+
"aria-valuenow": value,
|
58
|
+
"aria-valuemin": 0,
|
59
|
+
"aria-valuemax": max,
|
60
|
+
style: {
|
61
|
+
width
|
62
|
+
}
|
63
|
+
}));
|
64
|
+
}
|
65
|
+
}], [{
|
66
|
+
key: "toPercent",
|
67
|
+
value:
|
68
|
+
/**
|
69
|
+
* @param {number} value The progress task value
|
70
|
+
* @param {number} max The maximum value
|
71
|
+
* @return {number} The progress task value in percents
|
72
|
+
* @private
|
73
|
+
*/
|
74
|
+
function toPercent(value, max) {
|
75
|
+
var HUNDRED_PERCENT = 100;
|
76
|
+
var percents = value * HUNDRED_PERCENT / max;
|
77
|
+
return percents > HUNDRED_PERCENT ? HUNDRED_PERCENT : percents;
|
78
|
+
}
|
79
|
+
}]);
|
80
|
+
return ProgressBar;
|
81
|
+
}(PureComponent);
|
82
|
+
_defineProperty(ProgressBar, "propTypes", {
|
83
|
+
label: PropTypes.string,
|
84
|
+
/**
|
85
|
+
* Sets the ring-progress-bar_global class to position the progress bar on top of the screen.
|
86
|
+
* Should be placed directly inside body, will be positioned right below .ring-header
|
87
|
+
* if placed adjacent to it.
|
88
|
+
* @type {boolean}
|
89
|
+
*/
|
90
|
+
global: PropTypes.bool,
|
91
|
+
/**
|
92
|
+
* Custom class
|
93
|
+
* @type {string}
|
94
|
+
*/
|
95
|
+
className: PropTypes.string,
|
96
|
+
style: PropTypes.object,
|
97
|
+
/**
|
98
|
+
* A floating point number that specifies minimum completion rate for a task to be considered
|
99
|
+
* complete. Default value is 1.0.
|
100
|
+
* @type {number}
|
101
|
+
*/
|
102
|
+
max: PropTypes.number,
|
103
|
+
/**
|
104
|
+
* A floating point number that specifies current task completion rate.
|
105
|
+
* @type {number}
|
106
|
+
*/
|
107
|
+
value: PropTypes.number,
|
108
|
+
/**
|
109
|
+
* Disables Disabled progress bar color animation and sets it to static color.
|
110
|
+
* @type {boolean}
|
111
|
+
*/
|
112
|
+
staticColor: PropTypes.bool
|
113
|
+
});
|
114
|
+
_defineProperty(ProgressBar, "defaultProps", {
|
115
|
+
max: 1.0,
|
116
|
+
value: 0,
|
117
|
+
label: 'Progress'
|
118
|
+
});
|
119
|
+
|
120
|
+
export { ProgressBar as default };
|