vxe-pc-ui 4.20.0 → 4.20.2
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 +780 -173
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/card/src/card.js +19 -4
- 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/language/fr-FR.js +29 -29
- package/es/layout-aside/src/layout-aside.js +10 -6
- package/es/layout-body/src/layout-body.js +21 -12
- package/es/list/src/list.js +118 -49
- package/es/list/style.css +25 -8
- package/es/list/style.min.css +1 -1
- 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 +73 -19
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +21 -6
- package/es/tree/src/tree.js +410 -53
- package/es/tree/style.css +43 -0
- package/es/tree/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +3 -0
- package/es/vxe-drawer/style.css +13 -6
- package/es/vxe-drawer/style.min.css +1 -1
- package/es/vxe-list/style.css +25 -8
- package/es/vxe-list/style.min.css +1 -1
- package/es/vxe-modal/style.css +15 -4
- package/es/vxe-modal/style.min.css +1 -1
- package/es/vxe-tree/style.css +43 -0
- package/es/vxe-tree/style.min.css +1 -1
- package/lib/card/src/card.js +19 -4
- 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 +887 -183
- package/lib/index.umd.min.js +1 -1
- package/lib/language/fr-FR.js +29 -29
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +29 -29
- package/lib/layout-aside/src/layout-aside.js +9 -8
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +29 -22
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/list/src/list.js +110 -47
- package/lib/list/src/list.min.js +1 -1
- package/lib/list/style/style.css +25 -8
- package/lib/list/style/style.min.css +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 +81 -17
- 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 +23 -11
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tree/src/tree.js +412 -50
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree/style/style.css +43 -0
- package/lib/tree/style/style.min.css +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/ui/src/utils.js +4 -0
- package/lib/ui/src/utils.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-list/style/style.css +25 -8
- package/lib/vxe-list/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/lib/vxe-tree/style/style.css +43 -0
- package/lib/vxe-tree/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/card/src/card.ts +20 -4
- package/packages/drawer/src/drawer.ts +73 -16
- package/packages/language/fr-FR.ts +903 -903
- package/packages/layout-aside/src/layout-aside.ts +10 -6
- package/packages/layout-body/src/layout-body.ts +25 -15
- package/packages/list/src/list.ts +130 -55
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +71 -14
- package/packages/scrollbar/src/scrollbar.ts +79 -18
- package/packages/tabs/src/tabs.ts +21 -7
- package/packages/tree/src/tree.ts +452 -62
- package/packages/ui/src/utils.ts +4 -0
- package/styles/components/drawer.scss +13 -6
- package/styles/components/list.scss +35 -10
- package/styles/components/modal.scss +12 -4
- package/styles/components/tree.scss +76 -0
- package/types/components/card.d.ts +10 -1
- package/types/components/drawer.d.ts +20 -0
- package/types/components/gantt-module/gantt-view.d.ts +24 -1
- package/types/components/gantt.d.ts +2 -0
- package/types/components/layout-aside.d.ts +10 -1
- package/types/components/layout-body.d.ts +10 -1
- package/types/components/list.d.ts +13 -2
- package/types/components/modal.d.ts +20 -0
- package/types/components/scrollbar.d.ts +17 -2
- package/types/components/table.d.ts +80 -6
- package/types/components/tabs.d.ts +10 -1
- package/types/components/tree.d.ts +35 -2
- /package/es/icon/{iconfont.1791880413927.ttf → iconfont.1792034967421.ttf} +0 -0
- /package/es/icon/{iconfont.1791880413927.woff → iconfont.1792034967421.woff} +0 -0
- /package/es/icon/{iconfont.1791880413927.woff2 → iconfont.1792034967421.woff2} +0 -0
- /package/es/{iconfont.1791880413927.ttf → iconfont.1792034967421.ttf} +0 -0
- /package/es/{iconfont.1791880413927.woff → iconfont.1792034967421.woff} +0 -0
- /package/es/{iconfont.1791880413927.woff2 → iconfont.1792034967421.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791880413927.ttf → iconfont.1792034967421.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791880413927.woff → iconfont.1792034967421.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791880413927.woff2 → iconfont.1792034967421.woff2} +0 -0
- /package/lib/{iconfont.1791880413927.ttf → iconfont.1792034967421.ttf} +0 -0
- /package/lib/{iconfont.1791880413927.woff → iconfont.1792034967421.woff} +0 -0
- /package/lib/{iconfont.1791880413927.woff2 → iconfont.1792034967421.woff2} +0 -0
|
@@ -4,6 +4,7 @@ import XEUtils from 'xe-utils'
|
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import { toCssUnit } from '../../ui/src/dom'
|
|
6
6
|
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from './util'
|
|
7
|
+
import { getDefaultConfig } from '../../ui/src/utils'
|
|
7
8
|
import VxeLoadingComponent from '../../loading'
|
|
8
9
|
|
|
9
10
|
import type { ScrollbarReactData, ScrollbarInternalData, VxeScrollbarEmits, ScrollbarMethods, ScrollbarPrivateMethods, VxeScrollbarPropTypes, ValueOf, ScrollbarPrivateRef, VxeScrollbarPrivateComputed, VxeScrollbarConstructor, VxeScrollbarPrivateMethods, VxeComponentStyleType } from '../../../types'
|
|
@@ -33,6 +34,7 @@ export default defineVxeComponent({
|
|
|
33
34
|
name: 'VxeScrollbar',
|
|
34
35
|
props: {
|
|
35
36
|
id: [String, Number] as PropType<VxeScrollbarPropTypes.Id>,
|
|
37
|
+
viewId: [String, Number] as PropType<VxeScrollbarPropTypes.ViewId>,
|
|
36
38
|
width: [String, Number] as PropType<VxeScrollbarPropTypes.Width>,
|
|
37
39
|
height: [String, Number] as PropType<VxeScrollbarPropTypes.Height>,
|
|
38
40
|
minWidth: [String, Number] as PropType<VxeScrollbarPropTypes.MinWidth>,
|
|
@@ -48,6 +50,14 @@ export default defineVxeComponent({
|
|
|
48
50
|
type: Boolean as PropType<VxeScrollbarPropTypes.Padding>,
|
|
49
51
|
default: () => getConfig().scrollbar.padding
|
|
50
52
|
},
|
|
53
|
+
autoHide: {
|
|
54
|
+
type: Boolean as PropType<VxeScrollbarPropTypes.AutoHide>,
|
|
55
|
+
default: () => getConfig().scrollbar.autoHide
|
|
56
|
+
},
|
|
57
|
+
visible: {
|
|
58
|
+
type: Boolean as PropType<VxeScrollbarPropTypes.Visible>,
|
|
59
|
+
default: () => getConfig().scrollbar.visible
|
|
60
|
+
},
|
|
51
61
|
xConfig: Object as PropType<VxeScrollbarPropTypes.XConfig>,
|
|
52
62
|
yConfig: Object as PropType<VxeScrollbarPropTypes.YConfig>,
|
|
53
63
|
className: {
|
|
@@ -95,8 +105,8 @@ export default defineVxeComponent({
|
|
|
95
105
|
|
|
96
106
|
const computeWrapperStyle = computed(() => {
|
|
97
107
|
const { width, height, minWidth, minHeight, maxWidth, maxHeight } = props
|
|
98
|
-
const
|
|
99
|
-
const
|
|
108
|
+
const barWidth = computeYWidth.value
|
|
109
|
+
const barHeight = computeXHeight.value
|
|
100
110
|
const stys: VxeComponentStyleType = {}
|
|
101
111
|
if (width) {
|
|
102
112
|
stys.width = toCssUnit(width)
|
|
@@ -116,34 +126,68 @@ export default defineVxeComponent({
|
|
|
116
126
|
if (maxHeight) {
|
|
117
127
|
stys.maxHeight = toCssUnit(maxHeight)
|
|
118
128
|
}
|
|
119
|
-
if (
|
|
120
|
-
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(
|
|
121
|
-
|
|
122
|
-
if (xOpts.height) {
|
|
123
|
-
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(xOpts.height)
|
|
129
|
+
if (barWidth || barHeight) {
|
|
130
|
+
stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight)
|
|
131
|
+
stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth)
|
|
124
132
|
}
|
|
125
133
|
return stys
|
|
126
134
|
})
|
|
127
135
|
|
|
136
|
+
const computeXHeight = computed(() => {
|
|
137
|
+
const xOpts = computeXOpts.value
|
|
138
|
+
return xOpts.height
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const computeYWidth = computed(() => {
|
|
142
|
+
const yOpts = computeYOpts.value
|
|
143
|
+
return yOpts.width
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
const computeXVisible = computed(() => {
|
|
147
|
+
const { visible } = props
|
|
148
|
+
const xOpts = computeXOpts.value
|
|
149
|
+
return getDefaultConfig(xOpts.visible, visible)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
const computeYVisible = computed(() => {
|
|
153
|
+
const { visible } = props
|
|
154
|
+
const yOpts = computeYOpts.value
|
|
155
|
+
return getDefaultConfig(yOpts.visible, visible)
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
const computeXAutoHide = computed(() => {
|
|
159
|
+
const { autoHide } = props
|
|
160
|
+
const xOpts = computeXOpts.value
|
|
161
|
+
return getDefaultConfig(xOpts.autoHide, autoHide)
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const computeYAutoHide = computed(() => {
|
|
165
|
+
const { autoHide } = props
|
|
166
|
+
const yOpts = computeYOpts.value
|
|
167
|
+
return getDefaultConfig(yOpts.autoHide, autoHide)
|
|
168
|
+
})
|
|
169
|
+
|
|
128
170
|
const computeWrapperClss = computed(() => {
|
|
129
171
|
const { native, className, padding } = props
|
|
130
172
|
const { yThumbHeight, xThumbWidth } = reactData
|
|
131
|
-
const xOpts = computeXOpts.value
|
|
132
|
-
const yOpts = computeYOpts.value
|
|
133
173
|
const xToTop = computeXToTop.value
|
|
134
174
|
const yToLeft = computeYToLeft.value
|
|
175
|
+
const xVisible = computeXVisible.value
|
|
176
|
+
const yVisible = computeYVisible.value
|
|
177
|
+
const xAutoHide = computeXAutoHide.value
|
|
178
|
+
const yAutoHide = computeYAutoHide.value
|
|
135
179
|
return domUtils.buildClass([
|
|
136
180
|
'vxe-scrollbar',
|
|
137
|
-
`ov-x--${
|
|
138
|
-
`ov-y--${
|
|
181
|
+
`ov-x--${xVisible === false ? 'hidden' : 'visible'}`,
|
|
182
|
+
`ov-y--${yVisible === false ? 'hidden' : 'visible'}`,
|
|
139
183
|
`sx-pos--${xToTop ? 'top' : 'bottom'}`,
|
|
140
184
|
`sy-pos--${yToLeft ? 'left' : 'right'}`,
|
|
141
185
|
native ? 'is--native' : 'is--virtual',
|
|
142
186
|
className
|
|
143
187
|
], {
|
|
144
188
|
'is--padding': padding,
|
|
145
|
-
'ov-x--auto-hide':
|
|
146
|
-
'ov-y--auto-hide':
|
|
189
|
+
'ov-x--auto-hide': xAutoHide,
|
|
190
|
+
'ov-y--auto-hide': yAutoHide,
|
|
147
191
|
'overflow-y': yThumbHeight,
|
|
148
192
|
'overflow-x': xThumbWidth
|
|
149
193
|
})
|
|
@@ -512,13 +556,13 @@ export default defineVxeComponent({
|
|
|
512
556
|
Object.assign($xeScrollbar, scrollbarMethods, scrollbarPrivateMethods)
|
|
513
557
|
|
|
514
558
|
const renderVN = () => {
|
|
515
|
-
const { id, native, loading, viewAttrs } = props
|
|
559
|
+
const { id, native, loading, viewId, viewAttrs } = props
|
|
516
560
|
const wrapperStyle = computeWrapperStyle.value
|
|
517
561
|
const wrapperClss = computeWrapperClss.value
|
|
518
562
|
const viewClss = computeViewClss.value
|
|
519
563
|
const viewInnerClss = computeViewInnerClss.value
|
|
520
|
-
const
|
|
521
|
-
const
|
|
564
|
+
const xVisible = computeXVisible.value
|
|
565
|
+
const yVisible = computeYVisible.value
|
|
522
566
|
const defaultSlot = slots.default
|
|
523
567
|
return h('div', {
|
|
524
568
|
ref: refElem,
|
|
@@ -530,6 +574,7 @@ export default defineVxeComponent({
|
|
|
530
574
|
ref: refViewElem,
|
|
531
575
|
class: viewClss,
|
|
532
576
|
onScroll: scrollEvent,
|
|
577
|
+
id: viewId || null,
|
|
533
578
|
...viewAttrs
|
|
534
579
|
}, [
|
|
535
580
|
h('div', {
|
|
@@ -538,7 +583,7 @@ export default defineVxeComponent({
|
|
|
538
583
|
class: viewInnerClss
|
|
539
584
|
}, defaultSlot ? defaultSlot({}) : [])
|
|
540
585
|
]),
|
|
541
|
-
native ||
|
|
586
|
+
native || xVisible === false
|
|
542
587
|
? renderEmptyElement($xeScrollbar)
|
|
543
588
|
: h('div', {
|
|
544
589
|
ref: refTrackXElem,
|
|
@@ -555,7 +600,7 @@ export default defineVxeComponent({
|
|
|
555
600
|
onLostpointercapture: cleatPointerThumbEvent
|
|
556
601
|
})
|
|
557
602
|
]),
|
|
558
|
-
native ||
|
|
603
|
+
native || yVisible === false
|
|
559
604
|
? renderEmptyElement($xeScrollbar)
|
|
560
605
|
: h('div', {
|
|
561
606
|
ref: refTrackYElem,
|
|
@@ -605,6 +650,22 @@ export default defineVxeComponent({
|
|
|
605
650
|
watch(() => props.syncResize, () => {
|
|
606
651
|
reFlag.value++
|
|
607
652
|
})
|
|
653
|
+
watch(computeYWidth, () => {
|
|
654
|
+
reFlag.value++
|
|
655
|
+
})
|
|
656
|
+
watch(computeXHeight, () => {
|
|
657
|
+
reFlag.value++
|
|
658
|
+
})
|
|
659
|
+
watch(computeXVisible, () => {
|
|
660
|
+
nextTick(() => {
|
|
661
|
+
reFlag.value++
|
|
662
|
+
})
|
|
663
|
+
})
|
|
664
|
+
watch(computeYVisible, () => {
|
|
665
|
+
nextTick(() => {
|
|
666
|
+
reFlag.value++
|
|
667
|
+
})
|
|
668
|
+
})
|
|
608
669
|
watch(reFlag, () => {
|
|
609
670
|
$xeScrollbar.recalculate().then(() => {
|
|
610
671
|
$xeScrollbar.recalculate()
|
|
@@ -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
|
// 已废弃
|
|
@@ -175,6 +175,23 @@ export default defineVxeComponent({
|
|
|
175
175
|
return Object.assign({}, getConfig().tabs.scrollbarConfig, props.scrollbarConfig)
|
|
176
176
|
})
|
|
177
177
|
|
|
178
|
+
const computeScrollbarProps = computed(() => {
|
|
179
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
180
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
181
|
+
return {
|
|
182
|
+
width: scrollbarOpts.width,
|
|
183
|
+
height: scrollbarOpts.height,
|
|
184
|
+
autoHide: scrollbarOpts.autoHide,
|
|
185
|
+
visible: scrollbarOpts.visible,
|
|
186
|
+
xConfig: scrollbarOpts.xConfig,
|
|
187
|
+
yConfig: scrollbarOpts.yConfig,
|
|
188
|
+
className: scrollbarOpts.className,
|
|
189
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
190
|
+
viewClassName: 'vxe-tabs-pane--scrollbar-item-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
191
|
+
viewInnerClassName: 'vxe-tabs-pane--scrollbar-item-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
|
|
178
195
|
const computeMaps: VxeTabsPrivateComputed = {
|
|
179
196
|
}
|
|
180
197
|
|
|
@@ -775,8 +792,7 @@ export default defineVxeComponent({
|
|
|
775
792
|
const { initNames, activeName } = reactData
|
|
776
793
|
const { name, slots } = item
|
|
777
794
|
const defaultSlot = slots ? slots.default : null
|
|
778
|
-
const
|
|
779
|
-
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
795
|
+
const scrollbarProps = computeScrollbarProps.value
|
|
780
796
|
if (name && initNames.includes(name)) {
|
|
781
797
|
return useScrollbar
|
|
782
798
|
? h(VxeScrollbarComponent, {
|
|
@@ -784,9 +800,7 @@ export default defineVxeComponent({
|
|
|
784
800
|
class: ['vxe-tabs-pane--scrollbar-item', {
|
|
785
801
|
'is--visible': activeName === name
|
|
786
802
|
}],
|
|
787
|
-
...
|
|
788
|
-
viewClassName: 'vxe-tabs-pane--scrollbar-item-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
789
|
-
viewInnerClassName: 'vxe-tabs-pane--scrollbar-item-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
803
|
+
...scrollbarProps
|
|
790
804
|
}, {
|
|
791
805
|
default: () => defaultSlot ? callSlot(defaultSlot, { name }) : []
|
|
792
806
|
})
|