gomtm 0.0.360 → 0.0.362

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.
@@ -1,2 +1,4 @@
1
1
  /// <reference types="react" />
2
- export default function CurdViewEditor(): import("react").JSX.Element;
2
+ export default function CurdViewEditor(props: {
3
+ name: string;
4
+ }): import("react").JSX.Element;
@@ -1,7 +1,58 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
- function CurdViewEditor() {
4
- return /* @__PURE__ */ jsx("div", { className: "bg-blue-100 p-2", children: /* @__PURE__ */ jsx("h1", { children: "TODO CurdViewEditor" }) });
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
+ import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "mtxuilib/ui/form";
23
+ import { Input } from "mtxuilib/ui/input";
24
+ import { useFormContext } from "react-hook-form";
25
+ import { FormShell } from "../../curd/form/FormShell";
26
+ function CurdViewEditor(props) {
27
+ const form = useFormContext();
28
+ return /* @__PURE__ */ jsxs(FormShell, { children: [
29
+ /* @__PURE__ */ jsx(
30
+ FormField,
31
+ {
32
+ control: form.control,
33
+ name: "name",
34
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
35
+ /* @__PURE__ */ jsx(FormLabel, { children: "name" }),
36
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadProps(__spreadValues({ placeholder: "name" }, field), { readOnly: true, disabled: true })) }),
37
+ /* @__PURE__ */ jsx(FormDescription, { children: "name" }),
38
+ /* @__PURE__ */ jsx(FormMessage, {})
39
+ ] })
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsx(
43
+ FormField,
44
+ {
45
+ control: form.control,
46
+ name: "svcName",
47
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
48
+ /* @__PURE__ */ jsx(FormLabel, { children: "Svc" }),
49
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, __spreadValues({ placeholder: "svcName" }, field)) }),
50
+ /* @__PURE__ */ jsx(FormDescription, { children: "svcName" }),
51
+ /* @__PURE__ */ jsx(FormMessage, {})
52
+ ] })
53
+ }
54
+ )
55
+ ] });
5
56
  }
6
57
  export {
7
58
  CurdViewEditor as default
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare const FormShell: (props: PropsWithChildren) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const FormShell = (props) => {
4
+ const { children } = props;
5
+ return /* @__PURE__ */ jsx("div", { children });
6
+ };
7
+ export {
8
+ FormShell
9
+ };
@@ -98,7 +98,7 @@ function CommonListView() {
98
98
  viewName: "CurdViewEditor",
99
99
  onOpenChange: setOpenCurdViewEditor,
100
100
  svc: "sppb.CurdService",
101
- method: methodCreate,
101
+ method: "curdViewUpdate",
102
102
  children: /* @__PURE__ */ jsx(CurdEditPanel, {})
103
103
  }
104
104
  )
@@ -40,9 +40,13 @@ import { createConnectTransport } from "@connectrpc/connect-web";
40
40
  import { camelCase, merge } from "lodash";
41
41
  import { fetchMiddleWithCache } from "mtxlib/http/fetchMiddleWithCache";
42
42
  import { CONST_HeaderMtmHost, MTM_API_PREFIX } from "./consts";
43
+ import { CurdService } from "./gomtmpb/mtm/sppb/curd_connect";
43
44
  import { MtmService } from "./gomtmpb/mtm/sppb/mtm_connect";
44
45
  import { MtmError } from "./gomtmpb/mtm/sppb/mtm_pb";
45
- const allServices = [MtmService];
46
+ const allServices = [
47
+ MtmService,
48
+ CurdService
49
+ ];
46
50
  const createQueryKey = (svc, method, input) => {
47
51
  return [svc, method, input || {}];
48
52
  };