pds-dev-kit-web-test 2.2.79 → 2.2.81
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.
@@ -354,15 +354,23 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
354
354
|
});
|
355
355
|
};
|
356
356
|
var onWidthChange = function (width) {
|
357
|
+
var _a, _b;
|
358
|
+
var viewport = width + ((_a = padding === null || padding === void 0 ? void 0 : padding.left) !== null && _a !== void 0 ? _a : 0) + ((_b = padding === null || padding === void 0 ? void 0 : padding.right) !== null && _b !== void 0 ? _b : 0);
|
357
359
|
if (device === 'MOBILE') {
|
358
|
-
var
|
360
|
+
var baseViewPort = 375;
|
361
|
+
var gap = baseViewPort - viewport;
|
362
|
+
var cellWidth_1 = viewport / MOBILE_GRID_COLS;
|
363
|
+
if (gap > 0) {
|
364
|
+
var magicNumber = Math.pow((gap / 15), 1.1);
|
365
|
+
var resSize = 16 - magicNumber;
|
366
|
+
console.log(viewport, resSize);
|
367
|
+
setBaseFontSize(resSize);
|
368
|
+
}
|
359
369
|
setRowHeight(cellWidth_1 * 0.56);
|
360
|
-
var mobileBaseFontSize = Math.min(cellWidth_1 * 0.59, 16);
|
361
|
-
setBaseFontSize(mobileBaseFontSize);
|
362
370
|
return;
|
363
371
|
}
|
364
372
|
var isSectionFontResponsive = !!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
|
365
|
-
var cellWidth =
|
373
|
+
var cellWidth = viewport / DESKTOP_GRID_COLS;
|
366
374
|
setRowHeight(cellWidth * 0.56);
|
367
375
|
isSectionFontResponsive ? setBaseFontSize(cellWidth / 2.35) : setBaseFontSize(16);
|
368
376
|
};
|
@@ -410,7 +418,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
410
418
|
paddingLeft: padding.left
|
411
419
|
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ innerRef: innerRef, allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: rowHeight, margin: [10, 10], style: {
|
412
420
|
width: customSectionStyles.width,
|
413
|
-
maxWidth: customSectionStyles.maxWidth,
|
421
|
+
maxWidth: isMobile ? '512px' : customSectionStyles.maxWidth,
|
414
422
|
minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
415
423
|
fontSize: "".concat(baseFontSize, "px")
|
416
424
|
}, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
|