gomtm 0.0.382 → 0.0.383

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.
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ChildrenDebug: (props: any) => import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ "use client";
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 { Fragment, jsx } from "react/jsx-runtime";
22
+ import { Children, createElement } from "react";
23
+ import { useForm } from "react-hook-form";
24
+ const ChildrenDebug = (props) => {
25
+ const { children } = props;
26
+ const methods = useForm({});
27
+ if (!children) {
28
+ return /* @__PURE__ */ jsx("div", { children: "no children" });
29
+ }
30
+ return /* @__PURE__ */ jsx(Fragment, { children: Children.map(children, (child) => {
31
+ var _a;
32
+ console.log({
33
+ "\u5B50\u7EC4\u4EF6\u540D\u79F0": child.props.name,
34
+ "\u5B50\u7EC4\u4EF6\u7C7B\u578B": children.type,
35
+ "\u5176\u4ED6\u5C5E\u6027": children.props,
36
+ "\u7EC4\u4EF6\u540D\u79F0": (_a = children.type) == null ? void 0 : _a.name
37
+ });
38
+ return child.props.name ? createElement(child.type, __spreadValues({}, __spreadProps(__spreadValues({}, child.props), {
39
+ register: methods.register,
40
+ key: child.props.name
41
+ }))) : child;
42
+ }) });
43
+ };
44
+ export {
45
+ ChildrenDebug
46
+ };