@hi-ui/check-cascader 4.3.0 → 4.3.1-alpha.0
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/lib/cjs/utils/index.js +5 -2
- package/lib/esm/utils/index.js +6 -3
- package/package.json +1 -1
- package/CHANGELOG.md +0 -168
package/lib/cjs/utils/index.js
CHANGED
@@ -101,10 +101,13 @@ function getCascaderItemEventData(node, requiredProps) {
|
|
101
101
|
*/
|
102
102
|
var processCheckedIds = function processCheckedIds(type, checkedIds, flattenData, allowCheck) {
|
103
103
|
var keySet = new Set(checkedIds);
|
104
|
+
var flattenDataMap = new Map(flattenData.map(function (node) {
|
105
|
+
return [node.id, node];
|
106
|
+
}));
|
104
107
|
switch (type) {
|
105
108
|
case 'CHILD':
|
106
109
|
return checkedIds.filter(function (id) {
|
107
|
-
var node =
|
110
|
+
var node = flattenDataMap.get(id);
|
108
111
|
if (node) {
|
109
112
|
var children = node.children;
|
110
113
|
if (typeAssertion.isArrayNonEmpty(children)) {
|
@@ -120,7 +123,7 @@ var processCheckedIds = function processCheckedIds(type, checkedIds, flattenData
|
|
120
123
|
});
|
121
124
|
case 'PARENT':
|
122
125
|
return checkedIds.filter(function (id) {
|
123
|
-
var node =
|
126
|
+
var node = flattenDataMap.get(id);
|
124
127
|
if (node) {
|
125
128
|
// 向上递归遍历是否被勾选
|
126
129
|
var ancestors = treeUtils.getNodeAncestors(node);
|
package/lib/esm/utils/index.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
import { baseFlattenTree, getTopDownAncestors,
|
10
|
+
import { baseFlattenTree, getTopDownAncestors, getNodeAncestors, findNestedChildren } from '@hi-ui/tree-utils';
|
11
11
|
import { isArrayNonEmpty } from '@hi-ui/type-assertion';
|
12
12
|
|
13
13
|
/**
|
@@ -96,10 +96,13 @@ function getCascaderItemEventData(node, requiredProps) {
|
|
96
96
|
*/
|
97
97
|
var processCheckedIds = function processCheckedIds(type, checkedIds, flattenData, allowCheck) {
|
98
98
|
var keySet = new Set(checkedIds);
|
99
|
+
var flattenDataMap = new Map(flattenData.map(function (node) {
|
100
|
+
return [node.id, node];
|
101
|
+
}));
|
99
102
|
switch (type) {
|
100
103
|
case 'CHILD':
|
101
104
|
return checkedIds.filter(function (id) {
|
102
|
-
var node =
|
105
|
+
var node = flattenDataMap.get(id);
|
103
106
|
if (node) {
|
104
107
|
var children = node.children;
|
105
108
|
if (isArrayNonEmpty(children)) {
|
@@ -115,7 +118,7 @@ var processCheckedIds = function processCheckedIds(type, checkedIds, flattenData
|
|
115
118
|
});
|
116
119
|
case 'PARENT':
|
117
120
|
return checkedIds.filter(function (id) {
|
118
|
-
var node =
|
121
|
+
var node = flattenDataMap.get(id);
|
119
122
|
if (node) {
|
120
123
|
// 向上递归遍历是否被勾选
|
121
124
|
var ancestors = getNodeAncestors(node);
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
# @hi-ui/check-cascader
|
2
|
-
|
3
|
-
## 4.3.0
|
4
|
-
|
5
|
-
### Minor Changes
|
6
|
-
|
7
|
-
- [#2868](https://github.com/XiaoMi/hiui/pull/2868) [`95f2e843d`](https://github.com/XiaoMi/hiui/commit/95f2e843d154d5767c08d7a04a86d61804d71396) Thanks [@xiamiao1121](https://github.com/xiamiao1121)! - feat: 新增支持配置字段别名
|
8
|
-
|
9
|
-
- [#2824](https://github.com/XiaoMi/hiui/pull/2824) [`912c60b7b`](https://github.com/XiaoMi/hiui/commit/912c60b7b0f19a8386ec1de30fe6440e3963f288) Thanks [@xiamiao1121](https://github.com/xiamiao1121)! - feat: 支持前置后置内容
|
10
|
-
|
11
|
-
- [#2920](https://github.com/XiaoMi/hiui/pull/2920) [`ec38ee1a6`](https://github.com/XiaoMi/hiui/commit/ec38ee1a62f1716106ecd4617840295c1f22ed5b) Thanks [@yang-x20](https://github.com/yang-x20)! - feat: 新增自定义触发器
|
12
|
-
|
13
|
-
## 4.2.7
|
14
|
-
|
15
|
-
### Patch Changes
|
16
|
-
|
17
|
-
- [#2791](https://github.com/XiaoMi/hiui/pull/2791) [`1a00f9fc4`](https://github.com/XiaoMi/hiui/commit/1a00f9fc4a44619059d7852e846b54fedbd56715) Thanks [@zyprepare](https://github.com/zyprepare)! - build: style-inject(node 环境下有问题) 替换为 @hi-ui/style-inject
|
18
|
-
|
19
|
-
- Updated dependencies [[`1a00f9fc4`](https://github.com/XiaoMi/hiui/commit/1a00f9fc4a44619059d7852e846b54fedbd56715)]:
|
20
|
-
- @hi-ui/env@4.0.5
|
21
|
-
- @hi-ui/icons@4.0.19
|
22
|
-
- @hi-ui/checkbox@4.0.10
|
23
|
-
- @hi-ui/input@4.1.1
|
24
|
-
- @hi-ui/picker@4.1.6
|
25
|
-
- @hi-ui/popper@4.1.5
|
26
|
-
- @hi-ui/spinner@4.0.9
|
27
|
-
- @hi-ui/tag-input@4.1.1
|
28
|
-
- @hi-ui/array-utils@4.0.5
|
29
|
-
- @hi-ui/classname@4.0.5
|
30
|
-
|
31
|
-
## 4.2.6
|
32
|
-
|
33
|
-
### Patch Changes
|
34
|
-
|
35
|
-
- [#2752](https://github.com/XiaoMi/hiui/pull/2752) [`8cc7d032a`](https://github.com/XiaoMi/hiui/commit/8cc7d032aff1aa62099e71e2e1a3ca3a9a226e30) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复 PARENT 和 CHILD 模式在搜索场景下 id 丢失问题
|
36
|
-
|
37
|
-
- Updated dependencies [[`a9b9c93fc`](https://github.com/XiaoMi/hiui/commit/a9b9c93fc3a3fea60d14052a5afeef9daf7efa1b), [`b3a13135c`](https://github.com/XiaoMi/hiui/commit/b3a13135c77e75291d5864ff7fcf63ddb2ff46b8), [`ca008e4ae`](https://github.com/XiaoMi/hiui/commit/ca008e4ae9753bc1f11efcdcbf09121d1ef07b56)]:
|
38
|
-
- @hi-ui/input@4.1.0
|
39
|
-
- @hi-ui/tag-input@4.1.0
|
40
|
-
- @hi-ui/tree-utils@4.1.6
|
41
|
-
|
42
|
-
## 4.2.5
|
43
|
-
|
44
|
-
### Patch Changes
|
45
|
-
|
46
|
-
- build: rollup2 构建
|
47
|
-
- Updated dependencies
|
48
|
-
- @hi-ui/core@4.0.8
|
49
|
-
- @hi-ui/use-check@4.0.5
|
50
|
-
- @hi-ui/use-data-source@4.0.4
|
51
|
-
- @hi-ui/use-latest@4.0.4
|
52
|
-
- @hi-ui/use-merge-refs@4.0.4
|
53
|
-
- @hi-ui/use-outside-click@4.0.4
|
54
|
-
- @hi-ui/use-search-mode@4.1.4
|
55
|
-
- @hi-ui/use-toggle@4.0.4
|
56
|
-
- @hi-ui/use-uncontrolled-state@4.0.4
|
57
|
-
- @hi-ui/icons@4.0.18
|
58
|
-
- @hi-ui/checkbox@4.0.8
|
59
|
-
- @hi-ui/input@4.0.13
|
60
|
-
- @hi-ui/picker@4.1.4
|
61
|
-
- @hi-ui/popper@4.1.3
|
62
|
-
- @hi-ui/spinner@4.0.8
|
63
|
-
- @hi-ui/tag-input@4.0.10
|
64
|
-
- @hi-ui/array-utils@4.0.4
|
65
|
-
- @hi-ui/classname@4.0.4
|
66
|
-
- @hi-ui/env@4.0.4
|
67
|
-
- @hi-ui/func-utils@4.0.4
|
68
|
-
- @hi-ui/times@4.0.4
|
69
|
-
- @hi-ui/tree-utils@4.1.4
|
70
|
-
- @hi-ui/type-assertion@4.0.4
|
71
|
-
|
72
|
-
## 4.2.4
|
73
|
-
|
74
|
-
### Patch Changes
|
75
|
-
|
76
|
-
- fix: 修复 rollup3 打包 cjs 模块问题
|
77
|
-
- Updated dependencies
|
78
|
-
- @hi-ui/env@4.0.3
|
79
|
-
- @hi-ui/core@4.0.7
|
80
|
-
- @hi-ui/use-check@4.0.4
|
81
|
-
- @hi-ui/use-data-source@4.0.3
|
82
|
-
- @hi-ui/use-latest@4.0.3
|
83
|
-
- @hi-ui/use-merge-refs@4.0.3
|
84
|
-
- @hi-ui/use-outside-click@4.0.3
|
85
|
-
- @hi-ui/use-search-mode@4.1.3
|
86
|
-
- @hi-ui/use-toggle@4.0.3
|
87
|
-
- @hi-ui/use-uncontrolled-state@4.0.3
|
88
|
-
- @hi-ui/icons@4.0.17
|
89
|
-
- @hi-ui/checkbox@4.0.7
|
90
|
-
- @hi-ui/input@4.0.12
|
91
|
-
- @hi-ui/picker@4.1.3
|
92
|
-
- @hi-ui/popper@4.1.2
|
93
|
-
- @hi-ui/spinner@4.0.7
|
94
|
-
- @hi-ui/tag-input@4.0.9
|
95
|
-
- @hi-ui/array-utils@4.0.3
|
96
|
-
- @hi-ui/classname@4.0.3
|
97
|
-
- @hi-ui/func-utils@4.0.3
|
98
|
-
- @hi-ui/times@4.0.3
|
99
|
-
- @hi-ui/tree-utils@4.1.3
|
100
|
-
- @hi-ui/type-assertion@4.0.3
|
101
|
-
|
102
|
-
## 4.2.3
|
103
|
-
|
104
|
-
### Patch Changes
|
105
|
-
|
106
|
-
- [#2672](https://github.com/XiaoMi/hiui/pull/2672) [`1ebe27830`](https://github.com/XiaoMi/hiui/commit/1ebe2783098b3a8cd980bd10076d67635463800e) Thanks [@zyprepare](https://github.com/zyprepare)! - build: 升级到 rollup3,重新构建发布组件
|
107
|
-
|
108
|
-
- Updated dependencies [[`1ebe27830`](https://github.com/XiaoMi/hiui/commit/1ebe2783098b3a8cd980bd10076d67635463800e)]:
|
109
|
-
- @hi-ui/core@4.0.6
|
110
|
-
- @hi-ui/use-check@4.0.3
|
111
|
-
- @hi-ui/use-data-source@4.0.2
|
112
|
-
- @hi-ui/use-latest@4.0.2
|
113
|
-
- @hi-ui/use-merge-refs@4.0.2
|
114
|
-
- @hi-ui/use-outside-click@4.0.2
|
115
|
-
- @hi-ui/use-search-mode@4.1.2
|
116
|
-
- @hi-ui/use-toggle@4.0.2
|
117
|
-
- @hi-ui/use-uncontrolled-state@4.0.2
|
118
|
-
- @hi-ui/icons@4.0.16
|
119
|
-
- @hi-ui/checkbox@4.0.6
|
120
|
-
- @hi-ui/input@4.0.11
|
121
|
-
- @hi-ui/picker@4.1.2
|
122
|
-
- @hi-ui/popper@4.1.1
|
123
|
-
- @hi-ui/spinner@4.0.6
|
124
|
-
- @hi-ui/tag-input@4.0.8
|
125
|
-
- @hi-ui/array-utils@4.0.2
|
126
|
-
- @hi-ui/classname@4.0.2
|
127
|
-
- @hi-ui/env@4.0.2
|
128
|
-
- @hi-ui/func-utils@4.0.2
|
129
|
-
- @hi-ui/times@4.0.2
|
130
|
-
- @hi-ui/tree-utils@4.1.2
|
131
|
-
- @hi-ui/type-assertion@4.0.2
|
132
|
-
|
133
|
-
## 4.2.2
|
134
|
-
|
135
|
-
### Patch Changes
|
136
|
-
|
137
|
-
- [#2653](https://github.com/XiaoMi/hiui/pull/2653) [`b477d91db`](https://github.com/XiaoMi/hiui/commit/b477d91db15bbc92c8712a9a771af5b332779315) Thanks [@zyprepare](https://github.com/zyprepare)! - chore: 更新使用到的 G40 颜色值
|
138
|
-
|
139
|
-
- Updated dependencies [[`b477d91db`](https://github.com/XiaoMi/hiui/commit/b477d91db15bbc92c8712a9a771af5b332779315)]:
|
140
|
-
- @hi-ui/input@4.0.10
|
141
|
-
- @hi-ui/tag-input@4.0.7
|
142
|
-
|
143
|
-
## 4.2.1
|
144
|
-
|
145
|
-
### Patch Changes
|
146
|
-
|
147
|
-
- [#2612](https://github.com/XiaoMi/hiui/pull/2612) [`832360b54`](https://github.com/XiaoMi/hiui/commit/832360b54231983148858b12707087c6b6fbac87) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修改下拉菜单高度为 32px
|
148
|
-
|
149
|
-
## 4.2.0
|
150
|
-
|
151
|
-
### Minor Changes
|
152
|
-
|
153
|
-
- [#2606](https://github.com/XiaoMi/hiui/pull/2606) [`9be456ec0`](https://github.com/XiaoMi/hiui/commit/9be456ec092031eab5ab6097f8276cde0bd4721d) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加 renderExtraFooter 和 dropdownColumnRender api
|
154
|
-
|
155
|
-
- [#2602](https://github.com/XiaoMi/hiui/pull/2602) [`ad0d14abd`](https://github.com/XiaoMi/hiui/commit/ad0d14abdaf3ab2d5b79d649e7886ee90d1c941a) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add size api
|
156
|
-
|
157
|
-
## 4.1.0
|
158
|
-
|
159
|
-
### Minor Changes
|
160
|
-
|
161
|
-
- [#2531](https://github.com/XiaoMi/hiui/pull/2531) [`0a9d90ac5`](https://github.com/XiaoMi/hiui/commit/0a9d90ac53bdf66aa2b83b698b58d2cdeb98d912) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加 tagInputProps API,支持显示内容高度自适应
|
162
|
-
|
163
|
-
### Patch Changes
|
164
|
-
|
165
|
-
- Updated dependencies [[`bd5940eba`](https://github.com/XiaoMi/hiui/commit/bd5940eba7d7a80aa676f37bb804ea27544864d2), [`0a9d90ac5`](https://github.com/XiaoMi/hiui/commit/0a9d90ac53bdf66aa2b83b698b58d2cdeb98d912)]:
|
166
|
-
- @hi-ui/picker@4.1.1
|
167
|
-
- @hi-ui/popper@4.0.5
|
168
|
-
- @hi-ui/tag-input@4.0.6
|