dtable-ui-component 6.0.97 → 6.0.99
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.
|
@@ -59,15 +59,18 @@ class ClickOutside extends _react.default.Component {
|
|
|
59
59
|
constructor() {
|
|
60
60
|
super(...arguments);
|
|
61
61
|
this.isClickedInside = false;
|
|
62
|
+
this.setClickedInsideStatus = status => {
|
|
63
|
+
this.isClickedInside = status || false;
|
|
64
|
+
};
|
|
62
65
|
this.handleDocumentClick = e => {
|
|
63
66
|
if (this.isClickedInside) {
|
|
64
|
-
this.
|
|
67
|
+
this.setClickedInsideStatus(false);
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
67
70
|
this.props.onClickOutside(e);
|
|
68
71
|
};
|
|
69
72
|
this.handleMouseDown = () => {
|
|
70
|
-
this.
|
|
73
|
+
this.setClickedInsideStatus(true);
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
76
|
componentDidMount() {
|
|
@@ -143,29 +143,35 @@ class FileUploader extends _react.default.Component {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
try {
|
|
146
|
-
let
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
146
|
+
let isImage = /image/i.test(uploadFile.type);
|
|
147
|
+
let uploadFileItem = {
|
|
148
|
+
name: uploadFile.name,
|
|
149
|
+
fileIconUrl: (0, _url.getFileIconUrl)(uploadFile.name),
|
|
150
|
+
isUploading: true,
|
|
151
|
+
isErrorTip: false,
|
|
152
|
+
uploadFile: uploadFile,
|
|
153
|
+
size: uploadFile.size,
|
|
154
|
+
url: '',
|
|
155
|
+
type: uploadType === 'file' ? 'file' : '',
|
|
156
|
+
percent: 0
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// Provide preview when the image size is less than 100MB
|
|
160
|
+
if (isImage && uploadFile.size < 100 * 1024 * 1024) {
|
|
161
|
+
let fileReader = new FileReader();
|
|
162
|
+
fileReader.readAsDataURL(uploadFile);
|
|
163
|
+
fileReader.onload = function (event) {
|
|
164
|
+
uploadFileItem.fileIconUrl = event.target.result;
|
|
162
165
|
uploadFileList.push(uploadFileItem);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
checkLoadFinish();
|
|
167
|
+
};
|
|
168
|
+
fileReader.onerror = function () {
|
|
169
|
+
checkLoadFinish();
|
|
170
|
+
};
|
|
171
|
+
} else {
|
|
172
|
+
uploadFileList.push(uploadFileItem);
|
|
167
173
|
checkLoadFinish();
|
|
168
|
-
}
|
|
174
|
+
}
|
|
169
175
|
} catch (event) {
|
|
170
176
|
checkLoadFinish();
|
|
171
177
|
}
|
|
@@ -39,7 +39,9 @@ class TextFormatter extends _react.default.Component {
|
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
40
|
className: classname,
|
|
41
41
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
42
|
-
className:
|
|
42
|
+
className: (0, _classnames.default)('text-formatter-value text-truncate', {
|
|
43
|
+
'row-expand-jump-link-value': isDisplayAsAsPhoneNumber
|
|
44
|
+
}),
|
|
43
45
|
children: formattedValue
|
|
44
46
|
}), isDisplayAsAsPhoneNumber && !!(0, _editorUtils.getTrimmedString)(value) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PhoneNumberLink.default, {
|
|
45
47
|
phoneNumber: value,
|
|
@@ -85,6 +85,10 @@ class SelectOptionGroup extends _react.Component {
|
|
|
85
85
|
if (isInModal) {
|
|
86
86
|
e.stopPropagation();
|
|
87
87
|
e.nativeEvent.stopImmediatePropagation();
|
|
88
|
+
|
|
89
|
+
// ClickOutside set isClickedInside to true via mouse down capture first
|
|
90
|
+
// Set isClickedInside to false after mouse down
|
|
91
|
+
this.clickOutsideRef && this.clickOutsideRef.setClickedInsideStatus(false);
|
|
88
92
|
}
|
|
89
93
|
};
|
|
90
94
|
this.scrollContent = () => {
|
|
@@ -213,6 +217,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
213
217
|
};
|
|
214
218
|
}
|
|
215
219
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
220
|
+
ref: ref => this.clickOutsideRef = ref,
|
|
216
221
|
onClickOutside: this.props.onClickOutside,
|
|
217
222
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
218
223
|
className: (0, _classnames.default)('option-group', className ? 'option-group-' + className : '', {
|