@unlayer/react-elements 0.1.15 → 0.1.16
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/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -415,6 +415,16 @@ function mapSemanticProps(props, defaultValues, componentType) {
|
|
|
415
415
|
if (Object.keys(collected).length > 0) {
|
|
416
416
|
final.border = { ...final.border || {}, ...collected };
|
|
417
417
|
}
|
|
418
|
+
if (final.border && typeof final.border === "object") {
|
|
419
|
+
const b = { ...final.border };
|
|
420
|
+
for (const key of Object.keys(b)) {
|
|
421
|
+
if (!/Width$/.test(key)) continue;
|
|
422
|
+
const v = b[key];
|
|
423
|
+
if (typeof v === "number") b[key] = `${v}px`;
|
|
424
|
+
else if (typeof v === "string" && /^\d+(?:\.\d+)?$/.test(v.trim())) b[key] = `${v.trim()}px`;
|
|
425
|
+
}
|
|
426
|
+
final.border = b;
|
|
427
|
+
}
|
|
418
428
|
}
|
|
419
429
|
return final;
|
|
420
430
|
}
|
|
@@ -1230,10 +1240,17 @@ var Row = (props) => {
|
|
|
1230
1240
|
...semanticProps
|
|
1231
1241
|
} = props;
|
|
1232
1242
|
const mode = modeProp ?? _config?.mode ?? "web";
|
|
1233
|
-
let cells
|
|
1243
|
+
let cells;
|
|
1234
1244
|
if (layout) {
|
|
1235
1245
|
validateColumnLayout(layout, React__default.default.Children.count(children));
|
|
1236
1246
|
cells = layout.cells;
|
|
1247
|
+
} else if (propsCells) {
|
|
1248
|
+
cells = propsCells;
|
|
1249
|
+
} else {
|
|
1250
|
+
const columnCount = React__default.default.Children.toArray(children).filter(
|
|
1251
|
+
(c) => React__default.default.isValidElement(c) && /^Column$/.test(c.type?.displayName || c.type?.name || "")
|
|
1252
|
+
).length;
|
|
1253
|
+
cells = Array(Math.max(1, columnCount)).fill(1);
|
|
1237
1254
|
}
|
|
1238
1255
|
const safeBodyValues = { ...DEFAULT_BODY_VALUES, ...bodyValues };
|
|
1239
1256
|
const values = mapSemanticProps(
|