vxe-pc-ui 4.19.6 → 4.19.8
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 +2206 -2111
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/card/src/card.js +35 -12
- package/es/card/style.css +42 -44
- package/es/card/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/list/src/list.js +6 -2
- package/es/row/src/col.js +39 -18
- package/es/row/src/row.js +34 -16
- package/es/row/style.css +101 -24
- package/es/row/style.min.css +1 -1
- package/es/scrollbar/src/scrollbar.js +11 -1
- package/es/scrollbar/style.css +5 -5
- package/es/scrollbar/style.min.css +1 -1
- package/es/space/style.css +1 -0
- package/es/space/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +27 -8
- package/es/tabs/style.css +4 -2
- package/es/tabs/style.min.css +1 -1
- package/es/tree/src/tree.js +6 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-card/style.css +42 -44
- package/es/vxe-card/style.min.css +1 -1
- package/es/vxe-row/style.css +101 -24
- package/es/vxe-row/style.min.css +1 -1
- package/es/vxe-scrollbar/style.css +5 -5
- package/es/vxe-scrollbar/style.min.css +1 -1
- package/es/vxe-space/style.css +1 -0
- package/es/vxe-space/style.min.css +1 -1
- package/es/vxe-tabs/style.css +4 -2
- package/es/vxe-tabs/style.min.css +1 -1
- package/lib/card/src/card.js +42 -6
- package/lib/card/src/card.min.js +1 -1
- package/lib/card/style/style.css +42 -44
- package/lib/card/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 +2600 -2463
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +5 -1
- package/lib/list/src/list.min.js +1 -1
- package/lib/row/src/col.js +43 -17
- package/lib/row/src/col.min.js +1 -1
- package/lib/row/src/row.js +38 -14
- package/lib/row/src/row.min.js +1 -1
- package/lib/row/style/style.css +101 -24
- package/lib/row/style/style.min.css +1 -1
- package/lib/scrollbar/src/scrollbar.js +11 -0
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/scrollbar/style/style.css +5 -5
- package/lib/scrollbar/style/style.min.css +1 -1
- package/lib/space/style/style.css +1 -0
- package/lib/space/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +40 -8
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tabs/style/style.css +4 -2
- package/lib/tabs/style/style.min.css +1 -1
- package/lib/tree/src/tree.js +5 -1
- 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-card/style/style.css +42 -44
- package/lib/vxe-card/style/style.min.css +1 -1
- package/lib/vxe-row/style/style.css +101 -24
- package/lib/vxe-row/style/style.min.css +1 -1
- package/lib/vxe-scrollbar/style/style.css +5 -5
- package/lib/vxe-scrollbar/style/style.min.css +1 -1
- package/lib/vxe-space/style/style.css +1 -0
- package/lib/vxe-space/style/style.min.css +1 -1
- package/lib/vxe-tabs/style/style.css +4 -2
- package/lib/vxe-tabs/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/card/src/card.ts +55 -12
- package/packages/list/src/list.ts +6 -2
- package/packages/row/src/col.ts +41 -18
- package/packages/row/src/row.ts +36 -17
- package/packages/scrollbar/src/scrollbar.ts +13 -1
- package/packages/tabs/src/tabs.ts +34 -8
- package/packages/tree/src/tree.ts +6 -2
- package/styles/components/card.scss +44 -58
- package/styles/components/row.scss +21 -3
- package/styles/components/scrollbar.scss +15 -11
- package/styles/components/space.scss +1 -0
- package/styles/components/tabs.scss +2 -1
- package/types/components/card.d.ts +11 -0
- package/types/components/grid.d.ts +37 -0
- package/types/components/layout-aside.d.ts +6 -0
- package/types/components/layout-body.d.ts +6 -0
- package/types/components/menu.d.ts +6 -0
- package/types/components/row.d.ts +2 -0
- package/types/components/table.d.ts +1 -2
- package/types/components/tabs.d.ts +11 -0
- /package/es/icon/{iconfont.1791769645781.ttf → iconfont.1791862962954.ttf} +0 -0
- /package/es/icon/{iconfont.1791769645781.woff → iconfont.1791862962954.woff} +0 -0
- /package/es/icon/{iconfont.1791769645781.woff2 → iconfont.1791862962954.woff2} +0 -0
- /package/es/{iconfont.1791769645781.ttf → iconfont.1791862962954.ttf} +0 -0
- /package/es/{iconfont.1791769645781.woff → iconfont.1791862962954.woff} +0 -0
- /package/es/{iconfont.1791769645781.woff2 → iconfont.1791862962954.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791769645781.ttf → iconfont.1791862962954.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791769645781.woff → iconfont.1791862962954.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791769645781.woff2 → iconfont.1791862962954.woff2} +0 -0
- /package/lib/{iconfont.1791769645781.ttf → iconfont.1791862962954.ttf} +0 -0
- /package/lib/{iconfont.1791769645781.woff → iconfont.1791862962954.woff} +0 -0
- /package/lib/{iconfont.1791769645781.woff2 → iconfont.1791862962954.woff2} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ref, h, reactive, PropType, computed } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
3
4
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
5
|
import { getConfig, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
5
6
|
import { toCssUnit } from '../../ui/src/dom'
|
|
6
7
|
import VxeLoadingComponent from '../../loading'
|
|
7
|
-
import
|
|
8
|
+
import VxeScrollbarComponent from '../../scrollbar'
|
|
8
9
|
|
|
9
10
|
import type { CardReactData, VxeCardEmits, VxeCardPropTypes, CardPrivateRef, ValueOf, CardMethods, CardPrivateMethods, VxeCardPrivateComputed, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
10
11
|
|
|
@@ -34,7 +35,12 @@ export default defineVxeComponent({
|
|
|
34
35
|
size: {
|
|
35
36
|
type: String as PropType<VxeCardPropTypes.Size>,
|
|
36
37
|
default: () => getConfig().card.size || getConfig().size
|
|
37
|
-
}
|
|
38
|
+
},
|
|
39
|
+
useScrollbar: {
|
|
40
|
+
type: Boolean as PropType<VxeCardPropTypes.UseScrollbar>,
|
|
41
|
+
default: () => getConfig().card.useScrollbar
|
|
42
|
+
},
|
|
43
|
+
scrollbarConfig: Object as PropType<VxeCardPropTypes.ScrollbarConfig>
|
|
38
44
|
},
|
|
39
45
|
emits: [
|
|
40
46
|
] as VxeCardEmits,
|
|
@@ -66,6 +72,10 @@ export default defineVxeComponent({
|
|
|
66
72
|
return stys
|
|
67
73
|
})
|
|
68
74
|
|
|
75
|
+
const computeScrollbarOpts = computed(() => {
|
|
76
|
+
return Object.assign({}, getConfig().card.scrollbarConfig, props.scrollbarConfig)
|
|
77
|
+
})
|
|
78
|
+
|
|
69
79
|
const computeMaps: VxeCardPrivateComputed = {
|
|
70
80
|
computeSize
|
|
71
81
|
}
|
|
@@ -94,7 +104,7 @@ export default defineVxeComponent({
|
|
|
94
104
|
Object.assign($xeCard, cardMethods, cardPrivateMethods)
|
|
95
105
|
|
|
96
106
|
const renderVN = () => {
|
|
97
|
-
const { title, border, shadow, padding, loading, showTitleOverflow } = props
|
|
107
|
+
const { title, border, shadow, padding, loading, showTitleOverflow, useScrollbar } = props
|
|
98
108
|
const defaultSlot = slots.default
|
|
99
109
|
const headerSlot = slots.header
|
|
100
110
|
const titleSlot = slots.title
|
|
@@ -104,6 +114,8 @@ export default defineVxeComponent({
|
|
|
104
114
|
const rightSlot = slots.right
|
|
105
115
|
const vSize = computeSize.value
|
|
106
116
|
const cardStyle = computeCardStyle.value
|
|
117
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
118
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
107
119
|
|
|
108
120
|
return h('div', {
|
|
109
121
|
ref: refElem,
|
|
@@ -137,17 +149,48 @@ export default defineVxeComponent({
|
|
|
137
149
|
class: 'vxe-card--body'
|
|
138
150
|
}, [
|
|
139
151
|
leftSlot
|
|
140
|
-
?
|
|
141
|
-
|
|
142
|
-
|
|
152
|
+
? (
|
|
153
|
+
useScrollbar
|
|
154
|
+
? h(VxeScrollbarComponent, {
|
|
155
|
+
class: 'vxe-card--body-scrollbar-left',
|
|
156
|
+
...scrollbarOpts,
|
|
157
|
+
viewClassName: 'vxe-card--body-scrollbar-left-view',
|
|
158
|
+
viewInnerClassName: 'vxe-card--body-scrollbar-left-inner'
|
|
159
|
+
}, {
|
|
160
|
+
default: () => getSlotVNs(leftSlot({}))
|
|
161
|
+
})
|
|
162
|
+
: h('div', {
|
|
163
|
+
class: 'vxe-card--body-left'
|
|
164
|
+
}, getSlotVNs(leftSlot({})))
|
|
165
|
+
)
|
|
143
166
|
: renderEmptyElement($xeCard),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
167
|
+
useScrollbar
|
|
168
|
+
? h(VxeScrollbarComponent, {
|
|
169
|
+
class: 'vxe-card--body-scrollbar-content',
|
|
170
|
+
...scrollbarOpts,
|
|
171
|
+
viewClassName: 'vxe-card--body-scrollbar-content-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
172
|
+
viewInnerClassName: 'vxe-card--body-scrollbar-content-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
173
|
+
}, {
|
|
174
|
+
default: () => defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
175
|
+
})
|
|
176
|
+
: h('div', {
|
|
177
|
+
class: 'vxe-card--body-content'
|
|
178
|
+
}, defaultSlot ? getSlotVNs(defaultSlot({})) : []),
|
|
147
179
|
rightSlot
|
|
148
|
-
?
|
|
149
|
-
|
|
150
|
-
|
|
180
|
+
? (
|
|
181
|
+
useScrollbar
|
|
182
|
+
? h(VxeScrollbarComponent, {
|
|
183
|
+
class: 'vxe-card--body-scrollbar-right',
|
|
184
|
+
...scrollbarOpts,
|
|
185
|
+
viewClassName: 'vxe-card--body-scrollbar-right-view',
|
|
186
|
+
viewInnerClassName: 'vxe-card--body-scrollbar-right-inner'
|
|
187
|
+
}, {
|
|
188
|
+
default: () => getSlotVNs(rightSlot({}))
|
|
189
|
+
})
|
|
190
|
+
: h('div', {
|
|
191
|
+
class: 'vxe-card--body-right'
|
|
192
|
+
}, getSlotVNs(rightSlot({})))
|
|
193
|
+
)
|
|
151
194
|
: renderEmptyElement($xeCard)
|
|
152
195
|
]),
|
|
153
196
|
footerSlot
|
|
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI, getConfig, getIcon, getI18n, menus, globalEvents, globalResize, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getCrossListDragRowInfo } from './store'
|
|
6
|
-
import { isScale, removeClass, addClass, getTpImg, toCssUnit } from '../../ui/src/dom'
|
|
6
|
+
import { isScale, removeClass, addClass, getTpImg, toCssUnit, hasClass } from '../../ui/src/dom'
|
|
7
7
|
import { isEnableConf, getText, enModelValue, deModelValue } from '../../ui/src/utils'
|
|
8
8
|
import { createComponentLog } from '../../ui/src/log'
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
|
|
@@ -419,8 +419,12 @@ export default defineVxeComponent({
|
|
|
419
419
|
const recalculate = () => {
|
|
420
420
|
const el = refElem.value
|
|
421
421
|
if (el) {
|
|
422
|
-
|
|
422
|
+
let parentEl = el.parentElement
|
|
423
423
|
let parentHeight = 0
|
|
424
|
+
// 如果是虚拟滚动条
|
|
425
|
+
if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
|
|
426
|
+
parentEl = parentEl.parentElement
|
|
427
|
+
}
|
|
424
428
|
if (parentEl) {
|
|
425
429
|
const parentStyle = getComputedStyle(parentEl)
|
|
426
430
|
parentHeight = parentEl.clientHeight - Math.ceil(XEUtils.toNumber(parentStyle.paddingLeft) + XEUtils.toNumber(parentStyle.paddingRight))
|
package/packages/row/src/col.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ref, h, reactive, computed, PropType, inject } from 'vue'
|
|
1
|
+
import { ref, h, reactive, computed, PropType, inject, onMounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { getConfig, createEvent, useSize } from '../../ui'
|
|
5
5
|
import { toCssUnit } from '../../ui/src/dom'
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log'
|
|
6
7
|
|
|
7
8
|
import type { ColReactData, VxeColPropTypes, ColPrivateRef, VxeColEmits, ColMethods, ColPrivateMethods, VxeColPrivateComputed, VxeColConstructor, VxeColPrivateMethods, ValueOf, VxeRowConstructor, VxeRowPrivateMethods } from '../../../types'
|
|
8
9
|
|
|
10
|
+
const { errLog } = createComponentLog('col')
|
|
11
|
+
|
|
9
12
|
export default defineVxeComponent({
|
|
10
13
|
name: 'VxeCol',
|
|
11
14
|
props: {
|
|
@@ -56,26 +59,32 @@ export default defineVxeComponent({
|
|
|
56
59
|
const { width } = props
|
|
57
60
|
const rowGutter = computeRowGutter.value
|
|
58
61
|
const rowVertical = computeRowVertical.value
|
|
62
|
+
let gridLayout = false
|
|
63
|
+
if ($xeRow) {
|
|
64
|
+
gridLayout = !!$xeRow.props.gridLayout
|
|
65
|
+
}
|
|
59
66
|
const style: Record<string, string | number> = {}
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (!gridLayout) {
|
|
68
|
+
if (rowGutter) {
|
|
69
|
+
let [lrGutter, tbGutter] = XEUtils.isArray(rowGutter) ? rowGutter : [rowGutter]
|
|
70
|
+
if (rowVertical) {
|
|
71
|
+
tbGutter = lrGutter
|
|
72
|
+
lrGutter = ''
|
|
73
|
+
}
|
|
74
|
+
if (lrGutter) {
|
|
75
|
+
const padding = XEUtils.isNumber(lrGutter) ? toCssUnit(lrGutter / 2) : `calc(${toCssUnit(lrGutter)} / 2)`
|
|
76
|
+
style.paddingLeft = padding
|
|
77
|
+
style.paddingRight = padding
|
|
78
|
+
}
|
|
79
|
+
if (tbGutter) {
|
|
80
|
+
const padding = XEUtils.isNumber(tbGutter) ? toCssUnit(tbGutter / 2) : `calc(${toCssUnit(tbGutter)} / 2)`
|
|
81
|
+
style.paddingTop = padding
|
|
82
|
+
style.paddingBottom = padding
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
style.paddingLeft = padding
|
|
69
|
-
style.paddingRight = padding
|
|
85
|
+
if (width) {
|
|
86
|
+
style.width = toCssUnit(width)
|
|
70
87
|
}
|
|
71
|
-
if (tbGutter) {
|
|
72
|
-
const padding = XEUtils.isNumber(tbGutter) ? toCssUnit(tbGutter / 2) : `calc(${toCssUnit(tbGutter)} / 2)`
|
|
73
|
-
style.paddingTop = padding
|
|
74
|
-
style.paddingBottom = padding
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (width) {
|
|
78
|
-
style.width = toCssUnit(width)
|
|
79
88
|
}
|
|
80
89
|
return style
|
|
81
90
|
})
|
|
@@ -126,6 +135,20 @@ export default defineVxeComponent({
|
|
|
126
135
|
])
|
|
127
136
|
}
|
|
128
137
|
|
|
138
|
+
onMounted(() => {
|
|
139
|
+
const { width, fill } = props
|
|
140
|
+
if ($xeRow) {
|
|
141
|
+
if ($xeRow.props.gridLayout) {
|
|
142
|
+
if (width) {
|
|
143
|
+
errLog('vxe.error.notSupportProp', ['grid-layout', `width=${width}`, 'width=null'])
|
|
144
|
+
}
|
|
145
|
+
if (fill) {
|
|
146
|
+
errLog('vxe.error.notSupportProp', ['grid-layout', `fill=${fill}`, 'fill=false'])
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
|
|
129
152
|
$xeCol.renderVN = renderVN
|
|
130
153
|
|
|
131
154
|
return $xeCol
|
package/packages/row/src/row.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { ref, h, reactive, provide, PropType, computed } from 'vue'
|
|
1
|
+
import { ref, h, reactive, provide, PropType, computed, onMounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { getConfig, createEvent, useSize } from '../../ui'
|
|
5
5
|
import { toCssUnit } from '../../ui/src/dom'
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log'
|
|
6
7
|
|
|
7
8
|
import type { VxeRowPropTypes, RowReactData, RowPrivateRef, VxeRowEmits, RowMethods, RowPrivateMethods, VxeRowPrivateComputed, VxeRowConstructor, VxeRowPrivateMethods, ValueOf } from '../../../types'
|
|
8
9
|
|
|
10
|
+
const { warnLog } = createComponentLog('row')
|
|
11
|
+
|
|
9
12
|
export default defineVxeComponent({
|
|
10
13
|
name: 'VxeRow',
|
|
11
14
|
props: {
|
|
15
|
+
gridLayout: {
|
|
16
|
+
type: Boolean as PropType<VxeRowPropTypes.GridLayout>,
|
|
17
|
+
default: () => getConfig().row.gridLayout
|
|
18
|
+
},
|
|
12
19
|
gutter: [Number, String, Array] as PropType<VxeRowPropTypes.Gutter>,
|
|
13
20
|
wrap: {
|
|
14
21
|
type: Boolean as PropType<VxeRowPropTypes.Wrap>,
|
|
@@ -40,23 +47,28 @@ export default defineVxeComponent({
|
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
const computeRowStyle = computed(() => {
|
|
43
|
-
const { gutter, vertical } = props
|
|
50
|
+
const { gridLayout, gutter, vertical } = props
|
|
44
51
|
const style: Record<string, string | number> = {}
|
|
45
52
|
if (gutter) {
|
|
46
53
|
let [lrGutter, tbGutter] = XEUtils.isArray(gutter) ? gutter : [gutter]
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
if (gridLayout) {
|
|
55
|
+
style.columnGap = toCssUnit(lrGutter)
|
|
56
|
+
style.rowGap = toCssUnit(tbGutter || lrGutter)
|
|
57
|
+
} else {
|
|
58
|
+
if (vertical) {
|
|
59
|
+
tbGutter = lrGutter
|
|
60
|
+
lrGutter = ''
|
|
61
|
+
}
|
|
62
|
+
if (lrGutter) {
|
|
63
|
+
const offsetSize = XEUtils.isNumber(lrGutter) ? toCssUnit(-(lrGutter / 2)) : `calc(${toCssUnit(lrGutter)} / 2 * -1)`
|
|
64
|
+
style.marginLeft = offsetSize
|
|
65
|
+
style.marginRight = offsetSize
|
|
66
|
+
}
|
|
67
|
+
if (tbGutter) {
|
|
68
|
+
const offsetSize = XEUtils.isNumber(tbGutter) ? toCssUnit(-(tbGutter / 2)) : `calc(${toCssUnit(tbGutter)} / 2 * -1)`
|
|
69
|
+
style.marginTop = offsetSize
|
|
70
|
+
style.marginBottom = offsetSize
|
|
71
|
+
}
|
|
60
72
|
}
|
|
61
73
|
}
|
|
62
74
|
return style
|
|
@@ -93,12 +105,12 @@ export default defineVxeComponent({
|
|
|
93
105
|
Object.assign($xeRow, rowMethods, rowPrivateMethods)
|
|
94
106
|
|
|
95
107
|
const renderVN = () => {
|
|
96
|
-
const { vertical, wrap } = props
|
|
108
|
+
const { gridLayout, vertical, wrap } = props
|
|
97
109
|
const rowStyle = computeRowStyle.value
|
|
98
110
|
const defaultSlot = slots.default
|
|
99
111
|
return h('div', {
|
|
100
112
|
ref: refElem,
|
|
101
|
-
class: ['vxe-row', {
|
|
113
|
+
class: ['vxe-row', gridLayout ? 'grid--layout' : 'def--layout', {
|
|
102
114
|
'is--vertical': vertical,
|
|
103
115
|
'is--wrap': wrap
|
|
104
116
|
}],
|
|
@@ -107,6 +119,13 @@ export default defineVxeComponent({
|
|
|
107
119
|
}, defaultSlot ? defaultSlot({}) : [])
|
|
108
120
|
}
|
|
109
121
|
|
|
122
|
+
onMounted(() => {
|
|
123
|
+
const { gridLayout, wrap } = props
|
|
124
|
+
if (gridLayout && !wrap) {
|
|
125
|
+
warnLog('vxe.error.notSupportProp', ['grid-layout', 'wrap=false', 'wrap=true'])
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
|
|
110
129
|
provide('$xeRow', $xeRow)
|
|
111
130
|
|
|
112
131
|
$xeRow.renderVN = renderVN
|
|
@@ -8,7 +8,7 @@ import VxeLoadingComponent from '../../loading'
|
|
|
8
8
|
|
|
9
9
|
import type { ScrollbarReactData, ScrollbarInternalData, VxeScrollbarEmits, ScrollbarMethods, ScrollbarPrivateMethods, VxeScrollbarPropTypes, ValueOf, ScrollbarPrivateRef, VxeScrollbarPrivateComputed, VxeScrollbarConstructor, VxeScrollbarPrivateMethods, VxeComponentStyleType } from '../../../types'
|
|
10
10
|
|
|
11
|
-
const { getConfig, createEvent, domUtils, globalResize, renderEmptyElement } = VxeUI
|
|
11
|
+
const { getConfig, createEvent, domUtils, globalResize, globalEvents, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
13
13
|
function createReactData (): ScrollbarReactData {
|
|
14
14
|
return {
|
|
@@ -268,6 +268,9 @@ export default defineVxeComponent({
|
|
|
268
268
|
if (!viewEl) {
|
|
269
269
|
return
|
|
270
270
|
}
|
|
271
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
272
|
+
return
|
|
273
|
+
}
|
|
271
274
|
const trackXEl = refTrackXElem.value
|
|
272
275
|
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0
|
|
273
276
|
const thumbXElem = refThumbXElem.value
|
|
@@ -277,6 +280,7 @@ export default defineVxeComponent({
|
|
|
277
280
|
reactData.xThumbWidth = xThumbWidth
|
|
278
281
|
|
|
279
282
|
const trackYEl = refTrackYElem.value
|
|
283
|
+
|
|
280
284
|
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0
|
|
281
285
|
const thumbYElem = refThumbYElem.value
|
|
282
286
|
if (thumbYElem) {
|
|
@@ -290,6 +294,9 @@ export default defineVxeComponent({
|
|
|
290
294
|
if (!viewEl) {
|
|
291
295
|
return
|
|
292
296
|
}
|
|
297
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
298
|
+
return
|
|
299
|
+
}
|
|
293
300
|
const { xThumbWidth, yThumbHeight } = reactData
|
|
294
301
|
const trackXEl = refTrackXElem.value
|
|
295
302
|
const thumbXElem = refThumbXElem.value
|
|
@@ -624,6 +631,10 @@ export default defineVxeComponent({
|
|
|
624
631
|
}
|
|
625
632
|
|
|
626
633
|
reFlag.value++
|
|
634
|
+
|
|
635
|
+
globalEvents.on($xeScrollbar, 'resize', () => {
|
|
636
|
+
reFlag.value++
|
|
637
|
+
})
|
|
627
638
|
})
|
|
628
639
|
|
|
629
640
|
onBeforeUnmount(() => {
|
|
@@ -631,6 +642,7 @@ export default defineVxeComponent({
|
|
|
631
642
|
if (resizeObserver) {
|
|
632
643
|
resizeObserver.disconnect()
|
|
633
644
|
}
|
|
645
|
+
globalEvents.off($xeScrollbar, 'resize')
|
|
634
646
|
})
|
|
635
647
|
|
|
636
648
|
$xeScrollbar.renderVN = renderVN
|
|
@@ -7,6 +7,7 @@ import { 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'
|
|
10
|
+
import VxeScrollbarComponent from '../../scrollbar'
|
|
10
11
|
|
|
11
12
|
import type { VxeTabsPropTypes, VxeTabPaneProps, VxeTabsEmits, TabsInternalData, TabsReactData, TabsPrivateRef, VxeTabsPrivateComputed, VxeTabsConstructor, VxeTabsPrivateMethods, VxeTabPaneDefines, ValueOf, TabsMethods, TabsPrivateMethods, VxeComponentStyleType } from '../../../types'
|
|
12
13
|
|
|
@@ -52,6 +53,11 @@ export default defineVxeComponent({
|
|
|
52
53
|
type: String as PropType<VxeTabsPropTypes.Size>,
|
|
53
54
|
default: () => getConfig().tabs.size || getConfig().size
|
|
54
55
|
},
|
|
56
|
+
useScrollbar: {
|
|
57
|
+
type: Boolean as PropType<VxeTabsPropTypes.UseScrollbar>,
|
|
58
|
+
default: () => getConfig().tabs.useScrollbar
|
|
59
|
+
},
|
|
60
|
+
scrollbarConfig: Object as PropType<VxeTabsPropTypes.ScrollbarConfig>,
|
|
55
61
|
// 已废弃
|
|
56
62
|
beforeCloseMethod: Function as PropType<VxeTabsPropTypes.BeforeCloseMethod>
|
|
57
63
|
},
|
|
@@ -165,6 +171,10 @@ export default defineVxeComponent({
|
|
|
165
171
|
return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null
|
|
166
172
|
})
|
|
167
173
|
|
|
174
|
+
const computeScrollbarOpts = computed(() => {
|
|
175
|
+
return Object.assign({}, getConfig().tabs.scrollbarConfig, props.scrollbarConfig)
|
|
176
|
+
})
|
|
177
|
+
|
|
168
178
|
const computeMaps: VxeTabsPrivateComputed = {
|
|
169
179
|
}
|
|
170
180
|
|
|
@@ -761,17 +771,33 @@ export default defineVxeComponent({
|
|
|
761
771
|
}
|
|
762
772
|
|
|
763
773
|
const renderTabPane = (item: VxeTabPaneProps | VxeTabPaneDefines.TabConfig) => {
|
|
774
|
+
const { useScrollbar } = props
|
|
764
775
|
const { initNames, activeName } = reactData
|
|
765
776
|
const { name, slots } = item
|
|
766
777
|
const defaultSlot = slots ? slots.default : null
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
778
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
779
|
+
const { viewClassName, viewInnerClassName } = scrollbarOpts
|
|
780
|
+
if (name && initNames.includes(name)) {
|
|
781
|
+
return useScrollbar
|
|
782
|
+
? h(VxeScrollbarComponent, {
|
|
783
|
+
key: `${name}`,
|
|
784
|
+
class: ['vxe-tabs-pane--scrollbar-item', {
|
|
785
|
+
'is--visible': activeName === name
|
|
786
|
+
}],
|
|
787
|
+
...scrollbarOpts,
|
|
788
|
+
viewClassName: 'vxe-tabs-pane--scrollbar-item-view' + (viewClassName ? (' ' + viewClassName) : ''),
|
|
789
|
+
viewInnerClassName: 'vxe-tabs-pane--scrollbar-item-inner' + (viewClassName ? (' ' + viewInnerClassName) : '')
|
|
790
|
+
}, {
|
|
791
|
+
default: () => defaultSlot ? callSlot(defaultSlot, { name }) : []
|
|
792
|
+
})
|
|
793
|
+
: h('div', {
|
|
794
|
+
key: `${name}`,
|
|
795
|
+
class: ['vxe-tabs-pane--item', {
|
|
796
|
+
'is--visible': activeName === name
|
|
797
|
+
}]
|
|
798
|
+
}, defaultSlot ? callSlot(defaultSlot, { name }) : [])
|
|
799
|
+
}
|
|
800
|
+
return renderEmptyElement($xeTabs)
|
|
775
801
|
}
|
|
776
802
|
|
|
777
803
|
const renderTabContent = (tabList: VxeTabsPropTypes.Options | VxeTabPaneDefines.TabConfig[]) => {
|
|
@@ -6,7 +6,7 @@ import { createComponentLog } from '../../ui/src/log'
|
|
|
6
6
|
import { getCrossTreeDragNodeInfo } from './store'
|
|
7
7
|
import XEUtils from 'xe-utils'
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
9
|
-
import { toCssUnit, isScale, getPaddingTopBottomSize, addClass, removeClass, getTpImg, hasControlKey, getEventTargetNode } from '../../ui/src/dom'
|
|
9
|
+
import { toCssUnit, isScale, getPaddingTopBottomSize, addClass, removeClass, getTpImg, hasControlKey, getEventTargetNode, hasClass } from '../../ui/src/dom'
|
|
10
10
|
import { isEnableConf, enModelValue, deModelValue, getText } from '../../ui/src/utils'
|
|
11
11
|
import { moveRowAnimateToTb, clearRowAnimate } from '../../ui/src/anime'
|
|
12
12
|
import VxeLoadingComponent from '../../loading'
|
|
@@ -936,11 +936,15 @@ export default defineVxeComponent({
|
|
|
936
936
|
const { rowHeight } = scrollYStore
|
|
937
937
|
const el = refElem.value
|
|
938
938
|
if (el && el.clientWidth && el.clientHeight) {
|
|
939
|
-
|
|
939
|
+
let parentEl = getParentElem()
|
|
940
940
|
const headerWrapperEl = refHeaderWrapperElem.value
|
|
941
941
|
const footerWrapperEl = refFooterWrapperElem.value
|
|
942
942
|
const headHeight = headerWrapperEl ? headerWrapperEl.clientHeight : 0
|
|
943
943
|
const footHeight = footerWrapperEl ? footerWrapperEl.clientHeight : 0
|
|
944
|
+
// 如果是虚拟滚动条
|
|
945
|
+
if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
|
|
946
|
+
parentEl = parentEl.parentElement
|
|
947
|
+
}
|
|
944
948
|
if (parentEl) {
|
|
945
949
|
const parentPaddingSize = getPaddingTopBottomSize(parentEl)
|
|
946
950
|
reactData.parentHeight = Math.max(headHeight + footHeight + rowHeight, parentEl.clientHeight - parentPaddingSize - headHeight - footHeight)
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
// 局部变量
|
|
2
|
+
.vxe-card {
|
|
3
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-default);
|
|
4
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-default);
|
|
5
|
+
&.size--xlarge {
|
|
6
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-xlarge);
|
|
7
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-xlarge);
|
|
8
|
+
}
|
|
9
|
+
&.size--large {
|
|
10
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-large);
|
|
11
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-large);
|
|
12
|
+
}
|
|
13
|
+
&.size--medium {
|
|
14
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-medium);
|
|
15
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-medium);
|
|
16
|
+
}
|
|
17
|
+
&.size--small {
|
|
18
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-small);
|
|
19
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-small);
|
|
20
|
+
}
|
|
21
|
+
&.size--mini {
|
|
22
|
+
--vxe-ui-card-current-font-size: var(--vxe-ui-font-size-mini);
|
|
23
|
+
--vxe-ui-card-current-padding: var(--vxe-ui-card-padding-mini);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
1
27
|
.vxe-card {
|
|
2
28
|
position: relative;
|
|
3
29
|
display: inline-flex;
|
|
4
30
|
flex-direction: column;
|
|
5
|
-
font-size: var(--vxe-ui-font-size
|
|
31
|
+
font-size: var(--vxe-ui-card-current-font-size);
|
|
6
32
|
color: var(--vxe-ui-font-color);
|
|
7
33
|
font-family: var(--vxe-ui-font-family);
|
|
8
34
|
background-color: var(--vxe-ui-layout-background-color);
|
|
@@ -33,19 +59,25 @@
|
|
|
33
59
|
flex-grow: 1;
|
|
34
60
|
}
|
|
35
61
|
.vxe-card--body-left,
|
|
62
|
+
.vxe-card--body-scrollbar-left,
|
|
36
63
|
.vxe-card--body-right,
|
|
37
|
-
.vxe-card--body-
|
|
64
|
+
.vxe-card--body-scrollbar-right,
|
|
65
|
+
.vxe-card--body-content,
|
|
66
|
+
.vxe-card--body-scrollbar-content {
|
|
38
67
|
overflow: auto;
|
|
39
68
|
}
|
|
40
69
|
.vxe-card--header,
|
|
41
70
|
.vxe-card--header-extra,
|
|
42
71
|
.vxe-card--footer,
|
|
43
72
|
.vxe-card--body-left,
|
|
44
|
-
.vxe-card--body-
|
|
73
|
+
.vxe-card--body-scrollbar-left,
|
|
74
|
+
.vxe-card--body-right,
|
|
75
|
+
.vxe-card--body-scrollbar-right {
|
|
45
76
|
flex-shrink: 0;
|
|
46
77
|
}
|
|
47
78
|
.vxe-card--header-title,
|
|
48
|
-
.vxe-card--body-content
|
|
79
|
+
.vxe-card--body-content,
|
|
80
|
+
.vxe-card--body-scrollbar-content {
|
|
49
81
|
flex-grow: 1;
|
|
50
82
|
}
|
|
51
83
|
.vxe-card--header-title {
|
|
@@ -57,66 +89,20 @@
|
|
|
57
89
|
}
|
|
58
90
|
|
|
59
91
|
.vxe-card {
|
|
60
|
-
font-size: var(--vxe-ui-font-size-default);
|
|
61
92
|
& > .vxe-card--header,
|
|
62
93
|
& > .vxe-card--footer {
|
|
63
|
-
padding: var(--vxe-ui-card-padding
|
|
94
|
+
padding: var(--vxe-ui-card-current-padding);
|
|
64
95
|
}
|
|
65
96
|
&.is--padding {
|
|
66
97
|
& > .vxe-card--body {
|
|
67
|
-
.vxe-card--body-content,
|
|
68
98
|
.vxe-card--body-left,
|
|
69
|
-
.vxe-card--body-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
font-size: var(--vxe-ui-font-size-medium);
|
|
76
|
-
& > .vxe-card--header,
|
|
77
|
-
& > .vxe-card--footer {
|
|
78
|
-
padding: var(--vxe-ui-card-padding-medium);
|
|
79
|
-
}
|
|
80
|
-
&.is--padding {
|
|
81
|
-
& > .vxe-card--body {
|
|
82
|
-
.vxe-card--body-content,
|
|
83
|
-
.vxe-card--body-left,
|
|
84
|
-
.vxe-card--body-right {
|
|
85
|
-
padding: var(--vxe-ui-card-padding-medium);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
&.size--small {
|
|
91
|
-
font-size: var(--vxe-ui-font-size-small);
|
|
92
|
-
& > .vxe-card--header,
|
|
93
|
-
& > .vxe-card--footer {
|
|
94
|
-
padding: var(--vxe-ui-card-padding-small);
|
|
95
|
-
}
|
|
96
|
-
&.is--padding {
|
|
97
|
-
& > .vxe-card--body {
|
|
98
|
-
.vxe-card--body-content,
|
|
99
|
-
.vxe-card--body-left,
|
|
100
|
-
.vxe-card--body-right {
|
|
101
|
-
padding: var(--vxe-ui-card-padding-small);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
&.size--mini {
|
|
107
|
-
font-size: var(--vxe-ui-font-size-mini);
|
|
108
|
-
& > .vxe-card--header,
|
|
109
|
-
& > .vxe-card--footer {
|
|
110
|
-
padding: var(--vxe-ui-card-padding-mini);
|
|
111
|
-
}
|
|
112
|
-
&.is--padding {
|
|
113
|
-
& > .vxe-card--body {
|
|
114
|
-
.vxe-card--body-content,
|
|
115
|
-
.vxe-card--body-left,
|
|
116
|
-
.vxe-card--body-right {
|
|
117
|
-
padding: var(--vxe-ui-card-padding-mini);
|
|
118
|
-
}
|
|
99
|
+
.vxe-card--body-scrollbar-left-view,
|
|
100
|
+
.vxe-card--body-right,
|
|
101
|
+
.vxe-card--body-scrollbar-right-view,
|
|
102
|
+
.vxe-card--body-content,
|
|
103
|
+
.vxe-card--body-scrollbar-content-view {
|
|
104
|
+
padding: var(--vxe-ui-card-current-padding);
|
|
119
105
|
}
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
|
-
}
|
|
108
|
+
}
|
|
@@ -36,9 +36,27 @@
|
|
|
36
36
|
&.align--right {
|
|
37
37
|
text-align: right;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.vxe-row {
|
|
42
|
+
&.def--layout {
|
|
43
|
+
& > .vxe-col {
|
|
44
|
+
@for $i from 0 to list.length(base_var.$colSpanList) {
|
|
45
|
+
&.span#{$i + 1} {
|
|
46
|
+
width: list.nth(base_var.$colSpanList, $i + 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
&.grid--layout {
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-template-columns: repeat(24, minmax(0, 1fr));
|
|
54
|
+
& > .vxe-col {
|
|
55
|
+
@for $i from 0 to list.length(base_var.$colSpanList) {
|
|
56
|
+
&.span#{$i + 1} {
|
|
57
|
+
grid-column: span $i + 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
42
60
|
}
|
|
43
61
|
}
|
|
44
62
|
}
|