@zohodesk/components 1.0.0-temp-78 → 1.0.0-temp-80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1084 -1075
- package/assets/Appearance/dark/mode/contrast/darkContrast.module.css +343 -0
- package/assets/Appearance/dark/themes/blue/contrast/blueDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/green/contrast/greenDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/orange/contrast/orangeDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/red/contrast/redDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/dark/themes/yellow/contrast/yellowDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/mode/contrast/defaultContrast.module.css +343 -0
- package/assets/Appearance/default/themes/blue/contrast/blueDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/green/contrast/greenDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/orange/contrast/orangeDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/red/contrast/redDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/default/themes/yellow/contrast/yellowDefaultCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/mode/contrast/pureDarkContrast.module.css +343 -0
- package/assets/Appearance/pureDark/themes/blue/contrast/bluePureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/green/contrast/greenPureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/orange/contrast/orangePureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/red/contrast/redPureDarkCTAThemeContrast.module.css +34 -0
- package/assets/Appearance/pureDark/themes/yellow/contrast/yellowPureDarkCTAThemeContrast.module.css +34 -0
- package/docs/external/active-line.js +72 -72
- package/docs/external/autorefresh.js +47 -47
- package/docs/external/codemirror.js +9681 -9681
- package/docs/external/css/hopscotch.css +576 -576
- package/docs/external/css/styleGuide.css +1100 -1100
- package/docs/external/css.js +466 -466
- package/docs/external/designTokens.js +1 -1
- package/docs/external/foldcode.js +151 -151
- package/docs/external/format.js +129 -129
- package/docs/external/htmlmixed.js +84 -84
- package/docs/external/index.html +127 -127
- package/docs/external/javascript.js +422 -422
- package/docs/external/jsx.js +147 -147
- package/docs/external/matchbrackets.js +145 -145
- package/docs/external/xml.js +322 -322
- package/docs/package.json +41 -41
- package/docs/src/index.js +1311 -1311
- package/es/Accordion/Accordion.js +0 -7
- package/es/Accordion/AccordionItem.js +0 -4
- package/es/Accordion/docs/Accordion__Demo.docs.js +0 -2
- package/es/Animation/Animation.js +0 -3
- package/es/Animation/docs/Animation__default.docs.js +0 -2
- package/es/Animation/docs/Animation__fadeIn.docs.js +0 -2
- package/es/Animation/docs/Animation__scaleIn.docs.js +0 -2
- package/es/Animation/docs/Animation__skewIn.docs.js +0 -2
- package/es/Animation/docs/Animation__slideDown.docs.js +0 -2
- package/es/Animation/docs/Animation__slideLeft.docs.js +0 -2
- package/es/Animation/docs/Animation__zoomIn.docs.js +0 -2
- package/es/AppContainer/AppContainer.js +2 -13
- package/es/AppContainer/AppContainer.module.css +18 -18
- package/es/AppContainer/docs/AppContainer__default.docs.js +0 -2
- package/es/Avatar/Avatar.js +44 -50
- package/es/Avatar/Avatar.module.css +135 -117
- package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -288
- package/es/Avatar/docs/Avatar__custom.docs.js +1 -3
- package/es/Avatar/docs/Avatar__default.docs.js +1 -3
- package/es/Avatar/docs/Avatar__palette.docs.js +1 -3
- package/es/Avatar/docs/Avatar__text.docs.js +1 -3
- package/es/Avatar/props/defaultProps.js +2 -1
- package/es/Avatar/props/propTypes.js +2 -1
- package/es/AvatarTeam/AvatarTeam.js +7 -10
- package/es/AvatarTeam/AvatarTeam.module.css +161 -161
- package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -226
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -2
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -2
- package/es/Button/Button.js +7 -14
- package/es/Button/Button.module.css +521 -521
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -191
- package/es/Button/docs/Button__custom.docs.js +11 -13
- package/es/Button/docs/Button__default.docs.js +11 -13
- package/es/Buttongroup/Buttongroup.js +1 -4
- package/es/Buttongroup/Buttongroup.module.css +89 -89
- package/es/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -146
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -2
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -2
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -2
- package/es/Card/Card.js +11 -26
- package/es/Card/Card.module.css +20 -20
- package/es/Card/docs/Card__Custom.docs.js +0 -2
- package/es/Card/docs/Card__Default.docs.js +0 -2
- package/es/Card/docs/Card__Scroll.docs.js +0 -3
- package/es/CheckBox/CheckBox.js +0 -5
- package/es/CheckBox/CheckBox.module.css +157 -157
- package/es/CheckBox/docs/CheckBox__custom.docs.js +12 -16
- package/es/CheckBox/docs/CheckBox__default.docs.js +12 -16
- package/es/DateTime/CalendarView.js +4 -23
- package/es/DateTime/DateTime.js +6 -74
- package/es/DateTime/DateTime.module.css +187 -187
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +34 -101
- package/es/DateTime/DateWidget.module.css +38 -38
- package/es/DateTime/DaysRow.js +2 -4
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +4 -28
- package/es/DateTime/YearView.module.css +81 -81
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -1
- package/es/DateTime/__tests__/DateTime.spec.js +0 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +3 -2
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -63
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -28
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/docs/DateTime__default.docs.js +6 -9
- package/es/DateTime/docs/DateWidget__default.docs.js +0 -5
- package/es/DateTime/index.js +0 -0
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +9 -52
- package/es/DropBox/DropBox.module.css +406 -406
- package/es/DropBox/DropBoxPositionMapping.json +144 -144
- package/es/DropBox/docs/DropBox__custom.docs.js +25 -27
- package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -7
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -7
- package/es/DropBox/docs/DropBox__position.docs.js +35 -37
- package/es/DropBox/docs/DropBox__size.docs.js +28 -30
- package/es/DropBox/props/defaultProps.js +1 -2
- package/es/DropBox/props/propTypes.js +0 -1
- package/es/DropDown/DropDown.js +1 -9
- package/es/DropDown/DropDown.module.css +5 -5
- package/es/DropDown/DropDownHeading.js +2 -4
- package/es/DropDown/DropDownHeading.module.css +53 -53
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownItem.module.css +94 -94
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSearch.module.css +14 -14
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/DropDownSeparator.module.css +7 -7
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -2
- package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -2
- package/es/Heading/Heading.js +34 -0
- package/es/Heading/Heading.module.css +5 -0
- package/es/Heading/docs/Heading__default.docs.js +19 -0
- package/es/Heading/props/defaultProps.js +5 -0
- package/es/Heading/props/propTypes.js +11 -0
- package/es/Label/Label.js +2 -4
- package/es/Label/Label.module.css +52 -52
- package/es/Label/LabelColors.module.css +20 -20
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -101
- package/es/Label/docs/Label__clipped.docs.js +0 -2
- package/es/Label/docs/Label__custom.docs.js +0 -2
- package/es/Label/docs/Label__palette.docs.js +0 -2
- package/es/Label/docs/Label__size.docs.js +0 -2
- package/es/Label/docs/Label__type.docs.js +0 -2
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/Layout.module.css +335 -335
- package/es/Layout/docs/Layout__Hidden.docs.js +0 -1
- package/es/Layout/docs/Layout__default.docs.js +0 -1
- package/es/Layout/docs/Layout__four_Column.docs.js +0 -1
- package/es/Layout/docs/Layout__three_Column.docs.js +0 -1
- package/es/Layout/docs/Layout__two_Column.docs.js +0 -1
- package/es/Layout/utils.js +0 -0
- package/es/LightNightMode/Colors.json +496 -496
- package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -2
- package/es/ListItem/ListContainer.js +1 -10
- package/es/ListItem/ListItem.js +0 -9
- package/es/ListItem/ListItem.module.css +209 -209
- package/es/ListItem/ListItemWithAvatar.js +1 -9
- package/es/ListItem/ListItemWithCheckBox.js +0 -7
- package/es/ListItem/ListItemWithIcon.js +0 -8
- package/es/ListItem/ListItemWithRadio.js +0 -7
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -2
- package/es/ListItem/docs/ListItem__custom.docs.js +0 -2
- package/es/ListItem/docs/ListItem__default.docs.js +0 -2
- package/es/Modal/Modal.js +8 -28
- package/es/Modal/__docs__/Modal__default.docs.js +1 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +16 -95
- package/es/MultiSelect/AdvancedMultiSelect.js +10 -36
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MultiSelect.js +36 -105
- package/es/MultiSelect/MultiSelect.module.css +205 -205
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +5 -14
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/SelectedOptions.module.css +15 -15
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -7
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +1 -7
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +1 -5
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +1 -6
- package/es/MultiSelect/props/propTypes.js +0 -2
- package/es/PopOver/PopOver.js +0 -18
- package/es/PopOver/PopOver.module.css +8 -8
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/PopOver/docs/PopOver__default.docs.js +0 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/PositionMapping.json +73 -73
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +2 -9
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Provider/docs/Provider_Id__Class.docs.js +3 -4
- package/es/Provider/docs/Provider_Id__Function.docs.js +0 -1
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +3 -4
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -1
- package/es/Provider.js +36 -11
- package/es/Radio/Radio.js +0 -4
- package/es/Radio/Radio.module.css +112 -112
- package/es/Radio/docs/Radio__custom.docs.js +12 -16
- package/es/Radio/docs/Radio__default.docs.js +12 -16
- package/es/Responsive/CustomResponsive.js +18 -28
- package/es/Responsive/RefWrapper.js +7 -6
- package/es/Responsive/ResizeComponent.js +25 -35
- package/es/Responsive/ResizeObserver.js +6 -26
- package/es/Responsive/Responsive.js +20 -34
- package/es/Responsive/docs/Responsive__Custom.docs.js +22 -14
- package/es/Responsive/docs/Responsive__default.docs.js +1 -3
- package/es/Responsive/docs/style.module.css +55 -55
- package/es/Responsive/sizeObservers.js +7 -28
- package/es/Responsive/utils/index.js +5 -7
- package/es/Responsive/utils/shallowCompare.js +2 -7
- package/es/Responsive/windowResizeObserver.js +0 -7
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +0 -4
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/es/Ribbon/Ribbon.js +0 -3
- package/es/Ribbon/Ribbon.module.css +376 -376
- package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -163
- package/es/Ribbon/docs/Ribbon__custom.docs.js +13 -14
- package/es/Ribbon/docs/Ribbon__default.docs.js +13 -14
- package/es/RippleEffect/RippleEffect.js +0 -1
- package/es/RippleEffect/RippleEffect.module.css +92 -92
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +12 -14
- package/es/Select/GroupSelect.js +13 -60
- package/es/Select/Select.js +34 -84
- package/es/Select/Select.module.css +106 -106
- package/es/Select/SelectWithAvatar.js +3 -20
- package/es/Select/SelectWithIcon.js +2 -40
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/docs/GroupSelect__default.docs.js +1 -6
- package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -4
- package/es/Select/docs/SelectWithIcon__default.docs.js +0 -4
- package/es/Select/docs/Select__default.docs.js +0 -5
- package/es/Select/props/propTypes.js +0 -1
- package/es/Stencils/Stencils.js +0 -3
- package/es/Stencils/Stencils.module.css +96 -96
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -49
- package/es/Stencils/docs/Stencils__custom.docs.js +0 -2
- package/es/Stencils/docs/Stencils__default.docs.js +0 -2
- package/es/Switch/Switch.js +0 -5
- package/es/Switch/Switch.module.css +110 -110
- package/es/Switch/docs/Switch__custom.docs.js +12 -14
- package/es/Switch/docs/Switch__default.docs.js +12 -14
- package/es/Tab/Tab.js +1 -4
- package/es/Tab/Tab.module.css +101 -101
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContent.module.css +4 -4
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +24 -71
- package/es/Tab/Tabs.module.css +141 -141
- package/es/Tab/__tests__/Tab.spec.js +2 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tab/docs/Tab__default.docs.js +0 -5
- package/es/Tab/docs/tabdocs.module.css +29 -29
- package/es/Tag/Tag.js +9 -14
- package/es/Tag/Tag.module.css +254 -254
- package/es/Tag/docs/Tag__custom.docs.js +11 -13
- package/es/Tag/docs/Tag__default.docs.js +11 -13
- package/es/TextBox/TextBox.js +0 -15
- package/es/TextBox/TextBox.module.css +157 -157
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -127
- package/es/TextBox/docs/TextBox__custom.docs.js +0 -2
- package/es/TextBox/docs/TextBox__default.docs.js +0 -2
- package/es/TextBox/docs/TextBox__size.docs.js +0 -2
- package/es/TextBox/docs/TextBox__variant.docs.js +0 -2
- package/es/TextBoxIcon/TextBoxIcon.js +0 -7
- package/es/TextBoxIcon/TextBoxIcon.module.css +78 -78
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -334
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -2
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -2
- package/es/Textarea/Textarea.js +0 -12
- package/es/Textarea/Textarea.module.css +139 -139
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -97
- package/es/Textarea/docs/Textarea__animated.docs.js +0 -2
- package/es/Textarea/docs/Textarea__custom.docs.js +0 -2
- package/es/Textarea/docs/Textarea__default.docs.js +0 -2
- package/es/Textarea/docs/Textarea__disabled.docs.js +0 -2
- package/es/Tooltip/Tooltip.js +11 -58
- package/es/Tooltip/Tooltip.module.css +109 -109
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/Tooltip/docs/Tooltip__default.docs.js +63 -67
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -3
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -5
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -7
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +17 -28
- package/es/common/animation.module.css +624 -624
- package/es/common/avatarsizes.module.css +44 -44
- package/es/common/basic.module.css +33 -33
- package/es/common/basicReset.module.css +40 -40
- package/es/common/common.module.css +524 -524
- package/es/common/customscroll.module.css +89 -89
- package/es/common/docStyle.module.css +887 -766
- package/es/common/reset.module.css +12 -12
- package/es/common/transition.module.css +146 -146
- package/es/deprecated/AdvancedMultiSelect.module.css +126 -126
- package/es/deprecated/PortalLayer/PortalLayer.js +17 -25
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -7
- package/es/index.js +5 -2
- package/es/semantic/Button/Button.js +0 -3
- package/es/semantic/Button/docs/Button__default.docs.js +0 -3
- package/es/semantic/Button/semanticButton.module.css +9 -9
- package/es/utils/Common.js +5 -47
- package/es/utils/ContextOptimizer.js +5 -4
- package/es/utils/__tests__/debounce.spec.js +2 -2
- package/es/utils/constructFullName.js +0 -2
- package/es/utils/datetime/common.js +5 -16
- package/es/utils/debounce.js +1 -5
- package/es/utils/dropDownUtils.js +11 -67
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/lib/Accordion/Accordion.js +10 -39
- package/lib/Accordion/AccordionItem.js +12 -38
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -22
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +12 -37
- package/lib/Animation/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/docs/Animation__default.docs.js +0 -24
- package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__skewIn.docs.js +0 -24
- package/lib/Animation/docs/Animation__slideDown.docs.js +0 -24
- package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -24
- package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -24
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +14 -52
- package/lib/AppContainer/AppContainer.module.css +18 -18
- package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -23
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +56 -98
- package/lib/Avatar/Avatar.module.css +135 -117
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -288
- package/lib/Avatar/docs/Avatar__custom.docs.js +1 -26
- package/lib/Avatar/docs/Avatar__default.docs.js +1 -24
- package/lib/Avatar/docs/Avatar__palette.docs.js +1 -26
- package/lib/Avatar/docs/Avatar__text.docs.js +1 -26
- package/lib/Avatar/props/defaultProps.js +2 -1
- package/lib/Avatar/props/propTypes.js +2 -4
- package/lib/AvatarTeam/AvatarTeam.js +27 -54
- package/lib/AvatarTeam/AvatarTeam.module.css +161 -161
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -226
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -24
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -24
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +25 -53
- package/lib/Button/Button.module.css +521 -521
- package/lib/Button/__tests__/Button.spec.js +0 -40
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -191
- package/lib/Button/docs/Button__custom.docs.js +11 -37
- package/lib/Button/docs/Button__default.docs.js +11 -36
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +6 -32
- package/lib/Buttongroup/Buttongroup.module.css +89 -89
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -146
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -25
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -25
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -27
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +45 -106
- package/lib/Card/Card.module.css +20 -20
- package/lib/Card/__tests__/Card.spec.js +1 -10
- package/lib/Card/docs/Card__Custom.docs.js +0 -27
- package/lib/Card/docs/Card__Default.docs.js +0 -26
- package/lib/Card/docs/Card__Scroll.docs.js +3 -30
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/propTypes.js +0 -3
- package/lib/CheckBox/CheckBox.js +40 -69
- package/lib/CheckBox/CheckBox.module.css +157 -157
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +12 -37
- package/lib/CheckBox/docs/CheckBox__default.docs.js +12 -36
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +20 -70
- package/lib/DateTime/DateTime.js +149 -243
- package/lib/DateTime/DateTime.module.css +187 -187
- package/lib/DateTime/DateTimePopupFooter.js +5 -30
- package/lib/DateTime/DateTimePopupHeader.js +13 -45
- package/lib/DateTime/DateWidget.js +243 -349
- package/lib/DateTime/DateWidget.module.css +38 -38
- package/lib/DateTime/DaysRow.js +2 -26
- package/lib/DateTime/Time.js +29 -72
- package/lib/DateTime/YearView.js +25 -75
- package/lib/DateTime/YearView.module.css +81 -81
- package/lib/DateTime/__tests__/CalendarView.spec.js +5 -13
- package/lib/DateTime/__tests__/DateTime.spec.js +37 -51
- package/lib/DateTime/__tests__/DateWidget.spec.js +8 -10
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -184
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +12 -61
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +20 -52
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/docs/DateTime__default.docs.js +10 -33
- package/lib/DateTime/docs/DateWidget__default.docs.js +2 -30
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +0 -3
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +6 -69
- package/lib/DropBox/DropBox.js +60 -141
- package/lib/DropBox/DropBox.module.css +406 -406
- package/lib/DropBox/DropBoxPositionMapping.json +144 -144
- package/lib/DropBox/__tests__/DropBox.spec.js +2 -6
- package/lib/DropBox/docs/DropBox__custom.docs.js +25 -50
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +9 -36
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +9 -36
- package/lib/DropBox/docs/DropBox__position.docs.js +35 -59
- package/lib/DropBox/docs/DropBox__size.docs.js +28 -52
- package/lib/DropBox/props/defaultProps.js +1 -2
- package/lib/DropBox/props/propTypes.js +0 -4
- package/lib/DropDown/DropDown.js +3 -53
- package/lib/DropDown/DropDown.module.css +5 -5
- package/lib/DropDown/DropDownHeading.js +11 -35
- package/lib/DropDown/DropDownHeading.module.css +53 -53
- package/lib/DropDown/DropDownItem.js +17 -41
- package/lib/DropDown/DropDownItem.module.css +94 -94
- package/lib/DropDown/DropDownSearch.js +15 -41
- package/lib/DropDown/DropDownSearch.module.css +14 -14
- package/lib/DropDown/DropDownSeparator.js +1 -23
- package/lib/DropDown/DropDownSeparator.module.css +7 -7
- package/lib/DropDown/__tests__/DropDown.spec.js +9 -15
- package/lib/DropDown/__tests__/DropDownItem.spec.js +4 -9
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -3
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -23
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -22
- package/lib/DropDown/props/propTypes.js +0 -5
- package/lib/Heading/Heading.js +64 -0
- package/lib/Heading/Heading.module.css +5 -0
- package/lib/Heading/docs/Heading__default.docs.js +50 -0
- package/lib/Heading/props/defaultProps.js +12 -0
- package/lib/Heading/props/propTypes.js +19 -0
- package/lib/Label/Label.js +11 -36
- package/lib/Label/Label.module.css +52 -52
- package/lib/Label/LabelColors.module.css +20 -20
- package/lib/Label/__tests__/Label.spec.js +1 -14
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -101
- package/lib/Label/docs/Label__clipped.docs.js +0 -25
- package/lib/Label/docs/Label__custom.docs.js +0 -26
- package/lib/Label/docs/Label__palette.docs.js +0 -25
- package/lib/Label/docs/Label__size.docs.js +0 -25
- package/lib/Label/docs/Label__type.docs.js +0 -25
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +11 -31
- package/lib/Layout/Container.js +10 -29
- package/lib/Layout/Layout.module.css +335 -335
- package/lib/Layout/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/docs/Layout__Hidden.docs.js +0 -22
- package/lib/Layout/docs/Layout__default.docs.js +0 -21
- package/lib/Layout/docs/Layout__four_Column.docs.js +0 -22
- package/lib/Layout/docs/Layout__three_Column.docs.js +0 -22
- package/lib/Layout/docs/Layout__two_Column.docs.js +0 -22
- package/lib/Layout/index.js +0 -4
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -10
- package/lib/LightNightMode/Colors.json +496 -496
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +1 -26
- package/lib/ListItem/ListContainer.js +26 -48
- package/lib/ListItem/ListItem.js +37 -66
- package/lib/ListItem/ListItem.module.css +209 -209
- package/lib/ListItem/ListItemWithAvatar.js +41 -72
- package/lib/ListItem/ListItemWithCheckBox.js +32 -61
- package/lib/ListItem/ListItemWithIcon.js +36 -65
- package/lib/ListItem/ListItemWithRadio.js +33 -62
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -24
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -23
- package/lib/ListItem/docs/ListItem__custom.docs.js +0 -23
- package/lib/ListItem/docs/ListItem__default.docs.js +0 -22
- package/lib/ListItem/props/propTypes.js +0 -5
- package/lib/Modal/Modal.js +4 -44
- package/lib/Modal/__docs__/Modal__default.docs.js +0 -23
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +162 -294
- package/lib/MultiSelect/AdvancedMultiSelect.js +120 -201
- package/lib/MultiSelect/EmptyState.js +21 -44
- package/lib/MultiSelect/MultiSelect.js +196 -317
- package/lib/MultiSelect/MultiSelect.module.css +205 -205
- package/lib/MultiSelect/MultiSelectHeader.js +5 -29
- package/lib/MultiSelect/MultiSelectWithAvatar.js +51 -96
- package/lib/MultiSelect/SelectedOptions.js +15 -44
- package/lib/MultiSelect/SelectedOptions.module.css +15 -15
- package/lib/MultiSelect/Suggestions.js +26 -59
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -23
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +3 -28
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +2 -28
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +2 -30
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +0 -5
- package/lib/PopOver/PopOver.js +44 -94
- package/lib/PopOver/PopOver.module.css +8 -8
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/docs/PopOver__default.docs.js +0 -25
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +77 -156
- package/lib/Popup/PositionMapping.json +73 -73
- package/lib/Popup/__tests__/Popup.spec.js +5 -42
- package/lib/Popup/viewPort.js +14 -28
- package/lib/Provider/AvatarSize.js +0 -4
- package/lib/Provider/Config.js +0 -2
- package/lib/Provider/CssProvider.js +0 -4
- package/lib/Provider/IdProvider.js +3 -17
- package/lib/Provider/LibraryContext.js +10 -32
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +14 -43
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Provider/docs/Provider_Id__Class.docs.js +3 -24
- package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -5
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +3 -24
- package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -5
- package/lib/Provider.js +38 -64
- package/lib/Radio/Radio.js +33 -60
- package/lib/Radio/Radio.module.css +112 -112
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/docs/Radio__custom.docs.js +12 -38
- package/lib/Radio/docs/Radio__default.docs.js +12 -37
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +23 -67
- package/lib/Responsive/RefWrapper.js +7 -15
- package/lib/Responsive/ResizeComponent.js +27 -58
- package/lib/Responsive/ResizeObserver.js +6 -23
- package/lib/Responsive/Responsive.js +24 -76
- package/lib/Responsive/docs/Responsive__Custom.docs.js +29 -54
- package/lib/Responsive/docs/Responsive__default.docs.js +4 -28
- package/lib/Responsive/docs/style.module.css +55 -55
- package/lib/Responsive/index.js +0 -2
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +13 -51
- package/lib/Responsive/utils/index.js +3 -11
- package/lib/Responsive/utils/shallowCompare.js +2 -11
- package/lib/Responsive/windowResizeObserver.js +0 -8
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +14 -44
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/lib/ResponsiveDropBox/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +7 -31
- package/lib/Ribbon/Ribbon.module.css +376 -376
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -163
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +13 -36
- package/lib/Ribbon/docs/Ribbon__default.docs.js +13 -35
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +7 -18
- package/lib/RippleEffect/RippleEffect.module.css +92 -92
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +12 -34
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +125 -225
- package/lib/Select/Select.js +203 -288
- package/lib/Select/Select.module.css +106 -106
- package/lib/Select/SelectWithAvatar.js +50 -101
- package/lib/Select/SelectWithIcon.js +69 -127
- package/lib/Select/__tests__/Select.spec.js +89 -131
- package/lib/Select/docs/GroupSelect__default.docs.js +0 -26
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -28
- package/lib/Select/docs/SelectWithIcon__default.docs.js +4 -29
- package/lib/Select/docs/Select__default.docs.js +0 -27
- package/lib/Select/props/defaultProps.js +0 -4
- package/lib/Select/props/propTypes.js +0 -4
- package/lib/Stencils/Stencils.js +4 -28
- package/lib/Stencils/Stencils.module.css +96 -96
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -49
- package/lib/Stencils/docs/Stencils__custom.docs.js +0 -24
- package/lib/Stencils/docs/Stencils__default.docs.js +0 -24
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +27 -55
- package/lib/Switch/Switch.module.css +110 -110
- package/lib/Switch/docs/Switch__custom.docs.js +12 -35
- package/lib/Switch/docs/Switch__default.docs.js +12 -34
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +23 -39
- package/lib/Tab/Tab.module.css +101 -101
- package/lib/Tab/TabContent.js +4 -11
- package/lib/Tab/TabContent.module.css +4 -4
- package/lib/Tab/TabContentWrapper.js +5 -12
- package/lib/Tab/TabWrapper.js +16 -34
- package/lib/Tab/Tabs.js +96 -177
- package/lib/Tab/Tabs.module.css +141 -141
- package/lib/Tab/__tests__/Tab.spec.js +63 -74
- package/lib/Tab/__tests__/TabContent.spec.js +6 -10
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +20 -28
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -12
- package/lib/Tab/__tests__/Tabs.spec.js +39 -53
- package/lib/Tab/docs/Tab__default.docs.js +0 -25
- package/lib/Tab/docs/tabdocs.module.css +29 -29
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +45 -78
- package/lib/Tag/Tag.module.css +254 -254
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/docs/Tag__custom.docs.js +11 -37
- package/lib/Tag/docs/Tag__default.docs.js +11 -36
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +52 -83
- package/lib/TextBox/TextBox.module.css +157 -157
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -127
- package/lib/TextBox/docs/TextBox__custom.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__default.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__size.docs.js +0 -26
- package/lib/TextBox/docs/TextBox__variant.docs.js +0 -26
- package/lib/TextBox/props/propTypes.js +0 -5
- package/lib/TextBoxIcon/TextBoxIcon.js +48 -80
- package/lib/TextBoxIcon/TextBoxIcon.module.css +78 -78
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +5 -14
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -334
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -27
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -27
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +22 -52
- package/lib/Textarea/Textarea.module.css +139 -139
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -97
- package/lib/Textarea/docs/Textarea__animated.docs.js +0 -25
- package/lib/Textarea/docs/Textarea__custom.docs.js +0 -26
- package/lib/Textarea/docs/Textarea__default.docs.js +0 -25
- package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -25
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +25 -92
- package/lib/Tooltip/Tooltip.module.css +109 -109
- package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -23
- package/lib/Tooltip/docs/Tooltip__default.docs.js +63 -91
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +11 -39
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +2 -29
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +18 -51
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +22 -54
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/common/animation.module.css +624 -624
- package/lib/common/avatarsizes.module.css +44 -44
- package/lib/common/basic.module.css +33 -33
- package/lib/common/basicReset.module.css +40 -40
- package/lib/common/common.module.css +524 -524
- package/lib/common/customscroll.module.css +89 -89
- package/lib/common/docStyle.module.css +887 -766
- package/lib/common/reset.module.css +12 -12
- package/lib/common/transition.module.css +146 -146
- package/lib/css.js +0 -39
- package/lib/deprecated/AdvancedMultiSelect.module.css +126 -126
- package/lib/deprecated/PortalLayer/PortalLayer.js +17 -45
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +2 -36
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +17 -157
- package/lib/semantic/Button/Button.js +17 -41
- package/lib/semantic/Button/docs/Button__default.docs.js +0 -23
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/Button/semanticButton.module.css +9 -9
- package/lib/utils/Common.js +11 -95
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/__tests__/constructFullName.spec.js +0 -1
- package/lib/utils/__tests__/debounce.spec.js +2 -3
- package/lib/utils/__tests__/getInitial.spec.js +0 -1
- package/lib/utils/constructFullName.js +2 -11
- package/lib/utils/datetime/common.js +5 -32
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +54 -171
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +76 -77
package/lib/Select/Select.js
CHANGED
|
@@ -1,91 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.SelectComponent = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _defaultProps = require("./props/defaultProps");
|
|
13
|
-
|
|
14
10
|
var _propTypes = require("./props/propTypes");
|
|
15
|
-
|
|
16
11
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
17
|
-
|
|
18
12
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
19
|
-
|
|
20
13
|
var _Layout = require("../Layout");
|
|
21
|
-
|
|
22
14
|
var _TextBox = _interopRequireDefault(require("../TextBox/TextBox"));
|
|
23
|
-
|
|
24
15
|
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
25
|
-
|
|
26
16
|
var _Suggestions = _interopRequireDefault(require("../MultiSelect/Suggestions"));
|
|
27
|
-
|
|
28
17
|
var _EmptyState = _interopRequireDefault(require("../MultiSelect/EmptyState"));
|
|
29
|
-
|
|
30
18
|
var _IdProvider = require("../Provider/IdProvider");
|
|
31
|
-
|
|
32
19
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
33
|
-
|
|
34
20
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
35
|
-
|
|
36
21
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
37
|
-
|
|
38
22
|
var _dropDownUtils = require("../utils/dropDownUtils");
|
|
39
|
-
|
|
40
23
|
var _Common = require("../utils/Common.js");
|
|
41
|
-
|
|
42
24
|
var _SelectModule = _interopRequireDefault(require("./Select.module.css"));
|
|
43
|
-
|
|
44
25
|
var _Config = require("../Provider/Config");
|
|
45
|
-
|
|
46
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
47
|
-
|
|
48
27
|
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); }
|
|
49
|
-
|
|
50
28
|
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; }
|
|
51
|
-
|
|
52
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
53
|
-
|
|
54
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
55
|
-
|
|
56
31
|
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); } }
|
|
57
|
-
|
|
58
32
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
59
|
-
|
|
60
33
|
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); }
|
|
61
|
-
|
|
62
34
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
63
|
-
|
|
64
35
|
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); }; }
|
|
65
|
-
|
|
66
36
|
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); }
|
|
67
|
-
|
|
68
37
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
69
|
-
|
|
70
38
|
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; } }
|
|
71
|
-
|
|
72
39
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
73
|
-
|
|
74
40
|
/* eslint-disable react/no-deprecated */
|
|
75
|
-
|
|
76
41
|
/* eslint-disable react/no-unused-prop-types */
|
|
77
|
-
var dummyArray = [];
|
|
78
42
|
|
|
43
|
+
var dummyArray = [];
|
|
79
44
|
var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
80
45
|
_inherits(SelectComponent, _Component);
|
|
81
|
-
|
|
82
46
|
var _super = _createSuper(SelectComponent);
|
|
83
|
-
|
|
84
47
|
function SelectComponent(props) {
|
|
85
48
|
var _this;
|
|
86
|
-
|
|
87
49
|
_classCallCheck(this, SelectComponent);
|
|
88
|
-
|
|
89
50
|
_this = _super.call(this, props);
|
|
90
51
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
91
52
|
_this.getFilterSuggestions = (0, _dropDownUtils.makeGetMultiSelectFilterSuggestions)();
|
|
@@ -93,38 +54,35 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
93
54
|
_this.getSelectedValue = (0, _dropDownUtils.makeGetSelectedValueText)();
|
|
94
55
|
_this.selectedFormatOptions = {};
|
|
95
56
|
var selectedValue = props.selectedValue,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
57
|
+
_props$searchDebounce = props.searchDebounceTime,
|
|
58
|
+
searchDebounceTime = _props$searchDebounce === void 0 ? 500 : _props$searchDebounce,
|
|
59
|
+
isDefaultSelectValue = props.isDefaultSelectValue,
|
|
60
|
+
_props$autoSelectDebo = props.autoSelectDebouneTime,
|
|
61
|
+
autoSelectDebouneTime = _props$autoSelectDebo === void 0 ? 350 : _props$autoSelectDebo,
|
|
62
|
+
valueField = props.valueField,
|
|
63
|
+
textField = props.textField;
|
|
104
64
|
var _this$handleFormatOpt = _this.handleFormatOptions(_this.props),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
65
|
+
allOptions = _this$handleFormatOpt.allOptions,
|
|
66
|
+
normalizedAllOptions = _this$handleFormatOpt.normalizedAllOptions,
|
|
67
|
+
optionsOrder = _this$handleFormatOpt.optionsOrder,
|
|
68
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
110
69
|
var _this$getSelectedValu = _this.getSelectedValue({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
70
|
+
optionsOrder: optionsOrder,
|
|
71
|
+
selectedValue: selectedValue,
|
|
72
|
+
normalizedFormatOptions: normalizedFormatOptions,
|
|
73
|
+
selectedFormatOptions: _this.selectedFormatOptions,
|
|
74
|
+
isDefaultSelectValue: isDefaultSelectValue,
|
|
75
|
+
valueField: valueField,
|
|
76
|
+
textField: textField
|
|
77
|
+
}),
|
|
78
|
+
selected = _this$getSelectedValu.selected,
|
|
79
|
+
hoverIndex = _this$getSelectedValu.hoverIndex,
|
|
80
|
+
selectedValueDetails = _this$getSelectedValu.selectedValueDetails,
|
|
81
|
+
selectedId = _this$getSelectedValu.selectedId,
|
|
82
|
+
isSelfValueChanged = _this$getSelectedValu.isSelfValueChanged;
|
|
83
|
+
if (isSelfValueChanged) {
|
|
84
|
+
// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
|
|
126
85
|
}
|
|
127
|
-
|
|
128
86
|
_this.state = {
|
|
129
87
|
selected: selected,
|
|
130
88
|
options: allOptions,
|
|
@@ -168,12 +126,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
168
126
|
_this.autoSelectIndex = 0;
|
|
169
127
|
return _this;
|
|
170
128
|
}
|
|
171
|
-
|
|
172
129
|
_createClass(SelectComponent, [{
|
|
173
130
|
key: "componentDidMount",
|
|
174
131
|
value: function componentDidMount() {
|
|
175
132
|
this._isMounted = true;
|
|
176
|
-
this.handleExposePopupHandlers();
|
|
133
|
+
this.handleExposePopupHandlers();
|
|
134
|
+
// let { suggestionContainer } = this;
|
|
177
135
|
// suggestionContainer &&
|
|
178
136
|
// suggestionContainer.addEventListener('scroll', this.handleScroll);
|
|
179
137
|
}
|
|
@@ -181,39 +139,34 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
181
139
|
key: "componentWillReceiveProps",
|
|
182
140
|
value: function componentWillReceiveProps(nextProps) {
|
|
183
141
|
var selectedValue = nextProps.selectedValue,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
142
|
+
isDefaultSelectValue = nextProps.isDefaultSelectValue,
|
|
143
|
+
valueField = nextProps.valueField,
|
|
144
|
+
textField = nextProps.textField;
|
|
187
145
|
var oldHoverIndex = this.state.hoverIndex;
|
|
188
|
-
|
|
189
146
|
var _this$handleFormatOpt2 = this.handleFormatOptions(nextProps),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
147
|
+
allOptions = _this$handleFormatOpt2.allOptions,
|
|
148
|
+
normalizedAllOptions = _this$handleFormatOpt2.normalizedAllOptions,
|
|
149
|
+
optionsOrder = _this$handleFormatOpt2.optionsOrder,
|
|
150
|
+
normalizedFormatOptions = _this$handleFormatOpt2.normalizedFormatOptions;
|
|
195
151
|
var oldSelectedFormatOptions = this.selectedFormatOptions;
|
|
196
|
-
|
|
197
152
|
var _this$getSelectedValu2 = this.getSelectedValue({
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
153
|
+
optionsOrder: optionsOrder,
|
|
154
|
+
selectedValue: selectedValue,
|
|
155
|
+
normalizedFormatOptions: normalizedFormatOptions,
|
|
156
|
+
selectedFormatOptions: oldSelectedFormatOptions,
|
|
157
|
+
isDefaultSelectValue: isDefaultSelectValue,
|
|
158
|
+
valueField: valueField,
|
|
159
|
+
textField: textField
|
|
160
|
+
}),
|
|
161
|
+
selected = _this$getSelectedValu2.selected,
|
|
162
|
+
hoverIndex = _this$getSelectedValu2.hoverIndex,
|
|
163
|
+
selectedValueDetails = _this$getSelectedValu2.selectedValueDetails,
|
|
164
|
+
selectedId = _this$getSelectedValu2.selectedId,
|
|
165
|
+
isSelfValueChanged = _this$getSelectedValu2.isSelfValueChanged;
|
|
212
166
|
var oldSelectedValue = this.props.selectedValue;
|
|
213
|
-
|
|
214
|
-
|
|
167
|
+
if (isSelfValueChanged && oldSelectedValue !== selectedValue) {
|
|
168
|
+
// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
|
|
215
169
|
}
|
|
216
|
-
|
|
217
170
|
this.selectedFormatOptions = Object.assign(oldSelectedFormatOptions, selectedValueDetails);
|
|
218
171
|
this.normalizedFormatOptions = normalizedFormatOptions;
|
|
219
172
|
this.optionsOrder = optionsOrder;
|
|
@@ -230,25 +183,23 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
230
183
|
key: "componentDidUpdate",
|
|
231
184
|
value: function componentDidUpdate(prevProps) {
|
|
232
185
|
var _this2 = this;
|
|
233
|
-
|
|
234
186
|
var suggestionContainer = this.suggestionContainer,
|
|
235
|
-
|
|
187
|
+
optionsOrder = this.optionsOrder;
|
|
236
188
|
var _this$state = this.state,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
189
|
+
hoverIndex = _this$state.hoverIndex,
|
|
190
|
+
searchStr = _this$state.searchStr,
|
|
191
|
+
selectedValueIndex = _this$state.selectedValueIndex;
|
|
240
192
|
var _this$props = this.props,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
193
|
+
needLocalSearch = _this$props.needLocalSearch,
|
|
194
|
+
onDropBoxClose = _this$props.onDropBoxClose,
|
|
195
|
+
onDropBoxOpen = _this$props.onDropBoxOpen,
|
|
196
|
+
needSearch = _this$props.needSearch,
|
|
197
|
+
onSearch = _this$props.onSearch,
|
|
198
|
+
isPopupOpen = _this$props.isPopupOpen,
|
|
199
|
+
isSearchClearOnClose = _this$props.isSearchClearOnClose;
|
|
248
200
|
var hoverId = (0, _Common.getIsEmptyValue)(optionsOrder[hoverIndex]) ? '' : optionsOrder[hoverIndex];
|
|
249
201
|
var selSuggestion = this["suggestion_".concat(hoverId)];
|
|
250
202
|
isPopupOpen && (0, _Common.scrollTo)(suggestionContainer, selSuggestion);
|
|
251
|
-
|
|
252
203
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
253
204
|
if (isPopupOpen) {
|
|
254
205
|
onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
|
|
@@ -266,16 +217,15 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
266
217
|
hoverIndex: selectedValueIndex
|
|
267
218
|
});
|
|
268
219
|
}
|
|
269
|
-
}
|
|
270
|
-
|
|
220
|
+
}
|
|
271
221
|
|
|
222
|
+
//When suggestions length less than 5, getNextOptions function call
|
|
272
223
|
var _this$props2 = this.props,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
224
|
+
isNextOptions = _this$props2.isNextOptions,
|
|
225
|
+
getNextOptions = _this$props2.getNextOptions;
|
|
226
|
+
// let { searchStr } = this.state;
|
|
276
227
|
var suggestions = isPopupOpen ? this.handleFilterSuggestions() : [];
|
|
277
228
|
var suggestionsLen = suggestions.length;
|
|
278
|
-
|
|
279
229
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
280
230
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
281
231
|
}
|
|
@@ -291,7 +241,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
291
241
|
closePopup: null,
|
|
292
242
|
togglePopup: null
|
|
293
243
|
};
|
|
294
|
-
getPopupHandlers && getPopupHandlers(methods);
|
|
244
|
+
getPopupHandlers && getPopupHandlers(methods);
|
|
245
|
+
// let { suggestionContainer } = this;
|
|
295
246
|
// suggestionContainer &&
|
|
296
247
|
// suggestionContainer.removeEventListener('scroll', this.handleScroll);
|
|
297
248
|
}
|
|
@@ -299,12 +250,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
299
250
|
key: "handleFormatOptions",
|
|
300
251
|
value: function handleFormatOptions(props) {
|
|
301
252
|
var options = props.options,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
253
|
+
valueField = props.valueField,
|
|
254
|
+
textField = props.textField,
|
|
255
|
+
_props$customProps = props.customProps,
|
|
256
|
+
customProps = _props$customProps === void 0 ? {} : _props$customProps;
|
|
306
257
|
var _customProps$listItem = customProps.listItemProps,
|
|
307
|
-
|
|
258
|
+
listItemProps = _customProps$listItem === void 0 ? {} : _customProps$listItem;
|
|
308
259
|
return this.formatOptions({
|
|
309
260
|
options: options,
|
|
310
261
|
valueField: valueField,
|
|
@@ -317,12 +268,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
317
268
|
value: function handleChange(id, value, index, e) {
|
|
318
269
|
e && e.preventDefault && e.preventDefault();
|
|
319
270
|
var _this$props3 = this.props,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
271
|
+
onChange = _this$props3.onChange,
|
|
272
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
273
|
+
needCloseOnSelect = _this$props3.needCloseOnSelect;
|
|
323
274
|
var optionsNormalize = this.state.optionsNormalize;
|
|
324
|
-
!isReadOnly && onChange && onChange(id, optionsNormalize[id]);
|
|
325
|
-
|
|
275
|
+
!isReadOnly && onChange && onChange(id, optionsNormalize[id]);
|
|
276
|
+
// this.valueInput && this.valueInput.focus({preventScroll:true});
|
|
326
277
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
327
278
|
}
|
|
328
279
|
}, {
|
|
@@ -339,80 +290,70 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
339
290
|
key: "handleKeyDown",
|
|
340
291
|
value: function handleKeyDown(e) {
|
|
341
292
|
var _this$props4 = this.props,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
293
|
+
onChange = _this$props4.onChange,
|
|
294
|
+
isPopupOpen = _this$props4.isPopupOpen,
|
|
295
|
+
onKeyDown = _this$props4.onKeyDown,
|
|
296
|
+
isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
|
|
297
|
+
needCloseOnSelect = _this$props4.needCloseOnSelect;
|
|
347
298
|
var _this$state2 = this.state,
|
|
348
|
-
|
|
349
|
-
|
|
299
|
+
hoverIndex = _this$state2.hoverIndex,
|
|
300
|
+
optionsNormalize = _this$state2.optionsNormalize;
|
|
350
301
|
var options = this.handleFilterSuggestions();
|
|
351
302
|
var keyCode = e.keyCode;
|
|
352
|
-
|
|
353
303
|
if (!isPopupOpen && !isPopupOpenOnEnter) {
|
|
354
304
|
onKeyDown && onKeyDown(e);
|
|
355
305
|
}
|
|
356
|
-
|
|
357
306
|
if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13) && e.preventDefault) {
|
|
358
307
|
e.preventDefault(); //prevent body scroll and enter key prevent
|
|
359
308
|
} else if (!isPopupOpen && keyCode === 40) {
|
|
360
309
|
e.preventDefault(); //prevent body scroll
|
|
361
|
-
|
|
362
310
|
this.togglePopup(e);
|
|
363
311
|
}
|
|
364
|
-
|
|
365
312
|
if (keyCode === 38 && isPopupOpen && options.length) {
|
|
366
|
-
if (hoverIndex === 0) {
|
|
313
|
+
if (hoverIndex === 0) {
|
|
314
|
+
// hoverIndex = options.length - 1;
|
|
367
315
|
} else {
|
|
368
316
|
hoverIndex -= 1;
|
|
369
317
|
}
|
|
370
|
-
|
|
371
318
|
this.setState({
|
|
372
319
|
hoverIndex: hoverIndex
|
|
373
320
|
});
|
|
374
321
|
} else if (keyCode === 40 && isPopupOpen && options.length) {
|
|
375
|
-
if (hoverIndex === options.length - 1) {
|
|
322
|
+
if (hoverIndex === options.length - 1) {
|
|
323
|
+
// hoverIndex = 0;
|
|
376
324
|
} else {
|
|
377
325
|
if (hoverIndex === options.length - 3) {
|
|
378
326
|
this.handleGetNextOptions();
|
|
379
327
|
}
|
|
380
|
-
|
|
381
328
|
hoverIndex += 1;
|
|
382
329
|
}
|
|
383
|
-
|
|
384
330
|
this.setState({
|
|
385
331
|
hoverIndex: hoverIndex
|
|
386
332
|
});
|
|
387
333
|
} else if (keyCode === 13) {
|
|
388
334
|
var option = options[hoverIndex];
|
|
389
|
-
|
|
390
335
|
var _ref2 = option || {},
|
|
391
|
-
|
|
392
|
-
|
|
336
|
+
id = _ref2.id;
|
|
393
337
|
if (isPopupOpen && !(0, _Common.getIsEmptyValue)(id) && onChange) {
|
|
394
338
|
onChange(id, optionsNormalize[id]);
|
|
395
339
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
396
340
|
}
|
|
397
|
-
|
|
398
341
|
if (!isPopupOpen && isPopupOpenOnEnter) {
|
|
399
342
|
this.togglePopup(e);
|
|
400
343
|
}
|
|
401
344
|
} else if (keyCode === 27) {
|
|
402
345
|
this.valueInput && this.valueInput.focus({
|
|
403
346
|
preventScroll: true
|
|
404
|
-
});
|
|
347
|
+
});
|
|
348
|
+
//this.handlePopupClose(e);
|
|
405
349
|
} else if (keyCode === 9) {
|
|
406
350
|
var _option = options[hoverIndex];
|
|
407
|
-
|
|
408
351
|
var _ref3 = _option || {},
|
|
409
|
-
|
|
410
|
-
|
|
352
|
+
_id = _ref3.id;
|
|
411
353
|
if (isPopupOpen && !(0, _Common.getIsEmptyValue)(_id)) {
|
|
412
354
|
onChange && onChange(_id, optionsNormalize[_id]);
|
|
413
355
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
414
356
|
}
|
|
415
|
-
|
|
416
357
|
if (!isPopupOpen && isPopupOpenOnEnter) {
|
|
417
358
|
this.togglePopup(e);
|
|
418
359
|
}
|
|
@@ -429,10 +370,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
429
370
|
key: "handleSearch",
|
|
430
371
|
value: function handleSearch(value) {
|
|
431
372
|
var _this3 = this;
|
|
432
|
-
|
|
433
373
|
// let { value = '' } = e.target;
|
|
434
374
|
var _this$state$searchStr = this.state.searchStr,
|
|
435
|
-
|
|
375
|
+
searchStr = _this$state$searchStr === void 0 ? '' : _this$state$searchStr;
|
|
436
376
|
var onSearch = this.props.onSearch;
|
|
437
377
|
var searchStrRegex = (0, _Common.getSearchString)(searchStr);
|
|
438
378
|
var valueStrRegex = (0, _Common.getSearchString)(value);
|
|
@@ -450,9 +390,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
450
390
|
}
|
|
451
391
|
}, {
|
|
452
392
|
key: "handleMouseEnter",
|
|
453
|
-
value: function handleMouseEnter(id
|
|
454
|
-
/*val, index*/
|
|
455
|
-
) {
|
|
393
|
+
value: function handleMouseEnter(id /*val, index*/) {
|
|
456
394
|
var hoverIndex = this.state.hoverIndex;
|
|
457
395
|
var optionsOrder = this.optionsOrder;
|
|
458
396
|
var newHoverIndex = optionsOrder.indexOf(id);
|
|
@@ -464,46 +402,43 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
464
402
|
key: "handleFilterSuggestions",
|
|
465
403
|
value: function handleFilterSuggestions() {
|
|
466
404
|
var _this$props5 = this.props,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
405
|
+
needLocalSearch = _this$props5.needLocalSearch,
|
|
406
|
+
_this$props5$excludeO = _this$props5.excludeOptions,
|
|
407
|
+
excludeOptions = _this$props5$excludeO === void 0 ? dummyArray : _this$props5$excludeO;
|
|
470
408
|
var _this$state3 = this.state,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
409
|
+
_this$state3$options = _this$state3.options,
|
|
410
|
+
options = _this$state3$options === void 0 ? dummyArray : _this$state3$options,
|
|
411
|
+
_this$state3$searchSt = _this$state3.searchStr,
|
|
412
|
+
searchStr = _this$state3$searchSt === void 0 ? '' : _this$state3$searchSt;
|
|
413
|
+
|
|
414
|
+
// if (
|
|
475
415
|
// (needSearch && searchStr && searchStr.trim().length) ||
|
|
476
416
|
// (excludeOptions && excludeOptions.length)
|
|
477
417
|
// ) {
|
|
478
|
-
|
|
479
418
|
searchStr = (0, _Common.getSearchString)(searchStr);
|
|
480
|
-
|
|
481
419
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
420
|
+
options: options,
|
|
421
|
+
selectedOptions: excludeOptions,
|
|
422
|
+
searchStr: searchStr,
|
|
423
|
+
needSearch: needLocalSearch
|
|
424
|
+
}),
|
|
425
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
426
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
490
427
|
this.optionsOrder = suggestionIds;
|
|
491
|
-
return suggestions;
|
|
428
|
+
return suggestions;
|
|
429
|
+
// }
|
|
492
430
|
// return options;
|
|
493
431
|
}
|
|
494
432
|
}, {
|
|
495
433
|
key: "handleScroll",
|
|
496
434
|
value: function handleScroll(e) {
|
|
497
435
|
var ele = e.target;
|
|
498
|
-
|
|
499
436
|
var _ele$getBoundingClien = ele.getBoundingClientRect(),
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
437
|
+
eleHeight = _ele$getBoundingClien.height;
|
|
438
|
+
var elementHeight = eleHeight || ele.clientHeight;
|
|
439
|
+
// let elementHeight = ele.clientHeight;
|
|
504
440
|
var eleScrollTop = ele.scrollTop;
|
|
505
441
|
var eleScrollHeight = ele.scrollHeight;
|
|
506
|
-
|
|
507
442
|
if (eleScrollHeight - (eleScrollTop + elementHeight) < 1) {
|
|
508
443
|
this.handleGetNextOptions();
|
|
509
444
|
}
|
|
@@ -512,18 +447,15 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
512
447
|
key: "handleFetchOptions",
|
|
513
448
|
value: function handleFetchOptions(APICall) {
|
|
514
449
|
var _this4 = this;
|
|
515
|
-
|
|
516
450
|
var searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
517
451
|
// let funcArgs = args.slice(1, args.length);
|
|
518
452
|
var _this$state$isFetchin = this.state.isFetchingOptions,
|
|
519
|
-
|
|
453
|
+
isFetchingOptions = _this$state$isFetchin === void 0 ? false : _this$state$isFetchin;
|
|
520
454
|
var _isMounted = this._isMounted;
|
|
521
|
-
|
|
522
455
|
if (!isFetchingOptions && APICall) {
|
|
523
456
|
this.setState({
|
|
524
457
|
isFetchingOptions: true
|
|
525
458
|
});
|
|
526
|
-
|
|
527
459
|
try {
|
|
528
460
|
return APICall(searchStr).then(function () {
|
|
529
461
|
_isMounted && _this4.setState({
|
|
@@ -545,8 +477,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
545
477
|
key: "handleGetNextOptions",
|
|
546
478
|
value: function handleGetNextOptions() {
|
|
547
479
|
var _this$props6 = this.props,
|
|
548
|
-
|
|
549
|
-
|
|
480
|
+
isNextOptions = _this$props6.isNextOptions,
|
|
481
|
+
getNextOptions = _this$props6.getNextOptions;
|
|
550
482
|
var searchStr = this.state.searchStr;
|
|
551
483
|
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
552
484
|
}
|
|
@@ -554,11 +486,11 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
554
486
|
key: "togglePopup",
|
|
555
487
|
value: function togglePopup(e) {
|
|
556
488
|
var _this$props7 = this.props,
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
489
|
+
togglePopup = _this$props7.togglePopup,
|
|
490
|
+
isReadOnly = _this$props7.isReadOnly,
|
|
491
|
+
defaultDropBoxPosition = _this$props7.defaultDropBoxPosition,
|
|
492
|
+
onFocus = _this$props7.onFocus,
|
|
493
|
+
isPopupOpen = _this$props7.isPopupOpen;
|
|
562
494
|
!isReadOnly && togglePopup(e, defaultDropBoxPosition ? "".concat(defaultDropBoxPosition) : null);
|
|
563
495
|
!isPopupOpen && typeof onFocus === 'function' && onFocus(e);
|
|
564
496
|
}
|
|
@@ -603,7 +535,6 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
603
535
|
key: "handleClearSearch",
|
|
604
536
|
value: function handleClearSearch() {
|
|
605
537
|
var _this5 = this;
|
|
606
|
-
|
|
607
538
|
this.handleSearch('');
|
|
608
539
|
setTimeout(function () {
|
|
609
540
|
_this5.searchInput && _this5.searchInput.focus({
|
|
@@ -617,9 +548,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
617
548
|
var which = e.which;
|
|
618
549
|
var typeString = String.fromCharCode(which);
|
|
619
550
|
var _this$props8 = this.props,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
551
|
+
isPopupOpen = _this$props8.isPopupOpen,
|
|
552
|
+
autoSelectOnType = _this$props8.autoSelectOnType;
|
|
623
553
|
if (!isPopupOpen && autoSelectOnType) {
|
|
624
554
|
this.valueInputTypeString += (typeString || '').trim();
|
|
625
555
|
this.handleChangeOnType();
|
|
@@ -629,53 +559,43 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
629
559
|
key: "handleChangeOnType",
|
|
630
560
|
value: function handleChangeOnType() {
|
|
631
561
|
var _this6 = this;
|
|
632
|
-
|
|
633
562
|
var _this$props$excludeOp = this.props.excludeOptions,
|
|
634
|
-
|
|
563
|
+
excludeOptions = _this$props$excludeOp === void 0 ? dummyArray : _this$props$excludeOp;
|
|
635
564
|
var _this$state$options = this.state.options,
|
|
636
|
-
|
|
565
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options;
|
|
637
566
|
var optionsOrder = this.optionsOrder;
|
|
638
567
|
var typeString = this.valueInputTypeString;
|
|
639
568
|
this.valueInputTypeString = '';
|
|
640
|
-
|
|
641
569
|
var changeValue = function changeValue() {
|
|
642
570
|
var optionDetails = _this6.autoSelectSuggestions[_this6.autoSelectIndex];
|
|
643
|
-
|
|
644
571
|
var _ref4 = optionDetails || {},
|
|
645
|
-
|
|
646
|
-
|
|
572
|
+
id = _ref4.id;
|
|
647
573
|
if (!(0, _Common.getIsEmptyValue)(id)) {
|
|
648
574
|
_this6.handleChange(id);
|
|
649
|
-
|
|
650
575
|
var hoverIndex = optionsOrder.indexOf(id);
|
|
651
|
-
|
|
652
576
|
_this6.setState({
|
|
653
577
|
hoverIndex: hoverIndex
|
|
654
578
|
});
|
|
655
579
|
}
|
|
656
580
|
};
|
|
657
|
-
|
|
658
581
|
if (typeString && typeString === this.valueInputSearchString) {
|
|
659
582
|
if (this.autoSelectIndex < this.autoSelectSuggestions.length - 1) {
|
|
660
583
|
this.autoSelectIndex += 1;
|
|
661
584
|
} else {
|
|
662
585
|
this.autoSelectIndex = 0;
|
|
663
586
|
}
|
|
664
|
-
|
|
665
587
|
changeValue();
|
|
666
588
|
} else if (typeString) {
|
|
667
589
|
this.valueInputSearchString = typeString;
|
|
668
|
-
|
|
669
590
|
var _this$getFilterSugges2 = this.getFilterSuggestions({
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
591
|
+
options: options,
|
|
592
|
+
selectedOptions: excludeOptions,
|
|
593
|
+
searchStr: typeString,
|
|
594
|
+
needSearch: true,
|
|
595
|
+
isStartsWithSearch: true
|
|
596
|
+
}),
|
|
597
|
+
_this$getFilterSugges3 = _this$getFilterSugges2.suggestions,
|
|
598
|
+
suggestions = _this$getFilterSugges3 === void 0 ? [] : _this$getFilterSugges3;
|
|
679
599
|
this.autoSelectIndex = 0;
|
|
680
600
|
this.autoSelectSuggestions = suggestions;
|
|
681
601
|
changeValue();
|
|
@@ -686,9 +606,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
686
606
|
value: function handleAddNewOption() {
|
|
687
607
|
var searchStr = this.state.searchStr;
|
|
688
608
|
var _this$props9 = this.props,
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
609
|
+
onAddNewOption = _this$props9.onAddNewOption,
|
|
610
|
+
getCustomEmptyState = _this$props9.getCustomEmptyState;
|
|
692
611
|
if (getCustomEmptyState) {
|
|
693
612
|
this.setState({
|
|
694
613
|
searchStr: ''
|
|
@@ -700,11 +619,11 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
700
619
|
key: "handleExposePopupHandlers",
|
|
701
620
|
value: function handleExposePopupHandlers() {
|
|
702
621
|
var _this$props10 = this.props,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
622
|
+
removeClose = _this$props10.removeClose,
|
|
623
|
+
openPopupOnly = _this$props10.openPopupOnly,
|
|
624
|
+
closePopupOnly = _this$props10.closePopupOnly,
|
|
625
|
+
togglePopup = _this$props10.togglePopup,
|
|
626
|
+
getPopupHandlers = _this$props10.getPopupHandlers;
|
|
708
627
|
var methods = {
|
|
709
628
|
removeClose: removeClose,
|
|
710
629
|
openPopup: openPopupOnly,
|
|
@@ -727,74 +646,73 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
727
646
|
key: "render",
|
|
728
647
|
value: function render() {
|
|
729
648
|
var _this7 = this;
|
|
730
|
-
|
|
731
649
|
var _this$props11 = this.props,
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
650
|
+
needSearch = _this$props11.needSearch,
|
|
651
|
+
dropBoxSize = _this$props11.dropBoxSize,
|
|
652
|
+
emptyMessage = _this$props11.emptyMessage,
|
|
653
|
+
searchEmptyMessage = _this$props11.searchEmptyMessage,
|
|
654
|
+
needBorder = _this$props11.needBorder,
|
|
655
|
+
needSelectDownIcon = _this$props11.needSelectDownIcon,
|
|
656
|
+
position = _this$props11.position,
|
|
657
|
+
defaultDropBoxPosition = _this$props11.defaultDropBoxPosition,
|
|
658
|
+
getTargetRef = _this$props11.getTargetRef,
|
|
659
|
+
getContainerRef = _this$props11.getContainerRef,
|
|
660
|
+
removeClose = _this$props11.removeClose,
|
|
661
|
+
isPopupOpen = _this$props11.isPopupOpen,
|
|
662
|
+
isPopupReady = _this$props11.isPopupReady,
|
|
663
|
+
animationStyle = _this$props11.animationStyle,
|
|
664
|
+
textBoxSize = _this$props11.textBoxSize,
|
|
665
|
+
textBoxVariant = _this$props11.textBoxVariant,
|
|
666
|
+
searchBoxSize = _this$props11.searchBoxSize,
|
|
667
|
+
searchBoxPlaceHolder = _this$props11.searchBoxPlaceHolder,
|
|
668
|
+
maxLength = _this$props11.maxLength,
|
|
669
|
+
isDisabled = _this$props11.isDisabled,
|
|
670
|
+
title = _this$props11.title,
|
|
671
|
+
size = _this$props11.size,
|
|
672
|
+
placeHolder = _this$props11.placeHolder,
|
|
673
|
+
className = _this$props11.className,
|
|
674
|
+
isReadOnly = _this$props11.isReadOnly,
|
|
675
|
+
dataId = _this$props11.dataId,
|
|
676
|
+
needResponsive = _this$props11.needResponsive,
|
|
677
|
+
borderColor = _this$props11.borderColor,
|
|
678
|
+
needTick = _this$props11.needTick,
|
|
679
|
+
listItemSize = _this$props11.listItemSize,
|
|
680
|
+
boxSize = _this$props11.boxSize,
|
|
681
|
+
needListBorder = _this$props11.needListBorder,
|
|
682
|
+
getFooter = _this$props11.getFooter,
|
|
683
|
+
getChildren = _this$props11.getChildren,
|
|
684
|
+
getCustomEmptyState = _this$props11.getCustomEmptyState,
|
|
685
|
+
isParentBased = _this$props11.isParentBased,
|
|
686
|
+
i18nKeys = _this$props11.i18nKeys,
|
|
687
|
+
htmlId = _this$props11.htmlId,
|
|
688
|
+
children = _this$props11.children,
|
|
689
|
+
iconOnHover = _this$props11.iconOnHover,
|
|
690
|
+
customProps = _this$props11.customProps,
|
|
691
|
+
autoComplete = _this$props11.autoComplete;
|
|
774
692
|
var _i18nKeys = i18nKeys,
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
693
|
+
TextBoxIcon_i18n = _i18nKeys.TextBoxIcon_i18n,
|
|
694
|
+
_i18nKeys$TextBox_all = _i18nKeys.TextBox_ally_label,
|
|
695
|
+
TextBox_ally_label = _i18nKeys$TextBox_all === void 0 ? 'click to select options' : _i18nKeys$TextBox_all;
|
|
778
696
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
779
697
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
780
698
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
781
699
|
});
|
|
782
700
|
var _this$state4 = this.state,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
701
|
+
hoverIndex = _this$state4.hoverIndex,
|
|
702
|
+
selected = _this$state4.selected,
|
|
703
|
+
searchStr = _this$state4.searchStr,
|
|
704
|
+
isFetchingOptions = _this$state4.isFetchingOptions,
|
|
705
|
+
selectedId = _this$state4.selectedId,
|
|
706
|
+
options = _this$state4.options;
|
|
789
707
|
var suggestions = this.handleFilterSuggestions();
|
|
790
708
|
var setAriaId = this.getNextAriaId();
|
|
791
709
|
var ariaErrorId = this.getNextAriaId();
|
|
792
710
|
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
711
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
|
|
712
|
+
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
713
|
+
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
714
|
+
_customProps$Suggesti = customProps.SuggestionsProps,
|
|
715
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
798
716
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
799
717
|
className: "".concat(isParentBased || isReadOnly || isDisabled ? _SelectModule["default"].container : '', " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : '', " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverStyle : ''),
|
|
800
718
|
"data-title": isDisabled ? title : null
|
|
@@ -969,10 +887,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
969
887
|
}) : null);
|
|
970
888
|
}
|
|
971
889
|
}]);
|
|
972
|
-
|
|
973
890
|
return SelectComponent;
|
|
974
891
|
}(_react.Component);
|
|
975
|
-
|
|
976
892
|
exports.SelectComponent = SelectComponent;
|
|
977
893
|
SelectComponent.propTypes = _propTypes.Select_propTypes;
|
|
978
894
|
SelectComponent.defaultProps = _defaultProps.Select_defaultProps;
|
|
@@ -981,14 +897,13 @@ var Select = (0, _Popup["default"])(SelectComponent);
|
|
|
981
897
|
Select.defaultProps = SelectComponent.defaultProps;
|
|
982
898
|
var _default = Select;
|
|
983
899
|
exports["default"] = _default;
|
|
984
|
-
|
|
985
900
|
if (false) {
|
|
986
901
|
Select.docs = {
|
|
987
902
|
componentGroup: 'Form Elements',
|
|
988
903
|
folderName: 'Style Guide',
|
|
989
904
|
external: true,
|
|
990
905
|
description: ' '
|
|
991
|
-
};
|
|
992
|
-
|
|
906
|
+
};
|
|
907
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
993
908
|
Select.propTypes = SelectComponent.propTypes;
|
|
994
909
|
}
|