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.
@@ -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 currentLayout = prev[layoutByDevice];
21
- var firstIdx = currentLayout.findIndex(function (item) { return Number(item.i) === selectedId; });
22
- var firstElem = currentLayout.splice(firstIdx, 1)[0];
23
- var secondIdx = currentLayout.findIndex(function (item) { return Number(item.i) === newId; });
24
- var secondElem = currentLayout.splice(secondIdx, 1)[0];
25
- // if (currentLayout) {
26
- // firstElem.childrenIds = currentLayout.childrenIds;
27
- // firstElem.groupLayouts = currentLayout.groupLayouts;
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
- currentLayout.push(group);
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, _b;
37
- var currentLayout = prev[layoutByDevice];
38
- var groupIdx = currentLayout.findIndex(function (item) { return item.i === 'group'; });
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 = currentLayout.splice(groupIdx, 1)[0];
43
- var groupItems = (_b = (_a = groupItem === null || groupItem === void 0 ? void 0 : groupItem.groupLayouts) === null || _a === void 0 ? void 0 : _a.map(function (each) { return (__assign(__assign({}, each), { x: groupItem.x + each.x, y: groupItem.y + each.y })); })) !== null && _b !== void 0 ? _b : [];
44
- currentLayout.push.apply(currentLayout, groupItems);
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.17",
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.28",
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
@@ -1,7 +1,7 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v0.3.17]
2
+ ## [v0.3.19]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.2.41
4
4
  ### sub
5
5
  * DynamicLayout
6
- * fix: shiftKey(벌크선택모드) on/off 코드를 제거
7
- * echo 업데이트
6
+ * prop으로 받은 객체 수정하는 코드 수정
7
+ * 그룹화/그룹해제 중에 이상하게 작동하는 부분 수정