@edux-design/tree-select 0.2.2 → 0.2.4
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 +16 -1
- package/dist/index.js +190 -14551
- package/dist/index.mjs +194 -14568
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,22 @@ export function ChevronExample() {
|
|
|
123
123
|
Tree data to render. This component is controlled; updates are emitted through `onDataChange`.
|
|
124
124
|
|
|
125
125
|
### `onDataChange` (function)
|
|
126
|
-
Called with
|
|
126
|
+
Called with `(nextTree, meta?)` when edits, add actions, deletes, or drag-and-drop reordering occur.
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
type TreeSelectChangeMeta = {
|
|
130
|
+
reason: "drag" | "edit" | "add-child" | "add-sibling" | "delete";
|
|
131
|
+
activeId?: string | null;
|
|
132
|
+
draggedRootIds?: string[];
|
|
133
|
+
draggedIds?: string[];
|
|
134
|
+
sourceParentId?: string | null;
|
|
135
|
+
targetParentId?: string | null;
|
|
136
|
+
targetSiblingIndex?: number | null;
|
|
137
|
+
projectedDepth?: number | null;
|
|
138
|
+
};
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
For drag-and-drop, `meta.draggedRootIds` identifies the exact root nodes that moved, which removes ambiguity when multiple reorder outcomes can produce the same final tree shape.
|
|
127
142
|
|
|
128
143
|
### `onLabelChange` (function)
|
|
129
144
|
Called with `(id, nextLabel)` when a label edit is committed. When provided, label edits do not emit `onDataChange`.
|