@zohodesk/components 1.0.0-temp-203.2 → 1.0.0-temp-204

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 (141) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +25 -0
  3. package/es/CheckBox/CheckBox.js +3 -2
  4. package/es/CheckBox/props/propTypes.js +2 -1
  5. package/es/DateTime/DateWidget.js +8 -3
  6. package/es/DateTime/DateWidget.module.css +1 -0
  7. package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
  8. package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
  9. package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
  10. package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
  11. package/es/DropBox/DropBoxPositionMapping.js +142 -0
  12. package/es/ListItem/ListItemWithAvatar.js +9 -5
  13. package/es/ListItem/props/defaultProps.js +1 -0
  14. package/es/ListItem/props/propTypes.js +4 -1
  15. package/es/MultiSelect/MultiSelect.js +11 -3
  16. package/es/MultiSelect/MultiSelect.module.css +4 -0
  17. package/es/MultiSelect/Suggestions.js +2 -0
  18. package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
  19. package/es/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
  20. package/es/MultiSelect/props/defaultProps.js +2 -1
  21. package/es/MultiSelect/props/propTypes.js +5 -1
  22. package/es/Popup/Popup.js +1 -1
  23. package/es/Popup/PositionMapping.js +72 -0
  24. package/es/Provider/LibraryContext.js +15 -3
  25. package/es/Provider/LibraryContextInit.js +1 -1
  26. package/es/Tab/Tabs.js +124 -20
  27. package/es/Tab/Tabs.module.css +33 -2
  28. package/es/Tab/props/defaultProps.js +3 -1
  29. package/es/Tab/props/propTypes.js +6 -1
  30. package/es/Tag/Tag.js +3 -1
  31. package/es/Tag/__tests__/Tag.spec.js +10 -0
  32. package/es/Tag/__tests__/__snapshots__/Tag.spec.js.snap +20 -0
  33. package/es/Tag/props/defaultProps.js +1 -0
  34. package/es/Tag/props/propTypes.js +1 -0
  35. package/es/TextBoxIcon/TextBoxIcon.js +13 -3
  36. package/es/TextBoxIcon/props/defaultProps.js +1 -0
  37. package/es/TextBoxIcon/props/propTypes.js +3 -1
  38. package/es/{Select → select}/Select.js +13 -8
  39. package/es/{Select → select}/Select.module.css +3 -0
  40. package/es/{Select → select}/SelectWithIcon.js +24 -4
  41. package/es/{Select → select}/__tests__/__snapshots__/Select.spec.js.snap +1 -1
  42. package/{lib/Select → es/select}/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
  43. package/es/{Select → select}/props/defaultProps.js +2 -1
  44. package/es/{Select → select}/props/propTypes.js +7 -1
  45. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
  46. package/es/v1/ListItem/ListItemWithAvatar.js +9 -5
  47. package/es/v1/ListItem/props/defaultProps.js +1 -0
  48. package/es/v1/ListItem/props/propTypes.js +4 -1
  49. package/es/v1/MultiSelect/Suggestions.js +2 -0
  50. package/es/v1/MultiSelect/props/propTypes.js +1 -0
  51. package/es/v1/Popup/Popup.js +1 -1
  52. package/es/v1/Select/Select.js +3 -1
  53. package/es/v1/Select/props/propTypes.js +1 -0
  54. package/es/v1/Tag/Tag.js +3 -1
  55. package/es/v1/Tag/props/defaultProps.js +1 -0
  56. package/es/v1/Tag/props/propTypes.js +1 -0
  57. package/es/v1/TextBoxIcon/TextBoxIcon.js +9 -1
  58. package/es/v1/TextBoxIcon/props/defaultProps.js +1 -0
  59. package/es/v1/TextBoxIcon/props/propTypes.js +1 -0
  60. package/lib/CheckBox/CheckBox.js +3 -2
  61. package/lib/CheckBox/props/propTypes.js +2 -1
  62. package/lib/DateTime/DateWidget.js +11 -4
  63. package/lib/DateTime/DateWidget.module.css +1 -0
  64. package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
  65. package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
  66. package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
  67. package/lib/DropBox/DropBoxElement/DropBoxElement.js +1 -1
  68. package/lib/DropBox/DropBoxPositionMapping.js +149 -0
  69. package/lib/ListItem/ListItemWithAvatar.js +9 -5
  70. package/lib/ListItem/props/defaultProps.js +1 -0
  71. package/lib/ListItem/props/propTypes.js +4 -2
  72. package/lib/MultiSelect/MultiSelect.js +12 -4
  73. package/lib/MultiSelect/MultiSelect.module.css +4 -0
  74. package/lib/MultiSelect/Suggestions.js +2 -0
  75. package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
  76. package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
  77. package/lib/MultiSelect/props/defaultProps.js +2 -1
  78. package/lib/MultiSelect/props/propTypes.js +5 -1
  79. package/lib/Popup/Popup.js +1 -1
  80. package/lib/Popup/PositionMapping.js +81 -0
  81. package/lib/Provider/LibraryContext.js +15 -5
  82. package/lib/Provider/LibraryContextInit.js +1 -1
  83. package/lib/Tab/Tabs.js +125 -27
  84. package/lib/Tab/Tabs.module.css +33 -2
  85. package/lib/Tab/props/defaultProps.js +3 -1
  86. package/lib/Tab/props/propTypes.js +6 -1
  87. package/lib/Tag/Tag.js +5 -2
  88. package/lib/Tag/__tests__/Tag.spec.js +10 -0
  89. package/lib/Tag/__tests__/__snapshots__/Tag.spec.js.snap +20 -0
  90. package/lib/Tag/props/defaultProps.js +1 -0
  91. package/lib/Tag/props/propTypes.js +1 -0
  92. package/lib/TextBoxIcon/TextBoxIcon.js +14 -3
  93. package/lib/TextBoxIcon/props/defaultProps.js +1 -0
  94. package/lib/TextBoxIcon/props/propTypes.js +3 -1
  95. package/lib/{Select → select}/Select.js +14 -9
  96. package/lib/{Select → select}/Select.module.css +3 -0
  97. package/lib/{Select → select}/SelectWithIcon.js +33 -6
  98. package/lib/{Select → select}/__tests__/__snapshots__/Select.spec.js.snap +1 -1
  99. package/{es/Select → lib/select}/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
  100. package/lib/{Select → select}/props/defaultProps.js +1 -1
  101. package/lib/{Select → select}/props/propTypes.js +7 -1
  102. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
  103. package/lib/v1/ListItem/ListItemWithAvatar.js +9 -5
  104. package/lib/v1/ListItem/props/defaultProps.js +1 -0
  105. package/lib/v1/ListItem/props/propTypes.js +4 -2
  106. package/lib/v1/MultiSelect/Suggestions.js +2 -0
  107. package/lib/v1/MultiSelect/props/propTypes.js +1 -0
  108. package/lib/v1/Popup/Popup.js +1 -1
  109. package/lib/v1/Select/Select.js +4 -2
  110. package/lib/v1/Select/props/propTypes.js +1 -0
  111. package/lib/v1/Tag/Tag.js +5 -2
  112. package/lib/v1/Tag/props/defaultProps.js +1 -0
  113. package/lib/v1/Tag/props/propTypes.js +1 -0
  114. package/lib/v1/TextBoxIcon/TextBoxIcon.js +9 -1
  115. package/lib/v1/TextBoxIcon/props/defaultProps.js +1 -0
  116. package/lib/v1/TextBoxIcon/props/propTypes.js +1 -0
  117. package/package.json +1 -1
  118. package/propValidationArg.json +1 -1
  119. package/result.json +1 -1
  120. package/es/DropBox/DropBoxPositionMapping.json +0 -145
  121. package/es/Popup/PositionMapping.json +0 -74
  122. package/lib/DropBox/DropBoxPositionMapping.json +0 -145
  123. package/lib/Popup/PositionMapping.json +0 -74
  124. /package/es/{Select → select}/GroupSelect.js +0 -0
  125. /package/es/{Select → select}/SelectWithAvatar.js +0 -0
  126. /package/es/{Select → select}/__tests__/GroupSelect.spec.js +0 -0
  127. /package/es/{Select → select}/__tests__/Select.spec.js +0 -0
  128. /package/es/{Select → select}/__tests__/SelectWithAvatar.spec.js +0 -0
  129. /package/es/{Select → select}/__tests__/SelectWithIcon.spec.js +0 -0
  130. /package/es/{Select → select}/__tests__/__snapshots__/GroupSelect.spec.js.snap +0 -0
  131. /package/es/{Select → select}/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +0 -0
  132. /package/es/{Select → select}/index.js +0 -0
  133. /package/lib/{Select → select}/GroupSelect.js +0 -0
  134. /package/lib/{Select → select}/SelectWithAvatar.js +0 -0
  135. /package/lib/{Select → select}/__tests__/GroupSelect.spec.js +0 -0
  136. /package/lib/{Select → select}/__tests__/Select.spec.js +0 -0
  137. /package/lib/{Select → select}/__tests__/SelectWithAvatar.spec.js +0 -0
  138. /package/lib/{Select → select}/__tests__/SelectWithIcon.spec.js +0 -0
  139. /package/lib/{Select → select}/__tests__/__snapshots__/GroupSelect.spec.js.snap +0 -0
  140. /package/lib/{Select → select}/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +0 -0
  141. /package/lib/{Select → select}/index.js +0 -0
@@ -3052,3 +3052,23 @@ exports[`Tag component rendering the Custom class 1`] = `
3052
3052
  </div>
3053
3053
  </DocumentFragment>
3054
3054
  `;
3055
+
3056
+ exports[`Tag component rendering with customAttributes prop 1`] = `
3057
+ <DocumentFragment>
3058
+ <div
3059
+ aria-labelledby="1"
3060
+ class="container effect medium lgRadius default "
3061
+ data-custom-attribute="true"
3062
+ data-id="tag_Tag"
3063
+ data-selector-id="tag"
3064
+ data-test-id="tag_Tag"
3065
+ tabindex="0"
3066
+ >
3067
+ <div
3068
+ aria-hidden="true"
3069
+ class="text mediumtext"
3070
+ id="1"
3071
+ />
3072
+ </div>
3073
+ </DocumentFragment>
3074
+ `;
@@ -13,6 +13,7 @@ var defaultProps = {
13
13
  size: 'medium',
14
14
  dataId: 'tag',
15
15
  customClass: {},
16
+ customAttributes: {},
16
17
  a11y: {},
17
18
  needEffect: true,
18
19
  isReadOnly: false,
@@ -36,6 +36,7 @@ var propTypes = {
36
36
  customTagIcon: _propTypes["default"].string,
37
37
  customAvatar: _propTypes["default"].string
38
38
  }),
39
+ customAttributes: _propTypes["default"].object,
39
40
  a11y: _propTypes["default"].shape({
40
41
  clearLabel: _propTypes["default"].string
41
42
  }),
@@ -66,6 +66,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
66
66
  _this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
67
67
  _this.handleRef = _this.handleRef.bind(_assertThisInitialized(_this));
68
68
  _this.handleClear = _this.handleClear.bind(_assertThisInitialized(_this));
69
+ _this.handleInputFocusOnClick = _this.handleInputFocusOnClick.bind(_assertThisInitialized(_this));
69
70
  return _this;
70
71
  }
71
72
 
@@ -109,6 +110,13 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
109
110
  });
110
111
  onBlur && onBlur(e);
111
112
  }
113
+ }, {
114
+ key: "handleInputFocusOnClick",
115
+ value: function handleInputFocusOnClick() {
116
+ this.inputEle && this.inputEle.focus({
117
+ preventScroll: true
118
+ });
119
+ }
112
120
  }, {
113
121
  key: "render",
114
122
  value: function render() {
@@ -148,7 +156,9 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
148
156
  isFocus = _this$props2.isFocus,
149
157
  onClearMouseDown = _this$props2.onClearMouseDown,
150
158
  isScrollPrevent = _this$props2.isScrollPrevent,
151
- customProps = _this$props2.customProps;
159
+ customProps = _this$props2.customProps,
160
+ needInputFocusOnWrapperClick = _this$props2.needInputFocusOnWrapperClick,
161
+ renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode;
152
162
  var isActive = this.state.isActive;
153
163
  var _customClass$customTB = customClass.customTBoxWrap,
154
164
  customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
@@ -167,7 +177,8 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
167
177
  isCover: false,
168
178
  className: "".concat(_TextBoxIconModule["default"].container, " ").concat(isDisabled ? _TextBoxIconModule["default"].disabled : isReadOnly ? needEffect ? _TextBoxIconModule["default"].effect : _TextBoxIconModule["default"].readonly : _TextBoxIconModule["default"].effect, " ").concat(isActive || isFocus ? _TextBoxIconModule["default"].effectFocused : '', " ").concat(customTBoxWrap, " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _TextBoxIconModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _TextBoxIconModule["default"].iconOnHoverStyle : ''),
169
179
  dataSelectorId: dataSelectorId,
170
- "data-title": isDisabled ? title : null
180
+ "data-title": isDisabled ? title : null,
181
+ onClick: needInputFocusOnWrapperClick && !isDisabled ? this.handleInputFocusOnClick : null
171
182
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
172
183
  flexible: true
173
184
  }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], _extends({}, this.props, {
@@ -217,7 +228,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
217
228
  size: "14"
218
229
  }))) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
219
230
  className: "".concat(_TextBoxIconModule["default"].icon, " ").concat(iconRotated ? _TextBoxIconModule["default"].rotated : '')
220
- }, children) : null)), needBorder && /*#__PURE__*/_react["default"].createElement("div", {
231
+ }, children) : null, renderRightPlaceholderNode ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, renderRightPlaceholderNode) : null)), needBorder && /*#__PURE__*/_react["default"].createElement("div", {
221
232
  className: "".concat(_TextBoxIconModule["default"].line, " ").concat(_TextBoxIconModule["default"]["borderColor_".concat(borderColor)], " ").concat(customTBoxLine)
222
233
  }));
223
234
  }
@@ -16,6 +16,7 @@ var defaultProps = {
16
16
  needReadOnlyStyle: true,
17
17
  isClickable: false,
18
18
  needEffect: true,
19
+ needInputFocusOnWrapperClick: false,
19
20
  dataId: 'textBoxIcon',
20
21
  borderColor: 'default',
21
22
  showClearIcon: false,
@@ -37,6 +37,7 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
37
37
  needBorder: _propTypes["default"].bool,
38
38
  needEffect: _propTypes["default"].bool,
39
39
  needReadOnlyStyle: _propTypes["default"].bool,
40
+ needInputFocusOnWrapperClick: _propTypes["default"].bool,
40
41
  onBlur: _propTypes["default"].func,
41
42
  onChange: _propTypes["default"].func,
42
43
  onClear: _propTypes["default"].func,
@@ -65,7 +66,8 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
65
66
  isScrollPrevent: _propTypes["default"].bool,
66
67
  customProps: _propTypes["default"].shape({
67
68
  TextBoxProps: _propTypes["default"].object
68
- })
69
+ }),
70
+ renderRightPlaceholderNode: _propTypes["default"].node
69
71
  });
70
72
 
71
73
  exports.propTypes = propTypes;
@@ -798,7 +798,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
798
798
  _customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
799
799
  DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
800
800
  _customProps$Suggesti = customProps.SuggestionsProps,
801
- SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
801
+ SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
802
+ _customProps$TextBoxI = customProps.TextBoxIconProps,
803
+ TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
802
804
  return /*#__PURE__*/_react["default"].createElement("div", {
803
805
  className: "".concat(isParentBased || isReadOnly || isDisabled ? _SelectModule["default"].container : '', " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : '', " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverStyle : ''),
804
806
  "data-title": isDisabled ? title : null,
@@ -809,7 +811,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
809
811
  ref: getTargetRef,
810
812
  "data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
811
813
  "data-test-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId)
812
- }, needSelectDownIcon ? /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
814
+ }, needSelectDownIcon ? /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
813
815
  a11y: {
814
816
  role: 'Menuitem',
815
817
  ariaLabel: TextBox_ally_label,
@@ -851,13 +853,13 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
851
853
  'data-title': title || selected
852
854
  }, TextBoxProps)
853
855
  }
854
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
856
+ }, TextBoxIconProps), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
857
+ isInline: true,
858
+ isCover: false,
855
859
  alignBox: "row",
856
- align: "both"
857
- }, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
858
- className: isPopupOpen ? _SelectModule["default"].rotate : '',
859
- dataId: "".concat(dataId, "_children")
860
- }, children) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
860
+ align: "both",
861
+ className: _SelectModule["default"].rightPlaceholder
862
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
861
863
  align: "both",
862
864
  dataId: "".concat(dataId, "_downIcon"),
863
865
  "aria-hidden": true,
@@ -865,7 +867,10 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
865
867
  }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
866
868
  name: "ZD-down",
867
869
  size: "7"
868
- })))) : /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
870
+ })), children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
871
+ className: isPopupOpen ? _SelectModule["default"].rotate : '',
872
+ dataId: "".concat(dataId, "_children")
873
+ }, children) : null)) : /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
869
874
  a11y: {
870
875
  role: 'Menuitem',
871
876
  ariaLabel: TextBox_ally_label,
@@ -117,6 +117,9 @@
117
117
  .rotate {
118
118
  transform: rotateX(180deg);
119
119
  }
120
+ .rightPlaceholder{
121
+ height: 100% ;
122
+ }
120
123
 
121
124
  .iconOnHoverStyle .arrowIcon,
122
125
  .iconOnHoverReadonly .arrowIcon,
@@ -45,6 +45,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
45
45
 
46
46
  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; }
47
47
 
48
+ 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); }
49
+
50
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
51
+
52
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
53
+
54
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
55
+
48
56
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
49
57
 
50
58
  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); } }
@@ -410,7 +418,8 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
410
418
  i18nKeys = _this$props7.i18nKeys,
411
419
  htmlId = _this$props7.htmlId,
412
420
  isLoading = _this$props7.isLoading,
413
- dataSelectorId = _this$props7.dataSelectorId;
421
+ dataSelectorId = _this$props7.dataSelectorId,
422
+ customProps = _this$props7.customProps;
414
423
  i18nKeys = Object.assign({}, i18nKeys, {
415
424
  emptyText: i18nKeys.emptyText || emptyMessage,
416
425
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
@@ -422,6 +431,12 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
422
431
  isFetchingOptions = _this$state3.isFetchingOptions;
423
432
  var setAriaId = this.getNextAriaId();
424
433
  var ariaErrorId = this.getNextAriaId();
434
+ var _customProps$TextBoxP = customProps.TextBoxProps,
435
+ TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
436
+ _customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
437
+ DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
438
+ _customProps$TextBoxI = customProps.TextBoxIconProps,
439
+ TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
425
440
  return /*#__PURE__*/_react["default"].createElement("div", {
426
441
  className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : ''),
427
442
  "data-title": isDisabled ? title : null,
@@ -444,7 +459,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
444
459
  dataId: "".concat(dataId, "_icon")
445
460
  })) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
446
461
  flexible: true
447
- }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
462
+ }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
448
463
  a11y: {
449
464
  role: 'combobox',
450
465
  ariaLabel: 'click to select options',
@@ -476,10 +491,19 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
476
491
  needEffect: isReadOnly || isDisabled ? false : true,
477
492
  borderColor: borderColor,
478
493
  autoComplete: false,
479
- isFocus: isPopupReady
480
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
494
+ isFocus: isPopupReady,
495
+ customProps: {
496
+ TextBoxProps: _objectSpread({
497
+ 'data-title': title || selectedValue
498
+ }, TextBoxProps)
499
+ }
500
+ }, TextBoxIconProps), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
501
+ isInline: true,
502
+ isCover: false,
481
503
  align: "both",
482
- dataId: "".concat(dataId, "_downIcon")
504
+ dataId: "".concat(dataId, "_downIcon"),
505
+ alignBox: "both",
506
+ className: _SelectModule["default"].rightPlaceholder
483
507
  }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
484
508
  name: "ZD-down",
485
509
  size: "7"
@@ -528,7 +552,10 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
528
552
  a11y: {
529
553
  ariaDescribedby: ariaErrorId
530
554
  },
531
- autoComplete: false
555
+ autoComplete: false,
556
+ customProps: {
557
+ TextBoxProps: DropdownSearchTextBoxProps
558
+ }
532
559
  }))) : null, /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
533
560
  customClass: "".concat(tabletMode ? _SelectModule["default"].responsivedropBoxList : _SelectModule["default"].dropBoxList, " ").concat(!tabletMode && dropBoxSize ? _SelectModule["default"][dropBoxSize] : ''),
534
561
  shrink: true,
@@ -62,7 +62,7 @@ exports[`Select rendering the defult props 1`] = `
62
62
  data-test-id="boxComponent"
63
63
  >
64
64
  <div
65
- class="flex cover rowdir both"
65
+ class="rightPlaceholder inflex rowdir both"
66
66
  data-id="containerComponent"
67
67
  data-selector-id="container"
68
68
  data-test-id="containerComponent"
@@ -79,7 +79,7 @@ exports[`SelectWithIcon rendering the defult props 1`] = `
79
79
  data-test-id="boxComponent"
80
80
  >
81
81
  <div
82
- class="flex cover coldir both"
82
+ class="rightPlaceholder inflex both"
83
83
  data-id="selectWithIcon_downIcon"
84
84
  data-selector-id="container"
85
85
  data-test-id="selectWithIcon_downIcon"
@@ -117,5 +117,5 @@ var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
117
117
  needListBorder: false,
118
118
  needSearch: false,
119
119
  boxSize: 'default'
120
- }, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _SelectWithIcon_defau);
120
+ }, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}), _SelectWithIcon_defau);
121
121
  exports.SelectWithIcon_defaultProps = SelectWithIcon_defaultProps;
@@ -96,6 +96,7 @@ var Select_propTypes = {
96
96
  iconOnHover: _propTypes["default"].bool,
97
97
  customProps: _propTypes["default"].shape({
98
98
  TextBoxProps: _propTypes["default"].object,
99
+ TextBoxIconProps: _propTypes["default"].object,
99
100
  DropdownSearchTextBoxProps: _propTypes["default"].object,
100
101
  listItemProps: _propTypes["default"].object,
101
102
  SuggestionsProps: _propTypes["default"].object
@@ -305,6 +306,11 @@ var SelectWithIcon_propTypes = {
305
306
  searchBoxSize: _propTypes["default"].string,
306
307
  needResponsive: _propTypes["default"].bool,
307
308
  boxSize: _propTypes["default"].string,
308
- emptyMessage: _propTypes["default"].string
309
+ emptyMessage: _propTypes["default"].string,
310
+ customProps: _propTypes["default"].shape({
311
+ TextBoxProps: _propTypes["default"].object,
312
+ DropdownSearchTextBoxProps: _propTypes["default"].object,
313
+ TextBoxIconProps: _propTypes["default"].object
314
+ })
309
315
  };
310
316
  exports.SelectWithIcon_propTypes = SelectWithIcon_propTypes;
@@ -11,7 +11,7 @@ var _useDropboxPosCalc2 = _interopRequireDefault(require("../../../DropBox/DropB
11
11
 
12
12
  var _cssJSLogic2 = _interopRequireDefault(require("../../../DropBox/DropBoxElement/css/cssJSLogic"));
13
13
 
14
- var _DropBoxPositionMapping = require("../../../DropBox/DropBoxPositionMapping.json");
14
+ var _DropBoxPositionMapping = require("../../../DropBox/DropBoxPositionMapping.js");
15
15
 
16
16
  var _defaultProps = require("./props/defaultProps");
17
17
 
@@ -41,6 +41,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
41
41
 
42
42
  var ListItemWithAvatar = function ListItemWithAvatar(props) {
43
43
  var size = props.size,
44
+ avatarSize = props.avatarSize,
44
45
  active = props.active,
45
46
  highlight = props.highlight,
46
47
  value = props.value,
@@ -67,7 +68,8 @@ var ListItemWithAvatar = function ListItemWithAvatar(props) {
67
68
  id = props.id,
68
69
  getRef = props.getRef,
69
70
  onClick = props.onClick,
70
- onMouseEnter = props.onMouseEnter;
71
+ onMouseEnter = props.onMouseEnter,
72
+ onAvatarClick = props.onAvatarClick;
71
73
 
72
74
  function handleRef(ele) {
73
75
  getRef && getRef(ele, index, id);
@@ -123,7 +125,7 @@ var ListItemWithAvatar = function ListItemWithAvatar(props) {
123
125
  className: _ListItemModule["default"].leftAvatar
124
126
  }, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
125
127
  name: name,
126
- size: "small",
128
+ size: avatarSize,
127
129
  src: imgSrc,
128
130
  needTitle: needAvatarTitle,
129
131
  textPalette: isDarkPalette ? 'white' : '',
@@ -131,16 +133,18 @@ var ListItemWithAvatar = function ListItemWithAvatar(props) {
131
133
  customClass: {
132
134
  customAvatar: customAvatar,
133
135
  customAvatarTeam: customAvatarTeam
134
- }
136
+ },
137
+ onClick: onAvatarClick
135
138
  }) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
136
139
  name: name,
137
- size: "small",
140
+ size: avatarSize,
138
141
  src: imgSrc,
139
142
  initial: initial,
140
143
  textPalette: isDarkPalette ? 'white' : '',
141
144
  needTitle: needAvatarTitle,
142
145
  palette: isDarkPalette ? 'info' : avatarPalette,
143
- customClass: customAvatar
146
+ customClass: customAvatar,
147
+ onClick: onAvatarClick
144
148
  })) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
145
149
  flexible: true,
146
150
  shrink: true,
@@ -47,6 +47,7 @@ var ListItemWithAvatarDefaultProps = {
47
47
  needTick: false,
48
48
  palette: 'default',
49
49
  size: 'medium',
50
+ avatarSize: 'small',
50
51
  value: 'List',
51
52
  dataId: 'listAvatar',
52
53
  needBorder: true,
@@ -7,6 +7,8 @@ exports.ListItem_Props = exports.ListItemWithRadio_Props = exports.ListItemWithI
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _propTypes2 = require("../../Avatar/props/propTypes.js");
11
+
10
12
  var _ListItemWithAvatar_P;
11
13
 
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -83,7 +85,7 @@ var ListItemWithAvatar_Props = (_ListItemWithAvatar_P = {
83
85
  active: _propTypes["default"].bool,
84
86
  autoHover: _propTypes["default"].bool,
85
87
  avatarPalette: _propTypes["default"].string
86
- }, _defineProperty(_ListItemWithAvatar_P, "avatarPalette", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "dataId", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "dataSelectorId", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "disableTitle", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "getRef", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "highlight", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "id", _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])), _defineProperty(_ListItemWithAvatar_P, "imgSrc", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "index", _propTypes["default"].number), _defineProperty(_ListItemWithAvatar_P, "initial", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "isDisabled", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "isTeam", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "name", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "needAvatarTitle", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "needBorder", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "needTick", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "onClick", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "onMouseEnter", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "palette", _propTypes["default"].oneOf(['dark'])), _defineProperty(_ListItemWithAvatar_P, "size", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "title", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "value", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "a11y", _propTypes["default"].shape({
88
+ }, _defineProperty(_ListItemWithAvatar_P, "avatarPalette", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "dataId", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "dataSelectorId", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "disableTitle", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "getRef", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "highlight", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "id", _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])), _defineProperty(_ListItemWithAvatar_P, "imgSrc", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "index", _propTypes["default"].number), _defineProperty(_ListItemWithAvatar_P, "initial", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "isDisabled", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "isTeam", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "name", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "needAvatarTitle", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "needBorder", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "needTick", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "onClick", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "onMouseEnter", _propTypes["default"].func), _defineProperty(_ListItemWithAvatar_P, "palette", _propTypes["default"].oneOf(['dark'])), _defineProperty(_ListItemWithAvatar_P, "size", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "avatarSize", _propTypes2.propTypes.size), _defineProperty(_ListItemWithAvatar_P, "title", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "value", _propTypes["default"].string), _defineProperty(_ListItemWithAvatar_P, "a11y", _propTypes["default"].shape({
87
89
  role: _propTypes["default"].string,
88
90
  ariaSelected: _propTypes["default"].bool,
89
91
  ariaHidden: _propTypes["default"].bool
@@ -93,7 +95,7 @@ var ListItemWithAvatar_Props = (_ListItemWithAvatar_P = {
93
95
  customAvatarTeam: _propTypes["default"].string
94
96
  })), _defineProperty(_ListItemWithAvatar_P, "needMultiLineText", _propTypes["default"].bool), _defineProperty(_ListItemWithAvatar_P, "customProps", _propTypes["default"].shape({
95
97
  ListItemProps: _propTypes["default"].object
96
- })), _ListItemWithAvatar_P);
98
+ })), _defineProperty(_ListItemWithAvatar_P, "onAvatarClick", _propTypes["default"].func), _ListItemWithAvatar_P);
97
99
  exports.ListItemWithAvatar_Props = ListItemWithAvatar_Props;
98
100
  var ListItemWithCheckBox_Props = {
99
101
  active: _propTypes["default"].bool,
@@ -70,6 +70,7 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
70
70
  getRef = _this$props.getRef,
71
71
  hoverOption = _this$props.hoverOption,
72
72
  onClick = _this$props.onClick,
73
+ onAvatarClick = _this$props.onAvatarClick,
73
74
  onMouseEnter = _this$props.onMouseEnter,
74
75
  needTick = _this$props.needTick,
75
76
  needBorder = _this$props.needBorder,
@@ -134,6 +135,7 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
134
135
  key: "".concat(id, "avatarListItem"),
135
136
  name: value,
136
137
  onClick: onClick,
138
+ onAvatarClick: onAvatarClick,
137
139
  onMouseEnter: onMouseEnter,
138
140
  value: value,
139
141
  title: value,
@@ -180,6 +180,7 @@ var Suggestions_propTypes = {
180
180
  needBorder: _propTypes["default"].bool,
181
181
  needTick: _propTypes["default"].bool,
182
182
  onClick: _propTypes["default"].func,
183
+ onAvatarClick: _propTypes["default"].func,
183
184
  onMouseEnter: _propTypes["default"].func,
184
185
  palette: _propTypes["default"].string,
185
186
  selectedOptions: _propTypes["default"].array,
@@ -17,7 +17,7 @@ var _Common = require("../../utils/Common.js");
17
17
 
18
18
  var _viewPort = _interopRequireDefault(require("../../Popup/viewPort"));
19
19
 
20
- var _PositionMapping = require("../../Popup/PositionMapping.json");
20
+ var _PositionMapping = require("../../Popup/PositionMapping.js");
21
21
 
22
22
  var _ResizeObserver = _interopRequireDefault(require("@zohodesk/virtualizer/lib/commons/ResizeObserver.js"));
23
23
 
@@ -798,6 +798,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
798
798
  var ariaErrorId = this.getNextAriaId();
799
799
  var _customProps$TextBoxP = customProps.TextBoxProps,
800
800
  TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
801
+ _customProps$TextBoxI = customProps.TextBoxIconProps,
802
+ TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
801
803
  _customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
802
804
  DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
803
805
  _customProps$Suggesti = customProps.SuggestionsProps,
@@ -812,7 +814,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
812
814
  ref: getTargetRef,
813
815
  "data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
814
816
  "data-test-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId)
815
- }, needSelectDownIcon ? /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
817
+ }, needSelectDownIcon ? /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
816
818
  a11y: {
817
819
  role: 'Menuitem',
818
820
  ariaLabel: TextBox_ally_label,
@@ -854,7 +856,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
854
856
  'data-title': title || selected
855
857
  }, TextBoxProps)
856
858
  }
857
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
859
+ }, TextBoxIconProps), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
858
860
  alignBox: "row",
859
861
  align: "both"
860
862
  }, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
@@ -96,6 +96,7 @@ var Select_propTypes = {
96
96
  iconOnHover: _propTypes["default"].bool,
97
97
  customProps: _propTypes["default"].shape({
98
98
  TextBoxProps: _propTypes["default"].object,
99
+ TextBoxIconProps: _propTypes["default"].object,
99
100
  DropdownSearchTextBoxProps: _propTypes["default"].object,
100
101
  listItemProps: _propTypes["default"].object,
101
102
  SuggestionsProps: _propTypes["default"].object
package/lib/v1/Tag/Tag.js CHANGED
@@ -31,6 +31,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
31
 
32
32
  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; }
33
33
 
34
+ 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); }
35
+
34
36
  /*
35
37
  * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
36
38
  * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
@@ -63,6 +65,7 @@ function Tag(props) {
63
65
  tooltip = props.tooltip,
64
66
  avatarPalette = props.avatarPalette,
65
67
  customClass = props.customClass,
68
+ customAttributes = props.customAttributes,
66
69
  a11y = props.a11y,
67
70
  needEffect = props.needEffect,
68
71
  isReadOnly = props.isReadOnly,
@@ -101,7 +104,7 @@ function Tag(props) {
101
104
  var _a11y$clearLabel = a11y.clearLabel,
102
105
  clearLabel = _a11y$clearLabel === void 0 ? 'Delete' : _a11y$clearLabel;
103
106
  var isDarkPalette = palette === 'dark';
104
- return /*#__PURE__*/_react["default"].createElement("div", {
107
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
105
108
  className: "".concat(_TagModule["default"].container, " ").concat(needEffect && !isReadOnly ? _TagModule["default"].effect : _TagModule["default"].readonly, " ").concat(active ? "".concat(_TagModule["default"].selected, " ").concat(_TagModule["default"]["active".concat(palette)]) : '', " ").concat(onRemove ? active ? "".concat(_TagModule["default"]["active".concat(size, "Effect")]) : '' : '', " ").concat(_TagModule["default"][size], " ").concat(rounded ? _TagModule["default"].lgRadius : _TagModule["default"].smRadius, " ").concat(_TagModule["default"][palette], " ").concat(disabled ? _TagModule["default"].disabled : '', " ").concat(onSelectTag ? _TagModule["default"].pointer : '', " ").concat(customTag),
106
109
  "data-id": active ? "".concat(dataId, "_TagSelected") : "".concat(dataId, "_Tag"),
107
110
  "data-test-id": active ? "".concat(dataId, "_TagSelected") : "".concat(dataId, "_Tag"),
@@ -111,7 +114,7 @@ function Tag(props) {
111
114
  tabIndex: disabled ? '-1' : '0',
112
115
  "aria-labelledby": getAriaId,
113
116
  "data-selector-id": dataSelectorId
114
- }, hasAvatar ? /*#__PURE__*/_react["default"].createElement("div", {
117
+ }, customAttributes), hasAvatar ? /*#__PURE__*/_react["default"].createElement("div", {
115
118
  className: _TagModule["default"].avatar
116
119
  }, /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
117
120
  palette: isDarkPalette ? 'info' : avatarPalette,
@@ -13,6 +13,7 @@ var defaultProps = {
13
13
  size: 'medium',
14
14
  dataId: 'tag',
15
15
  customClass: {},
16
+ customAttributes: {},
16
17
  a11y: {},
17
18
  needEffect: true,
18
19
  isReadOnly: false,
@@ -36,6 +36,7 @@ var propTypes = {
36
36
  customTagIcon: _propTypes["default"].string,
37
37
  customAvatar: _propTypes["default"].string
38
38
  }),
39
+ customAttributes: _propTypes["default"].object,
39
40
  a11y: _propTypes["default"].shape({
40
41
  clearLabel: _propTypes["default"].string
41
42
  }),
@@ -83,6 +83,7 @@ function TextBoxIcon(props) {
83
83
  inputRef = props.inputRef,
84
84
  onFocus = props.onFocus,
85
85
  onBlur = props.onBlur,
86
+ needInputFocusOnWrapperClick = props.needInputFocusOnWrapperClick,
86
87
  isScrollPrevent = props.isScrollPrevent;
87
88
  var _customClass$customTB = customClass.customTBoxWrap,
88
89
  customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
@@ -127,12 +128,19 @@ function TextBoxIcon(props) {
127
128
  onBlur && onBlur(e);
128
129
  };
129
130
 
131
+ var handleInputFocusOnClick = function handleInputFocusOnClick() {
132
+ inputEle.current && inputEle.current.focus({
133
+ preventScroll: true
134
+ });
135
+ };
136
+
130
137
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
131
138
  alignBox: "row",
132
139
  isCover: false,
133
140
  className: "".concat(_TextBoxIconModule["default"].container, " ").concat(isDisabled ? _TextBoxIconModule["default"].disabled : isReadOnly ? needEffect ? _TextBoxIconModule["default"].effect : _TextBoxIconModule["default"].readonly : _TextBoxIconModule["default"].effect, " ").concat(isActive || isFocus ? _TextBoxIconModule["default"].effectFocused : '', " ").concat(customTBoxWrap, " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _TextBoxIconModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _TextBoxIconModule["default"].iconOnHoverStyle : ''),
134
141
  dataSelectorId: dataSelectorId,
135
- "data-title": isDisabled ? title : null
142
+ "data-title": isDisabled ? title : null,
143
+ onClick: needInputFocusOnWrapperClick && !isDisabled ? handleInputFocusOnClick : null
136
144
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
137
145
  flexible: true
138
146
  }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], _extends({}, props, {
@@ -14,6 +14,7 @@ var defaultProps = {
14
14
  type: 'text',
15
15
  variant: 'default',
16
16
  needReadOnlyStyle: true,
17
+ needInputFocusOnWrapperClick: false,
17
18
  isClickable: false,
18
19
  needEffect: true,
19
20
  dataId: 'textBoxIcon',
@@ -37,6 +37,7 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
37
37
  needBorder: _propTypes["default"].bool,
38
38
  needEffect: _propTypes["default"].bool,
39
39
  needReadOnlyStyle: _propTypes["default"].bool,
40
+ needInputFocusOnWrapperClick: _propTypes["default"].bool,
40
41
  onBlur: _propTypes["default"].func,
41
42
  onChange: _propTypes["default"].func,
42
43
  onClear: _propTypes["default"].func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-temp-203.2",
3
+ "version": "1.0.0-temp-204",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -7,6 +7,6 @@
7
7
  "need_report": true,
8
8
  "prop_validation_strict_mode": true,
9
9
  "prop_validation_log": false,
10
- "prop_unification_strict_mode": true,
10
+ "prop_unification_strict_mode": false,
11
11
  "prop_unification_log": false
12
12
  }