@zohodesk/components 1.0.0-alpha-250 → 1.0.0-alpha-253
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 +24 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -1
- package/assets/Appearance/default/mode/defaultMode.module.css +2 -1
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +2 -1
- package/es/Accordion/Accordion.js +0 -7
- package/es/Accordion/AccordionItem.js +0 -4
- package/es/Animation/Animation.js +0 -3
- package/es/AppContainer/AppContainer.js +2 -13
- package/es/Avatar/Avatar.js +9 -22
- package/es/AvatarTeam/AvatarTeam.js +0 -3
- package/es/Button/Button.js +0 -4
- package/es/Buttongroup/Buttongroup.js +0 -3
- package/es/Card/Card.js +7 -22
- package/es/Card/props/defaultProps.js +0 -1
- package/es/Card/props/propTypes.js +2 -2
- package/es/CheckBox/CheckBox.js +0 -5
- package/es/DateTime/CalendarView.js +30 -36
- package/es/DateTime/DateTime.js +22 -77
- package/es/DateTime/DateTime.module.css +51 -5
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +23 -16
- package/es/DateTime/DateWidget.js +38 -103
- package/es/DateTime/DaysRow.js +4 -5
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +16 -32
- package/es/DateTime/YearView.module.css +19 -1
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -1
- package/es/DateTime/__tests__/DateTime.spec.js +0 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +3 -2
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -63
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -28
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/props/propTypes.js +4 -2
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +5 -28
- package/es/DropDown/DropDown.js +1 -9
- package/es/DropDown/DropDownHeading.js +5 -5
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/DropDown/props/propTypes.js +2 -1
- package/es/Heading/Heading.js +0 -2
- package/es/Heading/Heading.module.css +3 -3
- package/es/Label/Label.js +4 -4
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/props/propTypes.js +3 -3
- package/es/ListItem/ListContainer.js +4 -10
- package/es/ListItem/ListItem.js +0 -9
- package/es/ListItem/ListItemWithAvatar.js +1 -9
- package/es/ListItem/ListItemWithCheckBox.js +0 -7
- package/es/ListItem/ListItemWithIcon.js +0 -8
- package/es/ListItem/ListItemWithRadio.js +0 -7
- package/es/Modal/Modal.js +8 -28
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +11 -90
- package/es/MultiSelect/AdvancedMultiSelect.js +21 -39
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MultiSelect.js +53 -114
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +16 -17
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/Suggestions.js +5 -8
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/props/defaultProps.js +8 -4
- package/es/MultiSelect/props/propTypes.js +8 -6
- package/es/PopOver/PopOver.js +0 -18
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +2 -9
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Radio/Radio.js +0 -4
- package/es/Responsive/CustomResponsive.js +25 -31
- package/es/Responsive/RefWrapper.js +7 -6
- package/es/Responsive/ResizeComponent.js +25 -35
- package/es/Responsive/ResizeObserver.js +6 -26
- package/es/Responsive/Responsive.js +20 -34
- package/es/Responsive/sizeObservers.js +7 -28
- package/es/Responsive/utils/index.js +5 -7
- package/es/Responsive/utils/shallowCompare.js +2 -7
- package/es/Responsive/windowResizeObserver.js +0 -7
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +0 -4
- package/es/Ribbon/Ribbon.js +0 -3
- package/es/RippleEffect/RippleEffect.js +0 -1
- package/es/Select/GroupSelect.js +28 -67
- package/es/Select/Select.js +54 -101
- package/es/Select/Select.module.css +3 -0
- package/es/Select/SelectWithAvatar.js +15 -24
- package/es/Select/SelectWithIcon.js +75 -54
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/props/defaultProps.js +8 -4
- package/es/Select/props/propTypes.js +8 -5
- package/es/Stencils/Stencils.js +0 -3
- package/es/Switch/Switch.js +0 -5
- package/es/Tab/Tab.js +1 -4
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +16 -58
- package/es/Tab/Tabs.module.css +1 -1
- package/es/Tab/__tests__/Tab.spec.js +2 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tag/Tag.js +1 -6
- package/es/TextBox/TextBox.js +0 -15
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBoxIcon/TextBoxIcon.js +0 -7
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/Textarea/Textarea.js +0 -12
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +15 -59
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -7
- package/es/deprecated/PortalLayer/PortalLayer.js +17 -25
- package/es/index.js +108 -106
- package/es/semantic/Button/Button.js +0 -3
- package/es/utils/Common.js +23 -47
- package/es/utils/ContextOptimizer.js +5 -4
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +0 -2
- package/es/utils/datetime/common.js +5 -16
- package/es/utils/debounce.js +1 -5
- package/es/utils/dropDownUtils.js +11 -67
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/lib/Accordion/Accordion.js +10 -39
- package/lib/Accordion/AccordionItem.js +12 -38
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +12 -37
- package/lib/Animation/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +14 -52
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +29 -72
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/props/propTypes.js +0 -3
- package/lib/AvatarTeam/AvatarTeam.js +20 -47
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +19 -44
- package/lib/Button/__tests__/Button.spec.js +0 -40
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +5 -31
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +41 -102
- package/lib/Card/__tests__/Card.spec.js +1 -10
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/defaultProps.js +0 -1
- package/lib/Card/props/propTypes.js +2 -5
- package/lib/CheckBox/CheckBox.js +40 -69
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +44 -81
- package/lib/DateTime/DateTime.js +164 -245
- package/lib/DateTime/DateTime.module.css +51 -5
- package/lib/DateTime/DateTimePopupFooter.js +5 -30
- package/lib/DateTime/DateTimePopupHeader.js +33 -52
- package/lib/DateTime/DateWidget.js +246 -350
- package/lib/DateTime/DaysRow.js +4 -27
- package/lib/DateTime/Time.js +29 -72
- package/lib/DateTime/YearView.js +37 -79
- package/lib/DateTime/YearView.module.css +19 -1
- package/lib/DateTime/__tests__/CalendarView.spec.js +5 -13
- package/lib/DateTime/__tests__/DateTime.spec.js +37 -51
- package/lib/DateTime/__tests__/DateWidget.spec.js +8 -10
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -184
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +12 -61
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +20 -52
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +4 -5
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +6 -69
- package/lib/DropBox/DropBox.js +58 -119
- package/lib/DropBox/__tests__/DropBox.spec.js +2 -6
- package/lib/DropBox/props/propTypes.js +0 -3
- package/lib/DropDown/DropDown.js +3 -53
- package/lib/DropDown/DropDownHeading.js +13 -35
- package/lib/DropDown/DropDownItem.js +17 -41
- package/lib/DropDown/DropDownSearch.js +15 -41
- package/lib/DropDown/DropDownSeparator.js +1 -23
- package/lib/DropDown/__tests__/DropDown.spec.js +9 -15
- package/lib/DropDown/__tests__/DropDownItem.spec.js +4 -9
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -3
- package/lib/DropDown/props/propTypes.js +2 -6
- package/lib/Heading/Heading.js +8 -35
- package/lib/Heading/Heading.module.css +3 -3
- package/lib/Heading/props/propTypes.js +0 -3
- package/lib/Label/Label.js +14 -37
- package/lib/Label/__tests__/Label.spec.js +1 -14
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +11 -31
- package/lib/Layout/Container.js +10 -29
- package/lib/Layout/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/index.js +0 -4
- package/lib/Layout/props/propTypes.js +3 -6
- package/lib/Layout/utils.js +0 -10
- package/lib/ListItem/ListContainer.js +28 -47
- package/lib/ListItem/ListItem.js +37 -66
- package/lib/ListItem/ListItemWithAvatar.js +41 -72
- package/lib/ListItem/ListItemWithCheckBox.js +32 -61
- package/lib/ListItem/ListItemWithIcon.js +36 -65
- package/lib/ListItem/ListItemWithRadio.js +33 -62
- package/lib/ListItem/props/propTypes.js +0 -5
- package/lib/Modal/Modal.js +4 -44
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +157 -289
- package/lib/MultiSelect/AdvancedMultiSelect.js +130 -203
- package/lib/MultiSelect/EmptyState.js +21 -44
- package/lib/MultiSelect/MultiSelect.js +216 -326
- package/lib/MultiSelect/MultiSelectHeader.js +5 -29
- package/lib/MultiSelect/MultiSelectWithAvatar.js +61 -98
- package/lib/MultiSelect/SelectedOptions.js +15 -44
- package/lib/MultiSelect/Suggestions.js +28 -60
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/props/defaultProps.js +8 -6
- package/lib/MultiSelect/props/propTypes.js +8 -9
- package/lib/PopOver/PopOver.js +44 -94
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +77 -156
- package/lib/Popup/__tests__/Popup.spec.js +5 -42
- package/lib/Popup/viewPort.js +14 -28
- package/lib/Provider/AvatarSize.js +0 -4
- package/lib/Provider/Config.js +0 -2
- package/lib/Provider/CssProvider.js +0 -4
- package/lib/Provider/IdProvider.js +3 -17
- package/lib/Provider/LibraryContext.js +10 -32
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +14 -43
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Radio/Radio.js +33 -60
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +30 -70
- package/lib/Responsive/RefWrapper.js +7 -15
- package/lib/Responsive/ResizeComponent.js +27 -58
- package/lib/Responsive/ResizeObserver.js +6 -23
- package/lib/Responsive/Responsive.js +24 -76
- package/lib/Responsive/index.js +0 -2
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +13 -51
- package/lib/Responsive/utils/index.js +3 -11
- package/lib/Responsive/utils/shallowCompare.js +2 -11
- package/lib/Responsive/windowResizeObserver.js +0 -8
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +14 -44
- package/lib/ResponsiveDropBox/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +7 -31
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +7 -18
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +138 -230
- package/lib/Select/Select.js +220 -301
- package/lib/Select/Select.module.css +3 -0
- package/lib/Select/SelectWithAvatar.js +61 -104
- package/lib/Select/SelectWithIcon.js +151 -144
- package/lib/Select/__tests__/Select.spec.js +89 -131
- package/lib/Select/props/defaultProps.js +7 -8
- package/lib/Select/props/propTypes.js +8 -8
- package/lib/Stencils/Stencils.js +4 -28
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +27 -55
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +23 -39
- package/lib/Tab/TabContent.js +4 -11
- package/lib/Tab/TabContentWrapper.js +5 -12
- package/lib/Tab/TabWrapper.js +16 -34
- package/lib/Tab/Tabs.js +94 -170
- package/lib/Tab/Tabs.module.css +1 -1
- package/lib/Tab/__tests__/Tab.spec.js +63 -74
- package/lib/Tab/__tests__/TabContent.spec.js +6 -10
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +20 -28
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -12
- package/lib/Tab/__tests__/Tabs.spec.js +39 -53
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +37 -70
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +52 -83
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/props/propTypes.js +0 -5
- package/lib/TextBoxIcon/TextBoxIcon.js +48 -80
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +5 -14
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +22 -52
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +29 -93
- package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -23
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +11 -39
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +18 -51
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/css.js +0 -39
- package/lib/deprecated/PortalLayer/PortalLayer.js +17 -45
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +76 -1075
- package/lib/semantic/Button/Button.js +17 -41
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/utils/Common.js +29 -95
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/__tests__/constructFullName.spec.js +0 -1
- package/lib/utils/__tests__/debounce.spec.js +2 -3
- package/lib/utils/__tests__/getInitial.spec.js +0 -1
- package/lib/utils/constructFullName.js +2 -11
- package/lib/utils/datetime/common.js +5 -32
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +54 -171
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +10 -5
- package/es/Accordion/docs/Accordion__Demo.docs.js +0 -80
- package/es/Animation/docs/Animation__default.docs.js +0 -34
- package/es/Animation/docs/Animation__fadeIn.docs.js +0 -34
- package/es/Animation/docs/Animation__scaleIn.docs.js +0 -34
- package/es/Animation/docs/Animation__skewIn.docs.js +0 -34
- package/es/Animation/docs/Animation__slideDown.docs.js +0 -34
- package/es/Animation/docs/Animation__slideLeft.docs.js +0 -34
- package/es/Animation/docs/Animation__zoomIn.docs.js +0 -34
- package/es/AppContainer/docs/AppContainer__default.docs.js +0 -20
- package/es/Avatar/docs/Avatar__custom.docs.js +0 -29
- package/es/Avatar/docs/Avatar__default.docs.js +0 -29
- package/es/Avatar/docs/Avatar__palette.docs.js +0 -49
- package/es/Avatar/docs/Avatar__text.docs.js +0 -28
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -73
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -31
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -50
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -49
- package/es/Button/docs/Button__custom.docs.js +0 -771
- package/es/Button/docs/Button__default.docs.js +0 -536
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -37
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -33
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -42
- package/es/Card/docs/Card__Custom.docs.js +0 -34
- package/es/Card/docs/Card__Default.docs.js +0 -37
- package/es/Card/docs/Card__Scroll.docs.js +0 -59
- package/es/CheckBox/docs/CheckBox__custom.docs.js +0 -293
- package/es/CheckBox/docs/CheckBox__default.docs.js +0 -219
- package/es/DateTime/docs/DateTime__default.docs.js +0 -91
- package/es/DateTime/docs/DateWidget__default.docs.js +0 -183
- package/es/DateTime/docs/timezonedata.json +0 -1
- package/es/DropBox/docs/DropBox__custom.docs.js +0 -66
- package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -92
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -91
- package/es/DropBox/docs/DropBox__position.docs.js +0 -87
- package/es/DropBox/docs/DropBox__size.docs.js +0 -61
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -23
- package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -21
- package/es/Heading/docs/Heading__default.docs.js +0 -21
- package/es/Label/docs/Label__clipped.docs.js +0 -27
- package/es/Label/docs/Label__custom.docs.js +0 -30
- package/es/Label/docs/Label__palette.docs.js +0 -42
- package/es/Label/docs/Label__size.docs.js +0 -29
- package/es/Label/docs/Label__type.docs.js +0 -37
- package/es/Layout/docs/Layout__Hidden.docs.js +0 -77
- package/es/Layout/docs/Layout__default.docs.js +0 -49
- package/es/Layout/docs/Layout__four_Column.docs.js +0 -79
- package/es/Layout/docs/Layout__three_Column.docs.js +0 -76
- package/es/Layout/docs/Layout__two_Column.docs.js +0 -69
- package/es/LightNightMode/Colors.json +0 -497
- package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -94
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -155
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -112
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -91
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -65
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -68
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -62
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -91
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -65
- package/es/ListItem/docs/ListItem__custom.docs.js +0 -114
- package/es/ListItem/docs/ListItem__default.docs.js +0 -82
- package/es/Modal/__docs__/Modal__default.docs.js +0 -46
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -125
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -114
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -141
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +0 -161
- package/es/PopOver/docs/PopOver__default.docs.js +0 -32
- package/es/Provider/docs/Provider_Id__Class.docs.js +0 -29
- package/es/Provider/docs/Provider_Id__Function.docs.js +0 -18
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +0 -32
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -23
- package/es/Provider.js +0 -95
- package/es/Radio/docs/Radio__custom.docs.js +0 -245
- package/es/Radio/docs/Radio__default.docs.js +0 -169
- package/es/Responsive/docs/Responsive__Custom.docs.js +0 -206
- package/es/Responsive/docs/Responsive__default.docs.js +0 -97
- package/es/Responsive/docs/style.module.css +0 -56
- package/es/Ribbon/docs/Ribbon__custom.docs.js +0 -386
- package/es/Ribbon/docs/Ribbon__default.docs.js +0 -342
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +0 -435
- package/es/Select/docs/GroupSelect__default.docs.js +0 -149
- package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -97
- package/es/Select/docs/SelectWithIcon__default.docs.js +0 -138
- package/es/Select/docs/Select__default.docs.js +0 -288
- package/es/Stencils/docs/Stencils__custom.docs.js +0 -45
- package/es/Stencils/docs/Stencils__default.docs.js +0 -50
- package/es/Switch/docs/Switch__custom.docs.js +0 -153
- package/es/Switch/docs/Switch__default.docs.js +0 -107
- package/es/Tab/docs/Tab__default.docs.js +0 -258
- package/es/Tab/docs/tabdocs.module.css +0 -29
- package/es/Tag/docs/Tag__custom.docs.js +0 -368
- package/es/Tag/docs/Tag__default.docs.js +0 -323
- package/es/TextBox/docs/TextBox__custom.docs.js +0 -43
- package/es/TextBox/docs/TextBox__default.docs.js +0 -40
- package/es/TextBox/docs/TextBox__size.docs.js +0 -38
- package/es/TextBox/docs/TextBox__variant.docs.js +0 -38
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -89
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -61
- package/es/Textarea/docs/Textarea__animated.docs.js +0 -41
- package/es/Textarea/docs/Textarea__custom.docs.js +0 -82
- package/es/Textarea/docs/Textarea__default.docs.js +0 -76
- package/es/Textarea/docs/Textarea__disabled.docs.js +0 -29
- package/es/Tooltip/docs/Tooltip__default.docs.js +0 -371
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -97
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -150
- package/es/common/docStyle.module.css +0 -766
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -72
- package/es/semantic/Button/docs/Button__default.docs.js +0 -20
- package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -126
- package/lib/Animation/docs/Animation__default.docs.js +0 -85
- package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -85
- package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -85
- package/lib/Animation/docs/Animation__skewIn.docs.js +0 -85
- package/lib/Animation/docs/Animation__slideDown.docs.js +0 -85
- package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -85
- package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -85
- package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -70
- package/lib/Avatar/docs/Avatar__custom.docs.js +0 -87
- package/lib/Avatar/docs/Avatar__default.docs.js +0 -83
- package/lib/Avatar/docs/Avatar__palette.docs.js +0 -107
- package/lib/Avatar/docs/Avatar__text.docs.js +0 -86
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -124
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -82
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -101
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -100
- package/lib/Button/docs/Button__custom.docs.js +0 -826
- package/lib/Button/docs/Button__default.docs.js +0 -590
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -89
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -85
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -98
- package/lib/Card/docs/Card__Custom.docs.js +0 -90
- package/lib/Card/docs/Card__Default.docs.js +0 -92
- package/lib/Card/docs/Card__Scroll.docs.js +0 -114
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +0 -348
- package/lib/CheckBox/docs/CheckBox__default.docs.js +0 -273
- package/lib/DateTime/docs/DateTime__default.docs.js +0 -142
- package/lib/DateTime/docs/DateWidget__default.docs.js +0 -240
- package/lib/DateTime/docs/timezonedata.json +0 -1
- package/lib/DropBox/docs/DropBox__custom.docs.js +0 -122
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +0 -141
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +0 -140
- package/lib/DropBox/docs/DropBox__position.docs.js +0 -142
- package/lib/DropBox/docs/DropBox__size.docs.js +0 -116
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -73
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -70
- package/lib/Heading/docs/Heading__default.docs.js +0 -74
- package/lib/Label/docs/Label__clipped.docs.js +0 -81
- package/lib/Label/docs/Label__custom.docs.js +0 -85
- package/lib/Label/docs/Label__palette.docs.js +0 -96
- package/lib/Label/docs/Label__size.docs.js +0 -83
- package/lib/Label/docs/Label__type.docs.js +0 -91
- package/lib/Layout/docs/Layout__Hidden.docs.js +0 -127
- package/lib/Layout/docs/Layout__default.docs.js +0 -98
- package/lib/Layout/docs/Layout__four_Column.docs.js +0 -129
- package/lib/Layout/docs/Layout__three_Column.docs.js +0 -126
- package/lib/Layout/docs/Layout__two_Column.docs.js +0 -119
- package/lib/LightNightMode/Colors.json +0 -497
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +0 -153
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -206
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -162
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -142
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -115
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -119
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -112
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -142
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -115
- package/lib/ListItem/docs/ListItem__custom.docs.js +0 -164
- package/lib/ListItem/docs/ListItem__default.docs.js +0 -131
- package/lib/Modal/__docs__/Modal__default.docs.js +0 -88
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -177
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -165
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -191
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +0 -214
- package/lib/PopOver/docs/PopOver__default.docs.js +0 -86
- package/lib/Provider/docs/Provider_Id__Class.docs.js +0 -77
- package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -29
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +0 -80
- package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -34
- package/lib/Provider.js +0 -175
- package/lib/Radio/docs/Radio__custom.docs.js +0 -299
- package/lib/Radio/docs/Radio__default.docs.js +0 -222
- package/lib/Responsive/docs/Responsive__Custom.docs.js +0 -272
- package/lib/Responsive/docs/Responsive__default.docs.js +0 -142
- package/lib/Responsive/docs/style.module.css +0 -56
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +0 -437
- package/lib/Ribbon/docs/Ribbon__default.docs.js +0 -392
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +0 -484
- package/lib/Select/docs/GroupSelect__default.docs.js +0 -199
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -152
- package/lib/Select/docs/SelectWithIcon__default.docs.js +0 -190
- package/lib/Select/docs/Select__default.docs.js +0 -340
- package/lib/Stencils/docs/Stencils__custom.docs.js +0 -96
- package/lib/Stencils/docs/Stencils__default.docs.js +0 -101
- package/lib/Switch/docs/Switch__custom.docs.js +0 -203
- package/lib/Switch/docs/Switch__default.docs.js +0 -156
- package/lib/Tab/docs/Tab__default.docs.js +0 -308
- package/lib/Tab/docs/tabdocs.module.css +0 -29
- package/lib/Tag/docs/Tag__custom.docs.js +0 -423
- package/lib/Tag/docs/Tag__default.docs.js +0 -377
- package/lib/TextBox/docs/TextBox__custom.docs.js +0 -98
- package/lib/TextBox/docs/TextBox__default.docs.js +0 -95
- package/lib/TextBox/docs/TextBox__size.docs.js +0 -93
- package/lib/TextBox/docs/TextBox__variant.docs.js +0 -93
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -145
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -117
- package/lib/Textarea/docs/Textarea__animated.docs.js +0 -95
- package/lib/Textarea/docs/Textarea__custom.docs.js +0 -137
- package/lib/Textarea/docs/Textarea__default.docs.js +0 -130
- package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -83
- package/lib/Tooltip/docs/Tooltip__default.docs.js +0 -430
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -150
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -206
- package/lib/common/docStyle.module.css +0 -766
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -145
- package/lib/semantic/Button/docs/Button__default.docs.js +0 -66
|
@@ -1,137 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.MultiSelectComponent = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("./props/propTypes");
|
|
13
|
-
|
|
14
10
|
var _defaultProps = require("./props/defaultProps");
|
|
15
|
-
|
|
16
11
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
17
|
-
|
|
18
12
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
19
|
-
|
|
20
13
|
var _Layout = require("../Layout");
|
|
21
|
-
|
|
22
14
|
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
23
|
-
|
|
24
15
|
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
25
|
-
|
|
26
16
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
27
|
-
|
|
28
17
|
var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
29
|
-
|
|
30
18
|
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
31
|
-
|
|
32
19
|
var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
|
|
33
|
-
|
|
34
20
|
var _IdProvider = require("../Provider/IdProvider");
|
|
35
|
-
|
|
36
21
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
37
|
-
|
|
38
22
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
39
|
-
|
|
23
|
+
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
40
24
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
41
|
-
|
|
42
25
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
43
|
-
|
|
44
26
|
var _Common = require("../utils/Common.js");
|
|
45
|
-
|
|
46
27
|
var _dropDownUtils = require("../utils/dropDownUtils");
|
|
47
|
-
|
|
48
28
|
var _Config = require("../Provider/Config");
|
|
49
|
-
|
|
50
29
|
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
|
-
|
|
52
30
|
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
|
-
|
|
54
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
55
|
-
|
|
56
32
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
57
|
-
|
|
58
33
|
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."); }
|
|
59
|
-
|
|
60
34
|
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
|
-
|
|
62
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
|
-
|
|
64
36
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
65
|
-
|
|
66
37
|
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
|
-
|
|
68
38
|
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
|
-
|
|
70
39
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
71
|
-
|
|
72
40
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
73
|
-
|
|
74
41
|
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
42
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
77
|
-
|
|
78
43
|
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); } }
|
|
79
|
-
|
|
80
44
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
81
|
-
|
|
82
45
|
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); }
|
|
83
|
-
|
|
84
46
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
85
|
-
|
|
86
47
|
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); }; }
|
|
87
|
-
|
|
88
48
|
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); }
|
|
89
|
-
|
|
90
49
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
91
|
-
|
|
92
50
|
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; } }
|
|
93
|
-
|
|
94
51
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
95
|
-
|
|
96
52
|
/* eslint-disable react/forbid-component-props */
|
|
97
|
-
|
|
98
53
|
/* eslint-disable react/no-unused-prop-types */
|
|
99
|
-
var dummyArray = [];
|
|
100
54
|
|
|
55
|
+
var dummyArray = [];
|
|
101
56
|
var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
102
57
|
_inherits(MultiSelectComponent, _React$Component);
|
|
103
|
-
|
|
104
58
|
var _super = _createSuper(MultiSelectComponent);
|
|
105
|
-
|
|
106
59
|
function MultiSelectComponent(props) {
|
|
107
60
|
var _this;
|
|
108
|
-
|
|
109
61
|
_classCallCheck(this, MultiSelectComponent);
|
|
110
|
-
|
|
111
62
|
_this = _super.call(this, props);
|
|
112
63
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
113
64
|
_this.getFilterSuggestions = (0, _dropDownUtils.makeGetMultiSelectFilterSuggestions)();
|
|
114
65
|
_this.formatOptions = (0, _dropDownUtils.makeFormatOptions)();
|
|
115
66
|
_this.getSelectedOptions = (0, _dropDownUtils.makeGetMultiSelectSelectedOptions)();
|
|
116
|
-
_this.getIsShowClearIcon = (0, _dropDownUtils.makeGetIsShowClearIcon)();
|
|
67
|
+
_this.getIsShowClearIcon = (0, _dropDownUtils.makeGetIsShowClearIcon)();
|
|
117
68
|
|
|
69
|
+
//Use in AdvancedMultiSelect component
|
|
118
70
|
_this.objectConcat = (0, _dropDownUtils.makeObjectConcat)();
|
|
119
71
|
_this.formatSelectedOptions = (0, _dropDownUtils.makeFormatOptions)();
|
|
120
72
|
var _this$props = _this.props,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
73
|
+
selectedOptions = _this$props.selectedOptions,
|
|
74
|
+
_this$props$searchDeb = _this$props.searchDebounceTime,
|
|
75
|
+
searchDebounceTime = _this$props$searchDeb === void 0 ? 500 : _this$props$searchDeb;
|
|
125
76
|
var _this$handleFormatOpt = _this.handleFormatOptions(_this.props),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
77
|
+
allOptions = _this$handleFormatOpt.allOptions,
|
|
78
|
+
normalizedAllOptions = _this$handleFormatOpt.normalizedAllOptions,
|
|
79
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
130
80
|
var _this$handleGetSelect = _this.handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, _this.props),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
81
|
+
formatSelectedOptions = _this$handleGetSelect.formatSelectedOptions,
|
|
82
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions,
|
|
83
|
+
selectedOptionIds = _this$handleGetSelect.selectedOptionIds;
|
|
135
84
|
_this.state = {
|
|
136
85
|
options: allOptions,
|
|
137
86
|
optionsNormalize: normalizedAllOptions,
|
|
@@ -148,50 +97,43 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
148
97
|
_this.allSelectedOptionsDetails = normalizedSelectedOptions;
|
|
149
98
|
_this.suggestionsOrder = [];
|
|
150
99
|
_this._isMounted = false;
|
|
151
|
-
|
|
152
100
|
_Common.bind.apply(_assertThisInitialized(_this), ['handleInputCick', 'handleFilterSuggestions', 'handleKeyDown', 'handleSelectAll', 'handleDeselectAll', 'handleSelectOption', 'handleRemoveOption', 'handleSearch', 'handleClickSelectedOption', 'handleChange', 'handlePopupClose', 'togglePopup', 'selectedOptionRef', 'searchInputRef', 'suggestionContainerRef', 'suggestionItemRef', 'selectedOptionContainerRef', 'handleActive', 'handleInactive', 'handleMouseEnter', 'handleFetchOptions', 'handleFormatOptions', 'handleGetSelectedOptions', 'handleComponentDidUpdate', 'handleInputFocus', 'handleExposedPublicMethods']);
|
|
153
|
-
|
|
154
101
|
_this.handleSearchOptions = (0, _Common.debounce)(_this.handleSearchOptions.bind(_assertThisInitialized(_this)), searchDebounceTime);
|
|
155
102
|
_this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));
|
|
156
103
|
_this.handleScrollFuncCall = (0, _Common.debounce)(_this.handleScrollFuncCall.bind(_assertThisInitialized(_this)), 500);
|
|
157
104
|
return _this;
|
|
158
105
|
}
|
|
159
|
-
|
|
160
106
|
_createClass(MultiSelectComponent, [{
|
|
161
107
|
key: "componentDidMount",
|
|
162
108
|
value: function componentDidMount() {
|
|
163
109
|
// let { suggestionContainer } = this;
|
|
164
110
|
this._isMounted = true;
|
|
165
|
-
this.handleExposedPublicMethods();
|
|
111
|
+
this.handleExposedPublicMethods();
|
|
112
|
+
// suggestionContainer &&
|
|
166
113
|
// suggestionContainer.addEventListener('scroll', this.handleScroll);
|
|
167
114
|
}
|
|
168
115
|
}, {
|
|
169
116
|
key: "componentWillReceiveProps",
|
|
170
117
|
value: function componentWillReceiveProps(nextProps) {
|
|
171
118
|
var _this2 = this;
|
|
172
|
-
|
|
173
119
|
var selectedOptions = nextProps.selectedOptions,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
120
|
+
options = nextProps.options,
|
|
121
|
+
valueField = nextProps.valueField,
|
|
122
|
+
textField = nextProps.textField,
|
|
123
|
+
prefixText = nextProps.prefixText;
|
|
178
124
|
var oldProps = this.props;
|
|
179
|
-
|
|
180
125
|
if (selectedOptions !== oldProps.selectedOptions || options !== oldProps.options || valueField !== oldProps.valueField || textField !== oldProps.textField || prefixText !== oldProps.prefixText //For GroupMultiSelect component
|
|
181
126
|
) {
|
|
182
127
|
var _this$handleFormatOpt2 = this.handleFormatOptions(nextProps),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
128
|
+
allOptions = _this$handleFormatOpt2.allOptions,
|
|
129
|
+
normalizedAllOptions = _this$handleFormatOpt2.normalizedAllOptions,
|
|
130
|
+
normalizedFormatOptions = _this$handleFormatOpt2.normalizedFormatOptions;
|
|
187
131
|
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
188
132
|
var optionsDetails = Object.assign({}, oldAllSelectedOptionsDetails, normalizedFormatOptions);
|
|
189
|
-
|
|
190
133
|
var _this$handleGetSelect2 = this.handleGetSelectedOptions(selectedOptions, optionsDetails, nextProps),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
134
|
+
formatSelectedOptions = _this$handleGetSelect2.formatSelectedOptions,
|
|
135
|
+
normalizedSelectedOptions = _this$handleGetSelect2.normalizedSelectedOptions,
|
|
136
|
+
selectedOptionIds = _this$handleGetSelect2.selectedOptionIds;
|
|
195
137
|
this.allSelectedOptionsDetails = Object.assign(oldAllSelectedOptionsDetails, normalizedSelectedOptions);
|
|
196
138
|
this.setState({
|
|
197
139
|
options: allOptions,
|
|
@@ -200,16 +142,11 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
200
142
|
selectedOptionIds: selectedOptionIds
|
|
201
143
|
}, function () {
|
|
202
144
|
var hoverOption = _this2.state.hoverOption;
|
|
203
|
-
|
|
204
145
|
var suggestions = _this2.handleFilterSuggestions();
|
|
205
|
-
|
|
206
146
|
var suggestionsLen = suggestions.length;
|
|
207
|
-
|
|
208
147
|
var _ref = suggestions[hoverOption] || {},
|
|
209
|
-
|
|
210
|
-
|
|
148
|
+
id = _ref.id;
|
|
211
149
|
var newHoverOption = !(0, _Common.getIsEmptyValue)(id) ? hoverOption : suggestionsLen ? suggestionsLen - 1 : 0;
|
|
212
|
-
|
|
213
150
|
_this2.setState({
|
|
214
151
|
hoverOption: newHoverOption
|
|
215
152
|
});
|
|
@@ -220,23 +157,23 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
220
157
|
key: "componentDidUpdate",
|
|
221
158
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
222
159
|
var suggestionContainer = this.suggestionContainer,
|
|
223
|
-
|
|
224
|
-
|
|
160
|
+
selectedOptionContainer = this.selectedOptionContainer,
|
|
161
|
+
suggestionsOrder = this.suggestionsOrder;
|
|
225
162
|
var _this$state = this.state,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
163
|
+
hoverOption = _this$state.hoverOption,
|
|
164
|
+
highLightedSelectOptions = _this$state.highLightedSelectOptions,
|
|
165
|
+
selectedOptions = _this$state.selectedOptions,
|
|
166
|
+
searchStr = _this$state.searchStr;
|
|
230
167
|
var _this$props2 = this.props,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
168
|
+
needLocalSearch = _this$props2.needLocalSearch,
|
|
169
|
+
isPopupOpen = _this$props2.isPopupOpen,
|
|
170
|
+
onDropBoxClose = _this$props2.onDropBoxClose,
|
|
171
|
+
onDropBoxOpen = _this$props2.onDropBoxOpen,
|
|
172
|
+
isSearchClearOnClose = _this$props2.isSearchClearOnClose;
|
|
236
173
|
|
|
174
|
+
//handle dropbox open & close
|
|
237
175
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
238
176
|
isPopupOpen && onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
|
|
239
|
-
|
|
240
177
|
if (!isPopupOpen) {
|
|
241
178
|
this.setState({
|
|
242
179
|
hoverOption: 0
|
|
@@ -244,35 +181,36 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
244
181
|
isSearchClearOnClose && searchStr && this.handleSearch('');
|
|
245
182
|
onDropBoxClose && onDropBoxClose();
|
|
246
183
|
}
|
|
247
|
-
}
|
|
248
|
-
|
|
184
|
+
}
|
|
249
185
|
|
|
186
|
+
//scrollTo handling
|
|
250
187
|
var hoverId = suggestionsOrder[hoverOption] || '';
|
|
251
188
|
var selectedSuggestion = this["suggestion_".concat(hoverId)];
|
|
252
189
|
var lastHighLightedSelectOption = highLightedSelectOptions.slice(-1).length ? highLightedSelectOptions.slice(-1)[0] : null;
|
|
253
190
|
var selectedOption = this["selectedOption_".concat(lastHighLightedSelectOption)];
|
|
254
191
|
isPopupOpen && (0, _Common.scrollTo)(suggestionContainer, selectedSuggestion);
|
|
255
|
-
selectedOptions.length && selectedOption && (0, _Common.scrollTo)(selectedOptionContainer, selectedOption);
|
|
192
|
+
selectedOptions.length && selectedOption && (0, _Common.scrollTo)(selectedOptionContainer, selectedOption);
|
|
256
193
|
|
|
194
|
+
//When suggestions length less than 5, getNextOptions function call
|
|
257
195
|
var _this$props3 = this.props,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
196
|
+
isNextOptions = _this$props3.isNextOptions,
|
|
197
|
+
getNextOptions = _this$props3.getNextOptions;
|
|
198
|
+
// let { searchStr } = this.state;
|
|
261
199
|
var suggestions = this.handleFilterSuggestions();
|
|
262
200
|
var suggestionsLen = suggestions.length;
|
|
263
|
-
|
|
264
201
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
265
202
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
266
|
-
}
|
|
267
|
-
|
|
203
|
+
}
|
|
268
204
|
|
|
205
|
+
//Need To MultiselectNew Component
|
|
269
206
|
this.handleComponentDidUpdate(prevProps, prevState);
|
|
270
207
|
}
|
|
271
208
|
}, {
|
|
272
209
|
key: "componentWillUnmount",
|
|
273
210
|
value: function componentWillUnmount() {
|
|
274
211
|
// let { suggestionContainer } = this;
|
|
275
|
-
this._isMounted = false;
|
|
212
|
+
this._isMounted = false;
|
|
213
|
+
// suggestionContainer &&
|
|
276
214
|
// suggestionContainer.removeEventListener('scroll', this.handleScroll);
|
|
277
215
|
}
|
|
278
216
|
}, {
|
|
@@ -284,10 +222,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
284
222
|
key: "handleFormatOptions",
|
|
285
223
|
value: function handleFormatOptions(props) {
|
|
286
224
|
var options = props.options,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
225
|
+
valueField = props.valueField,
|
|
226
|
+
textField = props.textField,
|
|
227
|
+
prefixText = props.prefixText,
|
|
228
|
+
disabledOptions = props.disabledOptions;
|
|
291
229
|
return this.formatOptions({
|
|
292
230
|
options: options,
|
|
293
231
|
valueField: valueField,
|
|
@@ -310,10 +248,9 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
310
248
|
value: function handleInputCick(e) {
|
|
311
249
|
var removeClose = this.props.removeClose;
|
|
312
250
|
var _this$state2 = this.state,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
251
|
+
highLightedSelectOptions = _this$state2.highLightedSelectOptions,
|
|
252
|
+
_this$state2$searchSt = _this$state2.searchStr,
|
|
253
|
+
searchStr = _this$state2$searchSt === void 0 ? '' : _this$state2$searchSt;
|
|
317
254
|
if (highLightedSelectOptions.length) {
|
|
318
255
|
this.setState({
|
|
319
256
|
highLightedSelectOptions: [],
|
|
@@ -331,23 +268,21 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
331
268
|
key: "handleFilterSuggestions",
|
|
332
269
|
value: function handleFilterSuggestions() {
|
|
333
270
|
var _this$state3 = this.state,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
271
|
+
_this$state3$options = _this$state3.options,
|
|
272
|
+
options = _this$state3$options === void 0 ? dummyArray : _this$state3$options,
|
|
273
|
+
_this$state3$searchSt = _this$state3.searchStr,
|
|
274
|
+
searchStr = _this$state3$searchSt === void 0 ? '' : _this$state3$searchSt;
|
|
338
275
|
var _this$props4 = this.props,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
276
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
277
|
+
needLocalSearch = _this$props4.needLocalSearch;
|
|
342
278
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
279
|
+
options: options,
|
|
280
|
+
selectedOptions: selectedOptions,
|
|
281
|
+
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
282
|
+
needSearch: needLocalSearch
|
|
283
|
+
}),
|
|
284
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
285
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
351
286
|
this.suggestionsOrder = suggestionIds;
|
|
352
287
|
return suggestions;
|
|
353
288
|
}
|
|
@@ -355,45 +290,38 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
355
290
|
key: "handleKeyDown",
|
|
356
291
|
value: function handleKeyDown(e) {
|
|
357
292
|
var keyCode = e.keyCode,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
293
|
+
ctrlKey = e.ctrlKey,
|
|
294
|
+
metaKey = e.metaKey,
|
|
295
|
+
shiftKey = e.shiftKey;
|
|
361
296
|
var suggestions = [];
|
|
362
297
|
var _this$state4 = this.state,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
298
|
+
hoverOption = _this$state4.hoverOption,
|
|
299
|
+
searchStr = _this$state4.searchStr,
|
|
300
|
+
highLightedSelectOptions = _this$state4.highLightedSelectOptions,
|
|
301
|
+
lastHighLightedSelectOption = _this$state4.lastHighLightedSelectOption,
|
|
302
|
+
shiftKeyPressHighLighted = _this$state4.shiftKeyPressHighLighted,
|
|
303
|
+
selectedOptions = _this$state4.selectedOptionIds;
|
|
369
304
|
var _this$props5 = this.props,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
305
|
+
isNextOptions = _this$props5.isNextOptions,
|
|
306
|
+
getNextOptions = _this$props5.getNextOptions,
|
|
307
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
308
|
+
isPopupOpenOnEnter = _this$props5.isPopupOpenOnEnter,
|
|
309
|
+
onKeyDown = _this$props5.onKeyDown;
|
|
375
310
|
var highLightedSelectOptionsLen = highLightedSelectOptions.length;
|
|
376
|
-
|
|
377
311
|
if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13 || keyCode === 27 || keyCode === 9)) {
|
|
378
312
|
suggestions = this.handleFilterSuggestions();
|
|
379
313
|
}
|
|
380
|
-
|
|
381
314
|
if (!isPopupOpen && !isPopupOpenOnEnter) {
|
|
382
315
|
onKeyDown && onKeyDown(e);
|
|
383
316
|
}
|
|
384
|
-
|
|
385
317
|
if (!isPopupOpen && keyCode === 40) {
|
|
386
318
|
//down arrow press popup open
|
|
387
319
|
e.preventDefault(); //prevent body scroll
|
|
388
|
-
|
|
389
320
|
this.togglePopup(e);
|
|
390
321
|
}
|
|
391
|
-
|
|
392
322
|
var suggestionsLen = suggestions.length;
|
|
393
|
-
|
|
394
323
|
if (suggestionsLen && isPopupOpen && keyCode === 38) {
|
|
395
324
|
//up arrow
|
|
396
|
-
|
|
397
325
|
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
398
326
|
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
399
327
|
}*/
|
|
@@ -404,7 +332,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
404
332
|
}
|
|
405
333
|
} else if (suggestionsLen && isPopupOpen && keyCode === 40) {
|
|
406
334
|
//down arrow
|
|
407
|
-
|
|
408
335
|
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
409
336
|
//disable last to first option higlight
|
|
410
337
|
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
@@ -430,7 +357,8 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
430
357
|
if (highLightedSelectOptionsLen) {
|
|
431
358
|
this.handleRemoveOption(highLightedSelectOptions);
|
|
432
359
|
} else {
|
|
433
|
-
this.handleRemoveOption(selectedOptions.slice(-1));
|
|
360
|
+
this.handleRemoveOption(selectedOptions.slice(-1));
|
|
361
|
+
// this.setState({
|
|
434
362
|
// highLightedSelectOptions: selectedOptions.slice(-1)
|
|
435
363
|
// });
|
|
436
364
|
}
|
|
@@ -445,7 +373,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
445
373
|
var lastHighLightedSelectOptionIndex = lastHighLightedSelectOption && selectedOptions.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptions.indexOf(lastHighLightedSelectOption) : 0;
|
|
446
374
|
var newShiftKeyPressHighLighted = shiftKeyPressHighLighted ? shiftKeyPressHighLighted : shiftKeyPressHighLighted + 1;
|
|
447
375
|
var newHighLightedSelectOption = lastHighLightedSelectOptionIndex !== null ? selectedOptions[lastHighLightedSelectOptionIndex + newShiftKeyPressHighLighted] : selectedOptions[0];
|
|
448
|
-
|
|
449
376
|
if (!(0, _Common.getIsEmptyValue)(newHighLightedSelectOption)) {
|
|
450
377
|
var newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions[0];
|
|
451
378
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
@@ -462,22 +389,15 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
462
389
|
} else if (keyCode === 37 && shiftKey && selectedOptions.length && !searchStr.length) {
|
|
463
390
|
// shift+left arrow=37
|
|
464
391
|
var _lastHighLightedSelectOptionIndex = lastHighLightedSelectOption ? selectedOptions.indexOf(lastHighLightedSelectOption) : selectedOptions.length - 1;
|
|
465
|
-
|
|
466
392
|
var _newShiftKeyPressHighLighted = shiftKeyPressHighLighted !== 1 ? shiftKeyPressHighLighted : shiftKeyPressHighLighted - 1;
|
|
467
|
-
|
|
468
393
|
var _newHighLightedSelectOption = selectedOptions[_lastHighLightedSelectOptionIndex + _newShiftKeyPressHighLighted - 1];
|
|
469
|
-
|
|
470
394
|
if (!(0, _Common.getIsEmptyValue)(_newHighLightedSelectOption)) {
|
|
471
395
|
var _newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions.slice(-1)[0];
|
|
472
|
-
|
|
473
396
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [_newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
474
|
-
|
|
475
397
|
var _isRemove = highLightedSelectOptions.indexOf(_newHighLightedSelectOption) >= 0 && _newHighLightedSelectOption !== lastHighLightedSelectOption ? true : false;
|
|
476
|
-
|
|
477
398
|
var _newHighLightedSelectOptions = _isRemove ? highLightedSelectOptions.filter(function (option) {
|
|
478
399
|
return option !== _newHighLightedSelectOption;
|
|
479
400
|
}) : [].concat(_toConsumableArray(highLightedSelectOptions), [_newHighLightedSelectOption]);
|
|
480
|
-
|
|
481
401
|
this.setState({
|
|
482
402
|
highLightedSelectOptions: _newHighLightedSelectOptions,
|
|
483
403
|
shiftKeyPressHighLighted: _newShiftKeyPressHighLighted - 1,
|
|
@@ -485,19 +405,16 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
485
405
|
});
|
|
486
406
|
}
|
|
487
407
|
} else if ((keyCode === 39 || keyCode === 37) && selectedOptions.length && !searchStr.length) {
|
|
488
|
-
var isRightArrow = keyCode === 39 ? true : false;
|
|
489
|
-
|
|
408
|
+
var isRightArrow = keyCode === 39 ? true : false;
|
|
409
|
+
// let isLefttArrow = keyCode === 37 ? true : false;
|
|
490
410
|
if (highLightedSelectOptions.length) {
|
|
491
411
|
var _highLightedSelectOpt = highLightedSelectOptions.slice(-1),
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
412
|
+
_highLightedSelectOpt2 = _slicedToArray(_highLightedSelectOpt, 1),
|
|
413
|
+
_lastHighLightedSelectOption = _highLightedSelectOpt2[0];
|
|
495
414
|
var _lastHighLightedSelectOptionIndex2 = selectedOptions.indexOf(_lastHighLightedSelectOption);
|
|
496
|
-
|
|
497
415
|
var newLastHighLightedSelectOptionIndex = isRightArrow ? _lastHighLightedSelectOptionIndex2 === selectedOptions.length - 1 ? _lastHighLightedSelectOptionIndex2 : _lastHighLightedSelectOptionIndex2 + 1 : _lastHighLightedSelectOptionIndex2 - 1;
|
|
498
416
|
var _newLastHighLightedSelectOption2 = selectedOptions[newLastHighLightedSelectOptionIndex];
|
|
499
417
|
var isEmptyHighlighted = isRightArrow && highLightedSelectOptions.length === 1 && selectedOptions.slice(-1)[0] === _lastHighLightedSelectOption ? true : false;
|
|
500
|
-
|
|
501
418
|
if (!(0, _Common.getIsEmptyValue)(_newLastHighLightedSelectOption2)) {
|
|
502
419
|
this.setState({
|
|
503
420
|
lastHighLightedSelectOption: isEmptyHighlighted ? '' : _newLastHighLightedSelectOption2,
|
|
@@ -507,16 +424,16 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
507
424
|
}
|
|
508
425
|
} else {
|
|
509
426
|
var _ref2 = isRightArrow ? selectedOptions : selectedOptions.slice(-1),
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
427
|
+
_ref3 = _slicedToArray(_ref2, 1),
|
|
428
|
+
_newLastHighLightedSelectOption3 = _ref3[0];
|
|
513
429
|
this.setState({
|
|
514
430
|
lastHighLightedSelectOption: _newLastHighLightedSelectOption3,
|
|
515
431
|
highLightedSelectOptions: [_newLastHighLightedSelectOption3],
|
|
516
432
|
shiftKeyPressHighLighted: 0
|
|
517
433
|
});
|
|
518
434
|
}
|
|
519
|
-
} else if (keyCode === 27) {
|
|
435
|
+
} else if (keyCode === 27) {
|
|
436
|
+
// this.handlePopupClose(e);
|
|
520
437
|
} else if (keyCode === 9) {
|
|
521
438
|
this.handlePopupClose(e);
|
|
522
439
|
}
|
|
@@ -530,12 +447,12 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
530
447
|
var newSelectedOptions = [];
|
|
531
448
|
suggestions.forEach(function (option) {
|
|
532
449
|
var id = option.id;
|
|
533
|
-
|
|
534
450
|
if (selectedOptions.indexOf(id) === -1) {
|
|
535
451
|
newSelectedOptions.push(id);
|
|
536
452
|
}
|
|
537
453
|
});
|
|
538
|
-
this.handleChange([].concat(_toConsumableArray(selectedOptions), newSelectedOptions));
|
|
454
|
+
this.handleChange([].concat(_toConsumableArray(selectedOptions), newSelectedOptions));
|
|
455
|
+
// this.handlePopupClose(e);
|
|
539
456
|
}
|
|
540
457
|
}, {
|
|
541
458
|
key: "handleDeselectAll",
|
|
@@ -543,14 +460,12 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
543
460
|
e && e.preventDefault();
|
|
544
461
|
var removeClose = this.props.removeClose;
|
|
545
462
|
var highLightedSelectOptions = this.state.highLightedSelectOptions;
|
|
546
|
-
|
|
547
463
|
if (highLightedSelectOptions.length) {
|
|
548
464
|
this.setState({
|
|
549
465
|
highLightedSelectOptions: [],
|
|
550
466
|
lastHighLightedSelectOption: ''
|
|
551
467
|
});
|
|
552
468
|
}
|
|
553
|
-
|
|
554
469
|
removeClose(e);
|
|
555
470
|
this.handleChange([]);
|
|
556
471
|
}
|
|
@@ -558,28 +473,26 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
558
473
|
key: "handleSelectOption",
|
|
559
474
|
value: function handleSelectOption(option, value, index, e) {
|
|
560
475
|
var _this$props6 = this.props,
|
|
561
|
-
|
|
562
|
-
|
|
476
|
+
selectedOptions = _this$props6.selectedOptions,
|
|
477
|
+
isSearchClearOnSelect = _this$props6.isSearchClearOnSelect;
|
|
563
478
|
var searchStr = this.state.searchStr;
|
|
564
|
-
|
|
565
479
|
if (searchStr.trim() != '' && isSearchClearOnSelect) {
|
|
566
480
|
this.handleSearch('');
|
|
567
481
|
}
|
|
568
|
-
|
|
569
|
-
|
|
482
|
+
this.handleChange([].concat(_toConsumableArray(selectedOptions), [option]), e);
|
|
483
|
+
// e && e.stopPropagation && this.handlePopupClose(e);
|
|
570
484
|
}
|
|
571
485
|
}, {
|
|
572
486
|
key: "handleRemoveOption",
|
|
573
487
|
value: function handleRemoveOption(options) {
|
|
574
488
|
var newOptions = !(0, _Common.getIsEmptyValue)(options) && !Array.isArray(options) ? [options] : options;
|
|
575
489
|
var _this$props7 = this.props,
|
|
576
|
-
|
|
577
|
-
|
|
490
|
+
selectedOptions = _this$props7.selectedOptions,
|
|
491
|
+
isReadOnly = _this$props7.isReadOnly;
|
|
578
492
|
var _this$state5 = this.state,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
493
|
+
highLightedSelectOptions = _this$state5.highLightedSelectOptions,
|
|
494
|
+
lastHighLightedSelectOption = _this$state5.lastHighLightedSelectOption,
|
|
495
|
+
shiftKeyPressHighLighted = _this$state5.shiftKeyPressHighLighted;
|
|
583
496
|
if (newOptions.length && !isReadOnly) {
|
|
584
497
|
var newSelectedOptions = selectedOptions.filter(function (option) {
|
|
585
498
|
return newOptions.indexOf(option) === -1;
|
|
@@ -589,16 +502,13 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
589
502
|
});
|
|
590
503
|
var isHighlightedRemoved = false;
|
|
591
504
|
var newOptionsLen = newOptions.length;
|
|
592
|
-
|
|
593
505
|
for (var i = 0; i < newOptionsLen; i++) {
|
|
594
506
|
var removedOption = newOptions[i];
|
|
595
|
-
|
|
596
507
|
if (highLightedSelectOptions.indexOf(removedOption) >= 0) {
|
|
597
508
|
isHighlightedRemoved = true;
|
|
598
509
|
break;
|
|
599
510
|
}
|
|
600
511
|
}
|
|
601
|
-
|
|
602
512
|
this.setState({
|
|
603
513
|
lastHighLightedSelectOption: newSelectedOptions.indexOf(lastHighLightedSelectOption) >= 0 && !isHighlightedRemoved ? lastHighLightedSelectOption : '',
|
|
604
514
|
highLightedSelectOptions: isHighlightedRemoved ? [] : newHighLightedSelectOptions,
|
|
@@ -606,7 +516,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
606
516
|
});
|
|
607
517
|
this.handleChange(newSelectedOptions);
|
|
608
518
|
}
|
|
609
|
-
|
|
610
519
|
this.searchInput && this.searchInput.focus({
|
|
611
520
|
preventScroll: true
|
|
612
521
|
});
|
|
@@ -618,7 +527,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
618
527
|
var hoverOption = this.state.hoverOption;
|
|
619
528
|
var suggestionsOrder = this.suggestionsOrder;
|
|
620
529
|
var newHoverIndex = suggestionsOrder.indexOf(id);
|
|
621
|
-
|
|
622
530
|
if (newHoverIndex !== hoverOption) {
|
|
623
531
|
this.setState({
|
|
624
532
|
hoverOption: newHoverIndex
|
|
@@ -629,22 +537,18 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
629
537
|
key: "handleFetchOptions",
|
|
630
538
|
value: function handleFetchOptions() {
|
|
631
539
|
var _this3 = this;
|
|
632
|
-
|
|
633
540
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
634
541
|
args[_key] = arguments[_key];
|
|
635
542
|
}
|
|
636
|
-
|
|
637
543
|
var APICall = args[0],
|
|
638
|
-
|
|
544
|
+
searchStr = args[1];
|
|
639
545
|
var isFetchingOptions = this.state.isFetchingOptions;
|
|
640
546
|
var _isMounted = this._isMounted;
|
|
641
547
|
var isForce = isFetchingOptions && searchStr ? true : false;
|
|
642
|
-
|
|
643
548
|
if (!isFetchingOptions && APICall || isForce) {
|
|
644
549
|
this.setState({
|
|
645
550
|
isFetchingOptions: true
|
|
646
551
|
});
|
|
647
|
-
|
|
648
552
|
try {
|
|
649
553
|
return APICall(searchStr).then(function () {
|
|
650
554
|
_isMounted && _this3.setState({
|
|
@@ -673,13 +577,12 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
673
577
|
key: "handleSearch",
|
|
674
578
|
value: function handleSearch(value, e) {
|
|
675
579
|
var _this4 = this;
|
|
676
|
-
|
|
677
580
|
var _this$props8 = this.props,
|
|
678
|
-
|
|
679
|
-
|
|
581
|
+
onSearch = _this$props8.onSearch,
|
|
582
|
+
isPopupOpen = _this$props8.isPopupOpen;
|
|
680
583
|
!isPopupOpen && e && this.togglePopup(e);
|
|
681
584
|
var _this$state$searchStr = this.state.searchStr,
|
|
682
|
-
|
|
585
|
+
searchStr = _this$state$searchStr === void 0 ? '' : _this$state$searchStr;
|
|
683
586
|
var searchStrRegex = (0, _Common.getSearchString)(searchStr);
|
|
684
587
|
var valueStrRegex = (0, _Common.getSearchString)(value);
|
|
685
588
|
var isSearch = searchStrRegex !== valueStrRegex ? true : false;
|
|
@@ -700,22 +603,19 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
700
603
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
701
604
|
var selectedOptions = this.props.selectedOptions;
|
|
702
605
|
var _this$state6 = this.state,
|
|
703
|
-
|
|
704
|
-
|
|
606
|
+
highLightedSelectOptions = _this$state6.highLightedSelectOptions,
|
|
607
|
+
lastHighLightedSelectOption = _this$state6.lastHighLightedSelectOption;
|
|
705
608
|
var metaKey = e.metaKey,
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
609
|
+
ctrlKey = e.ctrlKey,
|
|
610
|
+
shiftKey = e.shiftKey;
|
|
709
611
|
if (e && shiftKey) {
|
|
710
612
|
//shift+click
|
|
711
613
|
var from = selectedOptions.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptions.indexOf(lastHighLightedSelectOption) : 0;
|
|
712
614
|
var to = id && selectedOptions.indexOf(id) >= 0 ? selectedOptions.indexOf(id) : null;
|
|
713
|
-
|
|
714
615
|
if (to >= 0 && to < from) {
|
|
715
616
|
var _ref4 = [from, from = to];
|
|
716
617
|
to = _ref4[0];
|
|
717
618
|
}
|
|
718
|
-
|
|
719
619
|
to += 1;
|
|
720
620
|
var newSelectedHighlights = to ? selectedOptions.slice(from, to) : [];
|
|
721
621
|
to && this.setState({
|
|
@@ -726,7 +626,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
726
626
|
//ctrl+click
|
|
727
627
|
var isRemove = highLightedSelectOptions.indexOf(id) >= 0;
|
|
728
628
|
var _newSelectedHighlights = [];
|
|
729
|
-
|
|
730
629
|
if (isRemove) {
|
|
731
630
|
lastHighLightedSelectOption = id === lastHighLightedSelectOption ? '' : lastHighLightedSelectOption;
|
|
732
631
|
_newSelectedHighlights = highLightedSelectOptions.filter(function (option) {
|
|
@@ -736,7 +635,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
736
635
|
lastHighLightedSelectOption = id;
|
|
737
636
|
_newSelectedHighlights = [].concat(_toConsumableArray(highLightedSelectOptions), [id]);
|
|
738
637
|
}
|
|
739
|
-
|
|
740
638
|
this.setState({
|
|
741
639
|
highLightedSelectOptions: _newSelectedHighlights,
|
|
742
640
|
lastHighLightedSelectOption: lastHighLightedSelectOption
|
|
@@ -747,7 +645,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
747
645
|
lastHighLightedSelectOption: id
|
|
748
646
|
});
|
|
749
647
|
}
|
|
750
|
-
|
|
751
648
|
this.setState({
|
|
752
649
|
shiftKeyPressHighLighted: 0
|
|
753
650
|
});
|
|
@@ -758,18 +655,18 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
758
655
|
}, {
|
|
759
656
|
key: "handleScroll",
|
|
760
657
|
value: function handleScroll(e) {
|
|
761
|
-
var
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
this.handleScrollFuncCall();
|
|
765
|
-
}
|
|
658
|
+
var ele = e.target;
|
|
659
|
+
var isScrollReachedBottom = (0, _Common.findScrollEnd)(ele);
|
|
660
|
+
isScrollReachedBottom && this.handleScrollFuncCall();
|
|
766
661
|
}
|
|
767
662
|
}, {
|
|
768
663
|
key: "handleScrollFuncCall",
|
|
769
664
|
value: function handleScrollFuncCall() {
|
|
770
|
-
var
|
|
665
|
+
var _this$props9 = this.props,
|
|
666
|
+
getNextOptions = _this$props9.getNextOptions,
|
|
667
|
+
isNextOptions = _this$props9.isNextOptions;
|
|
771
668
|
var searchStr = this.state.searchStr;
|
|
772
|
-
getNextOptions && getNextOptions
|
|
669
|
+
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
773
670
|
}
|
|
774
671
|
}, {
|
|
775
672
|
key: "handleChange",
|
|
@@ -777,35 +674,30 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
777
674
|
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
778
675
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
779
676
|
var optionsNormalize = this.state.optionsNormalize;
|
|
780
|
-
var _this$
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
677
|
+
var _this$props10 = this.props,
|
|
678
|
+
onChange = _this$props10.onChange,
|
|
679
|
+
needToCloseOnSelect = _this$props10.needToCloseOnSelect,
|
|
680
|
+
togglePopup = _this$props10.togglePopup,
|
|
681
|
+
propSelectedOptions = _this$props10.selectedOptions,
|
|
682
|
+
_this$props10$disable = _this$props10.disabledOptions,
|
|
683
|
+
disabledOptions = _this$props10$disable === void 0 ? dummyArray : _this$props10$disable;
|
|
788
684
|
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
685
|
+
selectedOptions: selectedOptions,
|
|
686
|
+
propSelectedOptions: propSelectedOptions,
|
|
687
|
+
disabledOptions: disabledOptions
|
|
688
|
+
}),
|
|
689
|
+
newSelectedOptions = _filterSelectedOption.newSelectedOptions;
|
|
795
690
|
var selectedOptionsLen = newSelectedOptions.length;
|
|
796
691
|
var allSelectedOptionsDetails = [];
|
|
797
|
-
|
|
798
692
|
for (var i = 0; i < selectedOptionsLen; i++) {
|
|
799
693
|
var id = newSelectedOptions[i];
|
|
800
694
|
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
801
695
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
696
|
+
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails);
|
|
697
|
+
// this.setState({ searchStr: '' });
|
|
805
698
|
this.searchInput && this.searchInput.focus({
|
|
806
699
|
preventScroll: true
|
|
807
700
|
});
|
|
808
|
-
|
|
809
701
|
if (needToCloseOnSelect) {
|
|
810
702
|
togglePopup(e);
|
|
811
703
|
}
|
|
@@ -813,10 +705,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
813
705
|
}, {
|
|
814
706
|
key: "togglePopup",
|
|
815
707
|
value: function togglePopup(e) {
|
|
816
|
-
var _this$
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
708
|
+
var _this$props11 = this.props,
|
|
709
|
+
togglePopup = _this$props11.togglePopup,
|
|
710
|
+
defaultDropBoxPosition = _this$props11.defaultDropBoxPosition,
|
|
711
|
+
isReadOnly = _this$props11.isReadOnly;
|
|
820
712
|
!isReadOnly && togglePopup(e, defaultDropBoxPosition ? "".concat(defaultDropBoxPosition) : null);
|
|
821
713
|
}
|
|
822
714
|
}, {
|
|
@@ -858,18 +750,15 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
858
750
|
key: "handleActive",
|
|
859
751
|
value: function handleActive(e) {
|
|
860
752
|
var _this$state7 = this.state,
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
753
|
+
searchStr = _this$state7.searchStr,
|
|
754
|
+
isActive = _this$state7.isActive;
|
|
864
755
|
if (!isActive) {
|
|
865
756
|
this.setState({
|
|
866
757
|
isActive: true
|
|
867
758
|
});
|
|
868
759
|
}
|
|
869
|
-
|
|
870
760
|
var _ref5 = e || {},
|
|
871
|
-
|
|
872
|
-
|
|
761
|
+
target = _ref5.target;
|
|
873
762
|
target && target.setSelectionRange(target, 0);
|
|
874
763
|
var onFocus = this.props.onFocus;
|
|
875
764
|
onFocus && onFocus(searchStr);
|
|
@@ -878,7 +767,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
878
767
|
key: "handleInactive",
|
|
879
768
|
value: function handleInactive() {
|
|
880
769
|
var isActive = this.state.isActive;
|
|
881
|
-
|
|
882
770
|
if (isActive) {
|
|
883
771
|
this.setState({
|
|
884
772
|
isActive: false
|
|
@@ -888,9 +776,9 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
888
776
|
}, {
|
|
889
777
|
key: "handleInputFocus",
|
|
890
778
|
value: function handleInputFocus() {
|
|
891
|
-
var _this$
|
|
892
|
-
|
|
893
|
-
|
|
779
|
+
var _this$props12 = this.props,
|
|
780
|
+
isDisabled = _this$props12.isDisabled,
|
|
781
|
+
isReadOnly = _this$props12.isReadOnly;
|
|
894
782
|
this.searchInput && !isDisabled && !isReadOnly && this.searchInput.focus({
|
|
895
783
|
preventScroll: true
|
|
896
784
|
});
|
|
@@ -898,9 +786,9 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
898
786
|
}, {
|
|
899
787
|
key: "handleExposedPublicMethods",
|
|
900
788
|
value: function handleExposedPublicMethods() {
|
|
901
|
-
var _this$
|
|
902
|
-
|
|
903
|
-
|
|
789
|
+
var _this$props13 = this.props,
|
|
790
|
+
getPublicMethods = _this$props13.getPublicMethods,
|
|
791
|
+
openPopupOnly = _this$props13.openPopupOnly;
|
|
904
792
|
getPublicMethods && getPublicMethods({
|
|
905
793
|
openPopupOnly: openPopupOnly
|
|
906
794
|
});
|
|
@@ -919,79 +807,78 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
919
807
|
key: "render",
|
|
920
808
|
value: function render() {
|
|
921
809
|
var _this5 = this;
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
810
|
+
var _this$props14 = this.props,
|
|
811
|
+
isReadOnly = _this$props14.isReadOnly,
|
|
812
|
+
needSelectAll = _this$props14.needSelectAll,
|
|
813
|
+
searchEmptyMessage = _this$props14.searchEmptyMessage,
|
|
814
|
+
emptyMessage = _this$props14.emptyMessage,
|
|
815
|
+
noMoreOptionsMessage = _this$props14.noMoreOptionsMessage,
|
|
816
|
+
dropBoxSize = _this$props14.dropBoxSize,
|
|
817
|
+
placeHolder = _this$props14.placeHolder,
|
|
818
|
+
isPopupOpen = _this$props14.isPopupOpen,
|
|
819
|
+
isPopupReady = _this$props14.isPopupReady,
|
|
820
|
+
position = _this$props14.position,
|
|
821
|
+
defaultDropBoxPosition = _this$props14.defaultDropBoxPosition,
|
|
822
|
+
selectAllText = _this$props14.selectAllText,
|
|
823
|
+
getContainerRef = _this$props14.getContainerRef,
|
|
824
|
+
removeClose = _this$props14.removeClose,
|
|
825
|
+
isAnimate = _this$props14.isAnimate,
|
|
826
|
+
animationStyle = _this$props14.animationStyle,
|
|
827
|
+
textBoxSize = _this$props14.textBoxSize,
|
|
828
|
+
variant = _this$props14.variant,
|
|
829
|
+
size = _this$props14.size,
|
|
830
|
+
isDisabled = _this$props14.isDisabled,
|
|
831
|
+
title = _this$props14.title,
|
|
832
|
+
needResponsive = _this$props14.needResponsive,
|
|
833
|
+
dataId = _this$props14.dataId,
|
|
834
|
+
isSearching = _this$props14.isSearching,
|
|
835
|
+
borderColor = _this$props14.borderColor,
|
|
836
|
+
textBoxClass = _this$props14.textBoxClass,
|
|
837
|
+
needBorder = _this$props14.needBorder,
|
|
838
|
+
disableAction = _this$props14.disableAction,
|
|
839
|
+
isBoxPaddingNeed = _this$props14.isBoxPaddingNeed,
|
|
840
|
+
palette = _this$props14.palette,
|
|
841
|
+
needAutoFocus = _this$props14.needAutoFocus,
|
|
842
|
+
htmlId = _this$props14.htmlId,
|
|
843
|
+
i18nKeys = _this$props14.i18nKeys,
|
|
844
|
+
a11y = _this$props14.a11y,
|
|
845
|
+
children = _this$props14.children,
|
|
846
|
+
customChildrenClass = _this$props14.customChildrenClass,
|
|
847
|
+
getFooter = _this$props14.getFooter,
|
|
848
|
+
needEffect = _this$props14.needEffect,
|
|
849
|
+
disabledOptions = _this$props14.disabledOptions,
|
|
850
|
+
boxSize = _this$props14.boxSize,
|
|
851
|
+
autoComplete = _this$props14.autoComplete,
|
|
852
|
+
isLoading = _this$props14.isLoading;
|
|
965
853
|
var _i18nKeys = i18nKeys,
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
854
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
855
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText,
|
|
856
|
+
_i18nKeys$searchText = _i18nKeys.searchText,
|
|
857
|
+
searchText = _i18nKeys$searchText === void 0 ? 'Searching...' : _i18nKeys$searchText;
|
|
970
858
|
var _a11y$clearLabel = a11y.clearLabel,
|
|
971
|
-
|
|
859
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel,
|
|
860
|
+
ariaLabelledby = a11y.ariaLabelledby;
|
|
972
861
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
973
862
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
974
863
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
|
|
975
864
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
|
|
976
865
|
});
|
|
977
866
|
var _this$state8 = this.state,
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
867
|
+
selectedOptions = _this$state8.selectedOptions,
|
|
868
|
+
searchStr = _this$state8.searchStr,
|
|
869
|
+
hoverOption = _this$state8.hoverOption,
|
|
870
|
+
highLightedSelectOptions = _this$state8.highLightedSelectOptions,
|
|
871
|
+
options = _this$state8.options,
|
|
872
|
+
isFetchingOptions = _this$state8.isFetchingOptions,
|
|
873
|
+
isActive = _this$state8.isActive;
|
|
985
874
|
var suggestions = this.handleFilterSuggestions();
|
|
986
875
|
var setAriaId = this.getNextAriaId();
|
|
987
876
|
var ariaErrorId = this.getNextAriaId();
|
|
988
|
-
|
|
989
877
|
var _this$getIsShowClearI = this.getIsShowClearIcon({
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
878
|
+
selectedOptions: selectedOptions,
|
|
879
|
+
disabledOptions: disabledOptions
|
|
880
|
+
}),
|
|
881
|
+
isShowClear = _this$getIsShowClearI.isShowClearIcon;
|
|
995
882
|
var isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
|
|
996
883
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
997
884
|
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(isReadOnly ? _MultiSelectModule["default"].readOnly : '', " ").concat(disableAction ? (0, _CssProvider["default"])('isBlock') : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
@@ -1048,7 +935,8 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1048
935
|
ariaExpanded: !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? true : false,
|
|
1049
936
|
ariaHaspopup: true,
|
|
1050
937
|
ariaRequired: true,
|
|
1051
|
-
ariaDescribedby: ariaErrorId
|
|
938
|
+
ariaDescribedby: ariaErrorId,
|
|
939
|
+
ariaLabelledby: ariaLabelledby
|
|
1052
940
|
},
|
|
1053
941
|
autoComplete: autoComplete
|
|
1054
942
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -1102,7 +990,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1102
990
|
selectAllText: selectAllText,
|
|
1103
991
|
suggestions: suggestions,
|
|
1104
992
|
dataId: dataId
|
|
1105
|
-
})), /*#__PURE__*/_react["default"].createElement(
|
|
993
|
+
})), isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
994
|
+
align: "both",
|
|
995
|
+
className: _MultiSelectModule["default"].loader
|
|
996
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
1106
997
|
shrink: true,
|
|
1107
998
|
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
1108
999
|
eleRef: _this5.suggestionContainerRef
|
|
@@ -1129,25 +1020,24 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1129
1020
|
palette: palette,
|
|
1130
1021
|
i18nKeys: i18nKeys,
|
|
1131
1022
|
htmlId: ariaErrorId
|
|
1132
|
-
})
|
|
1023
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1024
|
+
isCover: false,
|
|
1025
|
+
align: "both"
|
|
1026
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter()) : null)));
|
|
1133
1027
|
}) : null);
|
|
1134
1028
|
}
|
|
1135
1029
|
}]);
|
|
1136
|
-
|
|
1137
1030
|
return MultiSelectComponent;
|
|
1138
1031
|
}(_react["default"].Component);
|
|
1139
|
-
|
|
1140
1032
|
exports.MultiSelectComponent = MultiSelectComponent;
|
|
1141
1033
|
MultiSelectComponent.propTypes = _propTypes.MultiSelect_propTypes;
|
|
1142
1034
|
MultiSelectComponent.defaultProps = _defaultProps.MultiSelect_defaultProps;
|
|
1143
|
-
|
|
1144
1035
|
if (false) {
|
|
1145
1036
|
MultiSelectComponent.docs = {
|
|
1146
1037
|
componentGroup: 'Form Elements',
|
|
1147
1038
|
folderName: 'Style Guide'
|
|
1148
1039
|
};
|
|
1149
1040
|
}
|
|
1150
|
-
|
|
1151
1041
|
MultiSelectComponent.displayName = 'MultiSelect';
|
|
1152
1042
|
var MultiSelect = (0, _Popup["default"])(MultiSelectComponent);
|
|
1153
1043
|
MultiSelect.propTypes = MultiSelectComponent.propTypes;
|