@zohodesk/components 1.2.3 → 1.2.5
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/.cli/PropLessFiles.html +1 -1
- package/.cli/PropValidationExcludeFilesArray.js +10 -2
- package/.cli/propValidation_report.html +1 -1
- package/README.md +8 -0
- package/coverage/Button/Button.js.html +1 -1
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +1 -1
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/index.js +2 -1
- package/es/v1/Accordion/Accordion.js +65 -0
- package/es/v1/Accordion/AccordionItem.js +57 -0
- package/es/v1/Accordion/index.js +2 -0
- package/es/v1/Animation/Animation.js +127 -0
- package/es/v1/AppContainer/AppContainer.js +134 -0
- package/es/v1/Avatar/Avatar.js +189 -0
- package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
- package/es/v1/Button/Button.js +68 -0
- package/es/v1/Buttongroup/Buttongroup.js +31 -0
- package/es/v1/Card/Card.js +271 -0
- package/es/v1/CheckBox/CheckBox.js +155 -0
- package/es/v1/DateTime/CalendarView.js +218 -0
- package/es/v1/DateTime/DateTime.js +783 -0
- package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
- package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
- package/es/v1/DateTime/DateWidget.js +1098 -0
- package/es/v1/DateTime/DaysRow.js +31 -0
- package/es/v1/DateTime/Time.js +166 -0
- package/es/v1/DateTime/YearView.js +264 -0
- package/es/v1/DateTime/index.js +1 -0
- package/es/v1/DropBox/DropBox.js +91 -0
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/v1/DropDown/DropDown.js +73 -0
- package/es/v1/DropDown/DropDownHeading.js +44 -0
- package/es/v1/DropDown/DropDownItem.js +76 -0
- package/es/v1/DropDown/DropDownSearch.js +63 -0
- package/es/v1/DropDown/DropDownSeparator.js +15 -0
- package/es/v1/Heading/Heading.js +32 -0
- package/es/v1/Label/Label.js +40 -0
- package/es/v1/Layout/Box.js +115 -0
- package/es/v1/Layout/Container.js +132 -0
- package/es/v1/Layout/index.js +2 -0
- package/es/v1/ListItem/ListContainer.js +102 -0
- package/es/v1/ListItem/ListItem.js +124 -0
- package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
- package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
- package/es/v1/ListItem/ListItemWithIcon.js +127 -0
- package/es/v1/ListItem/ListItemWithRadio.js +105 -0
- package/es/v1/ListItem/index.js +6 -0
- package/es/v1/Modal/Modal.js +154 -0
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
- package/es/v1/MultiSelect/EmptyState.js +64 -0
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/v1/MultiSelect/MultiSelect.js +1120 -0
- package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
- package/es/v1/MultiSelect/SelectedOptions.js +82 -0
- package/es/v1/MultiSelect/Suggestions.js +142 -0
- package/es/v1/MultiSelect/index.js +4 -0
- package/es/v1/PopOver/PopOver.js +211 -0
- package/es/v1/Popup/Popup.js +645 -0
- package/es/v1/Radio/Radio.js +115 -0
- package/es/v1/Responsive/CustomResponsive.js +195 -0
- package/es/v1/Responsive/RefWrapper.js +39 -0
- package/es/v1/Responsive/ResizeComponent.js +197 -0
- package/es/v1/Responsive/ResizeObserver.js +140 -0
- package/es/v1/Responsive/Responsive.js +194 -0
- package/es/v1/Responsive/index.js +9 -0
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
- package/es/v1/Ribbon/Ribbon.js +33 -0
- package/es/v1/RippleEffect/RippleEffect.js +24 -0
- package/es/v1/Select/GroupSelect.js +803 -0
- package/es/v1/Select/Select.js +969 -0
- package/es/v1/Select/SelectWithAvatar.js +344 -0
- package/es/v1/Select/SelectWithIcon.js +535 -0
- package/es/v1/Select/index.js +4 -0
- package/es/v1/Stencils/Stencils.js +26 -0
- package/es/v1/Switch/Switch.js +94 -0
- package/es/v1/Tab/Tab.js +108 -0
- package/es/v1/Tab/TabContent.js +30 -0
- package/es/v1/Tab/TabContentWrapper.js +29 -0
- package/es/v1/Tab/TabWrapper.js +57 -0
- package/es/v1/Tab/Tabs.js +612 -0
- package/es/v1/Tab/index.js +5 -0
- package/es/v1/Tag/Tag.js +134 -0
- package/es/v1/TextBox/TextBox.js +154 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
- package/es/v1/Textarea/Textarea.js +102 -0
- package/es/v1/Tooltip/Tooltip.js +518 -0
- package/es/v1/Typography/Typography.js +38 -0
- package/es/v1/Typography/css/Typography.module.css +376 -0
- package/es/v1/Typography/css/cssJSLogic.js +46 -0
- package/es/v1/Typography/css/letterSpacingMap.js +12 -0
- package/es/v1/Typography/props/defaultProps.js +8 -0
- package/es/v1/Typography/props/propTypes.js +24 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
- package/es/v1/semantic/Button/Button.js +53 -0
- package/es/v1/semantic/index.js +1 -0
- package/lib/index.js +10 -1
- package/lib/v1/Accordion/Accordion.js +96 -0
- package/lib/v1/Accordion/AccordionItem.js +68 -0
- package/lib/v1/Accordion/index.js +23 -0
- package/lib/v1/Animation/Animation.js +143 -0
- package/lib/v1/AppContainer/AppContainer.js +204 -0
- package/lib/v1/Avatar/Avatar.js +246 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
- package/lib/v1/Button/Button.js +82 -0
- package/lib/v1/Buttongroup/Buttongroup.js +44 -0
- package/lib/v1/Card/Card.js +365 -0
- package/lib/v1/CheckBox/CheckBox.js +166 -0
- package/lib/v1/DateTime/CalendarView.js +285 -0
- package/lib/v1/DateTime/DateTime.js +872 -0
- package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
- package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
- package/lib/v1/DateTime/DateWidget.js +1125 -0
- package/lib/v1/DateTime/DaysRow.js +80 -0
- package/lib/v1/DateTime/Time.js +254 -0
- package/lib/v1/DateTime/YearView.js +325 -0
- package/lib/v1/DateTime/index.js +15 -0
- package/lib/v1/DropBox/DropBox.js +119 -0
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/v1/DropDown/DropDown.js +170 -0
- package/lib/v1/DropDown/DropDownHeading.js +93 -0
- package/lib/v1/DropDown/DropDownItem.js +127 -0
- package/lib/v1/DropDown/DropDownSearch.js +113 -0
- package/lib/v1/DropDown/DropDownSeparator.js +64 -0
- package/lib/v1/Heading/Heading.js +49 -0
- package/lib/v1/Label/Label.js +51 -0
- package/lib/v1/Layout/Box.js +128 -0
- package/lib/v1/Layout/Container.js +145 -0
- package/lib/v1/Layout/index.js +23 -0
- package/lib/v1/ListItem/ListContainer.js +120 -0
- package/lib/v1/ListItem/ListItem.js +138 -0
- package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
- package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
- package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
- package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
- package/lib/v1/ListItem/index.js +55 -0
- package/lib/v1/Modal/Modal.js +212 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
- package/lib/v1/MultiSelect/EmptyState.js +112 -0
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
- package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
- package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
- package/lib/v1/MultiSelect/Suggestions.js +195 -0
- package/lib/v1/MultiSelect/index.js +39 -0
- package/lib/v1/PopOver/PopOver.js +293 -0
- package/lib/v1/Popup/Popup.js +715 -0
- package/lib/v1/Radio/Radio.js +126 -0
- package/lib/v1/Responsive/CustomResponsive.js +242 -0
- package/lib/v1/Responsive/RefWrapper.js +57 -0
- package/lib/v1/Responsive/ResizeComponent.js +268 -0
- package/lib/v1/Responsive/ResizeObserver.js +168 -0
- package/lib/v1/Responsive/Responsive.js +274 -0
- package/lib/v1/Responsive/index.js +55 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
- package/lib/v1/Ribbon/Ribbon.js +44 -0
- package/lib/v1/RippleEffect/RippleEffect.js +39 -0
- package/lib/v1/Select/GroupSelect.js +877 -0
- package/lib/v1/Select/Select.js +1013 -0
- package/lib/v1/Select/SelectWithAvatar.js +394 -0
- package/lib/v1/Select/SelectWithIcon.js +597 -0
- package/lib/v1/Select/index.js +39 -0
- package/lib/v1/Stencils/Stencils.js +43 -0
- package/lib/v1/Switch/Switch.js +108 -0
- package/lib/v1/Tab/Tab.js +132 -0
- package/lib/v1/Tab/TabContent.js +42 -0
- package/lib/v1/Tab/TabContentWrapper.js +42 -0
- package/lib/v1/Tab/TabWrapper.js +89 -0
- package/lib/v1/Tab/Tabs.js +680 -0
- package/lib/v1/Tab/index.js +47 -0
- package/lib/v1/Tag/Tag.js +154 -0
- package/lib/v1/TextBox/TextBox.js +168 -0
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
- package/lib/v1/Textarea/Textarea.js +118 -0
- package/lib/v1/Tooltip/Tooltip.js +586 -0
- package/lib/v1/Typography/Typography.js +56 -0
- package/lib/v1/Typography/css/Typography.module.css +376 -0
- package/lib/v1/Typography/css/cssJSLogic.js +41 -0
- package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
- package/lib/v1/Typography/props/defaultProps.js +15 -0
- package/lib/v1/Typography/props/propTypes.js +35 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
- package/lib/v1/semantic/Button/Button.js +63 -0
- package/lib/v1/semantic/index.js +15 -0
- package/package.json +4 -4
- package/result.json +1 -1
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.AdvancedMultiSelectComponent = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = require("../../MultiSelect/props/propTypes");
|
|
13
|
+
|
|
14
|
+
var _defaultProps = require("../../MultiSelect/props/defaultProps");
|
|
15
|
+
|
|
16
|
+
var _MultiSelect = require("./MultiSelect");
|
|
17
|
+
|
|
18
|
+
var _SelectedOptions = _interopRequireDefault(require("./SelectedOptions"));
|
|
19
|
+
|
|
20
|
+
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
21
|
+
|
|
22
|
+
var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
23
|
+
|
|
24
|
+
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
25
|
+
|
|
26
|
+
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
27
|
+
|
|
28
|
+
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
29
|
+
|
|
30
|
+
var _Layout = require("../Layout");
|
|
31
|
+
|
|
32
|
+
var _Card = _interopRequireWildcard(require("../Card/Card"));
|
|
33
|
+
|
|
34
|
+
var _icons = require("@zohodesk/icons");
|
|
35
|
+
|
|
36
|
+
var _IdProvider = require("../../Provider/IdProvider");
|
|
37
|
+
|
|
38
|
+
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
39
|
+
|
|
40
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
41
|
+
|
|
42
|
+
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
43
|
+
|
|
44
|
+
var _MultiSelectModule = _interopRequireDefault(require("../../MultiSelect/MultiSelect.module.css"));
|
|
45
|
+
|
|
46
|
+
var _Common = require("../../utils/Common.js");
|
|
47
|
+
|
|
48
|
+
var _dropDownUtils = require("../../utils/dropDownUtils");
|
|
49
|
+
|
|
50
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
+
|
|
52
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
+
|
|
54
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
55
|
+
|
|
56
|
+
function _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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
59
|
+
|
|
60
|
+
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
|
+
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
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
65
|
+
|
|
66
|
+
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
|
+
|
|
70
|
+
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
|
+
|
|
74
|
+
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
|
+
|
|
76
|
+
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
|
+
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
|
+
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
|
+
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
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
85
|
+
|
|
86
|
+
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
|
+
|
|
90
|
+
/* eslint-disable react/sort-prop-types */
|
|
91
|
+
|
|
92
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
93
|
+
|
|
94
|
+
/* eslint-disable react/forbid-component-props */
|
|
95
|
+
var dummyArray = [];
|
|
96
|
+
|
|
97
|
+
var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent) {
|
|
98
|
+
_inherits(AdvancedMultiSelectComponent, _MultiSelectComponent);
|
|
99
|
+
|
|
100
|
+
var _super = _createSuper(AdvancedMultiSelectComponent);
|
|
101
|
+
|
|
102
|
+
function AdvancedMultiSelectComponent(props) {
|
|
103
|
+
var _this;
|
|
104
|
+
|
|
105
|
+
_classCallCheck(this, AdvancedMultiSelectComponent);
|
|
106
|
+
|
|
107
|
+
_this = _super.call(this, props);
|
|
108
|
+
|
|
109
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
110
|
+
oldState = _assertThisInitialize.state;
|
|
111
|
+
|
|
112
|
+
var _this$props = _this.props,
|
|
113
|
+
selectedOptionsLimit = _this$props.selectedOptionsLimit,
|
|
114
|
+
selectedOptions = _this$props.selectedOptions;
|
|
115
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
116
|
+
_this.state = Object.assign({}, oldState, {
|
|
117
|
+
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
118
|
+
});
|
|
119
|
+
_this.getIsShowClearIcon = (0, _dropDownUtils.makeGetIsShowClearIcon)();
|
|
120
|
+
_this.handleFilterSuggestions = _this.handleFilterSuggestions.bind(_assertThisInitialized(_this));
|
|
121
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
122
|
+
_this.handleSelectOption = _this.handleSelectOption.bind(_assertThisInitialized(_this));
|
|
123
|
+
_this.handleGetSelectedOptions = _this.handleGetSelectedOptions.bind(_assertThisInitialized(_this));
|
|
124
|
+
_this.handleFormatSelectedOptions = _this.handleFormatSelectedOptions.bind(_assertThisInitialized(_this));
|
|
125
|
+
_this.handleComponentDidUpdate = _this.handleComponentDidUpdate.bind(_assertThisInitialized(_this));
|
|
126
|
+
_this.handleMoreClick = _this.handleMoreClick.bind(_assertThisInitialized(_this));
|
|
127
|
+
_this.getNextAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
128
|
+
return _this;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_createClass(AdvancedMultiSelectComponent, [{
|
|
132
|
+
key: "handleFilterSuggestions",
|
|
133
|
+
value: function handleFilterSuggestions() {
|
|
134
|
+
var _this$state = this.state,
|
|
135
|
+
_this$state$options = _this$state.options,
|
|
136
|
+
options = _this$state$options === void 0 ? dummyArray : _this$state$options,
|
|
137
|
+
searchStr = _this$state.searchStr;
|
|
138
|
+
var needLocalSearch = this.props.needLocalSearch;
|
|
139
|
+
|
|
140
|
+
var _this$getFilterSugges = this.getFilterSuggestions({
|
|
141
|
+
options: options,
|
|
142
|
+
selectedOptions: dummyArray,
|
|
143
|
+
searchStr: (0, _Common.getSearchString)(searchStr),
|
|
144
|
+
needSearch: needLocalSearch
|
|
145
|
+
}),
|
|
146
|
+
suggestions = _this$getFilterSugges.suggestions,
|
|
147
|
+
suggestionIds = _this$getFilterSugges.suggestionIds;
|
|
148
|
+
|
|
149
|
+
this.suggestionsOrder = suggestionIds;
|
|
150
|
+
return suggestions;
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "handleChange",
|
|
154
|
+
value: function handleChange() {
|
|
155
|
+
var selectedOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
156
|
+
var e = arguments.length > 1 ? arguments[1] : undefined;
|
|
157
|
+
var _this$state2 = this.state,
|
|
158
|
+
optionsNormalize = _this$state2.optionsNormalize,
|
|
159
|
+
searchStr = _this$state2.searchStr;
|
|
160
|
+
var _this$props2 = this.props,
|
|
161
|
+
onChange = _this$props2.onChange,
|
|
162
|
+
_this$props2$needToCl = _this$props2.needToCloseOnSelect,
|
|
163
|
+
needToCloseOnSelect = _this$props2$needToCl === void 0 ? false : _this$props2$needToCl,
|
|
164
|
+
togglePopup = _this$props2.togglePopup,
|
|
165
|
+
isSearchClearOnSelect = _this$props2.isSearchClearOnSelect,
|
|
166
|
+
propSelectedOptions = _this$props2.selectedOptions,
|
|
167
|
+
disabledOptions = _this$props2.disabledOptions;
|
|
168
|
+
|
|
169
|
+
var _filterSelectedOption = (0, _dropDownUtils.filterSelectedOptions)({
|
|
170
|
+
selectedOptions: selectedOptions,
|
|
171
|
+
propSelectedOptions: propSelectedOptions,
|
|
172
|
+
disabledOptions: disabledOptions
|
|
173
|
+
}),
|
|
174
|
+
newSelectedOptions = _filterSelectedOption.newSelectedOptions;
|
|
175
|
+
|
|
176
|
+
var selectedOptionsLen = newSelectedOptions.length;
|
|
177
|
+
var allSelectedOptionsDetails = [];
|
|
178
|
+
|
|
179
|
+
for (var i = 0; i < selectedOptionsLen; i++) {
|
|
180
|
+
var id = newSelectedOptions[i];
|
|
181
|
+
allSelectedOptionsDetails.push(optionsNormalize[id]);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
onChange && onChange(newSelectedOptions, allSelectedOptionsDetails);
|
|
185
|
+
|
|
186
|
+
if (searchStr.trim() !== '' && isSearchClearOnSelect) {
|
|
187
|
+
this.handleSearch('');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
this.searchInput && this.searchInput.focus({
|
|
191
|
+
preventScroll: true
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
if (needToCloseOnSelect) {
|
|
195
|
+
e && togglePopup(e);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
key: "handleSelectOption",
|
|
200
|
+
value: function handleSelectOption(option, value, index, e) {
|
|
201
|
+
var selectedOptions = this.props.selectedOptions;
|
|
202
|
+
|
|
203
|
+
if (selectedOptions.indexOf(option) >= 0) {
|
|
204
|
+
//toggle select option
|
|
205
|
+
this.handleRemoveOption(option);
|
|
206
|
+
} else {
|
|
207
|
+
this.handleChange([].concat(_toConsumableArray(selectedOptions), [option]), e);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "handleFormatOptions",
|
|
212
|
+
value: function handleFormatOptions(props) {
|
|
213
|
+
var options = props.options,
|
|
214
|
+
valueField = props.valueField,
|
|
215
|
+
textField = props.textField,
|
|
216
|
+
imageField = props.imageField,
|
|
217
|
+
iconName = props.iconName,
|
|
218
|
+
iconSize = props.iconSize,
|
|
219
|
+
prefixText = props.prefixText,
|
|
220
|
+
optionType = props.optionType,
|
|
221
|
+
disabledOptions = props.disabledOptions;
|
|
222
|
+
return this.formatOptions({
|
|
223
|
+
options: options,
|
|
224
|
+
valueField: valueField,
|
|
225
|
+
textField: textField,
|
|
226
|
+
imageField: imageField,
|
|
227
|
+
iconName: iconName,
|
|
228
|
+
prefixText: prefixText,
|
|
229
|
+
optionType: optionType,
|
|
230
|
+
iconSize: iconSize,
|
|
231
|
+
disabledOptions: disabledOptions
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "handleGetSelectedOptions",
|
|
236
|
+
value: function handleGetSelectedOptions(selectedOptions, normalizedFormatOptions, props) {
|
|
237
|
+
//handle selectedoptions length
|
|
238
|
+
var _ref = this.state || {},
|
|
239
|
+
showedSelectedOptionsCount = _ref.showedSelectedOptionsCount;
|
|
240
|
+
|
|
241
|
+
var selectedOptionsLimit = props.selectedOptionsLimit,
|
|
242
|
+
selectedOptionDetails = props.selectedOptionDetails;
|
|
243
|
+
showedSelectedOptionsCount = (0, _Common.getIsEmptyValue)(showedSelectedOptionsCount) ? selectedOptionsLimit : showedSelectedOptionsCount;
|
|
244
|
+
|
|
245
|
+
var _this$handleFormatSel = this.handleFormatSelectedOptions(selectedOptionDetails, props),
|
|
246
|
+
normalizedSelectedOptions = _this$handleFormatSel.normalizedFormatOptions;
|
|
247
|
+
|
|
248
|
+
var formatOptions = this.objectConcat({
|
|
249
|
+
obj1: normalizedFormatOptions,
|
|
250
|
+
obj2: normalizedSelectedOptions
|
|
251
|
+
});
|
|
252
|
+
return this.getSelectedOptions({
|
|
253
|
+
selectedOptions: selectedOptions,
|
|
254
|
+
normalizedFormatOptions: formatOptions,
|
|
255
|
+
selectedOptionsLength: showedSelectedOptionsCount
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}, {
|
|
259
|
+
key: "handleFormatSelectedOptions",
|
|
260
|
+
value: function handleFormatSelectedOptions(selectedOptionDetails, props) {
|
|
261
|
+
var valueField = props.valueField,
|
|
262
|
+
textField = props.textField,
|
|
263
|
+
imageField = props.imageField,
|
|
264
|
+
optionType = props.optionType,
|
|
265
|
+
iconName = props.iconName,
|
|
266
|
+
iconSize = props.iconSize,
|
|
267
|
+
disabledOptions = props.disabledOptions;
|
|
268
|
+
return this.formatSelectedOptions({
|
|
269
|
+
options: selectedOptionDetails,
|
|
270
|
+
valueField: valueField,
|
|
271
|
+
textField: textField,
|
|
272
|
+
imageField: imageField,
|
|
273
|
+
optionType: optionType,
|
|
274
|
+
iconName: iconName,
|
|
275
|
+
iconSize: iconSize,
|
|
276
|
+
disabledOptions: disabledOptions
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "handleComponentDidUpdate",
|
|
281
|
+
value: function handleComponentDidUpdate(prevProps, prevState) {
|
|
282
|
+
var _this2 = this;
|
|
283
|
+
|
|
284
|
+
var oldAllSelectedOptionsDetails = this.allSelectedOptionsDetails;
|
|
285
|
+
var _this$props3 = this.props,
|
|
286
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
287
|
+
selectedOptionsLimit = _this$props3.selectedOptionsLimit,
|
|
288
|
+
id = _this$props3.id,
|
|
289
|
+
selectedOptionDetails = _this$props3.selectedOptionDetails;
|
|
290
|
+
var oldSelectedOptions = prevProps.selectedOptions,
|
|
291
|
+
oldSelectedOptionsLimit = prevProps.selectedOptionsLimit;
|
|
292
|
+
var oldCount = this.state.showedSelectedOptionsCount;
|
|
293
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
294
|
+
var oldSelectedOptionsLen = oldSelectedOptions.length;
|
|
295
|
+
|
|
296
|
+
if (id !== prevProps.id || selectedOptionsLimit !== oldSelectedOptionsLimit) {
|
|
297
|
+
//handle component update case (New set of options or new selectedOptionsLimit update)
|
|
298
|
+
this.setState({
|
|
299
|
+
showedSelectedOptionsCount: !(0, _Common.getIsEmptyValue)(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
|
|
300
|
+
});
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (oldCount !== prevState.showedSelectedOptionsCount || selectedOptionDetails !== prevProps.selectedOptionDetails) {
|
|
305
|
+
//When showedSelectedOptionsCount update, setState the updated selected option details
|
|
306
|
+
var _this$handleFormatOpt = this.handleFormatOptions(this.props),
|
|
307
|
+
normalizedFormatOptions = _this$handleFormatOpt.normalizedFormatOptions;
|
|
308
|
+
|
|
309
|
+
var optionsDetails = Object.assign({}, oldAllSelectedOptionsDetails, normalizedFormatOptions);
|
|
310
|
+
|
|
311
|
+
var _this$handleGetSelect = this.handleGetSelectedOptions(selectedOptions, optionsDetails, this.props),
|
|
312
|
+
formatSelectedOptions = _this$handleGetSelect.formatSelectedOptions,
|
|
313
|
+
normalizedSelectedOptions = _this$handleGetSelect.normalizedSelectedOptions,
|
|
314
|
+
selectedOptionIds = _this$handleGetSelect.selectedOptionIds;
|
|
315
|
+
|
|
316
|
+
this.allSelectedOptionsDetails = Object.assign(oldAllSelectedOptionsDetails, normalizedSelectedOptions);
|
|
317
|
+
this.setState({
|
|
318
|
+
selectedOptions: formatSelectedOptions,
|
|
319
|
+
selectedOptionIds: selectedOptionIds
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if ((0, _Common.getIsEmptyValue)(oldCount) || oldSelectedOptionsLen <= oldCount) {
|
|
324
|
+
//handle not more options case
|
|
325
|
+
if (selectedOptionsLen > oldCount) {
|
|
326
|
+
this.setState({
|
|
327
|
+
showedSelectedOptionsCount: selectedOptionsLen
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
} else if (oldSelectedOptionsLen > selectedOptionsLen) {
|
|
331
|
+
//handle more case and option remove case
|
|
332
|
+
var showedSelectedOptions = oldSelectedOptions.slice(0, oldCount);
|
|
333
|
+
var removeSelectedOption = oldCount;
|
|
334
|
+
selectedOptions.forEach(function (option) {
|
|
335
|
+
if (showedSelectedOptions.indexOf(option) >= 0) {
|
|
336
|
+
removeSelectedOption -= 1;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
var newCount = oldCount - removeSelectedOption;
|
|
340
|
+
this.setState({
|
|
341
|
+
showedSelectedOptionsCount: newCount
|
|
342
|
+
}, function () {
|
|
343
|
+
var showedSelectedOptionsCount = _this2.state.showedSelectedOptionsCount;
|
|
344
|
+
|
|
345
|
+
if (showedSelectedOptionsCount === 0) {
|
|
346
|
+
_this2.handleMoreClick();
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}, {
|
|
352
|
+
key: "handleMoreClick",
|
|
353
|
+
value: function handleMoreClick(e) {
|
|
354
|
+
var _this3 = this;
|
|
355
|
+
|
|
356
|
+
var showedSelectedOptionsCount = this.state.showedSelectedOptionsCount;
|
|
357
|
+
var _this$props4 = this.props,
|
|
358
|
+
selectedOptionsLimit = _this$props4.selectedOptionsLimit,
|
|
359
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
360
|
+
getSelectedOptionDetails = _this$props4.getSelectedOptionDetails,
|
|
361
|
+
removeClose = _this$props4.removeClose;
|
|
362
|
+
removeClose(e);
|
|
363
|
+
var selectedOptionsLen = selectedOptions.length;
|
|
364
|
+
|
|
365
|
+
if (showedSelectedOptionsCount < selectedOptionsLen) {
|
|
366
|
+
var newCount = showedSelectedOptionsCount + selectedOptionsLimit;
|
|
367
|
+
var newSelectedOptionIds = selectedOptions.slice(showedSelectedOptionsCount, newCount);
|
|
368
|
+
|
|
369
|
+
try {
|
|
370
|
+
getSelectedOptionDetails(newSelectedOptionIds).then(function () {
|
|
371
|
+
_this3.setState({
|
|
372
|
+
showedSelectedOptionsCount: showedSelectedOptionsCount + newSelectedOptionIds.length
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
} catch (e) {//console.error('getSelectedOptionDetails is not a promise function.');
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
this.searchInput && this.searchInput.focus({
|
|
380
|
+
preventScroll: true
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
key: "responsiveFunc",
|
|
385
|
+
value: function responsiveFunc(_ref2) {
|
|
386
|
+
var mediaQueryOR = _ref2.mediaQueryOR;
|
|
387
|
+
return {
|
|
388
|
+
tabletMode: mediaQueryOR([{
|
|
389
|
+
maxWidth: 700
|
|
390
|
+
}])
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "render",
|
|
395
|
+
value: function render() {
|
|
396
|
+
var _this4 = this;
|
|
397
|
+
|
|
398
|
+
var _this$props5 = this.props,
|
|
399
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
400
|
+
needSelectAll = _this$props5.needSelectAll,
|
|
401
|
+
searchEmptyMessage = _this$props5.searchEmptyMessage,
|
|
402
|
+
emptyMessage = _this$props5.emptyMessage,
|
|
403
|
+
noMoreOptionsMessage = _this$props5.noMoreOptionsMessage,
|
|
404
|
+
dropBoxSize = _this$props5.dropBoxSize,
|
|
405
|
+
placeHolder = _this$props5.placeHolder,
|
|
406
|
+
isPopupOpen = _this$props5.isPopupOpen,
|
|
407
|
+
isPopupReady = _this$props5.isPopupReady,
|
|
408
|
+
position = _this$props5.position,
|
|
409
|
+
defaultDropBoxPosition = _this$props5.defaultDropBoxPosition,
|
|
410
|
+
selectAllText = _this$props5.selectAllText,
|
|
411
|
+
getContainerRef = _this$props5.getContainerRef,
|
|
412
|
+
removeClose = _this$props5.removeClose,
|
|
413
|
+
isAnimate = _this$props5.isAnimate,
|
|
414
|
+
animationStyle = _this$props5.animationStyle,
|
|
415
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
416
|
+
variant = _this$props5.variant,
|
|
417
|
+
size = _this$props5.size,
|
|
418
|
+
isDisabled = _this$props5.isDisabled,
|
|
419
|
+
title = _this$props5.title,
|
|
420
|
+
dataIdMultiSelectComp = _this$props5.dataIdMultiSelectComp,
|
|
421
|
+
dataIdClearIcon = _this$props5.dataIdClearIcon,
|
|
422
|
+
dataIdSelectAllEle = _this$props5.dataIdSelectAllEle,
|
|
423
|
+
dataIdLoading = _this$props5.dataIdLoading,
|
|
424
|
+
_this$props5$selected = _this$props5.selectedOptions,
|
|
425
|
+
allselectedOptionIds = _this$props5$selected === void 0 ? [] : _this$props5$selected,
|
|
426
|
+
listItemSize = _this$props5.listItemSize,
|
|
427
|
+
needBorder = _this$props5.needBorder,
|
|
428
|
+
i18nKeys = _this$props5.i18nKeys,
|
|
429
|
+
htmlId = _this$props5.htmlId,
|
|
430
|
+
a11y = _this$props5.a11y,
|
|
431
|
+
borderColor = _this$props5.borderColor,
|
|
432
|
+
isBoxPaddingNeed = _this$props5.isBoxPaddingNeed,
|
|
433
|
+
getFooter = _this$props5.getFooter,
|
|
434
|
+
customProps = _this$props5.customProps,
|
|
435
|
+
needEffect = _this$props5.needEffect,
|
|
436
|
+
disabledOptions = _this$props5.disabledOptions,
|
|
437
|
+
isLoading = _this$props5.isLoading,
|
|
438
|
+
dataSelectorId = _this$props5.dataSelectorId;
|
|
439
|
+
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
440
|
+
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
441
|
+
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
442
|
+
DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP;
|
|
443
|
+
var _i18nKeys = i18nKeys,
|
|
444
|
+
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
445
|
+
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
446
|
+
var _a11y$clearLabel = a11y.clearLabel,
|
|
447
|
+
clearLabel = _a11y$clearLabel === void 0 ? 'Clear all' : _a11y$clearLabel;
|
|
448
|
+
i18nKeys = Object.assign({}, i18nKeys, {
|
|
449
|
+
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
450
|
+
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage,
|
|
451
|
+
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
452
|
+
});
|
|
453
|
+
var _this$state3 = this.state,
|
|
454
|
+
selectedOptions = _this$state3.selectedOptions,
|
|
455
|
+
searchStr = _this$state3.searchStr,
|
|
456
|
+
hoverOption = _this$state3.hoverOption,
|
|
457
|
+
highLightedSelectOptions = _this$state3.highLightedSelectOptions,
|
|
458
|
+
isFetchingOptions = _this$state3.isFetchingOptions,
|
|
459
|
+
isActive = _this$state3.isActive,
|
|
460
|
+
showedSelectedOptionsCount = _this$state3.showedSelectedOptionsCount,
|
|
461
|
+
options = _this$state3.options;
|
|
462
|
+
var suggestions = this.handleFilterSuggestions();
|
|
463
|
+
var allselectedOptionIdsLen = allselectedOptionIds.length;
|
|
464
|
+
var moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
|
|
465
|
+
var setAriaId = this.getNextAriaId();
|
|
466
|
+
var ariaErrorId = this.getNextAriaId();
|
|
467
|
+
|
|
468
|
+
var _this$getIsShowClearI = this.getIsShowClearIcon({
|
|
469
|
+
selectedOptions: selectedOptions,
|
|
470
|
+
disabledOptions: disabledOptions
|
|
471
|
+
}),
|
|
472
|
+
isShowClear = _this$getIsShowClearI.isShowClearIcon;
|
|
473
|
+
|
|
474
|
+
var isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
475
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
476
|
+
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
477
|
+
"data-id": dataIdMultiSelectComp,
|
|
478
|
+
"data-test-id": dataIdMultiSelectComp,
|
|
479
|
+
"data-title": isDisabled ? title : null,
|
|
480
|
+
onClick: this.handleInputFocus,
|
|
481
|
+
"data-selector-id": dataSelectorId
|
|
482
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
483
|
+
align: "vertical",
|
|
484
|
+
alignBox: "row",
|
|
485
|
+
className: "".concat(_MultiSelectModule["default"].container, " ").concat(_MultiSelectModule["default"][size], " ").concat(isActive && needBorder ? _MultiSelectModule["default"].active : '', " ").concat(needBorder ? _MultiSelectModule["default"].hasBorder : '', " ").concat(needBorder ? !isDisabled ? _MultiSelectModule["default"]["borderColor_".concat(borderColor)] : _MultiSelectModule["default"].borderColor_transparent : ''),
|
|
486
|
+
eleRef: this.selectedOptionContainerRef,
|
|
487
|
+
wrap: "wrap"
|
|
488
|
+
}, /*#__PURE__*/_react["default"].createElement(_SelectedOptions["default"], {
|
|
489
|
+
selectedOptions: selectedOptions,
|
|
490
|
+
highLightedSelectOptions: highLightedSelectOptions,
|
|
491
|
+
isReadOnly: isReadOnly,
|
|
492
|
+
getRef: this.selectedOptionRef,
|
|
493
|
+
onRemove: this.handleRemoveOption,
|
|
494
|
+
onSelect: this.handleClickSelectedOption
|
|
495
|
+
}), moreCount > 0 ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
496
|
+
className: _MultiSelectModule["default"].more,
|
|
497
|
+
onClick: this.handleMoreClick,
|
|
498
|
+
tagName: "button"
|
|
499
|
+
}, "+ ".concat(moreCount, " More")) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
500
|
+
flexible: true,
|
|
501
|
+
className: _MultiSelectModule["default"].wrapper,
|
|
502
|
+
adjust: true,
|
|
503
|
+
shrink: true
|
|
504
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
505
|
+
className: " ".concat(_MultiSelectModule["default"].custmSpan, " ").concat(textBoxSize === 'xmedium' ? _MultiSelectModule["default"].custmSpanXmedium : _MultiSelectModule["default"].custmSpanMedium, " ").concat(isShowClearIcon ? _MultiSelectModule["default"].clearIconSpace : '', "\n ")
|
|
506
|
+
}, searchStr), /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
507
|
+
isDisabled: isDisabled,
|
|
508
|
+
inputRef: this.searchInputRef,
|
|
509
|
+
needBorder: false,
|
|
510
|
+
onBlur: this.handleInactive,
|
|
511
|
+
onChange: this.handleSearch,
|
|
512
|
+
onClick: this.handleInputCick,
|
|
513
|
+
onFocus: this.handleActive,
|
|
514
|
+
onKeyDown: this.handleKeyDown,
|
|
515
|
+
placeHolder: selectedOptions.length >= 1 ? '' : placeHolder,
|
|
516
|
+
size: textBoxSize,
|
|
517
|
+
value: searchStr,
|
|
518
|
+
variant: variant,
|
|
519
|
+
isReadOnly: isReadOnly,
|
|
520
|
+
tabindex: isDisabled && '-1',
|
|
521
|
+
customClass: {
|
|
522
|
+
customTBoxWrap: _MultiSelectModule["default"].custmInputWrapper
|
|
523
|
+
},
|
|
524
|
+
htmlId: htmlId,
|
|
525
|
+
a11y: {
|
|
526
|
+
role: 'combobox',
|
|
527
|
+
ariaOwns: setAriaId,
|
|
528
|
+
ariaControls: setAriaId,
|
|
529
|
+
ariaExpanded: !isReadOnly && !isDisabled && isPopupOpen ? true : false,
|
|
530
|
+
ariaHaspopup: true,
|
|
531
|
+
ariaDescribedby: ariaErrorId
|
|
532
|
+
},
|
|
533
|
+
autoComplete: false
|
|
534
|
+
}, isShowClearIcon ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
535
|
+
alignBox: "row",
|
|
536
|
+
align: "vertical"
|
|
537
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
538
|
+
className: "".concat(_MultiSelectModule["default"]["delete"]),
|
|
539
|
+
dataId: dataIdClearIcon,
|
|
540
|
+
"data-title": clearText,
|
|
541
|
+
onClick: this.handleDeselectAll,
|
|
542
|
+
tagName: "button",
|
|
543
|
+
"aria-label": clearLabel
|
|
544
|
+
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
545
|
+
name: "ZD-delete",
|
|
546
|
+
size: "15"
|
|
547
|
+
}))) : null))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
548
|
+
query: this.responsiveFunc,
|
|
549
|
+
responsiveId: "Helmet"
|
|
550
|
+
}, function (_ref3) {
|
|
551
|
+
var tabletMode = _ref3.tabletMode;
|
|
552
|
+
return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], _extends({
|
|
553
|
+
animationStyle: animationStyle,
|
|
554
|
+
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
555
|
+
getRef: getContainerRef,
|
|
556
|
+
isActive: isPopupReady,
|
|
557
|
+
isAnimate: isAnimate,
|
|
558
|
+
isArrow: false,
|
|
559
|
+
onClick: removeClose,
|
|
560
|
+
isPadding: false,
|
|
561
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
562
|
+
htmlId: setAriaId,
|
|
563
|
+
a11y: {
|
|
564
|
+
role: 'listbox',
|
|
565
|
+
ariaMultiselectable: true
|
|
566
|
+
}
|
|
567
|
+
}, DropBoxProps, {
|
|
568
|
+
alignBox: "row",
|
|
569
|
+
isResponsivePadding: getFooter ? false : true
|
|
570
|
+
}), isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
571
|
+
align: "both",
|
|
572
|
+
className: _MultiSelectModule["default"].loader
|
|
573
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
574
|
+
flexible: true
|
|
575
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
576
|
+
customClass: _MultiSelectModule["default"].box,
|
|
577
|
+
onScroll: _this4.handleScroll
|
|
578
|
+
}, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
579
|
+
onSelect: _this4.handleSelectAll,
|
|
580
|
+
selectAllText: selectAllText,
|
|
581
|
+
suggestions: suggestions,
|
|
582
|
+
dataId: dataIdSelectAllEle
|
|
583
|
+
})) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
584
|
+
shrink: true,
|
|
585
|
+
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
586
|
+
eleRef: _this4.suggestionContainerRef
|
|
587
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
588
|
+
suggestions: suggestions,
|
|
589
|
+
selectedOptions: allselectedOptionIds,
|
|
590
|
+
getRef: _this4.suggestionItemRef,
|
|
591
|
+
hoverOption: hoverOption,
|
|
592
|
+
onClick: _this4.handleSelectOption,
|
|
593
|
+
onMouseEnter: _this4.handleMouseEnter,
|
|
594
|
+
needTick: true,
|
|
595
|
+
listItemSize: listItemSize,
|
|
596
|
+
a11y: {
|
|
597
|
+
role: 'option'
|
|
598
|
+
}
|
|
599
|
+
}, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
600
|
+
isLoading: isFetchingOptions,
|
|
601
|
+
options: options,
|
|
602
|
+
searchString: searchStr,
|
|
603
|
+
suggestions: suggestions,
|
|
604
|
+
dataId: dataIdLoading,
|
|
605
|
+
i18nKeys: i18nKeys,
|
|
606
|
+
htmlId: ariaErrorId
|
|
607
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
608
|
+
isCover: false,
|
|
609
|
+
align: "both"
|
|
610
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter()) : null)));
|
|
611
|
+
}) : null);
|
|
612
|
+
}
|
|
613
|
+
}]);
|
|
614
|
+
|
|
615
|
+
return AdvancedMultiSelectComponent;
|
|
616
|
+
}(_MultiSelect.MultiSelectComponent);
|
|
617
|
+
|
|
618
|
+
exports.AdvancedMultiSelectComponent = AdvancedMultiSelectComponent;
|
|
619
|
+
AdvancedMultiSelectComponent.propTypes = _propTypes.AdvancedMultiSelect_propTypes;
|
|
620
|
+
AdvancedMultiSelectComponent.defaultProps = _defaultProps.AdvancedMultiSelect_defaultProps;
|
|
621
|
+
AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
|
|
622
|
+
var AdvancedMultiSelect = (0, _Popup["default"])(AdvancedMultiSelectComponent);
|
|
623
|
+
AdvancedMultiSelect.defaultProps = AdvancedMultiSelectComponent.defaultProps;
|
|
624
|
+
AdvancedMultiSelect.propTypes = AdvancedMultiSelectComponent.propTypes; // if (__DOCS__) {
|
|
625
|
+
// AdvancedMultiSelectComponent.docs = {
|
|
626
|
+
// componentGroup: 'Form Elements',
|
|
627
|
+
// folderName: 'Style Guide'
|
|
628
|
+
// };
|
|
629
|
+
// // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
630
|
+
// AdvancedMultiSelect.propTypes = AdvancedMultiSelectComponent.propTypes;
|
|
631
|
+
// }
|
|
632
|
+
|
|
633
|
+
var _default = AdvancedMultiSelect;
|
|
634
|
+
exports["default"] = _default;
|