@harnessio/forms 0.4.5 → 0.6.0

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/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  var ye = Object.defineProperty;
2
- var pe = (r, e, n) => e in r ? ye(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
- var N = (r, e, n) => pe(r, typeof e != "symbol" ? e + "" : e, n);
4
- import { isEmpty as I, cloneDeep as q, set as g, get as _, forOwn as te, isArray as O, isObject as ne, merge as w, isUndefined as F, unset as se, pick as ge, isNull as ae, omitBy as ue, isNil as be, isString as ve, capitalize as _e } from "lodash-es";
5
- import Re, { createContext as Ee, useContext as Te, useMemo as D, useRef as M, useEffect as j, useCallback as Se, forwardRef as Oe, Fragment as je } from "react";
6
- import { useFormContext as Ce, get as Ie, useForm as Ve, FormProvider as we, appendErrors as xe, useController as Pe } from "react-hook-form";
2
+ var ge = (r, e, n) => e in r ? ye(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var x = (r, e, n) => ge(r, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isEmpty as V, cloneDeep as A, set as g, get as E, forOwn as ne, isArray as j, isObject as se, merge as F, isUndefined as k, unset as ae, pick as be, isNull as oe, omitBy as ue, isNil as ve, isString as Ee, capitalize as _e } from "lodash-es";
5
+ import Te, { createContext as Re, useContext as Se, Component as Oe, useMemo as M, useRef as Z, useEffect as C, useCallback as je, forwardRef as Ce, Fragment as Ie } from "react";
6
+ import { useFormContext as Ve, get as we, useForm as xe, FormProvider as Fe, appendErrors as Pe, useController as qe } from "react-hook-form";
7
7
  export * from "react-hook-form";
8
- import * as d from "zod";
9
- import { toNestErrors as qe } from "@hookform/resolvers";
10
- class Fe extends Error {
8
+ import * as l from "zod";
9
+ import { toNestErrors as Ae } from "@hookform/resolvers";
10
+ class ke extends Error {
11
11
  constructor(e) {
12
12
  super(`Input component '${e}' is already registered.`);
13
13
  }
14
14
  }
15
- class oe {
15
+ class ie {
16
16
  constructor(e) {
17
- N(this, "componentBank");
18
- N(this, "allowOverride");
17
+ x(this, "componentBank");
18
+ x(this, "allowOverride");
19
19
  this.allowOverride = (e == null ? void 0 : e.allowOverride) ?? !1, this.componentBank = /* @__PURE__ */ new Map();
20
20
  }
21
21
  /**
@@ -26,11 +26,11 @@ class oe {
26
26
  */
27
27
  registerComponent(e) {
28
28
  if (!this.allowOverride && this.getComponent(e.internalType))
29
- throw new Fe(e.internalType);
29
+ throw new ke(e.internalType);
30
30
  this.componentBank.set(e.internalType, e);
31
31
  }
32
32
  getComponent(e) {
33
- if (e && !I(e))
33
+ if (e && !V(e))
34
34
  return this.componentBank.get(e);
35
35
  }
36
36
  /**
@@ -47,7 +47,7 @@ class oe {
47
47
  * @returns new input factory
48
48
  */
49
49
  clone() {
50
- const e = new oe({
50
+ const e = new ie({
51
51
  allowOverride: this.allowOverride
52
52
  });
53
53
  return this.listRegisteredComponents().forEach((n) => {
@@ -55,16 +55,16 @@ class oe {
55
55
  }), e;
56
56
  }
57
57
  }
58
- var Z = { exports: {} }, S = {};
58
+ var $ = { exports: {} }, O = {};
59
59
  /*
60
60
  object-assign
61
61
  (c) Sindre Sorhus
62
62
  @license MIT
63
63
  */
64
- var B, X;
65
- function Ae() {
66
- if (X) return B;
67
- X = 1;
64
+ var B, Y;
65
+ function Ne() {
66
+ if (Y) return B;
67
+ Y = 1;
68
68
  var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
69
69
  function t(s) {
70
70
  if (s == null)
@@ -78,33 +78,33 @@ function Ae() {
78
78
  var s = new String("abc");
79
79
  if (s[5] = "de", Object.getOwnPropertyNames(s)[0] === "5")
80
80
  return !1;
81
- for (var i = {}, u = 0; u < 10; u++)
82
- i["_" + String.fromCharCode(u)] = u;
83
- var o = Object.getOwnPropertyNames(i).map(function(l) {
84
- return i[l];
81
+ for (var i = {}, o = 0; o < 10; o++)
82
+ i["_" + String.fromCharCode(o)] = o;
83
+ var u = Object.getOwnPropertyNames(i).map(function(f) {
84
+ return i[f];
85
85
  });
86
- if (o.join("") !== "0123456789")
86
+ if (u.join("") !== "0123456789")
87
87
  return !1;
88
88
  var c = {};
89
- return "abcdefghijklmnopqrst".split("").forEach(function(l) {
90
- c[l] = l;
89
+ return "abcdefghijklmnopqrst".split("").forEach(function(f) {
90
+ c[f] = f;
91
91
  }), Object.keys(Object.assign({}, c)).join("") === "abcdefghijklmnopqrst";
92
92
  } catch {
93
93
  return !1;
94
94
  }
95
95
  }
96
96
  return B = a() ? Object.assign : function(s, i) {
97
- for (var u, o = t(s), c, l = 1; l < arguments.length; l++) {
98
- u = Object(arguments[l]);
99
- for (var m in u)
100
- e.call(u, m) && (o[m] = u[m]);
97
+ for (var o, u = t(s), c, f = 1; f < arguments.length; f++) {
98
+ o = Object(arguments[f]);
99
+ for (var m in o)
100
+ e.call(o, m) && (u[m] = o[m]);
101
101
  if (r) {
102
- c = r(u);
103
- for (var f = 0; f < c.length; f++)
104
- n.call(u, c[f]) && (o[c[f]] = u[c[f]]);
102
+ c = r(o);
103
+ for (var d = 0; d < c.length; d++)
104
+ n.call(o, c[d]) && (u[c[d]] = o[c[d]]);
105
105
  }
106
106
  }
107
- return o;
107
+ return u;
108
108
  }, B;
109
109
  }
110
110
  /** @license React v17.0.2
@@ -115,56 +115,76 @@ function Ae() {
115
115
  * This source code is licensed under the MIT license found in the
116
116
  * LICENSE file in the root directory of this source tree.
117
117
  */
118
- var Y;
119
- function ke() {
120
- if (Y) return S;
121
- Y = 1, Ae();
122
- var r = Re, e = 60103;
123
- if (S.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
118
+ var K;
119
+ function De() {
120
+ if (K) return O;
121
+ K = 1, Ne();
122
+ var r = Te, e = 60103;
123
+ if (O.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
124
124
  var n = Symbol.for;
125
- e = n("react.element"), S.Fragment = n("react.fragment");
125
+ e = n("react.element"), O.Fragment = n("react.fragment");
126
126
  }
127
127
  var t = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = Object.prototype.hasOwnProperty, s = { key: !0, ref: !0, __self: !0, __source: !0 };
128
- function i(u, o, c) {
129
- var l, m = {}, f = null, y = null;
130
- c !== void 0 && (f = "" + c), o.key !== void 0 && (f = "" + o.key), o.ref !== void 0 && (y = o.ref);
131
- for (l in o) a.call(o, l) && !s.hasOwnProperty(l) && (m[l] = o[l]);
132
- if (u && u.defaultProps) for (l in o = u.defaultProps, o) m[l] === void 0 && (m[l] = o[l]);
133
- return { $$typeof: e, type: u, key: f, ref: y, props: m, _owner: t.current };
128
+ function i(o, u, c) {
129
+ var f, m = {}, d = null, h = null;
130
+ c !== void 0 && (d = "" + c), u.key !== void 0 && (d = "" + u.key), u.ref !== void 0 && (h = u.ref);
131
+ for (f in u) a.call(u, f) && !s.hasOwnProperty(f) && (m[f] = u[f]);
132
+ if (o && o.defaultProps) for (f in u = o.defaultProps, u) m[f] === void 0 && (m[f] = u[f]);
133
+ return { $$typeof: e, type: o, key: d, ref: h, props: m, _owner: t.current };
134
134
  }
135
- return S.jsx = i, S.jsxs = i, S;
135
+ return O.jsx = i, O.jsxs = i, O;
136
136
  }
137
- var K;
138
- function Ne() {
139
- return K || (K = 1, Z.exports = ke()), Z.exports;
137
+ var z;
138
+ function Me() {
139
+ return z || (z = 1, $.exports = De()), $.exports;
140
140
  }
141
- var h = Ne();
142
- const ie = Ee({});
143
- function De({
141
+ var p = Me();
142
+ const ce = Re({});
143
+ function Ze({
144
144
  children: r,
145
145
  metadata: e,
146
- readonly: n
146
+ inputErrorHandler: n,
147
+ readonly: t
147
148
  }) {
148
- return /* @__PURE__ */ h.jsx(
149
- ie.Provider,
149
+ return /* @__PURE__ */ p.jsx(
150
+ ce.Provider,
150
151
  {
151
152
  value: {
152
153
  metadata: e,
153
- readonly: n
154
+ readonly: t,
155
+ inputErrorHandler: n
154
156
  },
155
157
  children: r
156
158
  }
157
159
  );
158
160
  }
159
- function Me() {
160
- const r = Te(ie);
161
+ function $e() {
162
+ const r = Se(ce);
161
163
  return r || console.warn("useRootFormContext must be used within RootFormProvider"), r;
162
164
  }
163
- const z = ({
165
+ class Be extends Oe {
166
+ constructor() {
167
+ super(...arguments);
168
+ x(this, "state", {
169
+ hasError: !1
170
+ });
171
+ }
172
+ static getDerivedStateFromError() {
173
+ return { hasError: !0 };
174
+ }
175
+ componentDidCatch() {
176
+ const n = new Error(`Form input [${this.props.inputType}] has failed at path [${this.props.path}].`);
177
+ this.props.inputErrorHandler ? this.props.inputErrorHandler(n) : console.error(n);
178
+ }
179
+ render() {
180
+ return this.state.hasError ? /* @__PURE__ */ p.jsx(p.Fragment, {}) : this.props.children;
181
+ }
182
+ }
183
+ const ee = ({
164
184
  children: r,
165
185
  withoutWrapper: e = !1
166
- }) => e || !r ? r : /* @__PURE__ */ h.jsx("div", { children: r });
167
- function Ze({
186
+ }) => e || !r ? r : /* @__PURE__ */ p.jsx("div", { children: r });
187
+ function Je({
168
188
  path: r,
169
189
  factory: e,
170
190
  onUpdate: n,
@@ -173,24 +193,24 @@ function Ze({
173
193
  input: s,
174
194
  withoutWrapper: i = !1
175
195
  }) {
176
- var W;
177
- const { formState: u, watch: o } = Ce(), {
196
+ var H;
197
+ const { formState: o, watch: u } = Ve(), {
178
198
  fixedValues: c = {}
179
199
  /*getValuesWithDependencies*/
180
- } = {}, { metadata: l, readonly: m } = Me(), f = e == null ? void 0 : e.getComponent(s.inputType), y = o(), b = q(y);
181
- c && Object.keys(c).forEach((V) => {
182
- const A = c[V];
183
- g(b, V, A);
200
+ } = {}, { metadata: f, readonly: m, inputErrorHandler: d } = $e(), h = e == null ? void 0 : e.getComponent(s.inputType), b = u(), y = A(b);
201
+ c && Object.keys(c).forEach((w) => {
202
+ const N = c[w];
203
+ g(y, w, N);
184
204
  });
185
- const p = !s.isVisible || s.isVisible(b, l);
186
- let E, R;
187
- p && (E = m || s.readonly, R = typeof s.disabled == "function" ? s.disabled(b, l) : s.disabled);
188
- const T = (W = s.warning) == null ? void 0 : W.schema, v = D(() => {
189
- var H, Q;
190
- if (!p || typeof T > "u") return;
191
- const V = Ie(y, s.path), A = typeof T == "function" ? T(b) : T, { success: he, error: k } = A.safeParse(V), G = (Q = (H = k == null ? void 0 : k.errors) == null ? void 0 : H[0]) == null ? void 0 : Q.message;
192
- return !he && G ? G : void 0;
193
- }, [s.path, y, T, p]), L = D(
205
+ const _ = !s.isVisible || s.isVisible(y, f);
206
+ let T, S;
207
+ _ && (T = m || s.readonly, S = typeof s.disabled == "function" ? s.disabled(y, f) : s.disabled);
208
+ const R = (H = s.warning) == null ? void 0 : H.schema, v = M(() => {
209
+ var Q, X;
210
+ if (!_ || typeof R > "u") return;
211
+ const w = we(b, s.path), N = typeof R == "function" ? R(y) : R, { success: pe, error: D } = N.safeParse(w), G = (X = (Q = D == null ? void 0 : D.errors) == null ? void 0 : Q[0]) == null ? void 0 : X.message;
212
+ return !pe && G ? G : void 0;
213
+ }, [s.path, b, R, _]), W = M(
194
214
  () => ({
195
215
  path: r,
196
216
  key: r,
@@ -198,29 +218,29 @@ function Ze({
198
218
  onUpdate: n,
199
219
  onChange: t,
200
220
  factory: e,
201
- readonly: E,
221
+ readonly: T,
202
222
  input: s,
203
- disabled: R,
223
+ disabled: S,
204
224
  warning: v
205
225
  }),
206
- [e, a, s, t, n, r, E, u.errors, R, v]
207
- ), me = D(() => p ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
226
+ [e, a, s, t, n, r, T, o.errors, S, v]
227
+ ), he = M(() => _ ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
208
228
  s.before ? s.before : null,
209
- f == null ? void 0 : f.renderComponent(L),
229
+ /* @__PURE__ */ p.jsx(Be, { path: r, inputType: s.inputType, inputErrorHandler: d, children: h == null ? void 0 : h.renderComponent(W) }),
210
230
  s.after ? s.after : null
211
- ] }) : null, [L, s.after, s.before, f, p, u.errors]);
212
- return f ? /* @__PURE__ */ h.jsx(z, { withoutWrapper: i, children: me }) : /* @__PURE__ */ h.jsx(z, { withoutWrapper: i, children: /* @__PURE__ */ h.jsxs("p", { children: [
231
+ ] }) : null, [_, s.before, s.inputType, s.after, r, h, W, o.errors]);
232
+ return h ? /* @__PURE__ */ p.jsx(ee, { withoutWrapper: i, children: he }) : /* @__PURE__ */ p.jsx(ee, { withoutWrapper: i, children: /* @__PURE__ */ p.jsxs("p", { children: [
213
233
  "Input component not found (internal type: ",
214
234
  s.inputType,
215
235
  ")"
216
236
  ] }) });
217
237
  }
218
- class ur {
238
+ class cr {
219
239
  getType() {
220
240
  return this.internalType;
221
241
  }
222
242
  }
223
- function or(r) {
243
+ function fr(r) {
224
244
  const {
225
245
  mode: e = "onSubmit",
226
246
  resolver: n,
@@ -229,27 +249,28 @@ function or(r) {
229
249
  // validateAfterFirstSubmit,
230
250
  onValuesChange: s,
231
251
  onValidationChange: i,
232
- onSubmit: u,
252
+ onSubmit: o,
253
+ onInputRenderError: u,
233
254
  // validate,
234
255
  // validateDebounceInterval,
235
256
  // validationConfig,
236
- metadata: o,
237
- children: c,
257
+ metadata: c,
258
+ children: f,
238
259
  // fixedValues
239
- autoFocusPath: l,
240
- readonly: m
241
- } = r, f = Ve({
260
+ autoFocusPath: m,
261
+ readonly: d
262
+ } = r, h = xe({
242
263
  mode: e ?? "onSubmit",
243
264
  reValidateMode: "onChange",
244
265
  defaultValues: t,
245
266
  shouldFocusError: a,
246
267
  resolver: n
247
- }), y = M(!1);
248
- j(() => {
249
- f.reset(t, {});
250
- }, [f.reset, t]), j(() => {
268
+ }), b = Z(!1);
269
+ C(() => {
270
+ h.reset(t, {});
271
+ }, [h.reset, t]), C(() => {
251
272
  const v = requestIdleCallback(() => {
252
- f.reset({}, {
273
+ h.reset({}, {
253
274
  keepErrors: !0,
254
275
  keepDirty: !0,
255
276
  keepDirtyValues: !0,
@@ -264,121 +285,121 @@ function or(r) {
264
285
  });
265
286
  return () => cancelIdleCallback(v);
266
287
  }, []);
267
- const { getValues: b, handleSubmit: p } = f, E = b(), R = M(!0);
268
- j(() => {
269
- if (R.current) {
270
- R.current = !1;
288
+ const { getValues: y, handleSubmit: _ } = h, T = y(), S = Z(!0);
289
+ C(() => {
290
+ if (S.current) {
291
+ S.current = !1;
271
292
  return;
272
293
  }
273
- s == null || s({ ...E }), y.current === !0 && f.trigger();
274
- }, [JSON.stringify(E)]);
275
- const T = M(!0);
276
- return j(() => {
277
- if (T.current) {
278
- T.current = !1;
294
+ s == null || s({ ...T }), b.current === !0 && h.trigger();
295
+ }, [JSON.stringify(T)]);
296
+ const R = Z(!0);
297
+ return C(() => {
298
+ if (R.current) {
299
+ R.current = !1;
279
300
  return;
280
301
  }
281
- i == null || i({ isValid: f.formState.isValid, isSubmitted: f.formState.isSubmitted });
282
- }, [f.formState.isValid, f.formState.isSubmitted]), j(() => {
283
- if (l)
302
+ i == null || i({ isValid: h.formState.isValid, isSubmitted: h.formState.isSubmitted });
303
+ }, [h.formState.isValid, h.formState.isSubmitted]), C(() => {
304
+ if (m)
284
305
  if ("requestIdleCallback" in window) {
285
306
  const v = requestIdleCallback(() => {
286
- f.setFocus(l);
307
+ h.setFocus(m);
287
308
  });
288
309
  return () => cancelIdleCallback(v);
289
310
  } else {
290
311
  const v = setTimeout(() => {
291
- f.setFocus(l);
312
+ h.setFocus(m);
292
313
  }, 100);
293
314
  return () => clearTimeout(v);
294
315
  }
295
- }, [f]), /* @__PURE__ */ h.jsx(De, { metadata: o, readonly: m, children: /* @__PURE__ */ h.jsx(we, { ...f, children: typeof c == "function" ? c({
296
- ...f,
316
+ }, [h]), /* @__PURE__ */ p.jsx(Ze, { metadata: c, readonly: d, inputErrorHandler: u, children: /* @__PURE__ */ p.jsx(Fe, { ...h, children: typeof f == "function" ? f({
317
+ ...h,
297
318
  submitForm: async () => {
298
- u && (y.current = !0, p((v) => {
299
- u(v);
319
+ o && (b.current = !0, _((v) => {
320
+ o(v);
300
321
  })());
301
322
  }
302
- }) : c }) });
323
+ }) : f }) });
303
324
  }
304
- const ir = (r) => {
325
+ const lr = (r) => {
305
326
  const e = {}, n = (t) => {
306
327
  t.forEach((a) => {
307
- const { path: s, default: i, inputType: u, inputs: o } = a;
308
- (u === "group" || u === "accordion") && Array.isArray(o) ? n(o) : _(e, s) === void 0 && g(e, s, i);
328
+ const { path: s, default: i, inputType: o, inputs: u } = a;
329
+ (o === "group" || o === "accordion") && Array.isArray(u) ? n(u) : E(e, s) === void 0 && g(e, s, i);
309
330
  });
310
331
  };
311
332
  return Array.isArray(r.inputs) && n(r.inputs), e;
312
333
  };
313
- function cr(r, e) {
334
+ function dr(r, e) {
314
335
  const n = r.inputs.map((t) => {
315
- const a = Be(e, t.path);
336
+ const a = Ue(e, t.path);
316
337
  return a || t;
317
338
  });
318
339
  return { ...r, inputs: n };
319
340
  }
320
- function Be(r, e) {
341
+ function Ue(r, e) {
321
342
  return r.inputs.find((n) => n.path === e);
322
343
  }
323
- const ce = "__temp_", fr = (r) => ce + r.split(".").join("__");
324
- function $e(r) {
344
+ const fe = "__temp_", mr = (r) => fe + r.split(".").join("__");
345
+ function Le(r) {
325
346
  const e = { ...r };
326
- return te(e, (n, t) => {
327
- t.startsWith(ce) && delete e[t];
347
+ return ne(e, (n, t) => {
348
+ t.startsWith(fe) && delete e[t];
328
349
  }), e;
329
350
  }
330
- const Je = "Required field";
331
- function C(r) {
351
+ const We = "Required field";
352
+ function I(r) {
332
353
  const e = typeof r == "string" ? JSON.parse(r) : r;
333
354
  if (typeof e == "string")
334
355
  return e;
335
- if (O(e))
336
- return C(e[0]);
356
+ if (j(e))
357
+ return I(e[0]);
337
358
  const n = e;
338
- return ne(n) && (n != null && n.message) ? e == null ? void 0 : e.message : "Unknown error";
359
+ return se(n) && (n != null && n.message) ? e == null ? void 0 : e.message : "Unknown error";
339
360
  }
340
- function Ue(r, e, n) {
361
+ function He(r, e, n) {
341
362
  let t = {};
342
- if (P(t, r.inputs, e, n), n != null && n.prefix) {
363
+ if (q(t, r.inputs, e, n), n != null && n.prefix) {
343
364
  const s = n == null ? void 0 : n.prefix.replace(/.$/, "");
344
365
  t = g({}, s, t);
345
366
  }
346
- return d.object(x(t, e, n));
367
+ return l.object(P(t, e, n));
347
368
  }
348
- function x(r, e, n) {
369
+ function P(r, e, n) {
349
370
  const t = {};
350
371
  return Object.keys(r).forEach((a) => {
351
372
  const {
352
373
  _requiredOnly: s,
353
374
  _schemaObj: i,
354
- _input: u,
355
- _isList: o,
375
+ _input: o,
376
+ _isList: u,
356
377
  _isArrayItem: c,
357
- _schema: l
378
+ _schema: f
358
379
  /*...nestedSchemaObj*/
359
380
  } = r[a];
360
- if (o && i && u) {
361
- const m = d.array(d.object(x(i, e, n))).optional(), f = ee(l, u, e, n, m);
362
- t[a] = f;
363
- } else if (c && u) {
364
- const m = i != null && i.___array ? x({ ___array: i.___array }, e, n) : { ___array: d.any() }, f = Le(m, u, n), y = ee(l, u, e, n, f);
365
- t[a] = y;
366
- } else if (l && u) {
367
- const m = We(l, u, e, n);
381
+ if (u && i && o) {
382
+ const m = l.array(l.object(P(i, e, n))).optional(), d = re(f, o, e, n, m);
383
+ t[a] = d;
384
+ } else if (c && o) {
385
+ const m = i != null && i.___array ? P({ ___array: i.___array }, e, n) : { ___array: l.any() }, d = Ge(m, o, n), h = re(f, o, e, n, d);
386
+ t[a] = h;
387
+ } else if (f && o) {
388
+ const m = Qe(f, o, e, n);
368
389
  t[a] = m;
369
- } else s && u ? t[a] = J(u, n) : t[a] = d.object(x(r[a], e, n)).optional();
390
+ } else s && o ? t[a] = U(o, n) : t[a] = l.object(P(r[a], e, n)).optional();
370
391
  }), t;
371
392
  }
372
- function Le(r, e, n) {
373
- return d.union([
374
- d.array(r.___array).optional(),
375
- d.string().superRefine((t, a) => {
393
+ function Ge(r, e, n) {
394
+ return l.union([
395
+ l.array(r.___array).optional(),
396
+ l.string().superRefine((t, a) => {
376
397
  var s;
377
398
  if ((s = n == null ? void 0 : n.validationConfig) != null && s.globalValidation) {
378
399
  const i = n.validationConfig.globalValidation(t, e, n.metadata);
379
400
  if (i.error)
380
401
  return a.addIssue({
381
- code: d.ZodIssueCode.custom,
402
+ code: l.ZodIssueCode.custom,
382
403
  message: i.error
383
404
  }), !1;
384
405
  if (!i.continue)
@@ -388,113 +409,113 @@ function Le(r, e, n) {
388
409
  })
389
410
  ]);
390
411
  }
391
- function We(r, e, n, t) {
392
- return d.any().optional().superRefine(async (a, s) => {
393
- var u, o;
394
- if (e.required && !(await J(e, t).safeParseAsync(a)).success)
412
+ function Qe(r, e, n, t) {
413
+ return l.any().optional().superRefine(async (a, s) => {
414
+ var o, u;
415
+ if (e.required && !(await U(e, t).safeParseAsync(a)).success)
395
416
  return s.addIssue({
396
- code: d.ZodIssueCode.custom,
397
- message: $(e, t)
398
- }), d.NEVER;
399
- if ((u = t == null ? void 0 : t.validationConfig) != null && u.globalValidation) {
400
- const c = (o = t == null ? void 0 : t.validationConfig) == null ? void 0 : o.globalValidation(a, e, t.metadata);
417
+ code: l.ZodIssueCode.custom,
418
+ message: J(e, t)
419
+ }), l.NEVER;
420
+ if ((o = t == null ? void 0 : t.validationConfig) != null && o.globalValidation) {
421
+ const c = (u = t == null ? void 0 : t.validationConfig) == null ? void 0 : u.globalValidation(a, e, t.metadata);
401
422
  if (c.error)
402
423
  return s.addIssue({
403
- code: d.ZodIssueCode.custom,
424
+ code: l.ZodIssueCode.custom,
404
425
  message: c.error
405
- }), d.NEVER;
426
+ }), l.NEVER;
406
427
  if (!c.continue)
407
428
  return !0;
408
429
  }
409
- const i = fe(r, n);
430
+ const i = le(r, n);
410
431
  if (i) {
411
432
  const c = await i.safeParseAsync(a);
412
433
  if (!c.success) {
413
- const l = C(c == null ? void 0 : c.error.message), m = l === "Required" ? $(e, t) : l;
434
+ const f = I(c == null ? void 0 : c.error.message), m = f === "Required" ? J(e, t) : f;
414
435
  s.addIssue({
415
- code: d.ZodIssueCode.custom,
436
+ code: l.ZodIssueCode.custom,
416
437
  message: m
417
438
  });
418
439
  }
419
440
  }
420
441
  });
421
442
  }
422
- function ee(r, e, n, t, a) {
423
- return d.any().optional().superRefine(async (s, i) => {
424
- var l, m;
425
- const o = await J(e, t).safeParseAsync(s);
426
- if (e.required && !o.success) {
427
- const f = C(o.error.message);
428
- return i.addIssue({ code: d.ZodIssueCode.custom, message: f, fatal: !0 }), d.NEVER;
443
+ function re(r, e, n, t, a) {
444
+ return l.any().optional().superRefine(async (s, i) => {
445
+ var f, m;
446
+ const u = await U(e, t).safeParseAsync(s);
447
+ if (e.required && !u.success) {
448
+ const d = I(u.error.message);
449
+ return i.addIssue({ code: l.ZodIssueCode.custom, message: d, fatal: !0 }), l.NEVER;
429
450
  }
430
- if (!e.required && !o.success)
431
- return d.NEVER;
432
- if ((l = t == null ? void 0 : t.validationConfig) != null && l.globalValidation) {
433
- const f = (m = t == null ? void 0 : t.validationConfig) == null ? void 0 : m.globalValidation(s, e, t.metadata);
434
- if (f.error)
451
+ if (!e.required && !u.success)
452
+ return l.NEVER;
453
+ if ((f = t == null ? void 0 : t.validationConfig) != null && f.globalValidation) {
454
+ const d = (m = t == null ? void 0 : t.validationConfig) == null ? void 0 : m.globalValidation(s, e, t.metadata);
455
+ if (d.error)
435
456
  return i.addIssue({
436
- code: d.ZodIssueCode.custom,
437
- message: C(f.error)
438
- }), d.NEVER;
439
- if (!f.continue)
440
- return d.NEVER;
457
+ code: l.ZodIssueCode.custom,
458
+ message: I(d.error)
459
+ }), l.NEVER;
460
+ if (!d.continue)
461
+ return l.NEVER;
441
462
  }
442
- if (!O(s))
463
+ if (!j(s))
443
464
  return i.addIssue({
444
- code: d.ZodIssueCode.custom,
465
+ code: l.ZodIssueCode.custom,
445
466
  message: "'Value is not array'"
446
- }), d.NEVER;
447
- const c = fe(r, n);
467
+ }), l.NEVER;
468
+ const c = le(r, n);
448
469
  if (c) {
449
- const f = await c.safeParseAsync(s);
450
- if (!f.success)
470
+ const d = await c.safeParseAsync(s);
471
+ if (!d.success)
451
472
  return i.addIssue({
452
- code: d.ZodIssueCode.custom,
453
- message: C(f.error.message)
454
- }), d.NEVER;
473
+ code: l.ZodIssueCode.custom,
474
+ message: I(d.error.message)
475
+ }), l.NEVER;
455
476
  }
456
- }).pipe(a ?? d.any());
477
+ }).pipe(a ?? l.any());
457
478
  }
458
- function P(r, e, n, t, a) {
479
+ function q(r, e, n, t, a) {
459
480
  e.forEach((s) => {
460
- var u, o, c, l, m, f, y;
481
+ var o, u, c, f, m, d, h;
461
482
  const i = n;
462
- if (!s.isVisible || (u = s.isVisible) != null && u.call(s, i, t == null ? void 0 : t.metadata)) {
463
- const b = _(r, s.path);
464
- if ((o = s.validation) != null && o.schema ? g(
483
+ if (!s.isVisible || (o = s.isVisible) != null && o.call(s, i, t == null ? void 0 : t.metadata)) {
484
+ const b = E(r, s.path);
485
+ if ((u = s.validation) != null && u.schema ? g(
465
486
  r,
466
487
  s.path,
467
- w(b, {
488
+ F(b, {
468
489
  _schema: (c = s.validation) == null ? void 0 : c.schema,
469
490
  _input: s
470
491
  })
471
- ) : s.required && g(r, s.path, w(b, { _requiredOnly: !0, _input: s })), s.inputs && P(r, s.inputs, n, t), s.inputType === "list") {
472
- const p = {};
473
- P(
474
- p,
475
- (m = (l = s.inputConfig) == null ? void 0 : l.inputs) == null ? void 0 : m.map((R) => ({
476
- ...R,
477
- path: R.relativePath
492
+ ) : s.required && g(r, s.path, F(b, { _requiredOnly: !0, _input: s })), s.inputs && q(r, s.inputs, n, t), s.inputType === "list") {
493
+ const y = {};
494
+ q(
495
+ y,
496
+ (m = (f = s.inputConfig) == null ? void 0 : f.inputs) == null ? void 0 : m.map((T) => ({
497
+ ...T,
498
+ path: T.relativePath
478
499
  })),
479
500
  n,
480
501
  t
481
502
  );
482
- const E = _(r, s.path);
483
- g(r, s.path, w(E, { _schemaObj: p, _isList: !0, _input: s }));
503
+ const _ = E(r, s.path);
504
+ g(r, s.path, F(_, { _schemaObj: y, _isList: !0, _input: s }));
484
505
  }
485
- if (!((f = s.validation) != null && f.schema) && s.inputType === "array") {
486
- const p = {};
487
- P(
488
- p,
506
+ if (!((d = s.validation) != null && d.schema) && s.inputType === "array") {
507
+ const y = {};
508
+ q(
509
+ y,
489
510
  [{ ...s.inputConfig.input, path: "___array" }],
490
511
  n,
491
512
  t
492
513
  ), g(
493
514
  r,
494
515
  s.path,
495
- w(b, {
496
- _schemaObj: p,
497
- _schema: (y = s.validation) == null ? void 0 : y.schema,
516
+ F(b, {
517
+ _schemaObj: y,
518
+ _schema: (h = s.validation) == null ? void 0 : h.schema,
498
519
  _isArrayItem: !0,
499
520
  _input: s
500
521
  })
@@ -503,51 +524,51 @@ function P(r, e, n, t, a) {
503
524
  }
504
525
  });
505
526
  }
506
- function $(r, e) {
527
+ function J(r, e) {
507
528
  var n, t, a;
508
- return ((t = (n = e == null ? void 0 : e.validationConfig) == null ? void 0 : n.requiredMessagePerInput) == null ? void 0 : t[r.inputType]) ?? ((a = e == null ? void 0 : e.validationConfig) == null ? void 0 : a.requiredMessage) ?? Je;
529
+ return ((t = (n = e == null ? void 0 : e.validationConfig) == null ? void 0 : n.requiredMessagePerInput) == null ? void 0 : t[r.inputType]) ?? ((a = e == null ? void 0 : e.validationConfig) == null ? void 0 : a.requiredMessage) ?? We;
509
530
  }
510
- function J(r, e) {
511
- var t, a, s, i, u, o;
531
+ function U(r, e) {
532
+ var t, a, s, i, o, u;
512
533
  if ((a = (t = e == null ? void 0 : e.validationConfig) == null ? void 0 : t.requiredSchemaPerInput) != null && a[r.inputType])
513
534
  return (i = (s = e == null ? void 0 : e.validationConfig) == null ? void 0 : s.requiredSchemaPerInput) == null ? void 0 : i[r.inputType];
514
- if ((u = e == null ? void 0 : e.validationConfig) != null && u.requiredSchema)
515
- return (o = e == null ? void 0 : e.validationConfig) == null ? void 0 : o.requiredSchema;
516
- const n = $(r, e);
517
- return d.any().optional().superRefine((c, l) => {
518
- typeof c == "object" && I(c) && l.addIssue({
519
- code: d.ZodIssueCode.custom,
535
+ if ((o = e == null ? void 0 : e.validationConfig) != null && o.requiredSchema)
536
+ return (u = e == null ? void 0 : e.validationConfig) == null ? void 0 : u.requiredSchema;
537
+ const n = J(r, e);
538
+ return l.any().optional().superRefine((c, f) => {
539
+ typeof c == "object" && V(c) && f.addIssue({
540
+ code: l.ZodIssueCode.custom,
520
541
  message: n
521
- }), (F(c) || c === "") && l.addIssue({
522
- code: d.ZodIssueCode.custom,
542
+ }), (k(c) || c === "") && f.addIssue({
543
+ code: l.ZodIssueCode.custom,
523
544
  message: n
524
545
  });
525
546
  });
526
547
  }
527
- function fe(r, e) {
528
- if (r instanceof d.ZodType)
548
+ function le(r, e) {
549
+ if (r instanceof l.ZodType)
529
550
  return r;
530
551
  if (typeof r == "function")
531
552
  return r(e);
532
553
  }
533
- const Ge = (r) => Array.isArray(r == null ? void 0 : r.errors), He = (r, e) => {
554
+ const Xe = (r) => Array.isArray(r == null ? void 0 : r.errors), Ye = (r, e) => {
534
555
  const n = {};
535
556
  for (; r.length; ) {
536
- const t = r[0], { code: a, message: s, path: i } = t, u = i.join(".");
537
- if (!n[u])
557
+ const t = r[0], { code: a, message: s, path: i } = t, o = i.join(".");
558
+ if (!n[o])
538
559
  if ("unionErrors" in t) {
539
- const o = t.unionErrors[0].errors[0];
540
- n[u] = {
541
- message: o.message,
542
- type: o.code
560
+ const u = t.unionErrors[0].errors[0];
561
+ n[o] = {
562
+ message: u.message,
563
+ type: u.code
543
564
  };
544
565
  } else
545
- n[u] = { message: s, type: a };
546
- "unionErrors" in t && t.unionErrors.forEach((o) => o.errors.forEach((c) => r.push(c)));
566
+ n[o] = { message: s, type: a };
567
+ "unionErrors" in t && t.unionErrors.forEach((u) => u.errors.forEach((c) => r.push(c)));
547
568
  {
548
- const o = n[u].types, c = o && o[t.code];
549
- n[u] = xe(
550
- u,
569
+ const u = n[o].types, c = u && u[t.code];
570
+ n[o] = Pe(
571
+ o,
551
572
  e,
552
573
  n,
553
574
  a,
@@ -558,20 +579,20 @@ const Ge = (r) => Array.isArray(r == null ? void 0 : r.errors), He = (r, e) => {
558
579
  }
559
580
  return n;
560
581
  };
561
- function lr(r, e) {
562
- return Se(
582
+ function hr(r, e) {
583
+ return je(
563
584
  async (n, t, a) => {
564
585
  try {
565
- return await Ue(r, n, e).parseAsync(n), {
586
+ return await He(r, n, e).parseAsync(n), {
566
587
  values: n,
567
588
  // TODO: check this - values does not contains all data
568
589
  errors: {}
569
590
  };
570
591
  } catch (s) {
571
- if (Ge(s))
592
+ if (Xe(s))
572
593
  return {
573
594
  values: {},
574
- errors: qe(He(s.errors, !0), a)
595
+ errors: Ae(Ye(s.errors, !0), a)
575
596
  };
576
597
  throw s;
577
598
  }
@@ -579,65 +600,65 @@ function lr(r, e) {
579
600
  [r]
580
601
  );
581
602
  }
582
- function Qe(r, e) {
583
- const n = q(r);
603
+ function Ke(r, e) {
604
+ const n = A(r);
584
605
  return e.forEach((t) => {
585
- t.inputTransform && (O(t.inputTransform) ? t.inputTransform : [t.inputTransform]).forEach((s) => {
586
- const i = _(n, t.path), u = s(i, n);
587
- u && g(n, u.path ?? t.path, u.value);
606
+ t.inputTransform && (j(t.inputTransform) ? t.inputTransform : [t.inputTransform]).forEach((s) => {
607
+ const i = E(n, t.path), o = s(i, n);
608
+ o && g(n, o.path ?? t.path, o.value);
588
609
  });
589
610
  }), n;
590
611
  }
591
- function Xe(r, e) {
592
- const n = [], t = q(r);
612
+ function ze(r, e) {
613
+ const n = [], t = A(r);
593
614
  return e.forEach((a) => {
594
- a.outputTransform && (O(a.outputTransform) ? a.outputTransform : [a.outputTransform]).forEach((i) => {
595
- const u = _(t, a.path), o = i(u, t);
596
- o && (o.path ? (g(t, o.path, o.value), o.unset && n.push(a.path)) : g(t, a.path, o.value));
615
+ a.outputTransform && (j(a.outputTransform) ? a.outputTransform : [a.outputTransform]).forEach((i) => {
616
+ const o = E(t, a.path), u = i(o, t);
617
+ u && (u.path ? (g(t, u.path, u.value), u.unset && n.push(a.path)) : g(t, a.path, u.value));
597
618
  });
598
619
  }), n.forEach((a) => {
599
- se(t, a);
620
+ ae(t, a);
600
621
  }), t;
601
622
  }
602
- function U(r) {
603
- return r.reduce((n, t) => (t.inputType === "group" || t.inputType === "accordion") && t.inputs ? [...n, t, ...U(t.inputs)] : [...n, t], []);
623
+ function L(r) {
624
+ return r.reduce((n, t) => (t.inputType === "group" || t.inputType === "accordion") && t.inputs ? [...n, t, ...L(t.inputs)] : [...n, t], []);
604
625
  }
605
- function le(r) {
606
- const n = U(r.inputs).reduce((t, a) => {
626
+ function de(r) {
627
+ const n = L(r.inputs).reduce((t, a) => {
607
628
  const s = a.inputType === "text" || a.inputType === "boolean" || a.inputType === "number" || a.inputType === "textarea" || a.inputType === "select";
608
629
  return (a.inputTransform || a.outputTransform) && t.push({
609
- ...ge(a, "path", "inputTransform", "outputTransform"),
630
+ ...be(a, "path", "inputTransform", "outputTransform"),
610
631
  level: a.path.split(".").length,
611
632
  isPrimitive: s
612
633
  }), t;
613
634
  }, []);
614
635
  return n.sort((t, a) => t.level === a.level ? t.isPrimitive ? 1 : -1 : t.level > a.level ? -1 : 1), n;
615
636
  }
616
- function Ye(r, e, n, t = {}) {
617
- const { preserve: a } = t, s = U(r.inputs), i = q(e);
618
- return s.forEach((u) => {
619
- a && a.includes(u.path) || u.isVisible && !u.isVisible(e, n) && se(i, u.path);
637
+ function er(r, e, n, t = {}) {
638
+ const { preserve: a } = t, s = L(r.inputs), i = A(e);
639
+ return s.forEach((o) => {
640
+ a && a.includes(o.path) || o.isVisible && !o.isVisible(e, n) && ae(i, o.path);
620
641
  }), i;
621
642
  }
622
- function dr(r, e) {
623
- const n = le(e);
624
- return Qe(r, n);
643
+ function pr(r, e) {
644
+ const n = de(e);
645
+ return Ke(r, n);
625
646
  }
626
- function mr(r, e, n, t = {}) {
627
- const a = le(e);
628
- let s = Ye(e, r, n, t);
629
- return s = Xe(s, a), s = $e(s), s;
647
+ function yr(r, e, n, t = {}) {
648
+ const a = de(e);
649
+ let s = er(e, r, n, t);
650
+ return s = ze(s, a), s = Le(s), s;
630
651
  }
631
- function hr(r) {
652
+ function gr(r) {
632
653
  const e = {}, n = (t) => {
633
654
  t.forEach((a) => {
634
- const { default: s, path: i, inputType: u, inputs: o } = a;
635
- (u === "group" || u === "accordion") && Array.isArray(o) ? n(o) : s !== void 0 && g(e, i, s);
655
+ const { default: s, path: i, inputType: o, inputs: u } = a;
656
+ (o === "group" || o === "accordion") && Array.isArray(u) ? n(u) : s !== void 0 && g(e, i, s);
636
657
  });
637
658
  };
638
659
  return Array.isArray(r.inputs) && n(r.inputs), e;
639
660
  }
640
- function yr() {
661
+ function br() {
641
662
  return function(r, e) {
642
663
  if (!(typeof r > "u"))
643
664
  return r ? {
@@ -645,7 +666,7 @@ function yr() {
645
666
  } : { value: r };
646
667
  };
647
668
  }
648
- function pr(r) {
669
+ function vr(r) {
649
670
  return function(e, n) {
650
671
  if (typeof e > "u") return;
651
672
  if (!e) return { value: e };
@@ -655,64 +676,64 @@ function pr(r) {
655
676
  return r != null && r.unsetIfEmpty && Object.getOwnPropertyNames(t.value).length === 0 ? { value: void 0 } : t;
656
677
  };
657
678
  }
658
- function gr() {
679
+ function Er() {
659
680
  return function(r, e) {
660
681
  if (!(typeof r > "u"))
661
- return O(r) && I(r) ? { value: void 0 } : { value: r };
682
+ return j(r) && V(r) ? { value: void 0 } : { value: r };
662
683
  };
663
684
  }
664
- function br(r) {
685
+ function _r(r) {
665
686
  return function(e, n) {
666
- const t = r ? _(n, r) : e;
687
+ const t = r ? E(n, r) : e;
667
688
  if (!(typeof t > "u")) {
668
- if (ae(t)) return { value: void 0, path: r };
669
- if (ne(t)) {
670
- const a = ue(t, be);
671
- if (I(a))
689
+ if (oe(t)) return { value: void 0, path: r };
690
+ if (se(t)) {
691
+ const a = ue(t, ve);
692
+ if (V(a))
672
693
  return { value: void 0, path: r };
673
694
  }
674
695
  return { value: t, path: r };
675
696
  }
676
697
  };
677
698
  }
678
- function vr() {
699
+ function Tr() {
679
700
  return function(r, e) {
680
701
  if (!(typeof r > "u"))
681
- return ve(r) && I(r) ? { value: void 0 } : { value: r };
702
+ return Ee(r) && V(r) ? { value: void 0 } : { value: r };
682
703
  };
683
704
  }
684
- function _r(r) {
705
+ function Rr(r) {
685
706
  return function(e, n) {
686
- const t = _(n, r);
707
+ const t = E(n, r);
687
708
  return typeof t == "string" ? { value: t } : { value: e };
688
709
  };
689
710
  }
690
- function Rr(r) {
711
+ function Sr(r) {
691
712
  return function(e, n) {
692
713
  if (typeof e > "u") return;
693
714
  if (!e) return { value: e };
694
- const t = _(n, r);
715
+ const t = E(n, r);
695
716
  if (typeof t == "object") {
696
- const a = Ke(t);
717
+ const a = rr(t);
697
718
  if (Object.getOwnPropertyNames(a).length === 1)
698
719
  return { value: e, path: r };
699
720
  }
700
721
  return { value: e };
701
722
  };
702
723
  }
703
- function Er(r) {
724
+ function Or(r) {
704
725
  return function(e, n) {
705
726
  if (typeof e > "u") return;
706
- const t = _(n, r);
727
+ const t = E(n, r);
707
728
  return typeof t == "string" ? { value: [t] } : { value: e };
708
729
  };
709
730
  }
710
- function Tr(r, e) {
731
+ function jr(r, e) {
711
732
  return function(n, t) {
712
733
  if (typeof n > "u") return;
713
734
  if (!n) return { value: n };
714
- const a = _(t, r);
715
- if (O(a)) {
735
+ const a = E(t, r);
736
+ if (j(a)) {
716
737
  if (a.length === 1)
717
738
  return { value: a[0], path: r };
718
739
  if (a.length === 0 && e != null && e.unsetIfEmpty)
@@ -721,16 +742,16 @@ function Tr(r, e) {
721
742
  return { value: n };
722
743
  };
723
744
  }
724
- function de(r) {
725
- return typeof r == "object" ? !Object.getOwnPropertyNames(r).some((e) => !de(r[e])) : F(r);
745
+ function me(r) {
746
+ return typeof r == "object" ? !Object.getOwnPropertyNames(r).some((e) => !me(r[e])) : k(r);
726
747
  }
727
- function Ke(r) {
728
- return ue(r, (e) => typeof e == "object" ? de(e) : F(e));
748
+ function rr(r) {
749
+ return ue(r, (e) => typeof e == "object" ? me(e) : k(e));
729
750
  }
730
- function re(r) {
751
+ function te(r) {
731
752
  const { items: e, ...n } = r;
732
- return /* @__PURE__ */ h.jsx(h.Fragment, { children: e.map((t) => /* @__PURE__ */ h.jsx(
733
- Ze,
753
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: e.map((t) => /* @__PURE__ */ p.jsx(
754
+ Je,
734
755
  {
735
756
  input: t,
736
757
  path: t.path,
@@ -739,24 +760,24 @@ function re(r) {
739
760
  `${t.inputType}_${t.path}_${t.label}`
740
761
  )) });
741
762
  }
742
- const ze = Oe((r, e) => {
763
+ const tr = Ce((r, e) => {
743
764
  const { inputs: n, className: t, factory: a, withoutWrapper: s } = r;
744
- return s ? /* @__PURE__ */ h.jsxs(je, { children: [
765
+ return s ? /* @__PURE__ */ p.jsxs(Ie, { children: [
745
766
  n.hero,
746
- /* @__PURE__ */ h.jsx(re, { items: n.inputs, factory: a, withoutWrapper: s })
747
- ] }) : /* @__PURE__ */ h.jsxs("div", { className: t, ref: e, children: [
767
+ /* @__PURE__ */ p.jsx(te, { items: n.inputs, factory: a, withoutWrapper: s })
768
+ ] }) : /* @__PURE__ */ p.jsxs("div", { className: t, ref: e, children: [
748
769
  n.hero,
749
- /* @__PURE__ */ h.jsx(re, { items: n.inputs, factory: a, withoutWrapper: s })
770
+ /* @__PURE__ */ p.jsx(te, { items: n.inputs, factory: a, withoutWrapper: s })
750
771
  ] });
751
772
  });
752
- ze.displayName = "RenderForm";
753
- function Sr(r) {
773
+ tr.displayName = "RenderForm";
774
+ function Cr(r) {
754
775
  let e = !0;
755
- return te(r, (n) => {
756
- e = e && (n === "" || ae(n) || F(n));
776
+ return ne(r, (n) => {
777
+ e = e && (n === "" || oe(n) || k(n));
757
778
  }), e;
758
779
  }
759
- const Or = (r = "") => _e(r.split("_").join(" ")), er = (r, e = 2) => {
780
+ const Ir = (r = "") => _e(r.split("_").join(" ")), nr = (r, e = 2) => {
760
781
  let n = !1;
761
782
  const t = () => {
762
783
  requestAnimationFrame(() => {
@@ -767,54 +788,54 @@ const Or = (r = "") => _e(r.split("_").join(" ")), er = (r, e = 2) => {
767
788
  n = !0;
768
789
  };
769
790
  };
770
- function jr(r) {
791
+ function Vr(r) {
771
792
  const {
772
793
  field: { onBlur: e, ...n },
773
794
  ...t
774
- } = Pe(r);
795
+ } = qe(r);
775
796
  return {
776
797
  ...t,
777
798
  field: {
778
799
  ...n,
779
- onBlur: er(e)
800
+ onBlur: nr(e)
780
801
  }
781
802
  };
782
803
  }
783
804
  export {
784
- ur as InputComponent,
785
- Ze as InputComponentRenderer,
786
- oe as InputFactory,
787
- Fe as InputOverrideError,
788
- ze as RenderForm,
789
- re as RenderInputs,
790
- or as RootForm,
791
- er as afterFrames,
792
- pr as arrayToObjectOutputTransformer,
793
- hr as collectDefaultValues,
794
- dr as convertDataToFormModel,
795
- mr as convertFormModelToData,
796
- Or as generateReadableLabel,
797
- ir as getDefaultValuesFromFormDefinition,
798
- fr as getTemporaryPath,
799
- le as getTransformers,
800
- Ue as getValidationSchema,
801
- Qe as inputTransformValues,
802
- Sr as isChildrenEmpty,
803
- yr as objectToArrayInputTransformer,
804
- Xe as outputTransformValues,
805
- cr as overrideFormDefinition,
806
- C as processValidationParseResponse,
807
- $e as removeTemporaryFieldsValue,
808
- Er as shorthandArrayInputTransformer,
809
- Tr as shorthandArrayOutputTransformer,
810
- _r as shorthandObjectInputTransformer,
811
- Rr as shorthandObjectOutputTransformer,
812
- gr as unsetEmptyArrayOutputTransformer,
813
- br as unsetEmptyObjectOutputTransformer,
814
- vr as unsetEmptyStringOutputTransformer,
815
- Ye as unsetHiddenInputsValues,
816
- jr as useController,
817
- Me as useRootFormContext,
818
- lr as useZodValidationResolver
805
+ cr as InputComponent,
806
+ Je as InputComponentRenderer,
807
+ ie as InputFactory,
808
+ ke as InputOverrideError,
809
+ tr as RenderForm,
810
+ te as RenderInputs,
811
+ fr as RootForm,
812
+ nr as afterFrames,
813
+ vr as arrayToObjectOutputTransformer,
814
+ gr as collectDefaultValues,
815
+ pr as convertDataToFormModel,
816
+ yr as convertFormModelToData,
817
+ Ir as generateReadableLabel,
818
+ lr as getDefaultValuesFromFormDefinition,
819
+ mr as getTemporaryPath,
820
+ de as getTransformers,
821
+ He as getValidationSchema,
822
+ Ke as inputTransformValues,
823
+ Cr as isChildrenEmpty,
824
+ br as objectToArrayInputTransformer,
825
+ ze as outputTransformValues,
826
+ dr as overrideFormDefinition,
827
+ I as processValidationParseResponse,
828
+ Le as removeTemporaryFieldsValue,
829
+ Or as shorthandArrayInputTransformer,
830
+ jr as shorthandArrayOutputTransformer,
831
+ Rr as shorthandObjectInputTransformer,
832
+ Sr as shorthandObjectOutputTransformer,
833
+ Er as unsetEmptyArrayOutputTransformer,
834
+ _r as unsetEmptyObjectOutputTransformer,
835
+ Tr as unsetEmptyStringOutputTransformer,
836
+ er as unsetHiddenInputsValues,
837
+ Vr as useController,
838
+ $e as useRootFormContext,
839
+ hr as useZodValidationResolver
819
840
  };
820
841
  //# sourceMappingURL=index.js.map