vxe-pc-ui 3.3.36 → 3.3.38
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/es/icon/style.css +1 -1
- package/es/pulldown/src/pulldown.js +2 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +1 -0
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +288 -74
- package/es/upload/style.css +38 -2
- package/es/upload/style.min.css +1 -1
- package/es/vxe-upload/style.css +38 -2
- package/es/vxe-upload/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +270 -52
- package/lib/index.umd.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +6 -0
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +2 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +257 -47
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +38 -2
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +38 -2
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/pulldown/src/pulldown.ts +3 -1
- package/packages/ui/src/dom.ts +2 -0
- package/packages/upload/src/upload.ts +306 -75
- package/styles/components/upload.scss +34 -2
- package/types/components/pulldown.d.ts +9 -1
- package/types/components/table.d.ts +4 -0
- package/types/components/upload.d.ts +10 -2
- /package/es/icon/{iconfont.1734331066100.ttf → iconfont.1734402650511.ttf} +0 -0
- /package/es/icon/{iconfont.1734331066100.woff → iconfont.1734402650511.woff} +0 -0
- /package/es/icon/{iconfont.1734331066100.woff2 → iconfont.1734402650511.woff2} +0 -0
- /package/es/{iconfont.1734331066100.ttf → iconfont.1734402650511.ttf} +0 -0
- /package/es/{iconfont.1734331066100.woff → iconfont.1734402650511.woff} +0 -0
- /package/es/{iconfont.1734331066100.woff2 → iconfont.1734402650511.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1734331066100.ttf → iconfont.1734402650511.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1734331066100.woff → iconfont.1734402650511.woff} +0 -0
- /package/lib/icon/style/{iconfont.1734331066100.woff2 → iconfont.1734402650511.woff2} +0 -0
- /package/lib/{iconfont.1734331066100.ttf → iconfont.1734402650511.ttf} +0 -0
- /package/lib/{iconfont.1734331066100.woff → iconfont.1734402650511.woff} +0 -0
- /package/lib/{iconfont.1734331066100.woff2 → iconfont.1734402650511.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -10355,7 +10355,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
10355
10355
|
GLOBAL_EVENT_KEYS: function() { return /* reexport */ GLOBAL_EVENT_KEYS; },
|
|
10356
10356
|
Icon: function() { return /* reexport */ Icon; },
|
|
10357
10357
|
IconPicker: function() { return /* reexport */ IconPicker; },
|
|
10358
|
-
Image: function() { return /* reexport */
|
|
10358
|
+
Image: function() { return /* reexport */ image_Image; },
|
|
10359
10359
|
ImageGroup: function() { return /* reexport */ ImageGroup; },
|
|
10360
10360
|
ImagePreview: function() { return /* reexport */ ImagePreview; },
|
|
10361
10361
|
Input: function() { return /* reexport */ Input; },
|
|
@@ -10564,7 +10564,7 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
10564
10564
|
GLOBAL_EVENT_KEYS: function() { return GLOBAL_EVENT_KEYS; },
|
|
10565
10565
|
Icon: function() { return Icon; },
|
|
10566
10566
|
IconPicker: function() { return IconPicker; },
|
|
10567
|
-
Image: function() { return
|
|
10567
|
+
Image: function() { return image_Image; },
|
|
10568
10568
|
ImageGroup: function() { return ImageGroup; },
|
|
10569
10569
|
ImagePreview: function() { return ImagePreview; },
|
|
10570
10570
|
Input: function() { return Input; },
|
|
@@ -12859,7 +12859,7 @@ function handleBooleanDefaultValue(value) {
|
|
|
12859
12859
|
}
|
|
12860
12860
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
12861
12861
|
|
|
12862
|
-
var log_version = "ui v".concat("3.3.
|
|
12862
|
+
var log_version = "ui v".concat("3.3.38");
|
|
12863
12863
|
var warnLog = log.create('warn', log_version);
|
|
12864
12864
|
var errLog = log.create('error', log_version);
|
|
12865
12865
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
@@ -12867,7 +12867,7 @@ var errLog = log.create('error', log_version);
|
|
|
12867
12867
|
|
|
12868
12868
|
|
|
12869
12869
|
|
|
12870
|
-
var ui_version = "3.3.
|
|
12870
|
+
var ui_version = "3.3.38";
|
|
12871
12871
|
index_esm_VxeUI.version = ui_version;
|
|
12872
12872
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
12873
12873
|
index_esm_VxeUI.tableVersion = '';
|
|
@@ -13534,6 +13534,7 @@ var es_string_match = __webpack_require__(1761);
|
|
|
13534
13534
|
|
|
13535
13535
|
|
|
13536
13536
|
var dom_browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
13537
|
+
var tpImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
|
|
13537
13538
|
var reClsMap = {};
|
|
13538
13539
|
function getClsRE(cls) {
|
|
13539
13540
|
if (!reClsMap[cls]) {
|
|
@@ -27197,7 +27198,7 @@ var VxeImage = Object.assign({}, src_image, {
|
|
|
27197
27198
|
});
|
|
27198
27199
|
dynamicApp.use(VxeImage);
|
|
27199
27200
|
index_esm_VxeUI.component(src_image);
|
|
27200
|
-
var
|
|
27201
|
+
var image_Image = VxeImage;
|
|
27201
27202
|
/* harmony default export */ var packages_image = (VxeImage);
|
|
27202
27203
|
;// CONCATENATED MODULE: ./packages/image/src/group.ts
|
|
27203
27204
|
|
|
@@ -38434,6 +38435,9 @@ var Print = VxePrint;
|
|
|
38434
38435
|
}, 40);
|
|
38435
38436
|
}, 10);
|
|
38436
38437
|
$xePulldown.updateZindex();
|
|
38438
|
+
$xePulldown.dispatchEvent('visible-change', {
|
|
38439
|
+
visible: true
|
|
38440
|
+
}, null);
|
|
38437
38441
|
} else {
|
|
38438
38442
|
$xePulldown.$nextTick(function () {
|
|
38439
38443
|
resolve();
|
|
@@ -38449,6 +38453,9 @@ var Print = VxePrint;
|
|
|
38449
38453
|
var reactData = $xePulldown.reactData;
|
|
38450
38454
|
var internalData = $xePulldown.internalData;
|
|
38451
38455
|
reactData.visiblePanel = false;
|
|
38456
|
+
$xePulldown.dispatchEvent('visible-change', {
|
|
38457
|
+
visible: false
|
|
38458
|
+
}, null);
|
|
38452
38459
|
$xePulldown.emitModel(false);
|
|
38453
38460
|
return new Promise(function (resolve) {
|
|
38454
38461
|
if (reactData.isAniVisible) {
|
|
@@ -45353,6 +45360,7 @@ var saveLocalFile = function saveLocalFile(options) {
|
|
|
45353
45360
|
|
|
45354
45361
|
|
|
45355
45362
|
|
|
45363
|
+
|
|
45356
45364
|
|
|
45357
45365
|
|
|
45358
45366
|
function getUniqueKey() {
|
|
@@ -45368,6 +45376,41 @@ function handleTransferFiles(items) {
|
|
|
45368
45376
|
});
|
|
45369
45377
|
return files;
|
|
45370
45378
|
}
|
|
45379
|
+
function showDropTip($xeUpload, evnt, dragEl, dragPos) {
|
|
45380
|
+
var xID = $xeUpload.xID;
|
|
45381
|
+
var reactData = $xeUpload.reactData;
|
|
45382
|
+
var showMorePopup = reactData.showMorePopup;
|
|
45383
|
+
var el = $xeUpload.$refs.refElem;
|
|
45384
|
+
var popupEl = document.getElementById("refPopupElem".concat(xID));
|
|
45385
|
+
var wrapperEl = showMorePopup ? popupEl : el;
|
|
45386
|
+
if (!wrapperEl) {
|
|
45387
|
+
return;
|
|
45388
|
+
}
|
|
45389
|
+
var wrapperRect = wrapperEl.getBoundingClientRect();
|
|
45390
|
+
var ddLineEl = $xeUpload.$refs.refDragLineElem;
|
|
45391
|
+
var mdLineEl = document.getElementById("refModalDragLineElem".concat(xID));
|
|
45392
|
+
var currDLineEl = showMorePopup ? mdLineEl : ddLineEl;
|
|
45393
|
+
if (currDLineEl) {
|
|
45394
|
+
var dragRect = dragEl.getBoundingClientRect();
|
|
45395
|
+
currDLineEl.style.display = 'block';
|
|
45396
|
+
currDLineEl.style.top = "".concat(Math.max(1, dragRect.y - wrapperRect.y), "px");
|
|
45397
|
+
currDLineEl.style.left = "".concat(Math.max(1, dragRect.x - wrapperRect.x), "px");
|
|
45398
|
+
currDLineEl.style.height = "".concat(dragRect.height, "px");
|
|
45399
|
+
currDLineEl.style.width = "".concat(dragRect.width - 1, "px");
|
|
45400
|
+
currDLineEl.setAttribute('drag-pos', dragPos);
|
|
45401
|
+
}
|
|
45402
|
+
}
|
|
45403
|
+
function hideDropTip($xeUpload) {
|
|
45404
|
+
var xID = $xeUpload.xID;
|
|
45405
|
+
var ddLineEl = $xeUpload.$refs.refDragLineElem;
|
|
45406
|
+
var mdLineEl = document.getElementById("refModalDragLineElem".concat(xID));
|
|
45407
|
+
if (ddLineEl) {
|
|
45408
|
+
ddLineEl.style.display = '';
|
|
45409
|
+
}
|
|
45410
|
+
if (mdLineEl) {
|
|
45411
|
+
mdLineEl.style.display = '';
|
|
45412
|
+
}
|
|
45413
|
+
}
|
|
45371
45414
|
/* harmony default export */ var upload = (defineVxeComponent({
|
|
45372
45415
|
name: 'VxeUpload',
|
|
45373
45416
|
model: {
|
|
@@ -45426,6 +45469,7 @@ function handleTransferFiles(items) {
|
|
|
45426
45469
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(getConfig().upload.fileTypes, true);
|
|
45427
45470
|
}
|
|
45428
45471
|
},
|
|
45472
|
+
dragSort: Boolean,
|
|
45429
45473
|
dragToUpload: {
|
|
45430
45474
|
type: Boolean,
|
|
45431
45475
|
default: function _default() {
|
|
@@ -45579,14 +45623,19 @@ function handleTransferFiles(items) {
|
|
|
45579
45623
|
data: function data() {
|
|
45580
45624
|
var xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
45581
45625
|
var reactData = {
|
|
45582
|
-
|
|
45626
|
+
isDragUploadStatus: false,
|
|
45583
45627
|
showMorePopup: false,
|
|
45584
45628
|
isActivated: false,
|
|
45585
45629
|
fileList: [],
|
|
45586
|
-
fileCacheMaps: {}
|
|
45630
|
+
fileCacheMaps: {},
|
|
45631
|
+
isDragMove: false,
|
|
45632
|
+
dragIndex: -1,
|
|
45633
|
+
dragTipText: ''
|
|
45587
45634
|
};
|
|
45588
45635
|
var internalData = {
|
|
45589
|
-
imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif']
|
|
45636
|
+
imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif'],
|
|
45637
|
+
prevDragIndex: -1
|
|
45638
|
+
// prevDragPos: ''
|
|
45590
45639
|
};
|
|
45591
45640
|
return {
|
|
45592
45641
|
xID: xID,
|
|
@@ -46224,7 +46273,7 @@ function handleTransferFiles(items) {
|
|
|
46224
46273
|
}
|
|
46225
46274
|
});
|
|
46226
46275
|
},
|
|
46227
|
-
|
|
46276
|
+
handleUploadDragleaveEvent: function handleUploadDragleaveEvent(evnt) {
|
|
46228
46277
|
var $xeUpload = this;
|
|
46229
46278
|
var reactData = $xeUpload.reactData;
|
|
46230
46279
|
var targetElem = evnt.currentTarget;
|
|
@@ -46237,11 +46286,11 @@ function handleTransferFiles(items) {
|
|
|
46237
46286
|
targetHeight = _targetElem$getBoundi.height,
|
|
46238
46287
|
targetWidth = _targetElem$getBoundi.width;
|
|
46239
46288
|
if (clientX < targetX || clientX > targetX + targetWidth || clientY < targetY || clientY > targetY + targetHeight) {
|
|
46240
|
-
reactData.
|
|
46289
|
+
reactData.isDragUploadStatus = false;
|
|
46241
46290
|
}
|
|
46242
46291
|
}
|
|
46243
46292
|
},
|
|
46244
|
-
|
|
46293
|
+
handleUploadDragoverEvent: function handleUploadDragoverEvent(evnt) {
|
|
46245
46294
|
var $xeUpload = this;
|
|
46246
46295
|
var reactData = $xeUpload.reactData;
|
|
46247
46296
|
var dataTransfer = evnt.dataTransfer;
|
|
@@ -46249,7 +46298,7 @@ function handleTransferFiles(items) {
|
|
|
46249
46298
|
var items = dataTransfer.items;
|
|
46250
46299
|
if (items && items.length) {
|
|
46251
46300
|
evnt.preventDefault();
|
|
46252
|
-
reactData.
|
|
46301
|
+
reactData.isDragUploadStatus = true;
|
|
46253
46302
|
}
|
|
46254
46303
|
}
|
|
46255
46304
|
},
|
|
@@ -46285,7 +46334,7 @@ function handleTransferFiles(items) {
|
|
|
46285
46334
|
}
|
|
46286
46335
|
$xeUpload.uploadFile(files, evnt);
|
|
46287
46336
|
},
|
|
46288
|
-
|
|
46337
|
+
handleUploadDropEvent: function handleUploadDropEvent(evnt) {
|
|
46289
46338
|
var $xeUpload = this;
|
|
46290
46339
|
var reactData = $xeUpload.reactData;
|
|
46291
46340
|
var dataTransfer = evnt.dataTransfer;
|
|
@@ -46299,12 +46348,13 @@ function handleTransferFiles(items) {
|
|
|
46299
46348
|
}
|
|
46300
46349
|
}
|
|
46301
46350
|
}
|
|
46302
|
-
reactData.
|
|
46351
|
+
reactData.isDragUploadStatus = false;
|
|
46303
46352
|
},
|
|
46304
46353
|
handleMoreEvent: function handleMoreEvent() {
|
|
46305
46354
|
var $xeUpload = this;
|
|
46306
46355
|
var props = $xeUpload;
|
|
46307
46356
|
var reactData = $xeUpload.reactData;
|
|
46357
|
+
var xID = $xeUpload.xID;
|
|
46308
46358
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46309
46359
|
var isImage = $xeUpload.computeIsImage;
|
|
46310
46360
|
if (index_esm_VxeUI.modal) {
|
|
@@ -46319,44 +46369,154 @@ function handleTransferFiles(items) {
|
|
|
46319
46369
|
slots: {
|
|
46320
46370
|
default: function _default(params, h) {
|
|
46321
46371
|
var showErrorStatus = props.showErrorStatus,
|
|
46322
|
-
dragToUpload = props.dragToUpload
|
|
46323
|
-
|
|
46324
|
-
var
|
|
46372
|
+
dragToUpload = props.dragToUpload,
|
|
46373
|
+
dragSort = props.dragSort;
|
|
46374
|
+
var isDragMove = reactData.isDragMove,
|
|
46375
|
+
isDragUploadStatus = reactData.isDragUploadStatus,
|
|
46376
|
+
dragIndex = reactData.dragIndex;
|
|
46325
46377
|
var fileList = reactData.fileList;
|
|
46378
|
+
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46326
46379
|
var ons = {};
|
|
46327
|
-
if (dragToUpload) {
|
|
46328
|
-
ons.dragover = $xeUpload.
|
|
46329
|
-
ons.dragleave = $xeUpload.
|
|
46330
|
-
ons.drop = $xeUpload.
|
|
46380
|
+
if (dragToUpload && dragIndex === -1) {
|
|
46381
|
+
ons.dragover = $xeUpload.handleUploadDragoverEvent;
|
|
46382
|
+
ons.dragleave = $xeUpload.handleUploadDragleaveEvent;
|
|
46383
|
+
ons.drop = $xeUpload.handleUploadDropEvent;
|
|
46331
46384
|
}
|
|
46332
46385
|
return h('div', {
|
|
46386
|
+
attrs: {
|
|
46387
|
+
id: "refPopupElem".concat(xID)
|
|
46388
|
+
},
|
|
46333
46389
|
class: ['vxe-upload--more-popup', {
|
|
46334
46390
|
'is--readonly': formReadonly,
|
|
46335
46391
|
'is--disabled': isDisabled,
|
|
46336
46392
|
'show--error': showErrorStatus,
|
|
46337
|
-
'is--drag':
|
|
46393
|
+
'is--drag': isDragUploadStatus
|
|
46338
46394
|
}],
|
|
46339
46395
|
on: ons
|
|
46340
|
-
}, [isImage ? h('
|
|
46396
|
+
}, [isImage ? dragSort ? h('transition-group', {
|
|
46397
|
+
props: {
|
|
46398
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46399
|
+
tag: 'div'
|
|
46400
|
+
},
|
|
46401
|
+
class: 'vxe-upload--image-more-list'
|
|
46402
|
+
}, $xeUpload.renderImageItemList(h, fileList, true).concat($xeUpload.renderImageAction(h, true))) : h('div', {
|
|
46341
46403
|
class: 'vxe-upload--image-more-list'
|
|
46342
46404
|
}, $xeUpload.renderImageItemList(h, fileList, true).concat($xeUpload.renderImageAction(h, true))) : h('div', {
|
|
46343
46405
|
class: 'vxe-upload--file-more-list'
|
|
46344
|
-
}, [$xeUpload.renderFileAction(h, true), h('
|
|
46406
|
+
}, [$xeUpload.renderFileAction(h, true), dragSort ? h('transition-group', {
|
|
46407
|
+
props: {
|
|
46408
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46409
|
+
tag: 'div'
|
|
46410
|
+
},
|
|
46411
|
+
class: 'vxe-upload--file-list'
|
|
46412
|
+
}, $xeUpload.renderFileItemList(h, fileList, true)) : h('div', {
|
|
46345
46413
|
class: 'vxe-upload--file-list'
|
|
46346
|
-
}, $xeUpload.renderFileItemList(h, fileList, true))]),
|
|
46414
|
+
}, $xeUpload.renderFileItemList(h, fileList, true))]), dragSort ? h('div', {
|
|
46415
|
+
attrs: {
|
|
46416
|
+
id: "refModalDragLineElem".concat(xID)
|
|
46417
|
+
},
|
|
46418
|
+
class: 'vxe-upload--drag-line'
|
|
46419
|
+
}) : renderEmptyElement($xeUpload), isDragUploadStatus ? h('div', {
|
|
46347
46420
|
class: 'vxe-upload--drag-placeholder'
|
|
46348
46421
|
}, getI18n('vxe.upload.dragPlaceholder')) : renderEmptyElement($xeUpload)]);
|
|
46349
46422
|
}
|
|
46350
46423
|
},
|
|
46351
|
-
|
|
46352
|
-
|
|
46353
|
-
|
|
46354
|
-
|
|
46355
|
-
|
|
46424
|
+
events: {
|
|
46425
|
+
show: function show() {
|
|
46426
|
+
reactData.showMorePopup = true;
|
|
46427
|
+
},
|
|
46428
|
+
hide: function hide() {
|
|
46429
|
+
reactData.showMorePopup = false;
|
|
46430
|
+
}
|
|
46356
46431
|
}
|
|
46357
46432
|
});
|
|
46358
46433
|
}
|
|
46359
46434
|
},
|
|
46435
|
+
// 拖拽
|
|
46436
|
+
handleDragSortDragstartEvent: function handleDragSortDragstartEvent(evnt) {
|
|
46437
|
+
var $xeUpload = this;
|
|
46438
|
+
var reactData = $xeUpload.reactData;
|
|
46439
|
+
if (evnt.dataTransfer) {
|
|
46440
|
+
var img = new Image();
|
|
46441
|
+
img.src = tpImg;
|
|
46442
|
+
evnt.dataTransfer.setDragImage(img, 0, 0);
|
|
46443
|
+
}
|
|
46444
|
+
var dragEl = evnt.currentTarget;
|
|
46445
|
+
var parentEl = dragEl.parentElement;
|
|
46446
|
+
var dragIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(Array.from(parentEl.children), function (item) {
|
|
46447
|
+
return dragEl === item;
|
|
46448
|
+
});
|
|
46449
|
+
reactData.isDragMove = true;
|
|
46450
|
+
reactData.dragIndex = dragIndex;
|
|
46451
|
+
setTimeout(function () {
|
|
46452
|
+
reactData.isDragMove = false;
|
|
46453
|
+
}, 500);
|
|
46454
|
+
},
|
|
46455
|
+
handleDragSortDragoverEvent: function handleDragSortDragoverEvent(evnt) {
|
|
46456
|
+
var $xeUpload = this;
|
|
46457
|
+
var reactData = $xeUpload.reactData;
|
|
46458
|
+
var internalData = $xeUpload.internalData;
|
|
46459
|
+
evnt.preventDefault();
|
|
46460
|
+
var dragIndex = reactData.dragIndex;
|
|
46461
|
+
if (dragIndex === -1) {
|
|
46462
|
+
return;
|
|
46463
|
+
}
|
|
46464
|
+
var isImage = $xeUpload.computeIsImage;
|
|
46465
|
+
var dragEl = evnt.currentTarget;
|
|
46466
|
+
var parentEl = dragEl.parentElement;
|
|
46467
|
+
var currIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(Array.from(parentEl.children), function (item) {
|
|
46468
|
+
return dragEl === item;
|
|
46469
|
+
});
|
|
46470
|
+
var dragPos = '';
|
|
46471
|
+
if (isImage) {
|
|
46472
|
+
var offsetX = evnt.clientX - dragEl.getBoundingClientRect().x;
|
|
46473
|
+
dragPos = offsetX < dragEl.clientWidth / 2 ? 'left' : 'right';
|
|
46474
|
+
} else {
|
|
46475
|
+
var offsetY = evnt.clientY - dragEl.getBoundingClientRect().y;
|
|
46476
|
+
dragPos = offsetY < dragEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
46477
|
+
}
|
|
46478
|
+
if (dragIndex === currIndex) {
|
|
46479
|
+
showDropTip($xeUpload, evnt, dragEl, dragPos);
|
|
46480
|
+
return;
|
|
46481
|
+
}
|
|
46482
|
+
showDropTip($xeUpload, evnt, dragEl, dragPos);
|
|
46483
|
+
internalData.prevDragIndex = currIndex;
|
|
46484
|
+
internalData.prevDragPos = dragPos;
|
|
46485
|
+
},
|
|
46486
|
+
handleDragSortDragendEvent: function handleDragSortDragendEvent(evnt) {
|
|
46487
|
+
var $xeUpload = this;
|
|
46488
|
+
var reactData = $xeUpload.reactData;
|
|
46489
|
+
var internalData = $xeUpload.internalData;
|
|
46490
|
+
var fileList = reactData.fileList,
|
|
46491
|
+
dragIndex = reactData.dragIndex;
|
|
46492
|
+
var prevDragIndex = internalData.prevDragIndex,
|
|
46493
|
+
prevDragPos = internalData.prevDragPos;
|
|
46494
|
+
var oldIndex = dragIndex;
|
|
46495
|
+
var targetIndex = prevDragIndex;
|
|
46496
|
+
var dragOffsetIndex = prevDragPos === 'bottom' || prevDragPos === 'right' ? 1 : 0;
|
|
46497
|
+
var oldItem = fileList[oldIndex];
|
|
46498
|
+
var newItem = fileList[targetIndex];
|
|
46499
|
+
if (oldItem && newItem) {
|
|
46500
|
+
fileList.splice(oldIndex, 1);
|
|
46501
|
+
var ptfIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(fileList, function (item) {
|
|
46502
|
+
return newItem === item;
|
|
46503
|
+
});
|
|
46504
|
+
var nIndex = ptfIndex + dragOffsetIndex;
|
|
46505
|
+
fileList.splice(nIndex, 0, oldItem);
|
|
46506
|
+
$xeUpload.dispatchEvent('sort-dragend', {
|
|
46507
|
+
oldItem: oldItem,
|
|
46508
|
+
newItem: newItem,
|
|
46509
|
+
dragPos: prevDragPos,
|
|
46510
|
+
offsetIndex: dragOffsetIndex,
|
|
46511
|
+
_index: {
|
|
46512
|
+
newIndex: nIndex,
|
|
46513
|
+
oldIndex: oldIndex
|
|
46514
|
+
}
|
|
46515
|
+
}, evnt);
|
|
46516
|
+
}
|
|
46517
|
+
hideDropTip($xeUpload);
|
|
46518
|
+
reactData.dragIndex = -1;
|
|
46519
|
+
},
|
|
46360
46520
|
handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
|
|
46361
46521
|
var $xeUpload = this;
|
|
46362
46522
|
var props = $xeUpload;
|
|
@@ -46405,25 +46565,37 @@ function handleTransferFiles(items) {
|
|
|
46405
46565
|
showProgress = props.showProgress,
|
|
46406
46566
|
progressText = props.progressText,
|
|
46407
46567
|
showPreview = props.showPreview,
|
|
46408
|
-
showErrorStatus = props.showErrorStatus
|
|
46568
|
+
showErrorStatus = props.showErrorStatus,
|
|
46569
|
+
dragSort = props.dragSort;
|
|
46409
46570
|
var fileCacheMaps = reactData.fileCacheMaps;
|
|
46410
46571
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46411
46572
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46412
46573
|
var nameProp = $xeUpload.computeNameProp;
|
|
46413
46574
|
var typeProp = $xeUpload.computeTypeProp;
|
|
46414
46575
|
var cornerSlot = slots.corner;
|
|
46576
|
+
var ons = {};
|
|
46577
|
+
if (dragSort) {
|
|
46578
|
+
ons.dragstart = $xeUpload.handleDragSortDragstartEvent;
|
|
46579
|
+
ons.dragover = $xeUpload.handleDragSortDragoverEvent;
|
|
46580
|
+
ons.dragend = $xeUpload.handleDragSortDragendEvent;
|
|
46581
|
+
}
|
|
46415
46582
|
return currList.map(function (item, index) {
|
|
46416
46583
|
var fileKey = $xeUpload.getFieldKey(item);
|
|
46417
46584
|
var cacheItem = fileCacheMaps[fileKey];
|
|
46418
46585
|
var isLoading = cacheItem && cacheItem.loading;
|
|
46419
46586
|
var isError = cacheItem && cacheItem.status === 'error';
|
|
46420
46587
|
return h('div', {
|
|
46421
|
-
key: index,
|
|
46588
|
+
key: dragSort ? fileKey : index,
|
|
46422
46589
|
class: ['vxe-upload--file-item', {
|
|
46423
46590
|
'is--preview': showPreview,
|
|
46424
46591
|
'is--loading': isLoading,
|
|
46425
46592
|
'is--error': isError
|
|
46426
|
-
}]
|
|
46593
|
+
}],
|
|
46594
|
+
attrs: {
|
|
46595
|
+
fileid: fileKey,
|
|
46596
|
+
draggable: dragSort ? true : null
|
|
46597
|
+
},
|
|
46598
|
+
on: ons
|
|
46427
46599
|
}, [h('div', {
|
|
46428
46600
|
class: 'vxe-upload--file-item-icon'
|
|
46429
46601
|
}, [h('i', {
|
|
@@ -46533,8 +46705,10 @@ function handleTransferFiles(items) {
|
|
|
46533
46705
|
var $xeUpload = this;
|
|
46534
46706
|
var props = $xeUpload;
|
|
46535
46707
|
var reactData = $xeUpload.reactData;
|
|
46536
|
-
var moreConfig = props.moreConfig
|
|
46537
|
-
|
|
46708
|
+
var moreConfig = props.moreConfig,
|
|
46709
|
+
dragSort = props.dragSort;
|
|
46710
|
+
var fileList = reactData.fileList,
|
|
46711
|
+
isDragMove = reactData.isDragMove;
|
|
46538
46712
|
var moreOpts = $xeUpload.computeMoreOpts;
|
|
46539
46713
|
var maxCount = moreOpts.maxCount,
|
|
46540
46714
|
showMoreButton = moreOpts.showMoreButton,
|
|
@@ -46553,7 +46727,13 @@ function handleTransferFiles(items) {
|
|
|
46553
46727
|
class: ['vxe-upload--file-list-wrapper', {
|
|
46554
46728
|
'is--horizontal': isHorizontal
|
|
46555
46729
|
}]
|
|
46556
|
-
}, [currList.length ? h('
|
|
46730
|
+
}, [currList.length ? dragSort ? h('transition-group', {
|
|
46731
|
+
attrs: {
|
|
46732
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46733
|
+
tag: 'div'
|
|
46734
|
+
},
|
|
46735
|
+
class: 'vxe-upload--file-list'
|
|
46736
|
+
}, $xeUpload.renderFileItemList(h, currList, false)) : h('div', {
|
|
46557
46737
|
class: 'vxe-upload--file-list'
|
|
46558
46738
|
}, $xeUpload.renderFileItemList(h, currList, false)) : renderEmptyElement($xeUpload), showMoreButton && overMaxNum ? h('div', {
|
|
46559
46739
|
class: 'vxe-upload--file-over-more'
|
|
@@ -46577,26 +46757,38 @@ function handleTransferFiles(items) {
|
|
|
46577
46757
|
showProgress = props.showProgress,
|
|
46578
46758
|
progressText = props.progressText,
|
|
46579
46759
|
showPreview = props.showPreview,
|
|
46580
|
-
showErrorStatus = props.showErrorStatus
|
|
46760
|
+
showErrorStatus = props.showErrorStatus,
|
|
46761
|
+
dragSort = props.dragSort;
|
|
46581
46762
|
var fileCacheMaps = reactData.fileCacheMaps;
|
|
46582
46763
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46583
46764
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46584
46765
|
var imageOpts = $xeUpload.computeImageOpts;
|
|
46585
46766
|
var imgStyle = $xeUpload.computeImgStyle;
|
|
46586
46767
|
var cornerSlot = slots.corner;
|
|
46768
|
+
var ons = {};
|
|
46769
|
+
if (dragSort) {
|
|
46770
|
+
ons.dragstart = $xeUpload.handleDragSortDragstartEvent;
|
|
46771
|
+
ons.dragover = $xeUpload.handleDragSortDragoverEvent;
|
|
46772
|
+
ons.dragend = $xeUpload.handleDragSortDragendEvent;
|
|
46773
|
+
}
|
|
46587
46774
|
return currList.map(function (item, index) {
|
|
46588
46775
|
var fileKey = $xeUpload.getFieldKey(item);
|
|
46589
46776
|
var cacheItem = fileCacheMaps[fileKey];
|
|
46590
46777
|
var isLoading = cacheItem && cacheItem.loading;
|
|
46591
46778
|
var isError = cacheItem && cacheItem.status === 'error';
|
|
46592
46779
|
return h('div', {
|
|
46593
|
-
key: index,
|
|
46780
|
+
key: dragSort ? fileKey : index,
|
|
46594
46781
|
class: ['vxe-upload--image-item', {
|
|
46595
46782
|
'is--preview': showPreview,
|
|
46596
46783
|
'is--circle': imageOpts.circle,
|
|
46597
46784
|
'is--loading': isLoading,
|
|
46598
46785
|
'is--error': isError
|
|
46599
|
-
}]
|
|
46786
|
+
}],
|
|
46787
|
+
attrs: {
|
|
46788
|
+
fileid: fileKey,
|
|
46789
|
+
draggable: dragSort ? true : null
|
|
46790
|
+
},
|
|
46791
|
+
on: ons
|
|
46600
46792
|
}, [h('div', {
|
|
46601
46793
|
class: 'vxe-upload--image-item-box',
|
|
46602
46794
|
style: isMoreView ? {} : imgStyle,
|
|
@@ -46713,8 +46905,11 @@ function handleTransferFiles(items) {
|
|
|
46713
46905
|
},
|
|
46714
46906
|
renderImageMode: function renderImageMode(h) {
|
|
46715
46907
|
var $xeUpload = this;
|
|
46908
|
+
var props = $xeUpload;
|
|
46716
46909
|
var reactData = $xeUpload.reactData;
|
|
46717
|
-
var
|
|
46910
|
+
var dragSort = props.dragSort;
|
|
46911
|
+
var fileList = reactData.fileList,
|
|
46912
|
+
isDragMove = reactData.isDragMove;
|
|
46718
46913
|
var moreOpts = $xeUpload.computeMoreOpts;
|
|
46719
46914
|
var maxCount = moreOpts.maxCount,
|
|
46720
46915
|
showMoreButton = moreOpts.showMoreButton;
|
|
@@ -46727,7 +46922,25 @@ function handleTransferFiles(items) {
|
|
|
46727
46922
|
return h('div', {
|
|
46728
46923
|
key: 'image',
|
|
46729
46924
|
class: 'vxe-upload--image-wrapper'
|
|
46730
|
-
}, [h('
|
|
46925
|
+
}, [dragSort ? h('transition-group', {
|
|
46926
|
+
attrs: {
|
|
46927
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46928
|
+
tag: 'div'
|
|
46929
|
+
},
|
|
46930
|
+
class: 'vxe-upload--image-list'
|
|
46931
|
+
}, $xeUpload.renderImageItemList(h, currList, false).concat([showMoreButton && overMaxNum ? h('div', {
|
|
46932
|
+
key: 'om',
|
|
46933
|
+
class: 'vxe-upload--image-over-more'
|
|
46934
|
+
}, [h(src_button, {
|
|
46935
|
+
props: {
|
|
46936
|
+
mode: 'text',
|
|
46937
|
+
content: getI18n('vxe.upload.moreBtnText', [fileList.length]),
|
|
46938
|
+
status: 'primary'
|
|
46939
|
+
},
|
|
46940
|
+
on: {
|
|
46941
|
+
click: $xeUpload.handleMoreEvent
|
|
46942
|
+
}
|
|
46943
|
+
})]) : renderEmptyElement($xeUpload), $xeUpload.renderImageAction(h, false)])) : h('div', {
|
|
46731
46944
|
class: 'vxe-upload--image-list'
|
|
46732
46945
|
}, $xeUpload.renderImageItemList(h, currList, false).concat([showMoreButton && overMaxNum ? h('div', {
|
|
46733
46946
|
class: 'vxe-upload--image-over-more'
|
|
@@ -46748,25 +46961,30 @@ function handleTransferFiles(items) {
|
|
|
46748
46961
|
var reactData = $xeUpload.reactData;
|
|
46749
46962
|
var showErrorStatus = props.showErrorStatus,
|
|
46750
46963
|
dragToUpload = props.dragToUpload,
|
|
46751
|
-
pasteToUpload = props.pasteToUpload
|
|
46752
|
-
|
|
46964
|
+
pasteToUpload = props.pasteToUpload,
|
|
46965
|
+
dragSort = props.dragSort;
|
|
46966
|
+
var isDragUploadStatus = reactData.isDragUploadStatus,
|
|
46753
46967
|
showMorePopup = reactData.showMorePopup,
|
|
46754
|
-
isActivated = reactData.isActivated
|
|
46968
|
+
isActivated = reactData.isActivated,
|
|
46969
|
+
dragIndex = reactData.dragIndex;
|
|
46755
46970
|
var vSize = $xeUpload.computeSize;
|
|
46756
46971
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46757
46972
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46758
46973
|
var isImage = $xeUpload.computeIsImage;
|
|
46759
46974
|
var ons = {};
|
|
46760
|
-
if (dragToUpload) {
|
|
46761
|
-
ons.dragover = $xeUpload.
|
|
46762
|
-
ons.dragleave = $xeUpload.
|
|
46763
|
-
ons.drop = $xeUpload.
|
|
46975
|
+
if (dragToUpload && dragIndex === -1) {
|
|
46976
|
+
ons.dragover = $xeUpload.handleUploadDragoverEvent;
|
|
46977
|
+
ons.dragleave = $xeUpload.handleUploadDragleaveEvent;
|
|
46978
|
+
ons.drop = $xeUpload.handleUploadDropEvent;
|
|
46764
46979
|
}
|
|
46765
46980
|
return h('div', {
|
|
46766
46981
|
ref: 'refElem',
|
|
46767
|
-
class: ['vxe-upload', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--active', isActivated), 'is--readonly', formReadonly), 'is--disabled', isDisabled), 'is--paste', pasteToUpload), 'show--error', showErrorStatus), 'is--drag',
|
|
46982
|
+
class: ['vxe-upload', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--active', isActivated), 'is--readonly', formReadonly), 'is--disabled', isDisabled), 'is--paste', pasteToUpload), 'show--error', showErrorStatus), 'is--drag', isDragUploadStatus)],
|
|
46768
46983
|
on: ons
|
|
46769
|
-
}, [isImage ? $xeUpload.renderImageMode(h) : $xeUpload.renderAllMode(h),
|
|
46984
|
+
}, [isImage ? $xeUpload.renderImageMode(h) : $xeUpload.renderAllMode(h), dragSort ? h('div', {
|
|
46985
|
+
ref: 'refDragLineElem',
|
|
46986
|
+
class: 'vxe-upload--drag-line'
|
|
46987
|
+
}) : renderEmptyElement($xeUpload), isDragUploadStatus && !showMorePopup ? h('div', {
|
|
46770
46988
|
class: 'vxe-upload--drag-placeholder'
|
|
46771
46989
|
}, getI18n('vxe.upload.dragPlaceholder')) : renderEmptyElement($xeUpload)]);
|
|
46772
46990
|
}
|
|
@@ -46783,7 +47001,7 @@ function handleTransferFiles(items) {
|
|
|
46783
47001
|
errLog('vxe.error.errConflicts', ['multiple', 'single-mode']);
|
|
46784
47002
|
}
|
|
46785
47003
|
if (props.imageStyle) {
|
|
46786
|
-
|
|
47004
|
+
warnLog('vxe.error.delProp', ['image-style', 'image-config']);
|
|
46787
47005
|
}
|
|
46788
47006
|
}
|
|
46789
47007
|
globalEvents.on($xeUpload, 'paste', $xeUpload.handleGlobalPasteEvent);
|
|
@@ -46793,7 +47011,7 @@ function handleTransferFiles(items) {
|
|
|
46793
47011
|
beforeDestroy: function beforeDestroy() {
|
|
46794
47012
|
var $xeUpload = this;
|
|
46795
47013
|
var reactData = $xeUpload.reactData;
|
|
46796
|
-
reactData.
|
|
47014
|
+
reactData.isDragUploadStatus = false;
|
|
46797
47015
|
globalEvents.off($xeUpload, 'paste');
|
|
46798
47016
|
globalEvents.off($xeUpload, 'mousedown');
|
|
46799
47017
|
globalEvents.off($xeUpload, 'blur');
|