pds-dev-kit-web-test 0.3.48 → 0.3.49
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/sectionActionTypes.d.ts +0 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +7 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js +8 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/utils.d.ts +1 -0
- package/package.json +1 -1
- package/release-note.md +2 -2
|
@@ -106,6 +106,7 @@ var CommentList = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
106
106
|
var _a;
|
|
107
107
|
var filteredLayout = (0, useGroupDrag_2.filterItemsById)(parsedLayouts[layoutByDevice], cbIds);
|
|
108
108
|
var newGroupLayout = (0, utils_1.getGroupForMultiple)(parsedLayouts[layoutByDevice].filter(function (each) { return cbIds.includes(each.i); }));
|
|
109
|
+
newGroupLayout.keepInLastIndex = true;
|
|
109
110
|
filteredLayout.push(newGroupLayout);
|
|
110
111
|
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = filteredLayout, _a));
|
|
111
112
|
});
|
|
@@ -415,14 +416,17 @@ var CommentList = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
415
416
|
});
|
|
416
417
|
function keepSimilarOrderToPreventRerender(arr) {
|
|
417
418
|
var _a;
|
|
418
|
-
var arrCopy = __spreadArray([], arr, true);
|
|
419
|
+
var arrCopy = __spreadArray([], arr, true).sort(function (a, b) { return Number(a.i) - Number(b.i); });
|
|
419
420
|
var groupIdx = arrCopy.findIndex(function (each) { return each.i === 'group'; });
|
|
420
421
|
if (groupIdx >= 0) {
|
|
421
422
|
var group = arrCopy.splice(groupIdx, 1)[0];
|
|
422
423
|
(_a = group.groupLayouts) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) { return Number(a.i) - Number(b.i); });
|
|
423
|
-
|
|
424
|
+
if (group.keepInLastIndex) {
|
|
425
|
+
return __spreadArray(__spreadArray([null], arrCopy, true), [group], false);
|
|
426
|
+
}
|
|
427
|
+
return __spreadArray([group], arrCopy, true);
|
|
424
428
|
}
|
|
425
|
-
return __spreadArray([], arrCopy
|
|
429
|
+
return __spreadArray([null], arrCopy, true);
|
|
426
430
|
}
|
|
427
431
|
function isLayoutPlacementSame(current, prev) {
|
|
428
432
|
if (!prev) {
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGroupDrag/useGroupDrag.js
CHANGED
|
@@ -45,6 +45,14 @@ function useGroupDrag(_a) {
|
|
|
45
45
|
// NOTE: 그룹이 없는 경우
|
|
46
46
|
if (groupIdx < 0) {
|
|
47
47
|
var group_1 = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
|
|
48
|
+
sectionActionHandler &&
|
|
49
|
+
sectionActionHandler({
|
|
50
|
+
type: '@CUSTOMSECTION/GROUP_CREATED',
|
|
51
|
+
payload: {
|
|
52
|
+
message: 'group generated',
|
|
53
|
+
data: group_1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
48
56
|
return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = [group_1], _a));
|
|
49
57
|
}
|
|
50
58
|
// NOTE: 그룹이 이미 있는경우
|
|
@@ -2,6 +2,7 @@ import type { ComponentBlock } from '../../types';
|
|
|
2
2
|
import type { LayoutItem } from 'publ-echo/dist/lib';
|
|
3
3
|
export interface LayoutItemWithGroupType extends LayoutItem {
|
|
4
4
|
childrenIds: string[];
|
|
5
|
+
keepInLastIndex?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare function getGroupData(elem1: LayoutItemWithGroupType, elem2: LayoutItemWithGroupType): LayoutItemWithGroupType;
|
|
7
8
|
export declare function recalculatedGroup(group: LayoutItemWithGroupType): LayoutItemWithGroupType;
|
package/package.json
CHANGED
package/release-note.md
CHANGED