@snack-uikit/tree 0.8.25 → 0.8.26-preview-c13438b6.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.
package/README.md CHANGED
@@ -45,7 +45,7 @@ const [selectedNodes, setSelected] = useState<TreeNodeId[]>([]);
45
45
  | data* | `TreeNodeProps[]` | - | Данные для отрисовки |
46
46
  | onNodeClick | `OnNodeClick` | - | Обработчик клика по элементу дерева |
47
47
  | expandedNodes | `string[]` | - | Состояние для раскрытых элементов |
48
- | onExpand | `(expandedKeys: string[], nodeId: string) => void` | - | Колбэк при раскрытии/закрытии элементов |
48
+ | onExpand | `(expandedKeys: string[], node: TreeNodeProps) => void` | - | Колбэк при раскрытии/закрытии элементов |
49
49
  | onDataLoad | `(node: TreeNodeProps) => Promise<unknown>` | - | Колбэк для асинхронной загрузки данных при раскрытии дерева |
50
50
  | parentActions | `(node: TreeNodeProps) => Item[]` | - | Дополнительные действия для элемента-родителя |
51
51
  | nodeActions | `(node: TreeNodeProps) => Item[]` | - | Дополнительные действия для элемента-потомка |
@@ -52,7 +52,7 @@ export type TreeCommonProps = {
52
52
  /** Состояние для раскрытых элементов */
53
53
  expandedNodes?: TreeNodeId[];
54
54
  /** Колбэк при раскрытии/закрытии элементов */
55
- onExpand?(expandedKeys: TreeNodeId[], nodeId: TreeNodeId): void;
55
+ onExpand?(expandedKeys: TreeNodeId[], node: TreeNodeProps): void;
56
56
  /** Состояние для выбранных элементов */
57
57
  selected?: TreeNodeId[] | TreeNodeId;
58
58
  /** Колбэк для асинхронной загрузки данных при раскрытии дерева */
@@ -52,7 +52,7 @@ export type TreeCommonProps = {
52
52
  /** Состояние для раскрытых элементов */
53
53
  expandedNodes?: TreeNodeId[];
54
54
  /** Колбэк при раскрытии/закрытии элементов */
55
- onExpand?(expandedKeys: TreeNodeId[], nodeId: TreeNodeId): void;
55
+ onExpand?(expandedKeys: TreeNodeId[], node: TreeNodeProps): void;
56
56
  /** Состояние для выбранных элементов */
57
57
  selected?: TreeNodeId[] | TreeNodeId;
58
58
  /** Колбэк для асинхронной загрузки данных при раскрытии дерева */
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Tree",
7
- "version": "0.8.25",
7
+ "version": "0.8.26-preview-c13438b6.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -47,5 +47,5 @@
47
47
  "react-transition-state": "2.1.1",
48
48
  "uncontrollable": "8.0.4"
49
49
  },
50
- "gitHead": "44591f943a79171320e8db3523ec38953ff101d8"
50
+ "gitHead": "6d3406fbbdefd7afbba809830af54917ff8109ac"
51
51
  }
@@ -64,7 +64,7 @@ export function TreeContextProvider({ children, value }: TreeContextProviderProp
64
64
  const isSingleSelect = selectionMode === SELECTION_MODE.Single;
65
65
  const isSelectable = Boolean(selectionMode);
66
66
 
67
- const [expandedNodes, onExpandHandler] = useUncontrolledProp<TreeNodeId[]>(
67
+ const [expandedNodes, onExpandHandler] = useUncontrolledProp<TreeNodeId[], NonNullable<TreeBaseProps['onExpand']>>(
68
68
  value.expandedNodes,
69
69
  value.expandedNodes || [],
70
70
  onExpandProp,
package/src/types.ts CHANGED
@@ -62,7 +62,7 @@ export type TreeCommonProps = {
62
62
  /** Состояние для раскрытых элементов */
63
63
  expandedNodes?: TreeNodeId[];
64
64
  /** Колбэк при раскрытии/закрытии элементов */
65
- onExpand?(expandedKeys: TreeNodeId[], nodeId: TreeNodeId): void;
65
+ onExpand?(expandedKeys: TreeNodeId[], node: TreeNodeProps): void;
66
66
  /** Состояние для выбранных элементов */
67
67
  selected?: TreeNodeId[] | TreeNodeId;
68
68
  /** Колбэк для асинхронной загрузки данных при раскрытии дерева */