@aatulwork/customform-renderer 1.13.0 → 1.14.0

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.js CHANGED
@@ -1453,6 +1453,39 @@ var FieldView = ({ field, value, services, colors }) => {
1453
1453
  if (field.type === "formReference" || field.type === "apiReference") {
1454
1454
  return /* @__PURE__ */ jsxRuntime.jsx(ReferenceFieldView, { field, value, services });
1455
1455
  }
1456
+ if (field.type === "color") {
1457
+ const colorValue = value && typeof value === "string" ? value : "#000000";
1458
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1459
+ material.Box,
1460
+ {
1461
+ sx: {
1462
+ display: "flex",
1463
+ flexDirection: "column",
1464
+ gap: 0.5,
1465
+ py: 1.5,
1466
+ px: 1,
1467
+ borderColor: "divider"
1468
+ },
1469
+ children: [
1470
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { fontWeight: 500 }, children: field.label }),
1471
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: value ? /* @__PURE__ */ jsxRuntime.jsx(
1472
+ material.Box,
1473
+ {
1474
+ sx: {
1475
+ width: 30,
1476
+ height: 30,
1477
+ backgroundColor: colorValue,
1478
+ border: "1px solid",
1479
+ borderColor: "divider",
1480
+ borderRadius: 1
1481
+ }
1482
+ }
1483
+ ) : /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body1", sx: { color: "text.disabled", fontStyle: "italic" }, children: "\u2014" }) })
1484
+ ]
1485
+ },
1486
+ field.name
1487
+ );
1488
+ }
1456
1489
  if (field.type === "ckeditor") {
1457
1490
  if (CKEditorDisplayComponent) {
1458
1491
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1670,6 +1703,8 @@ var formatFieldValue = (field, value, dateFormatter, services) => {
1670
1703
  return labels.join(", ");
1671
1704
  }
1672
1705
  return getLabelForValue(values[0]);
1706
+ case "color":
1707
+ return value ? String(value) : "\u2014";
1673
1708
  case "radio":
1674
1709
  if (field.options) {
1675
1710
  const normalizedOptions = normalizeOptions(field.options);