@zohodesk/components 1.0.0-temp-164 → 1.0.0-temp-166
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/README.md +34 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +151 -151
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +450 -450
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css +30 -30
- package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +450 -450
- package/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css +30 -30
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +450 -450
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css +30 -30
- package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +450 -450
- package/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css +30 -30
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +450 -450
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css +30 -30
- package/assets/Appearance/light/mode/Component_LightMode.module.css +148 -148
- package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +450 -450
- package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +30 -30
- package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +450 -450
- package/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css +30 -30
- package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +450 -450
- package/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css +30 -30
- package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +450 -450
- package/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css +30 -30
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +450 -450
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css +30 -30
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +153 -153
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +450 -450
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +450 -450
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +450 -450
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +450 -450
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +450 -450
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css +30 -30
- package/es/Accordion/Accordion.js +8 -3
- package/es/Accordion/AccordionItem.js +5 -2
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +27 -10
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/AppContainer/props/defaultProps.js +2 -1
- package/es/AppContainer/props/propTypes.js +1 -0
- package/es/Avatar/Avatar.js +26 -11
- package/es/Avatar/Avatar.module.css +18 -18
- package/es/AvatarTeam/AvatarTeam.js +4 -3
- package/es/AvatarTeam/AvatarTeam.module.css +35 -35
- package/es/Button/Button.js +5 -3
- package/es/Button/css/Button.module.css +70 -70
- package/es/Buttongroup/Buttongroup.js +4 -3
- package/es/Buttongroup/Buttongroup.module.css +14 -15
- package/es/Card/Card.js +21 -10
- package/es/CheckBox/CheckBox.js +5 -3
- package/es/CheckBox/CheckBox.module.css +15 -15
- package/es/DateTime/CalendarView.js +33 -20
- package/es/DateTime/DateTime.js +113 -12
- package/es/DateTime/DateTime.module.css +39 -39
- package/es/DateTime/DateTimePopupFooter.js +4 -2
- package/es/DateTime/DateTimePopupHeader.js +8 -2
- package/es/DateTime/DateWidget.js +100 -35
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +4 -2
- package/es/DateTime/Time.js +10 -2
- package/es/DateTime/YearView.js +28 -4
- package/es/DateTime/YearView.module.css +15 -15
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
- package/es/DateTime/__tests__/DateTime.spec.js +1 -0
- package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +32 -2
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/props/defaultProps.js +2 -1
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +9 -5
- package/es/DropBox/DropBoxElement/DropBoxElement.js +18 -6
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +85 -79
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +6 -4
- package/es/DropBox/DropBoxElement/props/propTypes.js +1 -1
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
- package/es/DropBox/__tests__/DropBox.spec.js +2 -2
- package/es/DropBox/css/DropBox.module.css +6 -6
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +1 -2
- package/es/DropDown/DropDown.js +10 -5
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +5 -5
- package/es/DropDown/DropDownHeading.module.css +6 -6
- package/es/DropDown/DropDownItem.js +8 -1
- package/es/DropDown/DropDownItem.module.css +12 -12
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -2
- package/es/Heading/Heading.js +3 -3
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +3 -3
- package/es/Label/Label.module.css +5 -5
- package/es/Layout/Box.js +17 -3
- package/es/Layout/Container.js +16 -4
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +1 -2
- package/es/Layout/props/defaultProps.js +2 -0
- package/es/Layout/props/propTypes.js +2 -0
- package/es/Layout/utils.js +5 -1
- package/es/ListItem/ListContainer.js +8 -3
- package/es/ListItem/ListItem.js +9 -3
- package/es/ListItem/ListItem.module.css +38 -38
- package/es/ListItem/ListItemWithAvatar.js +9 -3
- package/es/ListItem/ListItemWithCheckBox.js +7 -2
- package/es/ListItem/ListItemWithIcon.js +8 -3
- package/es/ListItem/ListItemWithRadio.js +7 -3
- package/es/Modal/Modal.js +28 -11
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +90 -13
- package/es/MultiSelect/AdvancedMultiSelect.js +33 -9
- package/es/MultiSelect/EmptyState.js +6 -0
- package/es/MultiSelect/MultiSelect.js +100 -32
- package/es/MultiSelect/MultiSelect.module.css +31 -31
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +13 -6
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +7 -3
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
- package/es/MultiSelect/props/propTypes.js +2 -0
- package/es/PopOver/PopOver.js +18 -2
- package/es/PopOver/__tests__/PopOver.spec.js +2 -1
- package/es/Popup/Popup.js +77 -27
- package/es/Popup/__tests__/Popup.spec.js +17 -5
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/IdProvider.js +10 -5
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Radio/Radio.js +4 -2
- package/es/Radio/Radio.module.css +9 -9
- package/es/Responsive/CustomResponsive.js +30 -18
- package/es/Responsive/RefWrapper.js +6 -7
- package/es/Responsive/ResizeComponent.js +35 -25
- package/es/Responsive/ResizeObserver.js +26 -6
- package/es/Responsive/Responsive.js +34 -20
- package/es/Responsive/index.js +1 -3
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/es/Ribbon/Ribbon.js +4 -2
- package/es/Ribbon/Ribbon.module.css +46 -48
- package/es/RippleEffect/RippleEffect.js +1 -3
- package/es/Select/GroupSelect.js +59 -14
- package/es/Select/Select.js +81 -34
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +19 -4
- package/es/Select/SelectWithIcon.js +48 -6
- package/es/Select/__tests__/Select.spec.js +6 -8
- package/es/Select/props/propTypes.js +1 -0
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +11 -11
- package/es/Switch/Switch.js +6 -3
- package/es/Switch/Switch.module.css +23 -23
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/Tab.module.css +14 -14
- package/es/Tab/TabContent.js +1 -0
- package/es/Tab/TabContentWrapper.js +2 -0
- package/es/Tab/TabWrapper.js +5 -2
- package/es/Tab/Tabs.js +56 -8
- package/es/Tab/Tabs.module.css +24 -42
- package/es/Tab/__tests__/Tab.spec.js +1 -3
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
- package/es/Tag/Tag.js +7 -3
- package/es/Tag/Tag.module.css +25 -25
- package/es/TextBox/TextBox.js +16 -3
- package/es/TextBox/TextBox.module.css +9 -9
- package/es/TextBox/__tests__/TextBox.spec.js +1 -4
- package/es/TextBoxIcon/TextBoxIcon.js +9 -2
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
- package/es/Textarea/Textarea.js +13 -3
- package/es/Textarea/Textarea.module.css +21 -21
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +60 -15
- package/es/Tooltip/Tooltip.module.css +5 -5
- package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
- package/es/common/animation.module.css +8 -8
- package/es/common/avatarsizes.module.css +16 -16
- package/es/common/basicReset.module.css +3 -3
- package/es/common/common.module.css +24 -24
- package/es/common/customscroll.module.css +2 -2
- package/es/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
- package/es/semantic/Button/Button.js +4 -2
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/utils/Common.js +58 -9
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/css/compileClassNames.js +5 -0
- package/es/utils/css/mergeStyle.js +7 -6
- package/es/utils/css/utils.js +1 -0
- package/es/utils/datetime/GMTZones.js +48 -0
- package/es/utils/datetime/common.js +31 -7
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +68 -11
- package/es/utils/getInitial.js +4 -0
- package/es/utils/shallowEqual.js +6 -0
- package/lib/Accordion/Accordion.js +43 -18
- package/lib/Accordion/AccordionItem.js +41 -18
- package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/propTypes.js +3 -0
- package/lib/Animation/Animation.js +38 -18
- package/lib/Animation/__tests__/Animation.spec.js +11 -7
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/AppContainer/AppContainer.js +66 -26
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/defaultProps.js +2 -1
- package/lib/AppContainer/props/propTypes.js +4 -0
- package/lib/Avatar/Avatar.js +81 -38
- package/lib/Avatar/Avatar.module.css +18 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
- package/lib/Avatar/props/propTypes.js +3 -0
- package/lib/AvatarTeam/AvatarTeam.js +53 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +35 -35
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
- package/lib/AvatarTeam/props/propTypes.js +3 -0
- package/lib/Button/Button.js +32 -20
- package/lib/Button/css/Button.module.css +70 -70
- package/lib/Button/css/cssJSLogic.js +18 -17
- package/lib/Button/index.js +3 -0
- package/lib/Button/props/defaultProps.js +2 -0
- package/lib/Button/props/propTypes.js +3 -0
- package/lib/Buttongroup/Buttongroup.js +33 -12
- package/lib/Buttongroup/Buttongroup.module.css +14 -15
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
- package/lib/Buttongroup/props/propTypes.js +3 -0
- package/lib/Card/Card.js +102 -46
- package/lib/Card/__tests__/Card.spec.js +10 -1
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/propTypes.js +3 -0
- package/lib/CheckBox/CheckBox.js +71 -47
- package/lib/CheckBox/CheckBox.module.css +15 -15
- package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
- package/lib/CheckBox/props/propTypes.js +3 -0
- package/lib/DateTime/CalendarView.js +83 -42
- package/lib/DateTime/DateTime.js +287 -160
- package/lib/DateTime/DateTime.module.css +39 -39
- package/lib/DateTime/DateTimePopupFooter.js +31 -8
- package/lib/DateTime/DateTimePopupHeader.js +48 -17
- package/lib/DateTime/DateWidget.js +354 -250
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +27 -5
- package/lib/DateTime/Time.js +73 -32
- package/lib/DateTime/YearView.js +77 -28
- package/lib/DateTime/YearView.module.css +15 -15
- package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
- package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
- package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
- package/lib/DateTime/dateFormatUtils/index.js +74 -16
- package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +54 -22
- package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
- package/lib/DateTime/index.js +2 -0
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/defaultProps.js +2 -1
- package/lib/DateTime/props/propTypes.js +11 -1
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +73 -10
- package/lib/DropBox/DropBox.js +36 -12
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +68 -42
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +85 -79
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +43 -34
- package/lib/DropBox/DropBoxElement/props/propTypes.js +4 -1
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
- package/lib/DropBox/__tests__/DropBox.spec.js +8 -4
- package/lib/DropBox/css/DropBox.module.css +6 -6
- package/lib/DropBox/css/cssJSLogic.js +3 -1
- package/lib/DropBox/props/defaultProps.js +8 -4
- package/lib/DropBox/props/propTypes.js +10 -4
- package/lib/DropDown/DropDown.js +54 -9
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +40 -20
- package/lib/DropDown/DropDownHeading.module.css +6 -6
- package/lib/DropDown/DropDownItem.js +44 -21
- package/lib/DropDown/DropDownItem.module.css +12 -12
- package/lib/DropDown/DropDownSearch.js +40 -17
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.js +24 -4
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
- package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
- package/lib/DropDown/index.js +9 -0
- package/lib/DropDown/props/propTypes.js +6 -4
- package/lib/Heading/Heading.js +39 -16
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +40 -19
- package/lib/Label/Label.module.css +5 -5
- package/lib/Label/__tests__/Label.spec.js +14 -1
- package/lib/Label/props/propTypes.js +3 -0
- package/lib/Layout/Box.js +39 -15
- package/lib/Layout/Container.js +37 -14
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/__tests__/Box.spec.js +65 -49
- package/lib/Layout/__tests__/Container.spec.js +67 -50
- package/lib/Layout/index.js +3 -0
- package/lib/Layout/props/defaultProps.js +2 -0
- package/lib/Layout/props/propTypes.js +5 -0
- package/lib/Layout/utils.js +15 -1
- package/lib/ListItem/ListContainer.js +48 -27
- package/lib/ListItem/ListItem.js +69 -45
- package/lib/ListItem/ListItem.module.css +38 -38
- package/lib/ListItem/ListItemWithAvatar.js +75 -48
- package/lib/ListItem/ListItemWithCheckBox.js +64 -39
- package/lib/ListItem/ListItemWithIcon.js +68 -44
- package/lib/ListItem/ListItemWithRadio.js +65 -41
- package/lib/ListItem/index.js +7 -0
- package/lib/ListItem/props/propTypes.js +6 -4
- package/lib/Modal/Modal.js +45 -10
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +295 -166
- package/lib/MultiSelect/AdvancedMultiSelect.js +203 -125
- package/lib/MultiSelect/EmptyState.js +49 -24
- package/lib/MultiSelect/MultiSelect.js +324 -206
- package/lib/MultiSelect/MultiSelect.module.css +31 -31
- package/lib/MultiSelect/MultiSelectHeader.js +30 -8
- package/lib/MultiSelect/MultiSelectWithAvatar.js +106 -63
- package/lib/MultiSelect/SelectedOptions.js +43 -17
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +64 -32
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
- package/lib/MultiSelect/index.js +5 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +5 -0
- package/lib/PopOver/PopOver.js +95 -49
- package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
- package/lib/PopOver/index.js +4 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -84
- package/lib/Popup/__tests__/Popup.spec.js +43 -8
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +4 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +17 -6
- package/lib/Provider/LibraryContext.js +35 -15
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +5 -0
- package/lib/Radio/Radio.js +61 -38
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radiospec.js +9 -5
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +73 -29
- package/lib/Responsive/RefWrapper.js +17 -11
- package/lib/Responsive/ResizeComponent.js +62 -36
- package/lib/Responsive/ResizeObserver.js +24 -10
- package/lib/Responsive/Responsive.js +80 -30
- package/lib/Responsive/index.js +4 -0
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +53 -17
- package/lib/Responsive/utils/index.js +11 -3
- package/lib/Responsive/utils/shallowCompare.js +11 -2
- package/lib/Responsive/windowResizeObserver.js +8 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
- package/lib/Ribbon/Ribbon.js +34 -13
- package/lib/Ribbon/Ribbon.module.css +46 -48
- package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
- package/lib/Ribbon/props/propTypes.js +3 -0
- package/lib/RippleEffect/RippleEffect.js +18 -10
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +230 -130
- package/lib/Select/Select.js +292 -210
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +104 -56
- package/lib/Select/SelectWithIcon.js +134 -77
- package/lib/Select/__tests__/Select.spec.js +133 -91
- package/lib/Select/index.js +5 -0
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +4 -0
- package/lib/Stencils/Stencils.js +29 -10
- package/lib/Stencils/Stencils.module.css +11 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +58 -34
- package/lib/Switch/Switch.module.css +23 -23
- package/lib/Switch/props/propTypes.js +3 -0
- package/lib/Tab/Tab.js +40 -27
- package/lib/Tab/Tab.module.css +14 -14
- package/lib/Tab/TabContent.js +12 -5
- package/lib/Tab/TabContentWrapper.js +13 -6
- package/lib/Tab/TabWrapper.js +37 -19
- package/lib/Tab/Tabs.js +173 -92
- package/lib/Tab/Tabs.module.css +24 -42
- package/lib/Tab/__tests__/Tab.spec.js +67 -58
- package/lib/Tab/__tests__/TabContent.spec.js +10 -6
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
- package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
- package/lib/Tab/__tests__/Tabs.spec.js +53 -39
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/propTypes.js +3 -0
- package/lib/Tag/Tag.js +73 -43
- package/lib/Tag/Tag.module.css +25 -25
- package/lib/Tag/__tests__/Tag.spec.js +14 -8
- package/lib/Tag/props/propTypes.js +3 -0
- package/lib/TextBox/TextBox.js +86 -59
- package/lib/TextBox/TextBox.module.css +9 -9
- package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
- package/lib/TextBox/props/propTypes.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +79 -52
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -5
- package/lib/TextBoxIcon/props/propTypes.js +3 -0
- package/lib/Textarea/Textarea.js +55 -29
- package/lib/Textarea/Textarea.module.css +21 -21
- package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
- package/lib/Textarea/props/propTypes.js +3 -0
- package/lib/Tooltip/Tooltip.js +96 -32
- package/lib/Tooltip/Tooltip.module.css +5 -5
- package/lib/Tooltip/__tests__/Tooltip.spec.js +24 -3
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +3 -0
- package/lib/common/animation.module.css +8 -8
- package/lib/common/avatarsizes.module.css +16 -16
- package/lib/common/basicReset.module.css +3 -3
- package/lib/common/common.module.css +24 -24
- package/lib/common/customscroll.module.css +2 -2
- package/lib/css.js +40 -0
- package/lib/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/lib/deprecated/PortalLayer/PortalLayer.js +46 -23
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +57 -0
- package/lib/semantic/Button/Button.js +43 -22
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +2 -0
- package/lib/utils/Common.js +117 -19
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/__tests__/constructFullName.spec.js +1 -0
- package/lib/utils/__tests__/debounce.spec.js +3 -2
- package/lib/utils/__tests__/getInitial.spec.js +1 -0
- package/lib/utils/constructFullName.js +13 -4
- package/lib/utils/css/compileClassNames.js +6 -0
- package/lib/utils/css/mergeStyle.js +10 -7
- package/lib/utils/css/utils.js +8 -0
- package/lib/utils/datetime/GMTZones.js +55 -0
- package/lib/utils/datetime/common.js +52 -7
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +175 -59
- package/lib/utils/dummyFunction.js +2 -0
- package/lib/utils/getHTMLFontSize.js +1 -0
- package/lib/utils/getInitial.js +6 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/package.json +18 -27
package/es/DateTime/DateTime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint css-modules/no-unused-class: [0, { markAsUsed: ['datesStr', 'dateContainer', 'dateRow', 'today', 'emptySpan', 'dropDown'] }] */
|
|
2
|
-
/* eslint-disable react/forbid-component-props */
|
|
3
2
|
|
|
3
|
+
/* eslint-disable react/forbid-component-props */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { DateTime_propTypes } from './props/propTypes';
|
|
6
6
|
import { DateTime_defaultProps } from './props/defaultProps';
|
|
@@ -17,11 +17,13 @@ import { monthNamesDefault, monthNamesShortDefault, dayNamesDefault, dayNamesSho
|
|
|
17
17
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
18
18
|
import { Box } from '../Layout';
|
|
19
19
|
import { getHourSuggestions, getMinuteSuggestions, addZeroIfNeeded } from './dateFormatUtils';
|
|
20
|
+
|
|
20
21
|
function title(date, year, month) {
|
|
21
22
|
let monthNames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
22
23
|
const HeadingText = `${monthNames[month] || ''} ${year}`;
|
|
23
24
|
return HeadingText;
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
export default class DateTime extends React.PureComponent {
|
|
26
28
|
constructor(props) {
|
|
27
29
|
super(props);
|
|
@@ -44,9 +46,11 @@ export default class DateTime extends React.PureComponent {
|
|
|
44
46
|
this.handleSelectMonthViaYearView = this.handleSelectMonthViaYearView.bind(this);
|
|
45
47
|
this.handleGetStateValues = this.handleGetStateValues.bind(this);
|
|
46
48
|
this.handleYearViewToggle = this.handleYearViewToggle.bind(this);
|
|
49
|
+
this.getInitialDate = this.getInitialDate.bind(this);
|
|
47
50
|
const {
|
|
48
51
|
ampmText = ampmTextDefault
|
|
49
52
|
} = props.i18nKeys;
|
|
53
|
+
|
|
50
54
|
this.ampmSuggestions = (() => {
|
|
51
55
|
const ampmSuggestions = [];
|
|
52
56
|
ampmText.forEach((text, index) => {
|
|
@@ -64,24 +68,29 @@ export default class DateTime extends React.PureComponent {
|
|
|
64
68
|
});
|
|
65
69
|
return ampmSuggestions;
|
|
66
70
|
})();
|
|
71
|
+
|
|
67
72
|
const initalStateObj = this.getStateFromProps(props);
|
|
68
73
|
this.state = Object.assign({}, initalStateObj, {
|
|
69
74
|
isYearView: false,
|
|
70
75
|
isMonthOpen: false
|
|
71
76
|
});
|
|
72
77
|
}
|
|
78
|
+
|
|
73
79
|
componentDidMount() {
|
|
74
80
|
this.handleExposeMethods(true);
|
|
75
81
|
}
|
|
82
|
+
|
|
76
83
|
componentDidUpdate(prevProps) {
|
|
77
84
|
const {
|
|
78
85
|
value,
|
|
79
86
|
isActive,
|
|
80
87
|
is24Hour
|
|
81
88
|
} = this.props;
|
|
89
|
+
|
|
82
90
|
if (prevProps.value !== value || is24Hour !== prevProps.is24Hour) {
|
|
83
91
|
this.setState(this.getStateFromProps(this.props));
|
|
84
92
|
}
|
|
93
|
+
|
|
85
94
|
if (prevProps.isActive !== isActive && !isActive) {
|
|
86
95
|
this.setState({
|
|
87
96
|
isYearView: false,
|
|
@@ -89,9 +98,38 @@ export default class DateTime extends React.PureComponent {
|
|
|
89
98
|
});
|
|
90
99
|
}
|
|
91
100
|
}
|
|
101
|
+
|
|
92
102
|
componentWillUnmount() {
|
|
93
103
|
this.handleExposeMethods(false);
|
|
94
104
|
}
|
|
105
|
+
|
|
106
|
+
getInitialDate(value) {
|
|
107
|
+
let timeZone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
108
|
+
let isDateTime = arguments.length > 2 ? arguments[2] : undefined;
|
|
109
|
+
let result = null;
|
|
110
|
+
|
|
111
|
+
if (isDateTime) {
|
|
112
|
+
if (timeZone && value) {
|
|
113
|
+
result = datetime.toDate(datetime.tz.utcToTz(value, timeZone));
|
|
114
|
+
} else {
|
|
115
|
+
value = value.replace('Z', '');
|
|
116
|
+
result = new Date(value);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
if (value) {
|
|
120
|
+
if (timeZone) {
|
|
121
|
+
result = datetime.toDate(value);
|
|
122
|
+
} else {
|
|
123
|
+
result = new Date(value);
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
result = new Date();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
|
|
95
133
|
getStateFromProps(props) {
|
|
96
134
|
let date, month, year, hours, mins, amPm;
|
|
97
135
|
let {
|
|
@@ -102,18 +140,21 @@ export default class DateTime extends React.PureComponent {
|
|
|
102
140
|
isDateTimeField,
|
|
103
141
|
is24Hour
|
|
104
142
|
} = props; //defaultTime --> 12:00:PM
|
|
143
|
+
|
|
105
144
|
defaultTime = needDefaultTime ? defaultTime ? defaultTime : '12:00:PM' : '';
|
|
106
145
|
let defaultHour, defaultMin, defaultAmPm;
|
|
107
146
|
let todayObj = new Date();
|
|
108
147
|
let todayDate = todayObj.getDate();
|
|
109
148
|
let todayMonth = todayObj.getMonth();
|
|
110
149
|
let todayYear = todayObj.getFullYear();
|
|
150
|
+
|
|
111
151
|
if (!value) {
|
|
112
152
|
[defaultHour, defaultMin, defaultAmPm] = defaultTime ? defaultTime.split(':') : [];
|
|
113
153
|
defaultHour = parseInt(defaultHour);
|
|
114
154
|
defaultMin = parseInt(defaultMin);
|
|
115
155
|
}
|
|
116
|
-
|
|
156
|
+
|
|
157
|
+
const dateObj = this.getInitialDate(value, timeZone, isDateTimeField);
|
|
117
158
|
date = dateObj.getDate();
|
|
118
159
|
month = dateObj.getMonth();
|
|
119
160
|
year = dateObj.getFullYear();
|
|
@@ -134,8 +175,10 @@ export default class DateTime extends React.PureComponent {
|
|
|
134
175
|
todayYear
|
|
135
176
|
};
|
|
136
177
|
}
|
|
178
|
+
|
|
137
179
|
getHours(hoursParam, is24Hour) {
|
|
138
180
|
let hours = hoursParam;
|
|
181
|
+
|
|
139
182
|
if (!is24Hour) {
|
|
140
183
|
if (hours === 0) {
|
|
141
184
|
hours = 12;
|
|
@@ -143,9 +186,11 @@ export default class DateTime extends React.PureComponent {
|
|
|
143
186
|
hours -= 12;
|
|
144
187
|
}
|
|
145
188
|
}
|
|
189
|
+
|
|
146
190
|
hours = addZeroIfNeeded(hours);
|
|
147
191
|
return hours;
|
|
148
192
|
}
|
|
193
|
+
|
|
149
194
|
handleGetSelectedDate() {
|
|
150
195
|
let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
151
196
|
const {
|
|
@@ -154,7 +199,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
154
199
|
timeZone,
|
|
155
200
|
isDateTimeField,
|
|
156
201
|
dateFormat,
|
|
157
|
-
is24Hour
|
|
202
|
+
is24Hour,
|
|
203
|
+
customDateFormat
|
|
158
204
|
} = this.props;
|
|
159
205
|
let {
|
|
160
206
|
year,
|
|
@@ -164,32 +210,47 @@ export default class DateTime extends React.PureComponent {
|
|
|
164
210
|
mins,
|
|
165
211
|
amPm
|
|
166
212
|
} = selectedInfo;
|
|
213
|
+
|
|
167
214
|
if (!is24Hour) {
|
|
168
215
|
if (parseInt(hours) === 12) {
|
|
169
216
|
hours = amPm === 'AM' ? 0 : 12;
|
|
170
217
|
}
|
|
218
|
+
|
|
171
219
|
if (amPm === 'PM') {
|
|
172
220
|
if (hours < 12) {
|
|
173
221
|
hours = parseInt(hours) + 12;
|
|
174
222
|
}
|
|
175
223
|
}
|
|
176
224
|
}
|
|
225
|
+
|
|
177
226
|
let minInMillis = min ? datetime.millis(min) : null,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
227
|
+
maxInMillis = max ? datetime.millis(max) : null,
|
|
228
|
+
selectedInMillis,
|
|
229
|
+
selectedValue = '',
|
|
230
|
+
formattedValue;
|
|
231
|
+
let currentDate = new Date();
|
|
232
|
+
let sec = currentDate.getSeconds();
|
|
233
|
+
let milliSec = currentDate.getMilliseconds();
|
|
234
|
+
|
|
235
|
+
if (isDateTimeField || customDateFormat) {
|
|
236
|
+
const dateArgs = [year, month, date, hours, mins];
|
|
237
|
+
|
|
238
|
+
if (customDateFormat) {
|
|
239
|
+
dateArgs.push(sec, milliSec);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
selectedInMillis = timeZone ? datetime.tz.tzToUtc(Date.UTC(...dateArgs), timeZone) : Date.UTC(...dateArgs);
|
|
184
243
|
selectedValue = datetime.ISO(selectedInMillis);
|
|
185
|
-
formattedValue = formatDate(new Date(
|
|
244
|
+
formattedValue = formatDate(new Date(...dateArgs), customDateFormat == null ? is24Hour ? `${dateFormat} HH:mm:ss` : `${dateFormat} hh:mm:ss A` : `${customDateFormat}`);
|
|
186
245
|
} else {
|
|
187
246
|
selectedInMillis = Date.UTC(year, month, date);
|
|
188
247
|
selectedValue = formatDate(new Date(year, month, date), 'YYYY-MM-DD');
|
|
189
248
|
formattedValue = formatDate(new Date(year, month, date), dateFormat);
|
|
190
249
|
}
|
|
250
|
+
|
|
191
251
|
let isError = false;
|
|
192
252
|
let errorType = '';
|
|
253
|
+
|
|
193
254
|
if (minInMillis && minInMillis > selectedInMillis) {
|
|
194
255
|
isError = true;
|
|
195
256
|
errorType = 'MIN';
|
|
@@ -197,6 +258,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
197
258
|
isError = true;
|
|
198
259
|
errorType = 'MAX';
|
|
199
260
|
}
|
|
261
|
+
|
|
200
262
|
return {
|
|
201
263
|
isError,
|
|
202
264
|
errorType,
|
|
@@ -204,6 +266,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
204
266
|
formattedValue
|
|
205
267
|
};
|
|
206
268
|
}
|
|
269
|
+
|
|
207
270
|
handleSelect(e) {
|
|
208
271
|
e && e.preventDefault();
|
|
209
272
|
const {
|
|
@@ -233,6 +296,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
233
296
|
mins,
|
|
234
297
|
amPm
|
|
235
298
|
});
|
|
299
|
+
|
|
236
300
|
if (isError) {
|
|
237
301
|
if (errorType === 'MIN') {
|
|
238
302
|
onError && onError(minErrorText, true);
|
|
@@ -243,6 +307,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
243
307
|
onSelect(selectedValue, formattedValue, e);
|
|
244
308
|
}
|
|
245
309
|
}
|
|
310
|
+
|
|
246
311
|
handleChange() {
|
|
247
312
|
let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
248
313
|
const {
|
|
@@ -275,6 +340,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
275
340
|
mins: getIsEmptyValue(mins) ? oldMins : mins,
|
|
276
341
|
amPm: getIsEmptyValue(amPm) ? oldAMPM : amPm
|
|
277
342
|
};
|
|
343
|
+
|
|
278
344
|
if (onChange) {
|
|
279
345
|
const {
|
|
280
346
|
isError,
|
|
@@ -282,6 +348,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
282
348
|
selectedValue,
|
|
283
349
|
formattedValue
|
|
284
350
|
} = this.handleGetSelectedDate(newSelectedInfo);
|
|
351
|
+
|
|
285
352
|
if (isError) {
|
|
286
353
|
if (errorType === 'MIN') {
|
|
287
354
|
onError && onError(minErrorText, true);
|
|
@@ -296,17 +363,20 @@ export default class DateTime extends React.PureComponent {
|
|
|
296
363
|
this.setState(newSelectedInfo);
|
|
297
364
|
}
|
|
298
365
|
}
|
|
366
|
+
|
|
299
367
|
handleClear(e) {
|
|
300
368
|
const {
|
|
301
369
|
onSelect,
|
|
302
370
|
onClear
|
|
303
371
|
} = this.props;
|
|
372
|
+
|
|
304
373
|
if (onClear) {
|
|
305
374
|
onClear(e);
|
|
306
375
|
} else {
|
|
307
376
|
onSelect('', '', e);
|
|
308
377
|
}
|
|
309
378
|
}
|
|
379
|
+
|
|
310
380
|
dateSelect(date, month, year, e) {
|
|
311
381
|
this.handleChange({
|
|
312
382
|
date,
|
|
@@ -338,6 +408,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
338
408
|
mins,
|
|
339
409
|
amPm
|
|
340
410
|
});
|
|
411
|
+
|
|
341
412
|
if (isError) {
|
|
342
413
|
if (errorType === 'MIN') {
|
|
343
414
|
onError && onError(minErrorText, true);
|
|
@@ -348,26 +419,31 @@ export default class DateTime extends React.PureComponent {
|
|
|
348
419
|
onDateSelect && onDateSelect(selectedValue, formattedValue, e);
|
|
349
420
|
}
|
|
350
421
|
}
|
|
422
|
+
|
|
351
423
|
hoursSelect(hours) {
|
|
352
424
|
this.handleChange({
|
|
353
425
|
hours
|
|
354
426
|
});
|
|
355
427
|
}
|
|
428
|
+
|
|
356
429
|
minutesSelect(mins) {
|
|
357
430
|
this.handleChange({
|
|
358
431
|
mins
|
|
359
432
|
});
|
|
360
433
|
}
|
|
434
|
+
|
|
361
435
|
amPmSelect(amPm) {
|
|
362
436
|
this.handleChange({
|
|
363
437
|
amPm
|
|
364
438
|
});
|
|
365
439
|
}
|
|
366
|
-
|
|
367
440
|
/*global closeGroupPopups*/
|
|
441
|
+
|
|
442
|
+
|
|
368
443
|
closePopup() {
|
|
369
444
|
closeGroupPopups('calender');
|
|
370
445
|
}
|
|
446
|
+
|
|
371
447
|
handleCalendarNavigation(type, selectedInfo) {
|
|
372
448
|
const {
|
|
373
449
|
year: stateYear,
|
|
@@ -377,10 +453,12 @@ export default class DateTime extends React.PureComponent {
|
|
|
377
453
|
let date = stateDate;
|
|
378
454
|
let month = stateMonth;
|
|
379
455
|
const year = stateYear;
|
|
456
|
+
|
|
380
457
|
const getDate = (month, year) => {
|
|
381
458
|
const monthEnd = getMonthEnd(month, year);
|
|
382
459
|
return monthEnd >= parseInt(date) ? date : monthEnd;
|
|
383
460
|
};
|
|
461
|
+
|
|
384
462
|
const modifyCalendarRecursion = recursionType => {
|
|
385
463
|
if (recursionType === 'nextYear') {
|
|
386
464
|
//Click next year icon
|
|
@@ -404,6 +482,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
404
482
|
month = 0;
|
|
405
483
|
return modifyCalendarRecursion('nextYear');
|
|
406
484
|
}
|
|
485
|
+
|
|
407
486
|
const newMonth = month + 1;
|
|
408
487
|
return {
|
|
409
488
|
date: getDate(newMonth, year),
|
|
@@ -416,6 +495,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
416
495
|
month = 11;
|
|
417
496
|
return modifyCalendarRecursion('previousYear');
|
|
418
497
|
}
|
|
498
|
+
|
|
419
499
|
const newMonth = month - 1;
|
|
420
500
|
return {
|
|
421
501
|
date: getDate(newMonth, year),
|
|
@@ -424,10 +504,12 @@ export default class DateTime extends React.PureComponent {
|
|
|
424
504
|
};
|
|
425
505
|
} else if (recursionType === 'nextDate') {
|
|
426
506
|
const monthEnd = getMonthEnd(month, year);
|
|
507
|
+
|
|
427
508
|
if (date === monthEnd) {
|
|
428
509
|
date = 1;
|
|
429
510
|
return modifyCalendarRecursion('nextMonth');
|
|
430
511
|
}
|
|
512
|
+
|
|
431
513
|
const newDate = parseInt(date) + 1;
|
|
432
514
|
return {
|
|
433
515
|
date: newDate,
|
|
@@ -439,6 +521,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
439
521
|
date = month === 0 ? getMonthEnd(11, year - 1) : getMonthEnd(month - 1, year);
|
|
440
522
|
return modifyCalendarRecursion('previousMonth');
|
|
441
523
|
}
|
|
524
|
+
|
|
442
525
|
const newDate = parseInt(date) - 1;
|
|
443
526
|
return {
|
|
444
527
|
date: newDate,
|
|
@@ -447,8 +530,10 @@ export default class DateTime extends React.PureComponent {
|
|
|
447
530
|
};
|
|
448
531
|
}
|
|
449
532
|
};
|
|
533
|
+
|
|
450
534
|
return modifyCalendarRecursion(type);
|
|
451
535
|
}
|
|
536
|
+
|
|
452
537
|
modifyCalendar(type) {
|
|
453
538
|
const {
|
|
454
539
|
year,
|
|
@@ -461,9 +546,11 @@ export default class DateTime extends React.PureComponent {
|
|
|
461
546
|
date
|
|
462
547
|
}));
|
|
463
548
|
}
|
|
549
|
+
|
|
464
550
|
handleDateReset() {
|
|
465
551
|
this.setState(this.getStateFromProps(this.props));
|
|
466
552
|
}
|
|
553
|
+
|
|
467
554
|
handleGetStateValues() {
|
|
468
555
|
const {
|
|
469
556
|
isActive
|
|
@@ -478,17 +565,20 @@ export default class DateTime extends React.PureComponent {
|
|
|
478
565
|
isMonthOpen
|
|
479
566
|
};
|
|
480
567
|
}
|
|
568
|
+
|
|
481
569
|
handleYearViewToggle(isYearOpen, isMonthOpen) {
|
|
482
570
|
this.setState({
|
|
483
571
|
isYearView: isYearOpen,
|
|
484
572
|
isMonthOpen
|
|
485
573
|
});
|
|
486
574
|
}
|
|
575
|
+
|
|
487
576
|
handleExposeMethods(isMount) {
|
|
488
577
|
const {
|
|
489
578
|
getMethods
|
|
490
579
|
} = this.props;
|
|
491
580
|
let methods = {};
|
|
581
|
+
|
|
492
582
|
if (isMount) {
|
|
493
583
|
methods = {
|
|
494
584
|
resetLocalDate: this.handleDateReset,
|
|
@@ -502,8 +592,10 @@ export default class DateTime extends React.PureComponent {
|
|
|
502
592
|
toggleYearView: null
|
|
503
593
|
};
|
|
504
594
|
}
|
|
595
|
+
|
|
505
596
|
getMethods && getMethods(methods);
|
|
506
597
|
}
|
|
598
|
+
|
|
507
599
|
handleOpenYearView() {
|
|
508
600
|
const {
|
|
509
601
|
isYearView,
|
|
@@ -514,12 +606,14 @@ export default class DateTime extends React.PureComponent {
|
|
|
514
606
|
isMonthOpen: !isMonthOpen
|
|
515
607
|
});
|
|
516
608
|
}
|
|
609
|
+
|
|
517
610
|
handleSelectYear(year) {
|
|
518
611
|
this.setState({
|
|
519
612
|
year,
|
|
520
613
|
isMonthOpen: true
|
|
521
614
|
});
|
|
522
615
|
}
|
|
616
|
+
|
|
523
617
|
handleSelectMonth(month) {
|
|
524
618
|
const {
|
|
525
619
|
date,
|
|
@@ -527,14 +621,17 @@ export default class DateTime extends React.PureComponent {
|
|
|
527
621
|
} = this.state;
|
|
528
622
|
const monthEnd = getMonthEnd(month, year);
|
|
529
623
|
let newDate = date;
|
|
624
|
+
|
|
530
625
|
if (date > monthEnd) {
|
|
531
626
|
newDate = monthEnd;
|
|
532
627
|
}
|
|
628
|
+
|
|
533
629
|
this.setState({
|
|
534
630
|
month,
|
|
535
631
|
date: newDate
|
|
536
632
|
});
|
|
537
633
|
}
|
|
634
|
+
|
|
538
635
|
handleSelectMonthViaYearView(month) {
|
|
539
636
|
this.handleSelectMonth(month);
|
|
540
637
|
this.setState({
|
|
@@ -542,6 +639,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
542
639
|
isMonthOpen: false
|
|
543
640
|
});
|
|
544
641
|
}
|
|
642
|
+
|
|
545
643
|
render() {
|
|
546
644
|
const {
|
|
547
645
|
date,
|
|
@@ -597,6 +695,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
597
695
|
const childEle = /*#__PURE__*/React.createElement("div", {
|
|
598
696
|
className: `${style.container} ${innerClass}`,
|
|
599
697
|
"data-id": `${dataId}_Calendar`,
|
|
698
|
+
"data-test-id": `${dataId}_Calendar`,
|
|
600
699
|
onClick: this.closePopup
|
|
601
700
|
}, /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
602
701
|
onOpenYearView: this.handleOpenYearView,
|
|
@@ -654,7 +753,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
654
753
|
})) : null));
|
|
655
754
|
return isDefaultPosition ? /*#__PURE__*/React.createElement("div", {
|
|
656
755
|
className: `${style.dropBox} ${className}`,
|
|
657
|
-
"data-id": `${dataId}_dateBoxContainer
|
|
756
|
+
"data-id": `${dataId}_dateBoxContainer`,
|
|
757
|
+
"data-test-id": `${dataId}_dateBoxContainer`
|
|
658
758
|
}, childEle) : isReady ? /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
659
759
|
size: boxSize,
|
|
660
760
|
boxPosition: position,
|
|
@@ -677,6 +777,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
677
777
|
portalId: dropBoxPortalId
|
|
678
778
|
}, /*#__PURE__*/React.createElement(Box, null, childEle)) : null;
|
|
679
779
|
}
|
|
780
|
+
|
|
680
781
|
}
|
|
681
782
|
DateTime.propTypes = DateTime_propTypes;
|
|
682
783
|
DateTime.defaultProps = DateTime_defaultProps;
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
[dir=ltr] .boxPadding {
|
|
6
|
-
padding-right:
|
|
7
|
-
padding-left:
|
|
6
|
+
padding-right: var(--zd_size19) ;
|
|
7
|
+
padding-left: var(--zd_size19) ;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
[dir=rtl] .boxPadding {
|
|
11
|
-
padding-left:
|
|
12
|
-
padding-right:
|
|
11
|
+
padding-left: var(--zd_size19) ;
|
|
12
|
+
padding-right: var(--zd_size19) ;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.container {
|
|
16
|
-
font-size:
|
|
16
|
+
font-size: var(--zd_font_size16) ;
|
|
17
17
|
composes: offSelection from '../common/common.module.css';
|
|
18
18
|
border-radius: 3px;
|
|
19
19
|
background-color: var(--zdt_datetime_default_bg);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.header {
|
|
23
|
-
min-height:
|
|
23
|
+
min-height: var(--zd_size36) ;
|
|
24
24
|
composes: boxPadding;
|
|
25
25
|
text-align: center;
|
|
26
26
|
background-color: var(--zdt_datetime_header_bg);
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.grid {
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
36
|
+
width: var(--zd_size28) ;
|
|
37
|
+
height: var(--zd_size28) ;
|
|
38
38
|
line-height: var(--zd_size18);
|
|
39
39
|
text-align: center;
|
|
40
|
-
padding:
|
|
40
|
+
padding: var(--zd_size4) 0 ;
|
|
41
41
|
border-radius: 50%;
|
|
42
42
|
border: 1px solid transparent;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.thArrow,
|
|
46
46
|
.datesStr {
|
|
47
|
-
font-size:
|
|
47
|
+
font-size: var(--zd_font_size13) ;
|
|
48
48
|
color: var(--zdt_datetime_datestr_text);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
[dir=ltr] .navigation {
|
|
65
|
-
margin-left:
|
|
65
|
+
margin-left: var(--zd_size2) ;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
[dir=rtl] .navigation {
|
|
69
|
-
margin-right:
|
|
69
|
+
margin-right: var(--zd_size2) ;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.thMonYear {
|
|
73
|
-
font-size:
|
|
73
|
+
font-size: var(--zd_font_size13) ;
|
|
74
74
|
line-height: var(--zd_size24);
|
|
75
75
|
color: var(--zdt_datetime_datestr_text);
|
|
76
76
|
composes: semibold;
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.dateContainer {
|
|
81
|
-
margin: 0
|
|
82
|
-
padding:
|
|
81
|
+
margin: 0 var(--zd_size19) 0 var(--zd_size19) ;
|
|
82
|
+
padding: var(--zd_size6) 0 var(--zd_size10) 0 ;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.separator {
|
|
@@ -87,27 +87,27 @@
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.days {
|
|
90
|
-
min-height:
|
|
90
|
+
min-height: var(--zd_size36) ;
|
|
91
91
|
composes: boxPadding;
|
|
92
92
|
composes: alignBetween from '../common/common.module.css';
|
|
93
|
-
padding-top:
|
|
93
|
+
padding-top: var(--zd_size7) ;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.daysStr {
|
|
97
|
-
font-size:
|
|
97
|
+
font-size: var(--zd_font_size10) ;
|
|
98
98
|
color: var(--zdt_datetime_daystr_text);
|
|
99
99
|
text-transform: uppercase;
|
|
100
100
|
composes: semibold;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.dateRow {
|
|
104
|
-
height:
|
|
104
|
+
height: var(--zd_size28) ;
|
|
105
105
|
composes: alignBetween from '../common/common.module.css';
|
|
106
|
-
margin:
|
|
106
|
+
margin: var(--zd_size1) 0 var(--zd_size5) ;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.dateRow:last-child {
|
|
110
|
-
margin-bottom: 0;
|
|
110
|
+
margin-bottom: 0 ;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.sunday,
|
|
@@ -149,24 +149,24 @@
|
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
.timesection {
|
|
152
|
-
padding-top:
|
|
153
|
-
padding-bottom:
|
|
152
|
+
padding-top: var(--zd_size5) ;
|
|
153
|
+
padding-bottom: var(--zd_size10) ;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
.dropDownContainer {
|
|
157
|
-
padding: 0
|
|
157
|
+
padding: 0 var(--zd_size5) ;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
.dropDown {
|
|
161
|
-
width:
|
|
161
|
+
width: var(--zd_size60) ;
|
|
162
162
|
display: inline-block;
|
|
163
163
|
position: relative;
|
|
164
|
-
margin: 0
|
|
164
|
+
margin: 0 var(--zd_size4) ;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
.footer {
|
|
168
|
-
margin-top:
|
|
169
|
-
padding-bottom:
|
|
168
|
+
margin-top: var(--zd_size10) ;
|
|
169
|
+
padding-bottom: var(--zd_size12) ;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.timesection,
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
|
|
177
177
|
.space {
|
|
178
178
|
display: inline-block;
|
|
179
|
-
width:
|
|
179
|
+
width: var(--zd_size15) ;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.downArrow {
|
|
@@ -184,11 +184,11 @@
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
[dir=ltr] .downArrow {
|
|
187
|
-
margin-left:
|
|
187
|
+
margin-left: var(--zd_size2) ;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
[dir=rtl] .downArrow {
|
|
191
|
-
margin-right:
|
|
191
|
+
margin-right: var(--zd_size2) ;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
.dateText {
|
|
@@ -201,27 +201,27 @@
|
|
|
201
201
|
|
|
202
202
|
.text {
|
|
203
203
|
composes: boxPadding;
|
|
204
|
-
font-size:
|
|
204
|
+
font-size: var(--zd_font_size11) ;
|
|
205
205
|
text-transform: uppercase;
|
|
206
206
|
color: var(--zdt_datetime_text);
|
|
207
207
|
composes: semibold;
|
|
208
208
|
display: block;
|
|
209
|
-
margin-top:
|
|
209
|
+
margin-top: var(--zd_size14) ;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
.yearContainer {
|
|
213
213
|
position: absolute;
|
|
214
|
-
top: 0;
|
|
215
|
-
width: 100
|
|
216
|
-
height: 100
|
|
214
|
+
top: 0 ;
|
|
215
|
+
width: 100% ;
|
|
216
|
+
height: 100% ;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
[dir=ltr] .yearContainer {
|
|
220
|
-
left: 0;
|
|
220
|
+
left: 0 ;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
[dir=rtl] .yearContainer {
|
|
224
|
-
right: 0;
|
|
224
|
+
right: 0 ;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
.subContainer {
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
.dropBox {
|
|
232
|
-
width: 100
|
|
232
|
+
width: 100% ;
|
|
233
233
|
border-radius: 3px;
|
|
234
234
|
box-shadow: var(--zd_bs_dropbox_bottom);
|
|
235
235
|
background-color: var(--zdt_dropbox_default_bg);
|