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