@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,55 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { DatePickerChange, DatePopupBaseProps, DateSpecificPopupProps, DatePopupState, RangeSpecificPopupProps, TimeSpecificPopupProps, Field } from './consts';
|
4
|
+
export type DatePopupProps = DatePopupBaseProps & (DateSpecificPopupProps | TimeSpecificPopupProps | RangeSpecificPopupProps);
|
5
|
+
export default class DatePopup extends Component<DatePopupProps, DatePopupState> {
|
6
|
+
static sameDay(next: Date | number | null, prev: Date | number | null): boolean;
|
7
|
+
static propTypes: {
|
8
|
+
className: PropTypes.Requireable<string>;
|
9
|
+
date: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
10
|
+
range: PropTypes.Requireable<boolean>;
|
11
|
+
withTime: PropTypes.Requireable<boolean>;
|
12
|
+
time: PropTypes.Requireable<string>;
|
13
|
+
from: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
14
|
+
to: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
15
|
+
renderAfterCalendar: PropTypes.Requireable<(...args: any[]) => any>;
|
16
|
+
displayFormat: PropTypes.Requireable<(...args: any[]) => any>;
|
17
|
+
parseDateInput: PropTypes.Requireable<(...args: any[]) => any>;
|
18
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
19
|
+
onComplete: PropTypes.Requireable<(...args: any[]) => any>;
|
20
|
+
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
21
|
+
minDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
22
|
+
maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
23
|
+
fromPlaceholder: PropTypes.Requireable<string>;
|
24
|
+
toPlaceholder: PropTypes.Requireable<string>;
|
25
|
+
timePlaceholder: PropTypes.Requireable<string>;
|
26
|
+
locale: PropTypes.Requireable<object>;
|
27
|
+
};
|
28
|
+
static defaultProps: {
|
29
|
+
onChange(): void;
|
30
|
+
};
|
31
|
+
constructor(props: DatePopupProps);
|
32
|
+
componentDidMount(): void;
|
33
|
+
componentDidUpdate(prevProps: DatePopupBaseProps, prevState: DatePopupState): void;
|
34
|
+
componentWillUnmount(): void;
|
35
|
+
private _scrollDate?;
|
36
|
+
private _scrollTS?;
|
37
|
+
isInTimeMode: () => boolean;
|
38
|
+
componentRef: React.RefObject<HTMLDivElement>;
|
39
|
+
handleWheel: (e: WheelEvent) => void;
|
40
|
+
parse(text: string | null | undefined, type: 'time'): string;
|
41
|
+
parse(text: Date | number | string | null | undefined, type?: 'date' | 'from' | 'to'): Date;
|
42
|
+
select(changes: DatePickerChange): void;
|
43
|
+
confirm(name: Field): void;
|
44
|
+
isValidDate: (parsedText: Date) => boolean;
|
45
|
+
scheduleScroll: () => void;
|
46
|
+
scrollTo: (scrollDate: number) => void;
|
47
|
+
hoverHandler: (hoverDate: Date) => void;
|
48
|
+
handleActivate: (arg: Field) => () => void;
|
49
|
+
handleInput: (text: string, name: Field) => void;
|
50
|
+
handleConfirm: (arg: Field) => () => void;
|
51
|
+
selectHandler: (date: Date) => void;
|
52
|
+
handleScroll: (scrollDate: number) => void;
|
53
|
+
onClear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
54
|
+
render(): React.JSX.Element;
|
55
|
+
}
|
@@ -0,0 +1,488 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, g as _objectSpread2, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.reduce.js';
|
3
|
+
import 'core-js/modules/es.object.to-string.js';
|
4
|
+
import 'core-js/modules/es.array.map.js';
|
5
|
+
import React, { Component } from 'react';
|
6
|
+
import PropTypes from 'prop-types';
|
7
|
+
import isAfter from 'date-fns/isAfter';
|
8
|
+
import isBefore from 'date-fns/isBefore';
|
9
|
+
import isSameDay from 'date-fns/isSameDay';
|
10
|
+
import startOfDay from 'date-fns/startOfDay';
|
11
|
+
import { set } from 'date-fns';
|
12
|
+
import memoize from '../global/memoize.js';
|
13
|
+
import DateInput from './date-input.js';
|
14
|
+
import Months from './months.js';
|
15
|
+
import Years from './years.js';
|
16
|
+
import Weekdays from './weekdays.js';
|
17
|
+
import { dateType, parseTime } from './consts.js';
|
18
|
+
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
19
|
+
import 'core-js/modules/es.array.iterator.js';
|
20
|
+
import 'core-js/modules/es.map.js';
|
21
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
22
|
+
import 'core-js/modules/es.weak-map.js';
|
23
|
+
import 'core-js/modules/es.array.concat.js';
|
24
|
+
import 'core-js/modules/es.regexp.exec.js';
|
25
|
+
import 'core-js/modules/es.string.replace.js';
|
26
|
+
import 'core-js/modules/es.array.filter.js';
|
27
|
+
import 'classnames';
|
28
|
+
import '../_helpers/input.js';
|
29
|
+
import 'core-js/modules/es.object.values.js';
|
30
|
+
import '@jetbrains/icons/close-12px';
|
31
|
+
import '../global/prop-types.js';
|
32
|
+
import '../button/button.js';
|
33
|
+
import '@jetbrains/icons/chevron-10px';
|
34
|
+
import '../icon/icon.js';
|
35
|
+
import 'util-deprecate';
|
36
|
+
import '../icon/icon__constants.js';
|
37
|
+
import '../_helpers/icon__svg.js';
|
38
|
+
import 'core-js/modules/es.string.starts-with.js';
|
39
|
+
import '../link/clickableLink.js';
|
40
|
+
import '../global/controls-height.js';
|
41
|
+
import '../_helpers/button__classes.js';
|
42
|
+
import '../global/get-uid.js';
|
43
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
44
|
+
import '../i18n/i18n-context.js';
|
45
|
+
import '../i18n/i18n.js';
|
46
|
+
import 'core-js/modules/es.set.js';
|
47
|
+
import '../global/composeRefs.js';
|
48
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
49
|
+
import '../control-label/control-label.js';
|
50
|
+
import 'date-fns/addMonths';
|
51
|
+
import 'date-fns/getDay';
|
52
|
+
import 'date-fns/getDaysInMonth';
|
53
|
+
import 'date-fns/startOfMonth';
|
54
|
+
import 'date-fns/subMonths';
|
55
|
+
import 'date-fns/endOfMonth';
|
56
|
+
import '../global/schedule-raf.js';
|
57
|
+
import '../global/linear-function.js';
|
58
|
+
import '../global/use-event-callback.js';
|
59
|
+
import './month.js';
|
60
|
+
import 'date-fns/addDays';
|
61
|
+
import 'date-fns/format';
|
62
|
+
import 'date-fns/setDay';
|
63
|
+
import './day.js';
|
64
|
+
import 'core-js/modules/es.array.includes.js';
|
65
|
+
import 'core-js/modules/es.string.includes.js';
|
66
|
+
import 'date-fns/getDate';
|
67
|
+
import 'date-fns/isToday';
|
68
|
+
import 'date-fns/add';
|
69
|
+
import './month-names.js';
|
70
|
+
import 'date-fns/isThisMonth';
|
71
|
+
import 'date-fns/set';
|
72
|
+
import 'date-fns/startOfYear';
|
73
|
+
import './month-slider.js';
|
74
|
+
import 'date-fns/addYears';
|
75
|
+
import 'date-fns/subYears';
|
76
|
+
import 'date-fns/getYear';
|
77
|
+
import 'date-fns/isSameYear';
|
78
|
+
import 'date-fns/isThisYear';
|
79
|
+
import 'date-fns/setYear';
|
80
|
+
|
81
|
+
var _excluded = ["from", "to", "date", "time"];
|
82
|
+
var scrollExpDelay = 10;
|
83
|
+
var DatePopup = /*#__PURE__*/function (_Component) {
|
84
|
+
_inherits(DatePopup, _Component);
|
85
|
+
var _super = _createSuper(DatePopup);
|
86
|
+
function DatePopup(props) {
|
87
|
+
var _this;
|
88
|
+
_classCallCheck(this, DatePopup);
|
89
|
+
_this = _super.call(this, props);
|
90
|
+
_defineProperty(_assertThisInitialized(_this), "_scrollDate", void 0);
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "_scrollTS", void 0);
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "isInTimeMode", function () {
|
93
|
+
return !_this.props.range && _this.props.withTime || false;
|
94
|
+
});
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "componentRef", /*#__PURE__*/React.createRef());
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "handleWheel", function (e) {
|
97
|
+
if (e.cancelable) {
|
98
|
+
e.preventDefault();
|
99
|
+
}
|
100
|
+
});
|
101
|
+
_defineProperty(_assertThisInitialized(_this), "isValidDate", function (parsedText) {
|
102
|
+
var minDate = _this.parse(_this.props.minDate, 'date');
|
103
|
+
var maxDate = _this.parse(_this.props.maxDate, 'date');
|
104
|
+
if (parsedText) {
|
105
|
+
return !(minDate && isBefore(parsedText, minDate) || maxDate && isAfter(parsedText, maxDate));
|
106
|
+
}
|
107
|
+
return false;
|
108
|
+
});
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleScroll", function () {
|
110
|
+
var current = _this.state.scrollDate && _this.parse(_this.state.scrollDate, 'date') || _this.parse(_this.props[_this.state.active], 'date') || new Date();
|
111
|
+
var goal = _this._scrollDate;
|
112
|
+
if (!current || !goal || DatePopup.sameDay(goal, current)) {
|
113
|
+
_this._scrollDate = null;
|
114
|
+
_this._scrollTS = null;
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
if (_this._scrollTS) {
|
118
|
+
var diff = goal - Number(current);
|
119
|
+
var dt = Date.now() - _this._scrollTS;
|
120
|
+
var next = goal - diff * Math.pow(Math.E, -dt / scrollExpDelay);
|
121
|
+
_this.setState({
|
122
|
+
scrollDate: next
|
123
|
+
});
|
124
|
+
}
|
125
|
+
_this._scrollTS = Date.now();
|
126
|
+
window.requestAnimationFrame(_this.scheduleScroll);
|
127
|
+
});
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "scrollTo", function (scrollDate) {
|
129
|
+
_this._scrollDate = scrollDate;
|
130
|
+
if (!_this._scrollTS) {
|
131
|
+
_this.scheduleScroll();
|
132
|
+
}
|
133
|
+
});
|
134
|
+
_defineProperty(_assertThisInitialized(_this), "hoverHandler", function (hoverDate) {
|
135
|
+
return _this.setState({
|
136
|
+
hoverDate
|
137
|
+
});
|
138
|
+
});
|
139
|
+
_defineProperty(_assertThisInitialized(_this), "handleActivate", memoize(function (name) {
|
140
|
+
return function () {
|
141
|
+
return _this.setState({
|
142
|
+
active: name
|
143
|
+
});
|
144
|
+
};
|
145
|
+
}));
|
146
|
+
_defineProperty(_assertThisInitialized(_this), "handleInput", function (text, name) {
|
147
|
+
if (name !== 'time') {
|
148
|
+
var parsed = _this.parse(text, name);
|
149
|
+
if (_this.isValidDate(parsed)) {
|
150
|
+
_this.scrollTo(Number(parsed));
|
151
|
+
}
|
152
|
+
}
|
153
|
+
_this.setState({
|
154
|
+
text,
|
155
|
+
hoverDate: null
|
156
|
+
});
|
157
|
+
});
|
158
|
+
_defineProperty(_assertThisInitialized(_this), "handleConfirm", memoize(function (name) {
|
159
|
+
return function () {
|
160
|
+
return _this.confirm(name);
|
161
|
+
};
|
162
|
+
}));
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "selectHandler", function (date) {
|
164
|
+
if (_this.isInTimeMode()) {
|
165
|
+
_this.setState({
|
166
|
+
active: 'time'
|
167
|
+
}, function () {
|
168
|
+
return _this.select({
|
169
|
+
date
|
170
|
+
});
|
171
|
+
});
|
172
|
+
} else {
|
173
|
+
_this.select({
|
174
|
+
[_this.state.active]: date
|
175
|
+
});
|
176
|
+
}
|
177
|
+
});
|
178
|
+
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (scrollDate) {
|
179
|
+
return _this.setState({
|
180
|
+
scrollDate
|
181
|
+
});
|
182
|
+
});
|
183
|
+
_defineProperty(_assertThisInitialized(_this), "onClear", function (e) {
|
184
|
+
var _this$props$onClear, _this$props, _this$componentRef$cu;
|
185
|
+
var changes;
|
186
|
+
if (_this.props.range) {
|
187
|
+
changes = {
|
188
|
+
from: null,
|
189
|
+
to: null
|
190
|
+
};
|
191
|
+
} else {
|
192
|
+
changes = {
|
193
|
+
date: null
|
194
|
+
};
|
195
|
+
}
|
196
|
+
_this.select(changes);
|
197
|
+
(_this$props$onClear = (_this$props = _this.props).onClear) === null || _this$props$onClear === void 0 || _this$props$onClear.call(_this$props, e);
|
198
|
+
(_this$componentRef$cu = _this.componentRef.current) === null || _this$componentRef$cu === void 0 || (_this$componentRef$cu = _this$componentRef$cu.querySelector('input')) === null || _this$componentRef$cu === void 0 || _this$componentRef$cu.focus();
|
199
|
+
});
|
200
|
+
var defaultState = {
|
201
|
+
text: null,
|
202
|
+
hoverDate: null,
|
203
|
+
scrollDate: null
|
204
|
+
};
|
205
|
+
var range = props.range,
|
206
|
+
withTime = props.withTime;
|
207
|
+
if (!range) {
|
208
|
+
var parsedDate = _this.parse(props.date, 'date');
|
209
|
+
var active = withTime && parsedDate && !props.time ? 'time' : 'date';
|
210
|
+
_this.state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
211
|
+
active
|
212
|
+
});
|
213
|
+
} else if (props.from && !props.to) {
|
214
|
+
_this.state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
215
|
+
active: 'to'
|
216
|
+
});
|
217
|
+
} else {
|
218
|
+
_this.state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
219
|
+
active: 'from'
|
220
|
+
});
|
221
|
+
}
|
222
|
+
return _this;
|
223
|
+
}
|
224
|
+
_createClass(DatePopup, [{
|
225
|
+
key: "componentDidMount",
|
226
|
+
value: function componentDidMount() {
|
227
|
+
if (this.componentRef.current) {
|
228
|
+
this.componentRef.current.addEventListener('wheel', this.handleWheel);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}, {
|
232
|
+
key: "componentDidUpdate",
|
233
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
234
|
+
if (this.state.active !== prevState.active) {
|
235
|
+
if (this.state.text && prevState.active) {
|
236
|
+
this.confirm(prevState.active);
|
237
|
+
}
|
238
|
+
this.setState({
|
239
|
+
text: null
|
240
|
+
});
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}, {
|
244
|
+
key: "componentWillUnmount",
|
245
|
+
value: function componentWillUnmount() {
|
246
|
+
if (this.componentRef.current) {
|
247
|
+
this.componentRef.current.removeEventListener('wheel', this.handleWheel);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}, {
|
251
|
+
key: "parse",
|
252
|
+
value: function parse(text, type) {
|
253
|
+
if (type === 'time') {
|
254
|
+
return parseTime(String(text));
|
255
|
+
}
|
256
|
+
return this.props.parseDateInput(text);
|
257
|
+
}
|
258
|
+
}, {
|
259
|
+
key: "select",
|
260
|
+
value: function select(changes) {
|
261
|
+
var _this$props2 = this.props,
|
262
|
+
range = _this$props2.range,
|
263
|
+
withTime = _this$props2.withTime;
|
264
|
+
var prevActive = this.state.active;
|
265
|
+
if (!range && !withTime) {
|
266
|
+
this.setState({
|
267
|
+
text: null,
|
268
|
+
scrollDate: null
|
269
|
+
});
|
270
|
+
var adjustedDate = changes.date && set(new Date(), {
|
271
|
+
year: changes.date.getFullYear(),
|
272
|
+
month: changes.date.getMonth(),
|
273
|
+
date: changes.date.getDate()
|
274
|
+
});
|
275
|
+
this.props.onChange(adjustedDate);
|
276
|
+
this.props.onComplete();
|
277
|
+
} else if (!range && withTime) {
|
278
|
+
var date = this.parse(this.props.date, 'date');
|
279
|
+
var time = this.parse(this.props.time, 'time');
|
280
|
+
var changeToSubmit = {
|
281
|
+
date: changes.date || date,
|
282
|
+
time: changes.time || time
|
283
|
+
};
|
284
|
+
this.setState({
|
285
|
+
active: changes.date ? 'time' : 'date',
|
286
|
+
text: null,
|
287
|
+
scrollDate: null
|
288
|
+
});
|
289
|
+
this.props.onChange(changeToSubmit);
|
290
|
+
if (!changes.date && prevActive === 'time' && changeToSubmit.date && changeToSubmit.time) {
|
291
|
+
this.props.onComplete();
|
292
|
+
}
|
293
|
+
} else {
|
294
|
+
var _this$props$changes = _objectSpread2(_objectSpread2({}, this.props), changes),
|
295
|
+
from = _this$props$changes.from,
|
296
|
+
to = _this$props$changes.to;
|
297
|
+
from = this.parse(from, 'from');
|
298
|
+
to = this.parse(to, 'to');
|
299
|
+
// proceed to setting the end by default
|
300
|
+
var active = 'to';
|
301
|
+
var complete = false;
|
302
|
+
// end is before beginning
|
303
|
+
if (from && to && isAfter(startOfDay(from), startOfDay(to))) {
|
304
|
+
// ignore the old end when beginning is changed
|
305
|
+
if (changes.from) {
|
306
|
+
to = null;
|
307
|
+
// treat range as reverse when end is changed
|
308
|
+
} else if (changes.to) {
|
309
|
+
to = from;
|
310
|
+
from = changes.to;
|
311
|
+
}
|
312
|
+
} else if (changes.to) {
|
313
|
+
active = 'from';
|
314
|
+
complete = !!from;
|
315
|
+
}
|
316
|
+
this.setState({
|
317
|
+
active,
|
318
|
+
hoverDate: null,
|
319
|
+
text: null
|
320
|
+
});
|
321
|
+
this.props.onChange({
|
322
|
+
from,
|
323
|
+
to
|
324
|
+
});
|
325
|
+
if (complete) {
|
326
|
+
this.props.onComplete();
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
}, {
|
331
|
+
key: "confirm",
|
332
|
+
value: function confirm(name) {
|
333
|
+
var text = this.state.text;
|
334
|
+
var result;
|
335
|
+
if (name === 'time') {
|
336
|
+
result = this.parse(text, name);
|
337
|
+
var time = this.parse('time' in this.props ? this.props.time : '', 'time');
|
338
|
+
var emptyCase = this.state.active === 'time' ? '00:00' : null;
|
339
|
+
result = result || time || emptyCase;
|
340
|
+
} else {
|
341
|
+
result = this.parse(text, name);
|
342
|
+
if (!this.isValidDate(result)) {
|
343
|
+
result = this.parse(name in this.props ? this.props[name] : '', name);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
this.select({
|
347
|
+
[name]: result
|
348
|
+
});
|
349
|
+
}
|
350
|
+
}, {
|
351
|
+
key: "render",
|
352
|
+
value: function render() {
|
353
|
+
var _this2 = this;
|
354
|
+
var _this$props3 = this.props,
|
355
|
+
range = _this$props3.range,
|
356
|
+
withTime = _this$props3.withTime,
|
357
|
+
locale = _this$props3.locale;
|
358
|
+
var _this$props4 = this.props;
|
359
|
+
_this$props4.from;
|
360
|
+
_this$props4.to;
|
361
|
+
_this$props4.date;
|
362
|
+
var time = _this$props4.time,
|
363
|
+
restProps = _objectWithoutProperties(_this$props4, _excluded);
|
364
|
+
var parsedDate = this.parse(this.props.date, 'date');
|
365
|
+
var parsedTo = this.parse(this.props.to, 'to');
|
366
|
+
var names = range ? ['from', 'to'] : ['date'];
|
367
|
+
var dates = names.reduce(function (obj, key) {
|
368
|
+
var value = _this2.props[key];
|
369
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
370
|
+
[key]: _this2.parse(value, key)
|
371
|
+
});
|
372
|
+
}, {});
|
373
|
+
var activeDate = this.state.active !== 'time' ? this.state.hoverDate || (this.state.text != null ? this.parse(this.state.text, 'date') : null) : this.state.hoverDate || null;
|
374
|
+
var currentRange = range && dates.from && dates.to && [dates.from, dates.to] || null;
|
375
|
+
var activeRange = null;
|
376
|
+
if (range && activeDate) {
|
377
|
+
switch (this.state.active) {
|
378
|
+
case 'from':
|
379
|
+
if (dates.to && isAfter(startOfDay(activeDate), startOfDay(dates.to))) {
|
380
|
+
activeRange = [activeDate, dates.to];
|
381
|
+
}
|
382
|
+
break;
|
383
|
+
case 'to':
|
384
|
+
if (!dates.from) {
|
385
|
+
break;
|
386
|
+
}
|
387
|
+
if (isBefore(startOfDay(activeDate), startOfDay(dates.from))) {
|
388
|
+
activeRange = [activeDate, dates.from];
|
389
|
+
} else {
|
390
|
+
activeRange = [dates.from, activeDate];
|
391
|
+
}
|
392
|
+
break;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
var scrollDate = withTime && !range ? this.state.scrollDate || dates.date || new Date() : this.state.scrollDate || dates[this.state.active] || new Date();
|
396
|
+
var calendarProps = _objectSpread2(_objectSpread2(_objectSpread2({}, restProps), dates), {}, {
|
397
|
+
scrollDate,
|
398
|
+
activeDate,
|
399
|
+
currentRange,
|
400
|
+
activeRange,
|
401
|
+
onScroll: this.handleScroll,
|
402
|
+
onScrollChange: this.scrollTo
|
403
|
+
});
|
404
|
+
var clearable = Boolean(this.props.onClear);
|
405
|
+
return /*#__PURE__*/React.createElement("div", {
|
406
|
+
className: modules_0c7b7d96.datePopup,
|
407
|
+
"data-test": "ring-date-popup",
|
408
|
+
ref: this.componentRef
|
409
|
+
}, /*#__PURE__*/React.createElement("div", {
|
410
|
+
className: modules_0c7b7d96.filterWrapper
|
411
|
+
}, names.map(function (name) {
|
412
|
+
var onClear;
|
413
|
+
if (clearable && name !== 'from' && !_this2.isInTimeMode()) {
|
414
|
+
onClear = _this2.onClear.bind(_this2);
|
415
|
+
}
|
416
|
+
return /*#__PURE__*/React.createElement(DateInput, _extends({}, _this2.props, _this2.state, {
|
417
|
+
divider: name === 'from' && (dates[name] != null || parsedTo != null),
|
418
|
+
name: name,
|
419
|
+
key: name,
|
420
|
+
date: dates[name],
|
421
|
+
active: _this2.state.active === name,
|
422
|
+
onActivate: _this2.handleActivate(name),
|
423
|
+
onInput: _this2.handleInput,
|
424
|
+
onConfirm: _this2.handleConfirm(name),
|
425
|
+
onClear: onClear,
|
426
|
+
locale: locale
|
427
|
+
}));
|
428
|
+
}), this.isInTimeMode() ? /*#__PURE__*/React.createElement(DateInput, _extends({}, this.props, {
|
429
|
+
text: this.state.text,
|
430
|
+
divider: !!parsedDate,
|
431
|
+
hoverDate: null,
|
432
|
+
name: 'time',
|
433
|
+
key: 'time',
|
434
|
+
date: null,
|
435
|
+
time: time,
|
436
|
+
active: this.state.active === 'time',
|
437
|
+
onActivate: this.handleActivate('time'),
|
438
|
+
onInput: this.handleInput,
|
439
|
+
onConfirm: this.handleConfirm('time'),
|
440
|
+
onClear: clearable && this.onClear || undefined,
|
441
|
+
locale: locale
|
442
|
+
})) : ''), /*#__PURE__*/React.createElement(Weekdays, {
|
443
|
+
locale: locale
|
444
|
+
}), /*#__PURE__*/React.createElement("div", {
|
445
|
+
className: modules_0c7b7d96.calendar
|
446
|
+
}, /*#__PURE__*/React.createElement(Months, _extends({}, calendarProps, {
|
447
|
+
onHover: this.hoverHandler,
|
448
|
+
onSelect: this.selectHandler,
|
449
|
+
locale: locale
|
450
|
+
})), /*#__PURE__*/React.createElement(Years, calendarProps)), this.props.renderAfterCalendar && this.props.renderAfterCalendar(this.state));
|
451
|
+
}
|
452
|
+
}], [{
|
453
|
+
key: "sameDay",
|
454
|
+
value: function sameDay(next, prev) {
|
455
|
+
if (next && prev) {
|
456
|
+
return isSameDay(next, prev);
|
457
|
+
}
|
458
|
+
return next === prev;
|
459
|
+
}
|
460
|
+
}]);
|
461
|
+
return DatePopup;
|
462
|
+
}(Component);
|
463
|
+
_defineProperty(DatePopup, "propTypes", {
|
464
|
+
className: PropTypes.string,
|
465
|
+
date: dateType,
|
466
|
+
range: PropTypes.bool,
|
467
|
+
withTime: PropTypes.bool,
|
468
|
+
time: PropTypes.string,
|
469
|
+
from: dateType,
|
470
|
+
to: dateType,
|
471
|
+
renderAfterCalendar: PropTypes.func,
|
472
|
+
displayFormat: PropTypes.func,
|
473
|
+
parseDateInput: PropTypes.func,
|
474
|
+
onChange: PropTypes.func,
|
475
|
+
onComplete: PropTypes.func,
|
476
|
+
onClear: PropTypes.func,
|
477
|
+
minDate: dateType,
|
478
|
+
maxDate: dateType,
|
479
|
+
fromPlaceholder: PropTypes.string,
|
480
|
+
toPlaceholder: PropTypes.string,
|
481
|
+
timePlaceholder: PropTypes.string,
|
482
|
+
locale: PropTypes.object
|
483
|
+
});
|
484
|
+
_defineProperty(DatePopup, "defaultProps", {
|
485
|
+
onChange() {}
|
486
|
+
});
|
487
|
+
|
488
|
+
export { DatePopup as default };
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { MonthsProps } from './consts';
|
4
|
+
export interface DayProps extends MonthsProps {
|
5
|
+
day: Date;
|
6
|
+
empty: boolean;
|
7
|
+
}
|
8
|
+
export default class Day extends Component<DayProps> {
|
9
|
+
static propTypes: {
|
10
|
+
day: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
11
|
+
from: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
12
|
+
currentRange: PropTypes.Requireable<(NonNullable<string | number | Date | null | undefined> | null | undefined)[]>;
|
13
|
+
activeRange: PropTypes.Requireable<(NonNullable<string | number | Date | null | undefined> | null | undefined)[]>;
|
14
|
+
empty: PropTypes.Requireable<boolean>;
|
15
|
+
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
16
|
+
parseDateInput: PropTypes.Requireable<(...args: any[]) => any>;
|
17
|
+
onHover: PropTypes.Requireable<(...args: any[]) => any>;
|
18
|
+
minDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
19
|
+
maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
20
|
+
};
|
21
|
+
handleClick: () => void;
|
22
|
+
handleMouseOver: () => void;
|
23
|
+
handleMouseOut: () => void;
|
24
|
+
isDay: (date: Date) => boolean;
|
25
|
+
is: (name: 'date' | 'from' | 'to' | 'activeDate') => boolean;
|
26
|
+
inRange: (range: [Date, Date] | null) => boolean | null;
|
27
|
+
isDisabled: (date: Date) => boolean;
|
28
|
+
parse(text: string | null | undefined): Date | null;
|
29
|
+
render(): React.JSX.Element;
|
30
|
+
}
|