pds-dev-kit-web-test 0.3.17 → 0.3.19
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/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js
CHANGED
|
@@ -17,32 +17,40 @@ function useGroupDrag(_a) {
|
|
|
17
17
|
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
|
18
18
|
function setGroupCB(selectedId, newId) {
|
|
19
19
|
setLayouts(function (prev) {
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
var _a;
|
|
21
|
+
// TODO: 임시용 카피
|
|
22
|
+
var currentLayoutCopy = JSON.parse(JSON.stringify(prev[layoutByDevice]));
|
|
23
|
+
var firstIdx = currentLayoutCopy.findIndex(function (item) {
|
|
24
|
+
if (selectedId === 'group') {
|
|
25
|
+
return item.i === 'group';
|
|
26
|
+
}
|
|
27
|
+
if (Number(item.i) === selectedId) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
});
|
|
32
|
+
var firstElem = currentLayoutCopy.splice(firstIdx, 1)[0];
|
|
33
|
+
var secondIdx = currentLayoutCopy.findIndex(function (item) { return Number(item.i) === newId; });
|
|
34
|
+
var secondElem = currentLayoutCopy.splice(secondIdx, 1)[0];
|
|
29
35
|
var group = (0, utils_1.getGroupData)(firstElem, secondElem);
|
|
30
|
-
|
|
31
|
-
return __assign({}, prev);
|
|
36
|
+
currentLayoutCopy.push(group);
|
|
37
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = currentLayoutCopy, _a));
|
|
32
38
|
});
|
|
33
39
|
}
|
|
34
40
|
function breakGroupCB() {
|
|
35
41
|
setLayouts(function (prev) {
|
|
36
|
-
var _a
|
|
37
|
-
var
|
|
38
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
var _b, _c;
|
|
44
|
+
// TODO: 임시용 카피
|
|
45
|
+
var currentLayoutCopy = JSON.parse(JSON.stringify(prev[layoutByDevice]));
|
|
46
|
+
var groupIdx = currentLayoutCopy.findIndex(function (item) { return item.i === 'group'; });
|
|
39
47
|
if (groupIdx < 0) {
|
|
40
48
|
return prev;
|
|
41
49
|
}
|
|
42
|
-
var groupItem =
|
|
43
|
-
var groupItems = (
|
|
44
|
-
|
|
45
|
-
return __assign({}, prev);
|
|
50
|
+
var groupItem = currentLayoutCopy.splice(groupIdx, 1)[0];
|
|
51
|
+
var groupItems = (_c = (_b = groupItem === null || groupItem === void 0 ? void 0 : groupItem.groupLayouts) === null || _b === void 0 ? void 0 : _b.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _c !== void 0 ? _c : [];
|
|
52
|
+
currentLayoutCopy.push.apply(currentLayoutCopy, groupItems);
|
|
53
|
+
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = currentLayoutCopy, _a));
|
|
46
54
|
});
|
|
47
55
|
}
|
|
48
56
|
function getGroupCB(layout) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pds-dev-kit-web-test",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"i18next-intervalplural-postprocessor": "^3.0.0",
|
|
23
23
|
"lottie-react": "^2.3.1",
|
|
24
24
|
"nuka-carousel": "^4.8.4",
|
|
25
|
-
"publ-echo": "^0.0.
|
|
25
|
+
"publ-echo": "^0.0.30",
|
|
26
26
|
"react-hook-form": "^7.28.1",
|
|
27
27
|
"react-i18next": "^11.12.0",
|
|
28
28
|
"react-router-dom": "^5.2.0",
|
package/release-note.md
CHANGED