@zohodesk/components 1.2.23 → 1.2.24
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 +4 -0
- package/es/Accordion/Accordion.js +7 -3
- package/es/Accordion/AccordionItem.js +4 -2
- package/es/Animation/Animation.js +7 -89
- package/es/Animation/utils.js +83 -0
- package/es/AppContainer/AppContainer.js +14 -3
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/Avatar/Avatar.js +23 -11
- 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/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -2
- package/es/Button/Button.js +4 -3
- package/es/Button/css/Button.module.css +70 -70
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/Buttongroup.module.css +13 -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 +32 -20
- package/es/DateTime/DateTime.js +69 -6
- package/es/DateTime/DateTime.module.css +40 -40
- package/es/DateTime/DateTimePopupFooter.js +4 -1
- package/es/DateTime/DateTimePopupHeader.js +8 -2
- package/es/DateTime/DateWidget.js +98 -35
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +4 -1
- package/es/DateTime/Time.js +10 -1
- package/es/DateTime/YearView.js +28 -4
- package/es/DateTime/YearView.module.css +15 -15
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +65 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +31 -1
- 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/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +6 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +73 -76
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
- 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 +7 -1
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +4 -5
- package/es/DropDown/DropDownHeading.module.css +6 -6
- package/es/DropDown/DropDownItem.js +6 -0
- 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/props/propTypes.js +1 -2
- package/es/Heading/Heading.js +2 -3
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +2 -3
- package/es/Label/Label.module.css +5 -5
- package/es/Label/__tests__/Label.spec.js +1 -2
- package/es/Layout/Box.js +15 -2
- package/es/Layout/Container.js +14 -3
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +1 -2
- package/es/Layout/utils.js +1 -0
- package/es/ListItem/ListContainer.js +8 -3
- package/es/ListItem/ListItem.js +9 -3
- package/es/ListItem/ListItem.module.css +27 -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 +89 -13
- package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/MultiSelect/EmptyState.js +2 -0
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/es/MultiSelect/MultiSelect.js +99 -30
- package/es/MultiSelect/MultiSelect.module.css +31 -31
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +10 -3
- 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/props/propTypes.js +2 -2
- package/es/PopOver/PopOver.js +16 -0
- package/es/Popup/Popup.js +77 -24
- 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 +3 -0
- 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/ResponsiveDropBox/props/propTypes.js +1 -2
- package/es/Ribbon/Ribbon.js +3 -2
- package/es/Ribbon/Ribbon.module.css +45 -48
- package/es/RippleEffect/RippleEffect.js +1 -3
- package/es/Select/GroupSelect.js +58 -14
- package/es/Select/Select.js +79 -33
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +17 -4
- package/es/Select/SelectWithIcon.js +46 -5
- package/es/Select/props/propTypes.js +2 -2
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +11 -11
- package/es/Switch/Switch.js +5 -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 +3 -0
- package/es/Tab/TabWrapper.js +5 -2
- package/es/Tab/Tabs.js +54 -7
- package/es/Tab/Tabs.module.css +22 -22
- package/es/Tag/Tag.js +6 -3
- package/es/Tag/Tag.module.css +24 -25
- package/es/TextBox/TextBox.js +16 -3
- package/es/TextBox/TextBox.module.css +9 -9
- package/es/TextBoxIcon/TextBoxIcon.js +9 -2
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/es/TextBoxIcon/props/propTypes.js +1 -2
- package/es/Textarea/Textarea.js +12 -3
- package/es/Textarea/Textarea.module.css +21 -21
- package/es/Tooltip/Tooltip.js +58 -14
- package/es/Tooltip/Tooltip.module.css +5 -5
- 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/PortalLayer/PortalLayer.js +25 -20
- package/es/semantic/Button/Button.js +3 -2
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/utils/Common.js +54 -9
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/datetime/common.js +16 -5
- 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/es/v1/Accordion/Accordion.js +4 -3
- package/es/v1/Accordion/AccordionItem.js +4 -2
- package/es/v1/Animation/Animation.js +5 -89
- package/es/v1/Animation/utils.js +83 -0
- package/es/v1/AppContainer/AppContainer.js +9 -3
- package/es/v1/Avatar/Avatar.js +18 -6
- package/es/v1/AvatarTeam/AvatarTeam.js +1 -0
- package/es/v1/Button/Button.js +3 -3
- package/es/v1/Card/Card.js +16 -8
- package/es/v1/CheckBox/CheckBox.js +6 -3
- package/es/v1/DateTime/CalendarView.js +32 -20
- package/es/v1/DateTime/DateTime.js +69 -6
- package/es/v1/DateTime/DateTimePopupFooter.js +4 -1
- package/es/v1/DateTime/DateTimePopupHeader.js +8 -2
- package/es/v1/DateTime/DateWidget.js +98 -35
- package/es/v1/DateTime/DaysRow.js +4 -1
- package/es/v1/DateTime/Time.js +10 -1
- package/es/v1/DateTime/YearView.js +28 -4
- package/es/v1/DropBox/DropBox.js +6 -2
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/v1/DropBox/props/defaultProps.js +1 -2
- package/es/v1/DropBox/props/propTypes.js +1 -2
- package/es/v1/DropDown/DropDown.js +3 -0
- package/es/v1/DropDown/DropDownHeading.js +2 -2
- package/es/v1/DropDown/DropDownItem.js +5 -0
- package/es/v1/DropDown/DropDownSearch.js +3 -2
- package/es/v1/DropDown/props/propTypes.js +1 -2
- package/es/v1/Heading/Heading.js +1 -3
- package/es/v1/Layout/Box.js +15 -2
- package/es/v1/Layout/Container.js +14 -3
- package/es/v1/ListItem/ListContainer.js +8 -3
- package/es/v1/ListItem/ListItem.js +10 -3
- package/es/v1/ListItem/ListItemWithAvatar.js +9 -1
- package/es/v1/ListItem/ListItemWithCheckBox.js +8 -2
- package/es/v1/ListItem/ListItemWithIcon.js +9 -3
- package/es/v1/ListItem/ListItemWithRadio.js +8 -3
- package/es/v1/Modal/Modal.js +17 -1
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +90 -15
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/v1/MultiSelect/EmptyState.js +2 -0
- package/es/v1/MultiSelect/MultiSelect.js +100 -31
- package/es/v1/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +11 -3
- package/es/v1/MultiSelect/SelectedOptions.js +6 -3
- package/es/v1/MultiSelect/Suggestions.js +7 -3
- package/es/v1/MultiSelect/props/propTypes.js +2 -2
- package/es/v1/PopOver/PopOver.js +11 -0
- package/es/v1/Popup/Popup.js +77 -24
- package/es/v1/Provider/IdProvider.js +10 -5
- package/es/v1/Provider/LibraryContext.js +6 -4
- package/es/v1/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/v1/Provider/ZindexProvider.js +9 -2
- package/es/v1/Radio/Radio.js +5 -2
- package/es/v1/Responsive/CustomResponsive.js +30 -18
- package/es/v1/Responsive/RefWrapper.js +6 -7
- package/es/v1/Responsive/ResizeComponent.js +35 -25
- package/es/v1/Responsive/ResizeObserver.js +26 -6
- package/es/v1/Responsive/Responsive.js +34 -20
- package/es/v1/Responsive/index.js +1 -3
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +1 -0
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -2
- package/es/v1/Select/GroupSelect.js +58 -14
- package/es/v1/Select/Select.js +81 -37
- package/es/v1/Select/SelectWithAvatar.js +17 -4
- package/es/v1/Select/SelectWithIcon.js +46 -5
- package/es/v1/Select/props/propTypes.js +2 -2
- package/es/v1/Stencils/Stencils.js +2 -0
- package/es/v1/Switch/Switch.js +6 -3
- package/es/v1/Tab/Tab.js +3 -3
- package/es/v1/Tab/TabContent.js +1 -0
- package/es/v1/Tab/TabContentWrapper.js +3 -0
- package/es/v1/Tab/TabWrapper.js +5 -2
- package/es/v1/Tab/Tabs.js +54 -9
- package/es/v1/Tab/v1Tab.module.css +14 -14
- package/es/v1/Tab/v1Tabs.module.css +22 -22
- package/es/v1/Tag/Tag.js +5 -1
- package/es/v1/TextBox/TextBox.js +14 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -2
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -2
- package/es/v1/Textarea/Textarea.js +10 -3
- package/es/v1/Tooltip/Tooltip.js +58 -14
- package/es/v1/Typography/Typography.js +2 -0
- package/es/v1/Typography/css/Typography.module.css +31 -31
- package/es/v1/Typography/css/cssJSLogic.js +3 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -2
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -4
- package/es/v1/semantic/Button/Button.js +1 -2
- package/lib/Accordion/Accordion.js +42 -18
- package/lib/Accordion/AccordionItem.js +40 -18
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/propTypes.js +3 -0
- package/lib/Animation/Animation.js +42 -104
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/Animation/utils.js +94 -0
- package/lib/AppContainer/AppContainer.js +58 -20
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/propTypes.js +3 -0
- package/lib/Avatar/Avatar.js +78 -38
- package/lib/Avatar/Avatar.module.css +18 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +95 -71
- package/lib/Avatar/props/propTypes.js +3 -0
- package/lib/AvatarTeam/AvatarTeam.js +52 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +35 -35
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +77 -61
- package/lib/AvatarTeam/props/propTypes.js +3 -0
- package/lib/Button/Button.js +33 -22
- package/lib/Button/__tests__/Button.spec.js +65 -48
- 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 +32 -12
- package/lib/Buttongroup/Buttongroup.module.css +13 -15
- package/lib/Buttongroup/__tests__/Buttongroup.spec.js +18 -10
- package/lib/Buttongroup/props/propTypes.js +3 -0
- package/lib/Card/Card.js +102 -46
- 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/props/propTypes.js +3 -0
- package/lib/DateTime/CalendarView.js +82 -42
- package/lib/DateTime/DateTime.js +244 -156
- package/lib/DateTime/DateTime.module.css +40 -40
- package/lib/DateTime/DateTimePopupFooter.js +33 -8
- package/lib/DateTime/DateTimePopupHeader.js +49 -17
- package/lib/DateTime/DateWidget.js +350 -249
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +28 -5
- package/lib/DateTime/Time.js +75 -32
- package/lib/DateTime/YearView.js +76 -27
- package/lib/DateTime/YearView.module.css +15 -15
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +187 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/lib/DateTime/dateFormatUtils/dayChange.js +15 -7
- package/lib/DateTime/dateFormatUtils/index.js +73 -16
- package/lib/DateTime/dateFormatUtils/monthChange.js +20 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +54 -22
- package/lib/DateTime/dateFormatUtils/yearChange.js +23 -11
- package/lib/DateTime/index.js +2 -0
- package/lib/DateTime/objectUtils.js +24 -20
- 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 +45 -21
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +59 -38
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +73 -76
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +42 -34
- package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
- 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 +51 -5
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +39 -20
- package/lib/DropDown/DropDownHeading.module.css +6 -6
- package/lib/DropDown/DropDownItem.js +42 -20
- 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/index.js +9 -0
- package/lib/DropDown/props/propTypes.js +10 -4
- package/lib/Heading/Heading.js +37 -15
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +41 -21
- package/lib/Label/Label.module.css +5 -5
- package/lib/Label/__tests__/Label.spec.js +48 -34
- package/lib/Label/props/propTypes.js +3 -0
- package/lib/Layout/Box.js +35 -15
- package/lib/Layout/Container.js +33 -14
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/index.js +3 -0
- package/lib/Layout/props/propTypes.js +3 -0
- package/lib/Layout/utils.js +11 -0
- package/lib/ListItem/ListContainer.js +55 -30
- package/lib/ListItem/ListItem.js +74 -45
- package/lib/ListItem/ListItem.module.css +27 -38
- package/lib/ListItem/ListItemWithAvatar.js +80 -48
- package/lib/ListItem/ListItemWithCheckBox.js +70 -40
- package/lib/ListItem/ListItemWithIcon.js +73 -44
- package/lib/ListItem/ListItemWithRadio.js +71 -42
- 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 +293 -166
- package/lib/MultiSelect/AdvancedMultiSelect.js +202 -125
- package/lib/MultiSelect/EmptyState.js +45 -24
- package/lib/MultiSelect/MobileHeader/MobileHeader.js +14 -5
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/lib/MultiSelect/MobileHeader/props/propTypes.js +3 -0
- package/lib/MultiSelect/MultiSelect.js +333 -214
- package/lib/MultiSelect/MultiSelect.module.css +31 -31
- package/lib/MultiSelect/MultiSelectHeader.js +29 -7
- package/lib/MultiSelect/MultiSelectWithAvatar.js +85 -43
- 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/index.js +5 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +14 -4
- package/lib/PopOver/PopOver.js +94 -47
- package/lib/PopOver/index.js +4 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -81
- 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 +60 -36
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radio.spec.js +134 -103
- 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 +9 -4
- package/lib/Ribbon/Ribbon.js +33 -13
- package/lib/Ribbon/Ribbon.module.css +45 -48
- package/lib/Ribbon/__tests__/Ribbon.spec.js +24 -14
- package/lib/Ribbon/props/propTypes.js +3 -0
- package/lib/RippleEffect/RippleEffect.js +18 -10
- package/lib/RippleEffect/__tests__/RippleEffect.spec.js +34 -22
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +229 -130
- package/lib/Select/Select.js +295 -211
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +102 -56
- package/lib/Select/SelectWithIcon.js +131 -76
- package/lib/Select/index.js +5 -0
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +10 -4
- package/lib/Stencils/Stencils.js +29 -10
- package/lib/Stencils/Stencils.module.css +11 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +22 -13
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +57 -34
- package/lib/Switch/Switch.module.css +23 -23
- package/lib/Switch/__tests__/Switch.spec.js +91 -72
- 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 +16 -8
- package/lib/Tab/TabWrapper.js +37 -19
- package/lib/Tab/Tabs.js +171 -91
- package/lib/Tab/Tabs.module.css +22 -22
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/propTypes.js +3 -0
- package/lib/Tag/Tag.js +72 -43
- package/lib/Tag/Tag.module.css +24 -25
- package/lib/Tag/props/propTypes.js +3 -0
- package/lib/TextBox/TextBox.js +86 -60
- package/lib/TextBox/TextBox.module.css +9 -9
- package/lib/TextBox/props/propTypes.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +80 -53
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/lib/TextBoxIcon/props/propTypes.js +9 -4
- package/lib/Textarea/Textarea.js +54 -29
- package/lib/Textarea/Textarea.module.css +21 -21
- package/lib/Textarea/props/propTypes.js +3 -0
- package/lib/Tooltip/Tooltip.js +94 -31
- package/lib/Tooltip/Tooltip.module.css +5 -5
- 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/PortalLayer/PortalLayer.js +46 -23
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +58 -0
- package/lib/semantic/Button/Button.js +42 -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 +111 -18
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/constructFullName.js +13 -4
- package/lib/utils/datetime/common.js +34 -5
- 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 +1 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/lib/v1/Accordion/Accordion.js +38 -19
- package/lib/v1/Accordion/AccordionItem.js +23 -13
- package/lib/v1/Accordion/index.js +3 -0
- package/lib/v1/Accordion/props/propTypes.js +3 -0
- package/lib/v1/Animation/Animation.js +24 -100
- package/lib/v1/Animation/props/propTypes.js +3 -0
- package/lib/v1/Animation/utils.js +94 -0
- package/lib/v1/AppContainer/AppContainer.js +46 -17
- package/lib/v1/AppContainer/props/propTypes.js +3 -0
- package/lib/v1/Avatar/Avatar.js +68 -32
- package/lib/v1/Avatar/props/propTypes.js +3 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +32 -24
- package/lib/v1/AvatarTeam/props/propTypes.js +3 -0
- package/lib/v1/Button/Button.js +32 -22
- package/lib/v1/Button/props/defaultProps.js +2 -0
- package/lib/v1/Button/props/propTypes.js +3 -0
- package/lib/v1/Buttongroup/Buttongroup.js +13 -5
- package/lib/v1/Buttongroup/props/propTypes.js +3 -0
- package/lib/v1/Card/Card.js +78 -44
- package/lib/v1/Card/index.js +4 -0
- package/lib/v1/Card/props/propTypes.js +3 -0
- package/lib/v1/CheckBox/CheckBox.js +52 -41
- package/lib/v1/CheckBox/props/propTypes.js +3 -0
- package/lib/v1/DateTime/CalendarView.js +89 -48
- package/lib/v1/DateTime/DateTime.js +246 -158
- package/lib/v1/DateTime/DateTimePopupFooter.js +33 -8
- package/lib/v1/DateTime/DateTimePopupHeader.js +49 -17
- package/lib/v1/DateTime/DateWidget.js +352 -251
- package/lib/v1/DateTime/DaysRow.js +28 -5
- package/lib/v1/DateTime/Time.js +75 -32
- package/lib/v1/DateTime/YearView.js +76 -27
- package/lib/v1/DateTime/index.js +2 -0
- package/lib/v1/DateTime/props/propTypes.js +11 -1
- package/lib/v1/DropBox/DropBox.js +45 -21
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +59 -38
- package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/v1/DropBox/props/defaultProps.js +8 -4
- package/lib/v1/DropBox/props/propTypes.js +10 -4
- package/lib/v1/DropDown/DropDown.js +23 -3
- package/lib/v1/DropDown/DropDownHeading.js +20 -13
- package/lib/v1/DropDown/DropDownItem.js +26 -11
- package/lib/v1/DropDown/DropDownSearch.js +28 -16
- package/lib/v1/DropDown/DropDownSeparator.js +7 -1
- package/lib/v1/DropDown/props/propTypes.js +10 -4
- package/lib/v1/Heading/Heading.js +19 -14
- package/lib/v1/Heading/props/propTypes.js +3 -0
- package/lib/v1/Label/Label.js +22 -14
- package/lib/v1/Label/props/propTypes.js +3 -0
- package/lib/v1/Layout/Box.js +35 -15
- package/lib/v1/Layout/Container.js +33 -14
- package/lib/v1/Layout/index.js +3 -0
- package/lib/v1/Layout/props/propTypes.js +3 -0
- package/lib/v1/ListItem/ListContainer.js +55 -30
- package/lib/v1/ListItem/ListItem.js +53 -38
- package/lib/v1/ListItem/ListItemWithAvatar.js +62 -39
- package/lib/v1/ListItem/ListItemWithCheckBox.js +49 -34
- package/lib/v1/ListItem/ListItemWithIcon.js +52 -37
- package/lib/v1/ListItem/ListItemWithRadio.js +49 -35
- package/lib/v1/ListItem/index.js +7 -0
- package/lib/v1/ListItem/props/propTypes.js +6 -4
- package/lib/v1/Modal/Modal.js +46 -9
- package/lib/v1/Modal/props/propTypes.js +3 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +294 -168
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +202 -125
- package/lib/v1/MultiSelect/EmptyState.js +45 -24
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +14 -5
- package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +3 -0
- package/lib/v1/MultiSelect/MultiSelect.js +335 -216
- package/lib/v1/MultiSelect/MultiSelectHeader.js +29 -7
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +86 -43
- package/lib/v1/MultiSelect/SelectedOptions.js +43 -17
- package/lib/v1/MultiSelect/Suggestions.js +64 -32
- package/lib/v1/MultiSelect/index.js +5 -0
- package/lib/v1/MultiSelect/props/defaultProps.js +2 -0
- package/lib/v1/MultiSelect/props/propTypes.js +14 -4
- package/lib/v1/PopOver/PopOver.js +71 -40
- package/lib/v1/PopOver/props/propTypes.js +3 -0
- package/lib/v1/Popup/Popup.js +158 -81
- package/lib/v1/Provider/AvatarSize.js +4 -0
- package/lib/v1/Provider/Config.js +2 -0
- package/lib/v1/Provider/CssProvider.js +4 -0
- package/lib/v1/Provider/IdProvider.js +17 -6
- package/lib/v1/Provider/LibraryContext.js +35 -15
- package/lib/v1/Provider/LibraryContextInit.js +4 -0
- package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/v1/Provider/ZindexProvider.js +15 -3
- package/lib/v1/Provider/index.js +5 -0
- package/lib/v1/Radio/Radio.js +42 -32
- package/lib/v1/Radio/props/propTypes.js +3 -0
- package/lib/v1/Responsive/CustomResponsive.js +73 -29
- package/lib/v1/Responsive/RefWrapper.js +17 -11
- package/lib/v1/Responsive/ResizeComponent.js +62 -36
- package/lib/v1/Responsive/ResizeObserver.js +24 -10
- package/lib/v1/Responsive/Responsive.js +80 -30
- package/lib/v1/Responsive/index.js +4 -0
- package/lib/v1/Responsive/props/propTypes.js +3 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +27 -13
- package/lib/v1/ResponsiveDropBox/props/propTypes.js +9 -4
- package/lib/v1/Ribbon/Ribbon.js +14 -7
- package/lib/v1/Ribbon/props/propTypes.js +3 -0
- package/lib/v1/RippleEffect/RippleEffect.js +17 -7
- package/lib/v1/RippleEffect/props/propTypes.js +3 -0
- package/lib/v1/Select/GroupSelect.js +229 -130
- package/lib/v1/Select/Select.js +297 -214
- package/lib/v1/Select/SelectWithAvatar.js +102 -56
- package/lib/v1/Select/SelectWithIcon.js +131 -76
- package/lib/v1/Select/index.js +5 -0
- package/lib/v1/Select/props/defaultProps.js +5 -4
- package/lib/v1/Select/props/propTypes.js +10 -4
- package/lib/v1/Stencils/Stencils.js +13 -3
- package/lib/v1/Stencils/props/propTypes.js +3 -0
- package/lib/v1/Switch/Switch.js +38 -25
- package/lib/v1/Switch/props/propTypes.js +3 -0
- package/lib/v1/Tab/Tab.js +40 -27
- package/lib/v1/Tab/TabContent.js +12 -5
- package/lib/v1/Tab/TabContentWrapper.js +16 -8
- package/lib/v1/Tab/TabWrapper.js +37 -19
- package/lib/v1/Tab/Tabs.js +170 -83
- package/lib/v1/Tab/index.js +6 -0
- package/lib/v1/Tab/props/propTypes.js +3 -0
- package/lib/v1/Tab/v1Tab.module.css +14 -14
- package/lib/v1/Tab/v1Tabs.module.css +22 -22
- package/lib/v1/Tag/Tag.js +50 -32
- package/lib/v1/Tag/props/propTypes.js +3 -0
- package/lib/v1/TextBox/TextBox.js +70 -47
- package/lib/v1/TextBox/props/propTypes.js +6 -4
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +80 -55
- package/lib/v1/TextBoxIcon/props/propTypes.js +9 -4
- package/lib/v1/Textarea/Textarea.js +45 -28
- package/lib/v1/Textarea/props/propTypes.js +3 -0
- package/lib/v1/Tooltip/Tooltip.js +94 -31
- package/lib/v1/Tooltip/props/propTypes.js +3 -0
- package/lib/v1/Typography/Typography.js +26 -15
- package/lib/v1/Typography/css/Typography.module.css +31 -31
- package/lib/v1/Typography/css/cssJSLogic.js +25 -20
- package/lib/v1/Typography/props/propTypes.js +3 -0
- package/lib/v1/Typography/utils/index.js +1 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +25 -12
- package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +38 -22
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/v1/semantic/Button/Button.js +24 -18
- package/lib/v1/semantic/Button/props/propTypes.js +3 -0
- package/lib/v1/semantic/index.js +2 -0
- package/package.json +2 -2
- package/result.json +1 -1
- package/.DS_Store +0 -0
|
@@ -7,11 +7,12 @@ export function getChangedDay(values, event, focusOrders, keyActions) {
|
|
|
7
7
|
which
|
|
8
8
|
} = event;
|
|
9
9
|
const {
|
|
10
|
-
day = ''
|
|
10
|
+
day = ''
|
|
11
|
+
/*month = '', year = ''*/
|
|
12
|
+
|
|
11
13
|
} = values;
|
|
12
14
|
let isChanged = false;
|
|
13
|
-
let newDay = Number.parseInt(day) || 0;
|
|
14
|
-
// const newMonth = Number.parseInt(month) || 0;
|
|
15
|
+
let newDay = Number.parseInt(day) || 0; // const newMonth = Number.parseInt(month) || 0;
|
|
15
16
|
// const newYear = Number.parseInt(year) || 0;
|
|
16
17
|
|
|
17
18
|
const {
|
|
@@ -21,8 +22,11 @@ export function getChangedDay(values, event, focusOrders, keyActions) {
|
|
|
21
22
|
const isNewType = getIsNewValueType(focusOrders, keyActions);
|
|
22
23
|
const {
|
|
23
24
|
startPoint,
|
|
24
|
-
endPoint
|
|
25
|
+
endPoint
|
|
26
|
+
/*getDayEnd(newMonth, newYear);*/
|
|
27
|
+
|
|
25
28
|
} = getDayDetails();
|
|
29
|
+
|
|
26
30
|
if (keyCode === 38) {
|
|
27
31
|
//up arrow
|
|
28
32
|
if (newDay === endPoint || !newDay) {
|
|
@@ -45,15 +49,19 @@ export function getChangedDay(values, event, focusOrders, keyActions) {
|
|
|
45
49
|
const keyString = getKeyValue(event);
|
|
46
50
|
let newValue = isNewType ? keyString : day.toString() + keyString;
|
|
47
51
|
newValue = Number.parseInt(newValue);
|
|
52
|
+
|
|
48
53
|
if (isNewType) {
|
|
49
54
|
isChanged = true;
|
|
55
|
+
|
|
50
56
|
if (newValue * 10 > endPoint) {
|
|
51
57
|
newFocusOrder += 1;
|
|
52
58
|
}
|
|
59
|
+
|
|
53
60
|
newDay = newValue;
|
|
54
61
|
} else {
|
|
55
62
|
isChanged = true;
|
|
56
63
|
newFocusOrder += 1;
|
|
64
|
+
|
|
57
65
|
if (newValue > endPoint) {
|
|
58
66
|
newDay = endPoint;
|
|
59
67
|
} else if (!newValue) {
|
|
@@ -66,6 +74,7 @@ export function getChangedDay(values, event, focusOrders, keyActions) {
|
|
|
66
74
|
isChanged = true;
|
|
67
75
|
newDay = '';
|
|
68
76
|
}
|
|
77
|
+
|
|
69
78
|
return {
|
|
70
79
|
day: newDay,
|
|
71
80
|
isChanged,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/** * Methods ** */
|
|
4
4
|
import { getMonthEnd } from '../../utils/datetime/common';
|
|
5
|
-
|
|
6
5
|
/** * Constants ** */
|
|
6
|
+
|
|
7
7
|
import { flags, INVALID_DATE } from '../constants';
|
|
8
8
|
import { getDateText } from './dateFormat';
|
|
9
9
|
export function convertYearToTwoDigit(year) {
|
|
@@ -13,6 +13,7 @@ export function addZero() {
|
|
|
13
13
|
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
14
14
|
let length = arguments.length > 1 ? arguments[1] : undefined;
|
|
15
15
|
let newValue = value.toString();
|
|
16
|
+
|
|
16
17
|
for (let i = 0; i < length; i++) {
|
|
17
18
|
if (newValue.length < length) {
|
|
18
19
|
newValue = `0${newValue}`;
|
|
@@ -20,16 +21,19 @@ export function addZero() {
|
|
|
20
21
|
break;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
|
|
23
25
|
return newValue;
|
|
24
26
|
}
|
|
25
27
|
export function getDayEnd(month, year) {
|
|
26
28
|
month -= 1;
|
|
27
29
|
const monthend = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
30
|
+
|
|
28
31
|
if (month && year) {
|
|
29
32
|
return getMonthEnd(month, year);
|
|
30
33
|
} else if (month) {
|
|
31
34
|
return monthend[month];
|
|
32
35
|
}
|
|
36
|
+
|
|
33
37
|
return 31;
|
|
34
38
|
}
|
|
35
39
|
export function getIsNumberTyped(event) {
|
|
@@ -39,15 +43,18 @@ export function getIsNumberTyped(event) {
|
|
|
39
43
|
metaKey,
|
|
40
44
|
shiftKey
|
|
41
45
|
} = event;
|
|
46
|
+
|
|
42
47
|
if ((keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) && !ctrlKey && !metaKey && !shiftKey) {
|
|
43
48
|
return true;
|
|
44
49
|
}
|
|
50
|
+
|
|
45
51
|
return false;
|
|
46
52
|
}
|
|
47
53
|
export function getIsDeleteTyped(keyCode) {
|
|
48
54
|
if (keyCode === 8) {
|
|
49
55
|
return true;
|
|
50
56
|
}
|
|
57
|
+
|
|
51
58
|
return false;
|
|
52
59
|
}
|
|
53
60
|
export function getIsNewValueType(focusOrders, keyActions) {
|
|
@@ -76,6 +83,7 @@ export function getMonthDetails() {
|
|
|
76
83
|
export function getYearDetails(yearLength) {
|
|
77
84
|
const dateObj = new Date();
|
|
78
85
|
const year = dateObj.getFullYear();
|
|
86
|
+
|
|
79
87
|
if (yearLength === 2) {
|
|
80
88
|
return {
|
|
81
89
|
startPoint: 0,
|
|
@@ -83,6 +91,7 @@ export function getYearDetails(yearLength) {
|
|
|
83
91
|
currentYear: year
|
|
84
92
|
};
|
|
85
93
|
}
|
|
94
|
+
|
|
86
95
|
return {
|
|
87
96
|
startPoint: 1850,
|
|
88
97
|
endPoint: 9999,
|
|
@@ -96,9 +105,11 @@ export function convertTwoDigitToYear() {
|
|
|
96
105
|
let year = dateObj.getFullYear();
|
|
97
106
|
const digitValueStr = addZero(digitValue.toString(), 2);
|
|
98
107
|
year = selectedYear ? selectedYear : year;
|
|
108
|
+
|
|
99
109
|
if (digitValueStr && digitValueStr.length <= 2) {
|
|
100
110
|
return parseInt(year.toString().slice(0, 2) + digitValueStr);
|
|
101
111
|
}
|
|
112
|
+
|
|
102
113
|
return digitValue;
|
|
103
114
|
}
|
|
104
115
|
export function getHourDetails(is24Hour) {
|
|
@@ -113,10 +124,12 @@ export function getHourSuggestions(is24Hour) {
|
|
|
113
124
|
endPoint
|
|
114
125
|
} = getHourDetails(is24Hour);
|
|
115
126
|
const hourArr = [];
|
|
127
|
+
|
|
116
128
|
for (let hour = startPoint; hour <= endPoint; hour++) {
|
|
117
129
|
const htxt = addZeroIfNeeded(hour);
|
|
118
130
|
hourArr.push(htxt);
|
|
119
131
|
}
|
|
132
|
+
|
|
120
133
|
return hourArr;
|
|
121
134
|
}
|
|
122
135
|
export function getMinuteDetails() {
|
|
@@ -131,10 +144,12 @@ export function getMinuteSuggestions() {
|
|
|
131
144
|
endPoint
|
|
132
145
|
} = getMinuteDetails();
|
|
133
146
|
const minArr = [];
|
|
147
|
+
|
|
134
148
|
for (let minute = startPoint; minute <= endPoint; minute++) {
|
|
135
149
|
const mtxt = addZeroIfNeeded(minute);
|
|
136
150
|
minArr.push(mtxt);
|
|
137
151
|
}
|
|
152
|
+
|
|
138
153
|
return minArr;
|
|
139
154
|
}
|
|
140
155
|
export function addZeroIfNeeded(value) {
|
|
@@ -144,12 +159,14 @@ export function getIsNoonValueTyped(event) {
|
|
|
144
159
|
const {
|
|
145
160
|
keyCode
|
|
146
161
|
} = event;
|
|
162
|
+
|
|
147
163
|
if (keyCode === 65 || keyCode === 77 || keyCode === 80) {
|
|
148
164
|
//A -65
|
|
149
165
|
//M -77
|
|
150
166
|
//P -80
|
|
151
167
|
return true;
|
|
152
168
|
}
|
|
169
|
+
|
|
153
170
|
return false;
|
|
154
171
|
}
|
|
155
172
|
export function getNoonDetails() {
|
|
@@ -157,32 +174,42 @@ export function getNoonDetails() {
|
|
|
157
174
|
allowedValues: ['AM', 'PM']
|
|
158
175
|
};
|
|
159
176
|
}
|
|
177
|
+
|
|
160
178
|
function getIsArrowTyped(keyCode) {
|
|
161
179
|
const arrowKeycodes = [37, 38, 39, 40];
|
|
180
|
+
|
|
162
181
|
if (arrowKeycodes.indexOf(keyCode) >= 0) {
|
|
163
182
|
return true;
|
|
164
183
|
}
|
|
184
|
+
|
|
165
185
|
return false;
|
|
166
186
|
}
|
|
187
|
+
|
|
167
188
|
export function getIsSupportedKey(event) {
|
|
168
189
|
const {
|
|
169
190
|
keyCode
|
|
170
191
|
} = event;
|
|
192
|
+
|
|
171
193
|
if (getIsArrowTyped(keyCode) || getIsDeleteTyped(keyCode) || getIsNumberTyped(event) || getIsNoonValueTyped(event)) {
|
|
172
194
|
return true;
|
|
173
195
|
}
|
|
196
|
+
|
|
174
197
|
return false;
|
|
175
198
|
}
|
|
176
199
|
export function arrayIsNotEqual(a, b) {
|
|
177
200
|
return a.some((val, index) => val !== b[index]);
|
|
178
201
|
}
|
|
202
|
+
|
|
179
203
|
function getIsEmptyValue(value, startPoint, endPoint) {
|
|
180
204
|
const newValue = parseInt(value) || 0;
|
|
205
|
+
|
|
181
206
|
if (newValue >= startPoint && newValue <= endPoint) {
|
|
182
207
|
return false;
|
|
183
208
|
}
|
|
209
|
+
|
|
184
210
|
return true;
|
|
185
211
|
}
|
|
212
|
+
|
|
186
213
|
export function getIsEmptyHour(value, is24Hour) {
|
|
187
214
|
const {
|
|
188
215
|
startPoint,
|
|
@@ -204,6 +231,7 @@ export function getIsCurrentYear(_ref) {
|
|
|
204
231
|
timeZone
|
|
205
232
|
} = _ref;
|
|
206
233
|
let isCurrentYear = false;
|
|
234
|
+
|
|
207
235
|
if (value && value !== INVALID_DATE) {
|
|
208
236
|
const dateObj = getDateText(value, isDateTime, timeZone);
|
|
209
237
|
const currentDateObj = new Date();
|
|
@@ -211,6 +239,7 @@ export function getIsCurrentYear(_ref) {
|
|
|
211
239
|
const selectedYear = dateObj.getFullYear();
|
|
212
240
|
isCurrentYear = currentYear === selectedYear;
|
|
213
241
|
}
|
|
242
|
+
|
|
214
243
|
return {
|
|
215
244
|
isCurrentYear
|
|
216
245
|
};
|
|
@@ -223,6 +252,7 @@ export function removeYearPattern(dateFormatArr, patternArr) {
|
|
|
223
252
|
const {
|
|
224
253
|
type
|
|
225
254
|
} = flags[val];
|
|
255
|
+
|
|
226
256
|
if (type === 'year') {
|
|
227
257
|
yearIndex = index;
|
|
228
258
|
} else {
|
|
@@ -24,6 +24,7 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
24
24
|
startPoint,
|
|
25
25
|
endPoint
|
|
26
26
|
} = getMonthDetails();
|
|
27
|
+
|
|
27
28
|
if (keyCode === 38) {
|
|
28
29
|
//up arrow
|
|
29
30
|
if (newMonth === endPoint || !newMonth) {
|
|
@@ -46,15 +47,19 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
46
47
|
const keyString = getKeyValue(event);
|
|
47
48
|
let newValue = isNewType ? keyString : month.toString() + keyString;
|
|
48
49
|
newValue = Number.parseInt(newValue);
|
|
50
|
+
|
|
49
51
|
if (isNewType) {
|
|
50
52
|
isChanged = true;
|
|
53
|
+
|
|
51
54
|
if (newValue * 10 > endPoint) {
|
|
52
55
|
newFocusOrder += 1;
|
|
53
56
|
}
|
|
57
|
+
|
|
54
58
|
newMonth = newValue;
|
|
55
59
|
} else {
|
|
56
60
|
isChanged = true;
|
|
57
61
|
newFocusOrder += 1;
|
|
62
|
+
|
|
58
63
|
if (newValue > endPoint) {
|
|
59
64
|
newMonth = endPoint;
|
|
60
65
|
} else if (!newValue) {
|
|
@@ -67,12 +72,15 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
67
72
|
isChanged = true;
|
|
68
73
|
newMonth = '';
|
|
69
74
|
}
|
|
75
|
+
|
|
70
76
|
const dayEnd = getDayEnd(newMonth, newYear);
|
|
71
77
|
let dayChanged = false;
|
|
78
|
+
|
|
72
79
|
if (newDay && newDay > dayEnd) {
|
|
73
80
|
dayChanged = true;
|
|
74
81
|
newDay = dayEnd;
|
|
75
82
|
}
|
|
83
|
+
|
|
76
84
|
return {
|
|
77
85
|
day: dayChanged ? newDay : day,
|
|
78
86
|
month: newMonth,
|
|
@@ -23,6 +23,7 @@ export function getChangedHour(values, event, focusOrders, keyActions) {
|
|
|
23
23
|
startPoint,
|
|
24
24
|
endPoint
|
|
25
25
|
} = getHourDetails(is24Hour);
|
|
26
|
+
|
|
26
27
|
if (keyCode === 38) {
|
|
27
28
|
//up arrow
|
|
28
29
|
if (newHour === endPoint || getIsEmptyHour(newHour, is24Hour)) {
|
|
@@ -45,15 +46,19 @@ export function getChangedHour(values, event, focusOrders, keyActions) {
|
|
|
45
46
|
const keyString = getKeyValue(event);
|
|
46
47
|
let newValue = isNewType ? keyString : hour.toString() + keyString;
|
|
47
48
|
newValue = Number.parseInt(newValue);
|
|
49
|
+
|
|
48
50
|
if (isNewType) {
|
|
49
51
|
isChanged = true;
|
|
52
|
+
|
|
50
53
|
if (newValue * 10 > endPoint) {
|
|
51
54
|
newFocusOrder += 1;
|
|
52
55
|
}
|
|
56
|
+
|
|
53
57
|
newHour = newValue;
|
|
54
58
|
} else {
|
|
55
59
|
isChanged = true;
|
|
56
60
|
newFocusOrder += 1;
|
|
61
|
+
|
|
57
62
|
if (newValue > endPoint) {
|
|
58
63
|
newHour = endPoint;
|
|
59
64
|
} else if (!newValue) {
|
|
@@ -66,6 +71,7 @@ export function getChangedHour(values, event, focusOrders, keyActions) {
|
|
|
66
71
|
isChanged = true;
|
|
67
72
|
newHour = '';
|
|
68
73
|
}
|
|
74
|
+
|
|
69
75
|
return {
|
|
70
76
|
hour: newHour,
|
|
71
77
|
isChanged,
|
|
@@ -92,6 +98,7 @@ export function getChangedMinute(values, event, focusOrders, keyActions) {
|
|
|
92
98
|
startPoint,
|
|
93
99
|
endPoint
|
|
94
100
|
} = getMinuteDetails();
|
|
101
|
+
|
|
95
102
|
if (keyCode === 38) {
|
|
96
103
|
//up arrow
|
|
97
104
|
if (newMinute === endPoint || isEmptyMinute) {
|
|
@@ -114,15 +121,19 @@ export function getChangedMinute(values, event, focusOrders, keyActions) {
|
|
|
114
121
|
const keyString = getKeyValue(event);
|
|
115
122
|
let newValue = isNewType ? keyString : minute.toString() + keyString;
|
|
116
123
|
newValue = Number.parseInt(newValue);
|
|
124
|
+
|
|
117
125
|
if (isNewType) {
|
|
118
126
|
isChanged = true;
|
|
127
|
+
|
|
119
128
|
if (newValue * 10 > endPoint) {
|
|
120
129
|
newFocusOrder += 1;
|
|
121
130
|
}
|
|
131
|
+
|
|
122
132
|
newMinute = newValue;
|
|
123
133
|
} else {
|
|
124
134
|
isChanged = true;
|
|
125
135
|
newFocusOrder += 1;
|
|
136
|
+
|
|
126
137
|
if (newValue > endPoint) {
|
|
127
138
|
newMinute = endPoint;
|
|
128
139
|
} else {
|
|
@@ -133,13 +144,16 @@ export function getChangedMinute(values, event, focusOrders, keyActions) {
|
|
|
133
144
|
isChanged = true;
|
|
134
145
|
newMinute = '';
|
|
135
146
|
}
|
|
147
|
+
|
|
136
148
|
return {
|
|
137
149
|
minute: newMinute,
|
|
138
150
|
isChanged,
|
|
139
151
|
focusOrder: newFocusOrder
|
|
140
152
|
};
|
|
141
153
|
}
|
|
142
|
-
export function getChangedNoon(values, event, focusOrders
|
|
154
|
+
export function getChangedNoon(values, event, focusOrders
|
|
155
|
+
/*keyActions*/
|
|
156
|
+
) {
|
|
143
157
|
const {
|
|
144
158
|
keyCode,
|
|
145
159
|
which
|
|
@@ -152,9 +166,7 @@ export function getChangedNoon(values, event, focusOrders /*keyActions*/) {
|
|
|
152
166
|
const {
|
|
153
167
|
focusOrder
|
|
154
168
|
} = focusOrders;
|
|
155
|
-
const newFocusOrder = focusOrder;
|
|
156
|
-
|
|
157
|
-
// const isNewType = getIsNewValueType(focusOrders, keyActions);
|
|
169
|
+
const newFocusOrder = focusOrder; // const isNewType = getIsNewValueType(focusOrders, keyActions);
|
|
158
170
|
|
|
159
171
|
const {
|
|
160
172
|
allowedValues
|
|
@@ -162,6 +174,7 @@ export function getChangedNoon(values, event, focusOrders /*keyActions*/) {
|
|
|
162
174
|
const [startPoint] = allowedValues;
|
|
163
175
|
const endPoint = allowedValues[allowedValues.length - 1];
|
|
164
176
|
const currentNoonIndex = allowedValues.indexOf(newNoon);
|
|
177
|
+
|
|
165
178
|
if (keyCode === 38) {
|
|
166
179
|
//up arrow
|
|
167
180
|
if (newNoon === endPoint || !newNoon) {
|
|
@@ -181,11 +194,11 @@ export function getChangedNoon(values, event, focusOrders /*keyActions*/) {
|
|
|
181
194
|
newNoon = allowedValues[currentNoonIndex - 1];
|
|
182
195
|
}
|
|
183
196
|
} else if (getIsNoonValueTyped(event)) {
|
|
184
|
-
const keyString = getKeyValue(event).toUpperCase();
|
|
197
|
+
const keyString = getKeyValue(event).toUpperCase(); // let newValue = isNewType ? keyString : noon.toString() + keyString;
|
|
185
198
|
|
|
186
|
-
// let newValue = isNewType ? keyString : noon.toString() + keyString;
|
|
187
199
|
const newValue = keyString;
|
|
188
200
|
const needChangeNoon = newNoon.indexOf(newValue) === -1 ? true : false;
|
|
201
|
+
|
|
189
202
|
if (needChangeNoon) {
|
|
190
203
|
let newValueIndex = currentNoonIndex;
|
|
191
204
|
allowedValues.some((val, index) => {
|
|
@@ -193,8 +206,10 @@ export function getChangedNoon(values, event, focusOrders /*keyActions*/) {
|
|
|
193
206
|
newValueIndex = index;
|
|
194
207
|
return true;
|
|
195
208
|
}
|
|
209
|
+
|
|
196
210
|
return false;
|
|
197
211
|
});
|
|
212
|
+
|
|
198
213
|
if (currentNoonIndex !== newValueIndex) {
|
|
199
214
|
isChanged = true;
|
|
200
215
|
newNoon = allowedValues[newValueIndex];
|
|
@@ -204,6 +219,7 @@ export function getChangedNoon(values, event, focusOrders /*keyActions*/) {
|
|
|
204
219
|
isChanged = true;
|
|
205
220
|
newNoon = '';
|
|
206
221
|
}
|
|
222
|
+
|
|
207
223
|
return {
|
|
208
224
|
noon: newNoon,
|
|
209
225
|
isChanged,
|
|
@@ -16,16 +16,17 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
16
16
|
day = '',
|
|
17
17
|
month = ''
|
|
18
18
|
} = values;
|
|
19
|
-
let isChanged = false;
|
|
19
|
+
let isChanged = false; //Year Two Digit case
|
|
20
20
|
|
|
21
|
-
//Year Two Digit case
|
|
22
21
|
const {
|
|
23
22
|
length: yearLength
|
|
24
23
|
} = yearInfo;
|
|
25
24
|
const oldYear = year; // For get Centuries
|
|
25
|
+
|
|
26
26
|
if (yearLength === 2) {
|
|
27
27
|
year = convertYearToTwoDigit(year).toString();
|
|
28
28
|
}
|
|
29
|
+
|
|
29
30
|
let newDay = Number.parseInt(day) || 0;
|
|
30
31
|
const newMonth = Number.parseInt(month) || 0;
|
|
31
32
|
let newYear = Number.parseInt(year) || 0;
|
|
@@ -39,6 +40,7 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
39
40
|
endPoint,
|
|
40
41
|
currentYear
|
|
41
42
|
} = getYearDetails(yearLength);
|
|
43
|
+
|
|
42
44
|
if (keyCode === 38) {
|
|
43
45
|
//up arrow
|
|
44
46
|
if (newYear === endPoint) {
|
|
@@ -68,14 +70,17 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
68
70
|
let newValue = isNewType ? keyString : year.toString() + keyString;
|
|
69
71
|
const newValueString = newValue || '';
|
|
70
72
|
newValue = Number.parseInt(newValue);
|
|
73
|
+
|
|
71
74
|
if (isNewType) {
|
|
72
75
|
isChanged = true;
|
|
73
76
|
newYear = newValue;
|
|
74
77
|
} else {
|
|
75
78
|
isChanged = true;
|
|
79
|
+
|
|
76
80
|
if (newValue * 10 > endPoint) {
|
|
77
81
|
newFocusOrder += 1;
|
|
78
82
|
}
|
|
83
|
+
|
|
79
84
|
if (newValue > endPoint) {
|
|
80
85
|
// newYear = endPoint;
|
|
81
86
|
newYear = currentYear;
|
|
@@ -94,15 +99,19 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
94
99
|
isChanged = true;
|
|
95
100
|
newYear = '';
|
|
96
101
|
}
|
|
102
|
+
|
|
97
103
|
if (yearLength === 2) {
|
|
98
104
|
newYear = convertTwoDigitToYear(newYear, oldYear);
|
|
99
105
|
}
|
|
106
|
+
|
|
100
107
|
const dayEnd = getDayEnd(newMonth, newYear);
|
|
101
108
|
let dayChanged = false;
|
|
109
|
+
|
|
102
110
|
if (newDay && newDay > dayEnd) {
|
|
103
111
|
dayChanged = true;
|
|
104
112
|
newDay = dayEnd;
|
|
105
113
|
}
|
|
114
|
+
|
|
106
115
|
return {
|
|
107
116
|
day: dayChanged ? newDay : day,
|
|
108
117
|
year: newYear,
|
|
@@ -4,56 +4,50 @@ export const clone = (a, b, c, d, e, f) => {
|
|
|
4
4
|
};
|
|
5
5
|
export const extract = (obj, keys, target) => {
|
|
6
6
|
target = target || {};
|
|
7
|
+
|
|
7
8
|
for (var i in obj) {
|
|
8
9
|
if (keys.indexOf(i) < 0) continue;
|
|
9
10
|
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
|
10
11
|
target[i] = obj[i];
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
return target;
|
|
13
15
|
};
|
|
14
16
|
export const omit = (obj, keys, target) => {
|
|
15
17
|
target = target || {};
|
|
18
|
+
|
|
16
19
|
for (var i in obj) {
|
|
17
20
|
if (keys.indexOf(i) >= 0) continue;
|
|
18
21
|
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
|
19
22
|
target[i] = obj[i];
|
|
20
23
|
}
|
|
24
|
+
|
|
21
25
|
return target;
|
|
22
26
|
};
|
|
23
27
|
export const equals = (x, y) => {
|
|
24
|
-
if (x === y) return true;
|
|
25
|
-
// if both x and y are null or undefined and exactly the same
|
|
28
|
+
if (x === y) return true; // if both x and y are null or undefined and exactly the same
|
|
26
29
|
|
|
27
|
-
if (x == null && y != null || x != null && y == null) return false;
|
|
28
|
-
//break if not same null or undefined
|
|
30
|
+
if (x == null && y != null || x != null && y == null) return false; //break if not same null or undefined
|
|
29
31
|
|
|
30
|
-
if (!(x instanceof Object) || !(y instanceof Object)) return false;
|
|
31
|
-
// if they are not strictly equal, they both need to be Objects
|
|
32
|
+
if (!(x instanceof Object) || !(y instanceof Object)) return false; // if they are not strictly equal, they both need to be Objects
|
|
32
33
|
|
|
33
|
-
if (x.constructor !== y.constructor) return false;
|
|
34
|
-
// they must have the exact same prototype chain, the closest we can do is
|
|
34
|
+
if (x.constructor !== y.constructor) return false; // they must have the exact same prototype chain, the closest we can do is
|
|
35
35
|
// test there constructor.
|
|
36
36
|
|
|
37
37
|
for (var p in x) {
|
|
38
|
-
if (!x.hasOwnProperty(p)) continue;
|
|
39
|
-
// other properties were tested using x.constructor === y.constructor
|
|
38
|
+
if (!x.hasOwnProperty(p)) continue; // other properties were tested using x.constructor === y.constructor
|
|
40
39
|
|
|
41
|
-
if (!y.hasOwnProperty(p)) return false;
|
|
42
|
-
// allows to compare x[ p ] and y[ p ] when set to undefined
|
|
40
|
+
if (!y.hasOwnProperty(p)) return false; // allows to compare x[ p ] and y[ p ] when set to undefined
|
|
43
41
|
|
|
44
|
-
if (x[p] === y[p]) continue;
|
|
45
|
-
// if they have the same strict value or identity then they are equal
|
|
42
|
+
if (x[p] === y[p]) continue; // if they have the same strict value or identity then they are equal
|
|
46
43
|
|
|
47
|
-
if (typeof x[p] !== 'object') return false;
|
|
48
|
-
// Numbers, Strings, Functions, Booleans must be strictly equal
|
|
44
|
+
if (typeof x[p] !== 'object') return false; // Numbers, Strings, Functions, Booleans must be strictly equal
|
|
49
45
|
|
|
50
|
-
if (!equals(x[p], y[p])) return false;
|
|
51
|
-
// Objects and Arrays must be tested recursively
|
|
46
|
+
if (!equals(x[p], y[p])) return false; // Objects and Arrays must be tested recursively
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
for (p in y) {
|
|
55
|
-
if (y.hasOwnProperty(p) && !x.hasOwnProperty(p)) return false;
|
|
56
|
-
// allows x[ p ] to be set to undefined
|
|
50
|
+
if (y.hasOwnProperty(p) && !x.hasOwnProperty(p)) return false; // allows x[ p ] to be set to undefined
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
return true;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const exports = {};
|
|
2
2
|
let types = 'Array Object String Date RegExp Function Boolean Number Null Undefined'.split(' ');
|
|
3
|
+
|
|
3
4
|
let type = function () {
|
|
4
5
|
return Object.prototype.toString.call(this).slice(8, -1);
|
|
5
6
|
};
|
|
7
|
+
|
|
6
8
|
for (let i = types.length; i--;) {
|
|
7
9
|
/*eslint-disable */
|
|
8
10
|
exports['is' + types[i]] = function (self) {
|
|
@@ -13,4 +15,5 @@ for (let i = types.length; i--;) {
|
|
|
13
15
|
}
|
|
14
16
|
/*eslint-enable */
|
|
15
17
|
|
|
18
|
+
|
|
16
19
|
export default exports;
|