@zohodesk/components 1.0.0-temp-157 → 1.0.0-temp-158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/es/Accordion/Accordion.js +7 -3
- package/es/Accordion/AccordionItem.js +4 -2
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +13 -5
- package/es/Avatar/Avatar.js +23 -11
- package/es/Avatar/Avatar.module.css +8 -8
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/AvatarTeam/AvatarTeam.module.css +33 -32
- package/es/Button/Button.js +4 -3
- package/es/Button/css/Button.module.css +49 -48
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/Buttongroup.module.css +10 -10
- package/es/Card/Card.js +21 -10
- package/es/CheckBox/CheckBox.js +5 -3
- package/es/CheckBox/CheckBox.module.css +14 -14
- package/es/DateTime/CalendarView.js +32 -20
- package/es/DateTime/DateTime.js +76 -11
- package/es/DateTime/DateTime.module.css +32 -32
- package/es/DateTime/DateTimePopupFooter.js +4 -2
- package/es/DateTime/DateTimePopupHeader.js +8 -2
- package/es/DateTime/DateWidget.js +98 -35
- package/es/DateTime/DaysRow.js +4 -2
- package/es/DateTime/Time.js +10 -2
- package/es/DateTime/YearView.js +28 -4
- package/es/DateTime/YearView.module.css +12 -12
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
- package/es/DateTime/__tests__/DateTime.spec.js +1 -0
- package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +32 -2
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/props/defaultProps.js +2 -1
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +6 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +42 -41
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +1 -2
- package/es/DropDown/DropDown.js +8 -4
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +4 -5
- package/es/DropDown/DropDownHeading.module.css +5 -5
- package/es/DropDown/DropDownItem.js +6 -0
- package/es/DropDown/DropDownItem.module.css +7 -7
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -2
- package/es/Heading/Heading.js +2 -3
- package/es/Heading/Heading.module.css +1 -1
- package/es/Label/Label.js +4 -10
- package/es/Label/Label.module.css +6 -6
- package/es/Label/props/propTypes.js +1 -4
- package/es/Layout/Box.js +13 -0
- package/es/Layout/Container.js +12 -1
- package/es/Layout/index.js +1 -2
- package/es/ListItem/ListContainer.js +8 -3
- package/es/ListItem/ListItem.js +9 -3
- package/es/ListItem/ListItem.module.css +37 -37
- package/es/ListItem/ListItemWithAvatar.js +9 -3
- package/es/ListItem/ListItemWithCheckBox.js +7 -2
- package/es/ListItem/ListItemWithIcon.js +8 -3
- package/es/ListItem/ListItemWithRadio.js +7 -3
- package/es/Modal/Modal.js +28 -11
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +89 -13
- package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/MultiSelect/EmptyState.js +2 -0
- package/es/MultiSelect/MultiSelect.js +99 -32
- package/es/MultiSelect/MultiSelect.module.css +25 -24
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +12 -6
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/SelectedOptions.module.css +4 -4
- package/es/MultiSelect/Suggestions.js +7 -3
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
- package/es/MultiSelect/props/propTypes.js +2 -0
- package/es/PopOver/PopOver.js +18 -2
- package/es/PopOver/__tests__/PopOver.spec.js +2 -1
- package/es/Popup/Popup.js +77 -24
- package/es/Popup/__tests__/Popup.spec.js +17 -5
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/IdProvider.js +10 -5
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Radio/Radio.js +4 -2
- package/es/Radio/Radio.module.css +9 -9
- package/es/Responsive/CustomResponsive.js +30 -18
- package/es/Responsive/RefWrapper.js +6 -7
- package/es/Responsive/ResizeComponent.js +35 -25
- package/es/Responsive/ResizeObserver.js +26 -6
- package/es/Responsive/Responsive.js +34 -20
- package/es/Responsive/index.js +1 -3
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
- package/es/Ribbon/Ribbon.js +3 -2
- package/es/Ribbon/Ribbon.module.css +44 -42
- package/es/RippleEffect/RippleEffect.js +1 -3
- package/es/Select/GroupSelect.js +58 -14
- package/es/Select/Select.js +79 -33
- package/es/Select/Select.module.css +19 -19
- package/es/Select/SelectWithAvatar.js +17 -4
- package/es/Select/SelectWithIcon.js +46 -5
- package/es/Select/__tests__/Select.spec.js +6 -8
- package/es/Select/props/propTypes.js +1 -0
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +13 -13
- package/es/Switch/Switch.js +5 -3
- package/es/Switch/Switch.module.css +22 -22
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/Tab.module.css +10 -10
- package/es/Tab/TabContent.js +1 -0
- package/es/Tab/TabContentWrapper.js +2 -0
- package/es/Tab/TabWrapper.js +5 -2
- package/es/Tab/Tabs.js +54 -7
- package/es/Tab/Tabs.module.css +12 -12
- package/es/Tab/__tests__/Tab.spec.js +1 -3
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
- package/es/Tag/Tag.js +6 -3
- package/es/Tag/Tag.module.css +20 -20
- package/es/TextBox/TextBox.js +15 -3
- package/es/TextBox/TextBox.module.css +15 -14
- package/es/TextBox/__tests__/TextBox.spec.js +1 -4
- package/es/TextBoxIcon/TextBoxIcon.js +9 -2
- package/es/TextBoxIcon/TextBoxIcon.module.css +2 -1
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
- package/es/Textarea/Textarea.js +12 -3
- package/es/Textarea/Textarea.module.css +21 -21
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +58 -14
- package/es/Tooltip/Tooltip.module.css +10 -3
- package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
- package/es/common/avatarsizes.module.css +16 -16
- package/es/common/customscroll.module.css +2 -0
- package/es/common/reset.module.css +1 -0
- package/es/deprecated/AdvancedMultiSelect.module.css +16 -16
- package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
- package/es/semantic/Button/Button.js +3 -2
- package/es/utils/Common.js +54 -9
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/css/compileClassNames.js +5 -0
- package/es/utils/css/mergeStyle.js +7 -6
- package/es/utils/css/utils.js +1 -0
- package/es/utils/datetime/GMTZones.js +48 -0
- package/es/utils/datetime/common.js +31 -7
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +68 -11
- package/es/utils/getInitial.js +4 -0
- package/es/utils/shallowEqual.js +6 -0
- package/lib/Accordion/Accordion.js +42 -18
- package/lib/Accordion/AccordionItem.js +40 -18
- package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/propTypes.js +3 -0
- package/lib/Animation/Animation.js +38 -18
- package/lib/Animation/__tests__/Animation.spec.js +11 -7
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/AppContainer/AppContainer.js +56 -21
- package/lib/AppContainer/props/propTypes.js +3 -0
- package/lib/Avatar/Avatar.js +78 -38
- package/lib/Avatar/Avatar.module.css +8 -8
- package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
- package/lib/Avatar/props/propTypes.js +3 -0
- package/lib/AvatarTeam/AvatarTeam.js +52 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +33 -32
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
- package/lib/AvatarTeam/props/propTypes.js +3 -0
- package/lib/Button/Button.js +31 -20
- package/lib/Button/css/Button.module.css +49 -48
- package/lib/Button/css/cssJSLogic.js +18 -17
- package/lib/Button/index.js +3 -0
- package/lib/Button/props/defaultProps.js +2 -0
- package/lib/Button/props/propTypes.js +3 -0
- package/lib/Buttongroup/Buttongroup.js +32 -12
- package/lib/Buttongroup/Buttongroup.module.css +10 -10
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
- package/lib/Buttongroup/props/propTypes.js +3 -0
- package/lib/Card/Card.js +102 -46
- package/lib/Card/__tests__/Card.spec.js +10 -1
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/propTypes.js +3 -0
- package/lib/CheckBox/CheckBox.js +71 -47
- package/lib/CheckBox/CheckBox.module.css +14 -14
- package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
- package/lib/CheckBox/props/propTypes.js +3 -0
- package/lib/DateTime/CalendarView.js +82 -42
- package/lib/DateTime/DateTime.js +248 -160
- package/lib/DateTime/DateTime.module.css +32 -32
- package/lib/DateTime/DateTimePopupFooter.js +32 -9
- package/lib/DateTime/DateTimePopupHeader.js +49 -18
- package/lib/DateTime/DateWidget.js +353 -251
- package/lib/DateTime/DaysRow.js +28 -6
- package/lib/DateTime/Time.js +74 -33
- package/lib/DateTime/YearView.js +78 -29
- package/lib/DateTime/YearView.module.css +12 -12
- package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
- package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
- package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
- package/lib/DateTime/dateFormatUtils/index.js +74 -16
- package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +55 -23
- package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
- package/lib/DateTime/index.js +2 -0
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/defaultProps.js +2 -1
- package/lib/DateTime/props/propTypes.js +11 -1
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +73 -10
- package/lib/DropBox/DropBox.js +34 -10
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +58 -37
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +42 -41
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +41 -33
- package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
- package/lib/DropBox/__tests__/DropBox.spec.js +6 -2
- package/lib/DropBox/css/cssJSLogic.js +3 -1
- package/lib/DropBox/props/defaultProps.js +8 -4
- package/lib/DropBox/props/propTypes.js +10 -4
- package/lib/DropDown/DropDown.js +52 -8
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +39 -20
- package/lib/DropDown/DropDownHeading.module.css +5 -5
- package/lib/DropDown/DropDownItem.js +42 -20
- package/lib/DropDown/DropDownItem.module.css +7 -7
- package/lib/DropDown/DropDownSearch.js +40 -17
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.js +24 -4
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
- package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
- package/lib/DropDown/index.js +9 -0
- package/lib/DropDown/props/propTypes.js +6 -4
- package/lib/Heading/Heading.js +37 -15
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +41 -27
- package/lib/Label/Label.module.css +6 -6
- package/lib/Label/__tests__/Label.spec.js +14 -1
- package/lib/Label/props/propTypes.js +4 -4
- package/lib/Layout/Box.js +31 -11
- package/lib/Layout/Container.js +29 -10
- package/lib/Layout/__tests__/Box.spec.js +65 -49
- package/lib/Layout/__tests__/Container.spec.js +67 -50
- package/lib/Layout/index.js +3 -0
- package/lib/Layout/props/propTypes.js +3 -0
- package/lib/Layout/utils.js +10 -0
- package/lib/ListItem/ListContainer.js +49 -28
- package/lib/ListItem/ListItem.js +70 -46
- package/lib/ListItem/ListItem.module.css +37 -37
- package/lib/ListItem/ListItemWithAvatar.js +76 -49
- package/lib/ListItem/ListItemWithCheckBox.js +64 -39
- package/lib/ListItem/ListItemWithIcon.js +69 -45
- package/lib/ListItem/ListItemWithRadio.js +65 -41
- package/lib/ListItem/index.js +7 -0
- package/lib/ListItem/props/propTypes.js +6 -4
- package/lib/Modal/Modal.js +46 -11
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +295 -167
- package/lib/MultiSelect/AdvancedMultiSelect.js +203 -125
- package/lib/MultiSelect/EmptyState.js +46 -25
- package/lib/MultiSelect/MultiSelect.js +324 -206
- package/lib/MultiSelect/MultiSelect.module.css +25 -24
- package/lib/MultiSelect/MultiSelectHeader.js +31 -9
- package/lib/MultiSelect/MultiSelectWithAvatar.js +106 -64
- package/lib/MultiSelect/SelectedOptions.js +44 -18
- package/lib/MultiSelect/SelectedOptions.module.css +4 -4
- package/lib/MultiSelect/Suggestions.js +65 -33
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
- package/lib/MultiSelect/index.js +5 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +5 -0
- package/lib/PopOver/PopOver.js +95 -49
- package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
- package/lib/PopOver/index.js +4 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +159 -82
- package/lib/Popup/__tests__/Popup.spec.js +44 -9
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +4 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +17 -6
- package/lib/Provider/LibraryContext.js +35 -15
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +5 -0
- package/lib/Radio/Radio.js +62 -39
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radiospec.js +9 -5
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +73 -28
- package/lib/Responsive/RefWrapper.js +17 -11
- package/lib/Responsive/ResizeComponent.js +63 -39
- package/lib/Responsive/ResizeObserver.js +24 -10
- package/lib/Responsive/Responsive.js +81 -31
- package/lib/Responsive/index.js +4 -0
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +53 -17
- package/lib/Responsive/utils/index.js +11 -3
- package/lib/Responsive/utils/shallowCompare.js +11 -2
- package/lib/Responsive/windowResizeObserver.js +8 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
- package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
- package/lib/Ribbon/Ribbon.js +34 -14
- package/lib/Ribbon/Ribbon.module.css +44 -42
- package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
- package/lib/Ribbon/props/propTypes.js +3 -0
- package/lib/RippleEffect/RippleEffect.js +18 -10
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +230 -131
- package/lib/Select/Select.js +291 -209
- package/lib/Select/Select.module.css +19 -19
- package/lib/Select/SelectWithAvatar.js +103 -57
- package/lib/Select/SelectWithIcon.js +133 -77
- package/lib/Select/__tests__/Select.spec.js +134 -92
- package/lib/Select/index.js +5 -0
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +4 -0
- package/lib/Stencils/Stencils.js +30 -11
- package/lib/Stencils/Stencils.module.css +13 -13
- package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +57 -34
- package/lib/Switch/Switch.module.css +22 -22
- package/lib/Switch/props/propTypes.js +3 -0
- package/lib/Tab/Tab.js +41 -28
- package/lib/Tab/Tab.module.css +10 -10
- package/lib/Tab/TabContent.js +12 -5
- package/lib/Tab/TabContentWrapper.js +13 -6
- package/lib/Tab/TabWrapper.js +37 -19
- package/lib/Tab/Tabs.js +172 -98
- package/lib/Tab/Tabs.module.css +12 -12
- package/lib/Tab/__tests__/Tab.spec.js +67 -58
- package/lib/Tab/__tests__/TabContent.spec.js +10 -6
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
- package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
- package/lib/Tab/__tests__/Tabs.spec.js +53 -39
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/propTypes.js +3 -0
- package/lib/Tag/Tag.js +72 -43
- package/lib/Tag/Tag.module.css +20 -20
- package/lib/Tag/__tests__/Tag.spec.js +14 -8
- package/lib/Tag/props/propTypes.js +3 -0
- package/lib/TextBox/TextBox.js +86 -60
- package/lib/TextBox/TextBox.module.css +15 -14
- package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
- package/lib/TextBox/props/propTypes.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +79 -52
- package/lib/TextBoxIcon/TextBoxIcon.module.css +2 -1
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -4
- package/lib/TextBoxIcon/props/propTypes.js +3 -0
- package/lib/Textarea/Textarea.js +55 -30
- package/lib/Textarea/Textarea.module.css +21 -21
- package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
- package/lib/Textarea/props/propTypes.js +3 -0
- package/lib/Tooltip/Tooltip.js +94 -31
- package/lib/Tooltip/Tooltip.module.css +10 -3
- package/lib/Tooltip/__tests__/Tooltip.spec.js +24 -3
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +3 -0
- package/lib/common/avatarsizes.module.css +16 -16
- package/lib/common/customscroll.module.css +2 -0
- package/lib/common/reset.module.css +1 -0
- package/lib/css.js +40 -0
- package/lib/deprecated/AdvancedMultiSelect.module.css +16 -16
- package/lib/deprecated/PortalLayer/PortalLayer.js +47 -24
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +57 -0
- package/lib/semantic/Button/Button.js +42 -22
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/index.js +2 -0
- package/lib/utils/Common.js +108 -18
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/__tests__/constructFullName.spec.js +1 -0
- package/lib/utils/__tests__/debounce.spec.js +3 -2
- package/lib/utils/__tests__/getInitial.spec.js +1 -0
- package/lib/utils/constructFullName.js +13 -4
- package/lib/utils/css/compileClassNames.js +6 -0
- package/lib/utils/css/mergeStyle.js +10 -7
- package/lib/utils/css/utils.js +8 -0
- package/lib/utils/datetime/GMTZones.js +55 -0
- package/lib/utils/datetime/common.js +52 -7
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +176 -60
- package/lib/utils/dummyFunction.js +2 -0
- package/lib/utils/getHTMLFontSize.js +1 -0
- package/lib/utils/getInitial.js +6 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/package.json +20 -13
|
@@ -1,68 +1,117 @@
|
|
|
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
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = exports.AdvancedMultiSelectComponent = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
9
12
|
var _propTypes = require("./props/propTypes");
|
|
13
|
+
|
|
10
14
|
var _defaultProps = require("./props/defaultProps");
|
|
15
|
+
|
|
11
16
|
var _MultiSelect = require("./MultiSelect");
|
|
17
|
+
|
|
12
18
|
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
19
|
+
|
|
13
20
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
21
|
+
|
|
14
22
|
var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
23
|
+
|
|
15
24
|
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
25
|
+
|
|
16
26
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
27
|
+
|
|
17
28
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
29
|
+
|
|
18
30
|
var _Layout = require("../Layout");
|
|
31
|
+
|
|
19
32
|
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
33
|
+
|
|
20
34
|
var _icons = require("@zohodesk/icons");
|
|
35
|
+
|
|
21
36
|
var _IdProvider = require("../Provider/IdProvider");
|
|
37
|
+
|
|
22
38
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
39
|
+
|
|
23
40
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
41
|
+
|
|
24
42
|
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
43
|
+
|
|
25
44
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
45
|
+
|
|
26
46
|
var _Common = require("../utils/Common.js");
|
|
47
|
+
|
|
27
48
|
var _dropDownUtils = require("../utils/dropDownUtils");
|
|
49
|
+
|
|
28
50
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
+
|
|
29
52
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
+
|
|
30
54
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
55
|
+
|
|
31
56
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
57
|
+
|
|
32
58
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
59
|
+
|
|
33
60
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
61
|
+
|
|
34
62
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
63
|
+
|
|
35
64
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
65
|
+
|
|
36
66
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
37
|
-
|
|
67
|
+
|
|
68
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
69
|
+
|
|
38
70
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
|
-
|
|
71
|
+
|
|
72
|
+
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); } }
|
|
73
|
+
|
|
40
74
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
-
|
|
42
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
75
|
+
|
|
43
76
|
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); }
|
|
77
|
+
|
|
44
78
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
79
|
+
|
|
45
80
|
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); }; }
|
|
81
|
+
|
|
46
82
|
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); }
|
|
83
|
+
|
|
47
84
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
85
|
+
|
|
48
86
|
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; } }
|
|
49
|
-
|
|
87
|
+
|
|
88
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
89
|
+
|
|
50
90
|
/* eslint-disable react/sort-prop-types */
|
|
91
|
+
|
|
51
92
|
/* eslint-disable react/no-unused-prop-types */
|
|
93
|
+
|
|
52
94
|
/* eslint-disable react/forbid-component-props */
|
|
53
95
|
var dummyArray = [];
|
|
96
|
+
|
|
54
97
|
var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent) {
|
|
55
98
|
_inherits(AdvancedMultiSelectComponent, _MultiSelectComponent);
|
|
99
|
+
|
|
56
100
|
var _super = _createSuper(AdvancedMultiSelectComponent);
|
|
101
|
+
|
|
57
102
|
function AdvancedMultiSelectComponent(props) {
|
|
58
103
|
var _this;
|
|
104
|
+
|
|
59
105
|
_classCallCheck(this, AdvancedMultiSelectComponent);
|
|
106
|
+
|
|
60
107
|
_this = _super.call(this, props);
|
|
108
|
+
|
|
61
109
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
62
|
-
|
|
110
|
+
oldState = _assertThisInitialize.state;
|
|
111
|
+
|
|
63
112
|
var _this$props = _this.props,
|
|
64
|
-
|
|
65
|
-
|
|
113
|
+
selectedOptionsLimit = _this$props.selectedOptionsLimit,
|
|
114
|
+
selectedOptions = _this$props.selectedOptions;
|
|
66
115
|
var selectedOptionsLen = selectedOptions.length;
|
|
67
116
|
_this.state = Object.assign({}, oldState, {
|
|
68
117
|
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
@@ -78,22 +127,25 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
78
127
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
79
128
|
return _this;
|
|
80
129
|
}
|
|
130
|
+
|
|
81
131
|
_createClass(AdvancedMultiSelectComponent, [{
|
|
82
132
|
key: "handleFilterSuggestions",
|
|
83
133
|
value: function handleFilterSuggestions() {
|
|
84
134
|
var _this$state = this.state,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
135
|
+
_this$state$options = _this$state.options,
|
|
136
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options,
|
|
137
|
+
searchStr = _this$state.searchStr;
|
|
88
138
|
var needLocalSearch = this.props.needLocalSearch;
|
|
139
|
+
|
|
89
140
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
141
|
+
options: options,
|
|
142
|
+
selectedOptions: dummyArray,
|
|
143
|
+
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
144
|
+
needSearch: needLocalSearch
|
|
145
|
+
}),
|
|
146
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
147
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
148
|
+
|
|
97
149
|
this.suggestionsOrder = suggestionIds;
|
|
98
150
|
return suggestions;
|
|
99
151
|
}
|
|
@@ -103,35 +155,42 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
103
155
|
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
104
156
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
105
157
|
var _this$state2 = this.state,
|
|
106
|
-
|
|
107
|
-
|
|
158
|
+
optionsNormalize = _this$state2.optionsNormalize,
|
|
159
|
+
searchStr = _this$state2.searchStr;
|
|
108
160
|
var _this$props2 = this.props,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
161
|
+
onChange = _this$props2.onChange,
|
|
162
|
+
_this$props2$needToCl = _this$props2.needToCloseOnSelect,
|
|
163
|
+
needToCloseOnSelect = _this$props2$needToCl === void 0 ? false : _this$props2$needToCl,
|
|
164
|
+
togglePopup = _this$props2.togglePopup,
|
|
165
|
+
isSearchClearOnSelect = _this$props2.isSearchClearOnSelect,
|
|
166
|
+
propSelectedOptions = _this$props2.selectedOptions,
|
|
167
|
+
disabledOptions = _this$props2.disabledOptions;
|
|
168
|
+
|
|
116
169
|
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
170
|
+
selectedOptions: selectedOptions,
|
|
171
|
+
propSelectedOptions: propSelectedOptions,
|
|
172
|
+
disabledOptions: disabledOptions
|
|
173
|
+
}),
|
|
174
|
+
newSelectedOptions = _filterSelectedOption.newSelectedOptions;
|
|
175
|
+
|
|
122
176
|
var selectedOptionsLen = newSelectedOptions.length;
|
|
123
177
|
var allSelectedOptionsDetails = [];
|
|
178
|
+
|
|
124
179
|
for (var i = 0; i < selectedOptionsLen; i++) {
|
|
125
180
|
var id = newSelectedOptions[i];
|
|
126
181
|
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
127
182
|
}
|
|
183
|
+
|
|
128
184
|
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails);
|
|
185
|
+
|
|
129
186
|
if (searchStr.trim() !== '' && isSearchClearOnSelect) {
|
|
130
187
|
this.handleSearch('');
|
|
131
188
|
}
|
|
189
|
+
|
|
132
190
|
this.searchInput && this.searchInput.focus({
|
|
133
191
|
preventScroll: true
|
|
134
192
|
});
|
|
193
|
+
|
|
135
194
|
if (needToCloseOnSelect) {
|
|
136
195
|
e && togglePopup(e);
|
|
137
196
|
}
|
|
@@ -140,6 +199,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
140
199
|
key: "handleSelectOption",
|
|
141
200
|
value: function handleSelectOption(option, value, index, e) {
|
|
142
201
|
var selectedOptions = this.props.selectedOptions;
|
|
202
|
+
|
|
143
203
|
if (selectedOptions.indexOf(option) >= 0) {
|
|
144
204
|
//toggle select option
|
|
145
205
|
this.handleRemoveOption(option);
|
|
@@ -151,14 +211,14 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
151
211
|
key: "handleFormatOptions",
|
|
152
212
|
value: function handleFormatOptions(props) {
|
|
153
213
|
var options = props.options,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
214
|
+
valueField = props.valueField,
|
|
215
|
+
textField = props.textField,
|
|
216
|
+
imageField = props.imageField,
|
|
217
|
+
iconName = props.iconName,
|
|
218
|
+
iconSize = props.iconSize,
|
|
219
|
+
prefixText = props.prefixText,
|
|
220
|
+
optionType = props.optionType,
|
|
221
|
+
disabledOptions = props.disabledOptions;
|
|
162
222
|
return this.formatOptions({
|
|
163
223
|
options: options,
|
|
164
224
|
valueField: valueField,
|
|
@@ -176,12 +236,15 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
176
236
|
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, props) {
|
|
177
237
|
//handle selectedoptions length
|
|
178
238
|
var _ref = this.state || {},
|
|
179
|
-
|
|
239
|
+
showedSelectedOptionsCount = _ref.showedSelectedOptionsCount;
|
|
240
|
+
|
|
180
241
|
var selectedOptionsLimit = props.selectedOptionsLimit,
|
|
181
|
-
|
|
242
|
+
selectedOptionDetails = props.selectedOptionDetails;
|
|
182
243
|
showedSelectedOptionsCount = (0, _Common.getIsEmptyValue)(showedSelectedOptionsCount) ? selectedOptionsLimit : showedSelectedOptionsCount;
|
|
244
|
+
|
|
183
245
|
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, props),
|
|
184
|
-
|
|
246
|
+
normalizedSelectedOptions = _this$handleFormatSel.normalizedFormatOptions;
|
|
247
|
+
|
|
185
248
|
var formatOptions = this.objectConcat({
|
|
186
249
|
obj1: normalizedFormatOptions,
|
|
187
250
|
obj2: normalizedSelectedOptions
|
|
@@ -196,12 +259,12 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
196
259
|
key: "handleFormatSelectedOptions",
|
|
197
260
|
value: function handleFormatSelectedOptions(selectedOptionDetails, props) {
|
|
198
261
|
var valueField = props.valueField,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
262
|
+
textField = props.textField,
|
|
263
|
+
imageField = props.imageField,
|
|
264
|
+
optionType = props.optionType,
|
|
265
|
+
iconName = props.iconName,
|
|
266
|
+
iconSize = props.iconSize,
|
|
267
|
+
disabledOptions = props.disabledOptions;
|
|
205
268
|
return this.formatSelectedOptions({
|
|
206
269
|
options: selectedOptionDetails,
|
|
207
270
|
valueField: valueField,
|
|
@@ -217,17 +280,19 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
217
280
|
key: "handleComponentDidUpdate",
|
|
218
281
|
value: function handleComponentDidUpdate(prevProps, prevState) {
|
|
219
282
|
var _this2 = this;
|
|
283
|
+
|
|
220
284
|
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
221
285
|
var _this$props3 = this.props,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
286
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
287
|
+
selectedOptionsLimit = _this$props3.selectedOptionsLimit,
|
|
288
|
+
id = _this$props3.id,
|
|
289
|
+
selectedOptionDetails = _this$props3.selectedOptionDetails;
|
|
226
290
|
var oldSelectedOptions = prevProps.selectedOptions,
|
|
227
|
-
|
|
291
|
+
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
228
292
|
var oldCount = this.state.showedSelectedOptionsCount;
|
|
229
293
|
var selectedOptionsLen = selectedOptions.length;
|
|
230
294
|
var oldSelectedOptionsLen = oldSelectedOptions.length;
|
|
295
|
+
|
|
231
296
|
if (id !== prevProps.id || selectedOptionsLimit !== oldSelectedOptionsLimit) {
|
|
232
297
|
//handle component update case (New set of options or new selectedOptionsLimit update)
|
|
233
298
|
this.setState({
|
|
@@ -235,21 +300,26 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
235
300
|
});
|
|
236
301
|
return;
|
|
237
302
|
}
|
|
303
|
+
|
|
238
304
|
if (oldCount !== prevState.showedSelectedOptionsCount || selectedOptionDetails !== prevProps.selectedOptionDetails) {
|
|
239
305
|
//When showedSelectedOptionsCount update, setState the updated selected option details
|
|
240
306
|
var _this$handleFormatOpt = this.handleFormatOptions(this.props),
|
|
241
|
-
|
|
307
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
308
|
+
|
|
242
309
|
var optionsDetails = Object.assign({}, oldAllSelectedOptionsDetails, normalizedFormatOptions);
|
|
310
|
+
|
|
243
311
|
var _this$handleGetSelect = this.handleGetSelectedOptions(selectedOptions, optionsDetails, this.props),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
312
|
+
formatSelectedOptions = _this$handleGetSelect.formatSelectedOptions,
|
|
313
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions,
|
|
314
|
+
selectedOptionIds = _this$handleGetSelect.selectedOptionIds;
|
|
315
|
+
|
|
247
316
|
this.allSelectedOptionsDetails = Object.assign(oldAllSelectedOptionsDetails, normalizedSelectedOptions);
|
|
248
317
|
this.setState({
|
|
249
318
|
selectedOptions: formatSelectedOptions,
|
|
250
319
|
selectedOptionIds: selectedOptionIds
|
|
251
320
|
});
|
|
252
321
|
}
|
|
322
|
+
|
|
253
323
|
if ((0, _Common.getIsEmptyValue)(oldCount) || oldSelectedOptionsLen <= oldCount) {
|
|
254
324
|
//handle not more options case
|
|
255
325
|
if (selectedOptionsLen > oldCount) {
|
|
@@ -271,6 +341,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
271
341
|
showedSelectedOptionsCount: newCount
|
|
272
342
|
}, function () {
|
|
273
343
|
var showedSelectedOptionsCount = _this2.state.showedSelectedOptionsCount;
|
|
344
|
+
|
|
274
345
|
if (showedSelectedOptionsCount === 0) {
|
|
275
346
|
_this2.handleMoreClick();
|
|
276
347
|
}
|
|
@@ -281,27 +352,30 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
281
352
|
key: "handleMoreClick",
|
|
282
353
|
value: function handleMoreClick(e) {
|
|
283
354
|
var _this3 = this;
|
|
355
|
+
|
|
284
356
|
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
285
357
|
var _this$props4 = this.props,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
358
|
+
selectedOptionsLimit = _this$props4.selectedOptionsLimit,
|
|
359
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
360
|
+
getSelectedOptionDetails = _this$props4.getSelectedOptionDetails,
|
|
361
|
+
removeClose = _this$props4.removeClose;
|
|
290
362
|
removeClose(e);
|
|
291
363
|
var selectedOptionsLen = selectedOptions.length;
|
|
364
|
+
|
|
292
365
|
if (showedSelectedOptionsCount < selectedOptionsLen) {
|
|
293
366
|
var newCount = showedSelectedOptionsCount + selectedOptionsLimit;
|
|
294
367
|
var newSelectedOptionIds = selectedOptions.slice(showedSelectedOptionsCount, newCount);
|
|
368
|
+
|
|
295
369
|
try {
|
|
296
370
|
getSelectedOptionDetails(newSelectedOptionIds).then(function () {
|
|
297
371
|
_this3.setState({
|
|
298
372
|
showedSelectedOptionsCount: showedSelectedOptionsCount + newSelectedOptionIds.length
|
|
299
373
|
});
|
|
300
374
|
});
|
|
301
|
-
} catch (e) {
|
|
302
|
-
//console.error('getSelectedOptionDetails is not a promise function.');
|
|
375
|
+
} catch (e) {//console.error('getSelectedOptionDetails is not a promise function.');
|
|
303
376
|
}
|
|
304
377
|
}
|
|
378
|
+
|
|
305
379
|
this.searchInput && this.searchInput.focus({
|
|
306
380
|
preventScroll: true
|
|
307
381
|
});
|
|
@@ -320,80 +394,83 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
320
394
|
key: "render",
|
|
321
395
|
value: function render() {
|
|
322
396
|
var _this4 = this;
|
|
397
|
+
|
|
323
398
|
var _this$props5 = this.props,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
399
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
400
|
+
needSelectAll = _this$props5.needSelectAll,
|
|
401
|
+
searchEmptyMessage = _this$props5.searchEmptyMessage,
|
|
402
|
+
emptyMessage = _this$props5.emptyMessage,
|
|
403
|
+
noMoreOptionsMessage = _this$props5.noMoreOptionsMessage,
|
|
404
|
+
dropBoxSize = _this$props5.dropBoxSize,
|
|
405
|
+
placeHolder = _this$props5.placeHolder,
|
|
406
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
407
|
+
isPopupReady = _this$props5.isPopupReady,
|
|
408
|
+
position = _this$props5.position,
|
|
409
|
+
defaultDropBoxPosition = _this$props5.defaultDropBoxPosition,
|
|
410
|
+
selectAllText = _this$props5.selectAllText,
|
|
411
|
+
getContainerRef = _this$props5.getContainerRef,
|
|
412
|
+
removeClose = _this$props5.removeClose,
|
|
413
|
+
isAnimate = _this$props5.isAnimate,
|
|
414
|
+
animationStyle = _this$props5.animationStyle,
|
|
415
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
416
|
+
variant = _this$props5.variant,
|
|
417
|
+
size = _this$props5.size,
|
|
418
|
+
isDisabled = _this$props5.isDisabled,
|
|
419
|
+
title = _this$props5.title,
|
|
420
|
+
dataIdMultiSelectComp = _this$props5.dataIdMultiSelectComp,
|
|
421
|
+
dataIdClearIcon = _this$props5.dataIdClearIcon,
|
|
422
|
+
dataIdSelectAllEle = _this$props5.dataIdSelectAllEle,
|
|
423
|
+
dataIdLoading = _this$props5.dataIdLoading,
|
|
424
|
+
_this$props5$selected = _this$props5.selectedOptions,
|
|
425
|
+
allselectedOptionIds = _this$props5$selected === void 0 ? [] : _this$props5$selected,
|
|
426
|
+
listItemSize = _this$props5.listItemSize,
|
|
427
|
+
needBorder = _this$props5.needBorder,
|
|
428
|
+
i18nKeys = _this$props5.i18nKeys,
|
|
429
|
+
htmlId = _this$props5.htmlId,
|
|
430
|
+
a11y = _this$props5.a11y,
|
|
431
|
+
borderColor = _this$props5.borderColor,
|
|
432
|
+
isBoxPaddingNeed = _this$props5.isBoxPaddingNeed,
|
|
433
|
+
getFooter = _this$props5.getFooter,
|
|
434
|
+
customProps = _this$props5.customProps,
|
|
435
|
+
needEffect = _this$props5.needEffect,
|
|
436
|
+
disabledOptions = _this$props5.disabledOptions,
|
|
437
|
+
isLoading = _this$props5.isLoading,
|
|
438
|
+
dataSelectorId = _this$props5.dataSelectorId;
|
|
364
439
|
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
440
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
441
|
+
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
442
|
+
DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP;
|
|
368
443
|
var _i18nKeys = i18nKeys,
|
|
369
|
-
|
|
370
|
-
|
|
444
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
445
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
371
446
|
var _a11y$clearLabel = a11y.clearLabel,
|
|
372
|
-
|
|
447
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
373
448
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
374
449
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
375
450
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage,
|
|
376
451
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
377
452
|
});
|
|
378
453
|
var _this$state3 = this.state,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
454
|
+
selectedOptions = _this$state3.selectedOptions,
|
|
455
|
+
searchStr = _this$state3.searchStr,
|
|
456
|
+
hoverOption = _this$state3.hoverOption,
|
|
457
|
+
highLightedSelectOptions = _this$state3.highLightedSelectOptions,
|
|
458
|
+
isFetchingOptions = _this$state3.isFetchingOptions,
|
|
459
|
+
isActive = _this$state3.isActive,
|
|
460
|
+
showedSelectedOptionsCount = _this$state3.showedSelectedOptionsCount,
|
|
461
|
+
options = _this$state3.options;
|
|
387
462
|
var suggestions = this.handleFilterSuggestions();
|
|
388
463
|
var allselectedOptionIdsLen = allselectedOptionIds.length;
|
|
389
464
|
var moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
|
|
390
465
|
var setAriaId = this.getNextAriaId();
|
|
391
466
|
var ariaErrorId = this.getNextAriaId();
|
|
467
|
+
|
|
392
468
|
var _this$getIsShowClearI = this.getIsShowClearIcon({
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
469
|
+
selectedOptions: selectedOptions,
|
|
470
|
+
disabledOptions: disabledOptions
|
|
471
|
+
}),
|
|
472
|
+
isShowClear = _this$getIsShowClearI.isShowClearIcon;
|
|
473
|
+
|
|
397
474
|
var isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
398
475
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
399
476
|
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
@@ -534,16 +611,16 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
534
611
|
}) : null);
|
|
535
612
|
}
|
|
536
613
|
}]);
|
|
614
|
+
|
|
537
615
|
return AdvancedMultiSelectComponent;
|
|
538
616
|
}(_MultiSelect.MultiSelectComponent);
|
|
617
|
+
|
|
539
618
|
exports.AdvancedMultiSelectComponent = AdvancedMultiSelectComponent;
|
|
540
619
|
AdvancedMultiSelectComponent.propTypes = _propTypes.AdvancedMultiSelect_propTypes;
|
|
541
620
|
AdvancedMultiSelectComponent.defaultProps = _defaultProps.AdvancedMultiSelect_defaultProps;
|
|
542
621
|
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
543
622
|
var AdvancedMultiSelect = (0, _Popup["default"])(AdvancedMultiSelectComponent);
|
|
544
|
-
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
545
|
-
|
|
546
|
-
// if (__DOCS__) {
|
|
623
|
+
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps; // if (__DOCS__) {
|
|
547
624
|
// AdvancedMultiSelectComponent.docs = {
|
|
548
625
|
// componentGroup: 'Form Elements',
|
|
549
626
|
// folderName: 'Style Guide'
|
|
@@ -551,5 +628,6 @@ AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
|
551
628
|
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
552
629
|
// AdvancedMultiSelect.propTypes = AdvancedMultiSelectComponent.propTypes;
|
|
553
630
|
// }
|
|
631
|
+
|
|
554
632
|
var _default = AdvancedMultiSelect;
|
|
555
633
|
exports["default"] = _default;
|