@zohodesk/components 1.0.0-temp-78 → 1.0.0-temp-80
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 +1084 -1075
- package/assets/Appearance/dark/mode/contrast/darkContrast.module.css +343 -0
- package/assets/Appearance/dark/themes/blue/contrast/blueDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/green/contrast/greenDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/orange/contrast/orangeDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/red/contrast/redDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/yellow/contrast/yellowDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/mode/contrast/defaultContrast.module.css +343 -0
- package/assets/Appearance/default/themes/blue/contrast/blueDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/green/contrast/greenDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/orange/contrast/orangeDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/red/contrast/redDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/yellow/contrast/yellowDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/mode/contrast/pureDarkContrast.module.css +343 -0
- package/assets/Appearance/pureDark/themes/blue/contrast/bluePureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/green/contrast/greenPureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/orange/contrast/orangePureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/red/contrast/redPureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/yellow/contrast/yellowPureDarkCTAThemeContrast.module.css +34 -0
- package/docs/external/active-line.js +72 -72
- package/docs/external/autorefresh.js +47 -47
- package/docs/external/codemirror.js +9681 -9681
- package/docs/external/css/hopscotch.css +576 -576
- package/docs/external/css/styleGuide.css +1100 -1100
- package/docs/external/css.js +466 -466
- package/docs/external/designTokens.js +1 -1
- package/docs/external/foldcode.js +151 -151
- package/docs/external/format.js +129 -129
- package/docs/external/htmlmixed.js +84 -84
- package/docs/external/index.html +127 -127
- package/docs/external/javascript.js +422 -422
- package/docs/external/jsx.js +147 -147
- package/docs/external/matchbrackets.js +145 -145
- package/docs/external/xml.js +322 -322
- package/docs/package.json +41 -41
- package/docs/src/index.js +1311 -1311
- package/es/Accordion/Accordion.js +0 -7
- package/es/Accordion/AccordionItem.js +0 -4
- package/es/Accordion/docs/Accordion__Demo.docs.js +0 -2
- package/es/Animation/Animation.js +0 -3
- package/es/Animation/docs/Animation__default.docs.js +0 -2
- package/es/Animation/docs/Animation__fadeIn.docs.js +0 -2
- package/es/Animation/docs/Animation__scaleIn.docs.js +0 -2
- package/es/Animation/docs/Animation__skewIn.docs.js +0 -2
- package/es/Animation/docs/Animation__slideDown.docs.js +0 -2
- package/es/Animation/docs/Animation__slideLeft.docs.js +0 -2
- package/es/Animation/docs/Animation__zoomIn.docs.js +0 -2
- package/es/AppContainer/AppContainer.js +2 -13
- package/es/AppContainer/AppContainer.module.css +18 -18
- package/es/AppContainer/docs/AppContainer__default.docs.js +0 -2
- package/es/Avatar/Avatar.js +44 -50
- package/es/Avatar/Avatar.module.css +135 -117
- package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -288
- package/es/Avatar/docs/Avatar__custom.docs.js +1 -3
- package/es/Avatar/docs/Avatar__default.docs.js +1 -3
- package/es/Avatar/docs/Avatar__palette.docs.js +1 -3
- package/es/Avatar/docs/Avatar__text.docs.js +1 -3
- package/es/Avatar/props/defaultProps.js +2 -1
- package/es/Avatar/props/propTypes.js +2 -1
- package/es/AvatarTeam/AvatarTeam.js +7 -10
- package/es/AvatarTeam/AvatarTeam.module.css +161 -161
- package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -226
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -2
- package/es/Button/Button.js +7 -14
- package/es/Button/Button.module.css +521 -521
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -191
- package/es/Button/docs/Button__custom.docs.js +11 -13
- package/es/Button/docs/Button__default.docs.js +11 -13
- package/es/Buttongroup/Buttongroup.js +1 -4
- package/es/Buttongroup/Buttongroup.module.css +89 -89
- package/es/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -146
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -2
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -2
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -2
- package/es/Card/Card.js +11 -26
- package/es/Card/Card.module.css +20 -20
- package/es/Card/docs/Card__Custom.docs.js +0 -2
- package/es/Card/docs/Card__Default.docs.js +0 -2
- package/es/Card/docs/Card__Scroll.docs.js +0 -3
- package/es/CheckBox/CheckBox.js +0 -5
- package/es/CheckBox/CheckBox.module.css +157 -157
- package/es/CheckBox/docs/CheckBox__custom.docs.js +12 -16
- package/es/CheckBox/docs/CheckBox__default.docs.js +12 -16
- package/es/DateTime/CalendarView.js +4 -23
- package/es/DateTime/DateTime.js +6 -74
- package/es/DateTime/DateTime.module.css +187 -187
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +34 -101
- package/es/DateTime/DateWidget.module.css +38 -38
- package/es/DateTime/DaysRow.js +2 -4
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +4 -28
- package/es/DateTime/YearView.module.css +81 -81
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -1
- package/es/DateTime/__tests__/DateTime.spec.js +0 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +3 -2
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -63
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -28
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/docs/DateTime__default.docs.js +6 -9
- package/es/DateTime/docs/DateWidget__default.docs.js +0 -5
- package/es/DateTime/index.js +0 -0
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +9 -52
- package/es/DropBox/DropBox.module.css +406 -406
- package/es/DropBox/DropBoxPositionMapping.json +144 -144
- package/es/DropBox/docs/DropBox__custom.docs.js +25 -27
- package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -7
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -7
- package/es/DropBox/docs/DropBox__position.docs.js +35 -37
- package/es/DropBox/docs/DropBox__size.docs.js +28 -30
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +0 -1
- package/es/DropDown/DropDown.js +1 -9
- package/es/DropDown/DropDown.module.css +5 -5
- package/es/DropDown/DropDownHeading.js +2 -4
- package/es/DropDown/DropDownHeading.module.css +53 -53
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownItem.module.css +94 -94
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSearch.module.css +14 -14
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/DropDownSeparator.module.css +7 -7
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -2
- package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -2
- package/es/Heading/Heading.js +34 -0
- package/es/Heading/Heading.module.css +5 -0
- package/es/Heading/docs/Heading__default.docs.js +19 -0
- package/es/Heading/props/defaultProps.js +5 -0
- package/es/Heading/props/propTypes.js +11 -0
- package/es/Label/Label.js +2 -4
- package/es/Label/Label.module.css +52 -52
- package/es/Label/LabelColors.module.css +20 -20
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -101
- package/es/Label/docs/Label__clipped.docs.js +0 -2
- package/es/Label/docs/Label__custom.docs.js +0 -2
- package/es/Label/docs/Label__palette.docs.js +0 -2
- package/es/Label/docs/Label__size.docs.js +0 -2
- package/es/Label/docs/Label__type.docs.js +0 -2
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/Layout.module.css +335 -335
- package/es/Layout/docs/Layout__Hidden.docs.js +0 -1
- package/es/Layout/docs/Layout__default.docs.js +0 -1
- package/es/Layout/docs/Layout__four_Column.docs.js +0 -1
- package/es/Layout/docs/Layout__three_Column.docs.js +0 -1
- package/es/Layout/docs/Layout__two_Column.docs.js +0 -1
- package/es/Layout/utils.js +0 -0
- package/es/LightNightMode/Colors.json +496 -496
- package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -2
- package/es/ListItem/ListContainer.js +1 -10
- package/es/ListItem/ListItem.js +0 -9
- package/es/ListItem/ListItem.module.css +209 -209
- package/es/ListItem/ListItemWithAvatar.js +1 -9
- package/es/ListItem/ListItemWithCheckBox.js +0 -7
- package/es/ListItem/ListItemWithIcon.js +0 -8
- package/es/ListItem/ListItemWithRadio.js +0 -7
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -2
- package/es/ListItem/docs/ListItem__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItem__default.docs.js +0 -2
- package/es/Modal/Modal.js +8 -28
- package/es/Modal/__docs__/Modal__default.docs.js +1 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +16 -95
- package/es/MultiSelect/AdvancedMultiSelect.js +10 -36
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MultiSelect.js +36 -105
- package/es/MultiSelect/MultiSelect.module.css +205 -205
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +5 -14
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/SelectedOptions.module.css +15 -15
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -7
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +1 -7
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +1 -5
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +1 -6
- package/es/MultiSelect/props/propTypes.js +0 -2
- package/es/PopOver/PopOver.js +0 -18
- package/es/PopOver/PopOver.module.css +8 -8
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/PopOver/docs/PopOver__default.docs.js +0 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/PositionMapping.json +73 -73
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +2 -9
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Provider/docs/Provider_Id__Class.docs.js +3 -4
- package/es/Provider/docs/Provider_Id__Function.docs.js +0 -1
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +3 -4
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -1
- package/es/Provider.js +36 -11
- package/es/Radio/Radio.js +0 -4
- package/es/Radio/Radio.module.css +112 -112
- package/es/Radio/docs/Radio__custom.docs.js +12 -16
- package/es/Radio/docs/Radio__default.docs.js +12 -16
- package/es/Responsive/CustomResponsive.js +18 -28
- package/es/Responsive/RefWrapper.js +7 -6
- package/es/Responsive/ResizeComponent.js +25 -35
- package/es/Responsive/ResizeObserver.js +6 -26
- package/es/Responsive/Responsive.js +20 -34
- package/es/Responsive/docs/Responsive__Custom.docs.js +22 -14
- package/es/Responsive/docs/Responsive__default.docs.js +1 -3
- package/es/Responsive/docs/style.module.css +55 -55
- package/es/Responsive/sizeObservers.js +7 -28
- package/es/Responsive/utils/index.js +5 -7
- package/es/Responsive/utils/shallowCompare.js +2 -7
- package/es/Responsive/windowResizeObserver.js +0 -7
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +0 -4
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/es/Ribbon/Ribbon.js +0 -3
- package/es/Ribbon/Ribbon.module.css +376 -376
- package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -163
- package/es/Ribbon/docs/Ribbon__custom.docs.js +13 -14
- package/es/Ribbon/docs/Ribbon__default.docs.js +13 -14
- package/es/RippleEffect/RippleEffect.js +0 -1
- package/es/RippleEffect/RippleEffect.module.css +92 -92
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +12 -14
- package/es/Select/GroupSelect.js +13 -60
- package/es/Select/Select.js +34 -84
- package/es/Select/Select.module.css +106 -106
- package/es/Select/SelectWithAvatar.js +3 -20
- package/es/Select/SelectWithIcon.js +2 -40
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/docs/GroupSelect__default.docs.js +1 -6
- package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -4
- package/es/Select/docs/SelectWithIcon__default.docs.js +0 -4
- package/es/Select/docs/Select__default.docs.js +0 -5
- package/es/Select/props/propTypes.js +0 -1
- package/es/Stencils/Stencils.js +0 -3
- package/es/Stencils/Stencils.module.css +96 -96
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -49
- package/es/Stencils/docs/Stencils__custom.docs.js +0 -2
- package/es/Stencils/docs/Stencils__default.docs.js +0 -2
- package/es/Switch/Switch.js +0 -5
- package/es/Switch/Switch.module.css +110 -110
- package/es/Switch/docs/Switch__custom.docs.js +12 -14
- package/es/Switch/docs/Switch__default.docs.js +12 -14
- package/es/Tab/Tab.js +1 -4
- package/es/Tab/Tab.module.css +101 -101
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContent.module.css +4 -4
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +24 -71
- package/es/Tab/Tabs.module.css +141 -141
- package/es/Tab/__tests__/Tab.spec.js +2 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tab/docs/Tab__default.docs.js +0 -5
- package/es/Tab/docs/tabdocs.module.css +29 -29
- package/es/Tag/Tag.js +9 -14
- package/es/Tag/Tag.module.css +254 -254
- package/es/Tag/docs/Tag__custom.docs.js +11 -13
- package/es/Tag/docs/Tag__default.docs.js +11 -13
- package/es/TextBox/TextBox.js +0 -15
- package/es/TextBox/TextBox.module.css +157 -157
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -127
- package/es/TextBox/docs/TextBox__custom.docs.js +0 -2
- package/es/TextBox/docs/TextBox__default.docs.js +0 -2
- package/es/TextBox/docs/TextBox__size.docs.js +0 -2
- package/es/TextBox/docs/TextBox__variant.docs.js +0 -2
- package/es/TextBoxIcon/TextBoxIcon.js +0 -7
- package/es/TextBoxIcon/TextBoxIcon.module.css +78 -78
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -334
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -2
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -2
- package/es/Textarea/Textarea.js +0 -12
- package/es/Textarea/Textarea.module.css +139 -139
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -97
- package/es/Textarea/docs/Textarea__animated.docs.js +0 -2
- package/es/Textarea/docs/Textarea__custom.docs.js +0 -2
- package/es/Textarea/docs/Textarea__default.docs.js +0 -2
- package/es/Textarea/docs/Textarea__disabled.docs.js +0 -2
- package/es/Tooltip/Tooltip.js +11 -58
- package/es/Tooltip/Tooltip.module.css +109 -109
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/Tooltip/docs/Tooltip__default.docs.js +63 -67
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -3
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -5
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -7
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +17 -28
- package/es/common/animation.module.css +624 -624
- package/es/common/avatarsizes.module.css +44 -44
- package/es/common/basic.module.css +33 -33
- package/es/common/basicReset.module.css +40 -40
- package/es/common/common.module.css +524 -524
- package/es/common/customscroll.module.css +89 -89
- package/es/common/docStyle.module.css +887 -766
- package/es/common/reset.module.css +12 -12
- package/es/common/transition.module.css +146 -146
- package/es/deprecated/AdvancedMultiSelect.module.css +126 -126
- package/es/deprecated/PortalLayer/PortalLayer.js +17 -25
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -7
- package/es/index.js +5 -2
- package/es/semantic/Button/Button.js +0 -3
- package/es/semantic/Button/docs/Button__default.docs.js +0 -3
- package/es/semantic/Button/semanticButton.module.css +9 -9
- package/es/utils/Common.js +5 -47
- package/es/utils/ContextOptimizer.js +5 -4
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +0 -2
- package/es/utils/datetime/common.js +5 -16
- package/es/utils/debounce.js +1 -5
- package/es/utils/dropDownUtils.js +11 -67
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/lib/Accordion/Accordion.js +10 -39
- package/lib/Accordion/AccordionItem.js +12 -38
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -22
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +12 -37
- package/lib/Animation/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/docs/Animation__default.docs.js +0 -24
- package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__skewIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__slideDown.docs.js +0 -24
- package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -24
- package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -24
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +14 -52
- package/lib/AppContainer/AppContainer.module.css +18 -18
- package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -23
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +56 -98
- package/lib/Avatar/Avatar.module.css +135 -117
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -288
- package/lib/Avatar/docs/Avatar__custom.docs.js +1 -26
- package/lib/Avatar/docs/Avatar__default.docs.js +1 -24
- package/lib/Avatar/docs/Avatar__palette.docs.js +1 -26
- package/lib/Avatar/docs/Avatar__text.docs.js +1 -26
- package/lib/Avatar/props/defaultProps.js +2 -1
- package/lib/Avatar/props/propTypes.js +2 -4
- package/lib/AvatarTeam/AvatarTeam.js +27 -54
- package/lib/AvatarTeam/AvatarTeam.module.css +161 -161
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -226
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -24
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +25 -53
- package/lib/Button/Button.module.css +521 -521
- package/lib/Button/__tests__/Button.spec.js +0 -40
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -191
- package/lib/Button/docs/Button__custom.docs.js +11 -37
- package/lib/Button/docs/Button__default.docs.js +11 -36
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +6 -32
- package/lib/Buttongroup/Buttongroup.module.css +89 -89
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -146
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -25
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -25
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -27
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +45 -106
- package/lib/Card/Card.module.css +20 -20
- package/lib/Card/__tests__/Card.spec.js +1 -10
- package/lib/Card/docs/Card__Custom.docs.js +0 -27
- package/lib/Card/docs/Card__Default.docs.js +0 -26
- package/lib/Card/docs/Card__Scroll.docs.js +3 -30
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/propTypes.js +0 -3
- package/lib/CheckBox/CheckBox.js +40 -69
- package/lib/CheckBox/CheckBox.module.css +157 -157
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +12 -37
- package/lib/CheckBox/docs/CheckBox__default.docs.js +12 -36
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +20 -70
- package/lib/DateTime/DateTime.js +149 -243
- package/lib/DateTime/DateTime.module.css +187 -187
- package/lib/DateTime/DateTimePopupFooter.js +5 -30
- package/lib/DateTime/DateTimePopupHeader.js +13 -45
- package/lib/DateTime/DateWidget.js +243 -349
- package/lib/DateTime/DateWidget.module.css +38 -38
- package/lib/DateTime/DaysRow.js +2 -26
- package/lib/DateTime/Time.js +29 -72
- package/lib/DateTime/YearView.js +25 -75
- package/lib/DateTime/YearView.module.css +81 -81
- package/lib/DateTime/__tests__/CalendarView.spec.js +5 -13
- package/lib/DateTime/__tests__/DateTime.spec.js +37 -51
- package/lib/DateTime/__tests__/DateWidget.spec.js +8 -10
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -184
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +12 -61
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +20 -52
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/docs/DateTime__default.docs.js +10 -33
- package/lib/DateTime/docs/DateWidget__default.docs.js +2 -30
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +0 -3
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +6 -69
- package/lib/DropBox/DropBox.js +60 -141
- package/lib/DropBox/DropBox.module.css +406 -406
- package/lib/DropBox/DropBoxPositionMapping.json +144 -144
- package/lib/DropBox/__tests__/DropBox.spec.js +2 -6
- package/lib/DropBox/docs/DropBox__custom.docs.js +25 -50
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +9 -36
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +9 -36
- package/lib/DropBox/docs/DropBox__position.docs.js +35 -59
- package/lib/DropBox/docs/DropBox__size.docs.js +28 -52
- package/lib/DropBox/props/defaultProps.js +1 -2
- package/lib/DropBox/props/propTypes.js +0 -4
- package/lib/DropDown/DropDown.js +3 -53
- package/lib/DropDown/DropDown.module.css +5 -5
- package/lib/DropDown/DropDownHeading.js +11 -35
- package/lib/DropDown/DropDownHeading.module.css +53 -53
- package/lib/DropDown/DropDownItem.js +17 -41
- package/lib/DropDown/DropDownItem.module.css +94 -94
- package/lib/DropDown/DropDownSearch.js +15 -41
- package/lib/DropDown/DropDownSearch.module.css +14 -14
- package/lib/DropDown/DropDownSeparator.js +1 -23
- package/lib/DropDown/DropDownSeparator.module.css +7 -7
- package/lib/DropDown/__tests__/DropDown.spec.js +9 -15
- package/lib/DropDown/__tests__/DropDownItem.spec.js +4 -9
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -3
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -23
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -22
- package/lib/DropDown/props/propTypes.js +0 -5
- package/lib/Heading/Heading.js +64 -0
- package/lib/Heading/Heading.module.css +5 -0
- package/lib/Heading/docs/Heading__default.docs.js +50 -0
- package/lib/Heading/props/defaultProps.js +12 -0
- package/lib/Heading/props/propTypes.js +19 -0
- package/lib/Label/Label.js +11 -36
- package/lib/Label/Label.module.css +52 -52
- package/lib/Label/LabelColors.module.css +20 -20
- package/lib/Label/__tests__/Label.spec.js +1 -14
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -101
- package/lib/Label/docs/Label__clipped.docs.js +0 -25
- package/lib/Label/docs/Label__custom.docs.js +0 -26
- package/lib/Label/docs/Label__palette.docs.js +0 -25
- package/lib/Label/docs/Label__size.docs.js +0 -25
- package/lib/Label/docs/Label__type.docs.js +0 -25
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +11 -31
- package/lib/Layout/Container.js +10 -29
- package/lib/Layout/Layout.module.css +335 -335
- package/lib/Layout/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/docs/Layout__Hidden.docs.js +0 -22
- package/lib/Layout/docs/Layout__default.docs.js +0 -21
- package/lib/Layout/docs/Layout__four_Column.docs.js +0 -22
- package/lib/Layout/docs/Layout__three_Column.docs.js +0 -22
- package/lib/Layout/docs/Layout__two_Column.docs.js +0 -22
- package/lib/Layout/index.js +0 -4
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -10
- package/lib/LightNightMode/Colors.json +496 -496
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +1 -26
- package/lib/ListItem/ListContainer.js +26 -48
- package/lib/ListItem/ListItem.js +37 -66
- package/lib/ListItem/ListItem.module.css +209 -209
- package/lib/ListItem/ListItemWithAvatar.js +41 -72
- package/lib/ListItem/ListItemWithCheckBox.js +32 -61
- package/lib/ListItem/ListItemWithIcon.js +36 -65
- package/lib/ListItem/ListItemWithRadio.js +33 -62
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItem__custom.docs.js +0 -23
- package/lib/ListItem/docs/ListItem__default.docs.js +0 -22
- package/lib/ListItem/props/propTypes.js +0 -5
- package/lib/Modal/Modal.js +4 -44
- package/lib/Modal/__docs__/Modal__default.docs.js +0 -23
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +162 -294
- package/lib/MultiSelect/AdvancedMultiSelect.js +120 -201
- package/lib/MultiSelect/EmptyState.js +21 -44
- package/lib/MultiSelect/MultiSelect.js +196 -317
- package/lib/MultiSelect/MultiSelect.module.css +205 -205
- package/lib/MultiSelect/MultiSelectHeader.js +5 -29
- package/lib/MultiSelect/MultiSelectWithAvatar.js +51 -96
- package/lib/MultiSelect/SelectedOptions.js +15 -44
- package/lib/MultiSelect/SelectedOptions.module.css +15 -15
- package/lib/MultiSelect/Suggestions.js +26 -59
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -23
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +3 -28
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +2 -28
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +2 -30
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +0 -5
- package/lib/PopOver/PopOver.js +44 -94
- package/lib/PopOver/PopOver.module.css +8 -8
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/docs/PopOver__default.docs.js +0 -25
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +77 -156
- package/lib/Popup/PositionMapping.json +73 -73
- package/lib/Popup/__tests__/Popup.spec.js +5 -42
- package/lib/Popup/viewPort.js +14 -28
- package/lib/Provider/AvatarSize.js +0 -4
- package/lib/Provider/Config.js +0 -2
- package/lib/Provider/CssProvider.js +0 -4
- package/lib/Provider/IdProvider.js +3 -17
- package/lib/Provider/LibraryContext.js +10 -32
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +14 -43
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Provider/docs/Provider_Id__Class.docs.js +3 -24
- package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -5
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +3 -24
- package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -5
- package/lib/Provider.js +38 -64
- package/lib/Radio/Radio.js +33 -60
- package/lib/Radio/Radio.module.css +112 -112
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/docs/Radio__custom.docs.js +12 -38
- package/lib/Radio/docs/Radio__default.docs.js +12 -37
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +23 -67
- package/lib/Responsive/RefWrapper.js +7 -15
- package/lib/Responsive/ResizeComponent.js +27 -58
- package/lib/Responsive/ResizeObserver.js +6 -23
- package/lib/Responsive/Responsive.js +24 -76
- package/lib/Responsive/docs/Responsive__Custom.docs.js +29 -54
- package/lib/Responsive/docs/Responsive__default.docs.js +4 -28
- package/lib/Responsive/docs/style.module.css +55 -55
- package/lib/Responsive/index.js +0 -2
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +13 -51
- package/lib/Responsive/utils/index.js +3 -11
- package/lib/Responsive/utils/shallowCompare.js +2 -11
- package/lib/Responsive/windowResizeObserver.js +0 -8
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +14 -44
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/lib/ResponsiveDropBox/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +7 -31
- package/lib/Ribbon/Ribbon.module.css +376 -376
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -163
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +13 -36
- package/lib/Ribbon/docs/Ribbon__default.docs.js +13 -35
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +7 -18
- package/lib/RippleEffect/RippleEffect.module.css +92 -92
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +12 -34
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +125 -225
- package/lib/Select/Select.js +203 -288
- package/lib/Select/Select.module.css +106 -106
- package/lib/Select/SelectWithAvatar.js +50 -101
- package/lib/Select/SelectWithIcon.js +69 -127
- package/lib/Select/__tests__/Select.spec.js +89 -131
- package/lib/Select/docs/GroupSelect__default.docs.js +0 -26
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -28
- package/lib/Select/docs/SelectWithIcon__default.docs.js +4 -29
- package/lib/Select/docs/Select__default.docs.js +0 -27
- package/lib/Select/props/defaultProps.js +0 -4
- package/lib/Select/props/propTypes.js +0 -4
- package/lib/Stencils/Stencils.js +4 -28
- package/lib/Stencils/Stencils.module.css +96 -96
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -49
- package/lib/Stencils/docs/Stencils__custom.docs.js +0 -24
- package/lib/Stencils/docs/Stencils__default.docs.js +0 -24
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +27 -55
- package/lib/Switch/Switch.module.css +110 -110
- package/lib/Switch/docs/Switch__custom.docs.js +12 -35
- package/lib/Switch/docs/Switch__default.docs.js +12 -34
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +23 -39
- package/lib/Tab/Tab.module.css +101 -101
- package/lib/Tab/TabContent.js +4 -11
- package/lib/Tab/TabContent.module.css +4 -4
- package/lib/Tab/TabContentWrapper.js +5 -12
- package/lib/Tab/TabWrapper.js +16 -34
- package/lib/Tab/Tabs.js +96 -177
- package/lib/Tab/Tabs.module.css +141 -141
- package/lib/Tab/__tests__/Tab.spec.js +63 -74
- package/lib/Tab/__tests__/TabContent.spec.js +6 -10
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +20 -28
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -12
- package/lib/Tab/__tests__/Tabs.spec.js +39 -53
- package/lib/Tab/docs/Tab__default.docs.js +0 -25
- package/lib/Tab/docs/tabdocs.module.css +29 -29
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +45 -78
- package/lib/Tag/Tag.module.css +254 -254
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/docs/Tag__custom.docs.js +11 -37
- package/lib/Tag/docs/Tag__default.docs.js +11 -36
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +52 -83
- package/lib/TextBox/TextBox.module.css +157 -157
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -127
- package/lib/TextBox/docs/TextBox__custom.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__default.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__size.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__variant.docs.js +0 -26
- package/lib/TextBox/props/propTypes.js +0 -5
- package/lib/TextBoxIcon/TextBoxIcon.js +48 -80
- package/lib/TextBoxIcon/TextBoxIcon.module.css +78 -78
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +5 -14
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -334
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -27
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -27
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +22 -52
- package/lib/Textarea/Textarea.module.css +139 -139
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -97
- package/lib/Textarea/docs/Textarea__animated.docs.js +0 -25
- package/lib/Textarea/docs/Textarea__custom.docs.js +0 -26
- package/lib/Textarea/docs/Textarea__default.docs.js +0 -25
- package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -25
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +25 -92
- package/lib/Tooltip/Tooltip.module.css +109 -109
- package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -23
- package/lib/Tooltip/docs/Tooltip__default.docs.js +63 -91
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +11 -39
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +2 -29
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +18 -51
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +22 -54
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/common/animation.module.css +624 -624
- package/lib/common/avatarsizes.module.css +44 -44
- package/lib/common/basic.module.css +33 -33
- package/lib/common/basicReset.module.css +40 -40
- package/lib/common/common.module.css +524 -524
- package/lib/common/customscroll.module.css +89 -89
- package/lib/common/docStyle.module.css +887 -766
- package/lib/common/reset.module.css +12 -12
- package/lib/common/transition.module.css +146 -146
- package/lib/css.js +0 -39
- package/lib/deprecated/AdvancedMultiSelect.module.css +126 -126
- package/lib/deprecated/PortalLayer/PortalLayer.js +17 -45
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +2 -36
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +17 -157
- package/lib/semantic/Button/Button.js +17 -41
- package/lib/semantic/Button/docs/Button__default.docs.js +0 -23
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/Button/semanticButton.module.css +9 -9
- package/lib/utils/Common.js +11 -95
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/__tests__/constructFullName.spec.js +0 -1
- package/lib/utils/__tests__/debounce.spec.js +2 -3
- package/lib/utils/__tests__/getInitial.spec.js +0 -1
- package/lib/utils/constructFullName.js +2 -11
- package/lib/utils/datetime/common.js +5 -32
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +54 -171
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +76 -77
|
@@ -1,87 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("./props/propTypes");
|
|
13
|
-
|
|
14
10
|
var _defaultProps = require("./props/defaultProps");
|
|
15
|
-
|
|
16
11
|
var _datetimejs = _interopRequireDefault(require("@zohodesk/datetimejs"));
|
|
17
|
-
|
|
18
12
|
var _DateTime = _interopRequireDefault(require("./DateTime"));
|
|
19
|
-
|
|
20
13
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
21
|
-
|
|
22
14
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
23
|
-
|
|
24
15
|
var _Layout = require("../Layout");
|
|
25
|
-
|
|
26
16
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
27
|
-
|
|
28
17
|
var _DateWidgetModule = _interopRequireDefault(require("./DateWidget.module.css"));
|
|
29
|
-
|
|
30
18
|
var _validator = _interopRequireDefault(require("./validator"));
|
|
31
|
-
|
|
32
19
|
var _common = require("../utils/datetime/common");
|
|
33
|
-
|
|
34
20
|
var _dateFormatUtils = require("./dateFormatUtils");
|
|
35
|
-
|
|
36
21
|
var _dateFormat = require("./dateFormatUtils/dateFormat");
|
|
37
|
-
|
|
38
22
|
var _dayChange = require("./dateFormatUtils/dayChange");
|
|
39
|
-
|
|
40
23
|
var _monthChange = require("./dateFormatUtils/monthChange");
|
|
41
|
-
|
|
42
24
|
var _yearChange = require("./dateFormatUtils/yearChange");
|
|
43
|
-
|
|
44
25
|
var _timeChange = require("./dateFormatUtils/timeChange");
|
|
45
|
-
|
|
46
26
|
var _Common = require("../utils/Common");
|
|
47
|
-
|
|
48
27
|
var _constants = require("./constants");
|
|
49
|
-
|
|
50
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
51
|
-
|
|
52
29
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
53
|
-
|
|
54
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
55
|
-
|
|
56
31
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
57
|
-
|
|
58
32
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
59
|
-
|
|
60
33
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
|
-
|
|
62
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
|
-
|
|
64
35
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
65
|
-
|
|
66
36
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
67
|
-
|
|
68
37
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
|
-
|
|
70
38
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
-
|
|
72
39
|
/* eslint-disable react/no-unused-prop-types */
|
|
73
|
-
|
|
74
40
|
/* eslint css-modules/no-unused-class: [0, { markAsUsed: 'inputLine'] }] */
|
|
75
41
|
var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
76
42
|
_inherits(DateWidgetComponent, _React$Component);
|
|
77
|
-
|
|
78
43
|
var _super = _createSuper(DateWidgetComponent);
|
|
79
|
-
|
|
80
44
|
function DateWidgetComponent(props) {
|
|
81
45
|
var _this;
|
|
82
|
-
|
|
83
46
|
_classCallCheck(this, DateWidgetComponent);
|
|
84
|
-
|
|
85
47
|
_this = _super.call(this, props);
|
|
86
48
|
_this.handleSelect = _this.handleSelect.bind(_assertThisInitialized(_this));
|
|
87
49
|
_this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
|
|
@@ -121,27 +83,21 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
121
83
|
_this.oldFocusOrder = '';
|
|
122
84
|
_this.focusOrder = '';
|
|
123
85
|
_this.oldKeyDownAction = ''; //'Arrow' || 'valueTyped'
|
|
124
|
-
|
|
125
86
|
_this.keyDownAction = ''; //'Arrow' || 'valueTyped'
|
|
126
|
-
|
|
127
87
|
_this.isMouseDown = false;
|
|
128
88
|
return _this;
|
|
129
89
|
}
|
|
130
|
-
|
|
131
90
|
_createClass(DateWidgetComponent, [{
|
|
132
91
|
key: "componentDidMount",
|
|
133
92
|
value: function componentDidMount() {
|
|
134
93
|
var validation = this.props.validation;
|
|
135
94
|
var selected = this.state.selected;
|
|
136
|
-
|
|
137
95
|
if (validation && validation.validate) {
|
|
138
96
|
this.validateOnSelect(selected, this.props);
|
|
139
97
|
}
|
|
140
|
-
|
|
141
98
|
var _this$handleGetDispla = this.handleGetDisplayText(this.props),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
99
|
+
displayText = _this$handleGetDispla.displayText,
|
|
100
|
+
newSelected = _this$handleGetDispla.selected;
|
|
145
101
|
this.setState({
|
|
146
102
|
displayText: displayText,
|
|
147
103
|
selected: newSelected
|
|
@@ -152,39 +108,35 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
152
108
|
key: "componentDidUpdate",
|
|
153
109
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
154
110
|
var _this$state = this.state,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
111
|
+
selected = _this$state.selected,
|
|
112
|
+
day = _this$state.day,
|
|
113
|
+
month = _this$state.month,
|
|
114
|
+
year = _this$state.year,
|
|
115
|
+
hour = _this$state.hour,
|
|
116
|
+
minute = _this$state.minute,
|
|
117
|
+
noon = _this$state.noon,
|
|
118
|
+
isDateEdited = _this$state.isDateEdited,
|
|
119
|
+
stateFocusOrder = _this$state.stateFocusOrder,
|
|
120
|
+
isFocused = _this$state.isFocused;
|
|
165
121
|
var _this$props = this.props,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
122
|
+
value = _this$props.value,
|
|
123
|
+
validation = _this$props.validation,
|
|
124
|
+
isPopupReady = _this$props.isPopupReady,
|
|
125
|
+
_this$props$dateForma = _this$props.dateFormat,
|
|
126
|
+
dateFormat = _this$props$dateForma === void 0 ? '' : _this$props$dateForma,
|
|
127
|
+
is24Hour = _this$props.is24Hour,
|
|
128
|
+
isHideCurrentYear = _this$props.isHideCurrentYear;
|
|
174
129
|
if (validation && validation.validate) {
|
|
175
130
|
this.validateOnSelect(selected, this.props);
|
|
176
131
|
}
|
|
177
|
-
|
|
178
132
|
if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || isHideCurrentYear !== prevProps.isHideCurrentYear) {
|
|
179
133
|
var _this$handleGetDispla2 = this.handleGetDisplayText(this.props),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
134
|
+
displayText = _this$handleGetDispla2.displayText,
|
|
135
|
+
_selected = _this$handleGetDispla2.selected;
|
|
183
136
|
this.setState({
|
|
184
137
|
selected: _selected,
|
|
185
138
|
displayText: displayText
|
|
186
139
|
});
|
|
187
|
-
|
|
188
140
|
if (value !== _constants.INVALID_DATE) {
|
|
189
141
|
this.setState({
|
|
190
142
|
day: '',
|
|
@@ -198,30 +150,29 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
198
150
|
});
|
|
199
151
|
}
|
|
200
152
|
}
|
|
201
|
-
|
|
202
153
|
if (prevProps.isPopupReady !== isPopupReady) {
|
|
203
154
|
if (isPopupReady) {
|
|
204
155
|
this.resetLocalDate && this.resetLocalDate();
|
|
205
156
|
}
|
|
206
157
|
}
|
|
207
|
-
|
|
208
158
|
var haveLocalValue = [day, month, year, hour, minute, noon].some(function (value) {
|
|
209
159
|
return !(0, _Common.getIsEmptyValue)(value);
|
|
210
160
|
});
|
|
211
|
-
|
|
212
161
|
if (isDateEdited !== haveLocalValue) {
|
|
213
162
|
this.setState({
|
|
214
163
|
isDateEdited: haveLocalValue
|
|
215
164
|
});
|
|
216
165
|
}
|
|
217
|
-
|
|
218
166
|
if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || (0, _dateFormatUtils.arrayIsNotEqual)([day, month, year, hour, minute, noon], [prevState.day, prevState.month, prevState.year, prevState.hour, prevState.minute, prevState.noon])) {
|
|
219
167
|
this.handleSelectionRangeDetails(this.props);
|
|
220
|
-
}
|
|
168
|
+
}
|
|
221
169
|
|
|
170
|
+
// if (stateFocusOrder !== prevState.stateFocusOrder) {
|
|
222
171
|
|
|
223
172
|
isFocused && !(0, _Common.getIsEmptyValue)(stateFocusOrder) && this.handleSelection(stateFocusOrder);
|
|
224
|
-
this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder);
|
|
173
|
+
this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder);
|
|
174
|
+
// }
|
|
175
|
+
|
|
225
176
|
// if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
226
177
|
// if (!isPopupOpen) {
|
|
227
178
|
// this.valueInput && this.valueInput.focus({preventScroll:true});
|
|
@@ -232,16 +183,14 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
232
183
|
key: "handleSelect",
|
|
233
184
|
value: function handleSelect(userZoneSelectedTime, fotmattedValue, e) {
|
|
234
185
|
var _this$props2 = this.props,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
186
|
+
id = _this$props2.id,
|
|
187
|
+
onSelect = _this$props2.onSelect,
|
|
188
|
+
closePopupOnly = _this$props2.closePopupOnly,
|
|
189
|
+
validation = _this$props2.validation;
|
|
240
190
|
if (validation && validation.validateOn) {
|
|
241
191
|
var selected = this.state.selected;
|
|
242
192
|
this.validateOnSelect(selected, this.props);
|
|
243
193
|
}
|
|
244
|
-
|
|
245
194
|
onSelect && onSelect(userZoneSelectedTime, id);
|
|
246
195
|
this.valueInput && this.valueInput.focus({
|
|
247
196
|
preventScroll: true
|
|
@@ -255,20 +204,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
255
204
|
var defaultValidateRules = ['required'];
|
|
256
205
|
var defaultType = 'onegroup';
|
|
257
206
|
var validation = props.validation,
|
|
258
|
-
|
|
259
|
-
|
|
207
|
+
onPassValidation = props.onPassValidation,
|
|
208
|
+
onFailValidation = props.onFailValidation;
|
|
260
209
|
var targetTag = this.elementRef;
|
|
261
|
-
|
|
262
210
|
if (validation) {
|
|
263
211
|
//validateOn won't work here ...
|
|
264
212
|
var newValidation = _validator["default"].combinePropsValidation(this.props, defaultType, 'onSelect', validation, defaultCheckPropsRules, defaultValidateRules);
|
|
265
|
-
|
|
266
213
|
var validationObj = {
|
|
267
214
|
validation: newValidation,
|
|
268
215
|
onPassValidation: onPassValidation,
|
|
269
216
|
onFailValidation: onFailValidation
|
|
270
217
|
};
|
|
271
|
-
|
|
272
218
|
_validator["default"].executeValidation(value, targetTag, validationObj, defaultType);
|
|
273
219
|
} else {
|
|
274
220
|
onPassValidation && onPassValidation(value, targetTag);
|
|
@@ -278,13 +224,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
278
224
|
key: "handleTogglePopup",
|
|
279
225
|
value: function handleTogglePopup(e, isOpenOnly) {
|
|
280
226
|
var _this$props3 = this.props,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
227
|
+
togglePopup = _this$props3.togglePopup,
|
|
228
|
+
_this$props3$defaultP = _this$props3.defaultPosition,
|
|
229
|
+
defaultPosition = _this$props3$defaultP === void 0 ? 'bottom' : _this$props3$defaultP,
|
|
230
|
+
openPopupOnly = _this$props3.openPopupOnly,
|
|
231
|
+
isPopupOpen = _this$props3.isPopupOpen,
|
|
232
|
+
removeClose = _this$props3.removeClose;
|
|
288
233
|
if (isOpenOnly) {
|
|
289
234
|
if (!isPopupOpen) {
|
|
290
235
|
togglePopup(e, "".concat(defaultPosition, "Right"));
|
|
@@ -292,26 +237,26 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
292
237
|
removeClose(e);
|
|
293
238
|
}
|
|
294
239
|
}
|
|
295
|
-
|
|
296
240
|
!isOpenOnly && togglePopup(e, "".concat(defaultPosition, "Right"));
|
|
297
241
|
}
|
|
298
242
|
}, {
|
|
299
243
|
key: "handleSelectionRangeDetails",
|
|
300
244
|
value: function handleSelectionRangeDetails(props) {
|
|
301
245
|
var timeZone = props.timeZone,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
246
|
+
dateFormat = props.dateFormat,
|
|
247
|
+
isDateTime = props.isDateTime,
|
|
248
|
+
value = props.value,
|
|
249
|
+
is24Hour = props.is24Hour;
|
|
306
250
|
var _this$state2 = this.state,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
251
|
+
day = _this$state2.day,
|
|
252
|
+
month = _this$state2.month,
|
|
253
|
+
year = _this$state2.year,
|
|
254
|
+
hour = _this$state2.hour,
|
|
255
|
+
minute = _this$state2.minute,
|
|
256
|
+
noon = _this$state2.noon;
|
|
257
|
+
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
314
258
|
|
|
259
|
+
//New UI Changes
|
|
315
260
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
316
261
|
isHideCurrentYear: false,
|
|
317
262
|
value: value,
|
|
@@ -342,11 +287,11 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
342
287
|
key: "handleGetDisplayText",
|
|
343
288
|
value: function handleGetDisplayText(props) {
|
|
344
289
|
var timeZone = props.timeZone,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
290
|
+
dateFormat = props.dateFormat,
|
|
291
|
+
isDateTime = props.isDateTime,
|
|
292
|
+
value = props.value,
|
|
293
|
+
is24Hour = props.is24Hour,
|
|
294
|
+
isHideCurrentYear = props.isHideCurrentYear;
|
|
350
295
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
351
296
|
isHideCurrentYear: isHideCurrentYear,
|
|
352
297
|
value: value,
|
|
@@ -356,21 +301,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
356
301
|
var newDateFormat = dateFormatDetails.dateFormat;
|
|
357
302
|
var displayText = '';
|
|
358
303
|
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
359
|
-
|
|
360
304
|
if (selected) {
|
|
361
305
|
var format = newDateFormat,
|
|
362
|
-
|
|
363
|
-
|
|
306
|
+
convertedValue;
|
|
364
307
|
if (isDateTime) {
|
|
365
308
|
convertedValue = _datetimejs["default"].toDate(_datetimejs["default"].tz.utcToTz(value, timeZone));
|
|
366
309
|
format = "".concat(newDateFormat, " ").concat(is24Hour ? 'HH:mm' : 'hh:mm A');
|
|
367
310
|
} else {
|
|
368
311
|
convertedValue = _datetimejs["default"].toDate(value);
|
|
369
312
|
}
|
|
370
|
-
|
|
371
313
|
displayText = (0, _common.formatDate)(convertedValue, format);
|
|
372
314
|
}
|
|
373
|
-
|
|
374
315
|
return {
|
|
375
316
|
displayText: displayText,
|
|
376
317
|
selected: selected
|
|
@@ -381,20 +322,18 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
381
322
|
value: function handleKeyDown(e) {
|
|
382
323
|
var keyCode = e.keyCode;
|
|
383
324
|
var _this$props4 = this.props,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
325
|
+
isPopupOpen = _this$props4.isPopupOpen,
|
|
326
|
+
isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
|
|
327
|
+
onKeyDown = _this$props4.onKeyDown,
|
|
328
|
+
closePopupOnly = _this$props4.closePopupOnly,
|
|
329
|
+
cantEditOnPopupOpen = _this$props4.cantEditOnPopupOpen;
|
|
389
330
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
390
|
-
|
|
391
331
|
if (isPopupOpen) {
|
|
392
332
|
if (keyCode === 9 && !isAllowedDateType) {
|
|
393
333
|
//on tab click popup close
|
|
394
334
|
closePopupOnly(e);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
|
|
335
|
+
}
|
|
336
|
+
// ~~~~~~~ handle date navigation in dateTime popup ~~~~~
|
|
398
337
|
if (isAllowedDateType) {
|
|
399
338
|
cantEditOnPopupOpen && this.handleDateType(e);
|
|
400
339
|
}
|
|
@@ -422,13 +361,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
422
361
|
value: function handleFocus() {
|
|
423
362
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
424
363
|
var isMouseDown = this.isMouseDown;
|
|
425
|
-
|
|
426
364
|
if (isAllowedDateType && !isMouseDown) {
|
|
427
365
|
var dateFormatSelection = this.state.dateFormatSelection;
|
|
428
366
|
var focusedIndex = dateFormatSelection.focusedIndex;
|
|
429
367
|
var _this$valueInput = this.valueInput,
|
|
430
|
-
|
|
431
|
-
|
|
368
|
+
newSelectionStart = _this$valueInput.selectionStart,
|
|
369
|
+
newSelectionEnd = _this$valueInput.selectionEnd;
|
|
432
370
|
var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)] || 0;
|
|
433
371
|
isAllowedDateType && this.setState({
|
|
434
372
|
stateFocusOrder: focusedOrder,
|
|
@@ -442,7 +380,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
442
380
|
isFocused: true
|
|
443
381
|
});
|
|
444
382
|
}
|
|
445
|
-
|
|
446
383
|
var onFocus = this.props.onFocus;
|
|
447
384
|
onFocus && onFocus();
|
|
448
385
|
}
|
|
@@ -455,7 +392,9 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
455
392
|
this.keyDownAction = '';
|
|
456
393
|
this.setState({
|
|
457
394
|
isFocused: false
|
|
458
|
-
});
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// const { valueInput } = this;
|
|
459
398
|
// document.getSelection().removeAllRanges();
|
|
460
399
|
// valueInput && valueInput.setSelectionRange(0, 0);
|
|
461
400
|
|
|
@@ -467,8 +406,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
467
406
|
value: function handleGetMethods(methods) {
|
|
468
407
|
var getMethods = this.props.getMethods;
|
|
469
408
|
var resetLocalDate = methods.resetLocalDate,
|
|
470
|
-
|
|
471
|
-
|
|
409
|
+
getStateValues = methods.getStateValues,
|
|
410
|
+
toggleYearView = methods.toggleYearView;
|
|
472
411
|
this.resetLocalDate = resetLocalDate;
|
|
473
412
|
this.getDateTimeStateValues = getStateValues;
|
|
474
413
|
this.DateTimeYearViewToggle = toggleYearView;
|
|
@@ -478,75 +417,67 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
478
417
|
key: "handleDateType",
|
|
479
418
|
value: function handleDateType(e) {
|
|
480
419
|
var _this2 = this;
|
|
481
|
-
|
|
482
420
|
var keyCode = e.keyCode,
|
|
483
|
-
|
|
421
|
+
shiftKey = e.shiftKey;
|
|
484
422
|
var input = e.target;
|
|
485
|
-
|
|
486
423
|
if ((0, _dateFormatUtils.getIsSupportedKey)(e)) {
|
|
487
424
|
e.preventDefault();
|
|
488
425
|
}
|
|
489
|
-
|
|
490
426
|
var _this$props5 = this.props,
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
427
|
+
isDateTime = _this$props5.isDateTime,
|
|
428
|
+
timeZone = _this$props5.timeZone,
|
|
429
|
+
value = _this$props5.value,
|
|
430
|
+
onSelect = _this$props5.onSelect,
|
|
431
|
+
id = _this$props5.id,
|
|
432
|
+
min = _this$props5.min,
|
|
433
|
+
max = _this$props5.max,
|
|
434
|
+
minErrorText = _this$props5.minErrorText,
|
|
435
|
+
maxErrorText = _this$props5.maxErrorText,
|
|
436
|
+
onError = _this$props5.onError,
|
|
437
|
+
closePopupOnly = _this$props5.closePopupOnly,
|
|
438
|
+
is24Hour = _this$props5.is24Hour;
|
|
503
439
|
var _this$state3 = this.state,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
440
|
+
dateFormatSelection = _this$state3.dateFormatSelection,
|
|
441
|
+
day = _this$state3.day,
|
|
442
|
+
month = _this$state3.month,
|
|
443
|
+
year = _this$state3.year,
|
|
444
|
+
hour = _this$state3.hour,
|
|
445
|
+
minute = _this$state3.minute,
|
|
446
|
+
noon = _this$state3.noon,
|
|
447
|
+
selected = _this$state3.selected,
|
|
448
|
+
dateFormatDetails = _this$state3.dateFormatDetails;
|
|
513
449
|
var focusedIndex = dateFormatSelection.focusedIndex,
|
|
514
|
-
|
|
450
|
+
order = dateFormatSelection.order;
|
|
515
451
|
var yearInfo = dateFormatDetails.yearInfo;
|
|
516
|
-
|
|
517
452
|
var _getDateDetails = (0, _dateFormat.getDateDetails)(selected, {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
453
|
+
day: day,
|
|
454
|
+
month: month,
|
|
455
|
+
year: year,
|
|
456
|
+
hour: hour,
|
|
457
|
+
minute: minute,
|
|
458
|
+
noon: noon
|
|
459
|
+
}, isDateTime, timeZone, {
|
|
460
|
+
is24Hour: is24Hour
|
|
461
|
+
}),
|
|
462
|
+
_getDateDetails$day = _getDateDetails.day,
|
|
463
|
+
selectedDay = _getDateDetails$day === void 0 ? '' : _getDateDetails$day,
|
|
464
|
+
_getDateDetails$month = _getDateDetails.month,
|
|
465
|
+
selectedMonth = _getDateDetails$month === void 0 ? '' : _getDateDetails$month,
|
|
466
|
+
_getDateDetails$year = _getDateDetails.year,
|
|
467
|
+
selectedYear = _getDateDetails$year === void 0 ? '' : _getDateDetails$year,
|
|
468
|
+
_getDateDetails$hour = _getDateDetails.hour,
|
|
469
|
+
selectedHour = _getDateDetails$hour === void 0 ? '' : _getDateDetails$hour,
|
|
470
|
+
_getDateDetails$minut = _getDateDetails.minute,
|
|
471
|
+
selectedMinute = _getDateDetails$minut === void 0 ? '' : _getDateDetails$minut,
|
|
472
|
+
_getDateDetails$noon = _getDateDetails.noon,
|
|
473
|
+
selectedNoon = _getDateDetails$noon === void 0 ? '' : _getDateDetails$noon;
|
|
540
474
|
var newSelectionStart = input.selectionStart,
|
|
541
|
-
|
|
475
|
+
newSelectionEnd = input.selectionEnd;
|
|
542
476
|
var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)];
|
|
543
|
-
|
|
544
477
|
var _ref = order[focusedOrder] || {},
|
|
545
|
-
|
|
546
|
-
|
|
478
|
+
type = _ref.type;
|
|
547
479
|
this.oldFocusOrder = this.focusOrder;
|
|
548
480
|
this.focusOrder = focusedOrder;
|
|
549
|
-
|
|
550
481
|
if (keyCode === 38 || keyCode === 40) {
|
|
551
482
|
//up arrow && down arrow
|
|
552
483
|
this.oldKeyDownAction = this.keyDownAction;
|
|
@@ -555,7 +486,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
555
486
|
this.oldKeyDownAction = this.keyDownAction;
|
|
556
487
|
this.keyDownAction = 'valueTyped';
|
|
557
488
|
}
|
|
558
|
-
|
|
559
489
|
var focusedOrders = {
|
|
560
490
|
focusOrder: this.focusOrder,
|
|
561
491
|
oldFocusOrder: this.oldFocusOrder
|
|
@@ -565,14 +495,13 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
565
495
|
keyAction: this.keyDownAction
|
|
566
496
|
};
|
|
567
497
|
var newDay = selectedDay,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
498
|
+
newMonth = selectedMonth,
|
|
499
|
+
newYear = selectedYear,
|
|
500
|
+
newHour = selectedHour,
|
|
501
|
+
newMinute = selectedMinute,
|
|
502
|
+
newNoon = selectedNoon,
|
|
503
|
+
isValueChanged = false,
|
|
504
|
+
newFocusOrder = focusedOrder;
|
|
576
505
|
if (keyCode === 9 && shiftKey && !(0, _Common.getIsEmptyValue)(focusedOrder) && focusedOrder !== 0) {
|
|
577
506
|
e.preventDefault();
|
|
578
507
|
this.setState({
|
|
@@ -606,7 +535,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
606
535
|
month: selectedMonth,
|
|
607
536
|
year: selectedYear
|
|
608
537
|
}, e, focusedOrders, keyActions);
|
|
609
|
-
|
|
610
538
|
newDay = _getChangedDay.day;
|
|
611
539
|
isValueChanged = _getChangedDay.isChanged;
|
|
612
540
|
newFocusOrder = _getChangedDay.focusOrder;
|
|
@@ -616,7 +544,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
616
544
|
month: selectedMonth,
|
|
617
545
|
year: selectedYear
|
|
618
546
|
}, e, focusedOrders, keyActions);
|
|
619
|
-
|
|
620
547
|
newMonth = _getChangedMonth.month;
|
|
621
548
|
isValueChanged = _getChangedMonth.isChanged;
|
|
622
549
|
newFocusOrder = _getChangedMonth.focusOrder;
|
|
@@ -628,7 +555,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
628
555
|
}, e, focusedOrders, keyActions, {
|
|
629
556
|
yearInfo: yearInfo
|
|
630
557
|
});
|
|
631
|
-
|
|
632
558
|
newYear = _getChangedYear.year;
|
|
633
559
|
isValueChanged = _getChangedYear.isChanged;
|
|
634
560
|
newFocusOrder = _getChangedYear.focusOrder;
|
|
@@ -638,7 +564,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
638
564
|
}, e, focusedOrders, keyActions, {
|
|
639
565
|
is24Hour: is24Hour
|
|
640
566
|
});
|
|
641
|
-
|
|
642
567
|
newHour = _getChangedHour.hour;
|
|
643
568
|
isValueChanged = _getChangedHour.isChanged;
|
|
644
569
|
newFocusOrder = _getChangedHour.focusOrder;
|
|
@@ -646,7 +571,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
646
571
|
var _getChangedMinute = (0, _timeChange.getChangedMinute)({
|
|
647
572
|
minute: selectedMinute
|
|
648
573
|
}, e, focusedOrders, keyActions);
|
|
649
|
-
|
|
650
574
|
newMinute = _getChangedMinute.minute;
|
|
651
575
|
isValueChanged = _getChangedMinute.isChanged;
|
|
652
576
|
newFocusOrder = _getChangedMinute.focusOrder;
|
|
@@ -654,12 +578,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
654
578
|
var _getChangedNoon = (0, _timeChange.getChangedNoon)({
|
|
655
579
|
noon: selectedNoon
|
|
656
580
|
}, e, focusedOrders, keyActions);
|
|
657
|
-
|
|
658
581
|
newNoon = _getChangedNoon.noon;
|
|
659
582
|
isValueChanged = _getChangedNoon.isChanged;
|
|
660
583
|
newFocusOrder = _getChangedNoon.focusOrder;
|
|
661
584
|
}
|
|
662
|
-
|
|
663
585
|
if (isValueChanged) {
|
|
664
586
|
var currentValue = {
|
|
665
587
|
day: newDay,
|
|
@@ -669,7 +591,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
669
591
|
minute: newMinute,
|
|
670
592
|
noon: newNoon
|
|
671
593
|
};
|
|
672
|
-
|
|
673
594
|
var errorCaseHandle = function errorCaseHandle(isEmptyValError) {
|
|
674
595
|
_this2.setState(function () {
|
|
675
596
|
return {
|
|
@@ -684,38 +605,33 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
684
605
|
isError: !isEmptyValError
|
|
685
606
|
};
|
|
686
607
|
});
|
|
687
|
-
|
|
688
608
|
var newSelected = isEmptyValError ? '' : _constants.INVALID_DATE;
|
|
689
609
|
value !== newSelected && onSelect && onSelect(newSelected, id);
|
|
690
610
|
};
|
|
691
|
-
|
|
692
611
|
var _getIsValidDate = (0, _dateFormat.getIsValidDate)(currentValue, isDateTime, {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
612
|
+
is24Hour: is24Hour
|
|
613
|
+
}),
|
|
614
|
+
isError = _getIsValidDate.isError,
|
|
615
|
+
isEmptyValError = _getIsValidDate.isEmptyValError;
|
|
698
616
|
if (isError) {
|
|
699
617
|
errorCaseHandle(isEmptyValError);
|
|
700
618
|
} else {
|
|
701
619
|
var _getSelectedDate = (0, _dateFormat.getSelectedDate)(currentValue, {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
620
|
+
min: min,
|
|
621
|
+
max: max,
|
|
622
|
+
timeZone: timeZone,
|
|
623
|
+
isDateTime: isDateTime,
|
|
624
|
+
is24Hour: is24Hour
|
|
625
|
+
}),
|
|
626
|
+
selectedValue = _getSelectedDate.selectedValue,
|
|
627
|
+
selectedDateError = _getSelectedDate.isError,
|
|
628
|
+
errorType = _getSelectedDate.errorType;
|
|
712
629
|
if (selectedDateError) {
|
|
713
630
|
if (errorType === 'MIN') {
|
|
714
631
|
onError && onError(minErrorText, true);
|
|
715
632
|
} else if (errorType === 'MAX') {
|
|
716
633
|
onError && onError(maxErrorText, true);
|
|
717
634
|
}
|
|
718
|
-
|
|
719
635
|
errorCaseHandle();
|
|
720
636
|
} else {
|
|
721
637
|
this.setState(function () {
|
|
@@ -741,23 +657,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
741
657
|
value: function handleSelection() {
|
|
742
658
|
var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
743
659
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
744
|
-
|
|
745
660
|
if (isAllowedDateType) {
|
|
746
661
|
var dateFormatSelection = this.state.dateFormatSelection;
|
|
747
662
|
var _dateFormatSelection$ = dateFormatSelection.order,
|
|
748
|
-
|
|
749
|
-
|
|
663
|
+
order = _dateFormatSelection$ === void 0 ? {} : _dateFormatSelection$;
|
|
750
664
|
var _ref2 = order[focusOrder] || {},
|
|
751
|
-
|
|
752
|
-
|
|
665
|
+
index = _ref2.index;
|
|
753
666
|
if (!index) {
|
|
754
667
|
focusOrder = 0;
|
|
755
|
-
|
|
756
668
|
var _ref3 = order[focusOrder] || {};
|
|
757
|
-
|
|
758
669
|
index = _ref3.index;
|
|
759
670
|
}
|
|
760
|
-
|
|
761
671
|
if (index && this.valueInput) {
|
|
762
672
|
document.getSelection().removeAllRanges();
|
|
763
673
|
this.valueInput.setSelectionRange(index[0], index[1]);
|
|
@@ -775,31 +685,26 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
775
685
|
var clickIndex = dateFormatSelection.clickIndex;
|
|
776
686
|
var focusOrder = clickIndex[selectionEnd] || clickIndex[selectionEnd - 1] || 0;
|
|
777
687
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
778
|
-
|
|
779
688
|
if (isAllowedDateType) {
|
|
780
689
|
this.setState({
|
|
781
690
|
stateFocusOrder: focusOrder,
|
|
782
691
|
isFocused: true
|
|
783
692
|
});
|
|
784
693
|
}
|
|
785
|
-
|
|
786
694
|
if (!isAllowedDateType) {
|
|
787
695
|
this.handleTogglePopup(e);
|
|
788
696
|
} else {
|
|
789
697
|
var _this$props6 = this.props,
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
698
|
+
isPopupOpenOnClick = _this$props6.isPopupOpenOnClick,
|
|
699
|
+
isReadOnly = _this$props6.isReadOnly,
|
|
700
|
+
isDisabled = _this$props6.isDisabled;
|
|
794
701
|
if (isPopupOpenOnClick && (!isReadOnly || !isDisabled)) {
|
|
795
702
|
this.handleTogglePopup(e, true);
|
|
796
703
|
}
|
|
797
|
-
|
|
798
704
|
var _this$props7 = this.props,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
705
|
+
isPopupCloseOnClick = _this$props7.isPopupCloseOnClick,
|
|
706
|
+
isPopupOpen = _this$props7.isPopupOpen,
|
|
707
|
+
closePopupOnly = _this$props7.closePopupOnly;
|
|
803
708
|
if (isPopupCloseOnClick && !isPopupOpen) {
|
|
804
709
|
closePopupOnly && closePopupOnly(e);
|
|
805
710
|
}
|
|
@@ -814,49 +719,47 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
814
719
|
key: "handleGetShowValue",
|
|
815
720
|
value: function handleGetShowValue() {
|
|
816
721
|
var _this$state4 = this.state,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
722
|
+
day = _this$state4.day,
|
|
723
|
+
month = _this$state4.month,
|
|
724
|
+
year = _this$state4.year,
|
|
725
|
+
hour = _this$state4.hour,
|
|
726
|
+
minute = _this$state4.minute,
|
|
727
|
+
noon = _this$state4.noon,
|
|
728
|
+
dateFormatDetails = _this$state4.dateFormatDetails,
|
|
729
|
+
displayText = _this$state4.displayText,
|
|
730
|
+
newDateFormat = _this$state4.newDateFormat,
|
|
731
|
+
isDateEdited = _this$state4.isDateEdited,
|
|
732
|
+
isFocused = _this$state4.isFocused,
|
|
733
|
+
selected = _this$state4.selected;
|
|
829
734
|
var _this$props8 = this.props,
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
735
|
+
isDateTime = _this$props8.isDateTime,
|
|
736
|
+
is24Hour = _this$props8.is24Hour,
|
|
737
|
+
isPopupReady = _this$props8.isPopupReady,
|
|
738
|
+
timeZone = _this$props8.timeZone,
|
|
739
|
+
isPopupOpen = _this$props8.isPopupOpen;
|
|
836
740
|
if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
|
|
837
741
|
var _getDateDetails2 = (0, _dateFormat.getDateDetails)(selected, {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
742
|
+
day: day,
|
|
743
|
+
month: month,
|
|
744
|
+
year: year,
|
|
745
|
+
hour: hour,
|
|
746
|
+
minute: minute,
|
|
747
|
+
noon: noon
|
|
748
|
+
}, isDateTime, timeZone, {
|
|
749
|
+
is24Hour: is24Hour
|
|
750
|
+
}),
|
|
751
|
+
_getDateDetails2$day = _getDateDetails2.day,
|
|
752
|
+
selectedDay = _getDateDetails2$day === void 0 ? '' : _getDateDetails2$day,
|
|
753
|
+
_getDateDetails2$mont = _getDateDetails2.month,
|
|
754
|
+
selectedMonth = _getDateDetails2$mont === void 0 ? '' : _getDateDetails2$mont,
|
|
755
|
+
_getDateDetails2$year = _getDateDetails2.year,
|
|
756
|
+
selectedYear = _getDateDetails2$year === void 0 ? '' : _getDateDetails2$year,
|
|
757
|
+
_getDateDetails2$hour = _getDateDetails2.hour,
|
|
758
|
+
selectedHour = _getDateDetails2$hour === void 0 ? '' : _getDateDetails2$hour,
|
|
759
|
+
_getDateDetails2$minu = _getDateDetails2.minute,
|
|
760
|
+
selectedMinute = _getDateDetails2$minu === void 0 ? '' : _getDateDetails2$minu,
|
|
761
|
+
_getDateDetails2$noon = _getDateDetails2.noon,
|
|
762
|
+
selectedNoon = _getDateDetails2$noon === void 0 ? '' : _getDateDetails2$noon;
|
|
860
763
|
var dateTimeString = (0, _dateFormat.getDateTimeString)({
|
|
861
764
|
day: selectedDay,
|
|
862
765
|
month: selectedMonth,
|
|
@@ -873,7 +776,6 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
873
776
|
} else if (displayText) {
|
|
874
777
|
return displayText;
|
|
875
778
|
}
|
|
876
|
-
|
|
877
779
|
var timeFormat = is24Hour ? ' HH:mm' : ' hh:mm --';
|
|
878
780
|
var dateTimeFormat = isDateTime ? "".concat(newDateFormat).concat(timeFormat) : newDateFormat;
|
|
879
781
|
return dateTimeFormat || '';
|
|
@@ -882,27 +784,24 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
882
784
|
key: "handleGetAllowedType",
|
|
883
785
|
value: function handleGetAllowedType() {
|
|
884
786
|
var _this$props9 = this.props,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
787
|
+
isReadOnly = _this$props9.isReadOnly,
|
|
788
|
+
isDisabled = _this$props9.isDisabled,
|
|
789
|
+
isEditable = _this$props9.isEditable;
|
|
889
790
|
if (isEditable) {
|
|
890
791
|
if (isReadOnly || isDisabled) {
|
|
891
792
|
return false;
|
|
892
793
|
}
|
|
893
|
-
|
|
894
794
|
return true;
|
|
895
795
|
}
|
|
896
|
-
|
|
897
796
|
return false;
|
|
898
797
|
}
|
|
899
798
|
}, {
|
|
900
799
|
key: "handleDateClear",
|
|
901
800
|
value: function handleDateClear() {
|
|
902
801
|
var _this$props10 = this.props,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
802
|
+
id = _this$props10.id,
|
|
803
|
+
onSelect = _this$props10.onSelect,
|
|
804
|
+
value = _this$props10.value;
|
|
906
805
|
this.setState({
|
|
907
806
|
day: '',
|
|
908
807
|
month: '',
|
|
@@ -940,82 +839,79 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
940
839
|
var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
941
840
|
var oldFocusOrder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
942
841
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
943
|
-
|
|
944
842
|
if (isAllowedDateType) {
|
|
945
843
|
// if (focusOrder !== oldFocusOrder) {
|
|
946
844
|
var _this$state$dateForma = this.state.dateFormatSelection,
|
|
947
|
-
|
|
845
|
+
dateFormatSelection = _this$state$dateForma === void 0 ? {} : _this$state$dateForma;
|
|
948
846
|
var _dateFormatSelection$2 = dateFormatSelection.order,
|
|
949
|
-
|
|
950
|
-
var isPopupOpen = this.props.isPopupOpen;
|
|
847
|
+
order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
|
|
848
|
+
var isPopupOpen = this.props.isPopupOpen;
|
|
951
849
|
|
|
850
|
+
// const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
|
|
952
851
|
var _ref4 = order[focusOrder] || {},
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
852
|
+
_ref4$type = _ref4.type,
|
|
853
|
+
focusedType = _ref4$type === void 0 ? '' : _ref4$type;
|
|
956
854
|
var _this$getDateTimeStat = this.getDateTimeStateValues(),
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
855
|
+
isYearView = _this$getDateTimeStat.isYearView,
|
|
856
|
+
oldIsMonthOpen = _this$getDateTimeStat.isMonthOpen;
|
|
960
857
|
var yearViewTypes = ['month', 'year'];
|
|
961
858
|
var isMonthOpen = focusedType === 'month';
|
|
962
|
-
|
|
963
859
|
if (isPopupOpen) {
|
|
964
860
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
965
861
|
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
966
862
|
} else if (yearViewTypes.indexOf(focusedType) === -1 && isYearView) {
|
|
967
863
|
this.DateTimeYearViewToggle(false, false);
|
|
968
864
|
}
|
|
969
|
-
}
|
|
970
|
-
|
|
865
|
+
}
|
|
866
|
+
// }
|
|
971
867
|
}
|
|
972
868
|
}
|
|
973
869
|
}, {
|
|
974
870
|
key: "render",
|
|
975
871
|
value: function render() {
|
|
976
872
|
var _this$props11 = this.props,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
873
|
+
removeClose = _this$props11.removeClose,
|
|
874
|
+
minErrorText = _this$props11.minErrorText,
|
|
875
|
+
maxErrorText = _this$props11.maxErrorText,
|
|
876
|
+
min = _this$props11.min,
|
|
877
|
+
max = _this$props11.max,
|
|
878
|
+
placeholder = _this$props11.placeholder,
|
|
879
|
+
isPopupOpen = _this$props11.isPopupOpen,
|
|
880
|
+
isPopupReady = _this$props11.isPopupReady,
|
|
881
|
+
isDateTime = _this$props11.isDateTime,
|
|
882
|
+
position = _this$props11.position,
|
|
883
|
+
textBoxVariant = _this$props11.textBoxVariant,
|
|
884
|
+
textBoxSize = _this$props11.textBoxSize,
|
|
885
|
+
_this$props11$childre = _this$props11.children,
|
|
886
|
+
children = _this$props11$childre === void 0 ? null : _this$props11$childre,
|
|
887
|
+
isDisabled = _this$props11.isDisabled,
|
|
888
|
+
getContainerRef = _this$props11.getContainerRef,
|
|
889
|
+
getTargetRef = _this$props11.getTargetRef,
|
|
890
|
+
timeZone = _this$props11.timeZone,
|
|
891
|
+
isReadOnly = _this$props11.isReadOnly,
|
|
892
|
+
dataId = _this$props11.dataId,
|
|
893
|
+
needResponsive = _this$props11.needResponsive,
|
|
894
|
+
className = _this$props11.className,
|
|
895
|
+
needBorder = _this$props11.needBorder,
|
|
896
|
+
defaultTime = _this$props11.defaultTime,
|
|
897
|
+
needDefaultTime = _this$props11.needDefaultTime,
|
|
898
|
+
borderColor = _this$props11.borderColor,
|
|
899
|
+
i18nKeys = _this$props11.i18nKeys,
|
|
900
|
+
needErrorOnBlur = _this$props11.needErrorOnBlur,
|
|
901
|
+
htmlId = _this$props11.htmlId,
|
|
902
|
+
iconOnHover = _this$props11.iconOnHover,
|
|
903
|
+
is24Hour = _this$props11.is24Hour,
|
|
904
|
+
isAbsolutePositioningNeeded = _this$props11.isAbsolutePositioningNeeded,
|
|
905
|
+
positionsOffset = _this$props11.positionsOffset,
|
|
906
|
+
targetOffset = _this$props11.targetOffset,
|
|
907
|
+
isRestrictScroll = _this$props11.isRestrictScroll,
|
|
908
|
+
dropBoxPortalId = _this$props11.dropBoxPortalId;
|
|
1013
909
|
var _this$state5 = this.state,
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
910
|
+
_this$state5$selected = _this$state5.selected,
|
|
911
|
+
value = _this$state5$selected === void 0 ? '' : _this$state5$selected,
|
|
912
|
+
isError = _this$state5.isError,
|
|
913
|
+
isDateEdited = _this$state5.isDateEdited,
|
|
914
|
+
isFocused = _this$state5.isFocused;
|
|
1019
915
|
var showValue = this.handleGetShowValue();
|
|
1020
916
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1021
917
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
|
@@ -1097,25 +993,23 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1097
993
|
}));
|
|
1098
994
|
}
|
|
1099
995
|
}]);
|
|
1100
|
-
|
|
1101
996
|
return DateWidgetComponent;
|
|
1102
997
|
}(_react["default"].Component);
|
|
1103
|
-
|
|
1104
998
|
DateWidgetComponent.defaultProps = _defaultProps.DateWidget_defaultProps;
|
|
1105
999
|
DateWidgetComponent.propTypes = _propTypes.DateWidget_propTypes;
|
|
1106
1000
|
var DateWidget = (0, _Popup["default"])(DateWidgetComponent);
|
|
1107
|
-
DateWidget.defaultProps = DateWidgetComponent.defaultProps;
|
|
1001
|
+
DateWidget.defaultProps = DateWidgetComponent.defaultProps;
|
|
1108
1002
|
|
|
1003
|
+
// eslint-disable-next-line no-undef
|
|
1109
1004
|
if (false) {
|
|
1110
1005
|
DateWidgetComponent.docs = {
|
|
1111
1006
|
componentGroup: 'Form Elements',
|
|
1112
1007
|
folderName: 'Style Guide',
|
|
1113
1008
|
external: true,
|
|
1114
1009
|
description: ' '
|
|
1115
|
-
};
|
|
1116
|
-
|
|
1010
|
+
};
|
|
1011
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
1117
1012
|
DateWidget.propTypes = DateWidgetComponent.propTypes;
|
|
1118
1013
|
}
|
|
1119
|
-
|
|
1120
1014
|
var _default = DateWidget;
|
|
1121
1015
|
exports["default"] = _default;
|