@zohodesk/components 1.0.0-temp-189.1 → 1.0.0-temp-189.2
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/UnValidatedFiles.html +101 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +15 -0
- package/es/CheckBox/CheckBox.js +10 -0
- package/es/CheckBox/props/propTypes.js +1 -0
- package/es/DateTime/DateWidget.js +13 -4
- package/es/DropBox/DropBox.js +5 -15
- package/es/DropBox/utils/isMobilePopover.js +17 -0
- package/es/MultiSelect/MultiSelect.js +75 -92
- package/es/MultiSelect/MultiSelectWithAvatar.js +73 -90
- package/es/Radio/Radio.js +26 -7
- package/es/Radio/Radio.module.css +3 -0
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/es/Radio/props/defaultProps.js +1 -0
- package/es/Radio/props/propTypes.js +7 -0
- package/es/Tag/Tag.js +1 -1
- package/es/v1/CheckBox/CheckBox.js +6 -0
- package/es/v1/CheckBox/props/propTypes.js +1 -0
- package/es/v1/DateTime/DateWidget.js +13 -4
- package/es/v1/DropBox/DropBox.js +3 -14
- package/es/v1/DropBox/utils/isMobilePopover.js +17 -0
- package/es/v1/MultiSelect/MultiSelect.js +75 -93
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +74 -91
- package/es/v1/Radio/Radio.js +22 -7
- package/es/v1/Radio/props/defaultProps.js +1 -0
- package/es/v1/Radio/props/propTypes.js +7 -0
- package/es/v1/Tag/Tag.js +1 -1
- package/lib/CheckBox/CheckBox.js +34 -24
- package/lib/CheckBox/props/propTypes.js +1 -0
- package/lib/DateTime/DateWidget.js +21 -11
- package/lib/DropBox/DropBox.js +3 -13
- package/lib/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/MultiSelect/MultiSelect.js +74 -91
- package/lib/MultiSelect/MultiSelectWithAvatar.js +72 -89
- package/lib/Radio/Radio.js +45 -26
- package/lib/Radio/Radio.module.css +3 -0
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/lib/Radio/props/defaultProps.js +1 -0
- package/lib/Radio/props/propTypes.js +7 -0
- package/lib/Tag/Tag.js +1 -1
- package/lib/v1/CheckBox/CheckBox.js +6 -0
- package/lib/v1/CheckBox/props/propTypes.js +1 -0
- package/lib/v1/DateTime/DateWidget.js +21 -11
- package/lib/v1/DropBox/DropBox.js +3 -13
- package/lib/v1/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/v1/MultiSelect/MultiSelect.js +76 -93
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +71 -90
- package/lib/v1/Radio/Radio.js +22 -7
- package/lib/v1/Radio/props/defaultProps.js +1 -0
- package/lib/v1/Radio/props/propTypes.js +7 -0
- package/lib/v1/Tag/Tag.js +1 -1
- package/package.json +6 -6
- package/propValidationArg.json +8 -4
- package/result.json +1 -1
package/es/v1/Radio/Radio.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { defaultProps } from './props/defaultProps';
|
|
3
5
|
import { propTypes } from './props/propTypes';
|
|
@@ -24,6 +26,9 @@ const Radio = props => {
|
|
|
24
26
|
active,
|
|
25
27
|
isFilled,
|
|
26
28
|
customClass,
|
|
29
|
+
customProps,
|
|
30
|
+
getRef,
|
|
31
|
+
children,
|
|
27
32
|
a11y
|
|
28
33
|
} = props;
|
|
29
34
|
let {
|
|
@@ -36,11 +41,16 @@ const Radio = props => {
|
|
|
36
41
|
let {
|
|
37
42
|
ariaHidden,
|
|
38
43
|
role = 'radio',
|
|
44
|
+
tabIndex,
|
|
39
45
|
ariaChecked = checked,
|
|
40
46
|
ariaLabel,
|
|
41
47
|
ariaLabelledby,
|
|
42
48
|
ariaReadonly = isReadOnly || disabled ? true : false
|
|
43
49
|
} = a11y;
|
|
50
|
+
let {
|
|
51
|
+
ContainerProps = {},
|
|
52
|
+
LabelProps = {}
|
|
53
|
+
} = customProps;
|
|
44
54
|
|
|
45
55
|
function onChange(e) {
|
|
46
56
|
const {
|
|
@@ -49,7 +59,11 @@ const Radio = props => {
|
|
|
49
59
|
onChange && onChange(value, e);
|
|
50
60
|
}
|
|
51
61
|
|
|
52
|
-
|
|
62
|
+
function handleGetRef(ele) {
|
|
63
|
+
getRef && getRef(ele, value);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
53
67
|
dataId: value ? value.toLowerCase() : 'RadioComp',
|
|
54
68
|
isCover: false,
|
|
55
69
|
isInline: text ? false : true,
|
|
@@ -59,13 +73,14 @@ const Radio = props => {
|
|
|
59
73
|
"data-title": toolTip,
|
|
60
74
|
onClick: !isReadOnly && !disabled ? onChange : '',
|
|
61
75
|
"aria-checked": ariaChecked,
|
|
62
|
-
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
76
|
+
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
|
|
77
|
+
eleRef: handleGetRef,
|
|
63
78
|
role: role,
|
|
64
79
|
"aria-Hidden": ariaHidden,
|
|
65
80
|
"aria-label": ariaLabel,
|
|
66
81
|
"aria-labelledby": ariaLabelledby,
|
|
67
82
|
"aria-readonly": ariaReadonly
|
|
68
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
83
|
+
}, ContainerProps), /*#__PURE__*/React.createElement(Box, {
|
|
69
84
|
className: `${style.radio} ${checked ? `${style[`rdBox${palette}`]}` : ''}
|
|
70
85
|
${isReadOnly || disabled ? '' : `${style[`hover${palette}`]}`} ${style[size]} ${isFilled ? style.filled : ''} ${style[`centerPath${palette}`]} ${customRadio}`
|
|
71
86
|
}, /*#__PURE__*/React.createElement("input", {
|
|
@@ -91,18 +106,18 @@ const Radio = props => {
|
|
|
91
106
|
}) : null))), text && /*#__PURE__*/React.createElement(Box, {
|
|
92
107
|
flexible: true,
|
|
93
108
|
className: style.text
|
|
94
|
-
}, /*#__PURE__*/React.createElement(Label, {
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
95
110
|
text: text,
|
|
96
|
-
palette:
|
|
111
|
+
palette: labelPalette,
|
|
97
112
|
size: labelSize,
|
|
98
113
|
type: "title",
|
|
99
114
|
clipped: true,
|
|
100
115
|
dataId: `${text}_label`,
|
|
101
116
|
variant: variant,
|
|
102
117
|
title: toolTip ? toolTip : text,
|
|
103
|
-
customClass: `${checked && active
|
|
118
|
+
customClass: `${checked && active ? `${style[`${palette}checkedActive`]}` : ''}
|
|
104
119
|
${style[`${palette}Label`]} ${accessMode} ${customLabel}`
|
|
105
|
-
})));
|
|
120
|
+
}, LabelProps))), children);
|
|
106
121
|
};
|
|
107
122
|
|
|
108
123
|
export default Radio;
|
|
@@ -4,6 +4,7 @@ export const propTypes = {
|
|
|
4
4
|
checked: PropTypes.bool,
|
|
5
5
|
disabled: PropTypes.bool,
|
|
6
6
|
disabledTitle: PropTypes.string,
|
|
7
|
+
getRef: PropTypes.func,
|
|
7
8
|
id: PropTypes.string,
|
|
8
9
|
isFilled: PropTypes.bool,
|
|
9
10
|
isReadOnly: PropTypes.bool,
|
|
@@ -20,14 +21,20 @@ export const propTypes = {
|
|
|
20
21
|
customRadio: PropTypes.string,
|
|
21
22
|
customLabel: PropTypes.string
|
|
22
23
|
}),
|
|
24
|
+
customProps: PropTypes.exact({
|
|
25
|
+
ContainerProps: PropTypes.object,
|
|
26
|
+
LabelProps: PropTypes.object
|
|
27
|
+
}),
|
|
23
28
|
a11y: PropTypes.shape({
|
|
24
29
|
ariaChecked: PropTypes.bool,
|
|
25
30
|
ariaHidden: PropTypes.bool,
|
|
26
31
|
role: PropTypes.string,
|
|
32
|
+
tabIndex: PropTypes.oneOfType(PropTypes.string, PropTypes.number),
|
|
27
33
|
ariaLabelledby: PropTypes.string,
|
|
28
34
|
ariaLabel: PropTypes.string,
|
|
29
35
|
ariaReadonly: PropTypes.bool
|
|
30
36
|
}),
|
|
37
|
+
children: PropTypes.node,
|
|
31
38
|
onChange: PropTypes.func,
|
|
32
39
|
text: PropTypes.string
|
|
33
40
|
};
|
package/es/v1/Tag/Tag.js
CHANGED
|
@@ -115,7 +115,7 @@ function Tag(props) {
|
|
|
115
115
|
${rounded ? style.lgRadiusClose : style.smRadiusClose} ${isDarkPalette ? style.darkTagClose : ''}
|
|
116
116
|
${customTagClose} ${style[`close${closePalette}`]}`,
|
|
117
117
|
dataId: `${dataId}_RemoveTag`,
|
|
118
|
-
|
|
118
|
+
title: closeTitle,
|
|
119
119
|
onClick: handleRemove,
|
|
120
120
|
a11y: {
|
|
121
121
|
ariaLabel: clearLabel
|
package/lib/CheckBox/CheckBox.js
CHANGED
|
@@ -57,6 +57,7 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
57
57
|
|
|
58
58
|
_this = _super.call(this, props);
|
|
59
59
|
_this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
|
|
60
|
+
_this.handleGetContainerRef = _this.handleGetContainerRef.bind(_assertThisInitialized(_this));
|
|
60
61
|
return _this;
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -68,33 +69,41 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
68
69
|
checked = _this$props.checked;
|
|
69
70
|
onChange && onChange(!checked, e);
|
|
70
71
|
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "handleGetContainerRef",
|
|
74
|
+
value: function handleGetContainerRef(ele) {
|
|
75
|
+
var _this$props2 = this.props,
|
|
76
|
+
getContainerRef = _this$props2.getContainerRef,
|
|
77
|
+
id = _this$props2.id;
|
|
78
|
+
getContainerRef && getContainerRef(ele, id);
|
|
79
|
+
}
|
|
71
80
|
}, {
|
|
72
81
|
key: "render",
|
|
73
82
|
value: function render() {
|
|
74
|
-
var _this$
|
|
75
|
-
id = _this$
|
|
76
|
-
checked = _this$
|
|
77
|
-
disabled = _this$
|
|
78
|
-
isReadOnly = _this$
|
|
79
|
-
disabledTitle = _this$
|
|
80
|
-
title = _this$
|
|
81
|
-
palette = _this$
|
|
82
|
-
text = _this$
|
|
83
|
-
size = _this$
|
|
84
|
-
labelPalette = _this$
|
|
85
|
-
labelSize = _this$
|
|
86
|
-
isFilled = _this$
|
|
87
|
-
isClipped = _this$
|
|
88
|
-
getRef = _this$
|
|
89
|
-
variant = _this$
|
|
90
|
-
active = _this$
|
|
91
|
-
dataId = _this$
|
|
92
|
-
name = _this$
|
|
93
|
-
activeStyle = _this$
|
|
94
|
-
a11y = _this$
|
|
95
|
-
customClass = _this$
|
|
96
|
-
customProps = _this$
|
|
97
|
-
dataSelectorId = _this$
|
|
83
|
+
var _this$props3 = this.props,
|
|
84
|
+
id = _this$props3.id,
|
|
85
|
+
checked = _this$props3.checked,
|
|
86
|
+
disabled = _this$props3.disabled,
|
|
87
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
88
|
+
disabledTitle = _this$props3.disabledTitle,
|
|
89
|
+
title = _this$props3.title,
|
|
90
|
+
palette = _this$props3.palette,
|
|
91
|
+
text = _this$props3.text,
|
|
92
|
+
size = _this$props3.size,
|
|
93
|
+
labelPalette = _this$props3.labelPalette,
|
|
94
|
+
labelSize = _this$props3.labelSize,
|
|
95
|
+
isFilled = _this$props3.isFilled,
|
|
96
|
+
isClipped = _this$props3.isClipped,
|
|
97
|
+
getRef = _this$props3.getRef,
|
|
98
|
+
variant = _this$props3.variant,
|
|
99
|
+
active = _this$props3.active,
|
|
100
|
+
dataId = _this$props3.dataId,
|
|
101
|
+
name = _this$props3.name,
|
|
102
|
+
activeStyle = _this$props3.activeStyle,
|
|
103
|
+
a11y = _this$props3.a11y,
|
|
104
|
+
customClass = _this$props3.customClass,
|
|
105
|
+
customProps = _this$props3.customProps,
|
|
106
|
+
dataSelectorId = _this$props3.dataSelectorId;
|
|
98
107
|
var _customProps$CheckBox = customProps.CheckBoxProps,
|
|
99
108
|
CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
|
|
100
109
|
_customProps$LabelPro = customProps.LabelProps,
|
|
@@ -127,6 +136,7 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
127
136
|
onClick: isReadOnly || disabled ? null : this.onChange,
|
|
128
137
|
tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
129
138
|
"aria-checked": ariaChecked,
|
|
139
|
+
eleRef: this.handleGetContainerRef,
|
|
130
140
|
role: role,
|
|
131
141
|
"aria-label": ariaLabel,
|
|
132
142
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -18,6 +18,7 @@ var propTypes = {
|
|
|
18
18
|
disabled: _propTypes["default"].bool,
|
|
19
19
|
disabledTitle: _propTypes["default"].string,
|
|
20
20
|
getRef: _propTypes["default"].func,
|
|
21
|
+
getContainerRef: _propTypes["default"].func,
|
|
21
22
|
id: _propTypes["default"].string,
|
|
22
23
|
isFilled: _propTypes["default"].bool,
|
|
23
24
|
isClipped: _propTypes["default"].bool,
|
|
@@ -934,8 +934,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
934
934
|
|
|
935
935
|
if (isAllowedDateType) {
|
|
936
936
|
// if (focusOrder !== oldFocusOrder) {
|
|
937
|
-
var _this$
|
|
938
|
-
|
|
937
|
+
var _this$state5 = this.state,
|
|
938
|
+
_this$state5$dateForm = _this$state5.dateFormatSelection,
|
|
939
|
+
dateFormatSelection = _this$state5$dateForm === void 0 ? {} : _this$state5$dateForm,
|
|
940
|
+
isFocused = _this$state5.isFocused;
|
|
939
941
|
var _dateFormatSelection$2 = dateFormatSelection.order,
|
|
940
942
|
order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
|
|
941
943
|
var isPopupOpen = this.props.isPopupOpen; // const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
|
|
@@ -953,9 +955,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
953
955
|
|
|
954
956
|
if (isPopupOpen) {
|
|
955
957
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
958
|
+
if (!isFocused && isYearView) {
|
|
959
|
+
this.DateTimeYearViewToggle(true, oldIsMonthOpen);
|
|
960
|
+
} else {
|
|
961
|
+
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
962
|
+
}
|
|
963
|
+
} else if (yearViewTypes.indexOf(focusedType) === -1) {
|
|
964
|
+
if (!isFocused && isYearView) {
|
|
965
|
+
this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
|
|
966
|
+
} else {
|
|
967
|
+
this.DateTimeYearViewToggle(false, false);
|
|
968
|
+
}
|
|
959
969
|
}
|
|
960
970
|
} // }
|
|
961
971
|
|
|
@@ -1004,12 +1014,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1004
1014
|
a11y = _this$props11.a11y,
|
|
1005
1015
|
boxSize = _this$props11.boxSize,
|
|
1006
1016
|
onError = _this$props11.onError;
|
|
1007
|
-
var _this$
|
|
1008
|
-
_this$
|
|
1009
|
-
value = _this$
|
|
1010
|
-
isError = _this$
|
|
1011
|
-
isDateEdited = _this$
|
|
1012
|
-
isFocused = _this$
|
|
1017
|
+
var _this$state6 = this.state,
|
|
1018
|
+
_this$state6$selected = _this$state6.selected,
|
|
1019
|
+
value = _this$state6$selected === void 0 ? '' : _this$state6$selected,
|
|
1020
|
+
isError = _this$state6.isError,
|
|
1021
|
+
isDateEdited = _this$state6.isDateEdited,
|
|
1022
|
+
isFocused = _this$state6.isFocused;
|
|
1013
1023
|
var showValue = this.handleGetShowValue();
|
|
1014
1024
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1015
1025
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
package/lib/DropBox/DropBox.js
CHANGED
|
@@ -13,8 +13,6 @@ var _FocusScope = _interopRequireDefault(require("@zohodesk/a11y/es/FocusScope/F
|
|
|
13
13
|
|
|
14
14
|
var _Modal = _interopRequireDefault(require("../Modal/Modal"));
|
|
15
15
|
|
|
16
|
-
var _Config = require("../Provider/Config");
|
|
17
|
-
|
|
18
16
|
var _LibraryContextInit = _interopRequireDefault(require("../Provider/LibraryContextInit"));
|
|
19
17
|
|
|
20
18
|
var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
|
|
@@ -27,6 +25,8 @@ var _propTypes = require("./props/propTypes");
|
|
|
27
25
|
|
|
28
26
|
var _Common = require("./../utils/Common");
|
|
29
27
|
|
|
28
|
+
var _isMobilePopover = _interopRequireDefault(require("./utils/isMobilePopover"));
|
|
29
|
+
|
|
30
30
|
var _DropBoxModule = _interopRequireDefault(require("./css/DropBox.module.css"));
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -64,17 +64,7 @@ function DropBox(props) {
|
|
|
64
64
|
var _ref = DropBoxContext || {},
|
|
65
65
|
direction = _ref.direction;
|
|
66
66
|
|
|
67
|
-
var
|
|
68
|
-
mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
|
|
69
|
-
isModel = false;
|
|
70
|
-
|
|
71
|
-
if (needResponsive) {
|
|
72
|
-
windowWidth = window.innerWidth;
|
|
73
|
-
|
|
74
|
-
if (windowWidth <= mobileWidth) {
|
|
75
|
-
isModel = true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
67
|
+
var isModel = (0, _isMobilePopover["default"])(needResponsive);
|
|
78
68
|
|
|
79
69
|
var _cssJSLogic = (0, _cssJSLogic2["default"])(props),
|
|
80
70
|
zIndexStyle = _cssJSLogic.zIndexStyle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = isMobilePopover;
|
|
7
|
+
|
|
8
|
+
var _Config = require("../../Provider/Config");
|
|
9
|
+
|
|
10
|
+
function isMobilePopover(needResponsive) {
|
|
11
|
+
// let { needResponsive } = props;
|
|
12
|
+
var windowWidth,
|
|
13
|
+
mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
|
|
14
|
+
isModel = false;
|
|
15
|
+
|
|
16
|
+
if (needResponsive) {
|
|
17
|
+
windowWidth = window.innerWidth;
|
|
18
|
+
|
|
19
|
+
if (windowWidth <= mobileWidth) {
|
|
20
|
+
isModel = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return isModel ? true : false;
|
|
25
|
+
}
|
|
@@ -35,12 +35,12 @@ var _IdProvider = require("../Provider/IdProvider");
|
|
|
35
35
|
|
|
36
36
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
37
37
|
|
|
38
|
-
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
39
|
-
|
|
40
38
|
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
41
39
|
|
|
42
40
|
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
43
41
|
|
|
42
|
+
var _isMobilePopover = _interopRequireDefault(require("../DropBox/utils/isMobilePopover"));
|
|
43
|
+
|
|
44
44
|
var _icons = require("@zohodesk/icons");
|
|
45
45
|
|
|
46
46
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
@@ -918,16 +918,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
918
918
|
openPopupOnly: openPopupOnly
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
|
-
}, {
|
|
922
|
-
key: "responsiveFunc",
|
|
923
|
-
value: function responsiveFunc(_ref6) {
|
|
924
|
-
var mediaQueryOR = _ref6.mediaQueryOR;
|
|
925
|
-
return {
|
|
926
|
-
tabletMode: mediaQueryOR([{
|
|
927
|
-
maxWidth: 700
|
|
928
|
-
}])
|
|
929
|
-
};
|
|
930
|
-
}
|
|
931
921
|
}, {
|
|
932
922
|
key: "getSelectionUI",
|
|
933
923
|
value: function getSelectionUI() {
|
|
@@ -1048,8 +1038,6 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1048
1038
|
}, {
|
|
1049
1039
|
key: "render",
|
|
1050
1040
|
value: function render() {
|
|
1051
|
-
var _this5 = this;
|
|
1052
|
-
|
|
1053
1041
|
var _this$props15 = this.props,
|
|
1054
1042
|
isReadOnly = _this$props15.isReadOnly,
|
|
1055
1043
|
searchEmptyMessage = _this$props15.searchEmptyMessage,
|
|
@@ -1099,6 +1087,7 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1099
1087
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
|
|
1100
1088
|
noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
|
|
1101
1089
|
});
|
|
1090
|
+
var isModel = (0, _isMobilePopover["default"])(needResponsive);
|
|
1102
1091
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1103
1092
|
className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(isReadOnly ? _MultiSelectModule["default"].readOnly : '', " ").concat(disableAction ? (0, _CssProvider["default"])('isBlock') : '', " ").concat(borderColor === 'transparent' ? _MultiSelectModule["default"].transparentContainer : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : ''),
|
|
1104
1093
|
"data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
|
|
@@ -1106,83 +1095,77 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1106
1095
|
"data-title": isDisabled ? title : null,
|
|
1107
1096
|
onClick: this.handleInputFocus,
|
|
1108
1097
|
"data-selector-id": dataSelectorId
|
|
1109
|
-
}, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
htmlId: ariaErrorId
|
|
1181
|
-
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1182
|
-
isCover: false,
|
|
1183
|
-
align: "both"
|
|
1184
|
-
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter()) : null)));
|
|
1185
|
-
}) : null);
|
|
1098
|
+
}, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
|
|
1099
|
+
animationStyle: animationStyle,
|
|
1100
|
+
boxPosition: position || "".concat(defaultDropBoxPosition),
|
|
1101
|
+
getRef: getContainerRef,
|
|
1102
|
+
isActive: isPopupReady,
|
|
1103
|
+
isAnimate: isAnimate,
|
|
1104
|
+
isArrow: false,
|
|
1105
|
+
onClick: removeClose,
|
|
1106
|
+
needResponsive: needResponsive,
|
|
1107
|
+
isPadding: false,
|
|
1108
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
1109
|
+
palette: palette,
|
|
1110
|
+
htmlId: setAriaId,
|
|
1111
|
+
a11y: {
|
|
1112
|
+
role: 'listbox',
|
|
1113
|
+
ariaMultiselectable: true
|
|
1114
|
+
},
|
|
1115
|
+
size: boxSize,
|
|
1116
|
+
alignBox: "row",
|
|
1117
|
+
isResponsivePadding: getFooter ? false : true
|
|
1118
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
1119
|
+
flexible: true
|
|
1120
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
1121
|
+
customClass: "".concat(_MultiSelectModule["default"].box, " ").concat(_MultiSelectModule["default"]["".concat(palette, "Box")]),
|
|
1122
|
+
onScroll: this.handleScroll
|
|
1123
|
+
}, isModel ? /*#__PURE__*/_react["default"].createElement(_MobileHeader["default"], {
|
|
1124
|
+
selectedOptions: selectedOptions,
|
|
1125
|
+
i18nKeys: i18nKeys,
|
|
1126
|
+
onClick: this.handlePopupClose
|
|
1127
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1128
|
+
className: _MultiSelectModule["default"].effect
|
|
1129
|
+
}, this.getSelectionUI(true))) : null, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
1130
|
+
onSelect: this.handleSelectAll,
|
|
1131
|
+
selectAllText: selectAllText,
|
|
1132
|
+
suggestions: suggestions,
|
|
1133
|
+
dataId: dataId
|
|
1134
|
+
})) : null, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1135
|
+
align: "both",
|
|
1136
|
+
className: _MultiSelectModule["default"].loader
|
|
1137
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
1138
|
+
shrink: true,
|
|
1139
|
+
customClass: !isModel && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
1140
|
+
eleRef: this.suggestionContainerRef
|
|
1141
|
+
}, isSearching ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1142
|
+
className: _MultiSelectModule["default"][palette]
|
|
1143
|
+
}, searchText) : suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
1144
|
+
suggestions: suggestions,
|
|
1145
|
+
getRef: this.suggestionItemRef,
|
|
1146
|
+
hoverOption: hoverOption,
|
|
1147
|
+
onClick: this.handleSelectOption,
|
|
1148
|
+
onMouseEnter: this.handleMouseEnter,
|
|
1149
|
+
needBorder: false,
|
|
1150
|
+
dataId: "".concat(dataId, "_Options"),
|
|
1151
|
+
palette: palette,
|
|
1152
|
+
selectedOptions: selectedOptionIds,
|
|
1153
|
+
a11y: {
|
|
1154
|
+
role: 'option'
|
|
1155
|
+
}
|
|
1156
|
+
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
1157
|
+
isLoading: isFetchingOptions,
|
|
1158
|
+
options: options,
|
|
1159
|
+
searchString: searchStr,
|
|
1160
|
+
suggestions: suggestions,
|
|
1161
|
+
dataId: dataId,
|
|
1162
|
+
palette: palette,
|
|
1163
|
+
i18nKeys: i18nKeys,
|
|
1164
|
+
htmlId: ariaErrorId
|
|
1165
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1166
|
+
isCover: false,
|
|
1167
|
+
align: "both"
|
|
1168
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter()) : null))) : null);
|
|
1186
1169
|
}
|
|
1187
1170
|
}]);
|
|
1188
1171
|
|