vxe-pc-ui 4.21.0 → 4.21.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 +442 -94
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +149 -29
- package/dist/style.mini.css +1 -1
- package/es/esm.index.d.ts +7 -0
- package/es/esm.index.js +8 -0
- package/es/icon/style.css +43 -4
- package/es/icon/style.mini.css +1 -1
- package/es/style.css +149 -29
- package/es/style.mini.css +1 -1
- package/es/tree/index.d.ts +14 -6
- package/es/tree/src/tree.d.ts +3 -1
- package/es/tree/src/tree.js +111 -48
- package/es/tree/src/util.d.ts +5 -0
- package/es/tree/src/util.js +97 -2
- package/es/tree/style.css +99 -23
- package/es/tree/style.mini.css +1 -1
- package/es/ui/index.js +15 -12
- package/es/ui/src/log.js +1 -1
- package/es/vxe-icon/style.css +43 -4
- package/es/vxe-icon/style.mini.css +1 -1
- package/es/vxe-tree/style.css +99 -23
- package/es/vxe-tree/style.mini.css +1 -1
- package/lib/esm.index.d.ts +7 -0
- package/lib/esm.index.js +39 -0
- package/lib/icon/style/style.css +43 -4
- package/lib/icon/style/style.mini.css +1 -1
- package/lib/index.umd.js +221 -93
- package/lib/index.umd.min.js +3 -3
- package/lib/style.css +149 -29
- package/lib/style.mini.css +1 -1
- package/lib/tree/index.d.ts +14 -6
- package/lib/tree/src/tree.d.ts +3 -1
- package/lib/tree/src/tree.js +110 -47
- package/lib/tree/src/util.d.ts +5 -0
- package/lib/tree/src/util.js +97 -2
- package/lib/tree/style/style.css +99 -23
- package/lib/tree/style/style.mini.css +1 -1
- package/lib/ui/index.js +15 -12
- package/lib/ui/src/log.js +1 -1
- package/lib/vxe-icon/style/style.css +43 -4
- package/lib/vxe-icon/style/style.mini.css +1 -1
- package/lib/vxe-tree/style/style.css +99 -23
- package/lib/vxe-tree/style/style.mini.css +1 -1
- package/package.json +2 -2
- package/packages/esm.index.ts +10 -0
- package/packages/tree/src/tree.ts +129 -48
- package/packages/tree/src/util.ts +113 -1
- package/packages/ui/index.ts +14 -11
- package/styles/components/icon.scss +11 -3
- package/styles/components/tree.scss +145 -14
- package/styles/theme/base.scss +7 -2
- package/types/components/table.d.ts +1 -0
- package/types/components/tree.d.ts +34 -0
- /package/dist/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/dist/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/dist/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/es/icon/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/es/icon/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/es/icon/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/es/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/es/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/es/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/lib/icon/style/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/lib/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/lib/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/lib/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, h, reactive, PropType, computed, VNode, watch, onBeforeUnmount, nextTick, onMounted, provide } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
-
import {
|
|
4
|
+
import { getTreeNodeLines, getItemCacheObj } from './util'
|
|
5
5
|
import { createComponentLog } from '../../ui/src/log'
|
|
6
6
|
import { getCrossTreeDragNodeInfo } from './store'
|
|
7
7
|
import XEUtils from 'xe-utils'
|
|
@@ -178,6 +178,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
178
178
|
type: Boolean as PropType<VxeTreePropTypes.ShowLine>,
|
|
179
179
|
default: () => getConfig().tree.showLine
|
|
180
180
|
},
|
|
181
|
+
lineConfig: Object as PropType<VxeTreePropTypes.LineConfig>,
|
|
181
182
|
trigger: String as PropType<VxeTreePropTypes.Trigger>,
|
|
182
183
|
indent: {
|
|
183
184
|
type: Number as PropType<VxeTreePropTypes.Indent>,
|
|
@@ -350,6 +351,15 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
350
351
|
return props.isHover
|
|
351
352
|
})
|
|
352
353
|
|
|
354
|
+
const computeLineOpts = computed(() => {
|
|
355
|
+
return Object.assign({}, getConfig().tree.lineConfig, props.lineConfig)
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
const computeShowTreeRootLine = computed(() => {
|
|
359
|
+
const lineOpts = computeLineOpts.value
|
|
360
|
+
return lineOpts.showRootLine
|
|
361
|
+
})
|
|
362
|
+
|
|
353
363
|
const computeRadioOpts = computed(() => {
|
|
354
364
|
return Object.assign({ showIcon: true }, getConfig().tree.radioConfig, props.radioConfig)
|
|
355
365
|
})
|
|
@@ -401,6 +411,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
401
411
|
const computeTreeStyle = computed(() => {
|
|
402
412
|
const { indent } = props
|
|
403
413
|
const { customHeight, customMinHeight, customMaxHeight } = reactData
|
|
414
|
+
const lineOpts = computeLineOpts.value
|
|
415
|
+
const { lineWidth, lineColor } = lineOpts
|
|
404
416
|
const checkboxOpts = computeCheckboxOpts.value
|
|
405
417
|
const { nodeStyle } = checkboxOpts
|
|
406
418
|
const stys: VxeComponentStyleType = {}
|
|
@@ -416,6 +428,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
416
428
|
if (indent) {
|
|
417
429
|
stys['--vxe-ui-tree-node-indent'] = toCssUnit(indent)
|
|
418
430
|
}
|
|
431
|
+
if (lineWidth) {
|
|
432
|
+
stys['--vxe-ui-tree-node-line-width'] = toCssUnit(lineWidth)
|
|
433
|
+
}
|
|
434
|
+
if (lineColor) {
|
|
435
|
+
stys['--vxe-ui-tree-node-line-color'] = toCssUnit(lineColor)
|
|
436
|
+
}
|
|
419
437
|
if (nodeStyle) {
|
|
420
438
|
const { indeterminateColor, checkedColor } = nodeStyle
|
|
421
439
|
if (indeterminateColor) {
|
|
@@ -736,7 +754,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
736
754
|
level: nodes.length - 1,
|
|
737
755
|
treeIndex: index,
|
|
738
756
|
lineCount: 0,
|
|
739
|
-
treeLoaded: false
|
|
757
|
+
treeLoaded: false,
|
|
758
|
+
linesMask: 0
|
|
740
759
|
}
|
|
741
760
|
},
|
|
742
761
|
{ children: childrenField }
|
|
@@ -745,40 +764,83 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
745
764
|
}
|
|
746
765
|
|
|
747
766
|
const updateAfterDataIndex = () => {
|
|
748
|
-
const { transform } = props
|
|
767
|
+
const { lazy, showLine, transform } = props
|
|
749
768
|
const { afterTreeList, nodeMaps } = internalData
|
|
750
769
|
const childrenField = computeChildrenField.value
|
|
751
770
|
const mapChildrenField = computeMapChildrenField.value
|
|
771
|
+
const hasChildField = computeHasChildField.value
|
|
772
|
+
const showTreeRootLine = computeShowTreeRootLine.value
|
|
773
|
+
const treeFullSize = afterTreeList.length
|
|
752
774
|
let vtIndex = 0
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
775
|
+
|
|
776
|
+
function handleTreeDFS(item: any, index: number, items: any[], parenItem: any, depth: number, isFirstRow: boolean, isLastRow: boolean, isLastChild: boolean, stackMask: number, seq: string) {
|
|
777
|
+
const nodeid = getNodeId(item)
|
|
778
|
+
let nodeItem = nodeMaps[nodeid]
|
|
779
|
+
const nodeChilds = item[transform ? mapChildrenField : childrenField]
|
|
780
|
+
const childList: any[] = XEUtils.get(item, childrenField)
|
|
781
|
+
const isExistChild = childList && childList.length > 0
|
|
782
|
+
|
|
783
|
+
if (nodeItem) {
|
|
784
|
+
nodeItem.items = items
|
|
785
|
+
nodeItem.treeIndex = index
|
|
786
|
+
nodeItem._index = vtIndex
|
|
787
|
+
} else {
|
|
788
|
+
nodeItem = {
|
|
789
|
+
item,
|
|
790
|
+
index,
|
|
791
|
+
$index: -1,
|
|
792
|
+
_index: vtIndex,
|
|
793
|
+
items,
|
|
794
|
+
parent: parenItem,
|
|
795
|
+
nodes: [],
|
|
796
|
+
level: 0,
|
|
797
|
+
treeIndex: index,
|
|
798
|
+
lineCount: 0,
|
|
799
|
+
treeLoaded: false,
|
|
800
|
+
linesMask: 0
|
|
777
801
|
}
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
|
|
802
|
+
nodeMaps[nodeid] = nodeItem
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// 计算当前节点的线条标记
|
|
806
|
+
let linesMask = (stackMask >> 1)
|
|
807
|
+
if (!isLastChild) {
|
|
808
|
+
linesMask |= (1 << (depth - 1))
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
nodeItem.level = depth - 1
|
|
812
|
+
nodeItem.linesMask = linesMask
|
|
813
|
+
|
|
814
|
+
let hasLazyChilds = false
|
|
815
|
+
let isLazyLoaded = false
|
|
816
|
+
if (lazy) {
|
|
817
|
+
hasLazyChilds = item[hasChildField]
|
|
818
|
+
isLazyLoaded = !!nodeItem.treeLoaded
|
|
819
|
+
}
|
|
820
|
+
const isExpandable = lazy ? (isLazyLoaded ? isExistChild : hasLazyChilds) : isExistChild
|
|
821
|
+
|
|
822
|
+
nodeItem.treeLines = showLine && treeFullSize > 1 ? getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showTreeRootLine) : []
|
|
823
|
+
|
|
824
|
+
// 计算传给子节点的状态
|
|
825
|
+
let nextStackMask = stackMask
|
|
826
|
+
if (!isLastChild) {
|
|
827
|
+
nextStackMask |= (1 << depth)
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
vtIndex++
|
|
831
|
+
|
|
832
|
+
// 递归子节点
|
|
833
|
+
if (nodeChilds) {
|
|
834
|
+
for (let i = 0; i < nodeChilds.length; i++) {
|
|
835
|
+
handleTreeDFS(nodeChilds[i], i, nodeChilds, item, depth + 1, false, false, i === nodeChilds.length - 1, nextStackMask, `${seq}.${i + 1}`)
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// 根节点 depth 从 1 开始
|
|
841
|
+
for (let i = 0; i < treeFullSize; i++) {
|
|
842
|
+
handleTreeDFS(afterTreeList[i], i, afterTreeList, null, 1, !i, i === treeFullSize - 1, i === treeFullSize - 1, 0, '' + i)
|
|
843
|
+
}
|
|
782
844
|
}
|
|
783
845
|
|
|
784
846
|
const updateAfterFullData = () => {
|
|
@@ -2255,7 +2317,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
2255
2317
|
level: parentLevel + nodes.length,
|
|
2256
2318
|
treeIndex: -1,
|
|
2257
2319
|
lineCount: 0,
|
|
2258
|
-
treeLoaded: false
|
|
2320
|
+
treeLoaded: false,
|
|
2321
|
+
linesMask: 0
|
|
2259
2322
|
}
|
|
2260
2323
|
},
|
|
2261
2324
|
{ children: childrenField }
|
|
@@ -3370,10 +3433,29 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3370
3433
|
return renderEmptyElement($xeTree)
|
|
3371
3434
|
}
|
|
3372
3435
|
|
|
3436
|
+
const renderLine = (nodeItem: VxeTreeDefines.NodeCacheItem) => {
|
|
3437
|
+
const treeLines = nodeItem.treeLines
|
|
3438
|
+
const lineVNs: VNode[] = []
|
|
3439
|
+
if (treeLines) {
|
|
3440
|
+
const lineOpts = computeLineOpts.value
|
|
3441
|
+
const { lineType } = lineOpts
|
|
3442
|
+
treeLines.forEach((item, i) => {
|
|
3443
|
+
lineVNs.push(
|
|
3444
|
+
h('span', {
|
|
3445
|
+
key: 'le' + i,
|
|
3446
|
+
class: ['vxe-tree--node-line', `type--${lineType || 'solid'}`, item.type],
|
|
3447
|
+
style: item.style
|
|
3448
|
+
})
|
|
3449
|
+
)
|
|
3450
|
+
})
|
|
3451
|
+
}
|
|
3452
|
+
return lineVNs
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3373
3455
|
const renderNode = (node: any, nodeid: string) => {
|
|
3374
3456
|
const { lazy, drag, transform, showRadio, showCheckbox, showLine, visibleMethod, iconOpen, iconClose, iconLoaded, showIcon } = props
|
|
3375
3457
|
const { currentNode, selectRadioKey, updateExpandedFlag } = reactData
|
|
3376
|
-
const {
|
|
3458
|
+
const { nodeMaps, treeExpandedMaps, treeExpandLazyLoadedMaps } = internalData
|
|
3377
3459
|
const tooltipOpts = computeTooltipOpts.value
|
|
3378
3460
|
const { mode: tipMode } = tooltipOpts
|
|
3379
3461
|
const radioOpts = computeRadioOpts.value
|
|
@@ -3415,7 +3497,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3415
3497
|
hasLazyChilds = node[hasChildField]
|
|
3416
3498
|
isLazyLoaded = !!nodeItem.treeLoaded
|
|
3417
3499
|
}
|
|
3418
|
-
const prevNode = nodeItem.items[nodeItem.treeIndex - 1]
|
|
3419
3500
|
const nParams = { node, isExpand, $tree: $xeTree }
|
|
3420
3501
|
|
|
3421
3502
|
const itemOns: {
|
|
@@ -3483,20 +3564,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3483
3564
|
},
|
|
3484
3565
|
[
|
|
3485
3566
|
showLine
|
|
3486
|
-
? h(
|
|
3487
|
-
'
|
|
3488
|
-
|
|
3489
|
-
class: 'vxe-tree--node-line-wrapper'
|
|
3490
|
-
},
|
|
3491
|
-
[
|
|
3492
|
-
h('div', {
|
|
3493
|
-
class: 'vxe-tree--node-line',
|
|
3494
|
-
style: {
|
|
3495
|
-
height: `${getNodeId(afterTreeList[0]) === nodeid ? 1 : calcTreeLine($xeTree, node, prevNode)}px`
|
|
3496
|
-
}
|
|
3497
|
-
})
|
|
3498
|
-
]
|
|
3499
|
-
)
|
|
3567
|
+
? h('div', {
|
|
3568
|
+
class: 'vxe-tree--node-line-wrapper'
|
|
3569
|
+
}, renderLine(nodeItem))
|
|
3500
3570
|
: renderEmptyElement($xeTree),
|
|
3501
3571
|
h(
|
|
3502
3572
|
'div',
|
|
@@ -4009,6 +4079,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
4009
4079
|
})
|
|
4010
4080
|
})
|
|
4011
4081
|
|
|
4082
|
+
const lineFlag = ref(0)
|
|
4083
|
+
watch(() => props.showLine, () => {
|
|
4084
|
+
lineFlag.value++
|
|
4085
|
+
})
|
|
4086
|
+
watch(computeShowTreeRootLine, () => {
|
|
4087
|
+
lineFlag.value++
|
|
4088
|
+
})
|
|
4089
|
+
watch(lineFlag, () => {
|
|
4090
|
+
updateAfterDataIndex()
|
|
4091
|
+
})
|
|
4092
|
+
|
|
4012
4093
|
watch(reScrollFlag, () => {
|
|
4013
4094
|
updateScrollbar().then(() => {
|
|
4014
4095
|
updateScrollbar()
|
|
@@ -46,6 +46,118 @@ export function getItemCacheObj(item: any): VxeTreeDefines.NodeCacheItem {
|
|
|
46
46
|
level: 0,
|
|
47
47
|
treeIndex: -1,
|
|
48
48
|
lineCount: 0,
|
|
49
|
-
treeLoaded: false
|
|
49
|
+
treeLoaded: false,
|
|
50
|
+
linesMask: 0
|
|
50
51
|
}
|
|
51
52
|
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 分配树节点的连接线
|
|
56
|
+
* 类名(cut-full / cut-top / cut-bottom)
|
|
57
|
+
*/
|
|
58
|
+
export function getTreeNodeLines(isExpandable: boolean, depth: number, linesMask: number, isFirstRow: boolean, isLastRow: boolean, showRootLine: boolean | undefined) {
|
|
59
|
+
const lines: VxeTreeDefines.NodeCacheTreeLineData[] = []
|
|
60
|
+
|
|
61
|
+
for (let col = 1; col <= depth; col++) {
|
|
62
|
+
const leftVal = `var(--vxe-ui-tree-node-padding) + var(--vxe-ui-tree-node-btn-width) / 2 + var(--vxe-ui-tree-node-indent) * ${(col - 1)}`
|
|
63
|
+
const through = (linesMask & (1 << (col - 1))) !== 0
|
|
64
|
+
|
|
65
|
+
if (col === 1 && !showRootLine) {
|
|
66
|
+
continue
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (col < depth) {
|
|
70
|
+
// 普通列(贯穿线)
|
|
71
|
+
if (through) {
|
|
72
|
+
let top = '0'
|
|
73
|
+
let height = '100%'
|
|
74
|
+
if (isFirstRow) {
|
|
75
|
+
top = '50%'
|
|
76
|
+
height = '50%'
|
|
77
|
+
} else if (isLastRow) {
|
|
78
|
+
top = '0'
|
|
79
|
+
height = '50%'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
lines.push({
|
|
83
|
+
type: 'v',
|
|
84
|
+
style: {
|
|
85
|
+
left: `calc(${leftVal})`,
|
|
86
|
+
top,
|
|
87
|
+
height
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
// 肘部列
|
|
93
|
+
let vTop = '0'
|
|
94
|
+
let vHeight = through ? '100%' : '50%'
|
|
95
|
+
|
|
96
|
+
if (isFirstRow && isLastRow) {
|
|
97
|
+
vTop = '50%'
|
|
98
|
+
vHeight = '0px'
|
|
99
|
+
} else if (isFirstRow) {
|
|
100
|
+
vTop = '50%'
|
|
101
|
+
vHeight = '50%'
|
|
102
|
+
} else if (isLastRow) {
|
|
103
|
+
vTop = '0'
|
|
104
|
+
vHeight = '50%'
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (isExpandable && vHeight !== '0px') {
|
|
108
|
+
// 元素切割:根据头和尾的情况分配不同的类名
|
|
109
|
+
let cutType = 'v cut'
|
|
110
|
+
if (vTop === '0' && vHeight === '50%') {
|
|
111
|
+
cutType = 'v cut-top'
|
|
112
|
+
} else if (vTop === '50%' && vHeight === '50%') {
|
|
113
|
+
cutType = 'v cut-bottom'
|
|
114
|
+
} else if (vHeight === '100%') {
|
|
115
|
+
cutType = 'v cut-full'
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
lines.push({
|
|
119
|
+
type: cutType,
|
|
120
|
+
style: {
|
|
121
|
+
left: `calc(${leftVal})`,
|
|
122
|
+
top: vTop,
|
|
123
|
+
height: vHeight
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
} else {
|
|
127
|
+
// 正常竖线
|
|
128
|
+
if (vHeight !== '0px') {
|
|
129
|
+
lines.push({
|
|
130
|
+
type: 'v',
|
|
131
|
+
style: {
|
|
132
|
+
left: `calc(${leftVal})`,
|
|
133
|
+
top: vTop,
|
|
134
|
+
height: vHeight
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 横线处理:如果可展开,横线从图标右侧开始画;否则正常画
|
|
141
|
+
if (isExpandable) {
|
|
142
|
+
lines.push({
|
|
143
|
+
type: 'h',
|
|
144
|
+
style: {
|
|
145
|
+
left: `calc(${leftVal} + var(--vxe-ui-tree-node-btn-width) / 2)`,
|
|
146
|
+
top: '50%',
|
|
147
|
+
width: 'calc(var(--vxe-ui-tree-node-indent) - var(--vxe-ui-tree-node-btn-width) - 0.2em)'
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
} else {
|
|
151
|
+
lines.push({
|
|
152
|
+
type: 'h',
|
|
153
|
+
style: {
|
|
154
|
+
left: `calc(${leftVal})`,
|
|
155
|
+
top: '50%',
|
|
156
|
+
width: 'calc(var(--vxe-ui-tree-node-indent) - var(--vxe-ui-tree-node-btn-width) / 2 - 0.1em)'
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return lines
|
|
163
|
+
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -497,9 +497,12 @@ setConfig({
|
|
|
497
497
|
transfer: {},
|
|
498
498
|
tree: {
|
|
499
499
|
// autoResize: false,
|
|
500
|
-
indent: 20,
|
|
500
|
+
// indent: 20,
|
|
501
501
|
minHeight: 60,
|
|
502
502
|
showOverflow: true,
|
|
503
|
+
lineConfig: {
|
|
504
|
+
showRootLine: true
|
|
505
|
+
},
|
|
503
506
|
radioConfig: {
|
|
504
507
|
strict: true
|
|
505
508
|
},
|
|
@@ -579,23 +582,23 @@ setIcon({
|
|
|
579
582
|
LOADING: iconPrefix + 'spinner roll vxe-loading--default-icon',
|
|
580
583
|
|
|
581
584
|
// button
|
|
582
|
-
BUTTON_DROPDOWN_OPEN: iconPrefix + 'arrow-down
|
|
585
|
+
BUTTON_DROPDOWN_OPEN: iconPrefix + 'arrow-down rotate-180',
|
|
583
586
|
BUTTON_DROPDOWN_CLOSE: iconPrefix + 'arrow-down',
|
|
584
587
|
BUTTON_LOADING: iconPrefix + 'spinner roll',
|
|
585
588
|
BUTTON_TOOLTIP_ICON: iconPrefix + 'question-circle-fill',
|
|
586
589
|
|
|
587
590
|
// menu
|
|
588
|
-
MENU_ITEM_EXPAND_OPEN: iconPrefix + 'arrow-right
|
|
591
|
+
MENU_ITEM_EXPAND_OPEN: iconPrefix + 'arrow-right rotate-90',
|
|
589
592
|
MENU_ITEM_EXPAND_CLOSE: iconPrefix + 'arrow-right',
|
|
590
593
|
|
|
591
594
|
// select
|
|
592
595
|
SELECT_LOADED: iconPrefix + 'spinner roll',
|
|
593
|
-
SELECT_OPEN: iconPrefix + 'caret-down
|
|
596
|
+
SELECT_OPEN: iconPrefix + 'caret-down rotate-180',
|
|
594
597
|
SELECT_CLOSE: iconPrefix + 'caret-down',
|
|
595
598
|
SELECT_ADD_OPTION: iconPrefix + 'add',
|
|
596
599
|
|
|
597
600
|
// icon-picker
|
|
598
|
-
ICON_PICKER_OPEN: iconPrefix + 'caret-down
|
|
601
|
+
ICON_PICKER_OPEN: iconPrefix + 'caret-down rotate-180',
|
|
599
602
|
ICON_PICKER_CLOSE: iconPrefix + 'caret-down',
|
|
600
603
|
|
|
601
604
|
// pager
|
|
@@ -657,7 +660,7 @@ setIcon({
|
|
|
657
660
|
// form
|
|
658
661
|
FORM_PREFIX: iconPrefix + 'question-circle-fill',
|
|
659
662
|
FORM_SUFFIX: iconPrefix + 'question-circle-fill',
|
|
660
|
-
FORM_FOLDING: iconPrefix + 'arrow-up
|
|
663
|
+
FORM_FOLDING: iconPrefix + 'arrow-up rotate-180',
|
|
661
664
|
FORM_UNFOLDING: iconPrefix + 'arrow-up',
|
|
662
665
|
FORM_VALID_ERROR_ICON: iconPrefix + 'warning-circle-fill',
|
|
663
666
|
|
|
@@ -727,7 +730,7 @@ setIcon({
|
|
|
727
730
|
ALERT_ERROR: iconPrefix + 'error-circle-fill',
|
|
728
731
|
|
|
729
732
|
// tree
|
|
730
|
-
TREE_NODE_OPEN: iconPrefix + 'caret-right
|
|
733
|
+
TREE_NODE_OPEN: iconPrefix + 'caret-right rotate-90',
|
|
731
734
|
TREE_NODE_CLOSE: iconPrefix + 'caret-right',
|
|
732
735
|
TREE_NODE_LOADED: iconPrefix + 'spinner roll',
|
|
733
736
|
TREE_DRAG: iconPrefix + 'drag-handle',
|
|
@@ -737,12 +740,12 @@ setIcon({
|
|
|
737
740
|
|
|
738
741
|
// tree-select
|
|
739
742
|
TREE_SELECT_LOADED: iconPrefix + 'spinner roll',
|
|
740
|
-
TREE_SELECT_OPEN: iconPrefix + 'caret-down
|
|
743
|
+
TREE_SELECT_OPEN: iconPrefix + 'caret-down rotate-180',
|
|
741
744
|
TREE_SELECT_CLOSE: iconPrefix + 'caret-down',
|
|
742
745
|
|
|
743
746
|
// table-select
|
|
744
747
|
TABLE_SELECT_LOADED: iconPrefix + 'spinner roll',
|
|
745
|
-
TABLE_SELECT_OPEN: iconPrefix + 'caret-down
|
|
748
|
+
TABLE_SELECT_OPEN: iconPrefix + 'caret-down rotate-180',
|
|
746
749
|
TABLE_SELECT_CLOSE: iconPrefix + 'caret-down',
|
|
747
750
|
|
|
748
751
|
// tabs
|
|
@@ -769,7 +772,7 @@ setIcon({
|
|
|
769
772
|
CAROUSEL_VERTICAL_NEXT: iconPrefix + 'arrow-down',
|
|
770
773
|
|
|
771
774
|
// collapse
|
|
772
|
-
COLLAPSE_OPEN: iconPrefix + 'arrow-right
|
|
775
|
+
COLLAPSE_OPEN: iconPrefix + 'arrow-right rotate-90',
|
|
773
776
|
COLLAPSE_CLOSE: iconPrefix + 'arrow-right',
|
|
774
777
|
|
|
775
778
|
// empty
|
|
@@ -790,7 +793,7 @@ setIcon({
|
|
|
790
793
|
// color-picker
|
|
791
794
|
COLOR_PICKER_COLOR_COPY: iconPrefix + 'copy',
|
|
792
795
|
COLOR_PICKER_EYE_DROPPER: iconPrefix + 'dropper',
|
|
793
|
-
COLOR_PICKER_TPTY_OPEN: iconPrefix + 'arrow-down
|
|
796
|
+
COLOR_PICKER_TPTY_OPEN: iconPrefix + 'arrow-down rotate-180',
|
|
794
797
|
COLOR_PICKER_TPTY_CLOSE: iconPrefix + 'arrow-down',
|
|
795
798
|
|
|
796
799
|
// split
|
|
@@ -58,18 +58,26 @@ $btnThemeList: (
|
|
|
58
58
|
&.animat {
|
|
59
59
|
transition: transform 0.25s ease-in-out;
|
|
60
60
|
}
|
|
61
|
-
&.rotate45
|
|
61
|
+
&.rotate45,
|
|
62
|
+
&.rotate-45 {
|
|
62
63
|
transform: rotate(45deg);
|
|
63
64
|
}
|
|
64
|
-
&.rotate90
|
|
65
|
+
&.rotate90,
|
|
66
|
+
&.rotate-90 {
|
|
65
67
|
transform: rotate(90deg);
|
|
66
68
|
}
|
|
67
|
-
&.rotate180
|
|
69
|
+
&.rotate180,
|
|
70
|
+
&.rotate-180 {
|
|
68
71
|
transform: rotate(180deg);
|
|
69
72
|
}
|
|
70
73
|
&.roll {
|
|
71
74
|
animation: rollCircle 1s infinite linear;
|
|
72
75
|
}
|
|
76
|
+
@for $i from 6 through 18 {
|
|
77
|
+
&.fs-#{$i} {
|
|
78
|
+
font-size: #{$i}px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
73
81
|
@for $index from 0 to list.length($btnThemeList) {
|
|
74
82
|
$item: list.nth($btnThemeList, $index + 1);
|
|
75
83
|
&.theme--#{map.get($item, name)} {
|