@zohodesk/dot 1.4.10 → 1.4.11
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.
- package/.cli/UnValidatedFiles.html +101 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +5 -0
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/IconButton/IconButton.js.html +1 -1
- package/coverage/IconButton/IconButton.module.css.html +1 -1
- package/coverage/IconButton/index.html +1 -1
- package/coverage/IconButton/props/defaultProps.js.html +1 -1
- package/coverage/IconButton/props/index.html +1 -1
- package/coverage/IconButton/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -4
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +9 -0
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
- package/es/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
- package/es/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
- package/es/v1/form/fields/SelectField/SelectField.js +1 -9
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +42 -13
- package/es/v1/form/fields/TagsMultiSelect/props/defaultProps.js +4 -1
- package/es/v1/form/fields/TagsMultiSelect/props/propTypes.js +10 -1
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
- package/es/v1/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
- package/es/v1/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +122 -142
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +133 -153
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +137 -178
- package/es/v1/form/fields/TextareaField/TextareaField.js +113 -137
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +43 -43
- package/es/v1/form/layout/Field/Field.js +24 -28
- package/es/v1/form/layout/Section/Section.js +26 -33
- package/es/v1/list/Subject/Subject.js +39 -48
- package/es/v1/list/TagNew/TagNew.js +18 -27
- package/es/v1/list/Thread/Thread.js +26 -35
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -5
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +9 -0
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
- package/lib/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
- package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
- package/lib/v1/form/fields/SelectField/SelectField.js +1 -7
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +45 -13
- package/lib/v1/form/fields/TagsMultiSelect/props/defaultProps.js +4 -1
- package/lib/v1/form/fields/TagsMultiSelect/props/propTypes.js +10 -1
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
- package/lib/v1/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
- package/lib/v1/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +125 -181
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +138 -193
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +160 -212
- package/lib/v1/form/fields/TextareaField/TextareaField.js +117 -177
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +41 -80
- package/lib/v1/form/layout/Field/Field.js +22 -69
- package/lib/v1/form/layout/Section/Section.js +26 -72
- package/lib/v1/list/Subject/Subject.js +39 -87
- package/lib/v1/list/TagNew/TagNew.js +18 -66
- package/lib/v1/list/Thread/Thread.js +25 -73
- package/package.json +8 -8
- package/propValidationArg.json +8 -4
- package/result.json +1 -1
|
@@ -33,6 +33,8 @@ var _ResponsiveDropBox = _interopRequireDefault(require("@zohodesk/components/es
|
|
|
33
33
|
|
|
34
34
|
var _CustomResponsive = require("@zohodesk/components/es/v1/Responsive/CustomResponsive");
|
|
35
35
|
|
|
36
|
+
var _MultiSelectHeader = _interopRequireDefault(require("@zohodesk/components/es/v1/MultiSelect/MultiSelectHeader"));
|
|
37
|
+
|
|
36
38
|
var _General = require("../../../../utils/General");
|
|
37
39
|
|
|
38
40
|
var _Common = require("@zohodesk/components/es/utils/Common.js");
|
|
@@ -41,6 +43,8 @@ var _TagsMultiSelectModule = _interopRequireDefault(require("../../../../form/fi
|
|
|
41
43
|
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
45
|
|
|
46
|
+
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); }
|
|
47
|
+
|
|
44
48
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
49
|
|
|
46
50
|
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); } }
|
|
@@ -200,11 +204,28 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
200
204
|
boxSize = _this$props3.boxSize,
|
|
201
205
|
onSelectTag = _this$props3.onSelectTag,
|
|
202
206
|
clickableTag = _this$props3.clickableTag,
|
|
203
|
-
dataSelectorId = _this$props3.dataSelectorId
|
|
207
|
+
dataSelectorId = _this$props3.dataSelectorId,
|
|
208
|
+
handleSelectAll = _this$props3.handleSelectAll,
|
|
209
|
+
selectAllText = _this$props3.selectAllText,
|
|
210
|
+
needSelectAll = _this$props3.needSelectAll,
|
|
211
|
+
customClass = _this$props3.customClass,
|
|
212
|
+
customProps = _this$props3.customProps;
|
|
204
213
|
var showAll = this.state.showAll;
|
|
205
214
|
var chipLimit = !isPopupReady ? showAll ? tagsList.length : chipNeedToShow : tagsList.length;
|
|
215
|
+
var _customClass$tagCusto = customClass.tagCustomClass,
|
|
216
|
+
tagCustomClass = _customClass$tagCusto === void 0 ? '' : _customClass$tagCusto,
|
|
217
|
+
_customClass$listItem = customClass.listItemClass,
|
|
218
|
+
listItemClass = _customClass$listItem === void 0 ? '' : _customClass$listItem,
|
|
219
|
+
_customClass$textBoxI = customClass.textBoxIconWrapperClass,
|
|
220
|
+
textBoxIconWrapperClass = _customClass$textBoxI === void 0 ? '' : _customClass$textBoxI;
|
|
221
|
+
var _customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
222
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
|
|
223
|
+
_customProps$TagWrapp = customProps.TagWrapperProps,
|
|
224
|
+
TagWrapperProps = _customProps$TagWrapp === void 0 ? {} : _customProps$TagWrapp,
|
|
225
|
+
_customProps$TagProps = customProps.TagProps,
|
|
226
|
+
TagProps = _customProps$TagProps === void 0 ? {} : _customProps$TagProps;
|
|
206
227
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
|
-
className: " ".concat(!isReadOnly ? " ".concat(needBorder ? _TagsMultiSelectModule["default"].hasBorder : '', "\n ").concat(needBorder ? _TagsMultiSelectModule["default"]["borderColor_".concat(borderColor)] : _TagsMultiSelectModule["default"].borderColor_transparent, " ").concat(isPopupReady && needBorder ? _TagsMultiSelectModule["default"].active : '') : '', " ").concat(className),
|
|
228
|
+
className: "".concat(_TagsMultiSelectModule["default"].container, " ").concat(!isReadOnly ? " ".concat(needBorder ? _TagsMultiSelectModule["default"].hasBorder : '', "\n ").concat(needBorder ? _TagsMultiSelectModule["default"]["borderColor_".concat(borderColor)] : _TagsMultiSelectModule["default"].borderColor_transparent, " ").concat(isPopupReady && needBorder ? _TagsMultiSelectModule["default"].active : '') : '', " ").concat(className),
|
|
208
229
|
onClick: _General.stopBubbling,
|
|
209
230
|
"data-id": "".concat(dataId, "_tagsContainer"),
|
|
210
231
|
"data-test-id": "".concat(dataId, "_tagsContainer"),
|
|
@@ -213,26 +234,29 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
213
234
|
alignBox: "row",
|
|
214
235
|
align: "vertical",
|
|
215
236
|
isCover: false,
|
|
216
|
-
className: _TagsMultiSelectModule["default"].tagDiv,
|
|
237
|
+
className: "".concat(_TagsMultiSelectModule["default"].tagDiv, " ").concat(textBoxIconWrapperClass),
|
|
217
238
|
wrap: "wrap",
|
|
218
239
|
eleRef: getTargetRef,
|
|
219
240
|
scroll: "vertical"
|
|
220
241
|
}, tagsList.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, tagsList.map(function (tag, index) {
|
|
221
242
|
var name = tag.name,
|
|
222
243
|
tagType = tag.tagType,
|
|
223
|
-
id = tag.id
|
|
224
|
-
|
|
244
|
+
id = tag.id,
|
|
245
|
+
boxCustomProps = tag.boxCustomProps,
|
|
246
|
+
tagCustomProps = tag.tagCustomProps;
|
|
247
|
+
return index < chipLimit ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, _extends({
|
|
225
248
|
className: _TagsMultiSelectModule["default"].tag,
|
|
226
249
|
key: index
|
|
227
|
-
}, /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
|
250
|
+
}, TagWrapperProps, boxCustomProps), /*#__PURE__*/_react["default"].createElement(_Tag["default"], _extends({
|
|
228
251
|
id: id,
|
|
229
252
|
text: name,
|
|
230
253
|
onRemove: isReadOnly ? null : deleteTag.bind(_this3, name),
|
|
231
254
|
closeTitle: i18nKeys.deleteText,
|
|
232
255
|
palette: clickableTag ? 'defaultLink' : tagType === 'SYSTEM' ? 'primary' : 'default',
|
|
233
256
|
isReadOnly: isReadOnly,
|
|
234
|
-
onSelectTag: onSelectTag ? onSelectTag : undefined
|
|
235
|
-
|
|
257
|
+
onSelectTag: onSelectTag ? onSelectTag : undefined,
|
|
258
|
+
customClass: tagCustomClass
|
|
259
|
+
}, TagProps, tagCustomProps))) : null;
|
|
236
260
|
}), tagsList.length > chipNeedToShow && !isPopupReady ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
237
261
|
className: _TagsMultiSelectModule["default"].moreLess,
|
|
238
262
|
dataId: "".concat(dataId, "_tagsMore"),
|
|
@@ -244,7 +268,7 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
244
268
|
className: _TagsMultiSelectModule["default"].inputWrapper
|
|
245
269
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
246
270
|
className: _TagsMultiSelectModule["default"].custmSpan
|
|
247
|
-
}, name), /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
271
|
+
}, name), /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
|
|
248
272
|
htmlId: htmlId,
|
|
249
273
|
dataId: "".concat(dataId, "_tagInp"),
|
|
250
274
|
value: name,
|
|
@@ -261,7 +285,7 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
261
285
|
},
|
|
262
286
|
size: "xsmall",
|
|
263
287
|
inputRef: this.textInputRef
|
|
264
|
-
}, getTextBoxChildren ? getTextBoxChildren() : null))), isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
288
|
+
}, TextBoxIconProps), getTextBoxChildren ? getTextBoxChildren() : null))), isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
265
289
|
query: this.responsiveFunc,
|
|
266
290
|
responsiveId: "Helmet"
|
|
267
291
|
}, function (_ref2) {
|
|
@@ -283,7 +307,12 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
283
307
|
alignBox: "row"
|
|
284
308
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
285
309
|
flexible: true
|
|
286
|
-
},
|
|
310
|
+
}, needSelectAll ? /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
311
|
+
onSelect: handleSelectAll,
|
|
312
|
+
selectAllText: selectAllText,
|
|
313
|
+
suggestions: searchList,
|
|
314
|
+
dataId: "".concat(dataId, "_selectAll")
|
|
315
|
+
}) : null, isTagListLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
287
316
|
align: "both",
|
|
288
317
|
className: "".concat(tabletMode ? '' : _TagsMultiSelectModule["default"].viewpopNew)
|
|
289
318
|
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -296,7 +325,8 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
296
325
|
shrink: true
|
|
297
326
|
}, searchList.map(function (item, index) {
|
|
298
327
|
var name = item.name,
|
|
299
|
-
isNew = item.isNew
|
|
328
|
+
isNew = item.isNew,
|
|
329
|
+
listItemProps = item.listItemProps;
|
|
300
330
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, searchList.length > 1 && isNew ? /*#__PURE__*/_react["default"].createElement(_DropDownSeparator["default"], null) : null, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
|
|
301
331
|
key: index,
|
|
302
332
|
index: index,
|
|
@@ -307,7 +337,9 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
307
337
|
needTick: true,
|
|
308
338
|
highlight: selectSearchIndex === index,
|
|
309
339
|
getRef: _this3.getSelectedItemRef,
|
|
310
|
-
isDisabled: listDisabled
|
|
340
|
+
isDisabled: listDisabled,
|
|
341
|
+
customProps: listItemProps,
|
|
342
|
+
customClass: listItemClass
|
|
311
343
|
}, isNew ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
312
344
|
alignBox: "row",
|
|
313
345
|
align: "vertical"
|
|
@@ -13,6 +13,9 @@ var defaultProps = {
|
|
|
13
13
|
dataId: '',
|
|
14
14
|
boxSize: 'default',
|
|
15
15
|
clickableTag: false,
|
|
16
|
-
dataSelectorId: 'tagsMultiSelectField'
|
|
16
|
+
dataSelectorId: 'tagsMultiSelectField',
|
|
17
|
+
needSelectAll: false,
|
|
18
|
+
customClass: {},
|
|
19
|
+
customProps: {}
|
|
17
20
|
};
|
|
18
21
|
exports.defaultProps = defaultProps;
|
|
@@ -50,6 +50,15 @@ var propTypes = {
|
|
|
50
50
|
boxSize: _propTypes["default"].string,
|
|
51
51
|
onSelectTag: _propTypes["default"].func,
|
|
52
52
|
clickableTag: _propTypes["default"].bool,
|
|
53
|
-
dataSelectorId: _propTypes["default"].string
|
|
53
|
+
dataSelectorId: _propTypes["default"].string,
|
|
54
|
+
handleSelectAll: _propTypes["default"].func,
|
|
55
|
+
selectAllText: _propTypes["default"].string,
|
|
56
|
+
needSelectAll: _propTypes["default"].bool,
|
|
57
|
+
customClass: _propTypes["default"].object,
|
|
58
|
+
customProps: _propTypes["default"].shape({
|
|
59
|
+
TextBoxIconProps: _propTypes["default"].object,
|
|
60
|
+
TagWrapperProps: _propTypes["default"].object,
|
|
61
|
+
TagProps: _propTypes["default"].object
|
|
62
|
+
})
|
|
54
63
|
};
|
|
55
64
|
exports.propTypes = propTypes;
|
|
@@ -117,7 +117,11 @@ var TagsMultiSelectField = function TagsMultiSelectField(props) {
|
|
|
117
117
|
value = fieldProperties.value,
|
|
118
118
|
selectedValueCount = fieldProperties.selectedValueCount,
|
|
119
119
|
validationMessage = fieldProperties.validationMessage,
|
|
120
|
-
options = fieldProperties.options
|
|
120
|
+
options = fieldProperties.options,
|
|
121
|
+
infoText = fieldProperties.infoText,
|
|
122
|
+
isLocked = fieldProperties.isLocked,
|
|
123
|
+
lockedInfoText = fieldProperties.lockedInfoText,
|
|
124
|
+
alignField = fieldProperties.alignField;
|
|
121
125
|
options = options || [];
|
|
122
126
|
|
|
123
127
|
var handleKeyUp = function handleKeyUp(event) {
|
|
@@ -230,7 +234,10 @@ var TagsMultiSelectField = function TagsMultiSelectField(props) {
|
|
|
230
234
|
"data-selector-id": dataSelectorId
|
|
231
235
|
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
232
236
|
ePhiData: ePhiData,
|
|
233
|
-
alignContainer:
|
|
237
|
+
alignContainer: alignField,
|
|
238
|
+
infoText: infoText,
|
|
239
|
+
isLocked: isLocked,
|
|
240
|
+
lockedInfoText: lockedInfoText,
|
|
234
241
|
renderProps: {
|
|
235
242
|
end: renderEnd
|
|
236
243
|
}
|
|
@@ -16,7 +16,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
16
16
|
var defaultProps = _objectSpread({
|
|
17
17
|
fieldProperties: {
|
|
18
18
|
isDisabled: false,
|
|
19
|
-
isMandatory: false
|
|
19
|
+
isMandatory: false,
|
|
20
|
+
isLocked: false,
|
|
21
|
+
alignField: 'baseline'
|
|
20
22
|
},
|
|
21
23
|
styleProperties: {
|
|
22
24
|
containerClass: '',
|
|
@@ -22,7 +22,11 @@ var propTypes = {
|
|
|
22
22
|
selectedValueCount: _propTypes["default"].string,
|
|
23
23
|
validationMessage: _propTypes["default"].string,
|
|
24
24
|
options: _propTypes["default"].array,
|
|
25
|
-
clickableTag: _propTypes["default"].bool
|
|
25
|
+
clickableTag: _propTypes["default"].bool,
|
|
26
|
+
infoText: _propTypes["default"].string,
|
|
27
|
+
isLocked: _propTypes["default"].bool,
|
|
28
|
+
lockedInfoText: _propTypes["default"].string,
|
|
29
|
+
alignField: _propTypes["default"].oneOf(['vertical', 'baseline'])
|
|
26
30
|
}),
|
|
27
31
|
styleProperties: _propTypes["default"].shape({
|
|
28
32
|
labelSize: _propTypes["default"].string,
|
|
@@ -33,187 +33,131 @@ 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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
36
|
+
var TextBoxField = function TextBoxField(props) {
|
|
37
|
+
var labelName = props.labelName,
|
|
38
|
+
id = props.id,
|
|
39
|
+
textBoxSize = props.textBoxSize,
|
|
40
|
+
textBoxVariant = props.textBoxVariant,
|
|
41
|
+
textBoxType = props.textBoxType,
|
|
42
|
+
isMandatory = props.isMandatory,
|
|
43
|
+
validationMessage = props.validationMessage,
|
|
44
|
+
validationPalette = props.validationPalette,
|
|
45
|
+
maxLength = props.maxLength,
|
|
46
|
+
isReadOnly = props.isReadOnly,
|
|
47
|
+
value = props.value,
|
|
48
|
+
errorType = props.errorType,
|
|
49
|
+
isDisabled = props.isDisabled,
|
|
50
|
+
title = props.title,
|
|
51
|
+
onBlur = props.onBlur,
|
|
52
|
+
dataId = props.dataId,
|
|
53
|
+
dataSelectorId = props.dataSelectorId,
|
|
54
|
+
validationRuleMessage = props.validationRuleMessage,
|
|
55
|
+
validationRulePalette = props.validationRulePalette,
|
|
56
|
+
onKeyDown = props.onKeyDown,
|
|
57
|
+
placeHolder = props.placeHolder,
|
|
58
|
+
infoText = props.infoText,
|
|
59
|
+
borderColor = props.borderColor,
|
|
60
|
+
fieldSize = props.fieldSize,
|
|
61
|
+
labelPalette = props.labelPalette,
|
|
62
|
+
labelCustomClass = props.labelCustomClass,
|
|
63
|
+
htmlId = props.htmlId,
|
|
64
|
+
lockedInfoText = props.lockedInfoText,
|
|
65
|
+
isLocked = props.isLocked,
|
|
66
|
+
needReadOnlyStyle = props.needReadOnlyStyle,
|
|
67
|
+
isClickable = props.isClickable,
|
|
68
|
+
onFocus = props.onFocus,
|
|
69
|
+
ePhiData = props.ePhiData,
|
|
70
|
+
children = props.children,
|
|
71
|
+
customProps = props.customProps,
|
|
72
|
+
renderLabelProps = props.renderLabelProps,
|
|
73
|
+
onChange = props.onChange,
|
|
74
|
+
getRef = props.getRef;
|
|
75
|
+
var _customProps$LabelPro = customProps.LabelProps,
|
|
76
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
77
|
+
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
78
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
|
|
79
|
+
_customProps$Validati = customProps.ValidationMessageProps1,
|
|
80
|
+
ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
|
|
81
|
+
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
82
|
+
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
83
|
+
var getNextId = (0, _IdProvider.useUniqueId)();
|
|
84
|
+
var uniqueId = htmlId ? htmlId : getNextId();
|
|
85
|
+
|
|
86
|
+
var handleChange = function handleChange(value) {
|
|
87
|
+
onChange && onChange(id, value);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var handleGetRef = function handleGetRef(el) {
|
|
91
|
+
getRef && getRef(el, id);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
95
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
96
|
+
"data-title": isDisabled ? title : null,
|
|
97
|
+
"data-selector-id": dataSelectorId
|
|
98
|
+
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
99
|
+
infoText: infoText,
|
|
100
|
+
isLocked: isLocked,
|
|
101
|
+
lockedInfoText: lockedInfoText,
|
|
102
|
+
ePhiData: ePhiData,
|
|
103
|
+
dataId: dataId,
|
|
104
|
+
renderProps: renderLabelProps
|
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
106
|
+
text: labelName,
|
|
107
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
108
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
109
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
|
|
110
|
+
htmlFor: uniqueId,
|
|
111
|
+
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
112
|
+
}, LabelProps, {
|
|
113
|
+
id: labelName
|
|
114
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
|
+
className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '')
|
|
116
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
|
|
117
|
+
htmlId: uniqueId,
|
|
118
|
+
id: id,
|
|
119
|
+
type: textBoxType,
|
|
120
|
+
variant: textBoxVariant,
|
|
121
|
+
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
122
|
+
maxLength: maxLength,
|
|
123
|
+
isReadOnly: isReadOnly,
|
|
124
|
+
inputRef: handleGetRef,
|
|
125
|
+
value: value,
|
|
126
|
+
onChange: handleChange,
|
|
127
|
+
dataId: dataId,
|
|
128
|
+
onBlur: onBlur,
|
|
129
|
+
onKeyDown: onKeyDown,
|
|
130
|
+
placeHolder: placeHolder,
|
|
131
|
+
borderColor: borderColor,
|
|
132
|
+
onFocus: onFocus,
|
|
133
|
+
isDisabled: isDisabled,
|
|
134
|
+
needEffect: isReadOnly || isDisabled ? false : true,
|
|
135
|
+
isClickable: isClickable,
|
|
136
|
+
needReadOnlyStyle: needReadOnlyStyle
|
|
137
|
+
}, TextBoxIconProps, {
|
|
138
|
+
a11y: {
|
|
139
|
+
ariaLabelledby: labelName
|
|
81
140
|
}
|
|
82
|
-
}, {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, {
|
|
98
|
-
key: "render",
|
|
99
|
-
value: function render() {
|
|
100
|
-
var _this$props3 = this.props,
|
|
101
|
-
labelName = _this$props3.labelName,
|
|
102
|
-
id = _this$props3.id,
|
|
103
|
-
textBoxSize = _this$props3.textBoxSize,
|
|
104
|
-
textBoxVariant = _this$props3.textBoxVariant,
|
|
105
|
-
textBoxType = _this$props3.textBoxType,
|
|
106
|
-
isMandatory = _this$props3.isMandatory,
|
|
107
|
-
validationMessage = _this$props3.validationMessage,
|
|
108
|
-
validationPalette = _this$props3.validationPalette,
|
|
109
|
-
maxLength = _this$props3.maxLength,
|
|
110
|
-
isReadOnly = _this$props3.isReadOnly,
|
|
111
|
-
value = _this$props3.value,
|
|
112
|
-
errorType = _this$props3.errorType,
|
|
113
|
-
isDisabled = _this$props3.isDisabled,
|
|
114
|
-
title = _this$props3.title,
|
|
115
|
-
onBlur = _this$props3.onBlur,
|
|
116
|
-
dataId = _this$props3.dataId,
|
|
117
|
-
dataSelectorId = _this$props3.dataSelectorId,
|
|
118
|
-
validationRuleMessage = _this$props3.validationRuleMessage,
|
|
119
|
-
validationRulePalette = _this$props3.validationRulePalette,
|
|
120
|
-
onKeyDown = _this$props3.onKeyDown,
|
|
121
|
-
placeHolder = _this$props3.placeHolder,
|
|
122
|
-
infoText = _this$props3.infoText,
|
|
123
|
-
borderColor = _this$props3.borderColor,
|
|
124
|
-
fieldSize = _this$props3.fieldSize,
|
|
125
|
-
labelPalette = _this$props3.labelPalette,
|
|
126
|
-
labelCustomClass = _this$props3.labelCustomClass,
|
|
127
|
-
htmlId = _this$props3.htmlId,
|
|
128
|
-
lockedInfoText = _this$props3.lockedInfoText,
|
|
129
|
-
isLocked = _this$props3.isLocked,
|
|
130
|
-
needReadOnlyStyle = _this$props3.needReadOnlyStyle,
|
|
131
|
-
isClickable = _this$props3.isClickable,
|
|
132
|
-
onFocus = _this$props3.onFocus,
|
|
133
|
-
ePhiData = _this$props3.ePhiData,
|
|
134
|
-
children = _this$props3.children,
|
|
135
|
-
customProps = _this$props3.customProps,
|
|
136
|
-
renderLabelProps = _this$props3.renderLabelProps;
|
|
137
|
-
var _customProps$LabelPro = customProps.LabelProps,
|
|
138
|
-
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
139
|
-
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
140
|
-
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
|
|
141
|
-
_customProps$Validati = customProps.ValidationMessageProps1,
|
|
142
|
-
ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
|
|
143
|
-
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
144
|
-
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
145
|
-
var uniqueId = htmlId ? htmlId : this.getNextId();
|
|
146
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
-
className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
148
|
-
"data-title": isDisabled ? title : null,
|
|
149
|
-
"data-selector-id": dataSelectorId
|
|
150
|
-
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
151
|
-
infoText: infoText,
|
|
152
|
-
isLocked: isLocked,
|
|
153
|
-
lockedInfoText: lockedInfoText,
|
|
154
|
-
ePhiData: ePhiData,
|
|
155
|
-
dataId: dataId,
|
|
156
|
-
renderProps: renderLabelProps
|
|
157
|
-
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
158
|
-
text: labelName,
|
|
159
|
-
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
160
|
-
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
161
|
-
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
|
|
162
|
-
htmlFor: uniqueId,
|
|
163
|
-
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
164
|
-
}, LabelProps, {
|
|
165
|
-
id: labelName
|
|
166
|
-
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
|
-
className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '')
|
|
168
|
-
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], _extends({
|
|
169
|
-
htmlId: uniqueId,
|
|
170
|
-
id: id,
|
|
171
|
-
type: textBoxType,
|
|
172
|
-
variant: textBoxVariant,
|
|
173
|
-
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
174
|
-
maxLength: maxLength,
|
|
175
|
-
isReadOnly: isReadOnly,
|
|
176
|
-
inputRef: this.handleGetRef,
|
|
177
|
-
value: value,
|
|
178
|
-
onChange: this.handleChange,
|
|
179
|
-
dataId: dataId,
|
|
180
|
-
onBlur: onBlur,
|
|
181
|
-
onKeyDown: onKeyDown,
|
|
182
|
-
placeHolder: placeHolder,
|
|
183
|
-
borderColor: borderColor,
|
|
184
|
-
onFocus: onFocus,
|
|
185
|
-
isDisabled: isDisabled,
|
|
186
|
-
needEffect: isReadOnly || isDisabled ? false : true,
|
|
187
|
-
isClickable: isClickable,
|
|
188
|
-
needReadOnlyStyle: needReadOnlyStyle
|
|
189
|
-
}, TextBoxIconProps, {
|
|
190
|
-
a11y: {
|
|
191
|
-
ariaLabelledby: labelName
|
|
192
|
-
}
|
|
193
|
-
}), children ? children : null), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
194
|
-
text: validationMessage,
|
|
195
|
-
palette: validationPalette,
|
|
196
|
-
type: errorType,
|
|
197
|
-
dataId: "".concat(dataId, "_ValidationMessage"),
|
|
198
|
-
htmlFor: uniqueId
|
|
199
|
-
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
200
|
-
text: validationRuleMessage,
|
|
201
|
-
palette: validationRulePalette,
|
|
202
|
-
type: errorType,
|
|
203
|
-
htmlFor: uniqueId,
|
|
204
|
-
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
205
|
-
}, ValidationMessageProps2))));
|
|
206
|
-
}
|
|
207
|
-
}]);
|
|
208
|
-
|
|
209
|
-
return TextBoxField;
|
|
210
|
-
}(_react.PureComponent);
|
|
141
|
+
}), children ? children : null), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
142
|
+
text: validationMessage,
|
|
143
|
+
palette: validationPalette,
|
|
144
|
+
type: errorType,
|
|
145
|
+
dataId: "".concat(dataId, "_ValidationMessage"),
|
|
146
|
+
htmlFor: uniqueId
|
|
147
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
148
|
+
text: validationRuleMessage,
|
|
149
|
+
palette: validationRulePalette,
|
|
150
|
+
type: errorType,
|
|
151
|
+
htmlFor: uniqueId,
|
|
152
|
+
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
153
|
+
}, ValidationMessageProps2))));
|
|
154
|
+
};
|
|
211
155
|
|
|
212
|
-
exports["default"] = TextBoxField;
|
|
213
156
|
TextBoxField.propTypes = _propTypes.propTypes;
|
|
214
|
-
TextBoxField.defaultProps = _defaultProps.defaultProps;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
157
|
+
TextBoxField.defaultProps = _defaultProps.defaultProps;
|
|
158
|
+
var MemoizedTextBoxField = /*#__PURE__*/(0, _react.memo)(TextBoxField);
|
|
159
|
+
MemoizedTextBoxField.propTypes = _propTypes.propTypes;
|
|
160
|
+
MemoizedTextBoxField.defaultProps = _defaultProps.defaultProps;
|
|
161
|
+
MemoizedTextBoxField.displayName = 'TextBoxField';
|
|
162
|
+
var _default = TextBoxField;
|
|
163
|
+
exports["default"] = _default;
|