vxe-pc-ui 4.20.7 → 4.20.9
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 +915 -820
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/card/src/card.js +8 -6
- package/es/drawer/src/drawer.js +7 -5
- package/es/icon/style.css +1 -1
- package/es/layout-aside/src/layout-aside.js +6 -4
- package/es/layout-body/src/layout-body.js +6 -4
- package/es/layout-container/src/layout-container.js +11 -3
- package/es/list/src/list.js +79 -50
- package/es/menu/src/menu.js +7 -5
- package/es/modal/src/modal.js +7 -5
- package/es/scrollbar/src/scrollbar.js +8 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +5 -4
- package/es/tooltip/src/tooltip.js +15 -7
- package/es/tree/src/tree.js +74 -45
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/card/src/card.js +9 -6
- package/lib/card/src/card.min.js +1 -1
- package/lib/drawer/src/drawer.js +7 -4
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +371 -163
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +7 -4
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +7 -4
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/layout-container/src/layout-container.js +20 -4
- package/lib/layout-container/src/layout-container.min.js +1 -1
- package/lib/list/src/list.js +79 -47
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/menu.js +8 -4
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +7 -4
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/scrollbar/src/scrollbar.js +8 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +6 -5
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +15 -6
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/src/tree.js +74 -43
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/card/src/card.ts +8 -6
- package/packages/drawer/src/drawer.ts +7 -5
- package/packages/layout-aside/src/layout-aside.ts +6 -4
- package/packages/layout-body/src/layout-body.ts +6 -4
- package/packages/layout-container/src/layout-container.ts +13 -3
- package/packages/list/src/list.ts +81 -50
- package/packages/menu/src/menu.ts +7 -5
- package/packages/modal/src/modal.ts +7 -5
- package/packages/scrollbar/src/scrollbar.ts +8 -1
- package/packages/tabs/src/tabs.ts +5 -4
- package/packages/tooltip/src/tooltip.ts +15 -7
- package/packages/tree/src/tree.ts +76 -45
- package/types/components/card.d.ts +2 -2
- package/types/components/drawer.d.ts +2 -2
- package/types/components/grid.d.ts +3 -1
- package/types/components/layout-aside.d.ts +2 -2
- package/types/components/layout-body.d.ts +2 -2
- package/types/components/layout-container.d.ts +3 -1
- package/types/components/list.d.ts +2 -2
- package/types/components/menu.d.ts +2 -2
- package/types/components/modal.d.ts +2 -2
- package/types/components/scrollbar.d.ts +10 -0
- package/types/components/table.d.ts +9 -5
- package/types/components/tabs.d.ts +2 -2
- package/types/components/tooltip.d.ts +2 -2
- package/types/components/tree.d.ts +2 -2
- /package/es/icon/{iconfont.1792080138286.ttf → iconfont.1792139440389.ttf} +0 -0
- /package/es/icon/{iconfont.1792080138286.woff → iconfont.1792139440389.woff} +0 -0
- /package/es/icon/{iconfont.1792080138286.woff2 → iconfont.1792139440389.woff2} +0 -0
- /package/es/{iconfont.1792080138286.ttf → iconfont.1792139440389.ttf} +0 -0
- /package/es/{iconfont.1792080138286.woff → iconfont.1792139440389.woff} +0 -0
- /package/es/{iconfont.1792080138286.woff2 → iconfont.1792139440389.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1792080138286.ttf → iconfont.1792139440389.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1792080138286.woff → iconfont.1792139440389.woff} +0 -0
- /package/lib/icon/style/{iconfont.1792080138286.woff2 → iconfont.1792139440389.woff2} +0 -0
- /package/lib/{iconfont.1792080138286.ttf → iconfont.1792139440389.ttf} +0 -0
- /package/lib/{iconfont.1792080138286.woff → iconfont.1792139440389.woff} +0 -0
- /package/lib/{iconfont.1792080138286.woff2 → iconfont.1792139440389.woff2} +0 -0
package/es/list/src/list.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, ref, computed, onBeforeUnmount, watch, reactive, nextTick, onActivated, onMounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
|
-
import { VxeUI,
|
|
4
|
+
import { VxeUI, createEvent, renderEmptyElement } from '../../ui';
|
|
5
5
|
import { getCrossListDragRowInfo } from './store';
|
|
6
6
|
import { isScale, removeClass, addClass, getTpImg, toCssUnit, hasClass } from '../../ui/src/dom';
|
|
7
7
|
import { isEnableConf, getText, enModelValue, deModelValue, getDefaultConfig } from '../../ui/src/utils';
|
|
@@ -9,7 +9,7 @@ import { createComponentLog } from '../../ui/src/log';
|
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime';
|
|
10
10
|
import { getItemCacheObj } from './util';
|
|
11
11
|
import VxeLoadingComponent from '../../loading';
|
|
12
|
-
const { getConfig, getIcon, getI18n, domUtils, scrollbarUtils, menus, globalEvents, globalResize } = VxeUI;
|
|
12
|
+
const { getConfig, getIcon, getI18n, domUtils, scrollbarUtils, useFns, menus, globalEvents, globalResize } = VxeUI;
|
|
13
13
|
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils;
|
|
14
14
|
const { warnLog, errLog } = createComponentLog('tree');
|
|
15
15
|
function getRowKeyByField(row, keyField) {
|
|
@@ -145,7 +145,8 @@ export default defineVxeComponent({
|
|
|
145
145
|
const { slots, emit } = context;
|
|
146
146
|
const xID = XEUtils.uniqueId();
|
|
147
147
|
const browseObj = XEUtils.browse();
|
|
148
|
-
const { computeSize } = useSize(props);
|
|
148
|
+
const { computeSize } = useFns.useSize(props);
|
|
149
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
149
150
|
const reactData = reactive(createReactData());
|
|
150
151
|
const internalData = createInternalData();
|
|
151
152
|
const crossListDragRowInfo = getCrossListDragRowInfo();
|
|
@@ -153,6 +154,7 @@ export default defineVxeComponent({
|
|
|
153
154
|
const refHeaderElem = ref();
|
|
154
155
|
const refFooterElem = ref();
|
|
155
156
|
const refVirtualWrapper = ref();
|
|
157
|
+
const refVirtualSpaceElem = ref();
|
|
156
158
|
const refVirtualBody = ref();
|
|
157
159
|
const refTrackXElem = ref();
|
|
158
160
|
const refTrackYElem = ref();
|
|
@@ -457,7 +459,6 @@ export default defineVxeComponent({
|
|
|
457
459
|
*/
|
|
458
460
|
const refreshScroll = () => {
|
|
459
461
|
const { lastScrollLeft, lastScrollTop } = internalData;
|
|
460
|
-
updateScrollbar();
|
|
461
462
|
return clearScroll().then(() => {
|
|
462
463
|
if (lastScrollLeft || lastScrollTop) {
|
|
463
464
|
internalData.lastScrollLeft = 0;
|
|
@@ -467,8 +468,14 @@ export default defineVxeComponent({
|
|
|
467
468
|
});
|
|
468
469
|
};
|
|
469
470
|
const updateScrollbar = () => {
|
|
470
|
-
|
|
471
|
-
|
|
471
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
472
|
+
if (isVScrollbar) {
|
|
473
|
+
return nextTick().then(() => {
|
|
474
|
+
updateThumbSize();
|
|
475
|
+
updateThumbOffset();
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
return Promise.resolve();
|
|
472
479
|
};
|
|
473
480
|
/**
|
|
474
481
|
* 重新计算列表
|
|
@@ -487,10 +494,11 @@ export default defineVxeComponent({
|
|
|
487
494
|
parentHeight = parentEl.clientHeight - Math.ceil(XEUtils.toNumber(parentStyle.paddingLeft) + XEUtils.toNumber(parentStyle.paddingRight));
|
|
488
495
|
}
|
|
489
496
|
reactData.parentHeight = parentHeight;
|
|
490
|
-
updateScrollbar();
|
|
491
497
|
updateHeight();
|
|
492
498
|
if (el.clientWidth && el.clientHeight) {
|
|
493
|
-
return computeScrollLoad()
|
|
499
|
+
return computeScrollLoad().then(() => {
|
|
500
|
+
updateScrollbar();
|
|
501
|
+
});
|
|
494
502
|
}
|
|
495
503
|
}
|
|
496
504
|
return nextTick();
|
|
@@ -498,7 +506,7 @@ export default defineVxeComponent({
|
|
|
498
506
|
const loadYData = (evnt) => {
|
|
499
507
|
const { scrollYStore } = internalData;
|
|
500
508
|
const { startIndex, endIndex, visibleSize, offsetSize, rowHeight } = scrollYStore;
|
|
501
|
-
const scrollBodyElem = evnt.
|
|
509
|
+
const scrollBodyElem = evnt.currentTarget;
|
|
502
510
|
const scrollTop = scrollBodyElem.scrollTop;
|
|
503
511
|
const toVisibleIndex = Math.floor(scrollTop / rowHeight);
|
|
504
512
|
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
|
|
@@ -512,7 +520,7 @@ export default defineVxeComponent({
|
|
|
512
520
|
}
|
|
513
521
|
};
|
|
514
522
|
const scrollEvent = (evnt) => {
|
|
515
|
-
const scrollBodyElem = evnt.
|
|
523
|
+
const scrollBodyElem = evnt.currentTarget;
|
|
516
524
|
const scrollTop = scrollBodyElem.scrollTop;
|
|
517
525
|
const scrollLeft = scrollBodyElem.scrollLeft;
|
|
518
526
|
const isX = scrollLeft !== internalData.lastScrollLeft;
|
|
@@ -1814,6 +1822,26 @@ export default defineVxeComponent({
|
|
|
1814
1822
|
hideDropTip();
|
|
1815
1823
|
}
|
|
1816
1824
|
};
|
|
1825
|
+
const bindScrollbarResize = () => {
|
|
1826
|
+
const { scrollObserver } = internalData;
|
|
1827
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
1828
|
+
if (isVScrollbar) {
|
|
1829
|
+
if (!scrollObserver) {
|
|
1830
|
+
const el = refElem.value;
|
|
1831
|
+
const viewInnerEl = refVirtualSpaceElem.value;
|
|
1832
|
+
const scrollObserver = globalResize.create(() => {
|
|
1833
|
+
reScrollFlag.value++;
|
|
1834
|
+
});
|
|
1835
|
+
if (el) {
|
|
1836
|
+
scrollObserver.observe(el);
|
|
1837
|
+
}
|
|
1838
|
+
if (viewInnerEl) {
|
|
1839
|
+
scrollObserver.observe(viewInnerEl);
|
|
1840
|
+
}
|
|
1841
|
+
internalData.scrollObserver = scrollObserver;
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1817
1845
|
const updateThumbSize = () => {
|
|
1818
1846
|
const viewEl = refVirtualWrapper.value;
|
|
1819
1847
|
if (!viewEl) {
|
|
@@ -2166,12 +2194,13 @@ export default defineVxeComponent({
|
|
|
2166
2194
|
}], rowid: hasKey && keyField ? rowid : undefined }, rowOns), ctVNs);
|
|
2167
2195
|
};
|
|
2168
2196
|
const renderVN = () => {
|
|
2169
|
-
const { showCheckbox, className, loading
|
|
2197
|
+
const { showCheckbox, className, loading } = props;
|
|
2170
2198
|
const { bodyHeight, topSpaceHeight, rowList, isAllChecked, isAllIndeterminate, xThumbWidth, yThumbHeight } = reactData;
|
|
2171
2199
|
const defaultSlot = slots.default;
|
|
2172
2200
|
const headerSlot = slots.header;
|
|
2173
2201
|
const footerSlot = slots.footer;
|
|
2174
2202
|
const vSize = computeSize.value;
|
|
2203
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
2175
2204
|
const wrapperStyles = computeWrapperStyles.value;
|
|
2176
2205
|
const virtualStyles = computeVirtualStyles.value;
|
|
2177
2206
|
const radioOpts = computeRadioOpts.value;
|
|
@@ -2197,17 +2226,17 @@ export default defineVxeComponent({
|
|
|
2197
2226
|
}
|
|
2198
2227
|
return h('div', Object.assign({ ref: refElem, class: [
|
|
2199
2228
|
'vxe-list',
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2229
|
+
isVScrollbar ? `ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2230
|
+
isVScrollbar ? `ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}` : '',
|
|
2231
|
+
isVScrollbar ? `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}` : '',
|
|
2232
|
+
isVScrollbar ? `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}` : '',
|
|
2204
2233
|
className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '',
|
|
2205
2234
|
{
|
|
2206
2235
|
[`size--${vSize}`]: vSize,
|
|
2207
|
-
'is--virtual-scrollbar':
|
|
2208
|
-
'ov-padding':
|
|
2209
|
-
'ov-x--auto-hide':
|
|
2210
|
-
'ov-y--auto-hide':
|
|
2236
|
+
'is--virtual-scrollbar': isVScrollbar,
|
|
2237
|
+
'ov-padding': isVScrollbar && scrollbarOpts.padding,
|
|
2238
|
+
'ov-x--auto-hide': isVScrollbar && scrollXAutoHide,
|
|
2239
|
+
'ov-y--auto-hide': isVScrollbar && scrollYAutoHide,
|
|
2211
2240
|
'overflow-y': yThumbHeight,
|
|
2212
2241
|
'overflow-x': xThumbWidth,
|
|
2213
2242
|
'is--drag': isDrag,
|
|
@@ -2253,6 +2282,7 @@ export default defineVxeComponent({
|
|
|
2253
2282
|
onScroll: scrollEvent
|
|
2254
2283
|
}, [
|
|
2255
2284
|
h('div', {
|
|
2285
|
+
ref: refVirtualSpaceElem,
|
|
2256
2286
|
class: 'vxe-list--y-space',
|
|
2257
2287
|
style: {
|
|
2258
2288
|
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
@@ -2281,7 +2311,7 @@ export default defineVxeComponent({
|
|
|
2281
2311
|
/**
|
|
2282
2312
|
* 滚动条
|
|
2283
2313
|
*/
|
|
2284
|
-
|
|
2314
|
+
isVScrollbar
|
|
2285
2315
|
? h('div', {
|
|
2286
2316
|
class: scrollbarWrapperClss
|
|
2287
2317
|
}, [
|
|
@@ -2344,43 +2374,54 @@ export default defineVxeComponent({
|
|
|
2344
2374
|
watch(dataFlag, () => {
|
|
2345
2375
|
loadData(props.data || []);
|
|
2346
2376
|
});
|
|
2347
|
-
const
|
|
2377
|
+
const reScrollFlag = ref(0);
|
|
2378
|
+
const reLayoutFlag = ref(0);
|
|
2348
2379
|
watch(() => props.height, () => {
|
|
2349
|
-
|
|
2380
|
+
reLayoutFlag.value++;
|
|
2350
2381
|
});
|
|
2351
2382
|
watch(() => props.maxHeight, () => {
|
|
2352
|
-
|
|
2383
|
+
reLayoutFlag.value++;
|
|
2353
2384
|
});
|
|
2354
2385
|
watch(() => props.syncResize, () => {
|
|
2355
|
-
|
|
2386
|
+
reLayoutFlag.value++;
|
|
2356
2387
|
});
|
|
2357
|
-
watch(
|
|
2358
|
-
|
|
2388
|
+
watch(computeIsVScrollbar, () => {
|
|
2389
|
+
nextTick(() => {
|
|
2390
|
+
bindScrollbarResize();
|
|
2391
|
+
nextTick(() => {
|
|
2392
|
+
reLayoutFlag.value++;
|
|
2393
|
+
});
|
|
2394
|
+
});
|
|
2359
2395
|
});
|
|
2360
2396
|
watch(computeRowHeight, () => {
|
|
2361
|
-
|
|
2397
|
+
reLayoutFlag.value++;
|
|
2362
2398
|
});
|
|
2363
2399
|
watch(computeScrollYWidth, () => {
|
|
2364
|
-
|
|
2400
|
+
reLayoutFlag.value++;
|
|
2365
2401
|
});
|
|
2366
2402
|
watch(computeScrollXHeight, () => {
|
|
2367
|
-
|
|
2403
|
+
reLayoutFlag.value++;
|
|
2368
2404
|
});
|
|
2369
2405
|
watch(computeScrollXVisible, () => {
|
|
2370
2406
|
nextTick(() => {
|
|
2371
|
-
|
|
2407
|
+
reLayoutFlag.value++;
|
|
2372
2408
|
});
|
|
2373
2409
|
});
|
|
2374
2410
|
watch(computeScrollYVisible, () => {
|
|
2375
2411
|
nextTick(() => {
|
|
2376
|
-
|
|
2412
|
+
reLayoutFlag.value++;
|
|
2377
2413
|
});
|
|
2378
2414
|
});
|
|
2379
|
-
watch(
|
|
2415
|
+
watch(reLayoutFlag, () => {
|
|
2380
2416
|
recalculate().then(() => {
|
|
2381
2417
|
recalculate();
|
|
2382
2418
|
});
|
|
2383
2419
|
});
|
|
2420
|
+
watch(reScrollFlag, () => {
|
|
2421
|
+
updateScrollbar().then(() => {
|
|
2422
|
+
updateScrollbar();
|
|
2423
|
+
});
|
|
2424
|
+
});
|
|
2384
2425
|
watch(() => props.checkRowKey, () => {
|
|
2385
2426
|
updateRadioModeValue();
|
|
2386
2427
|
});
|
|
@@ -2403,7 +2444,7 @@ export default defineVxeComponent({
|
|
|
2403
2444
|
loadData(props.data || []);
|
|
2404
2445
|
});
|
|
2405
2446
|
onMounted(() => {
|
|
2406
|
-
const { showSeq, showRadio, showCheckbox, autoResize
|
|
2447
|
+
const { showSeq, showRadio, showCheckbox, autoResize } = props;
|
|
2407
2448
|
const rowOpts = computeRowOpts.value;
|
|
2408
2449
|
const { useKey } = rowOpts;
|
|
2409
2450
|
const isDrag = computeIsDrag.value;
|
|
@@ -2425,25 +2466,12 @@ export default defineVxeComponent({
|
|
|
2425
2466
|
if (useKey && !keyField) {
|
|
2426
2467
|
errLog('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField']);
|
|
2427
2468
|
}
|
|
2428
|
-
const el = refElem.value;
|
|
2429
|
-
if (useScrollbar) {
|
|
2430
|
-
const viewInnerEl = refVirtualBody.value;
|
|
2431
|
-
const scrollObserver = globalResize.create(() => {
|
|
2432
|
-
reFlag.value++;
|
|
2433
|
-
});
|
|
2434
|
-
if (el) {
|
|
2435
|
-
scrollObserver.observe(el);
|
|
2436
|
-
}
|
|
2437
|
-
if (viewInnerEl) {
|
|
2438
|
-
scrollObserver.observe(viewInnerEl);
|
|
2439
|
-
}
|
|
2440
|
-
internalData.scrollObserver = scrollObserver;
|
|
2441
|
-
}
|
|
2442
2469
|
if (autoResize) {
|
|
2470
|
+
const el = refElem.value;
|
|
2443
2471
|
const parentEl = getParentElem();
|
|
2444
2472
|
const resizeObserver = globalResize.create(() => {
|
|
2445
2473
|
if (props.autoResize) {
|
|
2446
|
-
|
|
2474
|
+
reLayoutFlag.value++;
|
|
2447
2475
|
}
|
|
2448
2476
|
});
|
|
2449
2477
|
if (el) {
|
|
@@ -2454,9 +2482,10 @@ export default defineVxeComponent({
|
|
|
2454
2482
|
}
|
|
2455
2483
|
internalData.resizeObserver = resizeObserver;
|
|
2456
2484
|
}
|
|
2457
|
-
|
|
2485
|
+
reLayoutFlag.value++;
|
|
2486
|
+
bindScrollbarResize();
|
|
2458
2487
|
globalEvents.on($xeList, 'resize', () => {
|
|
2459
|
-
|
|
2488
|
+
reLayoutFlag.value++;
|
|
2460
2489
|
});
|
|
2461
2490
|
});
|
|
2462
2491
|
onBeforeUnmount(() => {
|
package/es/menu/src/menu.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, h, reactive, Teleport, inject, resolveComponent, watch, computed, nextTick, onBeforeUnmount, onMounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
|
-
import { VxeUI, createEvent, permission,
|
|
4
|
+
import { VxeUI, createEvent, permission, globalEvents, renderEmptyElement } from '../../ui';
|
|
5
5
|
import { getPopupContainer, scrollToView, toCssUnit } from '../../ui/src/dom';
|
|
6
6
|
import { getLastZIndex, nextZIndex, isEnableConf, getDefaultConfig } from '../../ui/src/utils';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
@@ -9,7 +9,7 @@ import { createComponentLog } from '../../ui/src/log';
|
|
|
9
9
|
import VxeLoadingComponent from '../../loading';
|
|
10
10
|
import VxeScrollbarComponent from '../../scrollbar';
|
|
11
11
|
const { errLog } = createComponentLog('menu');
|
|
12
|
-
const { menus, getConfig, getIcon } = VxeUI;
|
|
12
|
+
const { menus, useFns, getConfig, getIcon } = VxeUI;
|
|
13
13
|
function createInternalData() {
|
|
14
14
|
return {
|
|
15
15
|
lastActiveTime: 0,
|
|
@@ -88,7 +88,8 @@ export default defineVxeComponent({
|
|
|
88
88
|
const refCollapseElem = ref();
|
|
89
89
|
const refCollapseBodyElem = ref();
|
|
90
90
|
const refCollapseBodyScrollbar = ref();
|
|
91
|
-
const { computeSize } = useSize(props);
|
|
91
|
+
const { computeSize } = useFns.useSize(props);
|
|
92
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
92
93
|
const reactData = reactive(createReactData());
|
|
93
94
|
const internalData = createInternalData();
|
|
94
95
|
const refMaps = {
|
|
@@ -619,9 +620,10 @@ export default defineVxeComponent({
|
|
|
619
620
|
]);
|
|
620
621
|
};
|
|
621
622
|
const renderVN = () => {
|
|
622
|
-
const { loading, collapseFixed, appendTo
|
|
623
|
+
const { loading, collapseFixed, appendTo } = props;
|
|
623
624
|
const { initialized, menuList, collapseStyle, isEnterCollapse } = reactData;
|
|
624
625
|
const vSize = computeSize.value;
|
|
626
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
625
627
|
const isCollapsed = computeIsCollapsed.value;
|
|
626
628
|
const currBorder = computeCurrBorder.value;
|
|
627
629
|
const varStyle = computeVarStyle.value;
|
|
@@ -675,7 +677,7 @@ export default defineVxeComponent({
|
|
|
675
677
|
class: 'vxe-menu--header'
|
|
676
678
|
}, headerSlot(stParams))
|
|
677
679
|
: renderEmptyElement($xeMenu),
|
|
678
|
-
|
|
680
|
+
isVScrollbar && isEnterCollapse
|
|
679
681
|
? h(VxeScrollbarComponent, Object.assign(Object.assign({ ref: refCollapseBodyScrollbar, class: 'vxe-menu--scrollbar-body' }, scrollbarOpts), { viewClassName: 'vxe-menu--scrollbar-body-view' + (viewClassName ? (' ' + viewClassName) : ''), viewInnerClassName: 'vxe-menu--scrollbar-body-inner' + (viewClassName ? (' ' + viewInnerClassName) : '') }), {
|
|
680
682
|
default: () => menuList.map(child => renderDefaultChildren(child, menuList))
|
|
681
683
|
})
|
package/es/modal/src/modal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp';
|
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { getEventTargetNode, getPopupContainer, getPopupWrapperElement, isScale, toCssUnit } from '../../ui/src/dom';
|
|
5
5
|
import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue, getDefaultConfig } from '../../ui/src/utils';
|
|
6
|
-
import { VxeUI, getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent,
|
|
6
|
+
import { VxeUI, getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useFns, renderEmptyElement } from '../../ui';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { createComponentLog } from '../../ui/src/log';
|
|
9
9
|
import { allActiveModals } from './store';
|
|
@@ -253,7 +253,8 @@ export default defineVxeComponent({
|
|
|
253
253
|
const $xeDrawer = inject('$xeDrawer', null);
|
|
254
254
|
const $xeTable = inject('$xeTable', null);
|
|
255
255
|
const $xeForm = inject('$xeForm', null);
|
|
256
|
-
const { computeSize } = useSize(props);
|
|
256
|
+
const { computeSize } = useFns.useSize(props);
|
|
257
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
257
258
|
const reactData = reactive(createReactData());
|
|
258
259
|
const internalData = createInternalData();
|
|
259
260
|
const refElem = ref();
|
|
@@ -1330,8 +1331,9 @@ export default defineVxeComponent({
|
|
|
1330
1331
|
return renderEmptyElement($xeModal);
|
|
1331
1332
|
};
|
|
1332
1333
|
const renderBody = () => {
|
|
1333
|
-
const { slots: propSlots = {}, status, message, iconStatus,
|
|
1334
|
+
const { slots: propSlots = {}, status, message, iconStatus, useHtml } = props;
|
|
1334
1335
|
const content = props.content || message;
|
|
1336
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
1335
1337
|
const isMsg = computeIsMsg.value;
|
|
1336
1338
|
const scrollbarProps = computeScrollbarProps.value;
|
|
1337
1339
|
const defaultSlot = slots.default || propSlots.default;
|
|
@@ -1348,7 +1350,7 @@ export default defineVxeComponent({
|
|
|
1348
1350
|
]));
|
|
1349
1351
|
}
|
|
1350
1352
|
if (useHtml && !defaultSlot) {
|
|
1351
|
-
contVNs.push(
|
|
1353
|
+
contVNs.push(isVScrollbar
|
|
1352
1354
|
? h(VxeScrollbarComponent, Object.assign({ key: 'shc', class: 'vxe-modal--scrollbar-content' }, scrollbarProps), {
|
|
1353
1355
|
default() {
|
|
1354
1356
|
return [
|
|
@@ -1366,7 +1368,7 @@ export default defineVxeComponent({
|
|
|
1366
1368
|
}));
|
|
1367
1369
|
}
|
|
1368
1370
|
else {
|
|
1369
|
-
contVNs.push(
|
|
1371
|
+
contVNs.push(isVScrollbar
|
|
1370
1372
|
? h(VxeScrollbarComponent, Object.assign({ key: 'sdc', class: 'vxe-modal--scrollbar-content' }, scrollbarProps), {
|
|
1371
1373
|
default: () => defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content)
|
|
1372
1374
|
})
|
|
@@ -78,10 +78,18 @@ export default defineVxeComponent({
|
|
|
78
78
|
type: String,
|
|
79
79
|
default: () => getConfig().scrollbar.viewInnerClassName
|
|
80
80
|
},
|
|
81
|
+
/**
|
|
82
|
+
* 已废弃
|
|
83
|
+
* @deprecated
|
|
84
|
+
*/
|
|
81
85
|
autoResize: {
|
|
82
86
|
type: Boolean,
|
|
83
87
|
default: () => getConfig().scrollbar.autoResize
|
|
84
88
|
},
|
|
89
|
+
/**
|
|
90
|
+
* 已废弃
|
|
91
|
+
* @deprecated
|
|
92
|
+
*/
|
|
85
93
|
syncResize: [Boolean, String, Number]
|
|
86
94
|
},
|
|
87
95
|
emits: [
|