@zohodesk/dot 1.4.9 → 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.
Files changed (79) hide show
  1. package/.cli/UnValidatedFiles.html +101 -0
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +10 -1
  4. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  5. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  6. package/coverage/ExternalLink/index.html +1 -1
  7. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  8. package/coverage/ExternalLink/props/index.html +1 -1
  9. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  10. package/coverage/IconButton/IconButton.js.html +1 -1
  11. package/coverage/IconButton/IconButton.module.css.html +1 -1
  12. package/coverage/IconButton/index.html +1 -1
  13. package/coverage/IconButton/props/defaultProps.js.html +1 -1
  14. package/coverage/IconButton/props/index.html +1 -1
  15. package/coverage/IconButton/props/propTypes.js.html +1 -1
  16. package/coverage/Image/Image.js.html +1 -1
  17. package/coverage/Image/Image.module.css.html +1 -1
  18. package/coverage/Image/index.html +1 -1
  19. package/coverage/Image/props/defaultProps.js.html +1 -1
  20. package/coverage/Image/props/index.html +1 -1
  21. package/coverage/Image/props/propTypes.js.html +1 -1
  22. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  23. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  24. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  25. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  26. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  27. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  28. package/coverage/index.html +1 -1
  29. package/es/NewStar/NewStar.module.css +128 -67
  30. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -4
  31. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +9 -0
  32. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
  33. package/es/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
  34. package/es/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
  35. package/es/form/fields/TextEditor/TextEditor.module.css +63 -47
  36. package/es/v1/form/fields/SelectField/SelectField.js +1 -9
  37. package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +42 -13
  38. package/es/v1/form/fields/TagsMultiSelect/props/defaultProps.js +4 -1
  39. package/es/v1/form/fields/TagsMultiSelect/props/propTypes.js +10 -1
  40. package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
  41. package/es/v1/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
  42. package/es/v1/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
  43. package/es/v1/form/fields/TextBoxField/TextBoxField.js +122 -142
  44. package/es/v1/form/fields/TextEditorField/TextEditorField.js +133 -153
  45. package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +137 -178
  46. package/es/v1/form/fields/TextareaField/TextareaField.js +113 -137
  47. package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +43 -43
  48. package/es/v1/form/layout/Field/Field.js +24 -28
  49. package/es/v1/form/layout/Section/Section.js +26 -33
  50. package/es/v1/list/Subject/Subject.js +39 -48
  51. package/es/v1/list/TagNew/TagNew.js +18 -27
  52. package/es/v1/list/Thread/Thread.js +26 -35
  53. package/lib/NewStar/NewStar.module.css +128 -67
  54. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -5
  55. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +9 -0
  56. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
  57. package/lib/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
  58. package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
  59. package/lib/form/fields/TextEditor/TextEditor.module.css +63 -47
  60. package/lib/v1/form/fields/SelectField/SelectField.js +1 -7
  61. package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +45 -13
  62. package/lib/v1/form/fields/TagsMultiSelect/props/defaultProps.js +4 -1
  63. package/lib/v1/form/fields/TagsMultiSelect/props/propTypes.js +10 -1
  64. package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +9 -2
  65. package/lib/v1/form/fields/TagsMultiSelectField/props/defaultProps.js +3 -1
  66. package/lib/v1/form/fields/TagsMultiSelectField/props/propTypes.js +5 -1
  67. package/lib/v1/form/fields/TextBoxField/TextBoxField.js +125 -181
  68. package/lib/v1/form/fields/TextEditorField/TextEditorField.js +138 -193
  69. package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +160 -212
  70. package/lib/v1/form/fields/TextareaField/TextareaField.js +117 -177
  71. package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +41 -80
  72. package/lib/v1/form/layout/Field/Field.js +22 -69
  73. package/lib/v1/form/layout/Section/Section.js +26 -72
  74. package/lib/v1/list/Subject/Subject.js +39 -87
  75. package/lib/v1/list/TagNew/TagNew.js +18 -66
  76. package/lib/v1/list/Thread/Thread.js +25 -73
  77. package/package.json +10 -10
  78. package/propValidationArg.json +8 -4
  79. package/result.json +1 -1
@@ -1,7 +1,7 @@
1
1
  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); }
2
2
 
3
3
  /**** Libraries ****/
4
- import React, { PureComponent } from 'react';
4
+ import React, { memo } from 'react';
5
5
  import { defaultProps } from './props/defaultProps';
6
6
  import { propTypes } from './props/propTypes';
7
7
  /**** Components ****/
@@ -9,156 +9,136 @@ import { propTypes } from './props/propTypes';
9
9
  import Label from '@zohodesk/components/es/v1/Label/Label';
10
10
  import TextBoxIcon from '@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon';
11
11
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
12
- import { getUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
12
+ import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
13
13
  import FieldContainer from '../FieldContainer/FieldContainer';
14
14
  /**** CSS ****/
15
15
 
16
16
  import style from '../../../../form/fields/Fields.module.css';
17
- export default class TextBoxField extends PureComponent {
18
- constructor(props) {
19
- super(props);
20
- this.handleChange = this.handleChange.bind(this);
21
- this.handleGetRef = this.handleGetRef.bind(this); // this.handleLabelClick = this.handleLabelClick.bind(this);
22
17
 
23
- this.getNextId = getUniqueId(this);
24
- }
18
+ const TextBoxField = props => {
19
+ const {
20
+ labelName,
21
+ id,
22
+ textBoxSize,
23
+ textBoxVariant,
24
+ textBoxType,
25
+ isMandatory,
26
+ validationMessage,
27
+ validationPalette,
28
+ maxLength,
29
+ isReadOnly,
30
+ value,
31
+ errorType,
32
+ isDisabled,
33
+ title,
34
+ onBlur,
35
+ dataId,
36
+ dataSelectorId,
37
+ validationRuleMessage,
38
+ validationRulePalette,
39
+ onKeyDown,
40
+ placeHolder,
41
+ infoText,
42
+ borderColor,
43
+ fieldSize,
44
+ labelPalette,
45
+ labelCustomClass,
46
+ htmlId,
47
+ lockedInfoText,
48
+ isLocked,
49
+ needReadOnlyStyle,
50
+ isClickable,
51
+ onFocus,
52
+ ePhiData,
53
+ children,
54
+ customProps,
55
+ renderLabelProps,
56
+ onChange,
57
+ getRef
58
+ } = props;
59
+ const {
60
+ LabelProps = {},
61
+ TextBoxIconProps = {},
62
+ ValidationMessageProps1 = {},
63
+ ValidationMessageProps2 = {}
64
+ } = customProps;
65
+ const getNextId = useUniqueId();
66
+ let uniqueId = htmlId ? htmlId : getNextId();
25
67
 
26
- handleChange(value) {
27
- let {
28
- id,
29
- onChange
30
- } = this.props;
68
+ const handleChange = value => {
31
69
  onChange && onChange(id, value);
32
- }
70
+ };
33
71
 
34
- handleGetRef(el) {
35
- let {
36
- getRef,
37
- id
38
- } = this.props;
39
- this.textBox = el;
72
+ const handleGetRef = el => {
40
73
  getRef && getRef(el, id);
41
- } // handleLabelClick() {
42
- // // let { isFocusOnLabelClick } = this.props;
43
- // // if (isFocusOnLabelClick && this.textBox && this.textBox.focus) {
44
- // // this.textBox.focus();
45
- // // }
46
- // }
74
+ };
47
75
 
76
+ return /*#__PURE__*/React.createElement("div", {
77
+ className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
78
+ "data-title": isDisabled ? title : null,
79
+ "data-selector-id": dataSelectorId
80
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
81
+ infoText: infoText,
82
+ isLocked: isLocked,
83
+ lockedInfoText: lockedInfoText,
84
+ ePhiData: ePhiData,
85
+ dataId: dataId,
86
+ renderProps: renderLabelProps
87
+ }, /*#__PURE__*/React.createElement(Label, _extends({
88
+ text: labelName,
89
+ size: fieldSize === 'small' ? 'small' : 'medium',
90
+ palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
91
+ customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
92
+ htmlFor: uniqueId,
93
+ dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
94
+ }, LabelProps, {
95
+ id: labelName
96
+ }))), /*#__PURE__*/React.createElement("div", {
97
+ className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
98
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
99
+ htmlId: uniqueId,
100
+ id: id,
101
+ type: textBoxType,
102
+ variant: textBoxVariant,
103
+ size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
104
+ maxLength: maxLength,
105
+ isReadOnly: isReadOnly,
106
+ inputRef: handleGetRef,
107
+ value: value,
108
+ onChange: handleChange,
109
+ dataId: dataId,
110
+ onBlur: onBlur,
111
+ onKeyDown: onKeyDown,
112
+ placeHolder: placeHolder,
113
+ borderColor: borderColor,
114
+ onFocus: onFocus,
115
+ isDisabled: isDisabled,
116
+ needEffect: isReadOnly || isDisabled ? false : true,
117
+ isClickable: isClickable,
118
+ needReadOnlyStyle: needReadOnlyStyle
119
+ }, TextBoxIconProps, {
120
+ a11y: {
121
+ ariaLabelledby: labelName
122
+ }
123
+ }), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
124
+ text: validationMessage,
125
+ palette: validationPalette,
126
+ type: errorType,
127
+ dataId: `${dataId}_ValidationMessage`,
128
+ htmlFor: uniqueId
129
+ }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
130
+ text: validationRuleMessage,
131
+ palette: validationRulePalette,
132
+ type: errorType,
133
+ htmlFor: uniqueId,
134
+ dataId: `${dataId}_ValidationRuleMessage`
135
+ }, ValidationMessageProps2))));
136
+ };
48
137
 
49
- render() {
50
- let {
51
- labelName,
52
- id,
53
- textBoxSize,
54
- textBoxVariant,
55
- textBoxType,
56
- isMandatory,
57
- validationMessage,
58
- validationPalette,
59
- maxLength,
60
- isReadOnly,
61
- value,
62
- errorType,
63
- isDisabled,
64
- title,
65
- onBlur,
66
- dataId,
67
- dataSelectorId,
68
- validationRuleMessage,
69
- validationRulePalette,
70
- onKeyDown,
71
- placeHolder,
72
- infoText,
73
- borderColor,
74
- fieldSize,
75
- labelPalette,
76
- labelCustomClass,
77
- htmlId,
78
- lockedInfoText,
79
- isLocked,
80
- needReadOnlyStyle,
81
- isClickable,
82
- onFocus,
83
- ePhiData,
84
- children,
85
- customProps,
86
- renderLabelProps
87
- } = this.props;
88
- const {
89
- LabelProps = {},
90
- TextBoxIconProps = {},
91
- ValidationMessageProps1 = {},
92
- ValidationMessageProps2 = {}
93
- } = customProps;
94
- let uniqueId = htmlId ? htmlId : this.getNextId();
95
- return /*#__PURE__*/React.createElement("div", {
96
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
97
- "data-title": isDisabled ? title : null,
98
- "data-selector-id": dataSelectorId
99
- }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
100
- infoText: infoText,
101
- isLocked: isLocked,
102
- lockedInfoText: lockedInfoText,
103
- ePhiData: ePhiData,
104
- dataId: dataId,
105
- renderProps: renderLabelProps
106
- }, /*#__PURE__*/React.createElement(Label, _extends({
107
- text: labelName,
108
- size: fieldSize === 'small' ? 'small' : 'medium',
109
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
110
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
111
- htmlFor: uniqueId,
112
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
113
- }, LabelProps, {
114
- id: labelName
115
- }))), /*#__PURE__*/React.createElement("div", {
116
- className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
117
- }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
118
- htmlId: uniqueId,
119
- id: id,
120
- type: textBoxType,
121
- variant: textBoxVariant,
122
- size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
123
- maxLength: maxLength,
124
- isReadOnly: isReadOnly,
125
- inputRef: this.handleGetRef,
126
- value: value,
127
- onChange: this.handleChange,
128
- dataId: dataId,
129
- onBlur: onBlur,
130
- onKeyDown: onKeyDown,
131
- placeHolder: placeHolder,
132
- borderColor: borderColor,
133
- onFocus: onFocus,
134
- isDisabled: isDisabled,
135
- needEffect: isReadOnly || isDisabled ? false : true,
136
- isClickable: isClickable,
137
- needReadOnlyStyle: needReadOnlyStyle
138
- }, TextBoxIconProps, {
139
- a11y: {
140
- ariaLabelledby: labelName
141
- }
142
- }), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
143
- text: validationMessage,
144
- palette: validationPalette,
145
- type: errorType,
146
- dataId: `${dataId}_ValidationMessage`,
147
- htmlFor: uniqueId
148
- }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
149
- text: validationRuleMessage,
150
- palette: validationRulePalette,
151
- type: errorType,
152
- htmlFor: uniqueId,
153
- dataId: `${dataId}_ValidationRuleMessage`
154
- }, ValidationMessageProps2))));
155
- }
156
-
157
- }
158
138
  TextBoxField.propTypes = propTypes;
159
- TextBoxField.defaultProps = defaultProps; // if (__DOCS__) {
160
- // TextBoxField.docs = {
161
- // componentGroup: 'Form Fields',
162
- // folderName: 'General'
163
- // };
164
- // }
139
+ TextBoxField.defaultProps = defaultProps;
140
+ const MemoizedTextBoxField = /*#__PURE__*/memo(TextBoxField);
141
+ MemoizedTextBoxField.propTypes = propTypes;
142
+ MemoizedTextBoxField.defaultProps = defaultProps;
143
+ MemoizedTextBoxField.displayName = 'TextBoxField';
144
+ export default TextBoxField;
@@ -1,7 +1,7 @@
1
1
  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); }
2
2
 
3
3
  /**** Libraries ****/
4
- import React, { PureComponent } from 'react';
4
+ import React, { memo, useRef } from 'react';
5
5
  import { defaultProps } from './props/defaultProps';
6
6
  import { propTypes } from './props/propTypes';
7
7
  /**** Components ****/
@@ -13,166 +13,146 @@ import FieldContainer from '../FieldContainer/FieldContainer';
13
13
  /** Css */
14
14
 
15
15
  import style from '../../../../form/fields/Fields.module.css';
16
- export default class TextEditorField extends PureComponent {
17
- constructor(props) {
18
- super(props);
19
- this.handleChange = this.handleChange.bind(this);
20
- this.handleGetRef = this.handleGetRef.bind(this);
21
- this.handleLabelClick = this.handleLabelClick.bind(this);
22
- this.renderEnd = this.renderEnd.bind(this);
23
- }
24
16
 
25
- handleChange(value) {
26
- let {
27
- id,
28
- onChange
29
- } = this.props;
17
+ const TextEditorField = props => {
18
+ const {
19
+ labelName,
20
+ id,
21
+ isMandatory,
22
+ value,
23
+ validationMessage,
24
+ validationPalette,
25
+ isReadOnly,
26
+ onAttachmentUpload,
27
+ needEditor,
28
+ dataId,
29
+ dataSelectorId,
30
+ isDisabled,
31
+ fieldSize,
32
+ textBoxSize,
33
+ textBoxVariant,
34
+ labelPalette,
35
+ labelCustomClass,
36
+ infoText,
37
+ isLocked,
38
+ lockedInfoText,
39
+ errorType,
40
+ EDITORURL,
41
+ editorMode,
42
+ isCustomScroll,
43
+ initCallback,
44
+ loadingComponent,
45
+ handleAlertMessage,
46
+ editorCallback,
47
+ editorBlurCallback,
48
+ editorOptions,
49
+ onFocus,
50
+ isEditorDefaultOpen,
51
+ changeEditorContent,
52
+ shouldEditorUpdateContent,
53
+ setInlineAttachmentInProgress,
54
+ handleEditorDropUpload,
55
+ ImgLazyLoad,
56
+ needInlineAttachment,
57
+ i18nKeys,
58
+ className,
59
+ children,
60
+ ePhiData,
61
+ customProps,
62
+ onChange,
63
+ getRef,
64
+ isFocusOnLabelClick
65
+ } = props;
66
+ const textEditorEleRef = useRef(null);
67
+ const {
68
+ LabelProps = {},
69
+ TextEditorWrapperProps = {},
70
+ ValidationMessageProps = {}
71
+ } = customProps;
72
+
73
+ const handleChange = value => {
30
74
  onChange && onChange(id, value);
31
- }
75
+ };
32
76
 
33
- handleGetRef(el) {
34
- let {
35
- getRef,
36
- id
37
- } = this.props;
38
- this.textEditor = el;
77
+ const handleGetRef = el => {
78
+ textEditorEleRef.current = el;
39
79
  getRef && getRef(el, id);
40
- }
41
-
42
- handleLabelClick() {
43
- let {
44
- isFocusOnLabelClick,
45
- isDisabled,
46
- isReadOnly
47
- } = this.props;
80
+ };
48
81
 
49
- if (isFocusOnLabelClick && !isDisabled && !isReadOnly && this.textEditor && this.textEditor.focus) {
50
- this.textEditor.focus();
82
+ const handleLabelClick = () => {
83
+ if (isFocusOnLabelClick && !isDisabled && !isReadOnly && textEditorEleRef.current && textEditorEleRef.current.focus) {
84
+ textEditorEleRef.current.focus();
51
85
  }
52
- }
86
+ };
53
87
 
54
- renderEnd() {
55
- let {
56
- children
57
- } = this.props;
88
+ const renderEnd = () => {
58
89
  return children ? children : null;
59
- }
90
+ };
60
91
 
61
- render() {
62
- let {
63
- labelName,
64
- id,
65
- isMandatory,
66
- value,
67
- validationMessage,
68
- validationPalette,
69
- isReadOnly,
70
- onAttachmentUpload,
71
- needEditor,
72
- dataId,
73
- dataSelectorId,
74
- isDisabled,
75
- fieldSize,
76
- textBoxSize,
77
- textBoxVariant,
78
- labelPalette,
79
- labelCustomClass,
80
- infoText,
81
- isLocked,
82
- lockedInfoText,
83
- errorType,
84
- EDITORURL,
85
- editorMode,
86
- isCustomScroll,
87
- initCallback,
88
- loadingComponent,
89
- handleAlertMessage,
90
- editorCallback,
91
- editorBlurCallback,
92
- editorOptions,
93
- onFocus,
94
- isEditorDefaultOpen,
95
- changeEditorContent,
96
- shouldEditorUpdateContent,
97
- setInlineAttachmentInProgress,
98
- handleEditorDropUpload,
99
- ImgLazyLoad,
100
- needInlineAttachment,
101
- i18nKeys,
102
- className,
103
- children,
104
- ePhiData,
105
- customProps
106
- } = this.props;
107
- const {
108
- LabelProps = {},
109
- TextEditorWrapperProps = {},
110
- ValidationMessageProps = {}
111
- } = customProps;
112
- return /*#__PURE__*/React.createElement("div", {
113
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''} ${className || ''}`,
114
- "data-selector-id": dataSelectorId
115
- }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
116
- infoText: infoText,
117
- isLocked: isLocked,
118
- lockedInfoText: lockedInfoText,
119
- ePhiData: ePhiData,
120
- dataId: dataId,
121
- renderProps: {
122
- end: this.renderEnd
123
- }
124
- }, /*#__PURE__*/React.createElement(Label, _extends({
125
- text: labelName,
126
- size: fieldSize === 'small' ? 'small' : 'medium',
127
- htmlFor: !isReadOnly && !isDisabled ? id : undefined,
128
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
129
- onClick: this.handleLabelClick,
130
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
131
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
132
- }, LabelProps))), /*#__PURE__*/React.createElement("div", {
133
- className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
134
- }, /*#__PURE__*/React.createElement(TextEditorWrapper, _extends({
135
- needEditor: needEditor,
136
- onChange: this.handleChange,
137
- id: id,
138
- value: value,
139
- isReadOnly: isReadOnly,
140
- getRef: this.handleGetRef,
141
- onAttachmentUpload: onAttachmentUpload,
142
- dataId: dataId,
143
- isDisabled: isDisabled,
144
- textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
145
- textBoxVariant: textBoxVariant,
146
- EDITORURL: EDITORURL,
147
- editorMode: editorMode,
148
- isCustomScroll: isCustomScroll,
149
- initCallback: initCallback,
150
- loadingComponent: loadingComponent,
151
- handleAlertMessage: handleAlertMessage,
152
- editorCallback: editorCallback,
153
- i18nKeys: i18nKeys,
154
- ImgLazyLoad: ImgLazyLoad,
155
- editorOptions: editorOptions,
156
- editorBlurCallback: editorBlurCallback,
157
- onFocus: onFocus,
158
- isEditorDefaultOpen: isEditorDefaultOpen,
159
- changeEditorContent: changeEditorContent,
160
- shouldEditorUpdateContent: shouldEditorUpdateContent,
161
- setInlineAttachmentInProgress: setInlineAttachmentInProgress,
162
- handleEditorDropUpload: handleEditorDropUpload,
163
- needInlineAttachment: needInlineAttachment
164
- }, TextEditorWrapperProps))), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
165
- text: validationMessage,
166
- palette: validationPalette,
167
- type: errorType,
168
- dataId: `${dataId}_ValidationMessage`
169
- }, ValidationMessageProps)));
170
- }
92
+ return /*#__PURE__*/React.createElement("div", {
93
+ className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''} ${className || ''}`,
94
+ "data-selector-id": dataSelectorId
95
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
96
+ infoText: infoText,
97
+ isLocked: isLocked,
98
+ lockedInfoText: lockedInfoText,
99
+ ePhiData: ePhiData,
100
+ dataId: dataId,
101
+ renderProps: {
102
+ end: renderEnd
103
+ }
104
+ }, /*#__PURE__*/React.createElement(Label, _extends({
105
+ text: labelName,
106
+ size: fieldSize === 'small' ? 'small' : 'medium',
107
+ htmlFor: !isReadOnly && !isDisabled ? id : undefined,
108
+ palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
109
+ onClick: handleLabelClick,
110
+ customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
111
+ dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
112
+ }, LabelProps))), /*#__PURE__*/React.createElement("div", {
113
+ className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
114
+ }, /*#__PURE__*/React.createElement(TextEditorWrapper, _extends({
115
+ needEditor: needEditor,
116
+ onChange: handleChange,
117
+ id: id,
118
+ value: value,
119
+ isReadOnly: isReadOnly,
120
+ getRef: handleGetRef,
121
+ onAttachmentUpload: onAttachmentUpload,
122
+ dataId: dataId,
123
+ isDisabled: isDisabled,
124
+ textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
125
+ textBoxVariant: textBoxVariant,
126
+ EDITORURL: EDITORURL,
127
+ editorMode: editorMode,
128
+ isCustomScroll: isCustomScroll,
129
+ initCallback: initCallback,
130
+ loadingComponent: loadingComponent,
131
+ handleAlertMessage: handleAlertMessage,
132
+ editorCallback: editorCallback,
133
+ i18nKeys: i18nKeys,
134
+ ImgLazyLoad: ImgLazyLoad,
135
+ editorOptions: editorOptions,
136
+ editorBlurCallback: editorBlurCallback,
137
+ onFocus: onFocus,
138
+ isEditorDefaultOpen: isEditorDefaultOpen,
139
+ changeEditorContent: changeEditorContent,
140
+ shouldEditorUpdateContent: shouldEditorUpdateContent,
141
+ setInlineAttachmentInProgress: setInlineAttachmentInProgress,
142
+ handleEditorDropUpload: handleEditorDropUpload,
143
+ needInlineAttachment: needInlineAttachment
144
+ }, TextEditorWrapperProps))), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
145
+ text: validationMessage,
146
+ palette: validationPalette,
147
+ type: errorType,
148
+ dataId: `${dataId}_ValidationMessage`
149
+ }, ValidationMessageProps)));
150
+ };
171
151
 
172
- }
173
152
  TextEditorField.propTypes = propTypes;
174
- TextEditorField.defaultProps = defaultProps; // if (__DOCS__) {
175
- // TextEditorField.docs = {
176
- // componentGroup: 'Fields'
177
- // };
178
- // }
153
+ TextEditorField.defaultProps = defaultProps;
154
+ const MemoizedTextEditorField = /*#__PURE__*/memo(TextEditorField);
155
+ MemoizedTextEditorField.propTypes = propTypes;
156
+ MemoizedTextEditorField.defaultProps = defaultProps;
157
+ MemoizedTextEditorField.displayName = 'TextEditorField';
158
+ export default TextEditorField;