@zohodesk/components 1.2.21 → 1.2.23
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/.DS_Store +0 -0
- package/.cli/PropLessFiles.html +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/.cli/stringContains.js +1 -0
- package/README.md +10 -0
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +15 -0
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css +1 -0
- package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +15 -0
- package/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css +1 -0
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +15 -0
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css +1 -0
- package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +15 -0
- package/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css +1 -0
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +15 -0
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css +1 -0
- package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +15 -0
- package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +1 -0
- package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +15 -0
- package/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css +1 -0
- package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +15 -0
- package/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css +1 -0
- package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +15 -0
- package/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css +1 -0
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +15 -0
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css +1 -0
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +15 -0
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css +1 -0
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +15 -0
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css +1 -0
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +15 -0
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css +1 -0
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +15 -0
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css +1 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +15 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css +1 -0
- package/es/Accordion/Accordion.js +3 -7
- package/es/Accordion/AccordionItem.js +2 -4
- package/es/Animation/Animation.js +3 -3
- package/es/AppContainer/AppContainer.js +3 -14
- package/es/AppContainer/AppContainer.module.css +2 -2
- package/es/Avatar/Avatar.js +11 -23
- package/es/Avatar/Avatar.module.css +18 -18
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/AvatarTeam/AvatarTeam.module.css +37 -35
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +2 -1
- package/es/Button/Button.js +3 -4
- package/es/Button/css/Button.module.css +70 -70
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/Buttongroup.module.css +15 -13
- package/es/Card/Card.js +10 -21
- package/es/CheckBox/CheckBox.js +3 -5
- package/es/CheckBox/CheckBox.module.css +16 -16
- package/es/DateTime/CalendarView.js +20 -32
- package/es/DateTime/DateTime.js +6 -69
- package/es/DateTime/DateTime.module.css +40 -40
- package/es/DateTime/DateTimePopupFooter.js +1 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +35 -98
- package/es/DateTime/DateWidget.module.css +5 -5
- package/es/DateTime/DaysRow.js +1 -4
- package/es/DateTime/Time.js +1 -10
- package/es/DateTime/YearView.js +4 -28
- package/es/DateTime/YearView.module.css +15 -15
- package/es/DateTime/common.js +0 -3
- package/es/DateTime/constants.js +0 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +30 -65
- package/es/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +1 -31
- package/es/DateTime/dateFormatUtils/monthChange.js +0 -8
- package/es/DateTime/dateFormatUtils/timeChange.js +6 -22
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -11
- package/es/DateTime/objectUtils.js +20 -14
- package/es/DateTime/typeChecker.js +0 -3
- package/es/DateTime/validator.js +6 -58
- package/es/DropBox/DropBox.js +2 -6
- package/es/DropBox/DropBoxElement/DropBoxElement.js +2 -8
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +76 -73
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +3 -5
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +0 -3
- package/es/DropBox/css/DropBox.module.css +6 -6
- package/es/DropBox/props/defaultProps.js +2 -1
- package/es/DropBox/props/propTypes.js +2 -1
- package/es/DropDown/DropDown.js +1 -7
- package/es/DropDown/DropDown.module.css +2 -2
- package/es/DropDown/DropDownHeading.js +5 -4
- package/es/DropDown/DropDownHeading.module.css +6 -6
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownItem.module.css +12 -12
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/DropDownSeparator.module.css +2 -2
- package/es/DropDown/props/propTypes.js +2 -1
- package/es/Heading/Heading.js +3 -2
- package/es/Heading/Heading.module.css +2 -2
- package/es/Label/Label.js +3 -2
- package/es/Label/Label.module.css +5 -5
- package/es/Label/__tests__/Label.spec.js +2 -1
- package/es/Layout/Box.js +2 -15
- package/es/Layout/Container.js +3 -14
- package/es/Layout/Layout.module.css +15 -15
- package/es/Layout/index.js +2 -1
- package/es/Layout/utils.js +0 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +3 -9
- package/es/ListItem/ListItem.module.css +38 -27
- package/es/ListItem/ListItemWithAvatar.js +3 -9
- package/es/ListItem/ListItemWithCheckBox.js +2 -7
- package/es/ListItem/ListItemWithIcon.js +3 -8
- package/es/ListItem/ListItemWithRadio.js +3 -7
- package/es/Modal/Modal.js +11 -28
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +13 -89
- package/es/MultiSelect/AdvancedMultiSelect.js +9 -32
- package/es/MultiSelect/EmptyState.js +0 -2
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/es/MultiSelect/MultiSelect.js +30 -99
- package/es/MultiSelect/MultiSelect.module.css +31 -31
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +3 -10
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/SelectedOptions.module.css +5 -5
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/props/propTypes.js +2 -2
- package/es/PopOver/PopOver.js +0 -16
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/viewPort.js +4 -16
- package/es/Provider/IdProvider.js +5 -10
- package/es/Provider/LibraryContext.js +4 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/Provider/ZindexProvider.js +2 -9
- package/es/Radio/Radio.js +0 -3
- package/es/Radio/Radio.module.css +9 -9
- package/es/Responsive/CustomResponsive.js +18 -30
- 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/index.js +3 -1
- 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 +2 -2
- package/es/ResponsiveDropBox/props/propTypes.js +2 -1
- package/es/Ribbon/Ribbon.js +2 -3
- package/es/Ribbon/Ribbon.module.css +48 -45
- package/es/RippleEffect/RippleEffect.js +3 -1
- package/es/Select/GroupSelect.js +14 -58
- package/es/Select/Select.js +34 -80
- package/es/Select/Select.module.css +23 -23
- package/es/Select/SelectWithAvatar.js +4 -17
- package/es/Select/SelectWithIcon.js +5 -46
- package/es/Select/props/propTypes.js +2 -2
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/Stencils.module.css +11 -11
- package/es/Switch/Switch.js +3 -5
- package/es/Switch/Switch.module.css +23 -23
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/Tab.module.css +14 -14
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContentWrapper.js +8 -6
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +7 -54
- package/es/Tab/Tabs.module.css +22 -22
- package/es/Tab/props/defaultProps.js +2 -1
- package/es/Tab/props/propTypes.js +3 -1
- package/es/Tag/Tag.js +3 -6
- package/es/Tag/Tag.module.css +26 -25
- package/es/TextBox/TextBox.js +3 -16
- package/es/TextBox/TextBox.module.css +10 -10
- package/es/TextBoxIcon/TextBoxIcon.js +2 -9
- package/es/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/es/TextBoxIcon/props/propTypes.js +2 -1
- package/es/Textarea/Textarea.js +3 -12
- package/es/Textarea/Textarea.module.css +22 -22
- package/es/Tooltip/Tooltip.js +14 -58
- package/es/Tooltip/Tooltip.module.css +5 -9
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -7
- package/es/common/animation.module.css +8 -8
- package/es/common/avatarsizes.module.css +16 -16
- package/es/common/basicReset.module.css +3 -3
- package/es/common/common.module.css +24 -24
- package/es/common/customscroll.module.css +2 -12
- package/es/deprecated/PortalLayer/PortalLayer.js +20 -25
- package/es/semantic/Button/Button.js +2 -3
- package/es/semantic/Button/semanticButton.module.css +1 -1
- package/es/utils/Common.js +9 -54
- package/es/utils/ContextOptimizer.js +5 -4
- 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 -68
- package/es/utils/getInitial.js +0 -4
- package/es/utils/shallowEqual.js +0 -6
- package/es/v1/Accordion/Accordion.js +3 -4
- package/es/v1/Accordion/AccordionItem.js +2 -4
- package/es/v1/Animation/Animation.js +3 -1
- package/es/v1/AppContainer/AppContainer.js +3 -9
- package/es/v1/Avatar/Avatar.js +6 -18
- package/es/v1/AvatarTeam/AvatarTeam.js +0 -1
- package/es/v1/Button/Button.js +3 -3
- package/es/v1/Card/Card.js +8 -16
- package/es/v1/CheckBox/CheckBox.js +3 -6
- package/es/v1/DateTime/CalendarView.js +20 -32
- package/es/v1/DateTime/DateTime.js +6 -69
- package/es/v1/DateTime/DateTimePopupFooter.js +1 -4
- package/es/v1/DateTime/DateTimePopupHeader.js +2 -8
- package/es/v1/DateTime/DateWidget.js +35 -98
- package/es/v1/DateTime/DaysRow.js +1 -4
- package/es/v1/DateTime/Time.js +1 -10
- package/es/v1/DateTime/YearView.js +4 -28
- package/es/v1/DropBox/DropBox.js +2 -6
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +2 -8
- package/es/v1/DropBox/props/defaultProps.js +2 -1
- package/es/v1/DropBox/props/propTypes.js +2 -1
- package/es/v1/DropDown/DropDown.js +0 -3
- package/es/v1/DropDown/DropDownHeading.js +2 -2
- package/es/v1/DropDown/DropDownItem.js +0 -5
- package/es/v1/DropDown/DropDownSearch.js +2 -3
- package/es/v1/DropDown/props/propTypes.js +2 -1
- package/es/v1/Heading/Heading.js +3 -1
- package/es/v1/Layout/Box.js +2 -15
- package/es/v1/Layout/Container.js +3 -14
- package/es/v1/ListItem/ListContainer.js +3 -8
- package/es/v1/ListItem/ListItem.js +3 -10
- package/es/v1/ListItem/ListItemWithAvatar.js +1 -9
- package/es/v1/ListItem/ListItemWithCheckBox.js +2 -8
- package/es/v1/ListItem/ListItemWithIcon.js +3 -9
- package/es/v1/ListItem/ListItemWithRadio.js +3 -8
- package/es/v1/Modal/Modal.js +1 -17
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +15 -90
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +9 -32
- package/es/v1/MultiSelect/EmptyState.js +0 -2
- package/es/v1/MultiSelect/MultiSelect.js +31 -100
- package/es/v1/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +3 -11
- package/es/v1/MultiSelect/SelectedOptions.js +3 -6
- package/es/v1/MultiSelect/Suggestions.js +3 -7
- package/es/v1/MultiSelect/props/propTypes.js +2 -2
- package/es/v1/PopOver/PopOver.js +0 -11
- package/es/v1/Popup/Popup.js +24 -77
- package/es/v1/Provider/IdProvider.js +5 -10
- package/es/v1/Provider/LibraryContext.js +4 -6
- package/es/v1/Provider/NumberGenerator/NumberGenerator.js +7 -21
- package/es/v1/Provider/ZindexProvider.js +2 -9
- package/es/v1/Radio/Radio.js +2 -5
- package/es/v1/Responsive/CustomResponsive.js +18 -30
- package/es/v1/Responsive/RefWrapper.js +7 -6
- package/es/v1/Responsive/ResizeComponent.js +25 -35
- package/es/v1/Responsive/ResizeObserver.js +6 -26
- package/es/v1/Responsive/Responsive.js +20 -34
- package/es/v1/Responsive/index.js +3 -1
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +0 -1
- package/es/v1/ResponsiveDropBox/props/propTypes.js +2 -1
- package/es/v1/Select/GroupSelect.js +14 -58
- package/es/v1/Select/Select.js +38 -82
- package/es/v1/Select/SelectWithAvatar.js +4 -17
- package/es/v1/Select/SelectWithIcon.js +5 -46
- package/es/v1/Select/props/propTypes.js +2 -2
- package/es/v1/Stencils/Stencils.js +0 -2
- package/es/v1/Switch/Switch.js +3 -6
- package/es/v1/Tab/Tab.js +3 -3
- package/es/v1/Tab/TabContent.js +0 -1
- package/es/v1/Tab/TabContentWrapper.js +8 -6
- package/es/v1/Tab/TabWrapper.js +2 -5
- package/es/v1/Tab/Tabs.js +9 -54
- package/es/v1/Tab/props/defaultProps.js +2 -1
- package/es/v1/Tab/props/propTypes.js +3 -1
- package/es/v1/Tab/v1Tab.module.css +14 -14
- package/es/v1/Tab/v1Tabs.module.css +22 -22
- package/es/v1/Tag/Tag.js +1 -5
- package/es/v1/TextBox/TextBox.js +0 -14
- package/es/v1/TextBoxIcon/TextBoxIcon.js +2 -6
- package/es/v1/TextBoxIcon/props/propTypes.js +2 -1
- package/es/v1/Textarea/Textarea.js +3 -10
- package/es/v1/Tooltip/Tooltip.js +14 -58
- package/es/v1/Typography/Typography.js +0 -2
- package/es/v1/Typography/css/Typography.module.css +31 -31
- package/es/v1/Typography/css/cssJSLogic.js +0 -3
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -1
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +4 -5
- package/es/v1/semantic/Button/Button.js +2 -1
- package/lib/Accordion/Accordion.js +18 -42
- package/lib/Accordion/AccordionItem.js +18 -40
- package/lib/Accordion/index.js +0 -3
- package/lib/Accordion/props/propTypes.js +0 -3
- package/lib/Animation/Animation.js +18 -38
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +20 -58
- package/lib/AppContainer/AppContainer.module.css +2 -2
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +38 -78
- package/lib/Avatar/Avatar.module.css +18 -18
- package/lib/Avatar/__tests__/Avatar.spec.js +71 -95
- package/lib/Avatar/props/propTypes.js +0 -3
- package/lib/AvatarTeam/AvatarTeam.js +30 -52
- package/lib/AvatarTeam/AvatarTeam.module.css +37 -35
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +61 -77
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +22 -33
- package/lib/Button/__tests__/Button.spec.js +48 -65
- package/lib/Button/css/Button.module.css +70 -70
- package/lib/Button/css/cssJSLogic.js +17 -18
- package/lib/Button/index.js +0 -3
- package/lib/Button/props/defaultProps.js +0 -2
- package/lib/Button/props/propTypes.js +0 -3
- package/lib/Buttongroup/Buttongroup.js +12 -32
- package/lib/Buttongroup/Buttongroup.module.css +15 -13
- package/lib/Buttongroup/__tests__/Buttongroup.spec.js +10 -18
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +46 -102
- package/lib/Card/index.js +0 -4
- package/lib/Card/props/propTypes.js +0 -3
- package/lib/CheckBox/CheckBox.js +47 -71
- package/lib/CheckBox/CheckBox.module.css +16 -16
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +42 -82
- package/lib/DateTime/DateTime.js +156 -244
- package/lib/DateTime/DateTime.module.css +40 -40
- package/lib/DateTime/DateTimePopupFooter.js +8 -33
- package/lib/DateTime/DateTimePopupHeader.js +17 -49
- package/lib/DateTime/DateWidget.js +249 -350
- package/lib/DateTime/DateWidget.module.css +5 -5
- package/lib/DateTime/DaysRow.js +5 -28
- package/lib/DateTime/Time.js +32 -75
- package/lib/DateTime/YearView.js +27 -76
- package/lib/DateTime/YearView.module.css +15 -15
- package/lib/DateTime/common.js +0 -6
- package/lib/DateTime/constants.js +0 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +122 -187
- package/lib/DateTime/dateFormatUtils/dateFormats.js +1 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -15
- package/lib/DateTime/dateFormatUtils/index.js +16 -73
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -20
- package/lib/DateTime/dateFormatUtils/timeChange.js +22 -54
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -23
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/propTypes.js +1 -11
- package/lib/DateTime/typeChecker.js +0 -4
- package/lib/DateTime/validator.js +10 -73
- package/lib/DropBox/DropBox.js +21 -45
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +40 -60
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +76 -73
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +34 -42
- package/lib/DropBox/DropBoxElement/props/propTypes.js +0 -3
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +9 -14
- package/lib/DropBox/css/DropBox.module.css +6 -6
- package/lib/DropBox/css/cssJSLogic.js +1 -3
- package/lib/DropBox/props/defaultProps.js +4 -8
- package/lib/DropBox/props/propTypes.js +4 -10
- package/lib/DropDown/DropDown.js +5 -51
- package/lib/DropDown/DropDown.module.css +2 -2
- package/lib/DropDown/DropDownHeading.js +20 -39
- package/lib/DropDown/DropDownHeading.module.css +6 -6
- package/lib/DropDown/DropDownItem.js +20 -42
- package/lib/DropDown/DropDownItem.module.css +12 -12
- package/lib/DropDown/DropDownSearch.js +17 -40
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.js +4 -24
- package/lib/DropDown/DropDownSeparator.module.css +2 -2
- package/lib/DropDown/index.js +0 -9
- package/lib/DropDown/props/propTypes.js +4 -10
- package/lib/Heading/Heading.js +15 -37
- package/lib/Heading/Heading.module.css +2 -2
- package/lib/Heading/props/propTypes.js +0 -3
- package/lib/Label/Label.js +21 -41
- package/lib/Label/Label.module.css +5 -5
- package/lib/Label/__tests__/Label.spec.js +34 -48
- package/lib/Label/props/propTypes.js +0 -3
- package/lib/Layout/Box.js +15 -35
- package/lib/Layout/Container.js +14 -33
- package/lib/Layout/Layout.module.css +15 -15
- package/lib/Layout/index.js +0 -3
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -11
- package/lib/ListItem/ListContainer.js +30 -55
- package/lib/ListItem/ListItem.js +45 -74
- package/lib/ListItem/ListItem.module.css +38 -27
- package/lib/ListItem/ListItemWithAvatar.js +48 -80
- package/lib/ListItem/ListItemWithCheckBox.js +40 -70
- package/lib/ListItem/ListItemWithIcon.js +44 -73
- package/lib/ListItem/ListItemWithRadio.js +42 -71
- package/lib/ListItem/index.js +0 -7
- package/lib/ListItem/props/propTypes.js +4 -6
- package/lib/Modal/Modal.js +10 -45
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +166 -293
- package/lib/MultiSelect/AdvancedMultiSelect.js +125 -202
- package/lib/MultiSelect/EmptyState.js +24 -45
- package/lib/MultiSelect/MobileHeader/MobileHeader.js +5 -14
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +5 -5
- package/lib/MultiSelect/MobileHeader/props/propTypes.js +0 -3
- package/lib/MultiSelect/MultiSelect.js +214 -333
- package/lib/MultiSelect/MultiSelect.module.css +31 -31
- package/lib/MultiSelect/MultiSelectHeader.js +7 -29
- package/lib/MultiSelect/MultiSelectWithAvatar.js +43 -85
- package/lib/MultiSelect/SelectedOptions.js +17 -43
- package/lib/MultiSelect/SelectedOptions.module.css +5 -5
- package/lib/MultiSelect/Suggestions.js +32 -64
- package/lib/MultiSelect/index.js +0 -5
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +4 -14
- package/lib/PopOver/PopOver.js +47 -94
- package/lib/PopOver/index.js +0 -4
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +81 -158
- 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 +6 -17
- package/lib/Provider/LibraryContext.js +15 -35
- package/lib/Provider/LibraryContextInit.js +0 -4
- package/lib/Provider/NumberGenerator/NumberGenerator.js +15 -44
- package/lib/Provider/ZindexProvider.js +3 -15
- package/lib/Provider/index.js +0 -5
- package/lib/Radio/Radio.js +36 -60
- package/lib/Radio/Radio.module.css +9 -9
- package/lib/Radio/__tests__/Radio.spec.js +103 -134
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +29 -73
- package/lib/Responsive/RefWrapper.js +11 -17
- package/lib/Responsive/ResizeComponent.js +36 -62
- package/lib/Responsive/ResizeObserver.js +10 -24
- package/lib/Responsive/Responsive.js +30 -80
- package/lib/Responsive/index.js +0 -4
- package/lib/Responsive/props/propTypes.js +0 -3
- package/lib/Responsive/sizeObservers.js +17 -53
- 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 +17 -45
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +2 -2
- package/lib/ResponsiveDropBox/props/propTypes.js +4 -9
- package/lib/Ribbon/Ribbon.js +13 -33
- package/lib/Ribbon/Ribbon.module.css +48 -45
- package/lib/Ribbon/__tests__/Ribbon.spec.js +14 -24
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +10 -18
- package/lib/RippleEffect/__tests__/RippleEffect.spec.js +22 -34
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +130 -229
- package/lib/Select/Select.js +212 -296
- package/lib/Select/Select.module.css +23 -23
- package/lib/Select/SelectWithAvatar.js +56 -102
- package/lib/Select/SelectWithIcon.js +76 -131
- package/lib/Select/index.js +0 -5
- package/lib/Select/props/defaultProps.js +4 -5
- package/lib/Select/props/propTypes.js +4 -10
- package/lib/Stencils/Stencils.js +10 -29
- package/lib/Stencils/Stencils.module.css +11 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +13 -22
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +34 -57
- package/lib/Switch/Switch.module.css +23 -23
- package/lib/Switch/__tests__/Switch.spec.js +72 -91
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +27 -40
- package/lib/Tab/Tab.module.css +14 -14
- package/lib/Tab/TabContent.js +5 -12
- package/lib/Tab/TabContentWrapper.js +13 -16
- package/lib/Tab/TabWrapper.js +19 -37
- package/lib/Tab/Tabs.js +91 -171
- package/lib/Tab/Tabs.module.css +22 -22
- package/lib/Tab/index.js +0 -6
- package/lib/Tab/props/defaultProps.js +2 -1
- package/lib/Tab/props/propTypes.js +3 -4
- package/lib/Tag/Tag.js +43 -72
- package/lib/Tag/Tag.module.css +26 -25
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +60 -86
- package/lib/TextBox/TextBox.module.css +10 -10
- package/lib/TextBox/props/propTypes.js +4 -6
- package/lib/TextBoxIcon/TextBoxIcon.js +53 -80
- package/lib/TextBoxIcon/TextBoxIcon.module.css +7 -7
- package/lib/TextBoxIcon/props/propTypes.js +4 -9
- package/lib/Textarea/Textarea.js +29 -54
- package/lib/Textarea/Textarea.module.css +22 -22
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +31 -94
- package/lib/Tooltip/Tooltip.module.css +5 -9
- package/lib/Tooltip/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +16 -40
- package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +25 -53
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/VelocityAnimation/index.js +0 -3
- package/lib/common/animation.module.css +8 -8
- package/lib/common/avatarsizes.module.css +16 -16
- package/lib/common/basicReset.module.css +3 -3
- package/lib/common/common.module.css +24 -24
- package/lib/common/customscroll.module.css +2 -12
- package/lib/css.js +0 -40
- package/lib/deprecated/PortalLayer/PortalLayer.js +23 -46
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +0 -58
- package/lib/semantic/Button/Button.js +22 -42
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/Button/semanticButton.module.css +1 -1
- package/lib/semantic/index.js +0 -2
- package/lib/utils/Common.js +18 -111
- package/lib/utils/ContextOptimizer.js +10 -16
- package/lib/utils/constructFullName.js +4 -13
- package/lib/utils/datetime/common.js +5 -34
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +59 -175
- package/lib/utils/dummyFunction.js +0 -2
- package/lib/utils/getHTMLFontSize.js +0 -1
- package/lib/utils/getInitial.js +0 -6
- package/lib/utils/index.js +0 -1
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/lib/v1/Accordion/Accordion.js +19 -38
- package/lib/v1/Accordion/AccordionItem.js +13 -23
- package/lib/v1/Accordion/index.js +0 -3
- package/lib/v1/Accordion/props/propTypes.js +0 -3
- package/lib/v1/Animation/Animation.js +14 -20
- package/lib/v1/Animation/props/propTypes.js +0 -3
- package/lib/v1/AppContainer/AppContainer.js +17 -46
- package/lib/v1/AppContainer/props/propTypes.js +0 -3
- package/lib/v1/Avatar/Avatar.js +32 -68
- package/lib/v1/Avatar/props/propTypes.js +0 -3
- package/lib/v1/AvatarTeam/AvatarTeam.js +24 -32
- package/lib/v1/AvatarTeam/props/propTypes.js +0 -3
- package/lib/v1/Button/Button.js +22 -32
- package/lib/v1/Button/props/defaultProps.js +0 -2
- package/lib/v1/Button/props/propTypes.js +0 -3
- package/lib/v1/Buttongroup/Buttongroup.js +5 -13
- package/lib/v1/Buttongroup/props/propTypes.js +0 -3
- package/lib/v1/Card/Card.js +44 -78
- package/lib/v1/Card/index.js +0 -4
- package/lib/v1/Card/props/propTypes.js +0 -3
- package/lib/v1/CheckBox/CheckBox.js +41 -52
- package/lib/v1/CheckBox/props/propTypes.js +0 -3
- package/lib/v1/DateTime/CalendarView.js +48 -89
- package/lib/v1/DateTime/DateTime.js +158 -246
- package/lib/v1/DateTime/DateTimePopupFooter.js +8 -33
- package/lib/v1/DateTime/DateTimePopupHeader.js +17 -49
- package/lib/v1/DateTime/DateWidget.js +251 -352
- package/lib/v1/DateTime/DaysRow.js +5 -28
- package/lib/v1/DateTime/Time.js +32 -75
- package/lib/v1/DateTime/YearView.js +27 -76
- package/lib/v1/DateTime/index.js +0 -2
- package/lib/v1/DateTime/props/propTypes.js +1 -11
- package/lib/v1/DropBox/DropBox.js +21 -45
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +40 -60
- package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +0 -3
- package/lib/v1/DropBox/props/defaultProps.js +4 -8
- package/lib/v1/DropBox/props/propTypes.js +4 -10
- package/lib/v1/DropDown/DropDown.js +3 -23
- package/lib/v1/DropDown/DropDownHeading.js +13 -20
- package/lib/v1/DropDown/DropDownItem.js +11 -26
- package/lib/v1/DropDown/DropDownSearch.js +16 -28
- package/lib/v1/DropDown/DropDownSeparator.js +1 -7
- package/lib/v1/DropDown/props/propTypes.js +4 -10
- package/lib/v1/Heading/Heading.js +14 -19
- package/lib/v1/Heading/props/propTypes.js +0 -3
- package/lib/v1/Label/Label.js +14 -22
- package/lib/v1/Label/props/propTypes.js +0 -3
- package/lib/v1/Layout/Box.js +15 -35
- package/lib/v1/Layout/Container.js +14 -33
- package/lib/v1/Layout/index.js +0 -3
- package/lib/v1/Layout/props/propTypes.js +0 -3
- package/lib/v1/ListItem/ListContainer.js +30 -55
- package/lib/v1/ListItem/ListItem.js +38 -53
- package/lib/v1/ListItem/ListItemWithAvatar.js +39 -62
- package/lib/v1/ListItem/ListItemWithCheckBox.js +34 -49
- package/lib/v1/ListItem/ListItemWithIcon.js +37 -52
- package/lib/v1/ListItem/ListItemWithRadio.js +35 -49
- package/lib/v1/ListItem/index.js +0 -7
- package/lib/v1/ListItem/props/propTypes.js +4 -6
- package/lib/v1/Modal/Modal.js +9 -46
- package/lib/v1/Modal/props/propTypes.js +0 -3
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +168 -294
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +125 -202
- package/lib/v1/MultiSelect/EmptyState.js +24 -45
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +5 -14
- package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +0 -3
- package/lib/v1/MultiSelect/MultiSelect.js +216 -335
- package/lib/v1/MultiSelect/MultiSelectHeader.js +7 -29
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +43 -86
- package/lib/v1/MultiSelect/SelectedOptions.js +17 -43
- package/lib/v1/MultiSelect/Suggestions.js +32 -64
- package/lib/v1/MultiSelect/index.js +0 -5
- package/lib/v1/MultiSelect/props/defaultProps.js +0 -2
- package/lib/v1/MultiSelect/props/propTypes.js +4 -14
- package/lib/v1/PopOver/PopOver.js +40 -71
- package/lib/v1/PopOver/props/propTypes.js +0 -3
- package/lib/v1/Popup/Popup.js +81 -158
- package/lib/v1/Provider/AvatarSize.js +0 -4
- package/lib/v1/Provider/Config.js +0 -2
- package/lib/v1/Provider/CssProvider.js +0 -4
- package/lib/v1/Provider/IdProvider.js +6 -17
- package/lib/v1/Provider/LibraryContext.js +15 -35
- package/lib/v1/Provider/LibraryContextInit.js +0 -4
- package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +15 -44
- package/lib/v1/Provider/ZindexProvider.js +3 -15
- package/lib/v1/Provider/index.js +0 -5
- package/lib/v1/Radio/Radio.js +32 -42
- package/lib/v1/Radio/props/propTypes.js +0 -3
- package/lib/v1/Responsive/CustomResponsive.js +29 -73
- package/lib/v1/Responsive/RefWrapper.js +11 -17
- package/lib/v1/Responsive/ResizeComponent.js +36 -62
- package/lib/v1/Responsive/ResizeObserver.js +10 -24
- package/lib/v1/Responsive/Responsive.js +30 -80
- package/lib/v1/Responsive/index.js +0 -4
- package/lib/v1/Responsive/props/propTypes.js +0 -3
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +13 -27
- package/lib/v1/ResponsiveDropBox/props/propTypes.js +4 -9
- package/lib/v1/Ribbon/Ribbon.js +7 -14
- package/lib/v1/Ribbon/props/propTypes.js +0 -3
- package/lib/v1/RippleEffect/RippleEffect.js +7 -17
- package/lib/v1/RippleEffect/props/propTypes.js +0 -3
- package/lib/v1/Select/GroupSelect.js +130 -229
- package/lib/v1/Select/Select.js +215 -298
- package/lib/v1/Select/SelectWithAvatar.js +56 -102
- package/lib/v1/Select/SelectWithIcon.js +76 -131
- package/lib/v1/Select/index.js +0 -5
- package/lib/v1/Select/props/defaultProps.js +4 -5
- package/lib/v1/Select/props/propTypes.js +4 -10
- package/lib/v1/Stencils/Stencils.js +3 -13
- package/lib/v1/Stencils/props/propTypes.js +0 -3
- package/lib/v1/Switch/Switch.js +25 -38
- package/lib/v1/Switch/props/propTypes.js +0 -3
- package/lib/v1/Tab/Tab.js +27 -40
- package/lib/v1/Tab/TabContent.js +5 -12
- package/lib/v1/Tab/TabContentWrapper.js +13 -16
- package/lib/v1/Tab/TabWrapper.js +19 -37
- package/lib/v1/Tab/Tabs.js +83 -170
- package/lib/v1/Tab/index.js +0 -6
- package/lib/v1/Tab/props/defaultProps.js +2 -1
- package/lib/v1/Tab/props/propTypes.js +3 -4
- package/lib/v1/Tab/v1Tab.module.css +14 -14
- package/lib/v1/Tab/v1Tabs.module.css +22 -22
- package/lib/v1/Tag/Tag.js +32 -50
- package/lib/v1/Tag/props/propTypes.js +0 -3
- package/lib/v1/TextBox/TextBox.js +47 -70
- package/lib/v1/TextBox/props/propTypes.js +4 -6
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +55 -80
- package/lib/v1/TextBoxIcon/props/propTypes.js +4 -9
- package/lib/v1/Textarea/Textarea.js +28 -45
- package/lib/v1/Textarea/props/propTypes.js +0 -3
- package/lib/v1/Tooltip/Tooltip.js +31 -94
- package/lib/v1/Tooltip/props/propTypes.js +0 -3
- package/lib/v1/Typography/Typography.js +15 -26
- package/lib/v1/Typography/css/Typography.module.css +31 -31
- package/lib/v1/Typography/css/cssJSLogic.js +20 -25
- package/lib/v1/Typography/props/propTypes.js +0 -3
- package/lib/v1/Typography/utils/index.js +0 -1
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +12 -25
- package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -3
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +22 -38
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -3
- package/lib/v1/semantic/Button/Button.js +18 -24
- package/lib/v1/semantic/Button/props/propTypes.js +0 -3
- package/lib/v1/semantic/index.js +0 -2
- package/package.json +13 -12
- package/propValidationArg.json +2 -2
- package/result.json +1 -1
- /package/.cli/{AppearanceThemeValidationExcludeFiles.js → ThemeValidationExcludeFiles.js} +0 -0
package/lib/v1/Select/Select.js
CHANGED
|
@@ -1,99 +1,58 @@
|
|
|
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 _icons = require("@zohodesk/icons");
|
|
33
|
-
|
|
34
20
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
35
|
-
|
|
36
21
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
37
|
-
|
|
38
22
|
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
39
|
-
|
|
40
23
|
var _dropDownUtils = require("../../utils/dropDownUtils");
|
|
41
|
-
|
|
42
24
|
var _Common = require("../../utils/Common.js");
|
|
43
|
-
|
|
44
25
|
var _SelectModule = _interopRequireDefault(require("../../Select/Select.module.css"));
|
|
45
|
-
|
|
46
26
|
var _Config = require("../../Provider/Config");
|
|
47
|
-
|
|
48
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
|
-
|
|
50
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
-
|
|
52
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
-
|
|
54
30
|
function _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); }
|
|
55
|
-
|
|
56
31
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
|
-
|
|
58
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
|
-
|
|
60
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
61
|
-
|
|
33
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
62
34
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
63
|
-
|
|
64
|
-
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); } }
|
|
65
|
-
|
|
35
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
66
36
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
67
|
-
|
|
37
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
38
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
68
39
|
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); }
|
|
69
|
-
|
|
70
40
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
71
|
-
|
|
72
41
|
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); }; }
|
|
73
|
-
|
|
74
42
|
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); }
|
|
75
|
-
|
|
76
43
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
77
|
-
|
|
78
44
|
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; } }
|
|
79
|
-
|
|
80
45
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
81
|
-
|
|
82
46
|
/* eslint-disable react/no-deprecated */
|
|
83
|
-
|
|
84
47
|
/* eslint-disable react/no-unused-prop-types */
|
|
85
|
-
var dummyArray = [];
|
|
86
48
|
|
|
49
|
+
var dummyArray = [];
|
|
87
50
|
var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
88
51
|
_inherits(SelectComponent, _Component);
|
|
89
|
-
|
|
90
52
|
var _super = _createSuper(SelectComponent);
|
|
91
|
-
|
|
92
53
|
function SelectComponent(props) {
|
|
93
54
|
var _this;
|
|
94
|
-
|
|
95
55
|
_classCallCheck(this, SelectComponent);
|
|
96
|
-
|
|
97
56
|
_this = _super.call(this, props);
|
|
98
57
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
99
58
|
_this.getFilterSuggestions = (0, _dropDownUtils.makeGetMultiSelectFilterSuggestions)();
|
|
@@ -101,39 +60,36 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
101
60
|
_this.getSelectedValue = (0, _dropDownUtils.makeGetSelectedValueText)();
|
|
102
61
|
_this.selectedFormatOptions = {};
|
|
103
62
|
var selectedValue = props.selectedValue,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
63
|
+
_props$searchDebounce = props.searchDebounceTime,
|
|
64
|
+
searchDebounceTime = _props$searchDebounce === void 0 ? 500 : _props$searchDebounce,
|
|
65
|
+
isDefaultSelectValue = props.isDefaultSelectValue,
|
|
66
|
+
_props$autoSelectDebo = props.autoSelectDebouneTime,
|
|
67
|
+
autoSelectDebouneTime = _props$autoSelectDebo === void 0 ? 350 : _props$autoSelectDebo,
|
|
68
|
+
valueField = props.valueField,
|
|
69
|
+
textField = props.textField;
|
|
112
70
|
var _this$handleFormatOpt = _this.handleFormatOptions(_this.props),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
71
|
+
allOptions = _this$handleFormatOpt.allOptions,
|
|
72
|
+
normalizedAllOptions = _this$handleFormatOpt.normalizedAllOptions,
|
|
73
|
+
optionsOrder = _this$handleFormatOpt.optionsOrder,
|
|
74
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
118
75
|
var _this$getSelectedValu = _this.getSelectedValue({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
76
|
+
optionsOrder: optionsOrder,
|
|
77
|
+
selectedValue: selectedValue,
|
|
78
|
+
normalizedFormatOptions: normalizedFormatOptions,
|
|
79
|
+
selectedFormatOptions: _this.selectedFormatOptions,
|
|
80
|
+
isDefaultSelectValue: isDefaultSelectValue,
|
|
81
|
+
valueField: valueField,
|
|
82
|
+
textField: textField
|
|
83
|
+
}),
|
|
84
|
+
selected = _this$getSelectedValu.selected,
|
|
85
|
+
hoverIndex = _this$getSelectedValu.hoverIndex,
|
|
86
|
+
selectedValueDetails = _this$getSelectedValu.selectedValueDetails,
|
|
87
|
+
selectedId = _this$getSelectedValu.selectedId,
|
|
88
|
+
isSelfValueChanged = _this$getSelectedValu.isSelfValueChanged;
|
|
89
|
+
// eslint-disable-next-line
|
|
90
|
+
if (isSelfValueChanged) {
|
|
91
|
+
// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
|
|
135
92
|
}
|
|
136
|
-
|
|
137
93
|
_this.state = {
|
|
138
94
|
selected: selected,
|
|
139
95
|
options: allOptions,
|
|
@@ -177,12 +133,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
177
133
|
_this.autoSelectIndex = 0;
|
|
178
134
|
return _this;
|
|
179
135
|
}
|
|
180
|
-
|
|
181
136
|
_createClass(SelectComponent, [{
|
|
182
137
|
key: "componentDidMount",
|
|
183
138
|
value: function componentDidMount() {
|
|
184
139
|
this._isMounted = true;
|
|
185
|
-
this.handleExposePopupHandlers();
|
|
140
|
+
this.handleExposePopupHandlers();
|
|
141
|
+
// let { suggestionContainer } = this;
|
|
186
142
|
// suggestionContainer &&
|
|
187
143
|
// suggestionContainer.addEventListener('scroll', this.handleScroll);
|
|
188
144
|
}
|
|
@@ -190,39 +146,35 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
190
146
|
key: "componentWillReceiveProps",
|
|
191
147
|
value: function componentWillReceiveProps(nextProps) {
|
|
192
148
|
var selectedValue = nextProps.selectedValue,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
149
|
+
isDefaultSelectValue = nextProps.isDefaultSelectValue,
|
|
150
|
+
valueField = nextProps.valueField,
|
|
151
|
+
textField = nextProps.textField;
|
|
196
152
|
var oldHoverIndex = this.state.hoverIndex;
|
|
197
|
-
|
|
198
153
|
var _this$handleFormatOpt2 = this.handleFormatOptions(nextProps),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
154
|
+
allOptions = _this$handleFormatOpt2.allOptions,
|
|
155
|
+
normalizedAllOptions = _this$handleFormatOpt2.normalizedAllOptions,
|
|
156
|
+
optionsOrder = _this$handleFormatOpt2.optionsOrder,
|
|
157
|
+
normalizedFormatOptions = _this$handleFormatOpt2.normalizedFormatOptions;
|
|
204
158
|
var oldSelectedFormatOptions = this.selectedFormatOptions;
|
|
205
|
-
|
|
206
159
|
var _this$getSelectedValu2 = this.getSelectedValue({
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
160
|
+
optionsOrder: optionsOrder,
|
|
161
|
+
selectedValue: selectedValue,
|
|
162
|
+
normalizedFormatOptions: normalizedFormatOptions,
|
|
163
|
+
selectedFormatOptions: oldSelectedFormatOptions,
|
|
164
|
+
isDefaultSelectValue: isDefaultSelectValue,
|
|
165
|
+
valueField: valueField,
|
|
166
|
+
textField: textField
|
|
167
|
+
}),
|
|
168
|
+
selected = _this$getSelectedValu2.selected,
|
|
169
|
+
hoverIndex = _this$getSelectedValu2.hoverIndex,
|
|
170
|
+
selectedValueDetails = _this$getSelectedValu2.selectedValueDetails,
|
|
171
|
+
selectedId = _this$getSelectedValu2.selectedId,
|
|
172
|
+
isSelfValueChanged = _this$getSelectedValu2.isSelfValueChanged;
|
|
173
|
+
var oldSelectedValue = this.props.selectedValue;
|
|
174
|
+
// eslint-disable-next-line
|
|
175
|
+
if (isSelfValueChanged && oldSelectedValue !== selectedValue) {
|
|
176
|
+
// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
|
|
224
177
|
}
|
|
225
|
-
|
|
226
178
|
this.selectedFormatOptions = Object.assign(oldSelectedFormatOptions, selectedValueDetails);
|
|
227
179
|
this.normalizedFormatOptions = normalizedFormatOptions;
|
|
228
180
|
this.optionsOrder = optionsOrder;
|
|
@@ -239,25 +191,23 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
239
191
|
key: "componentDidUpdate",
|
|
240
192
|
value: function componentDidUpdate(prevProps) {
|
|
241
193
|
var _this2 = this;
|
|
242
|
-
|
|
243
194
|
var suggestionContainer = this.suggestionContainer,
|
|
244
|
-
|
|
195
|
+
optionsOrder = this.optionsOrder;
|
|
245
196
|
var _this$state = this.state,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
197
|
+
hoverIndex = _this$state.hoverIndex,
|
|
198
|
+
searchStr = _this$state.searchStr,
|
|
199
|
+
selectedValueIndex = _this$state.selectedValueIndex;
|
|
249
200
|
var _this$props = this.props,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
201
|
+
needLocalSearch = _this$props.needLocalSearch,
|
|
202
|
+
onDropBoxClose = _this$props.onDropBoxClose,
|
|
203
|
+
onDropBoxOpen = _this$props.onDropBoxOpen,
|
|
204
|
+
needSearch = _this$props.needSearch,
|
|
205
|
+
onSearch = _this$props.onSearch,
|
|
206
|
+
isPopupOpen = _this$props.isPopupOpen,
|
|
207
|
+
isSearchClearOnClose = _this$props.isSearchClearOnClose;
|
|
257
208
|
var hoverId = (0, _Common.getIsEmptyValue)(optionsOrder[hoverIndex]) ? '' : optionsOrder[hoverIndex];
|
|
258
209
|
var selSuggestion = this["suggestion_".concat(hoverId)];
|
|
259
210
|
isPopupOpen && (0, _Common.scrollTo)(suggestionContainer, selSuggestion);
|
|
260
|
-
|
|
261
211
|
if (prevProps.isPopupOpen !== isPopupOpen) {
|
|
262
212
|
if (isPopupOpen) {
|
|
263
213
|
onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
|
|
@@ -275,16 +225,15 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
275
225
|
hoverIndex: selectedValueIndex
|
|
276
226
|
});
|
|
277
227
|
}
|
|
278
|
-
}
|
|
279
|
-
|
|
228
|
+
}
|
|
280
229
|
|
|
230
|
+
//When suggestions length less than 5, getNextOptions function call
|
|
281
231
|
var _this$props2 = this.props,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
232
|
+
isNextOptions = _this$props2.isNextOptions,
|
|
233
|
+
getNextOptions = _this$props2.getNextOptions;
|
|
234
|
+
// let { searchStr } = this.state;
|
|
285
235
|
var suggestions = isPopupOpen ? this.handleFilterSuggestions() : [];
|
|
286
236
|
var suggestionsLen = suggestions.length;
|
|
287
|
-
|
|
288
237
|
if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
|
|
289
238
|
this.handleFetchOptions(getNextOptions, searchStr);
|
|
290
239
|
}
|
|
@@ -300,7 +249,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
300
249
|
closePopup: null,
|
|
301
250
|
togglePopup: null
|
|
302
251
|
};
|
|
303
|
-
getPopupHandlers && getPopupHandlers(methods);
|
|
252
|
+
getPopupHandlers && getPopupHandlers(methods);
|
|
253
|
+
// let { suggestionContainer } = this;
|
|
304
254
|
// suggestionContainer &&
|
|
305
255
|
// suggestionContainer.removeEventListener('scroll', this.handleScroll);
|
|
306
256
|
}
|
|
@@ -308,12 +258,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
308
258
|
key: "handleFormatOptions",
|
|
309
259
|
value: function handleFormatOptions(props) {
|
|
310
260
|
var options = props.options,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
261
|
+
valueField = props.valueField,
|
|
262
|
+
textField = props.textField,
|
|
263
|
+
_props$customProps = props.customProps,
|
|
264
|
+
customProps = _props$customProps === void 0 ? {} : _props$customProps;
|
|
315
265
|
var _customProps$listItem = customProps.listItemProps,
|
|
316
|
-
|
|
266
|
+
listItemProps = _customProps$listItem === void 0 ? {} : _customProps$listItem;
|
|
317
267
|
return this.formatOptions({
|
|
318
268
|
options: options,
|
|
319
269
|
valueField: valueField,
|
|
@@ -326,12 +276,12 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
326
276
|
value: function handleChange(id, value, index, e) {
|
|
327
277
|
e && e.preventDefault && e.preventDefault();
|
|
328
278
|
var _this$props3 = this.props,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
279
|
+
onChange = _this$props3.onChange,
|
|
280
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
281
|
+
needCloseOnSelect = _this$props3.needCloseOnSelect;
|
|
332
282
|
var optionsNormalize = this.state.optionsNormalize;
|
|
333
|
-
!isReadOnly && onChange && onChange(id, optionsNormalize[id]);
|
|
334
|
-
|
|
283
|
+
!isReadOnly && onChange && onChange(id, optionsNormalize[id]);
|
|
284
|
+
// this.valueInput && this.valueInput.focus({preventScroll:true});
|
|
335
285
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
336
286
|
}
|
|
337
287
|
}, {
|
|
@@ -348,83 +298,73 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
348
298
|
key: "handleKeyDown",
|
|
349
299
|
value: function handleKeyDown(e) {
|
|
350
300
|
var _this$props4 = this.props,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
301
|
+
onChange = _this$props4.onChange,
|
|
302
|
+
isPopupOpen = _this$props4.isPopupOpen,
|
|
303
|
+
onKeyDown = _this$props4.onKeyDown,
|
|
304
|
+
isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
|
|
305
|
+
needCloseOnSelect = _this$props4.needCloseOnSelect,
|
|
306
|
+
isPopupReady = _this$props4.isPopupReady;
|
|
357
307
|
var _this$state2 = this.state,
|
|
358
|
-
|
|
359
|
-
|
|
308
|
+
hoverIndex = _this$state2.hoverIndex,
|
|
309
|
+
optionsNormalize = _this$state2.optionsNormalize;
|
|
360
310
|
var options = this.handleFilterSuggestions();
|
|
361
311
|
var keyCode = e.keyCode;
|
|
362
|
-
|
|
363
312
|
if (!isPopupOpen && !isPopupOpenOnEnter) {
|
|
364
313
|
onKeyDown && onKeyDown(e);
|
|
365
314
|
}
|
|
366
|
-
|
|
367
315
|
if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13) && e.preventDefault) {
|
|
368
316
|
e.preventDefault(); //prevent body scroll and enter key prevent
|
|
369
317
|
} else if (!isPopupOpen && keyCode === 40) {
|
|
370
318
|
e.preventDefault(); //prevent body scroll
|
|
371
|
-
|
|
372
319
|
this.togglePopup(e);
|
|
373
320
|
}
|
|
374
|
-
|
|
375
321
|
if (keyCode === 38 && isPopupOpen && options.length) {
|
|
376
322
|
// eslint-disable-next-line
|
|
377
|
-
if (hoverIndex === 0) {
|
|
323
|
+
if (hoverIndex === 0) {
|
|
324
|
+
// hoverIndex = options.length - 1;
|
|
378
325
|
} else {
|
|
379
326
|
hoverIndex -= 1;
|
|
380
327
|
}
|
|
381
|
-
|
|
382
328
|
this.setState({
|
|
383
329
|
hoverIndex: hoverIndex
|
|
384
330
|
});
|
|
385
331
|
} else if (keyCode === 40 && isPopupOpen && options.length) {
|
|
386
332
|
// eslint-disable-next-line
|
|
387
|
-
if (hoverIndex === options.length - 1) {
|
|
333
|
+
if (hoverIndex === options.length - 1) {
|
|
334
|
+
// hoverIndex = 0;
|
|
388
335
|
} else {
|
|
389
336
|
if (hoverIndex === options.length - 3) {
|
|
390
337
|
this.handleGetNextOptions();
|
|
391
338
|
}
|
|
392
|
-
|
|
393
339
|
hoverIndex += 1;
|
|
394
340
|
}
|
|
395
|
-
|
|
396
341
|
this.setState({
|
|
397
342
|
hoverIndex: hoverIndex
|
|
398
343
|
});
|
|
399
344
|
} else if (keyCode === 13) {
|
|
400
345
|
var option = options[hoverIndex];
|
|
401
|
-
|
|
402
346
|
var _ref2 = option || {},
|
|
403
|
-
|
|
404
|
-
|
|
347
|
+
id = _ref2.id;
|
|
405
348
|
if (isPopupReady && !(0, _Common.getIsEmptyValue)(id) && onChange) {
|
|
406
349
|
onChange(id, optionsNormalize[id]);
|
|
407
350
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
408
351
|
}
|
|
409
|
-
|
|
410
|
-
if (!isPopupOpen && isPopupOpenOnEnter) {
|
|
352
|
+
if (!isPopupReady && isPopupOpenOnEnter) {
|
|
411
353
|
this.togglePopup(e);
|
|
412
354
|
}
|
|
413
355
|
} else if (keyCode === 27) {
|
|
414
356
|
this.valueInput && this.valueInput.focus({
|
|
415
357
|
preventScroll: true
|
|
416
|
-
});
|
|
358
|
+
});
|
|
359
|
+
//this.handlePopupClose(e);
|
|
417
360
|
} else if (keyCode === 9) {
|
|
418
361
|
var _option = options[hoverIndex];
|
|
419
|
-
|
|
420
362
|
var _ref3 = _option || {},
|
|
421
|
-
|
|
422
|
-
|
|
363
|
+
_id = _ref3.id;
|
|
423
364
|
if (isPopupOpen && !(0, _Common.getIsEmptyValue)(_id)) {
|
|
424
365
|
onChange && onChange(_id, optionsNormalize[_id]);
|
|
425
366
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
426
367
|
}
|
|
427
|
-
|
|
428
368
|
if (!isPopupOpen && isPopupOpenOnEnter) {
|
|
429
369
|
this.togglePopup(e);
|
|
430
370
|
}
|
|
@@ -441,10 +381,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
441
381
|
key: "handleSearch",
|
|
442
382
|
value: function handleSearch(value) {
|
|
443
383
|
var _this3 = this;
|
|
444
|
-
|
|
445
384
|
// let { value = '' } = e.target;
|
|
446
385
|
var _this$state$searchStr = this.state.searchStr,
|
|
447
|
-
|
|
386
|
+
searchStr = _this$state$searchStr === void 0 ? '' : _this$state$searchStr;
|
|
448
387
|
var onSearch = this.props.onSearch;
|
|
449
388
|
var searchStrRegex = (0, _Common.getSearchString)(searchStr);
|
|
450
389
|
var valueStrRegex = (0, _Common.getSearchString)(value);
|
|
@@ -462,9 +401,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
462
401
|
}
|
|
463
402
|
}, {
|
|
464
403
|
key: "handleMouseEnter",
|
|
465
|
-
value: function handleMouseEnter(id
|
|
466
|
-
/*val, index*/
|
|
467
|
-
) {
|
|
404
|
+
value: function handleMouseEnter(id /*val, index*/) {
|
|
468
405
|
var hoverIndex = this.state.hoverIndex;
|
|
469
406
|
var optionsOrder = this.optionsOrder;
|
|
470
407
|
var newHoverIndex = optionsOrder.indexOf(id);
|
|
@@ -476,31 +413,31 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
476
413
|
key: "handleFilterSuggestions",
|
|
477
414
|
value: function handleFilterSuggestions() {
|
|
478
415
|
var _this$props5 = this.props,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
416
|
+
needLocalSearch = _this$props5.needLocalSearch,
|
|
417
|
+
_this$props5$excludeO = _this$props5.excludeOptions,
|
|
418
|
+
excludeOptions = _this$props5$excludeO === void 0 ? dummyArray : _this$props5$excludeO;
|
|
482
419
|
var _this$state3 = this.state,
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
420
|
+
_this$state3$options = _this$state3.options,
|
|
421
|
+
options = _this$state3$options === void 0 ? dummyArray : _this$state3$options,
|
|
422
|
+
_this$state3$searchSt = _this$state3.searchStr,
|
|
423
|
+
searchStr = _this$state3$searchSt === void 0 ? '' : _this$state3$searchSt;
|
|
424
|
+
|
|
425
|
+
// if (
|
|
487
426
|
// (needSearch && searchStr && searchStr.trim().length) ||
|
|
488
427
|
// (excludeOptions && excludeOptions.length)
|
|
489
428
|
// ) {
|
|
490
|
-
|
|
491
429
|
searchStr = (0, _Common.getSearchString)(searchStr);
|
|
492
|
-
|
|
493
430
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
431
|
+
options: options,
|
|
432
|
+
selectedOptions: excludeOptions,
|
|
433
|
+
searchStr: searchStr,
|
|
434
|
+
needSearch: needLocalSearch
|
|
435
|
+
}),
|
|
436
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
437
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
502
438
|
this.optionsOrder = suggestionIds;
|
|
503
|
-
return suggestions;
|
|
439
|
+
return suggestions;
|
|
440
|
+
// }
|
|
504
441
|
// return options;
|
|
505
442
|
}
|
|
506
443
|
}, {
|
|
@@ -514,18 +451,15 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
514
451
|
key: "handleFetchOptions",
|
|
515
452
|
value: function handleFetchOptions(APICall) {
|
|
516
453
|
var _this4 = this;
|
|
517
|
-
|
|
518
454
|
var searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
519
455
|
// let funcArgs = args.slice(1, args.length);
|
|
520
456
|
var _this$state$isFetchin = this.state.isFetchingOptions,
|
|
521
|
-
|
|
457
|
+
isFetchingOptions = _this$state$isFetchin === void 0 ? false : _this$state$isFetchin;
|
|
522
458
|
var _isMounted = this._isMounted;
|
|
523
|
-
|
|
524
459
|
if (!isFetchingOptions && APICall) {
|
|
525
460
|
this.setState({
|
|
526
461
|
isFetchingOptions: true
|
|
527
462
|
});
|
|
528
|
-
|
|
529
463
|
try {
|
|
530
464
|
return APICall(searchStr).then(function () {
|
|
531
465
|
_isMounted && _this4.setState({
|
|
@@ -547,8 +481,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
547
481
|
key: "handleGetNextOptions",
|
|
548
482
|
value: function handleGetNextOptions() {
|
|
549
483
|
var _this$props6 = this.props,
|
|
550
|
-
|
|
551
|
-
|
|
484
|
+
isNextOptions = _this$props6.isNextOptions,
|
|
485
|
+
getNextOptions = _this$props6.getNextOptions;
|
|
552
486
|
var searchStr = this.state.searchStr;
|
|
553
487
|
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
554
488
|
}
|
|
@@ -556,11 +490,11 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
556
490
|
key: "togglePopup",
|
|
557
491
|
value: function togglePopup(e) {
|
|
558
492
|
var _this$props7 = this.props,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
493
|
+
togglePopup = _this$props7.togglePopup,
|
|
494
|
+
isReadOnly = _this$props7.isReadOnly,
|
|
495
|
+
defaultDropBoxPosition = _this$props7.defaultDropBoxPosition,
|
|
496
|
+
onFocus = _this$props7.onFocus,
|
|
497
|
+
isPopupOpen = _this$props7.isPopupOpen;
|
|
564
498
|
!isReadOnly && togglePopup(e, defaultDropBoxPosition ? "".concat(defaultDropBoxPosition) : null);
|
|
565
499
|
!isPopupOpen && typeof onFocus === 'function' && onFocus(e);
|
|
566
500
|
}
|
|
@@ -605,7 +539,6 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
605
539
|
key: "handleClearSearch",
|
|
606
540
|
value: function handleClearSearch() {
|
|
607
541
|
var _this5 = this;
|
|
608
|
-
|
|
609
542
|
this.handleSearch('');
|
|
610
543
|
setTimeout(function () {
|
|
611
544
|
_this5.searchInput && _this5.searchInput.focus({
|
|
@@ -618,9 +551,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
618
551
|
value: function handleValueInputChange(e) {
|
|
619
552
|
var typeString = (0, _Common.getKeyValue)(e);
|
|
620
553
|
var _this$props8 = this.props,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
554
|
+
isPopupOpen = _this$props8.isPopupOpen,
|
|
555
|
+
autoSelectOnType = _this$props8.autoSelectOnType;
|
|
624
556
|
if (!isPopupOpen && autoSelectOnType) {
|
|
625
557
|
this.valueInputTypeString += (typeString || '').trim();
|
|
626
558
|
this.handleChangeOnType();
|
|
@@ -630,53 +562,43 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
630
562
|
key: "handleChangeOnType",
|
|
631
563
|
value: function handleChangeOnType() {
|
|
632
564
|
var _this6 = this;
|
|
633
|
-
|
|
634
565
|
var _this$props$excludeOp = this.props.excludeOptions,
|
|
635
|
-
|
|
566
|
+
excludeOptions = _this$props$excludeOp === void 0 ? dummyArray : _this$props$excludeOp;
|
|
636
567
|
var _this$state$options = this.state.options,
|
|
637
|
-
|
|
568
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options;
|
|
638
569
|
var optionsOrder = this.optionsOrder;
|
|
639
570
|
var typeString = this.valueInputTypeString;
|
|
640
571
|
this.valueInputTypeString = '';
|
|
641
|
-
|
|
642
572
|
var changeValue = function changeValue() {
|
|
643
573
|
var optionDetails = _this6.autoSelectSuggestions[_this6.autoSelectIndex];
|
|
644
|
-
|
|
645
574
|
var _ref4 = optionDetails || {},
|
|
646
|
-
|
|
647
|
-
|
|
575
|
+
id = _ref4.id;
|
|
648
576
|
if (!(0, _Common.getIsEmptyValue)(id)) {
|
|
649
577
|
_this6.handleChange(id);
|
|
650
|
-
|
|
651
578
|
var hoverIndex = optionsOrder.indexOf(id);
|
|
652
|
-
|
|
653
579
|
_this6.setState({
|
|
654
580
|
hoverIndex: hoverIndex
|
|
655
581
|
});
|
|
656
582
|
}
|
|
657
583
|
};
|
|
658
|
-
|
|
659
584
|
if (typeString && typeString === this.valueInputSearchString) {
|
|
660
585
|
if (this.autoSelectIndex < this.autoSelectSuggestions.length - 1) {
|
|
661
586
|
this.autoSelectIndex += 1;
|
|
662
587
|
} else {
|
|
663
588
|
this.autoSelectIndex = 0;
|
|
664
589
|
}
|
|
665
|
-
|
|
666
590
|
changeValue();
|
|
667
591
|
} else if (typeString) {
|
|
668
592
|
this.valueInputSearchString = typeString;
|
|
669
|
-
|
|
670
593
|
var _this$getFilterSugges2 = this.getFilterSuggestions({
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
594
|
+
options: options,
|
|
595
|
+
selectedOptions: excludeOptions,
|
|
596
|
+
searchStr: typeString,
|
|
597
|
+
needSearch: true,
|
|
598
|
+
isStartsWithSearch: true
|
|
599
|
+
}),
|
|
600
|
+
_this$getFilterSugges3 = _this$getFilterSugges2.suggestions,
|
|
601
|
+
suggestions = _this$getFilterSugges3 === void 0 ? [] : _this$getFilterSugges3;
|
|
680
602
|
this.autoSelectIndex = 0;
|
|
681
603
|
this.autoSelectSuggestions = suggestions;
|
|
682
604
|
changeValue();
|
|
@@ -687,9 +609,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
687
609
|
value: function handleAddNewOption() {
|
|
688
610
|
var searchStr = this.state.searchStr;
|
|
689
611
|
var _this$props9 = this.props,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
612
|
+
onAddNewOption = _this$props9.onAddNewOption,
|
|
613
|
+
getCustomEmptyState = _this$props9.getCustomEmptyState;
|
|
693
614
|
if (getCustomEmptyState) {
|
|
694
615
|
this.setState({
|
|
695
616
|
searchStr: ''
|
|
@@ -701,11 +622,11 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
701
622
|
key: "handleExposePopupHandlers",
|
|
702
623
|
value: function handleExposePopupHandlers() {
|
|
703
624
|
var _this$props10 = this.props,
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
625
|
+
removeClose = _this$props10.removeClose,
|
|
626
|
+
openPopupOnly = _this$props10.openPopupOnly,
|
|
627
|
+
closePopupOnly = _this$props10.closePopupOnly,
|
|
628
|
+
togglePopup = _this$props10.togglePopup,
|
|
629
|
+
getPopupHandlers = _this$props10.getPopupHandlers;
|
|
709
630
|
var methods = {
|
|
710
631
|
removeClose: removeClose,
|
|
711
632
|
openPopup: openPopupOnly,
|
|
@@ -728,82 +649,81 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
728
649
|
key: "render",
|
|
729
650
|
value: function render() {
|
|
730
651
|
var _this7 = this;
|
|
731
|
-
|
|
732
652
|
var _this$props11 = this.props,
|
|
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
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
653
|
+
needSearch = _this$props11.needSearch,
|
|
654
|
+
dropBoxSize = _this$props11.dropBoxSize,
|
|
655
|
+
emptyMessage = _this$props11.emptyMessage,
|
|
656
|
+
searchEmptyMessage = _this$props11.searchEmptyMessage,
|
|
657
|
+
needBorder = _this$props11.needBorder,
|
|
658
|
+
needSelectDownIcon = _this$props11.needSelectDownIcon,
|
|
659
|
+
position = _this$props11.position,
|
|
660
|
+
defaultDropBoxPosition = _this$props11.defaultDropBoxPosition,
|
|
661
|
+
getTargetRef = _this$props11.getTargetRef,
|
|
662
|
+
getContainerRef = _this$props11.getContainerRef,
|
|
663
|
+
removeClose = _this$props11.removeClose,
|
|
664
|
+
isPopupOpen = _this$props11.isPopupOpen,
|
|
665
|
+
isPopupReady = _this$props11.isPopupReady,
|
|
666
|
+
animationStyle = _this$props11.animationStyle,
|
|
667
|
+
textBoxSize = _this$props11.textBoxSize,
|
|
668
|
+
textBoxVariant = _this$props11.textBoxVariant,
|
|
669
|
+
searchBoxSize = _this$props11.searchBoxSize,
|
|
670
|
+
searchBoxPlaceHolder = _this$props11.searchBoxPlaceHolder,
|
|
671
|
+
maxLength = _this$props11.maxLength,
|
|
672
|
+
isDisabled = _this$props11.isDisabled,
|
|
673
|
+
title = _this$props11.title,
|
|
674
|
+
size = _this$props11.size,
|
|
675
|
+
placeHolder = _this$props11.placeHolder,
|
|
676
|
+
className = _this$props11.className,
|
|
677
|
+
isReadOnly = _this$props11.isReadOnly,
|
|
678
|
+
dataId = _this$props11.dataId,
|
|
679
|
+
needResponsive = _this$props11.needResponsive,
|
|
680
|
+
borderColor = _this$props11.borderColor,
|
|
681
|
+
needTick = _this$props11.needTick,
|
|
682
|
+
listItemSize = _this$props11.listItemSize,
|
|
683
|
+
boxSize = _this$props11.boxSize,
|
|
684
|
+
needListBorder = _this$props11.needListBorder,
|
|
685
|
+
getFooter = _this$props11.getFooter,
|
|
686
|
+
getChildren = _this$props11.getChildren,
|
|
687
|
+
getCustomEmptyState = _this$props11.getCustomEmptyState,
|
|
688
|
+
isParentBased = _this$props11.isParentBased,
|
|
689
|
+
i18nKeys = _this$props11.i18nKeys,
|
|
690
|
+
htmlId = _this$props11.htmlId,
|
|
691
|
+
children = _this$props11.children,
|
|
692
|
+
iconOnHover = _this$props11.iconOnHover,
|
|
693
|
+
customProps = _this$props11.customProps,
|
|
694
|
+
autoComplete = _this$props11.autoComplete,
|
|
695
|
+
ariaLabelledby = _this$props11.ariaLabelledby,
|
|
696
|
+
isLoading = _this$props11.isLoading,
|
|
697
|
+
dataSelectorId = _this$props11.dataSelectorId,
|
|
698
|
+
isAbsolutePositioningNeeded = _this$props11.isAbsolutePositioningNeeded,
|
|
699
|
+
positionsOffset = _this$props11.positionsOffset,
|
|
700
|
+
targetOffset = _this$props11.targetOffset,
|
|
701
|
+
isRestrictScroll = _this$props11.isRestrictScroll,
|
|
702
|
+
dropBoxPortalId = _this$props11.dropBoxPortalId;
|
|
783
703
|
var _i18nKeys = i18nKeys,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
704
|
+
TextBoxIcon_i18n = _i18nKeys.TextBoxIcon_i18n,
|
|
705
|
+
_i18nKeys$TextBox_all = _i18nKeys.TextBox_ally_label,
|
|
706
|
+
TextBox_ally_label = _i18nKeys$TextBox_all === void 0 ? 'click to select options' : _i18nKeys$TextBox_all;
|
|
787
707
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
788
708
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
789
709
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
790
710
|
});
|
|
791
711
|
var _this$state4 = this.state,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
712
|
+
hoverIndex = _this$state4.hoverIndex,
|
|
713
|
+
selected = _this$state4.selected,
|
|
714
|
+
searchStr = _this$state4.searchStr,
|
|
715
|
+
isFetchingOptions = _this$state4.isFetchingOptions,
|
|
716
|
+
selectedId = _this$state4.selectedId,
|
|
717
|
+
options = _this$state4.options;
|
|
798
718
|
var suggestions = this.handleFilterSuggestions();
|
|
799
719
|
var setAriaId = this.getNextAriaId();
|
|
800
720
|
var ariaErrorId = this.getNextAriaId();
|
|
801
721
|
var _customProps$TextBoxP = customProps.TextBoxProps,
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
722
|
+
TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
|
|
723
|
+
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
724
|
+
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
725
|
+
_customProps$Suggesti = customProps.SuggestionsProps,
|
|
726
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
807
727
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
808
728
|
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 : ''),
|
|
809
729
|
"data-title": isDisabled ? title : null,
|
|
@@ -999,10 +919,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
999
919
|
}) : null);
|
|
1000
920
|
}
|
|
1001
921
|
}]);
|
|
1002
|
-
|
|
1003
922
|
return SelectComponent;
|
|
1004
923
|
}(_react.Component);
|
|
1005
|
-
|
|
1006
924
|
exports.SelectComponent = SelectComponent;
|
|
1007
925
|
SelectComponent.propTypes = _propTypes.Select_propTypes;
|
|
1008
926
|
SelectComponent.defaultProps = _defaultProps.Select_defaultProps;
|
|
@@ -1021,5 +939,4 @@ var _default = Select; // if (__DOCS__) {
|
|
|
1021
939
|
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
1022
940
|
// Select.propTypes = SelectComponent.propTypes;
|
|
1023
941
|
// }
|
|
1024
|
-
|
|
1025
942
|
exports["default"] = _default;
|