@zohodesk/components 1.0.0-temp-158 → 1.0.0-temp-159
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/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 +5 -13
- package/es/Avatar/Avatar.js +11 -23
- package/es/AvatarTeam/AvatarTeam.js +3 -3
- package/es/Button/Button.js +3 -4
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Card/Card.js +10 -21
- package/es/CheckBox/CheckBox.js +3 -5
- package/es/DateTime/CalendarView.js +20 -32
- package/es/DateTime/DateTime.js +10 -75
- package/es/DateTime/DateTimePopupFooter.js +2 -4
- package/es/DateTime/DateTimePopupHeader.js +2 -8
- package/es/DateTime/DateWidget.js +35 -98
- package/es/DateTime/DaysRow.js +2 -4
- package/es/DateTime/Time.js +2 -10
- package/es/DateTime/YearView.js +4 -28
- 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/dateFormats.js +1 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +4 -13
- package/es/DateTime/dateFormatUtils/index.js +2 -32
- 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/props/defaultProps.js +1 -2
- 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 +0 -7
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +3 -5
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +0 -3
- package/es/DropBox/props/defaultProps.js +2 -1
- package/es/DropBox/props/propTypes.js +2 -1
- package/es/DropDown/DropDown.js +4 -8
- package/es/DropDown/DropDownHeading.js +5 -4
- package/es/DropDown/DropDownItem.js +0 -6
- package/es/DropDown/DropDownSearch.js +0 -4
- package/es/DropDown/DropDownSeparator.js +0 -1
- package/es/DropDown/__tests__/DropDown.spec.js +2 -1
- package/es/Heading/Heading.js +3 -2
- package/es/Label/Label.js +3 -2
- package/es/Layout/Box.js +0 -13
- package/es/Layout/Container.js +1 -12
- package/es/Layout/index.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +3 -9
- 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/MultiSelect.js +32 -99
- package/es/MultiSelect/MultiSelectHeader.js +0 -3
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -12
- package/es/MultiSelect/SelectedOptions.js +3 -6
- package/es/MultiSelect/Suggestions.js +3 -7
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +6 -4
- package/es/MultiSelect/props/propTypes.js +0 -2
- package/es/PopOver/PopOver.js +2 -18
- package/es/PopOver/__tests__/PopOver.spec.js +1 -2
- package/es/Popup/Popup.js +24 -77
- package/es/Popup/__tests__/Popup.spec.js +5 -17
- 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 +2 -4
- 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/Ribbon/Ribbon.js +2 -3
- package/es/RippleEffect/RippleEffect.js +3 -1
- package/es/Select/GroupSelect.js +14 -58
- package/es/Select/Select.js +33 -79
- package/es/Select/SelectWithAvatar.js +4 -17
- package/es/Select/SelectWithIcon.js +5 -46
- package/es/Select/__tests__/Select.spec.js +8 -6
- package/es/Select/props/propTypes.js +0 -1
- package/es/Stencils/Stencils.js +3 -3
- package/es/Switch/Switch.js +3 -5
- package/es/Tab/Tab.js +4 -4
- package/es/Tab/TabContent.js +0 -1
- package/es/Tab/TabContentWrapper.js +0 -2
- package/es/Tab/TabWrapper.js +2 -5
- package/es/Tab/Tabs.js +7 -54
- package/es/Tab/__tests__/Tab.spec.js +3 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -1
- package/es/Tag/Tag.js +3 -6
- package/es/TextBox/TextBox.js +3 -15
- package/es/TextBox/TextBox.module.css +8 -5
- package/es/TextBox/__tests__/TextBox.spec.js +4 -1
- package/es/TextBoxIcon/TextBoxIcon.js +2 -9
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +7 -2
- package/es/Textarea/Textarea.js +3 -12
- package/es/Textarea/Textarea.module.css +3 -4
- package/es/Textarea/__tests__/Textarea.spec.js +2 -2
- package/es/Tooltip/Tooltip.js +14 -58
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -7
- package/es/deprecated/PortalLayer/PortalLayer.js +20 -25
- package/es/semantic/Button/Button.js +2 -3
- package/es/utils/Common.js +9 -54
- 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/css/compileClassNames.js +0 -5
- package/es/utils/css/mergeStyle.js +6 -7
- package/es/utils/css/utils.js +0 -1
- package/es/utils/datetime/common.js +7 -31
- 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/lib/Accordion/Accordion.js +18 -42
- package/lib/Accordion/AccordionItem.js +18 -40
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -3
- 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/__tests__/Animation.spec.js +7 -11
- package/lib/Animation/props/propTypes.js +0 -3
- package/lib/AppContainer/AppContainer.js +21 -56
- package/lib/AppContainer/props/propTypes.js +0 -3
- package/lib/Avatar/Avatar.js +38 -78
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -44
- package/lib/Avatar/props/propTypes.js +0 -3
- package/lib/AvatarTeam/AvatarTeam.js +30 -52
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -13
- package/lib/AvatarTeam/props/propTypes.js +0 -3
- package/lib/Button/Button.js +20 -31
- 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/__test__/Buttongroup.spec.js +0 -10
- package/lib/Buttongroup/props/propTypes.js +0 -3
- package/lib/Card/Card.js +46 -102
- package/lib/Card/__tests__/Card.spec.js +1 -10
- 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/__tests__/CheckBox.spec.js +0 -3
- package/lib/CheckBox/props/propTypes.js +0 -3
- package/lib/DateTime/CalendarView.js +42 -82
- package/lib/DateTime/DateTime.js +159 -247
- package/lib/DateTime/DateTimePopupFooter.js +9 -32
- package/lib/DateTime/DateTimePopupHeader.js +18 -49
- package/lib/DateTime/DateWidget.js +251 -353
- package/lib/DateTime/DaysRow.js +6 -28
- package/lib/DateTime/Time.js +33 -74
- package/lib/DateTime/YearView.js +29 -78
- 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/dateFormats.js +1 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +7 -14
- package/lib/DateTime/dateFormatUtils/index.js +16 -74
- package/lib/DateTime/dateFormatUtils/monthChange.js +9 -19
- package/lib/DateTime/dateFormatUtils/timeChange.js +23 -55
- package/lib/DateTime/dateFormatUtils/yearChange.js +11 -22
- package/lib/DateTime/index.js +0 -2
- package/lib/DateTime/objectUtils.js +20 -24
- package/lib/DateTime/props/defaultProps.js +1 -2
- 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 +10 -34
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +37 -58
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +33 -41
- package/lib/DropBox/DropBoxElement/props/propTypes.js +0 -3
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +9 -14
- package/lib/DropBox/__tests__/DropBox.spec.js +2 -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 +8 -52
- package/lib/DropDown/DropDownHeading.js +20 -39
- package/lib/DropDown/DropDownItem.js +20 -42
- package/lib/DropDown/DropDownSearch.js +17 -40
- package/lib/DropDown/DropDownSeparator.js +4 -24
- 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/index.js +0 -9
- package/lib/DropDown/props/propTypes.js +4 -6
- package/lib/Heading/Heading.js +15 -37
- package/lib/Heading/props/propTypes.js +0 -3
- package/lib/Label/Label.js +22 -40
- package/lib/Label/__tests__/Label.spec.js +1 -14
- 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/__tests__/Box.spec.js +49 -65
- package/lib/Layout/__tests__/Container.spec.js +50 -67
- package/lib/Layout/index.js +0 -3
- package/lib/Layout/props/propTypes.js +0 -3
- package/lib/Layout/utils.js +0 -10
- package/lib/ListItem/ListContainer.js +28 -49
- package/lib/ListItem/ListItem.js +46 -70
- package/lib/ListItem/ListItemWithAvatar.js +49 -76
- package/lib/ListItem/ListItemWithCheckBox.js +39 -64
- package/lib/ListItem/ListItemWithIcon.js +45 -69
- package/lib/ListItem/ListItemWithRadio.js +41 -65
- package/lib/ListItem/index.js +0 -7
- package/lib/ListItem/props/propTypes.js +4 -6
- package/lib/Modal/Modal.js +11 -46
- package/lib/Modal/props/propTypes.js +0 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +167 -295
- package/lib/MultiSelect/AdvancedMultiSelect.js +125 -203
- package/lib/MultiSelect/EmptyState.js +25 -46
- package/lib/MultiSelect/MultiSelect.js +206 -324
- package/lib/MultiSelect/MultiSelectHeader.js +9 -31
- package/lib/MultiSelect/MultiSelectWithAvatar.js +64 -106
- package/lib/MultiSelect/SelectedOptions.js +18 -44
- package/lib/MultiSelect/Suggestions.js +33 -65
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +75 -86
- package/lib/MultiSelect/index.js +0 -5
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +0 -5
- package/lib/PopOver/PopOver.js +49 -95
- package/lib/PopOver/__tests__/PopOver.spec.js +1 -4
- package/lib/PopOver/index.js +0 -4
- package/lib/PopOver/props/propTypes.js +0 -3
- package/lib/Popup/Popup.js +82 -159
- package/lib/Popup/__tests__/Popup.spec.js +9 -44
- 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 +39 -62
- package/lib/Radio/__tests__/Radiospec.js +5 -9
- package/lib/Radio/props/propTypes.js +0 -3
- package/lib/Responsive/CustomResponsive.js +28 -73
- package/lib/Responsive/RefWrapper.js +11 -17
- package/lib/Responsive/ResizeComponent.js +39 -63
- package/lib/Responsive/ResizeObserver.js +10 -24
- package/lib/Responsive/Responsive.js +31 -81
- 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/props/propTypes.js +0 -3
- package/lib/Ribbon/Ribbon.js +14 -34
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -22
- package/lib/Ribbon/props/propTypes.js +0 -3
- package/lib/RippleEffect/RippleEffect.js +10 -18
- package/lib/RippleEffect/props/propTypes.js +0 -3
- package/lib/Select/GroupSelect.js +131 -230
- package/lib/Select/Select.js +209 -291
- package/lib/Select/SelectWithAvatar.js +57 -103
- package/lib/Select/SelectWithIcon.js +77 -133
- package/lib/Select/__tests__/Select.spec.js +92 -134
- package/lib/Select/index.js +0 -5
- package/lib/Select/props/defaultProps.js +4 -5
- package/lib/Select/props/propTypes.js +0 -4
- package/lib/Stencils/Stencils.js +11 -30
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -12
- package/lib/Stencils/props/propTypes.js +0 -3
- package/lib/Switch/Switch.js +34 -57
- package/lib/Switch/props/propTypes.js +0 -3
- package/lib/Tab/Tab.js +28 -41
- package/lib/Tab/TabContent.js +5 -12
- package/lib/Tab/TabContentWrapper.js +6 -13
- package/lib/Tab/TabWrapper.js +19 -37
- package/lib/Tab/Tabs.js +98 -172
- package/lib/Tab/__tests__/Tab.spec.js +58 -67
- 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/index.js +0 -6
- package/lib/Tab/props/propTypes.js +0 -3
- package/lib/Tag/Tag.js +43 -72
- package/lib/Tag/__tests__/Tag.spec.js +8 -14
- package/lib/Tag/props/propTypes.js +0 -3
- package/lib/TextBox/TextBox.js +60 -86
- package/lib/TextBox/TextBox.module.css +8 -5
- package/lib/TextBox/__tests__/TextBox.spec.js +4 -14
- package/lib/TextBox/props/propTypes.js +4 -6
- package/lib/TextBoxIcon/TextBoxIcon.js +52 -79
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +4 -14
- package/lib/TextBoxIcon/props/propTypes.js +0 -3
- package/lib/Textarea/Textarea.js +30 -55
- package/lib/Textarea/Textarea.module.css +3 -4
- package/lib/Textarea/__tests__/Textarea.spec.js +2 -14
- package/lib/Textarea/props/propTypes.js +0 -3
- package/lib/Tooltip/Tooltip.js +31 -94
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -24
- 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/css.js +0 -40
- package/lib/deprecated/PortalLayer/PortalLayer.js +24 -47
- package/lib/deprecated/PortalLayer/props/propTypes.js +0 -3
- package/lib/index.js +0 -57
- package/lib/semantic/Button/Button.js +22 -42
- package/lib/semantic/Button/props/propTypes.js +0 -3
- package/lib/semantic/index.js +0 -2
- package/lib/utils/Common.js +18 -108
- 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 +4 -13
- package/lib/utils/css/compileClassNames.js +0 -6
- package/lib/utils/css/mergeStyle.js +7 -10
- package/lib/utils/css/utils.js +0 -8
- package/lib/utils/datetime/common.js +7 -52
- package/lib/utils/debounce.js +1 -6
- package/lib/utils/dropDownUtils.js +60 -176
- 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 -4
- package/lib/utils/scrollTo.js +0 -2
- package/lib/utils/shallowEqual.js +0 -8
- package/package.json +2 -2
- package/es/utils/datetime/GMTZones.js +0 -48
- package/lib/utils/datetime/GMTZones.js +0 -55
|
@@ -1,117 +1,68 @@
|
|
|
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.AdvancedMultiSelectComponent = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("./props/propTypes");
|
|
13
|
-
|
|
14
10
|
var _defaultProps = require("./props/defaultProps");
|
|
15
|
-
|
|
16
11
|
var _MultiSelect = require("./MultiSelect");
|
|
17
|
-
|
|
18
12
|
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
19
|
-
|
|
20
13
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
21
|
-
|
|
22
14
|
var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
23
|
-
|
|
24
15
|
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
25
|
-
|
|
26
16
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
27
|
-
|
|
28
17
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
29
|
-
|
|
30
18
|
var _Layout = require("../Layout");
|
|
31
|
-
|
|
32
19
|
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
33
|
-
|
|
34
20
|
var _icons = require("@zohodesk/icons");
|
|
35
|
-
|
|
36
21
|
var _IdProvider = require("../Provider/IdProvider");
|
|
37
|
-
|
|
38
22
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
39
|
-
|
|
40
23
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
41
|
-
|
|
42
24
|
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
43
|
-
|
|
44
25
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
45
|
-
|
|
46
26
|
var _Common = require("../utils/Common.js");
|
|
47
|
-
|
|
48
27
|
var _dropDownUtils = require("../utils/dropDownUtils");
|
|
49
|
-
|
|
50
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
-
|
|
52
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
-
|
|
54
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
55
|
-
|
|
56
31
|
function _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); }
|
|
57
|
-
|
|
58
32
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
59
|
-
|
|
60
33
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
61
|
-
|
|
62
34
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
63
|
-
|
|
64
35
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
65
|
-
|
|
66
36
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
67
|
-
|
|
68
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
69
|
-
|
|
37
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
70
38
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
71
|
-
|
|
72
|
-
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); } }
|
|
73
|
-
|
|
39
|
+
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); } }
|
|
74
40
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
75
|
-
|
|
41
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
42
|
+
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); }
|
|
76
43
|
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); }
|
|
77
|
-
|
|
78
44
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
79
|
-
|
|
80
45
|
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); }; }
|
|
81
|
-
|
|
82
46
|
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); }
|
|
83
|
-
|
|
84
47
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
85
|
-
|
|
86
48
|
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; } }
|
|
87
|
-
|
|
88
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
89
|
-
|
|
49
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**** Libraries ****/ /**** Components ****/ /**** CSS ****/ /**** Methods ****/
|
|
90
50
|
/* eslint-disable react/sort-prop-types */
|
|
91
|
-
|
|
92
51
|
/* eslint-disable react/no-unused-prop-types */
|
|
93
|
-
|
|
94
52
|
/* eslint-disable react/forbid-component-props */
|
|
95
53
|
var dummyArray = [];
|
|
96
|
-
|
|
97
54
|
var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent) {
|
|
98
55
|
_inherits(AdvancedMultiSelectComponent, _MultiSelectComponent);
|
|
99
|
-
|
|
100
56
|
var _super = _createSuper(AdvancedMultiSelectComponent);
|
|
101
|
-
|
|
102
57
|
function AdvancedMultiSelectComponent(props) {
|
|
103
58
|
var _this;
|
|
104
|
-
|
|
105
59
|
_classCallCheck(this, AdvancedMultiSelectComponent);
|
|
106
|
-
|
|
107
60
|
_this = _super.call(this, props);
|
|
108
|
-
|
|
109
61
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
110
|
-
|
|
111
|
-
|
|
62
|
+
oldState = _assertThisInitialize.state;
|
|
112
63
|
var _this$props = _this.props,
|
|
113
|
-
|
|
114
|
-
|
|
64
|
+
selectedOptionsLimit = _this$props.selectedOptionsLimit,
|
|
65
|
+
selectedOptions = _this$props.selectedOptions;
|
|
115
66
|
var selectedOptionsLen = selectedOptions.length;
|
|
116
67
|
_this.state = Object.assign({}, oldState, {
|
|
117
68
|
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
@@ -127,25 +78,22 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
127
78
|
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
128
79
|
return _this;
|
|
129
80
|
}
|
|
130
|
-
|
|
131
81
|
_createClass(AdvancedMultiSelectComponent, [{
|
|
132
82
|
key: "handleFilterSuggestions",
|
|
133
83
|
value: function handleFilterSuggestions() {
|
|
134
84
|
var _this$state = this.state,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
85
|
+
_this$state$options = _this$state.options,
|
|
86
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options,
|
|
87
|
+
searchStr = _this$state.searchStr;
|
|
138
88
|
var needLocalSearch = this.props.needLocalSearch;
|
|
139
|
-
|
|
140
89
|
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
90
|
+
options: options,
|
|
91
|
+
selectedOptions: dummyArray,
|
|
92
|
+
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
93
|
+
needSearch: needLocalSearch
|
|
94
|
+
}),
|
|
95
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
96
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
149
97
|
this.suggestionsOrder = suggestionIds;
|
|
150
98
|
return suggestions;
|
|
151
99
|
}
|
|
@@ -155,42 +103,35 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
155
103
|
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
156
104
|
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
157
105
|
var _this$state2 = this.state,
|
|
158
|
-
|
|
159
|
-
|
|
106
|
+
optionsNormalize = _this$state2.optionsNormalize,
|
|
107
|
+
searchStr = _this$state2.searchStr;
|
|
160
108
|
var _this$props2 = this.props,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
109
|
+
onChange = _this$props2.onChange,
|
|
110
|
+
_this$props2$needToCl = _this$props2.needToCloseOnSelect,
|
|
111
|
+
needToCloseOnSelect = _this$props2$needToCl === void 0 ? false : _this$props2$needToCl,
|
|
112
|
+
togglePopup = _this$props2.togglePopup,
|
|
113
|
+
isSearchClearOnSelect = _this$props2.isSearchClearOnSelect,
|
|
114
|
+
propSelectedOptions = _this$props2.selectedOptions,
|
|
115
|
+
disabledOptions = _this$props2.disabledOptions;
|
|
169
116
|
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
117
|
+
selectedOptions: selectedOptions,
|
|
118
|
+
propSelectedOptions: propSelectedOptions,
|
|
119
|
+
disabledOptions: disabledOptions
|
|
120
|
+
}),
|
|
121
|
+
newSelectedOptions = _filterSelectedOption.newSelectedOptions;
|
|
176
122
|
var selectedOptionsLen = newSelectedOptions.length;
|
|
177
123
|
var allSelectedOptionsDetails = [];
|
|
178
|
-
|
|
179
124
|
for (var i = 0; i < selectedOptionsLen; i++) {
|
|
180
125
|
var id = newSelectedOptions[i];
|
|
181
126
|
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
182
127
|
}
|
|
183
|
-
|
|
184
128
|
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails);
|
|
185
|
-
|
|
186
129
|
if (searchStr.trim() !== '' && isSearchClearOnSelect) {
|
|
187
130
|
this.handleSearch('');
|
|
188
131
|
}
|
|
189
|
-
|
|
190
132
|
this.searchInput && this.searchInput.focus({
|
|
191
133
|
preventScroll: true
|
|
192
134
|
});
|
|
193
|
-
|
|
194
135
|
if (needToCloseOnSelect) {
|
|
195
136
|
e && togglePopup(e);
|
|
196
137
|
}
|
|
@@ -199,7 +140,6 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
199
140
|
key: "handleSelectOption",
|
|
200
141
|
value: function handleSelectOption(option, value, index, e) {
|
|
201
142
|
var selectedOptions = this.props.selectedOptions;
|
|
202
|
-
|
|
203
143
|
if (selectedOptions.indexOf(option) >= 0) {
|
|
204
144
|
//toggle select option
|
|
205
145
|
this.handleRemoveOption(option);
|
|
@@ -211,14 +151,14 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
211
151
|
key: "handleFormatOptions",
|
|
212
152
|
value: function handleFormatOptions(props) {
|
|
213
153
|
var options = props.options,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
154
|
+
valueField = props.valueField,
|
|
155
|
+
textField = props.textField,
|
|
156
|
+
imageField = props.imageField,
|
|
157
|
+
iconName = props.iconName,
|
|
158
|
+
iconSize = props.iconSize,
|
|
159
|
+
prefixText = props.prefixText,
|
|
160
|
+
optionType = props.optionType,
|
|
161
|
+
disabledOptions = props.disabledOptions;
|
|
222
162
|
return this.formatOptions({
|
|
223
163
|
options: options,
|
|
224
164
|
valueField: valueField,
|
|
@@ -236,15 +176,12 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
236
176
|
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, props) {
|
|
237
177
|
//handle selectedoptions length
|
|
238
178
|
var _ref = this.state || {},
|
|
239
|
-
|
|
240
|
-
|
|
179
|
+
showedSelectedOptionsCount = _ref.showedSelectedOptionsCount;
|
|
241
180
|
var selectedOptionsLimit = props.selectedOptionsLimit,
|
|
242
|
-
|
|
181
|
+
selectedOptionDetails = props.selectedOptionDetails;
|
|
243
182
|
showedSelectedOptionsCount = (0, _Common.getIsEmptyValue)(showedSelectedOptionsCount) ? selectedOptionsLimit : showedSelectedOptionsCount;
|
|
244
|
-
|
|
245
183
|
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, props),
|
|
246
|
-
|
|
247
|
-
|
|
184
|
+
normalizedSelectedOptions = _this$handleFormatSel.normalizedFormatOptions;
|
|
248
185
|
var formatOptions = this.objectConcat({
|
|
249
186
|
obj1: normalizedFormatOptions,
|
|
250
187
|
obj2: normalizedSelectedOptions
|
|
@@ -259,12 +196,12 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
259
196
|
key: "handleFormatSelectedOptions",
|
|
260
197
|
value: function handleFormatSelectedOptions(selectedOptionDetails, props) {
|
|
261
198
|
var valueField = props.valueField,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
199
|
+
textField = props.textField,
|
|
200
|
+
imageField = props.imageField,
|
|
201
|
+
optionType = props.optionType,
|
|
202
|
+
iconName = props.iconName,
|
|
203
|
+
iconSize = props.iconSize,
|
|
204
|
+
disabledOptions = props.disabledOptions;
|
|
268
205
|
return this.formatSelectedOptions({
|
|
269
206
|
options: selectedOptionDetails,
|
|
270
207
|
valueField: valueField,
|
|
@@ -280,19 +217,17 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
280
217
|
key: "handleComponentDidUpdate",
|
|
281
218
|
value: function handleComponentDidUpdate(prevProps, prevState) {
|
|
282
219
|
var _this2 = this;
|
|
283
|
-
|
|
284
220
|
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
285
221
|
var _this$props3 = this.props,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
222
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
223
|
+
selectedOptionsLimit = _this$props3.selectedOptionsLimit,
|
|
224
|
+
id = _this$props3.id,
|
|
225
|
+
selectedOptionDetails = _this$props3.selectedOptionDetails;
|
|
290
226
|
var oldSelectedOptions = prevProps.selectedOptions,
|
|
291
|
-
|
|
227
|
+
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
292
228
|
var oldCount = this.state.showedSelectedOptionsCount;
|
|
293
229
|
var selectedOptionsLen = selectedOptions.length;
|
|
294
230
|
var oldSelectedOptionsLen = oldSelectedOptions.length;
|
|
295
|
-
|
|
296
231
|
if (id !== prevProps.id || selectedOptionsLimit !== oldSelectedOptionsLimit) {
|
|
297
232
|
//handle component update case (New set of options or new selectedOptionsLimit update)
|
|
298
233
|
this.setState({
|
|
@@ -300,26 +235,21 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
300
235
|
});
|
|
301
236
|
return;
|
|
302
237
|
}
|
|
303
|
-
|
|
304
238
|
if (oldCount !== prevState.showedSelectedOptionsCount || selectedOptionDetails !== prevProps.selectedOptionDetails) {
|
|
305
239
|
//When showedSelectedOptionsCount update, setState the updated selected option details
|
|
306
240
|
var _this$handleFormatOpt = this.handleFormatOptions(this.props),
|
|
307
|
-
|
|
308
|
-
|
|
241
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
309
242
|
var optionsDetails = Object.assign({}, oldAllSelectedOptionsDetails, normalizedFormatOptions);
|
|
310
|
-
|
|
311
243
|
var _this$handleGetSelect = this.handleGetSelectedOptions(selectedOptions, optionsDetails, this.props),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
244
|
+
formatSelectedOptions = _this$handleGetSelect.formatSelectedOptions,
|
|
245
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions,
|
|
246
|
+
selectedOptionIds = _this$handleGetSelect.selectedOptionIds;
|
|
316
247
|
this.allSelectedOptionsDetails = Object.assign(oldAllSelectedOptionsDetails, normalizedSelectedOptions);
|
|
317
248
|
this.setState({
|
|
318
249
|
selectedOptions: formatSelectedOptions,
|
|
319
250
|
selectedOptionIds: selectedOptionIds
|
|
320
251
|
});
|
|
321
252
|
}
|
|
322
|
-
|
|
323
253
|
if ((0, _Common.getIsEmptyValue)(oldCount) || oldSelectedOptionsLen <= oldCount) {
|
|
324
254
|
//handle not more options case
|
|
325
255
|
if (selectedOptionsLen > oldCount) {
|
|
@@ -341,7 +271,6 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
341
271
|
showedSelectedOptionsCount: newCount
|
|
342
272
|
}, function () {
|
|
343
273
|
var showedSelectedOptionsCount = _this2.state.showedSelectedOptionsCount;
|
|
344
|
-
|
|
345
274
|
if (showedSelectedOptionsCount === 0) {
|
|
346
275
|
_this2.handleMoreClick();
|
|
347
276
|
}
|
|
@@ -352,30 +281,27 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
352
281
|
key: "handleMoreClick",
|
|
353
282
|
value: function handleMoreClick(e) {
|
|
354
283
|
var _this3 = this;
|
|
355
|
-
|
|
356
284
|
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
357
285
|
var _this$props4 = this.props,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
286
|
+
selectedOptionsLimit = _this$props4.selectedOptionsLimit,
|
|
287
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
288
|
+
getSelectedOptionDetails = _this$props4.getSelectedOptionDetails,
|
|
289
|
+
removeClose = _this$props4.removeClose;
|
|
362
290
|
removeClose(e);
|
|
363
291
|
var selectedOptionsLen = selectedOptions.length;
|
|
364
|
-
|
|
365
292
|
if (showedSelectedOptionsCount < selectedOptionsLen) {
|
|
366
293
|
var newCount = showedSelectedOptionsCount + selectedOptionsLimit;
|
|
367
294
|
var newSelectedOptionIds = selectedOptions.slice(showedSelectedOptionsCount, newCount);
|
|
368
|
-
|
|
369
295
|
try {
|
|
370
296
|
getSelectedOptionDetails(newSelectedOptionIds).then(function () {
|
|
371
297
|
_this3.setState({
|
|
372
298
|
showedSelectedOptionsCount: showedSelectedOptionsCount + newSelectedOptionIds.length
|
|
373
299
|
});
|
|
374
300
|
});
|
|
375
|
-
} catch (e) {
|
|
301
|
+
} catch (e) {
|
|
302
|
+
//console.error('getSelectedOptionDetails is not a promise function.');
|
|
376
303
|
}
|
|
377
304
|
}
|
|
378
|
-
|
|
379
305
|
this.searchInput && this.searchInput.focus({
|
|
380
306
|
preventScroll: true
|
|
381
307
|
});
|
|
@@ -394,83 +320,80 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
394
320
|
key: "render",
|
|
395
321
|
value: function render() {
|
|
396
322
|
var _this4 = this;
|
|
397
|
-
|
|
398
323
|
var _this$props5 = this.props,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
324
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
325
|
+
needSelectAll = _this$props5.needSelectAll,
|
|
326
|
+
searchEmptyMessage = _this$props5.searchEmptyMessage,
|
|
327
|
+
emptyMessage = _this$props5.emptyMessage,
|
|
328
|
+
noMoreOptionsMessage = _this$props5.noMoreOptionsMessage,
|
|
329
|
+
dropBoxSize = _this$props5.dropBoxSize,
|
|
330
|
+
placeHolder = _this$props5.placeHolder,
|
|
331
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
332
|
+
isPopupReady = _this$props5.isPopupReady,
|
|
333
|
+
position = _this$props5.position,
|
|
334
|
+
defaultDropBoxPosition = _this$props5.defaultDropBoxPosition,
|
|
335
|
+
selectAllText = _this$props5.selectAllText,
|
|
336
|
+
getContainerRef = _this$props5.getContainerRef,
|
|
337
|
+
removeClose = _this$props5.removeClose,
|
|
338
|
+
isAnimate = _this$props5.isAnimate,
|
|
339
|
+
animationStyle = _this$props5.animationStyle,
|
|
340
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
341
|
+
variant = _this$props5.variant,
|
|
342
|
+
size = _this$props5.size,
|
|
343
|
+
isDisabled = _this$props5.isDisabled,
|
|
344
|
+
title = _this$props5.title,
|
|
345
|
+
dataIdMultiSelectComp = _this$props5.dataIdMultiSelectComp,
|
|
346
|
+
dataIdClearIcon = _this$props5.dataIdClearIcon,
|
|
347
|
+
dataIdSelectAllEle = _this$props5.dataIdSelectAllEle,
|
|
348
|
+
dataIdLoading = _this$props5.dataIdLoading,
|
|
349
|
+
_this$props5$selected = _this$props5.selectedOptions,
|
|
350
|
+
allselectedOptionIds = _this$props5$selected === void 0 ? [] : _this$props5$selected,
|
|
351
|
+
listItemSize = _this$props5.listItemSize,
|
|
352
|
+
needBorder = _this$props5.needBorder,
|
|
353
|
+
i18nKeys = _this$props5.i18nKeys,
|
|
354
|
+
htmlId = _this$props5.htmlId,
|
|
355
|
+
a11y = _this$props5.a11y,
|
|
356
|
+
borderColor = _this$props5.borderColor,
|
|
357
|
+
isBoxPaddingNeed = _this$props5.isBoxPaddingNeed,
|
|
358
|
+
getFooter = _this$props5.getFooter,
|
|
359
|
+
customProps = _this$props5.customProps,
|
|
360
|
+
needEffect = _this$props5.needEffect,
|
|
361
|
+
disabledOptions = _this$props5.disabledOptions,
|
|
362
|
+
isLoading = _this$props5.isLoading,
|
|
363
|
+
dataSelectorId = _this$props5.dataSelectorId;
|
|
439
364
|
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
365
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
366
|
+
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
367
|
+
DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP;
|
|
443
368
|
var _i18nKeys = i18nKeys,
|
|
444
|
-
|
|
445
|
-
|
|
369
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
370
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
446
371
|
var _a11y$clearLabel = a11y.clearLabel,
|
|
447
|
-
|
|
372
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
448
373
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
449
374
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
450
375
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage,
|
|
451
376
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
452
377
|
});
|
|
453
378
|
var _this$state3 = this.state,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
379
|
+
selectedOptions = _this$state3.selectedOptions,
|
|
380
|
+
searchStr = _this$state3.searchStr,
|
|
381
|
+
hoverOption = _this$state3.hoverOption,
|
|
382
|
+
highLightedSelectOptions = _this$state3.highLightedSelectOptions,
|
|
383
|
+
isFetchingOptions = _this$state3.isFetchingOptions,
|
|
384
|
+
isActive = _this$state3.isActive,
|
|
385
|
+
showedSelectedOptionsCount = _this$state3.showedSelectedOptionsCount,
|
|
386
|
+
options = _this$state3.options;
|
|
462
387
|
var suggestions = this.handleFilterSuggestions();
|
|
463
388
|
var allselectedOptionIdsLen = allselectedOptionIds.length;
|
|
464
389
|
var moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
|
|
465
390
|
var setAriaId = this.getNextAriaId();
|
|
466
391
|
var ariaErrorId = this.getNextAriaId();
|
|
467
|
-
|
|
468
392
|
var _this$getIsShowClearI = this.getIsShowClearIcon({
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
393
|
+
selectedOptions: selectedOptions,
|
|
394
|
+
disabledOptions: disabledOptions
|
|
395
|
+
}),
|
|
396
|
+
isShowClear = _this$getIsShowClearI.isShowClearIcon;
|
|
474
397
|
var isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
475
398
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
476
399
|
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
@@ -611,16 +534,16 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
611
534
|
}) : null);
|
|
612
535
|
}
|
|
613
536
|
}]);
|
|
614
|
-
|
|
615
537
|
return AdvancedMultiSelectComponent;
|
|
616
538
|
}(_MultiSelect.MultiSelectComponent);
|
|
617
|
-
|
|
618
539
|
exports.AdvancedMultiSelectComponent = AdvancedMultiSelectComponent;
|
|
619
540
|
AdvancedMultiSelectComponent.propTypes = _propTypes.AdvancedMultiSelect_propTypes;
|
|
620
541
|
AdvancedMultiSelectComponent.defaultProps = _defaultProps.AdvancedMultiSelect_defaultProps;
|
|
621
542
|
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
622
543
|
var AdvancedMultiSelect = (0, _Popup["default"])(AdvancedMultiSelectComponent);
|
|
623
|
-
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
544
|
+
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
545
|
+
|
|
546
|
+
// if (__DOCS__) {
|
|
624
547
|
// AdvancedMultiSelectComponent.docs = {
|
|
625
548
|
// componentGroup: 'Form Elements',
|
|
626
549
|
// folderName: 'Style Guide'
|
|
@@ -628,6 +551,5 @@ AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps; //
|
|
|
628
551
|
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
629
552
|
// AdvancedMultiSelect.propTypes = AdvancedMultiSelectComponent.propTypes;
|
|
630
553
|
// }
|
|
631
|
-
|
|
632
554
|
var _default = AdvancedMultiSelect;
|
|
633
555
|
exports["default"] = _default;
|