@rc-component/tree-select 1.1.1 → 1.1.2

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 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`,
@@ -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 interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode> extends Omit<BaseSelectPropsWithoutPrivate, 'mode'> {
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;
@@ -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
- export type SemanticName = 'item' | 'itemTitle' | 'input' | 'prefix' | 'suffix';
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
- styles?: Partial<Record<SemanticName, React.CSSProperties>>;
25
- classNames?: Partial<Record<SemanticName, string>>;
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`,
@@ -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 interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode> extends Omit<BaseSelectPropsWithoutPrivate, 'mode'> {
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;
@@ -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
- export type SemanticName = 'item' | 'itemTitle' | 'input' | 'prefix' | 'suffix';
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
- styles?: Partial<Record<SemanticName, React.CSSProperties>>;
25
- classNames?: Partial<Record<SemanticName, string>>;
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.1",
3
+ "version": "1.1.2",
4
4
  "description": "tree-select ui component for react",
5
5
  "keywords": [
6
6
  "react",