@zohodesk/components 1.2.10 → 1.2.12

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 (75) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +7 -10
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +10 -0
  5. package/coverage/Button/Button.js.html +1 -1
  6. package/coverage/Button/css/Button.module.css.html +1 -1
  7. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  8. package/coverage/Button/css/index.html +1 -1
  9. package/coverage/Button/index.html +1 -1
  10. package/coverage/Button/props/defaultProps.js.html +1 -1
  11. package/coverage/Button/props/index.html +1 -1
  12. package/coverage/Button/props/propTypes.js.html +1 -1
  13. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  14. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  15. package/coverage/Buttongroup/index.html +1 -1
  16. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  17. package/coverage/Buttongroup/props/index.html +1 -1
  18. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  19. package/coverage/coverage-final.json +10 -10
  20. package/coverage/coverage-summary.json +10 -10
  21. package/coverage/index.html +1 -1
  22. package/coverage/utils/dummyFunction.js.html +1 -1
  23. package/coverage/utils/index.html +1 -1
  24. package/es/MultiSelect/props/propTypes.js +140 -138
  25. package/es/Select/props/propTypes.js +3 -1
  26. package/es/v1/Accordion/Accordion.js +3 -2
  27. package/es/v1/AppContainer/AppContainer.js +75 -92
  28. package/es/v1/Avatar/Avatar.js +84 -134
  29. package/es/v1/Card/Card.js +143 -177
  30. package/es/v1/Card/index.js +4 -0
  31. package/es/v1/DropDown/DropDown.js +31 -52
  32. package/es/v1/DropDown/DropDownHeading.js +29 -37
  33. package/es/v1/DropDown/DropDownItem.js +38 -58
  34. package/es/v1/DropDown/DropDownSearch.js +41 -49
  35. package/es/v1/DropDown/DropDownSeparator.js +7 -10
  36. package/es/v1/MultiSelect/MultiSelect.js +1 -0
  37. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +1 -0
  38. package/es/v1/PopOver/PopOver.js +125 -160
  39. package/es/v1/Popup/Popup.js +1 -1
  40. package/es/v1/Provider/AvatarSize.js +13 -0
  41. package/es/v1/Provider/Config.js +18 -0
  42. package/es/v1/Provider/CssProvider.js +16 -0
  43. package/es/v1/Provider/IdProvider.js +66 -0
  44. package/es/v1/Provider/LibraryContext.js +37 -0
  45. package/es/v1/Provider/LibraryContextInit.js +3 -0
  46. package/es/v1/Provider/NumberGenerator/NumberGenerator.js +136 -0
  47. package/es/v1/Provider/ZindexProvider.js +57 -0
  48. package/es/v1/Provider/index.js +4 -0
  49. package/lib/MultiSelect/props/propTypes.js +146 -141
  50. package/lib/Select/props/propTypes.js +12 -2
  51. package/lib/v1/Accordion/Accordion.js +3 -1
  52. package/lib/v1/AppContainer/AppContainer.js +87 -138
  53. package/lib/v1/Avatar/Avatar.js +130 -186
  54. package/lib/v1/Card/Card.js +190 -286
  55. package/lib/v1/Card/index.js +37 -0
  56. package/lib/v1/DropDown/DropDown.js +34 -130
  57. package/lib/v1/DropDown/DropDownHeading.js +29 -75
  58. package/lib/v1/DropDown/DropDownItem.js +50 -102
  59. package/lib/v1/DropDown/DropDownSearch.js +50 -89
  60. package/lib/v1/DropDown/DropDownSeparator.js +8 -48
  61. package/lib/v1/MultiSelect/MultiSelect.js +3 -1
  62. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +3 -1
  63. package/lib/v1/PopOver/PopOver.js +160 -256
  64. package/lib/v1/Popup/Popup.js +1 -1
  65. package/lib/v1/Provider/AvatarSize.js +24 -0
  66. package/lib/v1/Provider/Config.js +27 -0
  67. package/lib/v1/Provider/CssProvider.js +27 -0
  68. package/lib/v1/Provider/IdProvider.js +79 -0
  69. package/lib/v1/Provider/LibraryContext.js +76 -0
  70. package/lib/v1/Provider/LibraryContextInit.js +15 -0
  71. package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +174 -0
  72. package/lib/v1/Provider/ZindexProvider.js +69 -0
  73. package/lib/v1/Provider/index.js +81 -0
  74. package/package.json +7 -7
  75. package/result.json +1 -1
@@ -5,9 +5,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports["default"] = DropDownSearch;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _propTypes = require("../../DropDown/props/propTypes");
13
13
 
@@ -19,95 +19,56 @@ var _DropDownSearchModule = _interopRequireDefault(require("../../DropDown/DropD
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
21
 
22
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
-
24
- 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); } }
25
-
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
-
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
-
30
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
-
32
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
33
-
34
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
-
36
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
-
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
-
40
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
-
42
- var DropDownSearch = /*#__PURE__*/function (_React$Component) {
43
- _inherits(DropDownSearch, _React$Component);
44
-
45
- var _super = _createSuper(DropDownSearch);
46
-
47
- function DropDownSearch(props) {
48
- var _this;
49
-
50
- _classCallCheck(this, DropDownSearch);
51
-
52
- _this = _super.call(this, props);
53
- _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
54
- return _this;
22
+ 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); }
23
+
24
+ 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; }
25
+
26
+ function DropDownSearch(props) {
27
+ var name = props.name,
28
+ id = props.id,
29
+ maxLength = props.maxLength,
30
+ onKeyDown = props.onKeyDown,
31
+ onChange = props.onChange,
32
+ value = props.value,
33
+ onBlur = props.onBlur,
34
+ size = props.size,
35
+ textBoxSize = props.textBoxSize,
36
+ placeHolder = props.placeHolder,
37
+ customClass = props.customClass,
38
+ getRef = props.getRef;
39
+ var _customClass$searchCl = customClass.searchClass,
40
+ searchClass = _customClass$searchCl === void 0 ? '' : _customClass$searchCl,
41
+ _customClass$customTe = customClass.customTextBox,
42
+ customTextBox = _customClass$customTe === void 0 ? '' : _customClass$customTe;
43
+ var inputRef = (0, _react.useRef)(null); // eslint-disable-next-line func-call-spacing
44
+
45
+ (0, _react.useEffect)(function () {
46
+ inputRef.current && input.current.focus({
47
+ preventScroll: true
48
+ });
49
+ }, []);
50
+
51
+ function getReference(ele) {
52
+ inputRef.current = ele;
53
+ getRef && getRef(ele);
55
54
  }
56
55
 
57
- _createClass(DropDownSearch, [{
58
- key: "componentDidMount",
59
- value: function componentDidMount() {
60
- this.input && this.input.focus({
61
- preventScroll: true
62
- });
63
- }
64
- }, {
65
- key: "getRef",
66
- value: function getRef(ele) {
67
- var getRef = this.props.getRef;
68
- this.input = ele;
69
- getRef && getRef(ele);
70
- }
71
- }, {
72
- key: "render",
73
- value: function render() {
74
- var _this$props = this.props,
75
- name = _this$props.name,
76
- id = _this$props.id,
77
- maxLength = _this$props.maxLength,
78
- onKeyDown = _this$props.onKeyDown,
79
- onChange = _this$props.onChange,
80
- value = _this$props.value,
81
- onBlur = _this$props.onBlur,
82
- size = _this$props.size,
83
- textBoxSize = _this$props.textBoxSize,
84
- placeHolder = _this$props.placeHolder,
85
- customClass = _this$props.customClass;
86
- var _customClass$searchCl = customClass.searchClass,
87
- searchClass = _customClass$searchCl === void 0 ? '' : _customClass$searchCl,
88
- _customClass$customTe = customClass.customTextBox,
89
- customTextBox = _customClass$customTe === void 0 ? '' : _customClass$customTe;
90
- return /*#__PURE__*/_react["default"].createElement("div", {
91
- className: "".concat(_DropDownSearchModule["default"].search, " ").concat(_DropDownSearchModule["default"]["".concat(size, "Search")], " ").concat(searchClass)
92
- }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
93
- id: id,
94
- inputRef: this.getRef,
95
- maxLength: maxLength,
96
- name: name,
97
- onBlur: onBlur,
98
- onChange: onChange,
99
- onKeyDown: onKeyDown,
100
- size: textBoxSize,
101
- value: value,
102
- placeHolder: placeHolder,
103
- customClass: customTextBox
104
- }));
105
- }
106
- }]);
56
+ return /*#__PURE__*/_react["default"].createElement("div", {
57
+ className: "".concat(_DropDownSearchModule["default"].search, " ").concat(_DropDownSearchModule["default"]["".concat(size, "Search")], " ").concat(searchClass)
58
+ }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
59
+ id: id,
60
+ inputRef: getReference,
61
+ maxLength: maxLength,
62
+ name: name,
63
+ onBlur: onBlur,
64
+ onChange: onChange,
65
+ onKeyDown: onKeyDown,
66
+ size: textBoxSize,
67
+ value: value,
68
+ placeHolder: placeHolder,
69
+ customClass: customTextBox
70
+ }));
71
+ }
107
72
 
108
- return DropDownSearch;
109
- }(_react["default"].Component);
110
-
111
- exports["default"] = DropDownSearch;
112
73
  DropDownSearch.defaultProps = _defaultProps.DropDownSearch_defaultProps;
113
74
  DropDownSearch.propTypes = _propTypes.DropDownSearch_propTypes;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
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
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = void 0;
6
+ exports["default"] = DropDownSeparator;
9
7
 
10
8
  var _react = _interopRequireDefault(require("react"));
11
9
 
@@ -15,50 +13,12 @@ var _DropDownSeparatorModule = _interopRequireDefault(require("../../DropDown/Dr
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
15
 
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
-
20
- 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); } }
21
-
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
-
24
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
-
26
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
-
28
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
29
-
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
31
-
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+ function DropDownSeparator(props) {
17
+ var _props$customClass = props.customClass,
18
+ customClass = _props$customClass === void 0 ? '' : _props$customClass;
19
+ return /*#__PURE__*/_react["default"].createElement("div", {
20
+ className: "".concat(_DropDownSeparatorModule["default"].separator, " ").concat(customClass)
21
+ });
22
+ }
33
23
 
34
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
-
36
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
37
-
38
- var DropDownSeparator = /*#__PURE__*/function (_React$Component) {
39
- _inherits(DropDownSeparator, _React$Component);
40
-
41
- var _super = _createSuper(DropDownSeparator);
42
-
43
- function DropDownSeparator() {
44
- _classCallCheck(this, DropDownSeparator);
45
-
46
- return _super.apply(this, arguments);
47
- }
48
-
49
- _createClass(DropDownSeparator, [{
50
- key: "render",
51
- value: function render() {
52
- var _this$props$customCla = this.props.customClass,
53
- customClass = _this$props$customCla === void 0 ? '' : _this$props$customCla;
54
- return /*#__PURE__*/_react["default"].createElement("div", {
55
- className: "".concat(_DropDownSeparatorModule["default"].separator, " ").concat(customClass)
56
- });
57
- }
58
- }]);
59
-
60
- return DropDownSeparator;
61
- }(_react["default"].Component);
62
-
63
- exports["default"] = DropDownSeparator;
64
24
  DropDownSeparator.propTypes = _propTypes.DropDownSeparator_propTypes;
@@ -13,6 +13,8 @@ var _propTypes = require("../../MultiSelect/props/propTypes");
13
13
 
14
14
  var _defaultProps = require("../../MultiSelect/props/defaultProps");
15
15
 
16
+ var _defaultProps2 = require("../../MultiSelect/MobileHeader/props/defaultProps");
17
+
16
18
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
17
19
 
18
20
  var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
@@ -1095,7 +1097,7 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
1095
1097
  var suggestions = this.handleFilterSuggestions();
1096
1098
  var setAriaId = this.getNextAriaId();
1097
1099
  var ariaErrorId = this.getNextAriaId();
1098
- i18nKeys = Object.assign({}, MobileHeader_defaultProps.i18nKeys, i18nKeys, {
1100
+ i18nKeys = Object.assign({}, _defaultProps2.defaultProps.i18nKeys, i18nKeys, {
1099
1101
  emptyText: i18nKeys.emptyText || emptyMessage,
1100
1102
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
1101
1103
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
@@ -13,6 +13,8 @@ var _propTypes = require("../../MultiSelect/props/propTypes");
13
13
 
14
14
  var _defaultProps = require("../../MultiSelect/props/defaultProps");
15
15
 
16
+ var _defaultProps2 = require("../../MultiSelect/MobileHeader/props/defaultProps");
17
+
16
18
  var _MultiSelect = require("./MultiSelect");
17
19
 
18
20
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
@@ -156,7 +158,7 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
156
158
  customProps = _this$props.customProps;
157
159
  var _customProps$Suggesti = customProps.SuggestionsProps,
158
160
  SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
159
- i18nKeys = Object.assign({}, MobileHeader_defaultProps.i18nKeys, i18nKeys, {
161
+ i18nKeys = Object.assign({}, _defaultProps2.defaultProps.i18nKeys, i18nKeys, {
160
162
  emptyText: i18nKeys.emptyText || emptyMessage,
161
163
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
162
164
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage