@hi-ui/tree-select 4.0.0 → 4.0.3

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.
@@ -194,7 +194,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
194
194
  var filterSearchStrategy = useSearchMode.useFilterSearch({
195
195
  enabled: searchModeProp === 'filter',
196
196
  data: data,
197
- flattedData: flattedData
197
+ flattedData: flattedData,
198
+ fieldNames: fieldNames
198
199
  });
199
200
  var highlightSearchStrategy = useSearchMode.useHighlightSearch({
200
201
  data: data,
@@ -285,8 +286,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
285
286
  selectable: true,
286
287
  selectedId: value,
287
288
  onSelect: onSelect,
289
+ fieldNames: fieldNames,
288
290
  // onLoadChildren 缓存数据
289
- // TODO: 支持 fieldNames
290
291
  // @ts-ignore
291
292
  onLoadChildren: onLoadChildren,
292
293
  virtual: virtual,
@@ -161,7 +161,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
161
161
  var filterSearchStrategy = useFilterSearch({
162
162
  enabled: searchModeProp === 'filter',
163
163
  data: data,
164
- flattedData: flattedData
164
+ flattedData: flattedData,
165
+ fieldNames: fieldNames
165
166
  });
166
167
  var highlightSearchStrategy = useHighlightSearch({
167
168
  data: data,
@@ -252,8 +253,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
252
253
  selectable: true,
253
254
  selectedId: value,
254
255
  onSelect: onSelect,
256
+ fieldNames: fieldNames,
255
257
  // onLoadChildren 缓存数据
256
- // TODO: 支持 fieldNames
257
258
  // @ts-ignore
258
259
  onLoadChildren: onLoadChildren,
259
260
  virtual: virtual,
@@ -76,11 +76,8 @@ export interface TreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' |
76
76
  */
77
77
  onLoadChildren?: (node: TreeNodeEventData) => void | Promise<TreeSelectDataItem[] | void>;
78
78
  /**
79
- * 从远端获取数据,初始时是否自动加载
80
- */
81
- autoload?: boolean;
82
- /**
83
- * 异步加载数据
79
+ * 异步加载数据。暂不对外暴露
80
+ * @private
84
81
  */
85
82
  dataSource?: UseDataSource<TreeSelectDataItem[]>;
86
83
  /**
@@ -1,7 +1,3 @@
1
1
  /// <reference types="react" />
2
- export declare const TreeSelectProvider: import("react").Provider<Omit<{
3
- rootProps: {};
4
- }, "rootProps"> | null>;
5
- export declare const useTreeSelectContext: () => Omit<{
6
- rootProps: {};
7
- }, "rootProps">;
2
+ export declare const TreeSelectProvider: import("react").Provider<any>;
3
+ export declare const useTreeSelectContext: () => any;
@@ -1,5 +1,6 @@
1
+ import { HiBaseDataItem } from '@hi-ui/core';
1
2
  import React from 'react';
2
- export interface TreeSelectDataItem {
3
+ export interface TreeSelectDataItem extends HiBaseDataItem {
3
4
  /**
4
5
  * 节点唯一 id
5
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/tree-select",
3
- "version": "4.0.0",
3
+ "version": "4.0.3",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -43,22 +43,22 @@
43
43
  "url": "https://github.com/XiaoMi/hiui/issues"
44
44
  },
45
45
  "dependencies": {
46
- "@hi-ui/array-utils": "^4.0.0",
47
- "@hi-ui/classname": "^4.0.0",
48
- "@hi-ui/env": "^4.0.0",
49
- "@hi-ui/func-utils": "^4.0.0",
50
- "@hi-ui/highlighter": "^4.0.0",
51
- "@hi-ui/icons": "^4.0.0",
52
- "@hi-ui/input": "^4.0.0",
53
- "@hi-ui/picker": "^4.0.0",
54
- "@hi-ui/popper": "^4.0.0",
55
- "@hi-ui/tree": "^4.0.0",
56
- "@hi-ui/tree-utils": "^4.0.0",
57
- "@hi-ui/type-assertion": "^4.0.0",
58
- "@hi-ui/use-data-source": "^4.0.0",
59
- "@hi-ui/use-search-mode": "^4.0.0",
60
- "@hi-ui/use-toggle": "^4.0.0",
61
- "@hi-ui/use-uncontrolled-state": "^4.0.0"
46
+ "@hi-ui/array-utils": "^4.0.1",
47
+ "@hi-ui/classname": "^4.0.1",
48
+ "@hi-ui/env": "^4.0.1",
49
+ "@hi-ui/func-utils": "^4.0.1",
50
+ "@hi-ui/highlighter": "^4.0.3",
51
+ "@hi-ui/icons": "^4.0.2",
52
+ "@hi-ui/input": "^4.0.2",
53
+ "@hi-ui/picker": "^4.0.2",
54
+ "@hi-ui/popper": "^4.0.2",
55
+ "@hi-ui/tree": "^4.0.3",
56
+ "@hi-ui/tree-utils": "^4.0.1",
57
+ "@hi-ui/type-assertion": "^4.0.1",
58
+ "@hi-ui/use-data-source": "^4.0.1",
59
+ "@hi-ui/use-search-mode": "^4.0.3",
60
+ "@hi-ui/use-toggle": "^4.0.1",
61
+ "@hi-ui/use-uncontrolled-state": "^4.0.1"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@hi-ui/core": ">=4.0.0",
@@ -66,11 +66,11 @@
66
66
  "react-dom": ">=16.8.6"
67
67
  },
68
68
  "devDependencies": {
69
- "@hi-ui/core": "^4.0.0",
70
- "@hi-ui/core-css": "^4.0.0",
71
- "@hi-ui/hi-build": "^4.0.0",
69
+ "@hi-ui/core": "^4.0.2",
70
+ "@hi-ui/core-css": "^4.0.1",
71
+ "@hi-ui/hi-build": "^4.0.1",
72
72
  "react": "^17.0.1",
73
73
  "react-dom": "^17.0.1"
74
74
  },
75
- "gitHead": "3530e4f3c0b4394b91d66a4aa749579708ebff84"
75
+ "gitHead": "7d841458bef1853b31426203cb0a9dc2b9820908"
76
76
  }
@@ -1,8 +0,0 @@
1
- import { TreeSelectDataItem } from './types';
2
- export declare const useTreeSelect: ({ data: dataProp, ...rest }: UseTreeSelectProps) => {
3
- rootProps: {};
4
- };
5
- export interface UseTreeSelectProps {
6
- data?: TreeSelectDataItem[];
7
- }
8
- export declare type UseTreeSelectReturn = ReturnType<typeof useTreeSelect>;