@steedos-widgets/sortable 1.3.4-beta.16 → 1.3.4-beta.17

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.
@@ -65314,7 +65314,7 @@ function MultipleContainers(props) {
65314
65314
  "type": "tpl",
65315
65315
  "tpl": "${label}",
65316
65316
  }] : _r, _s = props.boardFooter, boardFooter = _s === void 0 ? [] : _s, _t = props.wrapperClassName, wrapperClassName = _t === void 0 ? "gap-2" : _t, _u = props.boardClassName, boardClassName = _u === void 0 ? "border rounded" : _u, _v = props.cardClassName, cardClassName = _v === void 0 ? "" : _v;
65317
- // defaultValue && delete(defaultValue.$$id);
65317
+ value && delete (value.$$id);
65318
65318
  var _w = __read(react.exports.useState(function () {
65319
65319
  var _a;
65320
65320
  return (_a = value) !== null && _a !== void 0 ? _a : {
@@ -65324,14 +65324,14 @@ function MultipleContainers(props) {
65324
65324
  };
65325
65325
  }), 2), items = _w[0], setItems = _w[1];
65326
65326
  var _x = __read(react.exports.useState(Object.keys(items)), 2), containers = _x[0], setContainers = _x[1];
65327
- var handleChange = function () { return __awaiter(_this, void 0, void 0, function () {
65327
+ var handleChange = function (newItems) { return __awaiter(_this, void 0, void 0, function () {
65328
65328
  var value, rendererEvent;
65329
65329
  return __generator(this, function (_a) {
65330
65330
  switch (_a.label) {
65331
65331
  case 0:
65332
65332
  if (!amisDispatchEvent || !amisOnChange)
65333
65333
  return [2 /*return*/];
65334
- value = items;
65334
+ value = newItems || items;
65335
65335
  return [4 /*yield*/, amisDispatchEvent('change', createObject(amisData, {
65336
65336
  value: value
65337
65337
  }))];
@@ -65518,19 +65518,21 @@ function MultipleContainers(props) {
65518
65518
  return;
65519
65519
  }
65520
65520
  var overContainer = findContainer(overId);
65521
+ var newItems = items;
65521
65522
  if (overContainer) {
65522
65523
  var activeIndex_1 = items[activeContainer].indexOf(active.id);
65523
65524
  var overIndex_1 = items[overContainer].indexOf(overId);
65524
65525
  if (activeIndex_1 !== overIndex_1) {
65525
65526
  setItems(function (items) {
65526
65527
  var _a;
65527
- return (__assign$1(__assign$1({}, items), (_a = {}, _a[overContainer] = arrayMove(items[overContainer], activeIndex_1, overIndex_1), _a)));
65528
+ newItems = __assign$1(__assign$1({}, items), (_a = {}, _a[overContainer] = arrayMove(items[overContainer], activeIndex_1, overIndex_1), _a));
65529
+ return newItems;
65528
65530
  });
65529
65531
  }
65530
65532
  }
65531
65533
  setActiveId(null);
65532
65534
  // console.log('拖动结束2,更新form value')
65533
- handleChange();
65535
+ handleChange(newItems);
65534
65536
  }, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers },
65535
65537
  React.createElement("div", { style: {
65536
65538
  display: 'inline-grid',