@zohodesk/components 1.2.4 → 1.2.6

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 (202) hide show
  1. package/README.md +8 -0
  2. package/coverage/Button/Button.js.html +1 -1
  3. package/coverage/Button/css/Button.module.css.html +1 -1
  4. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  5. package/coverage/Button/css/index.html +1 -1
  6. package/coverage/Button/index.html +1 -1
  7. package/coverage/Button/props/defaultProps.js.html +1 -1
  8. package/coverage/Button/props/index.html +1 -1
  9. package/coverage/Button/props/propTypes.js.html +1 -1
  10. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  11. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  12. package/coverage/Buttongroup/index.html +1 -1
  13. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  14. package/coverage/Buttongroup/props/index.html +1 -1
  15. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  16. package/coverage/index.html +1 -1
  17. package/coverage/utils/dummyFunction.js.html +1 -1
  18. package/coverage/utils/index.html +1 -1
  19. package/es/AppContainer/AppContainer.js +3 -0
  20. package/es/v1/Accordion/Accordion.js +65 -0
  21. package/es/v1/Accordion/AccordionItem.js +57 -0
  22. package/es/v1/Accordion/index.js +2 -0
  23. package/es/v1/Animation/Animation.js +127 -0
  24. package/es/v1/AppContainer/AppContainer.js +137 -0
  25. package/es/v1/Avatar/Avatar.js +189 -0
  26. package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
  27. package/es/v1/Button/Button.js +68 -0
  28. package/es/v1/Buttongroup/Buttongroup.js +31 -0
  29. package/es/v1/Card/Card.js +271 -0
  30. package/es/v1/CheckBox/CheckBox.js +155 -0
  31. package/es/v1/DateTime/CalendarView.js +218 -0
  32. package/es/v1/DateTime/DateTime.js +783 -0
  33. package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
  34. package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
  35. package/es/v1/DateTime/DateWidget.js +1098 -0
  36. package/es/v1/DateTime/DaysRow.js +31 -0
  37. package/es/v1/DateTime/Time.js +166 -0
  38. package/es/v1/DateTime/YearView.js +264 -0
  39. package/es/v1/DateTime/index.js +1 -0
  40. package/es/v1/DropBox/DropBox.js +91 -0
  41. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
  42. package/es/v1/DropDown/DropDown.js +73 -0
  43. package/es/v1/DropDown/DropDownHeading.js +44 -0
  44. package/es/v1/DropDown/DropDownItem.js +76 -0
  45. package/es/v1/DropDown/DropDownSearch.js +63 -0
  46. package/es/v1/DropDown/DropDownSeparator.js +15 -0
  47. package/es/v1/Heading/Heading.js +32 -0
  48. package/es/v1/Label/Label.js +40 -0
  49. package/es/v1/Layout/Box.js +115 -0
  50. package/es/v1/Layout/Container.js +132 -0
  51. package/es/v1/Layout/index.js +2 -0
  52. package/es/v1/ListItem/ListContainer.js +102 -0
  53. package/es/v1/ListItem/ListItem.js +124 -0
  54. package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
  55. package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
  56. package/es/v1/ListItem/ListItemWithIcon.js +127 -0
  57. package/es/v1/ListItem/ListItemWithRadio.js +105 -0
  58. package/es/v1/ListItem/index.js +6 -0
  59. package/es/v1/Modal/Modal.js +154 -0
  60. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
  61. package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
  62. package/es/v1/MultiSelect/EmptyState.js +64 -0
  63. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
  64. package/es/v1/MultiSelect/MultiSelect.js +1120 -0
  65. package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
  66. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
  67. package/es/v1/MultiSelect/SelectedOptions.js +82 -0
  68. package/es/v1/MultiSelect/Suggestions.js +142 -0
  69. package/es/v1/MultiSelect/index.js +4 -0
  70. package/es/v1/PopOver/PopOver.js +211 -0
  71. package/es/v1/Popup/Popup.js +645 -0
  72. package/es/v1/Radio/Radio.js +115 -0
  73. package/es/v1/Responsive/CustomResponsive.js +195 -0
  74. package/es/v1/Responsive/RefWrapper.js +39 -0
  75. package/es/v1/Responsive/ResizeComponent.js +197 -0
  76. package/es/v1/Responsive/ResizeObserver.js +140 -0
  77. package/es/v1/Responsive/Responsive.js +194 -0
  78. package/es/v1/Responsive/index.js +9 -0
  79. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
  80. package/es/v1/Ribbon/Ribbon.js +33 -0
  81. package/es/v1/RippleEffect/RippleEffect.js +24 -0
  82. package/es/v1/Select/GroupSelect.js +803 -0
  83. package/es/v1/Select/Select.js +969 -0
  84. package/es/v1/Select/SelectWithAvatar.js +344 -0
  85. package/es/v1/Select/SelectWithIcon.js +535 -0
  86. package/es/v1/Select/index.js +4 -0
  87. package/es/v1/Stencils/Stencils.js +26 -0
  88. package/es/v1/Switch/Switch.js +94 -0
  89. package/es/v1/Tab/Tab.js +108 -0
  90. package/es/v1/Tab/TabContent.js +30 -0
  91. package/es/v1/Tab/TabContentWrapper.js +29 -0
  92. package/es/v1/Tab/TabWrapper.js +57 -0
  93. package/es/v1/Tab/Tabs.js +612 -0
  94. package/es/v1/Tab/index.js +5 -0
  95. package/es/v1/Tag/Tag.js +134 -0
  96. package/es/v1/TextBox/TextBox.js +154 -0
  97. package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
  98. package/es/v1/Textarea/Textarea.js +102 -0
  99. package/es/v1/Tooltip/Tooltip.js +518 -0
  100. package/es/v1/Typography/Typography.js +38 -0
  101. package/es/v1/Typography/css/Typography.module.css +376 -0
  102. package/es/v1/Typography/css/cssJSLogic.js +46 -0
  103. package/es/v1/Typography/css/letterSpacingMap.js +12 -0
  104. package/es/v1/Typography/props/defaultProps.js +8 -0
  105. package/es/v1/Typography/props/propTypes.js +24 -0
  106. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
  107. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
  108. package/es/v1/semantic/Button/Button.js +53 -0
  109. package/es/v1/semantic/index.js +1 -0
  110. package/lib/AppContainer/AppContainer.js +5 -0
  111. package/lib/v1/Accordion/Accordion.js +96 -0
  112. package/lib/v1/Accordion/AccordionItem.js +68 -0
  113. package/lib/v1/Accordion/index.js +23 -0
  114. package/lib/v1/Animation/Animation.js +143 -0
  115. package/lib/v1/AppContainer/AppContainer.js +209 -0
  116. package/lib/v1/Avatar/Avatar.js +246 -0
  117. package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
  118. package/lib/v1/Button/Button.js +82 -0
  119. package/lib/v1/Buttongroup/Buttongroup.js +44 -0
  120. package/lib/v1/Card/Card.js +365 -0
  121. package/lib/v1/CheckBox/CheckBox.js +166 -0
  122. package/lib/v1/DateTime/CalendarView.js +285 -0
  123. package/lib/v1/DateTime/DateTime.js +872 -0
  124. package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
  125. package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
  126. package/lib/v1/DateTime/DateWidget.js +1125 -0
  127. package/lib/v1/DateTime/DaysRow.js +80 -0
  128. package/lib/v1/DateTime/Time.js +254 -0
  129. package/lib/v1/DateTime/YearView.js +325 -0
  130. package/lib/v1/DateTime/index.js +15 -0
  131. package/lib/v1/DropBox/DropBox.js +119 -0
  132. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
  133. package/lib/v1/DropDown/DropDown.js +170 -0
  134. package/lib/v1/DropDown/DropDownHeading.js +93 -0
  135. package/lib/v1/DropDown/DropDownItem.js +127 -0
  136. package/lib/v1/DropDown/DropDownSearch.js +113 -0
  137. package/lib/v1/DropDown/DropDownSeparator.js +64 -0
  138. package/lib/v1/Heading/Heading.js +49 -0
  139. package/lib/v1/Label/Label.js +51 -0
  140. package/lib/v1/Layout/Box.js +128 -0
  141. package/lib/v1/Layout/Container.js +145 -0
  142. package/lib/v1/Layout/index.js +23 -0
  143. package/lib/v1/ListItem/ListContainer.js +120 -0
  144. package/lib/v1/ListItem/ListItem.js +138 -0
  145. package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
  146. package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
  147. package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
  148. package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
  149. package/lib/v1/ListItem/index.js +55 -0
  150. package/lib/v1/Modal/Modal.js +212 -0
  151. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
  152. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
  153. package/lib/v1/MultiSelect/EmptyState.js +112 -0
  154. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
  155. package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
  156. package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
  157. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
  158. package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
  159. package/lib/v1/MultiSelect/Suggestions.js +195 -0
  160. package/lib/v1/MultiSelect/index.js +39 -0
  161. package/lib/v1/PopOver/PopOver.js +293 -0
  162. package/lib/v1/Popup/Popup.js +715 -0
  163. package/lib/v1/Radio/Radio.js +126 -0
  164. package/lib/v1/Responsive/CustomResponsive.js +242 -0
  165. package/lib/v1/Responsive/RefWrapper.js +57 -0
  166. package/lib/v1/Responsive/ResizeComponent.js +268 -0
  167. package/lib/v1/Responsive/ResizeObserver.js +168 -0
  168. package/lib/v1/Responsive/Responsive.js +274 -0
  169. package/lib/v1/Responsive/index.js +55 -0
  170. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
  171. package/lib/v1/Ribbon/Ribbon.js +44 -0
  172. package/lib/v1/RippleEffect/RippleEffect.js +39 -0
  173. package/lib/v1/Select/GroupSelect.js +877 -0
  174. package/lib/v1/Select/Select.js +1013 -0
  175. package/lib/v1/Select/SelectWithAvatar.js +394 -0
  176. package/lib/v1/Select/SelectWithIcon.js +597 -0
  177. package/lib/v1/Select/index.js +39 -0
  178. package/lib/v1/Stencils/Stencils.js +43 -0
  179. package/lib/v1/Switch/Switch.js +108 -0
  180. package/lib/v1/Tab/Tab.js +132 -0
  181. package/lib/v1/Tab/TabContent.js +42 -0
  182. package/lib/v1/Tab/TabContentWrapper.js +42 -0
  183. package/lib/v1/Tab/TabWrapper.js +89 -0
  184. package/lib/v1/Tab/Tabs.js +680 -0
  185. package/lib/v1/Tab/index.js +47 -0
  186. package/lib/v1/Tag/Tag.js +154 -0
  187. package/lib/v1/TextBox/TextBox.js +168 -0
  188. package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
  189. package/lib/v1/Textarea/Textarea.js +118 -0
  190. package/lib/v1/Tooltip/Tooltip.js +586 -0
  191. package/lib/v1/Typography/Typography.js +56 -0
  192. package/lib/v1/Typography/css/Typography.module.css +376 -0
  193. package/lib/v1/Typography/css/cssJSLogic.js +41 -0
  194. package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
  195. package/lib/v1/Typography/props/defaultProps.js +15 -0
  196. package/lib/v1/Typography/props/propTypes.js +35 -0
  197. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
  198. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
  199. package/lib/v1/semantic/Button/Button.js +63 -0
  200. package/lib/v1/semantic/index.js +15 -0
  201. package/package.json +1 -1
  202. package/result.json +1 -1
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Tab", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Tab["default"];
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "TabContent", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _TabContent["default"];
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "TabContentWrapper", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _TabContentWrapper["default"];
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "TabWrapper", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _TabWrapper["default"];
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "Tabs", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _Tabs["default"];
34
+ }
35
+ });
36
+
37
+ var _TabWrapper = _interopRequireDefault(require("./TabWrapper"));
38
+
39
+ var _TabContentWrapper = _interopRequireDefault(require("./TabContentWrapper"));
40
+
41
+ var _TabContent = _interopRequireDefault(require("./TabContent"));
42
+
43
+ var _Tabs = _interopRequireDefault(require("./Tabs"));
44
+
45
+ var _Tab = _interopRequireDefault(require("./Tab"));
46
+
47
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _defaultProps = require("../../Tag/props/defaultProps");
13
+
14
+ var _propTypes = require("../../Tag/props/propTypes");
15
+
16
+ var _icons = require("@zohodesk/icons");
17
+
18
+ var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
19
+
20
+ var _Layout = require("../Layout");
21
+
22
+ var _Button = _interopRequireDefault(require("../semantic/Button/Button"));
23
+
24
+ var _IdProvider = require("../../Provider/IdProvider");
25
+
26
+ var _TagModule = _interopRequireDefault(require("../../Tag/Tag.module.css"));
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
+
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
+
34
+ /*
35
+ * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
36
+ * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
37
+ * 'pureDotted', 'primaryDotted'] }]
38
+ */
39
+
40
+ /*
41
+ * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
42
+ * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
43
+ * 'pureDotted', 'primaryDotted'] }]
44
+ */
45
+ function Tag(props) {
46
+ var imageURL = props.imageURL,
47
+ hasAvatar = props.hasAvatar,
48
+ text = props.text,
49
+ onRemove = props.onRemove,
50
+ initial = props.initial,
51
+ active = props.active,
52
+ size = props.size,
53
+ rounded = props.rounded,
54
+ palette = props.palette,
55
+ disabled = props.disabled,
56
+ closePalette = props.closePalette,
57
+ onSelectTag = props.onSelectTag,
58
+ closeTitle = props.closeTitle,
59
+ dataId = props.dataId,
60
+ dataSelectorId = props.dataSelectorId,
61
+ iconName = props.iconName,
62
+ iconSize = props.iconSize,
63
+ tooltip = props.tooltip,
64
+ avatarPalette = props.avatarPalette,
65
+ customClass = props.customClass,
66
+ a11y = props.a11y,
67
+ needEffect = props.needEffect,
68
+ isReadOnly = props.isReadOnly,
69
+ id = props.id;
70
+
71
+ var handleSelect = function handleSelect(e) {
72
+ e && e.preventDefault();
73
+ e.stopPropagation && e.stopPropagation();
74
+ e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
75
+ onSelectTag && onSelectTag(id, e);
76
+ };
77
+
78
+ var handleRemove = function handleRemove(e) {
79
+ e && e.preventDefault();
80
+ e.stopPropagation && e.stopPropagation();
81
+ e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
82
+ onRemove && onRemove(id);
83
+ };
84
+
85
+ var getRef = function getRef(el) {
86
+ var getRef = props.getRef;
87
+ getRef && getRef(el, id);
88
+ };
89
+
90
+ var _customClass$customTa = customClass.customTag,
91
+ customTag = _customClass$customTa === void 0 ? '' : _customClass$customTa,
92
+ _customClass$customTa2 = customClass.customTagClose,
93
+ customTagClose = _customClass$customTa2 === void 0 ? '' : _customClass$customTa2,
94
+ _customClass$customTa3 = customClass.customTagIcon,
95
+ customTagIcon = _customClass$customTa3 === void 0 ? '' : _customClass$customTa3,
96
+ _customClass$customAv = customClass.customAvatar,
97
+ customAvatar = _customClass$customAv === void 0 ? '' : _customClass$customAv;
98
+ var textSizes = size === 'small' ? _TagModule["default"].smalltext : _TagModule["default"].mediumtext;
99
+ var getNextAriaId = (0, _IdProvider.useUniqueId)();
100
+ var getAriaId = getNextAriaId();
101
+ var _a11y$clearLabel = a11y.clearLabel,
102
+ clearLabel = _a11y$clearLabel === void 0 ? 'Delete' : _a11y$clearLabel;
103
+ var isDarkPalette = palette === 'dark';
104
+ return /*#__PURE__*/_react["default"].createElement("div", {
105
+ 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
+ "data-id": active ? "".concat(dataId, "_TagSelected") : "".concat(dataId, "_Tag"),
107
+ "data-test-id": active ? "".concat(dataId, "_TagSelected") : "".concat(dataId, "_Tag"),
108
+ onClick: handleSelect,
109
+ ref: getRef,
110
+ "data-title": tooltip ? tooltip : text,
111
+ tabIndex: disabled ? '-1' : '0',
112
+ "aria-labelledby": getAriaId,
113
+ "data-selector-id": dataSelectorId
114
+ }, hasAvatar ? /*#__PURE__*/_react["default"].createElement("div", {
115
+ className: _TagModule["default"].avatar
116
+ }, /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
117
+ palette: isDarkPalette ? 'info' : avatarPalette,
118
+ name: initial,
119
+ size: "small",
120
+ src: imageURL,
121
+ textPalette: isDarkPalette ? 'white' : '',
122
+ customClass: customAvatar
123
+ })) : null, iconName ? /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: "".concat(_TagModule["default"].icon, " ").concat(customTagIcon),
125
+ "aria-hidden": true
126
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
127
+ name: iconName,
128
+ size: iconSize
129
+ })) : null, /*#__PURE__*/_react["default"].createElement("div", {
130
+ className: "".concat(_TagModule["default"].text, " ").concat(textSizes),
131
+ "aria-hidden": true,
132
+ id: getAriaId
133
+ }, text), onRemove && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
134
+ 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)]),
135
+ dataId: "".concat(dataId, "_RemoveTag"),
136
+ "data-title": closeTitle,
137
+ onClick: handleRemove,
138
+ a11y: {
139
+ ariaLabel: clearLabel
140
+ }
141
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
142
+ align: "both"
143
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
144
+ isBold: true,
145
+ name: "ZD-close2",
146
+ size: "8"
147
+ }))));
148
+ }
149
+
150
+ var _default = /*#__PURE__*/(0, _react.memo)(Tag);
151
+
152
+ exports["default"] = _default;
153
+ Tag.defaultProps = _defaultProps.defaultProps;
154
+ Tag.propTypes = _propTypes.propTypes;
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = TextBox;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _defaultProps = require("../../TextBox/props/defaultProps");
13
+
14
+ var _propTypes = require("../../TextBox/props/propTypes");
15
+
16
+ var _TextBoxModule = _interopRequireDefault(require("../../TextBox/TextBox.module.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ 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; }
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
+
26
+ function TextBox(props) {
27
+ var type = props.type,
28
+ name = props.name,
29
+ id = props.id,
30
+ maxLength = props.maxLength,
31
+ placeHolder = props.placeHolder,
32
+ size = props.size,
33
+ onKeyUp = props.onKeyUp,
34
+ isReadOnly = props.isReadOnly,
35
+ isDisabled = props.isDisabled,
36
+ onKeyDown = props.onKeyDown,
37
+ variant = props.variant,
38
+ onClick = props.onClick,
39
+ needBorder = props.needBorder,
40
+ value = props.value,
41
+ dataId = props.dataId,
42
+ autofocus = props.autofocus,
43
+ needReadOnlyStyle = props.needReadOnlyStyle,
44
+ needAppearance = props.needAppearance,
45
+ isClickable = props.isClickable,
46
+ onKeyPress = props.onKeyPress,
47
+ needEffect = props.needEffect,
48
+ autoComplete = props.autoComplete,
49
+ borderColor = props.borderColor,
50
+ onMouseDown = props.onMouseDown,
51
+ htmlId = props.htmlId,
52
+ a11y = props.a11y,
53
+ customClass = props.customClass,
54
+ isFocus = props.isFocus,
55
+ customProps = props.customProps,
56
+ dataSelectorId = props.dataSelectorId,
57
+ onFocus = props.onFocus,
58
+ onBlur = props.onBlur,
59
+ onChange = props.onChange,
60
+ inputRef = props.inputRef;
61
+ var ariaLabel = a11y.ariaLabel,
62
+ ariaAutocomplete = a11y.ariaAutocomplete,
63
+ ariaControls = a11y.ariaControls,
64
+ ariaExpanded = a11y.ariaExpanded,
65
+ role = a11y.role,
66
+ ariaDescribedby = a11y.ariaDescribedby,
67
+ ariaHaspopup = a11y.ariaHaspopup,
68
+ ariaRequired = a11y.ariaRequired,
69
+ ariaLabelledby = a11y.ariaLabelledby,
70
+ ariaInvalid = a11y.ariaInvalid,
71
+ ariaOwns = a11y.ariaOwns,
72
+ ariaActivedescendant = a11y.ariaActivedescendant,
73
+ ariaReadonly = a11y.ariaReadonly,
74
+ ariaMultiselectable = a11y.ariaMultiselectable;
75
+ var inputEle = (0, _react.useRef)();
76
+ var options = (0, _react.useRef)({});
77
+
78
+ if (isReadOnly) {
79
+ options.current.readOnly = true;
80
+ }
81
+
82
+ if (isDisabled) {
83
+ options.current.disabled = true;
84
+ }
85
+
86
+ if (autofocus) {
87
+ options.current.autoFocus = true;
88
+ }
89
+
90
+ if (!autoComplete) {
91
+ options.current.autoComplete = 'off';
92
+ }
93
+
94
+ var handleFocus = function handleFocus() {
95
+ onFocus && onFocus(id, value, name);
96
+ };
97
+
98
+ var handleBlur = function handleBlur() {
99
+ onBlur && onBlur(id, value, name);
100
+ };
101
+
102
+ var handleRef = (0, _react.useCallback)(function (ref) {
103
+ inputEle.current = ref;
104
+ inputRef && inputRef(ref);
105
+ }, []);
106
+
107
+ var setFocus = function setFocus() {
108
+ if (inputEle.current) {
109
+ inputEle.current.focus({
110
+ preventScroll: true
111
+ });
112
+ }
113
+ };
114
+
115
+ var handleChange = function handleChange(e) {
116
+ e.preventDefault();
117
+ var value = e.target.value;
118
+ onChange && !isReadOnly && onChange(value, e);
119
+ };
120
+
121
+ var classList = needAppearance ? "".concat(_TextBoxModule["default"].container, " ").concat(_TextBoxModule["default"][size], " ").concat(_TextBoxModule["default"][variant], " ").concat(needBorder ? _TextBoxModule["default"].border : '', " ").concat(isDisabled && !needEffect || isReadOnly && !needEffect ? '' : _TextBoxModule["default"].effect, " ").concat(isFocus ? _TextBoxModule["default"].focus : '') : "".concat(_TextBoxModule["default"].basic);
122
+ value = value === null || value === undefined ? '' : value;
123
+ return /*#__PURE__*/_react["default"].createElement("input", _extends({
124
+ "aria-label": ariaLabel,
125
+ "aria-invalid": ariaInvalid,
126
+ "aria-autocomplete": ariaAutocomplete,
127
+ "aria-controls": ariaControls,
128
+ "aria-expanded": ariaExpanded,
129
+ "aria-describedby": ariaDescribedby,
130
+ role: role,
131
+ "aria-haspopup": ariaHaspopup,
132
+ "aria-required": ariaRequired,
133
+ "aria-labelledby": ariaLabelledby,
134
+ "aria-owns": ariaOwns,
135
+ "aria-activedescendant": ariaActivedescendant,
136
+ "aria-readonly": ariaReadonly,
137
+ "aria-multiselectable": ariaMultiselectable,
138
+ className: "".concat(isReadOnly && needReadOnlyStyle ? _TextBoxModule["default"].readonly : '', " ").concat(isClickable ? _TextBoxModule["default"].pointer : '', " ").concat(classList, " ").concat(_TextBoxModule["default"]["borderColor_".concat(borderColor)], " ").concat(customClass ? customClass : ''),
139
+ "data-id": "".concat(dataId),
140
+ "data-test-id": "".concat(dataId),
141
+ "data-selector-id": dataSelectorId,
142
+ id: htmlId || id,
143
+ maxLength: maxLength,
144
+ name: name,
145
+ onBlur: handleBlur,
146
+ onChange: handleChange,
147
+ onClick: onClick,
148
+ onFocus: handleFocus,
149
+ onKeyDown: onKeyDown,
150
+ onKeyUp: onKeyUp,
151
+ placeholder: placeHolder,
152
+ ref: handleRef,
153
+ type: type,
154
+ value: value,
155
+ onKeyPress: onKeyPress,
156
+ onMouseDown: onMouseDown
157
+ }, options.current, customProps));
158
+ }
159
+
160
+ TextBox.defaultProps = _defaultProps.defaultProps;
161
+ TextBox.propTypes = _propTypes.propTypes; // if (__DOCS__) {
162
+ // Textbox.docs = {
163
+ // componentGroup: 'Form Elements',
164
+ // folderName: 'Style Guide',
165
+ // external: true,
166
+ // description: ' '
167
+ // };
168
+ // }
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = TextBoxIcon;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _defaultProps = require("../../TextBoxIcon/props/defaultProps");
13
+
14
+ var _propTypes = require("../../TextBoxIcon/props/propTypes");
15
+
16
+ var _TextBox = _interopRequireDefault(require("../TextBox/TextBox"));
17
+
18
+ var _Layout = require("../Layout");
19
+
20
+ var _icons = require("@zohodesk/icons");
21
+
22
+ var _semanticButtonModule = _interopRequireDefault(require("../../semantic/Button/semanticButton.module.css"));
23
+
24
+ var _TextBoxIconModule = _interopRequireDefault(require("../../TextBoxIcon/TextBoxIcon.module.css"));
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+
30
+ 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; }
31
+
32
+ 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); }
33
+
34
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
+
36
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
37
+
38
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
39
+
40
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
41
+
42
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
43
+
44
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
+
46
+ /* eslint-disable react/forbid-component-props */
47
+ function TextBoxIcon(props) {
48
+ var type = props.type,
49
+ name = props.name,
50
+ id = props.id,
51
+ maxLength = props.maxLength,
52
+ placeHolder = props.placeHolder,
53
+ size = props.size,
54
+ onKeyUp = props.onKeyUp,
55
+ isReadOnly = props.isReadOnly,
56
+ isDisabled = props.isDisabled,
57
+ children = props.children,
58
+ onKeyDown = props.onKeyDown,
59
+ onClick = props.onClick,
60
+ value = props.value,
61
+ iconRotated = props.iconRotated,
62
+ needBorder = props.needBorder,
63
+ variant = props.variant,
64
+ onClear = props.onClear,
65
+ onChange = props.onChange,
66
+ title = props.title,
67
+ dataId = props.dataId,
68
+ dataSelectorId = props.dataSelectorId,
69
+ needReadOnlyStyle = props.needReadOnlyStyle,
70
+ isClickable = props.isClickable,
71
+ needEffect = props.needEffect,
72
+ onKeyPress = props.onKeyPress,
73
+ borderColor = props.borderColor,
74
+ onMouseDown = props.onMouseDown,
75
+ showClearIcon = props.showClearIcon,
76
+ htmlId = props.htmlId,
77
+ i18nKeys = props.i18nKeys,
78
+ customClass = props.customClass,
79
+ iconOnHover = props.iconOnHover,
80
+ isFocus = props.isFocus,
81
+ onClearMouseDown = props.onClearMouseDown,
82
+ customProps = props.customProps,
83
+ inputRef = props.inputRef,
84
+ onFocus = props.onFocus,
85
+ onBlur = props.onBlur;
86
+ var _customClass$customTB = customClass.customTBoxWrap,
87
+ customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
88
+ _customClass$customTe = customClass.customTextBox,
89
+ customTextBox = _customClass$customTe === void 0 ? '' : _customClass$customTe,
90
+ _customClass$customTB2 = customClass.customTBoxIcon,
91
+ customTBoxIcon = _customClass$customTB2 === void 0 ? '' : _customClass$customTB2,
92
+ _customClass$customTB3 = customClass.customTBoxLine,
93
+ customTBoxLine = _customClass$customTB3 === void 0 ? '' : _customClass$customTB3;
94
+ var _i18nKeys$clearText = i18nKeys.clearText,
95
+ clearText = _i18nKeys$clearText === void 0 ? 'Clear' : _i18nKeys$clearText;
96
+ var _customProps$TextBoxP = customProps.TextBoxProps,
97
+ TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP;
98
+
99
+ var _useState = (0, _react.useState)(false),
100
+ _useState2 = _slicedToArray(_useState, 2),
101
+ isActive = _useState2[0],
102
+ setActive = _useState2[1];
103
+
104
+ var inputEle = (0, _react.useRef)();
105
+ var handleRef = (0, _react.useCallback)(function (ele) {
106
+ inputEle.current = ele;
107
+ inputRef && inputRef(ele);
108
+ }, []);
109
+
110
+ var handleClear = function handleClear() {
111
+ onClear && onClear();
112
+ inputEle.current && inputEle.current.focus({
113
+ preventScroll: true
114
+ });
115
+ };
116
+
117
+ var handleFocus = function handleFocus(e) {
118
+ if (!needReadOnlyStyle || !isReadOnly && needReadOnlyStyle) {
119
+ setActive(true);
120
+ onFocus && onFocus(e);
121
+ }
122
+ };
123
+
124
+ var handleBlur = function handleBlur(e) {
125
+ setActive(false);
126
+ onBlur && onBlur(e);
127
+ };
128
+
129
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
130
+ alignBox: "row",
131
+ isCover: false,
132
+ 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 : ''),
133
+ dataSelectorId: dataSelectorId,
134
+ "data-title": isDisabled ? title : null
135
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
136
+ flexible: true
137
+ }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], _extends({}, props, {
138
+ dataId: dataId,
139
+ size: size,
140
+ variant: variant,
141
+ type: type,
142
+ value: value,
143
+ name: name,
144
+ id: id,
145
+ htmlId: htmlId,
146
+ maxLength: maxLength,
147
+ placeHolder: placeHolder,
148
+ onKeyUp: onKeyUp,
149
+ onFocus: handleFocus,
150
+ onKeyDown: onKeyDown,
151
+ onChange: onChange,
152
+ onBlur: handleBlur,
153
+ onClick: onClick,
154
+ isReadOnly: isReadOnly,
155
+ isDisabled: isDisabled,
156
+ inputRef: handleRef,
157
+ needReadOnlyStyle: needReadOnlyStyle,
158
+ isClickable: isClickable,
159
+ onKeyPress: onKeyPress,
160
+ onMouseDown: onMouseDown,
161
+ needBorder: false,
162
+ customClass: customTextBox,
163
+ customProps: TextBoxProps
164
+ }))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
165
+ className: "".concat(_TextBoxIconModule["default"].iconContainer, " ").concat(customTBoxIcon)
166
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
167
+ alignBox: "row"
168
+ }, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
169
+ className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(_TextBoxIconModule["default"].icon),
170
+ onClick: handleClear,
171
+ dataId: "".concat(dataId, "_ClearIcon"),
172
+ "data-title": clearText,
173
+ tagName: "button"
174
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
175
+ align: "both",
176
+ "aria-hidden": true,
177
+ onMouseDown: onClearMouseDown
178
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
179
+ name: "ZD-delete",
180
+ size: "14"
181
+ }))) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
182
+ className: "".concat(_TextBoxIconModule["default"].icon, " ").concat(iconRotated ? _TextBoxIconModule["default"].rotated : '')
183
+ }, children) : null)), needBorder && /*#__PURE__*/_react["default"].createElement("div", {
184
+ className: "".concat(_TextBoxIconModule["default"].line, " ").concat(_TextBoxIconModule["default"]["borderColor_".concat(borderColor)], " ").concat(customTBoxLine)
185
+ }));
186
+ }
187
+
188
+ TextBoxIcon.defaultProps = _defaultProps.defaultProps;
189
+ TextBoxIcon.propTypes = _propTypes.propTypes; // if (__DOCS__) {
190
+ // TextBoxIcon.docs = {
191
+ // componentGroup: 'Form Elements',
192
+ // folderName: 'Style Guide',
193
+ // external: true,
194
+ // description: ' '
195
+ // };
196
+ // }