shadcn-zod-formkit 1.22.3 → 1.22.4
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 +42 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +42 -36
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-1.22.4.tgz +0 -0
- package/package.json +1 -1
- package/dist/shadcn-zod-formkit-1.22.3.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -5589,49 +5589,55 @@ var getFieldLabel = (fieldErrorKey, fields) => {
|
|
|
5589
5589
|
return foundField?.label ?? fieldErrorKey;
|
|
5590
5590
|
};
|
|
5591
5591
|
var isRenderableChild = (c) => c !== void 0 && c !== null && typeof c !== "function";
|
|
5592
|
-
var isFieldProps = (f) => !Array.isArray(f);
|
|
5593
5592
|
var FormFieldsGrid = ({
|
|
5594
5593
|
fields,
|
|
5595
5594
|
form,
|
|
5596
5595
|
isPending,
|
|
5597
5596
|
readOnly,
|
|
5598
5597
|
className = "",
|
|
5599
|
-
gap = "gap-
|
|
5598
|
+
gap = "gap-2"
|
|
5600
5599
|
}) => {
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5600
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full grid grid-cols-1 ${gap} ${className}`, children: fields.map(
|
|
5601
|
+
(inputOrGroup, idx) => Array.isArray(inputOrGroup) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5602
|
+
"div",
|
|
5603
|
+
{
|
|
5604
|
+
className: "w-full flex flex-row items-start gap-4 py-3",
|
|
5605
|
+
children: inputOrGroup.map((field, subIdx) => {
|
|
5606
|
+
const fieldCopy = {
|
|
5607
|
+
...field,
|
|
5608
|
+
disabled: readOnly ? true : field.disabled
|
|
5609
|
+
};
|
|
5610
|
+
const renderInlineChild = fieldCopy.childrenPosition !== "down" && isRenderableChild(fieldCopy.children);
|
|
5611
|
+
const renderInlineChildDown = fieldCopy.childrenPosition === "down" && isRenderableChild(fieldCopy.children);
|
|
5612
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full px-2", children: [
|
|
5613
|
+
renderInlineChild && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children }),
|
|
5614
|
+
InputFactory.create(fieldCopy, form, isPending),
|
|
5615
|
+
renderInlineChildDown && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children })
|
|
5616
|
+
] }, `field-${idx}-${subIdx}`);
|
|
5617
|
+
})
|
|
5618
|
+
},
|
|
5619
|
+
`field-group-${idx}`
|
|
5620
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5621
|
+
"div",
|
|
5622
|
+
{
|
|
5623
|
+
className: "flex flex-col justify-between py-3 w-full px-2",
|
|
5624
|
+
children: (() => {
|
|
5625
|
+
const fieldCopy = {
|
|
5626
|
+
...inputOrGroup,
|
|
5627
|
+
disabled: readOnly ? true : inputOrGroup.disabled
|
|
5628
|
+
};
|
|
5629
|
+
const renderUp = fieldCopy.childrenPosition !== "down" && isRenderableChild(fieldCopy.children);
|
|
5630
|
+
const renderDown = fieldCopy.childrenPosition === "down" && isRenderableChild(fieldCopy.children);
|
|
5631
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5632
|
+
renderUp && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children }),
|
|
5633
|
+
InputFactory.create(fieldCopy, form, isPending),
|
|
5634
|
+
renderDown && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children })
|
|
5635
|
+
] });
|
|
5636
|
+
})()
|
|
5637
|
+
},
|
|
5638
|
+
`field-single-${idx}`
|
|
5639
|
+
)
|
|
5640
|
+
) });
|
|
5635
5641
|
};
|
|
5636
5642
|
var DynamicForm = ({
|
|
5637
5643
|
formTitle,
|