pds-dev-kit-web-test 2.5.28 → 2.5.29
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.
@@ -79,6 +79,13 @@ type ActionHandlerPayload = {
|
|
79
79
|
'@CUSTOMSECTION/ESCAPE_ONE_FROM_GROUP': {
|
80
80
|
id: string;
|
81
81
|
};
|
82
|
+
'@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE': {
|
83
|
+
layout: Layout;
|
84
|
+
layoutItem: LayoutItem;
|
85
|
+
};
|
86
|
+
'@CUSTOMSECTION/ON_DROP_DRAG_OVER': {
|
87
|
+
e: any;
|
88
|
+
};
|
82
89
|
};
|
83
90
|
type ActionMap<M extends {
|
84
91
|
[index: string]: any;
|
@@ -445,18 +445,36 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
445
445
|
}
|
446
446
|
return false;
|
447
447
|
})();
|
448
|
+
var _j = (0, react_1.useState)(), droppingItem = _j[0], setDroppingItem = _j[1];
|
448
449
|
var onDrop = function (layout, layoutItem, _event) {
|
449
|
-
|
450
|
+
// const data = _event.dataTransfer.getData('text/plain');
|
451
|
+
// setDroppingItem(data);
|
452
|
+
// alert(`Dropped element props:\n${JSON.stringify(layoutItem, ['x', 'y', 'w', 'h'], 2)}`);
|
453
|
+
if (!isEditMode) {
|
454
|
+
return;
|
455
|
+
}
|
456
|
+
sectionActionHandler &&
|
457
|
+
sectionActionHandler({
|
458
|
+
type: '@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE',
|
459
|
+
payload: {
|
460
|
+
layout: layout,
|
461
|
+
layoutItem: layoutItem
|
462
|
+
}
|
463
|
+
});
|
450
464
|
};
|
451
465
|
var onDropDragOver = function (e) {
|
452
|
-
|
466
|
+
if (!sectionActionHandler) {
|
467
|
+
return null;
|
468
|
+
}
|
469
|
+
// return sectionActionHandler({
|
470
|
+
// type: '@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE',
|
471
|
+
// payload: {
|
472
|
+
// e
|
473
|
+
// }
|
474
|
+
// });
|
475
|
+
return null;
|
453
476
|
};
|
454
|
-
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsxs)(exports.S_gleStyles, { children: [showSectionHiddenCover && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(
|
455
|
-
// this is a hack for firefox
|
456
|
-
// Firefox requires some kind of initialization
|
457
|
-
// which we can do by adding this attribute
|
458
|
-
// @see https://bugzilla.mozilla.org/show_bug.cgi?id=568313
|
459
|
-
onDragStart: function (e) { return e.dataTransfer.setData('text/plain', ''); } }, { children: "Droppable Element (Drag me!)" })), (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
|
477
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsxs)(exports.S_gleStyles, { children: [showSectionHiddenCover && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
|
460
478
|
minHeight: customSectionStyles.minHeight,
|
461
479
|
paddingTop: padding.top,
|
462
480
|
paddingBottom: padding.bottom,
|
@@ -468,6 +486,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
468
486
|
minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
469
487
|
fontSize: "".concat(baseFontSize, "px")
|
470
488
|
}, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onDrop: onDrop, onResizeStop: onResizeStop, onDropDragOver: onDropDragOver,
|
489
|
+
// droppingItem={droppingItem}
|
471
490
|
// onFitToContent={onAutoFitContent}
|
472
491
|
onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
|
473
492
|
var _a;
|