@zohodesk/components 1.0.0-alpha-269 → 1.0.0-alpha-271
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 +16 -0
- package/es/Accordion/Accordion.js +3 -7
- package/es/Accordion/AccordionItem.js +2 -4
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +5 -13
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/Avatar/Avatar.js +11 -23
- package/es/Avatar/Avatar.module.css +18 -18
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/AvatarTeam/AvatarTeam.module.css +35 -35
- package/es/Button/Button.js +3 -4
- package/es/Button/css/Button.module.css +70 -70
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/Buttongroup.module.css +15 -14
- package/es/Card/Card.js +10 -21
- package/es/CheckBox/CheckBox.js +3 -5
- package/es/CheckBox/CheckBox.module.css +15 -15
- package/es/DateTime/CalendarView.js +20 -32
- package/es/DateTime/DateTime.js +6 -67
- package/es/DateTime/DateTime.module.css +39 -39
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +35 -98
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +2 -4
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +4 -28
- package/es/DateTime/YearView.module.css +15 -15
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -1
- package/es/DateTime/__tests__/DateTime.spec.js +0 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +3 -2
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -63
- package/es/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -32
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +5 -9
- package/es/DropBox/DropBoxElement/DropBoxElement.js +8 -13
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +85 -79
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -7
- package/es/DropBox/DropBoxElement/props/propTypes.js +1 -1
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +0 -3
- package/es/DropBox/__tests__/DropBox.spec.js +2 -2
- package/es/DropBox/css/DropBox.module.css +6 -6
- package/es/DropBox/props/defaultProps.js +2 -1
- package/es/DropBox/props/propTypes.js +2 -1
- package/es/DropDown/DropDown.js +4 -8
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +5 -4
- package/es/DropDown/DropDownHeading.module.css +6 -6
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownItem.module.css +12 -12
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/Heading/Heading.js +3 -2
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +3 -2
- package/es/Label/Label.module.css +5 -5
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +3 -9
- package/es/ListItem/ListItem.module.css +38 -38
- package/es/ListItem/ListItemWithAvatar.js +3 -9
- package/es/ListItem/ListItemWithCheckBox.js +2 -7
- package/es/ListItem/ListItemWithIcon.js +3 -8
- package/es/ListItem/ListItemWithRadio.js +3 -7
- package/es/Modal/Modal.js +11 -28
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +13 -89
- package/es/MultiSelect/AdvancedMultiSelect.js +9 -32
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MultiSelect.js +32 -99
- package/es/MultiSelect/MultiSelect.module.css +31 -31
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -12
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/props/propTypes.js +0 -2
- package/es/PopOver/PopOver.js +2 -18
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +5 -10
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Radio/Radio.js +2 -4
- package/es/Radio/Radio.module.css +9 -9
- package/es/Responsive/CustomResponsive.js +18 -30
- package/es/Responsive/RefWrapper.js +7 -6
- package/es/Responsive/ResizeComponent.js +25 -35
- package/es/Responsive/ResizeObserver.js +6 -26
- package/es/Responsive/Responsive.js +20 -34
- package/es/Responsive/index.js +3 -1
- package/es/Responsive/sizeObservers.js +7 -28
- package/es/Responsive/utils/index.js +5 -7
- package/es/Responsive/utils/shallowCompare.js +2 -7
- package/es/Responsive/windowResizeObserver.js +0 -7
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +0 -4
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/es/Ribbon/Ribbon.js +2 -3
- package/es/Ribbon/Ribbon.module.css +48 -46
- package/es/RippleEffect/RippleEffect.js +3 -1
- package/es/Select/GroupSelect.js +14 -58
- package/es/Select/Select.js +33 -79
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +4 -17
- package/es/Select/SelectWithIcon.js +5 -46
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/props/propTypes.js +0 -1
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +11 -11
- package/es/Switch/Switch.js +3 -5
- 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 +0 -1
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +7 -54
- package/es/Tab/Tabs.module.css +30 -37
- package/es/Tab/__tests__/Tab.spec.js +3 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tag/Tag.js +3 -6
- package/es/Tag/Tag.module.css +25 -25
- package/es/TextBox/TextBox.js +3 -15
- package/es/TextBox/TextBox.module.css +9 -9
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBoxIcon/TextBoxIcon.js +2 -9
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/Textarea/Textarea.js +3 -12
- package/es/Textarea/Textarea.module.css +21 -21
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +14 -58
- package/es/Tooltip/Tooltip.module.css +5 -5
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -7
- 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 +20 -25
- package/es/semantic/Button/Button.js +2 -3
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/utils/Common.js +13 -54
- package/es/utils/ContextOptimizer.js +5 -4
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +0 -2
- package/es/utils/css/compileClassNames.js +0 -5
- package/es/utils/css/mergeStyle.js +7 -8
- package/es/utils/css/utils.js +0 -1
- package/es/utils/datetime/common.js +5 -16
- package/es/utils/debounce.js +1 -5
- package/es/utils/dropDownUtils.js +11 -68
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/lib/Accordion/Accordion.js +18 -42
- package/lib/Accordion/AccordionItem.js +18 -40
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +18 -38
- package/lib/Animation/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +21 -56
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +38 -78
- package/lib/Avatar/Avatar.module.css +18 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/props/propTypes.js +0 -3
- package/lib/AvatarTeam/AvatarTeam.js +30 -52
- package/lib/AvatarTeam/AvatarTeam.module.css +35 -35
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +20 -31
- package/lib/Button/css/Button.module.css +70 -70
- package/lib/Button/css/cssJSLogic.js +17 -18
- package/lib/Button/index.js +0 -3
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +12 -32
- package/lib/Buttongroup/Buttongroup.module.css +15 -14
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +46 -102
- package/lib/Card/__tests__/Card.spec.js +1 -10
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/propTypes.js +0 -3
- package/lib/CheckBox/CheckBox.js +47 -71
- package/lib/CheckBox/CheckBox.module.css +15 -15
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +42 -82
- package/lib/DateTime/DateTime.js +155 -239
- package/lib/DateTime/DateTime.module.css +39 -39
- package/lib/DateTime/DateTimePopupFooter.js +8 -31
- package/lib/DateTime/DateTimePopupHeader.js +17 -48
- package/lib/DateTime/DateWidget.js +250 -352
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +5 -27
- package/lib/DateTime/Time.js +32 -73
- package/lib/DateTime/YearView.js +28 -77
- package/lib/DateTime/YearView.module.css +15 -15
- package/lib/DateTime/__tests__/CalendarView.spec.js +5 -13
- package/lib/DateTime/__tests__/DateTime.spec.js +37 -51
- package/lib/DateTime/__tests__/DateWidget.spec.js +8 -10
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -184
- package/lib/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +16 -74
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +22 -54
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +1 -11
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +10 -73
- package/lib/DropBox/DropBox.js +12 -36
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +44 -63
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +85 -79
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +35 -42
- package/lib/DropBox/DropBoxElement/props/propTypes.js +1 -4
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +9 -14
- package/lib/DropBox/__tests__/DropBox.spec.js +4 -8
- package/lib/DropBox/css/DropBox.module.css +6 -6
- package/lib/DropBox/css/cssJSLogic.js +1 -3
- package/lib/DropBox/props/defaultProps.js +4 -8
- package/lib/DropBox/props/propTypes.js +4 -10
- package/lib/DropDown/DropDown.js +8 -52
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +20 -39
- package/lib/DropDown/DropDownHeading.module.css +6 -6
- package/lib/DropDown/DropDownItem.js +20 -42
- package/lib/DropDown/DropDownItem.module.css +12 -12
- package/lib/DropDown/DropDownSearch.js +17 -40
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.js +4 -24
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/__tests__/DropDown.spec.js +9 -15
- package/lib/DropDown/__tests__/DropDownItem.spec.js +4 -9
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -3
- package/lib/DropDown/index.js +0 -9
- package/lib/DropDown/props/propTypes.js +4 -6
- package/lib/Heading/Heading.js +15 -37
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +0 -3
- package/lib/Label/Label.js +19 -39
- package/lib/Label/Label.module.css +5 -5
- package/lib/Label/__tests__/Label.spec.js +1 -14
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +11 -31
- package/lib/Layout/Container.js +10 -29
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/index.js +0 -3
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -10
- package/lib/ListItem/ListContainer.js +27 -48
- package/lib/ListItem/ListItem.js +45 -69
- package/lib/ListItem/ListItem.module.css +38 -38
- package/lib/ListItem/ListItemWithAvatar.js +48 -75
- package/lib/ListItem/ListItemWithCheckBox.js +39 -64
- package/lib/ListItem/ListItemWithIcon.js +44 -68
- package/lib/ListItem/ListItemWithRadio.js +41 -65
- package/lib/ListItem/index.js +0 -7
- package/lib/ListItem/props/propTypes.js +4 -6
- package/lib/Modal/Modal.js +10 -45
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +166 -294
- package/lib/MultiSelect/AdvancedMultiSelect.js +125 -202
- package/lib/MultiSelect/EmptyState.js +24 -45
- package/lib/MultiSelect/MultiSelect.js +206 -323
- package/lib/MultiSelect/MultiSelect.module.css +31 -31
- package/lib/MultiSelect/MultiSelectHeader.js +8 -30
- package/lib/MultiSelect/MultiSelectWithAvatar.js +63 -105
- package/lib/MultiSelect/SelectedOptions.js +17 -43
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +32 -64
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/index.js +0 -5
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +0 -5
- package/lib/PopOver/PopOver.js +49 -95
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/index.js +0 -4
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +81 -158
- package/lib/Popup/__tests__/Popup.spec.js +8 -43
- package/lib/Popup/viewPort.js +14 -28
- package/lib/Provider/AvatarSize.js +0 -4
- package/lib/Provider/Config.js +0 -2
- package/lib/Provider/CssProvider.js +0 -4
- package/lib/Provider/IdProvider.js +6 -17
- package/lib/Provider/LibraryContext.js +15 -35
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +15 -44
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Provider/index.js +0 -5
- package/lib/Radio/Radio.js +38 -61
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +29 -73
- package/lib/Responsive/RefWrapper.js +11 -17
- package/lib/Responsive/ResizeComponent.js +36 -62
- package/lib/Responsive/ResizeObserver.js +10 -24
- package/lib/Responsive/Responsive.js +30 -80
- package/lib/Responsive/index.js +0 -4
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +17 -53
- package/lib/Responsive/utils/index.js +3 -11
- package/lib/Responsive/utils/shallowCompare.js +2 -11
- package/lib/Responsive/windowResizeObserver.js +0 -8
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +17 -45
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +13 -33
- package/lib/Ribbon/Ribbon.module.css +48 -46
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +10 -18
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +130 -229
- package/lib/Select/Select.js +209 -290
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +56 -102
- package/lib/Select/SelectWithIcon.js +76 -132
- package/lib/Select/__tests__/Select.spec.js +91 -133
- package/lib/Select/index.js +0 -5
- package/lib/Select/props/defaultProps.js +4 -5
- package/lib/Select/props/propTypes.js +0 -4
- package/lib/Stencils/Stencils.js +10 -29
- package/lib/Stencils/Stencils.module.css +11 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +34 -57
- package/lib/Switch/Switch.module.css +23 -23
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +27 -40
- package/lib/Tab/Tab.module.css +14 -14
- package/lib/Tab/TabContent.js +5 -12
- package/lib/Tab/TabContentWrapper.js +6 -13
- package/lib/Tab/TabWrapper.js +19 -37
- package/lib/Tab/Tabs.js +91 -171
- package/lib/Tab/Tabs.module.css +30 -37
- package/lib/Tab/__tests__/Tab.spec.js +58 -67
- package/lib/Tab/__tests__/TabContent.spec.js +6 -10
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +20 -28
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -12
- package/lib/Tab/__tests__/Tabs.spec.js +39 -53
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +43 -72
- package/lib/Tag/Tag.module.css +25 -25
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +59 -85
- package/lib/TextBox/TextBox.module.css +9 -9
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/props/propTypes.js +4 -6
- package/lib/TextBoxIcon/TextBoxIcon.js +52 -79
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +5 -14
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +29 -54
- package/lib/Textarea/Textarea.module.css +21 -21
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +31 -94
- package/lib/Tooltip/Tooltip.module.css +5 -5
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -24
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +16 -40
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +25 -53
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/index.js +0 -3
- 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 +0 -40
- package/lib/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/lib/deprecated/PortalLayer/PortalLayer.js +23 -46
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +0 -57
- package/lib/semantic/Button/Button.js +22 -42
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +0 -2
- package/lib/utils/Common.js +25 -109
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/__tests__/constructFullName.spec.js +0 -1
- package/lib/utils/__tests__/debounce.spec.js +2 -3
- package/lib/utils/__tests__/getInitial.spec.js +0 -1
- package/lib/utils/constructFullName.js +4 -13
- package/lib/utils/css/compileClassNames.js +0 -6
- package/lib/utils/css/mergeStyle.js +8 -11
- package/lib/utils/css/utils.js +0 -8
- package/lib/utils/datetime/common.js +5 -32
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +59 -175
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/index.js +0 -4
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +1 -1
|
@@ -5,21 +5,19 @@ import { Container, Box } from '../Layout';
|
|
|
5
5
|
import style from './DateTime.module.css';
|
|
6
6
|
import { getMonthEnd } from '../utils/datetime/common';
|
|
7
7
|
import DaysRow from './DaysRow';
|
|
8
|
-
/* eslint css-modules/no-unused-class: [0, { markAsUsed: ['container', 'header', 'thArrowConatainer', 'thArrow', 'thMonYear', 'days', 'daysStr', 'timesection', 'timeStr', 'dropDownContainer', 'dropDown', 'footer', 'space'] }] */
|
|
9
8
|
|
|
9
|
+
/* eslint css-modules/no-unused-class: [0, { markAsUsed: ['container', 'header', 'thArrowConatainer', 'thArrow', 'thMonYear', 'days', 'daysStr', 'timesection', 'timeStr', 'dropDownContainer', 'dropDown', 'footer', 'space'] }] */
|
|
10
10
|
export default class CalendarView extends React.PureComponent {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.handleSelect = this.handleSelect.bind(this);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
handleSelect(day, month, year, e) {
|
|
17
16
|
const {
|
|
18
17
|
onSelect
|
|
19
18
|
} = this.props;
|
|
20
19
|
onSelect(day, month, year, e);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
render() {
|
|
24
22
|
const {
|
|
25
23
|
date,
|
|
@@ -39,7 +37,9 @@ export default class CalendarView extends React.PureComponent {
|
|
|
39
37
|
const userSeeMonth = userSeeDate.getMonth();
|
|
40
38
|
const monthEnd = getMonthEnd(month, year);
|
|
41
39
|
const lastMonth = 11;
|
|
42
|
-
const firstMonth = 0;
|
|
40
|
+
const firstMonth = 0;
|
|
41
|
+
|
|
42
|
+
// let noOfRow = 5;
|
|
43
43
|
// if (
|
|
44
44
|
// (monthEnd === 31 && userSeeDay >= 6) ||
|
|
45
45
|
// (monthEnd === 30 && userSeeDay === 7)
|
|
@@ -53,21 +53,16 @@ export default class CalendarView extends React.PureComponent {
|
|
|
53
53
|
let incremleti = 1;
|
|
54
54
|
let isSelectedDay = false;
|
|
55
55
|
let isToday = false;
|
|
56
|
-
|
|
57
56
|
const rows = (() => {
|
|
58
57
|
const rowArr = [];
|
|
59
|
-
|
|
60
58
|
for (let j = 1; j <= 6; j++) {
|
|
61
59
|
const dayArr = [];
|
|
62
60
|
let output = null;
|
|
63
|
-
|
|
64
61
|
for (let i = 1; i < 8; i++) {
|
|
65
62
|
let tdclass = `${style.datesStr} ${style.grid}`;
|
|
66
|
-
|
|
67
63
|
if (i === 1) {
|
|
68
64
|
tdclass += ` ${style.sunday}`;
|
|
69
65
|
}
|
|
70
|
-
|
|
71
66
|
if (incremleti >= userSeeDay && incremday <= monthEnd) {
|
|
72
67
|
if (parseInt(date) === incremday && parseInt(month) === userSeeMonth && parseInt(year) === userSeeYear) {
|
|
73
68
|
isSelectedDay = true;
|
|
@@ -78,7 +73,6 @@ export default class CalendarView extends React.PureComponent {
|
|
|
78
73
|
isSelectedDay = false;
|
|
79
74
|
isToday = false;
|
|
80
75
|
}
|
|
81
|
-
|
|
82
76
|
output = /*#__PURE__*/React.createElement(Span, {
|
|
83
77
|
i: i,
|
|
84
78
|
isActive: isSelectedDay,
|
|
@@ -94,51 +88,54 @@ export default class CalendarView extends React.PureComponent {
|
|
|
94
88
|
} else if (incremleti < userSeeDay) {
|
|
95
89
|
let prevMonth = userSeeMonth - 1;
|
|
96
90
|
let prevYear = userSeeYear;
|
|
97
|
-
|
|
98
91
|
if (userSeeMonth === firstMonth) {
|
|
99
92
|
prevMonth = lastMonth;
|
|
100
93
|
prevYear = userSeeYear - 1;
|
|
101
94
|
}
|
|
102
|
-
|
|
103
95
|
const prevMonthEnd = getMonthEnd(prevMonth, prevYear);
|
|
104
|
-
const prevDate = prevMonthEnd - (userSeeDay - 1) + incremleti;
|
|
96
|
+
const prevDate = prevMonthEnd - (userSeeDay - 1) + incremleti;
|
|
105
97
|
|
|
106
|
-
|
|
98
|
+
// isSelectedDay =
|
|
99
|
+
prevDate === parseInt(date) && parseInt(month) === prevMonth && parseInt(year) === prevYear ? true : false;
|
|
100
|
+
// isToday = prevDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
|
|
107
101
|
|
|
108
102
|
output = /*#__PURE__*/React.createElement(Span, {
|
|
109
|
-
i: i
|
|
103
|
+
i: i
|
|
104
|
+
//isActive={isSelectedDay}
|
|
110
105
|
,
|
|
111
106
|
tdclass: `${tdclass} ${style.invalidDate}`,
|
|
112
107
|
handleSelect: this.handleSelect,
|
|
113
108
|
incremday: prevDate,
|
|
114
109
|
userSeeMonth: prevMonth,
|
|
115
110
|
userSeeYear: prevYear,
|
|
116
|
-
dataId: isSelectedDay ? `${dataId}_dateSelected` : `${dataId}_invalidDate`
|
|
117
|
-
|
|
111
|
+
dataId: isSelectedDay ? `${dataId}_dateSelected` : `${dataId}_invalidDate`
|
|
112
|
+
// isToday={isToday}
|
|
118
113
|
});
|
|
119
114
|
} else if (incremleti > monthEnd) {
|
|
120
115
|
let nextMonth = userSeeMonth + 1;
|
|
121
116
|
let nextYear = userSeeYear;
|
|
122
|
-
|
|
123
117
|
if (userSeeMonth === lastMonth) {
|
|
124
118
|
nextMonth = firstMonth;
|
|
125
119
|
nextYear = userSeeYear + 1;
|
|
126
120
|
}
|
|
121
|
+
const nextDate = incremleti - (userSeeDay - 1) - monthEnd;
|
|
127
122
|
|
|
128
|
-
|
|
123
|
+
// isSelectedDay =
|
|
124
|
+
nextDate === parseInt(date) && parseInt(month) === nextMonth && parseInt(year) === nextYear ? true : false;
|
|
129
125
|
|
|
130
|
-
|
|
126
|
+
// isToday = nextDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
|
|
131
127
|
|
|
132
128
|
output = /*#__PURE__*/React.createElement(Span, {
|
|
133
|
-
i: i
|
|
129
|
+
i: i
|
|
130
|
+
// isActive={isSelectedDay}
|
|
134
131
|
,
|
|
135
132
|
tdclass: `${tdclass} ${style.invalidDate}`,
|
|
136
133
|
handleSelect: this.handleSelect,
|
|
137
134
|
incremday: nextDate,
|
|
138
135
|
userSeeMonth: nextMonth,
|
|
139
136
|
userSeeYear: nextYear,
|
|
140
|
-
dataId: isSelectedDay ? `${dataId}_dateSelected` : `${dataId}_invalidDate`
|
|
141
|
-
|
|
137
|
+
dataId: isSelectedDay ? `${dataId}_dateSelected` : `${dataId}_invalidDate`
|
|
138
|
+
//isToday={isToday}
|
|
142
139
|
});
|
|
143
140
|
} else {
|
|
144
141
|
output = /*#__PURE__*/React.createElement(Box, {
|
|
@@ -146,13 +143,10 @@ export default class CalendarView extends React.PureComponent {
|
|
|
146
143
|
className: `${style.grid}`
|
|
147
144
|
});
|
|
148
145
|
}
|
|
149
|
-
|
|
150
146
|
incremleti++;
|
|
151
147
|
dayArr.push(output);
|
|
152
148
|
}
|
|
153
149
|
/* eslint-disable react/forbid-component-props */
|
|
154
|
-
|
|
155
|
-
|
|
156
150
|
rowArr.push( /*#__PURE__*/React.createElement(Container, {
|
|
157
151
|
key: j,
|
|
158
152
|
alignBox: "row",
|
|
@@ -161,10 +155,8 @@ export default class CalendarView extends React.PureComponent {
|
|
|
161
155
|
className: style.dateRow
|
|
162
156
|
}, dayArr));
|
|
163
157
|
}
|
|
164
|
-
|
|
165
158
|
return rowArr;
|
|
166
159
|
})();
|
|
167
|
-
|
|
168
160
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DaysRow, {
|
|
169
161
|
dayNames: dayNames,
|
|
170
162
|
dayNamesShort: dayNamesShort,
|
|
@@ -174,7 +166,6 @@ export default class CalendarView extends React.PureComponent {
|
|
|
174
166
|
className: `${style.dateContainer} ${needBorder ? style.separator : ''}`
|
|
175
167
|
}, rows));
|
|
176
168
|
}
|
|
177
|
-
|
|
178
169
|
}
|
|
179
170
|
CalendarView.propTypes = CalendarView_propTypes;
|
|
180
171
|
CalendarView.defaultProps = CalendarView_defaultProps;
|
|
@@ -183,7 +174,6 @@ export class Span extends React.PureComponent {
|
|
|
183
174
|
super(props);
|
|
184
175
|
this.handleSelectChild = this.handleSelectChild.bind(this);
|
|
185
176
|
}
|
|
186
|
-
|
|
187
177
|
handleSelectChild(e) {
|
|
188
178
|
const {
|
|
189
179
|
handleSelect,
|
|
@@ -193,7 +183,6 @@ export class Span extends React.PureComponent {
|
|
|
193
183
|
} = this.props;
|
|
194
184
|
handleSelect(incremday, userSeeMonth, userSeeYear, e);
|
|
195
185
|
}
|
|
196
|
-
|
|
197
186
|
render() {
|
|
198
187
|
const {
|
|
199
188
|
tdclass,
|
|
@@ -211,7 +200,6 @@ export class Span extends React.PureComponent {
|
|
|
211
200
|
"aria-label": incremday
|
|
212
201
|
}, incremday);
|
|
213
202
|
}
|
|
214
|
-
|
|
215
203
|
}
|
|
216
204
|
Span.propTypes = Span_propTypes;
|
|
217
205
|
Span.defaultProps = Span_defaultProps;
|
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
|
-
|
|
3
2
|
/* eslint-disable react/forbid-component-props */
|
|
3
|
+
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { DateTime_propTypes } from './props/propTypes';
|
|
6
6
|
import { DateTime_defaultProps } from './props/defaultProps';
|
|
@@ -17,13 +17,11 @@ 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
|
-
|
|
21
20
|
function title(date, year, month) {
|
|
22
21
|
let monthNames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
23
22
|
const HeadingText = `${monthNames[month] || ''} ${year}`;
|
|
24
23
|
return HeadingText;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
export default class DateTime extends React.PureComponent {
|
|
28
26
|
constructor(props) {
|
|
29
27
|
super(props);
|
|
@@ -49,7 +47,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
49
47
|
const {
|
|
50
48
|
ampmText = ampmTextDefault
|
|
51
49
|
} = props.i18nKeys;
|
|
52
|
-
|
|
53
50
|
this.ampmSuggestions = (() => {
|
|
54
51
|
const ampmSuggestions = [];
|
|
55
52
|
ampmText.forEach((text, index) => {
|
|
@@ -67,29 +64,24 @@ export default class DateTime extends React.PureComponent {
|
|
|
67
64
|
});
|
|
68
65
|
return ampmSuggestions;
|
|
69
66
|
})();
|
|
70
|
-
|
|
71
67
|
const initalStateObj = this.getStateFromProps(props);
|
|
72
68
|
this.state = Object.assign({}, initalStateObj, {
|
|
73
69
|
isYearView: false,
|
|
74
70
|
isMonthOpen: false
|
|
75
71
|
});
|
|
76
72
|
}
|
|
77
|
-
|
|
78
73
|
componentDidMount() {
|
|
79
74
|
this.handleExposeMethods(true);
|
|
80
75
|
}
|
|
81
|
-
|
|
82
76
|
componentDidUpdate(prevProps) {
|
|
83
77
|
const {
|
|
84
78
|
value,
|
|
85
79
|
isActive,
|
|
86
80
|
is24Hour
|
|
87
81
|
} = this.props;
|
|
88
|
-
|
|
89
82
|
if (prevProps.value !== value || is24Hour !== prevProps.is24Hour) {
|
|
90
83
|
this.setState(this.getStateFromProps(this.props));
|
|
91
84
|
}
|
|
92
|
-
|
|
93
85
|
if (prevProps.isActive !== isActive && !isActive) {
|
|
94
86
|
this.setState({
|
|
95
87
|
isYearView: false,
|
|
@@ -97,11 +89,9 @@ export default class DateTime extends React.PureComponent {
|
|
|
97
89
|
});
|
|
98
90
|
}
|
|
99
91
|
}
|
|
100
|
-
|
|
101
92
|
componentWillUnmount() {
|
|
102
93
|
this.handleExposeMethods(false);
|
|
103
94
|
}
|
|
104
|
-
|
|
105
95
|
getStateFromProps(props) {
|
|
106
96
|
let date, month, year, hours, mins, amPm;
|
|
107
97
|
let {
|
|
@@ -112,20 +102,17 @@ export default class DateTime extends React.PureComponent {
|
|
|
112
102
|
isDateTimeField,
|
|
113
103
|
is24Hour
|
|
114
104
|
} = props; //defaultTime --> 12:00:PM
|
|
115
|
-
|
|
116
105
|
defaultTime = needDefaultTime ? defaultTime ? defaultTime : '12:00:PM' : '';
|
|
117
106
|
let defaultHour, defaultMin, defaultAmPm;
|
|
118
107
|
let todayObj = new Date();
|
|
119
108
|
let todayDate = todayObj.getDate();
|
|
120
109
|
let todayMonth = todayObj.getMonth();
|
|
121
110
|
let todayYear = todayObj.getFullYear();
|
|
122
|
-
|
|
123
111
|
if (!value) {
|
|
124
112
|
[defaultHour, defaultMin, defaultAmPm] = defaultTime ? defaultTime.split(':') : [];
|
|
125
113
|
defaultHour = parseInt(defaultHour);
|
|
126
114
|
defaultMin = parseInt(defaultMin);
|
|
127
115
|
}
|
|
128
|
-
|
|
129
116
|
const dateObj = isDateTimeField ? datetime.toDate(datetime.tz.utcToTz(value, timeZone)) : value ? datetime.toDate(value) : todayObj;
|
|
130
117
|
date = dateObj.getDate();
|
|
131
118
|
month = dateObj.getMonth();
|
|
@@ -147,10 +134,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
147
134
|
todayYear
|
|
148
135
|
};
|
|
149
136
|
}
|
|
150
|
-
|
|
151
137
|
getHours(hoursParam, is24Hour) {
|
|
152
138
|
let hours = hoursParam;
|
|
153
|
-
|
|
154
139
|
if (!is24Hour) {
|
|
155
140
|
if (hours === 0) {
|
|
156
141
|
hours = 12;
|
|
@@ -158,11 +143,9 @@ export default class DateTime extends React.PureComponent {
|
|
|
158
143
|
hours -= 12;
|
|
159
144
|
}
|
|
160
145
|
}
|
|
161
|
-
|
|
162
146
|
hours = addZeroIfNeeded(hours);
|
|
163
147
|
return hours;
|
|
164
148
|
}
|
|
165
|
-
|
|
166
149
|
handleGetSelectedDate() {
|
|
167
150
|
let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
168
151
|
const {
|
|
@@ -181,25 +164,21 @@ export default class DateTime extends React.PureComponent {
|
|
|
181
164
|
mins,
|
|
182
165
|
amPm
|
|
183
166
|
} = selectedInfo;
|
|
184
|
-
|
|
185
167
|
if (!is24Hour) {
|
|
186
168
|
if (parseInt(hours) === 12) {
|
|
187
169
|
hours = amPm === 'AM' ? 0 : 12;
|
|
188
170
|
}
|
|
189
|
-
|
|
190
171
|
if (amPm === 'PM') {
|
|
191
172
|
if (hours < 12) {
|
|
192
173
|
hours = parseInt(hours) + 12;
|
|
193
174
|
}
|
|
194
175
|
}
|
|
195
176
|
}
|
|
196
|
-
|
|
197
177
|
let minInMillis = min ? datetime.millis(min) : null,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
178
|
+
maxInMillis = max ? datetime.millis(max) : null,
|
|
179
|
+
selectedInMillis,
|
|
180
|
+
selectedValue = '',
|
|
181
|
+
formattedValue;
|
|
203
182
|
if (isDateTimeField) {
|
|
204
183
|
selectedInMillis = datetime.tz.tzToUtc(Date.UTC(year, month, date, hours, mins), timeZone);
|
|
205
184
|
selectedValue = datetime.ISO(selectedInMillis);
|
|
@@ -209,10 +188,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
209
188
|
selectedValue = formatDate(new Date(year, month, date), 'YYYY-MM-DD');
|
|
210
189
|
formattedValue = formatDate(new Date(year, month, date), dateFormat);
|
|
211
190
|
}
|
|
212
|
-
|
|
213
191
|
let isError = false;
|
|
214
192
|
let errorType = '';
|
|
215
|
-
|
|
216
193
|
if (minInMillis && minInMillis > selectedInMillis) {
|
|
217
194
|
isError = true;
|
|
218
195
|
errorType = 'MIN';
|
|
@@ -220,7 +197,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
220
197
|
isError = true;
|
|
221
198
|
errorType = 'MAX';
|
|
222
199
|
}
|
|
223
|
-
|
|
224
200
|
return {
|
|
225
201
|
isError,
|
|
226
202
|
errorType,
|
|
@@ -228,7 +204,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
228
204
|
formattedValue
|
|
229
205
|
};
|
|
230
206
|
}
|
|
231
|
-
|
|
232
207
|
handleSelect(e) {
|
|
233
208
|
e && e.preventDefault();
|
|
234
209
|
const {
|
|
@@ -258,7 +233,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
258
233
|
mins,
|
|
259
234
|
amPm
|
|
260
235
|
});
|
|
261
|
-
|
|
262
236
|
if (isError) {
|
|
263
237
|
if (errorType === 'MIN') {
|
|
264
238
|
onError && onError(minErrorText, true);
|
|
@@ -269,7 +243,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
269
243
|
onSelect(selectedValue, formattedValue, e);
|
|
270
244
|
}
|
|
271
245
|
}
|
|
272
|
-
|
|
273
246
|
handleChange() {
|
|
274
247
|
let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
275
248
|
const {
|
|
@@ -302,7 +275,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
302
275
|
mins: getIsEmptyValue(mins) ? oldMins : mins,
|
|
303
276
|
amPm: getIsEmptyValue(amPm) ? oldAMPM : amPm
|
|
304
277
|
};
|
|
305
|
-
|
|
306
278
|
if (onChange) {
|
|
307
279
|
const {
|
|
308
280
|
isError,
|
|
@@ -310,7 +282,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
310
282
|
selectedValue,
|
|
311
283
|
formattedValue
|
|
312
284
|
} = this.handleGetSelectedDate(newSelectedInfo);
|
|
313
|
-
|
|
314
285
|
if (isError) {
|
|
315
286
|
if (errorType === 'MIN') {
|
|
316
287
|
onError && onError(minErrorText, true);
|
|
@@ -325,20 +296,17 @@ export default class DateTime extends React.PureComponent {
|
|
|
325
296
|
this.setState(newSelectedInfo);
|
|
326
297
|
}
|
|
327
298
|
}
|
|
328
|
-
|
|
329
299
|
handleClear(e) {
|
|
330
300
|
const {
|
|
331
301
|
onSelect,
|
|
332
302
|
onClear
|
|
333
303
|
} = this.props;
|
|
334
|
-
|
|
335
304
|
if (onClear) {
|
|
336
305
|
onClear(e);
|
|
337
306
|
} else {
|
|
338
307
|
onSelect('', '', e);
|
|
339
308
|
}
|
|
340
309
|
}
|
|
341
|
-
|
|
342
310
|
dateSelect(date, month, year, e) {
|
|
343
311
|
this.handleChange({
|
|
344
312
|
date,
|
|
@@ -370,7 +338,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
370
338
|
mins,
|
|
371
339
|
amPm
|
|
372
340
|
});
|
|
373
|
-
|
|
374
341
|
if (isError) {
|
|
375
342
|
if (errorType === 'MIN') {
|
|
376
343
|
onError && onError(minErrorText, true);
|
|
@@ -381,31 +348,26 @@ export default class DateTime extends React.PureComponent {
|
|
|
381
348
|
onDateSelect && onDateSelect(selectedValue, formattedValue, e);
|
|
382
349
|
}
|
|
383
350
|
}
|
|
384
|
-
|
|
385
351
|
hoursSelect(hours) {
|
|
386
352
|
this.handleChange({
|
|
387
353
|
hours
|
|
388
354
|
});
|
|
389
355
|
}
|
|
390
|
-
|
|
391
356
|
minutesSelect(mins) {
|
|
392
357
|
this.handleChange({
|
|
393
358
|
mins
|
|
394
359
|
});
|
|
395
360
|
}
|
|
396
|
-
|
|
397
361
|
amPmSelect(amPm) {
|
|
398
362
|
this.handleChange({
|
|
399
363
|
amPm
|
|
400
364
|
});
|
|
401
365
|
}
|
|
402
|
-
/*global closeGroupPopups*/
|
|
403
|
-
|
|
404
366
|
|
|
367
|
+
/*global closeGroupPopups*/
|
|
405
368
|
closePopup() {
|
|
406
369
|
closeGroupPopups('calender');
|
|
407
370
|
}
|
|
408
|
-
|
|
409
371
|
handleCalendarNavigation(type, selectedInfo) {
|
|
410
372
|
const {
|
|
411
373
|
year: stateYear,
|
|
@@ -415,12 +377,10 @@ export default class DateTime extends React.PureComponent {
|
|
|
415
377
|
let date = stateDate;
|
|
416
378
|
let month = stateMonth;
|
|
417
379
|
const year = stateYear;
|
|
418
|
-
|
|
419
380
|
const getDate = (month, year) => {
|
|
420
381
|
const monthEnd = getMonthEnd(month, year);
|
|
421
382
|
return monthEnd >= parseInt(date) ? date : monthEnd;
|
|
422
383
|
};
|
|
423
|
-
|
|
424
384
|
const modifyCalendarRecursion = recursionType => {
|
|
425
385
|
if (recursionType === 'nextYear') {
|
|
426
386
|
//Click next year icon
|
|
@@ -444,7 +404,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
444
404
|
month = 0;
|
|
445
405
|
return modifyCalendarRecursion('nextYear');
|
|
446
406
|
}
|
|
447
|
-
|
|
448
407
|
const newMonth = month + 1;
|
|
449
408
|
return {
|
|
450
409
|
date: getDate(newMonth, year),
|
|
@@ -457,7 +416,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
457
416
|
month = 11;
|
|
458
417
|
return modifyCalendarRecursion('previousYear');
|
|
459
418
|
}
|
|
460
|
-
|
|
461
419
|
const newMonth = month - 1;
|
|
462
420
|
return {
|
|
463
421
|
date: getDate(newMonth, year),
|
|
@@ -466,12 +424,10 @@ export default class DateTime extends React.PureComponent {
|
|
|
466
424
|
};
|
|
467
425
|
} else if (recursionType === 'nextDate') {
|
|
468
426
|
const monthEnd = getMonthEnd(month, year);
|
|
469
|
-
|
|
470
427
|
if (date === monthEnd) {
|
|
471
428
|
date = 1;
|
|
472
429
|
return modifyCalendarRecursion('nextMonth');
|
|
473
430
|
}
|
|
474
|
-
|
|
475
431
|
const newDate = parseInt(date) + 1;
|
|
476
432
|
return {
|
|
477
433
|
date: newDate,
|
|
@@ -483,7 +439,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
483
439
|
date = month === 0 ? getMonthEnd(11, year - 1) : getMonthEnd(month - 1, year);
|
|
484
440
|
return modifyCalendarRecursion('previousMonth');
|
|
485
441
|
}
|
|
486
|
-
|
|
487
442
|
const newDate = parseInt(date) - 1;
|
|
488
443
|
return {
|
|
489
444
|
date: newDate,
|
|
@@ -492,10 +447,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
492
447
|
};
|
|
493
448
|
}
|
|
494
449
|
};
|
|
495
|
-
|
|
496
450
|
return modifyCalendarRecursion(type);
|
|
497
451
|
}
|
|
498
|
-
|
|
499
452
|
modifyCalendar(type) {
|
|
500
453
|
const {
|
|
501
454
|
year,
|
|
@@ -508,11 +461,9 @@ export default class DateTime extends React.PureComponent {
|
|
|
508
461
|
date
|
|
509
462
|
}));
|
|
510
463
|
}
|
|
511
|
-
|
|
512
464
|
handleDateReset() {
|
|
513
465
|
this.setState(this.getStateFromProps(this.props));
|
|
514
466
|
}
|
|
515
|
-
|
|
516
467
|
handleGetStateValues() {
|
|
517
468
|
const {
|
|
518
469
|
isActive
|
|
@@ -527,20 +478,17 @@ export default class DateTime extends React.PureComponent {
|
|
|
527
478
|
isMonthOpen
|
|
528
479
|
};
|
|
529
480
|
}
|
|
530
|
-
|
|
531
481
|
handleYearViewToggle(isYearOpen, isMonthOpen) {
|
|
532
482
|
this.setState({
|
|
533
483
|
isYearView: isYearOpen,
|
|
534
484
|
isMonthOpen
|
|
535
485
|
});
|
|
536
486
|
}
|
|
537
|
-
|
|
538
487
|
handleExposeMethods(isMount) {
|
|
539
488
|
const {
|
|
540
489
|
getMethods
|
|
541
490
|
} = this.props;
|
|
542
491
|
let methods = {};
|
|
543
|
-
|
|
544
492
|
if (isMount) {
|
|
545
493
|
methods = {
|
|
546
494
|
resetLocalDate: this.handleDateReset,
|
|
@@ -554,10 +502,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
554
502
|
toggleYearView: null
|
|
555
503
|
};
|
|
556
504
|
}
|
|
557
|
-
|
|
558
505
|
getMethods && getMethods(methods);
|
|
559
506
|
}
|
|
560
|
-
|
|
561
507
|
handleOpenYearView() {
|
|
562
508
|
const {
|
|
563
509
|
isYearView,
|
|
@@ -568,14 +514,12 @@ export default class DateTime extends React.PureComponent {
|
|
|
568
514
|
isMonthOpen: !isMonthOpen
|
|
569
515
|
});
|
|
570
516
|
}
|
|
571
|
-
|
|
572
517
|
handleSelectYear(year) {
|
|
573
518
|
this.setState({
|
|
574
519
|
year,
|
|
575
520
|
isMonthOpen: true
|
|
576
521
|
});
|
|
577
522
|
}
|
|
578
|
-
|
|
579
523
|
handleSelectMonth(month) {
|
|
580
524
|
const {
|
|
581
525
|
date,
|
|
@@ -583,17 +527,14 @@ export default class DateTime extends React.PureComponent {
|
|
|
583
527
|
} = this.state;
|
|
584
528
|
const monthEnd = getMonthEnd(month, year);
|
|
585
529
|
let newDate = date;
|
|
586
|
-
|
|
587
530
|
if (date > monthEnd) {
|
|
588
531
|
newDate = monthEnd;
|
|
589
532
|
}
|
|
590
|
-
|
|
591
533
|
this.setState({
|
|
592
534
|
month,
|
|
593
535
|
date: newDate
|
|
594
536
|
});
|
|
595
537
|
}
|
|
596
|
-
|
|
597
538
|
handleSelectMonthViaYearView(month) {
|
|
598
539
|
this.handleSelectMonth(month);
|
|
599
540
|
this.setState({
|
|
@@ -601,7 +542,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
601
542
|
isMonthOpen: false
|
|
602
543
|
});
|
|
603
544
|
}
|
|
604
|
-
|
|
605
545
|
render() {
|
|
606
546
|
const {
|
|
607
547
|
date,
|
|
@@ -737,7 +677,6 @@ export default class DateTime extends React.PureComponent {
|
|
|
737
677
|
portalId: dropBoxPortalId
|
|
738
678
|
}, /*#__PURE__*/React.createElement(Box, null, childEle)) : null;
|
|
739
679
|
}
|
|
740
|
-
|
|
741
680
|
}
|
|
742
681
|
DateTime.propTypes = DateTime_propTypes;
|
|
743
682
|
DateTime.defaultProps = DateTime_defaultProps;
|