@hi-ui/check-cascader 4.0.0-beta.7 → 4.0.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.
Files changed (65) hide show
  1. package/lib/cjs/CheckCascader.js +66 -67
  2. package/lib/cjs/CheckCascaderMenu.js +14 -13
  3. package/lib/cjs/{CheckCascaderMenus.js → CheckCascaderMenuList.js} +19 -25
  4. package/lib/cjs/context.js +1 -2
  5. package/lib/cjs/hooks/use-async-switch.js +5 -6
  6. package/lib/cjs/hooks/{use-cache.js → use-cache/lib/esm/index.js} +12 -6
  7. package/lib/cjs/hooks/use-check.js +16 -7
  8. package/lib/cjs/hooks/use-select.js +1 -2
  9. package/lib/cjs/icons/index.js +4 -5
  10. package/lib/cjs/index.js +1 -2
  11. package/lib/cjs/styles/index.scss.js +3 -4
  12. package/lib/cjs/utils/index.js +177 -68
  13. package/lib/esm/CheckCascader.js +54 -52
  14. package/lib/esm/CheckCascaderMenu.js +4 -4
  15. package/lib/esm/{CheckCascaderMenus.js → CheckCascaderMenuList.js} +16 -22
  16. package/lib/esm/context.js +1 -2
  17. package/lib/esm/hooks/use-async-switch.js +1 -2
  18. package/lib/esm/hooks/{use-cache.js → use-cache/lib/esm/index.js} +12 -6
  19. package/lib/esm/hooks/use-check.js +15 -7
  20. package/lib/esm/hooks/use-select.js +1 -2
  21. package/lib/esm/icons/index.js +1 -2
  22. package/lib/esm/index.js +1 -2
  23. package/lib/esm/styles/index.scss.js +4 -6
  24. package/lib/esm/utils/index.js +175 -70
  25. package/lib/types/CheckCascader.d.ts +14 -12
  26. package/lib/types/CheckCascaderMenu.d.ts +4 -4
  27. package/lib/types/{CheckCascaderMenus.d.ts → CheckCascaderMenuList.d.ts} +18 -10
  28. package/lib/types/context.d.ts +4 -4
  29. package/lib/types/hooks/index.d.ts +0 -2
  30. package/lib/types/hooks/use-async-switch.d.ts +2 -2
  31. package/lib/types/hooks/use-check.d.ts +2 -2
  32. package/lib/types/index.d.ts +1 -0
  33. package/lib/types/types.d.ts +13 -22
  34. package/lib/types/utils/index.d.ts +17 -10
  35. package/package.json +29 -27
  36. package/lib/cjs/CheckCascader.js.map +0 -1
  37. package/lib/cjs/CheckCascaderMenu.js.map +0 -1
  38. package/lib/cjs/CheckCascaderMenus.js.map +0 -1
  39. package/lib/cjs/context.js.map +0 -1
  40. package/lib/cjs/hooks/use-async-switch.js.map +0 -1
  41. package/lib/cjs/hooks/use-cache.js.map +0 -1
  42. package/lib/cjs/hooks/use-check.js.map +0 -1
  43. package/lib/cjs/hooks/use-search.js +0 -40
  44. package/lib/cjs/hooks/use-search.js.map +0 -1
  45. package/lib/cjs/hooks/use-select.js.map +0 -1
  46. package/lib/cjs/icons/index.js.map +0 -1
  47. package/lib/cjs/index.js.map +0 -1
  48. package/lib/cjs/styles/index.scss.js.map +0 -1
  49. package/lib/cjs/utils/index.js.map +0 -1
  50. package/lib/esm/CheckCascader.js.map +0 -1
  51. package/lib/esm/CheckCascaderMenu.js.map +0 -1
  52. package/lib/esm/CheckCascaderMenus.js.map +0 -1
  53. package/lib/esm/context.js.map +0 -1
  54. package/lib/esm/hooks/use-async-switch.js.map +0 -1
  55. package/lib/esm/hooks/use-cache.js.map +0 -1
  56. package/lib/esm/hooks/use-check.js.map +0 -1
  57. package/lib/esm/hooks/use-search.js +0 -31
  58. package/lib/esm/hooks/use-search.js.map +0 -1
  59. package/lib/esm/hooks/use-select.js.map +0 -1
  60. package/lib/esm/icons/index.js.map +0 -1
  61. package/lib/esm/index.js.map +0 -1
  62. package/lib/esm/styles/index.scss.js.map +0 -1
  63. package/lib/esm/utils/index.js.map +0 -1
  64. package/lib/types/hooks/use-cache.d.ts +0 -8
  65. package/lib/types/hooks/use-search.d.ts +0 -13
package/lib/cjs/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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.
@@ -19,4 +19,3 @@ var CheckCascader = require('./CheckCascader.js');
19
19
 
20
20
  exports.CheckCascader = CheckCascader.CheckCascader;
21
21
  exports["default"] = CheckCascader.CheckCascader;
22
- //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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.
@@ -12,11 +12,10 @@
12
12
  Object.defineProperty(exports, '__esModule', {
13
13
  value: true
14
14
  });
15
- var css_248z = "@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n.hi-v4-check-cascader__popper .hi-v4-picker__body {\n padding-left: 0;\n padding-right: 0; }\n.hi-v4-check-cascader__popper .hi-v4-picker__loading, .hi-v4-check-cascader__popper .hi-v4-picker__empty {\n padding: var(--hi-v4-spacing-5, 10px) var(--hi-v4-spacing-8, 16px); }\n.hi-v4-check-cascader-panel {\n white-space: nowrap;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n.hi-v4-check-cascader-panel-search {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0 10px 10px;\n position: relative; }\n.hi-v4-check-cascader-panel-search .hi-v4-input__prefix {\n font-size: 16px;\n padding-left: 0; }\n.hi-v4-check-cascader-panel-search__empty {\n display: inline-block;\n margin-top: 20px;\n font-size: 14px;\n font-weight: 400;\n color: #999;\n line-height: 20px; }\n.hi-v4-check-cascader-menus {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow-x: auto; }\n.hi-v4-check-cascader-menus--flatted .hi-v4-check-cascader-menu {\n -ms-flex-preferred-size: 100%;\n flex-basis: 100%; }\n.hi-v4-check-cascader-menu {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n vertical-align: middle;\n list-style: none;\n width: auto;\n box-sizing: border-box;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n display: inline-block;\n min-width: 140px;\n max-height: 256px;\n overflow: auto;\n padding: 0 var(--hi-v4-spacing-4, 8px);\n border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-check-cascader-menu:last-of-type {\n border: none; }\n.hi-v4-check-cascader-menu--checkable .hi-v4-check-cascader-menu-checkbox + .title__text {\n padding-left: 8px; }\n.hi-v4-check-cascader-menu-item {\n width: 100%;\n padding: var(--hi-v4-spacing-2, 4px) 0;\n position: relative;\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex; }\n.hi-v4-check-cascader-menu-checkbox {\n position: relative; }\n.hi-v4-check-cascader-menu-checkbox::after {\n right: 0;\n top: -8px;\n bottom: -8px;\n left: -8px;\n content: '';\n position: absolute;\n display: block; }\n.hi-v4-check-cascader-menu-option {\n padding: 0 var(--hi-v4-spacing-4, 8px);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n height: 32px;\n width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: relative;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-check-cascader-menu-option:hover {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-check-cascader-menus--selectchange .hi-v4-check-cascader-menu-option:hover .hi-v4-checkbox__icon {\n border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-check-cascader-menu-option.hi-v4-check-cascader-menu-option--selected {\n background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-check-cascader-menu-option.hi-v4-check-cascader-menu-option--selected .hi-v4-check-cascader-menu-switcher {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-check-cascader-menu-option--focused {\n background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }\n.hi-v4-check-cascader-menu-option--disabled {\n cursor: not-allowed;\n color: var(--hi-v4-color-gray-500, #929aa6);\n background: transparent; }\n.hi-v4-check-cascader-menu-option--disabled .hi-v4-check-cascader-menu-switcher {\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-check-cascader-menu .title__text {\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1; }\n.hi-v4-check-cascader-menu .title__text--cols {\n display: block;\n width: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n vertical-align: middle;\n list-style: none; }\n.hi-v4-check-cascader-menu .title__text--col {\n display: inline-block; }\n.hi-v4-check-cascader-menu .title__text--col::after {\n content: '\\00a0/\\00a0'; }\n.hi-v4-check-cascader-menu .title__text--col:last-child::after {\n content: none; }\n.hi-v4-check-cascader-menu .title__text--matched {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-check-cascader-menu-switcher {\n -ms-flex-negative: 0;\n flex-shrink: 0;\n font-size: 16px;\n color: var(--hi-v4-color-gray-500, #929aa6); }\n.hi-v4-check-cascader-menu-switcher--loading {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-tree--icon-loading {\n -webkit-animation-name: hi-rotate;\n animation-name: hi-rotate;\n -webkit-animation-duration: 2s;\n animation-duration: 2s;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite; }\n@-webkit-keyframes hi-rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0); }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n@keyframes hi-rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0); }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
15
+ var css_248z = ".hi-v4-check-cascader__popper .hi-v4-picker__body {padding-left: 0;padding-right: 0;overflow-y: hidden; }.hi-v4-check-cascader__popper .hi-v4-picker__loading, .hi-v4-check-cascader__popper .hi-v4-picker__empty {padding: var(--hi-v4-spacing-5, 10px) var(--hi-v4-spacing-8, 16px); }.hi-v4-check-cascader-panel {white-space: nowrap;-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-check-cascader-panel-search {-webkit-box-sizing: border-box;box-sizing: border-box;padding: 0 10px 10px;position: relative; }.hi-v4-check-cascader-panel-search .hi-v4-input__prefix {font-size: 16px;padding-left: 0; }.hi-v4-check-cascader-panel-search__empty {display: inline-block;margin-top: 20px;font-size: 14px;font-weight: 400;color: #999;line-height: 20px; }.hi-v4-check-cascader-menus {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-sizing: border-box;box-sizing: border-box;overflow-x: auto; }.hi-v4-check-cascader-menus--flatted .hi-v4-check-cascader-menu {-ms-flex-preferred-size: 100%;flex-basis: 100%; }.hi-v4-check-cascader-menu {-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;border: none;outline: none;font-size: var(--hi-v4-text-size-md, 0.875rem);vertical-align: middle;list-style: none;width: auto;box-sizing: border-box;-ms-flex-negative: 0;flex-shrink: 0;display: inline-block;min-width: 140px;max-height: 256px;overflow: auto;padding: 0 var(--hi-v4-spacing-4, 8px);border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-check-cascader-menu:last-of-type {border: none; }.hi-v4-check-cascader-menu--checkable .hi-v4-check-cascader-menu-checkbox + .title__text {padding-left: 8px; }.hi-v4-check-cascader-menu-item {width: 100%;padding: var(--hi-v4-spacing-2, 4px) 0;position: relative;cursor: pointer;display: -webkit-box;display: -ms-flexbox;display: flex; }.hi-v4-check-cascader-menu-checkbox {position: relative; }.hi-v4-check-cascader-menu-checkbox::after {right: 0;top: -8px;bottom: -8px;left: -8px;content: '';position: absolute;display: block; }.hi-v4-check-cascader-menu-option {padding: 0 var(--hi-v4-spacing-4, 8px);-webkit-box-sizing: border-box;box-sizing: border-box;height: 32px;width: 100%;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;position: relative;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;border-radius: var(--hi-v4-border-radius-md, 4px); }.hi-v4-check-cascader-menu-option:hover {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-check-cascader-menus--selectchange .hi-v4-check-cascader-menu-option:hover .hi-v4-checkbox__icon {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-check-cascader-menu-option.hi-v4-check-cascader-menu-option--selected {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-check-cascader-menu-option.hi-v4-check-cascader-menu-option--selected .hi-v4-check-cascader-menu-switcher {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-check-cascader-menu-option--focused {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-check-cascader-menu-option--disabled {cursor: not-allowed;color: var(--hi-v4-color-gray-500, #929aa6);background: transparent; }.hi-v4-check-cascader-menu-option--disabled .hi-v4-check-cascader-menu-switcher {color: var(--hi-v4-color-gray-400, #c9ced6); }.hi-v4-check-cascader-menu .title__text {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1; }.hi-v4-check-cascader-menu .title__text--cols {display: block;width: 100%;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0;padding: 0;border: none;outline: none;font-size: var(--hi-v4-text-size-md, 0.875rem);vertical-align: middle;list-style: none; }.hi-v4-check-cascader-menu .title__text--col {display: inline-block; }.hi-v4-check-cascader-menu .title__text--col::after {content: '\\00a0/\\00a0'; }.hi-v4-check-cascader-menu .title__text--col:last-child::after {content: none; }.hi-v4-check-cascader-menu .title__text--matched {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-check-cascader-menu-switcher {-ms-flex-negative: 0;flex-shrink: 0;font-size: 16px;color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-check-cascader-menu-switcher--loading {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-tree--icon-loading {-webkit-animation-name: hi-rotate;animation-name: hi-rotate;-webkit-animation-duration: 2s;animation-duration: 2s;-webkit-animation-iteration-count: infinite;animation-iteration-count: infinite; }@-webkit-keyframes hi-rotate {from {-webkit-transform: rotate(0);transform: rotate(0); }to {-webkit-transform: rotate(360deg);transform: rotate(360deg); } }@keyframes hi-rotate {from {-webkit-transform: rotate(0);transform: rotate(0); }to {-webkit-transform: rotate(360deg);transform: rotate(360deg); } }";
16
16
 
17
- var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
17
+ var __styleInject__ = require('inject-head-style')["default"];
18
18
 
19
19
  __styleInject__(css_248z);
20
20
 
21
21
  exports["default"] = css_248z;
22
- //# sourceMappingURL=index.scss.js.map
@@ -2,7 +2,7 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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.
@@ -12,6 +12,10 @@
12
12
  Object.defineProperty(exports, '__esModule', {
13
13
  value: true
14
14
  });
15
+
16
+ var treeUtils = require('@hi-ui/tree-utils');
17
+
18
+ var typeAssertion = require('@hi-ui/type-assertion');
15
19
  /**
16
20
  * 扁平化树数据结构,基于前序遍历
17
21
  *
@@ -19,74 +23,38 @@ Object.defineProperty(exports, '__esModule', {
19
23
  * @returns
20
24
  */
21
25
 
22
- var flattenTreeData = function flattenTreeData(treeData) {
23
- var flattedTreeData = [];
24
-
25
- var dig = function dig(node, depth, parent) {
26
- var id = node.id,
27
- title = node.title,
28
- children = node.children,
29
- _node$checkable = node.checkable,
30
- checkable = _node$checkable === void 0 ? true : _node$checkable,
31
- _node$isLeaf = node.isLeaf,
32
- isLeaf = _node$isLeaf === void 0 ? false : _node$isLeaf,
33
- _node$disabled = node.disabled,
34
- disabled = _node$disabled === void 0 ? false : _node$disabled,
35
- _node$disabledCheckbo = node.disabledCheckbox,
36
- disabledCheckbox = _node$disabledCheckbo === void 0 ? false : _node$disabledCheckbo;
37
- var flattedNode = {
38
- id: id,
39
- title: title,
40
- depth: depth,
41
- parent: parent,
42
- raw: node,
43
- isLeaf: isLeaf,
44
- disabled: disabled,
45
- disabledCheckbox: disabledCheckbox,
46
- checkable: checkable
47
- };
48
- flattedTreeData.push(flattedNode);
49
-
50
- if (children) {
51
- var childDepth = depth + 1;
52
- flattedNode.children = children.map(function (child) {
53
- return dig(child, childDepth, flattedNode);
54
- });
55
- }
56
-
57
- return flattedNode;
58
- }; // @ts-ignore
59
26
 
27
+ var flattenTreeData = function flattenTreeData(treeData, fieldNames) {
28
+ /**
29
+ * 转换对象
30
+ */
31
+ var getKeyFields = function getKeyFields(node, key) {
32
+ if (fieldNames) {
33
+ return node[fieldNames[key] || key];
34
+ }
60
35
 
61
- var treeRoot = getTreeRoot(); // @ts-ignore
62
-
63
- treeRoot.children = treeData.map(function (node) {
64
- return dig(node, 0, treeRoot);
65
- });
66
- return flattedTreeData;
67
- };
68
-
69
- var getTreeRoot = function getTreeRoot() {
70
- return {
71
- depth: -1
36
+ return node[key];
72
37
  };
73
- };
74
- /**
75
- * 获取祖先节点,包括自己
76
- * @param node
77
- * @returns
78
- */
79
-
80
38
 
81
- var getNodeAncestors = function getNodeAncestors(node) {
82
- var ancestors = [];
83
-
84
- while (node.parent) {
85
- ancestors.push(node);
86
- node = node.parent;
87
- }
39
+ return treeUtils.baseFlattenTree({
40
+ tree: treeData,
41
+ childrenFieldName: function childrenFieldName(node) {
42
+ return getKeyFields(node, 'children');
43
+ },
44
+ transform: function transform(node) {
45
+ var _a, _b, _c, _d;
88
46
 
89
- return ancestors;
47
+ var flattedNode = node;
48
+ var raw = node.raw;
49
+ flattedNode.id = getKeyFields(raw, 'id');
50
+ flattedNode.title = getKeyFields(raw, 'title');
51
+ flattedNode.disabled = (_a = getKeyFields(raw, 'disabled')) !== null && _a !== void 0 ? _a : false;
52
+ flattedNode.isLeaf = (_b = getKeyFields(raw, 'isLeaf')) !== null && _b !== void 0 ? _b : false;
53
+ flattedNode.checkable = (_c = getKeyFields(raw, 'checkable')) !== null && _c !== void 0 ? _c : true;
54
+ flattedNode.disabledCheckbox = (_d = getKeyFields(raw, 'disabledCheckbox')) !== null && _d !== void 0 ? _d : false;
55
+ return flattedNode;
56
+ }
57
+ });
90
58
  };
91
59
 
92
60
  var getActiveMenus = function getActiveMenus(data, selectedIds) {
@@ -128,20 +96,161 @@ var getActiveMenuIds = function getActiveMenuIds(data, selectedIds) {
128
96
  return selectedIds === id;
129
97
  });
130
98
  if (!selectedOption) return [];
131
- return getNodeAncestors(selectedOption).map(function (_ref4) {
99
+ return treeUtils.getTopDownAncestors(selectedOption).map(function (_ref4) {
132
100
  var id = _ref4.id;
133
101
  return id;
134
- }).reverse();
102
+ });
135
103
  };
136
104
 
137
105
  function getCascaderItemEventData(node, requiredProps) {
138
106
  return Object.assign(Object.assign({}, node), requiredProps);
139
107
  }
108
+ /**
109
+ * 处理选中的回显数据
110
+ *
111
+ * @param checkedIds 当前所有被选中的节点 ID 集合
112
+ * @param nodeEntries 所有数据的Map 集合
113
+ * @param type 数据回显方式
114
+ */
115
+
116
+
117
+ var processCheckedIds = function processCheckedIds(type, checkedIds, flattenData, allowCheck) {
118
+ var keySet = new Set(checkedIds);
119
+
120
+ switch (type) {
121
+ case 'CHILD':
122
+ return checkedIds.filter(function (id) {
123
+ var node = treeUtils.fFindNodeById(flattenData, id);
124
+
125
+ if (node) {
126
+ var children = node.children;
127
+
128
+ if (typeAssertion.isArrayNonEmpty(children)) {
129
+ if (children.filter(allowCheck).every(function (node) {
130
+ return keySet.has(node.id);
131
+ })) {
132
+ return false;
133
+ }
134
+ }
135
+ } // 没有孩子节点,保留
136
+
137
+
138
+ return true;
139
+ });
140
+
141
+ case 'PARENT':
142
+ return checkedIds.filter(function (id) {
143
+ var node = treeUtils.fFindNodeById(flattenData, id);
144
+
145
+ if (node) {
146
+ // 向上递归遍历是否被勾选
147
+ var ancestors = treeUtils.getNodeAncestors(node);
148
+
149
+ if (ancestors.some(function (parent) {
150
+ return keySet.has(parent.id);
151
+ })) {
152
+ return false;
153
+ }
154
+ }
155
+
156
+ return true;
157
+ });
158
+ }
159
+
160
+ return checkedIds;
161
+ };
162
+ /**
163
+ * 根据传入的 checkedIds 解析全选/半选数据
164
+ */
165
+
166
+
167
+ var parseCheckDataDirty = function parseCheckDataDirty(type, checkedIds, flattenData, allowCheck) {
168
+ switch (type) {
169
+ case 'CHILD':
170
+ case 'PARENT':
171
+ return dirtyCheck(checkedIds, flattenData, allowCheck);
172
+ }
173
+
174
+ return checkedIds;
175
+ };
176
+
177
+ function dirtyCheck(checkedIds, flattenData, allowCheck) {
178
+ var nodeEntities = flattenData.reduce(function (prev, cur) {
179
+ prev[cur.id] = cur;
180
+ return prev;
181
+ }, {});
182
+ var checkedIdsSet = new Set(checkedIds.filter(function (id) {
183
+ return !!nodeEntities[id];
184
+ }));
185
+ var depthEntities = new Map();
186
+ var maxDepth = 0; // Convert entities by depth for calculation
187
+
188
+ Object.keys(nodeEntities).forEach(function (id) {
189
+ var entity = nodeEntities[id];
190
+ var depth = entity.depth;
191
+ var depthSet = depthEntities.get(depth);
192
+
193
+ if (!depthSet) {
194
+ depthSet = new Set();
195
+ depthEntities.set(depth, depthSet);
196
+ }
197
+
198
+ depthSet.add(entity);
199
+ maxDepth = Math.max(maxDepth, depth);
200
+ });
201
+ return fillCheck(checkedIdsSet, depthEntities, nodeEntities, maxDepth, allowCheck);
202
+ }
203
+ /**
204
+ * 对 checkedIds 级联遗漏选项 id 填充
205
+ *
206
+ * 1. 把所有嵌套孩子节点 allowCheck 的都标记为 checked
207
+ * 2. 祖先节点从下至上维护 checked 状态
208
+ */
209
+
210
+
211
+ function fillCheck(checkedIds, depthEntities, nodeEntities, maxDepth, allowCheck) {
212
+ var checkedIdsSet = new Set(checkedIds);
213
+ checkedIdsSet.forEach(function (id) {
214
+ var checkedNode = nodeEntities[id];
215
+ var nestedChildren = treeUtils.findNestedChildren(checkedNode, allowCheck);
216
+ nestedChildren.forEach(function (child) {
217
+ checkedIdsSet.add(child.id);
218
+ });
219
+ }); // 缓存中间结果,优化查询
220
+
221
+ var visitedIds = new Map();
222
+
223
+ for (var depth = maxDepth - 1; depth >= 0; --depth) {
224
+ var entities = depthEntities.get(depth);
225
+ entities === null || entities === void 0 ? void 0 : entities.forEach(function (entity) {
226
+ var id = entity.id,
227
+ children = entity.children;
228
+ if (visitedIds.has(id)) return;
229
+
230
+ if (typeAssertion.isArrayNonEmpty(children)) {
231
+ var shouldChecked = !children.some(function (child) {
232
+ if (visitedIds.has(child.id)) {
233
+ return !visitedIds.get(child.id);
234
+ }
235
+
236
+ return !checkedIdsSet.has(child.id);
237
+ });
238
+ visitedIds.set(id, shouldChecked);
239
+
240
+ if (shouldChecked && allowCheck(entity)) {
241
+ checkedIdsSet.add(id);
242
+ }
243
+ }
244
+ });
245
+ }
246
+
247
+ return Array.from(checkedIdsSet);
248
+ }
140
249
 
141
250
  exports.flattenTreeData = flattenTreeData;
142
251
  exports.getActiveMenuIds = getActiveMenuIds;
143
252
  exports.getActiveMenus = getActiveMenus;
144
253
  exports.getCascaderItemEventData = getCascaderItemEventData;
145
254
  exports.getFlattedMenus = getFlattedMenus;
146
- exports.getNodeAncestors = getNodeAncestors;
147
- //# sourceMappingURL=index.js.map
255
+ exports.parseCheckDataDirty = parseCheckDataDirty;
256
+ exports.processCheckedIds = processCheckedIds;
@@ -2,32 +2,29 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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
10
  import { __rest } from 'tslib';
11
- import React, { forwardRef, useMemo, useCallback, useState } from 'react';
11
+ import React, { forwardRef, useMemo, useCallback } from 'react';
12
12
  import { getPrefixCls, cx } from '@hi-ui/classname';
13
13
  import { __DEV__ } from '@hi-ui/env';
14
- import { useToggle } from '@hi-ui/use-toggle';
14
+ import { useUncontrolledToggle } from '@hi-ui/use-toggle';
15
15
  import { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';
16
16
  import { UpOutlined, DownOutlined } from '@hi-ui/icons';
17
- import { matchStrategy } from './hooks/use-search.js';
18
- import '@hi-ui/use-check';
19
- import { useCache } from './hooks/use-cache.js';
20
- import '@babel/runtime/regenerator';
21
- import { useLatestRef, useLatestCallback } from '@hi-ui/use-latest';
22
- import { getTopDownAncestors, getNodeAncestorsWithMe } from '@hi-ui/tree-utils';
17
+ import { useCache } from './hooks/use-cache/lib/esm/index.js';
23
18
  import { Picker } from '@hi-ui/picker';
24
19
  import { TagInputMock } from '@hi-ui/tag-input';
25
- import { uniqBy } from '@hi-ui/array-utils';
26
- import { CheckCascaderMenus } from './CheckCascaderMenus.js';
27
- import { useTreeCustomSearch, useTreeUpMatchSearch, useSearchMode } from '@hi-ui/use-search-mode';
20
+ import { CheckCascaderMenuList } from './CheckCascaderMenuList.js';
21
+ import { useTreeCustomSearch, useTreeUpMatchSearch, useSearchMode, matchStrategy } from '@hi-ui/use-search-mode';
28
22
  import { flattenTreeData } from './utils/index.js';
23
+ import { getTopDownAncestors, getNodeAncestorsWithMe } from '@hi-ui/tree-utils';
24
+ import { useLatestCallback } from '@hi-ui/use-latest';
29
25
  import { isUndef, isArrayNonEmpty } from '@hi-ui/type-assertion';
30
- import { useLocaleContext } from '@hi-ui/locale-context';
26
+ import { useLocaleContext } from '@hi-ui/core';
27
+ import { callAllFuncs } from '@hi-ui/func-utils';
31
28
 
32
29
  var _prefix = getPrefixCls('check-cascader');
33
30
 
@@ -50,7 +47,8 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
50
47
  clearable = _a.clearable,
51
48
  onSelect = _a.onSelect,
52
49
  expandTrigger = _a.expandTrigger,
53
- disabled = _a.disabled,
50
+ _a$disabled = _a.disabled,
51
+ disabled = _a$disabled === void 0 ? false : _a$disabled,
54
52
  changeOnSelect = _a.changeOnSelect,
55
53
  titleRender = _a.render,
56
54
  displayRender = _a.displayRender,
@@ -60,18 +58,28 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
60
58
  invalid = _a.invalid,
61
59
  filterOption = _a.filterOption,
62
60
  searchableProp = _a.searchable,
61
+ onSearchProp = _a.onSearch,
63
62
  overlayClassName = _a.overlayClassName,
64
63
  _a$type = _a.type,
65
64
  type = _a$type === void 0 ? 'tree' : _a$type,
66
- rest = __rest(_a, ["prefixCls", "className", "defaultValue", "value", "onChange", "data", "placeholder", "clearable", "onSelect", "expandTrigger", "disabled", "emptyContent", "changeOnSelect", "render", "displayRender", "checkCascaded", "searchPlaceholder", "onLoadChildren", "wrap", "appearance", "invalid", "filterOption", "searchable", "overlayClassName", "type"]);
65
+ checkedMode = _a.checkedMode,
66
+ visible = _a.visible,
67
+ onOpen = _a.onOpen,
68
+ onClose = _a.onClose,
69
+ rest = __rest(_a, ["prefixCls", "className", "defaultValue", "value", "onChange", "data", "placeholder", "clearable", "onSelect", "expandTrigger", "disabled", "emptyContent", "changeOnSelect", "render", "displayRender", "checkCascaded", "searchPlaceholder", "onLoadChildren", "appearance", "invalid", "filterOption", "searchable", "onSearch", "overlayClassName", "type", "checkedMode", "visible", "onOpen", "onClose"]);
67
70
 
68
71
  var i18n = useLocaleContext();
69
72
  var placeholder = isUndef(placeholderProp) ? i18n.get('checkCascader.placeholder') : placeholderProp;
70
73
  var flatted = type === 'flatted';
71
74
 
72
- var _useToggle = useToggle(),
73
- menuVisible = _useToggle[0],
74
- menuVisibleAction = _useToggle[1];
75
+ var _useUncontrolledToggl = useUncontrolledToggle({
76
+ visible: visible,
77
+ disabled: disabled,
78
+ onOpen: onOpen,
79
+ onClose: onClose
80
+ }),
81
+ menuVisible = _useUncontrolledToggl[0],
82
+ menuVisibleAction = _useUncontrolledToggl[1];
75
83
 
76
84
  var _useCache = useCache(data),
77
85
  cascaderData = _useCache[0],
@@ -83,33 +91,37 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
83
91
 
84
92
  var _useUncontrolledState = useUncontrolledState(defaultValue, valueProp, onChange),
85
93
  _value = _useUncontrolledState[0],
86
- tryChangeValue = _useUncontrolledState[1];
94
+ tryChangeValue = _useUncontrolledState[1]; // 内部实现使用尾部 id
95
+
87
96
 
88
97
  var value = _value.map(function (path) {
89
98
  return path[path.length - 1];
90
99
  });
91
100
 
92
- var flattedDataLatestRef = useLatestRef(flattedData);
93
101
  var proxyOnChange = useLatestCallback(function (value, item, shouldChecked) {
94
- var flattedItems = flattedDataLatestRef.current;
95
- var itemsPaths = flattedItems.filter(function (item) {
96
- return value.includes(item.id);
97
- }).map(function (item) {
98
- return getTopDownAncestors(item).map(function (_ref) {
99
- var id = _ref.id;
100
- return id;
102
+ var flattedItems = flattedData;
103
+ var itemsPaths = value.map(function (lastId) {
104
+ var item = flattedItems.find(function (item) {
105
+ return item.id === lastId;
101
106
  });
102
- }); // TODO: 找到所有 id 的祖先节点路径
103
107
 
104
- tryChangeValue(itemsPaths); // 包括所有全选的数据,包括全选
108
+ if (item) {
109
+ return getTopDownAncestors(item).map(function (_ref) {
110
+ var id = _ref.id;
111
+ return id;
112
+ });
113
+ } // 对于传入的数据未匹配到,保持不变吐出去
114
+
105
115
 
106
- if (shouldChecked) {
107
- // TODO:as useCheckList
108
- setSelectedItems(function (prev) {
109
- return [].concat(prev, [item]);
116
+ var idPaths = _value.find(function (item) {
117
+ return item[item.length - 1] === lastId;
110
118
  });
111
- }
112
- }); // ************************** 异步搜索 ************************* //
119
+
120
+ return idPaths || [lastId];
121
+ });
122
+ tryChangeValue(itemsPaths);
123
+ }); // ************************** 搜索 ************************* //
124
+ // 无法做异步搜索,因为下拉菜单不能合并(因为树形数据,不知道是第几级)
113
125
 
114
126
  var customSearchStrategy = useTreeCustomSearch({
115
127
  data: flattedData,
@@ -171,22 +183,12 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
171
183
  }, resultStr), afterStr);
172
184
  }).reverse()) : true;
173
185
  return ret;
174
- }, [titleRender, searchValue, searchMode]); // 搜索时临时选中缓存数据
175
-
176
- var _useState = useState([]),
177
- selectedItems = _useState[0],
178
- setSelectedItems = _useState[1];
179
-
186
+ }, [titleRender, searchValue, searchMode]);
180
187
  var shouldUseSearch = !!searchValue;
181
188
  var selectProps = {
182
189
  data: shouldUseSearch ? stateInSearch.data : flattedData,
183
190
  titleRender: proxyTitleRender
184
- }; // 下拉菜单不能合并(因为树形数据,不知道是第几级)
185
-
186
- var mergedData = useMemo(function () {
187
- var nextData = selectedItems.concat(flattedData);
188
- return uniqBy(nextData, 'id');
189
- }, [selectedItems, flattedData]);
191
+ };
190
192
  var cls = cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
191
193
  return /*#__PURE__*/React.createElement(Picker, Object.assign({
192
194
  ref: ref,
@@ -205,7 +207,7 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
205
207
  disabled: disabled,
206
208
  onClose: menuVisibleAction.off,
207
209
  searchable: searchable,
208
- onSearch: onSearch,
210
+ onSearch: callAllFuncs(onSearchProp, onSearch),
209
211
  trigger: /*#__PURE__*/React.createElement(TagInputMock, {
210
212
  clearable: clearable,
211
213
  placeholder: placeholder,
@@ -217,10 +219,10 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
217
219
  value: value,
218
220
  // @ts-ignore
219
221
  onChange: proxyOnChange,
220
- data: mergedData,
222
+ data: flattedData,
221
223
  invalid: invalid
222
224
  })
223
- }), isArrayNonEmpty(selectProps.data) ? /*#__PURE__*/React.createElement(CheckCascaderMenus, {
225
+ }), isArrayNonEmpty(selectProps.data) ? /*#__PURE__*/React.createElement(CheckCascaderMenuList, {
224
226
  disabled: disabled,
225
227
  value: value,
226
228
  // @ts-ignore
@@ -235,7 +237,8 @@ var CheckCascader = /*#__PURE__*/forwardRef(function (_a, ref) {
235
237
  // @ts-ignore
236
238
  flattedData: selectProps.data,
237
239
  data: cascaderData,
238
- onChangeData: setCascaderData
240
+ onChangeData: setCascaderData,
241
+ checkedMode: checkedMode
239
242
  }) : null);
240
243
  });
241
244
 
@@ -244,4 +247,3 @@ if (__DEV__) {
244
247
  }
245
248
 
246
249
  export { CheckCascader };
247
- //# sourceMappingURL=CheckCascader.js.map
@@ -2,7 +2,7 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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.
@@ -12,7 +12,8 @@ import { getPrefixCls, cx } from '@hi-ui/classname';
12
12
  import { defaultLoadingIcon, defaultSuffixIcon, defaultLeafIcon } from './icons/index.js';
13
13
  import Checkbox from '@hi-ui/checkbox';
14
14
  import { useCheckCascaderContext } from './context.js';
15
- import { getNodeAncestors, getCascaderItemEventData } from './utils/index.js';
15
+ import { getCascaderItemEventData } from './utils/index.js';
16
+ import { getNodeAncestorsWithMe } from '@hi-ui/tree-utils';
16
17
  var _role = 'check-cascader-menu';
17
18
 
18
19
  var _prefix = getPrefixCls(_role);
@@ -49,7 +50,7 @@ var CheckCascaderMenu = function CheckCascaderMenu(_ref) {
49
50
 
50
51
  return flatted ? /*#__PURE__*/React.createElement("span", {
51
52
  className: cx("title__text", "title__text--cols")
52
- }, getNodeAncestors(option).reverse().map(function (item, index) {
53
+ }, getNodeAncestorsWithMe(option).reverse().map(function (item, index) {
53
54
  return /*#__PURE__*/React.createElement("span", {
54
55
  className: "title__text--col",
55
56
  key: item.id
@@ -145,4 +146,3 @@ var renderSuffix = function renderSuffix(prefixCls, node, loading, onLoadChildre
145
146
  };
146
147
 
147
148
  export { CheckCascaderMenu };
148
- //# sourceMappingURL=CheckCascaderMenu.js.map
@@ -2,7 +2,7 @@
2
2
  * @hi-ui/check-cascader
3
3
  * https://github.com/XiaoMi/hiui/tree/master/packages/ui/check-cascader#readme
4
4
  *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
5
+ * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
6
  *
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.
@@ -23,11 +23,7 @@ var _role = 'check-cascader-menus';
23
23
  var _prefix = getPrefixCls(_role);
24
24
 
25
25
  var NOOP_ARRAY = [];
26
- /**
27
- * TODO: What is CheckCascaderMenus
28
- */
29
-
30
- var CheckCascaderMenus = /*#__PURE__*/forwardRef(function (_a, ref) {
26
+ var CheckCascaderMenuList = /*#__PURE__*/forwardRef(function (_a, ref) {
31
27
  var _a$prefixCls = _a.prefixCls,
32
28
  prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
33
29
  _a$role = _a.role,
@@ -50,7 +46,13 @@ var CheckCascaderMenus = /*#__PURE__*/forwardRef(function (_a, ref) {
50
46
  onChange = _a.onChange,
51
47
  titleRender = _a.titleRender,
52
48
  flatted = _a.flatted,
53
- rest = __rest(_a, ["prefixCls", "role", "className", "children", "data", "flattedData", "onChangeData", "value", "defaultValue", "disabled", "expandTrigger", "changeOnSelect", "checkCascaded", "onLoadChildren", "onChange", "onSelect", "titleRender", "flatted"]);
49
+ _a$checkedMode = _a.checkedMode,
50
+ checkedMode = _a$checkedMode === void 0 ? 'ALL' : _a$checkedMode,
51
+ rest = __rest(_a, ["prefixCls", "role", "className", "children", "data", "flattedData", "onChangeData", "value", "defaultValue", "disabled", "expandTrigger", "changeOnSelect", "checkCascaded", "onLoadChildren", "onChange", "onSelect", "titleRender", "flatted", "checkedMode"]);
52
+
53
+ if (checkCascaded === false) {
54
+ checkedMode = 'SEPARATE';
55
+ }
54
56
 
55
57
  var _useSelect = useSelect(disabled),
56
58
  selectedId = _useSelect[0],
@@ -62,17 +64,10 @@ var CheckCascaderMenus = /*#__PURE__*/forwardRef(function (_a, ref) {
62
64
  isLoadingId = _useAsyncSwitch[0],
63
65
  onItemExpand = _useAsyncSwitch[1];
64
66
 
65
- var _useCheck = useCheck(checkCascaded, disabled, flattedData, defaultValue, valueProp, function (_ref, target, shouldChecked) {
66
- var checkedIds = _ref.checkedIds,
67
- semiCheckedIds = _ref.semiCheckedIds; // @ts-ignore
67
+ var _useCheck = useCheck(checkedMode, disabled, flattedData, defaultValue, valueProp, function (_ref, target, shouldChecked) {
68
+ var checkedIds = _ref.checkedIds; // @ts-ignore
68
69
 
69
- onChange === null || onChange === void 0 ? void 0 : onChange(checkedIds, {
70
- trigger: 'checkbox',
71
- target: target,
72
- shouldChecked: shouldChecked,
73
- semiCheckedIds: semiCheckedIds // checkedItems: fFindNodesByIds(flattedData, checkedIds),
74
-
75
- });
70
+ onChange === null || onChange === void 0 ? void 0 : onChange(checkedIds, target, shouldChecked);
76
71
  }),
77
72
  onOptionCheck = _useCheck[0],
78
73
  isCheckedId = _useCheck[1],
@@ -85,8 +80,8 @@ var CheckCascaderMenus = /*#__PURE__*/forwardRef(function (_a, ref) {
85
80
  selected: flatted ? selectedId === id : selectedIds[depth] === id,
86
81
  checked: isCheckedId(id),
87
82
  loading: isLoadingId(id),
88
- semiChecked: isSemiCheckedId(id),
89
- focused: false
83
+ semiChecked: isSemiCheckedId(id) // focused: false,
84
+
90
85
  };
91
86
  });
92
87
  var providedValue = useMemo(function () {
@@ -119,8 +114,7 @@ var CheckCascaderMenus = /*#__PURE__*/forwardRef(function (_a, ref) {
119
114
  });
120
115
 
121
116
  if (__DEV__) {
122
- CheckCascaderMenus.displayName = 'CheckCascaderMenus';
117
+ CheckCascaderMenuList.displayName = 'CheckCascaderMenuList';
123
118
  }
124
119
 
125
- export { CheckCascaderMenus };
126
- //# sourceMappingURL=CheckCascaderMenus.js.map
120
+ export { CheckCascaderMenuList };