@reactfast/forms 0.1.9 → 0.1.10
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/forms.cjs +7 -7
- package/dist/forms.es.js +37 -40
- package/dist/forms.umd.js +7 -7
- package/package.json +1 -1
package/dist/forms.es.js
CHANGED
|
@@ -131,14 +131,14 @@ function Ai() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var I = Object.assign, O = 0, Z,
|
|
134
|
+
var I = Object.assign, O = 0, Z, Q, T, H, J, Re, re;
|
|
135
135
|
function te() {
|
|
136
136
|
}
|
|
137
137
|
te.__reactDisabledLog = !0;
|
|
138
138
|
function wt() {
|
|
139
139
|
{
|
|
140
140
|
if (O === 0) {
|
|
141
|
-
Z = console.log,
|
|
141
|
+
Z = console.log, Q = console.info, T = console.warn, H = console.error, J = console.group, Re = console.groupCollapsed, re = console.groupEnd;
|
|
142
142
|
var v = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
@@ -171,7 +171,7 @@ function Ai() {
|
|
|
171
171
|
value: Z
|
|
172
172
|
}),
|
|
173
173
|
info: I({}, v, {
|
|
174
|
-
value:
|
|
174
|
+
value: Q
|
|
175
175
|
}),
|
|
176
176
|
warn: I({}, v, {
|
|
177
177
|
value: T
|
|
@@ -180,7 +180,7 @@ function Ai() {
|
|
|
180
180
|
value: H
|
|
181
181
|
}),
|
|
182
182
|
group: I({}, v, {
|
|
183
|
-
value:
|
|
183
|
+
value: J
|
|
184
184
|
}),
|
|
185
185
|
groupCollapsed: I({}, v, {
|
|
186
186
|
value: Re
|
|
@@ -3089,12 +3089,12 @@ const f0 = function(e) {
|
|
|
3089
3089
|
placement: O
|
|
3090
3090
|
}
|
|
3091
3091
|
};
|
|
3092
|
-
let Z = (G = $.filter((
|
|
3092
|
+
let Z = (G = $.filter((Q) => Q.overflows[0] <= 0).sort((Q, T) => Q.overflows[1] - T.overflows[1])[0]) == null ? void 0 : G.placement;
|
|
3093
3093
|
if (!Z)
|
|
3094
3094
|
switch (f) {
|
|
3095
3095
|
case "bestFit": {
|
|
3096
3096
|
var P;
|
|
3097
|
-
const
|
|
3097
|
+
const Q = (P = $.filter((T) => {
|
|
3098
3098
|
if (j) {
|
|
3099
3099
|
const H = He(T.placement);
|
|
3100
3100
|
return H === x || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -3102,8 +3102,8 @@ const f0 = function(e) {
|
|
|
3102
3102
|
H === "y";
|
|
3103
3103
|
}
|
|
3104
3104
|
return !0;
|
|
3105
|
-
}).map((T) => [T.placement, T.overflows.filter((H) => H > 0).reduce((H,
|
|
3106
|
-
|
|
3105
|
+
}).map((T) => [T.placement, T.overflows.filter((H) => H > 0).reduce((H, J) => H + J, 0)]).sort((T, H) => T[1] - H[1])[0]) == null ? void 0 : P[0];
|
|
3106
|
+
Q && (Z = Q);
|
|
3107
3107
|
break;
|
|
3108
3108
|
}
|
|
3109
3109
|
case "initialPlacement":
|
|
@@ -3734,7 +3734,7 @@ function V0(e) {
|
|
|
3734
3734
|
middleware: h
|
|
3735
3735
|
};
|
|
3736
3736
|
N.current && (T.platform = N.current), _0(j.current, M.current, T).then((H) => {
|
|
3737
|
-
const
|
|
3737
|
+
const J = {
|
|
3738
3738
|
...H,
|
|
3739
3739
|
// The floating element's position may be recomputed while it's closed
|
|
3740
3740
|
// but still mounted (such as when transitioning out). To ensure
|
|
@@ -3742,8 +3742,8 @@ function V0(e) {
|
|
|
3742
3742
|
// setting it to `true` when `open === false` (must be specified).
|
|
3743
3743
|
isPositioned: G.current !== !1
|
|
3744
3744
|
};
|
|
3745
|
-
I.current && !Xt(_.current,
|
|
3746
|
-
w(
|
|
3745
|
+
I.current && !Xt(_.current, J) && (_.current = J, Dt.flushSync(() => {
|
|
3746
|
+
w(J);
|
|
3747
3747
|
}));
|
|
3748
3748
|
});
|
|
3749
3749
|
}, [h, t, r, N, G]);
|
|
@@ -3771,7 +3771,7 @@ function V0(e) {
|
|
|
3771
3771
|
}), [x, E]), Z = o.useMemo(() => ({
|
|
3772
3772
|
reference: L,
|
|
3773
3773
|
floating: y
|
|
3774
|
-
}), [L, y]),
|
|
3774
|
+
}), [L, y]), Q = o.useMemo(() => {
|
|
3775
3775
|
const T = {
|
|
3776
3776
|
position: r,
|
|
3777
3777
|
left: 0,
|
|
@@ -3779,17 +3779,17 @@ function V0(e) {
|
|
|
3779
3779
|
};
|
|
3780
3780
|
if (!Z.floating)
|
|
3781
3781
|
return T;
|
|
3782
|
-
const H = lo(Z.floating, u.x),
|
|
3782
|
+
const H = lo(Z.floating, u.x), J = lo(Z.floating, u.y);
|
|
3783
3783
|
return l ? {
|
|
3784
3784
|
...T,
|
|
3785
|
-
transform: "translate(" + H + "px, " +
|
|
3785
|
+
transform: "translate(" + H + "px, " + J + "px)",
|
|
3786
3786
|
...Ra(Z.floating) >= 1.5 && {
|
|
3787
3787
|
willChange: "transform"
|
|
3788
3788
|
}
|
|
3789
3789
|
} : {
|
|
3790
3790
|
position: r,
|
|
3791
3791
|
left: H,
|
|
3792
|
-
top:
|
|
3792
|
+
top: J
|
|
3793
3793
|
};
|
|
3794
3794
|
}, [r, l, Z.floating, u.x, u.y]);
|
|
3795
3795
|
return o.useMemo(() => ({
|
|
@@ -3797,8 +3797,8 @@ function V0(e) {
|
|
|
3797
3797
|
update: P,
|
|
3798
3798
|
refs: O,
|
|
3799
3799
|
elements: Z,
|
|
3800
|
-
floatingStyles:
|
|
3801
|
-
}), [u, P, O, Z,
|
|
3800
|
+
floatingStyles: Q
|
|
3801
|
+
}), [u, P, O, Z, Q]);
|
|
3802
3802
|
}
|
|
3803
3803
|
const ja = (e, t) => ({
|
|
3804
3804
|
...I0(e),
|
|
@@ -4191,18 +4191,18 @@ function p1({ children: e, enabled: t = !0 }) {
|
|
|
4191
4191
|
if (!N) return;
|
|
4192
4192
|
let I = E.elements.floating;
|
|
4193
4193
|
if (!I) return;
|
|
4194
|
-
let O = parseFloat(getComputedStyle(I).scrollPaddingBottom) || 0, Z = Math.min(ho, I.childElementCount),
|
|
4194
|
+
let O = parseFloat(getComputedStyle(I).scrollPaddingBottom) || 0, Z = Math.min(ho, I.childElementCount), Q = 0, T = 0;
|
|
4195
4195
|
for (let H of (P = (G = E.elements.floating) == null ? void 0 : G.childNodes) != null ? P : []) if (De(H)) {
|
|
4196
|
-
let
|
|
4197
|
-
if (
|
|
4196
|
+
let J = H.offsetTop, Re = J + H.clientHeight + O, re = I.scrollTop, te = re + I.clientHeight;
|
|
4197
|
+
if (J >= re && Re <= te) Z--;
|
|
4198
4198
|
else {
|
|
4199
|
-
T = Math.max(0, Math.min(Re, te) - Math.max(
|
|
4199
|
+
T = Math.max(0, Math.min(Re, te) - Math.max(J, re)), Q = H.clientHeight;
|
|
4200
4200
|
break;
|
|
4201
4201
|
}
|
|
4202
4202
|
}
|
|
4203
4203
|
Z >= 1 && i((H) => {
|
|
4204
|
-
let
|
|
4205
|
-
return H >=
|
|
4204
|
+
let J = Q * Z - T + O;
|
|
4205
|
+
return H >= J ? H : J;
|
|
4206
4206
|
});
|
|
4207
4207
|
} }) : null, U0({ padding: f, apply({ availableWidth: N, availableHeight: G, elements: P }) {
|
|
4208
4208
|
Object.assign(P.floating.style, { overflow: "auto", maxWidth: `${N}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${G}px)` });
|
|
@@ -4487,9 +4487,9 @@ function P1(e, t) {
|
|
|
4487
4487
|
le(() => {
|
|
4488
4488
|
if (L && O && $ === "visible" && E.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
4489
4489
|
}, [E, $, O, L]);
|
|
4490
|
-
let Z = D && !_,
|
|
4490
|
+
let Z = D && !_, Q = _ && M && D, T = W(!1), H = Pa(() => {
|
|
4491
4491
|
T.current || (N("hidden"), I(E));
|
|
4492
|
-
}, G),
|
|
4492
|
+
}, G), J = q((de) => {
|
|
4493
4493
|
T.current = !0;
|
|
4494
4494
|
let xe = de ? "enter" : "leave";
|
|
4495
4495
|
H.onStart(E, xe, (Ae) => {
|
|
@@ -4502,9 +4502,9 @@ function P1(e, t) {
|
|
|
4502
4502
|
}), xe === "leave" && !dr(H) && (N("hidden"), I(E));
|
|
4503
4503
|
});
|
|
4504
4504
|
oe(() => {
|
|
4505
|
-
L && a || (
|
|
4505
|
+
L && a || (J(M), Re(M));
|
|
4506
4506
|
}, [M, L, a]);
|
|
4507
|
-
let re = !(!a || !L || !O || Z), [, te] = ma(re, k, M, { start:
|
|
4507
|
+
let re = !(!a || !L || !O || Z), [, te] = ma(re, k, M, { start: J, end: Re }), wt = Ze({ ref: y, className: ((n = Tr(g.className, Q && d, Q && u, te.enter && d, te.enter && te.closed && u, te.enter && !te.closed && w, te.leave && f, te.leave && !te.closed && p, te.leave && te.closed && b, !te.transition && M && h)) == null ? void 0 : n.trim()) || void 0, ...fa(te) }), Ne = 0;
|
|
4508
4508
|
$ === "visible" && (Ne |= Fe.Open), $ === "hidden" && (Ne |= Fe.Closed), M && $ === "hidden" && (Ne |= Fe.Opening), !M && $ === "visible" && (Ne |= Fe.Closing);
|
|
4509
4509
|
let S = Le();
|
|
4510
4510
|
return B.createElement(cr.Provider, { value: H }, B.createElement(Aa, { value: Ne }, S({ ourProps: wt, theirProps: g, defaultTag: _a, features: Na, visible: $ === "visible", name: "Transition.Child" })));
|
|
@@ -4768,10 +4768,10 @@ function z1(e, t) {
|
|
|
4768
4768
|
Rs(P, [I, O], (re, te) => {
|
|
4769
4769
|
y.send({ type: Da.CloseListbox }), ca(te, nn.Loose) || (re.preventDefault(), I == null || I.focus());
|
|
4770
4770
|
});
|
|
4771
|
-
let Z = Ge({ open: N === fe.Open, disabled: w, invalid: u, value: E }), [
|
|
4771
|
+
let Z = Ge({ open: N === fe.Open, disabled: w, invalid: u, value: E }), [Q, T] = ql({ inherit: !0 }), H = { ref: k }, J = Y(() => {
|
|
4772
4772
|
if (x !== void 0) return L == null ? void 0 : L(x);
|
|
4773
4773
|
}, [L, x]), Re = Le();
|
|
4774
|
-
return B.createElement(T, { value:
|
|
4774
|
+
return B.createElement(T, { value: Q, props: { htmlFor: I == null ? void 0 : I.id }, slot: { open: N === fe.Open, disabled: w } }, B.createElement(p1, null, B.createElement(Za.Provider, { value: y }, B.createElement(ur.Provider, { value: $ }, B.createElement(Aa, { value: $e(N, { [fe.Open]: Fe.Open, [fe.Closed]: Fe.Closed }) }, l != null && E != null && B.createElement(Sl, { disabled: w, data: { [l]: E }, form: s, onReset: J }), Re({ ourProps: H, theirProps: b, slot: Z, defaultTag: G1, name: "Listbox" }))))));
|
|
4775
4775
|
}
|
|
4776
4776
|
let Y1 = "button";
|
|
4777
4777
|
function K1(e, t) {
|
|
@@ -4826,12 +4826,12 @@ function J1(e, t) {
|
|
|
4826
4826
|
if (P === null) return { ...d, inner: void 0 };
|
|
4827
4827
|
let S = Array.from(h.listRef.current.values());
|
|
4828
4828
|
return { ...d, inner: { listRef: { current: S }, index: P } };
|
|
4829
|
-
})(), [O, Z] = w1(I),
|
|
4829
|
+
})(), [O, Z] = w1(I), Q = h1(), T = Oe(t, d ? O : null, f.actions.setOptionsElement, w), H = ot();
|
|
4830
4830
|
oe(() => {
|
|
4831
4831
|
let S = g;
|
|
4832
4832
|
S && p === fe.Open && (wl(S) || S == null || S.focus({ preventScroll: !0 }));
|
|
4833
4833
|
}, [p, g]);
|
|
4834
|
-
let
|
|
4834
|
+
let J = q((S) => {
|
|
4835
4835
|
var de;
|
|
4836
4836
|
switch (H.dispose(), S.key) {
|
|
4837
4837
|
case ce.Space:
|
|
@@ -4862,7 +4862,7 @@ function J1(e, t) {
|
|
|
4862
4862
|
}), Re = ge(f, (S) => {
|
|
4863
4863
|
var de;
|
|
4864
4864
|
return (de = S.buttonElement) == null ? void 0 : de.id;
|
|
4865
|
-
}), re = Ge({ open: p === fe.Open }), te = Ho(d ?
|
|
4865
|
+
}), re = Ge({ open: p === fe.Open }), te = Ho(d ? Q() : {}, { id: n, ref: T, "aria-activedescendant": ge(f, f.selectors.activeDescendantId), "aria-multiselectable": h.mode === qe.Multi ? !0 : void 0, "aria-labelledby": Re, "aria-orientation": h.orientation, onKeyDown: J, role: "listbox", tabIndex: p === fe.Open ? 0 : void 0, style: { ...c.style, ...Z, "--button-width": Jl(y, b, !0).width }, ...fa(j) }), wt = Le(), Ne = pe(() => h.mode === qe.Multi ? h : { ...h, isSelected: G }, [h, G]);
|
|
4866
4866
|
return B.createElement(A1, { enabled: i ? e.static || y : !1, ownerDocument: x }, B.createElement(ur.Provider, { value: Ne }, wt({ ourProps: te, theirProps: c, slot: re, defaultTag: X1, features: Q1, visible: D, name: "Listbox.Options" })));
|
|
4867
4867
|
}
|
|
4868
4868
|
let ec = "div";
|
|
@@ -5115,7 +5115,7 @@ function cc({ field: e, value: t, onChange: r, theme: n }) {
|
|
|
5115
5115
|
] });
|
|
5116
5116
|
}
|
|
5117
5117
|
const pn = {};
|
|
5118
|
-
function
|
|
5118
|
+
function ee(e, t) {
|
|
5119
5119
|
pn[e] = t;
|
|
5120
5120
|
}
|
|
5121
5121
|
function dc(e) {
|
|
@@ -15208,10 +15208,7 @@ function Fp({ field: e, value: t, onChange: r, theme: n }) {
|
|
|
15208
15208
|
}
|
|
15209
15209
|
let yo = !1;
|
|
15210
15210
|
function Zp() {
|
|
15211
|
-
yo || (yo = !0,
|
|
15212
|
-
var t;
|
|
15213
|
-
return /* @__PURE__ */ m.jsx("img", { src: (t = e.image) == null ? void 0 : t.src, alt: "" });
|
|
15214
|
-
}), Q("paragraph", ({ field: e }) => /* @__PURE__ */ m.jsx("p", { children: e.content })));
|
|
15211
|
+
yo || (yo = !0, ee("string", Ii), ee("text", Ti), ee("color", Wi), ee("number", fc), ee("boolean", Pi), ee("toggle", _i), ee("date", mc), ee("datetime", yp), ee("time", wp), ee("select", cc), ee("multiselect", Ep), ee("file", void 0), ee("fileV2", void 0), ee("uploadToBase", hp), ee("array", xo), ee("subForm", xo), ee("email", vp), ee("tel", bp), ee("radio", xp), ee("url", kp), ee("captcha", Fp), ee("signature", Cp), ee("rating", $p), ee("scale", Op), ee("header", Hi));
|
|
15215
15212
|
}
|
|
15216
15213
|
function Up({ children: e }) {
|
|
15217
15214
|
return oe(() => {
|
|
@@ -15323,11 +15320,11 @@ function qp({ setState: e, fields: t = [], rules: r = [] }) {
|
|
|
15323
15320
|
...H,
|
|
15324
15321
|
fieldValue: f[H.field] || ""
|
|
15325
15322
|
})));
|
|
15326
|
-
const Z = f[_] || "",
|
|
15323
|
+
const Z = f[_] || "", Q = P ? String(Z) : Number(Z) || 0, T = P ? String(G) : Number(G);
|
|
15327
15324
|
f[_] = Lo({
|
|
15328
15325
|
type: $,
|
|
15329
15326
|
kind: N,
|
|
15330
|
-
targetValue:
|
|
15327
|
+
targetValue: Q,
|
|
15331
15328
|
modifierValue: T,
|
|
15332
15329
|
strictString: P,
|
|
15333
15330
|
sourceFields: O
|
|
@@ -15466,5 +15463,5 @@ export {
|
|
|
15466
15463
|
dc as getField,
|
|
15467
15464
|
Zp as initForms,
|
|
15468
15465
|
zp as initializeFormData,
|
|
15469
|
-
|
|
15466
|
+
ee as registerField
|
|
15470
15467
|
};
|