vxe-pc-ui 3.3.35 → 3.3.37
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 +284 -72
- package/es/upload/style.css +37 -0
- package/es/upload/style.min.css +1 -1
- package/es/vxe-upload/style.css +37 -0
- 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 +267 -51
- 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 +254 -46
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +37 -0
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +37 -0
- 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 +302 -73
- package/styles/components/upload.scss +33 -0
- package/types/components/pulldown.d.ts +9 -1
- package/types/components/table-module/keyboard.d.ts +1 -2
- package/types/components/table.d.ts +22 -0
- package/types/components/upload.d.ts +10 -2
- /package/es/icon/{iconfont.1734189926286.ttf → iconfont.1734347209149.ttf} +0 -0
- /package/es/icon/{iconfont.1734189926286.woff → iconfont.1734347209149.woff} +0 -0
- /package/es/icon/{iconfont.1734189926286.woff2 → iconfont.1734347209149.woff2} +0 -0
- /package/es/{iconfont.1734189926286.ttf → iconfont.1734347209149.ttf} +0 -0
- /package/es/{iconfont.1734189926286.woff → iconfont.1734347209149.woff} +0 -0
- /package/es/{iconfont.1734189926286.woff2 → iconfont.1734347209149.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1734189926286.ttf → iconfont.1734347209149.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1734189926286.woff → iconfont.1734347209149.woff} +0 -0
- /package/lib/icon/style/{iconfont.1734189926286.woff2 → iconfont.1734347209149.woff2} +0 -0
- /package/lib/{iconfont.1734189926286.ttf → iconfont.1734347209149.ttf} +0 -0
- /package/lib/{iconfont.1734189926286.woff → iconfont.1734347209149.woff} +0 -0
- /package/lib/{iconfont.1734189926286.woff2 → iconfont.1734347209149.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.37");
|
|
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.37";
|
|
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,39 @@ 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 el = $xeUpload.$refs.refElem;
|
|
45383
|
+
if (!el) {
|
|
45384
|
+
return;
|
|
45385
|
+
}
|
|
45386
|
+
var showMorePopup = reactData.showMorePopup;
|
|
45387
|
+
var wrapperRect = el.getBoundingClientRect();
|
|
45388
|
+
var ddLineEl = $xeUpload.$refs.refDragLineElem;
|
|
45389
|
+
var mdLineEl = document.getElementById("refModalDragLineElem".concat(xID));
|
|
45390
|
+
var currDLineEl = showMorePopup ? mdLineEl : ddLineEl;
|
|
45391
|
+
if (currDLineEl) {
|
|
45392
|
+
var dragRect = dragEl.getBoundingClientRect();
|
|
45393
|
+
currDLineEl.style.display = 'block';
|
|
45394
|
+
currDLineEl.style.top = "".concat(Math.max(1, dragRect.y - wrapperRect.y), "px");
|
|
45395
|
+
currDLineEl.style.left = "".concat(Math.max(1, dragRect.x - wrapperRect.x), "px");
|
|
45396
|
+
currDLineEl.style.height = "".concat(dragRect.height, "px");
|
|
45397
|
+
currDLineEl.style.width = "".concat(dragRect.width - 1, "px");
|
|
45398
|
+
currDLineEl.setAttribute('drag-pos', dragPos);
|
|
45399
|
+
}
|
|
45400
|
+
}
|
|
45401
|
+
function hideDropTip($xeUpload) {
|
|
45402
|
+
var xID = $xeUpload.xID;
|
|
45403
|
+
var ddLineEl = $xeUpload.$refs.refDragLineElem;
|
|
45404
|
+
var mdLineEl = document.getElementById("refModalDragLineElem".concat(xID));
|
|
45405
|
+
if (ddLineEl) {
|
|
45406
|
+
ddLineEl.style.display = '';
|
|
45407
|
+
}
|
|
45408
|
+
if (mdLineEl) {
|
|
45409
|
+
mdLineEl.style.display = '';
|
|
45410
|
+
}
|
|
45411
|
+
}
|
|
45371
45412
|
/* harmony default export */ var upload = (defineVxeComponent({
|
|
45372
45413
|
name: 'VxeUpload',
|
|
45373
45414
|
model: {
|
|
@@ -45426,6 +45467,7 @@ function handleTransferFiles(items) {
|
|
|
45426
45467
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(getConfig().upload.fileTypes, true);
|
|
45427
45468
|
}
|
|
45428
45469
|
},
|
|
45470
|
+
dragSort: Boolean,
|
|
45429
45471
|
dragToUpload: {
|
|
45430
45472
|
type: Boolean,
|
|
45431
45473
|
default: function _default() {
|
|
@@ -45579,14 +45621,19 @@ function handleTransferFiles(items) {
|
|
|
45579
45621
|
data: function data() {
|
|
45580
45622
|
var xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
45581
45623
|
var reactData = {
|
|
45582
|
-
|
|
45624
|
+
isDragUploadStatus: false,
|
|
45583
45625
|
showMorePopup: false,
|
|
45584
45626
|
isActivated: false,
|
|
45585
45627
|
fileList: [],
|
|
45586
|
-
fileCacheMaps: {}
|
|
45628
|
+
fileCacheMaps: {},
|
|
45629
|
+
isDragMove: false,
|
|
45630
|
+
dragIndex: -1,
|
|
45631
|
+
dragTipText: ''
|
|
45587
45632
|
};
|
|
45588
45633
|
var internalData = {
|
|
45589
|
-
imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif']
|
|
45634
|
+
imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif'],
|
|
45635
|
+
prevDragIndex: -1
|
|
45636
|
+
// prevDragPos: ''
|
|
45590
45637
|
};
|
|
45591
45638
|
return {
|
|
45592
45639
|
xID: xID,
|
|
@@ -46224,7 +46271,7 @@ function handleTransferFiles(items) {
|
|
|
46224
46271
|
}
|
|
46225
46272
|
});
|
|
46226
46273
|
},
|
|
46227
|
-
|
|
46274
|
+
handleUploadDragleaveEvent: function handleUploadDragleaveEvent(evnt) {
|
|
46228
46275
|
var $xeUpload = this;
|
|
46229
46276
|
var reactData = $xeUpload.reactData;
|
|
46230
46277
|
var targetElem = evnt.currentTarget;
|
|
@@ -46237,11 +46284,11 @@ function handleTransferFiles(items) {
|
|
|
46237
46284
|
targetHeight = _targetElem$getBoundi.height,
|
|
46238
46285
|
targetWidth = _targetElem$getBoundi.width;
|
|
46239
46286
|
if (clientX < targetX || clientX > targetX + targetWidth || clientY < targetY || clientY > targetY + targetHeight) {
|
|
46240
|
-
reactData.
|
|
46287
|
+
reactData.isDragUploadStatus = false;
|
|
46241
46288
|
}
|
|
46242
46289
|
}
|
|
46243
46290
|
},
|
|
46244
|
-
|
|
46291
|
+
handleUploadDragoverEvent: function handleUploadDragoverEvent(evnt) {
|
|
46245
46292
|
var $xeUpload = this;
|
|
46246
46293
|
var reactData = $xeUpload.reactData;
|
|
46247
46294
|
var dataTransfer = evnt.dataTransfer;
|
|
@@ -46249,7 +46296,7 @@ function handleTransferFiles(items) {
|
|
|
46249
46296
|
var items = dataTransfer.items;
|
|
46250
46297
|
if (items && items.length) {
|
|
46251
46298
|
evnt.preventDefault();
|
|
46252
|
-
reactData.
|
|
46299
|
+
reactData.isDragUploadStatus = true;
|
|
46253
46300
|
}
|
|
46254
46301
|
}
|
|
46255
46302
|
},
|
|
@@ -46285,7 +46332,7 @@ function handleTransferFiles(items) {
|
|
|
46285
46332
|
}
|
|
46286
46333
|
$xeUpload.uploadFile(files, evnt);
|
|
46287
46334
|
},
|
|
46288
|
-
|
|
46335
|
+
handleUploadDropEvent: function handleUploadDropEvent(evnt) {
|
|
46289
46336
|
var $xeUpload = this;
|
|
46290
46337
|
var reactData = $xeUpload.reactData;
|
|
46291
46338
|
var dataTransfer = evnt.dataTransfer;
|
|
@@ -46299,12 +46346,13 @@ function handleTransferFiles(items) {
|
|
|
46299
46346
|
}
|
|
46300
46347
|
}
|
|
46301
46348
|
}
|
|
46302
|
-
reactData.
|
|
46349
|
+
reactData.isDragUploadStatus = false;
|
|
46303
46350
|
},
|
|
46304
46351
|
handleMoreEvent: function handleMoreEvent() {
|
|
46305
46352
|
var $xeUpload = this;
|
|
46306
46353
|
var props = $xeUpload;
|
|
46307
46354
|
var reactData = $xeUpload.reactData;
|
|
46355
|
+
var xID = $xeUpload.xID;
|
|
46308
46356
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46309
46357
|
var isImage = $xeUpload.computeIsImage;
|
|
46310
46358
|
if (index_esm_VxeUI.modal) {
|
|
@@ -46319,44 +46367,151 @@ function handleTransferFiles(items) {
|
|
|
46319
46367
|
slots: {
|
|
46320
46368
|
default: function _default(params, h) {
|
|
46321
46369
|
var showErrorStatus = props.showErrorStatus,
|
|
46322
|
-
dragToUpload = props.dragToUpload
|
|
46323
|
-
|
|
46324
|
-
var
|
|
46370
|
+
dragToUpload = props.dragToUpload,
|
|
46371
|
+
dragSort = props.dragSort;
|
|
46372
|
+
var isDragMove = reactData.isDragMove,
|
|
46373
|
+
isDragUploadStatus = reactData.isDragUploadStatus,
|
|
46374
|
+
dragIndex = reactData.dragIndex;
|
|
46325
46375
|
var fileList = reactData.fileList;
|
|
46376
|
+
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46326
46377
|
var ons = {};
|
|
46327
|
-
if (dragToUpload) {
|
|
46328
|
-
ons.dragover = $xeUpload.
|
|
46329
|
-
ons.dragleave = $xeUpload.
|
|
46330
|
-
ons.drop = $xeUpload.
|
|
46378
|
+
if (dragToUpload && dragIndex === -1) {
|
|
46379
|
+
ons.dragover = $xeUpload.handleUploadDragoverEvent;
|
|
46380
|
+
ons.dragleave = $xeUpload.handleUploadDragleaveEvent;
|
|
46381
|
+
ons.drop = $xeUpload.handleUploadDropEvent;
|
|
46331
46382
|
}
|
|
46332
46383
|
return h('div', {
|
|
46333
46384
|
class: ['vxe-upload--more-popup', {
|
|
46334
46385
|
'is--readonly': formReadonly,
|
|
46335
46386
|
'is--disabled': isDisabled,
|
|
46336
46387
|
'show--error': showErrorStatus,
|
|
46337
|
-
'is--drag':
|
|
46388
|
+
'is--drag': isDragUploadStatus
|
|
46338
46389
|
}],
|
|
46339
46390
|
on: ons
|
|
46340
|
-
}, [isImage ? h('
|
|
46391
|
+
}, [isImage ? dragSort ? h('transition-group', {
|
|
46392
|
+
props: {
|
|
46393
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46394
|
+
tag: 'div'
|
|
46395
|
+
},
|
|
46396
|
+
class: 'vxe-upload--image-more-list'
|
|
46397
|
+
}, $xeUpload.renderImageItemList(h, fileList, true).concat($xeUpload.renderImageAction(h, true))) : h('div', {
|
|
46341
46398
|
class: 'vxe-upload--image-more-list'
|
|
46342
46399
|
}, $xeUpload.renderImageItemList(h, fileList, true).concat($xeUpload.renderImageAction(h, true))) : h('div', {
|
|
46343
46400
|
class: 'vxe-upload--file-more-list'
|
|
46344
|
-
}, [$xeUpload.renderFileAction(h, true), h('
|
|
46401
|
+
}, [$xeUpload.renderFileAction(h, true), dragSort ? h('transition-group', {
|
|
46402
|
+
props: {
|
|
46403
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46404
|
+
tag: 'div'
|
|
46405
|
+
},
|
|
46406
|
+
class: 'vxe-upload--file-list'
|
|
46407
|
+
}, $xeUpload.renderFileItemList(h, fileList, true)) : h('div', {
|
|
46345
46408
|
class: 'vxe-upload--file-list'
|
|
46346
|
-
}, $xeUpload.renderFileItemList(h, fileList, true))]),
|
|
46409
|
+
}, $xeUpload.renderFileItemList(h, fileList, true))]), dragSort ? h('div', {
|
|
46410
|
+
attrs: {
|
|
46411
|
+
id: "refModalDragLineElem".concat(xID)
|
|
46412
|
+
},
|
|
46413
|
+
class: 'vxe-upload--drag-line'
|
|
46414
|
+
}) : renderEmptyElement($xeUpload), isDragUploadStatus ? h('div', {
|
|
46347
46415
|
class: 'vxe-upload--drag-placeholder'
|
|
46348
46416
|
}, getI18n('vxe.upload.dragPlaceholder')) : renderEmptyElement($xeUpload)]);
|
|
46349
46417
|
}
|
|
46350
46418
|
},
|
|
46351
|
-
|
|
46352
|
-
|
|
46353
|
-
|
|
46354
|
-
|
|
46355
|
-
|
|
46419
|
+
events: {
|
|
46420
|
+
show: function show() {
|
|
46421
|
+
reactData.showMorePopup = true;
|
|
46422
|
+
},
|
|
46423
|
+
hide: function hide() {
|
|
46424
|
+
reactData.showMorePopup = false;
|
|
46425
|
+
}
|
|
46356
46426
|
}
|
|
46357
46427
|
});
|
|
46358
46428
|
}
|
|
46359
46429
|
},
|
|
46430
|
+
// 拖拽
|
|
46431
|
+
handleDragSortDragstartEvent: function handleDragSortDragstartEvent(evnt) {
|
|
46432
|
+
var $xeUpload = this;
|
|
46433
|
+
var reactData = $xeUpload.reactData;
|
|
46434
|
+
if (evnt.dataTransfer) {
|
|
46435
|
+
var img = new Image();
|
|
46436
|
+
img.src = tpImg;
|
|
46437
|
+
evnt.dataTransfer.setDragImage(img, 0, 0);
|
|
46438
|
+
}
|
|
46439
|
+
var dragEl = evnt.currentTarget;
|
|
46440
|
+
var parentEl = dragEl.parentElement;
|
|
46441
|
+
var dragIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(Array.from(parentEl.children), function (item) {
|
|
46442
|
+
return dragEl === item;
|
|
46443
|
+
});
|
|
46444
|
+
reactData.isDragMove = true;
|
|
46445
|
+
reactData.dragIndex = dragIndex;
|
|
46446
|
+
setTimeout(function () {
|
|
46447
|
+
reactData.isDragMove = false;
|
|
46448
|
+
}, 500);
|
|
46449
|
+
},
|
|
46450
|
+
handleDragSortDragoverEvent: function handleDragSortDragoverEvent(evnt) {
|
|
46451
|
+
var $xeUpload = this;
|
|
46452
|
+
var reactData = $xeUpload.reactData;
|
|
46453
|
+
var internalData = $xeUpload.internalData;
|
|
46454
|
+
evnt.preventDefault();
|
|
46455
|
+
var dragIndex = reactData.dragIndex;
|
|
46456
|
+
if (dragIndex === -1) {
|
|
46457
|
+
return;
|
|
46458
|
+
}
|
|
46459
|
+
var isImage = $xeUpload.computeIsImage;
|
|
46460
|
+
var dragEl = evnt.currentTarget;
|
|
46461
|
+
var parentEl = dragEl.parentElement;
|
|
46462
|
+
var currIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(Array.from(parentEl.children), function (item) {
|
|
46463
|
+
return dragEl === item;
|
|
46464
|
+
});
|
|
46465
|
+
var dragPos = '';
|
|
46466
|
+
if (isImage) {
|
|
46467
|
+
var offsetX = evnt.clientX - dragEl.getBoundingClientRect().x;
|
|
46468
|
+
dragPos = offsetX < dragEl.clientWidth / 2 ? 'left' : 'right';
|
|
46469
|
+
} else {
|
|
46470
|
+
var offsetY = evnt.clientY - dragEl.getBoundingClientRect().y;
|
|
46471
|
+
dragPos = offsetY < dragEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
46472
|
+
}
|
|
46473
|
+
if (dragIndex === currIndex) {
|
|
46474
|
+
showDropTip($xeUpload, evnt, dragEl, dragPos);
|
|
46475
|
+
return;
|
|
46476
|
+
}
|
|
46477
|
+
showDropTip($xeUpload, evnt, dragEl, dragPos);
|
|
46478
|
+
internalData.prevDragIndex = currIndex;
|
|
46479
|
+
internalData.prevDragPos = dragPos;
|
|
46480
|
+
},
|
|
46481
|
+
handleDragSortDragendEvent: function handleDragSortDragendEvent(evnt) {
|
|
46482
|
+
var $xeUpload = this;
|
|
46483
|
+
var reactData = $xeUpload.reactData;
|
|
46484
|
+
var internalData = $xeUpload.internalData;
|
|
46485
|
+
var fileList = reactData.fileList,
|
|
46486
|
+
dragIndex = reactData.dragIndex;
|
|
46487
|
+
var prevDragIndex = internalData.prevDragIndex,
|
|
46488
|
+
prevDragPos = internalData.prevDragPos;
|
|
46489
|
+
var oldIndex = dragIndex;
|
|
46490
|
+
var targetIndex = prevDragIndex;
|
|
46491
|
+
var dragOffsetIndex = prevDragPos === 'bottom' || prevDragPos === 'right' ? 1 : 0;
|
|
46492
|
+
var oldItem = fileList[oldIndex];
|
|
46493
|
+
var newItem = fileList[targetIndex];
|
|
46494
|
+
if (oldItem && newItem) {
|
|
46495
|
+
fileList.splice(oldIndex, 1);
|
|
46496
|
+
var ptfIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(fileList, function (item) {
|
|
46497
|
+
return newItem === item;
|
|
46498
|
+
});
|
|
46499
|
+
var nIndex = ptfIndex + dragOffsetIndex;
|
|
46500
|
+
fileList.splice(nIndex, 0, oldItem);
|
|
46501
|
+
$xeUpload.dispatchEvent('sort-dragend', {
|
|
46502
|
+
oldItem: oldItem,
|
|
46503
|
+
newItem: newItem,
|
|
46504
|
+
dragPos: prevDragPos,
|
|
46505
|
+
offsetIndex: dragOffsetIndex,
|
|
46506
|
+
_index: {
|
|
46507
|
+
newIndex: nIndex,
|
|
46508
|
+
oldIndex: oldIndex
|
|
46509
|
+
}
|
|
46510
|
+
}, evnt);
|
|
46511
|
+
}
|
|
46512
|
+
hideDropTip($xeUpload);
|
|
46513
|
+
reactData.dragIndex = -1;
|
|
46514
|
+
},
|
|
46360
46515
|
handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
|
|
46361
46516
|
var $xeUpload = this;
|
|
46362
46517
|
var props = $xeUpload;
|
|
@@ -46405,25 +46560,37 @@ function handleTransferFiles(items) {
|
|
|
46405
46560
|
showProgress = props.showProgress,
|
|
46406
46561
|
progressText = props.progressText,
|
|
46407
46562
|
showPreview = props.showPreview,
|
|
46408
|
-
showErrorStatus = props.showErrorStatus
|
|
46563
|
+
showErrorStatus = props.showErrorStatus,
|
|
46564
|
+
dragSort = props.dragSort;
|
|
46409
46565
|
var fileCacheMaps = reactData.fileCacheMaps;
|
|
46410
46566
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46411
46567
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46412
46568
|
var nameProp = $xeUpload.computeNameProp;
|
|
46413
46569
|
var typeProp = $xeUpload.computeTypeProp;
|
|
46414
46570
|
var cornerSlot = slots.corner;
|
|
46571
|
+
var ons = {};
|
|
46572
|
+
if (dragSort) {
|
|
46573
|
+
ons.dragstart = $xeUpload.handleDragSortDragstartEvent;
|
|
46574
|
+
ons.dragover = $xeUpload.handleDragSortDragoverEvent;
|
|
46575
|
+
ons.dragend = $xeUpload.handleDragSortDragendEvent;
|
|
46576
|
+
}
|
|
46415
46577
|
return currList.map(function (item, index) {
|
|
46416
46578
|
var fileKey = $xeUpload.getFieldKey(item);
|
|
46417
46579
|
var cacheItem = fileCacheMaps[fileKey];
|
|
46418
46580
|
var isLoading = cacheItem && cacheItem.loading;
|
|
46419
46581
|
var isError = cacheItem && cacheItem.status === 'error';
|
|
46420
46582
|
return h('div', {
|
|
46421
|
-
key: index,
|
|
46583
|
+
key: dragSort ? fileKey : index,
|
|
46422
46584
|
class: ['vxe-upload--file-item', {
|
|
46423
46585
|
'is--preview': showPreview,
|
|
46424
46586
|
'is--loading': isLoading,
|
|
46425
46587
|
'is--error': isError
|
|
46426
|
-
}]
|
|
46588
|
+
}],
|
|
46589
|
+
attrs: {
|
|
46590
|
+
fileid: fileKey,
|
|
46591
|
+
draggable: dragSort ? true : null
|
|
46592
|
+
},
|
|
46593
|
+
on: ons
|
|
46427
46594
|
}, [h('div', {
|
|
46428
46595
|
class: 'vxe-upload--file-item-icon'
|
|
46429
46596
|
}, [h('i', {
|
|
@@ -46533,8 +46700,10 @@ function handleTransferFiles(items) {
|
|
|
46533
46700
|
var $xeUpload = this;
|
|
46534
46701
|
var props = $xeUpload;
|
|
46535
46702
|
var reactData = $xeUpload.reactData;
|
|
46536
|
-
var moreConfig = props.moreConfig
|
|
46537
|
-
|
|
46703
|
+
var moreConfig = props.moreConfig,
|
|
46704
|
+
dragSort = props.dragSort;
|
|
46705
|
+
var fileList = reactData.fileList,
|
|
46706
|
+
isDragMove = reactData.isDragMove;
|
|
46538
46707
|
var moreOpts = $xeUpload.computeMoreOpts;
|
|
46539
46708
|
var maxCount = moreOpts.maxCount,
|
|
46540
46709
|
showMoreButton = moreOpts.showMoreButton,
|
|
@@ -46553,7 +46722,13 @@ function handleTransferFiles(items) {
|
|
|
46553
46722
|
class: ['vxe-upload--file-list-wrapper', {
|
|
46554
46723
|
'is--horizontal': isHorizontal
|
|
46555
46724
|
}]
|
|
46556
|
-
}, [currList.length ? h('
|
|
46725
|
+
}, [currList.length ? dragSort ? h('transition-group', {
|
|
46726
|
+
attrs: {
|
|
46727
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46728
|
+
tag: 'div'
|
|
46729
|
+
},
|
|
46730
|
+
class: 'vxe-upload--file-list'
|
|
46731
|
+
}, $xeUpload.renderFileItemList(h, currList, false)) : h('div', {
|
|
46557
46732
|
class: 'vxe-upload--file-list'
|
|
46558
46733
|
}, $xeUpload.renderFileItemList(h, currList, false)) : renderEmptyElement($xeUpload), showMoreButton && overMaxNum ? h('div', {
|
|
46559
46734
|
class: 'vxe-upload--file-over-more'
|
|
@@ -46577,26 +46752,38 @@ function handleTransferFiles(items) {
|
|
|
46577
46752
|
showProgress = props.showProgress,
|
|
46578
46753
|
progressText = props.progressText,
|
|
46579
46754
|
showPreview = props.showPreview,
|
|
46580
|
-
showErrorStatus = props.showErrorStatus
|
|
46755
|
+
showErrorStatus = props.showErrorStatus,
|
|
46756
|
+
dragSort = props.dragSort;
|
|
46581
46757
|
var fileCacheMaps = reactData.fileCacheMaps;
|
|
46582
46758
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46583
46759
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46584
46760
|
var imageOpts = $xeUpload.computeImageOpts;
|
|
46585
46761
|
var imgStyle = $xeUpload.computeImgStyle;
|
|
46586
46762
|
var cornerSlot = slots.corner;
|
|
46763
|
+
var ons = {};
|
|
46764
|
+
if (dragSort) {
|
|
46765
|
+
ons.dragstart = $xeUpload.handleDragSortDragstartEvent;
|
|
46766
|
+
ons.dragover = $xeUpload.handleDragSortDragoverEvent;
|
|
46767
|
+
ons.dragend = $xeUpload.handleDragSortDragendEvent;
|
|
46768
|
+
}
|
|
46587
46769
|
return currList.map(function (item, index) {
|
|
46588
46770
|
var fileKey = $xeUpload.getFieldKey(item);
|
|
46589
46771
|
var cacheItem = fileCacheMaps[fileKey];
|
|
46590
46772
|
var isLoading = cacheItem && cacheItem.loading;
|
|
46591
46773
|
var isError = cacheItem && cacheItem.status === 'error';
|
|
46592
46774
|
return h('div', {
|
|
46593
|
-
key: index,
|
|
46775
|
+
key: dragSort ? fileKey : index,
|
|
46594
46776
|
class: ['vxe-upload--image-item', {
|
|
46595
46777
|
'is--preview': showPreview,
|
|
46596
46778
|
'is--circle': imageOpts.circle,
|
|
46597
46779
|
'is--loading': isLoading,
|
|
46598
46780
|
'is--error': isError
|
|
46599
|
-
}]
|
|
46781
|
+
}],
|
|
46782
|
+
attrs: {
|
|
46783
|
+
fileid: fileKey,
|
|
46784
|
+
draggable: dragSort ? true : null
|
|
46785
|
+
},
|
|
46786
|
+
on: ons
|
|
46600
46787
|
}, [h('div', {
|
|
46601
46788
|
class: 'vxe-upload--image-item-box',
|
|
46602
46789
|
style: isMoreView ? {} : imgStyle,
|
|
@@ -46713,8 +46900,11 @@ function handleTransferFiles(items) {
|
|
|
46713
46900
|
},
|
|
46714
46901
|
renderImageMode: function renderImageMode(h) {
|
|
46715
46902
|
var $xeUpload = this;
|
|
46903
|
+
var props = $xeUpload;
|
|
46716
46904
|
var reactData = $xeUpload.reactData;
|
|
46717
|
-
var
|
|
46905
|
+
var dragSort = props.dragSort;
|
|
46906
|
+
var fileList = reactData.fileList,
|
|
46907
|
+
isDragMove = reactData.isDragMove;
|
|
46718
46908
|
var moreOpts = $xeUpload.computeMoreOpts;
|
|
46719
46909
|
var maxCount = moreOpts.maxCount,
|
|
46720
46910
|
showMoreButton = moreOpts.showMoreButton;
|
|
@@ -46727,7 +46917,25 @@ function handleTransferFiles(items) {
|
|
|
46727
46917
|
return h('div', {
|
|
46728
46918
|
key: 'image',
|
|
46729
46919
|
class: 'vxe-upload--image-wrapper'
|
|
46730
|
-
}, [h('
|
|
46920
|
+
}, [dragSort ? h('transition-group', {
|
|
46921
|
+
attrs: {
|
|
46922
|
+
name: "vxe-upload--drag-list".concat(isDragMove ? '' : '-disabled'),
|
|
46923
|
+
tag: 'div'
|
|
46924
|
+
},
|
|
46925
|
+
class: 'vxe-upload--image-list'
|
|
46926
|
+
}, $xeUpload.renderImageItemList(h, currList, false).concat([showMoreButton && overMaxNum ? h('div', {
|
|
46927
|
+
key: 'om',
|
|
46928
|
+
class: 'vxe-upload--image-over-more'
|
|
46929
|
+
}, [h(src_button, {
|
|
46930
|
+
props: {
|
|
46931
|
+
mode: 'text',
|
|
46932
|
+
content: getI18n('vxe.upload.moreBtnText', [fileList.length]),
|
|
46933
|
+
status: 'primary'
|
|
46934
|
+
},
|
|
46935
|
+
on: {
|
|
46936
|
+
click: $xeUpload.handleMoreEvent
|
|
46937
|
+
}
|
|
46938
|
+
})]) : renderEmptyElement($xeUpload), $xeUpload.renderImageAction(h, false)])) : h('div', {
|
|
46731
46939
|
class: 'vxe-upload--image-list'
|
|
46732
46940
|
}, $xeUpload.renderImageItemList(h, currList, false).concat([showMoreButton && overMaxNum ? h('div', {
|
|
46733
46941
|
class: 'vxe-upload--image-over-more'
|
|
@@ -46748,25 +46956,30 @@ function handleTransferFiles(items) {
|
|
|
46748
46956
|
var reactData = $xeUpload.reactData;
|
|
46749
46957
|
var showErrorStatus = props.showErrorStatus,
|
|
46750
46958
|
dragToUpload = props.dragToUpload,
|
|
46751
|
-
pasteToUpload = props.pasteToUpload
|
|
46752
|
-
|
|
46959
|
+
pasteToUpload = props.pasteToUpload,
|
|
46960
|
+
dragSort = props.dragSort;
|
|
46961
|
+
var isDragUploadStatus = reactData.isDragUploadStatus,
|
|
46753
46962
|
showMorePopup = reactData.showMorePopup,
|
|
46754
|
-
isActivated = reactData.isActivated
|
|
46963
|
+
isActivated = reactData.isActivated,
|
|
46964
|
+
dragIndex = reactData.dragIndex;
|
|
46755
46965
|
var vSize = $xeUpload.computeSize;
|
|
46756
46966
|
var isDisabled = $xeUpload.computeIsDisabled;
|
|
46757
46967
|
var formReadonly = $xeUpload.computeFormReadonly;
|
|
46758
46968
|
var isImage = $xeUpload.computeIsImage;
|
|
46759
46969
|
var ons = {};
|
|
46760
|
-
if (dragToUpload) {
|
|
46761
|
-
ons.dragover = $xeUpload.
|
|
46762
|
-
ons.dragleave = $xeUpload.
|
|
46763
|
-
ons.drop = $xeUpload.
|
|
46970
|
+
if (dragToUpload && dragIndex === -1) {
|
|
46971
|
+
ons.dragover = $xeUpload.handleUploadDragoverEvent;
|
|
46972
|
+
ons.dragleave = $xeUpload.handleUploadDragleaveEvent;
|
|
46973
|
+
ons.drop = $xeUpload.handleUploadDropEvent;
|
|
46764
46974
|
}
|
|
46765
46975
|
return h('div', {
|
|
46766
46976
|
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',
|
|
46977
|
+
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
46978
|
on: ons
|
|
46769
|
-
}, [isImage ? $xeUpload.renderImageMode(h) : $xeUpload.renderAllMode(h),
|
|
46979
|
+
}, [isImage ? $xeUpload.renderImageMode(h) : $xeUpload.renderAllMode(h), dragSort ? h('div', {
|
|
46980
|
+
ref: 'refDragLineElem',
|
|
46981
|
+
class: 'vxe-upload--drag-line'
|
|
46982
|
+
}) : renderEmptyElement($xeUpload), isDragUploadStatus && !showMorePopup ? h('div', {
|
|
46770
46983
|
class: 'vxe-upload--drag-placeholder'
|
|
46771
46984
|
}, getI18n('vxe.upload.dragPlaceholder')) : renderEmptyElement($xeUpload)]);
|
|
46772
46985
|
}
|
|
@@ -46782,6 +46995,9 @@ function handleTransferFiles(items) {
|
|
|
46782
46995
|
if (props.multiple && props.singleMode) {
|
|
46783
46996
|
errLog('vxe.error.errConflicts', ['multiple', 'single-mode']);
|
|
46784
46997
|
}
|
|
46998
|
+
if (props.imageStyle) {
|
|
46999
|
+
errLog('vxe.error.delProp', ['image-style', 'image-config']);
|
|
47000
|
+
}
|
|
46785
47001
|
}
|
|
46786
47002
|
globalEvents.on($xeUpload, 'paste', $xeUpload.handleGlobalPasteEvent);
|
|
46787
47003
|
globalEvents.on($xeUpload, 'mousedown', $xeUpload.handleGlobalMousedownEvent);
|
|
@@ -46790,7 +47006,7 @@ function handleTransferFiles(items) {
|
|
|
46790
47006
|
beforeDestroy: function beforeDestroy() {
|
|
46791
47007
|
var $xeUpload = this;
|
|
46792
47008
|
var reactData = $xeUpload.reactData;
|
|
46793
|
-
reactData.
|
|
47009
|
+
reactData.isDragUploadStatus = false;
|
|
46794
47010
|
globalEvents.off($xeUpload, 'paste');
|
|
46795
47011
|
globalEvents.off($xeUpload, 'mousedown');
|
|
46796
47012
|
globalEvents.off($xeUpload, 'blur');
|