laif-ds 0.2.26 → 0.2.28
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/_virtual/index4.js +5 -2
- package/dist/_virtual/index6.js +2 -5
- package/dist/components/ui/checkbox.js +9 -9
- package/dist/components/ui/file-previewer.js +49 -37
- package/dist/index.d.ts +2 -0
- package/dist/node_modules/@shikijs/langs/dist/luau.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/move.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/nushell.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/swift.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +76 -74
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +93 -46
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +5 -5
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +4 -4
- package/dist/node_modules/react-hook-form/dist/index.esm.js +96 -96
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import o from "react";
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
var g = (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
|
-
},
|
|
9
|
-
function
|
|
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 (!(
|
|
15
|
-
if (s = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !
|
|
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] =
|
|
19
|
+
e.hasOwnProperty(r) && (s[r] = T(e[r]));
|
|
20
20
|
else
|
|
21
21
|
return e;
|
|
22
22
|
return s;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
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 = (
|
|
28
|
-
return
|
|
29
|
-
},
|
|
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 =
|
|
31
|
+
const r = U(s) ? [s] : I(s), a = r.length, i = a - 1;
|
|
32
32
|
for (; ++n < a; ) {
|
|
33
|
-
const
|
|
33
|
+
const u = r[n];
|
|
34
34
|
let y = t;
|
|
35
|
-
if (n !==
|
|
36
|
-
const l = e[
|
|
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 (
|
|
39
|
+
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
40
40
|
return;
|
|
41
|
-
e[
|
|
41
|
+
e[u] = y, e = e[u];
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const R = {
|
|
45
45
|
BLUR: "blur",
|
|
46
46
|
CHANGE: "change"
|
|
47
|
-
},
|
|
47
|
+
}, L = {
|
|
48
48
|
all: "all"
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
const
|
|
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(
|
|
53
|
+
return o.createElement(S.Provider, { value: t }, s);
|
|
54
54
|
};
|
|
55
|
-
var
|
|
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
|
|
63
|
-
return s._proxyFormState[
|
|
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
|
|
69
|
-
function
|
|
70
|
-
const s =
|
|
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
|
|
80
|
+
return H(() => t._subscribe({
|
|
81
81
|
name: r,
|
|
82
82
|
formState: y.current,
|
|
83
83
|
exact: a,
|
|
84
84
|
callback: (l) => {
|
|
85
|
-
!n &&
|
|
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(() =>
|
|
92
|
+
}, [t]), o.useMemo(() => Y(i, t, y.current, !1), [i, t]);
|
|
93
93
|
}
|
|
94
|
-
var
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
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 (
|
|
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
|
|
107
|
+
const i = e[a];
|
|
108
108
|
if (!r.includes(a))
|
|
109
109
|
return !1;
|
|
110
110
|
if (a !== "ref") {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
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
|
|
119
|
-
const s =
|
|
120
|
-
l.current =
|
|
121
|
-
const m = o.useMemo(() => t._getWatch(n, y.current), [t, n]), [
|
|
122
|
-
return
|
|
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:
|
|
128
|
-
callback: (
|
|
127
|
+
exact: i,
|
|
128
|
+
callback: (F) => {
|
|
129
129
|
if (!a) {
|
|
130
|
-
const
|
|
130
|
+
const v = ee(n, t._names, F.values || t._formValues, !1, y.current);
|
|
131
131
|
if (l.current) {
|
|
132
|
-
const _ = l.current(
|
|
133
|
-
|
|
132
|
+
const _ = l.current(v);
|
|
133
|
+
W(_, c.current) || (V(_), c.current = _);
|
|
134
134
|
} else
|
|
135
|
-
V(
|
|
135
|
+
V(v);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
}), [t, a, n,
|
|
138
|
+
}), [t, a, n, i]), o.useEffect(() => t._removeUnmounted()), h;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const s =
|
|
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 =
|
|
146
|
+
}), c = Z({
|
|
147
147
|
control: r,
|
|
148
148
|
name: t,
|
|
149
149
|
exact: !0
|
|
150
|
-
}), m = o.useRef(e),
|
|
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
|
-
...
|
|
153
|
+
...O(e.disabled) ? { disabled: e.disabled } : {}
|
|
154
154
|
}));
|
|
155
155
|
m.current = e;
|
|
156
|
-
const
|
|
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]),
|
|
177
|
+
}), [c, t]), v = o.useCallback((d) => V.current.onChange({
|
|
178
178
|
target: {
|
|
179
|
-
value:
|
|
179
|
+
value: q(d),
|
|
180
180
|
name: t
|
|
181
181
|
},
|
|
182
|
-
type:
|
|
183
|
-
}), [t]),
|
|
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:
|
|
189
|
-
}), [t, r._formValues]),
|
|
190
|
-
const
|
|
191
|
-
|
|
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: (
|
|
194
|
+
setCustomValidity: (A) => d.setCustomValidity(A),
|
|
195
195
|
reportValidity: () => d.reportValidity()
|
|
196
196
|
});
|
|
197
|
-
}, [r._fields, t]),
|
|
197
|
+
}, [r._fields, t]), N = o.useMemo(() => ({
|
|
198
198
|
name: t,
|
|
199
199
|
value: l,
|
|
200
|
-
...
|
|
201
|
-
onChange:
|
|
202
|
-
onBlur:
|
|
203
|
-
ref:
|
|
204
|
-
}), [t, n, c.disabled,
|
|
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
|
-
...
|
|
209
|
+
...O(m.current.disabled) ? { disabled: m.current.disabled } : {}
|
|
210
210
|
});
|
|
211
|
-
const
|
|
212
|
-
const
|
|
213
|
-
|
|
211
|
+
const A = (k, G) => {
|
|
212
|
+
const C = f(r._fields, k);
|
|
213
|
+
C && C._f && (C._f.mount = G);
|
|
214
214
|
};
|
|
215
|
-
if (
|
|
216
|
-
const
|
|
217
|
-
|
|
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 !
|
|
220
|
-
(
|
|
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,
|
|
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:
|
|
228
|
+
field: N,
|
|
229
229
|
formState: c,
|
|
230
|
-
fieldState:
|
|
231
|
-
}), [
|
|
230
|
+
fieldState: F
|
|
231
|
+
}), [N, c, F]);
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const oe = (e) => e.render(re(e));
|
|
234
234
|
export {
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
oe as Controller,
|
|
236
|
+
ne as FormProvider,
|
|
237
237
|
f as get,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
M as set,
|
|
239
|
+
re as useController,
|
|
240
|
+
P as useFormContext,
|
|
241
|
+
Z as useFormState,
|
|
242
|
+
te as useWatch
|
|
243
243
|
};
|