@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.
package/dist/assets.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
{
|
|
4
4
|
"package": "@steedos-widgets/sortable",
|
|
5
5
|
"urls": [
|
|
6
|
-
"https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.17/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.17/dist/sortable.umd.css"
|
|
8
8
|
],
|
|
9
9
|
"library": "BuilderSortable"
|
|
10
10
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"npm": {
|
|
16
16
|
"package": "@steedos-widgets/sortable"
|
|
17
17
|
},
|
|
18
|
-
"url": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.17/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.17/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.17/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -65318,7 +65318,7 @@ function MultipleContainers(props) {
|
|
|
65318
65318
|
"type": "tpl",
|
|
65319
65319
|
"tpl": "${label}",
|
|
65320
65320
|
}] : _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;
|
|
65321
|
-
|
|
65321
|
+
value && delete (value.$$id);
|
|
65322
65322
|
var _w = __read(react.exports.useState(function () {
|
|
65323
65323
|
var _a;
|
|
65324
65324
|
return (_a = value) !== null && _a !== void 0 ? _a : {
|
|
@@ -65328,14 +65328,14 @@ function MultipleContainers(props) {
|
|
|
65328
65328
|
};
|
|
65329
65329
|
}), 2), items = _w[0], setItems = _w[1];
|
|
65330
65330
|
var _x = __read(react.exports.useState(Object.keys(items)), 2), containers = _x[0], setContainers = _x[1];
|
|
65331
|
-
var handleChange = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
65331
|
+
var handleChange = function (newItems) { return __awaiter(_this, void 0, void 0, function () {
|
|
65332
65332
|
var value, rendererEvent;
|
|
65333
65333
|
return __generator(this, function (_a) {
|
|
65334
65334
|
switch (_a.label) {
|
|
65335
65335
|
case 0:
|
|
65336
65336
|
if (!amisDispatchEvent || !amisOnChange)
|
|
65337
65337
|
return [2 /*return*/];
|
|
65338
|
-
value = items;
|
|
65338
|
+
value = newItems || items;
|
|
65339
65339
|
return [4 /*yield*/, amisDispatchEvent('change', createObject(amisData, {
|
|
65340
65340
|
value: value
|
|
65341
65341
|
}))];
|
|
@@ -65522,19 +65522,21 @@ function MultipleContainers(props) {
|
|
|
65522
65522
|
return;
|
|
65523
65523
|
}
|
|
65524
65524
|
var overContainer = findContainer(overId);
|
|
65525
|
+
var newItems = items;
|
|
65525
65526
|
if (overContainer) {
|
|
65526
65527
|
var activeIndex_1 = items[activeContainer].indexOf(active.id);
|
|
65527
65528
|
var overIndex_1 = items[overContainer].indexOf(overId);
|
|
65528
65529
|
if (activeIndex_1 !== overIndex_1) {
|
|
65529
65530
|
setItems(function (items) {
|
|
65530
65531
|
var _a;
|
|
65531
|
-
|
|
65532
|
+
newItems = __assign$1(__assign$1({}, items), (_a = {}, _a[overContainer] = arrayMove(items[overContainer], activeIndex_1, overIndex_1), _a));
|
|
65533
|
+
return newItems;
|
|
65532
65534
|
});
|
|
65533
65535
|
}
|
|
65534
65536
|
}
|
|
65535
65537
|
setActiveId(null);
|
|
65536
65538
|
// console.log('拖动结束2,更新form value')
|
|
65537
|
-
handleChange();
|
|
65539
|
+
handleChange(newItems);
|
|
65538
65540
|
}, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers },
|
|
65539
65541
|
React.createElement("div", { style: {
|
|
65540
65542
|
display: 'inline-grid',
|