diginet-core-ui 1.4.39 → 1.4.40
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/.browserslistrc +6 -0
- package/.eslintrc.js +91 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc +32 -0
- package/.storybook/main.js +4 -0
- package/.storybook/manager.js +10 -0
- package/.storybook/preview-head.html +17 -0
- package/.storybook/preview.js +36 -0
- package/.storybook/themeDecorator.js +19 -0
- package/babel.config.json +17 -0
- package/bitbucket-pipelines.yml +18 -0
- package/jsconfig.json +8 -0
- package/package.json +78 -44
- package/package.json.tmp +44 -0
- package/postcss.config.js +9 -0
- package/readme.md +5 -0
- package/src/assets/images/menu/dhr/MHRP15N0002.svg +17 -0
- package/src/assets/images/menu/dhr/MHRP15N0003.svg +26 -0
- package/src/components/accordion/context.js +5 -0
- package/src/components/accordion/details.js +80 -0
- package/src/components/accordion/group.js +140 -0
- package/src/components/accordion/index.js +207 -0
- package/src/components/accordion/index.stories.js +278 -0
- package/src/components/accordion/summary.js +380 -0
- package/src/components/alert/index.js +312 -0
- package/src/components/alert/index.stories.js +109 -0
- package/src/components/alert/notify.js +179 -0
- package/src/components/avatar/index.js +472 -0
- package/src/components/avatar/index.stories.js +80 -0
- package/src/components/badge/index.js +307 -0
- package/src/components/badge/index.stories.js +187 -0
- package/src/components/breadcrumb/index.js +280 -0
- package/src/components/breadcrumb/index.stories.js +69 -0
- package/src/components/button/button.stories.js +34 -0
- package/src/components/button/buttonIcon.stories.js +36 -0
- package/src/components/button/buttonMore.stories.js +58 -0
- package/src/components/button/icon.js +468 -0
- package/src/components/button/index.js +582 -0
- package/src/components/button/more.js +249 -0
- package/src/components/button/ripple-effect.js +95 -0
- package/src/components/button/sample.stories.js +194 -0
- package/src/components/card/body.js +73 -0
- package/src/components/card/extra.js +73 -0
- package/src/components/card/footer.js +73 -0
- package/src/components/card/header.js +74 -0
- package/src/components/card/index.js +256 -0
- package/src/components/card/index.stories.js +242 -0
- package/src/components/chart/Pie/Circle.js +68 -0
- package/src/components/chart/Pie/Sector.js +134 -0
- package/src/components/chart/Pie/Sectors.js +96 -0
- package/src/components/chart/Pie/index.js +312 -0
- package/src/components/chart/Pie/index.stories.js +77 -0
- package/src/components/chart/Pie-v2/Circle.js +62 -0
- package/src/components/chart/Pie-v2/Sector.js +128 -0
- package/src/components/chart/Pie-v2/Sectors.js +353 -0
- package/src/components/chart/Pie-v2/index.js +499 -0
- package/src/components/chart/Pie-v2/index.stories.js +77 -0
- package/src/components/chart/bar/Axis.js +67 -0
- package/src/components/chart/bar/Bar.js +365 -0
- package/src/components/chart/bar/Grid.js +111 -0
- package/src/components/chart/bar/Labels.js +193 -0
- package/src/components/chart/bar/Points.js +112 -0
- package/src/components/chart/bar/index.js +170 -0
- package/src/components/chart/bar/index.stories.js +174 -0
- package/src/components/chart/bar-v2/Axis.js +67 -0
- package/src/components/chart/bar-v2/Bar.js +372 -0
- package/src/components/chart/bar-v2/Grid.js +111 -0
- package/src/components/chart/bar-v2/Labels.js +193 -0
- package/src/components/chart/bar-v2/Points.js +112 -0
- package/src/components/chart/bar-v2/index.js +170 -0
- package/src/components/chart/bar-v2/index.stories.js +174 -0
- package/src/components/chart/line/Axis.js +68 -0
- package/src/components/chart/line/Grid.js +98 -0
- package/src/components/chart/line/Labels.js +191 -0
- package/src/components/chart/line/Path.js +155 -0
- package/src/components/chart/line/Point.js +358 -0
- package/src/components/chart/line/Title.js +50 -0
- package/src/components/chart/line/index.js +202 -0
- package/src/components/chart/line/index.stories.js +148 -0
- package/src/components/chart/line-v2/Axis.js +66 -0
- package/src/components/chart/line-v2/Grid.js +111 -0
- package/src/components/chart/line-v2/Labels.js +190 -0
- package/src/components/chart/line-v2/Path.js +154 -0
- package/src/components/chart/line-v2/Point.js +336 -0
- package/src/components/chart/line-v2/Title.js +50 -0
- package/src/components/chart/line-v2/index.js +172 -0
- package/src/components/chart/line-v2/index.stories.js +148 -0
- package/src/components/check-text/index.js +168 -0
- package/src/components/check-text/index.stories.js +50 -0
- package/src/components/check-text/interview-confirmation.js +169 -0
- package/src/components/check-text/interview-status.js +142 -0
- package/src/components/chip/attach.js +156 -0
- package/src/components/chip/index.js +366 -0
- package/src/components/chip/index.stories.js +190 -0
- package/src/components/collapse/index.js +104 -0
- package/src/components/collapse/index.stories.js +35 -0
- package/src/components/dialogs/colors.js +13 -0
- package/src/components/divider/index.js +87 -0
- package/src/components/divider/index.stories.js +52 -0
- package/src/components/form-control/attachment/index.js +1770 -0
- package/src/components/form-control/attachment/index.stories.js +106 -0
- package/src/components/form-control/calendar/function.js +959 -0
- package/src/components/form-control/calendar/index.js +413 -0
- package/src/components/form-control/calendar/index.stories.js +40 -0
- package/src/components/form-control/calendar/range.js +329 -0
- package/src/components/form-control/checkbox/index.js +382 -0
- package/src/components/form-control/checkbox/index.stories.js +110 -0
- package/src/components/form-control/control/index.js +99 -0
- package/src/components/form-control/date-input/DateField.js +191 -0
- package/src/components/form-control/date-input/index.js +315 -0
- package/src/components/form-control/date-input/index.stories.js +96 -0
- package/src/components/form-control/date-input/useDateInputState.js +138 -0
- package/src/components/form-control/date-input/useIsFocused.js +25 -0
- package/src/components/form-control/date-input/useKeyboardInputEvent.js +45 -0
- package/src/components/form-control/date-input/utils.js +293 -0
- package/src/components/form-control/date-picker/index.js +429 -0
- package/src/components/form-control/date-picker/index.stories.js +141 -0
- package/src/components/form-control/date-range-picker/index.js +1349 -0
- package/src/components/form-control/date-range-picker/index.stories.js +43 -0
- package/src/components/form-control/dropdown/index.js +1858 -0
- package/src/components/form-control/dropdown/index.stories.js +222 -0
- package/src/components/form-control/dropdown-box/index.js +271 -0
- package/src/components/form-control/dropdown-box/index.stories.js +103 -0
- package/src/components/form-control/form/context.js +5 -0
- package/src/components/form-control/form/index.js +39 -0
- package/src/components/form-control/form-group/index.js +131 -0
- package/src/components/form-control/form-group/index.stories.js +57 -0
- package/src/components/form-control/helper-text/index.js +92 -0
- package/src/components/form-control/helper-text/index.stories.js +29 -0
- package/src/components/form-control/input-base/UncontrolledInputBase.js +499 -0
- package/src/components/form-control/input-base/index.js +706 -0
- package/src/components/form-control/input-base/index.stories.js +69 -0
- package/src/components/form-control/label/index.js +127 -0
- package/src/components/form-control/label/index.stories.js +69 -0
- package/src/components/form-control/money-input/index.js +622 -0
- package/src/components/form-control/money-input/index.stories.js +42 -0
- package/src/components/form-control/number-input/index.js +582 -0
- package/src/components/form-control/number-input/index.stories.js +53 -0
- package/src/components/form-control/number-input/index2.js +531 -0
- package/src/components/form-control/password-input/index.js +259 -0
- package/src/components/form-control/password-input/index.stories.js +32 -0
- package/src/components/form-control/phone-input/index.js +382 -0
- package/src/components/form-control/phone-input/index.stories.js +39 -0
- package/src/components/form-control/radio/index.js +241 -0
- package/src/components/form-control/radio/index.stories.js +51 -0
- package/src/components/form-control/text-input/index.js +254 -0
- package/src/components/form-control/text-input/index.stories.js +60 -0
- package/src/components/form-control/time-picker/index.js +782 -0
- package/src/components/form-control/time-picker/index.mdx +49 -0
- package/src/components/form-control/time-picker/index.stories.js +69 -0
- package/src/components/form-control/time-picker/swiper.js +568 -0
- package/src/components/form-control/time-picker/v2/index.js +785 -0
- package/src/components/form-control/time-picker/v2/index.stories.js +43 -0
- package/src/components/form-control/toggle/index.js +247 -0
- package/src/components/form-control/toggle/index.stories.js +51 -0
- package/src/components/form-view/helper-text.js +30 -0
- package/src/components/form-view/index.js +100 -0
- package/src/components/form-view/index.stories.js +25 -0
- package/src/components/form-view/input.js +134 -0
- package/src/components/form-view/label.js +39 -0
- package/src/components/grid/Col.js +89 -0
- package/src/components/grid/Container.js +99 -0
- package/src/components/grid/Row.js +97 -0
- package/src/components/grid/context.js +5 -0
- package/src/components/grid/index.js +323 -0
- package/src/components/grid/index.stories.js +523 -0
- package/src/components/image/index.js +191 -0
- package/src/components/image/index.stories.js +53 -0
- package/src/components/index.js +157 -0
- package/src/components/list/index.stories.js +261 -0
- package/src/components/list/list-item-action.js +94 -0
- package/src/components/list/list-item-icon.js +89 -0
- package/src/components/list/list-item-text.js +69 -0
- package/src/components/list/list-item.js +131 -0
- package/src/components/list/list.js +164 -0
- package/src/components/list/sub-header.js +79 -0
- package/src/components/modal/body.js +84 -0
- package/src/components/modal/context.js +5 -0
- package/src/components/modal/footer.js +90 -0
- package/src/components/modal/header.js +145 -0
- package/src/components/modal/index.js +59 -0
- package/src/components/modal/index.stories.js +95 -0
- package/src/components/modal/modal.js +330 -0
- package/src/components/others/date/index.stories.js +217 -0
- package/src/components/others/extra/index.js +129 -0
- package/src/components/others/extra/index.mdx +39 -0
- package/src/components/others/extra/index.stories.js +17 -0
- package/src/components/others/import/index.js +66 -0
- package/src/components/others/import/index.stories.js +70 -0
- package/src/components/others/locale/index.stories.js +42 -0
- package/src/components/others/option-wrapper/index.js +34 -0
- package/src/components/others/scrollbar/index.js +106 -0
- package/src/components/others/scrollbar/index.stories.js +68 -0
- package/src/components/others/validate/index.stories.js +113 -0
- package/src/components/paging/index.stories.js +76 -0
- package/src/components/paging/page-info.js +637 -0
- package/src/components/paging/page-selector.js +437 -0
- package/src/components/paper/index.js +128 -0
- package/src/components/paper/index.stories.js +37 -0
- package/src/components/popover/body.js +98 -0
- package/src/components/popover/footer.js +96 -0
- package/src/components/popover/header.js +99 -0
- package/src/components/popover/index.js +718 -0
- package/src/components/popover/index.stories.js +189 -0
- package/src/components/popup/danger_popup.js +196 -0
- package/src/components/popup/index.js +464 -0
- package/src/components/popup/v2/index.js +556 -0
- package/src/components/popup/v2/index.stories.js +113 -0
- package/src/components/progress/circular.js +326 -0
- package/src/components/progress/index.stories.js +51 -0
- package/src/components/progress/linear.js +361 -0
- package/src/components/rating/index.js +309 -0
- package/src/components/rating/index.stories.js +78 -0
- package/src/components/skeleton/index.js +79 -0
- package/src/components/skeleton/index.stories.js +29 -0
- package/src/components/slider/index.stories.js +50 -0
- package/src/components/slider/slider-container.js +415 -0
- package/src/components/slider/slider-item.js +222 -0
- package/src/components/status/index.js +145 -0
- package/src/components/status/index.stories.js +71 -0
- package/src/components/tab/context.js +5 -0
- package/src/components/tab/index.stories.js +123 -0
- package/src/components/tab/tab-container.js +109 -0
- package/src/components/tab/tab-header.js +177 -0
- package/src/components/tab/tab-panel.js +101 -0
- package/src/components/tab/tab.js +249 -0
- package/src/components/tooltip/index.js +580 -0
- package/src/components/tooltip/index.stories.js +282 -0
- package/src/components/tooltip/portal.js +10 -0
- package/src/components/transfer/index.js +555 -0
- package/src/components/transfer/index.stories.js +53 -0
- package/src/components/tree-view/index.js +1085 -0
- package/src/components/tree-view/index.stories.js +347 -0
- package/src/components/typography/index.js +331 -0
- package/src/components/typography/index.stories.js +166 -0
- package/src/docs/changelog/changelog.md +1354 -0
- package/src/docs/changelog/index.stories.js +20 -0
- package/src/global/index.js +247 -0
- package/src/icons/basic.js +5930 -0
- package/src/icons/basic.stories.js +178 -0
- package/src/icons/effect.js +167 -0
- package/src/icons/general/clock/clock.js +16 -0
- package/src/icons/general/color-handler/background.js +34 -0
- package/src/icons/general/color-handler/text.js +34 -0
- package/src/icons/general/emoji/emoji.js +27 -0
- package/src/icons/general/font-properties/bold.js +17 -0
- package/src/icons/general/font-properties/font-family.js +27 -0
- package/src/icons/general/font-properties/font-size.js +24 -0
- package/src/icons/general/font-properties/italic.js +17 -0
- package/src/icons/general/font-properties/underline.js +26 -0
- package/src/icons/general/hyperlink/hyperlink.js +33 -0
- package/src/icons/general/indent/decrease.js +54 -0
- package/src/icons/general/indent/increase.js +54 -0
- package/src/icons/general/index.js +21 -0
- package/src/icons/general/index.mdx +68 -0
- package/src/icons/general/list/bullets.js +76 -0
- package/src/icons/general/list/numbering.js +69 -0
- package/src/icons/general/picture/picture.js +17 -0
- package/src/icons/general/steps/redo.js +17 -0
- package/src/icons/general/steps/undo.js +17 -0
- package/src/icons/general/text-align/center.js +17 -0
- package/src/icons/general/text-align/justify.js +17 -0
- package/src/icons/general/text-align/left.js +17 -0
- package/src/icons/general/text-align/right.js +17 -0
- package/src/icons/index.js +3 -0
- package/src/icons/index.stories.js +22 -0
- package/src/icons/menu/dhr.js +2625 -0
- package/src/icons/menu/erp.js +513 -0
- package/src/icons/menu/index.js +6 -0
- package/src/icons/menu/index.stories.js +107 -0
- package/src/icons/menu/v2/index.js +77 -0
- package/src/icons/menu/v2/index.stories.js +426 -0
- package/src/locale/index.js +13 -0
- package/src/scss/styles.scss +10 -0
- package/src/styles/animation.js +930 -0
- package/src/styles/animations.js +13 -0
- package/src/styles/color-helper.js +364 -0
- package/src/styles/colors.js +504 -0
- package/src/styles/colors.stories.js +105 -0
- package/src/styles/font.js +26 -0
- package/src/styles/general.js +824 -0
- package/src/styles/sx/index.js +35 -0
- package/src/styles/typography.js +181 -0
- package/src/styles/utils.js +35 -0
- package/src/theme/createBreakpoints.js +95 -0
- package/src/theme/createSpacing.js +12 -0
- package/src/theme/createTheme.js +29 -0
- package/src/theme/createZIndex.js +10 -0
- package/src/theme/docs/breakpoints.md +242 -0
- package/src/theme/docs/colors.md +64 -0
- package/src/theme/docs/components.md +32 -0
- package/src/theme/docs/darkMode.md +20 -0
- package/src/theme/docs/spacing.md +52 -0
- package/src/theme/docs/theming.md +69 -0
- package/src/theme/docs/zIndex.md +27 -0
- package/src/theme/index.js +15 -0
- package/src/theme/make-styles.js +32 -0
- package/src/theme/settings.js +816 -0
- package/src/theme/stories/breakpoints.stories.js +20 -0
- package/src/theme/stories/colors.stories.js +20 -0
- package/src/theme/stories/components.stories.js +20 -0
- package/src/theme/stories/darkMode.stories.js +20 -0
- package/src/theme/stories/spacing.stories.js +20 -0
- package/src/theme/stories/theming.stories.js +20 -0
- package/src/theme/stories/zIndex.stories.js +20 -0
- package/src/theme/theme-provider.js +101 -0
- package/src/theme/theme.js +57 -0
- package/src/theme/use-classes.js +19 -0
- package/src/theme/utils/getThemeProps.js +11 -0
- package/src/theme/utils/resolveProps.js +16 -0
- package/src/theme/utils/useThemeProps.js +8 -0
- package/src/utils/array/array.js +197 -0
- package/src/utils/classNames/index.js +28 -0
- package/src/utils/classNames/index.stories.js +61 -0
- package/src/utils/console.js +30 -0
- package/src/utils/date.js +391 -0
- package/src/utils/error/error.js +65 -0
- package/src/utils/error/errors.js +250 -0
- package/src/utils/getFileType.js +24 -0
- package/src/utils/handleBreakpoints.js +27 -0
- package/src/utils/hexToRGBA/index.js +25 -0
- package/src/utils/hexToRGBA/index.stories.js +43 -0
- package/src/utils/index.js +40 -0
- package/src/utils/intersectionObserver.js +45 -0
- package/src/utils/isMobile/index.js +22 -0
- package/src/utils/isMobile/index.stories.js +49 -0
- package/src/utils/isUndefined.js +3 -0
- package/src/utils/iterator.js +45 -0
- package/src/utils/map-parent.js +49 -0
- package/src/utils/object/deepmerge.js +129 -0
- package/src/utils/object/extend.js +55 -0
- package/src/utils/object/object.js +61 -0
- package/src/utils/parseHTML.js +20 -0
- package/src/utils/promisify.js +37 -0
- package/src/utils/randomString.js +22 -0
- package/src/utils/refMethodType.js +9 -0
- package/src/utils/refType.js +5 -0
- package/src/utils/remove-unicode.js +13 -0
- package/src/utils/render-portal.js +87 -0
- package/src/utils/renderHTML.js +17 -0
- package/src/utils/renderIcon.js +41 -0
- package/src/utils/sb-template.js +115 -0
- package/src/utils/storybook/index.js +1 -0
- package/src/utils/storybook/refArgTypes.js +46 -0
- package/src/utils/string/capitalize.js +6 -0
- package/src/utils/string/capitalizeSentenceCase.js +9 -0
- package/src/utils/string/string.js +83 -0
- package/src/utils/type.js +121 -0
- package/src/utils/updatePosition.js +27 -0
- package/src/utils/useControlled/index.js +23 -0
- package/src/utils/useDelayUnmount.js +17 -0
- package/src/utils/useElementSize.js +59 -0
- package/src/utils/useEventListener.js +54 -0
- package/src/utils/useInput.js +39 -0
- package/src/utils/useMediaQuery/index.js +50 -0
- package/src/utils/useMediaQuery/index.stories.js +55 -0
- package/src/utils/useOnClickOutside.js +28 -0
- package/src/utils/usePortal.js +54 -0
- package/src/utils/validate.js +135 -0
- package/components/accordion/context.js +0 -6
- package/components/accordion/details.js +0 -76
- package/components/accordion/group.js +0 -135
- package/components/accordion/index.js +0 -178
- package/components/accordion/summary.js +0 -324
- package/components/alert/index.js +0 -257
- package/components/alert/notify.js +0 -140
- package/components/avatar/index.js +0 -388
- package/components/badge/index.js +0 -231
- package/components/breadcrumb/index.js +0 -220
- package/components/button/icon.js +0 -357
- package/components/button/index.js +0 -444
- package/components/button/more.js +0 -210
- package/components/button/ripple-effect.js +0 -81
- package/components/card/body.js +0 -76
- package/components/card/extra.js +0 -76
- package/components/card/footer.js +0 -76
- package/components/card/header.js +0 -80
- package/components/card/index.js +0 -203
- package/components/chart/Pie/Circle.js +0 -50
- package/components/chart/Pie/Sector.js +0 -124
- package/components/chart/Pie/Sectors.js +0 -81
- package/components/chart/Pie/index.js +0 -277
- package/components/chart/Pie-v2/Circle.js +0 -48
- package/components/chart/Pie-v2/Sector.js +0 -108
- package/components/chart/Pie-v2/Sectors.js +0 -204
- package/components/chart/Pie-v2/index.js +0 -488
- package/components/chart/bar/Axis.js +0 -67
- package/components/chart/bar/Bar.js +0 -344
- package/components/chart/bar/Grid.js +0 -97
- package/components/chart/bar/Labels.js +0 -162
- package/components/chart/bar/Points.js +0 -94
- package/components/chart/bar/index.js +0 -161
- package/components/chart/bar-v2/Axis.js +0 -67
- package/components/chart/bar-v2/Bar.js +0 -354
- package/components/chart/bar-v2/Grid.js +0 -97
- package/components/chart/bar-v2/Labels.js +0 -162
- package/components/chart/bar-v2/Points.js +0 -94
- package/components/chart/bar-v2/index.js +0 -161
- package/components/chart/line/Axis.js +0 -68
- package/components/chart/line/Grid.js +0 -99
- package/components/chart/line/Labels.js +0 -160
- package/components/chart/line/Path.js +0 -154
- package/components/chart/line/Point.js +0 -343
- package/components/chart/line/Title.js +0 -52
- package/components/chart/line/index.js +0 -199
- package/components/chart/line-v2/Axis.js +0 -66
- package/components/chart/line-v2/Grid.js +0 -97
- package/components/chart/line-v2/Labels.js +0 -160
- package/components/chart/line-v2/Path.js +0 -153
- package/components/chart/line-v2/Point.js +0 -326
- package/components/chart/line-v2/Title.js +0 -52
- package/components/chart/line-v2/index.js +0 -165
- package/components/check-text/index.js +0 -155
- package/components/check-text/interview-confirmation.js +0 -171
- package/components/check-text/interview-status.js +0 -137
- package/components/chip/attach.js +0 -167
- package/components/chip/index.js +0 -275
- package/components/collapse/index.js +0 -93
- package/components/dialogs/colors.js +0 -13
- package/components/divider/index.js +0 -89
- package/components/form-control/attachment/index.js +0 -1537
- package/components/form-control/calendar/function.js +0 -752
- package/components/form-control/calendar/index.js +0 -317
- package/components/form-control/calendar/range.js +0 -291
- package/components/form-control/checkbox/index.js +0 -329
- package/components/form-control/control/index.js +0 -91
- package/components/form-control/date-input/DateField.js +0 -187
- package/components/form-control/date-input/index.js +0 -292
- package/components/form-control/date-input/useDateInputState.js +0 -129
- package/components/form-control/date-input/useIsFocused.js +0 -20
- package/components/form-control/date-input/useKeyboardInputEvent.js +0 -45
- package/components/form-control/date-input/utils.js +0 -290
- package/components/form-control/date-picker/index.js +0 -357
- package/components/form-control/date-range-picker/index.js +0 -1183
- package/components/form-control/dropdown/index.js +0 -1624
- package/components/form-control/dropdown-box/index.js +0 -238
- package/components/form-control/form/context.js +0 -5
- package/components/form-control/form/index.js +0 -40
- package/components/form-control/form-group/index.js +0 -117
- package/components/form-control/helper-text/index.js +0 -88
- package/components/form-control/input-base/UncontrolledInputBase.js +0 -450
- package/components/form-control/input-base/index.js +0 -646
- package/components/form-control/label/index.js +0 -117
- package/components/form-control/money-input/index.js +0 -513
- package/components/form-control/number-input/index.js +0 -582
- package/components/form-control/number-input/index2.js +0 -481
- package/components/form-control/password-input/index.js +0 -242
- package/components/form-control/phone-input/index.js +0 -364
- package/components/form-control/radio/index.js +0 -224
- package/components/form-control/text-input/index.js +0 -239
- package/components/form-control/time-picker/index.js +0 -781
- package/components/form-control/time-picker/swiper.js +0 -540
- package/components/form-control/time-picker/v2/index.js +0 -809
- package/components/form-control/toggle/index.js +0 -222
- package/components/form-view/helper-text.js +0 -33
- package/components/form-view/index.js +0 -95
- package/components/form-view/input.js +0 -117
- package/components/form-view/label.js +0 -37
- package/components/grid/Col.js +0 -91
- package/components/grid/Container.js +0 -85
- package/components/grid/Row.js +0 -81
- package/components/grid/context.js +0 -3
- package/components/grid/index.js +0 -251
- package/components/image/index.js +0 -170
- package/components/index.js +0 -156
- package/components/list/list-item-action.js +0 -82
- package/components/list/list-item-icon.js +0 -71
- package/components/list/list-item-text.js +0 -56
- package/components/list/list-item.js +0 -108
- package/components/list/list.js +0 -149
- package/components/list/sub-header.js +0 -63
- package/components/modal/body.js +0 -74
- package/components/modal/context.js +0 -6
- package/components/modal/footer.js +0 -78
- package/components/modal/header.js +0 -128
- package/components/modal/index.js +0 -63
- package/components/modal/modal.js +0 -292
- package/components/others/extra/index.js +0 -116
- package/components/others/import/index.js +0 -71
- package/components/others/option-wrapper/index.js +0 -39
- package/components/others/scrollbar/index.js +0 -94
- package/components/paging/page-info.js +0 -582
- package/components/paging/page-selector.js +0 -381
- package/components/paper/index.js +0 -112
- package/components/popover/body.js +0 -86
- package/components/popover/footer.js +0 -84
- package/components/popover/header.js +0 -88
- package/components/popover/index.js +0 -663
- package/components/popup/danger_popup.js +0 -189
- package/components/popup/index.js +0 -414
- package/components/popup/v2/index.js +0 -398
- package/components/progress/circular.js +0 -296
- package/components/progress/linear.js +0 -324
- package/components/rating/index.js +0 -243
- package/components/skeleton/index.js +0 -79
- package/components/slider/slider-container.js +0 -340
- package/components/slider/slider-item.js +0 -205
- package/components/status/index.js +0 -111
- package/components/tab/context.js +0 -3
- package/components/tab/tab-container.js +0 -100
- package/components/tab/tab-header.js +0 -160
- package/components/tab/tab-panel.js +0 -91
- package/components/tab/tab.js +0 -210
- package/components/tooltip/index.js +0 -522
- package/components/tooltip/portal.js +0 -11
- package/components/transfer/index.js +0 -434
- package/components/tree-view/index.js +0 -1017
- package/components/typography/index.js +0 -193
- package/css/styles.css +0 -1
- package/css/styles.css.map +0 -1
- package/global/index.js +0 -194
- package/icons/basic.js +0 -7864
- package/icons/effect.js +0 -131
- package/icons/general/clock/clock.js +0 -20
- package/icons/general/color-handler/background.js +0 -40
- package/icons/general/color-handler/text.js +0 -40
- package/icons/general/emoji/emoji.js +0 -34
- package/icons/general/font-properties/bold.js +0 -20
- package/icons/general/font-properties/font-family.js +0 -34
- package/icons/general/font-properties/font-size.js +0 -26
- package/icons/general/font-properties/italic.js +0 -20
- package/icons/general/font-properties/underline.js +0 -30
- package/icons/general/hyperlink/hyperlink.js +0 -37
- package/icons/general/indent/decrease.js +0 -54
- package/icons/general/indent/increase.js +0 -54
- package/icons/general/index.js +0 -21
- package/icons/general/list/bullets.js +0 -76
- package/icons/general/list/numbering.js +0 -70
- package/icons/general/picture/picture.js +0 -20
- package/icons/general/steps/redo.js +0 -20
- package/icons/general/steps/undo.js +0 -20
- package/icons/general/text-align/center.js +0 -20
- package/icons/general/text-align/justify.js +0 -20
- package/icons/general/text-align/left.js +0 -20
- package/icons/general/text-align/right.js +0 -20
- package/icons/index.js +0 -3
- package/icons/menu/dhr.js +0 -2442
- package/icons/menu/erp.js +0 -491
- package/icons/menu/index.js +0 -5
- package/icons/menu/v2/index.js +0 -71
- package/locale/index.js +0 -11
- package/styles/animation.js +0 -848
- package/styles/animations.js +0 -13
- package/styles/color-helper.js +0 -343
- package/styles/colors.js +0 -476
- package/styles/font.js +0 -24
- package/styles/general.js +0 -568
- package/styles/sx/index.js +0 -28
- package/styles/typography.js +0 -156
- package/styles/utils.js +0 -35
- package/theme/createBreakpoints.js +0 -82
- package/theme/createSpacing.js +0 -10
- package/theme/createTheme.js +0 -26
- package/theme/createZIndex.js +0 -9
- package/theme/index.js +0 -14
- package/theme/make-styles.js +0 -30
- package/theme/settings.js +0 -861
- package/theme/theme-provider.js +0 -102
- package/theme/theme.js +0 -57
- package/theme/use-classes.js +0 -15
- package/theme/utils/getThemeProps.js +0 -12
- package/theme/utils/resolveProps.js +0 -17
- package/theme/utils/useThemeProps.js +0 -14
- package/utils/array/array.js +0 -169
- package/utils/classNames/index.js +0 -25
- package/utils/console.js +0 -27
- package/utils/date.js +0 -401
- package/utils/error/error.js +0 -53
- package/utils/error/errors.js +0 -200
- package/utils/getFileType.js +0 -23
- package/utils/handleBreakpoints.js +0 -25
- package/utils/hexToRGBA/index.js +0 -23
- package/utils/index.js +0 -38
- package/utils/intersectionObserver.js +0 -37
- package/utils/isMobile/index.js +0 -21
- package/utils/isUndefined.js +0 -2
- package/utils/iterator.js +0 -36
- package/utils/map-parent.js +0 -46
- package/utils/object/deepmerge.js +0 -103
- package/utils/object/extend.js +0 -47
- package/utils/object/object.js +0 -54
- package/utils/parseHTML.js +0 -18
- package/utils/promisify.js +0 -34
- package/utils/randomString.js +0 -26
- package/utils/refMethodType.js +0 -6
- package/utils/refType.js +0 -5
- package/utils/remove-unicode.js +0 -5
- package/utils/render-portal.js +0 -87
- package/utils/renderHTML.js +0 -18
- package/utils/renderIcon.js +0 -53
- package/utils/sb-template.js +0 -113
- package/utils/storybook/index.js +0 -1
- package/utils/storybook/refArgTypes.js +0 -41
- package/utils/string/capitalize.js +0 -3
- package/utils/string/capitalizeSentenceCase.js +0 -8
- package/utils/string/string.js +0 -60
- package/utils/type.js +0 -69
- package/utils/updatePosition.js +0 -35
- package/utils/useControlled/index.js +0 -14
- package/utils/useDelayUnmount.js +0 -15
- package/utils/useElementSize.js +0 -55
- package/utils/useEventListener.js +0 -51
- package/utils/useInput.js +0 -33
- package/utils/useMediaQuery/index.js +0 -44
- package/utils/useOnClickOutside.js +0 -21
- package/utils/usePortal.js +0 -49
- package/utils/validate.js +0 -135
- /package/{assets → src/assets}/avatar/default.svg +0 -0
- /package/{assets → src/assets}/fonts/SF-Pro-Display-Bold.otf +0 -0
- /package/{assets → src/assets}/fonts/SF-Pro-Display-Medium.otf +0 -0
- /package/{assets → src/assets}/fonts/SF-Pro-Display-Regular.otf +0 -0
- /package/{assets → src/assets}/fonts/text-security-disc-compat.eot +0 -0
- /package/{assets → src/assets}/fonts/text-security-disc-compat.ttf +0 -0
- /package/{assets → src/assets}/fonts/text-security-disc-compat.woff2 +0 -0
- /package/{assets → src/assets}/fonts/text-security-disc.woff2 +0 -0
- /package/{assets → src/assets}/image/default.png +0 -0
- /package/{assets → src/assets}/images/icons/wifi.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F0100.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F1025.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F2000.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F2020.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F2030.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F2040.svg +0 -0
- /package/{assets → src/assets}/images/menu/bem/WA3F2100.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/ALL.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D00.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D09.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D13.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D15.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D21.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D25.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D29.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D38.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D39.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D51.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D52.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D77.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D84.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/D89.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/Default.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR21N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0012.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR29N0013.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0009.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR75N0010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR89N0014.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MAHR89N0015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM00N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1020.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1025.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1030.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1035.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1040.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM09N1400.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM13N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM13N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM13N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM13N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM15N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM25N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM29N0015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM38N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM38N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM38N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0012.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0013.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0014.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0016.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0017.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0018.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0019.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0020.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0021.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0022.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM39N0023.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM51N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM51N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM51N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM77N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM77N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM82N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM82N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM84N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM84N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM89N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRM89N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP00N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0009.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0012.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0013.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0014.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0016.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0017.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0018.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0019.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0020.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0021.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0022.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0023.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0024.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0025.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0026.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0027.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0028.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0029.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0030.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0031.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0032.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0033.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0034.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP09N0035.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP13N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP13N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP13N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP21N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP21N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25L0101.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25L0501.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP25N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0009.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0012.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0013.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0014.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0016.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0017.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0018.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0019.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0020.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0021.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0022.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0023.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0026.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0027.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0028.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0029.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP29N0030.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP38N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP38N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0009.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0013.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0014.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0015.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0017.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0018.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0019.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0020.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N0021.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP39N1222.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP51N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP51N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP51N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP51N0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP52N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP52N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP52N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP75N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP77N0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP77N0008.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP77N0009.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP77N0010.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP77N0011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP89N1000.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/MHRP89N1001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/TASK.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W00F0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W00F0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W00F0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W00F0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W00F0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2000-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2000.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2002-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2005-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2020-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2022-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2150-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2152-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2160-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W09F2162-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W29F4006-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F2260-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F2261-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F3005-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F4070-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F4071-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W75F4100-WEB5.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W77F1011.svg +0 -0
- /package/{assets → src/assets}/images/menu/dhr/W77F1013.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/W00F0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/W00F0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/W00F0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/W00F0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76APP0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76APP0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0005.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0006.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76LIS0007.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76REQ0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76REQ0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76REQ0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WEO76TRA0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WTM76ACC0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WTM76INF0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WTM76PRO0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/eo/WTM76SYS0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/D05.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/D06.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/D90R.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/DBC.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W00F0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W00F0002.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W00F0003.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W00F0004.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0001N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0004N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0006N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0007N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0008N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0011N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F0013N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W05F4000N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0001N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0004N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0005N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0006N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W06F0008N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W94F1000N0000.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/W94F1000N0001.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/WA3F1025.svg +0 -0
- /package/{assets → src/assets}/images/menu/erp/WA3F2100.svg +0 -0
- /package/{assets → src/assets}/storybook/avatar01.svg +0 -0
- /package/{assets → src/assets}/storybook/cover01.svg +0 -0
|
@@ -1,1183 +0,0 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import { css, jsx } from '@emotion/core';
|
|
4
|
-
import { Button, ButtonIcon, Divider, HelperText, InputBase, Label, Typography } from "../..";
|
|
5
|
-
import { getGlobal } from "../../../global";
|
|
6
|
-
import locale from "../../../locale";
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
9
|
-
import { render } from 'react-dom';
|
|
10
|
-
import { bgColor, borderRadius4px, cursorPointer, displayBlock, displayFlex, displayNone, flexCol, flexRow, invisible, justifyEnd, left, parseHeight, parseMaxWidth, parseMinWidth, pointerEventsNone, positionFixed, shadowLarge, textCenter, top, userSelectNone, whiteSpaceNoWrap, z } from "../../../styles/general";
|
|
11
|
-
import { useTheme } from "../../../theme";
|
|
12
|
-
import { capitalizeSentenceCase, classNames, isEqual, date as moment, randomString, updatePosition } from "../../../utils";
|
|
13
|
-
import { generateCalendarCSS, onUpdateNavigator, renderHeader, renderNavigator } from "../calendar/function";
|
|
14
|
-
import ControlComp from "../control";
|
|
15
|
-
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
16
|
-
const toLocalTimestamp = t => {
|
|
17
|
-
if (typeof t === 'object' && t.getTime) {
|
|
18
|
-
t = t.getTime();
|
|
19
|
-
}
|
|
20
|
-
if (typeof t === 'string' && !t.match(/\d{13}/)) {
|
|
21
|
-
t = Date.parse(t).getTime();
|
|
22
|
-
}
|
|
23
|
-
t = parseInt(t, 10) - new Date().getTimezoneOffset() * 60 * 1000;
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
const getDaysFrom1970 = t => {
|
|
27
|
-
return Math.floor(toLocalTimestamp(t) / 86400000);
|
|
28
|
-
};
|
|
29
|
-
const countDays = (start, end, startFromZero) => {
|
|
30
|
-
return Math.abs(getDaysFrom1970(start) - getDaysFrom1970(end)) + (startFromZero ? 0 : 1);
|
|
31
|
-
};
|
|
32
|
-
const formatValue = (value, format, utc = false) => {
|
|
33
|
-
return moment(value).format(format, utc);
|
|
34
|
-
};
|
|
35
|
-
const getDateOfWeek = date => {
|
|
36
|
-
let day = date.getDay();
|
|
37
|
-
if (day === 0) day = 7;
|
|
38
|
-
return day - 1;
|
|
39
|
-
};
|
|
40
|
-
const isValidDate = v => {
|
|
41
|
-
if (!v) return false;
|
|
42
|
-
if (Object.prototype.toString.call(v) === '[object Date]') {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return !isNaN(Date.parse(new Date(v)));
|
|
46
|
-
};
|
|
47
|
-
const isValidValues = v => {
|
|
48
|
-
if (!v || !Array.isArray(v) || v.length !== 2) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
return !!(isValidDate(v[0]) && isValidDate(v[1]) && +moment(v[0]).diff(v[1]) <= 0);
|
|
52
|
-
};
|
|
53
|
-
const isToday = day => {
|
|
54
|
-
return +moment(day).diff(new Date().setHours(0, 0, 0, 0)) === 0 ? unique.day.today : '';
|
|
55
|
-
};
|
|
56
|
-
const isLimit = (day, max, min) => {
|
|
57
|
-
return isBefore(min, day) || isAfter(max, day) ? unique.day.limit : '';
|
|
58
|
-
};
|
|
59
|
-
const isBefore = (min, time) => {
|
|
60
|
-
return min && isValidDate(min) && moment(time).diff(min) < 0;
|
|
61
|
-
};
|
|
62
|
-
const isAfter = (max, time) => {
|
|
63
|
-
return max && isValidDate(max) && moment(time).diff(max) > 0;
|
|
64
|
-
};
|
|
65
|
-
const parseDate = day => {
|
|
66
|
-
return Date.parse(new Date(day));
|
|
67
|
-
};
|
|
68
|
-
const DateRangePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
69
|
-
// props priority: `inProps` > `themeDefaultProps`
|
|
70
|
-
const props = useThemeProps({
|
|
71
|
-
props: inProps,
|
|
72
|
-
name: 'DateRangePicker'
|
|
73
|
-
});
|
|
74
|
-
const {
|
|
75
|
-
action = {},
|
|
76
|
-
actionIconAt,
|
|
77
|
-
clearAble,
|
|
78
|
-
controls,
|
|
79
|
-
defaultValue,
|
|
80
|
-
disabled,
|
|
81
|
-
displayFormat,
|
|
82
|
-
error,
|
|
83
|
-
helperTextProps,
|
|
84
|
-
inputProps,
|
|
85
|
-
inputStyle,
|
|
86
|
-
label,
|
|
87
|
-
labelProps,
|
|
88
|
-
max,
|
|
89
|
-
min,
|
|
90
|
-
onChange,
|
|
91
|
-
onShowTooltip,
|
|
92
|
-
placeholder: placeholderProp,
|
|
93
|
-
pressESCToClose,
|
|
94
|
-
readOnly,
|
|
95
|
-
required,
|
|
96
|
-
returnFormat,
|
|
97
|
-
showUnitCount,
|
|
98
|
-
startFromZero,
|
|
99
|
-
style,
|
|
100
|
-
textAlign,
|
|
101
|
-
unitCount,
|
|
102
|
-
value,
|
|
103
|
-
viewType,
|
|
104
|
-
...other
|
|
105
|
-
} = props;
|
|
106
|
-
const placeholder = placeholderProp !== null && placeholderProp !== void 0 ? placeholderProp : `${displayFormat} - ${displayFormat}`;
|
|
107
|
-
const theme = useTheme();
|
|
108
|
-
const {
|
|
109
|
-
spacing
|
|
110
|
-
} = theme;
|
|
111
|
-
if (!reference) reference = useRef(null);
|
|
112
|
-
const footerRef = useRef(null);
|
|
113
|
-
const iconRef = useRef(null);
|
|
114
|
-
const ipConRef = useRef(null);
|
|
115
|
-
const ipRef = useRef(null);
|
|
116
|
-
const pickerRef = useRef(null);
|
|
117
|
-
const tableFrRef = useRef(null);
|
|
118
|
-
const tableToRef = useRef(null);
|
|
119
|
-
const tooltipRef = useRef(null);
|
|
120
|
-
const ref = useRef(null);
|
|
121
|
-
const tempValues = useRef([]);
|
|
122
|
-
const values = useRef([]);
|
|
123
|
-
const valueFr = useRef(null);
|
|
124
|
-
const valueTo = useRef(null);
|
|
125
|
-
const selected = useRef(0);
|
|
126
|
-
const [, setValues] = useState(Date.now());
|
|
127
|
-
const [, setTempValues] = useState(Date.now());
|
|
128
|
-
const [, setValueFr] = useState(Date.now());
|
|
129
|
-
const [, setValueTo] = useState(Date.now());
|
|
130
|
-
const [, setSelected] = useState(Date.now());
|
|
131
|
-
const [valueState, setValueState] = useState();
|
|
132
|
-
const navigatorFromRefs = {
|
|
133
|
-
doubleLeft: useRef(null),
|
|
134
|
-
doubleRight: useRef(null),
|
|
135
|
-
left: useRef(null),
|
|
136
|
-
right: useRef(null),
|
|
137
|
-
content: useRef(null)
|
|
138
|
-
};
|
|
139
|
-
const navigatorToRefs = {
|
|
140
|
-
doubleLeft: useRef(null),
|
|
141
|
-
doubleRight: useRef(null),
|
|
142
|
-
left: useRef(null),
|
|
143
|
-
right: useRef(null),
|
|
144
|
-
content: useRef(null)
|
|
145
|
-
};
|
|
146
|
-
const isEnable = !readOnly && !disabled;
|
|
147
|
-
const closeText = getGlobal(['close']);
|
|
148
|
-
const cancelText = getGlobal(['cancel']);
|
|
149
|
-
const confirmText = getGlobal(['confirm']);
|
|
150
|
-
const unitText = getGlobal([unitCount]);
|
|
151
|
-
const _ControlContainerCSS = ControlContainerCSS(theme);
|
|
152
|
-
const updateValues = useCallback(v => {
|
|
153
|
-
values.current = v;
|
|
154
|
-
setValues();
|
|
155
|
-
}, [values]);
|
|
156
|
-
const updateTempValues = useCallback(v => {
|
|
157
|
-
tempValues.current = v;
|
|
158
|
-
setTempValues();
|
|
159
|
-
}, [tempValues]);
|
|
160
|
-
const updateSelected = useCallback(v => {
|
|
161
|
-
selected.current = v;
|
|
162
|
-
setSelected();
|
|
163
|
-
}, [selected]);
|
|
164
|
-
const updateValueFr = useCallback(v => {
|
|
165
|
-
valueFr.current = v;
|
|
166
|
-
setValueFr();
|
|
167
|
-
}, [valueFr]);
|
|
168
|
-
const updateValueTo = useCallback(v => {
|
|
169
|
-
valueTo.current = v;
|
|
170
|
-
setValueTo();
|
|
171
|
-
}, [valueTo]);
|
|
172
|
-
const isActive = day => {
|
|
173
|
-
if (values.current[0] && +moment(values.current[0]).diff(day) === 0) {
|
|
174
|
-
if (values.current[1] && +moment(values.current[0]).diff(values.current[1]) < 0) {
|
|
175
|
-
return `${unique.day.from + ' ' + unique.day.active}`;
|
|
176
|
-
} else {
|
|
177
|
-
return unique.day.active;
|
|
178
|
-
}
|
|
179
|
-
} else if (values.current[1] && parseDate(values.current[1]) === parseDate(day)) {
|
|
180
|
-
return `${unique.day.to + ' ' + unique.day.active}`;
|
|
181
|
-
}
|
|
182
|
-
return '';
|
|
183
|
-
};
|
|
184
|
-
const isBetween = dayParsed => {
|
|
185
|
-
if (values.current[0] && values.current[1] && parseDate(values.current[0]) < dayParsed && dayParsed < parseDate(values.current[1])) {
|
|
186
|
-
return unique.day.between;
|
|
187
|
-
}
|
|
188
|
-
return '';
|
|
189
|
-
};
|
|
190
|
-
const countDay = v => {
|
|
191
|
-
if ((v === null || v === void 0 ? void 0 : v.length) === 2) {
|
|
192
|
-
return Number(+moment(v[1]).diff(v[0]) + (startFromZero ? 0 : 1));
|
|
193
|
-
}
|
|
194
|
-
return Number(startFromZero ? 0 : 1);
|
|
195
|
-
};
|
|
196
|
-
const onChangeValue = v => {
|
|
197
|
-
setInputValue(v[0], true);
|
|
198
|
-
setInputValue(v[1], false);
|
|
199
|
-
!!onChange && onChange({
|
|
200
|
-
value: [formatValue(v[0], returnFormat), formatValue(v[1], returnFormat), selected.current]
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
const onDayClick = e => {
|
|
204
|
-
const el = e.currentTarget;
|
|
205
|
-
const v = parseInt(el.dataset.time, 10);
|
|
206
|
-
if (values.current.length === 0) {
|
|
207
|
-
//push
|
|
208
|
-
el.classList.add(unique.day.active);
|
|
209
|
-
updateValues([v]);
|
|
210
|
-
updateSelected(countDay(values.current));
|
|
211
|
-
renderPicker();
|
|
212
|
-
controls ? setButtonState() : onChangeValue([values.current[0], values.current[0]]);
|
|
213
|
-
} else {
|
|
214
|
-
if (values.current.length === 1) {
|
|
215
|
-
if (+moment(values.current[0]).diff(new Date(v)) > 0) {
|
|
216
|
-
//unshift
|
|
217
|
-
el.classList.add(unique.day.active);
|
|
218
|
-
updateValues([v, values.current[0]]);
|
|
219
|
-
updateSelected(countDay(values.current));
|
|
220
|
-
renderPicker();
|
|
221
|
-
controls ? setButtonState() : onChangeValue(values.current);
|
|
222
|
-
} else if (+moment(values.current[0]).diff(new Date(v)) < 0) {
|
|
223
|
-
//push
|
|
224
|
-
el.classList.add(unique.day.active);
|
|
225
|
-
updateValues([values.current[0], v]);
|
|
226
|
-
updateSelected(countDay(values.current));
|
|
227
|
-
renderPicker();
|
|
228
|
-
controls ? setButtonState() : onChangeValue(values.current);
|
|
229
|
-
} else {
|
|
230
|
-
//cancel
|
|
231
|
-
e.preventDefault();
|
|
232
|
-
}
|
|
233
|
-
} else {
|
|
234
|
-
//restart
|
|
235
|
-
pickerRef.current.querySelectorAll(`.${unique.day.active}`).forEach(element => {
|
|
236
|
-
element.classList.remove(unique.day.active, unique.day.from, unique.day.to);
|
|
237
|
-
});
|
|
238
|
-
el.classList.add(unique.day.active);
|
|
239
|
-
updateValues([v]);
|
|
240
|
-
updateSelected(countDay(values.current));
|
|
241
|
-
renderPicker();
|
|
242
|
-
controls ? setButtonState() : onChangeValue([values.current[0], values.current[0]]);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
const renderCalendar = (time, type) => {
|
|
247
|
-
time = new Date(time);
|
|
248
|
-
const firstDay = new Date(new Date(time).setDate(1)),
|
|
249
|
-
lastDay = new Date(firstDay.getFullYear(), firstDay.getMonth() + 1, 0),
|
|
250
|
-
prevDay = new Date(firstDay.getFullYear(), firstDay.getMonth(), 0),
|
|
251
|
-
lastDate = lastDay.getDate(),
|
|
252
|
-
prevDate = prevDay.getDate();
|
|
253
|
-
let tableBody = [],
|
|
254
|
-
tableRaw = [],
|
|
255
|
-
tableData = [],
|
|
256
|
-
weekDateFirst = getDateOfWeek(firstDay),
|
|
257
|
-
weekDateLast = getDateOfWeek(lastDay);
|
|
258
|
-
/**
|
|
259
|
-
* days of previous month
|
|
260
|
-
*/
|
|
261
|
-
for (let i = weekDateFirst; i > 0; i--) {
|
|
262
|
-
const day = Date.parse(new Date(time.getFullYear(), time.getMonth(), 1));
|
|
263
|
-
tableData.push(jsx("td", {
|
|
264
|
-
key: `previous_month-${prevDate - i + 1}`,
|
|
265
|
-
"data-time": day - 1,
|
|
266
|
-
className: classNames(unique.table.data, 'previous_month', isBetween(day - 1), 'empty')
|
|
267
|
-
}, jsx("span", {
|
|
268
|
-
className: unique.day.day
|
|
269
|
-
})));
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* days of current month
|
|
273
|
-
*/
|
|
274
|
-
for (let i = 0; i < lastDate; i++) {
|
|
275
|
-
const day = new Date(time.getFullYear(), time.getMonth(), i + 1);
|
|
276
|
-
tableData.push(jsx("td", {
|
|
277
|
-
key: `this_month-${i + 1}`,
|
|
278
|
-
"data-time": Date.parse(day),
|
|
279
|
-
className: classNames(unique.table.data, 'this_month', isToday(day), isActive(day), (max || min) && isLimit(day, new Date(max).setHours(0, 0, 0, 0), new Date(min).setHours(0, 0, 0, 0)), isBetween(Date.parse(day))),
|
|
280
|
-
onClick: onDayClick
|
|
281
|
-
}, jsx(Typography, {
|
|
282
|
-
className: unique.day.day,
|
|
283
|
-
color: 'inherit',
|
|
284
|
-
style: {
|
|
285
|
-
alignItems: 'center',
|
|
286
|
-
borderRadius: '50%',
|
|
287
|
-
display: 'flex',
|
|
288
|
-
height: 24,
|
|
289
|
-
justifyContent: 'center',
|
|
290
|
-
margin: 'auto',
|
|
291
|
-
pointerEvents: 'none',
|
|
292
|
-
transition: 'background-color 150ms linear',
|
|
293
|
-
width: 24
|
|
294
|
-
},
|
|
295
|
-
type: 'h6'
|
|
296
|
-
}, i + 1)));
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* days of next month
|
|
300
|
-
*/
|
|
301
|
-
for (let i = 0; i < 13 - weekDateLast; i++) {
|
|
302
|
-
const day = Date.parse(new Date(time.getFullYear(), time.getMonth() + 1, 0));
|
|
303
|
-
tableData.push(jsx("td", {
|
|
304
|
-
key: `next_month-${i + 1}`,
|
|
305
|
-
"data-time": i < 6 - weekDateLast && day + 1,
|
|
306
|
-
className: classNames(unique.table.data, 'next_month', i < 6 - weekDateLast && isBetween(day + 1), 'empty')
|
|
307
|
-
}, jsx("span", {
|
|
308
|
-
className: unique.day.day
|
|
309
|
-
})));
|
|
310
|
-
}
|
|
311
|
-
for (let i = 0; i < 6; i++) {
|
|
312
|
-
for (let j = 0; j < 7; j++) {
|
|
313
|
-
tableRaw.push(tableData[7 * i + j] || jsx("td", {
|
|
314
|
-
key: 7 * i + j,
|
|
315
|
-
className: classNames(unique.table.data, 'next_month')
|
|
316
|
-
}));
|
|
317
|
-
}
|
|
318
|
-
tableBody.push(jsx("tr", {
|
|
319
|
-
key: i,
|
|
320
|
-
className: unique.day.week
|
|
321
|
-
}, tableRaw));
|
|
322
|
-
tableRaw = [];
|
|
323
|
-
}
|
|
324
|
-
if (type === 'from') {
|
|
325
|
-
onUpdateNavigator(time, navigatorFromRefs);
|
|
326
|
-
if (tableFrRef.current) {
|
|
327
|
-
tableFrRef.current.querySelector('tbody').remove();
|
|
328
|
-
render(tableBody, tableFrRef.current.appendChild(document.createElement('tbody')));
|
|
329
|
-
}
|
|
330
|
-
} else if (type === 'to') {
|
|
331
|
-
onUpdateNavigator(time, navigatorToRefs);
|
|
332
|
-
if (tableToRef.current) {
|
|
333
|
-
tableToRef.current.querySelector('tbody').remove();
|
|
334
|
-
render(tableBody, tableToRef.current.appendChild(document.createElement('tbody')));
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
const updateFromTo = (times = [new Date(), new Date()]) => {
|
|
339
|
-
const timeFr = new Date(times[0]);
|
|
340
|
-
const timeTo = new Date(times[1]);
|
|
341
|
-
const isSameMonth = timeFr.getMonth() === timeTo.getMonth();
|
|
342
|
-
const from = new Date(timeFr.getFullYear(), timeFr.getMonth());
|
|
343
|
-
// const to = new Date(timeTo.getFullYear(), timeTo.getMonth());
|
|
344
|
-
const to = isSameMonth ? new Date(timeTo.getFullYear(), +moment(timeTo).diff(timeFr, 'months') === 0 ? timeTo.getMonth() + 1 : timeTo.getMonth()) : new Date(timeTo.getFullYear(), timeTo.getMonth());
|
|
345
|
-
updateValueFr(from);
|
|
346
|
-
updateValueTo(to);
|
|
347
|
-
};
|
|
348
|
-
const update = v => {
|
|
349
|
-
if (v) {
|
|
350
|
-
if (isValidValues(v)) {
|
|
351
|
-
updateValues([new Date(v[0]).setHours(0, 0, 0, 0), new Date(v[1]).setHours(0, 0, 0, 0)]);
|
|
352
|
-
updateSelected(countDay(values.current));
|
|
353
|
-
updateFromTo(values.current);
|
|
354
|
-
setInputValue(values.current[0], true);
|
|
355
|
-
setInputValue(values.current[1], false);
|
|
356
|
-
} else {
|
|
357
|
-
updateValues([]);
|
|
358
|
-
updateFromTo([new Date(), new Date(new Date().getFullYear(), new Date().getMonth() + 1)]);
|
|
359
|
-
}
|
|
360
|
-
} else {
|
|
361
|
-
updateValues([new Date().setHours(0, 0, 0, 0), new Date().setHours(0, 0, 0, 0)]);
|
|
362
|
-
updateSelected(0);
|
|
363
|
-
updateFromTo(values.current);
|
|
364
|
-
// setInputValue(values.current[0], true);
|
|
365
|
-
// setInputValue(values.current[1], false);
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
const getPickerStyle = anchor => {
|
|
369
|
-
const {
|
|
370
|
-
innerHeight,
|
|
371
|
-
innerWidth
|
|
372
|
-
} = window;
|
|
373
|
-
const {
|
|
374
|
-
left,
|
|
375
|
-
height,
|
|
376
|
-
top
|
|
377
|
-
} = anchor instanceof Element ? anchor.getBoundingClientRect() : ref.current.getBoundingClientRect();
|
|
378
|
-
const pickerHeight = innerWidth < 567 ? controls ? 550 : 495 : controls ? 310 : 256;
|
|
379
|
-
let style = {};
|
|
380
|
-
style.left = left;
|
|
381
|
-
style.top = top + height + 4;
|
|
382
|
-
style.transformOrigin = '50% 20%';
|
|
383
|
-
if (style.top + pickerHeight > innerHeight) {
|
|
384
|
-
if (top > pickerHeight) {
|
|
385
|
-
style.top = innerHeight - pickerHeight - 4;
|
|
386
|
-
style.transformOrigin = '50% 80%';
|
|
387
|
-
} else {
|
|
388
|
-
style.top = Math.round((innerHeight - pickerHeight - 16) / 2);
|
|
389
|
-
style.transformOrigin = 'center';
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
const pickerWidth = window.innerWidth <= 633 ? 300 : 633;
|
|
393
|
-
if (left + pickerWidth > innerWidth) {
|
|
394
|
-
if (innerWidth > pickerWidth) {
|
|
395
|
-
style.left = (innerWidth - pickerWidth) / 2;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
return pickerCSS.picker(style).styles;
|
|
399
|
-
};
|
|
400
|
-
const clearDayHovering = arr => {
|
|
401
|
-
if (values.current.length !== 2) {
|
|
402
|
-
for (let i in arr) {
|
|
403
|
-
arr[i].classList.remove(unique.day.from, unique.day.to, unique.day.between);
|
|
404
|
-
}
|
|
405
|
-
tooltipRef.current.style.visibility = 'hidden';
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
const createBackground = () => {
|
|
409
|
-
let background = document.getElementById(unique.backGr);
|
|
410
|
-
if (!background) {
|
|
411
|
-
background = document.createElement('div');
|
|
412
|
-
background.id = unique.backGr;
|
|
413
|
-
background.classList.add(unique.portal, unique.backGr);
|
|
414
|
-
document.body.appendChild(background);
|
|
415
|
-
}
|
|
416
|
-
background.style.cssText = pickerCSS.backGr(theme);
|
|
417
|
-
return background;
|
|
418
|
-
};
|
|
419
|
-
const createPicker = anchor => {
|
|
420
|
-
const picker = document.createElement('div');
|
|
421
|
-
picker.id = unique.picker;
|
|
422
|
-
picker.style.cssText = getPickerStyle(anchor);
|
|
423
|
-
return picker;
|
|
424
|
-
};
|
|
425
|
-
const setPrevTime = (e, level, time, type) => {
|
|
426
|
-
if (!valueFr.current || !time) return;
|
|
427
|
-
const firstDayOfMin = min && new Date(new Date(min).setDate(1)).setHours(0, 0, 0, 0);
|
|
428
|
-
const firstDayOfTime = new Date(new Date(time).setDate(1)).setHours(0, 0, 0, 0);
|
|
429
|
-
if (level === 'month') {
|
|
430
|
-
if (firstDayOfMin) {
|
|
431
|
-
if (type === 'to' && getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMin) < 59) {
|
|
432
|
-
e.currentTarget.disabled = true;
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
if (getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMin) < 28) {
|
|
436
|
-
e.currentTarget.disabled = true;
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
time.setMonth(time.getMonth() - 1);
|
|
441
|
-
renderCalendar(time, type);
|
|
442
|
-
}
|
|
443
|
-
if (level === 'year') {
|
|
444
|
-
if (firstDayOfMin) {
|
|
445
|
-
if (type === 'to' && getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMin) < 396) {
|
|
446
|
-
e.currentTarget.disabled = true;
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
if (getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMin) < 365) {
|
|
450
|
-
e.currentTarget.disabled = true;
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
time.setFullYear(time.getFullYear() - 1);
|
|
455
|
-
renderCalendar(time, type);
|
|
456
|
-
}
|
|
457
|
-
if (type === 'to') {
|
|
458
|
-
if (+moment(time).diff(valueFr.current, 'months') < 1) {
|
|
459
|
-
valueFr.current.setFullYear(time.getFullYear());
|
|
460
|
-
valueFr.current.setMonth(time.getMonth() - 1);
|
|
461
|
-
renderCalendar(valueFr.current, 'from');
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
const setNextTime = (e, level, time, type) => {
|
|
466
|
-
if (!valueTo.current || !time) return;
|
|
467
|
-
const firstDayOfMax = max && new Date(new Date(max).setDate(1)).setHours(0, 0, 0, 0);
|
|
468
|
-
const firstDayOfTime = new Date(new Date(time).setDate(1)).setHours(0, 0, 0, 0);
|
|
469
|
-
if (level === 'month') {
|
|
470
|
-
if (firstDayOfMax) {
|
|
471
|
-
if (type === 'from' && getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMax) > -59) {
|
|
472
|
-
e.currentTarget.disabled = true;
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
if (getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMax) > -28) {
|
|
476
|
-
e.currentTarget.disabled = true;
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
time.setMonth(time.getMonth() + 1);
|
|
481
|
-
renderCalendar(time, type);
|
|
482
|
-
}
|
|
483
|
-
if (level === 'year') {
|
|
484
|
-
if (firstDayOfMax) {
|
|
485
|
-
if (type === 'from' && getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMax) > -396) {
|
|
486
|
-
e.currentTarget.disabled = true;
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
if (getDaysFrom1970(firstDayOfTime) - getDaysFrom1970(firstDayOfMax) > -365) {
|
|
490
|
-
e.currentTarget.disabled = true;
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
time.setFullYear(time.getFullYear() + 1);
|
|
495
|
-
renderCalendar(time, type);
|
|
496
|
-
}
|
|
497
|
-
if (type === 'from') {
|
|
498
|
-
if (+moment(time).diff(valueTo.current, 'months') >= 0) {
|
|
499
|
-
valueTo.current.setFullYear(time.getFullYear());
|
|
500
|
-
valueTo.current.setMonth(time.getMonth() + 1);
|
|
501
|
-
renderCalendar(valueTo.current, 'to');
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
const setButtonState = () => {
|
|
506
|
-
const isVisible = isEqual(values.current, tempValues.current);
|
|
507
|
-
const query = function (selector) {
|
|
508
|
-
return footerRef.current.querySelector(selector);
|
|
509
|
-
};
|
|
510
|
-
const close = query(`.${unique.close}`);
|
|
511
|
-
const cancel = query(`.${unique.cancel}`);
|
|
512
|
-
const confirm = query(`.${unique.confirm}`);
|
|
513
|
-
const hidden = {
|
|
514
|
-
display: 'none',
|
|
515
|
-
visibility: 'hidden'
|
|
516
|
-
};
|
|
517
|
-
const visible = {
|
|
518
|
-
display: 'inline-flex',
|
|
519
|
-
visibility: 'visible'
|
|
520
|
-
};
|
|
521
|
-
if (isVisible) {
|
|
522
|
-
Object.assign(close.style, visible);
|
|
523
|
-
Object.assign(cancel.style, hidden);
|
|
524
|
-
Object.assign(confirm.style, hidden);
|
|
525
|
-
} else {
|
|
526
|
-
Object.assign(cancel.style, visible);
|
|
527
|
-
Object.assign(confirm.style, visible);
|
|
528
|
-
Object.assign(close.style, hidden);
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
const onCancel = () => {
|
|
532
|
-
updateValues(tempValues.current);
|
|
533
|
-
setButtonState();
|
|
534
|
-
closePicker();
|
|
535
|
-
};
|
|
536
|
-
const onConfirm = () => {
|
|
537
|
-
setButtonState();
|
|
538
|
-
if (values.current.length === 1) {
|
|
539
|
-
onChangeValue([values.current[0], values.current[0]]);
|
|
540
|
-
} else {
|
|
541
|
-
onChangeValue(values.current);
|
|
542
|
-
}
|
|
543
|
-
closePicker();
|
|
544
|
-
};
|
|
545
|
-
const onSwap = open => {
|
|
546
|
-
if (!isEnable) return;
|
|
547
|
-
const t = iconRef.current.childNodes[+open];
|
|
548
|
-
if (open) {
|
|
549
|
-
Object.assign(t.style, {
|
|
550
|
-
...hiddenStyle
|
|
551
|
-
});
|
|
552
|
-
Object.assign(t.previousSibling.style, {
|
|
553
|
-
...activeStyle
|
|
554
|
-
});
|
|
555
|
-
setTimeout(() => {
|
|
556
|
-
t.previousSibling.style.pointerEvents = null;
|
|
557
|
-
}, 200);
|
|
558
|
-
} else {
|
|
559
|
-
Object.assign(t.style, {
|
|
560
|
-
...hiddenStyle
|
|
561
|
-
});
|
|
562
|
-
Object.assign(t.nextSibling.style, {
|
|
563
|
-
...activeStyle
|
|
564
|
-
});
|
|
565
|
-
setTimeout(() => {
|
|
566
|
-
t.nextSibling.style.pointerEvents = null;
|
|
567
|
-
}, 200);
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
const onScroll = () => {
|
|
571
|
-
const node = document.getElementById(unique.picker);
|
|
572
|
-
if (!ipConRef.current || !node) {
|
|
573
|
-
window.removeEventListener('scroll', onScroll);
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
updatePosition(ipConRef.current, node, closePicker);
|
|
577
|
-
};
|
|
578
|
-
const onResize = () => {
|
|
579
|
-
if (!ref.current) return;
|
|
580
|
-
const {
|
|
581
|
-
width
|
|
582
|
-
} = ref.current.getBoundingClientRect();
|
|
583
|
-
const node = document.getElementById(unique.picker);
|
|
584
|
-
if (node) {
|
|
585
|
-
node.style.width = width + 'px';
|
|
586
|
-
}
|
|
587
|
-
onScroll();
|
|
588
|
-
};
|
|
589
|
-
const onDayHover = (e, arr) => {
|
|
590
|
-
const currentTime = parseInt(e.target.dataset.time, 10);
|
|
591
|
-
let tooltipContent = '';
|
|
592
|
-
if (e.target.classList.contains(unique.day.limit)) return;
|
|
593
|
-
for (let i in arr) {
|
|
594
|
-
const time = parseInt(arr[i].dataset.time, 10);
|
|
595
|
-
if (values.current[0] && !values.current[1]) {
|
|
596
|
-
const firstValue = Number(values.current[0]);
|
|
597
|
-
if (firstValue <= time && currentTime >= time && currentTime !== firstValue) {
|
|
598
|
-
if (time === firstValue) {
|
|
599
|
-
arr[i].classList.remove(unique.day.between, unique.day.to);
|
|
600
|
-
arr[i].classList.add(unique.day.from);
|
|
601
|
-
} else if (currentTime === time) {
|
|
602
|
-
arr[i].classList.remove(unique.day.between, unique.day.from);
|
|
603
|
-
arr[i].classList.add(unique.day.to);
|
|
604
|
-
} else {
|
|
605
|
-
arr[i].classList.remove(unique.day.to, unique.day.from);
|
|
606
|
-
arr[i].classList.add(unique.day.between);
|
|
607
|
-
}
|
|
608
|
-
} else if (firstValue >= time && currentTime <= time && currentTime !== firstValue) {
|
|
609
|
-
if (time === firstValue) {
|
|
610
|
-
arr[i].classList.remove(unique.day.between, unique.day.from);
|
|
611
|
-
arr[i].classList.add(unique.day.to);
|
|
612
|
-
} else if (currentTime === time) {
|
|
613
|
-
arr[i].classList.remove(unique.day.between, unique.day.to);
|
|
614
|
-
arr[i].classList.add(unique.day.from);
|
|
615
|
-
} else {
|
|
616
|
-
arr[i].classList.remove(unique.day.to, unique.day.from);
|
|
617
|
-
arr[i].classList.add(unique.day.between);
|
|
618
|
-
}
|
|
619
|
-
} else {
|
|
620
|
-
arr[i].classList.remove(unique.day.to, unique.day.from, unique.day.between);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
if (values.current[0] && !values.current[1]) {
|
|
625
|
-
const dates = Math.abs(countDays(new Date(values.current), new Date(currentTime), startFromZero));
|
|
626
|
-
const tooltip = tooltipRef.current;
|
|
627
|
-
if (onShowTooltip && dates > 0) {
|
|
628
|
-
tooltipContent = dates + ' ' + unitText;
|
|
629
|
-
}
|
|
630
|
-
if (tooltipContent) {
|
|
631
|
-
const tooltipBounding = tooltip.getBoundingClientRect();
|
|
632
|
-
const dayBounding = e.target.getBoundingClientRect();
|
|
633
|
-
const pickerBounding = pickerRef.current.getBoundingClientRect();
|
|
634
|
-
tooltip.style.visibility = 'visible';
|
|
635
|
-
let left = dayBounding.left - pickerBounding.left + dayBounding.width / 2 - tooltipBounding.width / 2 + 'px';
|
|
636
|
-
let top = dayBounding.top - pickerBounding.top - 4 - tooltipBounding.height + 'px';
|
|
637
|
-
tooltip.childNodes[0].textContent = tooltipContent;
|
|
638
|
-
setTimeout(() => {
|
|
639
|
-
tooltip.style.left = left;
|
|
640
|
-
tooltip.style.top = top;
|
|
641
|
-
}, 10);
|
|
642
|
-
} else {
|
|
643
|
-
tooltipRef.current.style.visibility = 'hidden';
|
|
644
|
-
}
|
|
645
|
-
} else {
|
|
646
|
-
tooltipRef.current.style.visibility = 'hidden';
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
const onPickerHover = (e, arr) => {
|
|
650
|
-
arr = Array.from(arr);
|
|
651
|
-
if (e.target.tagName && e.target.tagName.toLowerCase() === 'td') {
|
|
652
|
-
onDayHover(e, arr);
|
|
653
|
-
} else {
|
|
654
|
-
clearDayHovering(arr);
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
const pressESCHandler = event => {
|
|
658
|
-
if (event.key === 'Escape') {
|
|
659
|
-
onClickOutside({
|
|
660
|
-
target: null
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
const renderPicker = () => {
|
|
665
|
-
renderCalendar(valueFr.current, 'from');
|
|
666
|
-
renderCalendar(valueTo.current, 'to');
|
|
667
|
-
};
|
|
668
|
-
const openPicker = anchor => {
|
|
669
|
-
const backGr = createBackground();
|
|
670
|
-
const picker = createPicker(anchor);
|
|
671
|
-
render(pickerComp, backGr.appendChild(picker));
|
|
672
|
-
const arr = pickerRef.current.getElementsByTagName('td');
|
|
673
|
-
updateTempValues(values.current.length === 1 ? [values.current[0], values.current[0]] : values.current);
|
|
674
|
-
setTimeout(() => {
|
|
675
|
-
Object.assign(picker.style, {
|
|
676
|
-
...pickerCSS.active
|
|
677
|
-
});
|
|
678
|
-
renderPicker();
|
|
679
|
-
pickerRef.current.addEventListener('mouseover', e => onPickerHover(e, arr));
|
|
680
|
-
window.addEventListener('resize', onResize);
|
|
681
|
-
window.addEventListener('scroll', onScroll);
|
|
682
|
-
document.addEventListener('mousedown', onClickOutside);
|
|
683
|
-
if (pressESCToClose) {
|
|
684
|
-
document.addEventListener('keydown', pressESCHandler);
|
|
685
|
-
}
|
|
686
|
-
controls && setButtonState();
|
|
687
|
-
});
|
|
688
|
-
};
|
|
689
|
-
const closePicker = () => {
|
|
690
|
-
const backGr = document.getElementById(unique.backGr);
|
|
691
|
-
if (!backGr) return;
|
|
692
|
-
const picker = backGr.querySelector(`#${unique.picker}`);
|
|
693
|
-
if (!picker) return;
|
|
694
|
-
Object.assign(picker.style, {
|
|
695
|
-
...pickerCSS.remove
|
|
696
|
-
});
|
|
697
|
-
if (pressESCToClose) {
|
|
698
|
-
document.removeEventListener('keydown', pressESCHandler);
|
|
699
|
-
}
|
|
700
|
-
document.removeEventListener('mousedown', onClickOutside);
|
|
701
|
-
window.removeEventListener('scroll', onScroll);
|
|
702
|
-
window.removeEventListener('resize', onResize);
|
|
703
|
-
setTimeout(() => {
|
|
704
|
-
backGr.remove();
|
|
705
|
-
}, 200);
|
|
706
|
-
pickerRef.current && pickerRef.current.removeEventListener('mouseover', onPickerHover);
|
|
707
|
-
if (ipConRef.current) {
|
|
708
|
-
ipConRef.current.classList.remove(unique.focus);
|
|
709
|
-
ipConRef.current.style.zIndex = null;
|
|
710
|
-
}
|
|
711
|
-
ipRef.current && ipRef.current.blur();
|
|
712
|
-
updateTempValues([]);
|
|
713
|
-
};
|
|
714
|
-
const onClickOutside = e => {
|
|
715
|
-
if (ipConRef.current && !ipConRef.current.contains(e.target) && ipRef.current && !ipRef.current.contains(e.target) && pickerRef.current && !pickerRef.current.contains(e.target)) {
|
|
716
|
-
controls ? onCancel() : closePicker();
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
const triggerFocus = () => {
|
|
720
|
-
if (!ipConRef.current.classList.contains(unique.focus)) {
|
|
721
|
-
ipRef.current.focus();
|
|
722
|
-
} else {
|
|
723
|
-
onClickOutside({
|
|
724
|
-
target: null
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
const onInputFocus = () => {
|
|
729
|
-
if (!isEnable) return;
|
|
730
|
-
const el = ipConRef.current;
|
|
731
|
-
if (!el.classList.contains(unique.focus)) {
|
|
732
|
-
el.classList.add(unique.focus);
|
|
733
|
-
openPicker();
|
|
734
|
-
}
|
|
735
|
-
};
|
|
736
|
-
const setInputValue = (time, reset, unshift = false) => {
|
|
737
|
-
if (!ipRef.current) return;
|
|
738
|
-
const el = ipRef.current;
|
|
739
|
-
let enUnitText = locale.get() === 'en' && selected.current > 1 ? unitText + 's' : unitText;
|
|
740
|
-
let tempValue;
|
|
741
|
-
if (!reset) {
|
|
742
|
-
if (unshift) {
|
|
743
|
-
tempValue = formatValue(time, displayFormat) + ' - ' + el.value + (showUnitCount ? ` (${selected.current} ${enUnitText})` : '');
|
|
744
|
-
} else {
|
|
745
|
-
tempValue = el.value + ' - ' + formatValue(time, displayFormat) + (showUnitCount ? ` (${selected.current} ${enUnitText})` : '');
|
|
746
|
-
}
|
|
747
|
-
} else {
|
|
748
|
-
tempValue = formatValue(time, displayFormat);
|
|
749
|
-
}
|
|
750
|
-
el.value = capitalizeSentenceCase(tempValue);
|
|
751
|
-
setValueState(capitalizeSentenceCase(tempValue));
|
|
752
|
-
clearAble && onSwap(false);
|
|
753
|
-
};
|
|
754
|
-
const onClear = () => {
|
|
755
|
-
if (!clearAble || !ipRef.current) return;
|
|
756
|
-
ipRef.current.value = '';
|
|
757
|
-
updateValues([]);
|
|
758
|
-
const e = {
|
|
759
|
-
value: null
|
|
760
|
-
};
|
|
761
|
-
!!onChange && onChange(e);
|
|
762
|
-
onSwap(true);
|
|
763
|
-
};
|
|
764
|
-
useEffect(() => {
|
|
765
|
-
update(defaultValue);
|
|
766
|
-
return () => {
|
|
767
|
-
closePicker();
|
|
768
|
-
};
|
|
769
|
-
}, []);
|
|
770
|
-
useEffect(() => {
|
|
771
|
-
if (value) {
|
|
772
|
-
update(value);
|
|
773
|
-
closePicker();
|
|
774
|
-
}
|
|
775
|
-
}, [value]);
|
|
776
|
-
useEffect(() => {
|
|
777
|
-
if (!readOnly) {
|
|
778
|
-
ipRef.current.addEventListener('focus', onInputFocus);
|
|
779
|
-
}
|
|
780
|
-
return () => {
|
|
781
|
-
if (!ipRef.current) return;
|
|
782
|
-
if (!readOnly) {
|
|
783
|
-
ipRef.current.removeEventListener('focus', onInputFocus);
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
}, [readOnly, onChange]);
|
|
787
|
-
useEffect(() => {
|
|
788
|
-
if (min) {
|
|
789
|
-
let arr = [];
|
|
790
|
-
const newMin = new Date(min).setHours(0, 0, 0, 0);
|
|
791
|
-
if (isBefore(newMin, values.current[0])) {
|
|
792
|
-
arr.push(newMin);
|
|
793
|
-
if (isBefore(newMin, values.current[1])) {
|
|
794
|
-
arr.push(newMin);
|
|
795
|
-
} else {
|
|
796
|
-
arr.push(values.current[1]);
|
|
797
|
-
}
|
|
798
|
-
update(arr);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
if (max) {
|
|
802
|
-
let arr = [];
|
|
803
|
-
const newMax = max && new Date(max).setHours(0, 0, 0, 0);
|
|
804
|
-
if (isAfter(newMax, values.current[1])) {
|
|
805
|
-
arr.push(newMax);
|
|
806
|
-
if (isAfter(newMax, values.current[0])) {
|
|
807
|
-
arr.push(newMax);
|
|
808
|
-
} else {
|
|
809
|
-
arr.unshift(values.current[0]);
|
|
810
|
-
}
|
|
811
|
-
update(arr);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
}, [max, min]);
|
|
815
|
-
useEffect(() => {
|
|
816
|
-
if (ipRef.current.value !== '') {
|
|
817
|
-
update(values.current);
|
|
818
|
-
}
|
|
819
|
-
if (isEnable) {
|
|
820
|
-
closePicker();
|
|
821
|
-
}
|
|
822
|
-
return () => {
|
|
823
|
-
if (!iconRef.current || !ipRef.current) return;
|
|
824
|
-
closePicker();
|
|
825
|
-
};
|
|
826
|
-
}, [actionIconAt, clearAble, controls, disabled, displayFormat, max, min, pressESCToClose, readOnly, startFromZero, unitCount, viewType]);
|
|
827
|
-
useImperativeHandle(reference, () => {
|
|
828
|
-
const currentRef = ref.current || {};
|
|
829
|
-
currentRef.element = ref.current;
|
|
830
|
-
currentRef.get = ref.current;
|
|
831
|
-
const _instance = {
|
|
832
|
-
show: el => openPicker(el),
|
|
833
|
-
close: closePicker,
|
|
834
|
-
...action
|
|
835
|
-
}; // methods
|
|
836
|
-
_instance.__proto__ = {}; // hidden methods
|
|
837
|
-
currentRef.instance = _instance;
|
|
838
|
-
return currentRef;
|
|
839
|
-
});
|
|
840
|
-
const iconComp = isEnable ? jsx("div", {
|
|
841
|
-
css: IconAreaCSS,
|
|
842
|
-
ref: iconRef
|
|
843
|
-
}, jsx(ButtonIcon, {
|
|
844
|
-
viewType: 'ghost',
|
|
845
|
-
onClick: triggerFocus,
|
|
846
|
-
className: `${unique.icon} ${unique.icon}-accept`,
|
|
847
|
-
viewBox: true,
|
|
848
|
-
name: 'Calendar'
|
|
849
|
-
}), jsx(ButtonIcon, {
|
|
850
|
-
viewType: 'ghost',
|
|
851
|
-
onClick: onClear,
|
|
852
|
-
className: `${unique.icon} ${unique.icon}-cancel`,
|
|
853
|
-
viewBox: true,
|
|
854
|
-
name: 'Close'
|
|
855
|
-
})) : null;
|
|
856
|
-
const endIcon = actionIconAt === 'end' && iconComp;
|
|
857
|
-
const startIcon = actionIconAt === 'start' && iconComp;
|
|
858
|
-
const footerMemo = jsx("div", {
|
|
859
|
-
css: _ControlContainerCSS,
|
|
860
|
-
className: unique.footer,
|
|
861
|
-
ref: footerRef
|
|
862
|
-
}, jsx(Button, {
|
|
863
|
-
...buttonProps(theme),
|
|
864
|
-
className: unique.close,
|
|
865
|
-
onClick: () => onClickOutside({
|
|
866
|
-
target: null
|
|
867
|
-
})
|
|
868
|
-
}, closeText), jsx(Button, {
|
|
869
|
-
...buttonProps(theme),
|
|
870
|
-
className: unique.cancel,
|
|
871
|
-
onClick: onCancel
|
|
872
|
-
}, cancelText), jsx(Button, {
|
|
873
|
-
...buttonProps(theme),
|
|
874
|
-
color: 'info',
|
|
875
|
-
className: unique.confirm,
|
|
876
|
-
onClick: onConfirm
|
|
877
|
-
}, confirmText));
|
|
878
|
-
const leftCalendarComp = jsx("div", {
|
|
879
|
-
css: generateCalendarCSS(unique, false, false, theme)
|
|
880
|
-
}, renderNavigator(unique, navigatorFromRefs, e => setPrevTime(e, 'year', valueFr.current, 'from'), e => setPrevTime(e, 'month', valueFr.current, 'from'), e => setNextTime(e, 'month', valueFr.current, 'from'), e => setNextTime(e, 'year', valueFr.current, 'from')), jsx("div", {
|
|
881
|
-
className: unique.table.container
|
|
882
|
-
}, jsx("table", {
|
|
883
|
-
className: unique.table.table,
|
|
884
|
-
ref: tableFrRef
|
|
885
|
-
}, renderHeader(unique), jsx("tbody", null))));
|
|
886
|
-
const rightCalendarComp = jsx("div", {
|
|
887
|
-
css: generateCalendarCSS(unique, false, false, theme)
|
|
888
|
-
}, renderNavigator(unique, navigatorToRefs, e => setPrevTime(e, 'year', valueTo.current, 'to'), e => setPrevTime(e, 'month', valueTo.current, 'to'), e => setNextTime(e, 'month', valueTo.current, 'to'), e => setNextTime(e, 'year', valueTo.current, 'to')), jsx("div", {
|
|
889
|
-
className: unique.table.container
|
|
890
|
-
}, jsx("table", {
|
|
891
|
-
className: unique.table.table,
|
|
892
|
-
ref: tableToRef
|
|
893
|
-
}, renderHeader(unique), jsx("tbody", null))));
|
|
894
|
-
const tooltipComp = jsx("div", {
|
|
895
|
-
className: unique.tooltip,
|
|
896
|
-
ref: tooltipRef
|
|
897
|
-
}, jsx(Typography, {
|
|
898
|
-
color: 'system/standard',
|
|
899
|
-
type: 'p2'
|
|
900
|
-
}));
|
|
901
|
-
const pickerComp = jsx("div", {
|
|
902
|
-
css: pickerCSS.container(theme),
|
|
903
|
-
ref: pickerRef
|
|
904
|
-
}, jsx("div", {
|
|
905
|
-
className: unique.wrapper
|
|
906
|
-
}, leftCalendarComp, jsx(Divider, {
|
|
907
|
-
direction: 'vertical',
|
|
908
|
-
className: unique.divider,
|
|
909
|
-
height: '100%',
|
|
910
|
-
style: {
|
|
911
|
-
height: '226px',
|
|
912
|
-
margin: spacing([4.5, 0.5, 0])
|
|
913
|
-
}
|
|
914
|
-
}), rightCalendarComp), tooltipComp, controls ? footerMemo : null);
|
|
915
|
-
return jsx(ControlComp, {
|
|
916
|
-
...other,
|
|
917
|
-
disabled: disabled,
|
|
918
|
-
error: error,
|
|
919
|
-
ref: ref,
|
|
920
|
-
style: style
|
|
921
|
-
}, label ? jsx(Label, {
|
|
922
|
-
...labelProps,
|
|
923
|
-
disabled: disabled,
|
|
924
|
-
required: required
|
|
925
|
-
}, label) : null, jsx(InputBase, {
|
|
926
|
-
inputProps: {
|
|
927
|
-
placeholder: !readOnly && !disabled ? placeholder : '',
|
|
928
|
-
...inputProps
|
|
929
|
-
},
|
|
930
|
-
readOnly: true,
|
|
931
|
-
ref: ipConRef,
|
|
932
|
-
inputRef: ipRef,
|
|
933
|
-
disabled: disabled,
|
|
934
|
-
viewType: viewType,
|
|
935
|
-
inputStyle: {
|
|
936
|
-
textAlign: textAlign,
|
|
937
|
-
textOverflow: 'ellipsis',
|
|
938
|
-
...inputStyle
|
|
939
|
-
},
|
|
940
|
-
startIcon: startIcon,
|
|
941
|
-
startIconProps: {
|
|
942
|
-
className: 'non-effect allow-disabled'
|
|
943
|
-
},
|
|
944
|
-
endIcon: endIcon,
|
|
945
|
-
value: valueState,
|
|
946
|
-
onClick: onInputFocus
|
|
947
|
-
}), error ? jsx(HelperText, {
|
|
948
|
-
...helperTextProps,
|
|
949
|
-
disabled: disabled
|
|
950
|
-
}, error) : null);
|
|
951
|
-
}));
|
|
952
|
-
const unique = {
|
|
953
|
-
backGr: 'DGN-UI-Portal',
|
|
954
|
-
close: 'DGN-UI-DateRangePicker-close',
|
|
955
|
-
cancel: 'DGN-UI-DateRangePicker-cancel',
|
|
956
|
-
confirm: 'DGN-UI-DateRangePicker-confirm',
|
|
957
|
-
divider: 'DGN-UI-DateRangePicker-Divider',
|
|
958
|
-
disabled: 'DGN-UI-DateRangePicker-disabled',
|
|
959
|
-
error: 'DGN-UI-DateRangePicker-error',
|
|
960
|
-
focus: 'DGN-UI-DateRangePicker-focus',
|
|
961
|
-
footer: 'DGN-UI-DateRangePicker-Footer',
|
|
962
|
-
picker: 'DGN-UI-DateRangePicker-Picker-' + randomString(6, {
|
|
963
|
-
allowSymbol: false
|
|
964
|
-
}),
|
|
965
|
-
wrapper: 'DGN-UI-DateRangePicker-Wrapper',
|
|
966
|
-
container: 'DGN-UI-DateRangePicker',
|
|
967
|
-
icon: 'DGN-UI-DateRangePicker-Icon',
|
|
968
|
-
tooltip: 'DGN-UI-DateRangePicker-Tooltip',
|
|
969
|
-
navigator: {
|
|
970
|
-
navigator: 'DGN-UI-DateRangePicker-Navigator',
|
|
971
|
-
around: 'DGN-UI-DateRangePicker-Navigator-Around',
|
|
972
|
-
center: 'DGN-UI-DateRangePicker-Navigator-Center'
|
|
973
|
-
},
|
|
974
|
-
table: {
|
|
975
|
-
container: 'DGN-UI-DateRangePicker-Table-Container',
|
|
976
|
-
table: 'DGN-UI-DateRangePicker-Table-Table',
|
|
977
|
-
header: 'DGN-UI-DateRangePicker-Table-Header',
|
|
978
|
-
raw: 'DGN-UI-DateRangePicker-Table-Raw',
|
|
979
|
-
data: 'DGN-UI-DateRangePicker-Table-Data'
|
|
980
|
-
},
|
|
981
|
-
day: {
|
|
982
|
-
day: 'DGN-UI-DateRangePicker-Day',
|
|
983
|
-
week: 'DGN-UI-DateRangePicker-Week',
|
|
984
|
-
today: 'DGN-UI-DateRangePicker-Day-today',
|
|
985
|
-
active: 'DGN-UI-DateRangePicker-Day-active',
|
|
986
|
-
limit: 'DGN-UI-DateRangePicker-Day-limit',
|
|
987
|
-
from: 'DGN-UI-DateRangePicker-Day-from',
|
|
988
|
-
to: 'DGN-UI-DateRangePicker-Day-to',
|
|
989
|
-
between: 'DGN-UI-DateRangePicker-Day-between'
|
|
990
|
-
}
|
|
991
|
-
};
|
|
992
|
-
const hiddenStyle = {
|
|
993
|
-
opacity: 0,
|
|
994
|
-
display: 'none'
|
|
995
|
-
};
|
|
996
|
-
const activeStyle = {
|
|
997
|
-
opacity: 1,
|
|
998
|
-
pointerEvents: 'none',
|
|
999
|
-
display: 'block'
|
|
1000
|
-
};
|
|
1001
|
-
const buttonProps = ({
|
|
1002
|
-
spacing
|
|
1003
|
-
}) => ({
|
|
1004
|
-
style: {
|
|
1005
|
-
display: 'none',
|
|
1006
|
-
margin: spacing([0, 0.5]),
|
|
1007
|
-
padding: spacing([1.75, 2]),
|
|
1008
|
-
visibility: 'hidden'
|
|
1009
|
-
}
|
|
1010
|
-
});
|
|
1011
|
-
const IconAreaCSS = css`
|
|
1012
|
-
.${unique.icon} {
|
|
1013
|
-
${displayNone};
|
|
1014
|
-
${cursorPointer};
|
|
1015
|
-
opacity: 0;
|
|
1016
|
-
transition: display 50ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 50ms;
|
|
1017
|
-
will-change: display, opacity;
|
|
1018
|
-
}
|
|
1019
|
-
.${unique.icon}-accept {
|
|
1020
|
-
${displayBlock};
|
|
1021
|
-
opacity: 1;
|
|
1022
|
-
}
|
|
1023
|
-
`;
|
|
1024
|
-
const ControlContainerCSS = ({
|
|
1025
|
-
spacing
|
|
1026
|
-
}) => css`
|
|
1027
|
-
${displayFlex};
|
|
1028
|
-
${flexRow};
|
|
1029
|
-
${justifyEnd};
|
|
1030
|
-
margin: ${spacing([0, 4, 4])};
|
|
1031
|
-
`;
|
|
1032
|
-
const pickerCSS = {
|
|
1033
|
-
backGr: ({
|
|
1034
|
-
zIndex
|
|
1035
|
-
}) => `
|
|
1036
|
-
background-color: transparent;
|
|
1037
|
-
top: 0px; bottom: 0px; left: 0px; right: 0px; pointer-events: auto;
|
|
1038
|
-
position: fixed;
|
|
1039
|
-
z-index: ${zIndex(1)};`,
|
|
1040
|
-
container: ({
|
|
1041
|
-
spacing
|
|
1042
|
-
}) => css`
|
|
1043
|
-
${displayFlex};
|
|
1044
|
-
${flexCol};
|
|
1045
|
-
${borderRadius4px};
|
|
1046
|
-
${bgColor('system/standard')};
|
|
1047
|
-
${shadowLarge};
|
|
1048
|
-
.${unique.wrapper} {
|
|
1049
|
-
${displayFlex};
|
|
1050
|
-
${flexRow};
|
|
1051
|
-
${parseMinWidth(633)};
|
|
1052
|
-
}
|
|
1053
|
-
.${unique.tooltip} {
|
|
1054
|
-
${borderRadius4px};
|
|
1055
|
-
${pointerEventsNone};
|
|
1056
|
-
${positionFixed};
|
|
1057
|
-
${textCenter};
|
|
1058
|
-
${userSelectNone};
|
|
1059
|
-
${whiteSpaceNoWrap};
|
|
1060
|
-
${parseHeight(18)};
|
|
1061
|
-
${parseMinWidth(65)};
|
|
1062
|
-
${bgColor('rgba(21, 26, 48, 0.9)')};
|
|
1063
|
-
padding: ${spacing([0.75, 1.5])};
|
|
1064
|
-
${invisible};
|
|
1065
|
-
${z(3)};
|
|
1066
|
-
transition: left 0.05s ease-in, top 0.05s ease-in;
|
|
1067
|
-
vertical-align: middle;
|
|
1068
|
-
will-change: left top visibility;
|
|
1069
|
-
}
|
|
1070
|
-
@media only screen and (max-width: 800px) {
|
|
1071
|
-
${parseMaxWidth(400)};
|
|
1072
|
-
.${unique.wrapper} {
|
|
1073
|
-
${displayFlex};
|
|
1074
|
-
${flexCol};
|
|
1075
|
-
${parseMinWidth(260)};
|
|
1076
|
-
}
|
|
1077
|
-
.${unique.divider} {
|
|
1078
|
-
height: 1px !important;
|
|
1079
|
-
margin: ${spacing([0, 4])} !important;
|
|
1080
|
-
width: calc(100% - 32px) !important;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
`,
|
|
1084
|
-
picker: position => css`
|
|
1085
|
-
${borderRadius4px};
|
|
1086
|
-
${positionFixed};
|
|
1087
|
-
${parseHeight('max-content')};
|
|
1088
|
-
${parseMinWidth(window.innerWidth <= 633 ? 300 : 633)};
|
|
1089
|
-
${parseMaxWidth(805)};
|
|
1090
|
-
${top(position.top)};
|
|
1091
|
-
${left(position.left)};
|
|
1092
|
-
${z(2)};
|
|
1093
|
-
opacity: 0;
|
|
1094
|
-
transform: scale(0);
|
|
1095
|
-
transform-origin: ${position.transformOrigin};
|
|
1096
|
-
transition: opacity 120ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
1097
|
-
`,
|
|
1098
|
-
active: {
|
|
1099
|
-
opacity: 1,
|
|
1100
|
-
transform: 'scale(1)'
|
|
1101
|
-
},
|
|
1102
|
-
remove: {
|
|
1103
|
-
opacity: 0,
|
|
1104
|
-
pointerEvents: 'none',
|
|
1105
|
-
transform: 'scale(0)'
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
// DateRangePicker.defaultProps = {
|
|
1110
|
-
// actionIconAt: 'end',
|
|
1111
|
-
// clearAble: false,
|
|
1112
|
-
// controls: false,
|
|
1113
|
-
// disabled: false,
|
|
1114
|
-
// displayFormat: 'DD/MM/YY',
|
|
1115
|
-
// onShowTooltip: true,
|
|
1116
|
-
// pressESCToClose: true,
|
|
1117
|
-
// readOnly: false,
|
|
1118
|
-
// required: false,
|
|
1119
|
-
// returnFormat: 'YYYY-MM-DD',
|
|
1120
|
-
// showUnitCount: true,
|
|
1121
|
-
// startFromZero: false,
|
|
1122
|
-
// textAlign: 'start',
|
|
1123
|
-
// unitCount: 'day',
|
|
1124
|
-
// viewType: 'underlined',
|
|
1125
|
-
// };
|
|
1126
|
-
|
|
1127
|
-
DateRangePicker.propTypes = {
|
|
1128
|
-
/** Position of action icons. */
|
|
1129
|
-
actionIconAt: PropTypes.oneOf(['end', 'start']),
|
|
1130
|
-
/** If `true`, display the clear icon. */
|
|
1131
|
-
clearAble: PropTypes.bool,
|
|
1132
|
-
/** If `true`, the calendar will have a footer controls. */
|
|
1133
|
-
controls: PropTypes.bool,
|
|
1134
|
-
/** Default value of the component. */
|
|
1135
|
-
defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.instanceOf(Date)), PropTypes.arrayOf(PropTypes.string)]),
|
|
1136
|
-
/** If `true`, the component is disabled. */
|
|
1137
|
-
disabled: PropTypes.bool,
|
|
1138
|
-
/** Format to display value. */
|
|
1139
|
-
displayFormat: PropTypes.oneOfType([PropTypes.oneOf(['DD/MM/YYYY', 'MM/DD/YYYY', 'YYYY/MM/DD', 'DD-MM-YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD']), PropTypes.string]),
|
|
1140
|
-
/** Error displayed below input. */
|
|
1141
|
-
error: PropTypes.string,
|
|
1142
|
-
/** [Props](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) of helper text. */
|
|
1143
|
-
helperTextProps: PropTypes.object,
|
|
1144
|
-
/** [Props](https://core.diginet.com.vn/ui/?path=/story/form-control-input-inputbase) of input base */
|
|
1145
|
-
inputProps: PropTypes.object,
|
|
1146
|
-
/** Consult [InputBase's](https://core.diginet.com.vn/ui/?path=/story/form-control-input-inputbase) documents. */
|
|
1147
|
-
inputStyle: PropTypes.object,
|
|
1148
|
-
/** The label of the component. */
|
|
1149
|
-
label: PropTypes.string,
|
|
1150
|
-
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label--simple) of label. */
|
|
1151
|
-
labelProps: PropTypes.object,
|
|
1152
|
-
/** Max value of date picker. */
|
|
1153
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
|
|
1154
|
-
/** Min value of date picker. */
|
|
1155
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
|
|
1156
|
-
/** Callback fired when the value is changed. */
|
|
1157
|
-
onChange: PropTypes.func,
|
|
1158
|
-
/** The short hint displayed in the input before the user enters a value. */
|
|
1159
|
-
placeholder: PropTypes.string,
|
|
1160
|
-
/** If `true`, hitting escape will close component. */
|
|
1161
|
-
pressESCToClose: PropTypes.bool,
|
|
1162
|
-
/** If `true`, the component is readOnly. */
|
|
1163
|
-
readOnly: PropTypes.bool,
|
|
1164
|
-
/** If `true`, the input element is required. */
|
|
1165
|
-
required: PropTypes.bool,
|
|
1166
|
-
/** Format of the returned value. */
|
|
1167
|
-
returnFormat: PropTypes.oneOfType([PropTypes.oneOf(['DD/MM/YYYY', 'MM/DD/YYYY', 'YYYY/MM/DD', 'DD-MM-YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD']), PropTypes.string]),
|
|
1168
|
-
/** If `true`, show unit count. */
|
|
1169
|
-
showUnitCount: PropTypes.bool,
|
|
1170
|
-
/** Counter with start with 0 or 1. */
|
|
1171
|
-
startFromZero: PropTypes.bool,
|
|
1172
|
-
/** Style inline of component. */
|
|
1173
|
-
style: PropTypes.object,
|
|
1174
|
-
/** Text align of the input. */
|
|
1175
|
-
textAlign: PropTypes.oneOf(['center', 'end', 'start']),
|
|
1176
|
-
/** The count unit when select. */
|
|
1177
|
-
unitCount: PropTypes.oneOf(['day', 'night']),
|
|
1178
|
-
/** The value of the input element, required for a controlled component. String must be [Date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date): YYYY/MM/DD, MM/DD/YYYY,...*/
|
|
1179
|
-
value: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string])),
|
|
1180
|
-
/** The variant to use. */
|
|
1181
|
-
viewType: PropTypes.oneOf(['outlined', 'underlined'])
|
|
1182
|
-
};
|
|
1183
|
-
export default DateRangePicker;
|