vxe-pc-ui 4.8.7 → 4.8.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/es/form/src/form.js +16 -10
- package/es/icon/style.css +1 -1
- package/es/list/src/list.js +59 -55
- package/es/select/src/select.js +24 -20
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +44 -31
- package/es/tree-select/src/tree-select.js +9 -5
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/form/src/form.js +15 -9
- package/lib/form/src/form.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 +162 -128
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +66 -62
- package/lib/list/src/list.min.js +1 -1
- package/lib/select/src/select.js +24 -20
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tree/src/tree.js +46 -30
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +9 -5
- package/lib/tree-select/src/tree-select.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 +1 -1
- package/packages/form/src/form.ts +18 -10
- package/packages/list/src/list.ts +61 -56
- package/packages/select/src/select.ts +27 -22
- package/packages/tree/src/tree.ts +47 -35
- package/packages/tree-select/src/tree-select.ts +10 -5
- package/types/components/grid.d.ts +3 -0
- package/types/components/table.d.ts +1 -1
- /package/es/icon/{iconfont.1754401543189.ttf → iconfont.1754452750861.ttf} +0 -0
- /package/es/icon/{iconfont.1754401543189.woff → iconfont.1754452750861.woff} +0 -0
- /package/es/icon/{iconfont.1754401543189.woff2 → iconfont.1754452750861.woff2} +0 -0
- /package/es/{iconfont.1754401543189.ttf → iconfont.1754452750861.ttf} +0 -0
- /package/es/{iconfont.1754401543189.woff → iconfont.1754452750861.woff} +0 -0
- /package/es/{iconfont.1754401543189.woff2 → iconfont.1754452750861.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1754401543189.ttf → iconfont.1754452750861.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1754401543189.woff → iconfont.1754452750861.woff} +0 -0
- /package/lib/icon/style/{iconfont.1754401543189.woff2 → iconfont.1754452750861.woff2} +0 -0
- /package/lib/{iconfont.1754401543189.ttf → iconfont.1754452750861.ttf} +0 -0
- /package/lib/{iconfont.1754401543189.woff → iconfont.1754452750861.woff} +0 -0
- /package/lib/{iconfont.1754401543189.woff2 → iconfont.1754452750861.woff2} +0 -0
|
@@ -7,6 +7,22 @@ import VxeLoadingComponent from '../../loading/src/loading'
|
|
|
7
7
|
|
|
8
8
|
import type { VxeListConstructor, VxeListPropTypes, VxeListEmits, ListReactData, ListInternalData, ValueOf, ListMethods, ListPrivateRef, VxeListMethods } from '../../../types'
|
|
9
9
|
|
|
10
|
+
function createInternalData (): ListInternalData {
|
|
11
|
+
return {
|
|
12
|
+
resizeObserver: undefined,
|
|
13
|
+
fullData: [],
|
|
14
|
+
lastScrollLeft: 0,
|
|
15
|
+
lastScrollTop: 0,
|
|
16
|
+
scrollYStore: {
|
|
17
|
+
startIndex: 0,
|
|
18
|
+
endIndex: 0,
|
|
19
|
+
visibleSize: 0,
|
|
20
|
+
offsetSize: 0,
|
|
21
|
+
rowHeight: 0
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
10
26
|
export default defineVxeComponent({
|
|
11
27
|
name: 'VxeList',
|
|
12
28
|
props: {
|
|
@@ -49,19 +65,7 @@ export default defineVxeComponent({
|
|
|
49
65
|
items: []
|
|
50
66
|
})
|
|
51
67
|
|
|
52
|
-
const internalData
|
|
53
|
-
resizeObserver: undefined,
|
|
54
|
-
fullData: [],
|
|
55
|
-
lastScrollLeft: 0,
|
|
56
|
-
lastScrollTop: 0,
|
|
57
|
-
scrollYStore: {
|
|
58
|
-
startIndex: 0,
|
|
59
|
-
endIndex: 0,
|
|
60
|
-
visibleSize: 0,
|
|
61
|
-
offsetSize: 0,
|
|
62
|
-
rowHeight: 0
|
|
63
|
-
}
|
|
64
|
-
}
|
|
68
|
+
const internalData = createInternalData()
|
|
65
69
|
|
|
66
70
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
67
71
|
const refVirtualWrapper = ref() as Ref<HTMLDivElement>
|
|
@@ -322,6 +326,49 @@ export default defineVxeComponent({
|
|
|
322
326
|
|
|
323
327
|
Object.assign($xeList, listMethods)
|
|
324
328
|
|
|
329
|
+
const renderVN = () => {
|
|
330
|
+
const { className, loading } = props
|
|
331
|
+
const { bodyHeight, topSpaceHeight, items } = reactData
|
|
332
|
+
const defaultSlot = slots.default
|
|
333
|
+
const vSize = computeSize.value
|
|
334
|
+
const styles = computeStyles.value
|
|
335
|
+
return h('div', {
|
|
336
|
+
ref: refElem,
|
|
337
|
+
class: ['vxe-list', className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '', {
|
|
338
|
+
[`size--${vSize}`]: vSize,
|
|
339
|
+
'is--loading': loading
|
|
340
|
+
}]
|
|
341
|
+
}, [
|
|
342
|
+
h('div', {
|
|
343
|
+
ref: refVirtualWrapper,
|
|
344
|
+
class: 'vxe-list--virtual-wrapper',
|
|
345
|
+
style: styles,
|
|
346
|
+
onScroll: scrollEvent
|
|
347
|
+
}, [
|
|
348
|
+
h('div', {
|
|
349
|
+
class: 'vxe-list--y-space',
|
|
350
|
+
style: {
|
|
351
|
+
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
352
|
+
}
|
|
353
|
+
}),
|
|
354
|
+
h('div', {
|
|
355
|
+
ref: refVirtualBody,
|
|
356
|
+
class: 'vxe-list--body',
|
|
357
|
+
style: {
|
|
358
|
+
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
359
|
+
}
|
|
360
|
+
}, defaultSlot ? defaultSlot({ items, $list: $xeList }) : [])
|
|
361
|
+
]),
|
|
362
|
+
/**
|
|
363
|
+
* 加载中
|
|
364
|
+
*/
|
|
365
|
+
h(VxeLoadingComponent, {
|
|
366
|
+
class: 'vxe-list--loading',
|
|
367
|
+
modelValue: loading
|
|
368
|
+
})
|
|
369
|
+
])
|
|
370
|
+
}
|
|
371
|
+
|
|
325
372
|
const dataFlag = ref(0)
|
|
326
373
|
watch(() => props.data ? props.data.length : -1, () => {
|
|
327
374
|
dataFlag.value++
|
|
@@ -377,51 +424,9 @@ export default defineVxeComponent({
|
|
|
377
424
|
resizeObserver.disconnect()
|
|
378
425
|
}
|
|
379
426
|
globalEvents.off($xeList, 'resize')
|
|
427
|
+
XEUtils.assign(internalData, createInternalData())
|
|
380
428
|
})
|
|
381
429
|
|
|
382
|
-
const renderVN = () => {
|
|
383
|
-
const { className, loading } = props
|
|
384
|
-
const { bodyHeight, topSpaceHeight, items } = reactData
|
|
385
|
-
const defaultSlot = slots.default
|
|
386
|
-
const vSize = computeSize.value
|
|
387
|
-
const styles = computeStyles.value
|
|
388
|
-
return h('div', {
|
|
389
|
-
ref: refElem,
|
|
390
|
-
class: ['vxe-list', className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '', {
|
|
391
|
-
[`size--${vSize}`]: vSize,
|
|
392
|
-
'is--loading': loading
|
|
393
|
-
}]
|
|
394
|
-
}, [
|
|
395
|
-
h('div', {
|
|
396
|
-
ref: refVirtualWrapper,
|
|
397
|
-
class: 'vxe-list--virtual-wrapper',
|
|
398
|
-
style: styles,
|
|
399
|
-
onScroll: scrollEvent
|
|
400
|
-
}, [
|
|
401
|
-
h('div', {
|
|
402
|
-
class: 'vxe-list--y-space',
|
|
403
|
-
style: {
|
|
404
|
-
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
405
|
-
}
|
|
406
|
-
}),
|
|
407
|
-
h('div', {
|
|
408
|
-
ref: refVirtualBody,
|
|
409
|
-
class: 'vxe-list--body',
|
|
410
|
-
style: {
|
|
411
|
-
marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
|
|
412
|
-
}
|
|
413
|
-
}, defaultSlot ? defaultSlot({ items, $list: $xeList }) : [])
|
|
414
|
-
]),
|
|
415
|
-
/**
|
|
416
|
-
* 加载中
|
|
417
|
-
*/
|
|
418
|
-
h(VxeLoadingComponent, {
|
|
419
|
-
class: 'vxe-list--loading',
|
|
420
|
-
modelValue: loading
|
|
421
|
-
})
|
|
422
|
-
])
|
|
423
|
-
}
|
|
424
|
-
|
|
425
430
|
$xeList.renderVN = renderVN
|
|
426
431
|
|
|
427
432
|
return $xeList
|
|
@@ -19,6 +19,31 @@ function getOptUniqueId () {
|
|
|
19
19
|
return XEUtils.uniqueId('opt_')
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function createInternalData (): SelectInternalData {
|
|
23
|
+
return {
|
|
24
|
+
synchData: [],
|
|
25
|
+
fullData: [],
|
|
26
|
+
afterVisibleList: [],
|
|
27
|
+
optAddMaps: {},
|
|
28
|
+
optGroupKeyMaps: {},
|
|
29
|
+
optFullValMaps: {},
|
|
30
|
+
remoteValMaps: {},
|
|
31
|
+
|
|
32
|
+
lastScrollLeft: 0,
|
|
33
|
+
lastScrollTop: 0,
|
|
34
|
+
scrollYStore: {
|
|
35
|
+
startIndex: 0,
|
|
36
|
+
endIndex: 0,
|
|
37
|
+
visibleSize: 0,
|
|
38
|
+
offsetSize: 0,
|
|
39
|
+
rowHeight: 0
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
lastScrollTime: 0,
|
|
43
|
+
hpTimeout: undefined
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
22
47
|
export default defineVxeComponent({
|
|
23
48
|
name: 'VxeSelect',
|
|
24
49
|
props: {
|
|
@@ -157,28 +182,7 @@ export default defineVxeComponent({
|
|
|
157
182
|
isActivated: false
|
|
158
183
|
})
|
|
159
184
|
|
|
160
|
-
const internalData
|
|
161
|
-
synchData: [],
|
|
162
|
-
fullData: [],
|
|
163
|
-
afterVisibleList: [],
|
|
164
|
-
optAddMaps: {},
|
|
165
|
-
optGroupKeyMaps: {},
|
|
166
|
-
optFullValMaps: {},
|
|
167
|
-
remoteValMaps: {},
|
|
168
|
-
|
|
169
|
-
lastScrollLeft: 0,
|
|
170
|
-
lastScrollTop: 0,
|
|
171
|
-
scrollYStore: {
|
|
172
|
-
startIndex: 0,
|
|
173
|
-
endIndex: 0,
|
|
174
|
-
visibleSize: 0,
|
|
175
|
-
offsetSize: 0,
|
|
176
|
-
rowHeight: 0
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
lastScrollTime: 0,
|
|
180
|
-
hpTimeout: undefined
|
|
181
|
-
}
|
|
185
|
+
const internalData = createInternalData()
|
|
182
186
|
|
|
183
187
|
const refMaps: SelectPrivateRef = {
|
|
184
188
|
refElem
|
|
@@ -1498,6 +1502,7 @@ export default defineVxeComponent({
|
|
|
1498
1502
|
globalEvents.off($xeSelect, 'keydown')
|
|
1499
1503
|
globalEvents.off($xeSelect, 'blur')
|
|
1500
1504
|
globalEvents.off($xeSelect, 'resize')
|
|
1505
|
+
XEUtils.assign(internalData, createInternalData())
|
|
1501
1506
|
})
|
|
1502
1507
|
|
|
1503
1508
|
provide('$xeSelect', $xeSelect)
|
|
@@ -17,6 +17,34 @@ function getNodeUniqueId () {
|
|
|
17
17
|
return XEUtils.uniqueId('node_')
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function createInternalData (): TreeInternalData {
|
|
21
|
+
return {
|
|
22
|
+
// initialized: false,
|
|
23
|
+
// lastFilterValue: '',
|
|
24
|
+
treeFullData: [],
|
|
25
|
+
afterTreeList: [],
|
|
26
|
+
afterVisibleList: [],
|
|
27
|
+
nodeMaps: {},
|
|
28
|
+
selectCheckboxMaps: {},
|
|
29
|
+
indeterminateRowMaps: {},
|
|
30
|
+
treeExpandedMaps: {},
|
|
31
|
+
treeExpandLazyLoadedMaps: {},
|
|
32
|
+
|
|
33
|
+
lastScrollLeft: 0,
|
|
34
|
+
lastScrollTop: 0,
|
|
35
|
+
scrollYStore: {
|
|
36
|
+
startIndex: 0,
|
|
37
|
+
endIndex: 0,
|
|
38
|
+
visibleSize: 0,
|
|
39
|
+
offsetSize: 0,
|
|
40
|
+
rowHeight: 0
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
lastScrollTime: 0
|
|
44
|
+
// hpTimeout: undefined
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
20
48
|
export default defineVxeComponent({
|
|
21
49
|
name: 'VxeTree',
|
|
22
50
|
props: {
|
|
@@ -170,31 +198,7 @@ export default defineVxeComponent({
|
|
|
170
198
|
updateCheckboxFlag: 1
|
|
171
199
|
})
|
|
172
200
|
|
|
173
|
-
const internalData
|
|
174
|
-
// initialized: false,
|
|
175
|
-
// lastFilterValue: '',
|
|
176
|
-
treeFullData: [],
|
|
177
|
-
afterTreeList: [],
|
|
178
|
-
afterVisibleList: [],
|
|
179
|
-
nodeMaps: {},
|
|
180
|
-
selectCheckboxMaps: {},
|
|
181
|
-
indeterminateRowMaps: {},
|
|
182
|
-
treeExpandedMaps: {},
|
|
183
|
-
treeExpandLazyLoadedMaps: {},
|
|
184
|
-
|
|
185
|
-
lastScrollLeft: 0,
|
|
186
|
-
lastScrollTop: 0,
|
|
187
|
-
scrollYStore: {
|
|
188
|
-
startIndex: 0,
|
|
189
|
-
endIndex: 0,
|
|
190
|
-
visibleSize: 0,
|
|
191
|
-
offsetSize: 0,
|
|
192
|
-
rowHeight: 0
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
lastScrollTime: 0
|
|
196
|
-
// hpTimeout: undefined
|
|
197
|
-
}
|
|
201
|
+
const internalData = createInternalData()
|
|
198
202
|
|
|
199
203
|
const refMaps: TreePrivateRef = {
|
|
200
204
|
refElem
|
|
@@ -823,10 +827,13 @@ export default defineVxeComponent({
|
|
|
823
827
|
return nextTick()
|
|
824
828
|
}
|
|
825
829
|
|
|
826
|
-
const loadYData = (
|
|
830
|
+
const loadYData = () => {
|
|
827
831
|
const { scrollYStore } = internalData
|
|
828
832
|
const { startIndex, endIndex, visibleSize, offsetSize, rowHeight } = scrollYStore
|
|
829
|
-
const scrollBodyElem =
|
|
833
|
+
const scrollBodyElem = refVirtualWrapper.value
|
|
834
|
+
if (!scrollBodyElem) {
|
|
835
|
+
return
|
|
836
|
+
}
|
|
830
837
|
const scrollTop = scrollBodyElem.scrollTop
|
|
831
838
|
const toVisibleIndex = Math.floor(scrollTop / rowHeight)
|
|
832
839
|
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize)
|
|
@@ -849,7 +856,7 @@ export default defineVxeComponent({
|
|
|
849
856
|
internalData.lastScrollTop = scrollTop
|
|
850
857
|
internalData.lastScrollLeft = scrollLeft
|
|
851
858
|
if (reactData.scrollYLoad) {
|
|
852
|
-
loadYData(
|
|
859
|
+
loadYData()
|
|
853
860
|
}
|
|
854
861
|
internalData.lastScrollTime = Date.now()
|
|
855
862
|
dispatchEvent('scroll', { scrollLeft, scrollTop, isX, isY }, evnt)
|
|
@@ -1483,7 +1490,8 @@ export default defineVxeComponent({
|
|
|
1483
1490
|
},
|
|
1484
1491
|
setAllExpandNode (expanded) {
|
|
1485
1492
|
const { transform } = props
|
|
1486
|
-
const {
|
|
1493
|
+
const { scrollYLoad } = reactData
|
|
1494
|
+
const { scrollYStore, treeExpandedMaps } = internalData
|
|
1487
1495
|
const childrenField = computeChildrenField.value
|
|
1488
1496
|
const mapChildrenField = computeMapChildrenField.value
|
|
1489
1497
|
if (expanded) {
|
|
@@ -1499,9 +1507,17 @@ export default defineVxeComponent({
|
|
|
1499
1507
|
internalData.treeExpandedMaps = {}
|
|
1500
1508
|
}
|
|
1501
1509
|
reactData.updateExpandedFlag++
|
|
1510
|
+
reactData.topSpaceHeight = 0
|
|
1511
|
+
scrollYStore.startIndex = 0
|
|
1512
|
+
scrollYStore.endIndex = 1
|
|
1502
1513
|
handleTreeToList()
|
|
1503
1514
|
handleData()
|
|
1504
|
-
return recalculate()
|
|
1515
|
+
return recalculate().then(() => {
|
|
1516
|
+
if (scrollYLoad) {
|
|
1517
|
+
loadYData()
|
|
1518
|
+
}
|
|
1519
|
+
return recalculate()
|
|
1520
|
+
})
|
|
1505
1521
|
},
|
|
1506
1522
|
reloadExpandNode (node) {
|
|
1507
1523
|
const { lazy } = props
|
|
@@ -1955,12 +1971,8 @@ export default defineVxeComponent({
|
|
|
1955
1971
|
if (resizeObserver) {
|
|
1956
1972
|
resizeObserver.disconnect()
|
|
1957
1973
|
}
|
|
1958
|
-
|
|
1959
|
-
internalData.treeExpandedMaps = {}
|
|
1960
|
-
internalData.indeterminateRowMaps = {}
|
|
1961
|
-
internalData.nodeMaps = {}
|
|
1962
|
-
|
|
1963
1974
|
globalEvents.off($xeTree, 'resize')
|
|
1975
|
+
XEUtils.assign(internalData, createInternalData())
|
|
1964
1976
|
})
|
|
1965
1977
|
|
|
1966
1978
|
loadData(props.data || [])
|
|
@@ -17,6 +17,14 @@ function getOptUniqueId () {
|
|
|
17
17
|
return XEUtils.uniqueId('node_')
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function createInternalData (): TreeSelectInternalData {
|
|
21
|
+
return {
|
|
22
|
+
// hpTimeout: undefined,
|
|
23
|
+
fullOptionList: [],
|
|
24
|
+
fullNodeMaps: {}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export default defineVxeComponent({
|
|
21
29
|
name: 'VxeTreeSelect',
|
|
22
30
|
props: {
|
|
@@ -127,11 +135,7 @@ export default defineVxeComponent({
|
|
|
127
135
|
isActivated: false
|
|
128
136
|
})
|
|
129
137
|
|
|
130
|
-
const internalData
|
|
131
|
-
// hpTimeout: undefined,
|
|
132
|
-
fullOptionList: [],
|
|
133
|
-
fullNodeMaps: {}
|
|
134
|
-
}
|
|
138
|
+
const internalData = createInternalData()
|
|
135
139
|
|
|
136
140
|
const refMaps: TreeSelectPrivateRef = {
|
|
137
141
|
refElem
|
|
@@ -865,6 +869,7 @@ export default defineVxeComponent({
|
|
|
865
869
|
globalEvents.off($xeTreeSelect, 'mousedown')
|
|
866
870
|
globalEvents.off($xeTreeSelect, 'blur')
|
|
867
871
|
globalEvents.off($xeTreeSelect, 'resize')
|
|
872
|
+
XEUtils.assign(internalData, createInternalData())
|
|
868
873
|
})
|
|
869
874
|
|
|
870
875
|
provide('$xeTreeSelect', $xeTreeSelect)
|
|
@@ -18,6 +18,7 @@ export interface VxeGridConstructor<D = any> extends VxeComponentBaseOptions, Vx
|
|
|
18
18
|
props: VxeGridProps
|
|
19
19
|
context: SetupContext<VxeGridEmits>
|
|
20
20
|
reactData: GridReactData
|
|
21
|
+
internalData: GridInternalData
|
|
21
22
|
getRefMaps(): GridPrivateRef
|
|
22
23
|
getComputeMaps(): GridPrivateComputed
|
|
23
24
|
renderVN: RenderFunction
|
|
@@ -292,6 +293,8 @@ export interface GridReactData<D = any> {
|
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
295
|
|
|
296
|
+
export interface GridInternalData {}
|
|
297
|
+
|
|
295
298
|
export interface GridMethods<D = any> {
|
|
296
299
|
dispatchEvent(type: ValueOf<VxeGridEmits>, params: Record<string, any>, evnt: Event | null): void
|
|
297
300
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|