@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,235 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, d as _createClass } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'core-js/modules/es.array.map.js';
|
4
|
+
import React, { PureComponent } from 'react';
|
5
|
+
import PropTypes from 'prop-types';
|
6
|
+
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
7
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
8
|
+
import Link from '../link/link.js';
|
9
|
+
import Text from '../text/text.js';
|
10
|
+
import LoaderInline from '../loader-inline/loader-inline.js';
|
11
|
+
import { Button } from '../button/button.js';
|
12
|
+
import Selection from '../table/selection.js';
|
13
|
+
import { m as modules_09d014b4, T as Title } from '../_helpers/title.js';
|
14
|
+
import 'classnames';
|
15
|
+
import '../global/data-tests.js';
|
16
|
+
import 'core-js/modules/es.array.reduce.js';
|
17
|
+
import 'core-js/modules/es.object.to-string.js';
|
18
|
+
import 'core-js/modules/es.object.entries.js';
|
19
|
+
import '../link/clickableLink.js';
|
20
|
+
import '../_helpers/link.js';
|
21
|
+
import '@jetbrains/icons/chevron-10px';
|
22
|
+
import '../icon/icon.js';
|
23
|
+
import 'util-deprecate';
|
24
|
+
import '../icon/icon__constants.js';
|
25
|
+
import '../_helpers/icon__svg.js';
|
26
|
+
import 'core-js/modules/es.regexp.exec.js';
|
27
|
+
import 'core-js/modules/es.string.replace.js';
|
28
|
+
import 'core-js/modules/es.string.starts-with.js';
|
29
|
+
import '../global/memoize.js';
|
30
|
+
import 'core-js/modules/es.array.iterator.js';
|
31
|
+
import 'core-js/modules/es.map.js';
|
32
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
33
|
+
import 'core-js/modules/es.weak-map.js';
|
34
|
+
import '../global/controls-height.js';
|
35
|
+
import '../_helpers/button__classes.js';
|
36
|
+
import 'core-js/modules/es.set.js';
|
37
|
+
import 'core-js/modules/es.array.filter.js';
|
38
|
+
import 'core-js/modules/es.array.index-of.js';
|
39
|
+
import '../global/focus-sensor-hoc.js';
|
40
|
+
import '../global/prop-types.js';
|
41
|
+
import '../global/composeRefs.js';
|
42
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
43
|
+
import '../checkbox/checkbox.js';
|
44
|
+
import '@jetbrains/icons/checkmark-14px';
|
45
|
+
import '@jetbrains/icons/remove-14px';
|
46
|
+
import '../global/get-uid.js';
|
47
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
48
|
+
|
49
|
+
var moreLessButtonStates;
|
50
|
+
(function (moreLessButtonStates) {
|
51
|
+
moreLessButtonStates[moreLessButtonStates["UNUSED"] = 0] = "UNUSED";
|
52
|
+
moreLessButtonStates[moreLessButtonStates["MORE"] = 1] = "MORE";
|
53
|
+
moreLessButtonStates[moreLessButtonStates["MORE_LOADING"] = 2] = "MORE_LOADING";
|
54
|
+
moreLessButtonStates[moreLessButtonStates["LESS"] = 3] = "LESS";
|
55
|
+
})(moreLessButtonStates || (moreLessButtonStates = {}));
|
56
|
+
var ITEM_LEFT_OFFSET = 32;
|
57
|
+
var LIST_LEFT_OFFSET = 24;
|
58
|
+
var Item = /*#__PURE__*/function (_PureComponent) {
|
59
|
+
_inherits(Item, _PureComponent);
|
60
|
+
var _super = _createSuper(Item);
|
61
|
+
function Item() {
|
62
|
+
var _this;
|
63
|
+
_classCallCheck(this, Item);
|
64
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
65
|
+
args[_key] = arguments[_key];
|
66
|
+
}
|
67
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "onShowMore", function () {
|
69
|
+
var _this$props = _this.props,
|
70
|
+
onItemMoreLess = _this$props.onItemMoreLess,
|
71
|
+
item = _this$props.item;
|
72
|
+
onItemMoreLess(item, true);
|
73
|
+
});
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "onShowLess", function () {
|
75
|
+
var _this$props2 = _this.props,
|
76
|
+
onItemMoreLess = _this$props2.onItemMoreLess,
|
77
|
+
item = _this$props2.item;
|
78
|
+
onItemMoreLess(item, false);
|
79
|
+
});
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
|
81
|
+
var _this$props3 = _this.props,
|
82
|
+
onFocus = _this$props3.onFocus,
|
83
|
+
item = _this$props3.item;
|
84
|
+
onFocus(item);
|
85
|
+
});
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "onSelect", function (selected) {
|
87
|
+
var _this$props4 = _this.props,
|
88
|
+
onSelect = _this$props4.onSelect,
|
89
|
+
item = _this$props4.item;
|
90
|
+
onSelect(item, selected);
|
91
|
+
});
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "renderItem", function (model, parentShift) {
|
93
|
+
var _this$props5 = _this.props,
|
94
|
+
onFocus = _this$props5.onFocus,
|
95
|
+
onSelect = _this$props5.onSelect,
|
96
|
+
selection = _this$props5.selection,
|
97
|
+
level = _this$props5.level,
|
98
|
+
itemFormatter = _this$props5.itemFormatter;
|
99
|
+
var item = itemFormatter(model);
|
100
|
+
return /*#__PURE__*/React.createElement(Item, {
|
101
|
+
key: item.key || item.id,
|
102
|
+
item: model,
|
103
|
+
title: item.title,
|
104
|
+
items: item.items,
|
105
|
+
level: level + 1,
|
106
|
+
parentShift: parentShift,
|
107
|
+
itemFormatter: itemFormatter,
|
108
|
+
collapsible: item.collapsible,
|
109
|
+
collapsed: item.collapsed,
|
110
|
+
onCollapse: item.onCollapse,
|
111
|
+
onExpand: item.onExpand,
|
112
|
+
showFocus: selection.isFocused(model),
|
113
|
+
onFocus: onFocus,
|
114
|
+
selection: selection,
|
115
|
+
selectable: item.selectable,
|
116
|
+
selected: selection.isSelected(model),
|
117
|
+
onSelect: onSelect
|
118
|
+
});
|
119
|
+
});
|
120
|
+
return _this;
|
121
|
+
}
|
122
|
+
_createClass(Item, [{
|
123
|
+
key: "render",
|
124
|
+
value: function render() {
|
125
|
+
var _this2 = this;
|
126
|
+
var _this$props6 = this.props,
|
127
|
+
title = _this$props6.title,
|
128
|
+
items = _this$props6.items,
|
129
|
+
showMoreLessButton = _this$props6.showMoreLessButton,
|
130
|
+
level = _this$props6.level,
|
131
|
+
parentShift = _this$props6.parentShift,
|
132
|
+
showFocus = _this$props6.showFocus,
|
133
|
+
selectable = _this$props6.selectable,
|
134
|
+
selected = _this$props6.selected,
|
135
|
+
collapsible = _this$props6.collapsible,
|
136
|
+
collapsed = _this$props6.collapsed,
|
137
|
+
onCollapse = _this$props6.onCollapse,
|
138
|
+
onExpand = _this$props6.onExpand;
|
139
|
+
var moreLessButton;
|
140
|
+
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
141
|
+
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
142
|
+
info: true
|
143
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
144
|
+
inherit: true,
|
145
|
+
pseudo: true,
|
146
|
+
onClick: this.onShowMore
|
147
|
+
}, 'Show more'), showMoreLessButton === moreLessButtonStates.MORE_LOADING && /*#__PURE__*/React.createElement(LoaderInline, {
|
148
|
+
className: modules_09d014b4.showMoreLoader
|
149
|
+
}));
|
150
|
+
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
151
|
+
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
152
|
+
info: true
|
153
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
154
|
+
inherit: true,
|
155
|
+
pseudo: true,
|
156
|
+
onClick: this.onShowLess
|
157
|
+
}, 'Show less'));
|
158
|
+
}
|
159
|
+
var collapserExpander = null;
|
160
|
+
if (collapsible) {
|
161
|
+
if (collapsed) {
|
162
|
+
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
163
|
+
title: "Expand",
|
164
|
+
onClick: onExpand,
|
165
|
+
icon: chevronRightIcon,
|
166
|
+
className: modules_09d014b4.collapseButton,
|
167
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
168
|
+
"data-test": "ring-data-list-expand"
|
169
|
+
});
|
170
|
+
} else {
|
171
|
+
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
172
|
+
title: "Collapse",
|
173
|
+
onClick: onCollapse,
|
174
|
+
icon: chevronDownIcon,
|
175
|
+
className: modules_09d014b4.collapseButton,
|
176
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
177
|
+
"data-test": "ring-data-list-collapse"
|
178
|
+
});
|
179
|
+
}
|
180
|
+
}
|
181
|
+
var itemIsEmpty = !(items !== null && items !== void 0 && items.length) || collapsible && collapsed;
|
182
|
+
var offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
183
|
+
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Title, {
|
184
|
+
title: title,
|
185
|
+
focused: showFocus,
|
186
|
+
showFocus: showFocus,
|
187
|
+
selectable: selectable,
|
188
|
+
selected: selected,
|
189
|
+
collapserExpander: collapserExpander,
|
190
|
+
onFocus: this.onFocus,
|
191
|
+
onSelect: this.onSelect,
|
192
|
+
offset: offset
|
193
|
+
}), !itemIsEmpty ? /*#__PURE__*/React.createElement("ul", {
|
194
|
+
className: modules_09d014b4.itemContent
|
195
|
+
}, items.map(function (model) {
|
196
|
+
return _this2.renderItem(model, parentShift);
|
197
|
+
}), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/React.createElement("li", {
|
198
|
+
className: modules_09d014b4.showMore
|
199
|
+
}, moreLessButton) : null) : null);
|
200
|
+
}
|
201
|
+
}]);
|
202
|
+
return Item;
|
203
|
+
}(PureComponent);
|
204
|
+
_defineProperty(Item, "defaultProps", {
|
205
|
+
items: [],
|
206
|
+
level: 0,
|
207
|
+
parentShift: 0,
|
208
|
+
showMoreLessButton: moreLessButtonStates.UNUSED,
|
209
|
+
onItemMoreLess: function onItemMoreLess() {}
|
210
|
+
});
|
211
|
+
Item.propTypes = {
|
212
|
+
item: PropTypes.shape({
|
213
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
214
|
+
}).isRequired,
|
215
|
+
title: PropTypes.node,
|
216
|
+
items: PropTypes.array,
|
217
|
+
className: PropTypes.string,
|
218
|
+
level: PropTypes.number,
|
219
|
+
parentShift: PropTypes.number,
|
220
|
+
itemFormatter: PropTypes.func.isRequired,
|
221
|
+
collapsible: PropTypes.bool,
|
222
|
+
collapsed: PropTypes.bool,
|
223
|
+
onCollapse: PropTypes.func,
|
224
|
+
onExpand: PropTypes.func,
|
225
|
+
showFocus: PropTypes.bool,
|
226
|
+
onFocus: PropTypes.func.isRequired,
|
227
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
228
|
+
selectable: PropTypes.bool,
|
229
|
+
selected: PropTypes.bool,
|
230
|
+
onSelect: PropTypes.func.isRequired,
|
231
|
+
showMoreLessButton: PropTypes.number,
|
232
|
+
onItemMoreLess: PropTypes.func
|
233
|
+
};
|
234
|
+
|
235
|
+
export { Item as default, moreLessButtonStates };
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import TableSelection, { CloneWithConfig, SelectionItem } from '../table/selection';
|
2
|
+
export default class Selection<T extends SelectionItem> extends TableSelection<T> {
|
3
|
+
protected _buildData(data: T[]): Set<T>;
|
4
|
+
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
5
|
+
private _getDescendants;
|
6
|
+
private _getAncestors;
|
7
|
+
private _selectDescendants;
|
8
|
+
private _deselectDescendants;
|
9
|
+
private _selectAncestors;
|
10
|
+
private _deselectAncestors;
|
11
|
+
select(value?: T | null): Selection<T>;
|
12
|
+
focus(value: T | null | undefined): Selection<T>;
|
13
|
+
resetSelection(): Selection<T>;
|
14
|
+
cloneWith(config: CloneWithConfig<T>): Selection<T>;
|
15
|
+
deselect(value?: T | null): Selection<T>;
|
16
|
+
}
|
@@ -0,0 +1,148 @@
|
|
1
|
+
import { a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, l as _toConsumableArray, n as _get, o as _getPrototypeOf } 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
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
7
|
+
import 'core-js/modules/es.array.concat.js';
|
8
|
+
import 'core-js/modules/es.array.find.js';
|
9
|
+
import 'core-js/modules/es.array.includes.js';
|
10
|
+
import 'core-js/modules/es.string.includes.js';
|
11
|
+
import 'core-js/modules/es.array.filter.js';
|
12
|
+
import Selection$1 from '../table/selection.js';
|
13
|
+
import 'core-js/modules/es.array.index-of.js';
|
14
|
+
|
15
|
+
var Selection = /*#__PURE__*/function (_TableSelection) {
|
16
|
+
_inherits(Selection, _TableSelection);
|
17
|
+
var _super = _createSuper(Selection);
|
18
|
+
function Selection() {
|
19
|
+
_classCallCheck(this, Selection);
|
20
|
+
return _super.apply(this, arguments);
|
21
|
+
}
|
22
|
+
_createClass(Selection, [{
|
23
|
+
key: "_buildData",
|
24
|
+
value: function _buildData(data) {
|
25
|
+
return new Set(this._getDescendants(data));
|
26
|
+
}
|
27
|
+
}, {
|
28
|
+
key: "_buildSelected",
|
29
|
+
value: function _buildSelected(data, selected) {
|
30
|
+
var _this = this;
|
31
|
+
var _selected = new Set(selected);
|
32
|
+
_toConsumableArray(data).forEach(function (item) {
|
33
|
+
if (_selected.has(item)) {
|
34
|
+
_this._selectDescendants(item, _selected);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
return _selected;
|
38
|
+
}
|
39
|
+
}, {
|
40
|
+
key: "_getDescendants",
|
41
|
+
value: function _getDescendants(items) {
|
42
|
+
var _this2 = this;
|
43
|
+
var result = [];
|
44
|
+
items.forEach(function (item) {
|
45
|
+
result.push(item);
|
46
|
+
result = [].concat(_toConsumableArray(result), _toConsumableArray(_this2._getDescendants(_this2._getChildren(item))));
|
47
|
+
});
|
48
|
+
return result;
|
49
|
+
}
|
50
|
+
}, {
|
51
|
+
key: "_getAncestors",
|
52
|
+
value: function _getAncestors(item) {
|
53
|
+
var _this3 = this;
|
54
|
+
var result = [];
|
55
|
+
var parent = _toConsumableArray(this._data).find(function (it) {
|
56
|
+
return _this3._getChildren(it).includes(item);
|
57
|
+
});
|
58
|
+
if (parent) {
|
59
|
+
result = [parent].concat(_toConsumableArray(this._getAncestors(parent)));
|
60
|
+
}
|
61
|
+
return result;
|
62
|
+
}
|
63
|
+
}, {
|
64
|
+
key: "_selectDescendants",
|
65
|
+
value: function _selectDescendants(item, selected) {
|
66
|
+
this._getDescendants(this._getChildren(item)).forEach(function (it) {
|
67
|
+
return selected.add(it);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}, {
|
71
|
+
key: "_deselectDescendants",
|
72
|
+
value: function _deselectDescendants(item, selected) {
|
73
|
+
this._getDescendants(this._getChildren(item)).forEach(function (it) {
|
74
|
+
return selected.delete(it);
|
75
|
+
});
|
76
|
+
}
|
77
|
+
}, {
|
78
|
+
key: "_selectAncestors",
|
79
|
+
value: function _selectAncestors(item, selected) {
|
80
|
+
var _this4 = this;
|
81
|
+
this._getAncestors(item).forEach(function (ancestor) {
|
82
|
+
var groupIsSelected = _this4._getChildren(ancestor).filter(function (it) {
|
83
|
+
return _this4._isItemSelectable(it);
|
84
|
+
}).every(function (it) {
|
85
|
+
return selected.has(it);
|
86
|
+
});
|
87
|
+
if (groupIsSelected) {
|
88
|
+
selected.add(ancestor);
|
89
|
+
}
|
90
|
+
});
|
91
|
+
}
|
92
|
+
}, {
|
93
|
+
key: "_deselectAncestors",
|
94
|
+
value: function _deselectAncestors(item, selected) {
|
95
|
+
this._getAncestors(item).forEach(function (it) {
|
96
|
+
return selected.delete(it);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
}, {
|
100
|
+
key: "select",
|
101
|
+
value: function select() {
|
102
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
103
|
+
if (!value || !this._isItemSelectable(value)) {
|
104
|
+
return this;
|
105
|
+
}
|
106
|
+
var selected = new Set(this._selected);
|
107
|
+
selected.add(value);
|
108
|
+
this._selectDescendants(value, selected);
|
109
|
+
this._selectAncestors(value, selected);
|
110
|
+
return this.cloneWith({
|
111
|
+
selected
|
112
|
+
});
|
113
|
+
}
|
114
|
+
}, {
|
115
|
+
key: "focus",
|
116
|
+
value: function focus(value) {
|
117
|
+
return _get(_getPrototypeOf(Selection.prototype), "focus", this).call(this, value);
|
118
|
+
}
|
119
|
+
}, {
|
120
|
+
key: "resetSelection",
|
121
|
+
value: function resetSelection() {
|
122
|
+
return _get(_getPrototypeOf(Selection.prototype), "resetSelection", this).call(this);
|
123
|
+
}
|
124
|
+
}, {
|
125
|
+
key: "cloneWith",
|
126
|
+
value: function cloneWith(config) {
|
127
|
+
return _get(_getPrototypeOf(Selection.prototype), "cloneWith", this).call(this, config);
|
128
|
+
}
|
129
|
+
}, {
|
130
|
+
key: "deselect",
|
131
|
+
value: function deselect() {
|
132
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
133
|
+
if (!value || !this._isItemSelectable(value)) {
|
134
|
+
return this;
|
135
|
+
}
|
136
|
+
var selected = new Set(this._selected);
|
137
|
+
selected.delete(value);
|
138
|
+
this._deselectDescendants(value, selected);
|
139
|
+
this._deselectAncestors(value, selected);
|
140
|
+
return this.cloneWith({
|
141
|
+
selected
|
142
|
+
});
|
143
|
+
}
|
144
|
+
}]);
|
145
|
+
return Selection;
|
146
|
+
}(Selection$1);
|
147
|
+
|
148
|
+
export { Selection as default };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React, { PureComponent, ReactNode } from 'react';
|
2
|
+
import { FocusSensorAddProps } from '../global/focus-sensor-hoc';
|
3
|
+
export interface TitleProps extends FocusSensorAddProps<HTMLDivElement> {
|
4
|
+
onSelect: (selected: boolean) => void;
|
5
|
+
selectable?: boolean | undefined;
|
6
|
+
selected?: boolean | undefined;
|
7
|
+
showFocus?: boolean | undefined;
|
8
|
+
offset?: number | undefined;
|
9
|
+
className?: string | null | undefined;
|
10
|
+
title?: ReactNode;
|
11
|
+
collapserExpander?: ReactNode;
|
12
|
+
}
|
13
|
+
declare class Title extends PureComponent<TitleProps> {
|
14
|
+
static defaultProps: {
|
15
|
+
selectable: boolean;
|
16
|
+
selected: boolean;
|
17
|
+
showFocus: boolean;
|
18
|
+
};
|
19
|
+
id: string;
|
20
|
+
onCheckboxFocus: () => void;
|
21
|
+
onCheckboxChange: () => void;
|
22
|
+
toggleSelection(): void;
|
23
|
+
render(): React.JSX.Element;
|
24
|
+
}
|
25
|
+
declare const _default: React.ComponentType<import("../global/focus-sensor-hoc").FocusSensorProps<TitleProps, HTMLDivElement, typeof Title>>;
|
26
|
+
export default _default;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'react';
|
4
|
+
import 'prop-types';
|
5
|
+
import 'classnames';
|
6
|
+
import '../global/focus-sensor-hoc.js';
|
7
|
+
import '../checkbox/checkbox.js';
|
8
|
+
import '../global/get-uid.js';
|
9
|
+
import '../global/prop-types.js';
|
10
|
+
export { T as default } from '../_helpers/title.js';
|
11
|
+
import '../global/composeRefs.js';
|
12
|
+
import 'core-js/modules/es.object.to-string.js';
|
13
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
14
|
+
import '@jetbrains/icons/checkmark-14px';
|
15
|
+
import '@jetbrains/icons/remove-14px';
|
16
|
+
import '../icon/icon.js';
|
17
|
+
import 'util-deprecate';
|
18
|
+
import '../icon/icon__constants.js';
|
19
|
+
import '../_helpers/icon__svg.js';
|
20
|
+
import 'core-js/modules/es.regexp.exec.js';
|
21
|
+
import 'core-js/modules/es.string.replace.js';
|
22
|
+
import 'core-js/modules/es.string.starts-with.js';
|
23
|
+
import '../global/memoize.js';
|
24
|
+
import 'core-js/modules/es.array.iterator.js';
|
25
|
+
import 'core-js/modules/es.map.js';
|
26
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
27
|
+
import 'core-js/modules/es.weak-map.js';
|
28
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import type { Locale } from 'date-fns';
|
4
|
+
declare const units: {
|
5
|
+
unit: number;
|
6
|
+
cellSize: number;
|
7
|
+
calHeight: number;
|
8
|
+
yearHeight: number;
|
9
|
+
};
|
10
|
+
export default units;
|
11
|
+
export declare const YEAR = 12;
|
12
|
+
export declare const WEEK = 7;
|
13
|
+
export declare const weekdays: {
|
14
|
+
MO: number;
|
15
|
+
TU: number;
|
16
|
+
WE: number;
|
17
|
+
TH: number;
|
18
|
+
FR: number;
|
19
|
+
SA: number;
|
20
|
+
SU: number;
|
21
|
+
};
|
22
|
+
export declare const MIDDLE_DAY = 15;
|
23
|
+
export declare const yearDuration: number;
|
24
|
+
export declare const yearScrollSpeed: number;
|
25
|
+
export declare const DOUBLE = 2;
|
26
|
+
export declare const HALF = 0.5;
|
27
|
+
export declare const dateType: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
28
|
+
export declare function parseTime(time: string): string | null;
|
29
|
+
export interface DateInputTranslations {
|
30
|
+
addFirstDate?: string;
|
31
|
+
addSecondDate?: string;
|
32
|
+
addTime?: string;
|
33
|
+
selectName?: string;
|
34
|
+
}
|
35
|
+
export interface DateSpecificPopupProps {
|
36
|
+
withTime?: false | undefined;
|
37
|
+
range?: false | undefined;
|
38
|
+
onChange: (date: Date | null | undefined) => void;
|
39
|
+
}
|
40
|
+
export interface DatePickerChange {
|
41
|
+
from?: Date | null | undefined;
|
42
|
+
to?: Date | null | undefined;
|
43
|
+
date?: Date | null | undefined;
|
44
|
+
time?: string | null | undefined;
|
45
|
+
}
|
46
|
+
export interface TimeSpecificPopupProps {
|
47
|
+
withTime: true;
|
48
|
+
range?: false | undefined;
|
49
|
+
onChange: (change: DatePickerChange) => void;
|
50
|
+
}
|
51
|
+
export interface RangeSpecificPopupProps {
|
52
|
+
withTime?: false | undefined;
|
53
|
+
range: true;
|
54
|
+
onChange: (change: DatePickerChange) => void;
|
55
|
+
}
|
56
|
+
export interface DatePopupState {
|
57
|
+
active: Field;
|
58
|
+
text: string | null;
|
59
|
+
hoverDate: Date | null;
|
60
|
+
scrollDate: number | null;
|
61
|
+
}
|
62
|
+
export interface DatePopupBaseProps {
|
63
|
+
date?: Date | number | string | null | undefined;
|
64
|
+
time?: string | null | undefined;
|
65
|
+
from?: Date | number | string | null | undefined;
|
66
|
+
to?: Date | number | string | null | undefined;
|
67
|
+
minDate?: string | null | undefined;
|
68
|
+
maxDate?: string | null | undefined;
|
69
|
+
translations?: DateInputTranslations | null | undefined;
|
70
|
+
fromPlaceholder?: string | null | undefined;
|
71
|
+
toPlaceholder?: string | null | undefined;
|
72
|
+
timePlaceholder?: string | null | undefined;
|
73
|
+
locale?: Locale | undefined;
|
74
|
+
parseDateInput: (text: Date | number | string | null | undefined) => Date | null;
|
75
|
+
displayFormat: (date: Date, locale: Locale | undefined) => string;
|
76
|
+
onComplete: () => void;
|
77
|
+
onClear?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | null | undefined;
|
78
|
+
renderAfterCalendar?: ((state: DatePopupState) => ReactNode) | undefined;
|
79
|
+
}
|
80
|
+
export interface Dates {
|
81
|
+
from?: Date | null | undefined;
|
82
|
+
to?: Date | null | undefined;
|
83
|
+
date?: Date | null | undefined;
|
84
|
+
time?: never;
|
85
|
+
}
|
86
|
+
export interface CalendarProps extends Omit<DatePopupBaseProps, 'date' | 'from' | 'to' | 'time'>, Dates {
|
87
|
+
activeDate: Date | null;
|
88
|
+
scrollDate: number | Date;
|
89
|
+
currentRange: [Date, Date] | null;
|
90
|
+
activeRange: [Date, Date] | null;
|
91
|
+
onScroll: (to: number) => void;
|
92
|
+
onScrollChange: (date: number) => void;
|
93
|
+
}
|
94
|
+
export interface MonthsProps extends CalendarProps {
|
95
|
+
onSelect: (date: Date) => void;
|
96
|
+
onHover: (date: Date) => void;
|
97
|
+
}
|
98
|
+
export type Field = 'date' | 'time' | 'from' | 'to';
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import 'core-js/modules/es.regexp.exec.js';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import add from 'date-fns/add';
|
4
|
+
|
5
|
+
var unit = 8; // px;
|
6
|
+
var units = {
|
7
|
+
unit,
|
8
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
9
|
+
cellSize: unit * 3,
|
10
|
+
calHeight: unit * 36,
|
11
|
+
yearHeight: unit * 4
|
12
|
+
/* eslint-enable */
|
13
|
+
};
|
14
|
+
var YEAR = 12;
|
15
|
+
var WEEK = 7;
|
16
|
+
var weekdays = {
|
17
|
+
MO: 1,
|
18
|
+
TU: 2,
|
19
|
+
WE: 3,
|
20
|
+
TH: 4,
|
21
|
+
FR: 5,
|
22
|
+
SA: 6,
|
23
|
+
SU: 0
|
24
|
+
};
|
25
|
+
var MIDDLE_DAY = 15;
|
26
|
+
var durationToMillis = function durationToMillis(duration) {
|
27
|
+
return +add(0, duration);
|
28
|
+
};
|
29
|
+
var yearDuration = durationToMillis({
|
30
|
+
years: 1
|
31
|
+
});
|
32
|
+
var yearScrollSpeed = yearDuration / (YEAR * units.cellSize);
|
33
|
+
var DOUBLE = 2;
|
34
|
+
var HALF = 0.5;
|
35
|
+
var dateType = PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]);
|
36
|
+
function parseTime(time) {
|
37
|
+
var result = null;
|
38
|
+
if (/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
39
|
+
result = time;
|
40
|
+
} else if (/^([0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
41
|
+
result = "0".concat(time);
|
42
|
+
}
|
43
|
+
return result;
|
44
|
+
}
|
45
|
+
|
46
|
+
export { DOUBLE, HALF, MIDDLE_DAY, WEEK, YEAR, dateType, units as default, parseTime, weekdays, yearDuration, yearScrollSpeed };
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { DatePopupBaseProps, Field } from './consts';
|
4
|
+
export interface UpdateInputConfig {
|
5
|
+
active: boolean;
|
6
|
+
text: string | null;
|
7
|
+
}
|
8
|
+
export interface DateInputProps extends DatePopupBaseProps, UpdateInputConfig {
|
9
|
+
divider: boolean;
|
10
|
+
name: Field;
|
11
|
+
hoverDate: Date | null;
|
12
|
+
date: Date | null | undefined;
|
13
|
+
time?: string | null | undefined;
|
14
|
+
onInput: (value: string, name: Field) => void;
|
15
|
+
onActivate: () => void;
|
16
|
+
onConfirm: () => void;
|
17
|
+
}
|
18
|
+
export default class DateInput extends React.PureComponent<DateInputProps> {
|
19
|
+
static propTypes: {
|
20
|
+
active: PropTypes.Requireable<boolean>;
|
21
|
+
divider: PropTypes.Requireable<boolean>;
|
22
|
+
name: PropTypes.Requireable<string>;
|
23
|
+
text: PropTypes.Requireable<string>;
|
24
|
+
hoverDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
25
|
+
date: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
26
|
+
time: PropTypes.Requireable<string>;
|
27
|
+
displayFormat: PropTypes.Requireable<(...args: any[]) => any>;
|
28
|
+
translations: PropTypes.Requireable<object>;
|
29
|
+
fromPlaceholder: PropTypes.Requireable<string>;
|
30
|
+
toPlaceholder: PropTypes.Requireable<string>;
|
31
|
+
timePlaceholder: PropTypes.Requireable<string>;
|
32
|
+
onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
33
|
+
onActivate: PropTypes.Requireable<(...args: any[]) => any>;
|
34
|
+
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
35
|
+
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
36
|
+
locale: PropTypes.Requireable<object>;
|
37
|
+
};
|
38
|
+
componentDidUpdate(prevProps: DateInputProps): void;
|
39
|
+
static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
|
40
|
+
context: React.ContextType<typeof DateInput.contextType>;
|
41
|
+
input?: HTMLInputElement | null;
|
42
|
+
inputRef: (el: HTMLInputElement | null) => void;
|
43
|
+
updateInput({ text, active }: UpdateInputConfig): void;
|
44
|
+
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
45
|
+
handleKeyDown: (e: React.KeyboardEvent) => false | void;
|
46
|
+
render(): React.JSX.Element;
|
47
|
+
}
|