@zohodesk/components 1.0.0-temp-107 → 1.0.0-test-252
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/css_error.log +0 -0
- package/es/Avatar/Avatar.js +1 -3
- package/es/Avatar/Avatar.module.css +23 -11
- package/es/AvatarTeam/AvatarTeam.module.css +21 -7
- package/es/Button/Button.module.css +97 -24
- package/es/Buttongroup/Buttongroup.module.css +37 -8
- package/es/CheckBox/CheckBox.module.css +17 -11
- package/es/DateTime/CalendarView.js +2 -4
- package/es/DateTime/DateTime.js +1 -1
- package/es/DateTime/DateTime.module.css +44 -13
- package/es/DateTime/DateTimePopupHeader.js +9 -24
- package/es/DateTime/DateWidget.js +2 -4
- package/es/DateTime/DateWidget.module.css +9 -5
- package/es/DateTime/DaysRow.js +2 -5
- package/es/DateTime/YearView.js +4 -12
- package/es/DateTime/YearView.module.css +18 -23
- package/es/DropBox/DropBox.module.css +47 -11
- package/es/DropDown/DropDownHeading.js +1 -3
- package/es/DropDown/DropDownHeading.module.css +7 -3
- package/es/DropDown/DropDownItem.module.css +32 -6
- package/es/DropDown/props/propTypes.js +1 -2
- package/es/Label/Label.js +2 -4
- package/es/ListItem/ListContainer.js +2 -4
- package/es/ListItem/ListItem.js +1 -2
- package/es/ListItem/ListItem.module.css +57 -25
- package/es/MultiSelect/MultiSelect.js +2 -4
- package/es/MultiSelect/MultiSelect.module.css +28 -11
- package/es/MultiSelect/SelectedOptions.module.css +8 -2
- package/es/MultiSelect/Suggestions.js +1 -2
- package/es/PopOver/PopOver.module.css +1 -1
- package/es/Radio/Radio.module.css +10 -4
- package/es/Ribbon/Ribbon.module.css +93 -28
- package/es/RippleEffect/RippleEffect.module.css +9 -27
- package/es/Select/Select.js +4 -7
- package/es/Select/Select.module.css +12 -2
- package/es/Select/SelectWithIcon.js +1 -2
- package/es/Stencils/Stencils.module.css +21 -3
- package/es/Switch/Switch.module.css +6 -7
- package/es/Tab/Tab.js +1 -2
- package/es/Tab/Tab.module.css +16 -7
- package/es/Tab/Tabs.js +3 -7
- package/es/Tab/Tabs.module.css +42 -8
- package/es/Tag/Tag.module.css +36 -14
- package/es/TextBox/TextBox.module.css +7 -11
- package/es/TextBoxIcon/TextBoxIcon.module.css +12 -5
- package/es/Textarea/Textarea.module.css +6 -7
- package/es/Tooltip/Tooltip.module.css +9 -8
- package/es/common/animation.module.css +219 -21
- package/es/common/basicReset.module.css +2 -12
- package/es/common/common.module.css +64 -18
- package/es/common/customscroll.module.css +17 -21
- package/es/common/transition.module.css +50 -10
- package/es/deprecated/AdvancedMultiSelect.module.css +22 -8
- package/es/index.js +107 -106
- package/es/semantic/Button/semanticButton.module.css +3 -3
- package/lib/Accordion/Accordion.js +102 -0
- package/lib/Accordion/AccordionItem.js +84 -0
- package/lib/Accordion/__tests__/Accordion.spec.js +82 -0
- package/lib/Accordion/index.js +20 -0
- package/lib/Accordion/props/defaultProps.js +16 -0
- package/lib/Accordion/props/propTypes.js +39 -0
- package/lib/Animation/Animation.js +161 -0
- package/lib/Animation/__tests__/Animation.spec.js +19 -0
- package/lib/Animation/props/defaultProps.js +14 -0
- package/lib/Animation/props/propTypes.js +20 -0
- package/lib/AppContainer/AppContainer.js +156 -0
- package/lib/AppContainer/AppContainer.module.css +18 -0
- package/lib/AppContainer/props/defaultProps.js +15 -0
- package/lib/AppContainer/props/propTypes.js +23 -0
- package/lib/Avatar/Avatar.js +199 -0
- package/lib/Avatar/Avatar.module.css +135 -0
- package/lib/Avatar/__tests__/Avatar.spec.js +164 -0
- package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -0
- package/lib/Avatar/props/defaultProps.js +21 -0
- package/lib/Avatar/props/propTypes.js +31 -0
- package/lib/AvatarTeam/AvatarTeam.js +99 -0
- package/lib/AvatarTeam/AvatarTeam.module.css +161 -0
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +79 -0
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -0
- package/lib/AvatarTeam/props/defaultProps.js +20 -0
- package/lib/AvatarTeam/props/propTypes.js +31 -0
- package/lib/Button/Button.js +90 -0
- package/lib/Button/Button.module.css +522 -0
- package/lib/Button/__tests__/Button.spec.js +193 -0
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -0
- package/lib/Button/props/defaultProps.js +22 -0
- package/lib/Button/props/propTypes.js +30 -0
- package/lib/Buttongroup/Buttongroup.js +70 -0
- package/lib/Buttongroup/Buttongroup.module.css +89 -0
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +76 -0
- package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -0
- package/lib/Buttongroup/props/defaultProps.js +11 -0
- package/lib/Buttongroup/props/propTypes.js +15 -0
- package/lib/Card/Card.js +301 -0
- package/lib/Card/Card.module.css +20 -0
- package/lib/Card/__tests__/Card.spec.js +47 -0
- package/lib/Card/index.js +33 -0
- package/lib/Card/props/defaultProps.js +23 -0
- package/lib/Card/props/propTypes.js +54 -0
- package/lib/CheckBox/CheckBox.js +183 -0
- package/lib/CheckBox/CheckBox.module.css +157 -0
- package/lib/CheckBox/__tests__/CheckBox.spec.js +15 -0
- package/lib/CheckBox/props/defaultProps.js +25 -0
- package/lib/CheckBox/props/propTypes.js +49 -0
- package/lib/DateTime/CalendarView.js +228 -0
- package/lib/DateTime/DateTime.js +779 -0
- package/lib/DateTime/DateTime.module.css +233 -0
- package/lib/DateTime/DateTimePopupFooter.js +65 -0
- package/lib/DateTime/DateTimePopupHeader.js +117 -0
- package/lib/DateTime/DateWidget.js +1015 -0
- package/lib/DateTime/DateWidget.module.css +38 -0
- package/lib/DateTime/DaysRow.js +52 -0
- package/lib/DateTime/Time.js +205 -0
- package/lib/DateTime/YearView.js +267 -0
- package/lib/DateTime/YearView.module.css +81 -0
- package/lib/DateTime/__tests__/CalendarView.spec.js +37 -0
- package/lib/DateTime/__tests__/DateTime.spec.js +113 -0
- package/lib/DateTime/__tests__/DateWidget.spec.js +79 -0
- package/lib/DateTime/common.js +30 -0
- package/lib/DateTime/constants.js +76 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +551 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +74 -0
- package/lib/DateTime/dateFormatUtils/index.js +225 -0
- package/lib/DateTime/dateFormatUtils/monthChange.js +84 -0
- package/lib/DateTime/dateFormatUtils/timeChange.js +208 -0
- package/lib/DateTime/dateFormatUtils/yearChange.js +108 -0
- package/lib/DateTime/index.js +13 -0
- package/lib/DateTime/objectUtils.js +72 -0
- package/lib/DateTime/props/defaultProps.js +61 -0
- package/lib/DateTime/props/propTypes.js +144 -0
- package/lib/DateTime/typeChecker.js +22 -0
- package/lib/DateTime/validator.js +290 -0
- package/lib/DropBox/DropBox.js +266 -0
- package/lib/DropBox/DropBox.module.css +406 -0
- package/lib/DropBox/DropBoxPositionMapping.json +145 -0
- package/lib/DropBox/__tests__/DropBox.spec.js +83 -0
- package/lib/DropBox/props/defaultProps.js +27 -0
- package/lib/DropBox/props/propTypes.js +55 -0
- package/lib/DropDown/DropDown.js +128 -0
- package/lib/DropDown/DropDown.module.css +5 -0
- package/lib/DropDown/DropDownHeading.js +64 -0
- package/lib/DropDown/DropDownHeading.module.css +53 -0
- package/lib/DropDown/DropDownItem.js +102 -0
- package/lib/DropDown/DropDownItem.module.css +94 -0
- package/lib/DropDown/DropDownSearch.js +89 -0
- package/lib/DropDown/DropDownSearch.module.css +14 -0
- package/lib/DropDown/DropDownSeparator.js +42 -0
- package/lib/DropDown/DropDownSeparator.module.css +7 -0
- package/lib/DropDown/__tests__/DropDown.spec.js +44 -0
- package/lib/DropDown/__tests__/DropDownItem.spec.js +46 -0
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +14 -0
- package/lib/DropDown/props/defaultProps.js +28 -0
- package/lib/DropDown/props/propTypes.js +89 -0
- package/lib/Heading/Heading.js +64 -0
- package/lib/Heading/Heading.module.css +5 -0
- package/lib/Heading/props/defaultProps.js +12 -0
- package/lib/Heading/props/propTypes.js +19 -0
- package/lib/Label/Label.js +65 -0
- package/lib/Label/Label.module.css +52 -0
- package/lib/Label/LabelColors.module.css +21 -0
- package/lib/Label/__tests__/Label.spec.js +124 -0
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -0
- package/lib/Label/props/defaultProps.js +17 -0
- package/lib/Label/props/propTypes.js +22 -0
- package/lib/Layout/Box.js +104 -0
- package/lib/Layout/Container.js +122 -0
- package/lib/Layout/Layout.module.css +336 -0
- package/lib/Layout/__tests__/Box.spec.js +105 -0
- package/lib/Layout/__tests__/Container.spec.js +110 -0
- package/lib/Layout/index.js +30 -0
- package/lib/Layout/props/defaultProps.js +20 -0
- package/lib/Layout/props/propTypes.js +51 -0
- package/lib/Layout/utils.js +45 -0
- package/lib/ListItem/ListContainer.js +93 -0
- package/lib/ListItem/ListItem.js +153 -0
- package/lib/ListItem/ListItem.module.css +209 -0
- package/lib/ListItem/ListItemWithAvatar.js +175 -0
- package/lib/ListItem/ListItemWithCheckBox.js +141 -0
- package/lib/ListItem/ListItemWithIcon.js +158 -0
- package/lib/ListItem/ListItemWithRadio.js +143 -0
- package/lib/ListItem/props/defaultProps.js +97 -0
- package/lib/ListItem/props/propTypes.js +176 -0
- package/lib/Modal/Modal.js +174 -0
- package/lib/Modal/props/defaultProps.js +10 -0
- package/lib/Modal/props/propTypes.js +14 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1032 -0
- package/lib/MultiSelect/AdvancedMultiSelect.js +552 -0
- package/lib/MultiSelect/EmptyState.js +85 -0
- package/lib/MultiSelect/MultiSelect.js +1044 -0
- package/lib/MultiSelect/MultiSelect.module.css +206 -0
- package/lib/MultiSelect/MultiSelectHeader.js +55 -0
- package/lib/MultiSelect/MultiSelectWithAvatar.js +304 -0
- package/lib/MultiSelect/SelectedOptions.js +98 -0
- package/lib/MultiSelect/SelectedOptions.module.css +15 -0
- package/lib/MultiSelect/Suggestions.js +158 -0
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +159 -0
- package/lib/MultiSelect/props/defaultProps.js +158 -0
- package/lib/MultiSelect/props/propTypes.js +377 -0
- package/lib/PopOver/PopOver.js +252 -0
- package/lib/PopOver/PopOver.module.css +8 -0
- package/lib/PopOver/__tests__/PopOver.spec.js +17 -0
- package/lib/PopOver/props/defaultProps.js +15 -0
- package/lib/PopOver/props/propTypes.js +63 -0
- package/lib/Popup/Popup.js +640 -0
- package/lib/Popup/PositionMapping.json +74 -0
- package/lib/Popup/__tests__/Popup.spec.js +155 -0
- package/lib/Popup/viewPort.js +354 -0
- package/lib/Provider/AvatarSize.js +19 -0
- package/lib/Provider/Config.js +25 -0
- package/lib/Provider/CssProvider.js +23 -0
- package/lib/Provider/IdProvider.js +68 -0
- package/lib/Provider/LibraryContext.js +54 -0
- package/lib/Provider/LibraryContextInit.js +11 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +145 -0
- package/lib/Provider/ZindexProvider.js +57 -0
- package/lib/Radio/Radio.js +146 -0
- package/lib/Radio/Radio.module.css +112 -0
- package/lib/Radio/__tests__/Radiospec.js +25 -0
- package/lib/Radio/props/defaultProps.js +21 -0
- package/lib/Radio/props/propTypes.js +40 -0
- package/lib/Responsive/CustomResponsive.js +192 -0
- package/lib/Responsive/RefWrapper.js +47 -0
- package/lib/Responsive/ResizeComponent.js +237 -0
- package/lib/Responsive/ResizeObserver.js +151 -0
- package/lib/Responsive/Responsive.js +222 -0
- package/lib/Responsive/index.js +28 -0
- package/lib/Responsive/props/defaultProps.js +23 -0
- package/lib/Responsive/props/propTypes.js +36 -0
- package/lib/Responsive/sizeObservers.js +176 -0
- package/lib/Responsive/utils/index.js +62 -0
- package/lib/Responsive/utils/shallowCompare.js +29 -0
- package/lib/Responsive/windowResizeObserver.js +55 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +94 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
- package/lib/ResponsiveDropBox/props/defaultProps.js +11 -0
- package/lib/ResponsiveDropBox/props/propTypes.js +15 -0
- package/lib/Ribbon/Ribbon.js +71 -0
- package/lib/Ribbon/Ribbon.module.css +377 -0
- package/lib/Ribbon/__tests__/Ribbon.spec.js +171 -0
- package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -0
- package/lib/Ribbon/props/defaultProps.js +15 -0
- package/lib/Ribbon/props/propTypes.js +18 -0
- package/lib/RippleEffect/RippleEffect.js +35 -0
- package/lib/RippleEffect/RippleEffect.module.css +92 -0
- package/lib/RippleEffect/props/defaultProps.js +16 -0
- package/lib/RippleEffect/props/propTypes.js +19 -0
- package/lib/Select/GroupSelect.js +771 -0
- package/lib/Select/Select.js +910 -0
- package/lib/Select/Select.module.css +109 -0
- package/lib/Select/SelectWithAvatar.js +340 -0
- package/lib/Select/SelectWithIcon.js +530 -0
- package/lib/Select/__tests__/Select.spec.js +341 -0
- package/lib/Select/props/defaultProps.js +112 -0
- package/lib/Select/props/propTypes.js +280 -0
- package/lib/Stencils/Stencils.js +57 -0
- package/lib/Stencils/Stencils.module.css +96 -0
- package/lib/Stencils/__tests__/Stencils.spec.js +72 -0
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -0
- package/lib/Stencils/props/defaultProps.js +13 -0
- package/lib/Stencils/props/propTypes.js +15 -0
- package/lib/Switch/Switch.js +123 -0
- package/lib/Switch/Switch.module.css +111 -0
- package/lib/Switch/props/defaultProps.js +17 -0
- package/lib/Switch/props/propTypes.js +35 -0
- package/lib/Tab/Tab.js +116 -0
- package/lib/Tab/Tab.module.css +101 -0
- package/lib/Tab/TabContent.js +33 -0
- package/lib/Tab/TabContent.module.css +4 -0
- package/lib/Tab/TabContentWrapper.js +33 -0
- package/lib/Tab/TabWrapper.js +69 -0
- package/lib/Tab/Tabs.js +581 -0
- package/lib/Tab/Tabs.module.css +141 -0
- package/lib/Tab/__tests__/Tab.spec.js +119 -0
- package/lib/Tab/__tests__/TabContent.spec.js +18 -0
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +51 -0
- package/lib/Tab/__tests__/TabWrapper.spec.js +88 -0
- package/lib/Tab/__tests__/Tabs.spec.js +109 -0
- package/lib/Tab/index.js +41 -0
- package/lib/Tab/props/defaultProps.js +50 -0
- package/lib/Tab/props/propTypes.js +114 -0
- package/lib/Tag/Tag.js +177 -0
- package/lib/Tag/Tag.module.css +255 -0
- package/lib/Tag/__tests__/Tag.spec.js +29 -0
- package/lib/Tag/props/defaultProps.js +20 -0
- package/lib/Tag/props/propTypes.js +42 -0
- package/lib/TextBox/TextBox.js +193 -0
- package/lib/TextBox/TextBox.module.css +157 -0
- package/lib/TextBox/__tests__/TextBox.spec.js +195 -0
- package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -0
- package/lib/TextBox/props/defaultProps.js +26 -0
- package/lib/TextBox/props/propTypes.js +57 -0
- package/lib/TextBoxIcon/TextBoxIcon.js +188 -0
- package/lib/TextBoxIcon/TextBoxIcon.module.css +78 -0
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +219 -0
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -0
- package/lib/TextBoxIcon/props/defaultProps.js +28 -0
- package/lib/TextBoxIcon/props/propTypes.js +57 -0
- package/lib/Textarea/Textarea.js +130 -0
- package/lib/Textarea/Textarea.module.css +139 -0
- package/lib/Textarea/__tests__/Textarea.spec.js +174 -0
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -0
- package/lib/Textarea/props/defaultProps.js +23 -0
- package/lib/Textarea/props/propTypes.js +39 -0
- package/lib/Tooltip/Tooltip.js +519 -0
- package/lib/Tooltip/Tooltip.module.css +109 -0
- package/lib/Tooltip/__tests__/Tooltip.spec.js +75 -0
- package/lib/Tooltip/props/defaultProps.js +11 -0
- package/lib/Tooltip/props/propTypes.js +16 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +100 -0
- package/lib/VelocityAnimation/VelocityAnimation/props/defaultProps.js +14 -0
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +20 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +131 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +22 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +27 -0
- package/lib/common/animation.module.css +624 -0
- package/lib/common/avatarsizes.module.css +45 -0
- package/lib/common/basic.module.css +33 -0
- package/lib/common/basicReset.module.css +40 -0
- package/lib/common/common.module.css +525 -0
- package/lib/common/customscroll.module.css +89 -0
- package/lib/common/reset.module.css +12 -0
- package/lib/common/transition.module.css +146 -0
- package/lib/css.js +42 -0
- package/lib/deprecated/AdvancedMultiSelect.module.css +127 -0
- package/lib/deprecated/PortalLayer/PortalLayer.js +126 -0
- package/lib/deprecated/PortalLayer/props/defaultProps.js +12 -0
- package/lib/deprecated/PortalLayer/props/propTypes.js +19 -0
- package/lib/deprecated/advancedMultiSelectVariableJson.js +82 -0
- package/lib/index.js +404 -0
- package/lib/semantic/Button/Button.js +81 -0
- package/lib/semantic/Button/props/defaultProps.js +19 -0
- package/lib/semantic/Button/props/propTypes.js +34 -0
- package/lib/semantic/Button/semanticButton.module.css +9 -0
- package/lib/utils/Common.js +391 -0
- package/lib/utils/ContextOptimizer.js +43 -0
- package/lib/utils/__tests__/constructFullName.spec.js +11 -0
- package/lib/utils/__tests__/debounce.spec.js +39 -0
- package/lib/utils/__tests__/getInitial.spec.js +25 -0
- package/lib/utils/constant.js +10 -0
- package/lib/utils/constructFullName.js +25 -0
- package/lib/utils/datetime/common.js +206 -0
- package/lib/utils/debounce.js +25 -0
- package/lib/utils/dropDownUtils.js +491 -0
- package/lib/utils/dummyFunction.js +8 -0
- package/lib/utils/getHTMLFontSize.js +10 -0
- package/lib/utils/getInitial.js +27 -0
- package/lib/utils/scrollTo.js +20 -0
- package/lib/utils/shallowEqual.js +33 -0
- package/package.json +1 -1
- package/es/Accordion/docs/Accordion__Demo.docs.js +0 -78
- package/es/Animation/docs/Animation__default.docs.js +0 -32
- package/es/Animation/docs/Animation__fadeIn.docs.js +0 -32
- package/es/Animation/docs/Animation__scaleIn.docs.js +0 -32
- package/es/Animation/docs/Animation__skewIn.docs.js +0 -32
- package/es/Animation/docs/Animation__slideDown.docs.js +0 -32
- package/es/Animation/docs/Animation__slideLeft.docs.js +0 -32
- package/es/Animation/docs/Animation__zoomIn.docs.js +0 -32
- package/es/AppContainer/docs/AppContainer__default.docs.js +0 -18
- package/es/Avatar/docs/Avatar__custom.docs.js +0 -27
- package/es/Avatar/docs/Avatar__default.docs.js +0 -27
- package/es/Avatar/docs/Avatar__palette.docs.js +0 -47
- package/es/Avatar/docs/Avatar__text.docs.js +0 -26
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -71
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -29
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -48
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -47
- package/es/Button/docs/Button__custom.docs.js +0 -769
- package/es/Button/docs/Button__default.docs.js +0 -534
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -35
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -31
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -40
- package/es/Card/docs/Card__Custom.docs.js +0 -32
- package/es/Card/docs/Card__Default.docs.js +0 -35
- package/es/Card/docs/Card__Scroll.docs.js +0 -56
- package/es/CheckBox/docs/CheckBox__custom.docs.js +0 -289
- package/es/CheckBox/docs/CheckBox__default.docs.js +0 -215
- package/es/DateTime/docs/DateTime__default.docs.js +0 -88
- package/es/DateTime/docs/DateWidget__default.docs.js +0 -178
- package/es/DateTime/docs/timezonedata.json +0 -1
- package/es/DropBox/docs/DropBox__custom.docs.js +0 -64
- package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -85
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -84
- package/es/DropBox/docs/DropBox__position.docs.js +0 -85
- package/es/DropBox/docs/DropBox__size.docs.js +0 -59
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -21
- package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -19
- package/es/FramerAnimation/FramerAnimation.js +0 -206
- package/es/FramerAnimation/docs/FramerAnimation__default.docs.js +0 -123
- package/es/Heading/docs/Heading__default.docs.js +0 -19
- package/es/Label/docs/Label__clipped.docs.js +0 -25
- package/es/Label/docs/Label__custom.docs.js +0 -28
- package/es/Label/docs/Label__palette.docs.js +0 -40
- package/es/Label/docs/Label__size.docs.js +0 -27
- package/es/Label/docs/Label__type.docs.js +0 -35
- package/es/Layout/docs/Layout__Hidden.docs.js +0 -76
- package/es/Layout/docs/Layout__default.docs.js +0 -48
- package/es/Layout/docs/Layout__four_Column.docs.js +0 -78
- package/es/Layout/docs/Layout__three_Column.docs.js +0 -75
- package/es/Layout/docs/Layout__two_Column.docs.js +0 -68
- package/es/LightNightMode/Colors.json +0 -497
- package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -92
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -153
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -110
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -89
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -63
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -66
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -60
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -89
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -63
- package/es/ListItem/docs/ListItem__custom.docs.js +0 -112
- package/es/ListItem/docs/ListItem__default.docs.js +0 -80
- package/es/Modal/__docs__/Modal__default.docs.js +0 -42
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -118
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -108
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -137
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +0 -156
- package/es/PopOver/docs/PopOver__default.docs.js +0 -30
- package/es/Provider/docs/Provider_Id__Class.docs.js +0 -28
- package/es/Provider/docs/Provider_Id__Function.docs.js +0 -17
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +0 -31
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -22
- package/es/Provider.js +0 -91
- package/es/Radio/docs/Radio__custom.docs.js +0 -241
- package/es/Radio/docs/Radio__default.docs.js +0 -165
- package/es/Responsive/docs/Responsive__Custom.docs.js +0 -214
- package/es/Responsive/docs/Responsive__default.docs.js +0 -95
- package/es/Responsive/docs/style.module.css +0 -47
- package/es/Ribbon/docs/Ribbon__custom.docs.js +0 -385
- package/es/Ribbon/docs/Ribbon__default.docs.js +0 -341
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +0 -433
- package/es/Select/docs/GroupSelect__default.docs.js +0 -144
- package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -93
- package/es/Select/docs/SelectWithIcon__default.docs.js +0 -134
- package/es/Select/docs/Select__default.docs.js +0 -283
- package/es/Stencils/docs/Stencils__custom.docs.js +0 -43
- package/es/Stencils/docs/Stencils__default.docs.js +0 -48
- package/es/Switch/docs/Switch__custom.docs.js +0 -151
- package/es/Switch/docs/Switch__default.docs.js +0 -105
- package/es/Tab/docs/Tab__default.docs.js +0 -253
- package/es/Tab/docs/tabdocs.module.css +0 -29
- package/es/Tag/docs/Tag__custom.docs.js +0 -366
- package/es/Tag/docs/Tag__default.docs.js +0 -321
- package/es/TextBox/docs/TextBox__custom.docs.js +0 -41
- package/es/TextBox/docs/TextBox__default.docs.js +0 -38
- package/es/TextBox/docs/TextBox__size.docs.js +0 -36
- package/es/TextBox/docs/TextBox__variant.docs.js +0 -36
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -87
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -59
- package/es/Textarea/docs/Textarea__animated.docs.js +0 -39
- package/es/Textarea/docs/Textarea__custom.docs.js +0 -80
- package/es/Textarea/docs/Textarea__default.docs.js +0 -74
- package/es/Textarea/docs/Textarea__disabled.docs.js +0 -27
- package/es/Tooltip/docs/Tooltip__default.docs.js +0 -367
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -92
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -139
- package/es/common/docStyle.module.css +0 -719
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -65
- package/es/semantic/Button/docs/Button__default.docs.js +0 -17
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.AdvancedMultiSelectComponent = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = require("./props/propTypes");
|
|
10
|
+
var _defaultProps = require("./props/defaultProps");
|
|
11
|
+
var _MultiSelect = require("./MultiSelect");
|
|
12
|
+
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
13
|
+
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
14
|
+
var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
15
|
+
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
16
|
+
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
17
|
+
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
18
|
+
var _Layout = require("../Layout");
|
|
19
|
+
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
20
|
+
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
21
|
+
var _IdProvider = require("../Provider/IdProvider");
|
|
22
|
+
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
23
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
24
|
+
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
25
|
+
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
26
|
+
var _Common = require("../utils/Common.js");
|
|
27
|
+
var _dropDownUtils = require("../utils/dropDownUtils");
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
32
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
33
|
+
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."); }
|
|
34
|
+
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); }
|
|
35
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
36
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
37
|
+
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; }
|
|
38
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
|
+
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); } }
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
+
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); }
|
|
42
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
+
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); }; }
|
|
44
|
+
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); }
|
|
45
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
46
|
+
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; } }
|
|
47
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
48
|
+
/* eslint-disable react/sort-prop-types */
|
|
49
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
50
|
+
/* eslint-disable react/forbid-component-props */
|
|
51
|
+
|
|
52
|
+
var dummyArray = [];
|
|
53
|
+
var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent) {
|
|
54
|
+
_inherits(AdvancedMultiSelectComponent, _MultiSelectComponent);
|
|
55
|
+
var _super = _createSuper(AdvancedMultiSelectComponent);
|
|
56
|
+
function AdvancedMultiSelectComponent(props) {
|
|
57
|
+
var _this;
|
|
58
|
+
_classCallCheck(this, AdvancedMultiSelectComponent);
|
|
59
|
+
_this = _super.call(this, props);
|
|
60
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
61
|
+
oldState = _assertThisInitialize.state;
|
|
62
|
+
var _this$props = _this.props,
|
|
63
|
+
selectedOptionsLimit = _this$props.selectedOptionsLimit,
|
|
64
|
+
selectedOptions = _this$props.selectedOptions;
|
|
65
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
66
|
+
_this.state = Object.assign({}, oldState, {
|
|
67
|
+
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
68
|
+
});
|
|
69
|
+
_this.getIsShowClearIcon = (0, _dropDownUtils.makeGetIsShowClearIcon)();
|
|
70
|
+
_this.handleFilterSuggestions = _this.handleFilterSuggestions.bind(_assertThisInitialized(_this));
|
|
71
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
72
|
+
_this.handleSelectOption = _this.handleSelectOption.bind(_assertThisInitialized(_this));
|
|
73
|
+
_this.handleGetSelectedOptions = _this.handleGetSelectedOptions.bind(_assertThisInitialized(_this));
|
|
74
|
+
_this.handleFormatSelectedOptions = _this.handleFormatSelectedOptions.bind(_assertThisInitialized(_this));
|
|
75
|
+
_this.handleComponentDidUpdate = _this.handleComponentDidUpdate.bind(_assertThisInitialized(_this));
|
|
76
|
+
_this.handleMoreClick = _this.handleMoreClick.bind(_assertThisInitialized(_this));
|
|
77
|
+
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
_createClass(AdvancedMultiSelectComponent, [{
|
|
81
|
+
key: "handleFilterSuggestions",
|
|
82
|
+
value: function handleFilterSuggestions() {
|
|
83
|
+
var _this$state = this.state,
|
|
84
|
+
_this$state$options = _this$state.options,
|
|
85
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options,
|
|
86
|
+
searchStr = _this$state.searchStr;
|
|
87
|
+
var needLocalSearch = this.props.needLocalSearch;
|
|
88
|
+
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
89
|
+
options: options,
|
|
90
|
+
selectedOptions: dummyArray,
|
|
91
|
+
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
92
|
+
needSearch: needLocalSearch
|
|
93
|
+
}),
|
|
94
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
95
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
96
|
+
this.suggestionsOrder = suggestionIds;
|
|
97
|
+
return suggestions;
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "handleChange",
|
|
101
|
+
value: function handleChange() {
|
|
102
|
+
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
103
|
+
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
104
|
+
var _this$state2 = this.state,
|
|
105
|
+
optionsNormalize = _this$state2.optionsNormalize,
|
|
106
|
+
searchStr = _this$state2.searchStr;
|
|
107
|
+
var _this$props2 = this.props,
|
|
108
|
+
onChange = _this$props2.onChange,
|
|
109
|
+
_this$props2$needToCl = _this$props2.needToCloseOnSelect,
|
|
110
|
+
needToCloseOnSelect = _this$props2$needToCl === void 0 ? false : _this$props2$needToCl,
|
|
111
|
+
togglePopup = _this$props2.togglePopup,
|
|
112
|
+
isSearchClearOnSelect = _this$props2.isSearchClearOnSelect,
|
|
113
|
+
propSelectedOptions = _this$props2.selectedOptions,
|
|
114
|
+
disabledOptions = _this$props2.disabledOptions;
|
|
115
|
+
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
116
|
+
selectedOptions: selectedOptions,
|
|
117
|
+
propSelectedOptions: propSelectedOptions,
|
|
118
|
+
disabledOptions: disabledOptions
|
|
119
|
+
}),
|
|
120
|
+
newSelectedOptions = _filterSelectedOption.newSelectedOptions;
|
|
121
|
+
var selectedOptionsLen = newSelectedOptions.length;
|
|
122
|
+
var allSelectedOptionsDetails = [];
|
|
123
|
+
for (var i = 0; i < selectedOptionsLen; i++) {
|
|
124
|
+
var id = newSelectedOptions[i];
|
|
125
|
+
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
126
|
+
}
|
|
127
|
+
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails);
|
|
128
|
+
if (searchStr.trim() !== '' && isSearchClearOnSelect) {
|
|
129
|
+
this.handleSearch('');
|
|
130
|
+
}
|
|
131
|
+
this.searchInput && this.searchInput.focus({
|
|
132
|
+
preventScroll: true
|
|
133
|
+
});
|
|
134
|
+
if (needToCloseOnSelect) {
|
|
135
|
+
e && togglePopup(e);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "handleSelectOption",
|
|
140
|
+
value: function handleSelectOption(option, value, index, e) {
|
|
141
|
+
var selectedOptions = this.props.selectedOptions;
|
|
142
|
+
if (selectedOptions.indexOf(option) >= 0) {
|
|
143
|
+
//toggle select option
|
|
144
|
+
this.handleRemoveOption(option);
|
|
145
|
+
} else {
|
|
146
|
+
this.handleChange([].concat(_toConsumableArray(selectedOptions), [option]), e);
|
|
147
|
+
}
|
|
148
|
+
// e && e.stopPropagation && this.handlePopupClose(e);
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "handleFormatOptions",
|
|
152
|
+
value: function handleFormatOptions(props) {
|
|
153
|
+
var options = props.options,
|
|
154
|
+
valueField = props.valueField,
|
|
155
|
+
textField = props.textField,
|
|
156
|
+
imageField = props.imageField,
|
|
157
|
+
iconName = props.iconName,
|
|
158
|
+
iconSize = props.iconSize,
|
|
159
|
+
prefixText = props.prefixText,
|
|
160
|
+
optionType = props.optionType,
|
|
161
|
+
disabledOptions = props.disabledOptions;
|
|
162
|
+
return this.formatOptions({
|
|
163
|
+
options: options,
|
|
164
|
+
valueField: valueField,
|
|
165
|
+
textField: textField,
|
|
166
|
+
imageField: imageField,
|
|
167
|
+
iconName: iconName,
|
|
168
|
+
prefixText: prefixText,
|
|
169
|
+
optionType: optionType,
|
|
170
|
+
iconSize: iconSize,
|
|
171
|
+
disabledOptions: disabledOptions
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "handleGetSelectedOptions",
|
|
176
|
+
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, props) {
|
|
177
|
+
//handle selectedoptions length
|
|
178
|
+
var _ref = this.state || {},
|
|
179
|
+
showedSelectedOptionsCount = _ref.showedSelectedOptionsCount;
|
|
180
|
+
var selectedOptionsLimit = props.selectedOptionsLimit,
|
|
181
|
+
selectedOptionDetails = props.selectedOptionDetails;
|
|
182
|
+
showedSelectedOptionsCount = (0, _Common.getIsEmptyValue)(showedSelectedOptionsCount) ? selectedOptionsLimit : showedSelectedOptionsCount;
|
|
183
|
+
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, props),
|
|
184
|
+
normalizedSelectedOptions = _this$handleFormatSel.normalizedFormatOptions;
|
|
185
|
+
var formatOptions = this.objectConcat({
|
|
186
|
+
obj1: normalizedFormatOptions,
|
|
187
|
+
obj2: normalizedSelectedOptions
|
|
188
|
+
});
|
|
189
|
+
return this.getSelectedOptions({
|
|
190
|
+
selectedOptions: selectedOptions,
|
|
191
|
+
normalizedFormatOptions: formatOptions,
|
|
192
|
+
selectedOptionsLength: showedSelectedOptionsCount
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "handleFormatSelectedOptions",
|
|
197
|
+
value: function handleFormatSelectedOptions(selectedOptionDetails, props) {
|
|
198
|
+
var valueField = props.valueField,
|
|
199
|
+
textField = props.textField,
|
|
200
|
+
imageField = props.imageField,
|
|
201
|
+
optionType = props.optionType,
|
|
202
|
+
iconName = props.iconName,
|
|
203
|
+
iconSize = props.iconSize,
|
|
204
|
+
disabledOptions = props.disabledOptions;
|
|
205
|
+
return this.formatSelectedOptions({
|
|
206
|
+
options: selectedOptionDetails,
|
|
207
|
+
valueField: valueField,
|
|
208
|
+
textField: textField,
|
|
209
|
+
imageField: imageField,
|
|
210
|
+
optionType: optionType,
|
|
211
|
+
iconName: iconName,
|
|
212
|
+
iconSize: iconSize,
|
|
213
|
+
disabledOptions: disabledOptions
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "handleComponentDidUpdate",
|
|
218
|
+
value: function handleComponentDidUpdate(prevProps, prevState) {
|
|
219
|
+
var _this2 = this;
|
|
220
|
+
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
221
|
+
var _this$props3 = this.props,
|
|
222
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
223
|
+
selectedOptionsLimit = _this$props3.selectedOptionsLimit,
|
|
224
|
+
id = _this$props3.id,
|
|
225
|
+
selectedOptionDetails = _this$props3.selectedOptionDetails;
|
|
226
|
+
var oldSelectedOptions = prevProps.selectedOptions,
|
|
227
|
+
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
228
|
+
var oldCount = this.state.showedSelectedOptionsCount;
|
|
229
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
230
|
+
var oldSelectedOptionsLen = oldSelectedOptions.length;
|
|
231
|
+
if (id !== prevProps.id || selectedOptionsLimit !== oldSelectedOptionsLimit) {
|
|
232
|
+
//handle component update case (New set of options or new selectedOptionsLimit update)
|
|
233
|
+
this.setState({
|
|
234
|
+
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
235
|
+
});
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (oldCount !== prevState.showedSelectedOptionsCount || selectedOptionDetails !== prevProps.selectedOptionDetails) {
|
|
239
|
+
//When showedSelectedOptionsCount update, setState the updated selected option details
|
|
240
|
+
var _this$handleFormatOpt = this.handleFormatOptions(this.props),
|
|
241
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
242
|
+
var optionsDetails = Object.assign({}, oldAllSelectedOptionsDetails, normalizedFormatOptions);
|
|
243
|
+
var _this$handleGetSelect = this.handleGetSelectedOptions(selectedOptions, optionsDetails, this.props),
|
|
244
|
+
formatSelectedOptions = _this$handleGetSelect.formatSelectedOptions,
|
|
245
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions,
|
|
246
|
+
selectedOptionIds = _this$handleGetSelect.selectedOptionIds;
|
|
247
|
+
this.allSelectedOptionsDetails = Object.assign(oldAllSelectedOptionsDetails, normalizedSelectedOptions);
|
|
248
|
+
this.setState({
|
|
249
|
+
selectedOptions: formatSelectedOptions,
|
|
250
|
+
selectedOptionIds: selectedOptionIds
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if ((0, _Common.getIsEmptyValue)(oldCount) || oldSelectedOptionsLen <= oldCount) {
|
|
254
|
+
//handle not more options case
|
|
255
|
+
if (selectedOptionsLen > oldCount) {
|
|
256
|
+
this.setState({
|
|
257
|
+
showedSelectedOptionsCount: selectedOptionsLen
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
} else if (oldSelectedOptionsLen > selectedOptionsLen) {
|
|
261
|
+
//handle more case and option remove case
|
|
262
|
+
var showedSelectedOptions = oldSelectedOptions.slice(0, oldCount);
|
|
263
|
+
var removeSelectedOption = oldCount;
|
|
264
|
+
selectedOptions.forEach(function (option) {
|
|
265
|
+
if (showedSelectedOptions.indexOf(option) >= 0) {
|
|
266
|
+
removeSelectedOption -= 1;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
var newCount = oldCount - removeSelectedOption;
|
|
270
|
+
this.setState({
|
|
271
|
+
showedSelectedOptionsCount: newCount
|
|
272
|
+
}, function () {
|
|
273
|
+
var showedSelectedOptionsCount = _this2.state.showedSelectedOptionsCount;
|
|
274
|
+
if (showedSelectedOptionsCount === 0) {
|
|
275
|
+
_this2.handleMoreClick();
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "handleMoreClick",
|
|
282
|
+
value: function handleMoreClick(e) {
|
|
283
|
+
var _this3 = this;
|
|
284
|
+
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
285
|
+
var _this$props4 = this.props,
|
|
286
|
+
selectedOptionsLimit = _this$props4.selectedOptionsLimit,
|
|
287
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
288
|
+
getSelectedOptionDetails = _this$props4.getSelectedOptionDetails,
|
|
289
|
+
removeClose = _this$props4.removeClose;
|
|
290
|
+
removeClose(e);
|
|
291
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
292
|
+
if (showedSelectedOptionsCount < selectedOptionsLen) {
|
|
293
|
+
var newCount = showedSelectedOptionsCount + selectedOptionsLimit;
|
|
294
|
+
var newSelectedOptionIds = selectedOptions.slice(showedSelectedOptionsCount, newCount);
|
|
295
|
+
try {
|
|
296
|
+
getSelectedOptionDetails(newSelectedOptionIds).then(function () {
|
|
297
|
+
_this3.setState({
|
|
298
|
+
showedSelectedOptionsCount: showedSelectedOptionsCount + newSelectedOptionIds.length
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
} catch (e) {
|
|
302
|
+
//console.error('getSelectedOptionDetails is not a promise function.');
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
this.searchInput && this.searchInput.focus({
|
|
306
|
+
preventScroll: true
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "responsiveFunc",
|
|
311
|
+
value: function responsiveFunc(_ref2) {
|
|
312
|
+
var mediaQueryOR = _ref2.mediaQueryOR;
|
|
313
|
+
return {
|
|
314
|
+
tabletMode: mediaQueryOR([{
|
|
315
|
+
maxWidth: 700
|
|
316
|
+
}])
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "render",
|
|
321
|
+
value: function render() {
|
|
322
|
+
var _this4 = this;
|
|
323
|
+
var _this$props5 = this.props,
|
|
324
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
325
|
+
needSelectAll = _this$props5.needSelectAll,
|
|
326
|
+
searchEmptyMessage = _this$props5.searchEmptyMessage,
|
|
327
|
+
emptyMessage = _this$props5.emptyMessage,
|
|
328
|
+
noMoreOptionsMessage = _this$props5.noMoreOptionsMessage,
|
|
329
|
+
dropBoxSize = _this$props5.dropBoxSize,
|
|
330
|
+
placeHolder = _this$props5.placeHolder,
|
|
331
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
332
|
+
isPopupReady = _this$props5.isPopupReady,
|
|
333
|
+
position = _this$props5.position,
|
|
334
|
+
defaultDropBoxPosition = _this$props5.defaultDropBoxPosition,
|
|
335
|
+
selectAllText = _this$props5.selectAllText,
|
|
336
|
+
getContainerRef = _this$props5.getContainerRef,
|
|
337
|
+
removeClose = _this$props5.removeClose,
|
|
338
|
+
isAnimate = _this$props5.isAnimate,
|
|
339
|
+
animationStyle = _this$props5.animationStyle,
|
|
340
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
341
|
+
variant = _this$props5.variant,
|
|
342
|
+
size = _this$props5.size,
|
|
343
|
+
isDisabled = _this$props5.isDisabled,
|
|
344
|
+
title = _this$props5.title,
|
|
345
|
+
dataIdMultiSelectComp = _this$props5.dataIdMultiSelectComp,
|
|
346
|
+
dataIdClearIcon = _this$props5.dataIdClearIcon,
|
|
347
|
+
dataIdSelectAllEle = _this$props5.dataIdSelectAllEle,
|
|
348
|
+
dataIdLoading = _this$props5.dataIdLoading,
|
|
349
|
+
_this$props5$selected = _this$props5.selectedOptions,
|
|
350
|
+
allselectedOptionIds = _this$props5$selected === void 0 ? [] : _this$props5$selected,
|
|
351
|
+
listItemSize = _this$props5.listItemSize,
|
|
352
|
+
needBorder = _this$props5.needBorder,
|
|
353
|
+
i18nKeys = _this$props5.i18nKeys,
|
|
354
|
+
htmlId = _this$props5.htmlId,
|
|
355
|
+
a11y = _this$props5.a11y,
|
|
356
|
+
borderColor = _this$props5.borderColor,
|
|
357
|
+
isBoxPaddingNeed = _this$props5.isBoxPaddingNeed,
|
|
358
|
+
getFooter = _this$props5.getFooter,
|
|
359
|
+
customProps = _this$props5.customProps,
|
|
360
|
+
needEffect = _this$props5.needEffect,
|
|
361
|
+
disabledOptions = _this$props5.disabledOptions,
|
|
362
|
+
isLoading = _this$props5.isLoading;
|
|
363
|
+
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
364
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
365
|
+
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
366
|
+
DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP;
|
|
367
|
+
var _i18nKeys = i18nKeys,
|
|
368
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
369
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
370
|
+
var _a11y$clearLabel = a11y.clearLabel,
|
|
371
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
372
|
+
i18nKeys = Object.assign({}, i18nKeys, {
|
|
373
|
+
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
374
|
+
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage,
|
|
375
|
+
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
376
|
+
});
|
|
377
|
+
var _this$state3 = this.state,
|
|
378
|
+
selectedOptions = _this$state3.selectedOptions,
|
|
379
|
+
searchStr = _this$state3.searchStr,
|
|
380
|
+
hoverOption = _this$state3.hoverOption,
|
|
381
|
+
highLightedSelectOptions = _this$state3.highLightedSelectOptions,
|
|
382
|
+
isFetchingOptions = _this$state3.isFetchingOptions,
|
|
383
|
+
isActive = _this$state3.isActive,
|
|
384
|
+
showedSelectedOptionsCount = _this$state3.showedSelectedOptionsCount,
|
|
385
|
+
options = _this$state3.options;
|
|
386
|
+
var suggestions = this.handleFilterSuggestions();
|
|
387
|
+
var allselectedOptionIdsLen = allselectedOptionIds.length;
|
|
388
|
+
var moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
|
|
389
|
+
var setAriaId = this.getNextAriaId();
|
|
390
|
+
var ariaErrorId = this.getNextAriaId();
|
|
391
|
+
var _this$getIsShowClearI = this.getIsShowClearIcon({
|
|
392
|
+
selectedOptions: selectedOptions,
|
|
393
|
+
disabledOptions: disabledOptions
|
|
394
|
+
}),
|
|
395
|
+
isShowClear = _this$getIsShowClearI.isShowClearIcon;
|
|
396
|
+
var isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
397
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
398
|
+
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
399
|
+
"data-id": dataIdMultiSelectComp,
|
|
400
|
+
"data-title": isDisabled ? title : null,
|
|
401
|
+
onClick: this.handleInputFocus
|
|
402
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
403
|
+
align: "vertical",
|
|
404
|
+
alignBox: "row",
|
|
405
|
+
className: "".concat(_MultiSelectModule["default"].container, " ").concat(_MultiSelectModule["default"][size], " ").concat(isActive && needBorder ? _MultiSelectModule["default"].active : '', " ").concat(needBorder ? _MultiSelectModule["default"].hasBorder : '', " ").concat(needBorder ? !isDisabled ? _MultiSelectModule["default"]["borderColor_".concat(borderColor)] : _MultiSelectModule["default"].borderColor_transparent : ''),
|
|
406
|
+
eleRef: this.selectedOptionContainerRef,
|
|
407
|
+
wrap: "wrap"
|
|
408
|
+
}, /*#__PURE__*/_react["default"].createElement(_SelectedOptions["default"], {
|
|
409
|
+
selectedOptions: selectedOptions,
|
|
410
|
+
highLightedSelectOptions: highLightedSelectOptions,
|
|
411
|
+
isReadOnly: isReadOnly,
|
|
412
|
+
getRef: this.selectedOptionRef,
|
|
413
|
+
onRemove: this.handleRemoveOption,
|
|
414
|
+
onSelect: this.handleClickSelectedOption
|
|
415
|
+
}), moreCount > 0 ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
416
|
+
className: _MultiSelectModule["default"].more,
|
|
417
|
+
onClick: this.handleMoreClick,
|
|
418
|
+
tagName: "button"
|
|
419
|
+
}, "+ ".concat(moreCount, " More")) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
420
|
+
flexible: true,
|
|
421
|
+
className: _MultiSelectModule["default"].wrapper,
|
|
422
|
+
adjust: true,
|
|
423
|
+
shrink: true
|
|
424
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
425
|
+
className: " ".concat(_MultiSelectModule["default"].custmSpan, " ").concat(textBoxSize === 'xmedium' ? _MultiSelectModule["default"].custmSpanXmedium : _MultiSelectModule["default"].custmSpanMedium, " ").concat(isShowClearIcon ? _MultiSelectModule["default"].clearIconSpace : '', "\n ")
|
|
426
|
+
}, searchStr), /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
427
|
+
isDisabled: isDisabled,
|
|
428
|
+
inputRef: this.searchInputRef,
|
|
429
|
+
needBorder: false,
|
|
430
|
+
onBlur: this.handleInactive,
|
|
431
|
+
onChange: this.handleSearch,
|
|
432
|
+
onClick: this.handleInputCick,
|
|
433
|
+
onFocus: this.handleActive,
|
|
434
|
+
onKeyDown: this.handleKeyDown,
|
|
435
|
+
placeHolder: selectedOptions.length >= 1 ? '' : placeHolder,
|
|
436
|
+
size: textBoxSize,
|
|
437
|
+
value: searchStr,
|
|
438
|
+
variant: variant,
|
|
439
|
+
isReadOnly: isReadOnly,
|
|
440
|
+
tabindex: isDisabled && '-1',
|
|
441
|
+
customClass: {
|
|
442
|
+
customTBoxWrap: _MultiSelectModule["default"].custmInputWrapper
|
|
443
|
+
},
|
|
444
|
+
htmlId: htmlId,
|
|
445
|
+
a11y: {
|
|
446
|
+
role: 'combobox',
|
|
447
|
+
ariaOwns: setAriaId,
|
|
448
|
+
ariaControls: setAriaId,
|
|
449
|
+
ariaExpanded: !isReadOnly && !isDisabled && isPopupOpen ? true : false,
|
|
450
|
+
ariaHaspopup: true,
|
|
451
|
+
ariaDescribedby: ariaErrorId
|
|
452
|
+
},
|
|
453
|
+
autoComplete: false
|
|
454
|
+
}, isShowClearIcon ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
455
|
+
alignBox: "row",
|
|
456
|
+
align: "vertical"
|
|
457
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
458
|
+
className: "".concat(_MultiSelectModule["default"]["delete"]),
|
|
459
|
+
dataId: dataIdClearIcon,
|
|
460
|
+
"data-title": clearText,
|
|
461
|
+
onClick: this.handleDeselectAll,
|
|
462
|
+
tagName: "button",
|
|
463
|
+
"aria-label": clearLabel
|
|
464
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
465
|
+
name: "ZD-delete",
|
|
466
|
+
size: "15"
|
|
467
|
+
}))) : null))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
468
|
+
query: this.responsiveFunc,
|
|
469
|
+
responsiveId: "Helmet"
|
|
470
|
+
}, function (_ref3) {
|
|
471
|
+
var tabletMode = _ref3.tabletMode;
|
|
472
|
+
return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], _extends({
|
|
473
|
+
animationStyle: animationStyle,
|
|
474
|
+
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
475
|
+
getRef: getContainerRef,
|
|
476
|
+
isActive: isPopupReady,
|
|
477
|
+
isAnimate: isAnimate,
|
|
478
|
+
isArrow: false,
|
|
479
|
+
onClick: removeClose,
|
|
480
|
+
isPadding: false,
|
|
481
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
482
|
+
htmlId: setAriaId,
|
|
483
|
+
a11y: {
|
|
484
|
+
role: 'listbox',
|
|
485
|
+
ariaMultiselectable: true
|
|
486
|
+
}
|
|
487
|
+
}, DropBoxProps, {
|
|
488
|
+
alignBox: "row",
|
|
489
|
+
isResponsivePadding: getFooter ? false : true
|
|
490
|
+
}), isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
491
|
+
align: "both",
|
|
492
|
+
className: _MultiSelectModule["default"].loader
|
|
493
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
494
|
+
flexible: true
|
|
495
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
496
|
+
customClass: _MultiSelectModule["default"].box,
|
|
497
|
+
onScroll: _this4.handleScroll
|
|
498
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
499
|
+
needSelectAll: needSelectAll,
|
|
500
|
+
onSelect: _this4.handleSelectAll,
|
|
501
|
+
selectAllText: selectAllText,
|
|
502
|
+
suggestions: suggestions,
|
|
503
|
+
dataId: dataIdSelectAllEle
|
|
504
|
+
})), /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
505
|
+
shrink: true,
|
|
506
|
+
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
507
|
+
eleRef: _this4.suggestionContainerRef
|
|
508
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
509
|
+
suggestions: suggestions,
|
|
510
|
+
selectedOptions: allselectedOptionIds,
|
|
511
|
+
getRef: _this4.suggestionItemRef,
|
|
512
|
+
hoverOption: hoverOption,
|
|
513
|
+
onClick: _this4.handleSelectOption,
|
|
514
|
+
onMouseEnter: _this4.handleMouseEnter,
|
|
515
|
+
needTick: true,
|
|
516
|
+
listItemSize: listItemSize,
|
|
517
|
+
a11y: {
|
|
518
|
+
role: 'option'
|
|
519
|
+
}
|
|
520
|
+
}, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
521
|
+
isLoading: isFetchingOptions,
|
|
522
|
+
options: options,
|
|
523
|
+
searchString: searchStr,
|
|
524
|
+
suggestions: suggestions,
|
|
525
|
+
dataId: dataIdLoading,
|
|
526
|
+
i18nKeys: i18nKeys,
|
|
527
|
+
htmlId: ariaErrorId
|
|
528
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
529
|
+
isCover: false,
|
|
530
|
+
align: "both"
|
|
531
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter()) : null)));
|
|
532
|
+
}) : null);
|
|
533
|
+
}
|
|
534
|
+
}]);
|
|
535
|
+
return AdvancedMultiSelectComponent;
|
|
536
|
+
}(_MultiSelect.MultiSelectComponent);
|
|
537
|
+
exports.AdvancedMultiSelectComponent = AdvancedMultiSelectComponent;
|
|
538
|
+
AdvancedMultiSelectComponent.propTypes = _propTypes.AdvancedMultiSelect_propTypes;
|
|
539
|
+
AdvancedMultiSelectComponent.defaultProps = _defaultProps.AdvancedMultiSelect_defaultProps;
|
|
540
|
+
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
541
|
+
var AdvancedMultiSelect = (0, _Popup["default"])(AdvancedMultiSelectComponent);
|
|
542
|
+
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
543
|
+
if (false) {
|
|
544
|
+
AdvancedMultiSelectComponent.docs = {
|
|
545
|
+
componentGroup: 'Form Elements',
|
|
546
|
+
folderName: 'Style Guide'
|
|
547
|
+
};
|
|
548
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
549
|
+
AdvancedMultiSelect.propTypes = AdvancedMultiSelectComponent.propTypes;
|
|
550
|
+
}
|
|
551
|
+
var _default = AdvancedMultiSelect;
|
|
552
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = require("./props/propTypes");
|
|
10
|
+
var _defaultProps = require("./props/defaultProps");
|
|
11
|
+
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
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); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
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); }; }
|
|
19
|
+
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); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
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; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
var EmptyState = /*#__PURE__*/function (_React$PureComponent) {
|
|
24
|
+
_inherits(EmptyState, _React$PureComponent);
|
|
25
|
+
var _super = _createSuper(EmptyState);
|
|
26
|
+
function EmptyState() {
|
|
27
|
+
_classCallCheck(this, EmptyState);
|
|
28
|
+
return _super.apply(this, arguments);
|
|
29
|
+
}
|
|
30
|
+
_createClass(EmptyState, [{
|
|
31
|
+
key: "render",
|
|
32
|
+
value: function render() {
|
|
33
|
+
var _this$props = this.props,
|
|
34
|
+
emptyMessage = _this$props.emptyMessage,
|
|
35
|
+
isLoading = _this$props.isLoading,
|
|
36
|
+
noMoreOptionsMessage = _this$props.noMoreOptionsMessage,
|
|
37
|
+
options = _this$props.options,
|
|
38
|
+
searchEmptyMessage = _this$props.searchEmptyMessage,
|
|
39
|
+
searchString = _this$props.searchString,
|
|
40
|
+
suggestions = _this$props.suggestions,
|
|
41
|
+
dataId = _this$props.dataId,
|
|
42
|
+
getCustomEmptyState = _this$props.getCustomEmptyState,
|
|
43
|
+
palette = _this$props.palette,
|
|
44
|
+
i18nKeys = _this$props.i18nKeys,
|
|
45
|
+
htmlId = _this$props.htmlId,
|
|
46
|
+
a11y = _this$props.a11y;
|
|
47
|
+
var _i18nKeys$loadingText = i18nKeys.loadingText,
|
|
48
|
+
loadingText = _i18nKeys$loadingText === void 0 ? 'Loading' : _i18nKeys$loadingText,
|
|
49
|
+
_i18nKeys$emptyText = i18nKeys.emptyText,
|
|
50
|
+
emptyText = _i18nKeys$emptyText === void 0 ? emptyMessage : _i18nKeys$emptyText,
|
|
51
|
+
_i18nKeys$noMoreText = i18nKeys.noMoreText,
|
|
52
|
+
noMoreText = _i18nKeys$noMoreText === void 0 ? noMoreOptionsMessage : _i18nKeys$noMoreText,
|
|
53
|
+
_i18nKeys$searchEmpty = i18nKeys.searchEmptyText,
|
|
54
|
+
searchEmptyText = _i18nKeys$searchEmpty === void 0 ? searchEmptyMessage : _i18nKeys$searchEmpty;
|
|
55
|
+
var className = " ".concat(_MultiSelectModule["default"][palette]);
|
|
56
|
+
var _a11y$role = a11y.role,
|
|
57
|
+
role = _a11y$role === void 0 ? 'alert' : _a11y$role;
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isLoading ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: className,
|
|
60
|
+
"data-id": "".concat(dataId, "_Loading"),
|
|
61
|
+
role: role,
|
|
62
|
+
id: htmlId
|
|
63
|
+
}, loadingText) : searchString.length && suggestions.length === 0 ? getCustomEmptyState ? getCustomEmptyState() : /*#__PURE__*/_react["default"].createElement("div", {
|
|
64
|
+
className: className,
|
|
65
|
+
"data-id": "".concat(dataId, "_srchEmptyMsg"),
|
|
66
|
+
role: role,
|
|
67
|
+
id: htmlId
|
|
68
|
+
}, searchEmptyText || emptyText) : options.length === 0 ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
69
|
+
className: className,
|
|
70
|
+
"data-id": "".concat(dataId, "_noOptnsMsg"),
|
|
71
|
+
role: role,
|
|
72
|
+
id: htmlId
|
|
73
|
+
}, emptyText) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
|
+
className: className,
|
|
75
|
+
"data-id": "".concat(dataId, "_NoMoreOptionMsg"),
|
|
76
|
+
role: role,
|
|
77
|
+
id: htmlId
|
|
78
|
+
}, noMoreText || emptyText));
|
|
79
|
+
}
|
|
80
|
+
}]);
|
|
81
|
+
return EmptyState;
|
|
82
|
+
}(_react["default"].PureComponent);
|
|
83
|
+
exports["default"] = EmptyState;
|
|
84
|
+
EmptyState.propTypes = _propTypes.EmptyState_propTypes;
|
|
85
|
+
EmptyState.defaultProps = _defaultProps.EmptyState_defaultProps;
|