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