@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("./MultiSelectHeader"));
|
|
27
|
+
|
|
17
28
|
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
29
|
+
|
|
18
30
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
31
|
+
|
|
19
32
|
var _EmptyState = _interopRequireDefault(require("./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/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,18 +600,17 @@ 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
|
-
}
|
|
518
|
-
//
|
|
519
|
-
else if (keyCode === 27) {
|
|
520
|
-
// this.handlePopupClose(e);
|
|
612
|
+
} // eslint-disable-next-line
|
|
613
|
+
else if (keyCode === 27) {// this.handlePopupClose(e);
|
|
521
614
|
}
|
|
522
615
|
}
|
|
523
616
|
}, {
|
|
@@ -525,8 +618,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
525
618
|
value: function handleMouseEnter(id, val, hoverOptionIndex, e) {
|
|
526
619
|
e && e.preventDefault();
|
|
527
620
|
var _this$state6 = this.state,
|
|
528
|
-
|
|
529
|
-
|
|
621
|
+
hoverIndex = _this$state6.hoverIndex,
|
|
622
|
+
allOptionIds = _this$state6.allOptionIds;
|
|
530
623
|
var newHoverIndex = allOptionIds.indexOf(id);
|
|
531
624
|
hoverIndex !== newHoverIndex && this.setState({
|
|
532
625
|
hoverIndex: newHoverIndex
|
|
@@ -536,17 +629,21 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
536
629
|
key: "handleFetchOptions",
|
|
537
630
|
value: function handleFetchOptions() {
|
|
538
631
|
var _this3 = this;
|
|
632
|
+
|
|
539
633
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
540
634
|
args[_key] = arguments[_key];
|
|
541
635
|
}
|
|
636
|
+
|
|
542
637
|
var APICall = args[0],
|
|
543
|
-
|
|
638
|
+
searchStr = args[1];
|
|
544
639
|
var isFetchingOptions = this.state.isFetchingOptions;
|
|
545
640
|
var _isMounted = this._isMounted;
|
|
641
|
+
|
|
546
642
|
if (!isFetchingOptions && APICall) {
|
|
547
643
|
this.setState({
|
|
548
644
|
isFetchingOptions: true
|
|
549
645
|
});
|
|
646
|
+
|
|
550
647
|
try {
|
|
551
648
|
return APICall(searchStr).then(function () {
|
|
552
649
|
_isMounted && _this3.setState({
|
|
@@ -575,12 +672,13 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
575
672
|
key: "handleSearch",
|
|
576
673
|
value: function handleSearch(value, e) {
|
|
577
674
|
var _this4 = this;
|
|
675
|
+
|
|
578
676
|
var _this$props3 = this.props,
|
|
579
|
-
|
|
580
|
-
|
|
677
|
+
onSearch = _this$props3.onSearch,
|
|
678
|
+
isPopupOpen = _this$props3.isPopupOpen;
|
|
581
679
|
!isPopupOpen && e && this.togglePopup(e);
|
|
582
680
|
var _this$state$searchStr = this.state.searchStr,
|
|
583
|
-
|
|
681
|
+
searchStr = _this$state$searchStr === void 0 ? '' : _this$state$searchStr;
|
|
584
682
|
var searchStrRegex = (0, _Common.getSearchString)(searchStr);
|
|
585
683
|
var valueStrRegex = (0, _Common.getSearchString)(value);
|
|
586
684
|
var isSearch = searchStrRegex !== valueStrRegex ? true : false;
|
|
@@ -598,6 +696,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
598
696
|
key: "handleScroll",
|
|
599
697
|
value: function handleScroll(e) {
|
|
600
698
|
var isNextOptions = this.props.isNextOptions;
|
|
699
|
+
|
|
601
700
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1 && isNextOptions) {
|
|
602
701
|
this.handleScrollFuncCall();
|
|
603
702
|
}
|
|
@@ -613,8 +712,10 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
613
712
|
key: "handleSelectAll",
|
|
614
713
|
value: function handleSelectAll(e) {
|
|
615
714
|
e && e.preventDefault();
|
|
715
|
+
|
|
616
716
|
var _this$handleFilterSug2 = this.handleFilterSuggestions(),
|
|
617
|
-
|
|
717
|
+
suggestionOptionIds = _this$handleFilterSug2.suggestionOptionIds;
|
|
718
|
+
|
|
618
719
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
619
720
|
var newSelectedOptions = suggestionOptionIds.filter(function (id) {
|
|
620
721
|
return selectedOptionIds.indexOf(id) === -1;
|
|
@@ -626,12 +727,14 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
626
727
|
value: function handleDeselectAll(e) {
|
|
627
728
|
e && e.preventDefault();
|
|
628
729
|
var highLightedSelectOptions = this.state.highLightedSelectOptions;
|
|
730
|
+
|
|
629
731
|
if (highLightedSelectOptions.length) {
|
|
630
732
|
this.setState({
|
|
631
733
|
highLightedSelectOptions: [],
|
|
632
734
|
lastHighLightedSelectOption: ''
|
|
633
735
|
});
|
|
634
736
|
}
|
|
737
|
+
|
|
635
738
|
this.handleChange([]);
|
|
636
739
|
}
|
|
637
740
|
}, {
|
|
@@ -640,21 +743,24 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
640
743
|
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
641
744
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
642
745
|
var _this$props4 = this.props,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
746
|
+
onChange = _this$props4.onChange,
|
|
747
|
+
needToCloseOnSelect = _this$props4.needToCloseOnSelect,
|
|
748
|
+
togglePopup = _this$props4.togglePopup,
|
|
749
|
+
isSearchClearOnSelect = _this$props4.isSearchClearOnSelect;
|
|
647
750
|
var searchStr = this.state.searchStr;
|
|
648
751
|
var newSelectedOptions = selectedOptions.map(function (option) {
|
|
649
752
|
return (0, _dropDownUtils.extractOptionId)(option);
|
|
650
753
|
});
|
|
651
754
|
onChange(_toConsumableArray(newSelectedOptions));
|
|
755
|
+
|
|
652
756
|
if (searchStr.trim() != '' && isSearchClearOnSelect) {
|
|
653
757
|
this.handleSearch('');
|
|
654
758
|
}
|
|
759
|
+
|
|
655
760
|
this.searchInput && this.searchInput.focus({
|
|
656
761
|
preventScroll: true
|
|
657
762
|
});
|
|
763
|
+
|
|
658
764
|
if (needToCloseOnSelect) {
|
|
659
765
|
e && togglePopup(e);
|
|
660
766
|
}
|
|
@@ -664,6 +770,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
664
770
|
value: function handleSelectOption(id, val, index, e) {
|
|
665
771
|
e && e.preventDefault();
|
|
666
772
|
var selectedOptionIds = this.state.selectedOptionIds;
|
|
773
|
+
|
|
667
774
|
if (selectedOptionIds.indexOf(id) === -1) {
|
|
668
775
|
this.handleChange([].concat(_toConsumableArray(selectedOptionIds), [id]), e);
|
|
669
776
|
} else {
|
|
@@ -674,15 +781,18 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
674
781
|
key: "handleActive",
|
|
675
782
|
value: function handleActive(e) {
|
|
676
783
|
var _this$state7 = this.state,
|
|
677
|
-
|
|
678
|
-
|
|
784
|
+
searchStr = _this$state7.searchStr,
|
|
785
|
+
isActive = _this$state7.isActive;
|
|
786
|
+
|
|
679
787
|
if (!isActive) {
|
|
680
788
|
this.setState({
|
|
681
789
|
isActive: true
|
|
682
790
|
});
|
|
683
791
|
}
|
|
792
|
+
|
|
684
793
|
var _ref4 = e || {},
|
|
685
|
-
|
|
794
|
+
target = _ref4.target;
|
|
795
|
+
|
|
686
796
|
target && target.setSelectionRange(target, 0);
|
|
687
797
|
var onFocus = this.props.onFocus;
|
|
688
798
|
onFocus && onFocus(searchStr);
|
|
@@ -691,6 +801,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
691
801
|
key: "handleInactive",
|
|
692
802
|
value: function handleInactive() {
|
|
693
803
|
var isActive = this.state.isActive;
|
|
804
|
+
|
|
694
805
|
if (isActive) {
|
|
695
806
|
this.setState({
|
|
696
807
|
isActive: false
|
|
@@ -701,8 +812,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
701
812
|
key: "handleInputFocus",
|
|
702
813
|
value: function handleInputFocus() {
|
|
703
814
|
var _this$props5 = this.props,
|
|
704
|
-
|
|
705
|
-
|
|
815
|
+
isDisabled = _this$props5.isDisabled,
|
|
816
|
+
isReadOnly = _this$props5.isReadOnly;
|
|
706
817
|
this.searchInput && !isDisabled && !isReadOnly && this.searchInput.focus({
|
|
707
818
|
preventScroll: true
|
|
708
819
|
});
|
|
@@ -721,24 +832,26 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
721
832
|
key: "componentDidUpdate",
|
|
722
833
|
value: function componentDidUpdate(prevProps) {
|
|
723
834
|
var _this$props6 = this.props,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
835
|
+
groupedOptions = _this$props6.groupedOptions,
|
|
836
|
+
selectedGroupOptions = _this$props6.selectedGroupOptions,
|
|
837
|
+
isPopupOpen = _this$props6.isPopupOpen,
|
|
838
|
+
selectedOptionDetails = _this$props6.selectedOptionDetails,
|
|
839
|
+
searchStr = _this$props6.searchStr,
|
|
840
|
+
notifyPopupToggle = _this$props6.notifyPopupToggle;
|
|
730
841
|
var _this$state8 = this.state,
|
|
731
|
-
|
|
732
|
-
|
|
842
|
+
normalizedFormatOptions = _this$state8.normalizedFormatOptions,
|
|
843
|
+
hoverIndex = _this$state8.hoverIndex;
|
|
733
844
|
var newOptionIds = this.state.allOptionIds;
|
|
845
|
+
|
|
734
846
|
if (prevProps.groupedOptions != groupedOptions) {
|
|
735
847
|
var _this$handleGetGroupS2 = this.handleGetGroupSelectOptions(this.props),
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
848
|
+
revampedGroups = _this$handleGetGroupS2.revampedGroups,
|
|
849
|
+
normalizedAllOptions = _this$handleGetGroupS2.normalizedAllOptions,
|
|
850
|
+
formatNoramlizer = _this$handleGetGroupS2.normalizedFormatOptions,
|
|
851
|
+
allOptionIds = _this$handleGetGroupS2.allOptionIds,
|
|
852
|
+
groupIds = _this$handleGetGroupS2.groupIds,
|
|
853
|
+
normalizedGroupedOptions = _this$handleGetGroupS2.normalizedGroupedOptions;
|
|
854
|
+
|
|
742
855
|
normalizedFormatOptions = formatNoramlizer;
|
|
743
856
|
newOptionIds = allOptionIds;
|
|
744
857
|
this.setState({
|
|
@@ -750,39 +863,47 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
750
863
|
groupDetails: normalizedGroupedOptions
|
|
751
864
|
});
|
|
752
865
|
}
|
|
866
|
+
|
|
753
867
|
if (prevProps.selectedOptionDetails != selectedOptionDetails || prevProps.selectedGroupOptions != selectedGroupOptions) {
|
|
754
868
|
var _this$state9 = this.state,
|
|
755
|
-
|
|
756
|
-
|
|
869
|
+
groupDetails = _this$state9.groupDetails,
|
|
870
|
+
_groupIds = _this$state9.groupIds;
|
|
757
871
|
var changedSelectedOptionDetails = this.handleSelectedOptionDetailsIdChange(this.props, {
|
|
758
872
|
groupIds: _groupIds,
|
|
759
873
|
groupDetails: groupDetails
|
|
760
874
|
});
|
|
875
|
+
|
|
761
876
|
var _this$handleGetSelect2 = this.handleGetSelectedOptions(changedSelectedOptionDetails),
|
|
762
|
-
|
|
877
|
+
normalizedSelectedOptions = _this$handleGetSelect2.normalizedSelectedOptions;
|
|
878
|
+
|
|
763
879
|
var _this$handleSelectedO2 = this.handleSelectedOptionIdChange(selectedGroupOptions, normalizedFormatOptions, normalizedSelectedOptions),
|
|
764
|
-
|
|
765
|
-
|
|
880
|
+
formatSelectedOptions = _this$handleSelectedO2.formatSelectedOptions,
|
|
881
|
+
selectedOptionIds = _this$handleSelectedO2.selectedOptionIds;
|
|
882
|
+
|
|
766
883
|
this.setState({
|
|
767
884
|
formatSelectedOptions: formatSelectedOptions,
|
|
768
885
|
selectedOptionIds: selectedOptionIds
|
|
769
886
|
});
|
|
770
887
|
}
|
|
888
|
+
|
|
771
889
|
var hoverId = (0, _Common.getIsEmptyValue)(newOptionIds[hoverIndex]) ? '' : newOptionIds[hoverIndex];
|
|
772
890
|
var selSuggestion = this["suggestion_".concat(hoverId)];
|
|
773
|
-
isPopupOpen && (0, _Common.scrollTo)(this.suggestionContainer, selSuggestion);
|
|
891
|
+
isPopupOpen && (0, _Common.scrollTo)(this.suggestionContainer, selSuggestion); //When suggestions length less than 5, getNextOptions function call
|
|
774
892
|
|
|
775
|
-
//When suggestions length less than 5, getNextOptions function call
|
|
776
893
|
var _this$props7 = this.props,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
894
|
+
isNextOptions = _this$props7.isNextOptions,
|
|
895
|
+
getNextOptions = _this$props7.getNextOptions,
|
|
896
|
+
needLocalSearch = _this$props7.needLocalSearch;
|
|
897
|
+
|
|
780
898
|
var _this$handleFilterSug3 = this.handleFilterSuggestions(),
|
|
781
|
-
|
|
899
|
+
suggestions = _this$handleFilterSug3.suggestionOptionIds;
|
|
900
|
+
|
|
782
901
|
var suggestionsLen = suggestions.length;
|
|
902
|
+
|
|
783
903
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
784
904
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
785
905
|
}
|
|
906
|
+
|
|
786
907
|
if (prevProps.isPopupOpen != isPopupOpen) {
|
|
787
908
|
notifyPopupToggle && notifyPopupToggle(isPopupOpen);
|
|
788
909
|
}
|
|
@@ -801,67 +922,70 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
801
922
|
key: "render",
|
|
802
923
|
value: function render() {
|
|
803
924
|
var _this5 = this;
|
|
925
|
+
|
|
804
926
|
var _this$props8 = this.props,
|
|
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
|
-
|
|
841
|
-
|
|
842
|
-
|
|
927
|
+
size = _this$props8.size,
|
|
928
|
+
textBoxSize = _this$props8.textBoxSize,
|
|
929
|
+
selectedGroupOptions = _this$props8.selectedGroupOptions,
|
|
930
|
+
placeHolder = _this$props8.placeHolder,
|
|
931
|
+
dataId = _this$props8.dataId,
|
|
932
|
+
dataSelectorId = _this$props8.dataSelectorId,
|
|
933
|
+
isReadOnly = _this$props8.isReadOnly,
|
|
934
|
+
isDisabled = _this$props8.isDisabled,
|
|
935
|
+
isPopupOpen = _this$props8.isPopupOpen,
|
|
936
|
+
isPopupReady = _this$props8.isPopupReady,
|
|
937
|
+
defaultDropBoxPosition = _this$props8.defaultDropBoxPosition,
|
|
938
|
+
removeClose = _this$props8.removeClose,
|
|
939
|
+
needResponsive = _this$props8.needResponsive,
|
|
940
|
+
animationStyle = _this$props8.animationStyle,
|
|
941
|
+
needSelectAll = _this$props8.needSelectAll,
|
|
942
|
+
selectAllText = _this$props8.selectAllText,
|
|
943
|
+
dropBoxSize = _this$props8.dropBoxSize,
|
|
944
|
+
position = _this$props8.position,
|
|
945
|
+
getContainerRef = _this$props8.getContainerRef,
|
|
946
|
+
emptyMessage = _this$props8.emptyMessage,
|
|
947
|
+
searchEmptyMessage = _this$props8.searchEmptyMessage,
|
|
948
|
+
title = _this$props8.title,
|
|
949
|
+
variant = _this$props8.variant,
|
|
950
|
+
children = _this$props8.children,
|
|
951
|
+
listItemSize = _this$props8.listItemSize,
|
|
952
|
+
isDataLoaded = _this$props8.isDataLoaded,
|
|
953
|
+
needBorder = _this$props8.needBorder,
|
|
954
|
+
isNextOptions = _this$props8.isNextOptions,
|
|
955
|
+
getFooter = _this$props8.getFooter,
|
|
956
|
+
customClass = _this$props8.customClass,
|
|
957
|
+
borderColor = _this$props8.borderColor,
|
|
958
|
+
isPadding = _this$props8.isPadding,
|
|
959
|
+
htmlId = _this$props8.htmlId,
|
|
960
|
+
i18nKeys = _this$props8.i18nKeys,
|
|
961
|
+
a11y = _this$props8.a11y,
|
|
962
|
+
palette = _this$props8.palette,
|
|
963
|
+
needEffect = _this$props8.needEffect,
|
|
964
|
+
autoComplete = _this$props8.autoComplete;
|
|
843
965
|
var _i18nKeys = i18nKeys,
|
|
844
|
-
|
|
845
|
-
|
|
966
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
967
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
846
968
|
var _a11y$clearLabel = a11y.clearLabel,
|
|
847
|
-
|
|
969
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
848
970
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
849
971
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
850
972
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
851
973
|
});
|
|
852
974
|
var _this$state10 = this.state,
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
975
|
+
isActive = _this$state10.isActive,
|
|
976
|
+
searchStr = _this$state10.searchStr,
|
|
977
|
+
_this$state10$revampe = _this$state10.revampedGroups,
|
|
978
|
+
revampedGroups = _this$state10$revampe === void 0 ? [] : _this$state10$revampe,
|
|
979
|
+
selectedOptionIds = _this$state10.selectedOptionIds,
|
|
980
|
+
formatSelectedOptions = _this$state10.formatSelectedOptions,
|
|
981
|
+
hoverIndex = _this$state10.hoverIndex,
|
|
982
|
+
highLightedSelectOptions = _this$state10.highLightedSelectOptions,
|
|
983
|
+
isFetchingOptions = _this$state10.isFetchingOptions;
|
|
984
|
+
|
|
862
985
|
var _this$handleFilterSug4 = this.handleFilterSuggestions(),
|
|
863
|
-
|
|
864
|
-
|
|
986
|
+
suggestionGroups = _this$handleFilterSug4.suggestionGroups,
|
|
987
|
+
suggestionOptionIds = _this$handleFilterSug4.suggestionOptionIds;
|
|
988
|
+
|
|
865
989
|
var setAriaId = this.getNextAriaId();
|
|
866
990
|
var ariaErrorId = this.getNextAriaId();
|
|
867
991
|
var isShowClearIcon = !isReadOnly && !isDisabled && selectedGroupOptions.length > 1;
|
|
@@ -980,7 +1104,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
980
1104
|
key: 'SuggestonsParent'
|
|
981
1105
|
}, suggestionGroups.length ? suggestionGroups.map(function (group) {
|
|
982
1106
|
var _group$options = group.options,
|
|
983
|
-
|
|
1107
|
+
suggestions = _group$options === void 0 ? [] : _group$options;
|
|
984
1108
|
var groupId = group.id;
|
|
985
1109
|
var groupName = group.name;
|
|
986
1110
|
var hoverId = suggestionOptionIds[hoverIndex];
|
|
@@ -1024,18 +1148,20 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1024
1148
|
}) : null);
|
|
1025
1149
|
}
|
|
1026
1150
|
}]);
|
|
1151
|
+
|
|
1027
1152
|
return AdvancedGroupMultiSelect;
|
|
1028
1153
|
}(_react["default"].Component);
|
|
1154
|
+
|
|
1029
1155
|
AdvancedGroupMultiSelect.defaultProps = _defaultProps.AdvancedGroupMultiSelect_defaultProps;
|
|
1030
1156
|
AdvancedGroupMultiSelect.propTypes = _propTypes.AdvancedGroupMultiSelect_propTypes;
|
|
1031
1157
|
var AdvancedGroupMultiSelectComponent = (0, _Popup["default"])(AdvancedGroupMultiSelect);
|
|
1032
1158
|
AdvancedGroupMultiSelectComponent.defaultProps = AdvancedGroupMultiSelect.defaultProps;
|
|
1033
|
-
AdvancedGroupMultiSelectComponent.propTypes = AdvancedGroupMultiSelect.propTypes;
|
|
1034
|
-
// if (__DOCS__) {
|
|
1159
|
+
AdvancedGroupMultiSelectComponent.propTypes = AdvancedGroupMultiSelect.propTypes; // if (__DOCS__) {
|
|
1035
1160
|
// AdvancedGroupMultiSelect.docs = {
|
|
1036
1161
|
// componentGroup: 'Form Elements',
|
|
1037
1162
|
// folderName: 'Style Guide'
|
|
1038
1163
|
// };
|
|
1039
1164
|
// }
|
|
1165
|
+
|
|
1040
1166
|
var _default = AdvancedGroupMultiSelectComponent;
|
|
1041
1167
|
exports["default"] = _default;
|