@rc-component/tree-select 1.1.1 → 1.1.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.
- package/es/OptionList.js +2 -2
- package/es/TreeSelect.d.ts +10 -4
- package/es/TreeSelect.js +1 -1
- package/es/TreeSelectContext.d.ts +3 -3
- package/lib/OptionList.js +2 -2
- package/lib/TreeSelect.d.ts +10 -4
- package/lib/TreeSelect.js +1 -1
- package/lib/TreeSelectContext.d.ts +3 -3
- package/package.json +2 -2
package/es/OptionList.js
CHANGED
|
@@ -310,8 +310,8 @@ const OptionList = (_, ref) => {
|
|
|
310
310
|
nodeDisabled
|
|
311
311
|
}
|
|
312
312
|
}, /*#__PURE__*/React.createElement(Tree, _extends({
|
|
313
|
-
classNames: treeClassNames,
|
|
314
|
-
styles: styles,
|
|
313
|
+
classNames: treeClassNames?.popup,
|
|
314
|
+
styles: styles?.popup,
|
|
315
315
|
ref: treeRef,
|
|
316
316
|
focusable: false,
|
|
317
317
|
prefixCls: `${prefixCls}-tree`,
|
package/es/TreeSelect.d.ts
CHANGED
|
@@ -6,10 +6,18 @@ import TreeNode from './TreeNode';
|
|
|
6
6
|
import type { CheckedStrategy } from './utils/strategyUtil';
|
|
7
7
|
import { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from './utils/strategyUtil';
|
|
8
8
|
import type { SafeKey, DataNode, SimpleModeConfig, ChangeEventExtra, FieldNames, LegacyDataNode } from './interface';
|
|
9
|
-
export
|
|
9
|
+
export type SemanticName = 'input' | 'prefix' | 'suffix';
|
|
10
|
+
export type PopupSemantic = 'item' | 'itemTitle';
|
|
11
|
+
export interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode> extends Omit<BaseSelectPropsWithoutPrivate, 'mode' | 'classNames' | 'styles'> {
|
|
10
12
|
prefixCls?: string;
|
|
11
13
|
id?: string;
|
|
12
14
|
children?: React.ReactNode;
|
|
15
|
+
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
|
|
16
|
+
popup?: Partial<Record<PopupSemantic, React.CSSProperties>>;
|
|
17
|
+
};
|
|
18
|
+
classNames?: Partial<Record<SemanticName, string>> & {
|
|
19
|
+
popup?: Partial<Record<PopupSemantic, string>>;
|
|
20
|
+
};
|
|
13
21
|
value?: ValueType;
|
|
14
22
|
defaultValue?: ValueType;
|
|
15
23
|
onChange?: (value: ValueType, labelList: React.ReactNode[], extra: ChangeEventExtra) => void;
|
|
@@ -52,9 +60,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
|
|
|
52
60
|
switcherIcon?: IconType;
|
|
53
61
|
treeMotion?: any;
|
|
54
62
|
}
|
|
55
|
-
declare const GenericTreeSelect: (<ValueType = any, OptionType extends DataNode = DataNode>(props: TreeSelectProps<ValueType, OptionType
|
|
56
|
-
children?: React.ReactNode;
|
|
57
|
-
} & {
|
|
63
|
+
declare const GenericTreeSelect: (<ValueType = any, OptionType extends DataNode = DataNode>(props: React.PropsWithChildren<TreeSelectProps<ValueType, OptionType>> & {
|
|
58
64
|
ref?: React.Ref<BaseSelectRef>;
|
|
59
65
|
}) => React.ReactElement) & {
|
|
60
66
|
TreeNode: typeof TreeNode;
|
package/es/TreeSelect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import { BaseSelect } from '@rc-component/select';
|
|
3
|
-
import useId from "@rc-component/
|
|
3
|
+
import useId from "@rc-component/util/es/hooks/useId";
|
|
4
4
|
import { conductCheck } from "@rc-component/tree/es/utils/conductUtil";
|
|
5
5
|
import useMergedState from "@rc-component/util/es/hooks/useMergedState";
|
|
6
6
|
import * as React from 'react';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
|
|
3
3
|
import type { DataNode, FieldNames, Key } from './interface';
|
|
4
4
|
import type useDataEntities from './hooks/useDataEntities';
|
|
5
|
-
|
|
5
|
+
import { TreeSelectProps } from './TreeSelect';
|
|
6
6
|
export interface TreeSelectContextProps {
|
|
7
7
|
virtual?: boolean;
|
|
8
8
|
popupMatchSelectWidth?: boolean | number;
|
|
@@ -21,8 +21,8 @@ export interface TreeSelectContextProps {
|
|
|
21
21
|
/** When `true`, only take leaf node as count, or take all as count with `maxCount` limitation */
|
|
22
22
|
leafCountOnly: boolean;
|
|
23
23
|
valueEntities: ReturnType<typeof useDataEntities>['valueEntities'];
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
classNames: TreeSelectProps['classNames'];
|
|
25
|
+
styles: TreeSelectProps['styles'];
|
|
26
26
|
}
|
|
27
27
|
declare const TreeSelectContext: React.Context<TreeSelectContextProps>;
|
|
28
28
|
export default TreeSelectContext;
|
package/lib/OptionList.js
CHANGED
|
@@ -318,8 +318,8 @@ const OptionList = (_, ref) => {
|
|
|
318
318
|
nodeDisabled
|
|
319
319
|
}
|
|
320
320
|
}, /*#__PURE__*/React.createElement(_tree.default, _extends({
|
|
321
|
-
classNames: treeClassNames,
|
|
322
|
-
styles: styles,
|
|
321
|
+
classNames: treeClassNames?.popup,
|
|
322
|
+
styles: styles?.popup,
|
|
323
323
|
ref: treeRef,
|
|
324
324
|
focusable: false,
|
|
325
325
|
prefixCls: `${prefixCls}-tree`,
|
package/lib/TreeSelect.d.ts
CHANGED
|
@@ -6,10 +6,18 @@ import TreeNode from './TreeNode';
|
|
|
6
6
|
import type { CheckedStrategy } from './utils/strategyUtil';
|
|
7
7
|
import { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from './utils/strategyUtil';
|
|
8
8
|
import type { SafeKey, DataNode, SimpleModeConfig, ChangeEventExtra, FieldNames, LegacyDataNode } from './interface';
|
|
9
|
-
export
|
|
9
|
+
export type SemanticName = 'input' | 'prefix' | 'suffix';
|
|
10
|
+
export type PopupSemantic = 'item' | 'itemTitle';
|
|
11
|
+
export interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode> extends Omit<BaseSelectPropsWithoutPrivate, 'mode' | 'classNames' | 'styles'> {
|
|
10
12
|
prefixCls?: string;
|
|
11
13
|
id?: string;
|
|
12
14
|
children?: React.ReactNode;
|
|
15
|
+
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
|
|
16
|
+
popup?: Partial<Record<PopupSemantic, React.CSSProperties>>;
|
|
17
|
+
};
|
|
18
|
+
classNames?: Partial<Record<SemanticName, string>> & {
|
|
19
|
+
popup?: Partial<Record<PopupSemantic, string>>;
|
|
20
|
+
};
|
|
13
21
|
value?: ValueType;
|
|
14
22
|
defaultValue?: ValueType;
|
|
15
23
|
onChange?: (value: ValueType, labelList: React.ReactNode[], extra: ChangeEventExtra) => void;
|
|
@@ -52,9 +60,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
|
|
|
52
60
|
switcherIcon?: IconType;
|
|
53
61
|
treeMotion?: any;
|
|
54
62
|
}
|
|
55
|
-
declare const GenericTreeSelect: (<ValueType = any, OptionType extends DataNode = DataNode>(props: TreeSelectProps<ValueType, OptionType
|
|
56
|
-
children?: React.ReactNode;
|
|
57
|
-
} & {
|
|
63
|
+
declare const GenericTreeSelect: (<ValueType = any, OptionType extends DataNode = DataNode>(props: React.PropsWithChildren<TreeSelectProps<ValueType, OptionType>> & {
|
|
58
64
|
ref?: React.Ref<BaseSelectRef>;
|
|
59
65
|
}) => React.ReactElement) & {
|
|
60
66
|
TreeNode: typeof TreeNode;
|
package/lib/TreeSelect.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _select = require("@rc-component/select");
|
|
8
|
-
var _useId = _interopRequireDefault(require("@rc-component/
|
|
8
|
+
var _useId = _interopRequireDefault(require("@rc-component/util/lib/hooks/useId"));
|
|
9
9
|
var _conductUtil = require("@rc-component/tree/lib/utils/conductUtil");
|
|
10
10
|
var _useMergedState = _interopRequireDefault(require("@rc-component/util/lib/hooks/useMergedState"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import type { ExpandAction } from '@rc-component/tree/lib/Tree';
|
|
3
3
|
import type { DataNode, FieldNames, Key } from './interface';
|
|
4
4
|
import type useDataEntities from './hooks/useDataEntities';
|
|
5
|
-
|
|
5
|
+
import { TreeSelectProps } from './TreeSelect';
|
|
6
6
|
export interface TreeSelectContextProps {
|
|
7
7
|
virtual?: boolean;
|
|
8
8
|
popupMatchSelectWidth?: boolean | number;
|
|
@@ -21,8 +21,8 @@ export interface TreeSelectContextProps {
|
|
|
21
21
|
/** When `true`, only take leaf node as count, or take all as count with `maxCount` limitation */
|
|
22
22
|
leafCountOnly: boolean;
|
|
23
23
|
valueEntities: ReturnType<typeof useDataEntities>['valueEntities'];
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
classNames: TreeSelectProps['classNames'];
|
|
25
|
+
styles: TreeSelectProps['styles'];
|
|
26
26
|
}
|
|
27
27
|
declare const TreeSelectContext: React.Context<TreeSelectContextProps>;
|
|
28
28
|
export default TreeSelectContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rc-component/tree-select",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "tree-select ui component for react",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"classnames": "2.x",
|
|
48
|
-
"@rc-component/select": "~1.0.
|
|
48
|
+
"@rc-component/select": "~1.0.7",
|
|
49
49
|
"@rc-component/tree": "~1.0.1",
|
|
50
50
|
"@rc-component/util": "^1.2.1"
|
|
51
51
|
},
|