@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
|
@@ -33,12 +33,12 @@ var _IdProvider = require("../Provider/IdProvider");
|
|
|
33
33
|
|
|
34
34
|
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
35
35
|
|
|
36
|
-
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
37
|
-
|
|
38
36
|
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
39
37
|
|
|
40
38
|
var _MultiSelectHeader = _interopRequireDefault(require("./MultiSelectHeader"));
|
|
41
39
|
|
|
40
|
+
var _isMobilePopover = _interopRequireDefault(require("../DropBox/utils/isMobilePopover"));
|
|
41
|
+
|
|
42
42
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
43
43
|
|
|
44
44
|
var _MobileHeader = _interopRequireDefault(require("./MobileHeader/MobileHeader"));
|
|
@@ -109,21 +109,9 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
109
109
|
disabledOptions: disabledOptions
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
}, {
|
|
113
|
-
key: "responsiveFunc",
|
|
114
|
-
value: function responsiveFunc(_ref) {
|
|
115
|
-
var mediaQueryOR = _ref.mediaQueryOR;
|
|
116
|
-
return {
|
|
117
|
-
tabletMode: mediaQueryOR([{
|
|
118
|
-
maxWidth: 700
|
|
119
|
-
}])
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
112
|
}, {
|
|
123
113
|
key: "render",
|
|
124
114
|
value: function render() {
|
|
125
|
-
var _this2 = this;
|
|
126
|
-
|
|
127
115
|
var _this$props = this.props,
|
|
128
116
|
isReadOnly = _this$props.isReadOnly,
|
|
129
117
|
needSelectAll = _this$props.needSelectAll,
|
|
@@ -172,6 +160,7 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
172
160
|
var setAriaId = this.getNextAriaId();
|
|
173
161
|
var ariaErrorId = this.getNextAriaId();
|
|
174
162
|
var popUpState = !isReadOnly && !isDisabled && !disableAction && isPopupOpen;
|
|
163
|
+
var isModel = (0, _isMobilePopover["default"])(needResponsive);
|
|
175
164
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
165
|
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 : ''),
|
|
177
166
|
"data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
|
|
@@ -179,81 +168,75 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
179
168
|
"data-title": isDisabled ? title : null,
|
|
180
169
|
onClick: this.handleInputFocus,
|
|
181
170
|
"data-selector-id": dataSelectorId
|
|
182
|
-
}, this.getSelectionUI(), popUpState ? /*#__PURE__*/_react["default"].createElement(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
htmlId: ariaErrorId
|
|
252
|
-
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
253
|
-
isCover: false,
|
|
254
|
-
align: "both"
|
|
255
|
-
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))))));
|
|
256
|
-
}) : null);
|
|
171
|
+
}, this.getSelectionUI(), popUpState ? /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
|
|
172
|
+
animationStyle: animationStyle,
|
|
173
|
+
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
174
|
+
getRef: getContainerRef,
|
|
175
|
+
isActive: isPopupReady,
|
|
176
|
+
isAnimate: isAnimate,
|
|
177
|
+
isArrow: false,
|
|
178
|
+
onClick: removeClose,
|
|
179
|
+
needResponsive: needResponsive,
|
|
180
|
+
isPadding: false,
|
|
181
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
182
|
+
palette: palette,
|
|
183
|
+
htmlId: setAriaId,
|
|
184
|
+
a11y: {
|
|
185
|
+
ariaMultiselectable: true,
|
|
186
|
+
role: 'listbox'
|
|
187
|
+
},
|
|
188
|
+
isResponsivePadding: true,
|
|
189
|
+
alignBox: "row"
|
|
190
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
191
|
+
flexible: true
|
|
192
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
193
|
+
customClass: "".concat(_MultiSelectModule["default"].box, " ").concat(_MultiSelectModule["default"]["".concat(palette, "Box")]),
|
|
194
|
+
onScroll: this.handleScroll
|
|
195
|
+
}, isModel ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_MobileHeader["default"], {
|
|
196
|
+
selectedOptions: selectedOptions,
|
|
197
|
+
i18nKeys: i18nKeys,
|
|
198
|
+
onClick: this.handlePopupClose
|
|
199
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
200
|
+
className: _MultiSelectModule["default"].effect
|
|
201
|
+
}, this.getSelectionUI(true)))) : null, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
202
|
+
onSelect: this.handleSelectAll,
|
|
203
|
+
selectAllText: selectAllText,
|
|
204
|
+
suggestions: suggestions,
|
|
205
|
+
dataId: dataId
|
|
206
|
+
})) : null, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
207
|
+
align: "both",
|
|
208
|
+
className: _MultiSelectModule["default"].loader
|
|
209
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
210
|
+
shrink: true,
|
|
211
|
+
customClass: !isModel && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
212
|
+
eleRef: this.suggestionContainerRef
|
|
213
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
214
|
+
needTick: keepSelectedOptions,
|
|
215
|
+
suggestions: suggestions,
|
|
216
|
+
getRef: this.suggestionItemRef,
|
|
217
|
+
hoverOption: hoverOption,
|
|
218
|
+
onClick: this.handleSelectOption,
|
|
219
|
+
onMouseEnter: this.handleMouseEnter,
|
|
220
|
+
needBorder: false,
|
|
221
|
+
dataId: "".concat(dataId, "_Options"),
|
|
222
|
+
palette: palette,
|
|
223
|
+
selectedOptions: selectedOptionIds,
|
|
224
|
+
a11y: {
|
|
225
|
+
role: 'option'
|
|
226
|
+
}
|
|
227
|
+
}, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
228
|
+
isLoading: isFetchingOptions,
|
|
229
|
+
options: options,
|
|
230
|
+
searchString: searchStr,
|
|
231
|
+
suggestions: suggestions,
|
|
232
|
+
dataId: dataId,
|
|
233
|
+
palette: palette,
|
|
234
|
+
i18nKeys: i18nKeys,
|
|
235
|
+
htmlId: ariaErrorId
|
|
236
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
237
|
+
isCover: false,
|
|
238
|
+
align: "both"
|
|
239
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)))))) : null);
|
|
257
240
|
}
|
|
258
241
|
}]);
|
|
259
242
|
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -21,6 +21,8 @@ var _RadioModule = _interopRequireDefault(require("./Radio.module.css"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
24
26
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
27
|
|
|
26
28
|
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); } }
|
|
@@ -53,6 +55,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
53
55
|
|
|
54
56
|
_this = _super.call(this, props);
|
|
55
57
|
_this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
|
|
58
|
+
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this));
|
|
56
59
|
return _this;
|
|
57
60
|
}
|
|
58
61
|
|
|
@@ -64,28 +67,38 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
64
67
|
value = _this$props.value;
|
|
65
68
|
onChange && onChange(value, e);
|
|
66
69
|
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "handleGetRef",
|
|
72
|
+
value: function handleGetRef(ele) {
|
|
73
|
+
var _this$props2 = this.props,
|
|
74
|
+
getRef = _this$props2.getRef,
|
|
75
|
+
value = _this$props2.value;
|
|
76
|
+
getRef && getRef(ele, value);
|
|
77
|
+
}
|
|
67
78
|
}, {
|
|
68
79
|
key: "render",
|
|
69
80
|
value: function render() {
|
|
70
|
-
var _this$
|
|
71
|
-
id = _this$
|
|
72
|
-
name = _this$
|
|
73
|
-
value = _this$
|
|
74
|
-
checked = _this$
|
|
75
|
-
disabled = _this$
|
|
76
|
-
isReadOnly = _this$
|
|
77
|
-
palette = _this$
|
|
78
|
-
disabledTitle = _this$
|
|
79
|
-
title = _this$
|
|
80
|
-
text = _this$
|
|
81
|
-
labelPalette = _this$
|
|
82
|
-
size = _this$
|
|
83
|
-
labelSize = _this$
|
|
84
|
-
variant = _this$
|
|
85
|
-
active = _this$
|
|
86
|
-
isFilled = _this$
|
|
87
|
-
customClass = _this$
|
|
88
|
-
|
|
81
|
+
var _this$props3 = this.props,
|
|
82
|
+
id = _this$props3.id,
|
|
83
|
+
name = _this$props3.name,
|
|
84
|
+
value = _this$props3.value,
|
|
85
|
+
checked = _this$props3.checked,
|
|
86
|
+
disabled = _this$props3.disabled,
|
|
87
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
88
|
+
palette = _this$props3.palette,
|
|
89
|
+
disabledTitle = _this$props3.disabledTitle,
|
|
90
|
+
title = _this$props3.title,
|
|
91
|
+
text = _this$props3.text,
|
|
92
|
+
labelPalette = _this$props3.labelPalette,
|
|
93
|
+
size = _this$props3.size,
|
|
94
|
+
labelSize = _this$props3.labelSize,
|
|
95
|
+
variant = _this$props3.variant,
|
|
96
|
+
active = _this$props3.active,
|
|
97
|
+
isFilled = _this$props3.isFilled,
|
|
98
|
+
customClass = _this$props3.customClass,
|
|
99
|
+
customProps = _this$props3.customProps,
|
|
100
|
+
children = _this$props3.children,
|
|
101
|
+
a11y = _this$props3.a11y;
|
|
89
102
|
var _customClass$customRa = customClass.customRadioWrap,
|
|
90
103
|
customRadioWrap = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
91
104
|
_customClass$customRa2 = customClass.customRadio,
|
|
@@ -97,13 +110,18 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
97
110
|
var ariaHidden = a11y.ariaHidden,
|
|
98
111
|
_a11y$role = a11y.role,
|
|
99
112
|
role = _a11y$role === void 0 ? 'radio' : _a11y$role,
|
|
113
|
+
tabIndex = a11y.tabIndex,
|
|
100
114
|
_a11y$ariaChecked = a11y.ariaChecked,
|
|
101
115
|
ariaChecked = _a11y$ariaChecked === void 0 ? checked : _a11y$ariaChecked,
|
|
102
116
|
ariaLabel = a11y.ariaLabel,
|
|
103
117
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
104
118
|
_a11y$ariaReadonly = a11y.ariaReadonly,
|
|
105
119
|
ariaReadonly = _a11y$ariaReadonly === void 0 ? isReadOnly || disabled ? true : false : _a11y$ariaReadonly;
|
|
106
|
-
|
|
120
|
+
var _customProps$Containe = customProps.ContainerProps,
|
|
121
|
+
ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
|
|
122
|
+
_customProps$LabelPro = customProps.LabelProps,
|
|
123
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro;
|
|
124
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
107
125
|
dataId: value ? value.toLowerCase() : 'RadioComp',
|
|
108
126
|
isCover: false,
|
|
109
127
|
isInline: text ? false : true,
|
|
@@ -113,13 +131,14 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
113
131
|
"data-title": toolTip,
|
|
114
132
|
onClick: !isReadOnly && !disabled ? this.onChange : '',
|
|
115
133
|
"aria-checked": ariaChecked,
|
|
116
|
-
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
134
|
+
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
|
|
135
|
+
eleRef: this.handleGetRef,
|
|
117
136
|
role: role,
|
|
118
137
|
"aria-Hidden": ariaHidden,
|
|
119
138
|
"aria-label": ariaLabel,
|
|
120
139
|
"aria-labelledby": ariaLabelledby,
|
|
121
140
|
"aria-readonly": ariaReadonly
|
|
122
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
141
|
+
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
123
142
|
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(isReadOnly || disabled ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio)
|
|
124
143
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
125
144
|
type: "hidden",
|
|
@@ -144,17 +163,17 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
144
163
|
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
145
164
|
flexible: true,
|
|
146
165
|
className: _RadioModule["default"].text
|
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
166
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
148
167
|
text: text,
|
|
149
|
-
palette:
|
|
168
|
+
palette: labelPalette,
|
|
150
169
|
size: labelSize,
|
|
151
170
|
type: "title",
|
|
152
171
|
clipped: true,
|
|
153
172
|
dataId: "".concat(text, "_label"),
|
|
154
173
|
variant: variant,
|
|
155
174
|
title: toolTip ? toolTip : text,
|
|
156
|
-
customClass: "".concat(checked && active
|
|
157
|
-
})));
|
|
175
|
+
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(accessMode, " ").concat(customLabel)
|
|
176
|
+
}, LabelProps))), children);
|
|
158
177
|
}
|
|
159
178
|
}]);
|
|
160
179
|
|
|
@@ -1145,7 +1145,7 @@ exports[`Radio rendering the accessMode when disabled 1`] = `
|
|
|
1145
1145
|
data-test-id="boxComponent"
|
|
1146
1146
|
>
|
|
1147
1147
|
<label
|
|
1148
|
-
class="label title medium
|
|
1148
|
+
class="label title medium default font_default
|
|
1149
1149
|
dotted cursor
|
|
1150
1150
|
primaryLabel disabled "
|
|
1151
1151
|
data-id="RadioText_label"
|
|
@@ -1505,7 +1505,7 @@ exports[`Radio rendering the disabled is true 1`] = `
|
|
|
1505
1505
|
data-test-id="boxComponent"
|
|
1506
1506
|
>
|
|
1507
1507
|
<label
|
|
1508
|
-
class="label title medium
|
|
1508
|
+
class="label title medium default font_default
|
|
1509
1509
|
dotted cursor
|
|
1510
1510
|
undefined disabled "
|
|
1511
1511
|
data-id="RadioText_label"
|
|
@@ -1567,7 +1567,7 @@ exports[`Radio rendering the disabledTitle 1`] = `
|
|
|
1567
1567
|
data-test-id="boxComponent"
|
|
1568
1568
|
>
|
|
1569
1569
|
<label
|
|
1570
|
-
class="label title medium
|
|
1570
|
+
class="label title medium default font_default
|
|
1571
1571
|
dotted cursor
|
|
1572
1572
|
primaryLabel disabled "
|
|
1573
1573
|
data-id="RadioText_label"
|
|
@@ -14,6 +14,7 @@ var propTypes = {
|
|
|
14
14
|
checked: _propTypes["default"].bool,
|
|
15
15
|
disabled: _propTypes["default"].bool,
|
|
16
16
|
disabledTitle: _propTypes["default"].string,
|
|
17
|
+
getRef: _propTypes["default"].func,
|
|
17
18
|
id: _propTypes["default"].string,
|
|
18
19
|
isFilled: _propTypes["default"].bool,
|
|
19
20
|
isReadOnly: _propTypes["default"].bool,
|
|
@@ -30,14 +31,20 @@ var propTypes = {
|
|
|
30
31
|
customRadio: _propTypes["default"].string,
|
|
31
32
|
customLabel: _propTypes["default"].string
|
|
32
33
|
}),
|
|
34
|
+
customProps: _propTypes["default"].exact({
|
|
35
|
+
ContainerProps: _propTypes["default"].object,
|
|
36
|
+
LabelProps: _propTypes["default"].object
|
|
37
|
+
}),
|
|
33
38
|
a11y: _propTypes["default"].shape({
|
|
34
39
|
ariaChecked: _propTypes["default"].bool,
|
|
35
40
|
ariaHidden: _propTypes["default"].bool,
|
|
36
41
|
role: _propTypes["default"].string,
|
|
42
|
+
tabIndex: _propTypes["default"].oneOfType(_propTypes["default"].string, _propTypes["default"].number),
|
|
37
43
|
ariaLabelledby: _propTypes["default"].string,
|
|
38
44
|
ariaLabel: _propTypes["default"].string,
|
|
39
45
|
ariaReadonly: _propTypes["default"].bool
|
|
40
46
|
}),
|
|
47
|
+
children: _propTypes["default"].node,
|
|
41
48
|
onChange: _propTypes["default"].func,
|
|
42
49
|
text: _propTypes["default"].string
|
|
43
50
|
};
|
package/lib/Tag/Tag.js
CHANGED
|
@@ -183,7 +183,7 @@ var Tag = /*#__PURE__*/function (_PureComponent) {
|
|
|
183
183
|
}, text), onRemove && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
184
184
|
customClass: "".concat(_TagModule["default"].close, " ").concat(active ? _TagModule["default"]["active".concat(closePalette, "Close")] : '', "\n ").concat(rounded ? _TagModule["default"].lgRadiusClose : _TagModule["default"].smRadiusClose, " ").concat(isDarkPalette ? _TagModule["default"].darkTagClose : '', "\n ").concat(customTagClose, " ").concat(_TagModule["default"]["close".concat(closePalette)]),
|
|
185
185
|
dataId: "".concat(dataId, "_RemoveTag"),
|
|
186
|
-
|
|
186
|
+
title: closeTitle,
|
|
187
187
|
onClick: this.handleRemove,
|
|
188
188
|
a11y: {
|
|
189
189
|
ariaLabel: clearLabel
|
|
@@ -38,6 +38,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
38
38
|
isFilled = props.isFilled,
|
|
39
39
|
isClipped = props.isClipped,
|
|
40
40
|
getRef = props.getRef,
|
|
41
|
+
getContainerRef = props.getContainerRef,
|
|
41
42
|
variant = props.variant,
|
|
42
43
|
active = props.active,
|
|
43
44
|
dataId = props.dataId,
|
|
@@ -53,6 +54,10 @@ var CheckBox = function CheckBox(props) {
|
|
|
53
54
|
onChange && onChange(!checked, e);
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
function handleGetContainerRef(ele) {
|
|
58
|
+
getContainerRef && getContainerRef(ele, id);
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
var _customProps$CheckBox = customProps.CheckBoxProps,
|
|
57
62
|
CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
|
|
58
63
|
_customProps$LabelPro = customProps.LabelProps,
|
|
@@ -85,6 +90,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
85
90
|
onClick: isReadOnly || disabled ? null : onChange,
|
|
86
91
|
tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
87
92
|
"aria-checked": ariaChecked,
|
|
93
|
+
eleRef: handleGetContainerRef,
|
|
88
94
|
role: role,
|
|
89
95
|
"aria-label": ariaLabel,
|
|
90
96
|
"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
|
|
|
@@ -1006,12 +1016,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1006
1016
|
onError = _this$props11.onError,
|
|
1007
1017
|
startDate = _this$props11.startDate,
|
|
1008
1018
|
endDate = _this$props11.endDate;
|
|
1009
|
-
var _this$
|
|
1010
|
-
_this$
|
|
1011
|
-
value = _this$
|
|
1012
|
-
isError = _this$
|
|
1013
|
-
isDateEdited = _this$
|
|
1014
|
-
isFocused = _this$
|
|
1019
|
+
var _this$state6 = this.state,
|
|
1020
|
+
_this$state6$selected = _this$state6.selected,
|
|
1021
|
+
value = _this$state6$selected === void 0 ? '' : _this$state6$selected,
|
|
1022
|
+
isError = _this$state6.isError,
|
|
1023
|
+
isDateEdited = _this$state6.isDateEdited,
|
|
1024
|
+
isFocused = _this$state6.isFocused;
|
|
1015
1025
|
var showValue = this.handleGetShowValue();
|
|
1016
1026
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1017
1027
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
|
@@ -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("../../DropBox/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("../../DropBox/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
|
+
}
|