@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.
Files changed (54) hide show
  1. package/.cli/UnValidatedFiles.html +101 -0
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +15 -0
  4. package/es/CheckBox/CheckBox.js +10 -0
  5. package/es/CheckBox/props/propTypes.js +1 -0
  6. package/es/DateTime/DateWidget.js +13 -4
  7. package/es/DropBox/DropBox.js +5 -15
  8. package/es/DropBox/utils/isMobilePopover.js +17 -0
  9. package/es/MultiSelect/MultiSelect.js +75 -92
  10. package/es/MultiSelect/MultiSelectWithAvatar.js +73 -90
  11. package/es/Radio/Radio.js +26 -7
  12. package/es/Radio/Radio.module.css +3 -0
  13. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  14. package/es/Radio/props/defaultProps.js +1 -0
  15. package/es/Radio/props/propTypes.js +7 -0
  16. package/es/Tag/Tag.js +1 -1
  17. package/es/v1/CheckBox/CheckBox.js +6 -0
  18. package/es/v1/CheckBox/props/propTypes.js +1 -0
  19. package/es/v1/DateTime/DateWidget.js +13 -4
  20. package/es/v1/DropBox/DropBox.js +3 -14
  21. package/es/v1/DropBox/utils/isMobilePopover.js +17 -0
  22. package/es/v1/MultiSelect/MultiSelect.js +75 -93
  23. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +74 -91
  24. package/es/v1/Radio/Radio.js +22 -7
  25. package/es/v1/Radio/props/defaultProps.js +1 -0
  26. package/es/v1/Radio/props/propTypes.js +7 -0
  27. package/es/v1/Tag/Tag.js +1 -1
  28. package/lib/CheckBox/CheckBox.js +34 -24
  29. package/lib/CheckBox/props/propTypes.js +1 -0
  30. package/lib/DateTime/DateWidget.js +21 -11
  31. package/lib/DropBox/DropBox.js +3 -13
  32. package/lib/DropBox/utils/isMobilePopover.js +25 -0
  33. package/lib/MultiSelect/MultiSelect.js +74 -91
  34. package/lib/MultiSelect/MultiSelectWithAvatar.js +72 -89
  35. package/lib/Radio/Radio.js +45 -26
  36. package/lib/Radio/Radio.module.css +3 -0
  37. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  38. package/lib/Radio/props/defaultProps.js +1 -0
  39. package/lib/Radio/props/propTypes.js +7 -0
  40. package/lib/Tag/Tag.js +1 -1
  41. package/lib/v1/CheckBox/CheckBox.js +6 -0
  42. package/lib/v1/CheckBox/props/propTypes.js +1 -0
  43. package/lib/v1/DateTime/DateWidget.js +21 -11
  44. package/lib/v1/DropBox/DropBox.js +3 -13
  45. package/lib/v1/DropBox/utils/isMobilePopover.js +25 -0
  46. package/lib/v1/MultiSelect/MultiSelect.js +76 -93
  47. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +71 -90
  48. package/lib/v1/Radio/Radio.js +22 -7
  49. package/lib/v1/Radio/props/defaultProps.js +1 -0
  50. package/lib/v1/Radio/props/propTypes.js +7 -0
  51. package/lib/v1/Tag/Tag.js +1 -1
  52. package/package.json +6 -6
  53. package/propValidationArg.json +8 -4
  54. 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(_CustomResponsive.ResponsiveReceiver, {
183
- query: this.responsiveFunc,
184
- responsiveId: "Helmet"
185
- }, function (_ref2) {
186
- var tabletMode = _ref2.tabletMode;
187
- return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
188
- animationStyle: animationStyle,
189
- boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
190
- getRef: getContainerRef,
191
- isActive: isPopupReady,
192
- isAnimate: isAnimate,
193
- isArrow: false,
194
- onClick: removeClose,
195
- needResponsive: needResponsive,
196
- isPadding: false,
197
- isBoxPaddingNeed: isBoxPaddingNeed,
198
- palette: palette,
199
- htmlId: setAriaId,
200
- a11y: {
201
- ariaMultiselectable: true,
202
- role: 'listbox'
203
- },
204
- isResponsivePadding: true,
205
- alignBox: "row"
206
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
207
- flexible: true
208
- }, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
209
- customClass: "".concat(_MultiSelectModule["default"].box, " ").concat(_MultiSelectModule["default"]["".concat(palette, "Box")]),
210
- onScroll: _this2.handleScroll
211
- }, tabletMode && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_MobileHeader["default"], {
212
- selectedOptions: selectedOptions,
213
- i18nKeys: i18nKeys,
214
- onClick: _this2.handlePopupClose
215
- }, /*#__PURE__*/_react["default"].createElement("div", {
216
- className: _MultiSelectModule["default"].effect
217
- }, _this2.getSelectionUI(true)))), needSelectAll ? /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
218
- onSelect: _this2.handleSelectAll,
219
- selectAllText: selectAllText,
220
- suggestions: suggestions,
221
- dataId: dataId
222
- })) : null, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
223
- align: "both",
224
- className: _MultiSelectModule["default"].loader
225
- }, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
226
- shrink: true,
227
- customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
228
- eleRef: _this2.suggestionContainerRef
229
- }, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
230
- needTick: keepSelectedOptions,
231
- suggestions: suggestions,
232
- getRef: _this2.suggestionItemRef,
233
- hoverOption: hoverOption,
234
- onClick: _this2.handleSelectOption,
235
- onMouseEnter: _this2.handleMouseEnter,
236
- needBorder: false,
237
- dataId: "".concat(dataId, "_Options"),
238
- palette: palette,
239
- selectedOptions: selectedOptionIds,
240
- a11y: {
241
- role: 'option'
242
- }
243
- }, SuggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
244
- isLoading: isFetchingOptions,
245
- options: options,
246
- searchString: searchStr,
247
- suggestions: suggestions,
248
- dataId: dataId,
249
- palette: palette,
250
- i18nKeys: i18nKeys,
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
 
@@ -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$props2 = this.props,
71
- id = _this$props2.id,
72
- name = _this$props2.name,
73
- value = _this$props2.value,
74
- checked = _this$props2.checked,
75
- disabled = _this$props2.disabled,
76
- isReadOnly = _this$props2.isReadOnly,
77
- palette = _this$props2.palette,
78
- disabledTitle = _this$props2.disabledTitle,
79
- title = _this$props2.title,
80
- text = _this$props2.text,
81
- labelPalette = _this$props2.labelPalette,
82
- size = _this$props2.size,
83
- labelSize = _this$props2.labelSize,
84
- variant = _this$props2.variant,
85
- active = _this$props2.active,
86
- isFilled = _this$props2.isFilled,
87
- customClass = _this$props2.customClass,
88
- a11y = _this$props2.a11y;
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
- return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
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: disabled ? 'disable' : labelPalette,
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 && !disabled ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(accessMode, " ").concat(customLabel)
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
 
@@ -21,6 +21,9 @@
21
21
  .readonly, .disabled {
22
22
  cursor: not-allowed;
23
23
  }
24
+ .disabled {
25
+ opacity: 0.7
26
+ }
24
27
  .radio {
25
28
  composes: offSelection from '../common/common.module.css';
26
29
  width: var(--radio_width);
@@ -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 disable font_default
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 disable font_default
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 disable font_default
1570
+ class="label title medium default font_default
1571
1571
  dotted cursor
1572
1572
  primaryLabel disabled "
1573
1573
  data-id="RadioText_label"
@@ -16,6 +16,7 @@ var defaultProps = {
16
16
  variant: 'default',
17
17
  isFilled: true,
18
18
  customClass: {},
19
+ customProps: {},
19
20
  a11y: {}
20
21
  };
21
22
  exports.defaultProps = defaultProps;
@@ -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
- "data-title": closeTitle,
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$state$dateForma = this.state.dateFormatSelection,
938
- dateFormatSelection = _this$state$dateForma === void 0 ? {} : _this$state$dateForma;
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
- this.DateTimeYearViewToggle(true, isMonthOpen);
957
- } else if (yearViewTypes.indexOf(focusedType) === -1 && isYearView) {
958
- this.DateTimeYearViewToggle(false, false);
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$state5 = this.state,
1010
- _this$state5$selected = _this$state5.selected,
1011
- value = _this$state5$selected === void 0 ? '' : _this$state5$selected,
1012
- isError = _this$state5.isError,
1013
- isDateEdited = _this$state5.isDateEdited,
1014
- isFocused = _this$state5.isFocused;
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 windowWidth,
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
+ }