rsuite 5.23.2 → 5.23.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.
@@ -8,8 +8,4 @@
8
8
  .rs-btn-toolbar {
9
9
  // Clear whitespace
10
10
  line-height: 0;
11
-
12
- > :not(:first-child):not(.rs-btn-block) {
13
- margin-left: 10px;
14
- }
15
11
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [5.23.3](https://github.com/rsuite/rsuite/compare/v5.23.2...v5.23.3) (2022-12-16)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **Modal:** fix close button alignment and color ([#2973](https://github.com/rsuite/rsuite/issues/2973)) ([b1eb5b4](https://github.com/rsuite/rsuite/commit/b1eb5b406a29788290a704414cc5a19b115690c7))
6
+
1
7
  ## [5.23.2](https://github.com/rsuite/rsuite/compare/v5.23.1...v5.23.2) (2022-12-09)
2
8
 
3
9
  ### Bug Fixes
@@ -3,6 +3,7 @@
3
3
 
4
4
  //
5
5
  // Modals
6
+ // Figma: https://www.figma.com/file/uEq9QBplcKUYZrcWWA3RK2/NXT-UI?node-id=0%3A1348&t=H5h3Dd3AnJVgbAbz-4
6
7
  // --------------------------------------------------
7
8
 
8
9
  // Modal background
@@ -100,17 +101,16 @@
100
101
  padding-right: @line-height-computed;
101
102
 
102
103
  .rs-modal-header-close {
103
- // button width the same to height
104
- @padding-right: 4px;
105
-
106
104
  position: absolute;
107
105
  right: @modal-content-padding;
108
106
  top: @modal-content-padding;
109
107
  font-size: @modal-close-btn-size;
110
- line-height: @modal-close-btn-line-height;
111
108
  color: @modal-close-btn-color;
112
- width: @line-height-computed;
113
- padding: 0 @padding-right;
109
+ padding: 0;
110
+
111
+ &:hover {
112
+ color: @modal-close-btn-hover-color;
113
+ }
114
114
  }
115
115
  }
116
116
 
@@ -1,3 +1,4 @@
1
- import { ItemDataType } from '../@types/common';
2
1
  export declare function transformData(data: any[]): any[];
3
- export declare const shouldDisplay: (filterBy: ((value: string, item: ItemDataType) => boolean) | undefined, value: any) => (item: any) => boolean;
2
+ export declare const shouldDisplay: <TItem extends {
3
+ label: string;
4
+ }>(filterBy: ((value: string, item: TItem) => boolean) | undefined, value: string) => (item: TItem) => boolean;
@@ -37,7 +37,7 @@ var shouldDisplay = function shouldDisplay(filterBy, value) {
37
37
  return false;
38
38
  }
39
39
 
40
- var keyword = (value || '').toLocaleLowerCase();
40
+ var keyword = value.toLocaleLowerCase();
41
41
  return ("" + item.label).toLocaleLowerCase().indexOf(keyword) >= 0;
42
42
  };
43
43
  };
@@ -1,4 +1,5 @@
1
1
  import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
2
+ import Stack from '../Stack';
2
3
  export interface ButtonToolbarProps extends WithAsProps {
3
4
  /**
4
5
  * The ARIA role describing the button toolbar. Generally the default
@@ -7,5 +8,5 @@ export interface ButtonToolbarProps extends WithAsProps {
7
8
  */
8
9
  role?: string;
9
10
  }
10
- declare const ButtonToolbar: RsRefForwardingComponent<'div', ButtonToolbarProps>;
11
+ declare const ButtonToolbar: RsRefForwardingComponent<typeof Stack, ButtonToolbarProps>;
11
12
  export default ButtonToolbar;
@@ -15,22 +15,29 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
16
  var _utils = require("../utils");
17
17
 
18
+ var _Stack = _interopRequireDefault(require("../Stack"));
19
+
18
20
  var ButtonToolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
19
21
  var className = props.className,
20
22
  _props$classPrefix = props.classPrefix,
21
23
  classPrefix = _props$classPrefix === void 0 ? 'btn-toolbar' : _props$classPrefix,
22
24
  _props$as = props.as,
23
- Component = _props$as === void 0 ? 'div' : _props$as,
25
+ Component = _props$as === void 0 ? _Stack.default : _props$as,
24
26
  _props$role = props.role,
25
27
  role = _props$role === void 0 ? 'toolbar' : _props$role,
26
28
  rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["className", "classPrefix", "as", "role"]);
29
+ var stackProps = Component === _Stack.default ? {
30
+ wrap: true,
31
+ spacing: 10,
32
+ childrenRenderMode: 'clone'
33
+ } : null;
27
34
 
28
35
  var _useClassNames = (0, _utils.useClassNames)(classPrefix),
29
36
  withClassPrefix = _useClassNames.withClassPrefix,
30
37
  merge = _useClassNames.merge;
31
38
 
32
39
  var classes = merge(className, withClassPrefix());
33
- return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
40
+ return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, stackProps, rest, {
34
41
  role: role,
35
42
  ref: ref,
36
43
  className: classes
@@ -454,7 +454,8 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
454
454
  classPrefix: 'picker-cascader-menu',
455
455
  cascadeData: columnData,
456
456
  cascadePaths: selectedPaths,
457
- activeItemValue: value,
457
+ activeItemValue: value // FIXME make onSelect generic
458
+ ,
458
459
  onSelect: handleSelect,
459
460
  renderMenu: renderMenu,
460
461
  renderMenuItem: renderMenuItem
@@ -1,18 +1,23 @@
1
1
  /// <reference types="react" />
2
- import { CascaderProps } from './Cascader';
3
- import { ItemDataType } from '../@types/common';
4
- export declare function getColumnsAndPaths<T extends ItemDataType>(data: T[], value: any, options: any): {
5
- columns: ItemDataType<string | number>[][];
2
+ export declare function getColumnsAndPaths<T extends Record<string, unknown>>(data: T[], value: any, options: any): {
3
+ columns: T[][];
6
4
  paths: T[];
7
5
  };
8
- export declare function usePaths(props: CascaderProps): {
6
+ declare type UsePathsParams<T> = {
7
+ data: T[];
8
+ valueKey: string;
9
+ childrenKey: string;
10
+ value: unknown;
11
+ };
12
+ export declare function usePaths<T extends Record<string, unknown>>(params: UsePathsParams<T>): {
9
13
  enforceUpdate: (nextValue: any, isAttachChildren?: boolean) => void;
10
- columnData: ItemDataType<string | number>[][];
11
- valueToPaths: ItemDataType<string | number>[];
12
- selectedPaths: ItemDataType<string | number>[];
13
- setValueToPaths: import("react").Dispatch<import("react").SetStateAction<ItemDataType<string | number>[]>>;
14
- setColumnData: import("react").Dispatch<import("react").SetStateAction<ItemDataType<string | number>[][]>>;
15
- setSelectedPaths: import("react").Dispatch<import("react").SetStateAction<ItemDataType<string | number>[]>>;
16
- addColumn: (column: ItemDataType[], index: number) => void;
14
+ columnData: T[][];
15
+ valueToPaths: T[];
16
+ selectedPaths: T[];
17
+ setValueToPaths: import("react").Dispatch<import("react").SetStateAction<T[]>>;
18
+ setColumnData: import("react").Dispatch<import("react").SetStateAction<T[][]>>;
19
+ setSelectedPaths: import("react").Dispatch<import("react").SetStateAction<T[]>>;
20
+ addColumn: (column: T[], index: number) => void;
17
21
  romoveColumnByIndex: (index: number) => void;
18
22
  };
23
+ export {};
@@ -86,11 +86,11 @@ function getColumnsAndPaths(data, value, options) {
86
86
  };
87
87
  }
88
88
 
89
- function usePaths(props) {
90
- var data = props.data,
91
- valueKey = props.valueKey,
92
- childrenKey = props.childrenKey,
93
- value = props.value;
89
+ function usePaths(params) {
90
+ var data = params.data,
91
+ valueKey = params.valueKey,
92
+ childrenKey = params.childrenKey,
93
+ value = params.value;
94
94
 
95
95
  var _useMemo = (0, _react.useMemo)(function () {
96
96
  return getColumnsAndPaths(data, value, {
@@ -9,25 +9,28 @@ interface ItemKeys {
9
9
  labelKey: string;
10
10
  childrenKey: string;
11
11
  }
12
+ declare type MayHasParent<T extends Record<string, unknown>> = T & {
13
+ parent?: MayHasParent<T>;
14
+ };
12
15
  /**
13
16
  * Get all parents of a node
14
17
  * @param node
15
18
  */
16
- export declare const getParents: (node: ItemType) => ItemType[];
19
+ export declare const getParents: <T extends Record<string, unknown>>(node: MayHasParent<T>) => MayHasParent<T>[];
17
20
  /**
18
21
  * Check if any child nodes are selected.
19
22
  * @param node
20
23
  * @param value
21
24
  * @param itemKeys
22
25
  */
23
- export declare const isSomeChildChecked: (node: ItemDataType, value: ValueType, itemKeys: Omit<ItemKeys, 'labelKey'>) => any;
26
+ export declare const isSomeChildChecked: <T extends Record<string, unknown>>(node: T, value: ValueType, itemKeys: Omit<ItemKeys, 'labelKey'>) => any;
24
27
  /**
25
28
  * Check if the parent is selected.
26
29
  * @param node
27
30
  * @param value
28
31
  * @param itemKeys
29
32
  */
30
- export declare const isSomeParentChecked: (node: ItemDataType, value: ValueType, itemKeys: Pick<ItemKeys, 'valueKey'>) => any;
33
+ export declare const isSomeParentChecked: <T extends Record<string, unknown>>(node: MayHasParent<T>, value: ValueType, itemKeys: Pick<ItemKeys, 'valueKey'>) => any;
31
34
  export declare const getOtherItemValuesByUnselectChild: <T>(itemNode: ItemType, value: any, itemKeys: Omit<ItemKeys, 'labelKey'>) => T[];
32
35
  /**
33
36
  * Remove the values of all children.
@@ -37,20 +40,20 @@ export declare const removeAllChildrenValue: <T>(value: T[], item: ItemType, ite
37
40
  * A hook to flatten tree structure data
38
41
  * @param data
39
42
  */
40
- export declare function useFlattenData(data: ItemDataType[], itemKeys: ItemKeys): {
41
- addFlattenData: (children: ItemDataType[], parent: ItemDataType) => void;
42
- flattenData: ItemDataType<string | number>[];
43
+ export declare function useFlattenData<T>(data: T[], itemKeys: ItemKeys): {
44
+ addFlattenData: (children: T[], parent: T) => void;
45
+ flattenData: T[];
43
46
  };
44
47
  /**
45
48
  * A hook for column data
46
49
  * @param flattenData
47
50
  */
48
- export declare function useColumnData(flattenData: ItemType[]): {
49
- columnData: ItemDataType<string | number>[][];
50
- addColumn: (column: ItemDataType[], index: number) => void;
51
+ export declare function useColumnData<T extends MayHasParent<Record<string, unknown>>>(flattenData: T[]): {
52
+ columnData: T[][];
53
+ addColumn: (column: T[], index: number) => void;
51
54
  romoveColumnByIndex: (index: number) => void;
52
- setColumnData: import("react").Dispatch<import("react").SetStateAction<ItemDataType<string | number>[][]>>;
53
- enforceUpdateColumnData: (nextData: ItemDataType[]) => void;
55
+ setColumnData: import("react").Dispatch<import("react").SetStateAction<T[][]>>;
56
+ enforceUpdateColumnData: (nextData: T[]) => void;
54
57
  };
55
58
  /**
56
59
  * A hook that converts the value into a cascading value
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { OverlayTriggerHandle } from './PickerToggleTrigger';
3
- import { TypeAttributes, ItemDataType } from '../@types/common';
3
+ import { TypeAttributes } from '../@types/common';
4
4
  import type { ListHandle } from '../Windowing';
5
5
  export interface NodeKeys {
6
6
  valueKey: string;
@@ -86,24 +86,25 @@ export interface ToggleKeyDownEventProps {
86
86
  * @param props
87
87
  */
88
88
  export declare const useToggleKeyDownEvent: (props: ToggleKeyDownEventProps) => (event: React.KeyboardEvent) => void;
89
- export interface SearchProps {
89
+ export interface SearchProps<TItem extends Record<string, unknown>, TLabel> {
90
90
  labelKey: string;
91
- data: ItemDataType[];
92
- searchBy?: (keyword: any, label: any, item: any) => boolean;
93
- callback?: (keyword: string, data: ItemDataType[], event: React.SyntheticEvent) => void;
91
+ data: TItem[];
92
+ searchBy?: (keyword: string, label: TLabel, item: TItem) => boolean;
93
+ callback?: (keyword: string, data: TItem[], event: React.SyntheticEvent) => void;
94
94
  }
95
+ declare type UseSearchResult<TItem extends Record<string, unknown>> = {
96
+ searchKeyword: string;
97
+ filteredData: TItem[];
98
+ updateFilteredData: (nextData: TItem[]) => void;
99
+ setSearchKeyword: (value: string) => void;
100
+ checkShouldDisplay: (item: TItem, keyword?: string) => boolean;
101
+ handleSearch: (searchKeyword: string, event: React.SyntheticEvent) => void;
102
+ };
95
103
  /**
96
104
  * A hook that handles search filter options
97
105
  * @param props
98
106
  */
99
- export declare function useSearch(props: SearchProps): {
100
- searchKeyword: string;
101
- filteredData: import("../CheckTreePicker/utils").TreeNodeType[];
102
- updateFilteredData: (nextData: ItemDataType[]) => void;
103
- setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
104
- checkShouldDisplay: (item: ItemDataType, keyword?: string) => boolean;
105
- handleSearch: (searchKeyword: string, event: React.SyntheticEvent) => void;
106
- };
107
+ export declare function useSearch<TItem extends Record<string, unknown>, TLabel>(props: SearchProps<TItem, TLabel>): UseSearchResult<TItem>;
107
108
  export interface PickerDependentParameters {
108
109
  triggerRef?: React.RefObject<OverlayTriggerHandle>;
109
110
  rootRef?: React.RefObject<HTMLElement>;
@@ -116,3 +117,4 @@ export interface PickerDependentParameters {
116
117
  * A hook of the exposed method of Picker
117
118
  */
118
119
  export declare function usePublicMethods(ref: any, parmas: PickerDependentParameters): void;
120
+ export {};
@@ -22,6 +22,10 @@ export interface StackProps extends WithAsProps {
22
22
  * Define whether the children in the stack are forced onto one line or can wrap onto multiple lines
23
23
  */
24
24
  wrap?: boolean;
25
+ /**
26
+ * The render mode of the children.
27
+ */
28
+ childrenRenderMode?: 'clone' | 'wrap';
25
29
  }
26
30
  export interface StackComponent extends RsRefForwardingComponent<'div', StackProps> {
27
31
  Item: typeof StackItem;
@@ -26,6 +26,8 @@ var Stack = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
26
26
  alignItems = _props$alignItems === void 0 ? 'center' : _props$alignItems,
27
27
  _props$classPrefix = props.classPrefix,
28
28
  classPrefix = _props$classPrefix === void 0 ? 'stack' : _props$classPrefix,
29
+ _props$childrenRender = props.childrenRenderMode,
30
+ childrenRenderMode = _props$childrenRender === void 0 ? 'wrap' : _props$childrenRender,
29
31
  className = props.className,
30
32
  children = props.children,
31
33
  direction = props.direction,
@@ -34,7 +36,7 @@ var Stack = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
34
36
  divider = props.divider,
35
37
  style = props.style,
36
38
  wrap = props.wrap,
37
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "alignItems", "classPrefix", "className", "children", "direction", "justifyContent", "spacing", "divider", "style", "wrap"]);
39
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "alignItems", "classPrefix", "childrenRenderMode", "className", "children", "direction", "justifyContent", "spacing", "divider", "style", "wrap"]);
38
40
 
39
41
  var _useCustom = (0, _utils.useCustom)('Stack'),
40
42
  rtl = _useCustom.rtl;
@@ -45,15 +47,15 @@ var Stack = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
45
47
  prefix = _useClassNames.prefix;
46
48
 
47
49
  var classes = merge(className, withClassPrefix());
48
- var isSupportGridGap = (0, _utils.isSupportFlexGap)();
49
- var gridGap = Array.isArray(spacing) ? spacing : [spacing, 0];
50
- var itemStyles = (_itemStyles = {}, _itemStyles[rtl ? 'marginLeft' : 'marginRight'] = gridGap[0], _itemStyles.marginBottom = gridGap[1], _itemStyles);
50
+ var isSupportGap = (0, _utils.isSupportFlexGap)();
51
+ var flexGap = Array.isArray(spacing) ? spacing : [spacing, spacing];
52
+ var itemStyles = (_itemStyles = {}, _itemStyles[rtl ? 'marginLeft' : 'marginRight'] = flexGap[0], _itemStyles.marginBottom = flexGap[1], _itemStyles);
51
53
  var styles = (0, _extends2.default)({
52
54
  alignItems: alignItems,
53
55
  justifyContent: justifyContent,
54
56
  flexDirection: direction,
55
57
  flexWrap: wrap ? 'wrap' : undefined,
56
- gap: isSupportGridGap ? spacing : undefined
58
+ gap: isSupportGap ? spacing : undefined
57
59
  }, style);
58
60
  /*
59
61
  * toArray remove undefined, null and boolean
@@ -67,13 +69,13 @@ var Stack = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
67
69
  className: classes,
68
70
  style: styles
69
71
  }), _react.default.Children.map(filterChildren, function (child, index) {
70
- var childNode = child.type !== _StackItem.default ? /*#__PURE__*/_react.default.createElement(_StackItem.default, {
72
+ var childNode = childrenRenderMode === 'wrap' && child.type !== _StackItem.default ? /*#__PURE__*/_react.default.createElement(_StackItem.default, {
71
73
  key: index,
72
74
  className: prefix('item'),
73
- style: !isSupportGridGap ? itemStyles : undefined
75
+ style: !isSupportGap ? itemStyles : undefined
74
76
  }, child) : /*#__PURE__*/_react.default.cloneElement(child, {
75
77
  className: merge(prefix('item'), child.props.className),
76
- style: !isSupportGridGap ? (0, _extends2.default)({}, itemStyles, child.props.style) : child.props.style
78
+ style: !isSupportGap ? (0, _extends2.default)({}, itemStyles, child.props.style) : child.props.style
77
79
  });
78
80
  return [childNode, index < count - 1 ? divider : null];
79
81
  }));
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { TreeNodeType, TreeNodesType } from '../CheckTreePicker/utils';
3
3
  import { TREE_NODE_DROP_POSITION } from '../utils';
4
4
  import { CheckTreePickerProps } from '../CheckTreePicker/CheckTreePicker';
5
- import { ItemDataType } from '../@types/common';
6
5
  import { TreePickerProps } from '../TreePicker/TreePicker';
7
6
  import { ListHandle } from '../Windowing';
8
7
  declare type PartialTreeProps = Partial<TreePickerProps | CheckTreePickerProps>;
@@ -11,14 +10,14 @@ declare type PartialTreeProps = Partial<TreePickerProps | CheckTreePickerProps>;
11
10
  * @param {*} expandItemValues
12
11
  * @param {*} parentKeys
13
12
  */
14
- export declare function shouldShowNodeByParentExpanded(expandItemValues?: any[], parentKeys?: any[]): boolean;
13
+ export declare function shouldShowNodeByParentExpanded<T>(expandItemValues?: T[], parentKeys?: T[]): boolean;
15
14
  /**
16
15
  * flatten tree structure to array
17
16
  * @param {*} tree
18
17
  * @param {*} childrenKey
19
18
  * @param {*} executor
20
19
  */
21
- export declare function flattenTree(tree: any[], childrenKey?: string, executor?: (node: any, index: number) => any): any[];
20
+ export declare function flattenTree<TItem>(tree: TItem[], childrenKey?: string, executor?: (node: any, index: number) => any): TItem[];
22
21
  /**
23
22
  * get all ancestor nodes of given node
24
23
  * @param {*} node
@@ -30,7 +29,7 @@ export declare function getNodeParents(node: any, parentKey?: string, valueKey?:
30
29
  * @param node
31
30
  * @param valueKey
32
31
  */
33
- export declare function getNodeParentKeys(nodes: TreeNodesType, node: TreeNodeType, valueKey: string): TreeNodeType[];
32
+ export declare function getNodeParentKeys<T>(nodes: TreeNodesType, node: TreeNodeType, valueKey: string): T[];
34
33
  export declare function hasVisibleChildren(node: TreeNodeType, childrenKey: string): any;
35
34
  /**
36
35
  * shallow equal array
@@ -38,7 +37,7 @@ export declare function hasVisibleChildren(node: TreeNodeType, childrenKey: stri
38
37
  * @param b
39
38
  */
40
39
  export declare function compareArray(a: any[], b: any[]): boolean;
41
- export declare function getDefaultExpandItemValues(data: ItemDataType[], props: Required<Pick<TreePickerProps, 'defaultExpandAll' | 'valueKey' | 'childrenKey' | 'defaultExpandItemValues'>>): any[];
40
+ export declare function getDefaultExpandItemValues<TItem>(data: TItem[], props: Required<Pick<TreePickerProps, 'defaultExpandAll' | 'valueKey' | 'childrenKey' | 'defaultExpandItemValues'>>): any[];
42
41
  /**
43
42
  * 获取 expandItemValues 的 value
44
43
  * @param props
@@ -61,7 +60,10 @@ export declare function createUpdateTreeDataFunction(params: any, { valueKey, ch
61
60
  childrenKey: any;
62
61
  }): (tree: any[]) => any[];
63
62
  export declare function findNodeOfTree(data: any, check: any): any;
64
- export declare function filterNodesOfTree(data: any, check: any): TreeNodeType[];
63
+ declare type HasChildren<T extends Record<string, unknown>> = T & {
64
+ children?: readonly HasChildren<T>[];
65
+ };
66
+ export declare function filterNodesOfTree<TItem extends HasChildren<Record<string, unknown>>>(data: readonly TItem[], check: (item: TItem) => boolean): TItem[];
65
67
  /**
66
68
  * get all focusable items
67
69
  * exclude not visible and disabled node
@@ -70,7 +72,7 @@ export declare function filterNodesOfTree(data: any, check: any): TreeNodeType[]
70
72
  * @param isSearching - component is in Searching
71
73
  * @returns
72
74
  */
73
- export declare const getFocusableItems: (filteredData: ItemDataType[], props: Required<Pick<PartialTreeProps, 'disabledItemValues' | 'valueKey' | 'childrenKey' | 'expandItemValues'>>, isSearching?: boolean) => TreeNodeType[];
75
+ export declare const getFocusableItems: <TItem extends TreeNodeType>(filteredData: TItem[], props: Required<Pick<PartialTreeProps, 'disabledItemValues' | 'valueKey' | 'childrenKey' | 'expandItemValues'>>, isSearching?: boolean) => TItem[];
74
76
  /**
75
77
  * return all focusable Item and active Element index
76
78
  * @param focusItemValue
@@ -150,7 +152,13 @@ export { getTreeActiveNode };
150
152
  * toggle tree node
151
153
  * @param param0
152
154
  */
153
- export declare function toggleExpand({ node, isExpand, expandItemValues, valueKey }: any): ItemDataType<string | number>[];
155
+ export declare function toggleExpand<T>({ node, isExpand, expandItemValues, valueKey }: ToggleExpandOptions<T>): T[];
156
+ declare type ToggleExpandOptions<T> = {
157
+ node: Record<string, unknown>;
158
+ isExpand: boolean;
159
+ expandItemValues: T[];
160
+ valueKey: string;
161
+ };
154
162
  export declare function getTreeNodeTitle(label: any): string | undefined;
155
163
  /**
156
164
  * get all children from flattenNodes object by given parent node
@@ -158,12 +166,12 @@ export declare function getTreeNodeTitle(label: any): string | undefined;
158
166
  * @param parent
159
167
  */
160
168
  export declare function getChildrenByFlattenNodes(nodes: TreeNodesType, parent: TreeNodeType): TreeNodeType[];
161
- export declare function useTreeDrag(): {
162
- dragNode: ItemDataType<string | number> | null;
169
+ export declare function useTreeDrag<T>(): {
170
+ dragNode: T | null;
163
171
  dragOverNodeKey: null;
164
172
  dragNodeKeys: (string | number)[];
165
173
  dropNodePosition: TREE_NODE_DROP_POSITION | null;
166
- setDragNode: (node: ItemDataType | null) => void;
174
+ setDragNode: (node: T | null) => void;
167
175
  setDragOverNodeKey: React.Dispatch<React.SetStateAction<null>>;
168
176
  setDragNodeKeys: React.Dispatch<React.SetStateAction<(string | number)[]>>;
169
177
  setDropNodePosition: React.Dispatch<React.SetStateAction<TREE_NODE_DROP_POSITION | null>>;
@@ -193,7 +201,7 @@ export declare function useFlattenTreeData({ data, labelKey, valueKey, childrenK
193
201
  flattenTreeData: (treeData: TreeNodeType[], parent?: TreeNodeType, layer?: any) => never[] | undefined;
194
202
  serializeListOnlyParent: (nodes: TreeNodesType, key: string) => (string | number)[];
195
203
  unSerializeList: ({ nodes, key, value, cascade, uncheckableItemValues }: UnSerializeListProps) => void;
196
- formatVirtualizedTreeData: (nodes: TreeNodesType, data: any[], expandItemValues: ItemDataType[], options: {
204
+ formatVirtualizedTreeData: (nodes: TreeNodesType, data: any[], expandItemValues: unknown[], options: {
197
205
  cascade?: boolean;
198
206
  searchKeyword?: string;
199
207
  }) => TreeNodeType[];
@@ -205,28 +213,28 @@ export declare function useTreeNodeRefs(): {
205
213
  treeNodesRefs: {};
206
214
  saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string) => void;
207
215
  };
208
- interface TreeSearchProps {
216
+ interface TreeSearchProps<T> {
209
217
  labelKey: string;
210
218
  childrenKey: string;
211
219
  searchKeyword?: string;
212
- data: ItemDataType[];
220
+ data: T[];
213
221
  searchBy?: (keyword: any, label: any, item: any) => boolean;
214
- callback?: (keyword: string, data: ItemDataType[], event: React.SyntheticEvent) => void;
222
+ callback?: (keyword: string, data: T[], event: React.SyntheticEvent) => void;
215
223
  }
216
224
  /**
217
225
  * A hook that handles tree search filter options
218
226
  * @param props
219
227
  */
220
- export declare function useTreeSearch<T extends HTMLElement = HTMLInputElement>(props: TreeSearchProps): {
228
+ export declare function useTreeSearch<T>(props: TreeSearchProps<T>): {
221
229
  searchKeywordState: string;
222
- filteredData: ItemDataType<string | number>[];
223
- setFilteredData: (data: ItemDataType[], searchKeyword: string) => void;
230
+ filteredData: T[];
231
+ setFilteredData: (data: T[], searchKeyword: string) => void;
224
232
  setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
225
- handleSearch: (searchKeyword: string, event: React.ChangeEvent<T>) => void;
233
+ handleSearch: (searchKeyword: string, event: React.ChangeEvent) => void;
226
234
  };
227
- export declare function useGetTreeNodeChildren(treeData: ItemDataType[], valueKey: string, childrenKey: string): {
228
- data: ItemDataType<string | number>[];
229
- setData: React.Dispatch<React.SetStateAction<ItemDataType<string | number>[]>>;
235
+ export declare function useGetTreeNodeChildren<T extends Record<string, unknown>>(treeData: T[], valueKey: string, childrenKey: string): {
236
+ data: T[];
237
+ setData: React.Dispatch<React.SetStateAction<T[]>>;
230
238
  loadingNodeValues: never[];
231
239
  loadChildren: (node: any, getChildren: any) => void;
232
240
  };
@@ -2785,9 +2785,6 @@ tbody.rs-anim-collapse.rs-anim-in {
2785
2785
  .rs-btn-toolbar {
2786
2786
  line-height: 0;
2787
2787
  }
2788
- .rs-btn-toolbar > :not(:first-child):not(.rs-btn-block) {
2789
- margin-right: 10px;
2790
- }
2791
2788
  .rs-picker-subtle .picker-subtle-toggle {
2792
2789
  position: relative;
2793
2790
  z-index: 5;
@@ -9428,11 +9425,13 @@ textarea.rs-picker-search-input {
9428
9425
  left: 20px;
9429
9426
  top: 20px;
9430
9427
  font-size: 12px;
9431
- line-height: 1.66666667;
9428
+ color: #8e8e93;
9429
+ color: var(--rs-text-secondary);
9430
+ padding: 0;
9431
+ }
9432
+ .rs-modal-header .rs-modal-header-close:hover {
9432
9433
  color: #575757;
9433
9434
  color: var(--rs-text-primary);
9434
- width: 20px;
9435
- padding: 0 4px;
9436
9435
  }
9437
9436
  .rs-modal-title {
9438
9437
  font-weight: normal;