shadcn-zod-formkit 1.21.1 → 1.22.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.mjs
CHANGED
|
@@ -5564,8 +5564,8 @@ var FormFieldsGrid = ({
|
|
|
5564
5564
|
const fieldCopy = { ...field, disabled: readOnly ? true : field.disabled };
|
|
5565
5565
|
const renderUp = fieldCopy.childrenPosition !== "down" && isRenderableChild(fieldCopy.children);
|
|
5566
5566
|
const renderDown = fieldCopy.childrenPosition === "down" && isRenderableChild(fieldCopy.children);
|
|
5567
|
-
const dirClass = fieldCopy.direction === "row" ? "flex flex-row items-center gap-4" : "flex flex-col gap-2";
|
|
5568
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
5567
|
+
const dirClass = fieldCopy.direction === "row" ? "flex flex-col sm:flex-row sm:items-center sm:gap-4 w-full flex-wrap" : "flex flex-col gap-2 w-full";
|
|
5568
|
+
return /* @__PURE__ */ jsxs("div", { className: dirClass, children: [
|
|
5569
5569
|
renderUp && /* @__PURE__ */ jsx(Fragment, { children: fieldCopy.children }),
|
|
5570
5570
|
InputFactory.create(fieldCopy, form, isPending),
|
|
5571
5571
|
renderDown && /* @__PURE__ */ jsx(Fragment, { children: fieldCopy.children })
|
|
@@ -5573,8 +5573,8 @@ var FormFieldsGrid = ({
|
|
|
5573
5573
|
};
|
|
5574
5574
|
const renderColumn = (col) => {
|
|
5575
5575
|
if (col.length === 0) return null;
|
|
5576
|
-
const colDirection = isFieldProps(col[0]) && col[0].direction === "row" ? "flex flex-row gap-4" : "flex flex-col gap-2";
|
|
5577
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
5576
|
+
const colDirection = isFieldProps(col[0]) && col[0].direction === "row" ? "flex flex-col sm:flex-row sm:items-center sm:gap-4 w-full flex-wrap" : "flex flex-col gap-2 w-full";
|
|
5577
|
+
return /* @__PURE__ */ jsx("div", { className: colDirection, children: col.map((item, idx) => {
|
|
5578
5578
|
if (isFieldProps(item)) return renderField(item);
|
|
5579
5579
|
if (Array.isArray(item)) return renderColumn(item);
|
|
5580
5580
|
return null;
|
|
@@ -5582,13 +5582,13 @@ var FormFieldsGrid = ({
|
|
|
5582
5582
|
};
|
|
5583
5583
|
const renderRow = (row) => {
|
|
5584
5584
|
if (row.length === 0) return null;
|
|
5585
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full flex flex-row gap-4 py-2", children: row.map((col, idx) => {
|
|
5585
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full flex flex-col sm:flex-row sm:gap-4 py-2 flex-wrap", children: row.map((col, idx) => {
|
|
5586
5586
|
if (isFieldProps(col)) return renderColumn([col]);
|
|
5587
5587
|
if (Array.isArray(col)) return renderColumn(col);
|
|
5588
5588
|
return null;
|
|
5589
5589
|
}) });
|
|
5590
5590
|
};
|
|
5591
|
-
return /* @__PURE__ */ jsx("div", { className: `w-full flex flex-col gap
|
|
5591
|
+
return /* @__PURE__ */ jsx("div", { className: `w-full flex flex-col ${gap} ${className}`, children: fields.map((f, idx) => {
|
|
5592
5592
|
if (isFieldProps(f)) return /* @__PURE__ */ jsx("div", { children: renderField(f) }, idx);
|
|
5593
5593
|
if (Array.isArray(f)) return /* @__PURE__ */ jsx("div", { children: renderRow(f) }, idx);
|
|
5594
5594
|
return null;
|