vxe-pc-ui 4.20.1 → 4.20.5
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 +1306 -1214
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/card/src/card.js +2 -1
- package/es/drawer/src/drawer.js +59 -15
- package/es/drawer/style.css +13 -6
- package/es/drawer/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/layout-aside/src/layout-aside.js +2 -1
- package/es/layout-body/src/layout-body.js +2 -1
- package/es/list/src/list.js +52 -25
- package/es/menu/src/menu.js +2 -2
- package/es/modal/src/modal.js +56 -12
- package/es/modal/style.css +15 -4
- package/es/modal/style.min.css +1 -1
- package/es/scrollbar/src/scrollbar.js +18 -6
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +2 -2
- package/es/tree/src/tree.js +45 -26
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-drawer/style.css +13 -6
- package/es/vxe-drawer/style.min.css +1 -1
- package/es/vxe-modal/style.css +15 -4
- package/es/vxe-modal/style.min.css +1 -1
- package/lib/card/src/card.js +2 -1
- package/lib/card/src/card.min.js +1 -1
- package/lib/drawer/src/drawer.js +64 -11
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/drawer/style/style.css +13 -6
- package/lib/drawer/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +396 -190
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +2 -1
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +2 -1
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/list/src/list.js +106 -66
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/menu.js +1 -1
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +61 -10
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +15 -4
- package/lib/modal/style/style.min.css +1 -1
- package/lib/scrollbar/src/scrollbar.js +33 -15
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +1 -1
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tree/src/tree.js +60 -36
- 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/lib/vxe-drawer/style/style.css +13 -6
- package/lib/vxe-drawer/style/style.min.css +1 -1
- package/lib/vxe-modal/style/style.css +15 -4
- package/lib/vxe-modal/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/card/src/card.ts +2 -1
- package/packages/drawer/src/drawer.ts +73 -16
- package/packages/layout-aside/src/layout-aside.ts +2 -1
- package/packages/layout-body/src/layout-body.ts +2 -1
- package/packages/list/src/list.ts +58 -25
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +71 -14
- package/packages/scrollbar/src/scrollbar.ts +21 -6
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tree/src/tree.ts +49 -26
- package/styles/components/drawer.scss +13 -6
- package/styles/components/modal.scss +12 -4
- package/types/components/drawer.d.ts +20 -0
- package/types/components/gantt-module/gantt-view.d.ts +24 -1
- package/types/components/gantt-plugins/extend-gantt-chart.d.ts +1 -1
- package/types/components/gantt.d.ts +2 -0
- package/types/components/layout-aside.d.ts +15 -0
- package/types/components/layout-body.d.ts +3 -0
- package/types/components/list.d.ts +18 -1
- package/types/components/modal.d.ts +20 -0
- package/types/components/number-input.d.ts +12 -2
- package/types/components/table-plugins/extend-pivot-table.d.ts +1 -1
- package/types/components/table.d.ts +36 -2
- package/types/components/tree.d.ts +15 -1
- package/es/scrollbar/src/util.js +0 -54
- package/lib/scrollbar/src/util.js +0 -63
- package/lib/scrollbar/src/util.min.js +0 -1
- package/packages/scrollbar/src/util.ts +0 -57
- /package/es/icon/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
- /package/es/icon/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
- /package/es/icon/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
- /package/es/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
- /package/es/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
- /package/es/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
- /package/lib/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
- /package/lib/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
- /package/lib/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { h, PropType, ref, Ref, computed, onBeforeUnmount, watch, reactive, nextTick, onActivated, onMounted, VNode } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import { VxeUI,
|
|
4
|
+
import { VxeUI, useSize, 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'
|
|
8
8
|
import { createComponentLog } from '../../ui/src/log'
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
|
|
10
|
-
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from '../../scrollbar/src/util'
|
|
11
10
|
import { getItemCacheObj } from './util'
|
|
12
11
|
import VxeLoadingComponent from '../../loading'
|
|
13
12
|
|
|
14
13
|
import type { VxeListConstructor, VxeListPropTypes, VxeListEmits, ListReactData, VxeListPrivateMethods, ListInternalData, VxeListDefines, ValueOf, ListMethods, ListPrivateMethods, ListPrivateRef, VxeComponentStyleType } from '../../../types'
|
|
15
14
|
|
|
15
|
+
const { getConfig, getIcon, getI18n, domUtils, scrollbarUtils, menus, globalEvents, globalResize } = VxeUI
|
|
16
|
+
|
|
17
|
+
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils
|
|
18
|
+
|
|
16
19
|
const { warnLog, errLog } = createComponentLog('tree')
|
|
17
20
|
|
|
18
21
|
function getRowKeyByField (row: any, keyField: string) {
|
|
@@ -63,8 +66,10 @@ function createInternalData (): ListInternalData {
|
|
|
63
66
|
fullKeyMaps: {},
|
|
64
67
|
rowMaps: {},
|
|
65
68
|
|
|
66
|
-
// 滚动条
|
|
67
69
|
// resizeObserver: undefined,
|
|
70
|
+
|
|
71
|
+
// 滚动条
|
|
72
|
+
// scrollObserver: undefined,
|
|
68
73
|
// isThumbDrag: false,
|
|
69
74
|
thumbDragOffset: 0,
|
|
70
75
|
yThumbTop: 0,
|
|
@@ -133,7 +138,7 @@ export default defineVxeComponent({
|
|
|
133
138
|
scrollY: Object as PropType<VxeListPropTypes.ScrollY>,
|
|
134
139
|
useScrollbar: {
|
|
135
140
|
type: Boolean as PropType<VxeListPropTypes.UseScrollbar>,
|
|
136
|
-
default: () => getConfig().list.useScrollbar
|
|
141
|
+
default: () => getDefaultConfig(getConfig().list.useScrollbar, getConfig().useScrollbar)
|
|
137
142
|
},
|
|
138
143
|
scrollbarConfig: Object as PropType<VxeListPropTypes.ScrollbarConfig>
|
|
139
144
|
},
|
|
@@ -241,11 +246,8 @@ export default defineVxeComponent({
|
|
|
241
246
|
|
|
242
247
|
const computeWrapperStyles = computed(() => {
|
|
243
248
|
const rowHeight = computeRowHeight.value
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
247
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
248
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
249
|
+
const barWidth = computeScrollYWidth.value
|
|
250
|
+
const barHeight = computeScrollXHeight.value
|
|
249
251
|
const stys: VxeComponentStyleType = {}
|
|
250
252
|
if (rowHeight) {
|
|
251
253
|
stys['--vxe-ui-list-row-height'] = toCssUnit(rowHeight)
|
|
@@ -284,6 +286,18 @@ export default defineVxeComponent({
|
|
|
284
286
|
return Object.assign({}, getConfig().scrollbar.yConfig, scrollbarOpts.yConfig)
|
|
285
287
|
})
|
|
286
288
|
|
|
289
|
+
const computeScrollXHeight = computed(() => {
|
|
290
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
291
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
292
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
const computeScrollYWidth = computed(() => {
|
|
296
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
297
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
298
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
299
|
+
})
|
|
300
|
+
|
|
287
301
|
const computeScrollXVisible = computed(() => {
|
|
288
302
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
289
303
|
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
@@ -309,15 +323,11 @@ export default defineVxeComponent({
|
|
|
309
323
|
})
|
|
310
324
|
|
|
311
325
|
const computeScrollbarWrapperClss = computed(() => {
|
|
312
|
-
const scrollbarOpts = computeScrollbarOpts.value
|
|
313
|
-
const { padding } = scrollbarOpts
|
|
314
326
|
const { yThumbHeight, xThumbWidth } = reactData
|
|
315
327
|
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
316
328
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
317
329
|
const scrollXVisible = computeScrollXVisible.value
|
|
318
330
|
const scrollYVisible = computeScrollYVisible.value
|
|
319
|
-
const scrollXAutoHide = computeScrollXAutoHide.value
|
|
320
|
-
const scrollYAutoHide = computeScrollYAutoHide.value
|
|
321
331
|
return domUtils.buildClass([
|
|
322
332
|
'vxe-scrollbar is--virtual',
|
|
323
333
|
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
@@ -325,9 +335,6 @@ export default defineVxeComponent({
|
|
|
325
335
|
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
326
336
|
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
327
337
|
], {
|
|
328
|
-
'is--padding': padding,
|
|
329
|
-
'ov-x--auto-hide': scrollXAutoHide,
|
|
330
|
-
'ov-y--auto-hide': scrollYAutoHide,
|
|
331
338
|
'overflow-y': yThumbHeight,
|
|
332
339
|
'overflow-x': xThumbWidth
|
|
333
340
|
})
|
|
@@ -360,6 +367,11 @@ export default defineVxeComponent({
|
|
|
360
367
|
return getRowIdByField(row, keyField)
|
|
361
368
|
}
|
|
362
369
|
|
|
370
|
+
const getParentElem = () => {
|
|
371
|
+
const el = refElem.value
|
|
372
|
+
return el ? el.parentElement : null
|
|
373
|
+
}
|
|
374
|
+
|
|
363
375
|
const calcTableHeight = (key: 'height' | 'maxHeight') => {
|
|
364
376
|
const { parentHeight } = reactData
|
|
365
377
|
const val = props[key]
|
|
@@ -2540,6 +2552,12 @@ export default defineVxeComponent({
|
|
|
2540
2552
|
watch(computeRowHeight, () => {
|
|
2541
2553
|
reFlag.value++
|
|
2542
2554
|
})
|
|
2555
|
+
watch(computeScrollYWidth, () => {
|
|
2556
|
+
reFlag.value++
|
|
2557
|
+
})
|
|
2558
|
+
watch(computeScrollXHeight, () => {
|
|
2559
|
+
reFlag.value++
|
|
2560
|
+
})
|
|
2543
2561
|
watch(computeScrollXVisible, () => {
|
|
2544
2562
|
nextTick(() => {
|
|
2545
2563
|
reFlag.value++
|
|
@@ -2605,20 +2623,32 @@ export default defineVxeComponent({
|
|
|
2605
2623
|
if (useKey && !keyField) {
|
|
2606
2624
|
errLog('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField'])
|
|
2607
2625
|
}
|
|
2608
|
-
|
|
2609
|
-
|
|
2626
|
+
const el = refElem.value
|
|
2627
|
+
if (useScrollbar) {
|
|
2610
2628
|
const viewInnerEl = refVirtualBody.value
|
|
2611
|
-
const
|
|
2629
|
+
const scrollObserver = globalResize.create(() => {
|
|
2612
2630
|
reFlag.value++
|
|
2613
2631
|
})
|
|
2614
2632
|
if (el) {
|
|
2615
|
-
|
|
2616
|
-
if (autoResize) {
|
|
2617
|
-
resizeObserver.observe(el.parentElement as HTMLDivElement)
|
|
2618
|
-
}
|
|
2633
|
+
scrollObserver.observe(el)
|
|
2619
2634
|
}
|
|
2620
2635
|
if (viewInnerEl) {
|
|
2621
|
-
|
|
2636
|
+
scrollObserver.observe(viewInnerEl)
|
|
2637
|
+
}
|
|
2638
|
+
internalData.scrollObserver = scrollObserver
|
|
2639
|
+
}
|
|
2640
|
+
if (autoResize) {
|
|
2641
|
+
const parentEl = getParentElem()
|
|
2642
|
+
const resizeObserver = globalResize.create(() => {
|
|
2643
|
+
if (props.autoResize) {
|
|
2644
|
+
reFlag.value++
|
|
2645
|
+
}
|
|
2646
|
+
})
|
|
2647
|
+
if (el) {
|
|
2648
|
+
resizeObserver.observe(el)
|
|
2649
|
+
}
|
|
2650
|
+
if (parentEl) {
|
|
2651
|
+
resizeObserver.observe(parentEl)
|
|
2622
2652
|
}
|
|
2623
2653
|
internalData.resizeObserver = resizeObserver
|
|
2624
2654
|
}
|
|
@@ -2629,10 +2659,13 @@ export default defineVxeComponent({
|
|
|
2629
2659
|
})
|
|
2630
2660
|
|
|
2631
2661
|
onBeforeUnmount(() => {
|
|
2632
|
-
const { resizeObserver } = internalData
|
|
2662
|
+
const { scrollObserver, resizeObserver } = internalData
|
|
2633
2663
|
if (resizeObserver) {
|
|
2634
2664
|
resizeObserver.disconnect()
|
|
2635
2665
|
}
|
|
2666
|
+
if (scrollObserver) {
|
|
2667
|
+
scrollObserver.disconnect()
|
|
2668
|
+
}
|
|
2636
2669
|
globalEvents.off($xeList, 'resize')
|
|
2637
2670
|
XEUtils.assign(reactData, createReactData())
|
|
2638
2671
|
XEUtils.assign(internalData, createInternalData())
|
|
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI, createEvent, permission, useSize, globalEvents, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getPopupContainer, scrollToView, toCssUnit } from '../../ui/src/dom'
|
|
6
|
-
import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils'
|
|
6
|
+
import { getLastZIndex, nextZIndex, isEnableConf, getDefaultConfig } from '../../ui/src/utils'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { createComponentLog } from '../../ui/src/log'
|
|
9
9
|
import VxeLoadingComponent from '../../loading'
|
|
@@ -74,7 +74,7 @@ export default defineVxeComponent({
|
|
|
74
74
|
menuConfig: Object as PropType<VxeMenuPropTypes.MenuConfig>,
|
|
75
75
|
useScrollbar: {
|
|
76
76
|
type: Boolean as PropType<VxeMenuPropTypes.UseScrollbar>,
|
|
77
|
-
default: () => getConfig().menu.useScrollbar
|
|
77
|
+
default: () => getDefaultConfig(getConfig().menu.useScrollbar, getConfig().useScrollbar)
|
|
78
78
|
},
|
|
79
79
|
scrollbarConfig: Object as PropType<VxeMenuPropTypes.ScrollbarConfig>,
|
|
80
80
|
appendTo: {
|
|
@@ -2,13 +2,14 @@ import { h, Teleport, ref, Ref, inject, computed, reactive, provide, nextTick, w
|
|
|
2
2
|
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
|
-
import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue } from '../../ui/src/utils'
|
|
5
|
+
import { getLastZIndex, nextZIndex, getSubLastZIndex, nextSubZIndex, getFuncText, handleBooleanDefaultValue, getDefaultConfig } from '../../ui/src/utils'
|
|
6
6
|
import { VxeUI, getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useSize, 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'
|
|
10
10
|
import VxeButtonComponent from '../../button'
|
|
11
11
|
import VxeLoadingComponent from '../../loading'
|
|
12
|
+
import VxeScrollbarComponent from '../../scrollbar'
|
|
12
13
|
|
|
13
14
|
import type { VxeModalConstructor, VxeModalPropTypes, ModalReactData, ModalInternalData, VxeModalEmits, VxeModalPrivateComputed, ModalEventTypes, VxeButtonInstance, ModalMethods, ModalPrivateRef, VxeModalMethods, ValueOf, VxeDrawerConstructor, VxeDrawerMethods, VxeFormConstructor, VxeFormPrivateMethods } from '../../../types'
|
|
14
15
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
@@ -223,6 +224,11 @@ export default defineVxeComponent({
|
|
|
223
224
|
},
|
|
224
225
|
beforeHideMethod: Function as PropType<VxeModalPropTypes.BeforeHideMethod>,
|
|
225
226
|
slots: Object as PropType<VxeModalPropTypes.Slots>,
|
|
227
|
+
useScrollbar: {
|
|
228
|
+
type: Boolean as PropType<VxeModalPropTypes.UseScrollbar>,
|
|
229
|
+
default: () => getDefaultConfig(getConfig().modal.useScrollbar, getConfig().useScrollbar)
|
|
230
|
+
},
|
|
231
|
+
scrollbarConfig: Object as PropType<VxeModalPropTypes.ScrollbarConfig>,
|
|
226
232
|
|
|
227
233
|
/**
|
|
228
234
|
* 已废弃
|
|
@@ -310,6 +316,27 @@ export default defineVxeComponent({
|
|
|
310
316
|
return Object.assign({}, getConfig().modal.zoomConfig, props.zoomConfig)
|
|
311
317
|
})
|
|
312
318
|
|
|
319
|
+
const computeScrollbarOpts = computed(() => {
|
|
320
|
+
return Object.assign({}, getConfig().modal.scrollbarConfig, props.scrollbarConfig)
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
const computeScrollbarProps = computed(() => {
|
|
324
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
325
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
326
|
+
return {
|
|
327
|
+
width: scrollbarOpts.width,
|
|
328
|
+
height: scrollbarOpts.height,
|
|
329
|
+
autoHide: scrollbarOpts.autoHide,
|
|
330
|
+
visible: scrollbarOpts.visible,
|
|
331
|
+
xConfig: scrollbarOpts.xConfig,
|
|
332
|
+
yConfig: scrollbarOpts.yConfig,
|
|
333
|
+
className: scrollbarOpts.className,
|
|
334
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
335
|
+
viewClassName: 'vxe-modal--scrollbar-content-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
336
|
+
viewInnerClassName: 'vxe-modal--scrollbar-content-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
337
|
+
}
|
|
338
|
+
})
|
|
339
|
+
|
|
313
340
|
const computeMaps: VxeModalPrivateComputed = {
|
|
314
341
|
computeSize,
|
|
315
342
|
computeZoomOpts
|
|
@@ -1371,9 +1398,10 @@ export default defineVxeComponent({
|
|
|
1371
1398
|
}
|
|
1372
1399
|
|
|
1373
1400
|
const renderBody = () => {
|
|
1374
|
-
const { slots: propSlots = {}, status, message, iconStatus, useHtml } = props
|
|
1401
|
+
const { slots: propSlots = {}, status, message, iconStatus, useScrollbar, useHtml } = props
|
|
1375
1402
|
const content = props.content || message
|
|
1376
1403
|
const isMsg = computeIsMsg.value
|
|
1404
|
+
const scrollbarProps = computeScrollbarProps.value
|
|
1377
1405
|
const defaultSlot = slots.default || propSlots.default
|
|
1378
1406
|
const leftSlot = slots.left || propSlots.left
|
|
1379
1407
|
const rightSlot = slots.right || propSlots.right
|
|
@@ -1389,18 +1417,47 @@ export default defineVxeComponent({
|
|
|
1389
1417
|
])
|
|
1390
1418
|
)
|
|
1391
1419
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1420
|
+
|
|
1421
|
+
if (useHtml && !defaultSlot) {
|
|
1422
|
+
contVNs.push(
|
|
1423
|
+
useScrollbar
|
|
1424
|
+
? h(VxeScrollbarComponent, {
|
|
1425
|
+
key: 'shc',
|
|
1426
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1427
|
+
...scrollbarProps
|
|
1428
|
+
}, {
|
|
1429
|
+
default () {
|
|
1430
|
+
return [
|
|
1431
|
+
h('div', {
|
|
1432
|
+
class: 'vxe-modal--scrollbar-content-html',
|
|
1433
|
+
innerHTML: getFuncText(content)
|
|
1434
|
+
})
|
|
1435
|
+
]
|
|
1436
|
+
}
|
|
1437
|
+
})
|
|
1438
|
+
: h('div', {
|
|
1439
|
+
key: 'hc',
|
|
1440
|
+
class: 'vxe-modal--content',
|
|
1441
|
+
innerHTML: getFuncText(content)
|
|
1442
|
+
})
|
|
1443
|
+
)
|
|
1444
|
+
} else {
|
|
1445
|
+
contVNs.push(
|
|
1446
|
+
useScrollbar
|
|
1447
|
+
? h(VxeScrollbarComponent, {
|
|
1448
|
+
key: 'sdc',
|
|
1449
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1450
|
+
...scrollbarProps
|
|
1451
|
+
}, {
|
|
1452
|
+
default: () => defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content)
|
|
1453
|
+
})
|
|
1454
|
+
: h('div', {
|
|
1455
|
+
key: 'dc',
|
|
1456
|
+
class: 'vxe-modal--content'
|
|
1457
|
+
}, defaultSlot ? getSlotVNs(defaultSlot({ $modal: $xeModal })) : getFuncText(content))
|
|
1458
|
+
)
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1404
1461
|
return h('div', {
|
|
1405
1462
|
class: 'vxe-modal--body'
|
|
1406
1463
|
}, [
|
|
@@ -3,13 +3,14 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import { toCssUnit } from '../../ui/src/dom'
|
|
6
|
-
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from './util'
|
|
7
6
|
import { getDefaultConfig } from '../../ui/src/utils'
|
|
8
7
|
import VxeLoadingComponent from '../../loading'
|
|
9
8
|
|
|
10
9
|
import type { ScrollbarReactData, ScrollbarInternalData, VxeScrollbarEmits, ScrollbarMethods, ScrollbarPrivateMethods, VxeScrollbarPropTypes, ValueOf, ScrollbarPrivateRef, VxeScrollbarPrivateComputed, VxeScrollbarConstructor, VxeScrollbarPrivateMethods, VxeComponentStyleType } from '../../../types'
|
|
11
10
|
|
|
12
|
-
const { getConfig, createEvent, domUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI
|
|
11
|
+
const { getConfig, createEvent, domUtils, scrollbarUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI
|
|
12
|
+
|
|
13
|
+
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils
|
|
13
14
|
|
|
14
15
|
function createReactData (): ScrollbarReactData {
|
|
15
16
|
return {
|
|
@@ -105,10 +106,8 @@ export default defineVxeComponent({
|
|
|
105
106
|
|
|
106
107
|
const computeWrapperStyle = computed(() => {
|
|
107
108
|
const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const barWidth = yOpts.width
|
|
111
|
-
const barHeight = xOpts.height
|
|
109
|
+
const barWidth = computeYWidth.value
|
|
110
|
+
const barHeight = computeXHeight.value
|
|
112
111
|
const stys: VxeComponentStyleType = {}
|
|
113
112
|
if (width) {
|
|
114
113
|
stys.width = toCssUnit(width)
|
|
@@ -135,6 +134,16 @@ export default defineVxeComponent({
|
|
|
135
134
|
return stys
|
|
136
135
|
})
|
|
137
136
|
|
|
137
|
+
const computeXHeight = computed(() => {
|
|
138
|
+
const xOpts = computeXOpts.value
|
|
139
|
+
return xOpts.height
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
const computeYWidth = computed(() => {
|
|
143
|
+
const yOpts = computeYOpts.value
|
|
144
|
+
return yOpts.width
|
|
145
|
+
})
|
|
146
|
+
|
|
138
147
|
const computeXVisible = computed(() => {
|
|
139
148
|
const { visible } = props
|
|
140
149
|
const xOpts = computeXOpts.value
|
|
@@ -642,6 +651,12 @@ export default defineVxeComponent({
|
|
|
642
651
|
watch(() => props.syncResize, () => {
|
|
643
652
|
reFlag.value++
|
|
644
653
|
})
|
|
654
|
+
watch(computeYWidth, () => {
|
|
655
|
+
reFlag.value++
|
|
656
|
+
})
|
|
657
|
+
watch(computeXHeight, () => {
|
|
658
|
+
reFlag.value++
|
|
659
|
+
})
|
|
645
660
|
watch(computeXVisible, () => {
|
|
646
661
|
nextTick(() => {
|
|
647
662
|
reFlag.value++
|
|
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import { createEvent, getConfig, getIcon, globalEvents, permission, useSize, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
5
5
|
import { toCssUnit, addClass, removeClass } from '../../ui/src/dom'
|
|
6
|
-
import { isEnableConf } from '../../ui/src/utils'
|
|
6
|
+
import { getDefaultConfig, isEnableConf } from '../../ui/src/utils'
|
|
7
7
|
import { createComponentLog } from '../../ui/src/log'
|
|
8
8
|
import XEUtils from 'xe-utils'
|
|
9
9
|
import VxeLoadingComponent from '../../loading'
|
|
@@ -55,7 +55,7 @@ export default defineVxeComponent({
|
|
|
55
55
|
},
|
|
56
56
|
useScrollbar: {
|
|
57
57
|
type: Boolean as PropType<VxeTabsPropTypes.UseScrollbar>,
|
|
58
|
-
default: () => getConfig().tabs.useScrollbar
|
|
58
|
+
default: () => getDefaultConfig(getConfig().tabs.useScrollbar, getConfig().useScrollbar)
|
|
59
59
|
},
|
|
60
60
|
scrollbarConfig: Object as PropType<VxeTabsPropTypes.ScrollbarConfig>,
|
|
61
61
|
// 已废弃
|
|
@@ -9,7 +9,6 @@ import { getSlotVNs } from '../../ui/src/vn'
|
|
|
9
9
|
import { toCssUnit, isScale, getPaddingTopBottomSize, addClass, removeClass, getTpImg, hasControlKey, getEventTargetNode, hasClass } from '../../ui/src/dom'
|
|
10
10
|
import { isEnableConf, enModelValue, deModelValue, getText, getDefaultConfig } from '../../ui/src/utils'
|
|
11
11
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
|
|
12
|
-
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from '../../scrollbar/src/util'
|
|
13
12
|
import VxeLoadingComponent from '../../loading'
|
|
14
13
|
import VxeTooltipComponent from '../../tooltip'
|
|
15
14
|
|
|
@@ -17,7 +16,9 @@ import type { TreeReactData, VxeTreeEmits, VxeTreePropTypes, TreeInternalData, T
|
|
|
17
16
|
|
|
18
17
|
const { warnLog, errLog } = createComponentLog('tree')
|
|
19
18
|
|
|
20
|
-
const { menus, getConfig, getI18n, getIcon } = VxeUI
|
|
19
|
+
const { menus, scrollbarUtils, getConfig, getI18n, getIcon } = VxeUI
|
|
20
|
+
|
|
21
|
+
const { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } = scrollbarUtils
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* 生成节点的唯一主键
|
|
@@ -70,8 +71,10 @@ function createInternalData (): TreeInternalData {
|
|
|
70
71
|
treeExpandedMaps: {},
|
|
71
72
|
treeExpandLazyLoadedMaps: {},
|
|
72
73
|
|
|
73
|
-
// 滚动条
|
|
74
74
|
// resizeObserver: undefined,
|
|
75
|
+
|
|
76
|
+
// 滚动条
|
|
77
|
+
// scrollObserver: undefined,
|
|
75
78
|
// isThumbDrag: false,
|
|
76
79
|
thumbDragOffset: 0,
|
|
77
80
|
yThumbTop: 0,
|
|
@@ -236,7 +239,7 @@ export default defineVxeComponent({
|
|
|
236
239
|
virtualYConfig: Object as PropType<VxeTreePropTypes.VirtualYConfig>,
|
|
237
240
|
useScrollbar: {
|
|
238
241
|
type: Boolean as PropType<VxeTreePropTypes.UseScrollbar>,
|
|
239
|
-
default: () => getConfig().tree.useScrollbar
|
|
242
|
+
default: () => getDefaultConfig(getConfig().tree.useScrollbar, getConfig().useScrollbar)
|
|
240
243
|
},
|
|
241
244
|
scrollbarConfig: Object as PropType<VxeTreePropTypes.ScrollbarConfig>
|
|
242
245
|
},
|
|
@@ -373,11 +376,8 @@ export default defineVxeComponent({
|
|
|
373
376
|
})
|
|
374
377
|
|
|
375
378
|
const computeWrapperStyles = computed(() => {
|
|
376
|
-
const
|
|
377
|
-
const
|
|
378
|
-
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
379
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
380
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
379
|
+
const barWidth = computeScrollYWidth.value
|
|
380
|
+
const barHeight = computeScrollXHeight.value
|
|
381
381
|
const stys: VxeComponentStyleType = {}
|
|
382
382
|
if (barWidth || barHeight) {
|
|
383
383
|
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
|
|
@@ -436,6 +436,18 @@ export default defineVxeComponent({
|
|
|
436
436
|
return Object.assign({}, getConfig().scrollbar.yConfig, scrollbarOpts.yConfig)
|
|
437
437
|
})
|
|
438
438
|
|
|
439
|
+
const computeScrollXHeight = computed(() => {
|
|
440
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
441
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
442
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), getConfig().scrollbar.height)
|
|
443
|
+
})
|
|
444
|
+
|
|
445
|
+
const computeScrollYWidth = computed(() => {
|
|
446
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
447
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
448
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), getConfig().scrollbar.width)
|
|
449
|
+
})
|
|
450
|
+
|
|
439
451
|
const computeScrollXVisible = computed(() => {
|
|
440
452
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
441
453
|
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
@@ -461,15 +473,11 @@ export default defineVxeComponent({
|
|
|
461
473
|
})
|
|
462
474
|
|
|
463
475
|
const computeScrollbarWrapperClss = computed(() => {
|
|
464
|
-
const scrollbarOpts = computeScrollbarOpts.value
|
|
465
|
-
const { padding } = scrollbarOpts
|
|
466
476
|
const { yThumbHeight, xThumbWidth } = reactData
|
|
467
477
|
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
468
478
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
469
479
|
const scrollXVisible = computeScrollXVisible.value
|
|
470
480
|
const scrollYVisible = computeScrollYVisible.value
|
|
471
|
-
const scrollXAutoHide = computeScrollXAutoHide.value
|
|
472
|
-
const scrollYAutoHide = computeScrollYAutoHide.value
|
|
473
481
|
return domUtils.buildClass([
|
|
474
482
|
'vxe-scrollbar is--virtual',
|
|
475
483
|
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
@@ -477,9 +485,6 @@ export default defineVxeComponent({
|
|
|
477
485
|
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
478
486
|
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
479
487
|
], {
|
|
480
|
-
'is--padding': padding,
|
|
481
|
-
'ov-x--auto-hide': scrollXAutoHide,
|
|
482
|
-
'ov-y--auto-hide': scrollYAutoHide,
|
|
483
488
|
'overflow-y': yThumbHeight,
|
|
484
489
|
'overflow-x': xThumbWidth
|
|
485
490
|
})
|
|
@@ -3855,6 +3860,12 @@ export default defineVxeComponent({
|
|
|
3855
3860
|
watch(() => props.useScrollbar, () => {
|
|
3856
3861
|
reFlag.value++
|
|
3857
3862
|
})
|
|
3863
|
+
watch(computeScrollYWidth, () => {
|
|
3864
|
+
reFlag.value++
|
|
3865
|
+
})
|
|
3866
|
+
watch(computeScrollXHeight, () => {
|
|
3867
|
+
reFlag.value++
|
|
3868
|
+
})
|
|
3858
3869
|
watch(computeScrollXVisible, () => {
|
|
3859
3870
|
nextTick(() => {
|
|
3860
3871
|
reFlag.value++
|
|
@@ -3893,23 +3904,32 @@ export default defineVxeComponent({
|
|
|
3893
3904
|
if (menuConfig && !VxeUIContextMenu) {
|
|
3894
3905
|
errLog('vxe.error.reqComp', ['vxe-context-menu'])
|
|
3895
3906
|
}
|
|
3907
|
+
const el = refElem.value
|
|
3896
3908
|
if (useScrollbar || autoResize) {
|
|
3897
|
-
const el = refElem.value
|
|
3898
3909
|
const viewInnerEl = refVirtualBody.value
|
|
3910
|
+
const scrollObserver = globalResize.create(() => {
|
|
3911
|
+
updateScrollbar()
|
|
3912
|
+
})
|
|
3913
|
+
if (el) {
|
|
3914
|
+
scrollObserver.observe(el)
|
|
3915
|
+
}
|
|
3916
|
+
if (viewInnerEl) {
|
|
3917
|
+
scrollObserver.observe(viewInnerEl)
|
|
3918
|
+
}
|
|
3919
|
+
internalData.scrollObserver = scrollObserver
|
|
3920
|
+
}
|
|
3921
|
+
if (autoResize) {
|
|
3899
3922
|
const parentEl = getParentElem()
|
|
3900
3923
|
const resizeObserver = globalResize.create(() => {
|
|
3901
|
-
|
|
3924
|
+
if (props.autoResize) {
|
|
3925
|
+
reFlag.value++
|
|
3926
|
+
}
|
|
3902
3927
|
})
|
|
3903
3928
|
if (el) {
|
|
3904
3929
|
resizeObserver.observe(el)
|
|
3905
|
-
if (autoResize) {
|
|
3906
|
-
if (parentEl) {
|
|
3907
|
-
resizeObserver.observe(parentEl)
|
|
3908
|
-
}
|
|
3909
|
-
}
|
|
3910
3930
|
}
|
|
3911
|
-
if (
|
|
3912
|
-
resizeObserver.observe(
|
|
3931
|
+
if (parentEl) {
|
|
3932
|
+
resizeObserver.observe(parentEl)
|
|
3913
3933
|
}
|
|
3914
3934
|
internalData.resizeObserver = resizeObserver
|
|
3915
3935
|
}
|
|
@@ -3921,10 +3941,13 @@ export default defineVxeComponent({
|
|
|
3921
3941
|
})
|
|
3922
3942
|
|
|
3923
3943
|
onBeforeUnmount(() => {
|
|
3924
|
-
const { resizeObserver } = internalData
|
|
3944
|
+
const { scrollObserver, resizeObserver } = internalData
|
|
3925
3945
|
if (resizeObserver) {
|
|
3926
3946
|
resizeObserver.disconnect()
|
|
3927
3947
|
}
|
|
3948
|
+
if (scrollObserver) {
|
|
3949
|
+
scrollObserver.disconnect()
|
|
3950
|
+
}
|
|
3928
3951
|
globalEvents.off($xeTree, 'resize')
|
|
3929
3952
|
XEUtils.assign(reactData, createReactData())
|
|
3930
3953
|
XEUtils.assign(internalData, createInternalData())
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
&.is--drag {
|
|
182
182
|
cursor: move;
|
|
183
183
|
transition: none;
|
|
184
|
-
.vxe-
|
|
185
|
-
.vxe-
|
|
184
|
+
.vxe-drawer--body,
|
|
185
|
+
.vxe-drawer--footer {
|
|
186
186
|
&:after {
|
|
187
187
|
content: "";
|
|
188
188
|
position: absolute;
|
|
@@ -192,9 +192,10 @@
|
|
|
192
192
|
height: 100%;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
.vxe-
|
|
195
|
+
.vxe-drawer--body {
|
|
196
196
|
overflow: hidden;
|
|
197
|
-
.vxe-
|
|
197
|
+
.vxe-drawer--content,
|
|
198
|
+
.vxe-drawer--scrollbar-content {
|
|
198
199
|
overflow: hidden;
|
|
199
200
|
}
|
|
200
201
|
}
|
|
@@ -213,7 +214,8 @@
|
|
|
213
214
|
overflow: auto;
|
|
214
215
|
outline: 0;
|
|
215
216
|
}
|
|
216
|
-
.vxe-drawer--content
|
|
217
|
+
.vxe-drawer--content,
|
|
218
|
+
.vxe-drawer--scrollbar-content {
|
|
217
219
|
flex-grow: 1;
|
|
218
220
|
white-space: pre-line;
|
|
219
221
|
}
|
|
@@ -227,7 +229,8 @@
|
|
|
227
229
|
flex-grow: 1;
|
|
228
230
|
overflow: auto;
|
|
229
231
|
outline: 0;
|
|
230
|
-
.vxe-drawer--content
|
|
232
|
+
.vxe-drawer--content,
|
|
233
|
+
.vxe-drawer--scrollbar-content {
|
|
231
234
|
overflow: auto;
|
|
232
235
|
}
|
|
233
236
|
}
|
|
@@ -349,3 +352,7 @@
|
|
|
349
352
|
overflow: hidden;
|
|
350
353
|
}
|
|
351
354
|
}
|
|
355
|
+
|
|
356
|
+
.vxe-drawer--scrollbar-content {
|
|
357
|
+
width: 100%;
|
|
358
|
+
}
|
|
@@ -52,7 +52,8 @@ html[data-vxe-lock-scroll] {
|
|
|
52
52
|
}
|
|
53
53
|
.vxe-modal--body {
|
|
54
54
|
overflow: hidden;
|
|
55
|
-
.vxe-modal--content
|
|
55
|
+
.vxe-modal--content,
|
|
56
|
+
.vxe-modal--scrollbar-content {
|
|
56
57
|
overflow: hidden;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -74,7 +75,8 @@ html[data-vxe-lock-scroll] {
|
|
|
74
75
|
align-items: center;
|
|
75
76
|
font-size: 1.6em;
|
|
76
77
|
}
|
|
77
|
-
.vxe-modal--content
|
|
78
|
+
.vxe-modal--content,
|
|
79
|
+
.vxe-modal--scrollbar-content {
|
|
78
80
|
flex-grow: 1;
|
|
79
81
|
white-space: pre-line;
|
|
80
82
|
}
|
|
@@ -447,7 +449,8 @@ html[data-vxe-lock-scroll] {
|
|
|
447
449
|
visibility: hidden;
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
|
-
.vxe-modal--content
|
|
452
|
+
.vxe-modal--content,
|
|
453
|
+
.vxe-modal--scrollbar-content {
|
|
451
454
|
max-width: 800px;
|
|
452
455
|
float: left;
|
|
453
456
|
}
|
|
@@ -478,7 +481,8 @@ html[data-vxe-lock-scroll] {
|
|
|
478
481
|
}
|
|
479
482
|
.vxe-modal--body {
|
|
480
483
|
overflow: auto;
|
|
481
|
-
.vxe-modal--content
|
|
484
|
+
.vxe-modal--content,
|
|
485
|
+
.vxe-modal--scrollbar-content {
|
|
482
486
|
overflow: auto;
|
|
483
487
|
}
|
|
484
488
|
}
|
|
@@ -538,3 +542,7 @@ html[data-vxe-lock-scroll] {
|
|
|
538
542
|
overflow: hidden;
|
|
539
543
|
}
|
|
540
544
|
}
|
|
545
|
+
|
|
546
|
+
.vxe-modal--scrollbar-content {
|
|
547
|
+
width: 100%;
|
|
548
|
+
}
|