vxe-pc-ui 4.15.13 → 4.15.14
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/dist/all.esm.js +708 -139
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/button/style.css +11 -0
- package/es/button/style.min.css +1 -1
- package/es/checkbox/src/button.js +3 -1
- package/es/checkbox/src/group.js +6 -1
- package/es/checkbox-button/style.css +151 -8
- package/es/checkbox-button/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +145 -46
- package/es/icon-picker/style.css +29 -5
- package/es/icon-picker/style.min.css +1 -1
- package/es/language/ar-EG.js +3 -0
- package/es/language/de-DE.js +3 -0
- package/es/language/en-US.js +3 -0
- package/es/language/es-ES.js +3 -0
- package/es/language/fr-FR.js +3 -0
- package/es/language/hu-HU.js +3 -0
- package/es/language/hy-AM.js +3 -0
- package/es/language/id-ID.js +3 -0
- package/es/language/it-IT.js +3 -0
- package/es/language/ja-JP.js +3 -0
- package/es/language/ko-KR.js +3 -0
- package/es/language/ms-MY.js +3 -0
- package/es/language/nb-NO.js +3 -0
- package/es/language/pt-BR.js +3 -0
- package/es/language/ru-RU.js +3 -0
- package/es/language/th-TH.js +3 -0
- package/es/language/ug-CN.js +3 -0
- package/es/language/uk-UA.js +3 -0
- package/es/language/uz-UZ.js +3 -0
- package/es/language/vi-VN.js +3 -0
- package/es/language/zh-CHT.js +3 -0
- package/es/language/zh-CN.js +3 -0
- package/es/list/src/list.js +14 -1
- package/es/radio/src/button.js +3 -1
- package/es/radio/src/group.js +6 -1
- package/es/radio-button/style.css +151 -8
- package/es/radio-button/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +441 -18
- package/es/tree/src/util.js +15 -0
- package/es/ui/index.js +5 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-button/style.css +11 -0
- package/es/vxe-button/style.min.css +1 -1
- package/es/vxe-checkbox-button/style.css +151 -8
- package/es/vxe-checkbox-button/style.min.css +1 -1
- package/es/vxe-icon-picker/style.css +29 -5
- package/es/vxe-icon-picker/style.min.css +1 -1
- package/es/vxe-radio-button/style.css +151 -8
- package/es/vxe-radio-button/style.min.css +1 -1
- package/lib/button/style/style.css +11 -0
- package/lib/button/style/style.min.css +1 -1
- package/lib/checkbox/src/button.js +3 -1
- package/lib/checkbox/src/button.min.js +1 -1
- package/lib/checkbox/src/group.js +6 -0
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/checkbox-button/style/style.css +151 -8
- package/lib/checkbox-button/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +143 -29
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/icon-picker/style/style.css +29 -5
- package/lib/icon-picker/style/style.min.css +1 -1
- package/lib/index.umd.js +731 -49
- package/lib/index.umd.min.js +1 -1
- package/lib/language/ar-EG.js +3 -0
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +3 -0
- package/lib/language/de-DE.js +3 -0
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +3 -0
- package/lib/language/en-US.js +3 -0
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +3 -0
- package/lib/language/es-ES.js +3 -0
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +3 -0
- package/lib/language/fr-FR.js +3 -0
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +3 -0
- package/lib/language/hu-HU.js +3 -0
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +3 -0
- package/lib/language/hy-AM.js +3 -0
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +3 -0
- package/lib/language/id-ID.js +3 -0
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +3 -0
- package/lib/language/it-IT.js +3 -0
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +3 -0
- package/lib/language/ja-JP.js +3 -0
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +3 -0
- package/lib/language/ko-KR.js +3 -0
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +3 -0
- package/lib/language/ms-MY.js +3 -0
- package/lib/language/ms-MY.min.js +1 -1
- package/lib/language/ms-MY.umd.js +3 -0
- package/lib/language/nb-NO.js +3 -0
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +3 -0
- package/lib/language/pt-BR.js +3 -0
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +3 -0
- package/lib/language/ru-RU.js +3 -0
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +3 -0
- package/lib/language/th-TH.js +3 -0
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +3 -0
- package/lib/language/ug-CN.js +3 -0
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +3 -0
- package/lib/language/uk-UA.js +3 -0
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +3 -0
- package/lib/language/uz-UZ.js +3 -0
- package/lib/language/uz-UZ.min.js +1 -1
- package/lib/language/uz-UZ.umd.js +3 -0
- package/lib/language/vi-VN.js +3 -0
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +3 -0
- package/lib/language/zh-CHT.js +3 -0
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +3 -0
- package/lib/language/zh-CN.js +3 -0
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +3 -0
- package/lib/list/src/list.js +19 -1
- package/lib/list/src/list.min.js +1 -1
- package/lib/radio/src/button.js +3 -1
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +7 -1
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio-button/style/style.css +151 -8
- package/lib/radio-button/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 +525 -14
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree/src/util.js +16 -0
- package/lib/tree/src/util.min.js +1 -1
- package/lib/ui/index.js +5 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-button/style/style.css +11 -0
- package/lib/vxe-button/style/style.min.css +1 -1
- package/lib/vxe-checkbox-button/style/style.css +151 -8
- package/lib/vxe-checkbox-button/style/style.min.css +1 -1
- package/lib/vxe-icon-picker/style/style.css +29 -5
- package/lib/vxe-icon-picker/style/style.min.css +1 -1
- package/lib/vxe-radio-button/style/style.css +151 -8
- package/lib/vxe-radio-button/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/checkbox/src/button.ts +3 -1
- package/packages/checkbox/src/group.ts +6 -1
- package/packages/icon-picker/src/icon-picker.ts +157 -48
- package/packages/language/ar-EG.ts +3 -0
- package/packages/language/de-DE.ts +3 -0
- package/packages/language/en-US.ts +3 -0
- package/packages/language/es-ES.ts +3 -0
- package/packages/language/fr-FR.ts +3 -0
- package/packages/language/hu-HU.ts +3 -0
- package/packages/language/hy-AM.ts +3 -0
- package/packages/language/id-ID.ts +3 -0
- package/packages/language/it-IT.ts +3 -0
- package/packages/language/ja-JP.ts +3 -0
- package/packages/language/ko-KR.ts +3 -0
- package/packages/language/ms-MY.ts +3 -0
- package/packages/language/nb-NO.ts +3 -0
- package/packages/language/pt-BR.ts +3 -0
- package/packages/language/ru-RU.ts +3 -0
- package/packages/language/th-TH.ts +3 -0
- package/packages/language/ug-CN.ts +3 -0
- package/packages/language/uk-UA.ts +3 -0
- package/packages/language/uz-UZ.ts +3 -0
- package/packages/language/vi-VN.ts +3 -0
- package/packages/language/zh-CHT.ts +3 -0
- package/packages/language/zh-CN.ts +3 -0
- package/packages/list/src/list.ts +14 -1
- package/packages/radio/src/button.ts +3 -1
- package/packages/radio/src/group.ts +6 -1
- package/packages/tree/src/tree.ts +443 -14
- package/packages/tree/src/util.ts +17 -1
- package/packages/ui/index.ts +4 -1
- package/styles/components/button.scss +24 -69
- package/styles/components/checkbox-button.scss +65 -13
- package/styles/components/icon-picker.scss +37 -11
- package/styles/components/radio-button.scss +65 -13
- package/styles/helpers/themeStatus.scss +58 -0
- package/types/all.d.ts +205 -0
- package/types/components/checkbox-group.d.ts +3 -1
- package/types/components/checkbox.d.ts +1 -1
- package/types/components/icon-picker.d.ts +27 -4
- package/types/components/list.d.ts +2 -2
- package/types/components/radio-group.d.ts +3 -1
- package/types/components/tree.d.ts +36 -0
- /package/es/icon/{iconfont.1782658269305.ttf → iconfont.1782742200841.ttf} +0 -0
- /package/es/icon/{iconfont.1782658269305.woff → iconfont.1782742200841.woff} +0 -0
- /package/es/icon/{iconfont.1782658269305.woff2 → iconfont.1782742200841.woff2} +0 -0
- /package/es/{iconfont.1782658269305.ttf → iconfont.1782742200841.ttf} +0 -0
- /package/es/{iconfont.1782658269305.woff → iconfont.1782742200841.woff} +0 -0
- /package/es/{iconfont.1782658269305.woff2 → iconfont.1782742200841.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1782658269305.ttf → iconfont.1782742200841.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1782658269305.woff → iconfont.1782742200841.woff} +0 -0
- /package/lib/icon/style/{iconfont.1782658269305.woff2 → iconfont.1782742200841.woff2} +0 -0
- /package/lib/{iconfont.1782658269305.ttf → iconfont.1782742200841.ttf} +0 -0
- /package/lib/{iconfont.1782658269305.woff → iconfont.1782742200841.woff} +0 -0
- /package/lib/{iconfont.1782658269305.woff2 → iconfont.1782742200841.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4657,7 +4657,7 @@ function checkDynamic() {
|
|
|
4657
4657
|
const {
|
|
4658
4658
|
log: log_log
|
|
4659
4659
|
} = VxeUI;
|
|
4660
|
-
const uiVersion = `ui v${"4.15.
|
|
4660
|
+
const uiVersion = `ui v${"4.15.14"}`;
|
|
4661
4661
|
function createComponentLog(name) {
|
|
4662
4662
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
4663
4663
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -4675,7 +4675,7 @@ const errLog = log_log.create('error', uiVersion);
|
|
|
4675
4675
|
|
|
4676
4676
|
|
|
4677
4677
|
|
|
4678
|
-
const ui_version = "4.15.
|
|
4678
|
+
const ui_version = "4.15.14";
|
|
4679
4679
|
VxeUI.uiVersion = ui_version;
|
|
4680
4680
|
VxeUI.dynamicApp = dynamicApp;
|
|
4681
4681
|
function config(options) {
|
|
@@ -4850,7 +4850,10 @@ setConfig({
|
|
|
4850
4850
|
formView: {},
|
|
4851
4851
|
icon: {},
|
|
4852
4852
|
iconPicker: {
|
|
4853
|
-
icons: ['home', 'company', 'comment', 'setting', 'send', 'envelope', 'envelope-open', 'bell', 'search', 'print', 'pc', 'goods', 'chart-line', 'edit', 'delete', 'save', 'folder', 'microphone', 'flag', 'link', 'location', 'sunny', 'rmb', 'usd', 'user', 'add-user', 'add-users', 'star', 'unlock', 'time', 'text', 'feedback', 'calendar', 'association-form', 'cloud-download', 'cloud-upload', 'file', 'subtable', 'chart-bar-x', 'chart-bar-y', 'chart-line', 'chart-pie', 'chart-radar']
|
|
4853
|
+
icons: ['home', 'company', 'comment', 'setting', 'send', 'envelope', 'envelope-open', 'bell', 'search', 'print', 'pc', 'goods', 'chart-line', 'edit', 'delete', 'save', 'folder', 'microphone', 'flag', 'link', 'location', 'sunny', 'rmb', 'usd', 'user', 'add-user', 'add-users', 'star', 'unlock', 'time', 'text', 'feedback', 'calendar', 'association-form', 'cloud-download', 'cloud-upload', 'file', 'subtable', 'chart-bar-x', 'chart-bar-y', 'chart-line', 'chart-pie', 'chart-radar'],
|
|
4854
|
+
popupConfig: {
|
|
4855
|
+
// chunkSize: 4
|
|
4856
|
+
}
|
|
4854
4857
|
},
|
|
4855
4858
|
image: {
|
|
4856
4859
|
draggable: null,
|
|
@@ -5644,6 +5647,9 @@ setIcon({
|
|
|
5644
5647
|
fixedRight: '冻结在右侧',
|
|
5645
5648
|
cancelFixed: '取消冻结列'
|
|
5646
5649
|
},
|
|
5650
|
+
iconPicker: {
|
|
5651
|
+
search: '搜索'
|
|
5652
|
+
},
|
|
5647
5653
|
datePicker: {
|
|
5648
5654
|
yearTitle: '{0} 年'
|
|
5649
5655
|
},
|
|
@@ -12887,14 +12893,22 @@ function list_createInternalData() {
|
|
|
12887
12893
|
}
|
|
12888
12894
|
};
|
|
12889
12895
|
const handleRowClickEvent = (evnt, row) => {
|
|
12896
|
+
const {
|
|
12897
|
+
showRadio,
|
|
12898
|
+
showCheckbox
|
|
12899
|
+
} = props;
|
|
12890
12900
|
const {
|
|
12891
12901
|
currentRow
|
|
12892
12902
|
} = internalData;
|
|
12903
|
+
const radioOpts = computeRadioOpts.value;
|
|
12904
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
12893
12905
|
const rowOpts = computeRowOpts.value;
|
|
12894
12906
|
const {
|
|
12895
12907
|
isCurrent
|
|
12896
12908
|
} = rowOpts;
|
|
12897
12909
|
let triggerCurrent = false;
|
|
12910
|
+
let triggerRadio = false;
|
|
12911
|
+
let triggerCheckbox = false;
|
|
12898
12912
|
if (isCurrent) {
|
|
12899
12913
|
triggerCurrent = true;
|
|
12900
12914
|
changeCurrentEvent(evnt, row);
|
|
@@ -12902,9 +12916,19 @@ function list_createInternalData() {
|
|
|
12902
12916
|
internalData.currentRow = null;
|
|
12903
12917
|
reactData.currRowFlag++;
|
|
12904
12918
|
}
|
|
12919
|
+
if (showRadio && radioOpts.trigger === 'row') {
|
|
12920
|
+
triggerRadio = true;
|
|
12921
|
+
changeRadioEvent(evnt, row);
|
|
12922
|
+
}
|
|
12923
|
+
if (showCheckbox && checkboxOpts.trigger === 'row') {
|
|
12924
|
+
triggerCheckbox = true;
|
|
12925
|
+
changeCheckboxEvent(evnt, row);
|
|
12926
|
+
}
|
|
12905
12927
|
dispatchEvent('row-click', {
|
|
12906
12928
|
row,
|
|
12907
|
-
triggerCurrent
|
|
12929
|
+
triggerCurrent,
|
|
12930
|
+
triggerRadio,
|
|
12931
|
+
triggerCheckbox
|
|
12908
12932
|
}, evnt);
|
|
12909
12933
|
};
|
|
12910
12934
|
const handleRowDblclickEvent = (evnt, row) => {
|
|
@@ -18981,7 +19005,9 @@ const Checkbox = VxeCheckbox;
|
|
|
18981
19005
|
checked: isChecked,
|
|
18982
19006
|
onChange: changeEvent
|
|
18983
19007
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18984
|
-
class: 'vxe-checkbox--label'
|
|
19008
|
+
class: ['vxe-checkbox--label', {
|
|
19009
|
+
'is--disabled': isDisabled
|
|
19010
|
+
}]
|
|
18985
19011
|
}, slots.default ? slots.default({}) : getFuncText(content))]);
|
|
18986
19012
|
};
|
|
18987
19013
|
$xeCheckboxButton.renderVN = renderVN;
|
|
@@ -19032,6 +19058,10 @@ function group_createInternalData() {
|
|
|
19032
19058
|
type: Boolean,
|
|
19033
19059
|
default: null
|
|
19034
19060
|
},
|
|
19061
|
+
status: {
|
|
19062
|
+
type: String,
|
|
19063
|
+
default: () => getConfig().checkboxGroup.status
|
|
19064
|
+
},
|
|
19035
19065
|
max: {
|
|
19036
19066
|
type: [String, Number],
|
|
19037
19067
|
default: null
|
|
@@ -19194,6 +19224,7 @@ function group_createInternalData() {
|
|
|
19194
19224
|
Object.assign($xeCheckboxGroup, checkboxGroupMethods, checkboxGroupPrivateMethods);
|
|
19195
19225
|
const renderVN = () => {
|
|
19196
19226
|
const {
|
|
19227
|
+
status,
|
|
19197
19228
|
options
|
|
19198
19229
|
} = props;
|
|
19199
19230
|
const defaultSlot = slots.default;
|
|
@@ -19204,6 +19235,7 @@ function group_createInternalData() {
|
|
|
19204
19235
|
const isDisabled = computeIsDisabled.value;
|
|
19205
19236
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
19206
19237
|
class: ['vxe-checkbox-group', {
|
|
19238
|
+
[`theme--${status}`]: status,
|
|
19207
19239
|
'is--readonly': isReadonly,
|
|
19208
19240
|
'is--disabled': isDisabled
|
|
19209
19241
|
}]
|
|
@@ -32382,6 +32414,28 @@ const Icon = VxeIcon;
|
|
|
32382
32414
|
|
|
32383
32415
|
|
|
32384
32416
|
|
|
32417
|
+
|
|
32418
|
+
|
|
32419
|
+
function icon_picker_createReactData() {
|
|
32420
|
+
return {
|
|
32421
|
+
initialized: false,
|
|
32422
|
+
selectIcon: '',
|
|
32423
|
+
panelIndex: 0,
|
|
32424
|
+
panelStyle: {},
|
|
32425
|
+
panelPlacement: null,
|
|
32426
|
+
visiblePanel: false,
|
|
32427
|
+
isAniVisible: false,
|
|
32428
|
+
isActivated: false,
|
|
32429
|
+
searchValue: '',
|
|
32430
|
+
iconGroups: []
|
|
32431
|
+
};
|
|
32432
|
+
}
|
|
32433
|
+
function icon_picker_createInternalData() {
|
|
32434
|
+
return {
|
|
32435
|
+
fullList: []
|
|
32436
|
+
// hpTimeout: undefined
|
|
32437
|
+
};
|
|
32438
|
+
}
|
|
32385
32439
|
/* harmony default export */ var icon_picker = (defineVxeComponent({
|
|
32386
32440
|
name: 'VxeIconPicker',
|
|
32387
32441
|
props: {
|
|
@@ -32410,6 +32464,11 @@ const Icon = VxeIcon;
|
|
|
32410
32464
|
type: Boolean,
|
|
32411
32465
|
default: null
|
|
32412
32466
|
},
|
|
32467
|
+
filterable: {
|
|
32468
|
+
type: Boolean,
|
|
32469
|
+
default: () => getConfig().iconPicker.filterable
|
|
32470
|
+
},
|
|
32471
|
+
filterConfig: Object,
|
|
32413
32472
|
icons: Array,
|
|
32414
32473
|
placement: String,
|
|
32415
32474
|
popupConfig: Object,
|
|
@@ -32432,22 +32491,12 @@ const Icon = VxeIcon;
|
|
|
32432
32491
|
const {
|
|
32433
32492
|
computeSize
|
|
32434
32493
|
} = useSize(props);
|
|
32435
|
-
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(
|
|
32436
|
-
|
|
32437
|
-
selectIcon: `${props.modelValue || ''}`,
|
|
32438
|
-
panelIndex: 0,
|
|
32439
|
-
panelStyle: {},
|
|
32440
|
-
panelPlacement: null,
|
|
32441
|
-
visiblePanel: false,
|
|
32442
|
-
isAniVisible: false,
|
|
32443
|
-
isActivated: false
|
|
32444
|
-
});
|
|
32445
|
-
const internalData = {
|
|
32446
|
-
// hpTimeout: undefined
|
|
32447
|
-
};
|
|
32494
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(icon_picker_createReactData());
|
|
32495
|
+
const internalData = icon_picker_createInternalData();
|
|
32448
32496
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
32449
32497
|
const refInput = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
32450
32498
|
const refOptionPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
32499
|
+
const refInpSearch = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
32451
32500
|
const refMaps = {
|
|
32452
32501
|
refElem
|
|
32453
32502
|
};
|
|
@@ -32515,6 +32564,23 @@ const Icon = VxeIcon;
|
|
|
32515
32564
|
}
|
|
32516
32565
|
return getI18n('vxe.base.pleaseSelect');
|
|
32517
32566
|
});
|
|
32567
|
+
const computePanelStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32568
|
+
const popupOpts = computePopupOpts.value;
|
|
32569
|
+
const {
|
|
32570
|
+
chunkSize,
|
|
32571
|
+
height,
|
|
32572
|
+
maxHeight
|
|
32573
|
+
} = popupOpts;
|
|
32574
|
+
const stys = {
|
|
32575
|
+
'--vxe-ui-icon-picker-item-width': `${100 / (chunkSize || 4)}%`
|
|
32576
|
+
};
|
|
32577
|
+
if (height) {
|
|
32578
|
+
stys['--vxe-ui-icon-picker-panel-height'] = toCssUnit(height);
|
|
32579
|
+
} else if (maxHeight) {
|
|
32580
|
+
stys['--vxe-ui-icon-picker-panel-max-height'] = toCssUnit(maxHeight);
|
|
32581
|
+
}
|
|
32582
|
+
return stys;
|
|
32583
|
+
});
|
|
32518
32584
|
const computeIconList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32519
32585
|
let {
|
|
32520
32586
|
icons
|
|
@@ -32536,13 +32602,12 @@ const Icon = VxeIcon;
|
|
|
32536
32602
|
};
|
|
32537
32603
|
});
|
|
32538
32604
|
});
|
|
32605
|
+
const computeFilterOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32606
|
+
return Object.assign({}, getConfig().iconPicker.filterConfig, props.filterConfig);
|
|
32607
|
+
});
|
|
32539
32608
|
const computePopupOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32540
32609
|
return Object.assign({}, getConfig().iconPicker.popupConfig, props.popupConfig);
|
|
32541
32610
|
});
|
|
32542
|
-
const computeIconGroupList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32543
|
-
const iconList = computeIconList.value;
|
|
32544
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().chunk(iconList, 4);
|
|
32545
|
-
});
|
|
32546
32611
|
const computeSelectIconItem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
32547
32612
|
const {
|
|
32548
32613
|
selectIcon
|
|
@@ -32566,6 +32631,9 @@ const Icon = VxeIcon;
|
|
|
32566
32631
|
const panelElem = refOptionPanel.value;
|
|
32567
32632
|
const btnTransfer = computeBtnTransfer.value;
|
|
32568
32633
|
const popupOpts = computePopupOpts.value;
|
|
32634
|
+
const {
|
|
32635
|
+
width
|
|
32636
|
+
} = popupOpts;
|
|
32569
32637
|
const handleStyle = () => {
|
|
32570
32638
|
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
32571
32639
|
placement: popupOpts.placement || placement,
|
|
@@ -32575,6 +32643,12 @@ const Icon = VxeIcon;
|
|
|
32575
32643
|
const panelStyle = Object.assign(ppObj.style, {
|
|
32576
32644
|
zIndex: panelIndex
|
|
32577
32645
|
});
|
|
32646
|
+
if (width) {
|
|
32647
|
+
Object.assign(panelStyle, {
|
|
32648
|
+
width: toCssUnit(width),
|
|
32649
|
+
minWidth: undefined
|
|
32650
|
+
});
|
|
32651
|
+
}
|
|
32578
32652
|
reactData.panelStyle = panelStyle;
|
|
32579
32653
|
reactData.panelPlacement = ppObj.placement;
|
|
32580
32654
|
};
|
|
@@ -32610,6 +32684,39 @@ const Icon = VxeIcon;
|
|
|
32610
32684
|
reactData.isAniVisible = false;
|
|
32611
32685
|
}, 350);
|
|
32612
32686
|
};
|
|
32687
|
+
const handleData = () => {
|
|
32688
|
+
const {
|
|
32689
|
+
modelValue
|
|
32690
|
+
} = props;
|
|
32691
|
+
const {
|
|
32692
|
+
searchValue
|
|
32693
|
+
} = reactData;
|
|
32694
|
+
const filterOpts = computeFilterOpts.value;
|
|
32695
|
+
const {
|
|
32696
|
+
filterMethod
|
|
32697
|
+
} = filterOpts;
|
|
32698
|
+
const popupOpts = computePopupOpts.value;
|
|
32699
|
+
const {
|
|
32700
|
+
chunkSize
|
|
32701
|
+
} = popupOpts;
|
|
32702
|
+
const iconList = computeIconList.value;
|
|
32703
|
+
let visibleList = iconList;
|
|
32704
|
+
if (searchValue) {
|
|
32705
|
+
const searchTxt = `${searchValue}`.toLowerCase();
|
|
32706
|
+
visibleList = iconList.filter(item => {
|
|
32707
|
+
if (filterMethod) {
|
|
32708
|
+
return filterMethod({
|
|
32709
|
+
option: item,
|
|
32710
|
+
value: modelValue,
|
|
32711
|
+
searchValue: searchTxt,
|
|
32712
|
+
$iconPicker: $xeIconPicker
|
|
32713
|
+
});
|
|
32714
|
+
}
|
|
32715
|
+
return item.title && `${item.title}`.toLowerCase().indexOf(searchTxt) > -1 || item.icon && `${item.icon}`.indexOf(searchTxt) > -1;
|
|
32716
|
+
});
|
|
32717
|
+
}
|
|
32718
|
+
reactData.iconGroups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().chunk(visibleList, chunkSize || 4);
|
|
32719
|
+
};
|
|
32613
32720
|
const changeEvent = (evnt, selectValue) => {
|
|
32614
32721
|
reactData.selectIcon = selectValue;
|
|
32615
32722
|
if (selectValue !== props.modelValue) {
|
|
@@ -32804,19 +32911,30 @@ const Icon = VxeIcon;
|
|
|
32804
32911
|
changeEvent(evnt, value);
|
|
32805
32912
|
hideOptionPanel();
|
|
32806
32913
|
};
|
|
32914
|
+
const modelSearchEvent = value => {
|
|
32915
|
+
reactData.searchValue = value;
|
|
32916
|
+
};
|
|
32917
|
+
const focusSearchEvent = () => {
|
|
32918
|
+
reactData.isActivated = true;
|
|
32919
|
+
};
|
|
32920
|
+
const handleSearchEvent = () => {
|
|
32921
|
+
handleData();
|
|
32922
|
+
};
|
|
32923
|
+
const triggerSearchEvent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(handleSearchEvent, 350, {
|
|
32924
|
+
trailing: true
|
|
32925
|
+
});
|
|
32807
32926
|
Object.assign($xeIconPicker, iconPickerMethods);
|
|
32808
32927
|
const renderIconWrapper = () => {
|
|
32809
32928
|
const {
|
|
32810
32929
|
showIconTitle
|
|
32811
32930
|
} = props;
|
|
32812
32931
|
const {
|
|
32813
|
-
selectIcon
|
|
32932
|
+
selectIcon,
|
|
32933
|
+
iconGroups
|
|
32814
32934
|
} = reactData;
|
|
32815
|
-
const iconGroupList = computeIconGroupList.value;
|
|
32816
|
-
const isDisabled = computeIsDisabled.value;
|
|
32817
32935
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32818
32936
|
class: 'vxe-ico-picker--list-wrapper'
|
|
32819
|
-
},
|
|
32937
|
+
}, iconGroups.map(list => {
|
|
32820
32938
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32821
32939
|
class: 'vxe-ico-picker--list'
|
|
32822
32940
|
}, list.map(item => {
|
|
@@ -32824,26 +32942,29 @@ const Icon = VxeIcon;
|
|
|
32824
32942
|
iconRender
|
|
32825
32943
|
} = item;
|
|
32826
32944
|
const compConf = iconRender ? renderer.get(iconRender.name) : null;
|
|
32827
|
-
const
|
|
32945
|
+
const iconMethod = compConf ? compConf.renderIconPickerOptionIcon : null;
|
|
32828
32946
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32829
32947
|
class: ['vxe-ico-picker--item', {
|
|
32830
32948
|
'is--selected': selectIcon === item.icon
|
|
32831
|
-
}]
|
|
32949
|
+
}]
|
|
32950
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32951
|
+
class: 'vxe-ico-picker--item-inner',
|
|
32832
32952
|
onClick(evnt) {
|
|
32953
|
+
const isDisabled = computeIsDisabled.value;
|
|
32833
32954
|
if (!isDisabled) {
|
|
32834
32955
|
handleClickIconEvent(evnt, item);
|
|
32835
32956
|
}
|
|
32836
32957
|
}
|
|
32837
32958
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32838
32959
|
class: 'vxe-ico-picker--item-icon'
|
|
32839
|
-
},
|
|
32960
|
+
}, iconMethod && iconRender ? vn_getSlotVNs(iconMethod(iconRender, {
|
|
32840
32961
|
$iconPicker: $xeIconPicker,
|
|
32841
32962
|
option: item
|
|
32842
32963
|
})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
32843
32964
|
class: item.icon || ''
|
|
32844
32965
|
})]), showIconTitle ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32845
32966
|
class: 'vxe-ico-picker--item-title'
|
|
32846
|
-
}, `${item.title || ''}`) : renderEmptyElement($xeIconPicker)]);
|
|
32967
|
+
}, `${item.title || ''}`) : renderEmptyElement($xeIconPicker)])]);
|
|
32847
32968
|
}));
|
|
32848
32969
|
}));
|
|
32849
32970
|
};
|
|
@@ -32878,7 +32999,8 @@ const Icon = VxeIcon;
|
|
|
32878
32999
|
const renderVN = () => {
|
|
32879
33000
|
const {
|
|
32880
33001
|
className,
|
|
32881
|
-
clearable
|
|
33002
|
+
clearable,
|
|
33003
|
+
filterable
|
|
32882
33004
|
} = props;
|
|
32883
33005
|
const {
|
|
32884
33006
|
initialized,
|
|
@@ -32892,6 +33014,7 @@ const Icon = VxeIcon;
|
|
|
32892
33014
|
const btnTransfer = computeBtnTransfer.value;
|
|
32893
33015
|
const formReadonly = computeFormReadonly.value;
|
|
32894
33016
|
const inpPlaceholder = computeInpPlaceholder.value;
|
|
33017
|
+
const panelStyle = computePanelStyle.value;
|
|
32895
33018
|
const popupOpts = computePopupOpts.value;
|
|
32896
33019
|
const ppClassName = popupOpts.className || props.popupClassName;
|
|
32897
33020
|
if (formReadonly) {
|
|
@@ -32950,23 +33073,47 @@ const Icon = VxeIcon;
|
|
|
32950
33073
|
placement: reactData.panelPlacement,
|
|
32951
33074
|
style: reactData.panelStyle
|
|
32952
33075
|
}, [initialized && (visiblePanel || isAniVisible) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
32953
|
-
class: 'vxe-ico-picker--panel-wrapper'
|
|
32954
|
-
|
|
33076
|
+
class: 'vxe-ico-picker--panel-wrapper',
|
|
33077
|
+
style: panelStyle
|
|
33078
|
+
}, [filterable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
33079
|
+
class: 'vxe-ico-picker--panel-search'
|
|
33080
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(input, {
|
|
33081
|
+
ref: refInpSearch,
|
|
33082
|
+
class: 'vxe-ico-picker-search--input',
|
|
33083
|
+
modelValue: reactData.searchValue,
|
|
33084
|
+
type: 'text',
|
|
33085
|
+
clearable: true,
|
|
33086
|
+
disabled: false,
|
|
33087
|
+
readonly: false,
|
|
33088
|
+
placeholder: getI18n('vxe.iconPicker.search'),
|
|
33089
|
+
prefixIcon: getIcon().INPUT_SEARCH,
|
|
33090
|
+
'onUpdate:modelValue': modelSearchEvent,
|
|
33091
|
+
onFocus: focusSearchEvent,
|
|
33092
|
+
onChange: triggerSearchEvent,
|
|
33093
|
+
onSearch: triggerSearchEvent
|
|
33094
|
+
})]) : renderEmptyElement($xeIconPicker), renderIconWrapper()]) : renderEmptyElement($xeIconPicker)])])]);
|
|
32955
33095
|
};
|
|
33096
|
+
reactData.selectIcon = `${props.modelValue || ''}`;
|
|
33097
|
+
handleData();
|
|
32956
33098
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
|
|
32957
33099
|
reactData.selectIcon = `${val || ''}`;
|
|
32958
33100
|
});
|
|
33101
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeIconList, () => {
|
|
33102
|
+
handleData();
|
|
33103
|
+
});
|
|
32959
33104
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
32960
33105
|
globalEvents.on($xeIconPicker, 'mousewheel', handleGlobalMousewheelEvent);
|
|
32961
33106
|
globalEvents.on($xeIconPicker, 'mousedown', handleGlobalMousedownEvent);
|
|
32962
33107
|
globalEvents.on($xeIconPicker, 'keydown', handleGlobalKeydownEvent);
|
|
32963
33108
|
globalEvents.on($xeIconPicker, 'blur', handleGlobalBlurEvent);
|
|
32964
33109
|
});
|
|
32965
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.
|
|
33110
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
32966
33111
|
globalEvents.off($xeIconPicker, 'mousewheel');
|
|
32967
33112
|
globalEvents.off($xeIconPicker, 'mousedown');
|
|
32968
33113
|
globalEvents.off($xeIconPicker, 'keydown');
|
|
32969
33114
|
globalEvents.off($xeIconPicker, 'blur');
|
|
33115
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, icon_picker_createReactData());
|
|
33116
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, icon_picker_createInternalData());
|
|
32970
33117
|
});
|
|
32971
33118
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeIconPicker', $xeIconPicker);
|
|
32972
33119
|
$xeIconPicker.renderVN = renderVN;
|
|
@@ -42092,7 +42239,9 @@ const Radio = VxeRadio;
|
|
|
42092
42239
|
onChange: changeEvent,
|
|
42093
42240
|
onClick: clickEvent
|
|
42094
42241
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
42095
|
-
class: 'vxe-radio--label'
|
|
42242
|
+
class: ['vxe-radio--label', {
|
|
42243
|
+
'is--disabled': isDisabled
|
|
42244
|
+
}]
|
|
42096
42245
|
}, defaultSlot ? defaultSlot({}) : getFuncText(content))]);
|
|
42097
42246
|
};
|
|
42098
42247
|
$xeRadioButton.renderVN = renderVN;
|
|
@@ -42142,6 +42291,10 @@ function src_group_createInternalData() {
|
|
|
42142
42291
|
default: null
|
|
42143
42292
|
},
|
|
42144
42293
|
type: String,
|
|
42294
|
+
status: {
|
|
42295
|
+
type: String,
|
|
42296
|
+
default: () => getConfig().radioGroup.status
|
|
42297
|
+
},
|
|
42145
42298
|
options: Array,
|
|
42146
42299
|
optionProps: Object,
|
|
42147
42300
|
strict: {
|
|
@@ -42289,7 +42442,8 @@ function src_group_createInternalData() {
|
|
|
42289
42442
|
const renderVN = () => {
|
|
42290
42443
|
const {
|
|
42291
42444
|
options,
|
|
42292
|
-
type
|
|
42445
|
+
type,
|
|
42446
|
+
status
|
|
42293
42447
|
} = props;
|
|
42294
42448
|
const vSize = computeSize.value;
|
|
42295
42449
|
const defaultSlot = slots.default;
|
|
@@ -42299,6 +42453,7 @@ function src_group_createInternalData() {
|
|
|
42299
42453
|
const btnComp = type === 'button' ? radio_src_button : src_radio;
|
|
42300
42454
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
42301
42455
|
class: ['vxe-radio-group', {
|
|
42456
|
+
[`theme--${status}`]: status,
|
|
42302
42457
|
[`size--${vSize}`]: vSize
|
|
42303
42458
|
}]
|
|
42304
42459
|
}, defaultSlot ? defaultSlot({}) : options ? options.map(item => {
|
|
@@ -48296,6 +48451,21 @@ function calcTreeLine($xeTree, node, prevNode) {
|
|
|
48296
48451
|
}
|
|
48297
48452
|
return (rowHeight || 28) * expandSize - (prevNode ? 1 : 12);
|
|
48298
48453
|
}
|
|
48454
|
+
function getItemCacheObj(item) {
|
|
48455
|
+
return {
|
|
48456
|
+
item,
|
|
48457
|
+
index: -1,
|
|
48458
|
+
$index: -1,
|
|
48459
|
+
_index: -1,
|
|
48460
|
+
items: [],
|
|
48461
|
+
parent: null,
|
|
48462
|
+
nodes: [],
|
|
48463
|
+
level: 0,
|
|
48464
|
+
treeIndex: -1,
|
|
48465
|
+
lineCount: 0,
|
|
48466
|
+
treeLoaded: false
|
|
48467
|
+
};
|
|
48468
|
+
}
|
|
48299
48469
|
;// ./packages/tree/src/store.ts
|
|
48300
48470
|
|
|
48301
48471
|
// 跨树拖拽
|
|
@@ -48324,6 +48494,7 @@ function getCrossTreeDragNodeInfo() {
|
|
|
48324
48494
|
|
|
48325
48495
|
|
|
48326
48496
|
const {
|
|
48497
|
+
warnLog: tree_warnLog,
|
|
48327
48498
|
errLog: tree_errLog
|
|
48328
48499
|
} = createComponentLog('tree');
|
|
48329
48500
|
const {
|
|
@@ -48359,6 +48530,8 @@ function tree_createInternalData() {
|
|
|
48359
48530
|
offsetSize: 0,
|
|
48360
48531
|
rowHeight: 0
|
|
48361
48532
|
},
|
|
48533
|
+
removeRowMaps: {},
|
|
48534
|
+
insertRowMaps: {},
|
|
48362
48535
|
// prevDragNode: null,
|
|
48363
48536
|
// prevDragToChild: false,
|
|
48364
48537
|
// prevDragPos: ''
|
|
@@ -48380,14 +48553,13 @@ function tree_createReactData() {
|
|
|
48380
48553
|
treeList: [],
|
|
48381
48554
|
updateExpandedFlag: 1,
|
|
48382
48555
|
updateCheckboxFlag: 1,
|
|
48556
|
+
insertRowFlag: 1,
|
|
48557
|
+
removeRowFlag: 1,
|
|
48383
48558
|
dragNode: null,
|
|
48384
48559
|
dragTipText: ''
|
|
48385
48560
|
};
|
|
48386
48561
|
}
|
|
48387
|
-
|
|
48388
|
-
// $oldTree: VxeTreeConstructor & VxeTreePrivateMethods
|
|
48389
|
-
// $newTree: (VxeTreeConstructor & VxeTreePrivateMethods) | null
|
|
48390
|
-
// } | null = null
|
|
48562
|
+
let crossTreeDragNodeObj = null;
|
|
48391
48563
|
/* harmony default export */ var tree = (defineVxeComponent({
|
|
48392
48564
|
name: 'VxeTree',
|
|
48393
48565
|
props: {
|
|
@@ -48509,7 +48681,7 @@ function tree_createReactData() {
|
|
|
48509
48681
|
},
|
|
48510
48682
|
virtualYConfig: Object
|
|
48511
48683
|
},
|
|
48512
|
-
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', 'node-expand', 'node-menu', 'menu-click'],
|
|
48684
|
+
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', 'node-remove-dragend', 'node-insert-dragend', 'node-expand', 'node-menu', 'menu-click'],
|
|
48513
48685
|
setup(props, context) {
|
|
48514
48686
|
const {
|
|
48515
48687
|
emit,
|
|
@@ -49868,6 +50040,177 @@ function tree_createReactData() {
|
|
|
49868
50040
|
}
|
|
49869
50041
|
recalculate();
|
|
49870
50042
|
};
|
|
50043
|
+
const insertTreeNode = (newRecords, isAppend) => {
|
|
50044
|
+
const {
|
|
50045
|
+
treeFullData,
|
|
50046
|
+
nodeMaps
|
|
50047
|
+
} = internalData;
|
|
50048
|
+
const keyField = computeKeyField.value;
|
|
50049
|
+
const parentField = computeParentField.value;
|
|
50050
|
+
const childrenField = computeChildrenField.value;
|
|
50051
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
50052
|
+
const funcName = isAppend ? 'push' : 'unshift';
|
|
50053
|
+
newRecords.forEach(item => {
|
|
50054
|
+
const parentRowId = item[parentField];
|
|
50055
|
+
const nodeid = getNodeId(item);
|
|
50056
|
+
const matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => parentRowId === item[keyField], {
|
|
50057
|
+
children: mapChildrenField
|
|
50058
|
+
}) : null;
|
|
50059
|
+
const itemRest = getItemCacheObj(item);
|
|
50060
|
+
if (matchObj) {
|
|
50061
|
+
const {
|
|
50062
|
+
item: parentItem
|
|
50063
|
+
} = matchObj;
|
|
50064
|
+
const parentRest = nodeMaps[getNodeId(parentItem)];
|
|
50065
|
+
const parentLevel = parentRest ? parentRest.level : 0;
|
|
50066
|
+
let pChilds = parentItem[childrenField];
|
|
50067
|
+
let pMapChilds = parentItem[mapChildrenField];
|
|
50068
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(pChilds)) {
|
|
50069
|
+
pChilds = parentItem[childrenField] = [];
|
|
50070
|
+
}
|
|
50071
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(pMapChilds)) {
|
|
50072
|
+
pMapChilds = parentItem[mapChildrenField] = [];
|
|
50073
|
+
}
|
|
50074
|
+
itemRest.parent = parentItem;
|
|
50075
|
+
itemRest.items = pChilds;
|
|
50076
|
+
itemRest.level = parentLevel;
|
|
50077
|
+
pChilds[funcName](item);
|
|
50078
|
+
pMapChilds[funcName](item);
|
|
50079
|
+
} else {
|
|
50080
|
+
if (parentRowId) {
|
|
50081
|
+
tree_warnLog('vxe.error.unableInsert');
|
|
50082
|
+
}
|
|
50083
|
+
treeFullData[funcName](item);
|
|
50084
|
+
}
|
|
50085
|
+
nodeMaps[nodeid] = itemRest;
|
|
50086
|
+
});
|
|
50087
|
+
};
|
|
50088
|
+
const handleInsertNodeAt = (records, targetNodeOrNodeid, isInsertNextNode) => {
|
|
50089
|
+
const {
|
|
50090
|
+
transform
|
|
50091
|
+
} = props;
|
|
50092
|
+
const {
|
|
50093
|
+
treeFullData,
|
|
50094
|
+
nodeMaps
|
|
50095
|
+
} = internalData;
|
|
50096
|
+
const keyField = computeKeyField.value;
|
|
50097
|
+
const parentField = computeParentField.value;
|
|
50098
|
+
const childrenField = computeChildrenField.value;
|
|
50099
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
50100
|
+
if (!transform) {
|
|
50101
|
+
tree_errLog('vxe.error.reqSupportProp', ['insert() | insertAt() | insertNextAt()', 'transform']);
|
|
50102
|
+
return Promise.resolve({
|
|
50103
|
+
node: null,
|
|
50104
|
+
nodes: []
|
|
50105
|
+
});
|
|
50106
|
+
}
|
|
50107
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
|
|
50108
|
+
records = [records];
|
|
50109
|
+
}
|
|
50110
|
+
let targetNode = targetNodeOrNodeid;
|
|
50111
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(targetNodeOrNodeid) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetNodeOrNodeid)) {
|
|
50112
|
+
const nodeRest = nodeMaps[targetNodeOrNodeid];
|
|
50113
|
+
if (nodeRest) {
|
|
50114
|
+
targetNode = nodeRest.item;
|
|
50115
|
+
}
|
|
50116
|
+
}
|
|
50117
|
+
if (!records.length) {
|
|
50118
|
+
return Promise.resolve({
|
|
50119
|
+
node: null,
|
|
50120
|
+
nodes: []
|
|
50121
|
+
});
|
|
50122
|
+
}
|
|
50123
|
+
const newRecords = records.map(record => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign({
|
|
50124
|
+
[mapChildrenField]: [],
|
|
50125
|
+
[childrenField]: []
|
|
50126
|
+
}, record));
|
|
50127
|
+
const treeRecords = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(newRecords, {
|
|
50128
|
+
key: keyField,
|
|
50129
|
+
parentKey: parentField,
|
|
50130
|
+
children: childrenField
|
|
50131
|
+
});
|
|
50132
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(targetNode)) {
|
|
50133
|
+
insertTreeNode(newRecords, false);
|
|
50134
|
+
} else {
|
|
50135
|
+
if (targetNode === -1) {
|
|
50136
|
+
insertTreeNode(newRecords, true);
|
|
50137
|
+
} else {
|
|
50138
|
+
const matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => targetNode[keyField] === item[keyField], {
|
|
50139
|
+
children: mapChildrenField
|
|
50140
|
+
});
|
|
50141
|
+
if (matchMapObj) {
|
|
50142
|
+
const {
|
|
50143
|
+
parent: parentNode
|
|
50144
|
+
} = matchMapObj;
|
|
50145
|
+
const parentMapChilds = parentNode ? parentNode[mapChildrenField] : treeFullData;
|
|
50146
|
+
const parentRest = nodeMaps[getNodeId(parentNode)];
|
|
50147
|
+
const parentLevel = parentRest ? parentRest.level : 0;
|
|
50148
|
+
treeRecords.forEach((row, i) => {
|
|
50149
|
+
if (parentNode) {
|
|
50150
|
+
if (row[parentField] !== parentNode[keyField]) {
|
|
50151
|
+
tree_errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentNode[keyField]}`]);
|
|
50152
|
+
row[parentField] = parentNode[keyField];
|
|
50153
|
+
}
|
|
50154
|
+
} else {
|
|
50155
|
+
if (row[parentField] !== null) {
|
|
50156
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(row[parentField])) {
|
|
50157
|
+
tree_errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null']);
|
|
50158
|
+
}
|
|
50159
|
+
row[parentField] = null;
|
|
50160
|
+
}
|
|
50161
|
+
}
|
|
50162
|
+
let targetIndex = matchMapObj.index + i;
|
|
50163
|
+
if (isInsertNextNode) {
|
|
50164
|
+
targetIndex = targetIndex + 1;
|
|
50165
|
+
}
|
|
50166
|
+
parentMapChilds.splice(targetIndex, 0, row);
|
|
50167
|
+
});
|
|
50168
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeRecords, item => {
|
|
50169
|
+
const nodeid = getNodeId(item);
|
|
50170
|
+
const nodeRest = getItemCacheObj(item);
|
|
50171
|
+
nodeRest.level = parentLevel;
|
|
50172
|
+
if (item[childrenField]) {
|
|
50173
|
+
item[mapChildrenField] = item[childrenField];
|
|
50174
|
+
}
|
|
50175
|
+
nodeMaps[nodeid] = nodeRest;
|
|
50176
|
+
}, {
|
|
50177
|
+
children: childrenField
|
|
50178
|
+
});
|
|
50179
|
+
// 源
|
|
50180
|
+
if (parentNode) {
|
|
50181
|
+
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => targetNode[keyField] === item[keyField], {
|
|
50182
|
+
children: childrenField
|
|
50183
|
+
});
|
|
50184
|
+
if (matchObj) {
|
|
50185
|
+
const parentChilds = matchObj.items;
|
|
50186
|
+
let targetIndex = matchObj.index;
|
|
50187
|
+
if (isInsertNextNode) {
|
|
50188
|
+
targetIndex = targetIndex + 1;
|
|
50189
|
+
}
|
|
50190
|
+
parentChilds.splice(targetIndex, 0, ...treeRecords);
|
|
50191
|
+
}
|
|
50192
|
+
}
|
|
50193
|
+
} else {
|
|
50194
|
+
tree_warnLog('vxe.error.unableInsert');
|
|
50195
|
+
insertTreeNode(newRecords, true);
|
|
50196
|
+
}
|
|
50197
|
+
}
|
|
50198
|
+
}
|
|
50199
|
+
reactData.insertRowFlag++;
|
|
50200
|
+
cacheNodeMap();
|
|
50201
|
+
handleData(true);
|
|
50202
|
+
updateAfterDataIndex();
|
|
50203
|
+
updateCheckboxStatus();
|
|
50204
|
+
if (reactData.scrollYLoad) {
|
|
50205
|
+
updateYSpace();
|
|
50206
|
+
}
|
|
50207
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
50208
|
+
return {
|
|
50209
|
+
node: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
50210
|
+
nodes: newRecords
|
|
50211
|
+
};
|
|
50212
|
+
});
|
|
50213
|
+
};
|
|
49871
50214
|
const treeMethods = {
|
|
49872
50215
|
dispatchEvent,
|
|
49873
50216
|
getNodeId,
|
|
@@ -50349,7 +50692,110 @@ function tree_createReactData() {
|
|
|
50349
50692
|
}
|
|
50350
50693
|
return recalculate();
|
|
50351
50694
|
},
|
|
50352
|
-
clearScroll
|
|
50695
|
+
clearScroll,
|
|
50696
|
+
insert(records) {
|
|
50697
|
+
return handleInsertNodeAt(records, null);
|
|
50698
|
+
},
|
|
50699
|
+
insertAt(records, targetNodeOrNodeid) {
|
|
50700
|
+
return handleInsertNodeAt(records, targetNodeOrNodeid);
|
|
50701
|
+
},
|
|
50702
|
+
insertNextAt(records, targetNodeOrNodeid) {
|
|
50703
|
+
return handleInsertNodeAt(records, targetNodeOrNodeid, true);
|
|
50704
|
+
},
|
|
50705
|
+
remove(nodes) {
|
|
50706
|
+
const {
|
|
50707
|
+
transform
|
|
50708
|
+
} = props;
|
|
50709
|
+
const {
|
|
50710
|
+
treeFullData
|
|
50711
|
+
} = internalData;
|
|
50712
|
+
const childrenField = computeChildrenField.value;
|
|
50713
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
50714
|
+
if (!transform) {
|
|
50715
|
+
tree_errLog('vxe.error.reqSupportProp', ['remove()', 'transform']);
|
|
50716
|
+
return Promise.resolve({
|
|
50717
|
+
node: null,
|
|
50718
|
+
nodes: []
|
|
50719
|
+
});
|
|
50720
|
+
}
|
|
50721
|
+
let delList = [];
|
|
50722
|
+
if (!nodes) {
|
|
50723
|
+
nodes = treeFullData;
|
|
50724
|
+
} else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodes)) {
|
|
50725
|
+
nodes = [nodes];
|
|
50726
|
+
}
|
|
50727
|
+
if (!nodes.length) {
|
|
50728
|
+
return Promise.resolve({
|
|
50729
|
+
node: null,
|
|
50730
|
+
nodes: []
|
|
50731
|
+
});
|
|
50732
|
+
}
|
|
50733
|
+
// 从数据源中移除
|
|
50734
|
+
if (treeFullData === nodes) {
|
|
50735
|
+
nodes = delList = treeFullData.slice(0);
|
|
50736
|
+
internalData.treeFullData = [];
|
|
50737
|
+
} else {
|
|
50738
|
+
nodes.forEach(item => {
|
|
50739
|
+
const nodeid = getNodeId(item);
|
|
50740
|
+
const matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => nodeid === getNodeId(item), {
|
|
50741
|
+
children: mapChildrenField
|
|
50742
|
+
});
|
|
50743
|
+
if (matchMapObj) {
|
|
50744
|
+
const rItems = matchMapObj.items.splice(matchMapObj.index, 1);
|
|
50745
|
+
delList.push(rItems[0]);
|
|
50746
|
+
}
|
|
50747
|
+
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => nodeid === getNodeId(item), {
|
|
50748
|
+
children: childrenField
|
|
50749
|
+
});
|
|
50750
|
+
if (matchObj) {
|
|
50751
|
+
const rItems = matchObj.items.splice(matchObj.index, 1);
|
|
50752
|
+
delList.push(rItems[0]);
|
|
50753
|
+
}
|
|
50754
|
+
});
|
|
50755
|
+
}
|
|
50756
|
+
reactData.removeRowFlag++;
|
|
50757
|
+
reactData.insertRowFlag++;
|
|
50758
|
+
cacheNodeMap();
|
|
50759
|
+
handleData(true);
|
|
50760
|
+
updateAfterDataIndex();
|
|
50761
|
+
updateCheckboxStatus();
|
|
50762
|
+
if (reactData.scrollYLoad) {
|
|
50763
|
+
updateYSpace();
|
|
50764
|
+
}
|
|
50765
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
50766
|
+
return recalculate();
|
|
50767
|
+
}).then(() => {
|
|
50768
|
+
return {
|
|
50769
|
+
node: delList.length ? delList[delList.length - 1] : null,
|
|
50770
|
+
nodes: delList
|
|
50771
|
+
};
|
|
50772
|
+
});
|
|
50773
|
+
},
|
|
50774
|
+
getInsertRecords() {
|
|
50775
|
+
const {
|
|
50776
|
+
insertRowMaps
|
|
50777
|
+
} = internalData;
|
|
50778
|
+
const insertRecords = [];
|
|
50779
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertRowMaps, row => {
|
|
50780
|
+
insertRecords.push(row);
|
|
50781
|
+
});
|
|
50782
|
+
return insertRecords;
|
|
50783
|
+
},
|
|
50784
|
+
getRemoveRecords() {
|
|
50785
|
+
const {
|
|
50786
|
+
removeRowMaps
|
|
50787
|
+
} = internalData;
|
|
50788
|
+
const removeRecords = [];
|
|
50789
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeRowMaps, row => {
|
|
50790
|
+
removeRecords.push(row);
|
|
50791
|
+
});
|
|
50792
|
+
return removeRecords;
|
|
50793
|
+
}
|
|
50794
|
+
};
|
|
50795
|
+
const handleNodeDragEndClearStatus = () => {
|
|
50796
|
+
clearNodeDragData();
|
|
50797
|
+
clearCrossTreeDragStatus();
|
|
50798
|
+
recalculate();
|
|
50353
50799
|
};
|
|
50354
50800
|
const clearNodeDropOrigin = () => {
|
|
50355
50801
|
const el = refElem.value;
|
|
@@ -50403,7 +50849,7 @@ function tree_createReactData() {
|
|
|
50403
50849
|
}
|
|
50404
50850
|
};
|
|
50405
50851
|
const clearCrossTreeDragStatus = () => {
|
|
50406
|
-
|
|
50852
|
+
crossTreeDragNodeObj = null;
|
|
50407
50853
|
crossTreeDragNodeInfo.node = null;
|
|
50408
50854
|
};
|
|
50409
50855
|
const clearDragStatus = () => {
|
|
@@ -50800,6 +51246,23 @@ function tree_createReactData() {
|
|
|
50800
51246
|
prevDragToChild
|
|
50801
51247
|
} = internalData;
|
|
50802
51248
|
const hasChildField = computeHasChildField.value;
|
|
51249
|
+
const dragConfig = computeDragOpts.value;
|
|
51250
|
+
const {
|
|
51251
|
+
isCrossDrag,
|
|
51252
|
+
isCrossTreeDrag
|
|
51253
|
+
} = dragConfig;
|
|
51254
|
+
// 跨树拖拽
|
|
51255
|
+
if (isCrossTreeDrag && crossTreeDragNodeObj) {
|
|
51256
|
+
const {
|
|
51257
|
+
$newTree
|
|
51258
|
+
} = crossTreeDragNodeObj;
|
|
51259
|
+
if ($newTree && $newTree.xID !== $xeTree.xID) {
|
|
51260
|
+
if (isCrossDrag) {
|
|
51261
|
+
$newTree.handleCrossTreeNodeDragInsertEvent(evnt);
|
|
51262
|
+
}
|
|
51263
|
+
return;
|
|
51264
|
+
}
|
|
51265
|
+
}
|
|
50803
51266
|
if (lazy && prevDragToChild) {
|
|
50804
51267
|
// 懒加载
|
|
50805
51268
|
const newNodeid = getNodeId(prevDragNode);
|
|
@@ -50886,15 +51349,228 @@ function tree_createReactData() {
|
|
|
50886
51349
|
/**
|
|
50887
51350
|
* 处理跨树拖拽完成
|
|
50888
51351
|
*/
|
|
50889
|
-
handleCrossTreeNodeDragFinishEvent() {
|
|
51352
|
+
handleCrossTreeNodeDragFinishEvent(evnt) {
|
|
51353
|
+
const {
|
|
51354
|
+
treeList
|
|
51355
|
+
} = reactData;
|
|
51356
|
+
const {
|
|
51357
|
+
nodeMaps
|
|
51358
|
+
} = internalData;
|
|
51359
|
+
const dragOpts = computeDragOpts.value;
|
|
51360
|
+
const {
|
|
51361
|
+
animation,
|
|
51362
|
+
isCrossTreeDrag
|
|
51363
|
+
} = dragOpts;
|
|
51364
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
51365
|
+
const el = refElem.value;
|
|
51366
|
+
if (!el) {
|
|
51367
|
+
return;
|
|
51368
|
+
}
|
|
51369
|
+
if (isCrossTreeDrag && crossTreeDragNodeObj && crossTreeDragNodeInfo) {
|
|
51370
|
+
const {
|
|
51371
|
+
node: dragNode
|
|
51372
|
+
} = crossTreeDragNodeInfo;
|
|
51373
|
+
if (dragNode) {
|
|
51374
|
+
const dragNodeid = getNodeId(dragNode);
|
|
51375
|
+
const dragNodeRest = nodeMaps[dragNodeid];
|
|
51376
|
+
let dragNodeHeight = 0;
|
|
51377
|
+
let rsIndex = -1;
|
|
51378
|
+
if (dragNodeRest) {
|
|
51379
|
+
if (animation) {
|
|
51380
|
+
const oldItemEl = el.querySelector(`.vxe-tree--node-wrapper[nodeid="${dragNodeid}"]`);
|
|
51381
|
+
const targetItemEl = oldItemEl;
|
|
51382
|
+
if (targetItemEl) {
|
|
51383
|
+
dragNodeHeight = targetItemEl.offsetHeight;
|
|
51384
|
+
}
|
|
51385
|
+
}
|
|
51386
|
+
rsIndex = dragNodeRest.$index;
|
|
51387
|
+
}
|
|
51388
|
+
const dragRangeList = rsIndex > -1 && rsIndex < treeList.length - 1 ? treeList.slice(rsIndex + 1) : [];
|
|
51389
|
+
const dragList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray([dragNode], {
|
|
51390
|
+
updated: true,
|
|
51391
|
+
children: mapChildrenField
|
|
51392
|
+
});
|
|
51393
|
+
$xeTree.remove(dragList).then(() => {
|
|
51394
|
+
if (animation && dragNodeHeight && dragRangeList.length) {
|
|
51395
|
+
const wrapperEl = el;
|
|
51396
|
+
const dtClss = [];
|
|
51397
|
+
dragRangeList.forEach(item => {
|
|
51398
|
+
const nodeid = getNodeId(item);
|
|
51399
|
+
dtClss.push(`.vxe-tree--node-wrapper[nodeid="${nodeid}"]`);
|
|
51400
|
+
});
|
|
51401
|
+
const dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
|
|
51402
|
+
moveRowAnimateToTb(dtTrList, dragNodeHeight);
|
|
51403
|
+
}
|
|
51404
|
+
});
|
|
51405
|
+
dispatchEvent('node-remove-dragend', {
|
|
51406
|
+
node: dragNode
|
|
51407
|
+
}, evnt);
|
|
51408
|
+
handleNodeDragEndClearStatus();
|
|
51409
|
+
}
|
|
51410
|
+
}
|
|
51411
|
+
},
|
|
50890
51412
|
/**
|
|
50891
51413
|
* 处理跨树拖至新的空树
|
|
50892
51414
|
*/
|
|
50893
|
-
|
|
51415
|
+
handleCrossTreeNodeDragoverEmptyEvent(evnt) {
|
|
51416
|
+
const {
|
|
51417
|
+
treeList
|
|
51418
|
+
} = reactData;
|
|
51419
|
+
const dragOpts = computeDragOpts.value;
|
|
51420
|
+
const {
|
|
51421
|
+
isCrossTreeDrag
|
|
51422
|
+
} = dragOpts;
|
|
51423
|
+
if (isCrossTreeDrag && crossTreeDragNodeObj && !treeList.length) {
|
|
51424
|
+
const {
|
|
51425
|
+
$oldTree,
|
|
51426
|
+
$newTree
|
|
51427
|
+
} = crossTreeDragNodeObj;
|
|
51428
|
+
if ($oldTree) {
|
|
51429
|
+
const oldTreeReactData = $oldTree;
|
|
51430
|
+
if ($oldTree.xID !== $xeTree.xID) {
|
|
51431
|
+
if ($newTree && $newTree.xID !== $xeTree.xID) {
|
|
51432
|
+
$newTree.hideCrossTreeNodeDropClearStatus();
|
|
51433
|
+
}
|
|
51434
|
+
evnt.preventDefault();
|
|
51435
|
+
$oldTree.hideCrossTreeNodeDropClearStatus();
|
|
51436
|
+
crossTreeDragNodeObj.$newTree = $xeTree;
|
|
51437
|
+
internalData.prevDragNode = null;
|
|
51438
|
+
reactData.dragTipText = oldTreeReactData.dragTipText;
|
|
51439
|
+
showDropTip(evnt, evnt.currentTarget, true, '');
|
|
51440
|
+
}
|
|
51441
|
+
}
|
|
51442
|
+
}
|
|
51443
|
+
},
|
|
50894
51444
|
/**
|
|
50895
51445
|
* 处理跨树拖插入
|
|
50896
51446
|
*/
|
|
50897
|
-
|
|
51447
|
+
handleCrossTreeNodeDragInsertEvent(evnt) {
|
|
51448
|
+
const {
|
|
51449
|
+
prevDragNode,
|
|
51450
|
+
prevDragPos,
|
|
51451
|
+
prevDragToChild
|
|
51452
|
+
} = internalData;
|
|
51453
|
+
const dragOpts = computeDragOpts.value;
|
|
51454
|
+
const {
|
|
51455
|
+
animation,
|
|
51456
|
+
isSelfToChildDrag,
|
|
51457
|
+
isCrossTreeDrag,
|
|
51458
|
+
dragEndMethod,
|
|
51459
|
+
dragToChildMethod
|
|
51460
|
+
} = dragOpts;
|
|
51461
|
+
const parentField = computeParentField.value;
|
|
51462
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
51463
|
+
const childrenField = computeChildrenField.value;
|
|
51464
|
+
// 跨表拖拽
|
|
51465
|
+
if (isCrossTreeDrag && crossTreeDragNodeObj && crossTreeDragNodeInfo) {
|
|
51466
|
+
const {
|
|
51467
|
+
node: oldNode
|
|
51468
|
+
} = crossTreeDragNodeInfo;
|
|
51469
|
+
const {
|
|
51470
|
+
$oldTree
|
|
51471
|
+
} = crossTreeDragNodeObj;
|
|
51472
|
+
const el = refElem.value;
|
|
51473
|
+
if (!el) {
|
|
51474
|
+
return;
|
|
51475
|
+
}
|
|
51476
|
+
if ($oldTree && oldNode) {
|
|
51477
|
+
const dragNode = oldNode;
|
|
51478
|
+
let dragOffsetIndex = -1;
|
|
51479
|
+
if (prevDragNode) {
|
|
51480
|
+
dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
51481
|
+
}
|
|
51482
|
+
const dragParams = {
|
|
51483
|
+
oldNode: dragNode,
|
|
51484
|
+
newNode: prevDragNode,
|
|
51485
|
+
dragNode,
|
|
51486
|
+
dragPos: prevDragPos,
|
|
51487
|
+
dragToChild: !!prevDragToChild,
|
|
51488
|
+
offsetIndex: dragOffsetIndex
|
|
51489
|
+
};
|
|
51490
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
51491
|
+
const errRest = {
|
|
51492
|
+
status: false
|
|
51493
|
+
};
|
|
51494
|
+
Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
51495
|
+
if (!status) {
|
|
51496
|
+
if ($oldTree) {
|
|
51497
|
+
if ($oldTree.xID !== $xeTree.xID) {
|
|
51498
|
+
$oldTree.handleCrossTreeNodeDragCancelEvent(evnt);
|
|
51499
|
+
}
|
|
51500
|
+
}
|
|
51501
|
+
handleNodeDragEndClearStatus();
|
|
51502
|
+
return errRest;
|
|
51503
|
+
}
|
|
51504
|
+
let insertRest = Promise.resolve();
|
|
51505
|
+
const dragList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray([dragNode], {
|
|
51506
|
+
updated: true,
|
|
51507
|
+
children: mapChildrenField
|
|
51508
|
+
});
|
|
51509
|
+
$oldTree.handleCrossTreeNodeDragFinishEvent(evnt);
|
|
51510
|
+
if (prevDragNode) {
|
|
51511
|
+
dragNode[parentField] = prevDragNode[parentField];
|
|
51512
|
+
} else {
|
|
51513
|
+
dragNode[parentField] = null;
|
|
51514
|
+
}
|
|
51515
|
+
dragList.forEach(row => {
|
|
51516
|
+
row[childrenField] = undefined;
|
|
51517
|
+
row[mapChildrenField] = undefined;
|
|
51518
|
+
});
|
|
51519
|
+
if (prevDragNode) {
|
|
51520
|
+
if (prevDragPos === 'bottom') {
|
|
51521
|
+
insertRest = $xeTree.insertNextAt(dragList, prevDragNode);
|
|
51522
|
+
} else {
|
|
51523
|
+
insertRest = $xeTree.insertAt(dragList, prevDragNode);
|
|
51524
|
+
}
|
|
51525
|
+
} else {
|
|
51526
|
+
insertRest = $xeTree.insert(dragList);
|
|
51527
|
+
}
|
|
51528
|
+
$xeTree.dispatchEvent('node-insert-dragend', {
|
|
51529
|
+
oldNode,
|
|
51530
|
+
newNode: prevDragNode,
|
|
51531
|
+
dragNode,
|
|
51532
|
+
dragPos: prevDragPos,
|
|
51533
|
+
dragToChild: isDragToChildFlag,
|
|
51534
|
+
offsetIndex: dragOffsetIndex
|
|
51535
|
+
}, evnt);
|
|
51536
|
+
clearNodeDragData();
|
|
51537
|
+
insertRest.then(() => {
|
|
51538
|
+
const {
|
|
51539
|
+
treeList
|
|
51540
|
+
} = reactData;
|
|
51541
|
+
const {
|
|
51542
|
+
nodeMaps
|
|
51543
|
+
} = internalData;
|
|
51544
|
+
const oldNodeid = getNodeId(dragNode);
|
|
51545
|
+
const oldNodeRest = nodeMaps[oldNodeid];
|
|
51546
|
+
let dragNodeHeight = 0;
|
|
51547
|
+
let rsIndex = -1;
|
|
51548
|
+
if (oldNodeRest) {
|
|
51549
|
+
if (animation) {
|
|
51550
|
+
const oldItemEl = el.querySelector(`.vxe-tree--node-wrapper[nodeid="${oldNodeid}"]`);
|
|
51551
|
+
const targetItemEl = oldItemEl;
|
|
51552
|
+
if (targetItemEl) {
|
|
51553
|
+
dragNodeHeight = targetItemEl.offsetHeight;
|
|
51554
|
+
}
|
|
51555
|
+
}
|
|
51556
|
+
rsIndex = oldNodeRest.$index;
|
|
51557
|
+
}
|
|
51558
|
+
const dragRangeList = rsIndex > -1 ? treeList.slice(rsIndex) : [];
|
|
51559
|
+
if (animation && dragNodeHeight && dragRangeList.length) {
|
|
51560
|
+
const wrapperEl = el;
|
|
51561
|
+
const dtClss = [];
|
|
51562
|
+
dragRangeList.forEach(item => {
|
|
51563
|
+
const nodeid = getNodeId(item);
|
|
51564
|
+
dtClss.push(`.vxe-tree--node-wrapper[nodeid="${nodeid}"]`);
|
|
51565
|
+
});
|
|
51566
|
+
const dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
|
|
51567
|
+
moveRowAnimateToTb(dtTrList, -dragNodeHeight);
|
|
51568
|
+
}
|
|
51569
|
+
});
|
|
51570
|
+
});
|
|
51571
|
+
}
|
|
51572
|
+
}
|
|
51573
|
+
},
|
|
50898
51574
|
hideCrossTreeNodeDropClearStatus() {
|
|
50899
51575
|
hideDropTip();
|
|
50900
51576
|
}
|
|
@@ -51234,9 +51910,14 @@ function tree_createReactData() {
|
|
|
51234
51910
|
const loadingOpts = computeLoadingOpts.value;
|
|
51235
51911
|
const isRowHover = computeIsRowHover.value;
|
|
51236
51912
|
const treeStyle = computeTreeStyle.value;
|
|
51913
|
+
const dragOpts = computeDragOpts.value;
|
|
51237
51914
|
const loadingSlot = slots.loading;
|
|
51238
51915
|
const headerSlot = slots.header;
|
|
51239
51916
|
const footerSlot = slots.footer;
|
|
51917
|
+
const teOns = {};
|
|
51918
|
+
if (dragOpts.isCrossTreeDrag && !treeList.length) {
|
|
51919
|
+
teOns.onDragover = $xeTree.handleCrossTreeNodeDragInsertEvent;
|
|
51920
|
+
}
|
|
51240
51921
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
51241
51922
|
ref: refElem,
|
|
51242
51923
|
class: ['vxe-tree', {
|
|
@@ -51247,7 +51928,8 @@ function tree_createReactData() {
|
|
|
51247
51928
|
'node--hover': isRowHover,
|
|
51248
51929
|
'node--trigger': trigger === 'node',
|
|
51249
51930
|
'is--loading': loading
|
|
51250
|
-
}]
|
|
51931
|
+
}],
|
|
51932
|
+
...teOns
|
|
51251
51933
|
}, [headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
51252
51934
|
ref: refHeaderWrapperElem,
|
|
51253
51935
|
class: 'vxe-tree--header-wrapper'
|
|
@@ -51351,8 +52033,8 @@ function tree_createReactData() {
|
|
|
51351
52033
|
if (drag && !transform) {
|
|
51352
52034
|
tree_errLog('vxe.error.notSupportProp', ['drag', 'transform=false', 'transform=true']);
|
|
51353
52035
|
}
|
|
51354
|
-
if (dragOpts.isCrossTreeDrag) {
|
|
51355
|
-
tree_errLog('vxe.error.
|
|
52036
|
+
if (dragOpts.isCrossTreeDrag && !dragOpts.isCrossDrag) {
|
|
52037
|
+
tree_errLog('vxe.error.reqSupportProp', ['drag-config.isCrossTreeDrag', 'drag-config.isCrossDrag']);
|
|
51356
52038
|
}
|
|
51357
52039
|
// if (valueField) {
|
|
51358
52040
|
// errLog('vxe.error.delProp', ['value-field', 'value-field'])
|