@zohodesk/dot 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +1 -1
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +21 -12
  5. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +163 -553
  6. package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +3 -12
  7. package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +3 -12
  8. package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +3 -12
  9. package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +3 -12
  10. package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +3 -12
  11. package/assets/Appearance/light/mode/Dot_LightMode.module.css +163 -553
  12. package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +3 -12
  13. package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +3 -12
  14. package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +3 -12
  15. package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +3 -12
  16. package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +3 -12
  17. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +163 -553
  18. package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +3 -12
  19. package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +3 -12
  20. package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +3 -12
  21. package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +3 -12
  22. package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +3 -12
  23. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  24. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  25. package/coverage/ExternalLink/index.html +1 -1
  26. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  27. package/coverage/ExternalLink/props/index.html +1 -1
  28. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  29. package/coverage/IconButton/IconButton.js.html +466 -0
  30. package/coverage/IconButton/IconButton.module.css.html +151 -0
  31. package/coverage/IconButton/index.html +131 -0
  32. package/coverage/IconButton/props/defaultProps.js.html +136 -0
  33. package/coverage/IconButton/props/index.html +131 -0
  34. package/coverage/IconButton/props/propTypes.js.html +187 -0
  35. package/coverage/Image/Image.js.html +1 -1
  36. package/coverage/Image/Image.module.css.html +1 -1
  37. package/coverage/Image/index.html +1 -1
  38. package/coverage/Image/props/defaultProps.js.html +1 -1
  39. package/coverage/Image/props/index.html +1 -1
  40. package/coverage/Image/props/propTypes.js.html +1 -1
  41. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  42. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  43. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  44. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  45. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  46. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  47. package/coverage/coverage-final.json +4 -0
  48. package/coverage/coverage-summary.json +5 -1
  49. package/coverage/index.html +40 -10
  50. package/es/IconButton/__tests__/IconButton.spec.js +148 -0
  51. package/es/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  52. package/es/form/fields/FieldContainer/props/propTypes.js +1 -1
  53. package/es/v1/ActionButton/ActionButton.js +2 -2
  54. package/es/v1/AlphabeticList/AlphabeticList.js +6 -2
  55. package/es/v1/Attachment/Attachment.js +78 -75
  56. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -63
  57. package/es/v1/Image/Image.js +26 -33
  58. package/es/v1/Loader/Loader.js +12 -18
  59. package/es/v1/Message/Message.js +16 -42
  60. package/es/v1/PlusIcon/PlusIcon.js +25 -37
  61. package/es/v1/Separator/Separator.js +40 -47
  62. package/es/v1/Upload/Upload.js +59 -66
  63. package/es/v1/alert/AlertHeader/AlertHeader.js +5 -4
  64. package/es/v1/alert/AlertHeader/props/defaultProps.js +12 -0
  65. package/es/v1/alert/AlertHeader/props/propTypes.js +20 -0
  66. package/es/v1/alert/AlertLookup/AlertLookup.js +6 -4
  67. package/es/v1/alert/AlertLookup/props/defaultProps.js +13 -0
  68. package/es/v1/alert/AlertLookup/props/propTypes.js +36 -0
  69. package/es/v1/avatar/AvatarClose/AvatarClose.js +32 -43
  70. package/es/v1/avatar/AvatarCollision/AvatarCollision.js +41 -52
  71. package/es/v1/avatar/AvatarIcon/AvatarIcon.js +38 -43
  72. package/es/v1/avatar/AvatarStatus/AvatarStatus.js +52 -63
  73. package/es/v1/avatar/AvatarThread/AvatarThread.js +62 -69
  74. package/es/v1/avatar/AvatarUser/AvatarUser.js +93 -100
  75. package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +81 -88
  76. package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  77. package/es/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  78. package/es/v1/form/fields/DateField/DateField.js +6 -6
  79. package/es/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  80. package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  81. package/es/v1/form/fields/PhoneField/PhoneField.js +6 -6
  82. package/es/v1/form/fields/RadioField/RadioField.js +89 -97
  83. package/es/v1/form/fields/SelectField/SelectField.js +139 -154
  84. package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +154 -197
  85. package/es/v1/layout/SubtabLayout/SubtabLayout.js +108 -124
  86. package/es/v1/list/SecondaryText/AccountName.js +61 -69
  87. package/es/v1/list/SecondaryText/ContactName.js +66 -74
  88. package/es/v1/list/SecondaryText/DepartmentText.js +15 -27
  89. package/es/v1/list/SecondaryText/Email.js +32 -40
  90. package/es/v1/list/SecondaryText/HappinessRating.js +17 -25
  91. package/es/v1/list/SecondaryText/PhoneNumber.js +36 -44
  92. package/es/v1/list/SecondaryText/PriorityText.js +16 -28
  93. package/es/v1/list/SecondaryText/SecondaryText.js +21 -33
  94. package/es/v1/list/SecondaryText/StatusText.js +17 -29
  95. package/es/v1/list/SecondaryText/TicketId.js +33 -45
  96. package/es/v1/list/SecondaryText/Website.js +22 -30
  97. package/es/v1/list/SecondryPanel/SecondryPanel.js +66 -83
  98. package/es/v1/list/SentimentStatus/SentimentStatus.js +18 -29
  99. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  100. package/es/v1/list/status/StatusListItem/StatusListItem.js +75 -100
  101. package/es/v1/lookup/EmptyPage/EmptyPage.js +15 -26
  102. package/es/v1/lookup/Section/Section.js +14 -20
  103. package/es/v1/svg/PlusIcon.js +20 -27
  104. package/es/v1/svg/SnippetIcon.js +22 -29
  105. package/es/v1/svg/TemplateIcon.js +23 -30
  106. package/lib/IconButton/__tests__/IconButton.spec.js +156 -0
  107. package/lib/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  108. package/lib/form/fields/FieldContainer/props/propTypes.js +1 -1
  109. package/lib/v1/ActionButton/ActionButton.js +2 -2
  110. package/lib/v1/AlphabeticList/AlphabeticList.js +7 -3
  111. package/lib/v1/Attachment/Attachment.js +77 -112
  112. package/lib/v1/AttachmentViewer/AttachmentImage.js +61 -96
  113. package/lib/v1/Image/Image.js +26 -71
  114. package/lib/v1/Loader/Loader.js +12 -55
  115. package/lib/v1/Message/Message.js +23 -80
  116. package/lib/v1/PlusIcon/PlusIcon.js +25 -71
  117. package/lib/v1/Separator/Separator.js +44 -85
  118. package/lib/v1/Upload/Upload.js +58 -103
  119. package/lib/v1/alert/AlertHeader/AlertHeader.js +5 -4
  120. package/lib/v1/alert/AlertHeader/props/defaultProps.js +19 -0
  121. package/lib/v1/alert/AlertHeader/props/propTypes.js +31 -0
  122. package/lib/v1/alert/AlertLookup/AlertLookup.js +6 -4
  123. package/lib/v1/alert/AlertLookup/props/defaultProps.js +20 -0
  124. package/lib/v1/alert/AlertLookup/props/propTypes.js +47 -0
  125. package/lib/v1/avatar/AvatarClose/AvatarClose.js +32 -77
  126. package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +41 -86
  127. package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +37 -80
  128. package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +52 -97
  129. package/lib/v1/avatar/AvatarThread/AvatarThread.js +61 -106
  130. package/lib/v1/avatar/AvatarUser/AvatarUser.js +95 -140
  131. package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +85 -130
  132. package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  133. package/lib/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  134. package/lib/v1/form/fields/DateField/DateField.js +6 -6
  135. package/lib/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  136. package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  137. package/lib/v1/form/fields/PhoneField/PhoneField.js +6 -6
  138. package/lib/v1/form/fields/RadioField/RadioField.js +91 -137
  139. package/lib/v1/form/fields/SelectField/SelectField.js +149 -200
  140. package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +160 -253
  141. package/lib/v1/layout/SubtabLayout/SubtabLayout.js +107 -206
  142. package/lib/v1/list/SecondaryText/AccountName.js +63 -113
  143. package/lib/v1/list/SecondaryText/ContactName.js +67 -117
  144. package/lib/v1/list/SecondaryText/DepartmentText.js +16 -66
  145. package/lib/v1/list/SecondaryText/Email.js +32 -82
  146. package/lib/v1/list/SecondaryText/HappinessRating.js +21 -68
  147. package/lib/v1/list/SecondaryText/PhoneNumber.js +36 -86
  148. package/lib/v1/list/SecondaryText/PriorityText.js +16 -66
  149. package/lib/v1/list/SecondaryText/SecondaryText.js +19 -69
  150. package/lib/v1/list/SecondaryText/StatusText.js +17 -67
  151. package/lib/v1/list/SecondaryText/TicketId.js +33 -83
  152. package/lib/v1/list/SecondaryText/Website.js +29 -72
  153. package/lib/v1/list/SecondryPanel/SecondryPanel.js +69 -168
  154. package/lib/v1/list/SentimentStatus/SentimentStatus.js +19 -64
  155. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  156. package/lib/v1/list/status/StatusListItem/StatusListItem.js +81 -137
  157. package/lib/v1/lookup/EmptyPage/EmptyPage.js +43 -93
  158. package/lib/v1/lookup/Section/Section.js +14 -58
  159. package/lib/v1/svg/PlusIcon.js +20 -65
  160. package/lib/v1/svg/SnippetIcon.js +22 -67
  161. package/lib/v1/svg/TemplateIcon.js +23 -68
  162. package/package.json +12 -12
  163. package/result.json +1 -1
  164. package/unittest/index.html +1 -1
@@ -29,141 +29,95 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
29
29
 
30
30
  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); }
31
31
 
32
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
- 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); } }
35
-
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
- 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); }
39
-
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
- 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); }; }
43
-
44
- 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); }
45
-
46
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
- 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; } }
49
-
50
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
- var RadioField = /*#__PURE__*/function (_PureComponent) {
53
- _inherits(RadioField, _PureComponent);
54
-
55
- var _super = _createSuper(RadioField);
56
-
57
- function RadioField(props) {
58
- var _this;
59
-
60
- _classCallCheck(this, RadioField);
61
-
62
- _this = _super.call(this, props);
63
- _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
64
- return _this;
65
- }
66
-
67
- _createClass(RadioField, [{
68
- key: "handleChange",
69
- value: function handleChange(value) {
70
- var _this$props = this.props,
71
- id = _this$props.id,
72
- onChange = _this$props.onChange;
73
- onChange && onChange(id, value);
74
- }
75
- }, {
76
- key: "render",
77
- value: function render() {
78
- var _this2 = this;
79
-
80
- var _this$props2 = this.props,
81
- labelName = _this$props2.labelName,
82
- id = _this$props2.id,
83
- isMandatory = _this$props2.isMandatory,
84
- options = _this$props2.options,
85
- validationMessage = _this$props2.validationMessage,
86
- validationPalette = _this$props2.validationPalette,
87
- errorType = _this$props2.errorType,
88
- isDisabled = _this$props2.isDisabled,
89
- title = _this$props2.title,
90
- labelPalette = _this$props2.labelPalette,
91
- labelSize = _this$props2.labelSize,
92
- size = _this$props2.size,
93
- selectedValue = _this$props2.selectedValue,
94
- isActive = _this$props2.isActive,
95
- dataId = _this$props2.dataId,
96
- dataSelectorId = _this$props2.dataSelectorId,
97
- validationRuleMessage = _this$props2.validationRuleMessage,
98
- validationRulePalette = _this$props2.validationRulePalette,
99
- isReadOnly = _this$props2.isReadOnly,
100
- variant = _this$props2.variant,
101
- customProps = _this$props2.customProps;
102
- var _customProps$LabelPro = customProps.LabelProps,
103
- LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
104
- _customProps$RadioPro = customProps.RadioProps,
105
- RadioProps = _customProps$RadioPro === void 0 ? {} : _customProps$RadioPro,
106
- _customProps$Validati = customProps.ValidationMessageProps1,
107
- ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
108
- _customProps$Validati2 = customProps.ValidationMessageProps2,
109
- ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
110
- return /*#__PURE__*/_react["default"].createElement("div", {
111
- className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
112
- "data-title": isDisabled ? title : null,
113
- "data-selector-id": dataSelectorId
114
- }, labelName && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
115
- text: labelName,
116
- size: "medium",
117
- id: id,
118
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : 'default',
119
- customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
120
- dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
121
- }, LabelProps)), /*#__PURE__*/_react["default"].createElement("div", {
122
- className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"].fieldMargin_medium : '', " ").concat(_FieldsModule["default"].radioContainer)
123
- }, options.map(function (option, index) {
124
- var text = option.text,
125
- value = option.value;
126
- return /*#__PURE__*/_react["default"].createElement("span", {
127
- key: index,
128
- className: "".concat(_FieldsModule["default"].radio)
129
- }, /*#__PURE__*/_react["default"].createElement(_Radio["default"], _extends({
130
- id: index,
131
- value: value,
132
- name: id,
133
- text: text,
134
- labelPalette: labelPalette,
135
- labelSize: labelSize,
136
- active: isActive,
137
- disabled: isDisabled,
138
- onChange: _this2.handleChange,
139
- size: size,
140
- checked: selectedValue == value,
141
- dataId: dataId,
142
- isReadOnly: isReadOnly,
143
- variant: variant
144
- }, RadioProps)));
145
- })), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
146
- text: validationMessage,
147
- palette: validationPalette,
148
- type: errorType,
149
- dataId: "".concat(dataId, "_ValidationMessage")
150
- }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
151
- text: validationRuleMessage,
152
- palette: validationRulePalette,
153
- type: errorType,
154
- dataId: "".concat(dataId, "_ValidationRuleMessage")
155
- }, ValidationMessageProps2)));
156
- }
157
- }]);
158
-
159
- return RadioField;
160
- }(_react.PureComponent);
161
-
162
- exports["default"] = RadioField;
32
+ var RadioField = function RadioField(props) {
33
+ var labelName = props.labelName,
34
+ id = props.id,
35
+ isMandatory = props.isMandatory,
36
+ options = props.options,
37
+ validationMessage = props.validationMessage,
38
+ validationPalette = props.validationPalette,
39
+ errorType = props.errorType,
40
+ isDisabled = props.isDisabled,
41
+ title = props.title,
42
+ labelPalette = props.labelPalette,
43
+ labelSize = props.labelSize,
44
+ size = props.size,
45
+ selectedValue = props.selectedValue,
46
+ isActive = props.isActive,
47
+ dataId = props.dataId,
48
+ dataSelectorId = props.dataSelectorId,
49
+ validationRuleMessage = props.validationRuleMessage,
50
+ validationRulePalette = props.validationRulePalette,
51
+ isReadOnly = props.isReadOnly,
52
+ variant = props.variant,
53
+ customProps = props.customProps,
54
+ onChange = props.onChange;
55
+ var _customProps$LabelPro = customProps.LabelProps,
56
+ LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
57
+ _customProps$RadioPro = customProps.RadioProps,
58
+ RadioProps = _customProps$RadioPro === void 0 ? {} : _customProps$RadioPro,
59
+ _customProps$Validati = customProps.ValidationMessageProps1,
60
+ ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
61
+ _customProps$Validati2 = customProps.ValidationMessageProps2,
62
+ ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
63
+
64
+ var handleChange = function handleChange(value) {
65
+ onChange && onChange(id, value);
66
+ };
67
+
68
+ return /*#__PURE__*/_react["default"].createElement("div", {
69
+ className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
70
+ "data-title": isDisabled ? title : null,
71
+ "data-selector-id": dataSelectorId
72
+ }, labelName && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
73
+ text: labelName,
74
+ size: "medium",
75
+ id: id,
76
+ palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : 'default',
77
+ customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
78
+ dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
79
+ }, LabelProps)), /*#__PURE__*/_react["default"].createElement("div", {
80
+ className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"].fieldMargin_medium : '', " ").concat(_FieldsModule["default"].radioContainer)
81
+ }, options.map(function (option, index) {
82
+ var text = option.text,
83
+ value = option.value;
84
+ return /*#__PURE__*/_react["default"].createElement("span", {
85
+ key: index,
86
+ className: "".concat(_FieldsModule["default"].radio)
87
+ }, /*#__PURE__*/_react["default"].createElement(_Radio["default"], _extends({
88
+ id: index,
89
+ value: value,
90
+ name: id,
91
+ text: text,
92
+ labelPalette: labelPalette,
93
+ labelSize: labelSize,
94
+ active: isActive,
95
+ disabled: isDisabled,
96
+ onChange: handleChange,
97
+ size: size,
98
+ checked: selectedValue == value,
99
+ dataId: dataId,
100
+ isReadOnly: isReadOnly,
101
+ variant: variant
102
+ }, RadioProps)));
103
+ })), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
104
+ text: validationMessage,
105
+ palette: validationPalette,
106
+ type: errorType,
107
+ dataId: "".concat(dataId, "_ValidationMessage")
108
+ }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
109
+ text: validationRuleMessage,
110
+ palette: validationRulePalette,
111
+ type: errorType,
112
+ dataId: "".concat(dataId, "_ValidationRuleMessage")
113
+ }, ValidationMessageProps2)));
114
+ };
115
+
163
116
  RadioField.propTypes = _propTypes.propTypes;
164
- RadioField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
165
- // RadioField.docs = {
166
- // componentGroup: 'Form Fields',
167
- // folderName: 'General'
168
- // };
169
- // }
117
+ RadioField.defaultProps = _defaultProps.defaultProps;
118
+ var MemoizedRadioField = /*#__PURE__*/(0, _react.memo)(RadioField);
119
+ MemoizedRadioField.propTypes = _propTypes.propTypes;
120
+ MemoizedRadioField.defaultProps = _defaultProps.defaultProps;
121
+ MemoizedRadioField.displayName = 'RadioField';
122
+ var _default = MemoizedRadioField;
123
+ exports["default"] = _default;
@@ -33,204 +33,153 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
33
33
 
34
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
35
 
36
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37
-
38
- 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); } }
39
-
40
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
41
-
42
- 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); }
43
-
44
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
-
46
- 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); }; }
47
-
48
- 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); }
49
-
50
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
51
-
52
- 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; } }
53
-
54
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
-
56
- var SelectField = /*#__PURE__*/function (_PureComponent) {
57
- _inherits(SelectField, _PureComponent);
58
-
59
- var _super = _createSuper(SelectField);
60
-
61
- function SelectField(props) {
62
- var _this;
63
-
64
- _classCallCheck(this, SelectField);
65
-
66
- _this = _super.call(this, props);
67
- _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
68
- _this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this)); // this.handleLabelClick = this.handleLabelClick.bind(this);
69
-
70
- _this.getNextId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
71
- return _this;
72
- }
73
-
74
- _createClass(SelectField, [{
75
- key: "handleChange",
76
- value: function handleChange(selctedId, selectedValue) {
77
- var _this$props = this.props,
78
- fieldId = _this$props.id,
79
- onChange = _this$props.onChange,
80
- propValue = _this$props.selectedValue;
81
- onChange && propValue !== selctedId && onChange(fieldId, selctedId, selectedValue);
82
- }
83
- }, {
84
- key: "handleGetRef",
85
- value: function handleGetRef(el) {
86
- var _this$props2 = this.props,
87
- getRef = _this$props2.getRef,
88
- id = _this$props2.id;
89
- this.selectBox = el;
90
- getRef && getRef(el, id);
91
- } // handleLabelClick() {
92
- // let { isFocusOnLabelClick } = this.props;
93
- // if (isFocusOnLabelClick && this.selectBox && this.selectBox.focus) {
94
- // this.selectBox.focus();
95
- // }
96
- // }
97
-
98
- }, {
99
- key: "render",
100
- value: function render() {
101
- var _this$props3 = this.props,
102
- labelName = _this$props3.labelName,
103
- id = _this$props3.id,
104
- isMandatory = _this$props3.isMandatory,
105
- options = _this$props3.options,
106
- selectedValue = _this$props3.selectedValue,
107
- needSearch = _this$props3.needSearch,
108
- emptyMessage = _this$props3.emptyMessage,
109
- animationStyle = _this$props3.animationStyle,
110
- textBoxSize = _this$props3.textBoxSize,
111
- textBoxVariant = _this$props3.textBoxVariant,
112
- searchBoxSize = _this$props3.searchBoxSize,
113
- searchBoxPlaceHolder = _this$props3.searchBoxPlaceHolder,
114
- validationMessage = _this$props3.validationMessage,
115
- validationPalette = _this$props3.validationPalette,
116
- isReadOnly = _this$props3.isReadOnly,
117
- valueField = _this$props3.valueField,
118
- textField = _this$props3.textField,
119
- excludeOptions = _this$props3.excludeOptions,
120
- errorType = _this$props3.errorType,
121
- isDisabled = _this$props3.isDisabled,
122
- title = _this$props3.title,
123
- dataId = _this$props3.dataId,
124
- dataSelectorId = _this$props3.dataSelectorId,
125
- fieldClass = _this$props3.fieldClass,
126
- validationRuleMessage = _this$props3.validationRuleMessage,
127
- validationRulePalette = _this$props3.validationRulePalette,
128
- onKeyDown = _this$props3.onKeyDown,
129
- infoText = _this$props3.infoText,
130
- isLocked = _this$props3.isLocked,
131
- lockedInfoText = _this$props3.lockedInfoText,
132
- borderColor = _this$props3.borderColor,
133
- fieldSize = _this$props3.fieldSize,
134
- isNextOptions = _this$props3.isNextOptions,
135
- getNextOptions = _this$props3.getNextOptions,
136
- popupGroup = _this$props3.popupGroup,
137
- onSearch = _this$props3.onSearch,
138
- labelPalette = _this$props3.labelPalette,
139
- labelCustomClass = _this$props3.labelCustomClass,
140
- htmlId = _this$props3.htmlId,
141
- needLocalSearch = _this$props3.needLocalSearch,
142
- isDefaultSelectValue = _this$props3.isDefaultSelectValue,
143
- placeHolder = _this$props3.placeHolder,
144
- children = _this$props3.children,
145
- onFocus = _this$props3.onFocus,
146
- iconOnHover = _this$props3.iconOnHover,
147
- customProps = _this$props3.customProps,
148
- renderLabelProps = _this$props3.renderLabelProps;
149
- var _customProps$LabelPro = customProps.LabelProps,
150
- LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
151
- _customProps$SelectPr = customProps.SelectProps,
152
- SelectProps = _customProps$SelectPr === void 0 ? {} : _customProps$SelectPr,
153
- _customProps$Validati = customProps.ValidationMessageProps1,
154
- ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
155
- _customProps$Validati2 = customProps.ValidationMessageProps2,
156
- ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
157
- var uniqueId = htmlId ? htmlId : this.getNextId();
158
- return /*#__PURE__*/_react["default"].createElement("div", {
159
- className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
160
- "data-title": isDisabled ? title : null,
161
- "data-selector-id": dataSelectorId
162
- }, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
163
- infoText: infoText,
164
- isLocked: isLocked,
165
- lockedInfoText: lockedInfoText,
166
- renderProps: renderLabelProps
167
- }, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
168
- text: labelName,
169
- size: fieldSize === 'small' ? 'small' : 'medium',
170
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
171
- customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
172
- htmlFor: uniqueId,
173
- dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
174
- }, LabelProps, {
175
- id: uniqueId
176
- }))), /*#__PURE__*/_react["default"].createElement("div", {
177
- className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '', " ").concat(fieldClass ? fieldClass : '')
178
- }, /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
179
- options: options,
180
- selectedValue: selectedValue,
181
- onChange: this.handleChange,
182
- onFocus: onFocus,
183
- getRef: this.handleGetRef,
184
- needSearch: needSearch,
185
- emptyMessage: emptyMessage,
186
- animationStyle: animationStyle,
187
- textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
188
- textBoxVariant: textBoxVariant,
189
- searchBoxSize: searchBoxSize,
190
- searchBoxPlaceHolder: searchBoxPlaceHolder,
191
- valueField: valueField,
192
- textField: textField,
193
- excludeOptions: excludeOptions,
194
- dataId: dataId,
195
- onKeyDown: onKeyDown,
196
- borderColor: borderColor,
197
- isDisabled: isDisabled,
198
- isReadOnly: isReadOnly,
199
- isNextOptions: isNextOptions,
200
- getNextOptions: getNextOptions,
201
- popupGroup: popupGroup,
202
- onSearch: onSearch,
203
- htmlId: uniqueId,
204
- needLocalSearch: needLocalSearch,
205
- isDefaultSelectValue: isDefaultSelectValue,
206
- placeHolder: placeHolder,
207
- iconOnHover: iconOnHover
208
- }, SelectProps, {
209
- ariaLabelledby: uniqueId
210
- }), children ? children : null)), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
211
- text: validationMessage,
212
- palette: validationPalette,
213
- type: errorType,
214
- htmlFor: uniqueId,
215
- dataId: "".concat(dataId, "_ValidationMessage")
216
- }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
217
- text: validationRuleMessage,
218
- palette: validationRulePalette,
219
- type: errorType,
220
- htmlFor: uniqueId,
221
- dataId: "".concat(dataId, "_ValidationRuleMessage")
222
- }, ValidationMessageProps2)));
223
- }
224
- }]);
225
-
226
- return SelectField;
227
- }(_react.PureComponent);
228
-
229
- exports["default"] = SelectField;
36
+ var SelectField = function SelectField(props) {
37
+ var labelName = props.labelName,
38
+ isMandatory = props.isMandatory,
39
+ options = props.options,
40
+ selectedValue = props.selectedValue,
41
+ needSearch = props.needSearch,
42
+ emptyMessage = props.emptyMessage,
43
+ animationStyle = props.animationStyle,
44
+ textBoxSize = props.textBoxSize,
45
+ textBoxVariant = props.textBoxVariant,
46
+ searchBoxSize = props.searchBoxSize,
47
+ searchBoxPlaceHolder = props.searchBoxPlaceHolder,
48
+ validationMessage = props.validationMessage,
49
+ validationPalette = props.validationPalette,
50
+ isReadOnly = props.isReadOnly,
51
+ valueField = props.valueField,
52
+ textField = props.textField,
53
+ excludeOptions = props.excludeOptions,
54
+ errorType = props.errorType,
55
+ isDisabled = props.isDisabled,
56
+ title = props.title,
57
+ dataId = props.dataId,
58
+ dataSelectorId = props.dataSelectorId,
59
+ fieldClass = props.fieldClass,
60
+ validationRuleMessage = props.validationRuleMessage,
61
+ validationRulePalette = props.validationRulePalette,
62
+ onKeyDown = props.onKeyDown,
63
+ infoText = props.infoText,
64
+ isLocked = props.isLocked,
65
+ lockedInfoText = props.lockedInfoText,
66
+ borderColor = props.borderColor,
67
+ fieldSize = props.fieldSize,
68
+ isNextOptions = props.isNextOptions,
69
+ getNextOptions = props.getNextOptions,
70
+ popupGroup = props.popupGroup,
71
+ onSearch = props.onSearch,
72
+ labelPalette = props.labelPalette,
73
+ labelCustomClass = props.labelCustomClass,
74
+ htmlId = props.htmlId,
75
+ needLocalSearch = props.needLocalSearch,
76
+ isDefaultSelectValue = props.isDefaultSelectValue,
77
+ placeHolder = props.placeHolder,
78
+ children = props.children,
79
+ onFocus = props.onFocus,
80
+ iconOnHover = props.iconOnHover,
81
+ customProps = props.customProps,
82
+ renderLabelProps = props.renderLabelProps,
83
+ id = props.id,
84
+ onChange = props.onChange,
85
+ getRef = props.getRef;
86
+ var _customProps$LabelPro = customProps.LabelProps,
87
+ LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
88
+ _customProps$SelectPr = customProps.SelectProps,
89
+ SelectProps = _customProps$SelectPr === void 0 ? {} : _customProps$SelectPr,
90
+ _customProps$Validati = customProps.ValidationMessageProps1,
91
+ ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
92
+ _customProps$Validati2 = customProps.ValidationMessageProps2,
93
+ ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
94
+ var getNextId = (0, _IdProvider.useUniqueId)();
95
+ var uniqueId = htmlId ? htmlId : getNextId();
96
+
97
+ var handleChange = function handleChange(selectedId, selectedVal) {
98
+ onChange && selectedValue !== selectedId && onChange(id, selectedId, selectedVal);
99
+ };
100
+
101
+ var handleGetRef = function handleGetRef(el) {
102
+ getRef && getRef(el, id);
103
+ }; // handleLabelClick() {
104
+ // let { isFocusOnLabelClick } = this.props;
105
+ // if (isFocusOnLabelClick && this.selectBox && this.selectBox.focus) {
106
+ // this.selectBox.focus();
107
+ // }
108
+ // }
109
+
110
+
111
+ return /*#__PURE__*/_react["default"].createElement("div", {
112
+ className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
113
+ "data-title": isDisabled ? title : null,
114
+ "data-selector-id": dataSelectorId
115
+ }, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
116
+ infoText: infoText,
117
+ isLocked: isLocked,
118
+ lockedInfoText: lockedInfoText,
119
+ renderProps: renderLabelProps
120
+ }, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
121
+ text: labelName,
122
+ size: fieldSize === 'small' ? 'small' : 'medium',
123
+ palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
124
+ customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
125
+ htmlFor: uniqueId,
126
+ dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
127
+ }, LabelProps, {
128
+ id: uniqueId
129
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
130
+ className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '', " ").concat(fieldClass ? fieldClass : '')
131
+ }, /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
132
+ options: options,
133
+ selectedValue: selectedValue,
134
+ onChange: handleChange,
135
+ onFocus: onFocus,
136
+ getRef: handleGetRef,
137
+ needSearch: needSearch,
138
+ emptyMessage: emptyMessage,
139
+ animationStyle: animationStyle,
140
+ textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
141
+ textBoxVariant: textBoxVariant,
142
+ searchBoxSize: searchBoxSize,
143
+ searchBoxPlaceHolder: searchBoxPlaceHolder,
144
+ valueField: valueField,
145
+ textField: textField,
146
+ excludeOptions: excludeOptions,
147
+ dataId: dataId,
148
+ onKeyDown: onKeyDown,
149
+ borderColor: borderColor,
150
+ isDisabled: isDisabled,
151
+ isReadOnly: isReadOnly,
152
+ isNextOptions: isNextOptions,
153
+ getNextOptions: getNextOptions,
154
+ popupGroup: popupGroup,
155
+ onSearch: onSearch,
156
+ htmlId: uniqueId,
157
+ needLocalSearch: needLocalSearch,
158
+ isDefaultSelectValue: isDefaultSelectValue,
159
+ placeHolder: placeHolder,
160
+ iconOnHover: iconOnHover
161
+ }, SelectProps, {
162
+ ariaLabelledby: uniqueId
163
+ }), children ? children : null)), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
164
+ text: validationMessage,
165
+ palette: validationPalette,
166
+ type: errorType,
167
+ htmlFor: uniqueId,
168
+ dataId: "".concat(dataId, "_ValidationMessage")
169
+ }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
170
+ text: validationRuleMessage,
171
+ palette: validationRulePalette,
172
+ type: errorType,
173
+ htmlFor: uniqueId,
174
+ dataId: "".concat(dataId, "_ValidationRuleMessage")
175
+ }, ValidationMessageProps2)));
176
+ };
177
+
230
178
  SelectField.propTypes = _propTypes.propTypes;
231
- SelectField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
232
- // SelectField.docs = {
233
- // componentGroup: 'Form Fields',
234
- // folderName: 'General'
235
- // };
236
- // }
179
+ SelectField.defaultProps = _defaultProps.defaultProps;
180
+ var MemoizedSelectField = /*#__PURE__*/(0, _react.memo)(SelectField);
181
+ MemoizedSelectField.propTypes = _propTypes.propTypes;
182
+ MemoizedSelectField.defaultProps = _defaultProps.defaultProps;
183
+ MemoizedSelectField.displayName = 'SelectField';
184
+ var _default = MemoizedSelectField;
185
+ exports["default"] = _default;