@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.
- package/.cli/UnValidatedFiles.html +101 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +10 -1
- 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/NewStar/NewStar.module.css +128 -67
- 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/form/fields/TextEditor/TextEditor.module.css +63 -47
- 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/NewStar/NewStar.module.css +128 -67
- 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/form/fields/TextEditor/TextEditor.module.css +63 -47
- 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 +10 -10
- package/propValidationArg.json +8 -4
- package/result.json +1 -1
|
@@ -13,6 +13,8 @@ var _defaultProps = require("./props/defaultProps");
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = require("./props/propTypes");
|
|
15
15
|
|
|
16
|
+
var _useEffectCallOnlyAfterState = _interopRequireDefault(require("@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState"));
|
|
17
|
+
|
|
16
18
|
var _TextEditor = _interopRequireDefault(require("../TextEditor/TextEditor"));
|
|
17
19
|
|
|
18
20
|
var _Textarea = _interopRequireDefault(require("@zohodesk/components/es/v1/Textarea/Textarea"));
|
|
@@ -31,226 +33,172 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
33
|
|
|
32
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); }
|
|
33
35
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
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); } }
|
|
37
|
-
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
36
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
37
|
|
|
40
|
-
function
|
|
38
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
41
39
|
|
|
42
|
-
function
|
|
40
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
43
41
|
|
|
44
|
-
function
|
|
42
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
45
43
|
|
|
46
|
-
function
|
|
44
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
47
45
|
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
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; } }
|
|
51
|
-
|
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
47
|
|
|
54
48
|
/* eslint-disable react/no-deprecated */
|
|
55
|
-
var TextEditorWrapper =
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
value = _this$props2.value;
|
|
118
|
-
|
|
119
|
-
if (np.value || typeof editor != 'undefined' && (0, _editorUtils.editorContentValidate)(editor[id])) {
|
|
120
|
-
this.setState({
|
|
121
|
-
isEditorShow: true
|
|
122
|
-
});
|
|
123
|
-
} else {
|
|
124
|
-
if (!this.state.isEditorFocus && !this.props.isEditorDefaultOpen) {
|
|
125
|
-
this.setState({
|
|
126
|
-
isEditorShow: false
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
} // if (np.value !== value && np.value == '') {
|
|
130
|
-
// editor[id].setContent('');
|
|
131
|
-
// }
|
|
132
|
-
|
|
49
|
+
var TextEditorWrapper = function TextEditorWrapper(props) {
|
|
50
|
+
var id = props.id,
|
|
51
|
+
onChange = props.onChange,
|
|
52
|
+
value = props.value,
|
|
53
|
+
onAttachmentUpload = props.onAttachmentUpload,
|
|
54
|
+
needEditor = props.needEditor,
|
|
55
|
+
dataId = props.dataId,
|
|
56
|
+
isReadOnly = props.isReadOnly,
|
|
57
|
+
isDisabled = props.isDisabled,
|
|
58
|
+
getRef = props.getRef,
|
|
59
|
+
textBoxSize = props.textBoxSize,
|
|
60
|
+
textBoxVariant = props.textBoxVariant,
|
|
61
|
+
editorMode = props.editorMode,
|
|
62
|
+
editorSize = props.editorSize,
|
|
63
|
+
editorBorder = props.editorBorder,
|
|
64
|
+
EDITORURL = props.EDITORURL,
|
|
65
|
+
isCustomScroll = props.isCustomScroll,
|
|
66
|
+
initCallback = props.initCallback,
|
|
67
|
+
loadingComponent = props.loadingComponent,
|
|
68
|
+
handleAlertMessage = props.handleAlertMessage,
|
|
69
|
+
editorCallback = props.editorCallback,
|
|
70
|
+
editorBlurCallback = props.editorBlurCallback,
|
|
71
|
+
editorOptions = props.editorOptions,
|
|
72
|
+
changeEditorContent = props.changeEditorContent,
|
|
73
|
+
shouldEditorUpdateContent = props.shouldEditorUpdateContent,
|
|
74
|
+
setInlineAttachmentInProgress = props.setInlineAttachmentInProgress,
|
|
75
|
+
handleEditorDropUpload = props.handleEditorDropUpload,
|
|
76
|
+
ImgLazyLoad = props.ImgLazyLoad,
|
|
77
|
+
i18nKeys = props.i18nKeys,
|
|
78
|
+
isEditorDefaultOpen = props.isEditorDefaultOpen,
|
|
79
|
+
needInlineAttachment = props.needInlineAttachment,
|
|
80
|
+
customProps = props.customProps,
|
|
81
|
+
dataSelectorId = props.dataSelectorId,
|
|
82
|
+
onFocus = props.onFocus;
|
|
83
|
+
var _customProps$Textarea = customProps.Textarea1Props,
|
|
84
|
+
Textarea1Props = _customProps$Textarea === void 0 ? {} : _customProps$Textarea,
|
|
85
|
+
_customProps$Textarea2 = customProps.Textarea2Props,
|
|
86
|
+
Textarea2Props = _customProps$Textarea2 === void 0 ? {} : _customProps$Textarea2,
|
|
87
|
+
_customProps$TextEdit = customProps.TextEditorProps,
|
|
88
|
+
TextEditorProps = _customProps$TextEdit === void 0 ? {} : _customProps$TextEdit;
|
|
89
|
+
|
|
90
|
+
var _useState = (0, _react.useState)(isEditorDefaultOpen ? true : !!value),
|
|
91
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
92
|
+
isEditorShow = _useState2[0],
|
|
93
|
+
setIsEditorShow = _useState2[1];
|
|
94
|
+
|
|
95
|
+
var _useState3 = (0, _react.useState)(false),
|
|
96
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
97
|
+
isEditorFocus = _useState4[0],
|
|
98
|
+
setIsEditorFocus = _useState4[1];
|
|
99
|
+
|
|
100
|
+
var defaultObj = {
|
|
101
|
+
needEditorFocus: !value
|
|
102
|
+
};
|
|
103
|
+
var editorOptionsObject = Object.assign(defaultObj, editorOptions);
|
|
104
|
+
|
|
105
|
+
var handleTextareaFocus = function handleTextareaFocus() {
|
|
106
|
+
if (!isReadOnly && !isDisabled) {
|
|
107
|
+
setIsEditorShow(true);
|
|
108
|
+
setTimeout(function () {
|
|
109
|
+
editor[id].squireInstance.focus();
|
|
110
|
+
}, 300);
|
|
133
111
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
editorBorder = _this$props3.editorBorder,
|
|
153
|
-
EDITORURL = _this$props3.EDITORURL,
|
|
154
|
-
isCustomScroll = _this$props3.isCustomScroll,
|
|
155
|
-
initCallback = _this$props3.initCallback,
|
|
156
|
-
loadingComponent = _this$props3.loadingComponent,
|
|
157
|
-
handleAlertMessage = _this$props3.handleAlertMessage,
|
|
158
|
-
editorCallback = _this$props3.editorCallback,
|
|
159
|
-
editorBlurCallback = _this$props3.editorBlurCallback,
|
|
160
|
-
editorOptions = _this$props3.editorOptions,
|
|
161
|
-
changeEditorContent = _this$props3.changeEditorContent,
|
|
162
|
-
shouldEditorUpdateContent = _this$props3.shouldEditorUpdateContent,
|
|
163
|
-
setInlineAttachmentInProgress = _this$props3.setInlineAttachmentInProgress,
|
|
164
|
-
handleEditorDropUpload = _this$props3.handleEditorDropUpload,
|
|
165
|
-
ImgLazyLoad = _this$props3.ImgLazyLoad,
|
|
166
|
-
i18nKeys = _this$props3.i18nKeys,
|
|
167
|
-
isEditorDefaultOpen = _this$props3.isEditorDefaultOpen,
|
|
168
|
-
needInlineAttachment = _this$props3.needInlineAttachment,
|
|
169
|
-
customProps = _this$props3.customProps,
|
|
170
|
-
dataSelectorId = _this$props3.dataSelectorId;
|
|
171
|
-
var _customProps$Textarea = customProps.Textarea1Props,
|
|
172
|
-
Textarea1Props = _customProps$Textarea === void 0 ? {} : _customProps$Textarea,
|
|
173
|
-
_customProps$Textarea2 = customProps.Textarea2Props,
|
|
174
|
-
Textarea2Props = _customProps$Textarea2 === void 0 ? {} : _customProps$Textarea2,
|
|
175
|
-
_customProps$TextEdit = customProps.TextEditorProps,
|
|
176
|
-
TextEditorProps = _customProps$TextEdit === void 0 ? {} : _customProps$TextEdit;
|
|
177
|
-
var defaultObj = {
|
|
178
|
-
needEditorFocus: !value
|
|
179
|
-
};
|
|
180
|
-
var editorOptionsObject = Object.assign(defaultObj, editorOptions);
|
|
181
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
182
|
-
className: _TextEditorWrapperModule["default"].container,
|
|
183
|
-
"data-selector-id": dataSelectorId
|
|
184
|
-
}, !isEditorShow ? /*#__PURE__*/_react["default"].createElement(_Textarea["default"], _extends({
|
|
185
|
-
onFocus: this.handleTextareaFocus,
|
|
186
|
-
text: value,
|
|
187
|
-
animated: !needEditor,
|
|
188
|
-
onChange: onChange,
|
|
189
|
-
dataId: dataId,
|
|
190
|
-
isReadOnly: isReadOnly,
|
|
191
|
-
isDisabled: isDisabled,
|
|
192
|
-
needEffect: !(isReadOnly || isDisabled),
|
|
193
|
-
getRef: getRef,
|
|
194
|
-
size: textBoxSize,
|
|
195
|
-
variant: textBoxVariant,
|
|
196
|
-
customClass: _TextEditorWrapperModule["default"].textBox
|
|
197
|
-
}, Textarea1Props)) : null, /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
|
|
198
|
-
name: "slideDown",
|
|
199
|
-
runOnMount: true,
|
|
200
|
-
enterDuration: '300',
|
|
201
|
-
exitDuration: '400',
|
|
202
|
-
isActive: isEditorShow,
|
|
203
|
-
component: "div"
|
|
204
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
|
-
className: _TextEditorWrapperModule["default"].textEditor
|
|
206
|
-
}, isEditorShow && needEditor ? /*#__PURE__*/_react["default"].createElement(_TextEditor["default"], _extends({
|
|
207
|
-
id: id,
|
|
208
|
-
value: value,
|
|
209
|
-
onChange: !isReadOnly && !isDisabled ? onChange : null,
|
|
210
|
-
editorOptions: editorOptionsObject,
|
|
211
|
-
onUpload: onAttachmentUpload,
|
|
212
|
-
editorMode: editorMode,
|
|
213
|
-
type: editorSize,
|
|
214
|
-
border: editorBorder,
|
|
215
|
-
dataId: dataId,
|
|
216
|
-
getRef: getRef,
|
|
217
|
-
plainTextSwitchCallback: !isReadOnly && !isDisabled ? onChange : null,
|
|
218
|
-
EDITORURL: EDITORURL,
|
|
219
|
-
isCustomScroll: isCustomScroll,
|
|
220
|
-
initCallback: initCallback,
|
|
221
|
-
loadingComponent: loadingComponent,
|
|
222
|
-
handleAlertMessage: handleAlertMessage,
|
|
223
|
-
toggleEdit: this.toggleEdit,
|
|
224
|
-
isEditorDefaultOpen: isEditorDefaultOpen,
|
|
225
|
-
editorCallback: editorCallback,
|
|
226
|
-
i18nKeys: i18nKeys,
|
|
227
|
-
ImgLazyLoad: ImgLazyLoad,
|
|
228
|
-
blurCallback: editorBlurCallback,
|
|
229
|
-
changeEditorContent: changeEditorContent,
|
|
230
|
-
shouldUpdateContent: shouldEditorUpdateContent,
|
|
231
|
-
setInlineAttachmentInProgress: setInlineAttachmentInProgress,
|
|
232
|
-
handleDropUpload: handleEditorDropUpload,
|
|
233
|
-
onFocus: this.focusCallback,
|
|
234
|
-
needInlineAttachment: needInlineAttachment
|
|
235
|
-
}, TextEditorProps)) : /*#__PURE__*/_react["default"].createElement(_Textarea["default"], _extends({
|
|
236
|
-
onFocus: this.handleTextareaFocus,
|
|
237
|
-
text: value,
|
|
238
|
-
animated: !needEditor,
|
|
239
|
-
onChange: onChange,
|
|
240
|
-
dataId: dataId,
|
|
241
|
-
isReadOnly: isReadOnly,
|
|
242
|
-
isDisabled: isDisabled,
|
|
243
|
-
needEffect: !(isReadOnly || isDisabled),
|
|
244
|
-
getRef: getRef,
|
|
245
|
-
size: textBoxSize,
|
|
246
|
-
variant: textBoxVariant
|
|
247
|
-
}, Textarea2Props)))));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var toggleEdit = function toggleEdit(value) {
|
|
115
|
+
setIsEditorShow(value);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var focusCallback = function focusCallback() {
|
|
119
|
+
setIsEditorFocus(true);
|
|
120
|
+
onFocus && onFocus();
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
(0, _useEffectCallOnlyAfterState["default"])(function () {
|
|
124
|
+
if (value || typeof editor !== 'undefined' && (0, _editorUtils.editorContentValidate)(editor[id])) {
|
|
125
|
+
setIsEditorShow(true);
|
|
126
|
+
} else {
|
|
127
|
+
if (!isEditorFocus && !isEditorDefaultOpen) {
|
|
128
|
+
setIsEditorShow(false);
|
|
129
|
+
}
|
|
248
130
|
}
|
|
249
|
-
}]);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
131
|
+
}, [value, id, isEditorDefaultOpen]);
|
|
132
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
|
+
className: _TextEditorWrapperModule["default"].container,
|
|
134
|
+
"data-selector-id": dataSelectorId
|
|
135
|
+
}, !isEditorShow ? /*#__PURE__*/_react["default"].createElement(_Textarea["default"], _extends({
|
|
136
|
+
onFocus: handleTextareaFocus,
|
|
137
|
+
text: value,
|
|
138
|
+
animated: !needEditor,
|
|
139
|
+
onChange: onChange,
|
|
140
|
+
dataId: dataId,
|
|
141
|
+
isReadOnly: isReadOnly,
|
|
142
|
+
isDisabled: isDisabled,
|
|
143
|
+
needEffect: !(isReadOnly || isDisabled),
|
|
144
|
+
getRef: getRef,
|
|
145
|
+
size: textBoxSize,
|
|
146
|
+
variant: textBoxVariant,
|
|
147
|
+
customClass: _TextEditorWrapperModule["default"].textBox
|
|
148
|
+
}, Textarea1Props)) : null, /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
|
|
149
|
+
name: "slideDown",
|
|
150
|
+
runOnMount: true,
|
|
151
|
+
enterDuration: '300',
|
|
152
|
+
exitDuration: '400',
|
|
153
|
+
isActive: isEditorShow,
|
|
154
|
+
component: "div"
|
|
155
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
|
+
className: _TextEditorWrapperModule["default"].textEditor
|
|
157
|
+
}, isEditorShow && needEditor ? /*#__PURE__*/_react["default"].createElement(_TextEditor["default"], _extends({
|
|
158
|
+
id: id,
|
|
159
|
+
value: value,
|
|
160
|
+
onChange: !isReadOnly && !isDisabled ? onChange : null,
|
|
161
|
+
editorOptions: editorOptionsObject,
|
|
162
|
+
onUpload: onAttachmentUpload,
|
|
163
|
+
editorMode: editorMode,
|
|
164
|
+
type: editorSize,
|
|
165
|
+
border: editorBorder,
|
|
166
|
+
dataId: dataId,
|
|
167
|
+
getRef: getRef,
|
|
168
|
+
plainTextSwitchCallback: !isReadOnly && !isDisabled ? onChange : null,
|
|
169
|
+
EDITORURL: EDITORURL,
|
|
170
|
+
isCustomScroll: isCustomScroll,
|
|
171
|
+
initCallback: initCallback,
|
|
172
|
+
loadingComponent: loadingComponent,
|
|
173
|
+
handleAlertMessage: handleAlertMessage,
|
|
174
|
+
toggleEdit: toggleEdit,
|
|
175
|
+
isEditorDefaultOpen: isEditorDefaultOpen,
|
|
176
|
+
editorCallback: editorCallback,
|
|
177
|
+
i18nKeys: i18nKeys,
|
|
178
|
+
ImgLazyLoad: ImgLazyLoad,
|
|
179
|
+
blurCallback: editorBlurCallback,
|
|
180
|
+
changeEditorContent: changeEditorContent,
|
|
181
|
+
shouldUpdateContent: shouldEditorUpdateContent,
|
|
182
|
+
setInlineAttachmentInProgress: setInlineAttachmentInProgress,
|
|
183
|
+
handleDropUpload: handleEditorDropUpload,
|
|
184
|
+
onFocus: focusCallback,
|
|
185
|
+
needInlineAttachment: needInlineAttachment
|
|
186
|
+
}, TextEditorProps)) : /*#__PURE__*/_react["default"].createElement(_Textarea["default"], _extends({
|
|
187
|
+
onFocus: handleTextareaFocus,
|
|
188
|
+
text: value,
|
|
189
|
+
animated: !needEditor,
|
|
190
|
+
onChange: onChange,
|
|
191
|
+
dataId: dataId,
|
|
192
|
+
isReadOnly: isReadOnly,
|
|
193
|
+
isDisabled: isDisabled,
|
|
194
|
+
needEffect: !(isReadOnly || isDisabled),
|
|
195
|
+
getRef: getRef,
|
|
196
|
+
size: textBoxSize,
|
|
197
|
+
variant: textBoxVariant
|
|
198
|
+
}, Textarea2Props)))));
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
var _default = TextEditorWrapper;
|
|
202
|
+
exports["default"] = _default;
|
|
255
203
|
TextEditorWrapper.propTypes = _propTypes.propTypes;
|
|
256
204
|
TextEditorWrapper.defaultProps = _defaultProps.defaultProps;
|