shadcn-zod-formkit 1.14.0 → 1.15.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.cjs +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +18 -7
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-1.15.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/shadcn-zod-formkit-1.14.0.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -5461,6 +5461,8 @@ var DynamicForm = ({
|
|
|
5461
5461
|
record = {},
|
|
5462
5462
|
onSubmit,
|
|
5463
5463
|
extraValidations,
|
|
5464
|
+
children,
|
|
5465
|
+
childrenHeader,
|
|
5464
5466
|
withErrorsAlert = true,
|
|
5465
5467
|
errorAlertPosition = "up",
|
|
5466
5468
|
withCard = false,
|
|
@@ -5490,12 +5492,18 @@ var DynamicForm = ({
|
|
|
5490
5492
|
}
|
|
5491
5493
|
};
|
|
5492
5494
|
const formContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5493
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex items-center gap-2 p-2 border-b", children: [
|
|
5494
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5495
|
-
|
|
5496
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5497
|
-
|
|
5498
|
-
|
|
5495
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex flex-row items-center gap-2 p-2 border-b", children: [
|
|
5496
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2 w-full", children: [
|
|
5497
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "h-5 w-5" }),
|
|
5498
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
5499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "text-xl", children: [
|
|
5500
|
+
formTitle,
|
|
5501
|
+
" "
|
|
5502
|
+
] }),
|
|
5503
|
+
formSubTitle && /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: formSubTitle })
|
|
5504
|
+
] })
|
|
5505
|
+
] }),
|
|
5506
|
+
childrenHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-2 w-full h-full", children: childrenHeader })
|
|
5499
5507
|
] }),
|
|
5500
5508
|
withErrorsAlert && errorAlertPosition === "up" && /* @__PURE__ */ jsxRuntime.jsx(FormErrorsAlert, { formState: form.formState, fields }),
|
|
5501
5509
|
/* @__PURE__ */ jsxRuntime.jsx(Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5504,7 +5512,10 @@ var DynamicForm = ({
|
|
|
5504
5512
|
onSubmit: form.handleSubmit(handleSubmit),
|
|
5505
5513
|
className: `flex flex-col gap-2 ${readOnly ? "opacity-70 pointer-events-none select-none" : ""}`,
|
|
5506
5514
|
children: [
|
|
5507
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5515
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full grid grid-cols-1", children: [
|
|
5516
|
+
/* @__PURE__ */ jsxRuntime.jsx(FormFieldsGrid, { fields, form, readOnly }),
|
|
5517
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-2 w-full h-full", children })
|
|
5518
|
+
] }),
|
|
5508
5519
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 justify-end items-end", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "lg", className: submitBtnClass, disabled: isPending, children: isPending ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5509
5520
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
5510
5521
|
"Guardando..."
|