@opentiny/vue-renderless 3.20.2 → 3.21.0
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/anchor/index.js +1 -1
- package/badge/vue.js +1 -1
- package/base-select/index.js +3 -0
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/cascader/index.js +10 -8
- package/cascader-panel/vue.js +1 -1
- package/cascader-select/column-index.js +3 -0
- package/chart-core/deps/utils.js +1 -1
- package/chart-core/index.js +1 -1
- package/common/browser.js +2 -0
- package/common/deps/eSpaceCtrl.js +3 -2
- package/common/deps/fastdom/singleton.js +9 -1
- package/common/deps/fullscreen/screenfull.js +54 -25
- package/common/deps/popper.js +18 -18
- package/common/deps/touch-emulator.js +15 -10
- package/common/deps/upload-ajax.js +1 -1
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +5 -2
- package/common/validate/util.js +1 -1
- package/dialog-box/index.js +6 -3
- package/divider/index.js +47 -0
- package/divider/vue.js +24 -3
- package/dropdown/index.js +7 -6
- package/dropdown/vue.js +7 -3
- package/espace/index.js +1 -1
- package/fall-menu/index.js +1 -1
- package/file-upload/index.js +71 -67
- package/file-upload/vue.js +6 -6
- package/floatbar/index.js +1 -1
- package/fluent-editor/index.js +25 -9
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/guide/index.js +1 -1
- package/image/index.js +1 -1
- package/image-viewer/index.js +3 -2
- package/input/vue.js +3 -0
- package/link/vue.js +1 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/menu/index.js +1 -1
- package/milestone/index.js +2 -1
- package/modal/index.js +0 -1
- package/nav-menu/index.js +80 -11
- package/nav-menu/vue.js +13 -1
- package/package.json +2 -2
- package/picker/index.js +10 -0
- package/rich-text/index.js +1 -1
- package/rich-text/module/file-upload.js +1 -1
- package/rich-text/module/image-upload.js +1 -1
- package/rich-text-editor/vue.js +11 -10
- package/roles/index.js +1 -1
- package/select/index.js +27 -17
- package/select/vue.js +33 -5
- package/select-dropdown/vue.js +2 -1
- package/split/index.js +2 -1
- package/statistic/index.js +5 -2
- package/tabbar-item/vue.js +1 -1
- package/tabs-mf/wheel.js +14 -9
- package/time-panel/index.js +8 -1
- package/time-panel/vue.js +2 -0
- package/time-spinner/index.js +2 -1
- package/toggle-menu/index.js +1 -1
- package/transfer/index.js +1 -5
- package/tree-menu/index.js +5 -1
- package/tree-menu/vue.js +5 -2
- package/types/alert.type.d.ts +4 -0
- package/types/date-picker.type.d.ts +1 -1
- package/types/dialog-box.type.d.ts +10 -0
- package/types/divider.type.d.ts +94 -0
- package/types/dropdown.type.d.ts +2 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +2 -2
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-f6fb4c38.d.ts → form.type-4e0ec0a1.d.ts} +2 -1
- package/types/form.type.d.ts +1 -1
- package/types/image.type.d.ts +1 -1
- package/types/nav-menu.type.d.ts +1 -0
- package/types/statistic.type.d.ts +2 -5
- package/types/tree-menu.type.d.ts +19 -0
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-6189e4c9.d.ts → upload-list.type-eaf82b7a.d.ts} +4 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +1 -1
- package/upload-dragger/index.js +49 -24
- package/upload-dragger/vue.js +1 -0
- package/upload-list/index.js +1 -1
- package/upload-list/vue.js +2 -1
- package/user/index.js +1 -1
- package/user-contact/index.js +1 -1
- package/year-table/index.js +2 -2
- package/common/xss.js +0 -191
package/dropdown/vue.js
CHANGED
|
@@ -18,10 +18,11 @@ import {
|
|
|
18
18
|
initDomOperation,
|
|
19
19
|
mounted,
|
|
20
20
|
beforeDistory,
|
|
21
|
-
clickOutside
|
|
21
|
+
clickOutside,
|
|
22
|
+
toggleFocus
|
|
22
23
|
} from "./index";
|
|
23
24
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
|
|
24
|
-
const renderless = (props, { reactive, watch, provide, onMounted, computed }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
|
+
const renderless = (props, { reactive, watch, provide, onMounted, computed, onBeforeUnmount }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
26
|
const api2 = {};
|
|
26
27
|
const state = reactive({
|
|
27
28
|
visible: false,
|
|
@@ -60,11 +61,14 @@ const renderless = (props, { reactive, watch, provide, onMounted, computed }, {
|
|
|
60
61
|
triggerElmFocus: triggerElmFocus(state),
|
|
61
62
|
initDomOperation: initDomOperation({ api: api2, state, vm }),
|
|
62
63
|
beforeDistory: beforeDistory({ vm, api: api2, state }),
|
|
63
|
-
clickOutside: clickOutside({ props, api: api2 })
|
|
64
|
+
clickOutside: clickOutside({ props, api: api2 }),
|
|
65
|
+
toggleFocusOnTrue: toggleFocus({ state, value: true }),
|
|
66
|
+
toggleFocusOnFalse: toggleFocus({ state, value: false })
|
|
64
67
|
});
|
|
65
68
|
watch(() => state.visible, api2.watchVisible);
|
|
66
69
|
watch(() => state.focusing, api2.watchFocusing);
|
|
67
70
|
onMounted(api2.mounted);
|
|
71
|
+
onBeforeUnmount(api2.beforeDistory);
|
|
68
72
|
return api2;
|
|
69
73
|
};
|
|
70
74
|
export {
|
package/espace/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
const getUserHref = ({ api, props }) => (item) => {
|
|
4
4
|
const type = item.type ? String(item.type).toLocaleLowerCase() : "";
|
|
5
5
|
const value = item.value ? String(item.value).toLocaleLowerCase() : "";
|
package/fall-menu/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { REFRESH_INTERVAL } from "../common";
|
|
3
3
|
import { on, off } from "../common/deps/dom";
|
|
4
4
|
import PopupManager from "../common/deps/popup-manager";
|
|
5
|
-
import { xss } from "
|
|
5
|
+
import { xss } from "@opentiny/utils";
|
|
6
6
|
const arrowClick = (state) => (opt) => {
|
|
7
7
|
state.pager += opt;
|
|
8
8
|
};
|
package/file-upload/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
5
|
import { extend } from "../common/object";
|
|
6
|
-
import { xss, log } from "
|
|
6
|
+
import { xss, log, crypt } from "@opentiny/utils";
|
|
7
7
|
import uploadAjax from "../common/deps/upload-ajax";
|
|
8
8
|
import { isObject } from "../common/type";
|
|
9
9
|
import { isEmptyObject } from "../common/type";
|
|
@@ -273,12 +273,14 @@ const properFileSize = ({
|
|
|
273
273
|
} else {
|
|
274
274
|
maxSize = state.isEdm ? Math.min(state.singleMaxSize) : props.fileSize / 1024;
|
|
275
275
|
}
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
message
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
276
|
+
if (state.isEdm || Array.isArray(props.fileSize) && props.fileSize[1]) {
|
|
277
|
+
if (!isNaN(Number(maxSize)) && file.size > maxSize * 1024 * 1024) {
|
|
278
|
+
Modal.message({
|
|
279
|
+
message: t(constants.EDM.EXCEED, { maxSize: api.formatFileSize(Number(maxSize * 1024 * 1024)) }),
|
|
280
|
+
status: "warning"
|
|
281
|
+
});
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
282
284
|
}
|
|
283
285
|
if (file.size <= 0) {
|
|
284
286
|
Modal.message({
|
|
@@ -312,7 +314,7 @@ const addFileToList = ({
|
|
|
312
314
|
if (state.isEdm) {
|
|
313
315
|
let fileBase = { serverName: "", docRelativePath: "", docId: "", docVersion: "", cacheSign: rawFile.uid };
|
|
314
316
|
file = Object.assign(file, fileBase);
|
|
315
|
-
props.edm.upload.isFolder && (file.path = rawFile.webkitRelativePath.match(/.*\//g)[0]);
|
|
317
|
+
props.edm.upload.isFolder && rawFile.webkitRelativePath && (file.path = rawFile.webkitRelativePath.match(/.*\//g)[0]);
|
|
316
318
|
}
|
|
317
319
|
state.cacheDocuments[file.uid] = file;
|
|
318
320
|
mode === "mobile" && calcFileForMobile(rawFile, file);
|
|
@@ -363,45 +365,24 @@ const getFileHash = ({
|
|
|
363
365
|
Modal,
|
|
364
366
|
constants,
|
|
365
367
|
t,
|
|
366
|
-
CryptoJS,
|
|
367
368
|
state
|
|
368
|
-
}) => ({ file,
|
|
369
|
+
}) => ({ file, showTips }) => {
|
|
369
370
|
if (showTips) {
|
|
370
371
|
Modal.message({
|
|
371
372
|
message: `${t(constants.EDM.CALCHASH)}`,
|
|
372
373
|
status: "warning"
|
|
373
374
|
});
|
|
374
375
|
}
|
|
375
|
-
const chunks = Math.ceil(file.size / chunkSize);
|
|
376
|
-
let chunkIndex = 0;
|
|
377
|
-
let start = chunkIndex * chunkSize;
|
|
378
|
-
let end = Math.min(file.size, start + chunkSize);
|
|
379
|
-
let chunk = file.raw.slice(start, end);
|
|
380
|
-
const hasher = CryptoJS.algo.SHA256.create();
|
|
381
|
-
let calculated = 0;
|
|
382
376
|
return new Promise((resolve) => {
|
|
383
377
|
const reader = new FileReader();
|
|
384
|
-
reader.readAsArrayBuffer(
|
|
385
|
-
reader.onload = (e) => {
|
|
378
|
+
reader.readAsArrayBuffer(file.raw);
|
|
379
|
+
reader.onload = async (e) => {
|
|
386
380
|
if (file.status === constants.FILE_STATUS.FAIL)
|
|
387
381
|
return;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (chunkIndex < chunks) {
|
|
393
|
-
start = chunkIndex * chunkSize;
|
|
394
|
-
end = Math.min(file.size, start + chunkSize);
|
|
395
|
-
calculated += end - start;
|
|
396
|
-
emit("hash-progress", Math.min(Math.floor(calculated / file.size * 100), 100));
|
|
397
|
-
chunk = file.raw.slice(start, end);
|
|
398
|
-
reader.readAsArrayBuffer(chunk);
|
|
399
|
-
} else {
|
|
400
|
-
const hash = hasher.finalize().toString();
|
|
401
|
-
file.hash = file.raw.hash = hash;
|
|
402
|
-
resolve(hash);
|
|
403
|
-
emit("hash-progress", 100);
|
|
404
|
-
}
|
|
382
|
+
const hash = await crypt.sha256(e.target && e.target.result);
|
|
383
|
+
file.hash = file.raw.hash = hash;
|
|
384
|
+
resolve(hash);
|
|
385
|
+
emit("hash-progress", 100);
|
|
405
386
|
};
|
|
406
387
|
reader.onerror = (err) => {
|
|
407
388
|
file.status = constants.FILE_STATUS.FAIL;
|
|
@@ -463,7 +444,7 @@ const handleStart = ({
|
|
|
463
444
|
isLargeFileHash = true;
|
|
464
445
|
}
|
|
465
446
|
}
|
|
466
|
-
api.getFileHash({ file: file2,
|
|
447
|
+
api.getFileHash({ file: file2, showTips: isLargeFileHash }).then((hash) => resolve(hash));
|
|
467
448
|
}).then(() => {
|
|
468
449
|
if (props.autoUpload) {
|
|
469
450
|
const tokenParams = { token: props.edm.upload.token, file: file2, type: "upload" };
|
|
@@ -983,7 +964,7 @@ const downloadFileSingle = ({
|
|
|
983
964
|
onDownloadProgress(evt) {
|
|
984
965
|
let progress = calcProgress(evt, isChunk);
|
|
985
966
|
if (progress !== 100) {
|
|
986
|
-
!isChunk && emit("download", progress, evt);
|
|
967
|
+
!isChunk && emit("download", progress, evt, {}, file);
|
|
987
968
|
}
|
|
988
969
|
if (typeof file === "object") {
|
|
989
970
|
file.percentage = progress;
|
|
@@ -997,7 +978,7 @@ const downloadFileSingle = ({
|
|
|
997
978
|
return;
|
|
998
979
|
handleSuccess2(data, "", range.index);
|
|
999
980
|
const { checkcode, "content-size": fileSize } = data.headers;
|
|
1000
|
-
!isChunk && emit("download", 100, "", { checkcode, fileSize });
|
|
981
|
+
!isChunk && emit("download", 100, "", { checkcode, fileSize }, file);
|
|
1001
982
|
if (typeof file === "object") {
|
|
1002
983
|
file.percentage = 100;
|
|
1003
984
|
setTimeout(() => file.status = constants.FILE_STATUS.SUCESS, 1e3);
|
|
@@ -1053,7 +1034,7 @@ const downloadFileBatch = ({
|
|
|
1053
1034
|
onDownloadProgress(evt) {
|
|
1054
1035
|
let progress = calcProgress(evt);
|
|
1055
1036
|
if (progress !== 100) {
|
|
1056
|
-
emit("download", progress, evt);
|
|
1037
|
+
emit("download", progress, evt, {}, file);
|
|
1057
1038
|
}
|
|
1058
1039
|
}
|
|
1059
1040
|
}
|
|
@@ -1063,7 +1044,7 @@ const downloadFileBatch = ({
|
|
|
1063
1044
|
if (api.validateDownloadStatus({ downloadOps: props.edm.download || {}, file, isLessThan17G, data: data2 }))
|
|
1064
1045
|
return;
|
|
1065
1046
|
const { "content-size": fileSize, checkcode } = data2.headers;
|
|
1066
|
-
emit("download", 100, "", { fileSize, checkcode });
|
|
1047
|
+
emit("download", 100, "", { fileSize, checkcode }, file);
|
|
1067
1048
|
handleSuccess2(data2, "zip");
|
|
1068
1049
|
});
|
|
1069
1050
|
});
|
|
@@ -1132,12 +1113,12 @@ const downloadFileSingleHwh5 = ({ state, props, emit, constants }) => ({ file })
|
|
|
1132
1113
|
onProgress: (event) => {
|
|
1133
1114
|
const { progress } = JSON.parse(event);
|
|
1134
1115
|
if (progress * 1 !== 100) {
|
|
1135
|
-
emit("download", progress);
|
|
1116
|
+
emit("download", progress, event, {}, file);
|
|
1136
1117
|
}
|
|
1137
1118
|
}
|
|
1138
1119
|
};
|
|
1139
1120
|
downloadToEDM(options).then((data) => {
|
|
1140
|
-
emit("download", 100, "", { data });
|
|
1121
|
+
emit("download", 100, "", { data }, file);
|
|
1141
1122
|
});
|
|
1142
1123
|
};
|
|
1143
1124
|
const downloadFile = ({ api, state }) => (file) => {
|
|
@@ -1172,7 +1153,8 @@ const downloadFileSingleInner = ({ props, state, api, constants }) => ({ file, i
|
|
|
1172
1153
|
api.downloadFileSingleHwh5({ file });
|
|
1173
1154
|
return;
|
|
1174
1155
|
}
|
|
1175
|
-
const
|
|
1156
|
+
const param = { docId: file.docId, docVersion: file.docVersion };
|
|
1157
|
+
const promise = state.hasFileInfoInterface ? api.getDownloadFileInfo(param) : Promise.resolve();
|
|
1176
1158
|
promise.then((fileInfo) => {
|
|
1177
1159
|
const { fileSize } = fileInfo || {};
|
|
1178
1160
|
const isLargeFile = fileSize > state.docSize && fileSize > state.chunkSize;
|
|
@@ -1184,7 +1166,7 @@ const downloadFileSingleInner = ({ props, state, api, constants }) => ({ file, i
|
|
|
1184
1166
|
});
|
|
1185
1167
|
});
|
|
1186
1168
|
};
|
|
1187
|
-
const getDownloadFileInfo = ({ api, state, props, service }) => ({ docId }) => {
|
|
1169
|
+
const getDownloadFileInfo = ({ api, state, props, service }) => ({ docId, docVersion }) => {
|
|
1188
1170
|
return service.getDocumentInfoUrl().then((url) => {
|
|
1189
1171
|
return new Promise((resolve, reject) => {
|
|
1190
1172
|
service.request({
|
|
@@ -1193,7 +1175,7 @@ const getDownloadFileInfo = ({ api, state, props, service }) => ({ docId }) => {
|
|
|
1193
1175
|
withCredentials: props.withCredentials,
|
|
1194
1176
|
headers: Object.assign(props.headers, state.headers),
|
|
1195
1177
|
cancelToken: api.createDownloadCancelToken({ docId }),
|
|
1196
|
-
data: { docInfoVO: { ids: [docId], docType: "", docVersion: "" } }
|
|
1178
|
+
data: { docInfoVO: { ids: [docId], docType: "", docVersion: docVersion || "" } }
|
|
1197
1179
|
}).then((res) => {
|
|
1198
1180
|
const { data } = res || {};
|
|
1199
1181
|
if (data && data.status === 200) {
|
|
@@ -1223,7 +1205,7 @@ const sliceDownloadChunk = ({ state }) => (file) => {
|
|
|
1223
1205
|
let endRange = -1;
|
|
1224
1206
|
for (let i = 0; i < chunkSize; i++) {
|
|
1225
1207
|
startRange = endRange + 1;
|
|
1226
|
-
endRange = Math.min(file.fileSize, startRange + state.chunkSize);
|
|
1208
|
+
endRange = Math.min(file.fileSize, startRange + state.chunkSize - 1);
|
|
1227
1209
|
if (endRange < startRange) {
|
|
1228
1210
|
return downloadChunkArray;
|
|
1229
1211
|
}
|
|
@@ -1305,10 +1287,14 @@ const downloadFileInner = ({ api, props, state }) => ({ batchIndex, file, range,
|
|
|
1305
1287
|
const afterDownload = ({ api, state }) => ({ batchIndex, range, data, file, isBatch, isChunk, isLessThan17G }) => {
|
|
1306
1288
|
if (data.status === 200) {
|
|
1307
1289
|
const key = file.docId + "-" + batchIndex;
|
|
1308
|
-
|
|
1309
|
-
|
|
1290
|
+
if (state.downloadBatchQueue[key] !== void 0) {
|
|
1291
|
+
state.downloadBatchQueue[key] += 1;
|
|
1292
|
+
} else {
|
|
1293
|
+
state.downloadBatchQueue[key] = 0;
|
|
1294
|
+
}
|
|
1310
1295
|
} else {
|
|
1311
|
-
const
|
|
1296
|
+
const key = file.docId + "-" + range.index;
|
|
1297
|
+
const countDownloadReplay = state.downloadReplayAtoms[key];
|
|
1312
1298
|
if (countDownloadReplay && countDownloadReplay >= 2) {
|
|
1313
1299
|
const msgArray = [
|
|
1314
1300
|
"The number of retry times exceeds the threshold! [docId:",
|
|
@@ -1318,11 +1304,14 @@ const afterDownload = ({ api, state }) => ({ batchIndex, range, data, file, isBa
|
|
|
1318
1304
|
"]"
|
|
1319
1305
|
];
|
|
1320
1306
|
log.logger.warn(msgArray.join(""));
|
|
1321
|
-
delete state.downloadReplayAtoms[
|
|
1307
|
+
delete state.downloadReplayAtoms[key];
|
|
1322
1308
|
} else {
|
|
1309
|
+
if (state.downloadReplayAtoms[key] === void 0) {
|
|
1310
|
+
state.downloadReplayAtoms[key] = 0;
|
|
1311
|
+
}
|
|
1323
1312
|
const msgArray = ["replay ", countDownloadReplay, "! [docId:", file.docId, ", chunk:", range.index, "]"];
|
|
1324
1313
|
log.logger.warn(msgArray.join(""));
|
|
1325
|
-
state.downloadReplayAtoms[
|
|
1314
|
+
state.downloadReplayAtoms[key] += 1;
|
|
1326
1315
|
api.downloadFileInner({ batchIndex, range, file, isBatch, isChunk, isLessThan17G });
|
|
1327
1316
|
}
|
|
1328
1317
|
}
|
|
@@ -1354,11 +1343,11 @@ const setWriterFile = ({
|
|
|
1354
1343
|
delete downloadChunkFile[index];
|
|
1355
1344
|
if (index + 1 >= chunkNum) {
|
|
1356
1345
|
delete state.downloadChunkFile[file.docId];
|
|
1357
|
-
emit("download", 100, "", { fileSize, checkcode });
|
|
1346
|
+
emit("download", 100, "", { fileSize, checkcode }, file);
|
|
1358
1347
|
writer.close();
|
|
1359
1348
|
} else {
|
|
1360
1349
|
const progress = Math.ceil(downloaded / fileSize * 100) || 0;
|
|
1361
|
-
progress !== 100 && emit("download", progress);
|
|
1350
|
+
progress !== 100 && emit("download", progress, "", { fileSize, checkcode }, file);
|
|
1362
1351
|
index++;
|
|
1363
1352
|
writerStreamSaver();
|
|
1364
1353
|
}
|
|
@@ -1371,10 +1360,10 @@ const setWriterFile = ({
|
|
|
1371
1360
|
if (index + 1 >= chunkNum) {
|
|
1372
1361
|
delete state.downloadChunkFile[file.docId];
|
|
1373
1362
|
aLinkDownload({ blob: new Blob(fileData), name: docName });
|
|
1374
|
-
emit("download", 100, "", { fileSize, checkcode });
|
|
1363
|
+
emit("download", 100, "", { fileSize, checkcode }, file);
|
|
1375
1364
|
} else {
|
|
1376
1365
|
const progress = Math.ceil(downloaded / fileSize * 100) || 0;
|
|
1377
|
-
progress !== 100 && emit("download", progress);
|
|
1366
|
+
progress !== 100 && emit("download", progress, "", { fileSize, checkcode }, file);
|
|
1378
1367
|
index++;
|
|
1379
1368
|
writerStreamSaver();
|
|
1380
1369
|
}
|
|
@@ -1497,10 +1486,14 @@ const afterUpload = ({
|
|
|
1497
1486
|
}) => {
|
|
1498
1487
|
if (data.status === 200) {
|
|
1499
1488
|
const key = file.docId + "-" + batchIndex;
|
|
1500
|
-
|
|
1501
|
-
|
|
1489
|
+
if (state.batchQueue[key] !== void 0) {
|
|
1490
|
+
state.batchQueue[key] += 1;
|
|
1491
|
+
} else {
|
|
1492
|
+
state.batchQueue[key] = 0;
|
|
1493
|
+
}
|
|
1502
1494
|
} else {
|
|
1503
|
-
const
|
|
1495
|
+
const key = file.docId + "-" + file.chunk;
|
|
1496
|
+
const countReplay = state.replayAtoms[key];
|
|
1504
1497
|
if (countReplay && countReplay >= 2) {
|
|
1505
1498
|
const msgArray = [
|
|
1506
1499
|
"The number of retry times exceeds the threshold! [docId:",
|
|
@@ -1510,11 +1503,14 @@ const afterUpload = ({
|
|
|
1510
1503
|
"]"
|
|
1511
1504
|
];
|
|
1512
1505
|
log.logger.warn(msgArray.join(""));
|
|
1513
|
-
delete state.replayAtoms[
|
|
1506
|
+
delete state.replayAtoms[key];
|
|
1514
1507
|
} else {
|
|
1508
|
+
if (state.replayAtoms[key] === void 0) {
|
|
1509
|
+
state.replayAtoms[key] = 0;
|
|
1510
|
+
}
|
|
1515
1511
|
const msgArray = ["replay ", countReplay, "! [docId:", file.docId, ", chunk:", file.chunk, "]"];
|
|
1516
1512
|
log.logger.warn(msgArray.join(""));
|
|
1517
|
-
state.replayAtoms[
|
|
1513
|
+
state.replayAtoms[key] += 1;
|
|
1518
1514
|
api.segmentUpload(batchIndex, file, progress);
|
|
1519
1515
|
}
|
|
1520
1516
|
}
|
|
@@ -1583,8 +1579,7 @@ const segmentUpload = ({
|
|
|
1583
1579
|
service,
|
|
1584
1580
|
state,
|
|
1585
1581
|
emit,
|
|
1586
|
-
constants
|
|
1587
|
-
CryptoJS
|
|
1582
|
+
constants
|
|
1588
1583
|
}) => (batchIndex, file, progress) => {
|
|
1589
1584
|
if (typeof file.then === "function") {
|
|
1590
1585
|
file.then(
|
|
@@ -1593,10 +1588,9 @@ const segmentUpload = ({
|
|
|
1593
1588
|
return resolve(file2);
|
|
1594
1589
|
const reader = new FileReader();
|
|
1595
1590
|
reader.readAsArrayBuffer(file2);
|
|
1596
|
-
reader.onload = (e) => {
|
|
1591
|
+
reader.onload = async (e) => {
|
|
1597
1592
|
if (props.edm.isCheckCode === true) {
|
|
1598
|
-
|
|
1599
|
-
const hash = CryptoJS.SHA256(wordArray).toString();
|
|
1593
|
+
const hash = await crypt.sha256(e.target && e.target.result);
|
|
1600
1594
|
file2.hash = hash;
|
|
1601
1595
|
}
|
|
1602
1596
|
resolve(file2);
|
|
@@ -1741,7 +1735,17 @@ const getToken = ({
|
|
|
1741
1735
|
if (["preview", "download"].includes(type) && props.accept) {
|
|
1742
1736
|
state.accept = props.accept;
|
|
1743
1737
|
} else if (whitelist) {
|
|
1744
|
-
|
|
1738
|
+
if (props.accept) {
|
|
1739
|
+
let propsAccept = "";
|
|
1740
|
+
props.accept.toString().split(",").forEach((item) => {
|
|
1741
|
+
if (!whitelist.includes(item)) {
|
|
1742
|
+
propsAccept += `,${item}`;
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
state.accept = whitelist + propsAccept;
|
|
1746
|
+
} else {
|
|
1747
|
+
state.accept = whitelist;
|
|
1748
|
+
}
|
|
1745
1749
|
}
|
|
1746
1750
|
state.headers[constants.EDM.EDMTOKEN] = result.edmToken || "";
|
|
1747
1751
|
state.headers[constants.EDM.TRACEID] = result.traceId || "";
|
package/file-upload/vue.js
CHANGED
|
@@ -227,10 +227,10 @@ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal, e
|
|
|
227
227
|
formatFileSize
|
|
228
228
|
});
|
|
229
229
|
};
|
|
230
|
-
const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm,
|
|
230
|
+
const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, Streamsaver }) => {
|
|
231
231
|
Object.assign(api2, {
|
|
232
232
|
segmentUploadInit: segmentUploadInit({ api: api2, props, service: $service, state, constants }),
|
|
233
|
-
segmentUpload: segmentUpload({ api: api2, props, service: $service, state, emit, constants
|
|
233
|
+
segmentUpload: segmentUpload({ api: api2, props, service: $service, state, emit, constants }),
|
|
234
234
|
addFileToList: addFileToList({ api: api2, constants, emit, props, state, mode }),
|
|
235
235
|
downloadFile: downloadFile({ api: api2, state }),
|
|
236
236
|
downloadFileSingleInner: downloadFileSingleInner({ props, state, api: api2, constants }),
|
|
@@ -257,7 +257,7 @@ const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Mo
|
|
|
257
257
|
downloadFileInner: downloadFileInner({ api: api2, props, state }),
|
|
258
258
|
setWriterFile: setWriterFile({ state, emit, Streamsaver }),
|
|
259
259
|
afterDownload: afterDownload({ api: api2, state }),
|
|
260
|
-
getFileHash: getFileHash({ emit, Modal, constants, t,
|
|
260
|
+
getFileHash: getFileHash({ emit, Modal, constants, t, state }),
|
|
261
261
|
modifyServiceUrlSingle: modifyServiceUrlSingle({ state, props, constants }),
|
|
262
262
|
getKiaScanTip: getKiaScanTip({ Modal, constants, t }),
|
|
263
263
|
downloadFileSingle: downloadFileSingle({ service: $service, constants, props, state, api: api2, emit }),
|
|
@@ -303,7 +303,7 @@ const initWatch = ({ watch, state, api: api2, props, $service }) => {
|
|
|
303
303
|
watch(() => props.edm, api2.computeDocChunkSize, { deep: true, immediate: true });
|
|
304
304
|
};
|
|
305
305
|
let getApi = () => ({});
|
|
306
|
-
const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants, useBreakpoint }, { Modal,
|
|
306
|
+
const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants, useBreakpoint }, { Modal, Streamsaver }) => {
|
|
307
307
|
let api2 = {};
|
|
308
308
|
const $service = initService({ props, service });
|
|
309
309
|
const httpRequest = $service.httpRequest;
|
|
@@ -320,13 +320,13 @@ const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactiv
|
|
|
320
320
|
useBreakpoint
|
|
321
321
|
});
|
|
322
322
|
initApi({ api: api2, state, props, constants, vm, $service, t, Modal, emit });
|
|
323
|
-
mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm,
|
|
323
|
+
mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, Streamsaver });
|
|
324
324
|
getApi = () => api2;
|
|
325
325
|
provide("uploader", parent);
|
|
326
326
|
onMounted(api2.mounted);
|
|
327
327
|
onBeforeUnmount(() => {
|
|
328
328
|
api2.onBeforeDestroy();
|
|
329
|
-
api2 =
|
|
329
|
+
api2 = null;
|
|
330
330
|
vm.$off("drag-over");
|
|
331
331
|
});
|
|
332
332
|
initWatch({ watch, state, api: api2, props, $service });
|
package/floatbar/index.js
CHANGED
package/fluent-editor/index.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { extend } from "../common/object";
|
|
3
3
|
import { isNull } from "../common/type";
|
|
4
|
-
import { xss } from "
|
|
4
|
+
import { xss } from "@opentiny/utils";
|
|
5
5
|
import { set } from "../chart-core/deps/utils";
|
|
6
6
|
import { on, off } from "../common/deps/dom";
|
|
7
7
|
import PopupManager from "../common/deps/popup-manager";
|
|
8
|
-
const init = ({
|
|
8
|
+
const init = ({
|
|
9
|
+
api,
|
|
10
|
+
emit,
|
|
11
|
+
props,
|
|
12
|
+
service,
|
|
13
|
+
state,
|
|
14
|
+
FluentEditor,
|
|
15
|
+
UploaderDfls,
|
|
16
|
+
defaultOptions,
|
|
17
|
+
vm,
|
|
18
|
+
useBreakpoint,
|
|
19
|
+
simpleToolbar
|
|
20
|
+
}) => () => {
|
|
21
|
+
var _a;
|
|
9
22
|
UploaderDfls.enableMultiUpload = { file: true, image: true };
|
|
10
23
|
UploaderDfls.handler = api.uploaderDflsHandler;
|
|
11
24
|
UploaderDfls.imagePasteFailCallback = props.imagePasteFailCallback;
|
|
@@ -30,6 +43,7 @@ const init = ({ api, emit, props, service, state, FluentEditor, UploaderDfls, de
|
|
|
30
43
|
if (current.value === "default") {
|
|
31
44
|
state.innerOptions.modules.toolbar = simpleToolbar;
|
|
32
45
|
}
|
|
46
|
+
(_a = props.beforeEditorInit) == null ? void 0 : _a.call(props, FluentEditor);
|
|
33
47
|
const quill = new FluentEditor(vm.$refs.editor, state.innerOptions);
|
|
34
48
|
quill.emitter.on("file-change", api.fileOperationToSev);
|
|
35
49
|
state.quill = Object.freeze(quill);
|
|
@@ -128,7 +142,8 @@ const handleCompositionend = ({ state }) => (event) => {
|
|
|
128
142
|
state.quill.root.classList.add("ql-blank");
|
|
129
143
|
}
|
|
130
144
|
} else {
|
|
131
|
-
let data = state.quill.container.innerHTML
|
|
145
|
+
let data = state.quill.container.innerHTML;
|
|
146
|
+
let range = state.quill.getSelection(true);
|
|
132
147
|
const [mentionItem, offset] = state.quill.getLeaf(range.index);
|
|
133
148
|
if (mentionItem.statics.blotName === "break" || mentionItem.statics.blotName === "text" && offset === 0) {
|
|
134
149
|
state.quill.clipboard.dangerouslyPasteHTML(data);
|
|
@@ -136,7 +151,8 @@ const handleCompositionend = ({ state }) => (event) => {
|
|
|
136
151
|
if (mentionItem.statics.blotName === "break") {
|
|
137
152
|
state.quill.setSelection(range.index + event.data.length);
|
|
138
153
|
} else {
|
|
139
|
-
let pattern = /[\u4E00-\u9FA5\
|
|
154
|
+
let pattern = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
|
|
155
|
+
let flag;
|
|
140
156
|
if (pattern.test(event.data)) {
|
|
141
157
|
flag = true;
|
|
142
158
|
}
|
|
@@ -194,7 +210,7 @@ const inputFileHandler = ({ state, UploaderDfls }) => (type, accept) => {
|
|
|
194
210
|
fileInput.classList.add(`ql-${type}`);
|
|
195
211
|
fileInput.setAttribute("type", "file");
|
|
196
212
|
fileInput.setAttribute("accept", mimeTypes);
|
|
197
|
-
if (UploaderDfls.enableMultiUpload
|
|
213
|
+
if (UploaderDfls.enableMultiUpload.file && type === "file" || UploaderDfls.enableMultiUpload.image && type === "image") {
|
|
198
214
|
fileInput.setAttribute("multiple", "");
|
|
199
215
|
}
|
|
200
216
|
fileInput.onchange = () => {
|
|
@@ -218,7 +234,7 @@ const uploaderDflsHandler = ({ api, modules }) => (range, files, fileFlags, reje
|
|
|
218
234
|
}
|
|
219
235
|
};
|
|
220
236
|
const handleUploadFile = ({ api, UploaderDfls }) => (range, files, hasRejectedFile) => {
|
|
221
|
-
const fileEnableMultiUpload = UploaderDfls.enableMultiUpload === true || UploaderDfls.enableMultiUpload
|
|
237
|
+
const fileEnableMultiUpload = UploaderDfls.enableMultiUpload === true || UploaderDfls.enableMultiUpload.file;
|
|
222
238
|
api.fileOperationToSev({
|
|
223
239
|
operation: "upload",
|
|
224
240
|
data: fileEnableMultiUpload ? { files } : { file: files[0] },
|
|
@@ -325,7 +341,7 @@ const fileOperationToSev = ({ state }) => (event) => {
|
|
|
325
341
|
const handleUploadImage = ({ state, api, FluentEditor, Delta, UploaderDfls }) => (range, { file, files }, hasRejectedImage) => {
|
|
326
342
|
if (state.quill.options.uploadOption.imageUploadToServer) {
|
|
327
343
|
const index = state.promisesData.length;
|
|
328
|
-
const imageEnableMultiUpload = UploaderDfls.enableMultiUpload
|
|
344
|
+
const imageEnableMultiUpload = UploaderDfls.enableMultiUpload.image;
|
|
329
345
|
const result = {
|
|
330
346
|
file,
|
|
331
347
|
data: { files: [file] },
|
|
@@ -359,7 +375,7 @@ const handleUploadImage = ({ state, api, FluentEditor, Delta, UploaderDfls }) =>
|
|
|
359
375
|
}
|
|
360
376
|
};
|
|
361
377
|
if (imageEnableMultiUpload) {
|
|
362
|
-
result
|
|
378
|
+
result.data = { files };
|
|
363
379
|
}
|
|
364
380
|
state.promisesData.push({
|
|
365
381
|
imageEnableMultiUpload
|
|
@@ -587,7 +603,7 @@ const doPreview = ({ props, state, nextTick }) => (elem) => {
|
|
|
587
603
|
}
|
|
588
604
|
};
|
|
589
605
|
const handleDblclick = ({ props, api }) => (e) => {
|
|
590
|
-
if (props.picPreview && e && e.type === "dblclick" && [...e.target.classList].
|
|
606
|
+
if (props.picPreview && e && e.type === "dblclick" && [...e.target.classList].includes("blot-formatter__overlay") && e.target.dataset.image) {
|
|
591
607
|
api.doPreview(e.target);
|
|
592
608
|
}
|
|
593
609
|
};
|
package/form/vue.js
CHANGED
|
@@ -95,7 +95,7 @@ const renderless = (props, { computed, inject, provide, reactive, watch, onBefor
|
|
|
95
95
|
provide("showAutoWidth", state.showAutoWidth);
|
|
96
96
|
const unbindDialogEvent = bindDialogEvent({ api: api2, dialog, state });
|
|
97
97
|
onBeforeUnmount(unbindDialogEvent);
|
|
98
|
-
watch(() => props.rules, api2.watchRules);
|
|
98
|
+
watch(() => props.rules, api2.watchRules, { deep: props.validateOnRuleChange === "deep" });
|
|
99
99
|
return api2;
|
|
100
100
|
};
|
|
101
101
|
export {
|
package/grid/plugins/export.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
|
-
import { xss } from "
|
|
4
|
+
import { xss } from "@opentiny/utils";
|
|
5
5
|
import browser from "../../common/browser";
|
|
6
6
|
import { toTreeArray } from "../static";
|
|
7
7
|
import { getCellValue, getFuncText } from "../utils";
|
package/guide/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
const createShepherd = ({ state, props, Shepherd, offset, designConfig }) => () => {
|
|
4
4
|
const tour = newTour(state, Shepherd, offset, designConfig);
|
|
5
5
|
state.tour = tour;
|
package/image/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { on, off, getScrollContainer, isInContainer } from "../common/deps/dom";
|
|
3
3
|
import { typeOf } from "../common/type";
|
|
4
4
|
import { rafThrottle } from "../image-viewer";
|
|
5
|
-
import { xss } from "
|
|
5
|
+
import { xss } from "@opentiny/utils";
|
|
6
6
|
const isSupportObjectFit = () => document.documentElement.style.objectFit !== void 0;
|
|
7
7
|
const isHtmlElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;
|
|
8
8
|
const computedGetImageStyle = ({ props, api }) => () => {
|
package/image-viewer/index.js
CHANGED
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
import { on, off } from "../common/deps/dom";
|
|
5
5
|
import { KEY_CODE } from "../common";
|
|
6
6
|
import PopupManager from "../common/deps/popup-manager";
|
|
7
|
-
import { xss } from "
|
|
8
|
-
|
|
7
|
+
import { xss } from "@opentiny/utils";
|
|
8
|
+
import { isBrowser } from "../common/browser";
|
|
9
|
+
const isFirefox = () => isBrowser ? !!window.navigator.userAgent.match(/firefox/i) : false;
|
|
9
10
|
const mousewheelEventName = isFirefox() ? "DOMMouseScroll" : "mousewheel";
|
|
10
11
|
const rafThrottle = (fn) => {
|
|
11
12
|
let locked = false;
|
package/input/vue.js
CHANGED
|
@@ -333,6 +333,9 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, onUpdated, re
|
|
|
333
333
|
api2.setShowMoreBtn(true);
|
|
334
334
|
on(window, "resize", api2.setShowMoreBtn);
|
|
335
335
|
}
|
|
336
|
+
if (vm.$attrs.autofocus) {
|
|
337
|
+
api2.focus();
|
|
338
|
+
}
|
|
336
339
|
});
|
|
337
340
|
onBeforeUnmount(() => {
|
|
338
341
|
if (props.type === "textarea" && props.popupMore && state.isDisplayOnly) {
|
package/link/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
import { handleClick } from "./index";
|
|
4
4
|
const api = ["state", "handleClick"];
|
|
5
5
|
const renderless = (props, { inject, reactive, computed }, { emit, parent }) => {
|
package/locales/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
const getLocales = ({ api, service, state }) => () => {
|
|
4
4
|
Promise.all([service.getLocale(), service.getCurrentLocale()]).then(([locales, current]) => {
|
|
5
5
|
state.locales = locales || ["zhCN"];
|
package/logout/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
const logout = ({ service, state, props }) => () => {
|
|
4
4
|
let { isMock, isLocal, redirectUrl = "", getLogoutUrl, showLogin } = service;
|
|
5
5
|
if (typeof props.beforeLogout === "function" && !state.logout) {
|
package/menu/index.js
CHANGED
package/milestone/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../common/browser";
|
|
2
3
|
const hexToRgb = (hex) => {
|
|
3
|
-
if (hex.includes("var")) {
|
|
4
|
+
if (hex.includes("var") && isBrowser) {
|
|
4
5
|
hex = hex.replace(/var\(|\)/g, "");
|
|
5
6
|
hex = getComputedStyle(document.documentElement).getPropertyValue(hex);
|
|
6
7
|
}
|
package/modal/index.js
CHANGED
|
@@ -227,7 +227,6 @@ const close = ({ emit, parent, props, state }) => (type) => {
|
|
|
227
227
|
setTimeout(() => {
|
|
228
228
|
state.visible = false;
|
|
229
229
|
let params = { type, $modal: parent };
|
|
230
|
-
emit("close", params);
|
|
231
230
|
if (events.hide) {
|
|
232
231
|
events.hide.call(parent, params);
|
|
233
232
|
} else {
|