vxe-pc-ui 4.14.39 → 4.15.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/dist/all.esm.js +1722 -728
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/cascader/src/cascader.js +1157 -172
- package/es/cascader/src/util.js +7 -0
- package/es/cascader/style.css +197 -21
- package/es/cascader/style.min.css +1 -1
- package/es/input/src/input.js +2 -2
- package/es/language/ar-EG.js +7 -0
- package/es/language/de-DE.js +7 -0
- package/es/language/en-US.js +7 -0
- package/es/language/es-ES.js +7 -0
- package/es/language/fr-FR.js +7 -0
- package/es/language/hu-HU.js +7 -0
- package/es/language/hy-AM.js +7 -0
- package/es/language/id-ID.js +7 -0
- package/es/language/it-IT.js +7 -0
- package/es/language/ja-JP.js +7 -0
- package/es/language/ko-KR.js +7 -0
- package/es/language/ms-MY.js +7 -0
- package/es/language/nb-NO.js +7 -0
- package/es/language/pt-BR.js +7 -0
- package/es/language/ru-RU.js +7 -0
- package/es/language/th-TH.js +7 -0
- package/es/language/ug-CN.js +7 -0
- package/es/language/uk-UA.js +7 -0
- package/es/language/uz-UZ.js +7 -0
- package/es/language/vi-VN.js +7 -0
- package/es/language/zh-CHT.js +7 -0
- package/es/language/zh-CN.js +7 -0
- package/es/list/style.css +2 -1
- package/es/list/style.min.css +1 -1
- package/es/number-input/src/number-input.js +7 -7
- package/es/number-input/src/util.js +2 -2
- package/es/split/style.css +1 -1
- package/es/split/style.min.css +1 -1
- package/es/splitter/style.css +1 -1
- package/es/splitter/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +23 -21
- package/es/tree-select/src/tree-select.js +20 -16
- package/es/tree-select/style.css +1 -8
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +10 -4
- package/es/ui/src/dom.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-cascader/style.css +197 -21
- package/es/vxe-cascader/style.min.css +1 -1
- package/es/vxe-list/style.css +2 -1
- package/es/vxe-list/style.min.css +1 -1
- package/es/vxe-split/style.css +1 -1
- package/es/vxe-split/style.min.css +1 -1
- package/es/vxe-splitter/style.css +1 -1
- package/es/vxe-splitter/style.min.css +1 -1
- package/es/vxe-tree-select/style.css +1 -8
- package/es/vxe-tree-select/style.min.css +1 -1
- package/lib/cascader/src/cascader.js +1322 -173
- package/lib/cascader/src/cascader.min.js +1 -1
- package/lib/cascader/src/util.js +15 -0
- package/lib/cascader/src/util.min.js +1 -0
- package/lib/cascader/style/style.css +197 -21
- package/lib/cascader/style/style.min.css +1 -1
- package/lib/index.umd.js +2159 -972
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +2 -2
- package/lib/input/src/input.min.js +1 -1
- package/lib/language/ar-EG.js +7 -0
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +7 -0
- package/lib/language/de-DE.js +7 -0
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +7 -0
- package/lib/language/en-US.js +7 -0
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +7 -0
- package/lib/language/es-ES.js +7 -0
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +7 -0
- package/lib/language/fr-FR.js +7 -0
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +7 -0
- package/lib/language/hu-HU.js +7 -0
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +7 -0
- package/lib/language/hy-AM.js +7 -0
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +7 -0
- package/lib/language/id-ID.js +7 -0
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +7 -0
- package/lib/language/it-IT.js +7 -0
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +7 -0
- package/lib/language/ja-JP.js +7 -0
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +7 -0
- package/lib/language/ko-KR.js +7 -0
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +7 -0
- package/lib/language/ms-MY.js +7 -0
- package/lib/language/ms-MY.min.js +1 -1
- package/lib/language/ms-MY.umd.js +7 -0
- package/lib/language/nb-NO.js +7 -0
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +7 -0
- package/lib/language/pt-BR.js +7 -0
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +7 -0
- package/lib/language/ru-RU.js +7 -0
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +7 -0
- package/lib/language/th-TH.js +7 -0
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +7 -0
- package/lib/language/ug-CN.js +7 -0
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +7 -0
- package/lib/language/uk-UA.js +7 -0
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +7 -0
- package/lib/language/uz-UZ.js +7 -0
- package/lib/language/uz-UZ.min.js +1 -1
- package/lib/language/uz-UZ.umd.js +7 -0
- package/lib/language/vi-VN.js +7 -0
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +7 -0
- package/lib/language/zh-CHT.js +7 -0
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +7 -0
- package/lib/language/zh-CN.js +7 -0
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +7 -0
- package/lib/list/style/style.css +2 -1
- package/lib/list/style/style.min.css +1 -1
- package/lib/number-input/src/number-input.js +7 -4
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/number-input/src/util.js +2 -2
- package/lib/number-input/src/util.min.js +1 -1
- package/lib/split/style/style.css +1 -1
- package/lib/split/style/style.min.css +1 -1
- package/lib/splitter/style/style.css +1 -1
- package/lib/splitter/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 +23 -21
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +22 -17
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/tree-select/style/style.css +1 -8
- package/lib/tree-select/style/style.min.css +1 -1
- package/lib/ui/index.js +10 -4
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +5 -3
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-cascader/style/style.css +197 -21
- package/lib/vxe-cascader/style/style.min.css +1 -1
- package/lib/vxe-list/style/style.css +2 -1
- package/lib/vxe-list/style/style.min.css +1 -1
- package/lib/vxe-split/style/style.css +1 -1
- package/lib/vxe-split/style/style.min.css +1 -1
- package/lib/vxe-splitter/style/style.css +1 -1
- package/lib/vxe-splitter/style/style.min.css +1 -1
- package/lib/vxe-tree-select/style/style.css +1 -8
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/cascader/src/cascader.ts +1193 -182
- package/packages/cascader/src/util.ts +9 -0
- package/packages/input/src/input.ts +2 -2
- package/packages/language/ar-EG.ts +7 -0
- package/packages/language/de-DE.ts +7 -0
- package/packages/language/en-US.ts +7 -0
- package/packages/language/es-ES.ts +7 -0
- package/packages/language/fr-FR.ts +7 -0
- package/packages/language/hu-HU.ts +7 -0
- package/packages/language/hy-AM.ts +7 -0
- package/packages/language/id-ID.ts +7 -0
- package/packages/language/it-IT.ts +7 -0
- package/packages/language/ja-JP.ts +7 -0
- package/packages/language/ko-KR.ts +7 -0
- package/packages/language/ms-MY.ts +7 -0
- package/packages/language/nb-NO.ts +7 -0
- package/packages/language/pt-BR.ts +7 -0
- package/packages/language/ru-RU.ts +7 -0
- package/packages/language/th-TH.ts +7 -0
- package/packages/language/ug-CN.ts +7 -0
- package/packages/language/uk-UA.ts +7 -0
- package/packages/language/uz-UZ.ts +7 -0
- package/packages/language/vi-VN.ts +7 -0
- package/packages/language/zh-CHT.ts +7 -0
- package/packages/language/zh-CN.ts +7 -0
- package/packages/number-input/src/number-input.ts +7 -7
- package/packages/number-input/src/util.ts +2 -2
- package/packages/tree/src/tree.ts +23 -22
- package/packages/tree-select/src/tree-select.ts +21 -16
- package/packages/ui/index.ts +10 -3
- package/packages/ui/src/dom.ts +3 -2
- package/styles/components/cascader.scss +116 -21
- package/styles/components/list.scss +2 -1
- package/styles/components/splitter.scss +3 -1
- package/styles/components/tree-select.scss +1 -8
- package/styles/helpers/placement.scss +2 -2
- package/styles/theme/base.scss +7 -0
- package/styles/theme/dark.scss +9 -0
- package/styles/theme/light.scss +9 -0
- package/styles/variable.scss +8 -0
- package/types/components/cascader.d.ts +167 -57
- package/types/ui/global-icon.d.ts +5 -0
- /package/es/icon/{iconfont.1781503194392.ttf → iconfont.1781659237913.ttf} +0 -0
- /package/es/icon/{iconfont.1781503194392.woff → iconfont.1781659237913.woff} +0 -0
- /package/es/icon/{iconfont.1781503194392.woff2 → iconfont.1781659237913.woff2} +0 -0
- /package/es/{iconfont.1781503194392.ttf → iconfont.1781659237913.ttf} +0 -0
- /package/es/{iconfont.1781503194392.woff → iconfont.1781659237913.woff} +0 -0
- /package/es/{iconfont.1781503194392.woff2 → iconfont.1781659237913.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1781503194392.ttf → iconfont.1781659237913.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1781503194392.woff → iconfont.1781659237913.woff} +0 -0
- /package/lib/icon/style/{iconfont.1781503194392.woff2 → iconfont.1781659237913.woff2} +0 -0
- /package/lib/{iconfont.1781503194392.ttf → iconfont.1781659237913.ttf} +0 -0
- /package/lib/{iconfont.1781503194392.woff → iconfont.1781659237913.woff} +0 -0
- /package/lib/{iconfont.1781503194392.woff2 → iconfont.1781659237913.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4646,7 +4646,7 @@ function checkDynamic() {
|
|
|
4646
4646
|
}
|
|
4647
4647
|
;// ./packages/ui/src/log.ts
|
|
4648
4648
|
|
|
4649
|
-
const log_version = `ui v${"4.
|
|
4649
|
+
const log_version = `ui v${"4.15.0"}`;
|
|
4650
4650
|
const warnLog = log.create('warn', log_version);
|
|
4651
4651
|
const errLog = log.create('error', log_version);
|
|
4652
4652
|
;// ./packages/ui/index.ts
|
|
@@ -4654,7 +4654,7 @@ const errLog = log.create('error', log_version);
|
|
|
4654
4654
|
|
|
4655
4655
|
|
|
4656
4656
|
|
|
4657
|
-
const ui_version = "4.
|
|
4657
|
+
const ui_version = "4.15.0";
|
|
4658
4658
|
VxeUI.uiVersion = ui_version;
|
|
4659
4659
|
VxeUI.dynamicApp = dynamicApp;
|
|
4660
4660
|
function config(options) {
|
|
@@ -4714,7 +4714,10 @@ setConfig({
|
|
|
4714
4714
|
},
|
|
4715
4715
|
carouselItem: {},
|
|
4716
4716
|
cascader: {
|
|
4717
|
-
|
|
4717
|
+
showFullLabel: true,
|
|
4718
|
+
treeConfig: {
|
|
4719
|
+
showIcon: true
|
|
4720
|
+
}
|
|
4718
4721
|
},
|
|
4719
4722
|
checkbox: {},
|
|
4720
4723
|
checkboxButton: {},
|
|
@@ -5068,7 +5071,6 @@ setConfig({
|
|
|
5068
5071
|
}
|
|
5069
5072
|
},
|
|
5070
5073
|
treeSelect: {
|
|
5071
|
-
autoClose: null,
|
|
5072
5074
|
// separator: '/',
|
|
5073
5075
|
virtualYConfig: {
|
|
5074
5076
|
enabled: true,
|
|
@@ -5306,7 +5308,11 @@ setIcon({
|
|
|
5306
5308
|
BACKTOP_TOP: iconPrefix + 'top',
|
|
5307
5309
|
// context-menu
|
|
5308
5310
|
CONTEXT_MENU_OPTION_LOADING: iconPrefix + 'spinner roll',
|
|
5309
|
-
CONTEXT_MENU_CHILDREN: iconPrefix + 'arrow-right'
|
|
5311
|
+
CONTEXT_MENU_CHILDREN: iconPrefix + 'arrow-right',
|
|
5312
|
+
// cascader
|
|
5313
|
+
CASCADER_NODE_OPEN: iconPrefix + 'arrow-right',
|
|
5314
|
+
CASCADER_NODE_CLOSE: iconPrefix + 'arrow-right',
|
|
5315
|
+
CASCADER_NODE_LOADED: iconPrefix + 'spinner roll'
|
|
5310
5316
|
});
|
|
5311
5317
|
|
|
5312
5318
|
/* harmony default export */ var ui = ((/* unused pure expression or super */ null && (ui_VxeUI)));
|
|
@@ -5664,6 +5670,13 @@ setIcon({
|
|
|
5664
5670
|
yearLabel: '{0} 年',
|
|
5665
5671
|
monthLabel: '{0} 月'
|
|
5666
5672
|
},
|
|
5673
|
+
cascader: {
|
|
5674
|
+
clearChecked: '清除',
|
|
5675
|
+
allChecked: '全选',
|
|
5676
|
+
total: '已选 {0} 项',
|
|
5677
|
+
close: '关闭',
|
|
5678
|
+
search: '搜索'
|
|
5679
|
+
},
|
|
5667
5680
|
numberInput: {
|
|
5668
5681
|
currencySymbol: '¥'
|
|
5669
5682
|
},
|
|
@@ -6474,10 +6487,12 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
6474
6487
|
placement,
|
|
6475
6488
|
defaultPlacement,
|
|
6476
6489
|
teleportTo,
|
|
6477
|
-
marginSize
|
|
6490
|
+
marginSize,
|
|
6491
|
+
isMinWidth
|
|
6478
6492
|
} = Object.assign({
|
|
6479
6493
|
teleportTo: false,
|
|
6480
|
-
marginSize: 18
|
|
6494
|
+
marginSize: 18,
|
|
6495
|
+
isMinWidth: true
|
|
6481
6496
|
}, options);
|
|
6482
6497
|
let panelPlacement = 'bottom';
|
|
6483
6498
|
let top = '';
|
|
@@ -6571,7 +6586,7 @@ function updatePanelPlacement(targetElem, panelElem, options) {
|
|
|
6571
6586
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(right)) {
|
|
6572
6587
|
stys.right = toCssUnit(right);
|
|
6573
6588
|
}
|
|
6574
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(minWidth)) {
|
|
6589
|
+
if (isMinWidth && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(minWidth)) {
|
|
6575
6590
|
stys.minWidth = toCssUnit(minWidth);
|
|
6576
6591
|
}
|
|
6577
6592
|
}
|
|
@@ -11837,7 +11852,7 @@ dynamicApp.use(VxeCarouselItem);
|
|
|
11837
11852
|
VxeUI.component(carousel_item);
|
|
11838
11853
|
const CarouselItem = VxeCarouselItem;
|
|
11839
11854
|
/* harmony default export */ var packages_carousel_item = (VxeCarouselItem);
|
|
11840
|
-
;// ./packages/
|
|
11855
|
+
;// ./packages/cascader/src/util.ts
|
|
11841
11856
|
|
|
11842
11857
|
function enNodeValue(nodeid) {
|
|
11843
11858
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(nodeid) ? '' : encodeURIComponent(`${nodeid}`);
|
|
@@ -11845,58 +11860,467 @@ function enNodeValue(nodeid) {
|
|
|
11845
11860
|
function deNodeValue(nodeid) {
|
|
11846
11861
|
return nodeid ? decodeURIComponent(`${nodeid}`) : nodeid;
|
|
11847
11862
|
}
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
}
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11863
|
+
;// ./packages/list/src/list.ts
|
|
11864
|
+
|
|
11865
|
+
|
|
11866
|
+
|
|
11867
|
+
|
|
11868
|
+
|
|
11869
|
+
|
|
11870
|
+
function list_createReactData() {
|
|
11871
|
+
return {
|
|
11872
|
+
scrollYLoad: false,
|
|
11873
|
+
bodyHeight: 0,
|
|
11874
|
+
customHeight: 0,
|
|
11875
|
+
customMaxHeight: 0,
|
|
11876
|
+
parentHeight: 0,
|
|
11877
|
+
topSpaceHeight: 0,
|
|
11878
|
+
items: []
|
|
11879
|
+
};
|
|
11880
|
+
}
|
|
11881
|
+
function list_createInternalData() {
|
|
11882
|
+
return {
|
|
11883
|
+
resizeObserver: undefined,
|
|
11884
|
+
fullData: [],
|
|
11885
|
+
lastScrollLeft: 0,
|
|
11886
|
+
lastScrollTop: 0,
|
|
11887
|
+
scrollYStore: {
|
|
11888
|
+
startIndex: 0,
|
|
11889
|
+
endIndex: 0,
|
|
11890
|
+
visibleSize: 0,
|
|
11891
|
+
offsetSize: 0,
|
|
11892
|
+
rowHeight: 0
|
|
11875
11893
|
}
|
|
11876
|
-
}
|
|
11877
|
-
return count;
|
|
11894
|
+
};
|
|
11878
11895
|
}
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11896
|
+
/* harmony default export */ var list = (defineVxeComponent({
|
|
11897
|
+
name: 'VxeList',
|
|
11898
|
+
props: {
|
|
11899
|
+
data: Array,
|
|
11900
|
+
height: [Number, String],
|
|
11901
|
+
maxHeight: [Number, String],
|
|
11902
|
+
loading: Boolean,
|
|
11903
|
+
className: [String, Function],
|
|
11904
|
+
size: {
|
|
11905
|
+
type: String,
|
|
11906
|
+
default: () => getConfig().list.size || getConfig().size
|
|
11907
|
+
},
|
|
11908
|
+
autoResize: {
|
|
11909
|
+
type: Boolean,
|
|
11910
|
+
default: () => getConfig().list.autoResize
|
|
11911
|
+
},
|
|
11912
|
+
syncResize: [Boolean, String, Number],
|
|
11913
|
+
virtualYConfig: Object,
|
|
11914
|
+
scrollY: Object
|
|
11915
|
+
},
|
|
11916
|
+
emits: ['scroll'],
|
|
11917
|
+
setup(props, context) {
|
|
11918
|
+
const {
|
|
11919
|
+
slots,
|
|
11920
|
+
emit
|
|
11921
|
+
} = context;
|
|
11922
|
+
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
11923
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
11924
|
+
const {
|
|
11925
|
+
computeSize
|
|
11926
|
+
} = useSize(props);
|
|
11927
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(list_createReactData());
|
|
11928
|
+
const internalData = list_createInternalData();
|
|
11929
|
+
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
11930
|
+
const refVirtualWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
11931
|
+
const refVirtualBody = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
11932
|
+
const refMaps = {
|
|
11933
|
+
refElem
|
|
11934
|
+
};
|
|
11935
|
+
const $xeList = {
|
|
11936
|
+
xID,
|
|
11937
|
+
props,
|
|
11938
|
+
context,
|
|
11939
|
+
reactData,
|
|
11940
|
+
internalData,
|
|
11941
|
+
getRefMaps: () => refMaps
|
|
11942
|
+
};
|
|
11943
|
+
const computeSYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11944
|
+
return Object.assign({}, getConfig().list.virtualYConfig || getConfig().list.scrollY, props.virtualYConfig || props.scrollY);
|
|
11945
|
+
});
|
|
11946
|
+
const computeStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11947
|
+
const {
|
|
11948
|
+
height,
|
|
11949
|
+
maxHeight
|
|
11950
|
+
} = props;
|
|
11951
|
+
const {
|
|
11952
|
+
customHeight,
|
|
11953
|
+
customMaxHeight
|
|
11954
|
+
} = reactData;
|
|
11955
|
+
const style = {};
|
|
11956
|
+
if (height) {
|
|
11957
|
+
style.height = `${customHeight}px`;
|
|
11958
|
+
} else if (maxHeight) {
|
|
11959
|
+
style.height = 'auto';
|
|
11960
|
+
style.maxHeight = `${customMaxHeight}px`;
|
|
11961
|
+
}
|
|
11962
|
+
return style;
|
|
11963
|
+
});
|
|
11964
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
11965
|
+
emit(type, createEvent(evnt, {
|
|
11966
|
+
$list: $xeList
|
|
11967
|
+
}, params));
|
|
11968
|
+
};
|
|
11969
|
+
const calcTableHeight = key => {
|
|
11970
|
+
const {
|
|
11971
|
+
parentHeight
|
|
11972
|
+
} = reactData;
|
|
11973
|
+
const val = props[key];
|
|
11974
|
+
let num = 0;
|
|
11975
|
+
if (val) {
|
|
11976
|
+
if (val === '100%' || val === 'auto') {
|
|
11977
|
+
num = parentHeight;
|
|
11978
|
+
} else {
|
|
11979
|
+
if (isScale(val)) {
|
|
11980
|
+
num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(val) || 1) / 100 * parentHeight);
|
|
11981
|
+
} else {
|
|
11982
|
+
num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val);
|
|
11983
|
+
}
|
|
11984
|
+
num = Math.max(40, num);
|
|
11985
|
+
}
|
|
11986
|
+
}
|
|
11987
|
+
return num;
|
|
11988
|
+
};
|
|
11989
|
+
const updateHeight = () => {
|
|
11990
|
+
reactData.customHeight = calcTableHeight('height');
|
|
11991
|
+
reactData.customMaxHeight = calcTableHeight('maxHeight');
|
|
11992
|
+
};
|
|
11993
|
+
const updateYSpace = () => {
|
|
11994
|
+
const {
|
|
11995
|
+
scrollYLoad
|
|
11996
|
+
} = reactData;
|
|
11997
|
+
const {
|
|
11998
|
+
scrollYStore,
|
|
11999
|
+
fullData
|
|
12000
|
+
} = internalData;
|
|
12001
|
+
reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
|
|
12002
|
+
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
|
|
12003
|
+
};
|
|
12004
|
+
const handleData = () => {
|
|
12005
|
+
const {
|
|
12006
|
+
scrollYLoad
|
|
12007
|
+
} = reactData;
|
|
12008
|
+
const {
|
|
12009
|
+
fullData,
|
|
12010
|
+
scrollYStore
|
|
12011
|
+
} = internalData;
|
|
12012
|
+
reactData.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
|
|
12013
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12014
|
+
};
|
|
12015
|
+
const updateYData = () => {
|
|
12016
|
+
handleData();
|
|
12017
|
+
updateYSpace();
|
|
12018
|
+
};
|
|
12019
|
+
const computeScrollLoad = () => {
|
|
12020
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
12021
|
+
const {
|
|
12022
|
+
scrollYLoad
|
|
12023
|
+
} = reactData;
|
|
12024
|
+
const {
|
|
12025
|
+
scrollYStore
|
|
12026
|
+
} = internalData;
|
|
12027
|
+
const virtualBodyElem = refVirtualBody.value;
|
|
12028
|
+
const sYOpts = computeSYOpts.value;
|
|
12029
|
+
let rowHeight = 0;
|
|
12030
|
+
let firstItemElem;
|
|
12031
|
+
if (virtualBodyElem) {
|
|
12032
|
+
if (sYOpts.sItem) {
|
|
12033
|
+
firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem);
|
|
12034
|
+
}
|
|
12035
|
+
if (!firstItemElem) {
|
|
12036
|
+
firstItemElem = virtualBodyElem.children[0];
|
|
12037
|
+
}
|
|
12038
|
+
}
|
|
12039
|
+
if (firstItemElem) {
|
|
12040
|
+
rowHeight = firstItemElem.offsetHeight;
|
|
12041
|
+
}
|
|
12042
|
+
rowHeight = Math.max(12, rowHeight);
|
|
12043
|
+
scrollYStore.rowHeight = rowHeight;
|
|
12044
|
+
// 计算 Y 逻辑
|
|
12045
|
+
if (scrollYLoad) {
|
|
12046
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
12047
|
+
const visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight));
|
|
12048
|
+
const offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sYOpts.oSize) : browseObj.edge ? 10 : 0;
|
|
12049
|
+
scrollYStore.offsetSize = offsetYSize;
|
|
12050
|
+
scrollYStore.visibleSize = visibleYSize;
|
|
12051
|
+
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
12052
|
+
updateYData();
|
|
12053
|
+
} else {
|
|
12054
|
+
updateYSpace();
|
|
12055
|
+
}
|
|
12056
|
+
});
|
|
12057
|
+
};
|
|
12058
|
+
/**
|
|
12059
|
+
* 清除滚动条
|
|
12060
|
+
*/
|
|
12061
|
+
const clearScroll = () => {
|
|
12062
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
12063
|
+
if (scrollBodyElem) {
|
|
12064
|
+
scrollBodyElem.scrollTop = 0;
|
|
12065
|
+
}
|
|
12066
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12067
|
+
};
|
|
12068
|
+
/**
|
|
12069
|
+
* 如果有滚动条,则滚动到对应的位置
|
|
12070
|
+
*/
|
|
12071
|
+
const scrollTo = (scrollLeft, scrollTop) => {
|
|
12072
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
12073
|
+
if (scrollLeft) {
|
|
12074
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
12075
|
+
scrollTop = scrollLeft.top;
|
|
12076
|
+
scrollLeft = scrollLeft.left;
|
|
12077
|
+
}
|
|
12078
|
+
}
|
|
12079
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
12080
|
+
scrollBodyElem.scrollLeft = scrollLeft;
|
|
12081
|
+
}
|
|
12082
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
|
|
12083
|
+
scrollBodyElem.scrollTop = scrollTop;
|
|
12084
|
+
}
|
|
12085
|
+
if (reactData.scrollYLoad) {
|
|
12086
|
+
return new Promise(resolve => {
|
|
12087
|
+
setTimeout(() => {
|
|
12088
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
12089
|
+
resolve();
|
|
12090
|
+
});
|
|
12091
|
+
}, 50);
|
|
12092
|
+
});
|
|
12093
|
+
}
|
|
12094
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12095
|
+
};
|
|
12096
|
+
/**
|
|
12097
|
+
* 刷新滚动条
|
|
12098
|
+
*/
|
|
12099
|
+
const refreshScroll = () => {
|
|
12100
|
+
const {
|
|
12101
|
+
lastScrollLeft,
|
|
12102
|
+
lastScrollTop
|
|
12103
|
+
} = internalData;
|
|
12104
|
+
return clearScroll().then(() => {
|
|
12105
|
+
if (lastScrollLeft || lastScrollTop) {
|
|
12106
|
+
internalData.lastScrollLeft = 0;
|
|
12107
|
+
internalData.lastScrollTop = 0;
|
|
12108
|
+
return scrollTo(lastScrollLeft, lastScrollTop);
|
|
12109
|
+
}
|
|
12110
|
+
});
|
|
12111
|
+
};
|
|
12112
|
+
/**
|
|
12113
|
+
* 重新计算列表
|
|
12114
|
+
*/
|
|
12115
|
+
const recalculate = () => {
|
|
12116
|
+
const el = refElem.value;
|
|
12117
|
+
if (el) {
|
|
12118
|
+
const parentEl = el.parentElement;
|
|
12119
|
+
reactData.parentHeight = parentEl ? parentEl.clientHeight : 0;
|
|
12120
|
+
updateHeight();
|
|
12121
|
+
if (el.clientWidth && el.clientHeight) {
|
|
12122
|
+
return computeScrollLoad();
|
|
12123
|
+
}
|
|
12124
|
+
}
|
|
12125
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12126
|
+
};
|
|
12127
|
+
const loadYData = evnt => {
|
|
12128
|
+
const {
|
|
12129
|
+
scrollYStore
|
|
12130
|
+
} = internalData;
|
|
12131
|
+
const {
|
|
12132
|
+
startIndex,
|
|
12133
|
+
endIndex,
|
|
12134
|
+
visibleSize,
|
|
12135
|
+
offsetSize,
|
|
12136
|
+
rowHeight
|
|
12137
|
+
} = scrollYStore;
|
|
12138
|
+
const scrollBodyElem = evnt.target;
|
|
12139
|
+
const scrollTop = scrollBodyElem.scrollTop;
|
|
12140
|
+
const toVisibleIndex = Math.floor(scrollTop / rowHeight);
|
|
12141
|
+
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
|
|
12142
|
+
const offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
|
|
12143
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
12144
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
12145
|
+
scrollYStore.startIndex = offsetStartIndex;
|
|
12146
|
+
scrollYStore.endIndex = offsetEndIndex;
|
|
12147
|
+
updateYData();
|
|
12148
|
+
}
|
|
12149
|
+
}
|
|
12150
|
+
};
|
|
12151
|
+
const scrollEvent = evnt => {
|
|
12152
|
+
const scrollBodyElem = evnt.target;
|
|
12153
|
+
const scrollTop = scrollBodyElem.scrollTop;
|
|
12154
|
+
const scrollLeft = scrollBodyElem.scrollLeft;
|
|
12155
|
+
const isX = scrollLeft !== internalData.lastScrollLeft;
|
|
12156
|
+
const isY = scrollTop !== internalData.lastScrollTop;
|
|
12157
|
+
internalData.lastScrollTop = scrollTop;
|
|
12158
|
+
internalData.lastScrollLeft = scrollLeft;
|
|
12159
|
+
if (reactData.scrollYLoad) {
|
|
12160
|
+
loadYData(evnt);
|
|
12161
|
+
}
|
|
12162
|
+
dispatchEvent('scroll', {
|
|
12163
|
+
scrollLeft,
|
|
12164
|
+
scrollTop,
|
|
12165
|
+
isX,
|
|
12166
|
+
isY
|
|
12167
|
+
}, evnt);
|
|
12168
|
+
};
|
|
12169
|
+
/**
|
|
12170
|
+
* 加载数据
|
|
12171
|
+
* @param {Array} datas 数据
|
|
12172
|
+
*/
|
|
12173
|
+
const loadData = datas => {
|
|
12174
|
+
const {
|
|
12175
|
+
scrollYStore
|
|
12176
|
+
} = internalData;
|
|
12177
|
+
const sYOpts = computeSYOpts.value;
|
|
12178
|
+
const fullData = datas || [];
|
|
12179
|
+
Object.assign(scrollYStore, {
|
|
12180
|
+
startIndex: 0,
|
|
12181
|
+
endIndex: 1,
|
|
12182
|
+
visibleSize: 0
|
|
12183
|
+
});
|
|
12184
|
+
internalData.fullData = fullData;
|
|
12185
|
+
// 如果gt为0,则总是启用
|
|
12186
|
+
reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length);
|
|
12187
|
+
handleData();
|
|
12188
|
+
return computeScrollLoad().then(() => {
|
|
12189
|
+
refreshScroll();
|
|
12190
|
+
});
|
|
12191
|
+
};
|
|
12192
|
+
const listMethods = {
|
|
12193
|
+
dispatchEvent,
|
|
12194
|
+
loadData,
|
|
12195
|
+
/**
|
|
12196
|
+
* 重新加载数据
|
|
12197
|
+
* @param {Array} datas 数据
|
|
12198
|
+
*/
|
|
12199
|
+
reloadData(datas) {
|
|
12200
|
+
clearScroll();
|
|
12201
|
+
return loadData(datas);
|
|
12202
|
+
},
|
|
12203
|
+
recalculate,
|
|
12204
|
+
scrollTo,
|
|
12205
|
+
refreshScroll,
|
|
12206
|
+
clearScroll
|
|
12207
|
+
};
|
|
12208
|
+
Object.assign($xeList, listMethods);
|
|
12209
|
+
const renderVN = () => {
|
|
12210
|
+
const {
|
|
12211
|
+
className,
|
|
12212
|
+
loading
|
|
12213
|
+
} = props;
|
|
12214
|
+
const {
|
|
12215
|
+
bodyHeight,
|
|
12216
|
+
topSpaceHeight,
|
|
12217
|
+
items
|
|
12218
|
+
} = reactData;
|
|
12219
|
+
const defaultSlot = slots.default;
|
|
12220
|
+
const vSize = computeSize.value;
|
|
12221
|
+
const styles = computeStyles.value;
|
|
12222
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
12223
|
+
ref: refElem,
|
|
12224
|
+
class: ['vxe-list', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
12225
|
+
$list: $xeList
|
|
12226
|
+
}) : className : '', {
|
|
12227
|
+
[`size--${vSize}`]: vSize,
|
|
12228
|
+
'is--loading': loading
|
|
12229
|
+
}]
|
|
12230
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
12231
|
+
ref: refVirtualWrapper,
|
|
12232
|
+
class: 'vxe-list--virtual-wrapper',
|
|
12233
|
+
style: styles,
|
|
12234
|
+
onScroll: scrollEvent
|
|
12235
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
12236
|
+
class: 'vxe-list--y-space',
|
|
12237
|
+
style: {
|
|
12238
|
+
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
12239
|
+
}
|
|
12240
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
12241
|
+
ref: refVirtualBody,
|
|
12242
|
+
class: 'vxe-list--body',
|
|
12243
|
+
style: {
|
|
12244
|
+
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
12245
|
+
}
|
|
12246
|
+
}, defaultSlot ? defaultSlot({
|
|
12247
|
+
items,
|
|
12248
|
+
$list: $xeList
|
|
12249
|
+
}) : [])]),
|
|
12250
|
+
/**
|
|
12251
|
+
* 加载中
|
|
12252
|
+
*/
|
|
12253
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_loading, {
|
|
12254
|
+
class: 'vxe-list--loading',
|
|
12255
|
+
modelValue: loading
|
|
12256
|
+
})]);
|
|
12257
|
+
};
|
|
12258
|
+
const dataFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
12259
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.data ? props.data.length : -1, () => {
|
|
12260
|
+
dataFlag.value++;
|
|
12261
|
+
});
|
|
12262
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.data, () => {
|
|
12263
|
+
dataFlag.value++;
|
|
12264
|
+
});
|
|
12265
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag, () => {
|
|
12266
|
+
loadData(props.data || []);
|
|
12267
|
+
});
|
|
12268
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.height, () => {
|
|
12269
|
+
recalculate();
|
|
12270
|
+
});
|
|
12271
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.maxHeight, () => {
|
|
12272
|
+
recalculate();
|
|
12273
|
+
});
|
|
12274
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
|
|
12275
|
+
if (value) {
|
|
12276
|
+
recalculate();
|
|
12277
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => setTimeout(() => recalculate()));
|
|
12278
|
+
}
|
|
12279
|
+
});
|
|
12280
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(() => {
|
|
12281
|
+
recalculate().then(() => refreshScroll());
|
|
12282
|
+
});
|
|
12283
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
12284
|
+
loadData(props.data || []);
|
|
12285
|
+
});
|
|
12286
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
12287
|
+
recalculate();
|
|
12288
|
+
if (props.autoResize) {
|
|
12289
|
+
const el = refElem.value;
|
|
12290
|
+
const resizeObserver = globalResize.create(() => recalculate());
|
|
12291
|
+
resizeObserver.observe(el);
|
|
12292
|
+
if (el) {
|
|
12293
|
+
resizeObserver.observe(el.parentElement);
|
|
12294
|
+
}
|
|
12295
|
+
internalData.resizeObserver = resizeObserver;
|
|
12296
|
+
}
|
|
12297
|
+
globalEvents.on($xeList, 'resize', recalculate);
|
|
12298
|
+
});
|
|
12299
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
12300
|
+
const {
|
|
12301
|
+
resizeObserver
|
|
12302
|
+
} = internalData;
|
|
12303
|
+
if (resizeObserver) {
|
|
12304
|
+
resizeObserver.disconnect();
|
|
12305
|
+
}
|
|
12306
|
+
globalEvents.off($xeList, 'resize');
|
|
12307
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, list_createReactData());
|
|
12308
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, list_createInternalData());
|
|
12309
|
+
});
|
|
12310
|
+
$xeList.renderVN = renderVN;
|
|
12311
|
+
return $xeList;
|
|
12312
|
+
},
|
|
12313
|
+
render() {
|
|
12314
|
+
return this.renderVN();
|
|
11890
12315
|
}
|
|
11891
|
-
|
|
11892
|
-
}
|
|
12316
|
+
}));
|
|
11893
12317
|
;// ./packages/number-input/src/util.ts
|
|
11894
12318
|
|
|
11895
12319
|
function handleNumber(val) {
|
|
11896
12320
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val) ? val.replace(/[^0-9e.-]/g, '') : val;
|
|
11897
12321
|
}
|
|
11898
|
-
function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
|
|
11899
|
-
if (!roundingMode || roundingMode === 'default') {
|
|
12322
|
+
function toFloatValueFixed(inputValue, type, digitsValue, roundingMode) {
|
|
12323
|
+
if (type !== 'integer' && (!roundingMode || roundingMode === 'default')) {
|
|
11900
12324
|
// 默认截取忽略
|
|
11901
12325
|
if (/^-/.test('' + inputValue)) {
|
|
11902
12326
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().ceil(inputValue, digitsValue), digitsValue);
|
|
@@ -12730,7 +13154,7 @@ function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
|
|
|
12730
13154
|
} = props;
|
|
12731
13155
|
const inpMaxLength = computeInpMaxLength.value;
|
|
12732
13156
|
const digitsValue = computeDigitsValue.value;
|
|
12733
|
-
const restVal = type === 'float' ? toFloatValueFixed(val, digitsValue, '') : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val);
|
|
13157
|
+
const restVal = type === 'float' ? toFloatValueFixed(val, type, digitsValue, '') : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val);
|
|
12734
13158
|
if (exponential && (val === restVal || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(val).toLowerCase() === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(restVal).toExponential())) {
|
|
12735
13159
|
return val;
|
|
12736
13160
|
}
|
|
@@ -12955,7 +13379,7 @@ function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
|
|
|
12955
13379
|
changeValue();
|
|
12956
13380
|
} else if (type === 'float') {
|
|
12957
13381
|
if (inputValue) {
|
|
12958
|
-
const validValue = toFloatValueFixed(inputValue, digitsValue, '');
|
|
13382
|
+
const validValue = toFloatValueFixed(inputValue, type, digitsValue, '');
|
|
12959
13383
|
if (inputValue !== validValue) {
|
|
12960
13384
|
handleChange(validValue, {
|
|
12961
13385
|
type: 'init'
|
|
@@ -14741,14 +15165,51 @@ function toFloatValueFixed(inputValue, digitsValue, roundingMode) {
|
|
|
14741
15165
|
|
|
14742
15166
|
|
|
14743
15167
|
|
|
14744
|
-
|
|
15168
|
+
|
|
15169
|
+
|
|
15170
|
+
|
|
15171
|
+
/**
|
|
15172
|
+
* 生成节点的唯一主键
|
|
15173
|
+
*/
|
|
15174
|
+
function getNodeUniqueId() {
|
|
14745
15175
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('node_');
|
|
14746
15176
|
}
|
|
15177
|
+
function cascader_createReactData() {
|
|
15178
|
+
return {
|
|
15179
|
+
initialized: false,
|
|
15180
|
+
searchValue: '',
|
|
15181
|
+
searchLoading: false,
|
|
15182
|
+
currentCunkList: [],
|
|
15183
|
+
currentItems: [],
|
|
15184
|
+
currentNode: null,
|
|
15185
|
+
panelIndex: 0,
|
|
15186
|
+
panelStyle: {},
|
|
15187
|
+
panelPlacement: null,
|
|
15188
|
+
triggerFocusPanel: false,
|
|
15189
|
+
visiblePanel: false,
|
|
15190
|
+
isAniVisible: false,
|
|
15191
|
+
isActivated: false,
|
|
15192
|
+
selectRadioKey: null,
|
|
15193
|
+
treeList: [],
|
|
15194
|
+
updateExpandedFlag: 1,
|
|
15195
|
+
updateCheckboxFlag: 1,
|
|
15196
|
+
fullOptFlag: 1,
|
|
15197
|
+
lazyOptFlag: 1
|
|
15198
|
+
};
|
|
15199
|
+
}
|
|
14747
15200
|
function cascader_createInternalData() {
|
|
14748
15201
|
return {
|
|
14749
15202
|
// hpTimeout: undefined,
|
|
14750
|
-
|
|
14751
|
-
|
|
15203
|
+
afterTreeList: [],
|
|
15204
|
+
treeFullData: [],
|
|
15205
|
+
afterVisibleList: [],
|
|
15206
|
+
nodeMaps: {},
|
|
15207
|
+
fullNodeMaps: {},
|
|
15208
|
+
lazyNodeMaps: {},
|
|
15209
|
+
indeterminateRowMaps: {},
|
|
15210
|
+
selectCheckboxMaps: {},
|
|
15211
|
+
treeExpandedMaps: {},
|
|
15212
|
+
treeExpandLazyLoadedMaps: {}
|
|
14752
15213
|
};
|
|
14753
15214
|
}
|
|
14754
15215
|
/* harmony default export */ var cascader = (defineVxeComponent({
|
|
@@ -14771,25 +15232,41 @@ function cascader_createInternalData() {
|
|
|
14771
15232
|
},
|
|
14772
15233
|
filterable: Boolean,
|
|
14773
15234
|
filterConfig: Object,
|
|
15235
|
+
showFullLabel: {
|
|
15236
|
+
type: Boolean,
|
|
15237
|
+
default: getConfig().cascader.showFullLabel
|
|
15238
|
+
},
|
|
15239
|
+
separator: {
|
|
15240
|
+
type: String,
|
|
15241
|
+
default: getConfig().cascader.separator
|
|
15242
|
+
},
|
|
14774
15243
|
multiple: Boolean,
|
|
14775
15244
|
className: [String, Function],
|
|
14776
15245
|
prefixIcon: String,
|
|
14777
|
-
placement: String,
|
|
14778
|
-
transform: Boolean,
|
|
14779
15246
|
lazyOptions: Array,
|
|
14780
15247
|
options: Array,
|
|
14781
15248
|
optionProps: Object,
|
|
14782
|
-
zIndex: Number,
|
|
14783
15249
|
size: {
|
|
14784
15250
|
type: String,
|
|
14785
15251
|
default: () => getConfig().cascader.size || getConfig().size
|
|
14786
15252
|
},
|
|
15253
|
+
treeConfig: Object,
|
|
15254
|
+
radioConfig: Object,
|
|
15255
|
+
checkboxConfig: Object,
|
|
14787
15256
|
remote: Boolean,
|
|
14788
15257
|
remoteConfig: Function,
|
|
14789
15258
|
popupConfig: Object,
|
|
14790
|
-
|
|
15259
|
+
checkedClosable: {
|
|
14791
15260
|
type: Boolean,
|
|
14792
|
-
default: () => getConfig().cascader.
|
|
15261
|
+
default: () => getConfig().cascader.checkedClosable
|
|
15262
|
+
},
|
|
15263
|
+
clearClosable: {
|
|
15264
|
+
type: Boolean,
|
|
15265
|
+
default: () => getConfig().cascader.clearClosable
|
|
15266
|
+
},
|
|
15267
|
+
showCloseButton: {
|
|
15268
|
+
type: Boolean,
|
|
15269
|
+
default: () => getConfig().cascader.showCloseButton
|
|
14793
15270
|
},
|
|
14794
15271
|
showTotalButton: {
|
|
14795
15272
|
type: Boolean,
|
|
@@ -14802,18 +15279,9 @@ function cascader_createInternalData() {
|
|
|
14802
15279
|
showClearButton: {
|
|
14803
15280
|
type: Boolean,
|
|
14804
15281
|
default: () => getConfig().cascader.showClearButton
|
|
14805
|
-
}
|
|
14806
|
-
transfer: {
|
|
14807
|
-
type: Boolean,
|
|
14808
|
-
default: null
|
|
14809
|
-
},
|
|
14810
|
-
/**
|
|
14811
|
-
* 已废弃,被 remote-config.queryMethod 替换
|
|
14812
|
-
* @deprecated
|
|
14813
|
-
*/
|
|
14814
|
-
remoteMethod: Function
|
|
15282
|
+
}
|
|
14815
15283
|
},
|
|
14816
|
-
emits: ['update:modelValue', 'change', 'all-change', 'clear', 'blur', 'focus', 'click', 'node-click'],
|
|
15284
|
+
emits: ['update:modelValue', 'change', 'all-change', 'clear', 'blur', 'focus', 'click', 'node-click', 'node-expand', 'current-change', 'radio-change', 'checkbox-change', 'load-success', 'load-error', 'visible-change'],
|
|
14817
15285
|
setup(props, context) {
|
|
14818
15286
|
const {
|
|
14819
15287
|
emit,
|
|
@@ -14831,21 +15299,9 @@ function cascader_createInternalData() {
|
|
|
14831
15299
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14832
15300
|
const refInput = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14833
15301
|
const refInpSearch = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14834
|
-
const
|
|
15302
|
+
const refChunkWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14835
15303
|
const refOptionPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14836
|
-
const
|
|
14837
|
-
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
14838
|
-
initialized: false,
|
|
14839
|
-
searchValue: '',
|
|
14840
|
-
searchLoading: false,
|
|
14841
|
-
panelIndex: 0,
|
|
14842
|
-
panelStyle: {},
|
|
14843
|
-
panelPlacement: null,
|
|
14844
|
-
triggerFocusPanel: false,
|
|
14845
|
-
visiblePanel: false,
|
|
14846
|
-
isAniVisible: false,
|
|
14847
|
-
isActivated: false
|
|
14848
|
-
});
|
|
15304
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(cascader_createReactData());
|
|
14849
15305
|
const internalData = cascader_createInternalData();
|
|
14850
15306
|
const refMaps = {
|
|
14851
15307
|
refElem
|
|
@@ -14875,19 +15331,26 @@ function cascader_createInternalData() {
|
|
|
14875
15331
|
return disabled;
|
|
14876
15332
|
});
|
|
14877
15333
|
const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15334
|
+
const popupOpts = computePopupOpts.value;
|
|
14878
15335
|
const {
|
|
14879
15336
|
transfer
|
|
14880
|
-
} =
|
|
14881
|
-
if (transfer
|
|
14882
|
-
|
|
14883
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
14884
|
-
return globalTransfer;
|
|
14885
|
-
}
|
|
14886
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
14887
|
-
return true;
|
|
14888
|
-
}
|
|
15337
|
+
} = popupOpts;
|
|
15338
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(transfer)) {
|
|
15339
|
+
return transfer;
|
|
14889
15340
|
}
|
|
14890
|
-
|
|
15341
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
15342
|
+
return true;
|
|
15343
|
+
}
|
|
15344
|
+
return false;
|
|
15345
|
+
});
|
|
15346
|
+
const computeTreeOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15347
|
+
return Object.assign({}, getConfig().cascader.treeConfig, props.treeConfig);
|
|
15348
|
+
});
|
|
15349
|
+
const computeRadioOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15350
|
+
return Object.assign({}, getConfig().cascader.radioConfig, props.radioConfig);
|
|
15351
|
+
});
|
|
15352
|
+
const computeCheckboxOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15353
|
+
return Object.assign({}, getConfig().cascader.checkboxConfig, props.checkboxConfig);
|
|
14891
15354
|
});
|
|
14892
15355
|
const computePopupOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14893
15356
|
return Object.assign({}, getConfig().cascader.popupConfig, props.popupConfig);
|
|
@@ -14895,10 +15358,6 @@ function cascader_createInternalData() {
|
|
|
14895
15358
|
const computePropsOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14896
15359
|
return props.optionProps || {};
|
|
14897
15360
|
});
|
|
14898
|
-
const computeNodeKeyField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14899
|
-
const valueField = computeValueField.value;
|
|
14900
|
-
return valueField;
|
|
14901
|
-
});
|
|
14902
15361
|
const computeLabelField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14903
15362
|
const propsOpts = computePropsOpts.value;
|
|
14904
15363
|
return propsOpts.label || 'label';
|
|
@@ -14907,54 +15366,92 @@ function cascader_createInternalData() {
|
|
|
14907
15366
|
const propsOpts = computePropsOpts.value;
|
|
14908
15367
|
return propsOpts.value || 'value';
|
|
14909
15368
|
});
|
|
15369
|
+
const computeKeyField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15370
|
+
const treeOpts = computeTreeOpts.value;
|
|
15371
|
+
return treeOpts.keyField || 'id';
|
|
15372
|
+
});
|
|
15373
|
+
const computeParentField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15374
|
+
const treeOpts = computeTreeOpts.value;
|
|
15375
|
+
return treeOpts.parentField || 'parentId';
|
|
15376
|
+
});
|
|
14910
15377
|
const computeChildrenField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14911
|
-
const
|
|
14912
|
-
return
|
|
15378
|
+
const treeOpts = computeTreeOpts.value;
|
|
15379
|
+
return treeOpts.childrenField || 'children';
|
|
15380
|
+
});
|
|
15381
|
+
const computeMapChildrenField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15382
|
+
const treeOpts = computeTreeOpts.value;
|
|
15383
|
+
return treeOpts.mapChildrenField || 'mapChildren';
|
|
15384
|
+
});
|
|
15385
|
+
const computeHasChildField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15386
|
+
const treeOpts = computeTreeOpts.value;
|
|
15387
|
+
return treeOpts.hasChildField || 'hasChild';
|
|
14913
15388
|
});
|
|
14914
15389
|
const computeRemoteOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14915
15390
|
return Object.assign({}, getConfig().cascader.remoteConfig, props.remoteConfig);
|
|
14916
15391
|
});
|
|
15392
|
+
const computeSelectVals = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15393
|
+
const {
|
|
15394
|
+
modelValue
|
|
15395
|
+
} = props;
|
|
15396
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
15397
|
+
});
|
|
14917
15398
|
const computeSelectLabel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14918
15399
|
const {
|
|
14919
|
-
|
|
14920
|
-
lazyOptions
|
|
15400
|
+
showFullLabel
|
|
14921
15401
|
} = props;
|
|
14922
15402
|
const {
|
|
14923
|
-
|
|
15403
|
+
fullOptFlag,
|
|
15404
|
+
lazyOptFlag
|
|
15405
|
+
} = reactData;
|
|
15406
|
+
const {
|
|
15407
|
+
fullNodeMaps,
|
|
15408
|
+
lazyNodeMaps
|
|
14924
15409
|
} = internalData;
|
|
14925
|
-
const valueField = computeValueField.value;
|
|
14926
15410
|
const labelField = computeLabelField.value;
|
|
14927
|
-
const selectVals =
|
|
15411
|
+
const selectVals = computeSelectVals.value;
|
|
14928
15412
|
return selectVals.map(val => {
|
|
14929
15413
|
const cacheItem = fullNodeMaps[val];
|
|
14930
|
-
if (cacheItem) {
|
|
14931
|
-
return cacheItem.item[labelField];
|
|
15414
|
+
if (fullOptFlag && cacheItem) {
|
|
15415
|
+
return showFullLabel ? cacheItem.fullLabel : cacheItem.item[labelField];
|
|
14932
15416
|
}
|
|
14933
|
-
if (
|
|
14934
|
-
const
|
|
14935
|
-
if (
|
|
14936
|
-
return
|
|
15417
|
+
if (lazyOptFlag) {
|
|
15418
|
+
const lazyCacheItem = lazyNodeMaps[val];
|
|
15419
|
+
if (lazyCacheItem) {
|
|
15420
|
+
return showFullLabel ? lazyCacheItem.fullLabel : lazyCacheItem.item[labelField];
|
|
14937
15421
|
}
|
|
14938
15422
|
}
|
|
14939
15423
|
return val;
|
|
14940
15424
|
}).join(', ');
|
|
14941
15425
|
});
|
|
14942
15426
|
const computePopupWrapperStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15427
|
+
const {
|
|
15428
|
+
currentCunkList,
|
|
15429
|
+
panelStyle
|
|
15430
|
+
} = reactData;
|
|
14943
15431
|
const popupOpts = computePopupOpts.value;
|
|
14944
15432
|
const {
|
|
14945
15433
|
height,
|
|
14946
|
-
|
|
15434
|
+
nodeWidth,
|
|
15435
|
+
nodeHeight
|
|
14947
15436
|
} = popupOpts;
|
|
14948
|
-
const stys = {
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
}
|
|
15437
|
+
const stys = {
|
|
15438
|
+
...panelStyle,
|
|
15439
|
+
'--vxe-ui-cascader-chunk-size': currentCunkList.length
|
|
15440
|
+
};
|
|
14952
15441
|
if (height) {
|
|
14953
|
-
stys
|
|
14954
|
-
|
|
15442
|
+
stys['--vxe-ui-cascader-chunk-height'] = toCssUnit(height);
|
|
15443
|
+
}
|
|
15444
|
+
if (nodeWidth) {
|
|
15445
|
+
stys['--vxe-ui-cascader-node-width'] = toCssUnit(nodeWidth);
|
|
15446
|
+
}
|
|
15447
|
+
if (nodeHeight) {
|
|
15448
|
+
stys['--vxe-ui-cascader-node-height'] = toCssUnit(nodeHeight);
|
|
14955
15449
|
}
|
|
14956
15450
|
return stys;
|
|
14957
15451
|
});
|
|
15452
|
+
const computeFilterOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15453
|
+
return Object.assign({}, getConfig().cascader.filterConfig, props.filterConfig);
|
|
15454
|
+
});
|
|
14958
15455
|
const computeMaps = {};
|
|
14959
15456
|
const $xeCascader = {
|
|
14960
15457
|
xID,
|
|
@@ -14976,60 +15473,388 @@ function cascader_createInternalData() {
|
|
|
14976
15473
|
const cascaderMethods = {
|
|
14977
15474
|
dispatchEvent
|
|
14978
15475
|
};
|
|
14979
|
-
const
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
15476
|
+
const getNodeId = node => {
|
|
15477
|
+
if (!node) {
|
|
15478
|
+
return '';
|
|
15479
|
+
}
|
|
15480
|
+
const valueField = computeValueField.value;
|
|
15481
|
+
const nodeKey = node[valueField];
|
|
15482
|
+
return enNodeValue(nodeKey);
|
|
14983
15483
|
};
|
|
14984
|
-
const
|
|
15484
|
+
const isCheckedByCheckboxNodeId = nodeid => {
|
|
14985
15485
|
const {
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
15486
|
+
updateCheckboxFlag
|
|
15487
|
+
} = reactData;
|
|
15488
|
+
const {
|
|
15489
|
+
selectCheckboxMaps
|
|
15490
|
+
} = internalData;
|
|
15491
|
+
return !!(updateCheckboxFlag && selectCheckboxMaps[nodeid]);
|
|
15492
|
+
};
|
|
15493
|
+
const handleCheckedCheckboxNode = (nodeList, checked) => {
|
|
15494
|
+
const {
|
|
15495
|
+
selectCheckboxMaps
|
|
15496
|
+
} = internalData;
|
|
15497
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
14990
15498
|
const childrenField = computeChildrenField.value;
|
|
15499
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
15500
|
+
const {
|
|
15501
|
+
checkStrictly
|
|
15502
|
+
} = checkboxOpts;
|
|
15503
|
+
const treeOpts = computeTreeOpts.value;
|
|
15504
|
+
const {
|
|
15505
|
+
transform
|
|
15506
|
+
} = treeOpts;
|
|
15507
|
+
const handleSelect = node => {
|
|
15508
|
+
const nodeid = getNodeId(node);
|
|
15509
|
+
if (checked) {
|
|
15510
|
+
if (!selectCheckboxMaps[nodeid]) {
|
|
15511
|
+
selectCheckboxMaps[nodeid] = node;
|
|
15512
|
+
}
|
|
15513
|
+
} else {
|
|
15514
|
+
if (selectCheckboxMaps[nodeid]) {
|
|
15515
|
+
delete selectCheckboxMaps[nodeid];
|
|
15516
|
+
}
|
|
15517
|
+
}
|
|
15518
|
+
};
|
|
15519
|
+
if (checkStrictly) {
|
|
15520
|
+
nodeList.forEach(handleSelect);
|
|
15521
|
+
} else {
|
|
15522
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(nodeList, handleSelect, {
|
|
15523
|
+
children: transform ? mapChildrenField : childrenField
|
|
15524
|
+
});
|
|
15525
|
+
}
|
|
15526
|
+
reactData.updateCheckboxFlag++;
|
|
15527
|
+
updateCheckboxStatus();
|
|
15528
|
+
};
|
|
15529
|
+
const createNode = records => {
|
|
14991
15530
|
const valueField = computeValueField.value;
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
15531
|
+
return Promise.resolve(records.map(obj => {
|
|
15532
|
+
const item = {
|
|
15533
|
+
...obj
|
|
15534
|
+
};
|
|
15535
|
+
let nodeid = getNodeId(item);
|
|
14996
15536
|
if (!nodeid) {
|
|
14997
|
-
nodeid =
|
|
14998
|
-
|
|
14999
|
-
if (keyMaps[nodeid]) {
|
|
15000
|
-
errLog('vxe.error.repeatKey', [`[tree-select] ${nodeKeyField}`, nodeid]);
|
|
15537
|
+
nodeid = getNodeUniqueId();
|
|
15538
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, valueField, nodeid);
|
|
15001
15539
|
}
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15540
|
+
return item;
|
|
15541
|
+
}));
|
|
15542
|
+
};
|
|
15543
|
+
const cacheNodeMap = () => {
|
|
15544
|
+
const {
|
|
15545
|
+
separator
|
|
15546
|
+
} = props;
|
|
15547
|
+
const {
|
|
15548
|
+
treeFullData
|
|
15549
|
+
} = internalData;
|
|
15550
|
+
const valueField = computeValueField.value;
|
|
15551
|
+
const labelField = computeLabelField.value;
|
|
15552
|
+
const childrenField = computeChildrenField.value;
|
|
15553
|
+
const keyMaps = {};
|
|
15554
|
+
const fullMaps = {};
|
|
15555
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeFullData, (item, index, items, path, parenItem, nodes) => {
|
|
15556
|
+
let nodeid = getNodeId(item);
|
|
15557
|
+
if (!nodeid) {
|
|
15558
|
+
nodeid = getNodeUniqueId();
|
|
15559
|
+
item[valueField] = nodeid;
|
|
15006
15560
|
}
|
|
15007
|
-
|
|
15561
|
+
const nodeVal = item[valueField];
|
|
15562
|
+
const itemRest = {
|
|
15008
15563
|
item,
|
|
15009
15564
|
index,
|
|
15565
|
+
$index: -1,
|
|
15566
|
+
_index: -1,
|
|
15010
15567
|
items,
|
|
15011
|
-
parent,
|
|
15012
|
-
nodes
|
|
15568
|
+
parent: parenItem,
|
|
15569
|
+
nodes,
|
|
15570
|
+
level: nodes.length - 1,
|
|
15571
|
+
treeIndex: index,
|
|
15572
|
+
lineCount: 0,
|
|
15573
|
+
treeLoaded: false,
|
|
15574
|
+
fullLabel: nodes.map(item => item[labelField]).join(separator || ' / ')
|
|
15013
15575
|
};
|
|
15014
|
-
|
|
15015
|
-
|
|
15576
|
+
keyMaps[nodeid] = itemRest;
|
|
15577
|
+
fullMaps[nodeVal] = itemRest;
|
|
15578
|
+
}, {
|
|
15579
|
+
children: childrenField
|
|
15580
|
+
});
|
|
15581
|
+
internalData.nodeMaps = keyMaps;
|
|
15582
|
+
internalData.fullNodeMaps = fullMaps;
|
|
15583
|
+
reactData.fullOptFlag++;
|
|
15584
|
+
};
|
|
15585
|
+
const updateAfterDataIndex = () => {
|
|
15586
|
+
const {
|
|
15587
|
+
separator
|
|
15588
|
+
} = props;
|
|
15589
|
+
const {
|
|
15590
|
+
afterTreeList,
|
|
15591
|
+
nodeMaps
|
|
15592
|
+
} = internalData;
|
|
15593
|
+
const labelField = computeLabelField.value;
|
|
15594
|
+
const childrenField = computeChildrenField.value;
|
|
15595
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
15596
|
+
const treeOpts = computeTreeOpts.value;
|
|
15597
|
+
const {
|
|
15598
|
+
transform
|
|
15599
|
+
} = treeOpts;
|
|
15600
|
+
let vtIndex = 0;
|
|
15601
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items, path, parenItem, nodes) => {
|
|
15602
|
+
const nodeid = getNodeId(item);
|
|
15603
|
+
const nodeItem = nodeMaps[nodeid];
|
|
15604
|
+
if (nodeItem) {
|
|
15605
|
+
nodeItem.items = items;
|
|
15606
|
+
nodeItem.treeIndex = index;
|
|
15607
|
+
nodeItem._index = vtIndex;
|
|
15608
|
+
} else {
|
|
15609
|
+
const rest = {
|
|
15610
|
+
item,
|
|
15611
|
+
index,
|
|
15612
|
+
$index: -1,
|
|
15613
|
+
_index: vtIndex,
|
|
15614
|
+
items,
|
|
15615
|
+
parent: parenItem,
|
|
15616
|
+
nodes,
|
|
15617
|
+
level: nodes.length - 1,
|
|
15618
|
+
treeIndex: index,
|
|
15619
|
+
lineCount: 0,
|
|
15620
|
+
treeLoaded: false,
|
|
15621
|
+
fullLabel: nodes.map(item => item[labelField]).join(separator || ' / ')
|
|
15622
|
+
};
|
|
15623
|
+
nodeMaps[nodeid] = rest;
|
|
15624
|
+
}
|
|
15625
|
+
vtIndex++;
|
|
15626
|
+
}, {
|
|
15627
|
+
children: transform ? mapChildrenField : childrenField
|
|
15628
|
+
});
|
|
15629
|
+
};
|
|
15630
|
+
const updateAfterFullData = () => {
|
|
15631
|
+
const {
|
|
15632
|
+
searchValue
|
|
15633
|
+
} = reactData;
|
|
15634
|
+
const {
|
|
15635
|
+
treeFullData,
|
|
15636
|
+
lastFilterValue
|
|
15637
|
+
} = internalData;
|
|
15638
|
+
const labelField = computeLabelField.value;
|
|
15639
|
+
const childrenField = computeChildrenField.value;
|
|
15640
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
15641
|
+
const treeOpts = computeTreeOpts.value;
|
|
15642
|
+
const {
|
|
15643
|
+
transform
|
|
15644
|
+
} = treeOpts;
|
|
15645
|
+
const filterOpts = computeFilterOpts.value;
|
|
15646
|
+
const {
|
|
15647
|
+
beforeFilterMethod,
|
|
15648
|
+
filterMethod,
|
|
15649
|
+
afterFilterMethod
|
|
15650
|
+
} = filterOpts;
|
|
15651
|
+
let fullList = treeFullData;
|
|
15652
|
+
let treeList = fullList;
|
|
15653
|
+
let filterStr = '';
|
|
15654
|
+
if (searchValue) {
|
|
15655
|
+
filterStr = `${searchValue}`;
|
|
15656
|
+
const handleSearch = filterMethod ? item => {
|
|
15657
|
+
return filterMethod({
|
|
15658
|
+
$cascader: $xeCascader,
|
|
15659
|
+
node: item,
|
|
15660
|
+
filterValue: filterStr
|
|
15661
|
+
});
|
|
15662
|
+
} : item => {
|
|
15663
|
+
return String(item[labelField]).toLowerCase().indexOf(filterStr.toLowerCase()) > -1;
|
|
15664
|
+
};
|
|
15665
|
+
const bafParams = {
|
|
15666
|
+
$cascader: $xeCascader,
|
|
15667
|
+
filterValue: filterStr
|
|
15668
|
+
};
|
|
15669
|
+
if (beforeFilterMethod) {
|
|
15670
|
+
beforeFilterMethod(bafParams);
|
|
15671
|
+
}
|
|
15016
15672
|
if (transform) {
|
|
15017
|
-
|
|
15018
|
-
|
|
15673
|
+
treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(treeFullData, handleSearch, {
|
|
15674
|
+
original: true,
|
|
15675
|
+
isEvery: true,
|
|
15676
|
+
children: childrenField,
|
|
15677
|
+
mapChildren: mapChildrenField
|
|
15019
15678
|
});
|
|
15679
|
+
fullList = treeList;
|
|
15020
15680
|
} else {
|
|
15021
|
-
|
|
15022
|
-
|
|
15681
|
+
fullList = treeFullData.filter(handleSearch);
|
|
15682
|
+
}
|
|
15683
|
+
internalData.lastFilterValue = filterStr;
|
|
15684
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
15685
|
+
if (afterFilterMethod) {
|
|
15686
|
+
afterFilterMethod(bafParams);
|
|
15687
|
+
}
|
|
15688
|
+
});
|
|
15689
|
+
} else {
|
|
15690
|
+
if (transform) {
|
|
15691
|
+
treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(treeFullData, () => true, {
|
|
15692
|
+
original: true,
|
|
15693
|
+
isEvery: true,
|
|
15694
|
+
children: childrenField,
|
|
15695
|
+
mapChildren: mapChildrenField
|
|
15023
15696
|
});
|
|
15697
|
+
fullList = treeList;
|
|
15698
|
+
if (lastFilterValue) {
|
|
15699
|
+
const bafParams = {
|
|
15700
|
+
$cascader: $xeCascader,
|
|
15701
|
+
filterValue: filterStr
|
|
15702
|
+
};
|
|
15703
|
+
if (beforeFilterMethod) {
|
|
15704
|
+
beforeFilterMethod(bafParams);
|
|
15705
|
+
}
|
|
15706
|
+
// 取消筛选时自动收起
|
|
15707
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
15708
|
+
if (afterFilterMethod) {
|
|
15709
|
+
afterFilterMethod(bafParams);
|
|
15710
|
+
}
|
|
15711
|
+
});
|
|
15712
|
+
}
|
|
15024
15713
|
}
|
|
15714
|
+
internalData.lastFilterValue = '';
|
|
15025
15715
|
}
|
|
15026
|
-
internalData.
|
|
15027
|
-
internalData.
|
|
15716
|
+
internalData.afterVisibleList = fullList;
|
|
15717
|
+
internalData.afterTreeList = treeList;
|
|
15718
|
+
updateAfterDataIndex();
|
|
15719
|
+
};
|
|
15720
|
+
/**
|
|
15721
|
+
* 如果为虚拟树、则将树结构拍平
|
|
15722
|
+
*/
|
|
15723
|
+
const handleTreeToList = () => {
|
|
15724
|
+
const {
|
|
15725
|
+
afterTreeList,
|
|
15726
|
+
treeExpandedMaps
|
|
15727
|
+
} = internalData;
|
|
15728
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
15729
|
+
const treeOpts = computeTreeOpts.value;
|
|
15730
|
+
const {
|
|
15731
|
+
transform
|
|
15732
|
+
} = treeOpts;
|
|
15733
|
+
const expandMaps = {};
|
|
15734
|
+
if (transform) {
|
|
15735
|
+
const fullData = [];
|
|
15736
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items, path, parentRow) => {
|
|
15737
|
+
const nodeid = getNodeId(item);
|
|
15738
|
+
const parentNodeid = getNodeId(parentRow);
|
|
15739
|
+
if (!parentRow || expandMaps[parentNodeid] && treeExpandedMaps[parentNodeid]) {
|
|
15740
|
+
expandMaps[nodeid] = 1;
|
|
15741
|
+
fullData.push(item);
|
|
15742
|
+
}
|
|
15743
|
+
}, {
|
|
15744
|
+
children: mapChildrenField
|
|
15745
|
+
});
|
|
15746
|
+
internalData.afterVisibleList = fullData;
|
|
15747
|
+
return fullData;
|
|
15748
|
+
}
|
|
15749
|
+
return internalData.afterVisibleList;
|
|
15750
|
+
};
|
|
15751
|
+
const handleData = force => {
|
|
15752
|
+
const {
|
|
15753
|
+
nodeMaps
|
|
15754
|
+
} = internalData;
|
|
15755
|
+
let fullList = internalData.afterVisibleList;
|
|
15756
|
+
if (force) {
|
|
15757
|
+
// 更新数据,处理筛选和排序
|
|
15758
|
+
updateAfterFullData();
|
|
15759
|
+
// 如果为虚拟树,将树结构拍平
|
|
15760
|
+
fullList = handleTreeToList();
|
|
15761
|
+
}
|
|
15762
|
+
const treeList = fullList.slice(0);
|
|
15763
|
+
treeList.forEach((item, $index) => {
|
|
15764
|
+
const nodeid = getNodeId(item);
|
|
15765
|
+
const itemRest = nodeMaps[nodeid];
|
|
15766
|
+
if (itemRest) {
|
|
15767
|
+
itemRest.$index = $index;
|
|
15768
|
+
}
|
|
15769
|
+
});
|
|
15770
|
+
reactData.treeList = treeList;
|
|
15771
|
+
};
|
|
15772
|
+
const triggerSearchEvent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => handleData(true), 350, {
|
|
15773
|
+
trailing: true
|
|
15774
|
+
});
|
|
15775
|
+
const loadData = list => {
|
|
15776
|
+
const treeOpts = computeTreeOpts.value;
|
|
15777
|
+
const keyField = computeKeyField.value;
|
|
15778
|
+
const parentField = computeParentField.value;
|
|
15779
|
+
const childrenField = computeChildrenField.value;
|
|
15780
|
+
const {
|
|
15781
|
+
rootParentValue,
|
|
15782
|
+
rootValues
|
|
15783
|
+
} = treeOpts;
|
|
15784
|
+
const {
|
|
15785
|
+
transform
|
|
15786
|
+
} = treeOpts;
|
|
15787
|
+
const fullData = transform ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(list, {
|
|
15788
|
+
key: keyField,
|
|
15789
|
+
parentKey: parentField,
|
|
15790
|
+
mapChildren: childrenField,
|
|
15791
|
+
rootParentValue,
|
|
15792
|
+
rootValues
|
|
15793
|
+
}) : list ? list.slice(0) : [];
|
|
15794
|
+
internalData.treeFullData = fullData;
|
|
15795
|
+
cacheNodeMap();
|
|
15796
|
+
handleData(true);
|
|
15797
|
+
handleCurrentItems();
|
|
15798
|
+
updateCurrentChunk();
|
|
15799
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
15800
|
+
};
|
|
15801
|
+
const updateCurrentChunk = () => {
|
|
15802
|
+
const {
|
|
15803
|
+
currentItems
|
|
15804
|
+
} = reactData;
|
|
15805
|
+
const {
|
|
15806
|
+
treeFullData
|
|
15807
|
+
} = internalData;
|
|
15808
|
+
const childrenField = computeChildrenField.value;
|
|
15809
|
+
const currentCunkList = [treeFullData];
|
|
15810
|
+
if (currentItems.length) {
|
|
15811
|
+
let chunkIndex = 0;
|
|
15812
|
+
let stNodeid = currentItems[chunkIndex];
|
|
15813
|
+
let optList = treeFullData;
|
|
15814
|
+
while (stNodeid && optList && optList.length) {
|
|
15815
|
+
stNodeid = currentItems[chunkIndex++];
|
|
15816
|
+
const currOption = optList.find(item => stNodeid === getNodeId(item));
|
|
15817
|
+
optList = currOption ? currOption[childrenField] : [];
|
|
15818
|
+
if (!optList || !optList.length) {
|
|
15819
|
+
break;
|
|
15820
|
+
}
|
|
15821
|
+
currentCunkList.push(optList);
|
|
15822
|
+
}
|
|
15823
|
+
}
|
|
15824
|
+
reactData.currentCunkList = currentCunkList;
|
|
15825
|
+
};
|
|
15826
|
+
const handleCurrentItems = () => {
|
|
15827
|
+
const {
|
|
15828
|
+
treeFullData
|
|
15829
|
+
} = internalData;
|
|
15830
|
+
const selectVals = computeSelectVals.value;
|
|
15831
|
+
const childrenField = computeChildrenField.value;
|
|
15832
|
+
const stItems = [];
|
|
15833
|
+
const expandedMaps = {};
|
|
15834
|
+
if (selectVals.length) {
|
|
15835
|
+
const lastVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(selectVals);
|
|
15836
|
+
const stRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(treeFullData, item => lastVal === getNodeId(item), {
|
|
15837
|
+
children: childrenField
|
|
15838
|
+
});
|
|
15839
|
+
if (stRest) {
|
|
15840
|
+
const {
|
|
15841
|
+
nodes
|
|
15842
|
+
} = stRest;
|
|
15843
|
+
nodes.forEach(item => {
|
|
15844
|
+
const nodeid = getNodeId(item);
|
|
15845
|
+
expandedMaps[nodeid] = true;
|
|
15846
|
+
stItems.push(nodeid);
|
|
15847
|
+
});
|
|
15848
|
+
}
|
|
15849
|
+
}
|
|
15850
|
+
internalData.treeExpandedMaps = expandedMaps;
|
|
15851
|
+
reactData.currentItems = stItems;
|
|
15028
15852
|
};
|
|
15029
15853
|
const updateZindex = () => {
|
|
15854
|
+
const popupOpts = computePopupOpts.value;
|
|
15030
15855
|
const {
|
|
15031
15856
|
zIndex
|
|
15032
|
-
} =
|
|
15857
|
+
} = popupOpts;
|
|
15033
15858
|
if (zIndex) {
|
|
15034
15859
|
reactData.panelIndex = zIndex;
|
|
15035
15860
|
} else if (reactData.panelIndex < getLastZIndex()) {
|
|
@@ -15037,9 +15862,6 @@ function cascader_createInternalData() {
|
|
|
15037
15862
|
}
|
|
15038
15863
|
};
|
|
15039
15864
|
const updatePlacement = () => {
|
|
15040
|
-
const {
|
|
15041
|
-
placement
|
|
15042
|
-
} = props;
|
|
15043
15865
|
const {
|
|
15044
15866
|
panelIndex
|
|
15045
15867
|
} = reactData;
|
|
@@ -15049,9 +15871,10 @@ function cascader_createInternalData() {
|
|
|
15049
15871
|
const popupOpts = computePopupOpts.value;
|
|
15050
15872
|
const handleStyle = () => {
|
|
15051
15873
|
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
15052
|
-
placement: popupOpts.placement
|
|
15874
|
+
placement: popupOpts.placement,
|
|
15053
15875
|
defaultPlacement: popupOpts.defaultPlacement,
|
|
15054
|
-
teleportTo: btnTransfer
|
|
15876
|
+
teleportTo: btnTransfer,
|
|
15877
|
+
isMinWidth: false
|
|
15055
15878
|
});
|
|
15056
15879
|
const panelStyle = Object.assign(ppObj.style, {
|
|
15057
15880
|
zIndex: panelIndex
|
|
@@ -15062,14 +15885,14 @@ function cascader_createInternalData() {
|
|
|
15062
15885
|
handleStyle();
|
|
15063
15886
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(handleStyle);
|
|
15064
15887
|
};
|
|
15065
|
-
const showOptionPanel =
|
|
15888
|
+
const showOptionPanel = evnt => {
|
|
15066
15889
|
const {
|
|
15067
15890
|
loading,
|
|
15068
15891
|
remote,
|
|
15069
15892
|
filterable
|
|
15070
15893
|
} = props;
|
|
15071
15894
|
const {
|
|
15072
|
-
|
|
15895
|
+
treeFullData
|
|
15073
15896
|
} = internalData;
|
|
15074
15897
|
const isDisabled = computeIsDisabled.value;
|
|
15075
15898
|
const remoteOpts = computeRemoteOpts.value;
|
|
@@ -15081,7 +15904,7 @@ function cascader_createInternalData() {
|
|
|
15081
15904
|
reactData.isActivated = true;
|
|
15082
15905
|
reactData.isAniVisible = true;
|
|
15083
15906
|
if (filterable) {
|
|
15084
|
-
if (remote && remoteOpts.enabled && remoteOpts.autoLoad && !
|
|
15907
|
+
if (remote && remoteOpts.enabled && remoteOpts.autoLoad && !treeFullData.length) {
|
|
15085
15908
|
handleSearchEvent();
|
|
15086
15909
|
}
|
|
15087
15910
|
}
|
|
@@ -15091,13 +15914,66 @@ function cascader_createInternalData() {
|
|
|
15091
15914
|
}, 10);
|
|
15092
15915
|
updateZindex();
|
|
15093
15916
|
updatePlacement();
|
|
15917
|
+
dispatchEvent('visible-change', {
|
|
15918
|
+
visible: true
|
|
15919
|
+
}, evnt || null);
|
|
15094
15920
|
}
|
|
15095
15921
|
};
|
|
15096
|
-
const hideOptionPanel =
|
|
15922
|
+
const hideOptionPanel = evnt => {
|
|
15097
15923
|
reactData.visiblePanel = false;
|
|
15098
15924
|
internalData.hpTimeout = setTimeout(() => {
|
|
15099
15925
|
reactData.isAniVisible = false;
|
|
15100
15926
|
}, 350);
|
|
15927
|
+
dispatchEvent('visible-change', {
|
|
15928
|
+
visible: false
|
|
15929
|
+
}, evnt || null);
|
|
15930
|
+
};
|
|
15931
|
+
const setCurrentNode = node => {
|
|
15932
|
+
reactData.currentNode = node;
|
|
15933
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
15934
|
+
};
|
|
15935
|
+
const setAllCheckboxNode = checked => {
|
|
15936
|
+
const selectMaps = {};
|
|
15937
|
+
const childrenField = computeChildrenField.value;
|
|
15938
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
15939
|
+
const treeOpts = computeTreeOpts.value;
|
|
15940
|
+
const {
|
|
15941
|
+
transform
|
|
15942
|
+
} = treeOpts;
|
|
15943
|
+
const checkKeys = [];
|
|
15944
|
+
const checkNodes = [];
|
|
15945
|
+
if (checked) {
|
|
15946
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeList, node => {
|
|
15947
|
+
const nodeid = getNodeId(node);
|
|
15948
|
+
checkKeys.push(nodeid);
|
|
15949
|
+
checkNodes.push(node);
|
|
15950
|
+
selectMaps[nodeid] = true;
|
|
15951
|
+
}, {
|
|
15952
|
+
children: transform ? mapChildrenField : childrenField
|
|
15953
|
+
});
|
|
15954
|
+
}
|
|
15955
|
+
internalData.indeterminateRowMaps = {};
|
|
15956
|
+
internalData.selectCheckboxMaps = selectMaps;
|
|
15957
|
+
reactData.updateCheckboxFlag++;
|
|
15958
|
+
updateCheckboxStatus();
|
|
15959
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15960
|
+
return {
|
|
15961
|
+
checkNodeKeys: checkKeys,
|
|
15962
|
+
checkNodes
|
|
15963
|
+
};
|
|
15964
|
+
});
|
|
15965
|
+
};
|
|
15966
|
+
const clearCheckboxNode = () => {
|
|
15967
|
+
internalData.indeterminateRowMaps = {};
|
|
15968
|
+
internalData.selectCheckboxMaps = {};
|
|
15969
|
+
reactData.updateCheckboxFlag++;
|
|
15970
|
+
updateCheckboxStatus();
|
|
15971
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15972
|
+
return {
|
|
15973
|
+
checkNodeKeys: [],
|
|
15974
|
+
checkNodes: []
|
|
15975
|
+
};
|
|
15976
|
+
});
|
|
15101
15977
|
};
|
|
15102
15978
|
const changeEvent = (evnt, selectValue, node) => {
|
|
15103
15979
|
const value = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(selectValue) ? selectValue.map(deNodeValue) : deNodeValue(selectValue);
|
|
@@ -15122,7 +15998,7 @@ function cascader_createInternalData() {
|
|
|
15122
15998
|
};
|
|
15123
15999
|
const clearEvent = (params, evnt) => {
|
|
15124
16000
|
clearValueEvent(evnt, null);
|
|
15125
|
-
hideOptionPanel();
|
|
16001
|
+
hideOptionPanel(evnt);
|
|
15126
16002
|
};
|
|
15127
16003
|
const allCheckedPanelEvent = params => {
|
|
15128
16004
|
const {
|
|
@@ -15130,120 +16006,544 @@ function cascader_createInternalData() {
|
|
|
15130
16006
|
} = params;
|
|
15131
16007
|
const {
|
|
15132
16008
|
multiple,
|
|
15133
|
-
|
|
16009
|
+
checkedClosable
|
|
15134
16010
|
} = props;
|
|
15135
|
-
const $tree = refTree.value;
|
|
15136
16011
|
if (multiple) {
|
|
15137
|
-
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15144
|
-
|
|
15145
|
-
|
|
15146
|
-
|
|
15147
|
-
|
|
16012
|
+
setAllCheckboxNode(true).then(({
|
|
16013
|
+
checkNodeKeys,
|
|
16014
|
+
checkNodes
|
|
16015
|
+
}) => {
|
|
16016
|
+
changeEvent($event, checkNodeKeys, checkNodes[0]);
|
|
16017
|
+
dispatchEvent('all-change', {
|
|
16018
|
+
value: checkNodeKeys
|
|
16019
|
+
}, $event);
|
|
16020
|
+
if (checkedClosable) {
|
|
16021
|
+
hideOptionPanel($event);
|
|
16022
|
+
}
|
|
16023
|
+
});
|
|
16024
|
+
}
|
|
16025
|
+
};
|
|
16026
|
+
const clearCheckedPanelEvent = params => {
|
|
16027
|
+
const {
|
|
16028
|
+
$event
|
|
16029
|
+
} = params;
|
|
16030
|
+
const {
|
|
16031
|
+
multiple,
|
|
16032
|
+
checkedClosable
|
|
16033
|
+
} = props;
|
|
16034
|
+
const value = multiple ? [] : null;
|
|
16035
|
+
clearCheckboxNode().then(() => {
|
|
16036
|
+
if (checkedClosable) {
|
|
16037
|
+
hideOptionPanel($event);
|
|
16038
|
+
}
|
|
16039
|
+
});
|
|
16040
|
+
changeEvent($event, value, null);
|
|
16041
|
+
dispatchEvent('clear', {
|
|
16042
|
+
value
|
|
16043
|
+
}, $event);
|
|
16044
|
+
};
|
|
16045
|
+
const closePanelEvent = params => {
|
|
16046
|
+
const {
|
|
16047
|
+
$event
|
|
16048
|
+
} = params;
|
|
16049
|
+
hideOptionPanel($event);
|
|
16050
|
+
};
|
|
16051
|
+
const handleGlobalMousewheelEvent = evnt => {
|
|
16052
|
+
const {
|
|
16053
|
+
visiblePanel
|
|
16054
|
+
} = reactData;
|
|
16055
|
+
const isDisabled = computeIsDisabled.value;
|
|
16056
|
+
if (!isDisabled) {
|
|
16057
|
+
if (visiblePanel) {
|
|
16058
|
+
const panelElem = refOptionPanel.value;
|
|
16059
|
+
if (getEventTargetNode(evnt, panelElem).flag) {
|
|
16060
|
+
updatePlacement();
|
|
16061
|
+
} else {
|
|
16062
|
+
hideOptionPanel(evnt);
|
|
16063
|
+
}
|
|
16064
|
+
}
|
|
16065
|
+
}
|
|
16066
|
+
};
|
|
16067
|
+
const handleGlobalMousedownEvent = evnt => {
|
|
16068
|
+
const {
|
|
16069
|
+
visiblePanel
|
|
16070
|
+
} = reactData;
|
|
16071
|
+
const isDisabled = computeIsDisabled.value;
|
|
16072
|
+
if (!isDisabled) {
|
|
16073
|
+
const el = refElem.value;
|
|
16074
|
+
const panelElem = refOptionPanel.value;
|
|
16075
|
+
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag;
|
|
16076
|
+
if (visiblePanel && !reactData.isActivated) {
|
|
16077
|
+
hideOptionPanel(evnt);
|
|
16078
|
+
}
|
|
16079
|
+
}
|
|
16080
|
+
};
|
|
16081
|
+
const handleGlobalBlurEvent = evnt => {
|
|
16082
|
+
const {
|
|
16083
|
+
visiblePanel,
|
|
16084
|
+
isActivated
|
|
16085
|
+
} = reactData;
|
|
16086
|
+
if (visiblePanel) {
|
|
16087
|
+
hideOptionPanel(evnt);
|
|
16088
|
+
}
|
|
16089
|
+
if (isActivated) {
|
|
16090
|
+
reactData.isActivated = false;
|
|
16091
|
+
}
|
|
16092
|
+
if (visiblePanel || isActivated) {
|
|
16093
|
+
const $input = refInput.value;
|
|
16094
|
+
if ($input) {
|
|
16095
|
+
$input.blur();
|
|
16096
|
+
}
|
|
16097
|
+
}
|
|
16098
|
+
};
|
|
16099
|
+
const handleGlobalResizeEvent = () => {
|
|
16100
|
+
const {
|
|
16101
|
+
visiblePanel
|
|
16102
|
+
} = reactData;
|
|
16103
|
+
if (visiblePanel) {
|
|
16104
|
+
updatePlacement();
|
|
16105
|
+
}
|
|
16106
|
+
};
|
|
16107
|
+
const handleFocusSearch = () => {
|
|
16108
|
+
if (props.filterable) {
|
|
16109
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
16110
|
+
const inpSearch = refInpSearch.value;
|
|
16111
|
+
if (inpSearch) {
|
|
16112
|
+
inpSearch.focus();
|
|
16113
|
+
}
|
|
16114
|
+
});
|
|
16115
|
+
}
|
|
16116
|
+
};
|
|
16117
|
+
const changeCurrentEvent = (evnt, node) => {
|
|
16118
|
+
evnt.preventDefault();
|
|
16119
|
+
const isChecked = true;
|
|
16120
|
+
reactData.currentNode = node;
|
|
16121
|
+
dispatchEvent('current-change', {
|
|
16122
|
+
node,
|
|
16123
|
+
checked: isChecked
|
|
16124
|
+
}, evnt);
|
|
16125
|
+
};
|
|
16126
|
+
const changeRadioEvent = (evnt, node) => {
|
|
16127
|
+
evnt.preventDefault();
|
|
16128
|
+
evnt.stopPropagation();
|
|
16129
|
+
const {
|
|
16130
|
+
nodeMaps
|
|
16131
|
+
} = internalData;
|
|
16132
|
+
const radioOpts = computeRadioOpts.value;
|
|
16133
|
+
const childrenField = computeChildrenField.value;
|
|
16134
|
+
const {
|
|
16135
|
+
checkMode,
|
|
16136
|
+
checkMethod
|
|
16137
|
+
} = radioOpts;
|
|
16138
|
+
const nodeid = getNodeId(node);
|
|
16139
|
+
const childList = node[childrenField];
|
|
16140
|
+
const isExistChild = childList && childList.length > 0;
|
|
16141
|
+
const nodeItem = nodeMaps[nodeid] || {};
|
|
16142
|
+
const nLevel = nodeItem.level;
|
|
16143
|
+
const isDisabled = checkMethod ? !checkMethod({
|
|
16144
|
+
$cascader: $xeCascader,
|
|
16145
|
+
node
|
|
16146
|
+
}) : !handleVisibleOrCheckMode(checkMode, isExistChild, nLevel);
|
|
16147
|
+
if (isDisabled) {
|
|
16148
|
+
return;
|
|
16149
|
+
}
|
|
16150
|
+
const value = nodeid;
|
|
16151
|
+
reactData.selectRadioKey = value;
|
|
16152
|
+
changeEvent(evnt, value, node);
|
|
16153
|
+
hideOptionPanel(evnt);
|
|
16154
|
+
};
|
|
16155
|
+
const handleAsyncTreeExpandChilds = node => {
|
|
16156
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
16157
|
+
const treeOpts = computeTreeOpts.value;
|
|
16158
|
+
const {
|
|
16159
|
+
loadMethod
|
|
16160
|
+
} = treeOpts;
|
|
16161
|
+
const {
|
|
16162
|
+
checkStrictly
|
|
16163
|
+
} = checkboxOpts;
|
|
16164
|
+
return new Promise(resolve => {
|
|
16165
|
+
if (loadMethod) {
|
|
16166
|
+
const {
|
|
16167
|
+
nodeMaps
|
|
16168
|
+
} = internalData;
|
|
16169
|
+
const nodeid = getNodeId(node);
|
|
16170
|
+
const nodeItem = nodeMaps[nodeid];
|
|
16171
|
+
internalData.treeExpandLazyLoadedMaps[nodeid] = true;
|
|
16172
|
+
Promise.resolve(loadMethod({
|
|
16173
|
+
$cascader: $xeCascader,
|
|
16174
|
+
node
|
|
16175
|
+
})).then(childRecords => {
|
|
16176
|
+
const {
|
|
16177
|
+
treeExpandLazyLoadedMaps
|
|
16178
|
+
} = internalData;
|
|
16179
|
+
nodeItem.treeLoaded = true;
|
|
16180
|
+
if (treeExpandLazyLoadedMaps[nodeid]) {
|
|
16181
|
+
treeExpandLazyLoadedMaps[nodeid] = false;
|
|
15148
16182
|
}
|
|
16183
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
16184
|
+
childRecords = [];
|
|
16185
|
+
}
|
|
16186
|
+
if (childRecords) {
|
|
16187
|
+
return $xeCascader.loadChildrenNode(node, childRecords).then(childRows => {
|
|
16188
|
+
const {
|
|
16189
|
+
treeExpandedMaps
|
|
16190
|
+
} = internalData;
|
|
16191
|
+
if (childRows.length && !treeExpandedMaps[nodeid]) {
|
|
16192
|
+
treeExpandedMaps[nodeid] = true;
|
|
16193
|
+
}
|
|
16194
|
+
reactData.updateExpandedFlag++;
|
|
16195
|
+
// 如果当前节点已选中,则展开后子节点也被选中
|
|
16196
|
+
if (!checkStrictly && $xeCascader.isCheckedByCheckboxNodeId(nodeid)) {
|
|
16197
|
+
handleCheckedCheckboxNode(childRows, true);
|
|
16198
|
+
}
|
|
16199
|
+
dispatchEvent('load-success', {
|
|
16200
|
+
node,
|
|
16201
|
+
data: childRecords
|
|
16202
|
+
}, new Event('load-success'));
|
|
16203
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16204
|
+
});
|
|
16205
|
+
} else {
|
|
16206
|
+
dispatchEvent('load-success', {
|
|
16207
|
+
node,
|
|
16208
|
+
data: childRecords
|
|
16209
|
+
}, new Event('load-success'));
|
|
16210
|
+
}
|
|
16211
|
+
}).catch(e => {
|
|
16212
|
+
const {
|
|
16213
|
+
treeExpandLazyLoadedMaps
|
|
16214
|
+
} = internalData;
|
|
16215
|
+
nodeItem.treeLoaded = false;
|
|
16216
|
+
if (treeExpandLazyLoadedMaps[nodeid]) {
|
|
16217
|
+
treeExpandLazyLoadedMaps[nodeid] = false;
|
|
16218
|
+
}
|
|
16219
|
+
dispatchEvent('load-error', {
|
|
16220
|
+
node,
|
|
16221
|
+
data: e
|
|
16222
|
+
}, new Event('load-error'));
|
|
16223
|
+
}).finally(() => {
|
|
16224
|
+
handleTreeToList();
|
|
16225
|
+
handleData();
|
|
15149
16226
|
});
|
|
16227
|
+
} else {
|
|
16228
|
+
resolve();
|
|
15150
16229
|
}
|
|
16230
|
+
});
|
|
16231
|
+
};
|
|
16232
|
+
/**
|
|
16233
|
+
* 展开与收起树节点
|
|
16234
|
+
* @param nodeList
|
|
16235
|
+
* @param expanded
|
|
16236
|
+
* @returns
|
|
16237
|
+
*/
|
|
16238
|
+
const handleBaseTreeExpand = (nodeList, expanded) => {
|
|
16239
|
+
const {
|
|
16240
|
+
treeExpandLazyLoadedMaps,
|
|
16241
|
+
treeExpandedMaps
|
|
16242
|
+
} = internalData;
|
|
16243
|
+
const {
|
|
16244
|
+
nodeMaps
|
|
16245
|
+
} = internalData;
|
|
16246
|
+
const childrenField = computeChildrenField.value;
|
|
16247
|
+
const hasChildField = computeHasChildField.value;
|
|
16248
|
+
const treeOpts = computeTreeOpts.value;
|
|
16249
|
+
const {
|
|
16250
|
+
lazy,
|
|
16251
|
+
toggleMethod
|
|
16252
|
+
} = treeOpts;
|
|
16253
|
+
const result = [];
|
|
16254
|
+
let validNodes = toggleMethod ? nodeList.filter(node => toggleMethod({
|
|
16255
|
+
$cascader: $xeCascader,
|
|
16256
|
+
expanded,
|
|
16257
|
+
node
|
|
16258
|
+
})) : nodeList;
|
|
16259
|
+
validNodes = validNodes.length ? [validNodes[validNodes.length - 1]] : [];
|
|
16260
|
+
// 同一级只能展开一个
|
|
16261
|
+
const nodeid = getNodeId(validNodes[0]);
|
|
16262
|
+
const nodeItem = nodeMaps[nodeid];
|
|
16263
|
+
if (nodeItem) {
|
|
16264
|
+
nodeItem.items.forEach(item => {
|
|
16265
|
+
const itemNodeId = getNodeId(item);
|
|
16266
|
+
if (treeExpandedMaps[itemNodeId]) {
|
|
16267
|
+
delete treeExpandedMaps[itemNodeId];
|
|
16268
|
+
}
|
|
16269
|
+
});
|
|
16270
|
+
}
|
|
16271
|
+
const expandNodes = [];
|
|
16272
|
+
if (expanded) {
|
|
16273
|
+
validNodes.forEach(item => {
|
|
16274
|
+
const itemNodeId = getNodeId(item);
|
|
16275
|
+
if (!treeExpandedMaps[itemNodeId]) {
|
|
16276
|
+
const nodeItem = nodeMaps[itemNodeId];
|
|
16277
|
+
const isLoad = lazy && item[hasChildField] && !nodeItem.treeLoaded && !treeExpandLazyLoadedMaps[itemNodeId];
|
|
16278
|
+
// 是否使用懒加载
|
|
16279
|
+
if (isLoad) {
|
|
16280
|
+
result.push(handleAsyncTreeExpandChilds(item));
|
|
16281
|
+
} else {
|
|
16282
|
+
if (item[childrenField] && item[childrenField].length) {
|
|
16283
|
+
treeExpandedMaps[itemNodeId] = true;
|
|
16284
|
+
expandNodes.push(item);
|
|
16285
|
+
}
|
|
16286
|
+
}
|
|
16287
|
+
}
|
|
16288
|
+
});
|
|
16289
|
+
} else {
|
|
16290
|
+
validNodes.forEach(item => {
|
|
16291
|
+
const itemNodeId = getNodeId(item);
|
|
16292
|
+
if (treeExpandedMaps[itemNodeId]) {
|
|
16293
|
+
delete treeExpandedMaps[itemNodeId];
|
|
16294
|
+
expandNodes.push(item);
|
|
16295
|
+
}
|
|
16296
|
+
});
|
|
15151
16297
|
}
|
|
16298
|
+
reactData.updateExpandedFlag++;
|
|
16299
|
+
handleTreeToList();
|
|
16300
|
+
handleData();
|
|
16301
|
+
return Promise.all(result);
|
|
15152
16302
|
};
|
|
15153
|
-
const
|
|
16303
|
+
const toggleExpandEvent = (evnt, node, chunks, chunkIndex) => {
|
|
15154
16304
|
const {
|
|
15155
|
-
|
|
15156
|
-
} =
|
|
16305
|
+
currentItems
|
|
16306
|
+
} = reactData;
|
|
15157
16307
|
const {
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
const
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
}, $event);
|
|
16308
|
+
treeExpandLazyLoadedMaps
|
|
16309
|
+
} = internalData;
|
|
16310
|
+
const treeOpts = computeTreeOpts.value;
|
|
16311
|
+
const {
|
|
16312
|
+
lazy
|
|
16313
|
+
} = treeOpts;
|
|
16314
|
+
const stItems = currentItems.slice(0, chunkIndex);
|
|
16315
|
+
const nodeid = getNodeId(node);
|
|
16316
|
+
const expanded = true;
|
|
16317
|
+
evnt.stopPropagation();
|
|
16318
|
+
stItems.push(nodeid);
|
|
16319
|
+
reactData.currentItems = stItems;
|
|
16320
|
+
if (!lazy || !treeExpandLazyLoadedMaps[nodeid]) {
|
|
16321
|
+
handleBaseTreeExpand([node], expanded);
|
|
15173
16322
|
}
|
|
16323
|
+
setCurrentNode(node);
|
|
16324
|
+
updateCurrentChunk();
|
|
16325
|
+
dispatchEvent('node-expand', {
|
|
16326
|
+
node,
|
|
16327
|
+
expanded
|
|
16328
|
+
}, evnt);
|
|
15174
16329
|
};
|
|
15175
|
-
const
|
|
16330
|
+
const updateCheckboxStatus = () => {
|
|
15176
16331
|
const {
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
16332
|
+
selectCheckboxMaps,
|
|
16333
|
+
indeterminateRowMaps,
|
|
16334
|
+
afterTreeList
|
|
16335
|
+
} = internalData;
|
|
16336
|
+
const childrenField = computeChildrenField.value;
|
|
16337
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
16338
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
16339
|
+
const {
|
|
16340
|
+
checkStrictly,
|
|
16341
|
+
checkMethod
|
|
16342
|
+
} = checkboxOpts;
|
|
16343
|
+
const treeOpts = computeTreeOpts.value;
|
|
16344
|
+
const {
|
|
16345
|
+
transform
|
|
16346
|
+
} = treeOpts;
|
|
16347
|
+
if (!checkStrictly) {
|
|
16348
|
+
const childRowMaps = {};
|
|
16349
|
+
const childRowList = [];
|
|
16350
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, node => {
|
|
16351
|
+
const nodeid = getNodeId(node);
|
|
16352
|
+
const childList = node[childrenField];
|
|
16353
|
+
if (childList && childList.length && !childRowMaps[nodeid]) {
|
|
16354
|
+
childRowMaps[nodeid] = 1;
|
|
16355
|
+
childRowList.unshift([node, nodeid, childList]);
|
|
16356
|
+
}
|
|
16357
|
+
}, {
|
|
16358
|
+
children: transform ? mapChildrenField : childrenField
|
|
16359
|
+
});
|
|
16360
|
+
childRowList.forEach(vals => {
|
|
16361
|
+
const node = vals[0];
|
|
16362
|
+
const nodeid = vals[1];
|
|
16363
|
+
const childList = vals[2];
|
|
16364
|
+
let sLen = 0; // 已选
|
|
16365
|
+
let hLen = 0; // 半选
|
|
16366
|
+
let vLen = 0; // 有效子行
|
|
16367
|
+
const cLen = childList.length; // 子行
|
|
16368
|
+
childList.forEach(checkMethod ? item => {
|
|
16369
|
+
const childNodeid = getNodeId(item);
|
|
16370
|
+
const isSelect = selectCheckboxMaps[childNodeid];
|
|
16371
|
+
if (checkMethod({
|
|
16372
|
+
$cascader: $xeCascader,
|
|
16373
|
+
node: item
|
|
16374
|
+
})) {
|
|
16375
|
+
if (isSelect) {
|
|
16376
|
+
sLen++;
|
|
16377
|
+
} else if (indeterminateRowMaps[childNodeid]) {
|
|
16378
|
+
hLen++;
|
|
16379
|
+
}
|
|
16380
|
+
vLen++;
|
|
16381
|
+
} else {
|
|
16382
|
+
if (isSelect) {
|
|
16383
|
+
sLen++;
|
|
16384
|
+
} else if (indeterminateRowMaps[childNodeid]) {
|
|
16385
|
+
hLen++;
|
|
16386
|
+
}
|
|
16387
|
+
}
|
|
16388
|
+
} : item => {
|
|
16389
|
+
const childNodeid = getNodeId(item);
|
|
16390
|
+
const isSelect = selectCheckboxMaps[childNodeid];
|
|
16391
|
+
if (isSelect) {
|
|
16392
|
+
sLen++;
|
|
16393
|
+
} else if (indeterminateRowMaps[childNodeid]) {
|
|
16394
|
+
hLen++;
|
|
16395
|
+
}
|
|
16396
|
+
vLen++;
|
|
16397
|
+
});
|
|
16398
|
+
let isSelected = false;
|
|
16399
|
+
if (cLen > 0) {
|
|
16400
|
+
if (vLen > 0) {
|
|
16401
|
+
isSelected = (sLen > 0 || hLen > 0) && sLen >= vLen;
|
|
16402
|
+
} else {
|
|
16403
|
+
// 如果存在子项禁用
|
|
16404
|
+
if (sLen > 0 && sLen >= vLen) {
|
|
16405
|
+
isSelected = true;
|
|
16406
|
+
} else if (selectCheckboxMaps[nodeid]) {
|
|
16407
|
+
isSelected = true;
|
|
16408
|
+
} else {
|
|
16409
|
+
isSelected = false;
|
|
16410
|
+
}
|
|
16411
|
+
}
|
|
15185
16412
|
} else {
|
|
15186
|
-
|
|
16413
|
+
// 如果无子项
|
|
16414
|
+
isSelected = selectCheckboxMaps[nodeid];
|
|
15187
16415
|
}
|
|
15188
|
-
|
|
16416
|
+
const halfSelect = !isSelected && (sLen > 0 || hLen > 0);
|
|
16417
|
+
if (isSelected) {
|
|
16418
|
+
selectCheckboxMaps[nodeid] = node;
|
|
16419
|
+
if (indeterminateRowMaps[nodeid]) {
|
|
16420
|
+
delete indeterminateRowMaps[nodeid];
|
|
16421
|
+
}
|
|
16422
|
+
} else {
|
|
16423
|
+
if (selectCheckboxMaps[nodeid]) {
|
|
16424
|
+
delete selectCheckboxMaps[nodeid];
|
|
16425
|
+
}
|
|
16426
|
+
if (halfSelect) {
|
|
16427
|
+
indeterminateRowMaps[nodeid] = node;
|
|
16428
|
+
} else {
|
|
16429
|
+
if (indeterminateRowMaps[nodeid]) {
|
|
16430
|
+
delete indeterminateRowMaps[nodeid];
|
|
16431
|
+
}
|
|
16432
|
+
}
|
|
16433
|
+
}
|
|
16434
|
+
});
|
|
16435
|
+
reactData.updateCheckboxFlag++;
|
|
15189
16436
|
}
|
|
15190
16437
|
};
|
|
15191
|
-
const
|
|
16438
|
+
const changeCheckboxEvent = (evnt, node) => {
|
|
16439
|
+
evnt.preventDefault();
|
|
16440
|
+
evnt.stopPropagation();
|
|
15192
16441
|
const {
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag;
|
|
15200
|
-
if (visiblePanel && !reactData.isActivated) {
|
|
15201
|
-
hideOptionPanel();
|
|
15202
|
-
}
|
|
15203
|
-
}
|
|
15204
|
-
};
|
|
15205
|
-
const handleGlobalBlurEvent = () => {
|
|
16442
|
+
selectCheckboxMaps,
|
|
16443
|
+
nodeMaps
|
|
16444
|
+
} = internalData;
|
|
16445
|
+
const childrenField = computeChildrenField.value;
|
|
16446
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
16447
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
15206
16448
|
const {
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
|
|
15211
|
-
|
|
16449
|
+
checkStrictly,
|
|
16450
|
+
checkMode,
|
|
16451
|
+
checkMethod
|
|
16452
|
+
} = checkboxOpts;
|
|
16453
|
+
const treeOpts = computeTreeOpts.value;
|
|
16454
|
+
const {
|
|
16455
|
+
transform
|
|
16456
|
+
} = treeOpts;
|
|
16457
|
+
const nodeid = getNodeId(node);
|
|
16458
|
+
const childList = node[childrenField];
|
|
16459
|
+
const isExistChild = childList && childList.length > 0;
|
|
16460
|
+
const nodeItem = nodeMaps[nodeid] || {};
|
|
16461
|
+
const nLevel = nodeItem.level;
|
|
16462
|
+
const isDisabled = checkMethod ? !checkMethod({
|
|
16463
|
+
$cascader: $xeCascader,
|
|
16464
|
+
node
|
|
16465
|
+
}) : !handleVisibleOrCheckMode(checkMode, isExistChild, nLevel);
|
|
16466
|
+
if (isDisabled) {
|
|
16467
|
+
return;
|
|
15212
16468
|
}
|
|
15213
|
-
|
|
15214
|
-
|
|
16469
|
+
let isChecked = false;
|
|
16470
|
+
if (selectCheckboxMaps[nodeid]) {
|
|
16471
|
+
delete selectCheckboxMaps[nodeid];
|
|
16472
|
+
} else {
|
|
16473
|
+
isChecked = true;
|
|
16474
|
+
selectCheckboxMaps[nodeid] = node;
|
|
15215
16475
|
}
|
|
15216
|
-
if (
|
|
15217
|
-
|
|
15218
|
-
|
|
15219
|
-
|
|
15220
|
-
|
|
16476
|
+
if (!checkStrictly) {
|
|
16477
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, transform ? mapChildrenField : childrenField), childNode => {
|
|
16478
|
+
const childNodeid = getNodeId(childNode);
|
|
16479
|
+
if (isChecked) {
|
|
16480
|
+
if (!selectCheckboxMaps[childNodeid]) {
|
|
16481
|
+
selectCheckboxMaps[childNodeid] = true;
|
|
16482
|
+
}
|
|
16483
|
+
} else {
|
|
16484
|
+
if (selectCheckboxMaps[childNodeid]) {
|
|
16485
|
+
delete selectCheckboxMaps[childNodeid];
|
|
16486
|
+
}
|
|
16487
|
+
}
|
|
16488
|
+
}, {
|
|
16489
|
+
children: transform ? mapChildrenField : childrenField
|
|
16490
|
+
});
|
|
15221
16491
|
}
|
|
16492
|
+
reactData.updateCheckboxFlag++;
|
|
16493
|
+
updateCheckboxStatus();
|
|
16494
|
+
const nodeids = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(selectCheckboxMaps);
|
|
16495
|
+
const value = nodeids;
|
|
16496
|
+
changeEvent(evnt, value, node);
|
|
15222
16497
|
};
|
|
15223
|
-
const
|
|
16498
|
+
const handleNodeClickEvent = (evnt, node, chunks, chunkIndex) => {
|
|
15224
16499
|
const {
|
|
15225
|
-
|
|
15226
|
-
} =
|
|
15227
|
-
|
|
15228
|
-
|
|
16500
|
+
multiple
|
|
16501
|
+
} = props;
|
|
16502
|
+
const treeOpts = computeTreeOpts.value;
|
|
16503
|
+
const radioOpts = computeRadioOpts.value;
|
|
16504
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
16505
|
+
const childrenField = computeChildrenField.value;
|
|
16506
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
16507
|
+
const {
|
|
16508
|
+
transform,
|
|
16509
|
+
trigger
|
|
16510
|
+
} = treeOpts;
|
|
16511
|
+
const childList = node[transform ? mapChildrenField : childrenField];
|
|
16512
|
+
let triggerCurrent = false;
|
|
16513
|
+
let triggerRadio = false;
|
|
16514
|
+
let triggerCheckbox = false;
|
|
16515
|
+
let triggerExpand = false;
|
|
16516
|
+
triggerCurrent = true;
|
|
16517
|
+
changeCurrentEvent(evnt, node);
|
|
16518
|
+
if (trigger !== 'icon') {
|
|
16519
|
+
triggerExpand = true;
|
|
16520
|
+
toggleExpandEvent(evnt, node, chunks, chunkIndex);
|
|
15229
16521
|
}
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
|
|
15233
|
-
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
|
|
15237
|
-
|
|
15238
|
-
|
|
16522
|
+
if (multiple) {
|
|
16523
|
+
if (checkboxOpts.trigger === 'node' || !checkboxOpts.showIcon && (!childList || !childList.length)) {
|
|
16524
|
+
triggerCheckbox = true;
|
|
16525
|
+
changeCheckboxEvent(evnt, node);
|
|
16526
|
+
}
|
|
16527
|
+
} else {
|
|
16528
|
+
if (radioOpts.trigger === 'node' || !radioOpts.showIcon && (!childList || !childList.length)) {
|
|
16529
|
+
triggerRadio = true;
|
|
16530
|
+
changeRadioEvent(evnt, node);
|
|
16531
|
+
}
|
|
15239
16532
|
}
|
|
16533
|
+
dispatchEvent('node-click', {
|
|
16534
|
+
node,
|
|
16535
|
+
triggerCurrent,
|
|
16536
|
+
triggerRadio,
|
|
16537
|
+
triggerCheckbox,
|
|
16538
|
+
triggerExpand
|
|
16539
|
+
}, evnt);
|
|
15240
16540
|
};
|
|
15241
16541
|
const focusEvent = evnt => {
|
|
15242
16542
|
const isDisabled = computeIsDisabled.value;
|
|
15243
16543
|
if (!isDisabled) {
|
|
15244
16544
|
if (!reactData.visiblePanel) {
|
|
15245
16545
|
reactData.triggerFocusPanel = true;
|
|
15246
|
-
showOptionPanel();
|
|
16546
|
+
showOptionPanel(evnt);
|
|
15247
16547
|
setTimeout(() => {
|
|
15248
16548
|
reactData.triggerFocusPanel = false;
|
|
15249
16549
|
}, 150);
|
|
@@ -15252,7 +16552,14 @@ function cascader_createInternalData() {
|
|
|
15252
16552
|
dispatchEvent('focus', {}, evnt);
|
|
15253
16553
|
};
|
|
15254
16554
|
const clickEvent = evnt => {
|
|
15255
|
-
|
|
16555
|
+
evnt.preventDefault();
|
|
16556
|
+
if (reactData.triggerFocusPanel) {
|
|
16557
|
+
reactData.triggerFocusPanel = false;
|
|
16558
|
+
} else {
|
|
16559
|
+
if (!reactData.visiblePanel) {
|
|
16560
|
+
showOptionPanel(evnt);
|
|
16561
|
+
}
|
|
16562
|
+
}
|
|
15256
16563
|
dispatchEvent('click', {}, evnt);
|
|
15257
16564
|
};
|
|
15258
16565
|
const blurEvent = evnt => {
|
|
@@ -15261,18 +16568,18 @@ function cascader_createInternalData() {
|
|
|
15261
16568
|
};
|
|
15262
16569
|
const modelSearchEvent = value => {
|
|
15263
16570
|
reactData.searchValue = value;
|
|
16571
|
+
triggerSearchEvent(new Event('filter'));
|
|
15264
16572
|
};
|
|
15265
16573
|
const handleSearchEvent = () => {
|
|
15266
16574
|
const {
|
|
15267
16575
|
modelValue,
|
|
15268
|
-
remote
|
|
15269
|
-
remoteMethod
|
|
16576
|
+
remote
|
|
15270
16577
|
} = props;
|
|
15271
16578
|
const {
|
|
15272
16579
|
searchValue
|
|
15273
16580
|
} = reactData;
|
|
15274
16581
|
const remoteOpts = computeRemoteOpts.value;
|
|
15275
|
-
const queryMethod = remoteOpts.queryMethod
|
|
16582
|
+
const queryMethod = remoteOpts.queryMethod;
|
|
15276
16583
|
if (remote && queryMethod && remoteOpts.enabled) {
|
|
15277
16584
|
reactData.searchLoading = true;
|
|
15278
16585
|
Promise.resolve(queryMethod({
|
|
@@ -15293,14 +16600,240 @@ function cascader_createInternalData() {
|
|
|
15293
16600
|
reactData.triggerFocusPanel = false;
|
|
15294
16601
|
} else {
|
|
15295
16602
|
if (reactData.visiblePanel) {
|
|
15296
|
-
hideOptionPanel();
|
|
16603
|
+
hideOptionPanel($event);
|
|
15297
16604
|
} else {
|
|
15298
|
-
showOptionPanel();
|
|
16605
|
+
showOptionPanel($event);
|
|
16606
|
+
}
|
|
16607
|
+
}
|
|
16608
|
+
};
|
|
16609
|
+
const cascaderPrivateMethods = {
|
|
16610
|
+
isCheckedByCheckboxNodeId,
|
|
16611
|
+
/**
|
|
16612
|
+
* 用于树结构,给行数据加载子节点
|
|
16613
|
+
*/
|
|
16614
|
+
loadChildrenNode(node, childRecords) {
|
|
16615
|
+
const {
|
|
16616
|
+
separator
|
|
16617
|
+
} = props;
|
|
16618
|
+
const {
|
|
16619
|
+
nodeMaps
|
|
16620
|
+
} = internalData;
|
|
16621
|
+
const treeOpts = computeTreeOpts.value;
|
|
16622
|
+
const labelField = computeLabelField.value;
|
|
16623
|
+
const {
|
|
16624
|
+
lazy,
|
|
16625
|
+
transform
|
|
16626
|
+
} = treeOpts;
|
|
16627
|
+
if (!lazy) {
|
|
16628
|
+
return Promise.resolve([]);
|
|
15299
16629
|
}
|
|
16630
|
+
const childrenField = computeChildrenField.value;
|
|
16631
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
16632
|
+
const parentNodeItem = nodeMaps[getNodeId(node)];
|
|
16633
|
+
const parentLevel = parentNodeItem ? parentNodeItem.level : 0;
|
|
16634
|
+
const parentNodes = parentNodeItem ? parentNodeItem.nodes : [];
|
|
16635
|
+
return createNode(childRecords).then(nodeList => {
|
|
16636
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(nodeList, (childRow, index, items, path, parent, nodes) => {
|
|
16637
|
+
const itemNodeId = getNodeId(childRow);
|
|
16638
|
+
nodeMaps[itemNodeId] = {
|
|
16639
|
+
item: childRow,
|
|
16640
|
+
index: -1,
|
|
16641
|
+
$index: -1,
|
|
16642
|
+
_index: -1,
|
|
16643
|
+
items,
|
|
16644
|
+
parent: parent || parentNodeItem.item,
|
|
16645
|
+
nodes: parentNodes.concat(nodes),
|
|
16646
|
+
level: parentLevel + nodes.length,
|
|
16647
|
+
treeIndex: -1,
|
|
16648
|
+
lineCount: 0,
|
|
16649
|
+
treeLoaded: false,
|
|
16650
|
+
fullLabel: nodes.map(item => item[labelField]).join(separator || ' / ')
|
|
16651
|
+
};
|
|
16652
|
+
}, {
|
|
16653
|
+
children: childrenField
|
|
16654
|
+
});
|
|
16655
|
+
node[childrenField] = nodeList;
|
|
16656
|
+
if (transform) {
|
|
16657
|
+
node[mapChildrenField] = nodeList;
|
|
16658
|
+
}
|
|
16659
|
+
updateAfterDataIndex();
|
|
16660
|
+
return nodeList;
|
|
16661
|
+
});
|
|
15300
16662
|
}
|
|
15301
16663
|
};
|
|
15302
|
-
const cascaderPrivateMethods = {};
|
|
15303
16664
|
Object.assign($xeCascader, cascaderMethods, cascaderPrivateMethods);
|
|
16665
|
+
const handleVisibleOrCheckMode = (mode, isExistChild, nLevel) => {
|
|
16666
|
+
if (mode) {
|
|
16667
|
+
if (mode === 'first') {
|
|
16668
|
+
return !nLevel;
|
|
16669
|
+
}
|
|
16670
|
+
if (mode === 'last') {
|
|
16671
|
+
return !isExistChild;
|
|
16672
|
+
}
|
|
16673
|
+
}
|
|
16674
|
+
return true;
|
|
16675
|
+
};
|
|
16676
|
+
const renderRadio = (node, isExistChild, nLevel, isChecked) => {
|
|
16677
|
+
const radioOpts = computeRadioOpts.value;
|
|
16678
|
+
const {
|
|
16679
|
+
showIcon,
|
|
16680
|
+
checkMode,
|
|
16681
|
+
checkMethod,
|
|
16682
|
+
visibleMode,
|
|
16683
|
+
visibleMethod
|
|
16684
|
+
} = radioOpts;
|
|
16685
|
+
const isVisible = visibleMethod ? visibleMethod({
|
|
16686
|
+
$cascader: $xeCascader,
|
|
16687
|
+
node
|
|
16688
|
+
}) : handleVisibleOrCheckMode(visibleMode, isExistChild, nLevel);
|
|
16689
|
+
if (showIcon && isVisible) {
|
|
16690
|
+
const isDisabled = checkMethod ? !checkMethod({
|
|
16691
|
+
$cascader: $xeCascader,
|
|
16692
|
+
node
|
|
16693
|
+
}) : !handleVisibleOrCheckMode(checkMode, isExistChild, nLevel);
|
|
16694
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16695
|
+
class: ['vxe-tree--radio-option', {
|
|
16696
|
+
'is--checked': isChecked,
|
|
16697
|
+
'is--disabled': isDisabled
|
|
16698
|
+
}],
|
|
16699
|
+
onClick: evnt => {
|
|
16700
|
+
if (!isDisabled) {
|
|
16701
|
+
changeRadioEvent(evnt, node);
|
|
16702
|
+
}
|
|
16703
|
+
}
|
|
16704
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16705
|
+
class: ['vxe-radio--icon', isChecked ? getIcon().RADIO_CHECKED : getIcon().RADIO_UNCHECKED]
|
|
16706
|
+
})]);
|
|
16707
|
+
}
|
|
16708
|
+
return renderEmptyElement($xeCascader);
|
|
16709
|
+
};
|
|
16710
|
+
const renderCheckbox = (node, isExistChild, nLevel, isChecked, isIndeterminate) => {
|
|
16711
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
16712
|
+
const {
|
|
16713
|
+
showIcon,
|
|
16714
|
+
checkMode,
|
|
16715
|
+
checkMethod,
|
|
16716
|
+
visibleMode,
|
|
16717
|
+
visibleMethod
|
|
16718
|
+
} = checkboxOpts;
|
|
16719
|
+
const isVisible = visibleMethod ? visibleMethod({
|
|
16720
|
+
$cascader: $xeCascader,
|
|
16721
|
+
node
|
|
16722
|
+
}) : handleVisibleOrCheckMode(visibleMode, isExistChild, nLevel);
|
|
16723
|
+
if (showIcon && isVisible) {
|
|
16724
|
+
const isDisabled = checkMethod ? !checkMethod({
|
|
16725
|
+
$cascader: $xeCascader,
|
|
16726
|
+
node
|
|
16727
|
+
}) : !handleVisibleOrCheckMode(checkMode, isExistChild, nLevel);
|
|
16728
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16729
|
+
class: ['vxe-cascader--checkbox-option', {
|
|
16730
|
+
'is--checked': isChecked,
|
|
16731
|
+
'is--indeterminate': isIndeterminate,
|
|
16732
|
+
'is--disabled': isDisabled
|
|
16733
|
+
}],
|
|
16734
|
+
onClick: evnt => {
|
|
16735
|
+
if (!isDisabled) {
|
|
16736
|
+
changeCheckboxEvent(evnt, node);
|
|
16737
|
+
}
|
|
16738
|
+
}
|
|
16739
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16740
|
+
class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().CHECKBOX_INDETERMINATE : isChecked ? getIcon().CHECKBOX_CHECKED : getIcon().CHECKBOX_UNCHECKED]
|
|
16741
|
+
})]);
|
|
16742
|
+
}
|
|
16743
|
+
return renderEmptyElement($xeCascader);
|
|
16744
|
+
};
|
|
16745
|
+
const renderNode = (node, nodeid, nodeIndex, chunks, chunkIndex) => {
|
|
16746
|
+
const {
|
|
16747
|
+
multiple
|
|
16748
|
+
} = props;
|
|
16749
|
+
const {
|
|
16750
|
+
currentNode,
|
|
16751
|
+
selectRadioKey,
|
|
16752
|
+
updateCheckboxFlag,
|
|
16753
|
+
updateExpandedFlag
|
|
16754
|
+
} = reactData;
|
|
16755
|
+
const {
|
|
16756
|
+
nodeMaps,
|
|
16757
|
+
selectCheckboxMaps,
|
|
16758
|
+
indeterminateRowMaps,
|
|
16759
|
+
treeExpandedMaps,
|
|
16760
|
+
treeExpandLazyLoadedMaps
|
|
16761
|
+
} = internalData;
|
|
16762
|
+
const treeOpts = computeTreeOpts.value;
|
|
16763
|
+
const {
|
|
16764
|
+
lazy,
|
|
16765
|
+
iconLoaded,
|
|
16766
|
+
iconOpen,
|
|
16767
|
+
iconClose
|
|
16768
|
+
} = treeOpts;
|
|
16769
|
+
const childrenField = computeChildrenField.value;
|
|
16770
|
+
const labelField = computeLabelField.value;
|
|
16771
|
+
const hasChildField = computeHasChildField.value;
|
|
16772
|
+
const childList = node[childrenField];
|
|
16773
|
+
const isExistChild = childList && childList.length > 0;
|
|
16774
|
+
const iconSlot = slots.icon;
|
|
16775
|
+
const titleSlot = slots.title;
|
|
16776
|
+
const isExpand = updateExpandedFlag && treeExpandedMaps[nodeid];
|
|
16777
|
+
const nodeItem = nodeMaps[nodeid] || {};
|
|
16778
|
+
const nodeTitle = node[labelField];
|
|
16779
|
+
const nLevel = nodeItem.level;
|
|
16780
|
+
let isRadioChecked = false;
|
|
16781
|
+
if (!multiple) {
|
|
16782
|
+
isRadioChecked = nodeid === selectRadioKey;
|
|
16783
|
+
}
|
|
16784
|
+
let isCheckboxChecked = false;
|
|
16785
|
+
let isIndeterminate = false;
|
|
16786
|
+
if (multiple) {
|
|
16787
|
+
isCheckboxChecked = !!(updateCheckboxFlag && selectCheckboxMaps[nodeid]);
|
|
16788
|
+
isIndeterminate = !!(updateCheckboxFlag && indeterminateRowMaps[nodeid]);
|
|
16789
|
+
}
|
|
16790
|
+
let hasLazyChilds = false;
|
|
16791
|
+
let isLazyLoading = false;
|
|
16792
|
+
let isLazyLoaded = false;
|
|
16793
|
+
if (lazy) {
|
|
16794
|
+
isLazyLoading = !!treeExpandLazyLoadedMaps[nodeid];
|
|
16795
|
+
hasLazyChilds = node[hasChildField];
|
|
16796
|
+
isLazyLoaded = !!nodeItem.treeLoaded;
|
|
16797
|
+
}
|
|
16798
|
+
const nParams = {
|
|
16799
|
+
node
|
|
16800
|
+
};
|
|
16801
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16802
|
+
key: `${chunkIndex}_${nodeIndex}`,
|
|
16803
|
+
class: ['vxe-cascader-chunk--node-item', {
|
|
16804
|
+
'is--current': currentNode && (currentNode === node || getNodeId(currentNode) === nodeid),
|
|
16805
|
+
'is-radio--checked': isRadioChecked,
|
|
16806
|
+
'is-checkbox--checked': isCheckboxChecked,
|
|
16807
|
+
'is-checkbox--indeterminate': isIndeterminate,
|
|
16808
|
+
'is--expand': isExpand
|
|
16809
|
+
}],
|
|
16810
|
+
title: nodeTitle,
|
|
16811
|
+
onMousedown: evnt => {
|
|
16812
|
+
const isLeftBtn = evnt.button === 0;
|
|
16813
|
+
if (isLeftBtn) {
|
|
16814
|
+
evnt.stopPropagation();
|
|
16815
|
+
}
|
|
16816
|
+
},
|
|
16817
|
+
onClick(evnt) {
|
|
16818
|
+
handleNodeClickEvent(evnt, node, chunks, chunkIndex);
|
|
16819
|
+
}
|
|
16820
|
+
}, [multiple ? renderCheckbox(node, isExistChild, nLevel, isCheckboxChecked, isIndeterminate) : renderRadio(node, isExistChild, nLevel, isRadioChecked), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16821
|
+
class: 'vxe-cascader-chunk--node-item-inner'
|
|
16822
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16823
|
+
class: 'vxe-cascader-chunk--node-item-title'
|
|
16824
|
+
}, titleSlot ? getSlotVNs(titleSlot(nParams)) : nodeTitle)]), treeOpts.showIcon && (lazy ? isLazyLoaded ? isExistChild : hasLazyChilds : isExistChild) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16825
|
+
class: 'vxe-cascader-chunk--node-item-switcher'
|
|
16826
|
+
}, [[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16827
|
+
class: 'vxe-cascader--node-item-icon',
|
|
16828
|
+
onClick(evnt) {
|
|
16829
|
+
if (treeOpts.trigger === 'icon') {
|
|
16830
|
+
toggleExpandEvent(evnt, node, chunks, chunkIndex);
|
|
16831
|
+
}
|
|
16832
|
+
}
|
|
16833
|
+
}, iconSlot ? getSlotVNs(iconSlot(nParams)) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16834
|
+
class: isLazyLoading ? iconLoaded || getIcon().CASCADER_NODE_LOADED : isExpand ? iconOpen || getIcon().CASCADER_NODE_OPEN : iconClose || getIcon().CASCADER_NODE_CLOSE
|
|
16835
|
+
})])]]) : renderEmptyElement($xeCascader)]);
|
|
16836
|
+
};
|
|
15304
16837
|
const renderVN = () => {
|
|
15305
16838
|
const {
|
|
15306
16839
|
className,
|
|
@@ -15310,14 +16843,16 @@ function cascader_createInternalData() {
|
|
|
15310
16843
|
filterable,
|
|
15311
16844
|
showTotalButton,
|
|
15312
16845
|
showCheckedButton,
|
|
15313
|
-
showClearButton
|
|
16846
|
+
showClearButton,
|
|
16847
|
+
showCloseButton
|
|
15314
16848
|
} = props;
|
|
15315
16849
|
const {
|
|
15316
16850
|
initialized,
|
|
15317
16851
|
isActivated,
|
|
15318
16852
|
isAniVisible,
|
|
15319
16853
|
visiblePanel,
|
|
15320
|
-
searchValue
|
|
16854
|
+
searchValue,
|
|
16855
|
+
currentCunkList
|
|
15321
16856
|
} = reactData;
|
|
15322
16857
|
const vSize = computeSize.value;
|
|
15323
16858
|
const isDisabled = computeIsDisabled.value;
|
|
@@ -15383,7 +16918,7 @@ function cascader_createInternalData() {
|
|
|
15383
16918
|
'ani--enter': !loading && visiblePanel
|
|
15384
16919
|
}],
|
|
15385
16920
|
placement: reactData.panelPlacement,
|
|
15386
|
-
style:
|
|
16921
|
+
style: popupWrapperStyle
|
|
15387
16922
|
}, initialized ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15388
16923
|
class: 'vxe-cascader--panel-wrapper'
|
|
15389
16924
|
}, [filterable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
@@ -15398,37 +16933,80 @@ function cascader_createInternalData() {
|
|
|
15398
16933
|
placeholder: getI18n('vxe.cascader.search'),
|
|
15399
16934
|
prefixIcon: getIcon().INPUT_SEARCH,
|
|
15400
16935
|
'onUpdate:modelValue': modelSearchEvent
|
|
15401
|
-
})]) : renderEmptyElement($xeCascader),
|
|
15402
|
-
class: 'vxe-
|
|
16936
|
+
})]) : renderEmptyElement($xeCascader), showCheckedButton && multiple || showClearButton || headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16937
|
+
class: 'vxe-tree-select--panel-header'
|
|
15403
16938
|
}, headerSlot ? headerSlot({}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15404
|
-
class: 'vxe-
|
|
15405
|
-
}, [
|
|
15406
|
-
class: 'vxe-
|
|
15407
|
-
}, getI18n('vxe.cascader.total', [selectVals.length])) : renderEmptyElement($xeCascader), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15408
|
-
class: 'vxe-cascader--header-btns'
|
|
16939
|
+
class: 'vxe-tree-select--header-button'
|
|
16940
|
+
}, [showCheckedButton && showClearButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16941
|
+
class: 'vxe-tree-select--selected-btns'
|
|
15409
16942
|
}, [showCheckedButton && multiple ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
15410
|
-
content: getI18n('vxe.
|
|
16943
|
+
content: getI18n('vxe.treeSelect.allChecked'),
|
|
15411
16944
|
mode: 'text',
|
|
15412
16945
|
onClick: allCheckedPanelEvent
|
|
15413
16946
|
}) : renderEmptyElement($xeCascader), showClearButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
15414
|
-
content: getI18n('vxe.
|
|
16947
|
+
content: getI18n('vxe.treeSelect.clearChecked'),
|
|
15415
16948
|
mode: 'text',
|
|
15416
16949
|
onClick: clearCheckedPanelEvent
|
|
15417
|
-
}) : renderEmptyElement($xeCascader)])])]) : renderEmptyElement($xeCascader), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16950
|
+
}) : renderEmptyElement($xeCascader)]) : renderEmptyElement($xeCascader)])]) : renderEmptyElement($xeCascader), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15418
16951
|
class: 'vxe-cascader--panel-body'
|
|
15419
16952
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15420
|
-
ref:
|
|
15421
|
-
class: 'vxe-cascader-
|
|
15422
|
-
|
|
15423
|
-
|
|
16953
|
+
ref: refChunkWrapper,
|
|
16954
|
+
class: 'vxe-cascader-chunk--wrapper'
|
|
16955
|
+
}, [currentCunkList.map((chunks, chunkIndex) => {
|
|
16956
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16957
|
+
key: chunkIndex,
|
|
16958
|
+
class: 'vxe-cascader-chunk--item-wrapper'
|
|
16959
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(list, {
|
|
16960
|
+
data: chunks
|
|
16961
|
+
}, {
|
|
16962
|
+
default(slotParams) {
|
|
16963
|
+
const {
|
|
16964
|
+
items
|
|
16965
|
+
} = slotParams;
|
|
16966
|
+
return items.map((node, nodeIndex) => {
|
|
16967
|
+
const nodeid = getNodeId(node);
|
|
16968
|
+
return renderNode(node, nodeid, nodeIndex, chunks, chunkIndex);
|
|
16969
|
+
});
|
|
16970
|
+
}
|
|
16971
|
+
})]);
|
|
16972
|
+
})])]), footerSlot || showTotalButton || showCloseButton && multiple ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15424
16973
|
class: 'vxe-cascader--panel-footer'
|
|
15425
|
-
}, footerSlot({})
|
|
16974
|
+
}, footerSlot ? footerSlot({}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16975
|
+
class: 'vxe-cascader--footer-button'
|
|
16976
|
+
}, [showTotalButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16977
|
+
class: 'vxe-cascader--total-btns'
|
|
16978
|
+
}, getI18n('vxe.treeSelect.total', [selectVals.length])) : renderEmptyElement($xeCascader), showCloseButton && multiple ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16979
|
+
class: 'vxe-cascader--oper-btns'
|
|
16980
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
16981
|
+
content: getI18n('vxe.select.close'),
|
|
16982
|
+
mode: 'text',
|
|
16983
|
+
onClick: closePanelEvent
|
|
16984
|
+
})]) : renderEmptyElement($xeCascader)])]) : renderEmptyElement($xeCascader)])] : [])])]);
|
|
15426
16985
|
};
|
|
16986
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
|
|
16987
|
+
if (!reactData.visiblePanel) {
|
|
16988
|
+
handleCurrentItems();
|
|
16989
|
+
updateCurrentChunk();
|
|
16990
|
+
}
|
|
16991
|
+
});
|
|
15427
16992
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.options, () => {
|
|
15428
|
-
|
|
16993
|
+
cacheNodeMap();
|
|
15429
16994
|
});
|
|
15430
|
-
|
|
16995
|
+
const dataFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
16996
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.options ? props.options.length : 0, () => {
|
|
16997
|
+
dataFlag.value++;
|
|
16998
|
+
});
|
|
16999
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.options, () => {
|
|
17000
|
+
dataFlag.value++;
|
|
17001
|
+
});
|
|
17002
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag, () => {
|
|
17003
|
+
loadData(props.options || []);
|
|
17004
|
+
});
|
|
17005
|
+
loadData(props.options || []);
|
|
15431
17006
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
17007
|
+
if (props.filterable) {
|
|
17008
|
+
errLog('vxe.error.notProp', ['filterable']);
|
|
17009
|
+
}
|
|
15432
17010
|
globalEvents.on($xeCascader, 'mousewheel', handleGlobalMousewheelEvent);
|
|
15433
17011
|
globalEvents.on($xeCascader, 'mousedown', handleGlobalMousedownEvent);
|
|
15434
17012
|
globalEvents.on($xeCascader, 'blur', handleGlobalBlurEvent);
|
|
@@ -16899,7 +18477,7 @@ function hexToRgb(str) {
|
|
|
16899
18477
|
// float
|
|
16900
18478
|
roundingMode: {
|
|
16901
18479
|
type: String,
|
|
16902
|
-
default:
|
|
18480
|
+
default: () => getConfig().numberInput.roundingMode
|
|
16903
18481
|
},
|
|
16904
18482
|
// float
|
|
16905
18483
|
digits: {
|
|
@@ -17176,6 +18754,7 @@ function hexToRgb(str) {
|
|
|
17176
18754
|
};
|
|
17177
18755
|
const getNumberValue = val => {
|
|
17178
18756
|
const {
|
|
18757
|
+
type,
|
|
17179
18758
|
exponential,
|
|
17180
18759
|
roundingMode,
|
|
17181
18760
|
autoFill
|
|
@@ -17185,7 +18764,7 @@ function hexToRgb(str) {
|
|
|
17185
18764
|
const decimalsType = computeDecimalsType.value;
|
|
17186
18765
|
let restVal = '';
|
|
17187
18766
|
if (decimalsType) {
|
|
17188
|
-
restVal = toFloatValueFixed(val, digitsValue, roundingMode);
|
|
18767
|
+
restVal = toFloatValueFixed(val, type, digitsValue, roundingMode);
|
|
17189
18768
|
if (!autoFill) {
|
|
17190
18769
|
restVal = handleNumberString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(restVal));
|
|
17191
18770
|
}
|
|
@@ -17302,6 +18881,7 @@ function hexToRgb(str) {
|
|
|
17302
18881
|
};
|
|
17303
18882
|
const updateModel = val => {
|
|
17304
18883
|
const {
|
|
18884
|
+
type,
|
|
17305
18885
|
roundingMode,
|
|
17306
18886
|
autoFill
|
|
17307
18887
|
} = props;
|
|
@@ -17315,7 +18895,7 @@ function hexToRgb(str) {
|
|
|
17315
18895
|
} else {
|
|
17316
18896
|
let textValue = '' + val;
|
|
17317
18897
|
if (decimalsType) {
|
|
17318
|
-
textValue = toFloatValueFixed(val, digitsValue, roundingMode);
|
|
18898
|
+
textValue = toFloatValueFixed(val, type, digitsValue, roundingMode);
|
|
17319
18899
|
if (!autoFill) {
|
|
17320
18900
|
textValue = '' + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(textValue);
|
|
17321
18901
|
}
|
|
@@ -17330,6 +18910,7 @@ function hexToRgb(str) {
|
|
|
17330
18910
|
*/
|
|
17331
18911
|
const initValue = () => {
|
|
17332
18912
|
const {
|
|
18913
|
+
type,
|
|
17333
18914
|
roundingMode,
|
|
17334
18915
|
autoFill
|
|
17335
18916
|
} = props;
|
|
@@ -17343,7 +18924,7 @@ function hexToRgb(str) {
|
|
|
17343
18924
|
let textValue = '';
|
|
17344
18925
|
let validValue = null;
|
|
17345
18926
|
if (inputValue) {
|
|
17346
|
-
textValue = toFloatValueFixed(inputValue, digitsValue, roundingMode);
|
|
18927
|
+
textValue = toFloatValueFixed(inputValue, type, digitsValue, roundingMode);
|
|
17347
18928
|
validValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(textValue);
|
|
17348
18929
|
if (!autoFill) {
|
|
17349
18930
|
textValue = `${validValue}`;
|
|
@@ -30600,666 +32181,212 @@ const LayoutFooter = VxeLayoutFooter;
|
|
|
30600
32181
|
const computeMaps = {};
|
|
30601
32182
|
const $xeLayoutHeader = {
|
|
30602
32183
|
xID,
|
|
30603
|
-
props,
|
|
30604
|
-
context,
|
|
30605
|
-
reactData,
|
|
30606
|
-
getRefMaps: () => refMaps,
|
|
30607
|
-
getComputeMaps: () => computeMaps
|
|
30608
|
-
};
|
|
30609
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
30610
|
-
emit(type, createEvent(evnt, {
|
|
30611
|
-
$layoutHeader: $xeLayoutHeader
|
|
30612
|
-
}, params));
|
|
30613
|
-
};
|
|
30614
|
-
const layoutHeaderMethods = {
|
|
30615
|
-
dispatchEvent
|
|
30616
|
-
};
|
|
30617
|
-
const layoutHeaderPrivateMethods = {};
|
|
30618
|
-
Object.assign($xeLayoutHeader, layoutHeaderMethods, layoutHeaderPrivateMethods);
|
|
30619
|
-
const renderVN = () => {
|
|
30620
|
-
const {
|
|
30621
|
-
fixed
|
|
30622
|
-
} = props;
|
|
30623
|
-
const defaultSlot = slots.default;
|
|
30624
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('header', {
|
|
30625
|
-
ref: refElem,
|
|
30626
|
-
class: ['vxe-layout-header', {
|
|
30627
|
-
'is--fixed': fixed
|
|
30628
|
-
}]
|
|
30629
|
-
}, defaultSlot ? defaultSlot({}) : []);
|
|
30630
|
-
};
|
|
30631
|
-
$xeLayoutHeader.renderVN = renderVN;
|
|
30632
|
-
return $xeLayoutHeader;
|
|
30633
|
-
},
|
|
30634
|
-
render() {
|
|
30635
|
-
return this.renderVN();
|
|
30636
|
-
}
|
|
30637
|
-
}));
|
|
30638
|
-
;// ./packages/layout-header/index.ts
|
|
30639
|
-
|
|
30640
|
-
|
|
30641
|
-
|
|
30642
|
-
const VxeLayoutHeader = Object.assign({}, layout_header, {
|
|
30643
|
-
install(app) {
|
|
30644
|
-
app.component(layout_header.name, layout_header);
|
|
30645
|
-
}
|
|
30646
|
-
});
|
|
30647
|
-
dynamicApp.use(VxeLayoutHeader);
|
|
30648
|
-
VxeUI.component(layout_header);
|
|
30649
|
-
const LayoutHeader = VxeLayoutHeader;
|
|
30650
|
-
/* harmony default export */ var packages_layout_header = (VxeLayoutHeader);
|
|
30651
|
-
;// ./packages/link/src/link.ts
|
|
30652
|
-
|
|
30653
|
-
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
/* harmony default export */ var src_link = (defineVxeComponent({
|
|
30658
|
-
name: 'VxeLink',
|
|
30659
|
-
props: {
|
|
30660
|
-
href: String,
|
|
30661
|
-
target: String,
|
|
30662
|
-
status: String,
|
|
30663
|
-
title: [String, Number],
|
|
30664
|
-
disabled: Boolean,
|
|
30665
|
-
icon: String,
|
|
30666
|
-
routerLink: Object,
|
|
30667
|
-
underline: {
|
|
30668
|
-
type: Boolean,
|
|
30669
|
-
default: () => getConfig().link.underline
|
|
30670
|
-
},
|
|
30671
|
-
/**
|
|
30672
|
-
* 权限码
|
|
30673
|
-
*/
|
|
30674
|
-
permissionCode: [String, Number],
|
|
30675
|
-
content: [String, Number],
|
|
30676
|
-
size: {
|
|
30677
|
-
type: String,
|
|
30678
|
-
default: () => getConfig().link.size || getConfig().size
|
|
30679
|
-
}
|
|
30680
|
-
},
|
|
30681
|
-
emits: ['click'],
|
|
30682
|
-
setup(props, context) {
|
|
30683
|
-
const {
|
|
30684
|
-
slots,
|
|
30685
|
-
emit
|
|
30686
|
-
} = context;
|
|
30687
|
-
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
30688
|
-
const {
|
|
30689
|
-
computeSize
|
|
30690
|
-
} = useSize(props);
|
|
30691
|
-
const {
|
|
30692
|
-
computePermissionInfo
|
|
30693
|
-
} = usePermission(props);
|
|
30694
|
-
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
30695
|
-
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
|
|
30696
|
-
const refMaps = {
|
|
30697
|
-
refElem
|
|
30698
|
-
};
|
|
30699
|
-
const computeMaps = {};
|
|
30700
|
-
const $xeLink = {
|
|
30701
|
-
xID,
|
|
30702
|
-
props,
|
|
30703
|
-
context,
|
|
30704
|
-
reactData,
|
|
30705
|
-
getRefMaps: () => refMaps,
|
|
30706
|
-
getComputeMaps: () => computeMaps
|
|
30707
|
-
};
|
|
30708
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
30709
|
-
emit(type, createEvent(evnt, {
|
|
30710
|
-
$link: $xeLink
|
|
30711
|
-
}, params));
|
|
30712
|
-
};
|
|
30713
|
-
const linkMethods = {
|
|
30714
|
-
dispatchEvent
|
|
30715
|
-
};
|
|
30716
|
-
const linkPrivateMethods = {};
|
|
30717
|
-
const clickEvent = evnt => {
|
|
30718
|
-
const {
|
|
30719
|
-
disabled
|
|
30720
|
-
} = props;
|
|
30721
|
-
if (!disabled) {
|
|
30722
|
-
dispatchEvent('click', {}, evnt);
|
|
30723
|
-
}
|
|
30724
|
-
};
|
|
30725
|
-
Object.assign($xeLink, linkMethods, linkPrivateMethods);
|
|
30726
|
-
const renderContent = () => {
|
|
30727
|
-
const {
|
|
30728
|
-
icon,
|
|
30729
|
-
content
|
|
30730
|
-
} = props;
|
|
30731
|
-
const defaultSlot = slots.default;
|
|
30732
|
-
const iconSlot = slots.icon;
|
|
30733
|
-
const textContent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(content);
|
|
30734
|
-
return [iconSlot || icon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
30735
|
-
class: 'vxe-link--icon'
|
|
30736
|
-
}, iconSlot ? vn_getSlotVNs(iconSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
30737
|
-
class: icon
|
|
30738
|
-
})]) : renderEmptyElement($xeLink), defaultSlot || textContent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
30739
|
-
class: 'vxe-link--content'
|
|
30740
|
-
}, defaultSlot ? defaultSlot({}) : textContent) : renderEmptyElement($xeLink)];
|
|
30741
|
-
};
|
|
30742
|
-
const renderVN = () => {
|
|
30743
|
-
const {
|
|
30744
|
-
status,
|
|
30745
|
-
target,
|
|
30746
|
-
href,
|
|
30747
|
-
title,
|
|
30748
|
-
underline,
|
|
30749
|
-
disabled,
|
|
30750
|
-
routerLink
|
|
30751
|
-
} = props;
|
|
30752
|
-
const permissionInfo = computePermissionInfo.value;
|
|
30753
|
-
const vSize = computeSize.value;
|
|
30754
|
-
if (!permissionInfo.visible) {
|
|
30755
|
-
return renderEmptyElement($xeLink);
|
|
30756
|
-
}
|
|
30757
|
-
if (routerLink && !disabled) {
|
|
30758
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
|
|
30759
|
-
class: ['vxe-link', {
|
|
30760
|
-
[`size--${vSize}`]: vSize,
|
|
30761
|
-
[`theme--${status}`]: status,
|
|
30762
|
-
'is--disabled': disabled,
|
|
30763
|
-
'is--underline': underline
|
|
30764
|
-
}],
|
|
30765
|
-
title,
|
|
30766
|
-
target,
|
|
30767
|
-
to: disabled ? null : routerLink,
|
|
30768
|
-
onClick: clickEvent
|
|
30769
|
-
}, {
|
|
30770
|
-
default() {
|
|
30771
|
-
return renderContent();
|
|
30772
|
-
}
|
|
30773
|
-
});
|
|
30774
|
-
}
|
|
30775
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('a', {
|
|
30776
|
-
ref: refElem,
|
|
30777
|
-
class: ['vxe-link', {
|
|
30778
|
-
[`size--${vSize}`]: vSize,
|
|
30779
|
-
[`theme--${status}`]: status,
|
|
30780
|
-
'is--disabled': disabled,
|
|
30781
|
-
'is--underline': underline
|
|
30782
|
-
}],
|
|
30783
|
-
href: disabled ? null : href,
|
|
30784
|
-
target,
|
|
30785
|
-
title,
|
|
30786
|
-
onClick: clickEvent
|
|
30787
|
-
}, renderContent());
|
|
30788
|
-
};
|
|
30789
|
-
$xeLink.renderVN = renderVN;
|
|
30790
|
-
return $xeLink;
|
|
30791
|
-
},
|
|
30792
|
-
render() {
|
|
30793
|
-
return this.renderVN();
|
|
30794
|
-
}
|
|
30795
|
-
}));
|
|
30796
|
-
;// ./packages/link/index.ts
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
const VxeLink = Object.assign({}, src_link, {
|
|
30801
|
-
install(app) {
|
|
30802
|
-
app.component(src_link.name, src_link);
|
|
30803
|
-
}
|
|
30804
|
-
});
|
|
30805
|
-
dynamicApp.use(VxeLink);
|
|
30806
|
-
VxeUI.component(src_link);
|
|
30807
|
-
const Link = VxeLink;
|
|
30808
|
-
/* harmony default export */ var packages_link = (VxeLink);
|
|
30809
|
-
;// ./packages/list/src/list.ts
|
|
30810
|
-
|
|
30811
|
-
|
|
30812
|
-
|
|
30813
|
-
|
|
30814
|
-
|
|
30815
|
-
|
|
30816
|
-
function list_createReactData() {
|
|
30817
|
-
return {
|
|
30818
|
-
scrollYLoad: false,
|
|
30819
|
-
bodyHeight: 0,
|
|
30820
|
-
customHeight: 0,
|
|
30821
|
-
customMaxHeight: 0,
|
|
30822
|
-
parentHeight: 0,
|
|
30823
|
-
topSpaceHeight: 0,
|
|
30824
|
-
items: []
|
|
30825
|
-
};
|
|
30826
|
-
}
|
|
30827
|
-
function list_createInternalData() {
|
|
30828
|
-
return {
|
|
30829
|
-
resizeObserver: undefined,
|
|
30830
|
-
fullData: [],
|
|
30831
|
-
lastScrollLeft: 0,
|
|
30832
|
-
lastScrollTop: 0,
|
|
30833
|
-
scrollYStore: {
|
|
30834
|
-
startIndex: 0,
|
|
30835
|
-
endIndex: 0,
|
|
30836
|
-
visibleSize: 0,
|
|
30837
|
-
offsetSize: 0,
|
|
30838
|
-
rowHeight: 0
|
|
30839
|
-
}
|
|
30840
|
-
};
|
|
30841
|
-
}
|
|
30842
|
-
/* harmony default export */ var list = (defineVxeComponent({
|
|
30843
|
-
name: 'VxeList',
|
|
30844
|
-
props: {
|
|
30845
|
-
data: Array,
|
|
30846
|
-
height: [Number, String],
|
|
30847
|
-
maxHeight: [Number, String],
|
|
30848
|
-
loading: Boolean,
|
|
30849
|
-
className: [String, Function],
|
|
30850
|
-
size: {
|
|
30851
|
-
type: String,
|
|
30852
|
-
default: () => getConfig().list.size || getConfig().size
|
|
30853
|
-
},
|
|
30854
|
-
autoResize: {
|
|
30855
|
-
type: Boolean,
|
|
30856
|
-
default: () => getConfig().list.autoResize
|
|
30857
|
-
},
|
|
30858
|
-
syncResize: [Boolean, String, Number],
|
|
30859
|
-
virtualYConfig: Object,
|
|
30860
|
-
scrollY: Object
|
|
30861
|
-
},
|
|
30862
|
-
emits: ['scroll'],
|
|
30863
|
-
setup(props, context) {
|
|
30864
|
-
const {
|
|
30865
|
-
slots,
|
|
30866
|
-
emit
|
|
30867
|
-
} = context;
|
|
30868
|
-
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
30869
|
-
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
30870
|
-
const {
|
|
30871
|
-
computeSize
|
|
30872
|
-
} = useSize(props);
|
|
30873
|
-
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(list_createReactData());
|
|
30874
|
-
const internalData = list_createInternalData();
|
|
30875
|
-
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
30876
|
-
const refVirtualWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
30877
|
-
const refVirtualBody = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
30878
|
-
const refMaps = {
|
|
30879
|
-
refElem
|
|
30880
|
-
};
|
|
30881
|
-
const $xeList = {
|
|
30882
|
-
xID,
|
|
30883
|
-
props,
|
|
30884
|
-
context,
|
|
30885
|
-
reactData,
|
|
30886
|
-
internalData,
|
|
30887
|
-
getRefMaps: () => refMaps
|
|
30888
|
-
};
|
|
30889
|
-
const computeSYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30890
|
-
return Object.assign({}, getConfig().list.virtualYConfig || getConfig().list.scrollY, props.virtualYConfig || props.scrollY);
|
|
30891
|
-
});
|
|
30892
|
-
const computeStyles = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
30893
|
-
const {
|
|
30894
|
-
height,
|
|
30895
|
-
maxHeight
|
|
30896
|
-
} = props;
|
|
30897
|
-
const {
|
|
30898
|
-
customHeight,
|
|
30899
|
-
customMaxHeight
|
|
30900
|
-
} = reactData;
|
|
30901
|
-
const style = {};
|
|
30902
|
-
if (height) {
|
|
30903
|
-
style.height = `${customHeight}px`;
|
|
30904
|
-
} else if (maxHeight) {
|
|
30905
|
-
style.height = 'auto';
|
|
30906
|
-
style.maxHeight = `${customMaxHeight}px`;
|
|
30907
|
-
}
|
|
30908
|
-
return style;
|
|
30909
|
-
});
|
|
30910
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
30911
|
-
emit(type, createEvent(evnt, {
|
|
30912
|
-
$list: $xeList
|
|
30913
|
-
}, params));
|
|
30914
|
-
};
|
|
30915
|
-
const calcTableHeight = key => {
|
|
30916
|
-
const {
|
|
30917
|
-
parentHeight
|
|
30918
|
-
} = reactData;
|
|
30919
|
-
const val = props[key];
|
|
30920
|
-
let num = 0;
|
|
30921
|
-
if (val) {
|
|
30922
|
-
if (val === '100%' || val === 'auto') {
|
|
30923
|
-
num = parentHeight;
|
|
30924
|
-
} else {
|
|
30925
|
-
if (isScale(val)) {
|
|
30926
|
-
num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(val) || 1) / 100 * parentHeight);
|
|
30927
|
-
} else {
|
|
30928
|
-
num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val);
|
|
30929
|
-
}
|
|
30930
|
-
num = Math.max(40, num);
|
|
30931
|
-
}
|
|
30932
|
-
}
|
|
30933
|
-
return num;
|
|
30934
|
-
};
|
|
30935
|
-
const updateHeight = () => {
|
|
30936
|
-
reactData.customHeight = calcTableHeight('height');
|
|
30937
|
-
reactData.customMaxHeight = calcTableHeight('maxHeight');
|
|
30938
|
-
};
|
|
30939
|
-
const updateYSpace = () => {
|
|
30940
|
-
const {
|
|
30941
|
-
scrollYLoad
|
|
30942
|
-
} = reactData;
|
|
30943
|
-
const {
|
|
30944
|
-
scrollYStore,
|
|
30945
|
-
fullData
|
|
30946
|
-
} = internalData;
|
|
30947
|
-
reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
|
|
30948
|
-
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
|
|
30949
|
-
};
|
|
30950
|
-
const handleData = () => {
|
|
30951
|
-
const {
|
|
30952
|
-
scrollYLoad
|
|
30953
|
-
} = reactData;
|
|
30954
|
-
const {
|
|
30955
|
-
fullData,
|
|
30956
|
-
scrollYStore
|
|
30957
|
-
} = internalData;
|
|
30958
|
-
reactData.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
|
|
30959
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
30960
|
-
};
|
|
30961
|
-
const updateYData = () => {
|
|
30962
|
-
handleData();
|
|
30963
|
-
updateYSpace();
|
|
30964
|
-
};
|
|
30965
|
-
const computeScrollLoad = () => {
|
|
30966
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
30967
|
-
const {
|
|
30968
|
-
scrollYLoad
|
|
30969
|
-
} = reactData;
|
|
30970
|
-
const {
|
|
30971
|
-
scrollYStore
|
|
30972
|
-
} = internalData;
|
|
30973
|
-
const virtualBodyElem = refVirtualBody.value;
|
|
30974
|
-
const sYOpts = computeSYOpts.value;
|
|
30975
|
-
let rowHeight = 0;
|
|
30976
|
-
let firstItemElem;
|
|
30977
|
-
if (virtualBodyElem) {
|
|
30978
|
-
if (sYOpts.sItem) {
|
|
30979
|
-
firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem);
|
|
30980
|
-
}
|
|
30981
|
-
if (!firstItemElem) {
|
|
30982
|
-
firstItemElem = virtualBodyElem.children[0];
|
|
30983
|
-
}
|
|
30984
|
-
}
|
|
30985
|
-
if (firstItemElem) {
|
|
30986
|
-
rowHeight = firstItemElem.offsetHeight;
|
|
30987
|
-
}
|
|
30988
|
-
rowHeight = Math.max(12, rowHeight);
|
|
30989
|
-
scrollYStore.rowHeight = rowHeight;
|
|
30990
|
-
// 计算 Y 逻辑
|
|
30991
|
-
if (scrollYLoad) {
|
|
30992
|
-
const scrollBodyElem = refVirtualWrapper.value;
|
|
30993
|
-
const visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight));
|
|
30994
|
-
const offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sYOpts.oSize) : browseObj.edge ? 10 : 0;
|
|
30995
|
-
scrollYStore.offsetSize = offsetYSize;
|
|
30996
|
-
scrollYStore.visibleSize = visibleYSize;
|
|
30997
|
-
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
30998
|
-
updateYData();
|
|
30999
|
-
} else {
|
|
31000
|
-
updateYSpace();
|
|
31001
|
-
}
|
|
31002
|
-
});
|
|
32184
|
+
props,
|
|
32185
|
+
context,
|
|
32186
|
+
reactData,
|
|
32187
|
+
getRefMaps: () => refMaps,
|
|
32188
|
+
getComputeMaps: () => computeMaps
|
|
31003
32189
|
};
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
const scrollBodyElem = refVirtualWrapper.value;
|
|
31009
|
-
if (scrollBodyElem) {
|
|
31010
|
-
scrollBodyElem.scrollTop = 0;
|
|
31011
|
-
}
|
|
31012
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
32190
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
32191
|
+
emit(type, createEvent(evnt, {
|
|
32192
|
+
$layoutHeader: $xeLayoutHeader
|
|
32193
|
+
}, params));
|
|
31013
32194
|
};
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
*/
|
|
31017
|
-
const scrollTo = (scrollLeft, scrollTop) => {
|
|
31018
|
-
const scrollBodyElem = refVirtualWrapper.value;
|
|
31019
|
-
if (scrollLeft) {
|
|
31020
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
31021
|
-
scrollTop = scrollLeft.top;
|
|
31022
|
-
scrollLeft = scrollLeft.left;
|
|
31023
|
-
}
|
|
31024
|
-
}
|
|
31025
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
31026
|
-
scrollBodyElem.scrollLeft = scrollLeft;
|
|
31027
|
-
}
|
|
31028
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
|
|
31029
|
-
scrollBodyElem.scrollTop = scrollTop;
|
|
31030
|
-
}
|
|
31031
|
-
if (reactData.scrollYLoad) {
|
|
31032
|
-
return new Promise(resolve => {
|
|
31033
|
-
setTimeout(() => {
|
|
31034
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
31035
|
-
resolve();
|
|
31036
|
-
});
|
|
31037
|
-
}, 50);
|
|
31038
|
-
});
|
|
31039
|
-
}
|
|
31040
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
32195
|
+
const layoutHeaderMethods = {
|
|
32196
|
+
dispatchEvent
|
|
31041
32197
|
};
|
|
31042
|
-
|
|
31043
|
-
|
|
31044
|
-
|
|
31045
|
-
const refreshScroll = () => {
|
|
32198
|
+
const layoutHeaderPrivateMethods = {};
|
|
32199
|
+
Object.assign($xeLayoutHeader, layoutHeaderMethods, layoutHeaderPrivateMethods);
|
|
32200
|
+
const renderVN = () => {
|
|
31046
32201
|
const {
|
|
31047
|
-
|
|
31048
|
-
|
|
31049
|
-
|
|
31050
|
-
return
|
|
31051
|
-
|
|
31052
|
-
|
|
31053
|
-
|
|
31054
|
-
|
|
31055
|
-
|
|
31056
|
-
});
|
|
32202
|
+
fixed
|
|
32203
|
+
} = props;
|
|
32204
|
+
const defaultSlot = slots.default;
|
|
32205
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('header', {
|
|
32206
|
+
ref: refElem,
|
|
32207
|
+
class: ['vxe-layout-header', {
|
|
32208
|
+
'is--fixed': fixed
|
|
32209
|
+
}]
|
|
32210
|
+
}, defaultSlot ? defaultSlot({}) : []);
|
|
31057
32211
|
};
|
|
32212
|
+
$xeLayoutHeader.renderVN = renderVN;
|
|
32213
|
+
return $xeLayoutHeader;
|
|
32214
|
+
},
|
|
32215
|
+
render() {
|
|
32216
|
+
return this.renderVN();
|
|
32217
|
+
}
|
|
32218
|
+
}));
|
|
32219
|
+
;// ./packages/layout-header/index.ts
|
|
32220
|
+
|
|
32221
|
+
|
|
32222
|
+
|
|
32223
|
+
const VxeLayoutHeader = Object.assign({}, layout_header, {
|
|
32224
|
+
install(app) {
|
|
32225
|
+
app.component(layout_header.name, layout_header);
|
|
32226
|
+
}
|
|
32227
|
+
});
|
|
32228
|
+
dynamicApp.use(VxeLayoutHeader);
|
|
32229
|
+
VxeUI.component(layout_header);
|
|
32230
|
+
const LayoutHeader = VxeLayoutHeader;
|
|
32231
|
+
/* harmony default export */ var packages_layout_header = (VxeLayoutHeader);
|
|
32232
|
+
;// ./packages/link/src/link.ts
|
|
32233
|
+
|
|
32234
|
+
|
|
32235
|
+
|
|
32236
|
+
|
|
32237
|
+
|
|
32238
|
+
/* harmony default export */ var src_link = (defineVxeComponent({
|
|
32239
|
+
name: 'VxeLink',
|
|
32240
|
+
props: {
|
|
32241
|
+
href: String,
|
|
32242
|
+
target: String,
|
|
32243
|
+
status: String,
|
|
32244
|
+
title: [String, Number],
|
|
32245
|
+
disabled: Boolean,
|
|
32246
|
+
icon: String,
|
|
32247
|
+
routerLink: Object,
|
|
32248
|
+
underline: {
|
|
32249
|
+
type: Boolean,
|
|
32250
|
+
default: () => getConfig().link.underline
|
|
32251
|
+
},
|
|
31058
32252
|
/**
|
|
31059
|
-
*
|
|
32253
|
+
* 权限码
|
|
31060
32254
|
*/
|
|
31061
|
-
|
|
31062
|
-
|
|
31063
|
-
|
|
31064
|
-
|
|
31065
|
-
|
|
31066
|
-
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
32255
|
+
permissionCode: [String, Number],
|
|
32256
|
+
content: [String, Number],
|
|
32257
|
+
size: {
|
|
32258
|
+
type: String,
|
|
32259
|
+
default: () => getConfig().link.size || getConfig().size
|
|
32260
|
+
}
|
|
32261
|
+
},
|
|
32262
|
+
emits: ['click'],
|
|
32263
|
+
setup(props, context) {
|
|
32264
|
+
const {
|
|
32265
|
+
slots,
|
|
32266
|
+
emit
|
|
32267
|
+
} = context;
|
|
32268
|
+
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
32269
|
+
const {
|
|
32270
|
+
computeSize
|
|
32271
|
+
} = useSize(props);
|
|
32272
|
+
const {
|
|
32273
|
+
computePermissionInfo
|
|
32274
|
+
} = usePermission(props);
|
|
32275
|
+
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
32276
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({});
|
|
32277
|
+
const refMaps = {
|
|
32278
|
+
refElem
|
|
31072
32279
|
};
|
|
31073
|
-
const
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
offsetSize,
|
|
31082
|
-
rowHeight
|
|
31083
|
-
} = scrollYStore;
|
|
31084
|
-
const scrollBodyElem = evnt.target;
|
|
31085
|
-
const scrollTop = scrollBodyElem.scrollTop;
|
|
31086
|
-
const toVisibleIndex = Math.floor(scrollTop / rowHeight);
|
|
31087
|
-
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
|
|
31088
|
-
const offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
|
|
31089
|
-
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
31090
|
-
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
31091
|
-
scrollYStore.startIndex = offsetStartIndex;
|
|
31092
|
-
scrollYStore.endIndex = offsetEndIndex;
|
|
31093
|
-
updateYData();
|
|
31094
|
-
}
|
|
31095
|
-
}
|
|
32280
|
+
const computeMaps = {};
|
|
32281
|
+
const $xeLink = {
|
|
32282
|
+
xID,
|
|
32283
|
+
props,
|
|
32284
|
+
context,
|
|
32285
|
+
reactData,
|
|
32286
|
+
getRefMaps: () => refMaps,
|
|
32287
|
+
getComputeMaps: () => computeMaps
|
|
31096
32288
|
};
|
|
31097
|
-
const
|
|
31098
|
-
|
|
31099
|
-
|
|
31100
|
-
|
|
31101
|
-
const isX = scrollLeft !== internalData.lastScrollLeft;
|
|
31102
|
-
const isY = scrollTop !== internalData.lastScrollTop;
|
|
31103
|
-
internalData.lastScrollTop = scrollTop;
|
|
31104
|
-
internalData.lastScrollLeft = scrollLeft;
|
|
31105
|
-
if (reactData.scrollYLoad) {
|
|
31106
|
-
loadYData(evnt);
|
|
31107
|
-
}
|
|
31108
|
-
dispatchEvent('scroll', {
|
|
31109
|
-
scrollLeft,
|
|
31110
|
-
scrollTop,
|
|
31111
|
-
isX,
|
|
31112
|
-
isY
|
|
31113
|
-
}, evnt);
|
|
32289
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
32290
|
+
emit(type, createEvent(evnt, {
|
|
32291
|
+
$link: $xeLink
|
|
32292
|
+
}, params));
|
|
31114
32293
|
};
|
|
31115
|
-
|
|
31116
|
-
|
|
31117
|
-
|
|
31118
|
-
|
|
31119
|
-
const
|
|
32294
|
+
const linkMethods = {
|
|
32295
|
+
dispatchEvent
|
|
32296
|
+
};
|
|
32297
|
+
const linkPrivateMethods = {};
|
|
32298
|
+
const clickEvent = evnt => {
|
|
31120
32299
|
const {
|
|
31121
|
-
|
|
31122
|
-
} =
|
|
31123
|
-
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
startIndex: 0,
|
|
31127
|
-
endIndex: 1,
|
|
31128
|
-
visibleSize: 0
|
|
31129
|
-
});
|
|
31130
|
-
internalData.fullData = fullData;
|
|
31131
|
-
// 如果gt为0,则总是启用
|
|
31132
|
-
reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length);
|
|
31133
|
-
handleData();
|
|
31134
|
-
return computeScrollLoad().then(() => {
|
|
31135
|
-
refreshScroll();
|
|
31136
|
-
});
|
|
32300
|
+
disabled
|
|
32301
|
+
} = props;
|
|
32302
|
+
if (!disabled) {
|
|
32303
|
+
dispatchEvent('click', {}, evnt);
|
|
32304
|
+
}
|
|
31137
32305
|
};
|
|
31138
|
-
|
|
31139
|
-
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
32306
|
+
Object.assign($xeLink, linkMethods, linkPrivateMethods);
|
|
32307
|
+
const renderContent = () => {
|
|
32308
|
+
const {
|
|
32309
|
+
icon,
|
|
32310
|
+
content
|
|
32311
|
+
} = props;
|
|
32312
|
+
const defaultSlot = slots.default;
|
|
32313
|
+
const iconSlot = slots.icon;
|
|
32314
|
+
const textContent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(content);
|
|
32315
|
+
return [iconSlot || icon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
32316
|
+
class: 'vxe-link--icon'
|
|
32317
|
+
}, iconSlot ? vn_getSlotVNs(iconSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
32318
|
+
class: icon
|
|
32319
|
+
})]) : renderEmptyElement($xeLink), defaultSlot || textContent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
32320
|
+
class: 'vxe-link--content'
|
|
32321
|
+
}, defaultSlot ? defaultSlot({}) : textContent) : renderEmptyElement($xeLink)];
|
|
31153
32322
|
};
|
|
31154
|
-
Object.assign($xeList, listMethods);
|
|
31155
32323
|
const renderVN = () => {
|
|
31156
32324
|
const {
|
|
31157
|
-
|
|
31158
|
-
|
|
32325
|
+
status,
|
|
32326
|
+
target,
|
|
32327
|
+
href,
|
|
32328
|
+
title,
|
|
32329
|
+
underline,
|
|
32330
|
+
disabled,
|
|
32331
|
+
routerLink
|
|
31159
32332
|
} = props;
|
|
31160
|
-
const
|
|
31161
|
-
bodyHeight,
|
|
31162
|
-
topSpaceHeight,
|
|
31163
|
-
items
|
|
31164
|
-
} = reactData;
|
|
31165
|
-
const defaultSlot = slots.default;
|
|
32333
|
+
const permissionInfo = computePermissionInfo.value;
|
|
31166
32334
|
const vSize = computeSize.value;
|
|
31167
|
-
|
|
31168
|
-
|
|
32335
|
+
if (!permissionInfo.visible) {
|
|
32336
|
+
return renderEmptyElement($xeLink);
|
|
32337
|
+
}
|
|
32338
|
+
if (routerLink && !disabled) {
|
|
32339
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('router-link'), {
|
|
32340
|
+
class: ['vxe-link', {
|
|
32341
|
+
[`size--${vSize}`]: vSize,
|
|
32342
|
+
[`theme--${status}`]: status,
|
|
32343
|
+
'is--disabled': disabled,
|
|
32344
|
+
'is--underline': underline
|
|
32345
|
+
}],
|
|
32346
|
+
title,
|
|
32347
|
+
target,
|
|
32348
|
+
to: disabled ? null : routerLink,
|
|
32349
|
+
onClick: clickEvent
|
|
32350
|
+
}, {
|
|
32351
|
+
default() {
|
|
32352
|
+
return renderContent();
|
|
32353
|
+
}
|
|
32354
|
+
});
|
|
32355
|
+
}
|
|
32356
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('a', {
|
|
31169
32357
|
ref: refElem,
|
|
31170
|
-
class: ['vxe-
|
|
31171
|
-
$list: $xeList
|
|
31172
|
-
}) : className : '', {
|
|
32358
|
+
class: ['vxe-link', {
|
|
31173
32359
|
[`size--${vSize}`]: vSize,
|
|
31174
|
-
|
|
31175
|
-
|
|
31176
|
-
|
|
31177
|
-
|
|
31178
|
-
|
|
31179
|
-
|
|
31180
|
-
|
|
31181
|
-
|
|
31182
|
-
|
|
31183
|
-
style: {
|
|
31184
|
-
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
31185
|
-
}
|
|
31186
|
-
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
31187
|
-
ref: refVirtualBody,
|
|
31188
|
-
class: 'vxe-list--body',
|
|
31189
|
-
style: {
|
|
31190
|
-
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
31191
|
-
}
|
|
31192
|
-
}, defaultSlot ? defaultSlot({
|
|
31193
|
-
items,
|
|
31194
|
-
$list: $xeList
|
|
31195
|
-
}) : [])]),
|
|
31196
|
-
/**
|
|
31197
|
-
* 加载中
|
|
31198
|
-
*/
|
|
31199
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_loading, {
|
|
31200
|
-
class: 'vxe-list--loading',
|
|
31201
|
-
modelValue: loading
|
|
31202
|
-
})]);
|
|
32360
|
+
[`theme--${status}`]: status,
|
|
32361
|
+
'is--disabled': disabled,
|
|
32362
|
+
'is--underline': underline
|
|
32363
|
+
}],
|
|
32364
|
+
href: disabled ? null : href,
|
|
32365
|
+
target,
|
|
32366
|
+
title,
|
|
32367
|
+
onClick: clickEvent
|
|
32368
|
+
}, renderContent());
|
|
31203
32369
|
};
|
|
31204
|
-
|
|
31205
|
-
|
|
31206
|
-
dataFlag.value++;
|
|
31207
|
-
});
|
|
31208
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.data, () => {
|
|
31209
|
-
dataFlag.value++;
|
|
31210
|
-
});
|
|
31211
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag, () => {
|
|
31212
|
-
loadData(props.data || []);
|
|
31213
|
-
});
|
|
31214
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.height, () => {
|
|
31215
|
-
recalculate();
|
|
31216
|
-
});
|
|
31217
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.maxHeight, () => {
|
|
31218
|
-
recalculate();
|
|
31219
|
-
});
|
|
31220
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
|
|
31221
|
-
if (value) {
|
|
31222
|
-
recalculate();
|
|
31223
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => setTimeout(() => recalculate()));
|
|
31224
|
-
}
|
|
31225
|
-
});
|
|
31226
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(() => {
|
|
31227
|
-
recalculate().then(() => refreshScroll());
|
|
31228
|
-
});
|
|
31229
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
31230
|
-
loadData(props.data || []);
|
|
31231
|
-
});
|
|
31232
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
31233
|
-
recalculate();
|
|
31234
|
-
if (props.autoResize) {
|
|
31235
|
-
const el = refElem.value;
|
|
31236
|
-
const resizeObserver = globalResize.create(() => recalculate());
|
|
31237
|
-
resizeObserver.observe(el);
|
|
31238
|
-
if (el) {
|
|
31239
|
-
resizeObserver.observe(el.parentElement);
|
|
31240
|
-
}
|
|
31241
|
-
internalData.resizeObserver = resizeObserver;
|
|
31242
|
-
}
|
|
31243
|
-
globalEvents.on($xeList, 'resize', recalculate);
|
|
31244
|
-
});
|
|
31245
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
31246
|
-
const {
|
|
31247
|
-
resizeObserver
|
|
31248
|
-
} = internalData;
|
|
31249
|
-
if (resizeObserver) {
|
|
31250
|
-
resizeObserver.disconnect();
|
|
31251
|
-
}
|
|
31252
|
-
globalEvents.off($xeList, 'resize');
|
|
31253
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, list_createReactData());
|
|
31254
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, list_createInternalData());
|
|
31255
|
-
});
|
|
31256
|
-
$xeList.renderVN = renderVN;
|
|
31257
|
-
return $xeList;
|
|
32370
|
+
$xeLink.renderVN = renderVN;
|
|
32371
|
+
return $xeLink;
|
|
31258
32372
|
},
|
|
31259
32373
|
render() {
|
|
31260
32374
|
return this.renderVN();
|
|
31261
32375
|
}
|
|
31262
32376
|
}));
|
|
32377
|
+
;// ./packages/link/index.ts
|
|
32378
|
+
|
|
32379
|
+
|
|
32380
|
+
|
|
32381
|
+
const VxeLink = Object.assign({}, src_link, {
|
|
32382
|
+
install(app) {
|
|
32383
|
+
app.component(src_link.name, src_link);
|
|
32384
|
+
}
|
|
32385
|
+
});
|
|
32386
|
+
dynamicApp.use(VxeLink);
|
|
32387
|
+
VxeUI.component(src_link);
|
|
32388
|
+
const Link = VxeLink;
|
|
32389
|
+
/* harmony default export */ var packages_link = (VxeLink);
|
|
31263
32390
|
;// ./packages/list/index.ts
|
|
31264
32391
|
|
|
31265
32392
|
|
|
@@ -33917,7 +35044,7 @@ const Option = VxeOption;
|
|
|
33917
35044
|
function isOptionVisible(option) {
|
|
33918
35045
|
return option.visible !== false;
|
|
33919
35046
|
}
|
|
33920
|
-
function
|
|
35047
|
+
function getOptUniqueId() {
|
|
33921
35048
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('opt_');
|
|
33922
35049
|
}
|
|
33923
35050
|
function select_createInternalData() {
|
|
@@ -34394,7 +35521,7 @@ function select_createInternalData() {
|
|
|
34394
35521
|
list.push(item);
|
|
34395
35522
|
let optid = getOptId(item);
|
|
34396
35523
|
if (!optid) {
|
|
34397
|
-
optid =
|
|
35524
|
+
optid = getOptUniqueId();
|
|
34398
35525
|
item[key] = optid;
|
|
34399
35526
|
}
|
|
34400
35527
|
fullKeyMaps[item[valueField]] = {
|
|
@@ -44437,6 +45564,59 @@ dynamicApp.use(VxeTour);
|
|
|
44437
45564
|
VxeUI.component(tour);
|
|
44438
45565
|
const Tour = VxeTour;
|
|
44439
45566
|
/* harmony default export */ var packages_tour = (VxeTour);
|
|
45567
|
+
;// ./packages/tree/src/util.ts
|
|
45568
|
+
|
|
45569
|
+
function util_enNodeValue(nodeid) {
|
|
45570
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(nodeid) ? '' : encodeURIComponent(`${nodeid}`);
|
|
45571
|
+
}
|
|
45572
|
+
function util_deNodeValue(nodeid) {
|
|
45573
|
+
return nodeid ? decodeURIComponent(`${nodeid}`) : nodeid;
|
|
45574
|
+
}
|
|
45575
|
+
function countTreeExpand($xeTree, prevNode) {
|
|
45576
|
+
let count = 1;
|
|
45577
|
+
if (!prevNode) {
|
|
45578
|
+
return count;
|
|
45579
|
+
}
|
|
45580
|
+
const props = $xeTree.props;
|
|
45581
|
+
const {
|
|
45582
|
+
transform
|
|
45583
|
+
} = props;
|
|
45584
|
+
const reactData = $xeTree.reactData;
|
|
45585
|
+
const {
|
|
45586
|
+
updateExpandedFlag
|
|
45587
|
+
} = reactData;
|
|
45588
|
+
const internalData = $xeTree.internalData;
|
|
45589
|
+
const {
|
|
45590
|
+
treeExpandedMaps
|
|
45591
|
+
} = internalData;
|
|
45592
|
+
const {
|
|
45593
|
+
computeChildrenField,
|
|
45594
|
+
computeMapChildrenField
|
|
45595
|
+
} = $xeTree.getComputeMaps();
|
|
45596
|
+
const childrenField = computeChildrenField.value;
|
|
45597
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
45598
|
+
const nodeChildren = prevNode[transform ? mapChildrenField : childrenField];
|
|
45599
|
+
if (nodeChildren && updateExpandedFlag && treeExpandedMaps[$xeTree.getNodeId(prevNode)]) {
|
|
45600
|
+
for (let index = 0; index < nodeChildren.length; index++) {
|
|
45601
|
+
count += countTreeExpand($xeTree, nodeChildren[index]);
|
|
45602
|
+
}
|
|
45603
|
+
}
|
|
45604
|
+
return count;
|
|
45605
|
+
}
|
|
45606
|
+
function calcTreeLine($xeTree, node, prevNode) {
|
|
45607
|
+
const internalData = $xeTree.internalData;
|
|
45608
|
+
const {
|
|
45609
|
+
scrollYStore
|
|
45610
|
+
} = internalData;
|
|
45611
|
+
const {
|
|
45612
|
+
rowHeight
|
|
45613
|
+
} = scrollYStore;
|
|
45614
|
+
let expandSize = 1;
|
|
45615
|
+
if (prevNode) {
|
|
45616
|
+
expandSize = countTreeExpand($xeTree, prevNode);
|
|
45617
|
+
}
|
|
45618
|
+
return (rowHeight || 28) * expandSize - (prevNode ? 1 : 12);
|
|
45619
|
+
}
|
|
44440
45620
|
;// ./packages/tree/src/store.ts
|
|
44441
45621
|
|
|
44442
45622
|
// 跨树拖拽
|
|
@@ -44525,7 +45705,7 @@ const {
|
|
|
44525
45705
|
/**
|
|
44526
45706
|
* 生成节点的唯一主键
|
|
44527
45707
|
*/
|
|
44528
|
-
function
|
|
45708
|
+
function tree_getNodeUniqueId() {
|
|
44529
45709
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('node_');
|
|
44530
45710
|
}
|
|
44531
45711
|
function tree_createInternalData() {
|
|
@@ -44858,9 +46038,12 @@ function tree_createReactData() {
|
|
|
44858
46038
|
getComputeMaps: () => computeMaps
|
|
44859
46039
|
};
|
|
44860
46040
|
const getNodeId = node => {
|
|
46041
|
+
if (!node) {
|
|
46042
|
+
return '';
|
|
46043
|
+
}
|
|
44861
46044
|
const valueField = computeValueField.value;
|
|
44862
46045
|
const nodeKey = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, valueField);
|
|
44863
|
-
return
|
|
46046
|
+
return util_enNodeValue(nodeKey);
|
|
44864
46047
|
};
|
|
44865
46048
|
const isExpandByNode = node => {
|
|
44866
46049
|
const {
|
|
@@ -44921,7 +46104,7 @@ function tree_createReactData() {
|
|
|
44921
46104
|
}
|
|
44922
46105
|
const nodeList = [];
|
|
44923
46106
|
nodeKeys.forEach(nodeKey => {
|
|
44924
|
-
const nodeid =
|
|
46107
|
+
const nodeid = util_enNodeValue(nodeKey);
|
|
44925
46108
|
const nodeItem = nodeMaps[nodeid];
|
|
44926
46109
|
if (nodeItem) {
|
|
44927
46110
|
nodeList.push(nodeItem.item);
|
|
@@ -45027,7 +46210,7 @@ function tree_createReactData() {
|
|
|
45027
46210
|
};
|
|
45028
46211
|
let nodeid = getNodeId(item);
|
|
45029
46212
|
if (!nodeid) {
|
|
45030
|
-
nodeid =
|
|
46213
|
+
nodeid = tree_getNodeUniqueId();
|
|
45031
46214
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, valueField, nodeid);
|
|
45032
46215
|
}
|
|
45033
46216
|
return item;
|
|
@@ -45040,10 +46223,10 @@ function tree_createReactData() {
|
|
|
45040
46223
|
const valueField = computeValueField.value;
|
|
45041
46224
|
const childrenField = computeChildrenField.value;
|
|
45042
46225
|
const keyMaps = {};
|
|
45043
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeFullData, (item, index, items, path,
|
|
46226
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeFullData, (item, index, items, path, parenItem, nodes) => {
|
|
45044
46227
|
let nodeid = getNodeId(item);
|
|
45045
46228
|
if (!nodeid) {
|
|
45046
|
-
nodeid =
|
|
46229
|
+
nodeid = tree_getNodeUniqueId();
|
|
45047
46230
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, valueField, nodeid);
|
|
45048
46231
|
}
|
|
45049
46232
|
keyMaps[nodeid] = {
|
|
@@ -45052,7 +46235,7 @@ function tree_createReactData() {
|
|
|
45052
46235
|
$index: -1,
|
|
45053
46236
|
_index: -1,
|
|
45054
46237
|
items,
|
|
45055
|
-
parent,
|
|
46238
|
+
parent: parenItem,
|
|
45056
46239
|
nodes,
|
|
45057
46240
|
level: nodes.length - 1,
|
|
45058
46241
|
treeIndex: index,
|
|
@@ -45075,7 +46258,7 @@ function tree_createReactData() {
|
|
|
45075
46258
|
const childrenField = computeChildrenField.value;
|
|
45076
46259
|
const mapChildrenField = computeMapChildrenField.value;
|
|
45077
46260
|
let vtIndex = 0;
|
|
45078
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items) => {
|
|
46261
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items, path, parenItem, nodes) => {
|
|
45079
46262
|
const nodeid = getNodeId(item);
|
|
45080
46263
|
const nodeItem = nodeMaps[nodeid];
|
|
45081
46264
|
if (nodeItem) {
|
|
@@ -45089,9 +46272,9 @@ function tree_createReactData() {
|
|
|
45089
46272
|
$index: -1,
|
|
45090
46273
|
_index: vtIndex,
|
|
45091
46274
|
items,
|
|
45092
|
-
parent,
|
|
45093
|
-
nodes
|
|
45094
|
-
level:
|
|
46275
|
+
parent: parenItem,
|
|
46276
|
+
nodes,
|
|
46277
|
+
level: nodes.length - 1,
|
|
45095
46278
|
treeIndex: index,
|
|
45096
46279
|
lineCount: 0,
|
|
45097
46280
|
treeLoaded: false
|
|
@@ -45977,7 +47160,7 @@ function tree_createReactData() {
|
|
|
45977
47160
|
reactData.updateCheckboxFlag++;
|
|
45978
47161
|
updateCheckboxStatus();
|
|
45979
47162
|
const nodeids = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(selectCheckboxMaps);
|
|
45980
|
-
const value = nodeids.map(
|
|
47163
|
+
const value = nodeids.map(util_deNodeValue);
|
|
45981
47164
|
emitCheckboxMode(value);
|
|
45982
47165
|
dispatchEvent('checkbox-change', {
|
|
45983
47166
|
node,
|
|
@@ -46045,7 +47228,7 @@ function tree_createReactData() {
|
|
|
46045
47228
|
return;
|
|
46046
47229
|
}
|
|
46047
47230
|
const isChecked = true;
|
|
46048
|
-
const value =
|
|
47231
|
+
const value = util_deNodeValue(nodeid);
|
|
46049
47232
|
reactData.selectRadioKey = nodeid;
|
|
46050
47233
|
emitRadioMode(value);
|
|
46051
47234
|
dispatchEvent('radio-change', {
|
|
@@ -46091,7 +47274,7 @@ function tree_createReactData() {
|
|
|
46091
47274
|
currentNode
|
|
46092
47275
|
} = reactData;
|
|
46093
47276
|
if (currentNode) {
|
|
46094
|
-
return
|
|
47277
|
+
return util_deNodeValue(getNodeId(currentNode));
|
|
46095
47278
|
}
|
|
46096
47279
|
return null;
|
|
46097
47280
|
},
|
|
@@ -46114,7 +47297,7 @@ function tree_createReactData() {
|
|
|
46114
47297
|
const {
|
|
46115
47298
|
nodeMaps
|
|
46116
47299
|
} = internalData;
|
|
46117
|
-
const nodeItem = nodeMaps[
|
|
47300
|
+
const nodeItem = nodeMaps[util_enNodeValue(nodeKey)];
|
|
46118
47301
|
reactData.currentNode = nodeItem ? nodeItem.item : null;
|
|
46119
47302
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
46120
47303
|
},
|
|
@@ -46146,7 +47329,7 @@ function tree_createReactData() {
|
|
|
46146
47329
|
return null;
|
|
46147
47330
|
},
|
|
46148
47331
|
setRadioNodeId(nodeKey) {
|
|
46149
|
-
reactData.selectRadioKey =
|
|
47332
|
+
reactData.selectRadioKey = util_enNodeValue(nodeKey);
|
|
46150
47333
|
emitRadioMode(nodeKey);
|
|
46151
47334
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
46152
47335
|
},
|
|
@@ -46154,7 +47337,7 @@ function tree_createReactData() {
|
|
|
46154
47337
|
if (node) {
|
|
46155
47338
|
const nodeid = getNodeId(node);
|
|
46156
47339
|
reactData.selectRadioKey = nodeid;
|
|
46157
|
-
emitRadioMode(
|
|
47340
|
+
emitRadioMode(util_deNodeValue(nodeid));
|
|
46158
47341
|
} else {
|
|
46159
47342
|
emitRadioMode(null);
|
|
46160
47343
|
}
|
|
@@ -46181,7 +47364,7 @@ function tree_createReactData() {
|
|
|
46181
47364
|
} = internalData;
|
|
46182
47365
|
const nodeKeys = [];
|
|
46183
47366
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (item, nodeId) => {
|
|
46184
|
-
nodeKeys.push(
|
|
47367
|
+
nodeKeys.push(util_deNodeValue(nodeId));
|
|
46185
47368
|
});
|
|
46186
47369
|
return nodeKeys;
|
|
46187
47370
|
},
|
|
@@ -46279,7 +47462,7 @@ function tree_createReactData() {
|
|
|
46279
47462
|
nodeKeys = [nodeKeys];
|
|
46280
47463
|
}
|
|
46281
47464
|
nodeKeys.forEach(nodeKey => {
|
|
46282
|
-
const nodeid =
|
|
47465
|
+
const nodeid = util_enNodeValue(nodeKey);
|
|
46283
47466
|
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
46284
47467
|
});
|
|
46285
47468
|
reactData.updateExpandedFlag++;
|
|
@@ -46294,7 +47477,7 @@ function tree_createReactData() {
|
|
|
46294
47477
|
} = internalData;
|
|
46295
47478
|
const nodeKeys = [];
|
|
46296
47479
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(treeExpandedMaps, (item, nodeId) => {
|
|
46297
|
-
nodeKeys.push(
|
|
47480
|
+
nodeKeys.push(util_deNodeValue(nodeId));
|
|
46298
47481
|
});
|
|
46299
47482
|
return nodeKeys;
|
|
46300
47483
|
},
|
|
@@ -46339,7 +47522,7 @@ function tree_createReactData() {
|
|
|
46339
47522
|
nodeKeys = [nodeKeys];
|
|
46340
47523
|
}
|
|
46341
47524
|
nodeKeys.forEach(nodeKey => {
|
|
46342
|
-
const nodeid =
|
|
47525
|
+
const nodeid = util_enNodeValue(nodeKey);
|
|
46343
47526
|
handleSetExpand(nodeid, !treeExpandedMaps[`${nodeid}`], treeExpandedMaps);
|
|
46344
47527
|
});
|
|
46345
47528
|
reactData.updateExpandedFlag++;
|
|
@@ -47263,7 +48446,7 @@ function tree_createReactData() {
|
|
|
47263
48446
|
const extraSlot = slots.extra;
|
|
47264
48447
|
const isExpand = updateExpandedFlag && treeExpandedMaps[nodeid];
|
|
47265
48448
|
const nodeItem = nodeMaps[nodeid] || {};
|
|
47266
|
-
const
|
|
48449
|
+
const nodeTitle = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, titleField);
|
|
47267
48450
|
const nLevel = nodeItem.level;
|
|
47268
48451
|
let isRadioChecked = false;
|
|
47269
48452
|
if (showRadio) {
|
|
@@ -47341,7 +48524,7 @@ function tree_createReactData() {
|
|
|
47341
48524
|
class: 'vxe-tree--node-item-inner'
|
|
47342
48525
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
47343
48526
|
class: 'vxe-tree--node-item-title'
|
|
47344
|
-
}, titleSlot ? vn_getSlotVNs(titleSlot(nParams)) : `${
|
|
48527
|
+
}, titleSlot ? vn_getSlotVNs(titleSlot(nParams)) : `${nodeTitle}`), extraSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
47345
48528
|
class: 'vxe-tree--node-item-extra'
|
|
47346
48529
|
}, vn_getSlotVNs(extraSlot(nParams))) : renderEmptyElement($xeTree)])])]);
|
|
47347
48530
|
};
|
|
@@ -47493,11 +48676,20 @@ function tree_createReactData() {
|
|
|
47493
48676
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.data, () => {
|
|
47494
48677
|
dataFlag.value++;
|
|
47495
48678
|
});
|
|
48679
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootParentValue, () => {
|
|
48680
|
+
dataFlag.value++;
|
|
48681
|
+
});
|
|
48682
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootValues ? props.rootValues.length : 0, () => {
|
|
48683
|
+
dataFlag.value++;
|
|
48684
|
+
});
|
|
48685
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootValues, () => {
|
|
48686
|
+
dataFlag.value++;
|
|
48687
|
+
});
|
|
47496
48688
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag, () => {
|
|
47497
48689
|
loadData(props.data || []);
|
|
47498
48690
|
});
|
|
47499
48691
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.checkNodeKey, nodeKey => {
|
|
47500
|
-
reactData.selectRadioKey =
|
|
48692
|
+
reactData.selectRadioKey = util_enNodeValue(nodeKey);
|
|
47501
48693
|
});
|
|
47502
48694
|
const checkboxFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
47503
48695
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.checkNodeKeys ? props.checkNodeKeys.length : 0, () => {
|
|
@@ -47525,19 +48717,6 @@ function tree_createReactData() {
|
|
|
47525
48717
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(hFlag, () => {
|
|
47526
48718
|
recalculate();
|
|
47527
48719
|
});
|
|
47528
|
-
const rootConf = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
47529
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootParentValue, () => {
|
|
47530
|
-
rootConf.value++;
|
|
47531
|
-
});
|
|
47532
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootValues ? props.rootValues.length : 0, () => {
|
|
47533
|
-
rootConf.value++;
|
|
47534
|
-
});
|
|
47535
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.rootValues, () => {
|
|
47536
|
-
rootConf.value++;
|
|
47537
|
-
});
|
|
47538
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(rootConf, () => {
|
|
47539
|
-
loadData(props.data || []);
|
|
47540
|
-
});
|
|
47541
48720
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
47542
48721
|
const {
|
|
47543
48722
|
transform,
|
|
@@ -47551,6 +48730,9 @@ function tree_createReactData() {
|
|
|
47551
48730
|
if (dragOpts.isCrossTreeDrag) {
|
|
47552
48731
|
errLog('vxe.error.notProp', ['drag-config.isCrossTreeDrag']);
|
|
47553
48732
|
}
|
|
48733
|
+
// if (valueField) {
|
|
48734
|
+
// errLog('vxe.error.delProp', ['value-field', 'value-field'])
|
|
48735
|
+
// }
|
|
47554
48736
|
const VxeUIContextMenu = VxeUI.getComponent('VxeContextMenu');
|
|
47555
48737
|
if (menuConfig && !VxeUIContextMenu) {
|
|
47556
48738
|
errLog('vxe.error.reqComp', ['vxe-context-menu']);
|
|
@@ -47584,7 +48766,7 @@ function tree_createReactData() {
|
|
|
47584
48766
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, tree_createReactData());
|
|
47585
48767
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, tree_createInternalData());
|
|
47586
48768
|
});
|
|
47587
|
-
reactData.selectRadioKey =
|
|
48769
|
+
reactData.selectRadioKey = util_enNodeValue(props.checkNodeKey);
|
|
47588
48770
|
loadData(props.data || []);
|
|
47589
48771
|
$xeTree.renderVN = renderVN;
|
|
47590
48772
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeTree', $xeTree);
|
|
@@ -47804,14 +48986,14 @@ function tree_select_createInternalData() {
|
|
|
47804
48986
|
return disabled;
|
|
47805
48987
|
});
|
|
47806
48988
|
const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
48989
|
+
const popupOpts = computePopupOpts.value;
|
|
47807
48990
|
const {
|
|
47808
48991
|
transfer
|
|
47809
|
-
} =
|
|
47810
|
-
|
|
47811
|
-
|
|
47812
|
-
return popupOpts.transfer;
|
|
48992
|
+
} = popupOpts;
|
|
48993
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(transfer)) {
|
|
48994
|
+
return transfer;
|
|
47813
48995
|
}
|
|
47814
|
-
if (transfer === null) {
|
|
48996
|
+
if (props.transfer === null) {
|
|
47815
48997
|
const globalTransfer = getConfig().treeSelect.transfer;
|
|
47816
48998
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
47817
48999
|
return globalTransfer;
|
|
@@ -47820,7 +49002,7 @@ function tree_select_createInternalData() {
|
|
|
47820
49002
|
return true;
|
|
47821
49003
|
}
|
|
47822
49004
|
}
|
|
47823
|
-
return transfer;
|
|
49005
|
+
return props.transfer;
|
|
47824
49006
|
});
|
|
47825
49007
|
const computePopupOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
47826
49008
|
return Object.assign({}, getConfig().treeSelect.popupConfig, props.popupConfig);
|
|
@@ -47893,9 +49075,14 @@ function tree_select_createInternalData() {
|
|
|
47893
49075
|
const treeOpts = computeTreeOpts.value;
|
|
47894
49076
|
return Object.assign({}, treeOpts.filterConfig, props.filterConfig);
|
|
47895
49077
|
});
|
|
49078
|
+
const computeSelectVals = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
49079
|
+
const {
|
|
49080
|
+
modelValue
|
|
49081
|
+
} = props;
|
|
49082
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
49083
|
+
});
|
|
47896
49084
|
const computeSelectLabel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
47897
49085
|
const {
|
|
47898
|
-
modelValue,
|
|
47899
49086
|
showFullLabel
|
|
47900
49087
|
} = props;
|
|
47901
49088
|
const {
|
|
@@ -47907,7 +49094,7 @@ function tree_select_createInternalData() {
|
|
|
47907
49094
|
lazyNodeMaps
|
|
47908
49095
|
} = internalData;
|
|
47909
49096
|
const labelField = computeLabelField.value;
|
|
47910
|
-
const selectVals =
|
|
49097
|
+
const selectVals = computeSelectVals.value;
|
|
47911
49098
|
return selectVals.map(val => {
|
|
47912
49099
|
const cacheItem = fullNodeMaps[val];
|
|
47913
49100
|
if (fullOptFlag && cacheItem) {
|
|
@@ -47996,12 +49183,12 @@ function tree_select_createInternalData() {
|
|
|
47996
49183
|
nodeid = tree_select_getOptUniqueId();
|
|
47997
49184
|
}
|
|
47998
49185
|
if (keyMaps[nodeid]) {
|
|
47999
|
-
errLog('vxe.error.repeatKey', [
|
|
49186
|
+
errLog('vxe.error.repeatKey', [nodeKeyField, nodeid]);
|
|
48000
49187
|
}
|
|
48001
49188
|
keyMaps[nodeid] = true;
|
|
48002
49189
|
const value = item[valueField];
|
|
48003
49190
|
if (nodeMaps[value]) {
|
|
48004
|
-
errLog('vxe.error.repeatKey', [
|
|
49191
|
+
errLog('vxe.error.repeatKey', [valueField, value]);
|
|
48005
49192
|
}
|
|
48006
49193
|
nodeMaps[value] = {
|
|
48007
49194
|
item,
|
|
@@ -48009,7 +49196,7 @@ function tree_select_createInternalData() {
|
|
|
48009
49196
|
items,
|
|
48010
49197
|
parent: parentItem,
|
|
48011
49198
|
nodes,
|
|
48012
|
-
fullLabel: nodes.map(item => item[labelField]).join(
|
|
49199
|
+
fullLabel: nodes.map(item => item[labelField]).join(separator || ' / ')
|
|
48013
49200
|
};
|
|
48014
49201
|
};
|
|
48015
49202
|
if (optList) {
|
|
@@ -48088,7 +49275,7 @@ function tree_select_createInternalData() {
|
|
|
48088
49275
|
handleStyle();
|
|
48089
49276
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(handleStyle);
|
|
48090
49277
|
};
|
|
48091
|
-
const showOptionPanel =
|
|
49278
|
+
const showOptionPanel = evnt => {
|
|
48092
49279
|
const {
|
|
48093
49280
|
loading,
|
|
48094
49281
|
remote,
|
|
@@ -48120,7 +49307,7 @@ function tree_select_createInternalData() {
|
|
|
48120
49307
|
updatePlacement();
|
|
48121
49308
|
dispatchEvent('visible-change', {
|
|
48122
49309
|
visible: true
|
|
48123
|
-
}, null);
|
|
49310
|
+
}, evnt || null);
|
|
48124
49311
|
}
|
|
48125
49312
|
};
|
|
48126
49313
|
const hideOptionPanel = evnt => {
|
|
@@ -48133,7 +49320,7 @@ function tree_select_createInternalData() {
|
|
|
48133
49320
|
}, evnt || null);
|
|
48134
49321
|
};
|
|
48135
49322
|
const changeEvent = (evnt, selectValue, node) => {
|
|
48136
|
-
const value = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(selectValue) ? selectValue.map(
|
|
49323
|
+
const value = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(selectValue) ? selectValue.map(util_deNodeValue) : util_deNodeValue(selectValue);
|
|
48137
49324
|
emitModel(value);
|
|
48138
49325
|
if (value !== props.modelValue) {
|
|
48139
49326
|
dispatchEvent('change', {
|
|
@@ -48180,7 +49367,7 @@ function tree_select_createInternalData() {
|
|
|
48180
49367
|
dispatchEvent('all-change', {
|
|
48181
49368
|
value: checkNodeKeys
|
|
48182
49369
|
}, $event);
|
|
48183
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(
|
|
49370
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(checkedClosable) ? checkedClosable : autoClose) {
|
|
48184
49371
|
hideOptionPanel($event);
|
|
48185
49372
|
}
|
|
48186
49373
|
});
|
|
@@ -48200,7 +49387,7 @@ function tree_select_createInternalData() {
|
|
|
48200
49387
|
if ($tree) {
|
|
48201
49388
|
const value = multiple ? [] : null;
|
|
48202
49389
|
$tree.clearCheckboxNode().then(() => {
|
|
48203
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(
|
|
49390
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(clearClosable) ? clearClosable : autoClose) {
|
|
48204
49391
|
hideOptionPanel($event);
|
|
48205
49392
|
}
|
|
48206
49393
|
});
|
|
@@ -48299,7 +49486,7 @@ function tree_select_createInternalData() {
|
|
|
48299
49486
|
if (!isDisabled) {
|
|
48300
49487
|
if (!reactData.visiblePanel) {
|
|
48301
49488
|
reactData.triggerFocusPanel = true;
|
|
48302
|
-
showOptionPanel();
|
|
49489
|
+
showOptionPanel(evnt);
|
|
48303
49490
|
setTimeout(() => {
|
|
48304
49491
|
reactData.triggerFocusPanel = false;
|
|
48305
49492
|
}, 150);
|
|
@@ -48351,7 +49538,7 @@ function tree_select_createInternalData() {
|
|
|
48351
49538
|
if (reactData.visiblePanel) {
|
|
48352
49539
|
hideOptionPanel($event);
|
|
48353
49540
|
} else {
|
|
48354
|
-
showOptionPanel();
|
|
49541
|
+
showOptionPanel($event);
|
|
48355
49542
|
}
|
|
48356
49543
|
}
|
|
48357
49544
|
};
|