@zohodesk/components 1.0.0-test-252 → 1.0.0
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 +161 -1
- package/assets/Appearance/dark/mode/darkMode.module.css +181 -179
- package/assets/Appearance/dark/themes/blue/blueDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +31 -31
- package/assets/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/red/redDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/red/redDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/red/redDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +177 -175
- package/assets/Appearance/default/themes/blue/blueDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +31 -31
- package/assets/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/red/redDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/red/redDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/red/redDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +182 -180
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +31 -31
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/green/greenPureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/red/redPureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkComponentTheme.module.css +3 -0
- package/assets/Contrast/darkContrastLightness.module.css +39 -0
- package/assets/Contrast/defaultContrastLightness.module.css +39 -0
- package/assets/Contrast/pureDarkContrastLightness.module.css +39 -0
- package/css_error.log +1 -0
- package/es/Accordion/Accordion.js +19 -9
- package/es/Accordion/AccordionItem.js +13 -8
- package/es/Accordion/props/defaultProps.js +6 -2
- package/es/Accordion/props/propTypes.js +3 -0
- package/es/Animation/Animation.js +10 -9
- package/es/AppContainer/AppContainer.js +38 -15
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/AppContainer/props/defaultProps.js +3 -1
- package/es/AppContainer/props/propTypes.js +2 -0
- package/es/Avatar/Avatar.js +48 -25
- package/es/Avatar/Avatar.module.css +59 -18
- package/es/Avatar/props/defaultProps.js +4 -1
- package/es/Avatar/props/propTypes.js +5 -2
- package/es/AvatarTeam/AvatarTeam.js +21 -11
- package/es/AvatarTeam/AvatarTeam.module.css +49 -21
- package/es/AvatarTeam/props/defaultProps.js +5 -1
- package/es/AvatarTeam/props/propTypes.js +5 -1
- package/es/Button/Button.js +55 -51
- package/{lib/Button → es/Button/css}/Button.module.css +62 -58
- package/es/Button/css/cssJSLogic.js +53 -0
- package/es/Button/index.js +2 -0
- package/es/Button/props/defaultProps.js +3 -1
- package/es/Button/props/propTypes.js +6 -2
- package/es/Buttongroup/Buttongroup.js +24 -16
- package/es/Buttongroup/Buttongroup.module.css +45 -28
- package/es/Buttongroup/props/defaultProps.js +3 -1
- package/es/Buttongroup/props/propTypes.js +3 -1
- package/es/Card/Card.js +48 -26
- package/es/Card/props/defaultProps.js +12 -2
- package/es/Card/props/propTypes.js +2 -2
- package/es/CheckBox/CheckBox.js +13 -9
- package/es/CheckBox/CheckBox.module.css +16 -16
- package/es/CheckBox/props/propTypes.js +1 -0
- package/es/DateTime/CalendarView.js +46 -19
- package/es/DateTime/DateTime.js +139 -77
- package/es/DateTime/DateTime.module.css +51 -48
- package/es/DateTime/DateTimePopupFooter.js +4 -2
- package/es/DateTime/DateTimePopupHeader.js +30 -11
- package/es/DateTime/DateWidget.js +122 -51
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +6 -3
- package/es/DateTime/Time.js +10 -2
- package/es/DateTime/YearView.js +41 -9
- package/es/DateTime/YearView.module.css +33 -15
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
- package/es/DateTime/__tests__/DateTime.spec.js +1 -0
- package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +42 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +59 -2
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/props/defaultProps.js +2 -1
- package/es/DateTime/props/propTypes.js +5 -2
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +82 -218
- package/es/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +435 -0
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +91 -0
- package/es/DropBox/DropBoxElement/props/defaultProps.js +18 -0
- package/es/DropBox/DropBoxElement/props/propTypes.js +45 -0
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +54 -0
- package/es/DropBox/__tests__/DropBox.spec.js +2 -2
- package/es/DropBox/css/DropBox.module.css +59 -0
- package/es/DropBox/css/cssJSLogic.js +14 -0
- package/es/DropBox/props/defaultProps.js +9 -15
- package/es/DropBox/props/propTypes.js +9 -41
- package/es/DropDown/DropDown.js +16 -9
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +18 -11
- package/es/DropDown/DropDownHeading.module.css +3 -3
- package/es/DropDown/DropDownItem.js +8 -1
- package/es/DropDown/DropDownItem.module.css +9 -9
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -2
- package/es/DropDown/index.js +7 -0
- package/es/DropDown/props/defaultProps.js +3 -1
- package/es/DropDown/props/propTypes.js +2 -1
- package/es/Heading/Heading.js +8 -7
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +14 -9
- package/es/Label/Label.module.css +1 -1
- package/es/Label/props/defaultProps.js +2 -1
- package/es/Label/props/propTypes.js +1 -0
- package/es/Layout/Box.js +19 -4
- package/es/Layout/Container.js +18 -5
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +9 -10
- package/es/Layout/props/defaultProps.js +6 -2
- package/es/Layout/props/propTypes.js +7 -3
- package/es/Layout/utils.js +5 -1
- package/es/ListItem/ListContainer.js +21 -9
- package/es/ListItem/ListItem.js +30 -14
- package/es/ListItem/ListItem.module.css +37 -30
- package/es/ListItem/ListItemWithAvatar.js +30 -15
- package/es/ListItem/ListItemWithCheckBox.js +22 -10
- package/es/ListItem/ListItemWithIcon.js +29 -14
- package/es/ListItem/ListItemWithRadio.js +22 -10
- package/es/ListItem/index.js +6 -0
- package/es/ListItem/props/defaultProps.js +18 -6
- package/es/ListItem/props/propTypes.js +13 -1
- package/es/Modal/Modal.js +35 -17
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +100 -20
- package/es/MultiSelect/AdvancedMultiSelect.js +45 -19
- package/es/MultiSelect/EmptyState.js +6 -0
- package/es/MultiSelect/MultiSelect.js +129 -46
- package/es/MultiSelect/MultiSelect.module.css +32 -31
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +43 -19
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +13 -6
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
- package/es/MultiSelect/index.js +4 -0
- package/es/MultiSelect/props/defaultProps.js +11 -4
- package/es/MultiSelect/props/propTypes.js +17 -5
- package/es/PopOver/PopOver.js +25 -9
- package/es/PopOver/__tests__/PopOver.spec.js +2 -1
- package/es/PopOver/index.js +3 -0
- package/es/Popup/Popup.js +80 -31
- package/es/Popup/__tests__/Popup.spec.js +17 -5
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/AvatarSize.js +1 -0
- package/es/Provider/IdProvider.js +16 -10
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Provider/index.js +4 -0
- package/es/Radio/Radio.js +9 -7
- package/es/Radio/Radio.module.css +3 -3
- package/es/Responsive/CustomResponsive.js +37 -21
- 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 +9 -8
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/es/Ribbon/Ribbon.js +21 -15
- package/es/Ribbon/Ribbon.module.css +133 -55
- package/es/Ribbon/props/defaultProps.js +2 -1
- package/es/Ribbon/props/propTypes.js +2 -1
- package/es/RippleEffect/RippleEffect.js +6 -7
- package/es/Select/GroupSelect.js +71 -23
- package/es/Select/Select.js +115 -50
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +31 -12
- package/es/Select/SelectWithIcon.js +60 -14
- package/es/Select/__tests__/Select.spec.js +6 -8
- package/es/Select/index.js +4 -0
- package/es/Select/props/defaultProps.js +6 -1
- package/es/Select/props/propTypes.js +10 -4
- package/es/Stencils/Stencils.js +10 -9
- package/es/Stencils/Stencils.module.css +2 -2
- package/es/Switch/Switch.js +14 -8
- package/es/Switch/Switch.module.css +49 -32
- package/es/Switch/props/defaultProps.js +2 -1
- package/es/Switch/props/propTypes.js +1 -0
- package/es/Tab/Tab.js +14 -11
- package/es/Tab/Tab.module.css +14 -15
- package/es/Tab/TabContent.js +6 -3
- package/es/Tab/TabContentWrapper.js +6 -2
- package/es/Tab/TabWrapper.js +9 -4
- package/es/Tab/Tabs.js +85 -21
- package/es/Tab/Tabs.module.css +36 -40
- package/es/Tab/__tests__/Tab.spec.js +4 -12
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
- package/es/Tab/props/defaultProps.js +10 -5
- package/es/Tab/props/propTypes.js +10 -5
- package/es/Tag/Tag.js +16 -10
- package/es/Tag/Tag.module.css +10 -10
- package/es/Tag/props/defaultProps.js +2 -1
- package/es/Tag/props/propTypes.js +2 -1
- package/es/TextBox/TextBox.js +26 -10
- package/es/TextBox/TextBox.module.css +6 -5
- package/es/TextBox/__tests__/TextBox.spec.js +1 -4
- package/es/TextBox/props/defaultProps.js +2 -1
- package/es/TextBox/props/propTypes.js +2 -1
- package/es/TextBoxIcon/TextBoxIcon.js +39 -13
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -6
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
- package/es/TextBoxIcon/props/defaultProps.js +2 -1
- package/es/TextBoxIcon/props/propTypes.js +1 -0
- package/es/Textarea/Textarea.js +23 -10
- package/es/Textarea/Textarea.module.css +6 -6
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Textarea/props/defaultProps.js +2 -1
- package/es/Textarea/props/propTypes.js +1 -0
- package/es/Tooltip/Tooltip.js +67 -21
- package/es/Tooltip/Tooltip.module.css +40 -8
- package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +7 -6
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +11 -8
- package/es/VelocityAnimation/index.js +2 -0
- package/es/common/a11y.module.css +4 -0
- package/es/common/animation.module.css +8 -8
- package/es/common/avatarsizes.module.css +6 -2
- package/es/common/basicReset.module.css +3 -3
- package/es/common/boxShadow.module.css +34 -0
- package/es/common/common.module.css +24 -24
- package/es/common/customscroll.module.css +4 -2
- package/es/common/reset.module.css +1 -0
- package/es/css.js +2 -1
- package/es/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/es/deprecated/PortalLayer/PortalLayer.js +30 -24
- package/es/index.js +30 -146
- package/es/semantic/Button/Button.js +9 -7
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/semantic/index.js +1 -0
- package/es/utils/Common.js +74 -7
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/css/compileClassNames.js +28 -0
- package/es/utils/css/mergeStyle.js +57 -0
- package/es/utils/css/utils.js +24 -0
- package/es/utils/datetime/GMTZones.js +48 -0
- package/es/utils/datetime/common.js +31 -7
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +71 -13
- package/es/utils/getInitial.js +4 -0
- package/es/utils/index.js +3 -0
- package/es/utils/shallowEqual.js +6 -0
- package/install.md +10 -0
- package/lib/Accordion/Accordion.js +50 -18
- package/lib/Accordion/AccordionItem.js +47 -20
- package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/defaultProps.js +6 -2
- package/lib/Accordion/props/propTypes.js +6 -0
- package/lib/Animation/Animation.js +44 -21
- package/lib/Animation/__tests__/Animation.spec.js +11 -7
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/AppContainer/AppContainer.js +75 -27
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/defaultProps.js +3 -1
- package/lib/AppContainer/props/propTypes.js +5 -0
- package/lib/Avatar/Avatar.js +97 -44
- package/lib/Avatar/Avatar.module.css +59 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
- package/lib/Avatar/props/defaultProps.js +4 -1
- package/lib/Avatar/props/propTypes.js +8 -2
- package/lib/AvatarTeam/AvatarTeam.js +64 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +49 -21
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
- package/lib/AvatarTeam/props/defaultProps.js +5 -1
- package/lib/AvatarTeam/props/propTypes.js +8 -1
- package/lib/Button/Button.js +64 -74
- package/{es/Button → lib/Button/css}/Button.module.css +62 -58
- package/lib/Button/css/cssJSLogic.js +41 -0
- package/lib/Button/index.js +23 -0
- package/lib/Button/props/defaultProps.js +5 -1
- package/lib/Button/props/propTypes.js +11 -3
- package/lib/Buttongroup/Buttongroup.js +49 -19
- package/lib/Buttongroup/Buttongroup.module.css +45 -28
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
- package/lib/Buttongroup/props/defaultProps.js +3 -1
- package/lib/Buttongroup/props/propTypes.js +6 -1
- package/lib/Card/Card.js +119 -55
- package/lib/Card/__tests__/Card.spec.js +10 -1
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/defaultProps.js +16 -4
- package/lib/Card/props/propTypes.js +5 -2
- package/lib/CheckBox/CheckBox.js +76 -48
- package/lib/CheckBox/CheckBox.module.css +16 -16
- package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
- package/lib/CheckBox/props/propTypes.js +4 -0
- package/lib/DateTime/CalendarView.js +95 -38
- package/lib/DateTime/DateTime.js +309 -216
- package/lib/DateTime/DateTime.module.css +51 -48
- package/lib/DateTime/DateTimePopupFooter.js +30 -5
- package/lib/DateTime/DateTimePopupHeader.js +69 -23
- package/lib/DateTime/DateWidget.js +370 -260
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +28 -3
- package/lib/DateTime/Time.js +72 -29
- package/lib/DateTime/YearView.js +89 -30
- package/lib/DateTime/YearView.module.css +33 -15
- package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
- package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
- package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +50 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
- package/lib/DateTime/dateFormatUtils/index.js +99 -13
- package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +52 -20
- package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
- package/lib/DateTime/index.js +3 -1
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/defaultProps.js +2 -1
- package/lib/DateTime/props/propTypes.js +21 -2
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +69 -6
- package/lib/DropBox/DropBox.js +102 -249
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +435 -0
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +81 -0
- package/lib/DropBox/DropBoxElement/props/defaultProps.js +25 -0
- package/lib/DropBox/DropBoxElement/props/propTypes.js +56 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +60 -0
- package/lib/DropBox/__tests__/DropBox.spec.js +8 -4
- package/lib/DropBox/css/DropBox.module.css +59 -0
- package/lib/DropBox/css/cssJSLogic.js +20 -0
- package/lib/DropBox/props/defaultProps.js +20 -17
- package/lib/DropBox/props/propTypes.js +22 -43
- package/lib/DropDown/DropDown.js +58 -10
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +47 -18
- package/lib/DropDown/DropDownHeading.module.css +3 -3
- package/lib/DropDown/DropDownItem.js +43 -18
- package/lib/DropDown/DropDownItem.module.css +9 -9
- package/lib/DropDown/DropDownSearch.js +39 -14
- package/lib/DropDown/DropDownSeparator.js +23 -1
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
- package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
- package/lib/DropDown/index.js +65 -0
- package/lib/DropDown/props/defaultProps.js +3 -1
- package/lib/DropDown/props/propTypes.js +7 -1
- package/lib/Heading/Heading.js +42 -16
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +47 -19
- package/lib/Label/Label.module.css +1 -1
- package/lib/Label/__tests__/Label.spec.js +14 -1
- package/lib/Label/props/defaultProps.js +2 -1
- package/lib/Label/props/propTypes.js +4 -0
- package/lib/Layout/Box.js +41 -16
- package/lib/Layout/Container.js +39 -15
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/__tests__/Box.spec.js +65 -49
- package/lib/Layout/__tests__/Container.spec.js +67 -50
- package/lib/Layout/index.js +4 -11
- package/lib/Layout/props/defaultProps.js +6 -2
- package/lib/Layout/props/propTypes.js +10 -3
- package/lib/Layout/utils.js +15 -1
- package/lib/ListItem/ListContainer.js +61 -34
- package/lib/ListItem/ListItem.js +92 -50
- package/lib/ListItem/ListItem.module.css +37 -30
- package/lib/ListItem/ListItemWithAvatar.js +98 -54
- package/lib/ListItem/ListItemWithCheckBox.js +82 -41
- package/lib/ListItem/ListItemWithIcon.js +92 -50
- package/lib/ListItem/ListItemWithRadio.js +83 -42
- package/lib/ListItem/index.js +55 -0
- package/lib/ListItem/props/defaultProps.js +18 -6
- package/lib/ListItem/props/propTypes.js +18 -3
- package/lib/Modal/Modal.js +51 -13
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +300 -167
- package/lib/MultiSelect/AdvancedMultiSelect.js +212 -130
- package/lib/MultiSelect/EmptyState.js +48 -21
- package/lib/MultiSelect/MultiSelect.js +341 -205
- package/lib/MultiSelect/MultiSelect.module.css +32 -31
- package/lib/MultiSelect/MultiSelectHeader.js +29 -5
- package/lib/MultiSelect/MultiSelectWithAvatar.js +126 -65
- package/lib/MultiSelect/SelectedOptions.js +42 -14
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +66 -29
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
- package/lib/MultiSelect/index.js +39 -0
- package/lib/MultiSelect/props/defaultProps.js +13 -4
- package/lib/MultiSelect/props/propTypes.js +20 -5
- package/lib/PopOver/PopOver.js +101 -53
- package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
- package/lib/PopOver/index.js +31 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -83
- package/lib/Popup/__tests__/Popup.spec.js +42 -5
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +5 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +23 -12
- package/lib/Provider/LibraryContext.js +32 -10
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +43 -14
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +81 -0
- package/lib/Radio/Radio.js +65 -40
- package/lib/Radio/Radio.module.css +3 -3
- package/lib/Radio/__tests__/Radiospec.js +9 -5
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +76 -26
- package/lib/Responsive/RefWrapper.js +15 -7
- package/lib/Responsive/ResizeComponent.js +58 -27
- package/lib/Responsive/ResizeObserver.js +23 -6
- package/lib/Responsive/Responsive.js +76 -24
- package/lib/Responsive/index.js +49 -22
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +51 -13
- 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 +44 -14
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
- package/lib/Ribbon/Ribbon.js +48 -21
- package/lib/Ribbon/Ribbon.module.css +133 -55
- package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
- package/lib/Ribbon/props/defaultProps.js +2 -1
- package/lib/Ribbon/props/propTypes.js +5 -1
- package/lib/RippleEffect/RippleEffect.js +23 -14
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +240 -137
- package/lib/Select/Select.js +320 -220
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +112 -59
- package/lib/Select/SelectWithIcon.js +145 -82
- package/lib/Select/__tests__/Select.spec.js +131 -89
- package/lib/Select/index.js +39 -0
- package/lib/Select/props/defaultProps.js +10 -2
- package/lib/Select/props/propTypes.js +13 -4
- package/lib/Stencils/Stencils.js +35 -13
- package/lib/Stencils/Stencils.module.css +2 -2
- package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +64 -35
- package/lib/Switch/Switch.module.css +49 -32
- package/lib/Switch/props/defaultProps.js +2 -1
- package/lib/Switch/props/propTypes.js +4 -0
- package/lib/Tab/Tab.js +49 -33
- package/lib/Tab/Tab.module.css +14 -15
- package/lib/Tab/TabContent.js +15 -6
- package/lib/Tab/TabContentWrapper.js +15 -6
- package/lib/Tab/TabWrapper.js +37 -17
- package/lib/Tab/Tabs.js +193 -94
- package/lib/Tab/Tabs.module.css +36 -40
- package/lib/Tab/__tests__/Tab.spec.js +74 -70
- package/lib/Tab/__tests__/TabContent.spec.js +10 -6
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
- package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
- package/lib/Tab/__tests__/Tabs.spec.js +53 -39
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/defaultProps.js +10 -5
- package/lib/Tab/props/propTypes.js +13 -5
- package/lib/Tag/Tag.js +82 -48
- package/lib/Tag/Tag.module.css +10 -10
- package/lib/Tag/__tests__/Tag.spec.js +14 -8
- package/lib/Tag/props/defaultProps.js +2 -1
- package/lib/Tag/props/propTypes.js +5 -1
- package/lib/TextBox/TextBox.js +93 -61
- package/lib/TextBox/TextBox.module.css +6 -5
- package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
- package/lib/TextBox/props/defaultProps.js +2 -1
- package/lib/TextBox/props/propTypes.js +6 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +108 -60
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -6
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -5
- package/lib/TextBoxIcon/props/defaultProps.js +2 -1
- package/lib/TextBoxIcon/props/propTypes.js +4 -0
- package/lib/Textarea/Textarea.js +63 -32
- package/lib/Textarea/Textarea.module.css +6 -6
- package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
- package/lib/Textarea/props/defaultProps.js +2 -1
- package/lib/Textarea/props/propTypes.js +4 -0
- package/lib/Tooltip/Tooltip.js +102 -35
- package/lib/Tooltip/Tooltip.module.css +40 -8
- package/lib/Tooltip/__tests__/Tooltip.spec.js +23 -0
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +43 -17
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +55 -24
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +23 -0
- package/lib/common/a11y.module.css +4 -0
- package/lib/common/animation.module.css +8 -8
- package/lib/common/avatarsizes.module.css +6 -2
- package/lib/common/basicReset.module.css +3 -3
- package/lib/common/boxShadow.module.css +34 -0
- package/lib/common/common.module.css +24 -24
- package/lib/common/customscroll.module.css +4 -2
- package/lib/common/reset.module.css +1 -0
- package/lib/css.js +42 -1
- package/lib/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/lib/deprecated/PortalLayer/PortalLayer.js +50 -24
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +214 -210
- package/lib/semantic/Button/Button.js +47 -24
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +15 -0
- package/lib/utils/Common.js +136 -17
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/__tests__/constructFullName.spec.js +1 -0
- package/lib/utils/__tests__/debounce.spec.js +3 -2
- package/lib/utils/__tests__/getInitial.spec.js +1 -0
- package/lib/utils/constructFullName.js +11 -2
- package/lib/utils/css/compileClassNames.js +37 -0
- package/lib/utils/css/mergeStyle.js +69 -0
- package/lib/utils/css/utils.js +41 -0
- package/lib/utils/datetime/GMTZones.js +55 -0
- package/lib/utils/datetime/common.js +52 -7
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +177 -56
- 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 +121 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/package.json +61 -26
- package/postPublish.js +8 -0
- package/prePublish.js +70 -0
- package/docs/external/active-line.js +0 -72
- package/docs/external/autorefresh.js +0 -47
- package/docs/external/codemirror.js +0 -9681
- package/docs/external/css/hopscotch.css +0 -576
- package/docs/external/css/styleGuide.css +0 -1100
- package/docs/external/css.js +0 -466
- package/docs/external/designTokens.js +0 -1
- package/docs/external/foldcode.js +0 -152
- package/docs/external/format.js +0 -129
- package/docs/external/htmlmixed.js +0 -84
- package/docs/external/images/bottom.png +0 -0
- package/docs/external/images/bottombg.jpg +0 -0
- package/docs/external/images/desk.png +0 -0
- package/docs/external/images/desklogo.png +0 -0
- package/docs/external/images/menu.png +0 -0
- package/docs/external/index.html +0 -127
- package/docs/external/javascript.js +0 -422
- package/docs/external/jsx.js +0 -148
- package/docs/external/matchbrackets.js +0 -145
- package/docs/external/xml.js +0 -322
- package/docs/package.json +0 -41
- package/docs/src/index.js +0 -1311
- package/es/Button/__tests__/Button.spec.js +0 -190
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/es/DropBox/DropBox.module.css +0 -406
- package/lib/Button/__tests__/Button.spec.js +0 -193
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/lib/DropBox/DropBox.module.css +0 -406
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
/** * Libraries ** */
|
|
4
4
|
import datetime from '@zohodesk/datetimejs';
|
|
5
|
-
|
|
6
5
|
/** * Methods ** */
|
|
7
|
-
import { getMonthEnd } from '../../utils/datetime/common';
|
|
8
6
|
|
|
7
|
+
import { getMonthEnd } from '../../utils/datetime/common';
|
|
9
8
|
/** * Constants ** */
|
|
9
|
+
|
|
10
10
|
import { flags, INVALID_DATE } from '../constants';
|
|
11
11
|
export function convertYearToTwoDigit(year) {
|
|
12
12
|
return parseInt(year.toString().slice(-2));
|
|
@@ -15,6 +15,7 @@ export function addZero() {
|
|
|
15
15
|
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
16
16
|
let length = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
17
|
let newValue = value.toString();
|
|
18
|
+
|
|
18
19
|
for (let i = 0; i < length; i++) {
|
|
19
20
|
if (newValue.length < length) {
|
|
20
21
|
newValue = `0${newValue}`;
|
|
@@ -22,16 +23,19 @@ export function addZero() {
|
|
|
22
23
|
break;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
return newValue;
|
|
26
28
|
}
|
|
27
29
|
export function getDayEnd(month, year) {
|
|
28
30
|
month -= 1;
|
|
29
31
|
const monthend = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
32
|
+
|
|
30
33
|
if (month && year) {
|
|
31
34
|
return getMonthEnd(month, year);
|
|
32
35
|
} else if (month) {
|
|
33
36
|
return monthend[month];
|
|
34
37
|
}
|
|
38
|
+
|
|
35
39
|
return 31;
|
|
36
40
|
}
|
|
37
41
|
export function getIsNumberTyped(event) {
|
|
@@ -41,15 +45,18 @@ export function getIsNumberTyped(event) {
|
|
|
41
45
|
metaKey,
|
|
42
46
|
shiftKey
|
|
43
47
|
} = event;
|
|
48
|
+
|
|
44
49
|
if (keyCode >= 48 && keyCode <= 57 && !ctrlKey && !metaKey && !shiftKey) {
|
|
45
50
|
return true;
|
|
46
51
|
}
|
|
52
|
+
|
|
47
53
|
return false;
|
|
48
54
|
}
|
|
49
55
|
export function getIsDeleteTyped(keyCode) {
|
|
50
56
|
if (keyCode === 8) {
|
|
51
57
|
return true;
|
|
52
58
|
}
|
|
59
|
+
|
|
53
60
|
return false;
|
|
54
61
|
}
|
|
55
62
|
export function getIsNewValueType(focusOrders, keyActions) {
|
|
@@ -78,6 +85,7 @@ export function getMonthDetails() {
|
|
|
78
85
|
export function getYearDetails(yearLength) {
|
|
79
86
|
const dateObj = new Date();
|
|
80
87
|
const year = dateObj.getFullYear();
|
|
88
|
+
|
|
81
89
|
if (yearLength === 2) {
|
|
82
90
|
return {
|
|
83
91
|
startPoint: 0,
|
|
@@ -85,6 +93,7 @@ export function getYearDetails(yearLength) {
|
|
|
85
93
|
currentYear: year
|
|
86
94
|
};
|
|
87
95
|
}
|
|
96
|
+
|
|
88
97
|
return {
|
|
89
98
|
startPoint: 1850,
|
|
90
99
|
endPoint: 9999,
|
|
@@ -98,9 +107,11 @@ export function convertTwoDigitToYear() {
|
|
|
98
107
|
let year = dateObj.getFullYear();
|
|
99
108
|
const digitValueStr = addZero(digitValue.toString(), 2);
|
|
100
109
|
year = selectedYear ? selectedYear : year;
|
|
110
|
+
|
|
101
111
|
if (digitValueStr && digitValueStr.length <= 2) {
|
|
102
112
|
return parseInt(year.toString().slice(0, 2) + digitValueStr);
|
|
103
113
|
}
|
|
114
|
+
|
|
104
115
|
return digitValue;
|
|
105
116
|
}
|
|
106
117
|
export function getHourDetails(is24Hour) {
|
|
@@ -109,22 +120,55 @@ export function getHourDetails(is24Hour) {
|
|
|
109
120
|
endPoint: is24Hour ? 23 : 12
|
|
110
121
|
};
|
|
111
122
|
}
|
|
123
|
+
export function getHourSuggestions(is24Hour) {
|
|
124
|
+
const {
|
|
125
|
+
startPoint,
|
|
126
|
+
endPoint
|
|
127
|
+
} = getHourDetails(is24Hour);
|
|
128
|
+
const hourArr = [];
|
|
129
|
+
|
|
130
|
+
for (let hour = startPoint; hour <= endPoint; hour++) {
|
|
131
|
+
const htxt = addZeroIfNeeded(hour);
|
|
132
|
+
hourArr.push(htxt);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return hourArr;
|
|
136
|
+
}
|
|
112
137
|
export function getMinuteDetails() {
|
|
113
138
|
return {
|
|
114
139
|
startPoint: 0,
|
|
115
140
|
endPoint: 59
|
|
116
141
|
};
|
|
117
142
|
}
|
|
143
|
+
export function getMinuteSuggestions() {
|
|
144
|
+
const {
|
|
145
|
+
startPoint,
|
|
146
|
+
endPoint
|
|
147
|
+
} = getMinuteDetails();
|
|
148
|
+
const minArr = [];
|
|
149
|
+
|
|
150
|
+
for (let minute = startPoint; minute <= endPoint; minute++) {
|
|
151
|
+
const mtxt = addZeroIfNeeded(minute);
|
|
152
|
+
minArr.push(mtxt);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return minArr;
|
|
156
|
+
}
|
|
157
|
+
export function addZeroIfNeeded(value) {
|
|
158
|
+
return value < 10 ? `0${value}` : value;
|
|
159
|
+
}
|
|
118
160
|
export function getIsNoonValueTyped(event) {
|
|
119
161
|
const {
|
|
120
162
|
keyCode
|
|
121
163
|
} = event;
|
|
164
|
+
|
|
122
165
|
if (keyCode === 65 || keyCode === 77 || keyCode === 80) {
|
|
123
166
|
//A -65
|
|
124
167
|
//M -77
|
|
125
168
|
//P -80
|
|
126
169
|
return true;
|
|
127
170
|
}
|
|
171
|
+
|
|
128
172
|
return false;
|
|
129
173
|
}
|
|
130
174
|
export function getNoonDetails() {
|
|
@@ -132,32 +176,42 @@ export function getNoonDetails() {
|
|
|
132
176
|
allowedValues: ['AM', 'PM']
|
|
133
177
|
};
|
|
134
178
|
}
|
|
179
|
+
|
|
135
180
|
function getIsArrowTyped(keyCode) {
|
|
136
181
|
const arrowKeycodes = [37, 38, 39, 40];
|
|
182
|
+
|
|
137
183
|
if (arrowKeycodes.indexOf(keyCode) >= 0) {
|
|
138
184
|
return true;
|
|
139
185
|
}
|
|
186
|
+
|
|
140
187
|
return false;
|
|
141
188
|
}
|
|
189
|
+
|
|
142
190
|
export function getIsSupportedKey(event) {
|
|
143
191
|
const {
|
|
144
192
|
keyCode
|
|
145
193
|
} = event;
|
|
194
|
+
|
|
146
195
|
if (getIsArrowTyped(keyCode) || getIsDeleteTyped(keyCode) || getIsNumberTyped(event) || getIsNoonValueTyped(event)) {
|
|
147
196
|
return true;
|
|
148
197
|
}
|
|
198
|
+
|
|
149
199
|
return false;
|
|
150
200
|
}
|
|
151
201
|
export function arrayIsNotEqual(a, b) {
|
|
152
202
|
return a.some((val, index) => val !== b[index]);
|
|
153
203
|
}
|
|
204
|
+
|
|
154
205
|
function getIsEmptyValue(value, startPoint, endPoint) {
|
|
155
206
|
const newValue = parseInt(value) || 0;
|
|
207
|
+
|
|
156
208
|
if (newValue >= startPoint && newValue <= endPoint) {
|
|
157
209
|
return false;
|
|
158
210
|
}
|
|
211
|
+
|
|
159
212
|
return true;
|
|
160
213
|
}
|
|
214
|
+
|
|
161
215
|
export function getIsEmptyHour(value, is24Hour) {
|
|
162
216
|
const {
|
|
163
217
|
startPoint,
|
|
@@ -179,6 +233,7 @@ export function getIsCurrentYear(_ref) {
|
|
|
179
233
|
timeZone
|
|
180
234
|
} = _ref;
|
|
181
235
|
let isCurrentYear = false;
|
|
236
|
+
|
|
182
237
|
if (value && value !== INVALID_DATE) {
|
|
183
238
|
const dateObj = isDateTime ? datetime.toDate(datetime.tz.utcToTz(value, timeZone)) : datetime.toDate(value);
|
|
184
239
|
const currentDateObj = new Date();
|
|
@@ -186,6 +241,7 @@ export function getIsCurrentYear(_ref) {
|
|
|
186
241
|
const selectedYear = dateObj.getFullYear();
|
|
187
242
|
isCurrentYear = currentYear === selectedYear;
|
|
188
243
|
}
|
|
244
|
+
|
|
189
245
|
return {
|
|
190
246
|
isCurrentYear
|
|
191
247
|
};
|
|
@@ -198,6 +254,7 @@ export function removeYearPattern(dateFormatArr, patternArr) {
|
|
|
198
254
|
const {
|
|
199
255
|
type
|
|
200
256
|
} = flags[val];
|
|
257
|
+
|
|
201
258
|
if (type === 'year') {
|
|
202
259
|
yearIndex = index;
|
|
203
260
|
} else {
|
|
@@ -23,6 +23,7 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
23
23
|
startPoint,
|
|
24
24
|
endPoint
|
|
25
25
|
} = getMonthDetails();
|
|
26
|
+
|
|
26
27
|
if (keyCode === 38) {
|
|
27
28
|
//up arrow
|
|
28
29
|
if (newMonth === endPoint || !newMonth) {
|
|
@@ -45,15 +46,19 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
45
46
|
const keyString = String.fromCharCode(which);
|
|
46
47
|
let newValue = isNewType ? keyString : month.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
|
newMonth = newValue;
|
|
54
58
|
} else {
|
|
55
59
|
isChanged = true;
|
|
56
60
|
newFocusOrder += 1;
|
|
61
|
+
|
|
57
62
|
if (newValue > endPoint) {
|
|
58
63
|
newMonth = endPoint;
|
|
59
64
|
} else if (!newValue) {
|
|
@@ -66,12 +71,15 @@ export function getChangedMonth(values, event, focusOrders, keyActions) {
|
|
|
66
71
|
isChanged = true;
|
|
67
72
|
newMonth = '';
|
|
68
73
|
}
|
|
74
|
+
|
|
69
75
|
const dayEnd = getDayEnd(newMonth, newYear);
|
|
70
76
|
let dayChanged = false;
|
|
77
|
+
|
|
71
78
|
if (newDay && newDay > dayEnd) {
|
|
72
79
|
dayChanged = true;
|
|
73
80
|
newDay = dayEnd;
|
|
74
81
|
}
|
|
82
|
+
|
|
75
83
|
return {
|
|
76
84
|
day: dayChanged ? newDay : day,
|
|
77
85
|
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 = String.fromCharCode(which);
|
|
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 = String.fromCharCode(which);
|
|
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 = String.fromCharCode(which);
|
|
197
|
+
const keyString = String.fromCharCode(which); // 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,
|
|
@@ -15,16 +15,17 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
15
15
|
day = '',
|
|
16
16
|
month = ''
|
|
17
17
|
} = values;
|
|
18
|
-
let isChanged = false;
|
|
18
|
+
let isChanged = false; //Year Two Digit case
|
|
19
19
|
|
|
20
|
-
//Year Two Digit case
|
|
21
20
|
const {
|
|
22
21
|
length: yearLength
|
|
23
22
|
} = yearInfo;
|
|
24
23
|
const oldYear = year; // For get Centuries
|
|
24
|
+
|
|
25
25
|
if (yearLength === 2) {
|
|
26
26
|
year = convertYearToTwoDigit(year).toString();
|
|
27
27
|
}
|
|
28
|
+
|
|
28
29
|
let newDay = Number.parseInt(day) || 0;
|
|
29
30
|
const newMonth = Number.parseInt(month) || 0;
|
|
30
31
|
let newYear = Number.parseInt(year) || 0;
|
|
@@ -38,6 +39,7 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
38
39
|
endPoint,
|
|
39
40
|
currentYear
|
|
40
41
|
} = getYearDetails(yearLength);
|
|
42
|
+
|
|
41
43
|
if (keyCode === 38) {
|
|
42
44
|
//up arrow
|
|
43
45
|
if (newYear === endPoint) {
|
|
@@ -67,14 +69,17 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
67
69
|
let newValue = isNewType ? keyString : year.toString() + keyString;
|
|
68
70
|
const newValueString = newValue || '';
|
|
69
71
|
newValue = Number.parseInt(newValue);
|
|
72
|
+
|
|
70
73
|
if (isNewType) {
|
|
71
74
|
isChanged = true;
|
|
72
75
|
newYear = newValue;
|
|
73
76
|
} else {
|
|
74
77
|
isChanged = true;
|
|
78
|
+
|
|
75
79
|
if (newValue * 10 > endPoint) {
|
|
76
80
|
newFocusOrder += 1;
|
|
77
81
|
}
|
|
82
|
+
|
|
78
83
|
if (newValue > endPoint) {
|
|
79
84
|
// newYear = endPoint;
|
|
80
85
|
newYear = currentYear;
|
|
@@ -93,15 +98,19 @@ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
|
|
|
93
98
|
isChanged = true;
|
|
94
99
|
newYear = '';
|
|
95
100
|
}
|
|
101
|
+
|
|
96
102
|
if (yearLength === 2) {
|
|
97
103
|
newYear = convertTwoDigitToYear(newYear, oldYear);
|
|
98
104
|
}
|
|
105
|
+
|
|
99
106
|
const dayEnd = getDayEnd(newMonth, newYear);
|
|
100
107
|
let dayChanged = false;
|
|
108
|
+
|
|
101
109
|
if (newDay && newDay > dayEnd) {
|
|
102
110
|
dayChanged = true;
|
|
103
111
|
newDay = dayEnd;
|
|
104
112
|
}
|
|
113
|
+
|
|
105
114
|
return {
|
|
106
115
|
day: dayChanged ? newDay : day,
|
|
107
116
|
year: newYear,
|
package/es/DateTime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DateWidget } from './DateWidget
|
|
1
|
+
export { default as DateWidget } from './DateWidget';
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { dataFormatList } from '../dateFormatUtils/dateFormats';
|
|
2
3
|
export const CalendarView_propTypes = {
|
|
3
4
|
dataId: PropTypes.string,
|
|
4
5
|
date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -71,7 +72,7 @@ export const DateWidget_propTypes = {
|
|
|
71
72
|
className: PropTypes.string,
|
|
72
73
|
closePopupOnly: PropTypes.func,
|
|
73
74
|
dataId: PropTypes.string,
|
|
74
|
-
dateFormat: PropTypes.oneOf([
|
|
75
|
+
dateFormat: PropTypes.oneOf([...dataFormatList]),
|
|
75
76
|
defaultPosition: PropTypes.oneOf(['top', 'bottom', 'right', 'left']),
|
|
76
77
|
defaultTime: PropTypes.string,
|
|
77
78
|
getContainerRef: PropTypes.func,
|
|
@@ -121,7 +122,9 @@ export const DateWidget_propTypes = {
|
|
|
121
122
|
is24Hour: PropTypes.bool,
|
|
122
123
|
isHideCurrentYear: PropTypes.bool,
|
|
123
124
|
onFocus: PropTypes.func,
|
|
124
|
-
onBlur: PropTypes.func
|
|
125
|
+
onBlur: PropTypes.func,
|
|
126
|
+
boxSize: PropTypes.string,
|
|
127
|
+
onError: PropTypes.func
|
|
125
128
|
};
|
|
126
129
|
export const YearView_propTypes = {
|
|
127
130
|
dataId: PropTypes.string,
|
|
@@ -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;
|