publ-echo-test 0.0.104 → 0.0.106

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.
@@ -310,6 +310,59 @@ var ReactGridLayout = function (_a) {
310
310
  setOldGroupChildren([]);
311
311
  props.onLayoutChange && props.onLayoutChange(newLayout);
312
312
  };
313
+ var onDragStopGroupHandler = function (i, x, y, _a) {
314
+ var _b;
315
+ var e = _a.e, node = _a.node;
316
+ if (!activeDrag || !oldDragItem) {
317
+ return;
318
+ }
319
+ ;
320
+ var l = (_b = getLayoutItem(layout, i)) !== null && _b !== void 0 ? _b : { i: i, x: x, y: y, w: 10, h: 10 };
321
+ if (!l)
322
+ return;
323
+ // NOTE: z-index 원래대로 복귀
324
+ l.z = oldDragItem.z;
325
+ var isUserAction = true;
326
+ var movedLayout = moveElement({
327
+ layout: layout,
328
+ l: l,
329
+ x: x,
330
+ y: y,
331
+ isUserAction: isUserAction,
332
+ preventCollision: preventCollision,
333
+ compactType: compactType,
334
+ cols: cols,
335
+ allowOverlap: allowOverlap,
336
+ overrideZ: oldDragItem.z
337
+ });
338
+ var updatedItems = oldGroupChildren.map(function (item) {
339
+ var layoutItem = getLayoutItem(layout, item.i);
340
+ return {
341
+ id: layoutItem.i,
342
+ x: layoutItem.x,
343
+ y: layoutItem.y,
344
+ };
345
+ });
346
+ props.onDragStopForGroup &&
347
+ props.onDragStopForGroup({
348
+ layout: movedLayout,
349
+ prev: oldDragItem,
350
+ item: l,
351
+ placeholder: undefined,
352
+ e: e,
353
+ node: node,
354
+ updatedItems: updatedItems
355
+ });
356
+ var newLayout = allowOverlap
357
+ ? movedLayout
358
+ : compact(movedLayout, compactType, cols);
359
+ setActiveDrag(undefined);
360
+ setLayout(newLayout);
361
+ setOldDragItem(undefined);
362
+ setOldLayout(undefined);
363
+ setOldGroupChildren([]);
364
+ props.onLayoutChange && props.onLayoutChange(newLayout);
365
+ };
313
366
  var onLayoutMaybeChanged = function (newLayout, oldLayout) {
314
367
  if (!oldLayout) {
315
368
  oldLayout = layout;
@@ -631,7 +684,7 @@ var ReactGridLayout = function (_a) {
631
684
  'grid-bulk-block': block.blockId === 'BULK',
632
685
  'editing': editingGroupBlock === block.blockId,
633
686
  'selected': selectedGroupBlock === block.blockId
634
- }), containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, onFitToContent: onFitToContentHandler, isDraggable: !viewOnly && !isEditingGroup && !isInBulk, isResizable: !viewOnly && !isEditingGroup && !isInBulk, isBounded: false, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: groupItem.w, h: groupItem.h, x: groupItem.x, y: groupItem.y, z: z, i: block.blockId,
687
+ }), containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopGroupHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, onFitToContent: onFitToContentHandler, isDraggable: !viewOnly && !isEditingGroup && !isInBulk, isResizable: !viewOnly && !isEditingGroup && !isInBulk, isBounded: false, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: groupItem.w, h: groupItem.h, x: groupItem.x, y: groupItem.y, z: z, i: block.blockId,
635
688
  // minH={l.minH}
636
689
  // minW={l.minW}
637
690
  // maxH={l.maxH}
@@ -29,6 +29,11 @@ export type DroppedEvent = {
29
29
  item?: LayoutItem;
30
30
  event?: DragEvent<HTMLDivElement>;
31
31
  };
32
+ export type UpdatedItem = {
33
+ id: string;
34
+ x: number;
35
+ y: number;
36
+ };
32
37
  export type ReactGridLayoutProps = {
33
38
  children: ReactElement<any> | ReactElement[];
34
39
  className?: string;
@@ -60,6 +65,7 @@ export type ReactGridLayoutProps = {
60
65
  onDrag?: EventCallback;
61
66
  onDragStart?: EventCallback;
62
67
  onDragStop?: EventCallback;
68
+ onDragStopForGroup?: EventCallbackForGroup;
63
69
  onResize?: EventCallback;
64
70
  onResizeStart?: EventCallback;
65
71
  onResizeStop?: EventCallback;
@@ -104,6 +110,15 @@ export type EventCallback = (properties: {
104
110
  e?: ResizeEventType;
105
111
  node?: HTMLElement;
106
112
  }) => void;
113
+ export type EventCallbackForGroup = (properties: {
114
+ layout: Layout;
115
+ prev?: LayoutItem;
116
+ item?: LayoutItem;
117
+ placeholder?: LayoutItem;
118
+ e?: ResizeEventType;
119
+ node?: HTMLElement;
120
+ updatedItems: UpdatedItem[];
121
+ }) => void;
107
122
  export type RowHeight = number | ((width: number) => number);
108
123
  export type Position = {
109
124
  left: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",