vxe-pc-ui 3.3.8 → 3.3.10
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/icon/style.css +1 -1
- package/es/password-input/src/password-input.js +17 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +49 -46
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.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 +68 -50
- package/lib/index.umd.min.js +1 -1
- package/lib/password-input/src/password-input.js +18 -3
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tree/src/tree.js +48 -45
- 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/package.json +2 -2
- package/packages/password-input/src/password-input.ts +17 -1
- package/packages/tree/src/tree.ts +52 -47
- package/types/components/password-input.d.ts +2 -0
- /package/es/icon/{iconfont.1732522266421.ttf → iconfont.1732785225158.ttf} +0 -0
- /package/es/icon/{iconfont.1732522266421.woff → iconfont.1732785225158.woff} +0 -0
- /package/es/icon/{iconfont.1732522266421.woff2 → iconfont.1732785225158.woff2} +0 -0
- /package/es/{iconfont.1732522266421.ttf → iconfont.1732785225158.ttf} +0 -0
- /package/es/{iconfont.1732522266421.woff → iconfont.1732785225158.woff} +0 -0
- /package/es/{iconfont.1732522266421.woff2 → iconfont.1732785225158.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1732522266421.ttf → iconfont.1732785225158.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1732522266421.woff → iconfont.1732785225158.woff} +0 -0
- /package/lib/icon/style/{iconfont.1732522266421.woff2 → iconfont.1732785225158.woff2} +0 -0
- /package/lib/{iconfont.1732522266421.ttf → iconfont.1732785225158.ttf} +0 -0
- /package/lib/{iconfont.1732522266421.woff → iconfont.1732785225158.woff} +0 -0
- /package/lib/{iconfont.1732522266421.woff2 → iconfont.1732785225158.woff2} +0 -0
|
@@ -15,6 +15,18 @@ function getNodeUniqueId () {
|
|
|
15
15
|
return XEUtils.uniqueId('node_')
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function handleSetExpand (nodeid: string, expanded: boolean, expandedMaps: Record<string, boolean>) {
|
|
19
|
+
if (expanded) {
|
|
20
|
+
if (expandedMaps[nodeid]) {
|
|
21
|
+
expandedMaps[nodeid] = true
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
if (expandedMaps[nodeid]) {
|
|
25
|
+
delete expandedMaps[nodeid]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
export default defineVxeComponent({
|
|
19
31
|
name: 'VxeTree',
|
|
20
32
|
mixins: [
|
|
@@ -266,7 +278,7 @@ export default defineVxeComponent({
|
|
|
266
278
|
const $xeTree = this
|
|
267
279
|
const reactData = $xeTree.reactData
|
|
268
280
|
|
|
269
|
-
const selectMaps: Record<string, boolean> = Object.assign(reactData.selectCheckboxMaps)
|
|
281
|
+
const selectMaps: Record<string, boolean> = Object.assign({}, reactData.selectCheckboxMaps)
|
|
270
282
|
const childrenField = $xeTree.computeChildrenField
|
|
271
283
|
if (checked) {
|
|
272
284
|
XEUtils.eachTree(reactData.treeList, (node) => {
|
|
@@ -296,13 +308,13 @@ export default defineVxeComponent({
|
|
|
296
308
|
const $xeTree = this
|
|
297
309
|
const reactData = $xeTree.reactData
|
|
298
310
|
|
|
299
|
-
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
|
|
311
|
+
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
|
|
300
312
|
if (nodeids) {
|
|
301
313
|
if (!XEUtils.isArray(nodeids)) {
|
|
302
314
|
nodeids = [nodeids]
|
|
303
315
|
}
|
|
304
316
|
nodeids.forEach((nodeid: string) => {
|
|
305
|
-
|
|
317
|
+
handleSetExpand(nodeid, expanded, expandedMaps)
|
|
306
318
|
})
|
|
307
319
|
reactData.treeExpandedMaps = expandedMaps
|
|
308
320
|
}
|
|
@@ -312,14 +324,14 @@ export default defineVxeComponent({
|
|
|
312
324
|
const $xeTree = this
|
|
313
325
|
const reactData = $xeTree.reactData
|
|
314
326
|
|
|
315
|
-
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
|
|
327
|
+
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
|
|
316
328
|
if (nodes) {
|
|
317
329
|
if (!XEUtils.isArray(nodes)) {
|
|
318
330
|
nodes = [nodes]
|
|
319
331
|
}
|
|
320
332
|
nodes.forEach((node: any) => {
|
|
321
333
|
const nodeid = $xeTree.getNodeId(node)
|
|
322
|
-
|
|
334
|
+
handleSetExpand(nodeid, expanded, expandedMaps)
|
|
323
335
|
})
|
|
324
336
|
reactData.treeExpandedMaps = expandedMaps
|
|
325
337
|
}
|
|
@@ -329,13 +341,13 @@ export default defineVxeComponent({
|
|
|
329
341
|
const $xeTree = this
|
|
330
342
|
const reactData = $xeTree.reactData
|
|
331
343
|
|
|
332
|
-
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
|
|
344
|
+
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
|
|
333
345
|
if (nodeids) {
|
|
334
346
|
if (!XEUtils.isArray(nodeids)) {
|
|
335
347
|
nodeids = [nodeids]
|
|
336
348
|
}
|
|
337
349
|
nodeids.forEach((nodeid: string) => {
|
|
338
|
-
|
|
350
|
+
handleSetExpand(nodeid, !expandedMaps[nodeid], expandedMaps)
|
|
339
351
|
})
|
|
340
352
|
reactData.treeExpandedMaps = expandedMaps
|
|
341
353
|
}
|
|
@@ -345,14 +357,14 @@ export default defineVxeComponent({
|
|
|
345
357
|
const $xeTree = this
|
|
346
358
|
const reactData = $xeTree.reactData
|
|
347
359
|
|
|
348
|
-
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
|
|
360
|
+
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
|
|
349
361
|
if (nodes) {
|
|
350
362
|
if (!XEUtils.isArray(nodes)) {
|
|
351
363
|
nodes = [nodes]
|
|
352
364
|
}
|
|
353
365
|
nodes.forEach((node: any) => {
|
|
354
366
|
const nodeid = $xeTree.getNodeId(node)
|
|
355
|
-
|
|
367
|
+
handleSetExpand(nodeid, !expandedMaps[nodeid], expandedMaps)
|
|
356
368
|
})
|
|
357
369
|
reactData.treeExpandedMaps = expandedMaps
|
|
358
370
|
}
|
|
@@ -362,7 +374,7 @@ export default defineVxeComponent({
|
|
|
362
374
|
const $xeTree = this
|
|
363
375
|
const reactData = $xeTree.reactData
|
|
364
376
|
|
|
365
|
-
const expandedMaps: Record<string, boolean> = Object.assign(reactData.treeExpandedMaps)
|
|
377
|
+
const expandedMaps: Record<string, boolean> = Object.assign({}, reactData.treeExpandedMaps)
|
|
366
378
|
const childrenField = $xeTree.computeChildrenField
|
|
367
379
|
XEUtils.eachTree(reactData.treeList, (node) => {
|
|
368
380
|
const nodeid = $xeTree.getNodeId(node)
|
|
@@ -554,17 +566,6 @@ export default defineVxeComponent({
|
|
|
554
566
|
}
|
|
555
567
|
reactData.selectCheckboxMaps = selectKeyMaps
|
|
556
568
|
},
|
|
557
|
-
handleSetExpand (nodeid: string, expanded: boolean, expandedMaps: Record<string, boolean>) {
|
|
558
|
-
if (expanded) {
|
|
559
|
-
if (expandedMaps[nodeid]) {
|
|
560
|
-
expandedMaps[nodeid] = true
|
|
561
|
-
}
|
|
562
|
-
} else {
|
|
563
|
-
if (expandedMaps[nodeid]) {
|
|
564
|
-
delete expandedMaps[nodeid]
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
569
|
createNode (records: any[]) {
|
|
569
570
|
const $xeTree = this
|
|
570
571
|
|
|
@@ -708,27 +709,30 @@ export default defineVxeComponent({
|
|
|
708
709
|
const { checkStrictly } = checkboxOpts
|
|
709
710
|
return new Promise(resolve => {
|
|
710
711
|
if (loadMethod) {
|
|
711
|
-
const
|
|
712
|
+
const tempExpandLazyLoadedMaps = Object.assign({}, reactData.treeExpandLazyLoadedMaps)
|
|
712
713
|
const { nodeMaps } = reactData
|
|
713
714
|
const nodeid = $xeTree.getNodeId(node)
|
|
714
715
|
const nodeItem = nodeMaps[nodeid]
|
|
715
|
-
|
|
716
|
+
tempExpandLazyLoadedMaps[nodeid] = true
|
|
717
|
+
reactData.treeExpandLazyLoadedMaps = tempExpandLazyLoadedMaps
|
|
716
718
|
Promise.resolve(
|
|
717
719
|
loadMethod({ $tree: $xeTree, node })
|
|
718
720
|
).then((childRecords: any) => {
|
|
721
|
+
const { treeExpandLazyLoadedMaps } = reactData
|
|
719
722
|
nodeItem.treeLoaded = true
|
|
720
723
|
if (treeExpandLazyLoadedMaps[nodeid]) {
|
|
721
|
-
|
|
724
|
+
treeExpandLazyLoadedMaps[nodeid] = false
|
|
722
725
|
}
|
|
723
726
|
if (!XEUtils.isArray(childRecords)) {
|
|
724
727
|
childRecords = []
|
|
725
728
|
}
|
|
726
729
|
if (childRecords) {
|
|
727
730
|
return $xeTree.loadChildrenNode(node, childRecords).then(childRows => {
|
|
728
|
-
const
|
|
729
|
-
if (childRows.length && !
|
|
730
|
-
|
|
731
|
+
const tempExpandedMaps = Object.assign({}, reactData.treeExpandedMaps)
|
|
732
|
+
if (childRows.length && !tempExpandedMaps[nodeid]) {
|
|
733
|
+
tempExpandedMaps[nodeid] = true
|
|
731
734
|
}
|
|
735
|
+
reactData.treeExpandedMaps = tempExpandedMaps
|
|
732
736
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
733
737
|
if (!checkStrictly && $xeTree.isCheckedByCheckboxNodeId(nodeid)) {
|
|
734
738
|
$xeTree.handleCheckedCheckboxNode(childRows.map((item: any) => $xeTree.getNodeId(item)), true)
|
|
@@ -743,9 +747,9 @@ export default defineVxeComponent({
|
|
|
743
747
|
}
|
|
744
748
|
}).catch((e) => {
|
|
745
749
|
const { treeExpandLazyLoadedMaps } = reactData
|
|
746
|
-
nodeItem.treeLoaded =
|
|
750
|
+
nodeItem.treeLoaded = true
|
|
747
751
|
if (treeExpandLazyLoadedMaps[nodeid]) {
|
|
748
|
-
|
|
752
|
+
treeExpandLazyLoadedMaps[nodeid] = false
|
|
749
753
|
}
|
|
750
754
|
$xeTree.updateNodeLine(node)
|
|
751
755
|
$xeTree.dispatchEvent('load-error', { node, data: e }, new Event('load-error'))
|
|
@@ -1089,24 +1093,6 @@ export default defineVxeComponent({
|
|
|
1089
1093
|
const isExpand = treeExpandedMaps[nodeid]
|
|
1090
1094
|
const nodeItem = nodeMaps[nodeid]
|
|
1091
1095
|
const nodeValue = XEUtils.get(node, titleField)
|
|
1092
|
-
const childVns: VNode[] = []
|
|
1093
|
-
if (hasChild && treeExpandedMaps[nodeid]) {
|
|
1094
|
-
if (showLine) {
|
|
1095
|
-
childVns.push(
|
|
1096
|
-
h('div', {
|
|
1097
|
-
key: 'line',
|
|
1098
|
-
class: 'vxe-tree--node-child-line',
|
|
1099
|
-
style: {
|
|
1100
|
-
height: `calc(${nodeItem.lineCount} * var(--vxe-ui-tree-node-height) - var(--vxe-ui-tree-node-height) / 2)`,
|
|
1101
|
-
left: `${(nodeItem.level + 1) * (indent || 1)}px`
|
|
1102
|
-
}
|
|
1103
|
-
})
|
|
1104
|
-
)
|
|
1105
|
-
}
|
|
1106
|
-
childList.forEach(childItem => {
|
|
1107
|
-
childVns.push($xeTree.renderNode(h, childItem))
|
|
1108
|
-
})
|
|
1109
|
-
}
|
|
1110
1096
|
|
|
1111
1097
|
let isRadioChecked = false
|
|
1112
1098
|
if (showRadio) {
|
|
@@ -1128,6 +1114,25 @@ export default defineVxeComponent({
|
|
|
1128
1114
|
isLazyLoaded = !!nodeItem.treeLoaded
|
|
1129
1115
|
}
|
|
1130
1116
|
|
|
1117
|
+
const childVns: VNode[] = []
|
|
1118
|
+
if (hasChild && treeExpandedMaps[nodeid]) {
|
|
1119
|
+
if (showLine) {
|
|
1120
|
+
childVns.push(
|
|
1121
|
+
h('div', {
|
|
1122
|
+
key: 'line',
|
|
1123
|
+
class: 'vxe-tree--node-child-line',
|
|
1124
|
+
style: {
|
|
1125
|
+
height: `calc(${nodeItem.lineCount} * var(--vxe-ui-tree-node-height) - var(--vxe-ui-tree-node-height) / 2)`,
|
|
1126
|
+
left: `${(nodeItem.level + 1) * (indent || 1)}px`
|
|
1127
|
+
}
|
|
1128
|
+
})
|
|
1129
|
+
)
|
|
1130
|
+
}
|
|
1131
|
+
childList.forEach(childItem => {
|
|
1132
|
+
childVns.push($xeTree.renderNode(h, childItem))
|
|
1133
|
+
})
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1131
1136
|
return h('div', {
|
|
1132
1137
|
class: ['vxe-tree--node-wrapper', `node--level-${nodeItem.level}`],
|
|
1133
1138
|
attrs: {
|
|
@@ -18,6 +18,7 @@ export interface VxePasswordInputPrivateRef extends PasswordInputPrivateRef { }
|
|
|
18
18
|
export namespace VxePasswordInputPropTypes {
|
|
19
19
|
export type Size = VxeComponentSizeType
|
|
20
20
|
export type ModelValue = string | null
|
|
21
|
+
export type Immediate = boolean
|
|
21
22
|
export type ClassName = string
|
|
22
23
|
export type Name = string
|
|
23
24
|
export type Clearable = boolean
|
|
@@ -39,6 +40,7 @@ export namespace VxePasswordInputPropTypes {
|
|
|
39
40
|
export interface VxePasswordInputProps {
|
|
40
41
|
size?: VxePasswordInputPropTypes.Size
|
|
41
42
|
value?: VxePasswordInputPropTypes.ModelValue
|
|
43
|
+
immediate?: VxePasswordInputPropTypes.Immediate
|
|
42
44
|
className?: VxePasswordInputPropTypes.ClassName
|
|
43
45
|
name?: VxePasswordInputPropTypes.Name
|
|
44
46
|
clearable?: VxePasswordInputPropTypes.Clearable
|
|
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
|