@zohodesk/components 1.2.23 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/es/Accordion/Accordion.js +7 -3
- package/es/Accordion/AccordionItem.js +4 -2
- package/es/Animation/Animation.js +7 -89
- package/es/Animation/utils.js +83 -0
- package/es/AppContainer/AppContainer.js +14 -3
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/Avatar/Avatar.js +23 -11
- package/es/Avatar/Avatar.module.css +18 -18
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/AvatarTeam/AvatarTeam.module.css +35 -35
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -2
- package/es/Button/Button.js +4 -3
- package/es/Button/css/Button.module.css +70 -70
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/Buttongroup.module.css +13 -15
- package/es/Card/Card.js +21 -10
- package/es/CheckBox/CheckBox.js +5 -3
- package/es/CheckBox/CheckBox.module.css +15 -15
- package/es/DateTime/CalendarView.js +32 -20
- package/es/DateTime/DateTime.js +69 -6
- package/es/DateTime/DateTime.module.css +40 -40
- package/es/DateTime/DateTimePopupFooter.js +4 -1
- package/es/DateTime/DateTimePopupHeader.js +8 -2
- package/es/DateTime/DateWidget.js +98 -35
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +4 -1
- package/es/DateTime/Time.js +10 -1
- package/es/DateTime/YearView.js +28 -4
- package/es/DateTime/YearView.module.css +15 -15
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +65 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +31 -1
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +6 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +73 -76
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
- package/es/DropBox/css/DropBox.module.css +6 -6
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +1 -2
- package/es/DropDown/DropDown.js +7 -1
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +4 -5
- package/es/DropDown/DropDownHeading.module.css +6 -6
- package/es/DropDown/DropDownItem.js +6 -0
- package/es/DropDown/DropDownItem.module.css +12 -12
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/props/propTypes.js +1 -2
- package/es/Heading/Heading.js +2 -3
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +2 -3
- package/es/Label/Label.module.css +5 -5
- package/es/Label/__tests__/Label.spec.js +1 -2
- package/es/Layout/Box.js +15 -2
- package/es/Layout/Container.js +14 -3
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +1 -2
- package/es/Layout/utils.js +1 -0
- package/es/ListItem/ListContainer.js +8 -3
- package/es/ListItem/ListItem.js +9 -3
- package/es/ListItem/ListItem.module.css +27 -38
- package/es/ListItem/ListItemWithAvatar.js +9 -3
- package/es/ListItem/ListItemWithCheckBox.js +7 -2
- package/es/ListItem/ListItemWithIcon.js +8 -3
- package/es/ListItem/ListItemWithRadio.js +7 -3
- package/es/Modal/Modal.js +28 -11
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +89 -13
- package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/MultiSelect/EmptyState.js +2 -0
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/es/MultiSelect/MultiSelect.js +99 -30
- package/es/MultiSelect/MultiSelect.module.css +31 -31
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +10 -3
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +7 -3
- package/es/MultiSelect/props/propTypes.js +2 -2
- package/es/PopOver/PopOver.js +16 -0
- package/es/Popup/Popup.js +77 -24
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/IdProvider.js +10 -5
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Radio/Radio.js +3 -0
- package/es/Radio/Radio.module.css +9 -9
- package/es/Responsive/CustomResponsive.js +30 -18
- package/es/Responsive/RefWrapper.js +6 -7
- package/es/Responsive/ResizeComponent.js +35 -25
- package/es/Responsive/ResizeObserver.js +26 -6
- package/es/Responsive/Responsive.js +34 -20
- package/es/Responsive/index.js +1 -3
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/es/ResponsiveDropBox/props/propTypes.js +1 -2
- package/es/Ribbon/Ribbon.js +3 -2
- package/es/Ribbon/Ribbon.module.css +45 -48
- package/es/RippleEffect/RippleEffect.js +1 -3
- package/es/Select/GroupSelect.js +58 -14
- package/es/Select/Select.js +79 -33
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +17 -4
- package/es/Select/SelectWithIcon.js +46 -5
- package/es/Select/props/propTypes.js +2 -2
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +11 -11
- package/es/Switch/Switch.js +5 -3
- package/es/Switch/Switch.module.css +23 -23
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/Tab.module.css +14 -14
- package/es/Tab/TabContent.js +1 -0
- package/es/Tab/TabContentWrapper.js +3 -0
- package/es/Tab/TabWrapper.js +5 -2
- package/es/Tab/Tabs.js +54 -7
- package/es/Tab/Tabs.module.css +22 -22
- package/es/Tag/Tag.js +6 -3
- package/es/Tag/Tag.module.css +24 -25
- package/es/TextBox/TextBox.js +16 -3
- package/es/TextBox/TextBox.module.css +9 -9
- package/es/TextBoxIcon/TextBoxIcon.js +9 -2
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/es/TextBoxIcon/props/propTypes.js +1 -2
- package/es/Textarea/Textarea.js +12 -3
- package/es/Textarea/Textarea.module.css +21 -21
- package/es/Tooltip/Tooltip.js +58 -14
- package/es/Tooltip/Tooltip.module.css +5 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
- package/es/common/animation.module.css +8 -8
- package/es/common/avatarsizes.module.css +16 -16
- package/es/common/basicReset.module.css +3 -3
- package/es/common/common.module.css +24 -24
- package/es/common/customscroll.module.css +2 -2
- package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
- package/es/semantic/Button/Button.js +3 -2
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/utils/Common.js +54 -9
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/datetime/common.js +16 -5
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +68 -11
- package/es/utils/getInitial.js +4 -0
- package/es/utils/shallowEqual.js +6 -0
- package/es/v1/Accordion/Accordion.js +4 -3
- package/es/v1/Accordion/AccordionItem.js +4 -2
- package/es/v1/Animation/Animation.js +5 -89
- package/es/v1/Animation/utils.js +83 -0
- package/es/v1/AppContainer/AppContainer.js +9 -3
- package/es/v1/Avatar/Avatar.js +18 -6
- package/es/v1/AvatarTeam/AvatarTeam.js +1 -0
- package/es/v1/Button/Button.js +3 -3
- package/es/v1/Card/Card.js +16 -8
- package/es/v1/CheckBox/CheckBox.js +6 -3
- package/es/v1/DateTime/CalendarView.js +32 -20
- package/es/v1/DateTime/DateTime.js +69 -6
- package/es/v1/DateTime/DateTimePopupFooter.js +4 -1
- package/es/v1/DateTime/DateTimePopupHeader.js +8 -2
- package/es/v1/DateTime/DateWidget.js +98 -35
- package/es/v1/DateTime/DaysRow.js +4 -1
- package/es/v1/DateTime/Time.js +10 -1
- package/es/v1/DateTime/YearView.js +28 -4
- package/es/v1/DropBox/DropBox.js +6 -2
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +7 -0
- package/es/v1/DropBox/props/defaultProps.js +1 -2
- package/es/v1/DropBox/props/propTypes.js +1 -2
- package/es/v1/DropDown/DropDown.js +3 -0
- package/es/v1/DropDown/DropDownHeading.js +2 -2
- package/es/v1/DropDown/DropDownItem.js +5 -0
- package/es/v1/DropDown/DropDownSearch.js +3 -2
- package/es/v1/DropDown/props/propTypes.js +1 -2
- package/es/v1/Heading/Heading.js +1 -3
- package/es/v1/Layout/Box.js +15 -2
- package/es/v1/Layout/Container.js +14 -3
- package/es/v1/ListItem/ListContainer.js +8 -3
- package/es/v1/ListItem/ListItem.js +10 -3
- package/es/v1/ListItem/ListItemWithAvatar.js +9 -1
- package/es/v1/ListItem/ListItemWithCheckBox.js +8 -2
- package/es/v1/ListItem/ListItemWithIcon.js +9 -3
- package/es/v1/ListItem/ListItemWithRadio.js +8 -3
- package/es/v1/Modal/Modal.js +17 -1
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +90 -15
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +32 -9
- package/es/v1/MultiSelect/EmptyState.js +2 -0
- package/es/v1/MultiSelect/MultiSelect.js +100 -31
- package/es/v1/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +11 -3
- package/es/v1/MultiSelect/SelectedOptions.js +6 -3
- package/es/v1/MultiSelect/Suggestions.js +7 -3
- package/es/v1/MultiSelect/props/propTypes.js +2 -2
- package/es/v1/PopOver/PopOver.js +11 -0
- package/es/v1/Popup/Popup.js +77 -24
- package/es/v1/Provider/IdProvider.js +10 -5
- package/es/v1/Provider/LibraryContext.js +6 -4
- package/es/v1/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/v1/Provider/ZindexProvider.js +9 -2
- package/es/v1/Radio/Radio.js +5 -2
- package/es/v1/Responsive/CustomResponsive.js +30 -18
- package/es/v1/Responsive/RefWrapper.js +6 -7
- package/es/v1/Responsive/ResizeComponent.js +35 -25
- package/es/v1/Responsive/ResizeObserver.js +26 -6
- package/es/v1/Responsive/Responsive.js +34 -20
- package/es/v1/Responsive/index.js +1 -3
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +1 -0
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -2
- package/es/v1/Select/GroupSelect.js +58 -14
- package/es/v1/Select/Select.js +81 -37
- package/es/v1/Select/SelectWithAvatar.js +17 -4
- package/es/v1/Select/SelectWithIcon.js +46 -5
- package/es/v1/Select/props/propTypes.js +2 -2
- package/es/v1/Stencils/Stencils.js +2 -0
- package/es/v1/Switch/Switch.js +6 -3
- package/es/v1/Tab/Tab.js +3 -3
- package/es/v1/Tab/TabContent.js +1 -0
- package/es/v1/Tab/TabContentWrapper.js +3 -0
- package/es/v1/Tab/TabWrapper.js +5 -2
- package/es/v1/Tab/Tabs.js +54 -9
- package/es/v1/Tab/v1Tab.module.css +14 -14
- package/es/v1/Tab/v1Tabs.module.css +22 -22
- package/es/v1/Tag/Tag.js +5 -1
- package/es/v1/TextBox/TextBox.js +14 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -2
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -2
- package/es/v1/Textarea/Textarea.js +10 -3
- package/es/v1/Tooltip/Tooltip.js +58 -14
- package/es/v1/Typography/Typography.js +2 -0
- package/es/v1/Typography/css/Typography.module.css +31 -31
- package/es/v1/Typography/css/cssJSLogic.js +3 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -2
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -4
- package/es/v1/semantic/Button/Button.js +1 -2
- package/lib/Accordion/Accordion.js +42 -18
- package/lib/Accordion/AccordionItem.js +40 -18
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/propTypes.js +3 -0
- package/lib/Animation/Animation.js +42 -104
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/Animation/utils.js +94 -0
- package/lib/AppContainer/AppContainer.js +58 -20
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/propTypes.js +3 -0
- package/lib/Avatar/Avatar.js +78 -38
- package/lib/Avatar/Avatar.module.css +18 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +95 -71
- package/lib/Avatar/props/propTypes.js +3 -0
- package/lib/AvatarTeam/AvatarTeam.js +52 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +35 -35
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +77 -61
- package/lib/AvatarTeam/props/propTypes.js +3 -0
- package/lib/Button/Button.js +33 -22
- package/lib/Button/__tests__/Button.spec.js +65 -48
- package/lib/Button/css/Button.module.css +70 -70
- package/lib/Button/css/cssJSLogic.js +18 -17
- package/lib/Button/index.js +3 -0
- package/lib/Button/props/defaultProps.js +2 -0
- package/lib/Button/props/propTypes.js +3 -0
- package/lib/Buttongroup/Buttongroup.js +32 -12
- package/lib/Buttongroup/Buttongroup.module.css +13 -15
- package/lib/Buttongroup/__tests__/Buttongroup.spec.js +18 -10
- package/lib/Buttongroup/props/propTypes.js +3 -0
- package/lib/Card/Card.js +102 -46
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/propTypes.js +3 -0
- package/lib/CheckBox/CheckBox.js +71 -47
- package/lib/CheckBox/CheckBox.module.css +15 -15
- package/lib/CheckBox/props/propTypes.js +3 -0
- package/lib/DateTime/CalendarView.js +82 -42
- package/lib/DateTime/DateTime.js +244 -156
- package/lib/DateTime/DateTime.module.css +40 -40
- package/lib/DateTime/DateTimePopupFooter.js +33 -8
- package/lib/DateTime/DateTimePopupHeader.js +49 -17
- package/lib/DateTime/DateWidget.js +350 -249
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +28 -5
- package/lib/DateTime/Time.js +75 -32
- package/lib/DateTime/YearView.js +76 -27
- package/lib/DateTime/YearView.module.css +15 -15
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +187 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
- package/lib/DateTime/dateFormatUtils/dayChange.js +15 -7
- package/lib/DateTime/dateFormatUtils/index.js +73 -16
- package/lib/DateTime/dateFormatUtils/monthChange.js +20 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +54 -22
- package/lib/DateTime/dateFormatUtils/yearChange.js +23 -11
- package/lib/DateTime/index.js +2 -0
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/propTypes.js +11 -1
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +73 -10
- package/lib/DropBox/DropBox.js +45 -21
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +59 -38
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +73 -76
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +42 -34
- package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
- package/lib/DropBox/css/DropBox.module.css +6 -6
- package/lib/DropBox/css/cssJSLogic.js +3 -1
- package/lib/DropBox/props/defaultProps.js +8 -4
- package/lib/DropBox/props/propTypes.js +10 -4
- package/lib/DropDown/DropDown.js +51 -5
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +39 -20
- package/lib/DropDown/DropDownHeading.module.css +6 -6
- package/lib/DropDown/DropDownItem.js +42 -20
- package/lib/DropDown/DropDownItem.module.css +12 -12
- package/lib/DropDown/DropDownSearch.js +40 -17
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.js +24 -4
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/index.js +9 -0
- package/lib/DropDown/props/propTypes.js +10 -4
- package/lib/Heading/Heading.js +37 -15
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +41 -21
- package/lib/Label/Label.module.css +5 -5
- package/lib/Label/__tests__/Label.spec.js +48 -34
- package/lib/Label/props/propTypes.js +3 -0
- package/lib/Layout/Box.js +35 -15
- package/lib/Layout/Container.js +33 -14
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/index.js +3 -0
- package/lib/Layout/props/propTypes.js +3 -0
- package/lib/Layout/utils.js +11 -0
- package/lib/ListItem/ListContainer.js +55 -30
- package/lib/ListItem/ListItem.js +74 -45
- package/lib/ListItem/ListItem.module.css +27 -38
- package/lib/ListItem/ListItemWithAvatar.js +80 -48
- package/lib/ListItem/ListItemWithCheckBox.js +70 -40
- package/lib/ListItem/ListItemWithIcon.js +73 -44
- package/lib/ListItem/ListItemWithRadio.js +71 -42
- package/lib/ListItem/index.js +7 -0
- package/lib/ListItem/props/propTypes.js +6 -4
- package/lib/Modal/Modal.js +45 -10
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +293 -166
- package/lib/MultiSelect/AdvancedMultiSelect.js +202 -125
- package/lib/MultiSelect/EmptyState.js +45 -24
- package/lib/MultiSelect/MobileHeader/MobileHeader.js +14 -5
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/lib/MultiSelect/MobileHeader/props/propTypes.js +3 -0
- package/lib/MultiSelect/MultiSelect.js +333 -214
- package/lib/MultiSelect/MultiSelect.module.css +31 -31
- package/lib/MultiSelect/MultiSelectHeader.js +29 -7
- package/lib/MultiSelect/MultiSelectWithAvatar.js +85 -43
- package/lib/MultiSelect/SelectedOptions.js +43 -17
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +64 -32
- package/lib/MultiSelect/index.js +5 -0
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +14 -4
- package/lib/PopOver/PopOver.js +94 -47
- package/lib/PopOver/index.js +4 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -81
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +4 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +17 -6
- package/lib/Provider/LibraryContext.js +35 -15
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +5 -0
- package/lib/Radio/Radio.js +60 -36
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radio.spec.js +134 -103
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +73 -29
- package/lib/Responsive/RefWrapper.js +17 -11
- package/lib/Responsive/ResizeComponent.js +62 -36
- package/lib/Responsive/ResizeObserver.js +24 -10
- package/lib/Responsive/Responsive.js +80 -30
- package/lib/Responsive/index.js +4 -0
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +53 -17
- package/lib/Responsive/utils/index.js +11 -3
- package/lib/Responsive/utils/shallowCompare.js +11 -2
- package/lib/Responsive/windowResizeObserver.js +8 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +9 -4
- package/lib/Ribbon/Ribbon.js +33 -13
- package/lib/Ribbon/Ribbon.module.css +45 -48
- package/lib/Ribbon/__tests__/Ribbon.spec.js +24 -14
- package/lib/Ribbon/props/propTypes.js +3 -0
- package/lib/RippleEffect/RippleEffect.js +18 -10
- package/lib/RippleEffect/__tests__/RippleEffect.spec.js +34 -22
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +229 -130
- package/lib/Select/Select.js +295 -211
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +102 -56
- package/lib/Select/SelectWithIcon.js +131 -76
- package/lib/Select/index.js +5 -0
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +10 -4
- package/lib/Stencils/Stencils.js +29 -10
- package/lib/Stencils/Stencils.module.css +11 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +22 -13
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +57 -34
- package/lib/Switch/Switch.module.css +23 -23
- package/lib/Switch/__tests__/Switch.spec.js +91 -72
- package/lib/Switch/props/propTypes.js +3 -0
- package/lib/Tab/Tab.js +40 -27
- package/lib/Tab/Tab.module.css +14 -14
- package/lib/Tab/TabContent.js +12 -5
- package/lib/Tab/TabContentWrapper.js +16 -8
- package/lib/Tab/TabWrapper.js +37 -19
- package/lib/Tab/Tabs.js +171 -91
- package/lib/Tab/Tabs.module.css +22 -22
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/propTypes.js +3 -0
- package/lib/Tag/Tag.js +72 -43
- package/lib/Tag/Tag.module.css +24 -25
- package/lib/Tag/props/propTypes.js +3 -0
- package/lib/TextBox/TextBox.js +86 -60
- package/lib/TextBox/TextBox.module.css +9 -9
- package/lib/TextBox/props/propTypes.js +6 -4
- package/lib/TextBoxIcon/TextBoxIcon.js +80 -53
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/lib/TextBoxIcon/props/propTypes.js +9 -4
- package/lib/Textarea/Textarea.js +54 -29
- package/lib/Textarea/Textarea.module.css +21 -21
- package/lib/Textarea/props/propTypes.js +3 -0
- package/lib/Tooltip/Tooltip.js +94 -31
- package/lib/Tooltip/Tooltip.module.css +5 -5
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +3 -0
- package/lib/common/animation.module.css +8 -8
- package/lib/common/avatarsizes.module.css +16 -16
- package/lib/common/basicReset.module.css +3 -3
- package/lib/common/common.module.css +24 -24
- package/lib/common/customscroll.module.css +2 -2
- package/lib/css.js +40 -0
- package/lib/deprecated/PortalLayer/PortalLayer.js +46 -23
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +58 -0
- package/lib/semantic/Button/Button.js +42 -22
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +2 -0
- package/lib/utils/Common.js +111 -18
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/constructFullName.js +13 -4
- package/lib/utils/datetime/common.js +34 -5
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +175 -59
- package/lib/utils/dummyFunction.js +2 -0
- package/lib/utils/getHTMLFontSize.js +1 -0
- package/lib/utils/getInitial.js +6 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/lib/v1/Accordion/Accordion.js +38 -19
- package/lib/v1/Accordion/AccordionItem.js +23 -13
- package/lib/v1/Accordion/index.js +3 -0
- package/lib/v1/Accordion/props/propTypes.js +3 -0
- package/lib/v1/Animation/Animation.js +24 -100
- package/lib/v1/Animation/props/propTypes.js +3 -0
- package/lib/v1/Animation/utils.js +94 -0
- package/lib/v1/AppContainer/AppContainer.js +46 -17
- package/lib/v1/AppContainer/props/propTypes.js +3 -0
- package/lib/v1/Avatar/Avatar.js +68 -32
- package/lib/v1/Avatar/props/propTypes.js +3 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +32 -24
- package/lib/v1/AvatarTeam/props/propTypes.js +3 -0
- package/lib/v1/Button/Button.js +32 -22
- package/lib/v1/Button/props/defaultProps.js +2 -0
- package/lib/v1/Button/props/propTypes.js +3 -0
- package/lib/v1/Buttongroup/Buttongroup.js +13 -5
- package/lib/v1/Buttongroup/props/propTypes.js +3 -0
- package/lib/v1/Card/Card.js +78 -44
- package/lib/v1/Card/index.js +4 -0
- package/lib/v1/Card/props/propTypes.js +3 -0
- package/lib/v1/CheckBox/CheckBox.js +52 -41
- package/lib/v1/CheckBox/props/propTypes.js +3 -0
- package/lib/v1/DateTime/CalendarView.js +89 -48
- package/lib/v1/DateTime/DateTime.js +246 -158
- package/lib/v1/DateTime/DateTimePopupFooter.js +33 -8
- package/lib/v1/DateTime/DateTimePopupHeader.js +49 -17
- package/lib/v1/DateTime/DateWidget.js +352 -251
- package/lib/v1/DateTime/DaysRow.js +28 -5
- package/lib/v1/DateTime/Time.js +75 -32
- package/lib/v1/DateTime/YearView.js +76 -27
- package/lib/v1/DateTime/index.js +2 -0
- package/lib/v1/DateTime/props/propTypes.js +11 -1
- package/lib/v1/DropBox/DropBox.js +45 -21
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +59 -38
- package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +3 -0
- package/lib/v1/DropBox/props/defaultProps.js +8 -4
- package/lib/v1/DropBox/props/propTypes.js +10 -4
- package/lib/v1/DropDown/DropDown.js +23 -3
- package/lib/v1/DropDown/DropDownHeading.js +20 -13
- package/lib/v1/DropDown/DropDownItem.js +26 -11
- package/lib/v1/DropDown/DropDownSearch.js +28 -16
- package/lib/v1/DropDown/DropDownSeparator.js +7 -1
- package/lib/v1/DropDown/props/propTypes.js +10 -4
- package/lib/v1/Heading/Heading.js +19 -14
- package/lib/v1/Heading/props/propTypes.js +3 -0
- package/lib/v1/Label/Label.js +22 -14
- package/lib/v1/Label/props/propTypes.js +3 -0
- package/lib/v1/Layout/Box.js +35 -15
- package/lib/v1/Layout/Container.js +33 -14
- package/lib/v1/Layout/index.js +3 -0
- package/lib/v1/Layout/props/propTypes.js +3 -0
- package/lib/v1/ListItem/ListContainer.js +55 -30
- package/lib/v1/ListItem/ListItem.js +53 -38
- package/lib/v1/ListItem/ListItemWithAvatar.js +62 -39
- package/lib/v1/ListItem/ListItemWithCheckBox.js +49 -34
- package/lib/v1/ListItem/ListItemWithIcon.js +52 -37
- package/lib/v1/ListItem/ListItemWithRadio.js +49 -35
- package/lib/v1/ListItem/index.js +7 -0
- package/lib/v1/ListItem/props/propTypes.js +6 -4
- package/lib/v1/Modal/Modal.js +46 -9
- package/lib/v1/Modal/props/propTypes.js +3 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +294 -168
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +202 -125
- package/lib/v1/MultiSelect/EmptyState.js +45 -24
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +14 -5
- package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +3 -0
- package/lib/v1/MultiSelect/MultiSelect.js +335 -216
- package/lib/v1/MultiSelect/MultiSelectHeader.js +29 -7
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +86 -43
- package/lib/v1/MultiSelect/SelectedOptions.js +43 -17
- package/lib/v1/MultiSelect/Suggestions.js +64 -32
- package/lib/v1/MultiSelect/index.js +5 -0
- package/lib/v1/MultiSelect/props/defaultProps.js +2 -0
- package/lib/v1/MultiSelect/props/propTypes.js +14 -4
- package/lib/v1/PopOver/PopOver.js +71 -40
- package/lib/v1/PopOver/props/propTypes.js +3 -0
- package/lib/v1/Popup/Popup.js +158 -81
- package/lib/v1/Provider/AvatarSize.js +4 -0
- package/lib/v1/Provider/Config.js +2 -0
- package/lib/v1/Provider/CssProvider.js +4 -0
- package/lib/v1/Provider/IdProvider.js +17 -6
- package/lib/v1/Provider/LibraryContext.js +35 -15
- package/lib/v1/Provider/LibraryContextInit.js +4 -0
- package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +44 -15
- package/lib/v1/Provider/ZindexProvider.js +15 -3
- package/lib/v1/Provider/index.js +5 -0
- package/lib/v1/Radio/Radio.js +42 -32
- package/lib/v1/Radio/props/propTypes.js +3 -0
- package/lib/v1/Responsive/CustomResponsive.js +73 -29
- package/lib/v1/Responsive/RefWrapper.js +17 -11
- package/lib/v1/Responsive/ResizeComponent.js +62 -36
- package/lib/v1/Responsive/ResizeObserver.js +24 -10
- package/lib/v1/Responsive/Responsive.js +80 -30
- package/lib/v1/Responsive/index.js +4 -0
- package/lib/v1/Responsive/props/propTypes.js +3 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +27 -13
- package/lib/v1/ResponsiveDropBox/props/propTypes.js +9 -4
- package/lib/v1/Ribbon/Ribbon.js +14 -7
- package/lib/v1/Ribbon/props/propTypes.js +3 -0
- package/lib/v1/RippleEffect/RippleEffect.js +17 -7
- package/lib/v1/RippleEffect/props/propTypes.js +3 -0
- package/lib/v1/Select/GroupSelect.js +229 -130
- package/lib/v1/Select/Select.js +297 -214
- package/lib/v1/Select/SelectWithAvatar.js +102 -56
- package/lib/v1/Select/SelectWithIcon.js +131 -76
- package/lib/v1/Select/index.js +5 -0
- package/lib/v1/Select/props/defaultProps.js +5 -4
- package/lib/v1/Select/props/propTypes.js +10 -4
- package/lib/v1/Stencils/Stencils.js +13 -3
- package/lib/v1/Stencils/props/propTypes.js +3 -0
- package/lib/v1/Switch/Switch.js +38 -25
- package/lib/v1/Switch/props/propTypes.js +3 -0
- package/lib/v1/Tab/Tab.js +40 -27
- package/lib/v1/Tab/TabContent.js +12 -5
- package/lib/v1/Tab/TabContentWrapper.js +16 -8
- package/lib/v1/Tab/TabWrapper.js +37 -19
- package/lib/v1/Tab/Tabs.js +170 -83
- package/lib/v1/Tab/index.js +6 -0
- package/lib/v1/Tab/props/propTypes.js +3 -0
- package/lib/v1/Tab/v1Tab.module.css +14 -14
- package/lib/v1/Tab/v1Tabs.module.css +22 -22
- package/lib/v1/Tag/Tag.js +50 -32
- package/lib/v1/Tag/props/propTypes.js +3 -0
- package/lib/v1/TextBox/TextBox.js +70 -47
- package/lib/v1/TextBox/props/propTypes.js +6 -4
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +80 -55
- package/lib/v1/TextBoxIcon/props/propTypes.js +9 -4
- package/lib/v1/Textarea/Textarea.js +45 -28
- package/lib/v1/Textarea/props/propTypes.js +3 -0
- package/lib/v1/Tooltip/Tooltip.js +94 -31
- package/lib/v1/Tooltip/props/propTypes.js +3 -0
- package/lib/v1/Typography/Typography.js +26 -15
- package/lib/v1/Typography/css/Typography.module.css +31 -31
- package/lib/v1/Typography/css/cssJSLogic.js +25 -20
- package/lib/v1/Typography/props/propTypes.js +3 -0
- package/lib/v1/Typography/utils/index.js +1 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +25 -12
- package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +38 -22
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/v1/semantic/Button/Button.js +24 -18
- package/lib/v1/semantic/Button/props/propTypes.js +3 -0
- package/lib/v1/semantic/index.js +2 -0
- package/package.json +2 -2
- package/result.json +1 -1
- package/.DS_Store +0 -0
|
@@ -1,65 +1,115 @@
|
|
|
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"] = 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 _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
17
|
+
|
|
12
18
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
19
|
+
|
|
13
20
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
21
|
+
|
|
14
22
|
var _Layout = require("../Layout");
|
|
23
|
+
|
|
15
24
|
var _DropDownHeading = _interopRequireDefault(require("../DropDown/DropDownHeading"));
|
|
25
|
+
|
|
16
26
|
var _MultiSelectHeader = _interopRequireDefault(require("../MultiSelect/MultiSelectHeader"));
|
|
27
|
+
|
|
17
28
|
var _SelectedOptions = _interopRequireDefault(require("../MultiSelect/SelectedOptions"));
|
|
29
|
+
|
|
18
30
|
var _Suggestions = _interopRequireDefault(require("../MultiSelect/Suggestions"));
|
|
31
|
+
|
|
19
32
|
var _EmptyState = _interopRequireDefault(require("../MultiSelect/EmptyState"));
|
|
33
|
+
|
|
20
34
|
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
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 _icons = require("@zohodesk/icons");
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
57
|
+
|
|
32
58
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
|
|
59
|
+
|
|
60
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
61
|
+
|
|
34
62
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
|
+
|
|
35
64
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
65
|
+
|
|
36
66
|
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."); }
|
|
67
|
+
|
|
37
68
|
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); }
|
|
69
|
+
|
|
38
70
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
71
|
+
|
|
39
72
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
40
|
-
|
|
41
|
-
function
|
|
73
|
+
|
|
74
|
+
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; }
|
|
75
|
+
|
|
76
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
77
|
+
|
|
42
78
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
-
|
|
79
|
+
|
|
80
|
+
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); } }
|
|
81
|
+
|
|
44
82
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
45
|
-
|
|
46
|
-
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); }
|
|
83
|
+
|
|
47
84
|
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); }
|
|
85
|
+
|
|
48
86
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
87
|
+
|
|
49
88
|
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); }; }
|
|
89
|
+
|
|
50
90
|
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); }
|
|
91
|
+
|
|
51
92
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
93
|
+
|
|
52
94
|
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; } }
|
|
95
|
+
|
|
53
96
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
97
|
+
|
|
54
98
|
/* eslint-disable react/forbid-component-props */
|
|
99
|
+
|
|
55
100
|
/* eslint-disable react/no-unused-prop-types */
|
|
56
101
|
var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
57
102
|
_inherits(AdvancedGroupMultiSelect, _React$Component);
|
|
103
|
+
|
|
58
104
|
var _super = _createSuper(AdvancedGroupMultiSelect);
|
|
105
|
+
|
|
59
106
|
function AdvancedGroupMultiSelect(props) {
|
|
60
107
|
var _this$state;
|
|
108
|
+
|
|
61
109
|
var _this;
|
|
110
|
+
|
|
62
111
|
_classCallCheck(this, AdvancedGroupMultiSelect);
|
|
112
|
+
|
|
63
113
|
_this = _super.call(this, props);
|
|
64
114
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
65
115
|
_this.objectConcat = (0, _dropDownUtils.makeObjectConcat)();
|
|
@@ -69,24 +119,29 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
69
119
|
_this.getOptionIdChange = (0, _dropDownUtils.makeGetOptionIdChange)();
|
|
70
120
|
_this.formatSelectedOptions = (0, _dropDownUtils.makeFormatOptions)();
|
|
71
121
|
var _props$searchDebounce = props.searchDebounceTime,
|
|
72
|
-
|
|
73
|
-
|
|
122
|
+
searchDebounceTime = _props$searchDebounce === void 0 ? 500 : _props$searchDebounce,
|
|
123
|
+
selectedGroupOptions = props.selectedGroupOptions;
|
|
124
|
+
|
|
74
125
|
var _this$handleGetGroupS = _this.handleGetGroupSelectOptions(props),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
126
|
+
revampedGroups = _this$handleGetGroupS.revampedGroups,
|
|
127
|
+
normalizedAllOptions = _this$handleGetGroupS.normalizedAllOptions,
|
|
128
|
+
normalizedFormatOptions = _this$handleGetGroupS.normalizedFormatOptions,
|
|
129
|
+
allOptionIds = _this$handleGetGroupS.allOptionIds,
|
|
130
|
+
groupIds = _this$handleGetGroupS.groupIds,
|
|
131
|
+
groupDetails = _this$handleGetGroupS.normalizedGroupedOptions;
|
|
132
|
+
|
|
81
133
|
var changedSelectedOptionDetails = _this.handleSelectedOptionDetailsIdChange(props, {
|
|
82
134
|
groupIds: groupIds,
|
|
83
135
|
groupDetails: groupDetails
|
|
84
136
|
});
|
|
137
|
+
|
|
85
138
|
var _this$handleGetSelect = _this.handleGetSelectedOptions(changedSelectedOptionDetails),
|
|
86
|
-
|
|
139
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions;
|
|
140
|
+
|
|
87
141
|
var _this$handleSelectedO = _this.handleSelectedOptionIdChange(selectedGroupOptions, normalizedFormatOptions, normalizedSelectedOptions),
|
|
88
|
-
|
|
89
|
-
|
|
142
|
+
formatSelectedOptions = _this$handleSelectedO.formatSelectedOptions,
|
|
143
|
+
selectedOptionIds = _this$handleSelectedO.selectedOptionIds;
|
|
144
|
+
|
|
90
145
|
_this.handleGetGroupSelectOptions = _this.handleGetGroupSelectOptions.bind(_assertThisInitialized(_this));
|
|
91
146
|
_this.selectedOptionContainerRef = _this.selectedOptionContainerRef.bind(_assertThisInitialized(_this));
|
|
92
147
|
_this.suggestionContainerRef = _this.suggestionContainerRef.bind(_assertThisInitialized(_this));
|
|
@@ -129,11 +184,13 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
129
184
|
_this._isMounted = false;
|
|
130
185
|
return _this;
|
|
131
186
|
}
|
|
187
|
+
|
|
132
188
|
_createClass(AdvancedGroupMultiSelect, [{
|
|
133
189
|
key: "handleGetSelectedOptions",
|
|
134
190
|
value: function handleGetSelectedOptions(selectedOptionDetails) {
|
|
135
191
|
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, this.props),
|
|
136
|
-
|
|
192
|
+
normalizedSelectedOptions = _this$handleFormatSel.normalizedFormatOptions;
|
|
193
|
+
|
|
137
194
|
return {
|
|
138
195
|
normalizedSelectedOptions: normalizedSelectedOptions
|
|
139
196
|
};
|
|
@@ -142,7 +199,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
142
199
|
key: "handleFormatSelectedOptions",
|
|
143
200
|
value: function handleFormatSelectedOptions(selectedOptionDetails, props) {
|
|
144
201
|
var valueField = props.valueField,
|
|
145
|
-
|
|
202
|
+
textField = props.textField;
|
|
146
203
|
return this.formatSelectedOptions({
|
|
147
204
|
options: selectedOptionDetails,
|
|
148
205
|
valueField: valueField,
|
|
@@ -153,16 +210,18 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
153
210
|
key: "handleSelectedOptionDetailsIdChange",
|
|
154
211
|
value: function handleSelectedOptionDetailsIdChange(props, state) {
|
|
155
212
|
var _this2 = this;
|
|
213
|
+
|
|
156
214
|
var groupIds = state.groupIds,
|
|
157
|
-
|
|
215
|
+
groupDetails = state.groupDetails;
|
|
158
216
|
var _props$selectedOption = props.selectedOptionDetails,
|
|
159
|
-
|
|
217
|
+
selectedOptionDetails = _props$selectedOption === void 0 ? {} : _props$selectedOption;
|
|
160
218
|
var newSelectedOptionDetails = [];
|
|
161
219
|
groupIds.forEach(function (groupId) {
|
|
162
220
|
var _groupDetails$groupId = groupDetails[groupId],
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
221
|
+
valueField = _groupDetails$groupId.valueField,
|
|
222
|
+
textField = _groupDetails$groupId.textField,
|
|
223
|
+
optionType = _groupDetails$groupId.optionType;
|
|
224
|
+
|
|
166
225
|
var changedDetails = _this2.getOptionIdChange({
|
|
167
226
|
options: selectedOptionDetails[groupId],
|
|
168
227
|
valueField: valueField,
|
|
@@ -170,6 +229,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
170
229
|
textField: textField,
|
|
171
230
|
optionType: optionType
|
|
172
231
|
});
|
|
232
|
+
|
|
173
233
|
newSelectedOptionDetails = [].concat(_toConsumableArray(newSelectedOptionDetails), _toConsumableArray(changedDetails));
|
|
174
234
|
});
|
|
175
235
|
return newSelectedOptionDetails;
|
|
@@ -222,34 +282,38 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
222
282
|
key: "togglePopup",
|
|
223
283
|
value: function togglePopup(e) {
|
|
224
284
|
var _this$props = this.props,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
285
|
+
togglePopup = _this$props.togglePopup,
|
|
286
|
+
defaultDropBoxPosition = _this$props.defaultDropBoxPosition,
|
|
287
|
+
isReadOnly = _this$props.isReadOnly;
|
|
228
288
|
!isReadOnly && togglePopup(e, defaultDropBoxPosition ? "".concat(defaultDropBoxPosition, "Center") : null);
|
|
229
289
|
}
|
|
230
290
|
}, {
|
|
231
291
|
key: "handleFilterSuggestions",
|
|
232
292
|
value: function handleFilterSuggestions() {
|
|
233
293
|
var _this$state2 = this.state,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
294
|
+
revampedGroups = _this$state2.revampedGroups,
|
|
295
|
+
_this$state2$searchSt = _this$state2.searchStr,
|
|
296
|
+
searchStr = _this$state2$searchSt === void 0 ? '' : _this$state2$searchSt,
|
|
297
|
+
allOptionIds = _this$state2.allOptionIds;
|
|
238
298
|
var needLocalSearch = this.props.needLocalSearch;
|
|
299
|
+
|
|
239
300
|
if (searchStr && searchStr.trim().length) {
|
|
240
301
|
searchStr = (0, _Common.getSearchString)(searchStr);
|
|
302
|
+
|
|
241
303
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
304
|
+
revampedGroups: revampedGroups,
|
|
305
|
+
searchStr: searchStr,
|
|
306
|
+
needSearch: needLocalSearch
|
|
307
|
+
}),
|
|
308
|
+
suggestionGroups = _this$getFilterSugges.suggestionGroups,
|
|
309
|
+
suggestionOptionIds = _this$getFilterSugges.suggestionOptionIds;
|
|
310
|
+
|
|
248
311
|
return {
|
|
249
312
|
suggestionGroups: suggestionGroups,
|
|
250
313
|
suggestionOptionIds: suggestionOptionIds
|
|
251
314
|
};
|
|
252
315
|
}
|
|
316
|
+
|
|
253
317
|
return {
|
|
254
318
|
suggestionGroups: revampedGroups,
|
|
255
319
|
suggestionOptionIds: allOptionIds
|
|
@@ -259,7 +323,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
259
323
|
key: "handleGetGroupSelectOptions",
|
|
260
324
|
value: function handleGetGroupSelectOptions(props) {
|
|
261
325
|
var _props$groupedOptions = props.groupedOptions,
|
|
262
|
-
|
|
326
|
+
groupedOptions = _props$groupedOptions === void 0 ? [] : _props$groupedOptions;
|
|
263
327
|
return this.getGroupSelectOptions({
|
|
264
328
|
groupedOptions: groupedOptions
|
|
265
329
|
});
|
|
@@ -281,19 +345,22 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
281
345
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
282
346
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
283
347
|
var _this$state3 = this.state,
|
|
284
|
-
|
|
285
|
-
|
|
348
|
+
highLightedSelectOptions = _this$state3.highLightedSelectOptions,
|
|
349
|
+
lastHighLightedSelectOption = _this$state3.lastHighLightedSelectOption;
|
|
286
350
|
var metaKey = e.metaKey,
|
|
287
|
-
|
|
288
|
-
|
|
351
|
+
ctrlKey = e.ctrlKey,
|
|
352
|
+
shiftKey = e.shiftKey;
|
|
353
|
+
|
|
289
354
|
if (e && shiftKey) {
|
|
290
355
|
//shift+click
|
|
291
356
|
var from = selectedOptionIds.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptionIds.indexOf(lastHighLightedSelectOption) : 0;
|
|
292
357
|
var to = id && selectedOptionIds.indexOf(id) >= 0 ? selectedOptionIds.indexOf(id) : null;
|
|
358
|
+
|
|
293
359
|
if (to >= 0 && to < from) {
|
|
294
360
|
var _ref = [from, from = to];
|
|
295
361
|
to = _ref[0];
|
|
296
362
|
}
|
|
363
|
+
|
|
297
364
|
to += 1;
|
|
298
365
|
var newSelectedHighlights = to ? selectedOptionIds.slice(from, to) : [];
|
|
299
366
|
to && this.setState({
|
|
@@ -304,6 +371,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
304
371
|
//ctrl+click
|
|
305
372
|
var isRemove = highLightedSelectOptions.indexOf(id) >= 0;
|
|
306
373
|
var _newSelectedHighlights = [];
|
|
374
|
+
|
|
307
375
|
if (isRemove) {
|
|
308
376
|
lastHighLightedSelectOption = id === lastHighLightedSelectOption ? '' : lastHighLightedSelectOption;
|
|
309
377
|
_newSelectedHighlights = highLightedSelectOptions.filter(function (option) {
|
|
@@ -313,6 +381,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
313
381
|
lastHighLightedSelectOption = id;
|
|
314
382
|
_newSelectedHighlights = [].concat(_toConsumableArray(highLightedSelectOptions), [id]);
|
|
315
383
|
}
|
|
384
|
+
|
|
316
385
|
this.setState({
|
|
317
386
|
highLightedSelectOptions: _newSelectedHighlights,
|
|
318
387
|
lastHighLightedSelectOption: lastHighLightedSelectOption
|
|
@@ -323,6 +392,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
323
392
|
lastHighLightedSelectOption: id
|
|
324
393
|
});
|
|
325
394
|
}
|
|
395
|
+
|
|
326
396
|
this.setState({
|
|
327
397
|
shiftKeyPressHighLighted: 0
|
|
328
398
|
});
|
|
@@ -337,9 +407,10 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
337
407
|
var isReadOnly = this.props.isReadOnly;
|
|
338
408
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
339
409
|
var _this$state4 = this.state,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
410
|
+
highLightedSelectOptions = _this$state4.highLightedSelectOptions,
|
|
411
|
+
lastHighLightedSelectOption = _this$state4.lastHighLightedSelectOption,
|
|
412
|
+
shiftKeyPressHighLighted = _this$state4.shiftKeyPressHighLighted;
|
|
413
|
+
|
|
343
414
|
if (newOptions.length && !isReadOnly) {
|
|
344
415
|
var newSelectedOptions = selectedOptionIds.filter(function (option) {
|
|
345
416
|
return newOptions.indexOf(option) === -1;
|
|
@@ -349,13 +420,16 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
349
420
|
});
|
|
350
421
|
var isHighlightedRemoved = false;
|
|
351
422
|
var newOptionsLen = newOptions.length;
|
|
423
|
+
|
|
352
424
|
for (var i = 0; i < newOptionsLen; i++) {
|
|
353
425
|
var removedOption = newOptions[i];
|
|
426
|
+
|
|
354
427
|
if (highLightedSelectOptions.indexOf(removedOption) >= 0) {
|
|
355
428
|
isHighlightedRemoved = true;
|
|
356
429
|
break;
|
|
357
430
|
}
|
|
358
431
|
}
|
|
432
|
+
|
|
359
433
|
this.setState({
|
|
360
434
|
lastHighLightedSelectOption: newSelectedOptions.indexOf(lastHighLightedSelectOption) >= 0 && !isHighlightedRemoved ? lastHighLightedSelectOption : '',
|
|
361
435
|
highLightedSelectOptions: isHighlightedRemoved ? [] : newHighLightedSelectOptions,
|
|
@@ -363,6 +437,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
363
437
|
});
|
|
364
438
|
this.handleChange(newSelectedOptions);
|
|
365
439
|
}
|
|
440
|
+
|
|
366
441
|
this.searchInput && this.searchInput.focus({
|
|
367
442
|
preventScroll: true
|
|
368
443
|
});
|
|
@@ -371,40 +446,48 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
371
446
|
key: "handleKeyDown",
|
|
372
447
|
value: function handleKeyDown(e) {
|
|
373
448
|
var keyCode = e.keyCode,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
449
|
+
ctrlKey = e.ctrlKey,
|
|
450
|
+
metaKey = e.metaKey,
|
|
451
|
+
shiftKey = e.shiftKey;
|
|
377
452
|
var suggestions = [];
|
|
378
453
|
var _this$state5 = this.state,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
454
|
+
hoverIndex = _this$state5.hoverIndex,
|
|
455
|
+
searchStr = _this$state5.searchStr,
|
|
456
|
+
highLightedSelectOptions = _this$state5.highLightedSelectOptions,
|
|
457
|
+
lastHighLightedSelectOption = _this$state5.lastHighLightedSelectOption,
|
|
458
|
+
shiftKeyPressHighLighted = _this$state5.shiftKeyPressHighLighted,
|
|
459
|
+
selectedOptions = _this$state5.selectedOptionIds;
|
|
385
460
|
var _this$props2 = this.props,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
461
|
+
isNextOptions = _this$props2.isNextOptions,
|
|
462
|
+
getNextOptions = _this$props2.getNextOptions,
|
|
463
|
+
isPopupOpen = _this$props2.isPopupOpen,
|
|
464
|
+
isPopupOpenOnEnter = _this$props2.isPopupOpenOnEnter,
|
|
465
|
+
onKeyDown = _this$props2.onKeyDown;
|
|
391
466
|
var highLightedSelectOptionsLen = highLightedSelectOptions.length;
|
|
467
|
+
|
|
392
468
|
if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13 || keyCode === 27)) {
|
|
393
469
|
var _this$handleFilterSug = this.handleFilterSuggestions(),
|
|
394
|
-
|
|
470
|
+
suggestionOptionIds = _this$handleFilterSug.suggestionOptionIds;
|
|
471
|
+
|
|
395
472
|
suggestions = suggestionOptionIds;
|
|
396
473
|
}
|
|
474
|
+
|
|
397
475
|
if (!isPopupOpen && !isPopupOpenOnEnter) {
|
|
398
476
|
onKeyDown && onKeyDown(e);
|
|
399
477
|
}
|
|
478
|
+
|
|
400
479
|
if (!isPopupOpen && keyCode === 40) {
|
|
401
480
|
//down arrow press popup open
|
|
402
481
|
e.preventDefault(); //prevent body scroll
|
|
482
|
+
|
|
403
483
|
this.togglePopup(e);
|
|
404
484
|
}
|
|
485
|
+
|
|
405
486
|
var suggestionsLen = suggestions.length;
|
|
487
|
+
|
|
406
488
|
if (suggestionsLen && isPopupOpen && keyCode === 38) {
|
|
407
489
|
//up arrow
|
|
490
|
+
|
|
408
491
|
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
409
492
|
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
410
493
|
}*/
|
|
@@ -415,6 +498,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
415
498
|
}
|
|
416
499
|
} else if (suggestionsLen && isPopupOpen && keyCode === 40) {
|
|
417
500
|
//down arrow
|
|
501
|
+
|
|
418
502
|
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
419
503
|
//disable last to first option higlight
|
|
420
504
|
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
@@ -439,8 +523,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
439
523
|
if (highLightedSelectOptionsLen) {
|
|
440
524
|
this.handleRemoveOption(highLightedSelectOptions);
|
|
441
525
|
} else {
|
|
442
|
-
this.handleRemoveOption(selectedOptions.slice(-1));
|
|
443
|
-
// this.setState({
|
|
526
|
+
this.handleRemoveOption(selectedOptions.slice(-1)); // this.setState({
|
|
444
527
|
// highLightedSelectOptions: selectedOptions.slice(-1)
|
|
445
528
|
// });
|
|
446
529
|
}
|
|
@@ -455,6 +538,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
455
538
|
var lastHighLightedSelectOptionIndex = lastHighLightedSelectOption && selectedOptions.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptions.indexOf(lastHighLightedSelectOption) : 0;
|
|
456
539
|
var newShiftKeyPressHighLighted = shiftKeyPressHighLighted ? shiftKeyPressHighLighted : shiftKeyPressHighLighted + 1;
|
|
457
540
|
var newHighLightedSelectOption = lastHighLightedSelectOptionIndex !== null ? selectedOptions[lastHighLightedSelectOptionIndex + newShiftKeyPressHighLighted] : selectedOptions[0];
|
|
541
|
+
|
|
458
542
|
if (!(0, _Common.getIsEmptyValue)(newHighLightedSelectOption)) {
|
|
459
543
|
var newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions[0];
|
|
460
544
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
@@ -471,15 +555,22 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
471
555
|
} else if (keyCode === 37 && shiftKey && selectedOptions.length && !searchStr.length) {
|
|
472
556
|
// shift+left arrow=37
|
|
473
557
|
var _lastHighLightedSelectOptionIndex = lastHighLightedSelectOption ? selectedOptions.indexOf(lastHighLightedSelectOption) : selectedOptions.length - 1;
|
|
558
|
+
|
|
474
559
|
var _newShiftKeyPressHighLighted = shiftKeyPressHighLighted !== 1 ? shiftKeyPressHighLighted : shiftKeyPressHighLighted - 1;
|
|
560
|
+
|
|
475
561
|
var _newHighLightedSelectOption = selectedOptions[_lastHighLightedSelectOptionIndex + _newShiftKeyPressHighLighted - 1];
|
|
562
|
+
|
|
476
563
|
if (!(0, _Common.getIsEmptyValue)(_newHighLightedSelectOption)) {
|
|
477
564
|
var _newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions.slice(-1)[0];
|
|
565
|
+
|
|
478
566
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [_newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
567
|
+
|
|
479
568
|
var _isRemove = highLightedSelectOptions.indexOf(_newHighLightedSelectOption) >= 0 && _newHighLightedSelectOption !== lastHighLightedSelectOption ? true : false;
|
|
569
|
+
|
|
480
570
|
var _newHighLightedSelectOptions = _isRemove ? highLightedSelectOptions.filter(function (option) {
|
|
481
571
|
return option !== _newHighLightedSelectOption;
|
|
482
572
|
}) : [].concat(_toConsumableArray(highLightedSelectOptions), [_newHighLightedSelectOption]);
|
|
573
|
+
|
|
483
574
|
this.setState({
|
|
484
575
|
highLightedSelectOptions: _newHighLightedSelectOptions,
|
|
485
576
|
shiftKeyPressHighLighted: _newShiftKeyPressHighLighted - 1,
|
|
@@ -487,16 +578,19 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
487
578
|
});
|
|
488
579
|
}
|
|
489
580
|
} else if ((keyCode === 39 || keyCode === 37) && selectedOptions.length && !searchStr.length) {
|
|
490
|
-
var isRightArrow = keyCode === 39 ? true : false;
|
|
491
|
-
|
|
581
|
+
var isRightArrow = keyCode === 39 ? true : false; // let isLefttArrow = keyCode === 37 ? true : false;
|
|
582
|
+
|
|
492
583
|
if (highLightedSelectOptions.length) {
|
|
493
584
|
var _highLightedSelectOpt = highLightedSelectOptions.slice(-1),
|
|
494
|
-
|
|
495
|
-
|
|
585
|
+
_highLightedSelectOpt2 = _slicedToArray(_highLightedSelectOpt, 1),
|
|
586
|
+
_lastHighLightedSelectOption = _highLightedSelectOpt2[0];
|
|
587
|
+
|
|
496
588
|
var _lastHighLightedSelectOptionIndex2 = selectedOptions.indexOf(_lastHighLightedSelectOption);
|
|
589
|
+
|
|
497
590
|
var newLastHighLightedSelectOptionIndex = isRightArrow ? _lastHighLightedSelectOptionIndex2 === selectedOptions.length - 1 ? _lastHighLightedSelectOptionIndex2 : _lastHighLightedSelectOptionIndex2 + 1 : _lastHighLightedSelectOptionIndex2 - 1;
|
|
498
591
|
var _newLastHighLightedSelectOption2 = selectedOptions[newLastHighLightedSelectOptionIndex];
|
|
499
592
|
var isEmptyHighlighted = isRightArrow && highLightedSelectOptions.length === 1 && selectedOptions.slice(-1)[0] === _lastHighLightedSelectOption ? true : false;
|
|
593
|
+
|
|
500
594
|
if (!(0, _Common.getIsEmptyValue)(_newLastHighLightedSelectOption2)) {
|
|
501
595
|
this.setState({
|
|
502
596
|
lastHighLightedSelectOption: isEmptyHighlighted ? '' : _newLastHighLightedSelectOption2,
|
|
@@ -506,16 +600,16 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
506
600
|
}
|
|
507
601
|
} else {
|
|
508
602
|
var _ref2 = isRightArrow ? selectedOptions : selectedOptions.slice(-1),
|
|
509
|
-
|
|
510
|
-
|
|
603
|
+
_ref3 = _slicedToArray(_ref2, 1),
|
|
604
|
+
_newLastHighLightedSelectOption3 = _ref3[0];
|
|
605
|
+
|
|
511
606
|
this.setState({
|
|
512
607
|
lastHighLightedSelectOption: _newLastHighLightedSelectOption3,
|
|
513
608
|
highLightedSelectOptions: [_newLastHighLightedSelectOption3],
|
|
514
609
|
shiftKeyPressHighLighted: 0
|
|
515
610
|
});
|
|
516
611
|
}
|
|
517
|
-
} else if (keyCode === 27) {
|
|
518
|
-
// this.handlePopupClose(e);
|
|
612
|
+
} else if (keyCode === 27) {// this.handlePopupClose(e);
|
|
519
613
|
}
|
|
520
614
|
}
|
|
521
615
|
}, {
|
|
@@ -523,8 +617,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
523
617
|
value: function handleMouseEnter(id, val, hoverOptionIndex, e) {
|
|
524
618
|
e && e.preventDefault();
|
|
525
619
|
var _this$state6 = this.state,
|
|
526
|
-
|
|
527
|
-
|
|
620
|
+
hoverIndex = _this$state6.hoverIndex,
|
|
621
|
+
allOptionIds = _this$state6.allOptionIds;
|
|
528
622
|
var newHoverIndex = allOptionIds.indexOf(id);
|
|
529
623
|
hoverIndex !== newHoverIndex && this.setState({
|
|
530
624
|
hoverIndex: newHoverIndex
|
|
@@ -534,17 +628,21 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
534
628
|
key: "handleFetchOptions",
|
|
535
629
|
value: function handleFetchOptions() {
|
|
536
630
|
var _this3 = this;
|
|
631
|
+
|
|
537
632
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
538
633
|
args[_key] = arguments[_key];
|
|
539
634
|
}
|
|
635
|
+
|
|
540
636
|
var APICall = args[0],
|
|
541
|
-
|
|
637
|
+
searchStr = args[1];
|
|
542
638
|
var isFetchingOptions = this.state.isFetchingOptions;
|
|
543
639
|
var _isMounted = this._isMounted;
|
|
640
|
+
|
|
544
641
|
if (!isFetchingOptions && APICall) {
|
|
545
642
|
this.setState({
|
|
546
643
|
isFetchingOptions: true
|
|
547
644
|
});
|
|
645
|
+
|
|
548
646
|
try {
|
|
549
647
|
return APICall(searchStr).then(function () {
|
|
550
648
|
_isMounted && _this3.setState({
|
|
@@ -573,12 +671,13 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
573
671
|
key: "handleSearch",
|
|
574
672
|
value: function handleSearch(value, e) {
|
|
575
673
|
var _this4 = this;
|
|
674
|
+
|
|
576
675
|
var _this$props3 = this.props,
|
|
577
|
-
|
|
578
|
-
|
|
676
|
+
onSearch = _this$props3.onSearch,
|
|
677
|
+
isPopupOpen = _this$props3.isPopupOpen;
|
|
579
678
|
!isPopupOpen && e && this.togglePopup(e);
|
|
580
679
|
var _this$state$searchStr = this.state.searchStr,
|
|
581
|
-
|
|
680
|
+
searchStr = _this$state$searchStr === void 0 ? '' : _this$state$searchStr;
|
|
582
681
|
var searchStrRegex = (0, _Common.getSearchString)(searchStr);
|
|
583
682
|
var valueStrRegex = (0, _Common.getSearchString)(value);
|
|
584
683
|
var isSearch = searchStrRegex !== valueStrRegex ? true : false;
|
|
@@ -596,6 +695,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
596
695
|
key: "handleScroll",
|
|
597
696
|
value: function handleScroll(e) {
|
|
598
697
|
var isNextOptions = this.props.isNextOptions;
|
|
698
|
+
|
|
599
699
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1 && isNextOptions) {
|
|
600
700
|
this.handleScrollFuncCall();
|
|
601
701
|
}
|
|
@@ -611,8 +711,10 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
611
711
|
key: "handleSelectAll",
|
|
612
712
|
value: function handleSelectAll(e) {
|
|
613
713
|
e && e.preventDefault();
|
|
714
|
+
|
|
614
715
|
var _this$handleFilterSug2 = this.handleFilterSuggestions(),
|
|
615
|
-
|
|
716
|
+
suggestionOptionIds = _this$handleFilterSug2.suggestionOptionIds;
|
|
717
|
+
|
|
616
718
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
617
719
|
var newSelectedOptions = suggestionOptionIds.filter(function (id) {
|
|
618
720
|
return selectedOptionIds.indexOf(id) === -1;
|
|
@@ -624,12 +726,14 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
624
726
|
value: function handleDeselectAll(e) {
|
|
625
727
|
e && e.preventDefault();
|
|
626
728
|
var highLightedSelectOptions = this.state.highLightedSelectOptions;
|
|
729
|
+
|
|
627
730
|
if (highLightedSelectOptions.length) {
|
|
628
731
|
this.setState({
|
|
629
732
|
highLightedSelectOptions: [],
|
|
630
733
|
lastHighLightedSelectOption: ''
|
|
631
734
|
});
|
|
632
735
|
}
|
|
736
|
+
|
|
633
737
|
this.handleChange([]);
|
|
634
738
|
}
|
|
635
739
|
}, {
|
|
@@ -638,21 +742,24 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
638
742
|
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
639
743
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
640
744
|
var _this$props4 = this.props,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
745
|
+
onChange = _this$props4.onChange,
|
|
746
|
+
needToCloseOnSelect = _this$props4.needToCloseOnSelect,
|
|
747
|
+
togglePopup = _this$props4.togglePopup,
|
|
748
|
+
isSearchClearOnSelect = _this$props4.isSearchClearOnSelect;
|
|
645
749
|
var searchStr = this.state.searchStr;
|
|
646
750
|
var newSelectedOptions = selectedOptions.map(function (option) {
|
|
647
751
|
return (0, _dropDownUtils.extractOptionId)(option);
|
|
648
752
|
});
|
|
649
753
|
onChange(_toConsumableArray(newSelectedOptions));
|
|
754
|
+
|
|
650
755
|
if (searchStr.trim() != '' && isSearchClearOnSelect) {
|
|
651
756
|
this.handleSearch('');
|
|
652
757
|
}
|
|
758
|
+
|
|
653
759
|
this.searchInput && this.searchInput.focus({
|
|
654
760
|
preventScroll: true
|
|
655
761
|
});
|
|
762
|
+
|
|
656
763
|
if (needToCloseOnSelect) {
|
|
657
764
|
e && togglePopup(e);
|
|
658
765
|
}
|
|
@@ -662,6 +769,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
662
769
|
value: function handleSelectOption(id, val, index, e) {
|
|
663
770
|
e && e.preventDefault();
|
|
664
771
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
772
|
+
|
|
665
773
|
if (selectedOptionIds.indexOf(id) === -1) {
|
|
666
774
|
this.handleChange([].concat(_toConsumableArray(selectedOptionIds), [id]), e);
|
|
667
775
|
} else {
|
|
@@ -672,15 +780,18 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
672
780
|
key: "handleActive",
|
|
673
781
|
value: function handleActive(e) {
|
|
674
782
|
var _this$state7 = this.state,
|
|
675
|
-
|
|
676
|
-
|
|
783
|
+
searchStr = _this$state7.searchStr,
|
|
784
|
+
isActive = _this$state7.isActive;
|
|
785
|
+
|
|
677
786
|
if (!isActive) {
|
|
678
787
|
this.setState({
|
|
679
788
|
isActive: true
|
|
680
789
|
});
|
|
681
790
|
}
|
|
791
|
+
|
|
682
792
|
var _ref4 = e || {},
|
|
683
|
-
|
|
793
|
+
target = _ref4.target;
|
|
794
|
+
|
|
684
795
|
target && target.setSelectionRange(target, 0);
|
|
685
796
|
var onFocus = this.props.onFocus;
|
|
686
797
|
onFocus && onFocus(searchStr);
|
|
@@ -689,6 +800,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
689
800
|
key: "handleInactive",
|
|
690
801
|
value: function handleInactive() {
|
|
691
802
|
var isActive = this.state.isActive;
|
|
803
|
+
|
|
692
804
|
if (isActive) {
|
|
693
805
|
this.setState({
|
|
694
806
|
isActive: false
|
|
@@ -699,8 +811,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
699
811
|
key: "handleInputFocus",
|
|
700
812
|
value: function handleInputFocus() {
|
|
701
813
|
var _this$props5 = this.props,
|
|
702
|
-
|
|
703
|
-
|
|
814
|
+
isDisabled = _this$props5.isDisabled,
|
|
815
|
+
isReadOnly = _this$props5.isReadOnly;
|
|
704
816
|
this.searchInput && !isDisabled && !isReadOnly && this.searchInput.focus({
|
|
705
817
|
preventScroll: true
|
|
706
818
|
});
|
|
@@ -719,24 +831,26 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
719
831
|
key: "componentDidUpdate",
|
|
720
832
|
value: function componentDidUpdate(prevProps) {
|
|
721
833
|
var _this$props6 = this.props,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
834
|
+
groupedOptions = _this$props6.groupedOptions,
|
|
835
|
+
selectedGroupOptions = _this$props6.selectedGroupOptions,
|
|
836
|
+
isPopupOpen = _this$props6.isPopupOpen,
|
|
837
|
+
selectedOptionDetails = _this$props6.selectedOptionDetails,
|
|
838
|
+
searchStr = _this$props6.searchStr,
|
|
839
|
+
notifyPopupToggle = _this$props6.notifyPopupToggle;
|
|
728
840
|
var _this$state8 = this.state,
|
|
729
|
-
|
|
730
|
-
|
|
841
|
+
normalizedFormatOptions = _this$state8.normalizedFormatOptions,
|
|
842
|
+
hoverIndex = _this$state8.hoverIndex;
|
|
731
843
|
var newOptionIds = this.state.allOptionIds;
|
|
844
|
+
|
|
732
845
|
if (prevProps.groupedOptions != groupedOptions) {
|
|
733
846
|
var _this$handleGetGroupS2 = this.handleGetGroupSelectOptions(this.props),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
847
|
+
revampedGroups = _this$handleGetGroupS2.revampedGroups,
|
|
848
|
+
normalizedAllOptions = _this$handleGetGroupS2.normalizedAllOptions,
|
|
849
|
+
formatNoramlizer = _this$handleGetGroupS2.normalizedFormatOptions,
|
|
850
|
+
allOptionIds = _this$handleGetGroupS2.allOptionIds,
|
|
851
|
+
groupIds = _this$handleGetGroupS2.groupIds,
|
|
852
|
+
normalizedGroupedOptions = _this$handleGetGroupS2.normalizedGroupedOptions;
|
|
853
|
+
|
|
740
854
|
normalizedFormatOptions = formatNoramlizer;
|
|
741
855
|
newOptionIds = allOptionIds;
|
|
742
856
|
this.setState({
|
|
@@ -748,39 +862,47 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
748
862
|
groupDetails: normalizedGroupedOptions
|
|
749
863
|
});
|
|
750
864
|
}
|
|
865
|
+
|
|
751
866
|
if (prevProps.selectedOptionDetails != selectedOptionDetails || prevProps.selectedGroupOptions != selectedGroupOptions) {
|
|
752
867
|
var _this$state9 = this.state,
|
|
753
|
-
|
|
754
|
-
|
|
868
|
+
groupDetails = _this$state9.groupDetails,
|
|
869
|
+
_groupIds = _this$state9.groupIds;
|
|
755
870
|
var changedSelectedOptionDetails = this.handleSelectedOptionDetailsIdChange(this.props, {
|
|
756
871
|
groupIds: _groupIds,
|
|
757
872
|
groupDetails: groupDetails
|
|
758
873
|
});
|
|
874
|
+
|
|
759
875
|
var _this$handleGetSelect2 = this.handleGetSelectedOptions(changedSelectedOptionDetails),
|
|
760
|
-
|
|
876
|
+
normalizedSelectedOptions = _this$handleGetSelect2.normalizedSelectedOptions;
|
|
877
|
+
|
|
761
878
|
var _this$handleSelectedO2 = this.handleSelectedOptionIdChange(selectedGroupOptions, normalizedFormatOptions, normalizedSelectedOptions),
|
|
762
|
-
|
|
763
|
-
|
|
879
|
+
formatSelectedOptions = _this$handleSelectedO2.formatSelectedOptions,
|
|
880
|
+
selectedOptionIds = _this$handleSelectedO2.selectedOptionIds;
|
|
881
|
+
|
|
764
882
|
this.setState({
|
|
765
883
|
formatSelectedOptions: formatSelectedOptions,
|
|
766
884
|
selectedOptionIds: selectedOptionIds
|
|
767
885
|
});
|
|
768
886
|
}
|
|
887
|
+
|
|
769
888
|
var hoverId = (0, _Common.getIsEmptyValue)(newOptionIds[hoverIndex]) ? '' : newOptionIds[hoverIndex];
|
|
770
889
|
var selSuggestion = this["suggestion_".concat(hoverId)];
|
|
771
|
-
isPopupOpen && (0, _Common.scrollTo)(this.suggestionContainer, selSuggestion);
|
|
890
|
+
isPopupOpen && (0, _Common.scrollTo)(this.suggestionContainer, selSuggestion); //When suggestions length less than 5, getNextOptions function call
|
|
772
891
|
|
|
773
|
-
//When suggestions length less than 5, getNextOptions function call
|
|
774
892
|
var _this$props7 = this.props,
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
893
|
+
isNextOptions = _this$props7.isNextOptions,
|
|
894
|
+
getNextOptions = _this$props7.getNextOptions,
|
|
895
|
+
needLocalSearch = _this$props7.needLocalSearch;
|
|
896
|
+
|
|
778
897
|
var _this$handleFilterSug3 = this.handleFilterSuggestions(),
|
|
779
|
-
|
|
898
|
+
suggestions = _this$handleFilterSug3.suggestionOptionIds;
|
|
899
|
+
|
|
780
900
|
var suggestionsLen = suggestions.length;
|
|
901
|
+
|
|
781
902
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
782
903
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
783
904
|
}
|
|
905
|
+
|
|
784
906
|
if (prevProps.isPopupOpen != isPopupOpen) {
|
|
785
907
|
notifyPopupToggle && notifyPopupToggle(isPopupOpen);
|
|
786
908
|
}
|
|
@@ -799,67 +921,70 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
799
921
|
key: "render",
|
|
800
922
|
value: function render() {
|
|
801
923
|
var _this5 = this;
|
|
924
|
+
|
|
802
925
|
var _this$props8 = this.props,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
926
|
+
size = _this$props8.size,
|
|
927
|
+
textBoxSize = _this$props8.textBoxSize,
|
|
928
|
+
selectedGroupOptions = _this$props8.selectedGroupOptions,
|
|
929
|
+
placeHolder = _this$props8.placeHolder,
|
|
930
|
+
dataId = _this$props8.dataId,
|
|
931
|
+
dataSelectorId = _this$props8.dataSelectorId,
|
|
932
|
+
isReadOnly = _this$props8.isReadOnly,
|
|
933
|
+
isDisabled = _this$props8.isDisabled,
|
|
934
|
+
isPopupOpen = _this$props8.isPopupOpen,
|
|
935
|
+
isPopupReady = _this$props8.isPopupReady,
|
|
936
|
+
defaultDropBoxPosition = _this$props8.defaultDropBoxPosition,
|
|
937
|
+
removeClose = _this$props8.removeClose,
|
|
938
|
+
needResponsive = _this$props8.needResponsive,
|
|
939
|
+
animationStyle = _this$props8.animationStyle,
|
|
940
|
+
needSelectAll = _this$props8.needSelectAll,
|
|
941
|
+
selectAllText = _this$props8.selectAllText,
|
|
942
|
+
dropBoxSize = _this$props8.dropBoxSize,
|
|
943
|
+
position = _this$props8.position,
|
|
944
|
+
getContainerRef = _this$props8.getContainerRef,
|
|
945
|
+
emptyMessage = _this$props8.emptyMessage,
|
|
946
|
+
searchEmptyMessage = _this$props8.searchEmptyMessage,
|
|
947
|
+
title = _this$props8.title,
|
|
948
|
+
variant = _this$props8.variant,
|
|
949
|
+
children = _this$props8.children,
|
|
950
|
+
listItemSize = _this$props8.listItemSize,
|
|
951
|
+
isDataLoaded = _this$props8.isDataLoaded,
|
|
952
|
+
needBorder = _this$props8.needBorder,
|
|
953
|
+
isNextOptions = _this$props8.isNextOptions,
|
|
954
|
+
getFooter = _this$props8.getFooter,
|
|
955
|
+
customClass = _this$props8.customClass,
|
|
956
|
+
borderColor = _this$props8.borderColor,
|
|
957
|
+
isPadding = _this$props8.isPadding,
|
|
958
|
+
htmlId = _this$props8.htmlId,
|
|
959
|
+
i18nKeys = _this$props8.i18nKeys,
|
|
960
|
+
a11y = _this$props8.a11y,
|
|
961
|
+
palette = _this$props8.palette,
|
|
962
|
+
needEffect = _this$props8.needEffect,
|
|
963
|
+
autoComplete = _this$props8.autoComplete;
|
|
841
964
|
var _i18nKeys = i18nKeys,
|
|
842
|
-
|
|
843
|
-
|
|
965
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
966
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
844
967
|
var _a11y$clearLabel = a11y.clearLabel,
|
|
845
|
-
|
|
968
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
846
969
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
847
970
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
848
971
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
849
972
|
});
|
|
850
973
|
var _this$state10 = this.state,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
974
|
+
isActive = _this$state10.isActive,
|
|
975
|
+
searchStr = _this$state10.searchStr,
|
|
976
|
+
_this$state10$revampe = _this$state10.revampedGroups,
|
|
977
|
+
revampedGroups = _this$state10$revampe === void 0 ? [] : _this$state10$revampe,
|
|
978
|
+
selectedOptionIds = _this$state10.selectedOptionIds,
|
|
979
|
+
formatSelectedOptions = _this$state10.formatSelectedOptions,
|
|
980
|
+
hoverIndex = _this$state10.hoverIndex,
|
|
981
|
+
highLightedSelectOptions = _this$state10.highLightedSelectOptions,
|
|
982
|
+
isFetchingOptions = _this$state10.isFetchingOptions;
|
|
983
|
+
|
|
860
984
|
var _this$handleFilterSug4 = this.handleFilterSuggestions(),
|
|
861
|
-
|
|
862
|
-
|
|
985
|
+
suggestionGroups = _this$handleFilterSug4.suggestionGroups,
|
|
986
|
+
suggestionOptionIds = _this$handleFilterSug4.suggestionOptionIds;
|
|
987
|
+
|
|
863
988
|
var setAriaId = this.getNextAriaId();
|
|
864
989
|
var ariaErrorId = this.getNextAriaId();
|
|
865
990
|
var isShowClearIcon = !isReadOnly && !isDisabled && selectedGroupOptions.length > 1;
|
|
@@ -978,7 +1103,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
978
1103
|
key: 'SuggestonsParent'
|
|
979
1104
|
}, suggestionGroups.length ? suggestionGroups.map(function (group) {
|
|
980
1105
|
var _group$options = group.options,
|
|
981
|
-
|
|
1106
|
+
suggestions = _group$options === void 0 ? [] : _group$options;
|
|
982
1107
|
var groupId = group.id;
|
|
983
1108
|
var groupName = group.name;
|
|
984
1109
|
var hoverId = suggestionOptionIds[hoverIndex];
|
|
@@ -1022,18 +1147,20 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1022
1147
|
}) : null);
|
|
1023
1148
|
}
|
|
1024
1149
|
}]);
|
|
1150
|
+
|
|
1025
1151
|
return AdvancedGroupMultiSelect;
|
|
1026
1152
|
}(_react["default"].Component);
|
|
1153
|
+
|
|
1027
1154
|
AdvancedGroupMultiSelect.defaultProps = _defaultProps.AdvancedGroupMultiSelect_defaultProps;
|
|
1028
1155
|
AdvancedGroupMultiSelect.propTypes = _propTypes.AdvancedGroupMultiSelect_propTypes;
|
|
1029
1156
|
var AdvancedGroupMultiSelectComponent = (0, _Popup["default"])(AdvancedGroupMultiSelect);
|
|
1030
1157
|
AdvancedGroupMultiSelectComponent.defaultProps = AdvancedGroupMultiSelect.defaultProps;
|
|
1031
|
-
AdvancedGroupMultiSelectComponent.propTypes = AdvancedGroupMultiSelect.propTypes;
|
|
1032
|
-
// if (__DOCS__) {
|
|
1158
|
+
AdvancedGroupMultiSelectComponent.propTypes = AdvancedGroupMultiSelect.propTypes; // if (__DOCS__) {
|
|
1033
1159
|
// AdvancedGroupMultiSelect.docs = {
|
|
1034
1160
|
// componentGroup: 'Form Elements',
|
|
1035
1161
|
// folderName: 'Style Guide'
|
|
1036
1162
|
// };
|
|
1037
1163
|
// }
|
|
1164
|
+
|
|
1038
1165
|
var _default = AdvancedGroupMultiSelectComponent;
|
|
1039
1166
|
exports["default"] = _default;
|