@oliasoft-open-source/react-ui-library 3.9.21 → 3.9.22

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/dist/index.js CHANGED
@@ -74119,7 +74119,8 @@ const TreeItem = ({
74119
74119
  hasChild,
74120
74120
  draggable: draggable2
74121
74121
  }) => {
74122
- const { active: active2, id: id2, testId, onClick } = node;
74122
+ const { id: id2, data } = node;
74123
+ const { active: active2, testId, onClick } = data;
74123
74124
  const handleToggle = (e2) => {
74124
74125
  e2.stopPropagation();
74125
74126
  onToggle(id2);
@@ -74158,7 +74159,7 @@ const TreeItem = ({
74158
74159
  })
74159
74160
  }),
74160
74161
  /* @__PURE__ */ jsxRuntime.exports.jsx(MetaContent, {
74161
- item: node
74162
+ item: data
74162
74163
  }),
74163
74164
  /* @__PURE__ */ jsxRuntime.exports.jsx("div", {
74164
74165
  className: listStyles.actions,
@@ -74186,14 +74187,30 @@ const Tree = ({
74186
74187
  }) => {
74187
74188
  const handleDrop = (newTree) => {
74188
74189
  if (onListReorder) {
74189
- onListReorder(newTree);
74190
+ const newList = newTree.map(({ id: id2, parent, droppable: droppable2, data }) => ({
74191
+ id: id2,
74192
+ parent,
74193
+ droppable: droppable2,
74194
+ ...data
74195
+ }));
74196
+ onListReorder(newList);
74190
74197
  }
74191
74198
  };
74192
74199
  const handleOpen = (id2) => {
74193
- if (onListReorder) {
74200
+ if (onChangeOpen) {
74194
74201
  onChangeOpen(id2);
74195
74202
  }
74196
74203
  };
74204
+ const tree2 = list2.items.map(({ id: id2, droppable: droppable2, parent, name: name2, ...rest }) => ({
74205
+ id: id2,
74206
+ text: name2,
74207
+ droppable: droppable2,
74208
+ parent,
74209
+ data: {
74210
+ name: name2,
74211
+ ...rest
74212
+ }
74213
+ }));
74197
74214
  return /* @__PURE__ */ jsxRuntime.exports.jsxs("div", {
74198
74215
  "data-testid": testId,
74199
74216
  children: [
@@ -74209,11 +74226,11 @@ const Tree = ({
74209
74226
  context: window,
74210
74227
  children: /* @__PURE__ */ jsxRuntime.exports.jsx(Tree$1, {
74211
74228
  ref: treeRef,
74212
- tree: list2.items,
74229
+ tree: tree2,
74213
74230
  sort: false,
74214
74231
  insertDroppableFirst: false,
74215
74232
  canDrag: () => draggable2,
74216
- canDrop: (tree2, { dragSource, dropTargetId }) => {
74233
+ canDrop: (tree22, { dragSource, dropTargetId }) => {
74217
74234
  if ((dragSource == null ? void 0 : dragSource.parent) === dropTargetId) {
74218
74235
  return true;
74219
74236
  }