gomtm 0.0.369 → 0.0.370

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.
@@ -4,4 +4,5 @@ export default function CurdViewEditor(props: {
4
4
  }): import("react").JSX.Element;
5
5
  export declare const CurdViewContentField: (props: {
6
6
  name: string;
7
+ defaultValues: any;
7
8
  }) => import("react").JSX.Element;
@@ -39,13 +39,17 @@ function CurdViewEditor(props) {
39
39
  ] })
40
40
  }
41
41
  ),
42
- /* @__PURE__ */ jsx(CurdViewContentField, __spreadValues({}, form.register("content")))
42
+ /* @__PURE__ */ jsx(FormField, { control: form.control, name: "title", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
43
+ /* @__PURE__ */ jsx(FormLabel, { children: "title" }),
44
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "title" }, field)) }),
45
+ /* @__PURE__ */ jsx(FormMessage, {})
46
+ ] }) }),
47
+ /* @__PURE__ */ jsx(CurdViewContentField, { name: "content", defaultValues: form.getValues()["content"] })
43
48
  ] });
44
49
  }
45
50
  const CurdViewContentField = (props) => {
46
- const { name } = props;
51
+ const { name, defaultValues } = props;
47
52
  const form = useFormContext();
48
- const defaultValues = form.getValues()[name];
49
53
  console.log("defaultValues", defaultValues);
50
54
  const contentForm = useForm({
51
55
  defaultValues
@@ -57,38 +61,6 @@ const CurdViewContentField = (props) => {
57
61
  return () => subscription.unsubscribe();
58
62
  }, [contentForm, contentForm.watch, form, name]);
59
63
  return /* @__PURE__ */ jsxs(Fragment, { children: [
60
- /* @__PURE__ */ jsx(
61
- FormField,
62
- {
63
- control: contentForm.control,
64
- name: "svcName",
65
- render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
66
- /* @__PURE__ */ jsx(FormLabel, { children: "Svc" }),
67
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "svcName" }, field)) }),
68
- /* @__PURE__ */ jsx(FormMessage, {})
69
- ] })
70
- }
71
- ),
72
- /* @__PURE__ */ jsx(FormField, { control: contentForm.control, name: "title", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
73
- /* @__PURE__ */ jsx(FormLabel, { children: "title" }),
74
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "title" }, field)) }),
75
- /* @__PURE__ */ jsx(FormMessage, {})
76
- ] }) }),
77
- /* @__PURE__ */ jsx(FormField, { control: contentForm.control, name: "methodList", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
78
- /* @__PURE__ */ jsx(FormLabel, { children: "methodList" }),
79
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "methodList" }, field)) }),
80
- /* @__PURE__ */ jsx(FormMessage, {})
81
- ] }) }),
82
- /* @__PURE__ */ jsx(FormField, { control: contentForm.control, name: "methodGet", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
83
- /* @__PURE__ */ jsx(FormLabel, { children: "methodGet" }),
84
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "methodGet" }, field)) }),
85
- /* @__PURE__ */ jsx(FormMessage, {})
86
- ] }) }),
87
- /* @__PURE__ */ jsx(FormField, { control: contentForm.control, name: "methodUpdate", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
88
- /* @__PURE__ */ jsx(FormLabel, { children: "methodUpdate" }),
89
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "methodUpdate" }, field)) }),
90
- /* @__PURE__ */ jsx(FormMessage, {})
91
- ] }) }),
92
64
  /* @__PURE__ */ jsx(FormField, { control: contentForm.control, name: "someField", render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
93
65
  /* @__PURE__ */ jsx(FormLabel, { children: "someField" }),
94
66
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "someField" }, field)) }),