laif-ds 0.2.25 → 0.2.27

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,73 +1,73 @@
1
1
  "use client";
2
2
  import o from "react";
3
- var W = (e) => e.type === "checkbox", v = (e) => e instanceof Date, x = (e) => e == null;
4
- const D = (e) => typeof e == "object";
5
- var g = (e) => !x(e) && !Array.isArray(e) && D(e) && !v(e), G = (e) => g(e) && e.target ? W(e.target) ? e.target.checked : e.target.value : e, $ = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, q = (e, s) => e.has($(s)), K = (e) => {
3
+ var $ = (e) => e.type === "checkbox", b = (e) => e instanceof Date, E = (e) => e == null;
4
+ const B = (e) => typeof e == "object";
5
+ var g = (e) => !E(e) && !Array.isArray(e) && B(e) && !b(e), q = (e) => g(e) && e.target ? $(e.target) ? e.target.checked : e.target.value : e, K = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, z = (e, s) => e.has(K(s)), J = (e) => {
6
6
  const s = e.constructor && e.constructor.prototype;
7
7
  return g(s) && s.hasOwnProperty("isPrototypeOf");
8
- }, z = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
9
- function R(e) {
8
+ }, Q = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
9
+ function T(e) {
10
10
  let s;
11
11
  const t = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
12
12
  if (e instanceof Date)
13
13
  s = new Date(e);
14
- else if (!(z && (e instanceof Blob || n)) && (t || g(e)))
15
- if (s = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !K(e))
14
+ else if (!(Q && (e instanceof Blob || n)) && (t || g(e)))
15
+ if (s = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !J(e))
16
16
  s = e;
17
17
  else
18
18
  for (const r in e)
19
- e.hasOwnProperty(r) && (s[r] = R(e[r]));
19
+ e.hasOwnProperty(r) && (s[r] = T(e[r]));
20
20
  else
21
21
  return e;
22
22
  return s;
23
23
  }
24
- var B = (e) => /^\w*$/.test(e), O = (e) => e === void 0, J = (e) => Array.isArray(e) ? e.filter(Boolean) : [], T = (e) => J(e.replace(/["|']|\]/g, "").split(/\.|\[/)), f = (e, s, t) => {
24
+ var U = (e) => /^\w*$/.test(e), x = (e) => e === void 0, X = (e) => Array.isArray(e) ? e.filter(Boolean) : [], I = (e) => X(e.replace(/["|']|\]/g, "").split(/\.|\[/)), f = (e, s, t) => {
25
25
  if (!s || !g(e))
26
26
  return t;
27
- const n = (B(s) ? [s] : T(s)).reduce((r, a) => x(r) ? r : r[a], e);
28
- return O(n) || n === e ? O(e[s]) ? t : e[s] : n;
29
- }, C = (e) => typeof e == "boolean", w = (e, s, t) => {
27
+ const n = (U(s) ? [s] : I(s)).reduce((r, a) => E(r) ? r : r[a], e);
28
+ return x(n) || n === e ? x(e[s]) ? t : e[s] : n;
29
+ }, O = (e) => typeof e == "boolean", M = (e, s, t) => {
30
30
  let n = -1;
31
- const r = B(s) ? [s] : T(s), a = r.length, u = a - 1;
31
+ const r = U(s) ? [s] : I(s), a = r.length, i = a - 1;
32
32
  for (; ++n < a; ) {
33
- const i = r[n];
33
+ const u = r[n];
34
34
  let y = t;
35
- if (n !== u) {
36
- const l = e[i];
35
+ if (n !== i) {
36
+ const l = e[u];
37
37
  y = g(l) || Array.isArray(l) ? l : isNaN(+r[n + 1]) ? {} : [];
38
38
  }
39
- if (i === "__proto__" || i === "constructor" || i === "prototype")
39
+ if (u === "__proto__" || u === "constructor" || u === "prototype")
40
40
  return;
41
- e[i] = y, e = e[i];
41
+ e[u] = y, e = e[u];
42
42
  }
43
43
  };
44
- const M = {
44
+ const R = {
45
45
  BLUR: "blur",
46
46
  CHANGE: "change"
47
- }, N = {
47
+ }, L = {
48
48
  all: "all"
49
- }, E = o.createContext(null);
50
- E.displayName = "HookFormContext";
51
- const S = () => o.useContext(E), re = (e) => {
49
+ }, S = o.createContext(null);
50
+ S.displayName = "HookFormContext";
51
+ const P = () => o.useContext(S), ne = (e) => {
52
52
  const { children: s, ...t } = e;
53
- return o.createElement(E.Provider, { value: t }, s);
53
+ return o.createElement(S.Provider, { value: t }, s);
54
54
  };
55
- var Q = (e, s, t, n = !0) => {
55
+ var Y = (e, s, t, n = !0) => {
56
56
  const r = {
57
57
  defaultValues: s._defaultValues
58
58
  };
59
59
  for (const a in e)
60
60
  Object.defineProperty(r, a, {
61
61
  get: () => {
62
- const u = a;
63
- return s._proxyFormState[u] !== N.all && (s._proxyFormState[u] = !n || N.all), t && (t[u] = !0), e[u];
62
+ const i = a;
63
+ return s._proxyFormState[i] !== L.all && (s._proxyFormState[i] = !n || L.all), t && (t[i] = !0), e[i];
64
64
  }
65
65
  });
66
66
  return r;
67
67
  };
68
- const U = typeof window < "u" ? o.useLayoutEffect : o.useEffect;
69
- function X(e) {
70
- const s = S(), { control: t = s.control, disabled: n, name: r, exact: a } = e || {}, [u, i] = o.useState(t._formState), y = o.useRef({
68
+ const H = typeof window < "u" ? o.useLayoutEffect : o.useEffect;
69
+ function Z(e) {
70
+ const s = P(), { control: t = s.control, disabled: n, name: r, exact: a } = e || {}, [i, u] = o.useState(t._formState), y = o.useRef({
71
71
  isDirty: !1,
72
72
  isLoading: !1,
73
73
  dirtyFields: !1,
@@ -77,25 +77,25 @@ function X(e) {
77
77
  isValid: !1,
78
78
  errors: !1
79
79
  });
80
- return U(() => t._subscribe({
80
+ return H(() => t._subscribe({
81
81
  name: r,
82
82
  formState: y.current,
83
83
  exact: a,
84
84
  callback: (l) => {
85
- !n && i({
85
+ !n && u({
86
86
  ...t._formState,
87
87
  ...l
88
88
  });
89
89
  }
90
90
  }), [r, n, a]), o.useEffect(() => {
91
91
  y.current.isValid && t._setValid(!0);
92
- }, [t]), o.useMemo(() => Q(u, t, y.current, !1), [u, t]);
92
+ }, [t]), o.useMemo(() => Y(i, t, y.current, !1), [i, t]);
93
93
  }
94
- var Y = (e) => typeof e == "string", Z = (e, s, t, n, r) => Y(e) ? f(t, e, r) : Array.isArray(e) ? e.map((a) => f(t, a)) : t, L = (e) => x(e) || !D(e);
95
- function I(e, s, t = /* @__PURE__ */ new WeakSet()) {
96
- if (L(e) || L(s))
94
+ var j = (e) => typeof e == "string", ee = (e, s, t, n, r) => j(e) ? f(t, e, r) : Array.isArray(e) ? e.map((a) => f(t, a)) : t, D = (e) => E(e) || !B(e);
95
+ function W(e, s, t = /* @__PURE__ */ new WeakSet()) {
96
+ if (D(e) || D(s))
97
97
  return e === s;
98
- if (v(e) && v(s))
98
+ if (b(e) && b(s))
99
99
  return e.getTime() === s.getTime();
100
100
  const n = Object.keys(e), r = Object.keys(s);
101
101
  if (n.length !== r.length)
@@ -104,56 +104,56 @@ function I(e, s, t = /* @__PURE__ */ new WeakSet()) {
104
104
  return !0;
105
105
  t.add(e), t.add(s);
106
106
  for (const a of n) {
107
- const u = e[a];
107
+ const i = e[a];
108
108
  if (!r.includes(a))
109
109
  return !1;
110
110
  if (a !== "ref") {
111
- const i = s[a];
112
- if (v(u) && v(i) || g(u) && g(i) || Array.isArray(u) && Array.isArray(i) ? !I(u, i, t) : u !== i)
111
+ const u = s[a];
112
+ if (b(i) && b(u) || g(i) && g(u) || Array.isArray(i) && Array.isArray(u) ? !W(i, u, t) : i !== u)
113
113
  return !1;
114
114
  }
115
115
  }
116
116
  return !0;
117
117
  }
118
- function j(e) {
119
- const s = S(), { control: t = s.control, name: n, defaultValue: r, disabled: a, exact: u, compute: i } = e || {}, y = o.useRef(r), l = o.useRef(i), c = o.useRef(void 0);
120
- l.current = i;
121
- const m = o.useMemo(() => t._getWatch(n, y.current), [t, n]), [F, V] = o.useState(l.current ? l.current(m) : m);
122
- return U(() => t._subscribe({
118
+ function te(e) {
119
+ const s = P(), { control: t = s.control, name: n, defaultValue: r, disabled: a, exact: i, compute: u } = e || {}, y = o.useRef(r), l = o.useRef(u), c = o.useRef(void 0);
120
+ l.current = u;
121
+ const m = o.useMemo(() => t._getWatch(n, y.current), [t, n]), [h, V] = o.useState(l.current ? l.current(m) : m);
122
+ return H(() => t._subscribe({
123
123
  name: n,
124
124
  formState: {
125
125
  values: !0
126
126
  },
127
- exact: u,
128
- callback: (A) => {
127
+ exact: i,
128
+ callback: (F) => {
129
129
  if (!a) {
130
- const b = Z(n, t._names, A.values || t._formValues, !1, y.current);
130
+ const v = ee(n, t._names, F.values || t._formValues, !1, y.current);
131
131
  if (l.current) {
132
- const _ = l.current(b);
133
- I(_, c.current) || (V(_), c.current = _);
132
+ const _ = l.current(v);
133
+ W(_, c.current) || (V(_), c.current = _);
134
134
  } else
135
- V(b);
135
+ V(v);
136
136
  }
137
137
  }
138
- }), [t, a, n, u]), o.useEffect(() => t._removeUnmounted()), F;
138
+ }), [t, a, n, i]), o.useEffect(() => t._removeUnmounted()), h;
139
139
  }
140
- function ee(e) {
141
- const s = S(), { name: t, disabled: n, control: r = s.control, shouldUnregister: a, defaultValue: u } = e, i = q(r._names.array, t), y = o.useMemo(() => f(r._formValues, t, f(r._defaultValues, t, u)), [r, t, u]), l = j({
140
+ function re(e) {
141
+ const s = P(), { name: t, disabled: n, control: r = s.control, shouldUnregister: a, defaultValue: i } = e, u = z(r._names.array, t), y = o.useMemo(() => f(r._formValues, t, f(r._defaultValues, t, i)), [r, t, i]), l = te({
142
142
  control: r,
143
143
  name: t,
144
144
  defaultValue: y,
145
145
  exact: !0
146
- }), c = X({
146
+ }), c = Z({
147
147
  control: r,
148
148
  name: t,
149
149
  exact: !0
150
- }), m = o.useRef(e), F = o.useRef(r.register(t, {
150
+ }), m = o.useRef(e), h = o.useRef(void 0), V = o.useRef(r.register(t, {
151
151
  ...e.rules,
152
152
  value: l,
153
- ...C(e.disabled) ? { disabled: e.disabled } : {}
153
+ ...O(e.disabled) ? { disabled: e.disabled } : {}
154
154
  }));
155
155
  m.current = e;
156
- const V = o.useMemo(() => Object.defineProperties({}, {
156
+ const F = o.useMemo(() => Object.defineProperties({}, {
157
157
  invalid: {
158
158
  enumerable: !0,
159
159
  get: () => !!f(c.errors, t)
@@ -174,70 +174,70 @@ function ee(e) {
174
174
  enumerable: !0,
175
175
  get: () => f(c.errors, t)
176
176
  }
177
- }), [c, t]), A = o.useCallback((d) => F.current.onChange({
177
+ }), [c, t]), v = o.useCallback((d) => V.current.onChange({
178
178
  target: {
179
- value: G(d),
179
+ value: q(d),
180
180
  name: t
181
181
  },
182
- type: M.CHANGE
183
- }), [t]), b = o.useCallback(() => F.current.onBlur({
182
+ type: R.CHANGE
183
+ }), [t]), _ = o.useCallback(() => V.current.onBlur({
184
184
  target: {
185
185
  value: f(r._formValues, t),
186
186
  name: t
187
187
  },
188
- type: M.BLUR
189
- }), [t, r._formValues]), _ = o.useCallback((d) => {
190
- const h = f(r._fields, t);
191
- h && d && (h._f.ref = {
188
+ type: R.BLUR
189
+ }), [t, r._formValues]), w = o.useCallback((d) => {
190
+ const p = f(r._fields, t);
191
+ p && d && (p._f.ref = {
192
192
  focus: () => d.focus && d.focus(),
193
193
  select: () => d.select && d.select(),
194
- setCustomValidity: (p) => d.setCustomValidity(p),
194
+ setCustomValidity: (A) => d.setCustomValidity(A),
195
195
  reportValidity: () => d.reportValidity()
196
196
  });
197
- }, [r._fields, t]), P = o.useMemo(() => ({
197
+ }, [r._fields, t]), N = o.useMemo(() => ({
198
198
  name: t,
199
199
  value: l,
200
- ...C(n) || c.disabled ? { disabled: c.disabled || n } : {},
201
- onChange: A,
202
- onBlur: b,
203
- ref: _
204
- }), [t, n, c.disabled, A, b, _, l]);
200
+ ...O(n) || c.disabled ? { disabled: c.disabled || n } : {},
201
+ onChange: v,
202
+ onBlur: _,
203
+ ref: w
204
+ }), [t, n, c.disabled, v, _, w, l]);
205
205
  return o.useEffect(() => {
206
- const d = r._options.shouldUnregister || a;
207
- r.register(t, {
206
+ const d = r._options.shouldUnregister || a, p = h.current;
207
+ p && p !== t && !u && r.unregister(p), r.register(t, {
208
208
  ...m.current.rules,
209
- ...C(m.current.disabled) ? { disabled: m.current.disabled } : {}
209
+ ...O(m.current.disabled) ? { disabled: m.current.disabled } : {}
210
210
  });
211
- const h = (p, H) => {
212
- const k = f(r._fields, p);
213
- k && k._f && (k._f.mount = H);
211
+ const A = (k, G) => {
212
+ const C = f(r._fields, k);
213
+ C && C._f && (C._f.mount = G);
214
214
  };
215
- if (h(t, !0), d) {
216
- const p = R(f(r._options.defaultValues, t));
217
- w(r._defaultValues, t, p), O(f(r._formValues, t)) && w(r._formValues, t, p);
215
+ if (A(t, !0), d) {
216
+ const k = T(f(r._options.defaultValues, t));
217
+ M(r._defaultValues, t, k), x(f(r._formValues, t)) && M(r._formValues, t, k);
218
218
  }
219
- return !i && r.register(t), () => {
220
- (i ? d && !r._state.action : d) ? r.unregister(t) : h(t, !1);
219
+ return !u && r.register(t), h.current = t, () => {
220
+ (u ? d && !r._state.action : d) ? r.unregister(t) : A(t, !1);
221
221
  };
222
- }, [t, r, i, a]), o.useEffect(() => {
222
+ }, [t, r, u, a]), o.useEffect(() => {
223
223
  r._setDisabledField({
224
224
  disabled: n,
225
225
  name: t
226
226
  });
227
227
  }, [n, t, r]), o.useMemo(() => ({
228
- field: P,
228
+ field: N,
229
229
  formState: c,
230
- fieldState: V
231
- }), [P, c, V]);
230
+ fieldState: F
231
+ }), [N, c, F]);
232
232
  }
233
- const se = (e) => e.render(ee(e));
233
+ const oe = (e) => e.render(re(e));
234
234
  export {
235
- se as Controller,
236
- re as FormProvider,
235
+ oe as Controller,
236
+ ne as FormProvider,
237
237
  f as get,
238
- w as set,
239
- ee as useController,
240
- S as useFormContext,
241
- X as useFormState,
242
- j as useWatch
238
+ M as set,
239
+ re as useController,
240
+ P as useFormContext,
241
+ Z as useFormState,
242
+ te as useWatch
243
243
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../../../_virtual/index2.js";
2
+ import e from "../../../../_virtual/index5.js";
3
3
  var r = new e(), n = "recharts.syncEvent.tooltip";
4
4
  export {
5
5
  n as TOOLTIP_SYNC_EVENT,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __exports as r } from "../../../_virtual/index7.js";
2
+ import { __exports as r } from "../../../_virtual/index6.js";
3
3
  import { __require as c } from "../../inline-style-parser/index.js";
4
4
  var f;
5
5
  function j() {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { bail as P } from "../../bail/index.js";
3
- import y from "../../../_virtual/index5.js";
3
+ import y from "../../../_virtual/index4.js";
4
4
  import z from "../../is-plain-obj/index.js";
5
5
  import { CallableInstance as C } from "./callable-instance.js";
6
6
  import { trough as A } from "../../trough/lib/index.js";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __module as e } from "../../../_virtual/index3.js";
2
+ import { __module as e } from "../../../_virtual/index2.js";
3
3
  import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
4
4
  import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
5
5
  var r;