@zohodesk/components 1.0.0-test-252 → 1.0.0
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 +161 -1
- package/assets/Appearance/dark/mode/darkMode.module.css +181 -179
- package/assets/Appearance/dark/themes/blue/blueDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +31 -31
- package/assets/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/red/redDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/red/redDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/red/redDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +177 -175
- package/assets/Appearance/default/themes/blue/blueDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +31 -31
- package/assets/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/red/redDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/red/redDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/red/redDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +182 -180
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +31 -31
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/green/greenPureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/red/redPureDarkComponentTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkComponentTheme.module.css +3 -0
- package/assets/Contrast/darkContrastLightness.module.css +39 -0
- package/assets/Contrast/defaultContrastLightness.module.css +39 -0
- package/assets/Contrast/pureDarkContrastLightness.module.css +39 -0
- package/css_error.log +1 -0
- package/es/Accordion/Accordion.js +19 -9
- package/es/Accordion/AccordionItem.js +13 -8
- package/es/Accordion/props/defaultProps.js +6 -2
- package/es/Accordion/props/propTypes.js +3 -0
- package/es/Animation/Animation.js +10 -9
- package/es/AppContainer/AppContainer.js +38 -15
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/AppContainer/props/defaultProps.js +3 -1
- package/es/AppContainer/props/propTypes.js +2 -0
- package/es/Avatar/Avatar.js +48 -25
- package/es/Avatar/Avatar.module.css +59 -18
- package/es/Avatar/props/defaultProps.js +4 -1
- package/es/Avatar/props/propTypes.js +5 -2
- package/es/AvatarTeam/AvatarTeam.js +21 -11
- package/es/AvatarTeam/AvatarTeam.module.css +49 -21
- package/es/AvatarTeam/props/defaultProps.js +5 -1
- package/es/AvatarTeam/props/propTypes.js +5 -1
- package/es/Button/Button.js +55 -51
- package/{lib/Button → es/Button/css}/Button.module.css +62 -58
- package/es/Button/css/cssJSLogic.js +53 -0
- package/es/Button/index.js +2 -0
- package/es/Button/props/defaultProps.js +3 -1
- package/es/Button/props/propTypes.js +6 -2
- package/es/Buttongroup/Buttongroup.js +24 -16
- package/es/Buttongroup/Buttongroup.module.css +45 -28
- package/es/Buttongroup/props/defaultProps.js +3 -1
- package/es/Buttongroup/props/propTypes.js +3 -1
- package/es/Card/Card.js +48 -26
- package/es/Card/props/defaultProps.js +12 -2
- package/es/Card/props/propTypes.js +2 -2
- package/es/CheckBox/CheckBox.js +13 -9
- package/es/CheckBox/CheckBox.module.css +16 -16
- package/es/CheckBox/props/propTypes.js +1 -0
- package/es/DateTime/CalendarView.js +46 -19
- package/es/DateTime/DateTime.js +139 -77
- package/es/DateTime/DateTime.module.css +51 -48
- package/es/DateTime/DateTimePopupFooter.js +4 -2
- package/es/DateTime/DateTimePopupHeader.js +30 -11
- package/es/DateTime/DateWidget.js +122 -51
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +6 -3
- package/es/DateTime/Time.js +10 -2
- package/es/DateTime/YearView.js +41 -9
- package/es/DateTime/YearView.module.css +33 -15
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
- package/es/DateTime/__tests__/DateTime.spec.js +1 -0
- package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
- package/es/DateTime/common.js +3 -0
- package/es/DateTime/constants.js +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
- package/es/DateTime/dateFormatUtils/dateFormats.js +42 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
- package/es/DateTime/dateFormatUtils/index.js +59 -2
- package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
- package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
- package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/objectUtils.js +14 -20
- package/es/DateTime/props/defaultProps.js +2 -1
- package/es/DateTime/props/propTypes.js +5 -2
- package/es/DateTime/typeChecker.js +3 -0
- package/es/DateTime/validator.js +58 -6
- package/es/DropBox/DropBox.js +82 -218
- package/es/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +435 -0
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +91 -0
- package/es/DropBox/DropBoxElement/props/defaultProps.js +18 -0
- package/es/DropBox/DropBoxElement/props/propTypes.js +45 -0
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +54 -0
- package/es/DropBox/__tests__/DropBox.spec.js +2 -2
- package/es/DropBox/css/DropBox.module.css +59 -0
- package/es/DropBox/css/cssJSLogic.js +14 -0
- package/es/DropBox/props/defaultProps.js +9 -15
- package/es/DropBox/props/propTypes.js +9 -41
- package/es/DropDown/DropDown.js +16 -9
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +18 -11
- package/es/DropDown/DropDownHeading.module.css +3 -3
- package/es/DropDown/DropDownItem.js +8 -1
- package/es/DropDown/DropDownItem.module.css +9 -9
- package/es/DropDown/DropDownSearch.js +4 -0
- package/es/DropDown/DropDownSeparator.js +1 -0
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -2
- package/es/DropDown/index.js +7 -0
- package/es/DropDown/props/defaultProps.js +3 -1
- package/es/DropDown/props/propTypes.js +2 -1
- package/es/Heading/Heading.js +8 -7
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +14 -9
- package/es/Label/Label.module.css +1 -1
- package/es/Label/props/defaultProps.js +2 -1
- package/es/Label/props/propTypes.js +1 -0
- package/es/Layout/Box.js +19 -4
- package/es/Layout/Container.js +18 -5
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +9 -10
- package/es/Layout/props/defaultProps.js +6 -2
- package/es/Layout/props/propTypes.js +7 -3
- package/es/Layout/utils.js +5 -1
- package/es/ListItem/ListContainer.js +21 -9
- package/es/ListItem/ListItem.js +30 -14
- package/es/ListItem/ListItem.module.css +37 -30
- package/es/ListItem/ListItemWithAvatar.js +30 -15
- package/es/ListItem/ListItemWithCheckBox.js +22 -10
- package/es/ListItem/ListItemWithIcon.js +29 -14
- package/es/ListItem/ListItemWithRadio.js +22 -10
- package/es/ListItem/index.js +6 -0
- package/es/ListItem/props/defaultProps.js +18 -6
- package/es/ListItem/props/propTypes.js +13 -1
- package/es/Modal/Modal.js +35 -17
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +100 -20
- package/es/MultiSelect/AdvancedMultiSelect.js +45 -19
- package/es/MultiSelect/EmptyState.js +6 -0
- package/es/MultiSelect/MultiSelect.js +129 -46
- package/es/MultiSelect/MultiSelect.module.css +32 -31
- package/es/MultiSelect/MultiSelectHeader.js +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +43 -19
- package/es/MultiSelect/SelectedOptions.js +6 -3
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +13 -6
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
- package/es/MultiSelect/index.js +4 -0
- package/es/MultiSelect/props/defaultProps.js +11 -4
- package/es/MultiSelect/props/propTypes.js +17 -5
- package/es/PopOver/PopOver.js +25 -9
- package/es/PopOver/__tests__/PopOver.spec.js +2 -1
- package/es/PopOver/index.js +3 -0
- package/es/Popup/Popup.js +80 -31
- package/es/Popup/__tests__/Popup.spec.js +17 -5
- package/es/Popup/viewPort.js +16 -4
- package/es/Provider/AvatarSize.js +1 -0
- package/es/Provider/IdProvider.js +16 -10
- package/es/Provider/LibraryContext.js +6 -4
- package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
- package/es/Provider/ZindexProvider.js +9 -2
- package/es/Provider/index.js +4 -0
- package/es/Radio/Radio.js +9 -7
- package/es/Radio/Radio.module.css +3 -3
- package/es/Responsive/CustomResponsive.js +37 -21
- package/es/Responsive/RefWrapper.js +6 -7
- package/es/Responsive/ResizeComponent.js +35 -25
- package/es/Responsive/ResizeObserver.js +26 -6
- package/es/Responsive/Responsive.js +34 -20
- package/es/Responsive/index.js +9 -8
- package/es/Responsive/sizeObservers.js +28 -7
- package/es/Responsive/utils/index.js +7 -5
- package/es/Responsive/utils/shallowCompare.js +7 -2
- package/es/Responsive/windowResizeObserver.js +7 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/es/Ribbon/Ribbon.js +21 -15
- package/es/Ribbon/Ribbon.module.css +133 -55
- package/es/Ribbon/props/defaultProps.js +2 -1
- package/es/Ribbon/props/propTypes.js +2 -1
- package/es/RippleEffect/RippleEffect.js +6 -7
- package/es/Select/GroupSelect.js +71 -23
- package/es/Select/Select.js +115 -50
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +31 -12
- package/es/Select/SelectWithIcon.js +60 -14
- package/es/Select/__tests__/Select.spec.js +6 -8
- package/es/Select/index.js +4 -0
- package/es/Select/props/defaultProps.js +6 -1
- package/es/Select/props/propTypes.js +10 -4
- package/es/Stencils/Stencils.js +10 -9
- package/es/Stencils/Stencils.module.css +2 -2
- package/es/Switch/Switch.js +14 -8
- package/es/Switch/Switch.module.css +49 -32
- package/es/Switch/props/defaultProps.js +2 -1
- package/es/Switch/props/propTypes.js +1 -0
- package/es/Tab/Tab.js +14 -11
- package/es/Tab/Tab.module.css +14 -15
- package/es/Tab/TabContent.js +6 -3
- package/es/Tab/TabContentWrapper.js +6 -2
- package/es/Tab/TabWrapper.js +9 -4
- package/es/Tab/Tabs.js +85 -21
- package/es/Tab/Tabs.module.css +36 -40
- package/es/Tab/__tests__/Tab.spec.js +4 -12
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
- package/es/Tab/props/defaultProps.js +10 -5
- package/es/Tab/props/propTypes.js +10 -5
- package/es/Tag/Tag.js +16 -10
- package/es/Tag/Tag.module.css +10 -10
- package/es/Tag/props/defaultProps.js +2 -1
- package/es/Tag/props/propTypes.js +2 -1
- package/es/TextBox/TextBox.js +26 -10
- package/es/TextBox/TextBox.module.css +6 -5
- package/es/TextBox/__tests__/TextBox.spec.js +1 -4
- package/es/TextBox/props/defaultProps.js +2 -1
- package/es/TextBox/props/propTypes.js +2 -1
- package/es/TextBoxIcon/TextBoxIcon.js +39 -13
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -6
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
- package/es/TextBoxIcon/props/defaultProps.js +2 -1
- package/es/TextBoxIcon/props/propTypes.js +1 -0
- package/es/Textarea/Textarea.js +23 -10
- package/es/Textarea/Textarea.module.css +6 -6
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Textarea/props/defaultProps.js +2 -1
- package/es/Textarea/props/propTypes.js +1 -0
- package/es/Tooltip/Tooltip.js +67 -21
- package/es/Tooltip/Tooltip.module.css +40 -8
- package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +7 -6
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +11 -8
- package/es/VelocityAnimation/index.js +2 -0
- package/es/common/a11y.module.css +4 -0
- package/es/common/animation.module.css +8 -8
- package/es/common/avatarsizes.module.css +6 -2
- package/es/common/basicReset.module.css +3 -3
- package/es/common/boxShadow.module.css +34 -0
- package/es/common/common.module.css +24 -24
- package/es/common/customscroll.module.css +4 -2
- package/es/common/reset.module.css +1 -0
- package/es/css.js +2 -1
- package/es/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/es/deprecated/PortalLayer/PortalLayer.js +30 -24
- package/es/index.js +30 -146
- package/es/semantic/Button/Button.js +9 -7
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/semantic/index.js +1 -0
- package/es/utils/Common.js +74 -7
- package/es/utils/ContextOptimizer.js +4 -5
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +2 -0
- package/es/utils/css/compileClassNames.js +28 -0
- package/es/utils/css/mergeStyle.js +57 -0
- package/es/utils/css/utils.js +24 -0
- package/es/utils/datetime/GMTZones.js +48 -0
- package/es/utils/datetime/common.js +31 -7
- package/es/utils/debounce.js +5 -1
- package/es/utils/dropDownUtils.js +71 -13
- package/es/utils/getInitial.js +4 -0
- package/es/utils/index.js +3 -0
- package/es/utils/shallowEqual.js +6 -0
- package/install.md +10 -0
- package/lib/Accordion/Accordion.js +50 -18
- package/lib/Accordion/AccordionItem.js +47 -20
- package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
- package/lib/Accordion/index.js +3 -0
- package/lib/Accordion/props/defaultProps.js +6 -2
- package/lib/Accordion/props/propTypes.js +6 -0
- package/lib/Animation/Animation.js +44 -21
- package/lib/Animation/__tests__/Animation.spec.js +11 -7
- package/lib/Animation/props/propTypes.js +3 -0
- package/lib/AppContainer/AppContainer.js +75 -27
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/defaultProps.js +3 -1
- package/lib/AppContainer/props/propTypes.js +5 -0
- package/lib/Avatar/Avatar.js +97 -44
- package/lib/Avatar/Avatar.module.css +59 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
- package/lib/Avatar/props/defaultProps.js +4 -1
- package/lib/Avatar/props/propTypes.js +8 -2
- package/lib/AvatarTeam/AvatarTeam.js +64 -30
- package/lib/AvatarTeam/AvatarTeam.module.css +49 -21
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
- package/lib/AvatarTeam/props/defaultProps.js +5 -1
- package/lib/AvatarTeam/props/propTypes.js +8 -1
- package/lib/Button/Button.js +64 -74
- package/{es/Button → lib/Button/css}/Button.module.css +62 -58
- package/lib/Button/css/cssJSLogic.js +41 -0
- package/lib/Button/index.js +23 -0
- package/lib/Button/props/defaultProps.js +5 -1
- package/lib/Button/props/propTypes.js +11 -3
- package/lib/Buttongroup/Buttongroup.js +49 -19
- package/lib/Buttongroup/Buttongroup.module.css +45 -28
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
- package/lib/Buttongroup/props/defaultProps.js +3 -1
- package/lib/Buttongroup/props/propTypes.js +6 -1
- package/lib/Card/Card.js +119 -55
- package/lib/Card/__tests__/Card.spec.js +10 -1
- package/lib/Card/index.js +4 -0
- package/lib/Card/props/defaultProps.js +16 -4
- package/lib/Card/props/propTypes.js +5 -2
- package/lib/CheckBox/CheckBox.js +76 -48
- package/lib/CheckBox/CheckBox.module.css +16 -16
- package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
- package/lib/CheckBox/props/propTypes.js +4 -0
- package/lib/DateTime/CalendarView.js +95 -38
- package/lib/DateTime/DateTime.js +309 -216
- package/lib/DateTime/DateTime.module.css +51 -48
- package/lib/DateTime/DateTimePopupFooter.js +30 -5
- package/lib/DateTime/DateTimePopupHeader.js +69 -23
- package/lib/DateTime/DateWidget.js +370 -260
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +28 -3
- package/lib/DateTime/Time.js +72 -29
- package/lib/DateTime/YearView.js +89 -30
- package/lib/DateTime/YearView.module.css +33 -15
- package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
- package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
- package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
- package/lib/DateTime/common.js +6 -0
- package/lib/DateTime/constants.js +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
- package/lib/DateTime/dateFormatUtils/dateFormats.js +50 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
- package/lib/DateTime/dateFormatUtils/index.js +99 -13
- package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
- package/lib/DateTime/dateFormatUtils/timeChange.js +52 -20
- package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
- package/lib/DateTime/index.js +3 -1
- package/lib/DateTime/objectUtils.js +24 -20
- package/lib/DateTime/props/defaultProps.js +2 -1
- package/lib/DateTime/props/propTypes.js +21 -2
- package/lib/DateTime/typeChecker.js +4 -0
- package/lib/DateTime/validator.js +69 -6
- package/lib/DropBox/DropBox.js +102 -249
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +435 -0
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +81 -0
- package/lib/DropBox/DropBoxElement/props/defaultProps.js +25 -0
- package/lib/DropBox/DropBoxElement/props/propTypes.js +56 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +60 -0
- package/lib/DropBox/__tests__/DropBox.spec.js +8 -4
- package/lib/DropBox/css/DropBox.module.css +59 -0
- package/lib/DropBox/css/cssJSLogic.js +20 -0
- package/lib/DropBox/props/defaultProps.js +20 -17
- package/lib/DropBox/props/propTypes.js +22 -43
- package/lib/DropDown/DropDown.js +58 -10
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +47 -18
- package/lib/DropDown/DropDownHeading.module.css +3 -3
- package/lib/DropDown/DropDownItem.js +43 -18
- package/lib/DropDown/DropDownItem.module.css +9 -9
- package/lib/DropDown/DropDownSearch.js +39 -14
- package/lib/DropDown/DropDownSeparator.js +23 -1
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
- package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
- package/lib/DropDown/index.js +65 -0
- package/lib/DropDown/props/defaultProps.js +3 -1
- package/lib/DropDown/props/propTypes.js +7 -1
- package/lib/Heading/Heading.js +42 -16
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +3 -0
- package/lib/Label/Label.js +47 -19
- package/lib/Label/Label.module.css +1 -1
- package/lib/Label/__tests__/Label.spec.js +14 -1
- package/lib/Label/props/defaultProps.js +2 -1
- package/lib/Label/props/propTypes.js +4 -0
- package/lib/Layout/Box.js +41 -16
- package/lib/Layout/Container.js +39 -15
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/__tests__/Box.spec.js +65 -49
- package/lib/Layout/__tests__/Container.spec.js +67 -50
- package/lib/Layout/index.js +4 -11
- package/lib/Layout/props/defaultProps.js +6 -2
- package/lib/Layout/props/propTypes.js +10 -3
- package/lib/Layout/utils.js +15 -1
- package/lib/ListItem/ListContainer.js +61 -34
- package/lib/ListItem/ListItem.js +92 -50
- package/lib/ListItem/ListItem.module.css +37 -30
- package/lib/ListItem/ListItemWithAvatar.js +98 -54
- package/lib/ListItem/ListItemWithCheckBox.js +82 -41
- package/lib/ListItem/ListItemWithIcon.js +92 -50
- package/lib/ListItem/ListItemWithRadio.js +83 -42
- package/lib/ListItem/index.js +55 -0
- package/lib/ListItem/props/defaultProps.js +18 -6
- package/lib/ListItem/props/propTypes.js +18 -3
- package/lib/Modal/Modal.js +51 -13
- package/lib/Modal/props/propTypes.js +3 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +300 -167
- package/lib/MultiSelect/AdvancedMultiSelect.js +212 -130
- package/lib/MultiSelect/EmptyState.js +48 -21
- package/lib/MultiSelect/MultiSelect.js +341 -205
- package/lib/MultiSelect/MultiSelect.module.css +32 -31
- package/lib/MultiSelect/MultiSelectHeader.js +29 -5
- package/lib/MultiSelect/MultiSelectWithAvatar.js +126 -65
- package/lib/MultiSelect/SelectedOptions.js +42 -14
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +66 -29
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
- package/lib/MultiSelect/index.js +39 -0
- package/lib/MultiSelect/props/defaultProps.js +13 -4
- package/lib/MultiSelect/props/propTypes.js +20 -5
- package/lib/PopOver/PopOver.js +101 -53
- package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
- package/lib/PopOver/index.js +31 -0
- package/lib/PopOver/props/propTypes.js +3 -0
- package/lib/Popup/Popup.js +158 -83
- package/lib/Popup/__tests__/Popup.spec.js +42 -5
- package/lib/Popup/viewPort.js +28 -14
- package/lib/Provider/AvatarSize.js +5 -0
- package/lib/Provider/Config.js +2 -0
- package/lib/Provider/CssProvider.js +4 -0
- package/lib/Provider/IdProvider.js +23 -12
- package/lib/Provider/LibraryContext.js +32 -10
- package/lib/Provider/LibraryContextInit.js +4 -0
- package/lib/Provider/NumberGenerator/NumberGenerator.js +43 -14
- package/lib/Provider/ZindexProvider.js +15 -3
- package/lib/Provider/index.js +81 -0
- package/lib/Radio/Radio.js +65 -40
- package/lib/Radio/Radio.module.css +3 -3
- package/lib/Radio/__tests__/Radiospec.js +9 -5
- package/lib/Radio/props/propTypes.js +3 -0
- package/lib/Responsive/CustomResponsive.js +76 -26
- package/lib/Responsive/RefWrapper.js +15 -7
- package/lib/Responsive/ResizeComponent.js +58 -27
- package/lib/Responsive/ResizeObserver.js +23 -6
- package/lib/Responsive/Responsive.js +76 -24
- package/lib/Responsive/index.js +49 -22
- package/lib/Responsive/props/propTypes.js +3 -0
- package/lib/Responsive/sizeObservers.js +51 -13
- package/lib/Responsive/utils/index.js +11 -3
- package/lib/Responsive/utils/shallowCompare.js +11 -2
- package/lib/Responsive/windowResizeObserver.js +8 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +44 -14
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
- package/lib/Ribbon/Ribbon.js +48 -21
- package/lib/Ribbon/Ribbon.module.css +133 -55
- package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
- package/lib/Ribbon/props/defaultProps.js +2 -1
- package/lib/Ribbon/props/propTypes.js +5 -1
- package/lib/RippleEffect/RippleEffect.js +23 -14
- package/lib/RippleEffect/props/propTypes.js +3 -0
- package/lib/Select/GroupSelect.js +240 -137
- package/lib/Select/Select.js +320 -220
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +112 -59
- package/lib/Select/SelectWithIcon.js +145 -82
- package/lib/Select/__tests__/Select.spec.js +131 -89
- package/lib/Select/index.js +39 -0
- package/lib/Select/props/defaultProps.js +10 -2
- package/lib/Select/props/propTypes.js +13 -4
- package/lib/Stencils/Stencils.js +35 -13
- package/lib/Stencils/Stencils.module.css +2 -2
- package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
- package/lib/Stencils/props/propTypes.js +3 -0
- package/lib/Switch/Switch.js +64 -35
- package/lib/Switch/Switch.module.css +49 -32
- package/lib/Switch/props/defaultProps.js +2 -1
- package/lib/Switch/props/propTypes.js +4 -0
- package/lib/Tab/Tab.js +49 -33
- package/lib/Tab/Tab.module.css +14 -15
- package/lib/Tab/TabContent.js +15 -6
- package/lib/Tab/TabContentWrapper.js +15 -6
- package/lib/Tab/TabWrapper.js +37 -17
- package/lib/Tab/Tabs.js +193 -94
- package/lib/Tab/Tabs.module.css +36 -40
- package/lib/Tab/__tests__/Tab.spec.js +74 -70
- package/lib/Tab/__tests__/TabContent.spec.js +10 -6
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
- package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
- package/lib/Tab/__tests__/Tabs.spec.js +53 -39
- package/lib/Tab/index.js +6 -0
- package/lib/Tab/props/defaultProps.js +10 -5
- package/lib/Tab/props/propTypes.js +13 -5
- package/lib/Tag/Tag.js +82 -48
- package/lib/Tag/Tag.module.css +10 -10
- package/lib/Tag/__tests__/Tag.spec.js +14 -8
- package/lib/Tag/props/defaultProps.js +2 -1
- package/lib/Tag/props/propTypes.js +5 -1
- package/lib/TextBox/TextBox.js +93 -61
- package/lib/TextBox/TextBox.module.css +6 -5
- package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
- package/lib/TextBox/props/defaultProps.js +2 -1
- package/lib/TextBox/props/propTypes.js +6 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +108 -60
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -6
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -5
- package/lib/TextBoxIcon/props/defaultProps.js +2 -1
- package/lib/TextBoxIcon/props/propTypes.js +4 -0
- package/lib/Textarea/Textarea.js +63 -32
- package/lib/Textarea/Textarea.module.css +6 -6
- package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
- package/lib/Textarea/props/defaultProps.js +2 -1
- package/lib/Textarea/props/propTypes.js +4 -0
- package/lib/Tooltip/Tooltip.js +102 -35
- package/lib/Tooltip/Tooltip.module.css +40 -8
- package/lib/Tooltip/__tests__/Tooltip.spec.js +23 -0
- package/lib/Tooltip/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +43 -17
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +55 -24
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
- package/lib/VelocityAnimation/index.js +23 -0
- package/lib/common/a11y.module.css +4 -0
- package/lib/common/animation.module.css +8 -8
- package/lib/common/avatarsizes.module.css +6 -2
- package/lib/common/basicReset.module.css +3 -3
- package/lib/common/boxShadow.module.css +34 -0
- package/lib/common/common.module.css +24 -24
- package/lib/common/customscroll.module.css +4 -2
- package/lib/common/reset.module.css +1 -0
- package/lib/css.js +42 -1
- package/lib/deprecated/AdvancedMultiSelect.module.css +18 -18
- package/lib/deprecated/PortalLayer/PortalLayer.js +50 -24
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
- package/lib/index.js +214 -210
- package/lib/semantic/Button/Button.js +47 -24
- package/lib/semantic/Button/props/propTypes.js +3 -0
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +15 -0
- package/lib/utils/Common.js +136 -17
- package/lib/utils/ContextOptimizer.js +16 -10
- package/lib/utils/__tests__/constructFullName.spec.js +1 -0
- package/lib/utils/__tests__/debounce.spec.js +3 -2
- package/lib/utils/__tests__/getInitial.spec.js +1 -0
- package/lib/utils/constructFullName.js +11 -2
- package/lib/utils/css/compileClassNames.js +37 -0
- package/lib/utils/css/mergeStyle.js +69 -0
- package/lib/utils/css/utils.js +41 -0
- package/lib/utils/datetime/GMTZones.js +55 -0
- package/lib/utils/datetime/common.js +52 -7
- package/lib/utils/debounce.js +6 -1
- package/lib/utils/dropDownUtils.js +177 -56
- package/lib/utils/dummyFunction.js +2 -0
- package/lib/utils/getHTMLFontSize.js +1 -0
- package/lib/utils/getInitial.js +6 -0
- package/lib/utils/index.js +121 -0
- package/lib/utils/scrollTo.js +2 -0
- package/lib/utils/shallowEqual.js +8 -0
- package/package.json +61 -26
- package/postPublish.js +8 -0
- package/prePublish.js +70 -0
- package/docs/external/active-line.js +0 -72
- package/docs/external/autorefresh.js +0 -47
- package/docs/external/codemirror.js +0 -9681
- package/docs/external/css/hopscotch.css +0 -576
- package/docs/external/css/styleGuide.css +0 -1100
- package/docs/external/css.js +0 -466
- package/docs/external/designTokens.js +0 -1
- package/docs/external/foldcode.js +0 -152
- package/docs/external/format.js +0 -129
- package/docs/external/htmlmixed.js +0 -84
- package/docs/external/images/bottom.png +0 -0
- package/docs/external/images/bottombg.jpg +0 -0
- package/docs/external/images/desk.png +0 -0
- package/docs/external/images/desklogo.png +0 -0
- package/docs/external/images/menu.png +0 -0
- package/docs/external/index.html +0 -127
- package/docs/external/javascript.js +0 -422
- package/docs/external/jsx.js +0 -148
- package/docs/external/matchbrackets.js +0 -145
- package/docs/external/xml.js +0 -322
- package/docs/package.json +0 -41
- package/docs/src/index.js +0 -1311
- package/es/Button/__tests__/Button.spec.js +0 -190
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/es/DropBox/DropBox.module.css +0 -406
- package/lib/Button/__tests__/Button.spec.js +0 -193
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/lib/DropBox/DropBox.module.css +0 -406
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MultiSelect_propTypes } from './props/propTypes';
|
|
4
4
|
import { MultiSelect_defaultProps } from './props/defaultProps';
|
|
5
|
-
|
|
6
5
|
/**** Components ****/
|
|
6
|
+
|
|
7
7
|
import Popup from '../Popup/Popup';
|
|
8
8
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
9
9
|
import { Container, Box } from '../Layout';
|
|
@@ -18,16 +18,18 @@ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
|
18
18
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
19
19
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
20
20
|
/**** Icons ****/
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
import { Icon } from '@zohodesk/icons';
|
|
22
23
|
/**** CSS ****/
|
|
23
|
-
import style from './MultiSelect.module.css';
|
|
24
24
|
|
|
25
|
+
import style from './MultiSelect.module.css';
|
|
25
26
|
/**** Methods ****/
|
|
27
|
+
|
|
26
28
|
import { debounce, scrollTo, bind, getIsEmptyValue, getSearchString, findScrollEnd } from '../utils/Common.js';
|
|
27
29
|
import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../utils/dropDownUtils';
|
|
28
30
|
import { getLibraryConfig } from '../Provider/Config';
|
|
29
|
-
|
|
30
31
|
/* eslint-disable react/forbid-component-props */
|
|
32
|
+
|
|
31
33
|
/* eslint-disable react/no-unused-prop-types */
|
|
32
34
|
|
|
33
35
|
const dummyArray = [];
|
|
@@ -38,9 +40,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
38
40
|
this.getFilterSuggestions = makeGetFilterSuggestions();
|
|
39
41
|
this.formatOptions = makeFormatOptions();
|
|
40
42
|
this.getSelectedOptions = makeGetSelectedOptions();
|
|
41
|
-
this.getIsShowClearIcon = makeGetIsShowClearIcon();
|
|
43
|
+
this.getIsShowClearIcon = makeGetIsShowClearIcon(); //Use in AdvancedMultiSelect component
|
|
42
44
|
|
|
43
|
-
//Use in AdvancedMultiSelect component
|
|
44
45
|
this.objectConcat = makeObjectConcat();
|
|
45
46
|
this.formatSelectedOptions = makeFormatOptions();
|
|
46
47
|
const {
|
|
@@ -78,11 +79,11 @@ export class MultiSelectComponent extends React.Component {
|
|
|
78
79
|
this.handleScroll = this.handleScroll.bind(this);
|
|
79
80
|
this.handleScrollFuncCall = debounce(this.handleScrollFuncCall.bind(this), 500);
|
|
80
81
|
}
|
|
82
|
+
|
|
81
83
|
componentDidMount() {
|
|
82
84
|
// let { suggestionContainer } = this;
|
|
83
85
|
this._isMounted = true;
|
|
84
|
-
this.handleExposedPublicMethods();
|
|
85
|
-
// suggestionContainer &&
|
|
86
|
+
this.handleExposedPublicMethods(); // suggestionContainer &&
|
|
86
87
|
// suggestionContainer.addEventListener('scroll', this.handleScroll);
|
|
87
88
|
}
|
|
88
89
|
|
|
@@ -95,6 +96,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
95
96
|
prefixText
|
|
96
97
|
} = nextProps;
|
|
97
98
|
const oldProps = this.props;
|
|
99
|
+
|
|
98
100
|
if (selectedOptions !== oldProps.selectedOptions || options !== oldProps.options || valueField !== oldProps.valueField || textField !== oldProps.textField || prefixText !== oldProps.prefixText //For GroupMultiSelect component
|
|
99
101
|
) {
|
|
100
102
|
const {
|
|
@@ -133,6 +135,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
}
|
|
138
|
+
|
|
136
139
|
componentDidUpdate(prevProps, prevState) {
|
|
137
140
|
const {
|
|
138
141
|
suggestionContainer,
|
|
@@ -151,11 +154,11 @@ export class MultiSelectComponent extends React.Component {
|
|
|
151
154
|
onDropBoxClose,
|
|
152
155
|
onDropBoxOpen,
|
|
153
156
|
isSearchClearOnClose
|
|
154
|
-
} = this.props;
|
|
157
|
+
} = this.props; //handle dropbox open & close
|
|
155
158
|
|
|
156
|
-
//handle dropbox open & close
|
|
157
159
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
158
160
|
isPopupOpen && onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
|
|
161
|
+
|
|
159
162
|
if (!isPopupOpen) {
|
|
160
163
|
this.setState({
|
|
161
164
|
hoverOption: 0
|
|
@@ -163,41 +166,42 @@ export class MultiSelectComponent extends React.Component {
|
|
|
163
166
|
isSearchClearOnClose && searchStr && this.handleSearch('');
|
|
164
167
|
onDropBoxClose && onDropBoxClose();
|
|
165
168
|
}
|
|
166
|
-
}
|
|
169
|
+
} //scrollTo handling
|
|
170
|
+
|
|
167
171
|
|
|
168
|
-
//scrollTo handling
|
|
169
172
|
const hoverId = suggestionsOrder[hoverOption] || '';
|
|
170
173
|
const selectedSuggestion = this[`suggestion_${hoverId}`];
|
|
171
174
|
const lastHighLightedSelectOption = highLightedSelectOptions.slice(-1).length ? highLightedSelectOptions.slice(-1)[0] : null;
|
|
172
175
|
const selectedOption = this[`selectedOption_${lastHighLightedSelectOption}`];
|
|
173
176
|
isPopupOpen && scrollTo(suggestionContainer, selectedSuggestion);
|
|
174
|
-
selectedOptions.length && selectedOption && scrollTo(selectedOptionContainer, selectedOption);
|
|
177
|
+
selectedOptions.length && selectedOption && scrollTo(selectedOptionContainer, selectedOption); //When suggestions length less than 5, getNextOptions function call
|
|
175
178
|
|
|
176
|
-
//When suggestions length less than 5, getNextOptions function call
|
|
177
179
|
const {
|
|
178
180
|
isNextOptions,
|
|
179
181
|
getNextOptions
|
|
180
|
-
} = this.props;
|
|
181
|
-
|
|
182
|
+
} = this.props; // let { searchStr } = this.state;
|
|
183
|
+
|
|
182
184
|
const suggestions = this.handleFilterSuggestions();
|
|
183
185
|
const suggestionsLen = suggestions.length;
|
|
186
|
+
|
|
184
187
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
185
188
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
186
|
-
}
|
|
189
|
+
} //Need To MultiselectNew Component
|
|
190
|
+
|
|
187
191
|
|
|
188
|
-
//Need To MultiselectNew Component
|
|
189
192
|
this.handleComponentDidUpdate(prevProps, prevState);
|
|
190
193
|
}
|
|
194
|
+
|
|
191
195
|
componentWillUnmount() {
|
|
192
196
|
// let { suggestionContainer } = this;
|
|
193
|
-
this._isMounted = false;
|
|
194
|
-
// suggestionContainer &&
|
|
197
|
+
this._isMounted = false; // suggestionContainer &&
|
|
195
198
|
// suggestionContainer.removeEventListener('scroll', this.handleScroll);
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
handleComponentDidUpdate() {
|
|
199
202
|
return;
|
|
200
203
|
}
|
|
204
|
+
|
|
201
205
|
handleFormatOptions(props) {
|
|
202
206
|
const {
|
|
203
207
|
options,
|
|
@@ -215,12 +219,14 @@ export class MultiSelectComponent extends React.Component {
|
|
|
215
219
|
disabledOptions
|
|
216
220
|
});
|
|
217
221
|
}
|
|
222
|
+
|
|
218
223
|
handleGetSelectedOptions(selectedOptions, normalizedFormatOptions) {
|
|
219
224
|
return this.getSelectedOptions({
|
|
220
225
|
selectedOptions,
|
|
221
226
|
normalizedFormatOptions
|
|
222
227
|
});
|
|
223
228
|
}
|
|
229
|
+
|
|
224
230
|
handleInputCick(e) {
|
|
225
231
|
const {
|
|
226
232
|
removeClose
|
|
@@ -229,6 +235,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
229
235
|
highLightedSelectOptions,
|
|
230
236
|
searchStr = ''
|
|
231
237
|
} = this.state;
|
|
238
|
+
|
|
232
239
|
if (highLightedSelectOptions.length) {
|
|
233
240
|
this.setState({
|
|
234
241
|
highLightedSelectOptions: [],
|
|
@@ -242,6 +249,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
242
249
|
this.togglePopup(e);
|
|
243
250
|
}
|
|
244
251
|
}
|
|
252
|
+
|
|
245
253
|
handleFilterSuggestions() {
|
|
246
254
|
const {
|
|
247
255
|
options = dummyArray,
|
|
@@ -249,7 +257,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
249
257
|
} = this.state;
|
|
250
258
|
const {
|
|
251
259
|
selectedOptions,
|
|
252
|
-
needLocalSearch
|
|
260
|
+
needLocalSearch,
|
|
261
|
+
keepSelectedOptions
|
|
253
262
|
} = this.props;
|
|
254
263
|
const {
|
|
255
264
|
suggestions,
|
|
@@ -258,11 +267,13 @@ export class MultiSelectComponent extends React.Component {
|
|
|
258
267
|
options,
|
|
259
268
|
selectedOptions,
|
|
260
269
|
searchStr: getSearchString(searchStr),
|
|
261
|
-
needSearch: needLocalSearch
|
|
270
|
+
needSearch: needLocalSearch,
|
|
271
|
+
keepSelectedOptions
|
|
262
272
|
});
|
|
263
273
|
this.suggestionsOrder = suggestionIds;
|
|
264
274
|
return suggestions;
|
|
265
275
|
}
|
|
276
|
+
|
|
266
277
|
handleKeyDown(e) {
|
|
267
278
|
const {
|
|
268
279
|
keyCode,
|
|
@@ -287,20 +298,27 @@ export class MultiSelectComponent extends React.Component {
|
|
|
287
298
|
onKeyDown
|
|
288
299
|
} = this.props;
|
|
289
300
|
const highLightedSelectOptionsLen = highLightedSelectOptions.length;
|
|
301
|
+
|
|
290
302
|
if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13 || keyCode === 27 || keyCode === 9)) {
|
|
291
303
|
suggestions = this.handleFilterSuggestions();
|
|
292
304
|
}
|
|
305
|
+
|
|
293
306
|
if (!isPopupOpen && !isPopupOpenOnEnter) {
|
|
294
307
|
onKeyDown && onKeyDown(e);
|
|
295
308
|
}
|
|
309
|
+
|
|
296
310
|
if (!isPopupOpen && keyCode === 40) {
|
|
297
311
|
//down arrow press popup open
|
|
298
312
|
e.preventDefault(); //prevent body scroll
|
|
313
|
+
|
|
299
314
|
this.togglePopup(e);
|
|
300
315
|
}
|
|
316
|
+
|
|
301
317
|
const suggestionsLen = suggestions.length;
|
|
318
|
+
|
|
302
319
|
if (suggestionsLen && isPopupOpen && keyCode === 38) {
|
|
303
320
|
//up arrow
|
|
321
|
+
|
|
304
322
|
/*if (hoverOption === 0) { //disable first to last option higlight
|
|
305
323
|
!isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
|
|
306
324
|
}*/
|
|
@@ -311,6 +329,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
311
329
|
}
|
|
312
330
|
} else if (suggestionsLen && isPopupOpen && keyCode === 40) {
|
|
313
331
|
//down arrow
|
|
332
|
+
|
|
314
333
|
/*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
|
|
315
334
|
//disable last to first option higlight
|
|
316
335
|
!isNextOptions && this.setState({ hoverOption: 0 });
|
|
@@ -338,8 +357,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
338
357
|
if (highLightedSelectOptionsLen) {
|
|
339
358
|
this.handleRemoveOption(highLightedSelectOptions);
|
|
340
359
|
} else {
|
|
341
|
-
this.handleRemoveOption(selectedOptions.slice(-1));
|
|
342
|
-
// this.setState({
|
|
360
|
+
this.handleRemoveOption(selectedOptions.slice(-1)); // this.setState({
|
|
343
361
|
// highLightedSelectOptions: selectedOptions.slice(-1)
|
|
344
362
|
// });
|
|
345
363
|
}
|
|
@@ -354,6 +372,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
354
372
|
const lastHighLightedSelectOptionIndex = lastHighLightedSelectOption && selectedOptions.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptions.indexOf(lastHighLightedSelectOption) : 0;
|
|
355
373
|
const newShiftKeyPressHighLighted = shiftKeyPressHighLighted ? shiftKeyPressHighLighted : shiftKeyPressHighLighted + 1;
|
|
356
374
|
const newHighLightedSelectOption = lastHighLightedSelectOptionIndex !== null ? selectedOptions[lastHighLightedSelectOptionIndex + newShiftKeyPressHighLighted] : selectedOptions[0];
|
|
375
|
+
|
|
357
376
|
if (!getIsEmptyValue(newHighLightedSelectOption)) {
|
|
358
377
|
const newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions[0];
|
|
359
378
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
@@ -370,6 +389,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
370
389
|
const lastHighLightedSelectOptionIndex = lastHighLightedSelectOption ? selectedOptions.indexOf(lastHighLightedSelectOption) : selectedOptions.length - 1;
|
|
371
390
|
const newShiftKeyPressHighLighted = shiftKeyPressHighLighted !== 1 ? shiftKeyPressHighLighted : shiftKeyPressHighLighted - 1;
|
|
372
391
|
const newHighLightedSelectOption = selectedOptions[lastHighLightedSelectOptionIndex + newShiftKeyPressHighLighted - 1];
|
|
392
|
+
|
|
373
393
|
if (!getIsEmptyValue(newHighLightedSelectOption)) {
|
|
374
394
|
const newLastHighLightedSelectOption = lastHighLightedSelectOption ? lastHighLightedSelectOption : selectedOptions.slice(-1)[0];
|
|
375
395
|
highLightedSelectOptions = !shiftKeyPressHighLighted ? [newLastHighLightedSelectOption] : highLightedSelectOptions;
|
|
@@ -382,14 +402,15 @@ export class MultiSelectComponent extends React.Component {
|
|
|
382
402
|
});
|
|
383
403
|
}
|
|
384
404
|
} else if ((keyCode === 39 || keyCode === 37) && selectedOptions.length && !searchStr.length) {
|
|
385
|
-
const isRightArrow = keyCode === 39 ? true : false;
|
|
386
|
-
|
|
405
|
+
const isRightArrow = keyCode === 39 ? true : false; // let isLefttArrow = keyCode === 37 ? true : false;
|
|
406
|
+
|
|
387
407
|
if (highLightedSelectOptions.length) {
|
|
388
408
|
const [lastHighLightedSelectOption] = highLightedSelectOptions.slice(-1);
|
|
389
409
|
const lastHighLightedSelectOptionIndex = selectedOptions.indexOf(lastHighLightedSelectOption);
|
|
390
410
|
const newLastHighLightedSelectOptionIndex = isRightArrow ? lastHighLightedSelectOptionIndex === selectedOptions.length - 1 ? lastHighLightedSelectOptionIndex : lastHighLightedSelectOptionIndex + 1 : lastHighLightedSelectOptionIndex - 1;
|
|
391
411
|
const newLastHighLightedSelectOption = selectedOptions[newLastHighLightedSelectOptionIndex];
|
|
392
412
|
const isEmptyHighlighted = isRightArrow && highLightedSelectOptions.length === 1 && selectedOptions.slice(-1)[0] === lastHighLightedSelectOption ? true : false;
|
|
413
|
+
|
|
393
414
|
if (!getIsEmptyValue(newLastHighLightedSelectOption)) {
|
|
394
415
|
this.setState({
|
|
395
416
|
lastHighLightedSelectOption: isEmptyHighlighted ? '' : newLastHighLightedSelectOption,
|
|
@@ -405,12 +426,12 @@ export class MultiSelectComponent extends React.Component {
|
|
|
405
426
|
shiftKeyPressHighLighted: 0
|
|
406
427
|
});
|
|
407
428
|
}
|
|
408
|
-
} else if (keyCode === 27) {
|
|
409
|
-
// this.handlePopupClose(e);
|
|
429
|
+
} else if (keyCode === 27) {// this.handlePopupClose(e);
|
|
410
430
|
} else if (keyCode === 9) {
|
|
411
431
|
this.handlePopupClose(e);
|
|
412
432
|
}
|
|
413
433
|
}
|
|
434
|
+
|
|
414
435
|
handleSelectAll(e) {
|
|
415
436
|
e && e.preventDefault();
|
|
416
437
|
const suggestions = this.handleFilterSuggestions();
|
|
@@ -422,12 +443,12 @@ export class MultiSelectComponent extends React.Component {
|
|
|
422
443
|
const {
|
|
423
444
|
id
|
|
424
445
|
} = option;
|
|
446
|
+
|
|
425
447
|
if (selectedOptions.indexOf(id) === -1) {
|
|
426
448
|
newSelectedOptions.push(id);
|
|
427
449
|
}
|
|
428
450
|
});
|
|
429
|
-
this.handleChange([...selectedOptions, ...newSelectedOptions]);
|
|
430
|
-
// this.handlePopupClose(e);
|
|
451
|
+
this.handleChange([...selectedOptions, ...newSelectedOptions]); // this.handlePopupClose(e);
|
|
431
452
|
}
|
|
432
453
|
|
|
433
454
|
handleDeselectAll(e) {
|
|
@@ -438,28 +459,40 @@ export class MultiSelectComponent extends React.Component {
|
|
|
438
459
|
const {
|
|
439
460
|
highLightedSelectOptions
|
|
440
461
|
} = this.state;
|
|
462
|
+
|
|
441
463
|
if (highLightedSelectOptions.length) {
|
|
442
464
|
this.setState({
|
|
443
465
|
highLightedSelectOptions: [],
|
|
444
466
|
lastHighLightedSelectOption: ''
|
|
445
467
|
});
|
|
446
468
|
}
|
|
469
|
+
|
|
447
470
|
removeClose(e);
|
|
448
471
|
this.handleChange([]);
|
|
449
472
|
}
|
|
473
|
+
|
|
450
474
|
handleSelectOption(option, value, index, e) {
|
|
451
475
|
const {
|
|
452
476
|
selectedOptions,
|
|
453
|
-
isSearchClearOnSelect
|
|
477
|
+
isSearchClearOnSelect,
|
|
478
|
+
keepSelectedOptions
|
|
454
479
|
} = this.props;
|
|
455
480
|
const {
|
|
456
481
|
searchStr
|
|
457
482
|
} = this.state;
|
|
483
|
+
|
|
458
484
|
if (searchStr.trim() != '' && isSearchClearOnSelect) {
|
|
459
485
|
this.handleSearch('');
|
|
460
486
|
}
|
|
461
|
-
|
|
462
|
-
|
|
487
|
+
|
|
488
|
+
if (keepSelectedOptions && selectedOptions.indexOf(option) != -1) {
|
|
489
|
+
let newSelectedOptions = selectedOptions.filter(id => {
|
|
490
|
+
return id != option;
|
|
491
|
+
});
|
|
492
|
+
this.handleChange(newSelectedOptions, e);
|
|
493
|
+
} else {
|
|
494
|
+
this.handleChange([...selectedOptions, option], e);
|
|
495
|
+
}
|
|
463
496
|
}
|
|
464
497
|
|
|
465
498
|
handleRemoveOption(options) {
|
|
@@ -473,18 +506,22 @@ export class MultiSelectComponent extends React.Component {
|
|
|
473
506
|
lastHighLightedSelectOption,
|
|
474
507
|
shiftKeyPressHighLighted
|
|
475
508
|
} = this.state;
|
|
509
|
+
|
|
476
510
|
if (newOptions.length && !isReadOnly) {
|
|
477
511
|
const newSelectedOptions = selectedOptions.filter(option => newOptions.indexOf(option) === -1);
|
|
478
512
|
const newHighLightedSelectOptions = highLightedSelectOptions.filter(option => newSelectedOptions.indexOf(option) >= 0);
|
|
479
513
|
let isHighlightedRemoved = false;
|
|
480
514
|
const newOptionsLen = newOptions.length;
|
|
515
|
+
|
|
481
516
|
for (let i = 0; i < newOptionsLen; i++) {
|
|
482
517
|
const removedOption = newOptions[i];
|
|
518
|
+
|
|
483
519
|
if (highLightedSelectOptions.indexOf(removedOption) >= 0) {
|
|
484
520
|
isHighlightedRemoved = true;
|
|
485
521
|
break;
|
|
486
522
|
}
|
|
487
523
|
}
|
|
524
|
+
|
|
488
525
|
this.setState({
|
|
489
526
|
lastHighLightedSelectOption: newSelectedOptions.indexOf(lastHighLightedSelectOption) >= 0 && !isHighlightedRemoved ? lastHighLightedSelectOption : '',
|
|
490
527
|
highLightedSelectOptions: isHighlightedRemoved ? [] : newHighLightedSelectOptions,
|
|
@@ -492,10 +529,12 @@ export class MultiSelectComponent extends React.Component {
|
|
|
492
529
|
});
|
|
493
530
|
this.handleChange(newSelectedOptions);
|
|
494
531
|
}
|
|
532
|
+
|
|
495
533
|
this.searchInput && this.searchInput.focus({
|
|
496
534
|
preventScroll: true
|
|
497
535
|
});
|
|
498
536
|
}
|
|
537
|
+
|
|
499
538
|
handleMouseEnter(id, val, hoverOptionIndex, e) {
|
|
500
539
|
e && e.preventDefault();
|
|
501
540
|
const {
|
|
@@ -505,16 +544,19 @@ export class MultiSelectComponent extends React.Component {
|
|
|
505
544
|
suggestionsOrder
|
|
506
545
|
} = this;
|
|
507
546
|
const newHoverIndex = suggestionsOrder.indexOf(id);
|
|
547
|
+
|
|
508
548
|
if (newHoverIndex !== hoverOption) {
|
|
509
549
|
this.setState({
|
|
510
550
|
hoverOption: newHoverIndex
|
|
511
551
|
});
|
|
512
552
|
}
|
|
513
553
|
}
|
|
554
|
+
|
|
514
555
|
handleFetchOptions() {
|
|
515
556
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
516
557
|
args[_key] = arguments[_key];
|
|
517
558
|
}
|
|
559
|
+
|
|
518
560
|
const [APICall, searchStr] = args;
|
|
519
561
|
const {
|
|
520
562
|
isFetchingOptions
|
|
@@ -523,10 +565,12 @@ export class MultiSelectComponent extends React.Component {
|
|
|
523
565
|
_isMounted
|
|
524
566
|
} = this;
|
|
525
567
|
const isForce = isFetchingOptions && searchStr ? true : false;
|
|
568
|
+
|
|
526
569
|
if (!isFetchingOptions && APICall || isForce) {
|
|
527
570
|
this.setState({
|
|
528
571
|
isFetchingOptions: true
|
|
529
572
|
});
|
|
573
|
+
|
|
530
574
|
try {
|
|
531
575
|
return APICall(searchStr).then(() => {
|
|
532
576
|
_isMounted && this.setState({
|
|
@@ -544,6 +588,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
544
588
|
}
|
|
545
589
|
}
|
|
546
590
|
}
|
|
591
|
+
|
|
547
592
|
handleSearchOptions() {
|
|
548
593
|
const {
|
|
549
594
|
onSearch
|
|
@@ -553,6 +598,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
553
598
|
} = this.state;
|
|
554
599
|
searchStr && this.handleFetchOptions(onSearch, searchStr);
|
|
555
600
|
}
|
|
601
|
+
|
|
556
602
|
handleSearch(value, e) {
|
|
557
603
|
const {
|
|
558
604
|
onSearch,
|
|
@@ -575,6 +621,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
575
621
|
}
|
|
576
622
|
});
|
|
577
623
|
}
|
|
624
|
+
|
|
578
625
|
handleClickSelectedOption() {
|
|
579
626
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
580
627
|
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -590,13 +637,16 @@ export class MultiSelectComponent extends React.Component {
|
|
|
590
637
|
ctrlKey,
|
|
591
638
|
shiftKey
|
|
592
639
|
} = e;
|
|
640
|
+
|
|
593
641
|
if (e && shiftKey) {
|
|
594
642
|
//shift+click
|
|
595
643
|
let from = selectedOptions.indexOf(lastHighLightedSelectOption) >= 0 ? selectedOptions.indexOf(lastHighLightedSelectOption) : 0;
|
|
596
644
|
let to = id && selectedOptions.indexOf(id) >= 0 ? selectedOptions.indexOf(id) : null;
|
|
645
|
+
|
|
597
646
|
if (to >= 0 && to < from) {
|
|
598
647
|
[to] = [from, from = to];
|
|
599
648
|
}
|
|
649
|
+
|
|
600
650
|
to += 1;
|
|
601
651
|
const newSelectedHighlights = to ? selectedOptions.slice(from, to) : [];
|
|
602
652
|
to && this.setState({
|
|
@@ -607,6 +657,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
607
657
|
//ctrl+click
|
|
608
658
|
const isRemove = highLightedSelectOptions.indexOf(id) >= 0;
|
|
609
659
|
let newSelectedHighlights = [];
|
|
660
|
+
|
|
610
661
|
if (isRemove) {
|
|
611
662
|
lastHighLightedSelectOption = id === lastHighLightedSelectOption ? '' : lastHighLightedSelectOption;
|
|
612
663
|
newSelectedHighlights = highLightedSelectOptions.filter(option => option !== id);
|
|
@@ -614,6 +665,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
614
665
|
lastHighLightedSelectOption = id;
|
|
615
666
|
newSelectedHighlights = [...highLightedSelectOptions, id];
|
|
616
667
|
}
|
|
668
|
+
|
|
617
669
|
this.setState({
|
|
618
670
|
highLightedSelectOptions: newSelectedHighlights,
|
|
619
671
|
lastHighLightedSelectOption
|
|
@@ -624,6 +676,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
624
676
|
lastHighLightedSelectOption: id
|
|
625
677
|
});
|
|
626
678
|
}
|
|
679
|
+
|
|
627
680
|
this.setState({
|
|
628
681
|
shiftKeyPressHighLighted: 0
|
|
629
682
|
});
|
|
@@ -631,11 +684,13 @@ export class MultiSelectComponent extends React.Component {
|
|
|
631
684
|
preventScroll: true
|
|
632
685
|
});
|
|
633
686
|
}
|
|
687
|
+
|
|
634
688
|
handleScroll(e) {
|
|
635
689
|
let ele = e.target;
|
|
636
690
|
let isScrollReachedBottom = findScrollEnd(ele);
|
|
637
691
|
isScrollReachedBottom && this.handleScrollFuncCall();
|
|
638
692
|
}
|
|
693
|
+
|
|
639
694
|
handleScrollFuncCall() {
|
|
640
695
|
const {
|
|
641
696
|
getNextOptions,
|
|
@@ -646,6 +701,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
646
701
|
} = this.state;
|
|
647
702
|
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
648
703
|
}
|
|
704
|
+
|
|
649
705
|
handleChange() {
|
|
650
706
|
let selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
651
707
|
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -668,19 +724,23 @@ export class MultiSelectComponent extends React.Component {
|
|
|
668
724
|
});
|
|
669
725
|
const selectedOptionsLen = newSelectedOptions.length;
|
|
670
726
|
const allSelectedOptionsDetails = [];
|
|
727
|
+
|
|
671
728
|
for (let i = 0; i < selectedOptionsLen; i++) {
|
|
672
729
|
const id = newSelectedOptions[i];
|
|
673
730
|
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
674
731
|
}
|
|
675
|
-
|
|
676
|
-
// this.setState({ searchStr: '' });
|
|
732
|
+
|
|
733
|
+
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails); // this.setState({ searchStr: '' });
|
|
734
|
+
|
|
677
735
|
this.searchInput && this.searchInput.focus({
|
|
678
736
|
preventScroll: true
|
|
679
737
|
});
|
|
738
|
+
|
|
680
739
|
if (needToCloseOnSelect) {
|
|
681
740
|
togglePopup(e);
|
|
682
741
|
}
|
|
683
742
|
}
|
|
743
|
+
|
|
684
744
|
togglePopup(e) {
|
|
685
745
|
const {
|
|
686
746
|
togglePopup,
|
|
@@ -689,12 +749,14 @@ export class MultiSelectComponent extends React.Component {
|
|
|
689
749
|
} = this.props;
|
|
690
750
|
!isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}` : null);
|
|
691
751
|
}
|
|
752
|
+
|
|
692
753
|
handlePopupClose(e) {
|
|
693
754
|
const {
|
|
694
755
|
closePopupOnly
|
|
695
756
|
} = this.props;
|
|
696
757
|
closePopupOnly(e);
|
|
697
758
|
}
|
|
759
|
+
|
|
698
760
|
searchInputRef(el) {
|
|
699
761
|
const {
|
|
700
762
|
getRef
|
|
@@ -702,6 +764,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
702
764
|
this.searchInput = el;
|
|
703
765
|
getRef && getRef(el);
|
|
704
766
|
}
|
|
767
|
+
|
|
705
768
|
selectedOptionContainerRef(el) {
|
|
706
769
|
const {
|
|
707
770
|
getTargetRef
|
|
@@ -709,25 +772,31 @@ export class MultiSelectComponent extends React.Component {
|
|
|
709
772
|
this.selectedOptionContainer = el;
|
|
710
773
|
getTargetRef(el);
|
|
711
774
|
}
|
|
775
|
+
|
|
712
776
|
selectedOptionRef(el, id) {
|
|
713
777
|
this[`selectedOption_${id}`] = el;
|
|
714
778
|
}
|
|
779
|
+
|
|
715
780
|
suggestionContainerRef(el) {
|
|
716
781
|
this.suggestionContainer = el;
|
|
717
782
|
}
|
|
783
|
+
|
|
718
784
|
suggestionItemRef(el, index, id) {
|
|
719
785
|
this[`suggestion_${id}`] = el;
|
|
720
786
|
}
|
|
787
|
+
|
|
721
788
|
handleActive(e) {
|
|
722
789
|
const {
|
|
723
790
|
searchStr,
|
|
724
791
|
isActive
|
|
725
792
|
} = this.state;
|
|
793
|
+
|
|
726
794
|
if (!isActive) {
|
|
727
795
|
this.setState({
|
|
728
796
|
isActive: true
|
|
729
797
|
});
|
|
730
798
|
}
|
|
799
|
+
|
|
731
800
|
const {
|
|
732
801
|
target
|
|
733
802
|
} = e || {};
|
|
@@ -737,16 +806,19 @@ export class MultiSelectComponent extends React.Component {
|
|
|
737
806
|
} = this.props;
|
|
738
807
|
onFocus && onFocus(searchStr);
|
|
739
808
|
}
|
|
809
|
+
|
|
740
810
|
handleInactive() {
|
|
741
811
|
const {
|
|
742
812
|
isActive
|
|
743
813
|
} = this.state;
|
|
814
|
+
|
|
744
815
|
if (isActive) {
|
|
745
816
|
this.setState({
|
|
746
817
|
isActive: false
|
|
747
818
|
});
|
|
748
819
|
}
|
|
749
820
|
}
|
|
821
|
+
|
|
750
822
|
handleInputFocus() {
|
|
751
823
|
const {
|
|
752
824
|
isDisabled,
|
|
@@ -756,6 +828,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
756
828
|
preventScroll: true
|
|
757
829
|
});
|
|
758
830
|
}
|
|
831
|
+
|
|
759
832
|
handleExposedPublicMethods() {
|
|
760
833
|
const {
|
|
761
834
|
getPublicMethods,
|
|
@@ -765,6 +838,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
765
838
|
openPopupOnly
|
|
766
839
|
});
|
|
767
840
|
}
|
|
841
|
+
|
|
768
842
|
responsiveFunc(_ref) {
|
|
769
843
|
let {
|
|
770
844
|
mediaQueryOR
|
|
@@ -775,6 +849,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
775
849
|
}])
|
|
776
850
|
};
|
|
777
851
|
}
|
|
852
|
+
|
|
778
853
|
render() {
|
|
779
854
|
let {
|
|
780
855
|
isReadOnly,
|
|
@@ -800,6 +875,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
800
875
|
title,
|
|
801
876
|
needResponsive,
|
|
802
877
|
dataId,
|
|
878
|
+
dataSelectorId,
|
|
803
879
|
isSearching,
|
|
804
880
|
borderColor,
|
|
805
881
|
textBoxClass,
|
|
@@ -825,7 +901,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
825
901
|
searchText = 'Searching...'
|
|
826
902
|
} = i18nKeys;
|
|
827
903
|
const {
|
|
828
|
-
clearLabel = 'Clear all'
|
|
904
|
+
clearLabel = 'Clear all',
|
|
905
|
+
ariaLabelledby
|
|
829
906
|
} = a11y;
|
|
830
907
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
831
908
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
@@ -839,7 +916,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
839
916
|
highLightedSelectOptions,
|
|
840
917
|
options,
|
|
841
918
|
isFetchingOptions,
|
|
842
|
-
isActive
|
|
919
|
+
isActive,
|
|
920
|
+
selectedOptionIds
|
|
843
921
|
} = this.state;
|
|
844
922
|
const suggestions = this.handleFilterSuggestions();
|
|
845
923
|
const setAriaId = this.getNextAriaId();
|
|
@@ -854,8 +932,10 @@ export class MultiSelectComponent extends React.Component {
|
|
|
854
932
|
return /*#__PURE__*/React.createElement("div", {
|
|
855
933
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
856
934
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
935
|
+
"data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
857
936
|
"data-title": isDisabled ? title : null,
|
|
858
|
-
onClick: this.handleInputFocus
|
|
937
|
+
onClick: this.handleInputFocus,
|
|
938
|
+
"data-selector-id": dataSelectorId
|
|
859
939
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
860
940
|
align: "vertical",
|
|
861
941
|
alignBox: "row",
|
|
@@ -907,7 +987,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
907
987
|
ariaExpanded: !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? true : false,
|
|
908
988
|
ariaHaspopup: true,
|
|
909
989
|
ariaRequired: true,
|
|
910
|
-
ariaDescribedby: ariaErrorId
|
|
990
|
+
ariaDescribedby: ariaErrorId,
|
|
991
|
+
ariaLabelledby: ariaLabelledby
|
|
911
992
|
},
|
|
912
993
|
autoComplete: autoComplete
|
|
913
994
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
@@ -981,6 +1062,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
981
1062
|
needBorder: false,
|
|
982
1063
|
dataId: `${dataId}_Options`,
|
|
983
1064
|
palette: palette,
|
|
1065
|
+
selectedOptions: selectedOptionIds,
|
|
984
1066
|
a11y: {
|
|
985
1067
|
role: 'option'
|
|
986
1068
|
}
|
|
@@ -999,15 +1081,16 @@ export class MultiSelectComponent extends React.Component {
|
|
|
999
1081
|
}, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
|
|
1000
1082
|
}) : null);
|
|
1001
1083
|
}
|
|
1084
|
+
|
|
1002
1085
|
}
|
|
1003
1086
|
MultiSelectComponent.propTypes = MultiSelect_propTypes;
|
|
1004
|
-
MultiSelectComponent.defaultProps = MultiSelect_defaultProps;
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1087
|
+
MultiSelectComponent.defaultProps = MultiSelect_defaultProps; // if (__DOCS__) {
|
|
1088
|
+
// MultiSelectComponent.docs = {
|
|
1089
|
+
// componentGroup: 'Form Elements',
|
|
1090
|
+
// folderName: 'Style Guide'
|
|
1091
|
+
// };
|
|
1092
|
+
// }
|
|
1093
|
+
|
|
1011
1094
|
MultiSelectComponent.displayName = 'MultiSelect';
|
|
1012
1095
|
const MultiSelect = Popup(MultiSelectComponent);
|
|
1013
1096
|
MultiSelect.propTypes = MultiSelectComponent.propTypes;
|