vxe-pc-ui 4.10.49 → 4.11.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/es/icon/style.css +1 -1
- package/es/language/ar-EG.js +2 -1
- package/es/language/de-DE.js +2 -1
- package/es/language/en-US.js +2 -1
- package/es/language/es-ES.js +2 -1
- package/es/language/fr-FR.js +2 -1
- package/es/language/hu-HU.js +2 -1
- package/es/language/hy-AM.js +2 -1
- package/es/language/id-ID.js +2 -1
- package/es/language/it-IT.js +2 -1
- package/es/language/ja-JP.js +2 -1
- package/es/language/ko-KR.js +2 -1
- package/es/language/ms-MY.js +2 -1
- package/es/language/nb-NO.js +2 -1
- package/es/language/pt-BR.js +2 -1
- package/es/language/ru-RU.js +2 -1
- package/es/language/th-TH.js +2 -1
- package/es/language/ug-CN.js +2 -1
- package/es/language/uk-UA.js +2 -1
- package/es/language/uz-UZ.js +2 -1
- package/es/language/vi-VN.js +2 -1
- package/es/language/zh-CHT.js +2 -1
- package/es/language/zh-CN.js +2 -1
- package/es/select/src/select.js +23 -2
- package/es/select/style.css +13 -4
- package/es/select/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +640 -25
- package/es/tree/style.css +119 -0
- package/es/tree/style.min.css +1 -1
- package/es/ui/index.js +11 -1
- package/es/ui/src/anime.js +46 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-select/style.css +13 -4
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-tree/style.css +119 -0
- package/es/vxe-tree/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +807 -37
- package/lib/index.umd.min.js +1 -1
- package/lib/language/ar-EG.js +2 -1
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +2 -1
- package/lib/language/de-DE.js +2 -1
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +2 -1
- package/lib/language/en-US.js +2 -1
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +2 -1
- package/lib/language/es-ES.js +2 -1
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +2 -1
- package/lib/language/fr-FR.js +2 -1
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +2 -1
- package/lib/language/hu-HU.js +2 -1
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +2 -1
- package/lib/language/hy-AM.js +2 -1
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +2 -1
- package/lib/language/id-ID.js +2 -1
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +2 -1
- package/lib/language/it-IT.js +2 -1
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +2 -1
- package/lib/language/ja-JP.js +2 -1
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +2 -1
- package/lib/language/ko-KR.js +2 -1
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +2 -1
- package/lib/language/ms-MY.js +2 -1
- package/lib/language/ms-MY.min.js +1 -1
- package/lib/language/ms-MY.umd.js +2 -1
- package/lib/language/nb-NO.js +2 -1
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +2 -1
- package/lib/language/pt-BR.js +2 -1
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +2 -1
- package/lib/language/ru-RU.js +2 -1
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +2 -1
- package/lib/language/th-TH.js +2 -1
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +2 -1
- package/lib/language/ug-CN.js +2 -1
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +2 -1
- package/lib/language/uk-UA.js +2 -1
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +2 -1
- package/lib/language/uz-UZ.js +2 -1
- package/lib/language/uz-UZ.min.js +1 -1
- package/lib/language/uz-UZ.umd.js +2 -1
- package/lib/language/vi-VN.js +2 -1
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +2 -1
- package/lib/language/zh-CHT.js +2 -1
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +2 -1
- package/lib/language/zh-CN.js +2 -1
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +2 -1
- package/lib/select/src/select.js +25 -2
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +13 -4
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tree/src/tree.js +704 -20
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree/style/style.css +119 -0
- package/lib/tree/style/style.min.css +1 -1
- package/lib/ui/index.js +11 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/anime.js +56 -0
- package/lib/ui/src/anime.min.js +1 -0
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-select/style/style.css +13 -4
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-tree/style/style.css +119 -0
- package/lib/vxe-tree/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/language/ar-EG.ts +2 -1
- package/packages/language/de-DE.ts +2 -1
- package/packages/language/en-US.ts +2 -1
- package/packages/language/es-ES.ts +2 -1
- package/packages/language/fr-FR.ts +2 -1
- package/packages/language/hu-HU.ts +2 -1
- package/packages/language/hy-AM.ts +2 -1
- package/packages/language/id-ID.ts +2 -1
- package/packages/language/it-IT.ts +2 -1
- package/packages/language/ja-JP.ts +2 -1
- package/packages/language/ko-KR.ts +2 -1
- package/packages/language/ms-MY.ts +2 -1
- package/packages/language/nb-NO.ts +2 -1
- package/packages/language/pt-BR.ts +2 -1
- package/packages/language/ru-RU.ts +2 -1
- package/packages/language/th-TH.ts +2 -1
- package/packages/language/ug-CN.ts +2 -1
- package/packages/language/uk-UA.ts +2 -1
- package/packages/language/uz-UZ.ts +2 -1
- package/packages/language/vi-VN.ts +2 -1
- package/packages/language/zh-CHT.ts +2 -1
- package/packages/language/zh-CN.ts +2 -1
- package/packages/select/src/select.ts +26 -3
- package/packages/tree/src/tree.ts +683 -20
- package/packages/ui/index.ts +10 -0
- package/packages/ui/src/anime.ts +52 -0
- package/styles/components/select.scss +13 -3
- package/styles/components/tree.scss +116 -0
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- package/types/components/select.d.ts +6 -0
- package/types/components/tree.d.ts +173 -10
- package/types/ui/global-icon.d.ts +4 -0
- /package/es/icon/{iconfont.1765265204333.ttf → iconfont.1765418463677.ttf} +0 -0
- /package/es/icon/{iconfont.1765265204333.woff → iconfont.1765418463677.woff} +0 -0
- /package/es/icon/{iconfont.1765265204333.woff2 → iconfont.1765418463677.woff2} +0 -0
- /package/es/{iconfont.1765265204333.ttf → iconfont.1765418463677.ttf} +0 -0
- /package/es/{iconfont.1765265204333.woff → iconfont.1765418463677.woff} +0 -0
- /package/es/{iconfont.1765265204333.woff2 → iconfont.1765418463677.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1765265204333.ttf → iconfont.1765418463677.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1765265204333.woff → iconfont.1765418463677.woff} +0 -0
- /package/lib/icon/style/{iconfont.1765265204333.woff2 → iconfont.1765418463677.woff2} +0 -0
- /package/lib/{iconfont.1765265204333.ttf → iconfont.1765418463677.ttf} +0 -0
- /package/lib/{iconfont.1765265204333.woff → iconfont.1765418463677.woff} +0 -0
- /package/lib/{iconfont.1765265204333.woff2 → iconfont.1765418463677.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3599,14 +3599,14 @@ function checkDynamic() {
|
|
|
3599
3599
|
}
|
|
3600
3600
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
3601
3601
|
|
|
3602
|
-
const log_version = `ui v${"4.
|
|
3602
|
+
const log_version = `ui v${"4.11.0"}`;
|
|
3603
3603
|
const warnLog = log.create('warn', log_version);
|
|
3604
3604
|
const errLog = log.create('error', log_version);
|
|
3605
3605
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
3606
3606
|
|
|
3607
3607
|
|
|
3608
3608
|
|
|
3609
|
-
const ui_version = "4.
|
|
3609
|
+
const ui_version = "4.11.0";
|
|
3610
3610
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
3611
3611
|
index_esm_VxeUI.dynamicApp = dynamicApp;
|
|
3612
3612
|
function config(options) {
|
|
@@ -3974,6 +3974,12 @@ setConfig({
|
|
|
3974
3974
|
radioConfig: {
|
|
3975
3975
|
strict: true
|
|
3976
3976
|
},
|
|
3977
|
+
dragConfig: {
|
|
3978
|
+
showIcon: true,
|
|
3979
|
+
animation: true,
|
|
3980
|
+
showGuidesStatus: true,
|
|
3981
|
+
showDragTip: true
|
|
3982
|
+
},
|
|
3977
3983
|
virtualYConfig: {
|
|
3978
3984
|
enabled: true,
|
|
3979
3985
|
gt: 50,
|
|
@@ -4157,6 +4163,10 @@ setIcon({
|
|
|
4157
4163
|
TREE_NODE_OPEN: iconPrefix + 'caret-right rotate90',
|
|
4158
4164
|
TREE_NODE_CLOSE: iconPrefix + 'caret-right',
|
|
4159
4165
|
TREE_NODE_LOADED: iconPrefix + 'spinner roll',
|
|
4166
|
+
TREE_DRAG: iconPrefix + 'drag-handle',
|
|
4167
|
+
TREE_DRAG_STATUS_NODE: iconPrefix + 'sort',
|
|
4168
|
+
TREE_DRAG_STATUS_SUB_NODE: iconPrefix + 'add-sub',
|
|
4169
|
+
TREE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
4160
4170
|
// tree-select
|
|
4161
4171
|
TREE_SELECT_LOADED: iconPrefix + 'spinner roll',
|
|
4162
4172
|
TREE_SELECT_OPEN: iconPrefix + 'caret-down rotate180',
|
|
@@ -4328,7 +4338,8 @@ setIcon({
|
|
|
4328
4338
|
searchEmpty: '未匹配到数据!'
|
|
4329
4339
|
},
|
|
4330
4340
|
tree: {
|
|
4331
|
-
searchEmpty: '未匹配到数据!'
|
|
4341
|
+
searchEmpty: '未匹配到数据!',
|
|
4342
|
+
dragTip: '移动:{0}'
|
|
4332
4343
|
},
|
|
4333
4344
|
treeSelect: {
|
|
4334
4345
|
clearChecked: '清除',
|
|
@@ -5221,14 +5232,14 @@ function isScale(val) {
|
|
|
5221
5232
|
function hasClass(elem, cls) {
|
|
5222
5233
|
return !!(elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
|
|
5223
5234
|
}
|
|
5224
|
-
function
|
|
5235
|
+
function dom_removeClass(elem, cls) {
|
|
5225
5236
|
if (elem && hasClass(elem, cls)) {
|
|
5226
5237
|
elem.className = elem.className.replace(getClsRE(cls), '');
|
|
5227
5238
|
}
|
|
5228
5239
|
}
|
|
5229
|
-
function
|
|
5240
|
+
function dom_addClass(elem, cls) {
|
|
5230
5241
|
if (elem && !hasClass(elem, cls)) {
|
|
5231
|
-
|
|
5242
|
+
dom_removeClass(elem, cls);
|
|
5232
5243
|
elem.className = `${elem.className} ${cls}`;
|
|
5233
5244
|
}
|
|
5234
5245
|
}
|
|
@@ -25252,7 +25263,7 @@ const IconPicker = VxeIconPicker;
|
|
|
25252
25263
|
const imagePreviewPrivateMethods = {};
|
|
25253
25264
|
const resetStyle = () => {
|
|
25254
25265
|
const elem = refElem.value;
|
|
25255
|
-
|
|
25266
|
+
dom_removeClass(elem, 'is--move');
|
|
25256
25267
|
Object.assign(reactData, {
|
|
25257
25268
|
offsetPct11: false,
|
|
25258
25269
|
offsetScale: 0,
|
|
@@ -25494,7 +25505,7 @@ const IconPicker = VxeIconPicker;
|
|
|
25494
25505
|
visibleWidth
|
|
25495
25506
|
} = getDomNode();
|
|
25496
25507
|
et.preventDefault();
|
|
25497
|
-
|
|
25508
|
+
dom_addClass(elem, 'is--move');
|
|
25498
25509
|
// 限制边界值
|
|
25499
25510
|
if (pageX > marginSize && pageY > marginSize && pageX < visibleWidth - marginSize && pageY < visibleHeight - marginSize) {
|
|
25500
25511
|
reactData.offsetLeft = offsetLeft + pageX - startX;
|
|
@@ -25504,7 +25515,7 @@ const IconPicker = VxeIconPicker;
|
|
|
25504
25515
|
document.onmouseup = () => {
|
|
25505
25516
|
document.onmousemove = domMousemove;
|
|
25506
25517
|
document.onmouseup = domMouseup;
|
|
25507
|
-
|
|
25518
|
+
dom_removeClass(elem, 'is--move');
|
|
25508
25519
|
};
|
|
25509
25520
|
};
|
|
25510
25521
|
const handleGlobalKeydownEvent = evnt => {
|
|
@@ -25685,7 +25696,7 @@ const IconPicker = VxeIconPicker;
|
|
|
25685
25696
|
const elem = refElem.value;
|
|
25686
25697
|
if (elem) {
|
|
25687
25698
|
elem.removeEventListener('wheel', wheelEvent);
|
|
25688
|
-
|
|
25699
|
+
dom_removeClass(elem, 'is--move');
|
|
25689
25700
|
}
|
|
25690
25701
|
});
|
|
25691
25702
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
@@ -29850,6 +29861,7 @@ function select_createInternalData() {
|
|
|
29850
29861
|
type: Boolean,
|
|
29851
29862
|
default: null
|
|
29852
29863
|
},
|
|
29864
|
+
popupConfig: Object,
|
|
29853
29865
|
virtualYConfig: Object,
|
|
29854
29866
|
scrollY: Object,
|
|
29855
29867
|
/**
|
|
@@ -30004,6 +30016,9 @@ function select_createInternalData() {
|
|
|
30004
30016
|
const selectVals = computeSelectVals.value;
|
|
30005
30017
|
return checkMaxLimit(selectVals);
|
|
30006
30018
|
});
|
|
30019
|
+
const computePopupOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30020
|
+
return Object.assign({}, getConfig().treeSelect.popupConfig, props.popupConfig);
|
|
30021
|
+
});
|
|
30007
30022
|
const computeVirtualYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30008
30023
|
return Object.assign({}, getConfig().select.virtualYConfig || getConfig().select.scrollY, props.virtualYConfig || props.scrollY);
|
|
30009
30024
|
});
|
|
@@ -30016,6 +30031,22 @@ function select_createInternalData() {
|
|
|
30016
30031
|
const computeMultiMaxCharNum = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30017
30032
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(props.multiCharOverflow);
|
|
30018
30033
|
});
|
|
30034
|
+
const computePopupWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30035
|
+
const popupOpts = computePopupOpts.value;
|
|
30036
|
+
const {
|
|
30037
|
+
height,
|
|
30038
|
+
width
|
|
30039
|
+
} = popupOpts;
|
|
30040
|
+
const stys = {};
|
|
30041
|
+
if (width) {
|
|
30042
|
+
stys.width = toCssUnit(width);
|
|
30043
|
+
}
|
|
30044
|
+
if (height) {
|
|
30045
|
+
stys.height = toCssUnit(height);
|
|
30046
|
+
stys.maxHeight = toCssUnit(height);
|
|
30047
|
+
}
|
|
30048
|
+
return stys;
|
|
30049
|
+
});
|
|
30019
30050
|
const computeSelectVals = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30020
30051
|
const {
|
|
30021
30052
|
modelValue,
|
|
@@ -31213,7 +31244,6 @@ function select_createInternalData() {
|
|
|
31213
31244
|
const renderVN = () => {
|
|
31214
31245
|
const {
|
|
31215
31246
|
className,
|
|
31216
|
-
popupClassName,
|
|
31217
31247
|
multiple,
|
|
31218
31248
|
loading,
|
|
31219
31249
|
filterable,
|
|
@@ -31237,6 +31267,9 @@ function select_createInternalData() {
|
|
|
31237
31267
|
const btnTransfer = computeBtnTransfer.value;
|
|
31238
31268
|
const formReadonly = computeFormReadonly.value;
|
|
31239
31269
|
const inpPlaceholder = computeInpPlaceholder.value;
|
|
31270
|
+
const popupWrapperStyle = computePopupWrapperStyle.value;
|
|
31271
|
+
const popupOpts = computePopupOpts.value;
|
|
31272
|
+
const popupClassName = popupOpts.className || props.popupClassName;
|
|
31240
31273
|
const defaultSlot = slots.default;
|
|
31241
31274
|
const headerSlot = slots.header;
|
|
31242
31275
|
const footerSlot = slots.footer;
|
|
@@ -31304,7 +31337,8 @@ function select_createInternalData() {
|
|
|
31304
31337
|
placement: reactData.panelPlacement,
|
|
31305
31338
|
style: reactData.panelStyle
|
|
31306
31339
|
}, initialized && (visiblePanel || isAniVisible) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
31307
|
-
class: 'vxe-select--panel-wrapper'
|
|
31340
|
+
class: 'vxe-select--panel-wrapper',
|
|
31341
|
+
style: popupWrapperStyle
|
|
31308
31342
|
}, [filterable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
31309
31343
|
class: 'vxe-select--panel-search'
|
|
31310
31344
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(input, {
|
|
@@ -35194,7 +35228,7 @@ const Select = VxeSelect;
|
|
|
35194
35228
|
rsSplitterLineEl.style.display = '';
|
|
35195
35229
|
}
|
|
35196
35230
|
handleUpdate();
|
|
35197
|
-
|
|
35231
|
+
dom_removeClass(el, 'is--drag');
|
|
35198
35232
|
dispatchEvent('resize-end', {
|
|
35199
35233
|
prevItem,
|
|
35200
35234
|
nextItem,
|
|
@@ -35208,7 +35242,7 @@ const Select = VxeSelect;
|
|
|
35208
35242
|
handleReStyle(evnt);
|
|
35209
35243
|
}
|
|
35210
35244
|
handleDrag(evnt);
|
|
35211
|
-
|
|
35245
|
+
dom_addClass(el, 'is--drag');
|
|
35212
35246
|
dispatchEvent('resize-start', {
|
|
35213
35247
|
prevItem,
|
|
35214
35248
|
nextItem
|
|
@@ -37509,16 +37543,16 @@ const scrollbarOffsetSize = 20;
|
|
|
37509
37543
|
} = headerWrapperEl;
|
|
37510
37544
|
if (headPrevEl) {
|
|
37511
37545
|
if ((lrPosition ? scrollTop : scrollLeft) > 0) {
|
|
37512
|
-
|
|
37546
|
+
dom_addClass(headPrevEl, 'scrolling--middle');
|
|
37513
37547
|
} else {
|
|
37514
|
-
|
|
37548
|
+
dom_removeClass(headPrevEl, 'scrolling--middle');
|
|
37515
37549
|
}
|
|
37516
37550
|
}
|
|
37517
37551
|
if (headNextEl) {
|
|
37518
37552
|
if (lrPosition ? clientHeight < scrollHeight - Math.ceil(scrollTop) : clientWidth < scrollWidth - Math.ceil(scrollLeft)) {
|
|
37519
|
-
|
|
37553
|
+
dom_addClass(headNextEl, 'scrolling--middle');
|
|
37520
37554
|
} else {
|
|
37521
|
-
|
|
37555
|
+
dom_removeClass(headNextEl, 'scrolling--middle');
|
|
37522
37556
|
}
|
|
37523
37557
|
}
|
|
37524
37558
|
}
|
|
@@ -39364,6 +39398,53 @@ function calcTreeLine($xeTree, node, prevNode) {
|
|
|
39364
39398
|
}
|
|
39365
39399
|
return (rowHeight || 28) * expandSize - (prevNode ? 1 : 12);
|
|
39366
39400
|
}
|
|
39401
|
+
;// CONCATENATED MODULE: ./packages/ui/src/anime.ts
|
|
39402
|
+
|
|
39403
|
+
|
|
39404
|
+
const rowMoveCls = 'row--drag-move';
|
|
39405
|
+
const colMoveClass = 'col--drag-move';
|
|
39406
|
+
/**
|
|
39407
|
+
* 上下拖拽
|
|
39408
|
+
*/
|
|
39409
|
+
function moveRowAnimateToTb(elemList, offsetTop) {
|
|
39410
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
|
|
39411
|
+
trEl.style.transform = `translateY(${offsetTop}px)`;
|
|
39412
|
+
});
|
|
39413
|
+
requestAnimationFrame(() => {
|
|
39414
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
|
|
39415
|
+
dom_addClass(trEl, rowMoveCls);
|
|
39416
|
+
trEl.style.transform = '';
|
|
39417
|
+
});
|
|
39418
|
+
});
|
|
39419
|
+
}
|
|
39420
|
+
function clearRowAnimate(elem, clss) {
|
|
39421
|
+
setTimeout(() => {
|
|
39422
|
+
if (elem) {
|
|
39423
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elem.querySelectorAll(clss.map(cls => `${cls}.${rowMoveCls}`).join(',')), elem => dom_removeClass(elem, rowMoveCls));
|
|
39424
|
+
}
|
|
39425
|
+
}, 500);
|
|
39426
|
+
}
|
|
39427
|
+
/**
|
|
39428
|
+
* 左右拖拽
|
|
39429
|
+
*/
|
|
39430
|
+
function moveColAnimateToLr(elemList, offsetLeft) {
|
|
39431
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
39432
|
+
trEl.style.transform = `translateX(${offsetLeft}px)`;
|
|
39433
|
+
});
|
|
39434
|
+
requestAnimationFrame(() => {
|
|
39435
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
39436
|
+
addClass(trEl, colMoveClass);
|
|
39437
|
+
trEl.style.transform = '';
|
|
39438
|
+
});
|
|
39439
|
+
});
|
|
39440
|
+
}
|
|
39441
|
+
function clearColAnimate(elem, clss) {
|
|
39442
|
+
setTimeout(() => {
|
|
39443
|
+
if (elem) {
|
|
39444
|
+
XEUtils.arrayEach(elem.querySelectorAll(clss.map(cls => `${cls}.${rowMoveCls}`).join(',')), elem => removeClass(elem, colMoveClass));
|
|
39445
|
+
}
|
|
39446
|
+
}, 500);
|
|
39447
|
+
}
|
|
39367
39448
|
;// CONCATENATED MODULE: ./packages/tree/src/tree.ts
|
|
39368
39449
|
|
|
39369
39450
|
|
|
@@ -39375,6 +39456,7 @@ function calcTreeLine($xeTree, node, prevNode) {
|
|
|
39375
39456
|
|
|
39376
39457
|
|
|
39377
39458
|
|
|
39459
|
+
|
|
39378
39460
|
/**
|
|
39379
39461
|
* 生成节点的唯一主键
|
|
39380
39462
|
*/
|
|
@@ -39402,6 +39484,9 @@ function tree_createInternalData() {
|
|
|
39402
39484
|
offsetSize: 0,
|
|
39403
39485
|
rowHeight: 0
|
|
39404
39486
|
},
|
|
39487
|
+
// prevDragNode: null,
|
|
39488
|
+
// prevDragToChild: false,
|
|
39489
|
+
// prevDragPos: ''
|
|
39405
39490
|
lastScrollTime: 0
|
|
39406
39491
|
// hpTimeout: undefined
|
|
39407
39492
|
};
|
|
@@ -39495,6 +39580,11 @@ function tree_createInternalData() {
|
|
|
39495
39580
|
lazy: Boolean,
|
|
39496
39581
|
toggleMethod: Function,
|
|
39497
39582
|
loadMethod: Function,
|
|
39583
|
+
drag: {
|
|
39584
|
+
type: Boolean,
|
|
39585
|
+
default: () => getConfig().tree.drag
|
|
39586
|
+
},
|
|
39587
|
+
dragConfig: Object,
|
|
39498
39588
|
showIcon: {
|
|
39499
39589
|
type: Boolean,
|
|
39500
39590
|
default: true
|
|
@@ -39519,7 +39609,7 @@ function tree_createInternalData() {
|
|
|
39519
39609
|
},
|
|
39520
39610
|
virtualYConfig: Object
|
|
39521
39611
|
},
|
|
39522
|
-
emits: ['update:modelValue', 'update:checkNodeKey', 'update:checkNodeKeys', 'node-click', 'node-dblclick', 'current-change', 'radio-change', 'checkbox-change', 'load-success', 'load-error', 'scroll'],
|
|
39612
|
+
emits: ['update:modelValue', 'update:checkNodeKey', 'update:checkNodeKeys', 'node-click', 'node-dblclick', 'current-change', 'radio-change', 'checkbox-change', 'load-success', 'load-error', 'scroll', 'node-dragstart', 'node-dragover', 'node-dragend'],
|
|
39523
39613
|
setup(props, context) {
|
|
39524
39614
|
const {
|
|
39525
39615
|
emit,
|
|
@@ -39534,6 +39624,8 @@ function tree_createInternalData() {
|
|
|
39534
39624
|
const refFooterWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39535
39625
|
const refVirtualWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39536
39626
|
const refVirtualBody = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39627
|
+
const refDragNodeLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39628
|
+
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39537
39629
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
39538
39630
|
parentHeight: 0,
|
|
39539
39631
|
customHeight: 0,
|
|
@@ -39546,7 +39638,9 @@ function tree_createInternalData() {
|
|
|
39546
39638
|
selectRadioKey: enNodeValue(props.checkNodeKey),
|
|
39547
39639
|
treeList: [],
|
|
39548
39640
|
updateExpandedFlag: 1,
|
|
39549
|
-
updateCheckboxFlag: 1
|
|
39641
|
+
updateCheckboxFlag: 1,
|
|
39642
|
+
dragNode: null,
|
|
39643
|
+
dragTipText: ''
|
|
39550
39644
|
});
|
|
39551
39645
|
const internalData = tree_createInternalData();
|
|
39552
39646
|
const refMaps = {
|
|
@@ -39613,6 +39707,9 @@ function tree_createInternalData() {
|
|
|
39613
39707
|
const computeLoadingOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39614
39708
|
return Object.assign({}, getConfig().tree.loadingConfig, props.loadingConfig);
|
|
39615
39709
|
});
|
|
39710
|
+
const computeDragOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39711
|
+
return Object.assign({}, getConfig().tree.dragConfig, props.dragConfig);
|
|
39712
|
+
});
|
|
39616
39713
|
const computeTreeStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39617
39714
|
const {
|
|
39618
39715
|
customHeight,
|
|
@@ -39635,11 +39732,14 @@ function tree_createInternalData() {
|
|
|
39635
39732
|
return Object.assign({}, getConfig().tree.filterConfig, props.filterConfig);
|
|
39636
39733
|
});
|
|
39637
39734
|
const computeMaps = {
|
|
39735
|
+
computeKeyField,
|
|
39736
|
+
computeParentField,
|
|
39638
39737
|
computeChildrenField,
|
|
39639
39738
|
computeMapChildrenField,
|
|
39640
39739
|
computeRadioOpts,
|
|
39641
39740
|
computeCheckboxOpts,
|
|
39642
|
-
computeNodeOpts
|
|
39741
|
+
computeNodeOpts,
|
|
39742
|
+
computeDragOpts
|
|
39643
39743
|
};
|
|
39644
39744
|
const $xeTree = {
|
|
39645
39745
|
xID,
|
|
@@ -39783,7 +39883,7 @@ function tree_createInternalData() {
|
|
|
39783
39883
|
const el = refElem.value;
|
|
39784
39884
|
return el ? el.parentElement : null;
|
|
39785
39885
|
};
|
|
39786
|
-
const
|
|
39886
|
+
const calcTreeHeight = key => {
|
|
39787
39887
|
const {
|
|
39788
39888
|
parentHeight
|
|
39789
39889
|
} = reactData;
|
|
@@ -39804,9 +39904,9 @@ function tree_createInternalData() {
|
|
|
39804
39904
|
return num;
|
|
39805
39905
|
};
|
|
39806
39906
|
const updateHeight = () => {
|
|
39807
|
-
reactData.customHeight =
|
|
39808
|
-
reactData.customMinHeight =
|
|
39809
|
-
reactData.customMaxHeight =
|
|
39907
|
+
reactData.customHeight = calcTreeHeight('height');
|
|
39908
|
+
reactData.customMinHeight = calcTreeHeight('minHeight');
|
|
39909
|
+
reactData.customMaxHeight = calcTreeHeight('maxHeight');
|
|
39810
39910
|
// 如果启用虚拟滚动,默认高度
|
|
39811
39911
|
if (reactData.scrollYLoad && !(reactData.customHeight || reactData.customMinHeight)) {
|
|
39812
39912
|
reactData.customHeight = 300;
|
|
@@ -39842,10 +39942,12 @@ function tree_createInternalData() {
|
|
|
39842
39942
|
keyMaps[nodeid] = {
|
|
39843
39943
|
item,
|
|
39844
39944
|
index,
|
|
39945
|
+
$index: -1,
|
|
39946
|
+
_index: -1,
|
|
39845
39947
|
items,
|
|
39846
39948
|
parent,
|
|
39847
39949
|
nodes,
|
|
39848
|
-
level: nodes.length,
|
|
39950
|
+
level: nodes.length - 1,
|
|
39849
39951
|
treeIndex: index,
|
|
39850
39952
|
lineCount: 0,
|
|
39851
39953
|
treeLoaded: false
|
|
@@ -39865,16 +39967,20 @@ function tree_createInternalData() {
|
|
|
39865
39967
|
} = internalData;
|
|
39866
39968
|
const childrenField = computeChildrenField.value;
|
|
39867
39969
|
const mapChildrenField = computeMapChildrenField.value;
|
|
39970
|
+
let vtIndex = 0;
|
|
39868
39971
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items) => {
|
|
39869
39972
|
const nodeid = getNodeId(item);
|
|
39870
39973
|
const nodeItem = nodeMaps[nodeid];
|
|
39871
39974
|
if (nodeItem) {
|
|
39872
39975
|
nodeItem.items = items;
|
|
39873
39976
|
nodeItem.treeIndex = index;
|
|
39977
|
+
nodeItem._index = vtIndex;
|
|
39874
39978
|
} else {
|
|
39875
39979
|
const rest = {
|
|
39876
39980
|
item,
|
|
39877
39981
|
index,
|
|
39982
|
+
$index: -1,
|
|
39983
|
+
_index: vtIndex,
|
|
39878
39984
|
items,
|
|
39879
39985
|
parent,
|
|
39880
39986
|
nodes: [],
|
|
@@ -39885,6 +39991,7 @@ function tree_createInternalData() {
|
|
|
39885
39991
|
};
|
|
39886
39992
|
nodeMaps[nodeid] = rest;
|
|
39887
39993
|
}
|
|
39994
|
+
vtIndex++;
|
|
39888
39995
|
}, {
|
|
39889
39996
|
children: transform ? mapChildrenField : childrenField
|
|
39890
39997
|
});
|
|
@@ -40030,7 +40137,8 @@ function tree_createInternalData() {
|
|
|
40030
40137
|
scrollYLoad
|
|
40031
40138
|
} = reactData;
|
|
40032
40139
|
const {
|
|
40033
|
-
scrollYStore
|
|
40140
|
+
scrollYStore,
|
|
40141
|
+
nodeMaps
|
|
40034
40142
|
} = internalData;
|
|
40035
40143
|
let fullList = internalData.afterVisibleList;
|
|
40036
40144
|
if (force) {
|
|
@@ -40040,6 +40148,13 @@ function tree_createInternalData() {
|
|
|
40040
40148
|
fullList = handleTreeToList();
|
|
40041
40149
|
}
|
|
40042
40150
|
const treeList = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
|
|
40151
|
+
treeList.forEach((item, $index) => {
|
|
40152
|
+
const nodeid = getNodeId(item);
|
|
40153
|
+
const itemRest = nodeMaps[nodeid];
|
|
40154
|
+
if (itemRest) {
|
|
40155
|
+
itemRest.$index = $index;
|
|
40156
|
+
}
|
|
40157
|
+
});
|
|
40043
40158
|
reactData.treeList = treeList;
|
|
40044
40159
|
};
|
|
40045
40160
|
const triggerSearchEvent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => handleData(true), 350, {
|
|
@@ -40286,6 +40401,40 @@ function tree_createInternalData() {
|
|
|
40286
40401
|
internalData.lastScrollLeft = 0;
|
|
40287
40402
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
40288
40403
|
};
|
|
40404
|
+
const handleNodeMousedownEvent = (evnt, node) => {
|
|
40405
|
+
const {
|
|
40406
|
+
drag
|
|
40407
|
+
} = props;
|
|
40408
|
+
const {
|
|
40409
|
+
nodeMaps
|
|
40410
|
+
} = internalData;
|
|
40411
|
+
const targetEl = evnt.currentTarget;
|
|
40412
|
+
const dragConfig = computeDragOpts.value;
|
|
40413
|
+
const {
|
|
40414
|
+
trigger,
|
|
40415
|
+
isCrossDrag,
|
|
40416
|
+
isPeerDrag,
|
|
40417
|
+
disabledMethod
|
|
40418
|
+
} = dragConfig;
|
|
40419
|
+
const nodeid = getNodeId(node);
|
|
40420
|
+
const triggerTreeNode = getEventTargetNode(evnt, targetEl, 'vxe-tree--node-item-switcher').flag;
|
|
40421
|
+
let isNodeDrag = false;
|
|
40422
|
+
if (drag) {
|
|
40423
|
+
isNodeDrag = trigger === 'node';
|
|
40424
|
+
}
|
|
40425
|
+
if (!triggerTreeNode) {
|
|
40426
|
+
const params = {
|
|
40427
|
+
node,
|
|
40428
|
+
$tree: $xeTree
|
|
40429
|
+
};
|
|
40430
|
+
const itemRest = nodeMaps[nodeid];
|
|
40431
|
+
if (isNodeDrag && (isCrossDrag || isPeerDrag || itemRest && !itemRest.level) && !(disabledMethod && disabledMethod(params))) {
|
|
40432
|
+
handleNodeDragMousedownEvent(evnt, {
|
|
40433
|
+
node
|
|
40434
|
+
});
|
|
40435
|
+
}
|
|
40436
|
+
}
|
|
40437
|
+
};
|
|
40289
40438
|
const handleNodeClickEvent = (evnt, node) => {
|
|
40290
40439
|
const {
|
|
40291
40440
|
showRadio,
|
|
@@ -41120,6 +41269,8 @@ function tree_createInternalData() {
|
|
|
41120
41269
|
nodeMaps[itemNodeId] = {
|
|
41121
41270
|
item: childRow,
|
|
41122
41271
|
index: -1,
|
|
41272
|
+
$index: -1,
|
|
41273
|
+
_index: -1,
|
|
41123
41274
|
items,
|
|
41124
41275
|
parent: parent || parentNodeItem.item,
|
|
41125
41276
|
nodes: parentNodes.concat(nodes),
|
|
@@ -41160,6 +41311,12 @@ function tree_createInternalData() {
|
|
|
41160
41311
|
return list;
|
|
41161
41312
|
},
|
|
41162
41313
|
recalculate,
|
|
41314
|
+
getFullData() {
|
|
41315
|
+
const {
|
|
41316
|
+
treeFullData
|
|
41317
|
+
} = internalData;
|
|
41318
|
+
return treeFullData.slice(0);
|
|
41319
|
+
},
|
|
41163
41320
|
scrollTo: handleScrollTo,
|
|
41164
41321
|
scrollToNode(node) {
|
|
41165
41322
|
return $xeTree.scrollToNodeId(getNodeId(node));
|
|
@@ -41200,8 +41357,562 @@ function tree_createInternalData() {
|
|
|
41200
41357
|
},
|
|
41201
41358
|
clearScroll
|
|
41202
41359
|
};
|
|
41203
|
-
const
|
|
41360
|
+
const clearNodeDropOrigin = () => {
|
|
41361
|
+
const el = refElem.value;
|
|
41362
|
+
if (el) {
|
|
41363
|
+
const clss = 'node--drag-origin';
|
|
41364
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
|
|
41365
|
+
elem.draggable = false;
|
|
41366
|
+
dom_removeClass(elem, clss);
|
|
41367
|
+
});
|
|
41368
|
+
}
|
|
41369
|
+
};
|
|
41370
|
+
const updateNodeDropOrigin = node => {
|
|
41371
|
+
const el = refElem.value;
|
|
41372
|
+
if (el) {
|
|
41373
|
+
const clss = 'node--drag-origin';
|
|
41374
|
+
const nodeid = getNodeId(node);
|
|
41375
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.vxe-tree--node-wrapper[nodeid="${nodeid}"]`), elem => {
|
|
41376
|
+
dom_addClass(elem, clss);
|
|
41377
|
+
});
|
|
41378
|
+
}
|
|
41379
|
+
};
|
|
41380
|
+
const updateRowDropTipContent = itemEl => {
|
|
41381
|
+
const {
|
|
41382
|
+
dragNode
|
|
41383
|
+
} = reactData;
|
|
41384
|
+
const dragOpts = computeDragOpts.value;
|
|
41385
|
+
const {
|
|
41386
|
+
tooltipMethod
|
|
41387
|
+
} = dragOpts;
|
|
41388
|
+
const rTooltipMethod = tooltipMethod;
|
|
41389
|
+
let tipContent = '';
|
|
41390
|
+
if (rTooltipMethod) {
|
|
41391
|
+
const rtParams = {
|
|
41392
|
+
$tree: $xeTree,
|
|
41393
|
+
node: dragNode
|
|
41394
|
+
};
|
|
41395
|
+
tipContent = `${rTooltipMethod(rtParams) || ''}`;
|
|
41396
|
+
} else {
|
|
41397
|
+
tipContent = getI18n('vxe.tree.dragTip', [itemEl.textContent || '']);
|
|
41398
|
+
}
|
|
41399
|
+
reactData.dragTipText = tipContent;
|
|
41400
|
+
};
|
|
41401
|
+
const hideDropTip = () => {
|
|
41402
|
+
const rdTipEl = refDragTipElem.value;
|
|
41403
|
+
const rdLineEl = refDragNodeLineElem.value;
|
|
41404
|
+
if (rdTipEl) {
|
|
41405
|
+
rdTipEl.style.display = '';
|
|
41406
|
+
}
|
|
41407
|
+
if (rdLineEl) {
|
|
41408
|
+
rdLineEl.style.display = '';
|
|
41409
|
+
}
|
|
41410
|
+
};
|
|
41411
|
+
const clearDragStatus = () => {
|
|
41412
|
+
const {
|
|
41413
|
+
dragNode
|
|
41414
|
+
} = reactData;
|
|
41415
|
+
if (dragNode) {
|
|
41416
|
+
clearNodeDropOrigin();
|
|
41417
|
+
hideDropTip();
|
|
41418
|
+
reactData.dragNode = null;
|
|
41419
|
+
}
|
|
41420
|
+
};
|
|
41421
|
+
const handleNodeDragMousedownEvent = (evnt, params) => {
|
|
41422
|
+
evnt.stopPropagation();
|
|
41423
|
+
const {
|
|
41424
|
+
node
|
|
41425
|
+
} = params;
|
|
41426
|
+
const dragConfig = computeDragOpts.value;
|
|
41427
|
+
const {
|
|
41428
|
+
trigger,
|
|
41429
|
+
dragStartMethod
|
|
41430
|
+
} = dragConfig;
|
|
41431
|
+
const dragEl = evnt.currentTarget;
|
|
41432
|
+
const itemEl = trigger === 'node' ? dragEl : dragEl.parentElement.parentElement;
|
|
41433
|
+
clearNodeDropOrigin();
|
|
41434
|
+
if (dragStartMethod && !dragStartMethod(params)) {
|
|
41435
|
+
itemEl.draggable = false;
|
|
41436
|
+
reactData.dragNode = null;
|
|
41437
|
+
hideDropTip();
|
|
41438
|
+
return;
|
|
41439
|
+
}
|
|
41440
|
+
reactData.dragNode = node;
|
|
41441
|
+
itemEl.draggable = true;
|
|
41442
|
+
updateNodeDropOrigin(node);
|
|
41443
|
+
updateRowDropTipContent(itemEl);
|
|
41444
|
+
dispatchEvent('node-dragstart', params, evnt);
|
|
41445
|
+
};
|
|
41446
|
+
const handleNodeDragMouseupEvent = () => {
|
|
41447
|
+
clearDragStatus();
|
|
41448
|
+
};
|
|
41449
|
+
const showDropTip = (evnt, itemEl, showLine, dragPos) => {
|
|
41450
|
+
const wrapperEl = refElem.value;
|
|
41451
|
+
if (!wrapperEl) {
|
|
41452
|
+
return;
|
|
41453
|
+
}
|
|
41454
|
+
const {
|
|
41455
|
+
prevDragToChild
|
|
41456
|
+
} = internalData;
|
|
41457
|
+
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
41458
|
+
const wrapperHeight = wrapperEl.clientHeight;
|
|
41459
|
+
if (itemEl) {
|
|
41460
|
+
const rdLineEl = refDragNodeLineElem.value;
|
|
41461
|
+
if (rdLineEl) {
|
|
41462
|
+
if (showLine) {
|
|
41463
|
+
const trRect = itemEl.getBoundingClientRect();
|
|
41464
|
+
let itemHeight = itemEl.clientHeight;
|
|
41465
|
+
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
41466
|
+
if (offsetTop + itemHeight > wrapperHeight) {
|
|
41467
|
+
itemHeight = wrapperHeight - offsetTop;
|
|
41468
|
+
}
|
|
41469
|
+
rdLineEl.style.display = 'block';
|
|
41470
|
+
rdLineEl.style.top = `${offsetTop}px`;
|
|
41471
|
+
rdLineEl.style.height = `${itemHeight}px`;
|
|
41472
|
+
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
41473
|
+
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
41474
|
+
} else {
|
|
41475
|
+
rdLineEl.style.display = '';
|
|
41476
|
+
}
|
|
41477
|
+
}
|
|
41478
|
+
}
|
|
41479
|
+
const rdTipEl = refDragTipElem.value;
|
|
41480
|
+
if (rdTipEl) {
|
|
41481
|
+
rdTipEl.style.display = 'block';
|
|
41482
|
+
rdTipEl.style.top = `${Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
|
|
41483
|
+
rdTipEl.style.left = `${Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - rdTipEl.clientWidth - 1, evnt.clientX - wrapperRect.x)}px`;
|
|
41484
|
+
rdTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
|
|
41485
|
+
}
|
|
41486
|
+
};
|
|
41487
|
+
const clearNodeDragData = () => {
|
|
41488
|
+
const wrapperEl = refElem.value;
|
|
41489
|
+
const dtClss = ['.vxe-tree--node-wrapper'];
|
|
41490
|
+
hideDropTip();
|
|
41491
|
+
clearNodeDropOrigin();
|
|
41492
|
+
clearRowAnimate(wrapperEl, dtClss);
|
|
41493
|
+
internalData.prevDragToChild = false;
|
|
41494
|
+
reactData.dragNode = null;
|
|
41495
|
+
};
|
|
41496
|
+
const handleNodeDragSwapEvent = (evnt, dragNode, prevDragNode, prevDragPos, prevDragToChild) => {
|
|
41497
|
+
const {
|
|
41498
|
+
transform
|
|
41499
|
+
} = props;
|
|
41500
|
+
const {
|
|
41501
|
+
nodeMaps,
|
|
41502
|
+
treeFullData,
|
|
41503
|
+
afterVisibleList
|
|
41504
|
+
} = internalData;
|
|
41505
|
+
const dragConfig = computeDragOpts.value;
|
|
41506
|
+
const {
|
|
41507
|
+
animation,
|
|
41508
|
+
isCrossDrag,
|
|
41509
|
+
isPeerDrag,
|
|
41510
|
+
isSelfToChildDrag,
|
|
41511
|
+
dragEndMethod,
|
|
41512
|
+
dragToChildMethod
|
|
41513
|
+
} = dragConfig;
|
|
41514
|
+
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
41515
|
+
const keyField = computeKeyField.value;
|
|
41516
|
+
const parentField = computeParentField.value;
|
|
41517
|
+
const childrenField = computeChildrenField.value;
|
|
41518
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
41519
|
+
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
41520
|
+
const el = refElem.value;
|
|
41521
|
+
const errRest = {
|
|
41522
|
+
status: false
|
|
41523
|
+
};
|
|
41524
|
+
if (!(el && prevDragNode && dragNode)) {
|
|
41525
|
+
return Promise.resolve(errRest);
|
|
41526
|
+
}
|
|
41527
|
+
// 判断是否有拖动
|
|
41528
|
+
if (prevDragNode !== dragNode) {
|
|
41529
|
+
const dragParams = {
|
|
41530
|
+
oldNode: dragNode,
|
|
41531
|
+
newNode: prevDragNode,
|
|
41532
|
+
dragNode,
|
|
41533
|
+
dragPos: prevDragPos,
|
|
41534
|
+
dragToChild: !!prevDragToChild,
|
|
41535
|
+
offsetIndex: dragOffsetIndex
|
|
41536
|
+
};
|
|
41537
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
41538
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
41539
|
+
if (!status) {
|
|
41540
|
+
return errRest;
|
|
41541
|
+
}
|
|
41542
|
+
const dragNodeid = getNodeId(dragNode);
|
|
41543
|
+
const dragNodeRest = nodeMaps[dragNodeid] || {};
|
|
41544
|
+
const _dragNodeIndex = dragNodeRest._index;
|
|
41545
|
+
let dragNodeHeight = 0;
|
|
41546
|
+
let dragOffsetTop = -1;
|
|
41547
|
+
if (animation) {
|
|
41548
|
+
const prevItemEl = el.querySelector(`.vxe-tree--node-wrapper[nodeid="${prevDragNode}"]`);
|
|
41549
|
+
const oldItemEl = el.querySelector(`.vxe-tree--node-wrapper[nodeid="${dragNodeid}"]`);
|
|
41550
|
+
const targetItemEl = prevItemEl || oldItemEl;
|
|
41551
|
+
if (targetItemEl) {
|
|
41552
|
+
dragNodeHeight = targetItemEl.offsetHeight;
|
|
41553
|
+
}
|
|
41554
|
+
if (oldItemEl) {
|
|
41555
|
+
dragOffsetTop = oldItemEl.offsetTop;
|
|
41556
|
+
}
|
|
41557
|
+
}
|
|
41558
|
+
let oafIndex = -1;
|
|
41559
|
+
let nafIndex = -1;
|
|
41560
|
+
if (transform) {
|
|
41561
|
+
// 移出源位置
|
|
41562
|
+
const oldRest = dragNodeRest;
|
|
41563
|
+
const newNodeid = getNodeId(prevDragNode);
|
|
41564
|
+
const newRest = nodeMaps[newNodeid];
|
|
41565
|
+
if (oldRest && newRest) {
|
|
41566
|
+
const {
|
|
41567
|
+
level: oldLevel
|
|
41568
|
+
} = oldRest;
|
|
41569
|
+
const {
|
|
41570
|
+
level: newLevel
|
|
41571
|
+
} = newRest;
|
|
41572
|
+
const oldAllMaps = {};
|
|
41573
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragNode], item => {
|
|
41574
|
+
oldAllMaps[getNodeId(item)] = item;
|
|
41575
|
+
}, {
|
|
41576
|
+
children: mapChildrenField
|
|
41577
|
+
});
|
|
41578
|
+
let isSelfToChildStatus = false;
|
|
41579
|
+
if (oldLevel && newLevel) {
|
|
41580
|
+
// 子到子
|
|
41581
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
41582
|
+
if (oldRest.item[parentField] !== newRest.item[parentField]) {
|
|
41583
|
+
// 非同级
|
|
41584
|
+
return errRest;
|
|
41585
|
+
}
|
|
41586
|
+
} else {
|
|
41587
|
+
if (!isCrossDrag) {
|
|
41588
|
+
return errRest;
|
|
41589
|
+
}
|
|
41590
|
+
if (oldAllMaps[newNodeid]) {
|
|
41591
|
+
isSelfToChildStatus = true;
|
|
41592
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
41593
|
+
if (index_esm_VxeUI.modal) {
|
|
41594
|
+
index_esm_VxeUI.modal.message({
|
|
41595
|
+
status: 'error',
|
|
41596
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
41597
|
+
});
|
|
41598
|
+
}
|
|
41599
|
+
return errRest;
|
|
41600
|
+
}
|
|
41601
|
+
}
|
|
41602
|
+
}
|
|
41603
|
+
} else if (oldLevel) {
|
|
41604
|
+
// 子到根
|
|
41605
|
+
if (!isCrossDrag) {
|
|
41606
|
+
return errRest;
|
|
41607
|
+
}
|
|
41608
|
+
} else if (newLevel) {
|
|
41609
|
+
// 根到子
|
|
41610
|
+
if (!isCrossDrag) {
|
|
41611
|
+
return errRest;
|
|
41612
|
+
}
|
|
41613
|
+
if (oldAllMaps[newNodeid]) {
|
|
41614
|
+
isSelfToChildStatus = true;
|
|
41615
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
41616
|
+
if (index_esm_VxeUI.modal) {
|
|
41617
|
+
index_esm_VxeUI.modal.message({
|
|
41618
|
+
status: 'error',
|
|
41619
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
41620
|
+
});
|
|
41621
|
+
}
|
|
41622
|
+
return errRest;
|
|
41623
|
+
}
|
|
41624
|
+
}
|
|
41625
|
+
} else {
|
|
41626
|
+
// 根到根
|
|
41627
|
+
}
|
|
41628
|
+
const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeList, {
|
|
41629
|
+
key: keyField,
|
|
41630
|
+
parentKey: parentField,
|
|
41631
|
+
children: mapChildrenField
|
|
41632
|
+
});
|
|
41633
|
+
// 移出
|
|
41634
|
+
const otfIndex = $xeTree.findNodeIndexOf(fullList, dragNode);
|
|
41635
|
+
fullList.splice(otfIndex, 1);
|
|
41636
|
+
// 插入
|
|
41637
|
+
const ptfIndex = $xeTree.findNodeIndexOf(fullList, prevDragNode);
|
|
41638
|
+
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
41639
|
+
fullList.splice(ntfIndex, 0, dragNode);
|
|
41640
|
+
// 改变层级
|
|
41641
|
+
if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
|
|
41642
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(dragNode[childrenField], childNode => {
|
|
41643
|
+
childNode[parentField] = dragNode[parentField];
|
|
41644
|
+
});
|
|
41645
|
+
}
|
|
41646
|
+
dragNode[parentField] = isDragToChildFlag ? prevDragNode[keyField] : prevDragNode[parentField];
|
|
41647
|
+
internalData.treeFullData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
|
|
41648
|
+
key: keyField,
|
|
41649
|
+
parentKey: parentField,
|
|
41650
|
+
children: childrenField,
|
|
41651
|
+
mapChildren: mapChildrenField
|
|
41652
|
+
});
|
|
41653
|
+
}
|
|
41654
|
+
} else {
|
|
41655
|
+
// 移出
|
|
41656
|
+
oafIndex = $xeTree.findNodeIndexOf(afterVisibleList, dragNode);
|
|
41657
|
+
const otfIndex = $xeTree.findNodeIndexOf(treeFullData, dragNode);
|
|
41658
|
+
afterVisibleList.splice(oafIndex, 1);
|
|
41659
|
+
treeFullData.splice(otfIndex, 1);
|
|
41660
|
+
// 插入
|
|
41661
|
+
const pafIndex = $xeTree.findNodeIndexOf(afterVisibleList, prevDragNode);
|
|
41662
|
+
const ptfIndex = $xeTree.findNodeIndexOf(treeFullData, prevDragNode);
|
|
41663
|
+
nafIndex = pafIndex + dragOffsetIndex;
|
|
41664
|
+
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
41665
|
+
afterVisibleList.splice(nafIndex, 0, dragNode);
|
|
41666
|
+
treeFullData.splice(ntfIndex, 0, dragNode);
|
|
41667
|
+
}
|
|
41668
|
+
cacheNodeMap();
|
|
41669
|
+
handleData(transform);
|
|
41670
|
+
if (!transform) {
|
|
41671
|
+
updateAfterDataIndex();
|
|
41672
|
+
}
|
|
41673
|
+
updateCheckboxStatus();
|
|
41674
|
+
if (reactData.scrollYLoad) {
|
|
41675
|
+
updateYSpace();
|
|
41676
|
+
}
|
|
41677
|
+
if (evnt) {
|
|
41678
|
+
dispatchEvent('node-dragend', {
|
|
41679
|
+
oldNode: dragNode,
|
|
41680
|
+
newNode: prevDragNode,
|
|
41681
|
+
dragNode,
|
|
41682
|
+
dragPos: prevDragPos,
|
|
41683
|
+
dragToChild: isDragToChildFlag,
|
|
41684
|
+
offsetIndex: dragOffsetIndex,
|
|
41685
|
+
_index: {
|
|
41686
|
+
newIndex: nafIndex,
|
|
41687
|
+
oldIndex: oafIndex
|
|
41688
|
+
}
|
|
41689
|
+
}, evnt);
|
|
41690
|
+
}
|
|
41691
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
41692
|
+
if (animation) {
|
|
41693
|
+
const {
|
|
41694
|
+
treeList
|
|
41695
|
+
} = reactData;
|
|
41696
|
+
const {
|
|
41697
|
+
nodeMaps
|
|
41698
|
+
} = internalData;
|
|
41699
|
+
const dragNodeRest = nodeMaps[dragNodeid];
|
|
41700
|
+
const _newNodeIndex = dragNodeRest._index;
|
|
41701
|
+
const firstNode = treeList[0];
|
|
41702
|
+
const firstNodeRest = nodeMaps[getNodeId(firstNode)];
|
|
41703
|
+
const wrapperEl = el;
|
|
41704
|
+
if (firstNodeRest) {
|
|
41705
|
+
const _firstNodeIndex = firstNodeRest._index;
|
|
41706
|
+
const _lastNodeIndex = _firstNodeIndex + treeList.length;
|
|
41707
|
+
let rsIndex = -1;
|
|
41708
|
+
let reIndex = -1;
|
|
41709
|
+
let offsetRate = 1;
|
|
41710
|
+
if (_dragNodeIndex < _firstNodeIndex) {
|
|
41711
|
+
// 从上往下虚拟拖拽
|
|
41712
|
+
rsIndex = 0;
|
|
41713
|
+
reIndex = _newNodeIndex - _firstNodeIndex;
|
|
41714
|
+
} else if (_dragNodeIndex > _lastNodeIndex) {
|
|
41715
|
+
// 从下往上虚拟拖拽
|
|
41716
|
+
const $newNodeIndex = dragNodeRest.$index;
|
|
41717
|
+
rsIndex = $newNodeIndex + 1;
|
|
41718
|
+
reIndex = treeList.length;
|
|
41719
|
+
offsetRate = -1;
|
|
41720
|
+
} else {
|
|
41721
|
+
if (_newNodeIndex > _dragNodeIndex) {
|
|
41722
|
+
// 从上往下拖拽
|
|
41723
|
+
rsIndex = _dragNodeIndex - _firstNodeIndex;
|
|
41724
|
+
reIndex = rsIndex + _newNodeIndex - _dragNodeIndex;
|
|
41725
|
+
} else {
|
|
41726
|
+
// 从下往上拖拽
|
|
41727
|
+
rsIndex = _newNodeIndex - _firstNodeIndex;
|
|
41728
|
+
reIndex = rsIndex + _dragNodeIndex - _newNodeIndex + 1;
|
|
41729
|
+
offsetRate = -1;
|
|
41730
|
+
}
|
|
41731
|
+
}
|
|
41732
|
+
const dragRangeList = treeList.slice(rsIndex, reIndex);
|
|
41733
|
+
if (dragRangeList.length) {
|
|
41734
|
+
const dtClss = [];
|
|
41735
|
+
dragRangeList.forEach(item => {
|
|
41736
|
+
const nodeid = getNodeId(item);
|
|
41737
|
+
dtClss.push(`.vxe-tree--node-wrapper[nodeid="${nodeid}"]`);
|
|
41738
|
+
});
|
|
41739
|
+
const dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
|
|
41740
|
+
moveRowAnimateToTb(dtTrList, offsetRate * dragNodeHeight);
|
|
41741
|
+
}
|
|
41742
|
+
}
|
|
41743
|
+
const drClss = [`.vxe-tree--node-wrapper[nodeid="${dragNodeid}"]`];
|
|
41744
|
+
const newDtTrList = wrapperEl.querySelectorAll(drClss.join(','));
|
|
41745
|
+
const newTrEl = newDtTrList[0];
|
|
41746
|
+
if (dragOffsetTop > -1 && newTrEl) {
|
|
41747
|
+
moveRowAnimateToTb(newDtTrList, dragOffsetTop - newTrEl.offsetTop);
|
|
41748
|
+
}
|
|
41749
|
+
}
|
|
41750
|
+
recalculate();
|
|
41751
|
+
}).then(() => {
|
|
41752
|
+
return {
|
|
41753
|
+
status: true
|
|
41754
|
+
};
|
|
41755
|
+
});
|
|
41756
|
+
}).catch(() => {
|
|
41757
|
+
return errRest;
|
|
41758
|
+
}).then(rest => {
|
|
41759
|
+
clearNodeDragData();
|
|
41760
|
+
return rest;
|
|
41761
|
+
});
|
|
41762
|
+
}
|
|
41763
|
+
clearNodeDragData();
|
|
41764
|
+
return Promise.resolve(errRest);
|
|
41765
|
+
};
|
|
41766
|
+
const handleNodeDragDragstartEvent = evnt => {
|
|
41767
|
+
if (evnt.dataTransfer) {
|
|
41768
|
+
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
41769
|
+
}
|
|
41770
|
+
};
|
|
41771
|
+
const handleNodeDragDragendEvent = evnt => {
|
|
41772
|
+
const {
|
|
41773
|
+
lazy
|
|
41774
|
+
} = props;
|
|
41775
|
+
const {
|
|
41776
|
+
dragNode
|
|
41777
|
+
} = reactData;
|
|
41778
|
+
const {
|
|
41779
|
+
nodeMaps,
|
|
41780
|
+
prevDragNode,
|
|
41781
|
+
prevDragPos,
|
|
41782
|
+
prevDragToChild
|
|
41783
|
+
} = internalData;
|
|
41784
|
+
const hasChildField = computeHasChildField.value;
|
|
41785
|
+
if (lazy && prevDragToChild) {
|
|
41786
|
+
// 懒加载
|
|
41787
|
+
const newNodeid = getNodeId(prevDragNode);
|
|
41788
|
+
const nodeRest = nodeMaps[newNodeid];
|
|
41789
|
+
if (prevDragNode[hasChildField]) {
|
|
41790
|
+
if (nodeRest && nodeRest.treeLoaded) {
|
|
41791
|
+
handleNodeDragSwapEvent(evnt, dragNode, prevDragNode, prevDragPos, prevDragToChild);
|
|
41792
|
+
}
|
|
41793
|
+
} else {
|
|
41794
|
+
handleNodeDragSwapEvent(evnt, dragNode, prevDragNode, prevDragPos, prevDragToChild);
|
|
41795
|
+
}
|
|
41796
|
+
} else {
|
|
41797
|
+
handleNodeDragSwapEvent(evnt, dragNode, prevDragNode, prevDragPos, prevDragToChild);
|
|
41798
|
+
}
|
|
41799
|
+
};
|
|
41800
|
+
const handleNodeDragDragoverEvent = evnt => {
|
|
41801
|
+
const {
|
|
41802
|
+
lazy,
|
|
41803
|
+
transform
|
|
41804
|
+
} = props;
|
|
41805
|
+
const {
|
|
41806
|
+
dragNode
|
|
41807
|
+
} = reactData;
|
|
41808
|
+
const {
|
|
41809
|
+
nodeMaps
|
|
41810
|
+
} = internalData;
|
|
41811
|
+
const dragConfig = computeDragOpts.value;
|
|
41812
|
+
const parentField = computeParentField.value;
|
|
41813
|
+
const hasChildField = computeHasChildField.value;
|
|
41814
|
+
const {
|
|
41815
|
+
isCrossDrag,
|
|
41816
|
+
isPeerDrag,
|
|
41817
|
+
isToChildDrag
|
|
41818
|
+
} = dragConfig;
|
|
41819
|
+
if (!dragNode && !isCrossDrag) {
|
|
41820
|
+
evnt.preventDefault();
|
|
41821
|
+
}
|
|
41822
|
+
const isControlKey = hasControlKey(evnt);
|
|
41823
|
+
const itemEl = evnt.currentTarget;
|
|
41824
|
+
const nodeid = itemEl.getAttribute('nodeid') || '';
|
|
41825
|
+
const nodeItem = nodeMaps[nodeid];
|
|
41826
|
+
if (nodeItem) {
|
|
41827
|
+
evnt.preventDefault();
|
|
41828
|
+
const node = nodeItem.item;
|
|
41829
|
+
const offsetY = evnt.clientY - itemEl.getBoundingClientRect().y;
|
|
41830
|
+
const dragPos = offsetY < itemEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
41831
|
+
internalData.prevDragToChild = !!(transform && isCrossDrag && isToChildDrag && isControlKey);
|
|
41832
|
+
internalData.prevDragNode = node;
|
|
41833
|
+
internalData.prevDragPos = dragPos;
|
|
41834
|
+
if (dragNode && getNodeId(dragNode) === nodeid || isControlKey && lazy && node[hasChildField] && nodeItem && !nodeItem.treeLoaded || !isCrossDrag && transform && (isPeerDrag ? dragNode[parentField] !== node[parentField] : nodeItem.level)) {
|
|
41835
|
+
showDropTip(evnt, itemEl, false, dragPos);
|
|
41836
|
+
return;
|
|
41837
|
+
}
|
|
41838
|
+
showDropTip(evnt, itemEl, true, dragPos);
|
|
41839
|
+
dispatchEvent('node-dragover', {
|
|
41840
|
+
oldRNode: dragNode,
|
|
41841
|
+
targetNode: node,
|
|
41842
|
+
dragPos
|
|
41843
|
+
}, evnt);
|
|
41844
|
+
}
|
|
41845
|
+
};
|
|
41846
|
+
const treePrivateMethods = {
|
|
41847
|
+
handleData,
|
|
41848
|
+
cacheNodeMap,
|
|
41849
|
+
updateAfterDataIndex,
|
|
41850
|
+
updateCheckboxStatus,
|
|
41851
|
+
updateYSpace,
|
|
41852
|
+
findNodeIndexOf(list, node) {
|
|
41853
|
+
return node ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(list, item => $xeTree.eqNode(item, node)) : -1;
|
|
41854
|
+
},
|
|
41855
|
+
eqNode(node1, node2) {
|
|
41856
|
+
if (node1 && node2) {
|
|
41857
|
+
if (node1 === node2) {
|
|
41858
|
+
return true;
|
|
41859
|
+
}
|
|
41860
|
+
return getNodeId(node1) === getNodeId(node2);
|
|
41861
|
+
}
|
|
41862
|
+
return false;
|
|
41863
|
+
}
|
|
41864
|
+
};
|
|
41204
41865
|
Object.assign($xeTree, treeMethods, treePrivateMethods);
|
|
41866
|
+
const renderDragIcon = (node, nodeid) => {
|
|
41867
|
+
const {
|
|
41868
|
+
drag,
|
|
41869
|
+
transform
|
|
41870
|
+
} = props;
|
|
41871
|
+
const {
|
|
41872
|
+
nodeMaps
|
|
41873
|
+
} = internalData;
|
|
41874
|
+
const dragOpts = computeDragOpts.value;
|
|
41875
|
+
const {
|
|
41876
|
+
showIcon,
|
|
41877
|
+
isPeerDrag,
|
|
41878
|
+
isCrossDrag,
|
|
41879
|
+
visibleMethod
|
|
41880
|
+
} = dragOpts;
|
|
41881
|
+
const params = {
|
|
41882
|
+
node,
|
|
41883
|
+
$tree: $xeTree
|
|
41884
|
+
};
|
|
41885
|
+
if (drag && showIcon && transform && (!visibleMethod || visibleMethod(params))) {
|
|
41886
|
+
const nodeItem = nodeMaps[nodeid];
|
|
41887
|
+
if (nodeItem && (isPeerDrag || isCrossDrag || !nodeItem.level)) {
|
|
41888
|
+
const dragConfig = computeDragOpts.value;
|
|
41889
|
+
const {
|
|
41890
|
+
icon,
|
|
41891
|
+
trigger,
|
|
41892
|
+
disabledMethod
|
|
41893
|
+
} = dragConfig;
|
|
41894
|
+
const isDisabled = disabledMethod && disabledMethod(params);
|
|
41895
|
+
const ons = {};
|
|
41896
|
+
if (trigger !== 'node') {
|
|
41897
|
+
ons.onMousedown = evnt => {
|
|
41898
|
+
if (!isDisabled) {
|
|
41899
|
+
handleNodeDragMousedownEvent(evnt, params);
|
|
41900
|
+
}
|
|
41901
|
+
};
|
|
41902
|
+
ons.onMouseup = handleNodeDragMouseupEvent;
|
|
41903
|
+
}
|
|
41904
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41905
|
+
class: ['vxe-tree--drag-handle', {
|
|
41906
|
+
'is--disabled': isDisabled
|
|
41907
|
+
}],
|
|
41908
|
+
...ons
|
|
41909
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
41910
|
+
class: icon || getIcon().TREE_DRAG
|
|
41911
|
+
})]);
|
|
41912
|
+
}
|
|
41913
|
+
}
|
|
41914
|
+
return renderEmptyElement($xeTree);
|
|
41915
|
+
};
|
|
41205
41916
|
const renderRadio = (node, nodeid, isChecked) => {
|
|
41206
41917
|
const {
|
|
41207
41918
|
showRadio
|
|
@@ -41283,6 +41994,8 @@ function tree_createInternalData() {
|
|
|
41283
41994
|
const renderNode = (node, nodeid) => {
|
|
41284
41995
|
const {
|
|
41285
41996
|
lazy,
|
|
41997
|
+
drag,
|
|
41998
|
+
transform,
|
|
41286
41999
|
showRadio,
|
|
41287
42000
|
showCheckbox,
|
|
41288
42001
|
showLine,
|
|
@@ -41336,10 +42049,29 @@ function tree_createInternalData() {
|
|
|
41336
42049
|
node,
|
|
41337
42050
|
isExpand
|
|
41338
42051
|
};
|
|
42052
|
+
const itemOn = {
|
|
42053
|
+
onMousedown(evnt) {
|
|
42054
|
+
handleNodeMousedownEvent(evnt, node);
|
|
42055
|
+
},
|
|
42056
|
+
onMouseup: handleNodeDragMouseupEvent,
|
|
42057
|
+
onClick(evnt) {
|
|
42058
|
+
handleNodeClickEvent(evnt, node);
|
|
42059
|
+
},
|
|
42060
|
+
onDblclick(evnt) {
|
|
42061
|
+
handleNodeDblclickEvent(evnt, node);
|
|
42062
|
+
}
|
|
42063
|
+
};
|
|
42064
|
+
// 拖拽行事件
|
|
42065
|
+
if (drag && transform) {
|
|
42066
|
+
itemOn.onDragstart = handleNodeDragDragstartEvent;
|
|
42067
|
+
itemOn.onDragend = handleNodeDragDragendEvent;
|
|
42068
|
+
itemOn.onDragover = handleNodeDragDragoverEvent;
|
|
42069
|
+
}
|
|
41339
42070
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41340
42071
|
key: nodeid,
|
|
41341
42072
|
class: ['vxe-tree--node-wrapper', `node--level-${nLevel}`],
|
|
41342
|
-
nodeid
|
|
42073
|
+
nodeid,
|
|
42074
|
+
...itemOn
|
|
41343
42075
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41344
42076
|
class: ['vxe-tree--node-item', {
|
|
41345
42077
|
'is--current': currentNode && nodeid === getNodeId(currentNode),
|
|
@@ -41347,13 +42079,7 @@ function tree_createInternalData() {
|
|
|
41347
42079
|
'is-checkbox--checked': isCheckboxChecked
|
|
41348
42080
|
}],
|
|
41349
42081
|
style: {
|
|
41350
|
-
paddingLeft: `${
|
|
41351
|
-
},
|
|
41352
|
-
onClick(evnt) {
|
|
41353
|
-
handleNodeClickEvent(evnt, node);
|
|
41354
|
-
},
|
|
41355
|
-
onDblclick(evnt) {
|
|
41356
|
-
handleNodeDblclickEvent(evnt, node);
|
|
42082
|
+
paddingLeft: `${nLevel * (indent || 1)}px`
|
|
41357
42083
|
}
|
|
41358
42084
|
}, [showLine ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41359
42085
|
class: 'vxe-tree--node-line-wrapper'
|
|
@@ -41371,7 +42097,7 @@ function tree_createInternalData() {
|
|
|
41371
42097
|
}
|
|
41372
42098
|
}, iconSlot ? vn_getSlotVNs(iconSlot(nParams)) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
41373
42099
|
class: isLazyLoading ? iconLoaded || getIcon().TREE_NODE_LOADED : isExpand ? iconOpen || getIcon().TREE_NODE_OPEN : iconClose || getIcon().TREE_NODE_CLOSE
|
|
41374
|
-
})])] : []), renderRadio(node, nodeid, isRadioChecked), renderCheckbox(node, nodeid, isCheckboxChecked), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42100
|
+
})])] : []), renderDragIcon(node, nodeid), renderRadio(node, nodeid, isRadioChecked), renderCheckbox(node, nodeid, isCheckboxChecked), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41375
42101
|
class: 'vxe-tree--node-item-inner'
|
|
41376
42102
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
41377
42103
|
class: 'vxe-tree--node-item-title'
|
|
@@ -41407,6 +42133,43 @@ function tree_createInternalData() {
|
|
|
41407
42133
|
});
|
|
41408
42134
|
return nodeVNs;
|
|
41409
42135
|
};
|
|
42136
|
+
const renderDragTip = () => {
|
|
42137
|
+
const {
|
|
42138
|
+
drag
|
|
42139
|
+
} = props;
|
|
42140
|
+
const {
|
|
42141
|
+
dragNode,
|
|
42142
|
+
dragTipText
|
|
42143
|
+
} = reactData;
|
|
42144
|
+
const dragOpts = computeDragOpts.value;
|
|
42145
|
+
const dNode = dragNode;
|
|
42146
|
+
if (drag) {
|
|
42147
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42148
|
+
class: 'vxe-tree--drag-wrapper'
|
|
42149
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42150
|
+
ref: refDragNodeLineElem,
|
|
42151
|
+
class: ['vxe-tree--drag-node-line', {
|
|
42152
|
+
'is--guides': dragOpts.showGuidesStatus
|
|
42153
|
+
}]
|
|
42154
|
+
}), dNode && dragOpts.showDragTip ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42155
|
+
ref: refDragTipElem,
|
|
42156
|
+
class: 'vxe-tree--drag-sort-tip'
|
|
42157
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42158
|
+
class: 'vxe-tree--drag-sort-tip-wrapper'
|
|
42159
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42160
|
+
class: 'vxe-tree--drag-sort-tip-status'
|
|
42161
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
42162
|
+
class: ['vxe-tree--drag-sort-tip-normal-status', getIcon().TREE_DRAG_STATUS_NODE]
|
|
42163
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
42164
|
+
class: ['vxe-tree--drag-sort-tip-sub-status', getIcon().TREE_DRAG_STATUS_SUB_NODE]
|
|
42165
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
42166
|
+
class: ['vxe-tree--drag-sort-tip-disabled-status', getIcon().TREE_DRAG_DISABLED]
|
|
42167
|
+
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42168
|
+
class: 'vxe-tree--drag-sort-tip-content'
|
|
42169
|
+
}, dragTipText)])]) : renderEmptyElement($xeTree)]);
|
|
42170
|
+
}
|
|
42171
|
+
return renderEmptyElement($xeTree);
|
|
42172
|
+
};
|
|
41410
42173
|
const renderVN = () => {
|
|
41411
42174
|
const {
|
|
41412
42175
|
loading,
|
|
@@ -41465,6 +42228,10 @@ function tree_createInternalData() {
|
|
|
41465
42228
|
}, footerSlot({
|
|
41466
42229
|
$tree: $xeTree
|
|
41467
42230
|
})) : renderEmptyElement($xeTree),
|
|
42231
|
+
/**
|
|
42232
|
+
* 拖拽提示
|
|
42233
|
+
*/
|
|
42234
|
+
renderDragTip(),
|
|
41468
42235
|
/**
|
|
41469
42236
|
* 加载中
|
|
41470
42237
|
*/
|
|
@@ -44977,6 +45744,9 @@ if (typeof window !== 'undefined') {
|
|
|
44977
45744
|
if (window.VxeUI && !window.VxeUIBase) {
|
|
44978
45745
|
window.VxeUIBase = components_namespaceObject;
|
|
44979
45746
|
}
|
|
45747
|
+
if (window.VxeUIBase && !window.VxeUI) {
|
|
45748
|
+
window.VxeUI = components_namespaceObject;
|
|
45749
|
+
}
|
|
44980
45750
|
}
|
|
44981
45751
|
|
|
44982
45752
|
/* harmony default export */ var index = (components_namespaceObject);
|