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
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
ButtonIcon,
|
|
7
|
+
Divider,
|
|
8
|
+
HelperText,
|
|
9
|
+
InputBase,
|
|
10
|
+
Label,
|
|
11
|
+
NumberInput,
|
|
12
|
+
Popover,
|
|
13
|
+
Typography,
|
|
14
|
+
} from 'components';
|
|
15
|
+
import { getGlobal } from 'global';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
18
|
+
import {
|
|
19
|
+
bgColor,
|
|
20
|
+
border,
|
|
21
|
+
borderColor,
|
|
22
|
+
borderNone,
|
|
23
|
+
borderRadius4px,
|
|
24
|
+
displayFlex,
|
|
25
|
+
flexCol,
|
|
26
|
+
itemsCenter,
|
|
27
|
+
justifyBetween,
|
|
28
|
+
justifyCenter,
|
|
29
|
+
parseHeight,
|
|
30
|
+
parseMinHeight,
|
|
31
|
+
parseWidth,
|
|
32
|
+
parseWidthHeight,
|
|
33
|
+
positionRelative,
|
|
34
|
+
textCenter,
|
|
35
|
+
textColor,
|
|
36
|
+
} from 'styles/general';
|
|
37
|
+
import { useTheme } from 'theme';
|
|
38
|
+
import useThemeProps from 'theme/utils/useThemeProps';
|
|
39
|
+
import { classNames, date, getProp, hexToRGBA } from 'utils';
|
|
40
|
+
|
|
41
|
+
const TimePicker = memo(
|
|
42
|
+
forwardRef((inProps, reference) => {
|
|
43
|
+
if (!reference) reference = useRef(null);
|
|
44
|
+
|
|
45
|
+
// props priority: `inProps` > `themeDefaultProps`
|
|
46
|
+
const props = useThemeProps({ props: inProps, name: 'TimePicker' });
|
|
47
|
+
const {
|
|
48
|
+
action = {},
|
|
49
|
+
actionIconAt,
|
|
50
|
+
className,
|
|
51
|
+
disabled,
|
|
52
|
+
displayFormat,
|
|
53
|
+
error,
|
|
54
|
+
errorProps,
|
|
55
|
+
inputProps,
|
|
56
|
+
inputStyle,
|
|
57
|
+
placeholder: placeholderProp,
|
|
58
|
+
onChange,
|
|
59
|
+
mode12h,
|
|
60
|
+
min,
|
|
61
|
+
max,
|
|
62
|
+
minuteStep,
|
|
63
|
+
label,
|
|
64
|
+
labelProps,
|
|
65
|
+
style,
|
|
66
|
+
value: valueProp,
|
|
67
|
+
viewType,
|
|
68
|
+
returnFormat,
|
|
69
|
+
readOnly,
|
|
70
|
+
required,
|
|
71
|
+
...other
|
|
72
|
+
} = props;
|
|
73
|
+
|
|
74
|
+
const placeholder = placeholderProp ?? displayFormat;
|
|
75
|
+
let value = valueProp;
|
|
76
|
+
|
|
77
|
+
// ref
|
|
78
|
+
const ref = useRef(null);
|
|
79
|
+
const timePickerRef = useRef(null);
|
|
80
|
+
|
|
81
|
+
// states
|
|
82
|
+
const [currentInputFocus, setCurrentInputFocus] = useState(null);
|
|
83
|
+
const [displayTime, setDisplayTime] = useState(value);
|
|
84
|
+
const [minValue, setMinValue] = useState(min);
|
|
85
|
+
const [maxValue, setMaxValue] = useState(max);
|
|
86
|
+
const [timeValue, setTimeValue] = useState({
|
|
87
|
+
hour: mode12h ? 1 : 0,
|
|
88
|
+
minute: 0,
|
|
89
|
+
second: 0,
|
|
90
|
+
text: 'AM',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const theme = useTheme();
|
|
94
|
+
|
|
95
|
+
// css
|
|
96
|
+
const _TimePickerBodyCSS = TimePickerBodyCSS(currentInputFocus, theme);
|
|
97
|
+
const _TimePickerAMPMCSS = TimePickerAMPMCSS(timeValue?.text, theme);
|
|
98
|
+
const _TimePickerCSS = TimePickerCSS(theme);
|
|
99
|
+
const _TimePickerFooterCSS = TimePickerFooterCSS(theme);
|
|
100
|
+
|
|
101
|
+
// variables
|
|
102
|
+
const isError = !!error && !value;
|
|
103
|
+
const currentHour = Number(timeValue?.hour);
|
|
104
|
+
const currentMinute = Number(timeValue?.minute);
|
|
105
|
+
const currentSecond = Number(timeValue?.second);
|
|
106
|
+
const currentTime = new Date(new Date().getFullYear(), 0, 1, currentHour, currentMinute, currentSecond);
|
|
107
|
+
|
|
108
|
+
const maxHour = maxValue.slice(0, 2) ? Number(maxValue.slice(0, 2)) : mode12h ? 12 : 23;
|
|
109
|
+
const maxMinute = maxValue.slice(3, 5) ? Number(maxValue.slice(3, 5)) : 59;
|
|
110
|
+
const maxSecond = maxValue.slice(6, 8) ? Number(maxValue.slice(6, 8)) : 59;
|
|
111
|
+
const minHour = minValue.slice(0, 2) ? Number(minValue.slice(0, 2)) : mode12h ? 1 : 0;
|
|
112
|
+
const minMinute = minValue.slice(3, 5) ? Number(minValue.slice(3, 5)) : 0;
|
|
113
|
+
const minSecond = minValue.slice(6, 8) ? Number(minValue.slice(6, 8)) : 0;
|
|
114
|
+
|
|
115
|
+
const startHour = minHour ? minHour : mode12h ? 1 : 0;
|
|
116
|
+
const startMinute = currentHour === minHour ? minMinute : 0;
|
|
117
|
+
const startSecond = currentHour === minHour && currentMinute === minMinute ? minSecond : 0;
|
|
118
|
+
const lastHour = maxHour ? maxHour : mode12h ? 12 : 23;
|
|
119
|
+
const lastMinute = currentHour === maxHour ? maxMinute : 59;
|
|
120
|
+
const lastSecond = currentHour === maxHour && currentMinute === maxMinute ? maxSecond : 59;
|
|
121
|
+
|
|
122
|
+
const saveText = getGlobal(['save']);
|
|
123
|
+
const nowText = getGlobal(['now']);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* onChange handler with condition base on min max
|
|
127
|
+
* @param {*} e
|
|
128
|
+
* @param {String} key one of ['hour', 'minute', 'second']
|
|
129
|
+
*/
|
|
130
|
+
const onChangeHandler = (e, key) => {
|
|
131
|
+
if (!e) return;
|
|
132
|
+
value = +e?.target?.value || 0;
|
|
133
|
+
if (key === 'hour') {
|
|
134
|
+
if (maxHour === value && maxMinute <= currentMinute) {
|
|
135
|
+
if (maxSecond <= currentSecond) {
|
|
136
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute, second: maxSecond });
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute });
|
|
140
|
+
} else if (minHour >= value && minMinute >= currentMinute && minSecond >= currentSecond) {
|
|
141
|
+
setTimeValue({ ...timeValue, hour: minHour, minute: minMinute, second: minSecond });
|
|
142
|
+
} else {
|
|
143
|
+
setTimeValue({ ...timeValue, [key]: value });
|
|
144
|
+
}
|
|
145
|
+
} else if (key === 'minute') {
|
|
146
|
+
if (currentHour === maxHour && maxMinute <= value && currentSecond >= maxSecond) {
|
|
147
|
+
setTimeValue({ ...timeValue, minute: maxMinute, second: maxSecond });
|
|
148
|
+
} else {
|
|
149
|
+
setTimeValue({ ...timeValue, [key]: value });
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
setTimeValue({ ...timeValue, [key]: value });
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
*
|
|
158
|
+
* @param {String} key
|
|
159
|
+
* @param {Number} value
|
|
160
|
+
*/
|
|
161
|
+
const setTimeAfterChange = (key, value) => {
|
|
162
|
+
setTimeValue({ ...timeValue, [key]: value });
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* Arrow up hour input onClick in the following cases:
|
|
168
|
+
* (1): Increase current hour by 1
|
|
169
|
+
* (2): If current hour is equal to max hour value, set current hour equal to min hour
|
|
170
|
+
* (3): If current hour plus 1 is equal to max hour, set current minute equal to max minute if current minute greater than max minute value
|
|
171
|
+
* (4): If current hour plus 1 is equal to max hour, set current second equal to max second if current second greater than max second value
|
|
172
|
+
* (5): Set current minute, second to min minute, second if current hour is greater than max hour value and current minute, second is greater than min minute, second value
|
|
173
|
+
*/
|
|
174
|
+
const onIncreaseHour = () => {
|
|
175
|
+
if (maxHour === currentHour + 1 && maxMinute < currentMinute) {
|
|
176
|
+
// (3)
|
|
177
|
+
if (maxSecond < currentSecond) {
|
|
178
|
+
// (4)
|
|
179
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute, second: maxSecond });
|
|
180
|
+
} else {
|
|
181
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute });
|
|
182
|
+
}
|
|
183
|
+
} else if (maxHour <= currentHour) {
|
|
184
|
+
// (2)
|
|
185
|
+
if (minMinute <= currentMinute) {
|
|
186
|
+
// (5)
|
|
187
|
+
setTimeValue({ ...timeValue, hour: minHour });
|
|
188
|
+
} else {
|
|
189
|
+
setTimeValue({ ...timeValue, hour: minHour, minute: minMinute, second: minSecond });
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
setTimeAfterChange('hour', currentHour + 1); // (1)
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
*
|
|
198
|
+
* @constant {Number} minuteStep
|
|
199
|
+
* @constant {Number} lastMinute
|
|
200
|
+
* Arrow up minute input onClick in the following cases:
|
|
201
|
+
* (1): Increase current minute by minute step (default 1).
|
|
202
|
+
* (2): If current minute plus minute step is greater than lastMinute, set current minute equal to min minute.
|
|
203
|
+
* (3): If current second greater than max second value, set current second equal to max second.
|
|
204
|
+
* (4): (3) and current second is greater than max second value, set current second equal to max second.
|
|
205
|
+
*/
|
|
206
|
+
const onIncreaseMinute = () => {
|
|
207
|
+
if (lastMinute < currentMinute + minuteStep) {
|
|
208
|
+
// (2)
|
|
209
|
+
setTimeAfterChange('minute', startMinute);
|
|
210
|
+
} else if (lastMinute === currentMinute + minuteStep) {
|
|
211
|
+
if (currentSecond > maxSecond) {
|
|
212
|
+
// (4)
|
|
213
|
+
setTimeValue({ ...timeValue, minute: currentMinute + minuteStep, second: maxSecond });
|
|
214
|
+
} else {
|
|
215
|
+
// (3)
|
|
216
|
+
setTimeValue({ ...timeValue, minute: currentMinute + minuteStep });
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
// (1)
|
|
220
|
+
setTimeAfterChange('minute', currentMinute + minuteStep);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* Arrow up second input onClick in the following cases:
|
|
227
|
+
* (1): Increase current second by 1
|
|
228
|
+
* (2): If current second plus 1 equal to max second value, set current second to min second
|
|
229
|
+
*/
|
|
230
|
+
const onIncreaseSecond = () => {
|
|
231
|
+
if (lastSecond < currentSecond + 1) {
|
|
232
|
+
// (2)
|
|
233
|
+
setTimeAfterChange('second', startSecond);
|
|
234
|
+
} else {
|
|
235
|
+
// (1)
|
|
236
|
+
setTimeAfterChange('second', currentSecond + 1);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
*
|
|
242
|
+
* Arrow down hour input onClick in the following cases:
|
|
243
|
+
* (1): Decrease current hour by 1
|
|
244
|
+
* (2): If current hour is equal to min hour value, set current hour equal to max hour
|
|
245
|
+
* (3): (2) and current minute is greater than max minute value, set minute to max minute value
|
|
246
|
+
* (4): (3) and current second is greater than min second value, set second to max second value
|
|
247
|
+
* (5): If current hour minus 1 is equal to min hour and current minute greater than min minute value, set current minute equal to min minute
|
|
248
|
+
* (6): (5) and current second is greater than min second value, set current second equal to min second
|
|
249
|
+
*/
|
|
250
|
+
const onDecreaseHour = () => {
|
|
251
|
+
if (minHour === currentHour - 1 && minMinute > currentMinute) {
|
|
252
|
+
if (minSecond > currentSecond) {
|
|
253
|
+
// (6)
|
|
254
|
+
setTimeValue({ ...timeValue, hour: minHour, minute: minMinute, second: minSecond });
|
|
255
|
+
} else {
|
|
256
|
+
// (5)
|
|
257
|
+
setTimeValue({ ...timeValue, hour: minHour, minute: minMinute });
|
|
258
|
+
}
|
|
259
|
+
} else if (minHour >= currentHour) {
|
|
260
|
+
if (maxMinute < currentMinute) {
|
|
261
|
+
if (maxSecond < currentSecond) {
|
|
262
|
+
// (4)
|
|
263
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute, second: maxSecond });
|
|
264
|
+
} else {
|
|
265
|
+
// (3)
|
|
266
|
+
setTimeValue({ ...timeValue, hour: maxHour, minute: maxMinute });
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
// (2)
|
|
270
|
+
setTimeValue({ ...timeValue, hour: maxHour });
|
|
271
|
+
}
|
|
272
|
+
} else {
|
|
273
|
+
// (1)
|
|
274
|
+
setTimeAfterChange('hour', currentHour - 1);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
* @constant {Number} minuteStep
|
|
281
|
+
* @constant {Number} startMinute
|
|
282
|
+
* @constant {Number} lastMinute
|
|
283
|
+
* Arrow down minute input onClick in the following cases:
|
|
284
|
+
* (1): Decrease current minute by @minuteStep
|
|
285
|
+
* (2): If current minute minus @minuteStep is smaller than @startMinute , set current minute to @lastMinute - @lastMinute % @minuteStep
|
|
286
|
+
* (3): (2) and current second is greater than max second, set current second to max second
|
|
287
|
+
*/
|
|
288
|
+
const onDecreaseMinute = () => {
|
|
289
|
+
if (startMinute > currentMinute - minuteStep) {
|
|
290
|
+
if (currentHour === maxHour && currentSecond > maxSecond) {
|
|
291
|
+
// (3)
|
|
292
|
+
setTimeValue({
|
|
293
|
+
...timeValue,
|
|
294
|
+
minute: lastMinute - (lastMinute % minuteStep),
|
|
295
|
+
second: maxSecond,
|
|
296
|
+
});
|
|
297
|
+
} else {
|
|
298
|
+
// (2)
|
|
299
|
+
setTimeAfterChange('minute', lastMinute - (lastMinute % minuteStep));
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
// (1)
|
|
303
|
+
setTimeAfterChange('minute', currentMinute - minuteStep);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
*
|
|
309
|
+
* @constant {Number} startSecond
|
|
310
|
+
* @constant {Number} lastSecond
|
|
311
|
+
* Arrow down second input onClick in the following cases:
|
|
312
|
+
* (1): Decrease current second by 1
|
|
313
|
+
* (2): If current second minus 1 is smaller than start second, set current second to last second
|
|
314
|
+
*/
|
|
315
|
+
const onDecreaseSecond = () => {
|
|
316
|
+
if (startSecond >= currentSecond - 1) {
|
|
317
|
+
// (2)
|
|
318
|
+
setTimeAfterChange('second', lastSecond);
|
|
319
|
+
} else {
|
|
320
|
+
// (1)
|
|
321
|
+
setTimeAfterChange('second', currentSecond - 1);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
*
|
|
327
|
+
* onClose Popover Timepicker when click Save button
|
|
328
|
+
*/
|
|
329
|
+
const onCloseTimePicker = () => {
|
|
330
|
+
timePickerRef.current.close();
|
|
331
|
+
setCurrentInputFocus(null);
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
*
|
|
336
|
+
* Format value using date().format() in utils
|
|
337
|
+
* @param {Date} value
|
|
338
|
+
* @param {String} outputFormat
|
|
339
|
+
* @returns
|
|
340
|
+
*/
|
|
341
|
+
const formatTime = (value, outputFormat) => {
|
|
342
|
+
return mode12h ? date(value).format(`hh${outputFormat.slice(2)} A`) : date(value).format(outputFormat);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* Button Save onClick
|
|
348
|
+
* @param {Boolean} now
|
|
349
|
+
*/
|
|
350
|
+
const onSelectTime = (now = false) => {
|
|
351
|
+
let displayTimeValue = '00:00:00';
|
|
352
|
+
let returnTimeValue = '00:00:00';
|
|
353
|
+
if (now) {
|
|
354
|
+
displayTimeValue = formatTime(null, displayFormat);
|
|
355
|
+
returnTimeValue = formatTime(null, returnFormat);
|
|
356
|
+
setTimeValue({
|
|
357
|
+
hour: displayTimeValue.slice(0, 2).includes(':')
|
|
358
|
+
? displayTimeValue.slice(0, 1)
|
|
359
|
+
: displayTimeValue.slice(0, 2),
|
|
360
|
+
minute: displayTimeValue.slice(0, 2).includes(':')
|
|
361
|
+
? displayTimeValue.slice(2, 4)
|
|
362
|
+
: displayTimeValue.slice(3, 5),
|
|
363
|
+
second: displayTimeValue.slice(0, 2).includes(':')
|
|
364
|
+
? displayTimeValue.slice(5, 7)
|
|
365
|
+
: displayTimeValue.slice(6, 8),
|
|
366
|
+
text: displayTimeValue.slice(0, 2).includes(':')
|
|
367
|
+
? displayTimeValue.slice(9, 11)
|
|
368
|
+
: displayTimeValue.slice(10, 12),
|
|
369
|
+
});
|
|
370
|
+
} else {
|
|
371
|
+
displayTimeValue = `${date(currentTime).format(displayFormat)}${mode12h ? ` ${timeValue?.text}` : ''}`;
|
|
372
|
+
returnTimeValue = `${date(currentTime).format(returnFormat)}${mode12h ? ` ${timeValue?.text}` : ''}`;
|
|
373
|
+
}
|
|
374
|
+
if (!now) {
|
|
375
|
+
setDisplayTime(displayTimeValue);
|
|
376
|
+
const e = {
|
|
377
|
+
value: returnTimeValue,
|
|
378
|
+
};
|
|
379
|
+
!!onChange && onChange(e);
|
|
380
|
+
onCloseTimePicker();
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// useEffect for prop value
|
|
385
|
+
useEffect(() => {
|
|
386
|
+
if (!value) {
|
|
387
|
+
if (!mode12h) {
|
|
388
|
+
const timeValue = {
|
|
389
|
+
hour: min ? min.slice(0, 2) : mode12h ? 1 : 0,
|
|
390
|
+
minute: min ? min.slice(3, 5) : 0,
|
|
391
|
+
second: min ? min.slice(6, 8) : 0,
|
|
392
|
+
};
|
|
393
|
+
setTimeValue(timeValue);
|
|
394
|
+
} else {
|
|
395
|
+
const timeValue = {
|
|
396
|
+
hour: min ? min.slice(0, 2) : mode12h ? 1 : 0,
|
|
397
|
+
minute: min ? min.slice(3, 5) : 0,
|
|
398
|
+
second: min ? min.slice(6, 8) : 0,
|
|
399
|
+
text: min ? (returnFormat === 'HH:mm:ss' ? min.slice(10, 12) : min.slice(6, 8)) || 'AM' : 'AM',
|
|
400
|
+
};
|
|
401
|
+
setTimeValue(timeValue);
|
|
402
|
+
}
|
|
403
|
+
setDisplayTime(null);
|
|
404
|
+
} else {
|
|
405
|
+
let displayTimeValue = '00:00:00';
|
|
406
|
+
const valueHour = Number(value.slice(0, 2)) || '00';
|
|
407
|
+
const valueMinute = Number(value.slice(3, 5)) || '00';
|
|
408
|
+
const valueSecond = Number(value.slice(6, 8)) || '00';
|
|
409
|
+
const valueTime = new Date(new Date().getFullYear(), 0, 1, valueHour, valueMinute, valueSecond);
|
|
410
|
+
displayTimeValue = mode12h
|
|
411
|
+
? formatTime(valueTime, displayFormat)
|
|
412
|
+
.slice(0, -3)
|
|
413
|
+
.concat(returnFormat === 'HH:mm:ss' ? ` ${value.slice(10, 12)}` : ` ${value.slice(6, 8)}`)
|
|
414
|
+
: formatTime(valueTime, displayFormat).concat(
|
|
415
|
+
returnFormat === 'HH:mm:ss' ? ` ${value.slice(10, 12)}` : ` ${value.slice(6, 8)}`
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
if (!mode12h) {
|
|
419
|
+
setTimeValue({
|
|
420
|
+
hour: value.slice(0, 2),
|
|
421
|
+
minute: value.slice(3, 5),
|
|
422
|
+
second: value.slice(6, 8),
|
|
423
|
+
});
|
|
424
|
+
} else {
|
|
425
|
+
const timeValue = {
|
|
426
|
+
hour: value.slice(0, 2),
|
|
427
|
+
minute: value.slice(3, 5),
|
|
428
|
+
second: returnFormat === 'HH:mm:ss' ? value.slice(6, 8) : '00',
|
|
429
|
+
text: returnFormat === 'HH:mm:ss' ? value.slice(10, 12) : value.slice(6, 8),
|
|
430
|
+
};
|
|
431
|
+
setTimeValue(timeValue);
|
|
432
|
+
}
|
|
433
|
+
setDisplayTime(displayTimeValue);
|
|
434
|
+
}
|
|
435
|
+
}, [value, displayFormat, returnFormat, mode12h, min, max]);
|
|
436
|
+
|
|
437
|
+
// useEffect for prop min/max
|
|
438
|
+
useEffect(() => {
|
|
439
|
+
setMinValue(min);
|
|
440
|
+
setMaxValue(max);
|
|
441
|
+
}, [min, max]);
|
|
442
|
+
|
|
443
|
+
useImperativeHandle(reference, () => {
|
|
444
|
+
const currentRef = ref.current || {};
|
|
445
|
+
currentRef.element = ref.current;
|
|
446
|
+
const _instance = {
|
|
447
|
+
...action,
|
|
448
|
+
}; // methods
|
|
449
|
+
_instance.__proto__ = {}; // hidden methods
|
|
450
|
+
currentRef.instance = _instance;
|
|
451
|
+
return currentRef;
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const IconComp = <ButtonIcon disabled={disabled || readOnly} viewType={'ghost'} viewBox name={'clock'} />;
|
|
455
|
+
|
|
456
|
+
const endIcon = actionIconAt === 'end' ? IconComp : null;
|
|
457
|
+
const startIcon = actionIconAt === 'start' ? IconComp : null;
|
|
458
|
+
|
|
459
|
+
return (
|
|
460
|
+
<div
|
|
461
|
+
ref={ref}
|
|
462
|
+
css={positionRelative}
|
|
463
|
+
style={style}
|
|
464
|
+
className={classNames('DGN-UI-TimePicker-Root', className, disabled && 'disabled')}
|
|
465
|
+
{...other}
|
|
466
|
+
>
|
|
467
|
+
{label && (
|
|
468
|
+
<Label disabled={disabled} required={required} {...labelProps}>
|
|
469
|
+
{label}
|
|
470
|
+
</Label>
|
|
471
|
+
)}
|
|
472
|
+
{readOnly ? (
|
|
473
|
+
<InputBase
|
|
474
|
+
inputProps={{
|
|
475
|
+
placeholder: !readOnly && !disabled ? placeholder : '',
|
|
476
|
+
...inputProps,
|
|
477
|
+
}}
|
|
478
|
+
disabled={disabled}
|
|
479
|
+
viewType={viewType}
|
|
480
|
+
inputStyle={{
|
|
481
|
+
...inputStyle,
|
|
482
|
+
}}
|
|
483
|
+
value={displayTime}
|
|
484
|
+
endIcon={endIcon}
|
|
485
|
+
startIcon={startIcon}
|
|
486
|
+
onKeyDown={e => e.preventDefault()}
|
|
487
|
+
status={error ? 'danger' : 'default'}
|
|
488
|
+
readOnly
|
|
489
|
+
/>
|
|
490
|
+
) : (
|
|
491
|
+
<Popover
|
|
492
|
+
css={_TimePickerCSS}
|
|
493
|
+
anchor={
|
|
494
|
+
<InputBase
|
|
495
|
+
inputProps={{
|
|
496
|
+
placeholder: !readOnly && !disabled ? placeholder : '',
|
|
497
|
+
...inputProps,
|
|
498
|
+
}}
|
|
499
|
+
disabled={disabled}
|
|
500
|
+
viewType={viewType}
|
|
501
|
+
inputStyle={{
|
|
502
|
+
...inputStyle,
|
|
503
|
+
}}
|
|
504
|
+
value={displayTime}
|
|
505
|
+
endIcon={endIcon}
|
|
506
|
+
startIcon={startIcon}
|
|
507
|
+
onKeyDown={e => e.preventDefault()}
|
|
508
|
+
status={error ? 'danger' : 'default'}
|
|
509
|
+
readOnly
|
|
510
|
+
/>
|
|
511
|
+
}
|
|
512
|
+
ref={timePickerRef}
|
|
513
|
+
transformOrigin={{
|
|
514
|
+
vertical: 'top',
|
|
515
|
+
horizontal: 'left',
|
|
516
|
+
}}
|
|
517
|
+
anchorOrigin={{
|
|
518
|
+
vertical: 'bottom',
|
|
519
|
+
horizontal: 'left',
|
|
520
|
+
}}
|
|
521
|
+
>
|
|
522
|
+
<div className="DGN-UI-TimePicker">
|
|
523
|
+
<div className="DGN-UI-TimePicker-Body" css={_TimePickerBodyCSS}>
|
|
524
|
+
{/* hours */}
|
|
525
|
+
<div className="DGN-UI-TimePicker-Input" css={TimePickerInputCSS}>
|
|
526
|
+
{currentInputFocus === 1 && (
|
|
527
|
+
<ButtonIcon viewType="ghost" name="ArrowUp" onClick={onIncreaseHour} />
|
|
528
|
+
)}
|
|
529
|
+
<NumberInput
|
|
530
|
+
delayOnChange={0}
|
|
531
|
+
onFocus={() => setCurrentInputFocus(1)}
|
|
532
|
+
viewType="outlined"
|
|
533
|
+
placeholder=""
|
|
534
|
+
value={currentHour}
|
|
535
|
+
onChange={e => onChangeHandler(e, 'hour')}
|
|
536
|
+
onKeyDown={e => onChangeHandler(e, 'hour')}
|
|
537
|
+
min={startHour}
|
|
538
|
+
max={lastHour}
|
|
539
|
+
disabledNegative
|
|
540
|
+
/>
|
|
541
|
+
{currentInputFocus === 1 && (
|
|
542
|
+
<ButtonIcon viewType="ghost" name="ArrowDown" onClick={onDecreaseHour} />
|
|
543
|
+
)}
|
|
544
|
+
</div>
|
|
545
|
+
{/* minutes */}
|
|
546
|
+
<Typography type="title1">:</Typography>
|
|
547
|
+
<div className="DGN-UI-TimePicker-Input" css={TimePickerInputCSS}>
|
|
548
|
+
{currentInputFocus === 2 && (
|
|
549
|
+
<ButtonIcon viewType="ghost" name="ArrowUp" onClick={onIncreaseMinute} />
|
|
550
|
+
)}
|
|
551
|
+
<NumberInput
|
|
552
|
+
delayOnChange={0}
|
|
553
|
+
onFocus={() => setCurrentInputFocus(2)}
|
|
554
|
+
viewType="outlined"
|
|
555
|
+
placeholder=""
|
|
556
|
+
value={currentMinute || 0}
|
|
557
|
+
onChange={e => onChangeHandler(e, 'minute')}
|
|
558
|
+
onKeyDown={e => onChangeHandler(e, 'minute')}
|
|
559
|
+
min={startMinute}
|
|
560
|
+
max={lastMinute}
|
|
561
|
+
disabledNegative
|
|
562
|
+
/>
|
|
563
|
+
{currentInputFocus === 2 && (
|
|
564
|
+
<ButtonIcon viewType="ghost" name="ArrowDown" onClick={onDecreaseMinute} />
|
|
565
|
+
)}
|
|
566
|
+
</div>
|
|
567
|
+
{/* seconds */}
|
|
568
|
+
{displayFormat === 'HH:mm:ss' && (
|
|
569
|
+
<React.Fragment>
|
|
570
|
+
<Typography type="title1">:</Typography>
|
|
571
|
+
<div className="DGN-UI-TimePicker-Input" css={TimePickerInputCSS}>
|
|
572
|
+
{currentInputFocus === 3 && (
|
|
573
|
+
<ButtonIcon
|
|
574
|
+
viewType="ghost"
|
|
575
|
+
name="ArrowUp"
|
|
576
|
+
onClick={onIncreaseSecond}
|
|
577
|
+
/>
|
|
578
|
+
)}
|
|
579
|
+
<NumberInput
|
|
580
|
+
delayOnChange={0}
|
|
581
|
+
onFocus={() => setCurrentInputFocus(3)}
|
|
582
|
+
viewType="outlined"
|
|
583
|
+
placeholder=""
|
|
584
|
+
value={currentSecond || 0}
|
|
585
|
+
onChange={e => onChangeHandler(e, 'second')}
|
|
586
|
+
onKeyDown={e => onChangeHandler(e, 'second')}
|
|
587
|
+
min={startSecond}
|
|
588
|
+
max={lastSecond}
|
|
589
|
+
disabledNegative
|
|
590
|
+
/>
|
|
591
|
+
{currentInputFocus === 3 && (
|
|
592
|
+
<ButtonIcon
|
|
593
|
+
viewType="ghost"
|
|
594
|
+
name="ArrowDown"
|
|
595
|
+
onClick={onDecreaseSecond}
|
|
596
|
+
/>
|
|
597
|
+
)}
|
|
598
|
+
</div>
|
|
599
|
+
</React.Fragment>
|
|
600
|
+
)}
|
|
601
|
+
{mode12h && (
|
|
602
|
+
<div className="TimePicker-AM/PM" css={_TimePickerAMPMCSS}>
|
|
603
|
+
<Button
|
|
604
|
+
onClick={() => setTimeValue({ ...timeValue, text: 'AM' })}
|
|
605
|
+
label="AM"
|
|
606
|
+
labelProps={{ type: 'heading4' }}
|
|
607
|
+
/>
|
|
608
|
+
<Button
|
|
609
|
+
onClick={() => setTimeValue({ ...timeValue, text: 'PM' })}
|
|
610
|
+
label="PM"
|
|
611
|
+
labelProps={{ type: 'heading4' }}
|
|
612
|
+
/>
|
|
613
|
+
</div>
|
|
614
|
+
)}
|
|
615
|
+
</div>
|
|
616
|
+
<Divider />
|
|
617
|
+
<div className="DGN-UI-TimePicker-Footer" css={_TimePickerFooterCSS}>
|
|
618
|
+
<Button
|
|
619
|
+
viewType="link"
|
|
620
|
+
size="medium"
|
|
621
|
+
label={nowText}
|
|
622
|
+
onClick={() => onSelectTime(true)}
|
|
623
|
+
labelProps={{ format: ['sentence'] }}
|
|
624
|
+
color="system/rest"
|
|
625
|
+
/>
|
|
626
|
+
<Button
|
|
627
|
+
viewType="link"
|
|
628
|
+
size="medium"
|
|
629
|
+
label={saveText}
|
|
630
|
+
onClick={() => onSelectTime(false)}
|
|
631
|
+
labelProps={{ format: ['sentence'] }}
|
|
632
|
+
color="info"
|
|
633
|
+
/>
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
</Popover>
|
|
637
|
+
)}
|
|
638
|
+
{isError && (
|
|
639
|
+
<HelperText
|
|
640
|
+
{...errorProps}
|
|
641
|
+
style={{ minHeight: 16, position: 'absolute', top: '100%' }}
|
|
642
|
+
disabled={disabled}
|
|
643
|
+
>
|
|
644
|
+
{error}
|
|
645
|
+
</HelperText>
|
|
646
|
+
)}
|
|
647
|
+
</div>
|
|
648
|
+
);
|
|
649
|
+
})
|
|
650
|
+
);
|
|
651
|
+
|
|
652
|
+
const TimePickerCSS = ({ spacing }) => css`
|
|
653
|
+
margin-top: ${spacing([1])};
|
|
654
|
+
`;
|
|
655
|
+
|
|
656
|
+
const TimePickerBodyCSS = (currentInputFocus, { colors, spacing, typography }) => css`
|
|
657
|
+
${typography.body1};
|
|
658
|
+
margin: ${spacing([2, 4])};
|
|
659
|
+
${displayFlex};
|
|
660
|
+
${justifyCenter};
|
|
661
|
+
${itemsCenter};
|
|
662
|
+
${parseMinHeight(88)};
|
|
663
|
+
.DGN-UI-NumberInput {
|
|
664
|
+
margin: ${spacing([0])};
|
|
665
|
+
.DGN-UI-InputBase {
|
|
666
|
+
${parseHeight(40)};
|
|
667
|
+
${parseWidth(48)};
|
|
668
|
+
margin: ${spacing([0])};
|
|
669
|
+
padding: ${spacing([0])};
|
|
670
|
+
${bgColor(hexToRGBA(getProp(colors, 'system/active'), 0.1))}
|
|
671
|
+
${borderNone};
|
|
672
|
+
${borderColor(getProp(colors, 'semantic/info'))};
|
|
673
|
+
input {
|
|
674
|
+
${parseWidthHeight('100%')};
|
|
675
|
+
${textCenter};
|
|
676
|
+
${typography.body1};
|
|
677
|
+
&:hover,
|
|
678
|
+
&:focus {
|
|
679
|
+
${bgColor(hexToRGBA(getProp(colors, 'semantic/info'), 0.2))};
|
|
680
|
+
${textColor(getProp(colors, 'semantic/info'))};
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
.DGN-UI-TimePicker-Input:nth-of-type(${currentInputFocus}) {
|
|
686
|
+
.DGN-UI-NumberInput {
|
|
687
|
+
.DGN-UI-InputBase {
|
|
688
|
+
${border(2)};
|
|
689
|
+
${borderColor(getProp(colors, 'semantic/info'))};
|
|
690
|
+
input {
|
|
691
|
+
${borderRadius4px};
|
|
692
|
+
${bgColor(hexToRGBA(getProp(colors, 'semantic/info'), 0.2))};
|
|
693
|
+
${textColor(getProp(colors, 'semantic/info'))};
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
.DGN-UI-Typography {
|
|
699
|
+
padding: ${spacing([0, 0.5])};
|
|
700
|
+
}
|
|
701
|
+
`;
|
|
702
|
+
|
|
703
|
+
const TimePickerInputCSS = css`
|
|
704
|
+
${flexCol};
|
|
705
|
+
${itemsCenter};
|
|
706
|
+
`;
|
|
707
|
+
|
|
708
|
+
const TimePickerFooterCSS = ({ spacing }) => css`
|
|
709
|
+
${displayFlex};
|
|
710
|
+
${justifyBetween};
|
|
711
|
+
${itemsCenter};
|
|
712
|
+
.DGN-UI-Button {
|
|
713
|
+
padding: ${spacing([2, 4])};
|
|
714
|
+
}
|
|
715
|
+
`;
|
|
716
|
+
|
|
717
|
+
const TimePickerAMPMCSS = (currentText, { colors, spacing }) => css`
|
|
718
|
+
${flexCol};
|
|
719
|
+
${parseHeight(40)};
|
|
720
|
+
${justifyBetween};
|
|
721
|
+
margin-left: ${spacing([2])};
|
|
722
|
+
button:nth-of-type(${currentText === 'AM' ? 1 : 2}) {
|
|
723
|
+
${bgColor(hexToRGBA(getProp(colors, 'semantic/info'), 0.2))};
|
|
724
|
+
${textColor(getProp(colors, 'semantic/info'))};
|
|
725
|
+
}
|
|
726
|
+
button {
|
|
727
|
+
&:hover,
|
|
728
|
+
&:focus {
|
|
729
|
+
${bgColor(hexToRGBA(getProp(colors, 'semantic/info'), 0.2))};
|
|
730
|
+
${textColor(getProp(colors, 'semantic/info'))};
|
|
731
|
+
}
|
|
732
|
+
padding: ${spacing([0])};
|
|
733
|
+
${parseHeight(18)};
|
|
734
|
+
${parseMinHeight(18)};
|
|
735
|
+
${parseWidth(32)};
|
|
736
|
+
}
|
|
737
|
+
`;
|
|
738
|
+
|
|
739
|
+
TimePicker.propTypes = {
|
|
740
|
+
/** CSS class for the component. ({container: '', header: '', body: '', footer: ''}) */
|
|
741
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
742
|
+
/** If `true`, the form control will be disabled. */
|
|
743
|
+
disabled: PropTypes.bool,
|
|
744
|
+
/** Format to display value. */
|
|
745
|
+
displayFormat: PropTypes.oneOfType([PropTypes.oneOf(['HH:mm', 'HH:mm:ss']), PropTypes.string]),
|
|
746
|
+
/** The default value of the component. */
|
|
747
|
+
defaultValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string, PropTypes.object]),
|
|
748
|
+
/** Error of the form control. */
|
|
749
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
750
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) of helper text. */
|
|
751
|
+
errorProps: PropTypes.object,
|
|
752
|
+
/** [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) applied to the input element. */
|
|
753
|
+
inputProps: PropTypes.object,
|
|
754
|
+
/** Inline style of the input element. */
|
|
755
|
+
inputStyle: PropTypes.object,
|
|
756
|
+
/** Hints for the input. */
|
|
757
|
+
placeholder: PropTypes.string,
|
|
758
|
+
/** Components style mode */
|
|
759
|
+
mode12h: PropTypes.bool,
|
|
760
|
+
/** Minimum value of the time picker. */
|
|
761
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string, PropTypes.object]),
|
|
762
|
+
/** Maximum value of the time picker. */
|
|
763
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string, PropTypes.object]),
|
|
764
|
+
/** Step of the minute. */
|
|
765
|
+
minuteStep: PropTypes.number,
|
|
766
|
+
/** Content of the label element. */
|
|
767
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
768
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label--simple) of label. */
|
|
769
|
+
labelProps: PropTypes.object,
|
|
770
|
+
/** A callback function when the value input changes. */
|
|
771
|
+
onChange: PropTypes.func,
|
|
772
|
+
/** Inline style of the component. */
|
|
773
|
+
style: PropTypes.object,
|
|
774
|
+
/** The value of the input element, required for a controlled component. */
|
|
775
|
+
value: PropTypes.oneOfType([PropTypes.string]),
|
|
776
|
+
/** View type of the form control. */
|
|
777
|
+
viewType: PropTypes.oneOf(['outlined', 'underlined']),
|
|
778
|
+
/** If `true`, the component is readonly. */
|
|
779
|
+
readOnly: PropTypes.bool,
|
|
780
|
+
/** If `true`, the input element is required. */
|
|
781
|
+
required: PropTypes.bool,
|
|
782
|
+
/** Format to display value. */
|
|
783
|
+
returnFormat: PropTypes.oneOfType([PropTypes.oneOf(['HH:mm', 'HH:mm:ss']), PropTypes.string]),
|
|
784
|
+
};
|
|
785
|
+
export default TimePicker;
|