New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mezzanine-ui/react-hook-form-v2

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mezzanine-ui/react-hook-form-v2 - npm Package Compare versions

Comparing version 0.0.18 to 0.0.19

416

index.js
import dt, { useMemo as X, useCallback as he, useEffect as ht, useState as ie } from "react";
import { FormField as Yt, cx as U, FormLabel as Bt, Typography as pe, Icon as Te, FormMessage as Lt, AutoComplete as _t, Checkbox as Gt, CheckboxGroup as Kt, DatePicker as Jt, DateRangePicker as Ht, DateTimePicker as qt, Button as be, Stepper as Xt, Step as Zt, Input as ze, RadioGroup as Qt, Slider as vt, Select as Nt, Option as er, TreeSelect as tr, Tabs as rr, TabPane as nr, Tab as or, Textarea as sr, Message as ge, UploadResult as ar, UploadButton as cr, UploadPicture as ir } from "@mezzanine-ui/react";
import { useFormContext as Y, useWatch as K, useFormState as ae, FormProvider as lr, useFieldArray as ur } from "react-hook-form";
import { FormField as Ut, cx as Y, FormLabel as Bt, Typography as pe, Icon as Te, FormMessage as Lt, AutoComplete as _t, Checkbox as Gt, CheckboxGroup as Ht, DatePicker as Kt, DateRangePicker as Jt, DateTimePicker as qt, Button as be, Stepper as Xt, Step as Zt, Input as ze, RadioGroup as Qt, Slider as vt, Select as Nt, Option as er, TreeSelect as tr, Tabs as rr, TabPane as nr, Tab as or, Textarea as sr, Message as ge, UploadResult as ar, UploadButton as cr, UploadPicture as ir } from "@mezzanine-ui/react";
import { useFormContext as U, useWatch as H, useFormState as ae, FormProvider as lr, useFieldArray as ur } from "react-hook-form";
import { get as pt, debounce as fr } from "lodash";

@@ -54,10 +54,10 @@ import { ErrorMessage as dr } from "@hookform/error-message";

{
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), $ = 1; $ < t; $++)
s[$ - 1] = arguments[$];
S("error", e, s);
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), S = 1; S < t; S++)
s[S - 1] = arguments[S];
$("error", e, s);
}
}
function S(e, t, s) {
function $(e, t, s) {
{
var $ = j.ReactDebugCurrentFrame, I = $.getStackAddendum();
var S = j.ReactDebugCurrentFrame, I = S.getStackAddendum();
I !== "" && (t += "%s", s = s.concat([I]));

@@ -80,5 +80,5 @@ var A = s.map(function(O) {

function D(e, t, s) {
var $ = e.displayName;
if ($)
return $;
var S = e.displayName;
if (S)
return S;
var I = t.displayName || t.name || "";

@@ -122,4 +122,4 @@ return I !== "" ? s + "(" + I + ")" : s;

case h:
var $ = e.displayName || null;
return $ !== null ? $ : E(e.type) || "Memo";
var S = e.displayName || null;
return S !== null ? S : E(e.type) || "Memo";
case f: {

@@ -136,3 +136,3 @@ var I = e, A = I._payload, O = I._init;

}
var M = Object.assign, P = 0, B, q, ee, te, J, re, Q;
var M = Object.assign, P = 0, B, q, ee, te, K, re, Q;
function ce() {

@@ -144,3 +144,3 @@ }

if (P === 0) {
B = console.log, q = console.info, ee = console.warn, te = console.error, J = console.group, re = console.groupCollapsed, Q = console.groupEnd;
B = console.log, q = console.info, ee = console.warn, te = console.error, K = console.group, re = console.groupCollapsed, Q = console.groupEnd;
var e = {

@@ -187,3 +187,3 @@ configurable: !0,

group: M({}, e, {
value: J
value: K
}),

@@ -208,4 +208,4 @@ groupCollapsed: M({}, e, {

} catch (I) {
var $ = I.stack.trim().match(/\n( *(at )?)/);
ye = $ && $[1] || "";
var S = I.stack.trim().match(/\n( *(at )?)/);
ye = S && S[1] || "";
}

@@ -221,3 +221,3 @@ return `

}
function Ue(e, t) {
function Ye(e, t) {
if (!e || we)

@@ -230,3 +230,3 @@ return "";

}
var $;
var S;
we = !0;

@@ -250,3 +250,3 @@ var I = Error.prepareStackTrace;

} catch (N) {
$ = N;
S = N;
}

@@ -258,3 +258,3 @@ Reflect.construct(e, [], O);

} catch (N) {
$ = N;
S = N;
}

@@ -267,3 +267,3 @@ e.call(O.prototype);

} catch (N) {
$ = N;
S = N;
}

@@ -273,5 +273,5 @@ e();

} catch (N) {
if (N && $ && typeof N.stack == "string") {
if (N && S && typeof N.stack == "string") {
for (var C = N.stack.split(`
`), Z = $.stack.split(`
`), Z = S.stack.split(`
`), L = C.length - 1, G = Z.length - 1; L >= 1 && G >= 0 && C[L] !== Z[G]; )

@@ -299,3 +299,3 @@ G--;

function mt(e, t, s) {
return Ue(e, !1);
return Ye(e, !1);
}

@@ -306,7 +306,7 @@ function xt(e) {

}
function $e(e, t, s) {
function Se(e, t, s) {
if (e == null)
return "";
if (typeof e == "function")
return Ue(e, xt(e));
return Ye(e, xt(e));
if (typeof e == "string")

@@ -325,7 +325,7 @@ return fe(e);

case h:
return $e(e.type, t, s);
return Se(e.type, t, s);
case f: {
var $ = e, I = $._payload, A = $._init;
var S = e, I = S._payload, A = S._init;
try {
return $e(A(I), t, s);
return Se(A(I), t, s);
} catch {

@@ -337,6 +337,6 @@ }

}
var me = Object.prototype.hasOwnProperty, Ye = {}, Be = j.ReactDebugCurrentFrame;
function Se(e) {
var me = Object.prototype.hasOwnProperty, Ue = {}, Be = j.ReactDebugCurrentFrame;
function $e(e) {
if (e) {
var t = e._owner, s = $e(e.type, e._source, t ? t.type : null);
var t = e._owner, s = Se(e.type, e._source, t ? t.type : null);
Be.setExtraStackFrame(s);

@@ -346,3 +346,3 @@ } else

}
function bt(e, t, s, $, I) {
function bt(e, t, s, S, I) {
{

@@ -355,10 +355,10 @@ var A = Function.call.bind(me);

if (typeof e[O] != "function") {
var Z = Error(($ || "React class") + ": " + s + " type `" + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[O] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
var Z = Error((S || "React class") + ": " + s + " type `" + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[O] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw Z.name = "Invariant Violation", Z;
}
C = e[O](t, O, $, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
C = e[O](t, O, S, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (L) {
C = L;
}
C && !(C instanceof Error) && (Se(I), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", $ || "React class", s, O, typeof C), Se(null)), C instanceof Error && !(C.message in Ye) && (Ye[C.message] = !0, Se(I), _("Failed %s type: %s", s, C.message), Se(null));
C && !(C instanceof Error) && ($e(I), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", S || "React class", s, O, typeof C), $e(null)), C instanceof Error && !(C.message in Ue) && (Ue[C.message] = !0, $e(I), _("Failed %s type: %s", s, C.message), $e(null));
}

@@ -396,3 +396,3 @@ }

__source: !0
}, Ke, Je, Ce;
}, He, Ke, Ce;
Ce = {};

@@ -407,3 +407,3 @@ function Wt(e) {

}
function $t(e) {
function St(e) {
if (me.call(e, "key")) {

@@ -416,3 +416,3 @@ var t = Object.getOwnPropertyDescriptor(e, "key").get;

}
function St(e, t) {
function $t(e, t) {
if (typeof e.ref == "string" && xe.current && t && xe.current.stateNode !== t) {

@@ -426,3 +426,3 @@ var s = E(xe.current.type);

var s = function() {
Ke || (Ke = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
He || (He = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
};

@@ -438,3 +438,3 @@ s.isReactWarning = !0, Object.defineProperty(e, "key", {

var s = function() {
Je || (Je = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
Ke || (Ke = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
};

@@ -447,3 +447,3 @@ s.isReactWarning = !0, Object.defineProperty(e, "ref", {

}
var wt = function(e, t, s, $, I, A, O) {
var wt = function(e, t, s, S, I, A, O) {
var C = {

@@ -469,3 +469,3 @@ // This tag allows us to uniquely identify this as a React Element

writable: !1,
value: $
value: S
}), Object.defineProperty(C, "_source", {

@@ -478,6 +478,6 @@ configurable: !1,

};
function Ft(e, t, s, $, I) {
function Ft(e, t, s, S, I) {
{
var A, O = {}, C = null, Z = null;
s !== void 0 && (Ge(s), C = "" + s), $t(t) && (Ge(t.key), C = "" + t.key), Wt(t) && (Z = t.ref, St(t, I));
s !== void 0 && (Ge(s), C = "" + s), St(t) && (Ge(t.key), C = "" + t.key), Wt(t) && (Z = t.ref, $t(t, I));
for (A in t)

@@ -494,12 +494,12 @@ me.call(t, A) && !gt.hasOwnProperty(A) && (O[A] = t[A]);

}
return wt(e, C, Z, I, $, xe.current, O);
return wt(e, C, Z, I, S, xe.current, O);
}
}
var Oe = j.ReactCurrentOwner, He = j.ReactDebugCurrentFrame;
var Oe = j.ReactCurrentOwner, Je = j.ReactDebugCurrentFrame;
function _e(e) {
if (e) {
var t = e._owner, s = $e(e.type, e._source, t ? t.type : null);
He.setExtraStackFrame(s);
var t = e._owner, s = Se(e.type, e._source, t ? t.type : null);
Je.setExtraStackFrame(s);
} else
He.setExtraStackFrame(null);
Je.setExtraStackFrame(null);
}

@@ -548,4 +548,4 @@ var De;

Xe[s] = !0;
var $ = "";
e && e._owner && e._owner !== Oe.current && ($ = " It was passed a child from " + E(e._owner.type) + "."), _e(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, $), _e(null);
var S = "";
e && e._owner && e._owner !== Oe.current && (S = " It was passed a child from " + E(e._owner.type) + "."), _e(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, S), _e(null);
}

@@ -559,4 +559,4 @@ }

for (var s = 0; s < e.length; s++) {
var $ = e[s];
Ve($) && Ze($, t);
var S = e[s];
Ve(S) && Ze(S, t);
}

@@ -588,4 +588,4 @@ else if (Ve(e))

if (s) {
var $ = E(t);
bt(s, e.props, "prop", $, e);
var S = E(t);
bt(s, e.props, "prop", S, e);
} else if (t.PropTypes !== void 0 && !De) {

@@ -602,5 +602,5 @@ De = !0;

for (var t = Object.keys(e.props), s = 0; s < t.length; s++) {
var $ = t[s];
if ($ !== "children" && $ !== "key") {
_e(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", $), _e(null);
var S = t[s];
if (S !== "children" && S !== "key") {
_e(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), _e(null);
break;

@@ -613,3 +613,3 @@ }

var Ne = {};
function et(e, t, s, $, I, A) {
function et(e, t, s, S, I, A) {
{

@@ -631,3 +631,3 @@ var O = z(e);

if (oe !== void 0)
if ($)
if (S)
if (Fe(oe)) {

@@ -643,4 +643,4 @@ for (var ve = 0; ve < oe.length; ve++)

if (me.call(t, "key")) {
var de = E(e), N = Object.keys(t).filter(function(Ut) {
return Ut !== "key";
var de = E(e), N = Object.keys(t).filter(function(Yt) {
return Yt !== "key";
}), Ie = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";

@@ -672,3 +672,3 @@ if (!Ne[de + Ie]) {

var r = Ae.exports;
const br = "_host_1ceen_1", jr = "_specifiedWidth_1ceen_5", Er = "_wrapper_1ceen_8", Rr = "_labelWrapper_1ceen_11", gr = "_label_1ceen_11", Wr = "_basicLabel_1ceen_23", $r = "_requiredMark_1ceen_26", Sr = "_field_1ceen_32", kr = "_hintsWrapper_1ceen_38", Tr = "_hintWrapper_1ceen_44", wr = "_horizontal_1ceen_50", se = {
const br = "_host_1ceen_1", jr = "_specifiedWidth_1ceen_5", Er = "_wrapper_1ceen_8", Rr = "_labelWrapper_1ceen_11", gr = "_label_1ceen_11", Wr = "_basicLabel_1ceen_23", Sr = "_requiredMark_1ceen_26", $r = "_field_1ceen_32", kr = "_hintsWrapper_1ceen_38", Tr = "_hintWrapper_1ceen_44", wr = "_horizontal_1ceen_50", se = {
host: br,

@@ -680,8 +680,8 @@ specifiedWidth: jr,

basicLabel: Wr,
requiredMark: $r,
field: Sr,
requiredMark: Sr,
field: $r,
hintsWrapper: kr,
hintWrapper: Tr,
horizontal: wr
}, H = ({
}, J = ({
children: y,

@@ -707,3 +707,3 @@ className: m,

}) => {
const { formState: S } = Y(), R = x || S.errors, g = {
const { formState: $ } = U(), R = x || $.errors, g = {
"--width": p ? `${p}px` : a ? "100%" : void 0,

@@ -716,5 +716,5 @@ ...o

return /* @__PURE__ */ r.jsxs(
Yt,
Ut,
{
className: U(se.host, p && se.specifiedWidth, m),
className: Y(se.host, p && se.specifiedWidth, m),
style: W,

@@ -727,3 +727,3 @@ disabled: v,

{
className: U(se.wrapper, {
className: Y(se.wrapper, {
[se.horizontal]: j

@@ -735,3 +735,3 @@ }),

{
className: U(se.label, se.basicLabel, i),
className: Y(se.label, se.basicLabel, i),
htmlFor: l,

@@ -754,3 +754,3 @@ remark: u,

) }),
/* @__PURE__ */ r.jsxs("div", { className: U(se.field, c), style: g, children: [
/* @__PURE__ */ r.jsxs("div", { className: Y(se.field, c), style: g, children: [
y,

@@ -798,3 +798,3 @@ _.length > 0 && /* @__PURE__ */ r.jsx("div", { className: se.hintsWrapper, children: _.map((T) => /* @__PURE__ */ r.jsxs("div", { className: se.hintWrapper, children: [

width: _,
disabledErrMsg: S,
disabledErrMsg: $,
errorMsgRender: R,

@@ -811,3 +811,3 @@ onChange: g,

setValue: V
} = Y(), E = K({ name: h, defaultValue: a }), M = X(
} = U(), E = H({ name: h, defaultValue: a }), M = X(
() => (n == null ? void 0 : n.filter((B) => E == null ? void 0 : E.includes(B.id))) ?? void 0,

@@ -823,3 +823,3 @@ [n, E]

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -833,7 +833,7 @@ disabled: d,

width: _,
disabledErrMsg: S,
disabledErrMsg: $,
errorMsgRender: R,
horizontal: w,
hints: T,
className: U(Cr.host, k),
className: Y(Cr.host, k),
children: /* @__PURE__ */ r.jsx(

@@ -883,3 +883,3 @@ _t,

errorMsgRender: _,
onChange: S,
onChange: $,
horizontal: R,

@@ -893,10 +893,10 @@ hints: g,

setValue: F
} = Y(), z = K({ name: l, defaultValue: v }), D = X(
} = U(), z = H({ name: l, defaultValue: v }), D = X(
() => (c == null ? void 0 : c.find((E) => E.id === z)) ?? null,
[c, z]
), V = (E) => {
T != null && T[l] && w(l), E ? F(l, E.id, { shouldDirty: !0 }) : F(l, null), S == null || S(E);
T != null && T[l] && w(l), E ? F(l, E.id, { shouldDirty: !0 }) : F(l, null), $ == null || $(E);
};
return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -914,3 +914,3 @@ disabled: a,

hints: g,
className: U(Dr.host, b),
className: Y(Dr.host, b),
children: /* @__PURE__ */ r.jsx(

@@ -951,3 +951,3 @@ _t,

}) => {
const { control: o, setValue: b } = Y(), { errors: p } = ae({ control: m || o }), k = K({ name: d }), j = he(
const { control: o, setValue: b } = U(), { errors: p } = ae({ control: m || o }), k = H({ name: d }), j = he(
(_) => {

@@ -959,3 +959,3 @@ b(d, _.target.checked, { shouldDirty: !0 });

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -986,3 +986,3 @@ disabled: v,

host: Vr
}, Un = ({
}, Yn = ({
className: y,

@@ -1007,7 +1007,7 @@ fieldClassName: m,

}) => {
const { control: _, setValue: S, clearErrors: R } = Y(), g = K({ name: u, defaultValue: a }), { errors: W } = ae({ control: v || _ }), w = (T, F) => {
W != null && W[u] && R(u), S(u, T, { shouldValidate: !0 }), p == null || p(T, F);
const { control: _, setValue: $, clearErrors: R } = U(), g = H({ name: u, defaultValue: a }), { errors: W } = ae({ control: v || _ }), w = (T, F) => {
W != null && W[u] && R(u), $(u, T, { shouldValidate: !0 }), p == null || p(T, F);
};
return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -1027,3 +1027,3 @@ disabled: d,

children: /* @__PURE__ */ r.jsx(
Kt,
Ht,
{

@@ -1034,3 +1034,3 @@ ...j,

defaultValue: a,
className: U(Ir.host, m),
className: Y(Ir.host, m),
value: g,

@@ -1045,3 +1045,3 @@ onChange: w

specifiedWidth: Pr
}, Yn = ({
}, Un = ({
clearable: y = !0,

@@ -1066,3 +1066,3 @@ className: m,

size: _ = "large",
width: S,
width: $,
errorMsgRender: R,

@@ -1080,3 +1080,3 @@ disabledErrMsg: g,

clearErrors: E
} = Y(), M = K({ name: o, defaultValue: j }), { errors: P } = ae({ control: v || z }), B = (f || D)(o), q = (te) => {
} = U(), M = H({ name: o, defaultValue: j }), { errors: P } = ae({ control: v || z }), B = (f || D)(o), q = (te) => {
P != null && P[o] && E(o), V(o, te, { shouldDirty: !0 }), W == null || W(te);

@@ -1088,3 +1088,3 @@ }, ee = {

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -1098,4 +1098,4 @@ disabled: a,

required: p,
width: S,
className: U(nt.host, S && nt.specifiedWidth, m),
width: $,
className: Y(nt.host, $ && nt.specifiedWidth, m),
disabledErrMsg: g,

@@ -1106,3 +1106,3 @@ errorMsgRender: R,

children: /* @__PURE__ */ r.jsx(
Jt,
Kt,
{

@@ -1128,3 +1128,3 @@ ...F,

);
}, Ar = "_host_2yof0_1", zr = "_specifiedWidth_2yof0_4", Ur = {
}, Ar = "_host_2yof0_1", zr = "_specifiedWidth_2yof0_4", Yr = {
host: Ar,

@@ -1152,3 +1152,3 @@ specifiedWidth: zr

style: _,
size: S = "large",
size: $ = "large",
horizontal: R,

@@ -1161,3 +1161,3 @@ hints: g

setValue: T
} = Y(), F = K({
} = U(), F = H({
control: v || W,

@@ -1182,7 +1182,7 @@ name: p,

return /* @__PURE__ */ r.jsx(
H,
J,
{
disabled: d,
errors: z,
className: U(Ur.host, m),
className: Y(Yr.host, m),
style: _,

@@ -1196,3 +1196,3 @@ label: l,

children: /* @__PURE__ */ r.jsx(
Ht,
Jt,
{

@@ -1211,3 +1211,3 @@ fullWidth: !0,

referenceDate: o,
size: S,
size: $,
value: F

@@ -1218,4 +1218,4 @@ }

);
}, Yr = "_host_2yof0_1", Br = "_specifiedWidth_2yof0_4", ot = {
host: Yr,
}, Ur = "_host_2yof0_1", Br = "_specifiedWidth_2yof0_4", ot = {
host: Ur,
specifiedWidth: Br

@@ -1242,3 +1242,3 @@ }, Ln = ({

registerName: _,
remark: S,
remark: $,
required: R,

@@ -1262,11 +1262,11 @@ secondStep: g,

setValue: te,
clearErrors: J
} = Y(), { errors: re } = ae({ control: v || q }), Q = K({ name: _, defaultValue: a }) || a, le = {
clearErrors: K
} = U(), { errors: re } = ae({ control: v || q }), Q = H({ name: _, defaultValue: a }) || a, le = {
autoComplete: "off",
...(j || ee)(_)
}, ue = (ne) => {
re != null && re[_] && J(_), te(_, ne, { shouldDirty: !0 }), E == null || E(ne);
re != null && re[_] && K(_), te(_, ne, { shouldDirty: !0 }), E == null || E(ne);
};
return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -1278,6 +1278,6 @@ disabled: d,

name: _,
remark: S,
remark: $,
required: R,
width: f,
className: U(ot.host, f && ot.specifiedWidth, m),
className: Y(ot.host, f && ot.specifiedWidth, m),
disabledErrMsg: D,

@@ -1317,3 +1317,3 @@ errorMsgRender: V,

}, Gn = ({ defaultValue: y, registerName: m }) => {
const { setValue: v } = Y();
const { setValue: v } = U();
return ht(() => {

@@ -1326,12 +1326,12 @@ v(m, y, {

}, []), null;
}, Lr = "_host_2cojc_1", Gr = "_hostHovered_2cojc_18", Kr = "_title_2cojc_21", Jr = "_code_2cojc_27", Hr = "_close_2cojc_38", Re = {
}, Lr = "_host_2cojc_1", Gr = "_hostHovered_2cojc_18", Hr = "_title_2cojc_21", Kr = "_code_2cojc_27", Jr = "_close_2cojc_38", Re = {
host: Lr,
hostHovered: Gr,
title: Kr,
code: Jr,
close: Hr
title: Hr,
code: Kr,
close: Jr
}, qr = () => {
const y = K();
const y = H();
return /* @__PURE__ */ r.jsx("pre", { className: Re.code, children: JSON.stringify(y, null, 2) });
}, Kn = ({
}, Hn = ({
mode: y = "dev",

@@ -1341,3 +1341,3 @@ title: m = "Hook Form State"

const [v, a] = ie(!1), [d, x] = ie(!1), [c, n] = ie(!0);
return y === "dev" && !d ? /* @__PURE__ */ r.jsxs("div", { className: U(Re.host, v && Re.hostHovered), children: [
return y === "dev" && !d ? /* @__PURE__ */ r.jsxs("div", { className: Y(Re.host, v && Re.hostHovered), children: [
/* @__PURE__ */ r.jsx(

@@ -1389,3 +1389,3 @@ "div",

}) => {
const [k, j] = ie(!1), _ = K(), S = X(() => _, [_]), R = X(() => h || k, [h, k]), g = X(
const [k, j] = ie(!1), _ = H(), $ = X(() => _, [_]), R = X(() => h || k, [h, k]), g = X(
() => !!f && f.length > 0 && typeof o == "number" && !!b,

@@ -1397,3 +1397,3 @@ [o, b, f]

{
className: U(Me.host, {
className: Y(Me.host, {
[Me.expanded]: y

@@ -1409,5 +1409,5 @@ }),

loading: R,
disabled: i(S) || R,
disabled: i($) || R,
onClick: async () => {
j(!0), await l(S), j(!1);
j(!0), await l($), j(!1);
},

@@ -1437,3 +1437,3 @@ ...c,

onClick: async () => {
await u(S);
await u($);
},

@@ -1451,3 +1451,3 @@ ...d,

disabled: p == null ? void 0 : p({
values: S,
values: $,
activeStep: o ?? 0

@@ -1468,3 +1468,3 @@ }),

loading: R,
disabled: n(S) || R,
disabled: n($) || R,
...x,

@@ -1481,3 +1481,3 @@ children: v

stepper: en
}, Jn = ({
}, Kn = ({
methods: y,

@@ -1505,3 +1505,3 @@ children: m,

onClickAction: _,
onCancel: S,
onCancel: $,
...R

@@ -1540,3 +1540,3 @@ }) => {

onClickAction: _,
onCancel: S,
onCancel: $,
submitting: W,

@@ -1575,3 +1575,3 @@ steps: a,

pattern: _,
register: S,
register: $,
registerName: R,

@@ -1595,9 +1595,9 @@ remark: g,

register: te,
setValue: J,
setValue: K,
trigger: re
} = Y(), Q = K({
} = U(), Q = H({
control: x || ee,
name: R,
defaultValue: c
}), ce = (S || te)(R, {
}), ce = ($ || te)(R, {
maxLength: h,

@@ -1609,3 +1609,3 @@ max: f,

}), le = (ne) => {
B == null || B(ne), ne.type === "change" ? (J(R, ne.target.value, { shouldDirty: !0 }), ee._options.mode === "onChange" && re(R)) : J(R, "");
B == null || B(ne), ne.type === "change" ? (K(R, ne.target.value, { shouldDirty: !0 }), ee._options.mode === "onChange" && re(R)) : K(R, "");
}, ue = X(() => {

@@ -1618,5 +1618,5 @@ if (g)

return /* @__PURE__ */ r.jsx(
H,
J,
{
className: U(st.host, l && st.specifiedWidth, v),
className: Y(st.host, l && st.specifiedWidth, v),
name: R,

@@ -1667,3 +1667,3 @@ disabledErrMsg: i,

specifiedWidth: an
}, Hn = ({
}, Jn = ({
autoComplete: y = "off",

@@ -1688,3 +1688,3 @@ autoFocus: m,

registerName: _,
remark: S,
remark: $,
required: R,

@@ -1706,3 +1706,3 @@ valueAsDate: g,

hints: te,
...J
...K
}) => {

@@ -1713,3 +1713,3 @@ const {

setValue: ce
} = Y(), le = K({
} = U(), le = H({
control: d || re,

@@ -1727,5 +1727,5 @@ name: _

return /* @__PURE__ */ r.jsx(
H,
J,
{
className: U(at.host, i && at.specifiedWidth, v),
className: Y(at.host, i && at.specifiedWidth, v),
name: _,

@@ -1735,3 +1735,3 @@ errors: ue,

required: R,
remark: S,
remark: $,
disabled: n,

@@ -1748,3 +1748,3 @@ label: u,

{
...J,
...K,
fullWidth: !0,

@@ -1821,3 +1821,3 @@ role: w,

}) => {
const { setValue: f } = Y(), o = K({
const { setValue: f } = U(), o = H({
name: c,

@@ -1830,3 +1830,3 @@ defaultValue: v

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -1847,3 +1847,3 @@ disabled: a,

orientation: x,
className: U(fn.radioGroup, l),
className: Y(fn.radioGroup, l),
size: n,

@@ -1878,6 +1878,6 @@ value: o,

const {
control: S,
control: $,
register: R,
setValue: g
} = Y(), { errors: W } = ae({ control: y || S }), w = K({ name: n }) || i || [m, v], T = (F) => {
} = U(), { errors: W } = ae({ control: y || $ }), w = H({ name: n }) || i || [m, v], T = (F) => {
g(n, F, { shouldDirty: !0 }), j == null || j(F);

@@ -1891,3 +1891,3 @@ };

), /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -1936,3 +1936,3 @@ disabled: a,

}) => {
const { control: l, setValue: u } = Y(), h = K({
const { control: l, setValue: u } = U(), h = H({
control: l,

@@ -1952,3 +1952,3 @@ name: x,

{
className: U(ct.host, y),
className: Y(ct.host, y),
clearable: m,

@@ -1993,3 +1993,3 @@ fullWidth: !0,

menuSize: _ = "large",
menuMaxHeight: S = 186,
menuMaxHeight: $ = 186,
style: R,

@@ -2009,3 +2009,3 @@ errorMsgRender: g,

setValue: P
} = Y(), B = K({
} = U(), B = H({
control: E,

@@ -2015,11 +2015,11 @@ name: f,

}), q = X(
() => (l == null ? void 0 : l.find((J) => J.id === B)) ?? null,
() => (l == null ? void 0 : l.find((K) => K.id === B)) ?? null,
[l, B]
), ee = () => {
M(f), P(f, "", { shouldDirty: !0 });
}, te = (J) => {
V != null && V[f] && D(f), P(f, J.id), W == null || W(J);
}, te = (K) => {
V != null && V[f] && D(f), P(f, K.id), W == null || W(K);
};
return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -2032,3 +2032,3 @@ disabled: a,

required: p,
className: U(it.host, d && it.specifiedWidth, y),
className: Y(it.host, d && it.specifiedWidth, y),
width: d,

@@ -2058,4 +2058,4 @@ disabledErrMsg: w,

menuSize: _,
menuMaxHeight: S,
children: l == null ? void 0 : l.map((J) => /* @__PURE__ */ r.jsx(er, { value: J.id, children: J.name }, J.id))
menuMaxHeight: $,
children: l == null ? void 0 : l.map((K) => /* @__PURE__ */ r.jsx(er, { value: K.id, children: K.name }, K.id))
}

@@ -2088,3 +2088,3 @@ )

hints: _,
...S
...$
}) => {

@@ -2095,3 +2095,3 @@ const {

setValue: W
} = Y(), w = K({
} = U(), w = H({
name: n,

@@ -2108,3 +2108,3 @@ defaultValue: v

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -2117,3 +2117,3 @@ disabled: a,

required: l,
className: U(lt.host, h && lt.specifiedWidth, y),
className: Y(lt.host, h && lt.specifiedWidth, y),
width: h,

@@ -2129,3 +2129,3 @@ fullWidth: d,

{
...S,
...$,
mode: "single",

@@ -2164,6 +2164,6 @@ clearable: m,

const {
control: S,
control: $,
register: R,
setValue: g
} = Y(), { errors: W } = ae({ control: y || S }), w = K({ name: c, defaultValue: n }) || n || 100, T = (F) => {
} = U(), { errors: W } = ae({ control: y || $ }), w = H({ name: c, defaultValue: n }) || n || 100, T = (F) => {
g(c, F, { shouldValidate: !0 }), k == null || k(F);

@@ -2177,3 +2177,3 @@ };

), /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -2226,3 +2226,3 @@ disabled: a,

}) => {
const { control: o } = Y(), b = K({
const { control: o } = U(), b = H({
control: m || o,

@@ -2232,5 +2232,5 @@ name: c

return /* @__PURE__ */ r.jsx(
H,
J,
{
className: U(ut.host, d && ut.specifiedWidth, y),
className: Y(ut.host, d && ut.specifiedWidth, y),
name: c,

@@ -2262,3 +2262,3 @@ disabledErrMsg: a,

}) => {
const [i, l] = ie((m == null ? void 0 : m.id) || ""), { register: u, setValue: h } = Y(), f = (o) => {
const [i, l] = ie((m == null ? void 0 : m.id) || ""), { register: u, setValue: h } = U(), f = (o) => {
l(o), h(d, o, { shouldValidate: !0 }), n == null || n(o);

@@ -2318,3 +2318,3 @@ };

disabledErrMsg: _,
errorMsgRender: S,
errorMsgRender: $,
onChange: R,

@@ -2325,3 +2325,3 @@ horizontal: g,

}) => {
const { control: T, register: F } = Y(), z = K({
const { control: T, register: F } = U(), z = H({
control: d || T,

@@ -2338,3 +2338,3 @@ name: p,

return /* @__PURE__ */ r.jsx(
H,
J,
{

@@ -2350,6 +2350,6 @@ disabled: c,

required: k,
className: U(Pe.host, n && Pe.specifiedWidth, m),
className: Y(Pe.host, n && Pe.specifiedWidth, m),
width: n,
disabledErrMsg: _,
errorMsgRender: S,
errorMsgRender: $,
horizontal: g,

@@ -2371,3 +2371,3 @@ hints: W,

...V,
className: U(Pe.input, v),
className: Y(Pe.input, v),
onChange: E,

@@ -2380,5 +2380,5 @@ placeholder: o,

);
}, $n = "_host_1l80h_1", Sn = "_specifiedWidth_1l80h_4", kn = "_fieldWrapper_1l80h_7", Tn = "_uploadButton_1l80h_12", ke = {
host: $n,
specifiedWidth: Sn,
}, Sn = "_host_1l80h_1", $n = "_specifiedWidth_1l80h_4", kn = "_fieldWrapper_1l80h_7", Tn = "_uploadButton_1l80h_12", ke = {
host: Sn,
specifiedWidth: $n,
fieldWrapper: kn,

@@ -2392,3 +2392,3 @@ uploadButton: Tn

disabledErrMsg: d,
fileHost: x,
renderFileUrl: x,
width: c,

@@ -2407,5 +2407,5 @@ style: n,

}) => {
const [_, S] = ie(!1), {
const [_, $] = ie(!1), {
formState: { errors: R }
} = Y(), { fields: g, append: W, remove: w } = ur({
} = U(), { fields: g, append: W, remove: w } = ur({
name: y

@@ -2427,3 +2427,3 @@ }), T = X(

try {
S(!0);
$(!0);
const { id: M } = await k(E), P = {

@@ -2433,3 +2433,3 @@ fileId: M,

};
W(P), S(!1);
W(P), $(!1);
} catch {

@@ -2443,5 +2443,5 @@ ge.error(`${E.name} 上傳失敗(檔案格式錯誤)`);

return /* @__PURE__ */ r.jsx(
H,
J,
{
className: U(ke.host, c && ke.specifiedWidth, a),
className: Y(ke.host, c && ke.specifiedWidth, a),
name: y,

@@ -2468,3 +2468,3 @@ disabledErrMsg: d,

onDownload: () => {
window.open(`${x}/${E.fileId}`, "_blank");
window.open(x(E.fileId), "_blank");
},

@@ -2509,3 +2509,3 @@ onDelete: () => {

label: n,
fileHost: i,
renderFileUrl: i,
width: l,

@@ -2522,6 +2522,6 @@ height: u,

}) => {
const S = {
const $ = {
"--object-fit": h,
...k
}, { control: R, setValue: g } = Y(), W = K({
}, { control: R, setValue: g } = U(), W = H({
control: a || R,

@@ -2536,3 +2536,3 @@ name: o,

throw ge.error(`${D.name} 上傳失敗 (檔案大小超過 ${j} MB)`), new Error(`${D.name} 上傳失敗 (檔案大小超過 ${j} MB)`);
return _(D).then((V) => (g(o, V.id, { shouldDirty: !0 }), `${i}/${V.id}`)).catch(() => {
return _(D).then((V) => (g(o, V.id, { shouldDirty: !0 }), i(V.id))).catch(() => {
throw ge.error("上傳失敗"), new Error("上傳失敗");

@@ -2544,5 +2544,5 @@ });

return /* @__PURE__ */ r.jsx(
H,
J,
{
className: U(ft.host, m),
className: Y(ft.host, m),
fieldClassName: v,

@@ -2570,6 +2570,6 @@ name: o,

height: u,
...S
...$
},
disabled: x,
defaultValue: W ? `${i}/${W}` : void 0
defaultValue: W ? i(W) : void 0
}

@@ -2583,13 +2583,13 @@ )

An as AutoCompleteSingleField,
H as BaseField,
J as BaseField,
zn as CheckboxField,
Un as CheckboxGroupField,
Yn as DatePickerField,
Yn as CheckboxGroupField,
Un as DatePickerField,
Bn as DateRangePickerField,
Ln as DateTimePickerField,
Gn as DefaultValueField,
Kn as FormFieldsDebug,
Jn as FormFieldsWrapper,
Hn as FormFieldsDebug,
Kn as FormFieldsWrapper,
on as InputField,
Hn as InputTagsModeField,
Jn as InputTagsModeField,
qn as PasswordField,

@@ -2596,0 +2596,0 @@ Xn as RadioGroupField,

{
"name": "@mezzanine-ui/react-hook-form-v2",
"version": "0.0.18",
"version": "0.0.19",
"main": "index.cjs",

@@ -5,0 +5,0 @@ "module": "index.js",

@@ -5,3 +5,3 @@ import { FC } from 'react';

export type UploadFileFieldProps<T extends FieldValues = FieldValues> = HookFormFieldProps<T, object, {
fileHost: string;
renderFileUrl: (fileId: string) => string;
buttonText?: string;

@@ -8,0 +8,0 @@ width?: number;

@@ -5,3 +5,3 @@ import { UploadPictureProps } from '@mezzanine-ui/react';

export type UploadImageFieldProps<T extends FieldValues = FieldValues> = HookFormFieldProps<T, UploadPictureProps, {
fileHost: string;
renderFileUrl: (fileId: string) => string;
fieldClassName?: string;

@@ -8,0 +8,0 @@ width?: number;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc