@arkyn/components 3.0.1-beta.44 → 3.0.1-beta.45
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/bundle.js +255 -248
- package/dist/bundle.umd.cjs +3 -3
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +3 -2
- package/dist/components/fieldWrapper/index.d.ts +2 -0
- package/dist/components/fieldWrapper/index.d.ts.map +1 -1
- package/dist/components/fieldWrapper/index.js +3 -2
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/switch/index.js +3 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -63,11 +63,11 @@ function Qa(e) {
|
|
63
63
|
...o
|
64
64
|
} = e, [i, c] = F(!1), l = oe(null), u = () => c(!0), d = () => c(!1), _ = (C) => {
|
65
65
|
if (r || !i || !l.current) return;
|
66
|
-
const
|
66
|
+
const x = l.current.getBoundingClientRect(), v = C.clientX - x.left, w = Math.min(Math.max(v / x.width * 100, 0), 100);
|
67
67
|
t(w);
|
68
68
|
}, h = (C) => {
|
69
69
|
if (r || !l.current) return;
|
70
|
-
const
|
70
|
+
const x = l.current.getBoundingClientRect(), v = C.clientX - x.left, w = Math.min(Math.max(v / x.width * 100, 0), 100);
|
71
71
|
t(w);
|
72
72
|
};
|
73
73
|
Ce(() => (i ? (a && a(!0), document.addEventListener("mousemove", _), document.addEventListener("mouseup", d)) : (a && a(!1), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", d)), () => {
|
@@ -90,8 +90,8 @@ function Qa(e) {
|
|
90
90
|
);
|
91
91
|
}
|
92
92
|
function es(e) {
|
93
|
-
var L,
|
94
|
-
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Ja(0), [i, c] = F(!1), [l, u] = F(!1), d = oe(null), _ = (L = d.current) == null ? void 0 : L.currentTime, h = (
|
93
|
+
var L, T, G, S;
|
94
|
+
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Ja(0), [i, c] = F(!1), [l, u] = F(!1), d = oe(null), _ = (L = d.current) == null ? void 0 : L.currentTime, h = (T = d.current) == null ? void 0 : T.duration, m = C(_), g = C(h), y = {
|
95
95
|
totalTime: h,
|
96
96
|
currentTime: _,
|
97
97
|
formattedCurrentTime: m,
|
@@ -99,10 +99,10 @@ function es(e) {
|
|
99
99
|
};
|
100
100
|
function C(b) {
|
101
101
|
if (!b) return "00:00";
|
102
|
-
const
|
103
|
-
return `${
|
102
|
+
const O = Math.floor(b / 60), M = Math.floor(b % 60), P = String(O).padStart(2, "0"), j = String(M).padStart(2, "0");
|
103
|
+
return `${P}:${j}`;
|
104
104
|
}
|
105
|
-
function
|
105
|
+
function x() {
|
106
106
|
const b = d.current;
|
107
107
|
b && (e.onPlayAudio && e.onPlayAudio(y), b.play(), c(!0));
|
108
108
|
}
|
@@ -111,23 +111,23 @@ function es(e) {
|
|
111
111
|
b && (e.onPauseAudio && e.onPauseAudio(y), b.pause(), c(!1));
|
112
112
|
}
|
113
113
|
function w() {
|
114
|
-
i ? v() :
|
114
|
+
i ? v() : x();
|
115
115
|
}
|
116
|
-
function
|
117
|
-
const
|
118
|
-
if (!
|
119
|
-
const M =
|
120
|
-
|
116
|
+
function H(b) {
|
117
|
+
const O = d.current;
|
118
|
+
if (!O) return;
|
119
|
+
const M = O.duration, P = b / 100 * M;
|
120
|
+
O.currentTime = P;
|
121
121
|
}
|
122
|
-
return l || !i ? (
|
122
|
+
return l || !i ? (G = d.current) == null || G.pause() : i && ((S = d.current) == null || S.play()), Ce(() => {
|
123
123
|
const b = d.current;
|
124
124
|
if (!b) return;
|
125
|
-
const
|
125
|
+
const O = () => {
|
126
126
|
const M = b.duration, j = b.currentTime / M * 100;
|
127
127
|
o(j);
|
128
128
|
};
|
129
|
-
return b.addEventListener("timeupdate",
|
130
|
-
b.removeEventListener("timeupdate",
|
129
|
+
return b.addEventListener("timeupdate", O), () => {
|
130
|
+
b.removeEventListener("timeupdate", O);
|
131
131
|
};
|
132
132
|
}, []), /* @__PURE__ */ k("div", { className: "arkynAudioPlayer", children: [
|
133
133
|
/* @__PURE__ */ f(
|
@@ -148,7 +148,7 @@ function es(e) {
|
|
148
148
|
Qa,
|
149
149
|
{
|
150
150
|
value: s,
|
151
|
-
onChange:
|
151
|
+
onChange: H,
|
152
152
|
onDragging: u,
|
153
153
|
disabled: r
|
154
154
|
}
|
@@ -180,8 +180,13 @@ function me(e) {
|
|
180
180
|
return /* @__PURE__ */ f("label", { className: s.trim(), ...r });
|
181
181
|
}
|
182
182
|
function ye(e) {
|
183
|
-
const {
|
184
|
-
|
183
|
+
const {
|
184
|
+
children: t,
|
185
|
+
className: n,
|
186
|
+
orientation: r = "vertical",
|
187
|
+
...a
|
188
|
+
} = e, s = `arkynFieldWrapper ${n} ${r}`;
|
189
|
+
return /* @__PURE__ */ f("section", { className: s.trim(), ...a, children: t });
|
185
190
|
}
|
186
191
|
function K(e) {
|
187
192
|
const { iconSize: t, icon: n, className: r, show: a = !0 } = e;
|
@@ -259,9 +264,9 @@ function Cn(e) {
|
|
259
264
|
if (!c.current) return;
|
260
265
|
const g = document.getElementById(i);
|
261
266
|
g && (u(a), requestAnimationFrame(() => {
|
262
|
-
const y = g.getBoundingClientRect(), C = window.innerWidth,
|
267
|
+
const y = g.getBoundingClientRect(), C = window.innerWidth, x = window.innerHeight;
|
263
268
|
let v = a;
|
264
|
-
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right > C ? v = "left" : a === "top" && y.top < 0 ? v = "bottom" : a === "bottom" && y.bottom >
|
269
|
+
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right > C ? v = "left" : a === "top" && y.top < 0 ? v = "bottom" : a === "bottom" && y.bottom > x && (v = "top"), v === "right" && y.right > C ? v = "left" : v === "left" && y.left < 0 ? v = "right" : v === "bottom" && y.bottom > x ? v = "top" : v === "top" && y.top < 0 && (v = "bottom"), u(v);
|
265
270
|
}));
|
266
271
|
}, h = c.current;
|
267
272
|
if (!h) return;
|
@@ -393,15 +398,15 @@ function xc(e) {
|
|
393
398
|
defaultValue: _ = "",
|
394
399
|
showAsterisk: h = !1,
|
395
400
|
disabled: m = !1
|
396
|
-
} = e, { fieldErrors: g } = be(), y = g == null ? void 0 : g[t], [C,
|
397
|
-
async function
|
401
|
+
} = e, { fieldErrors: g } = be(), y = g == null ? void 0 : g[t], [C, x] = F(_), [v, w] = F(""), [H, L] = F(null), [T, G] = F(_), [S, b] = F(!1);
|
402
|
+
async function O(I) {
|
398
403
|
if (m) return;
|
399
404
|
b(!0), L(I), w("");
|
400
405
|
const Z = new FormData();
|
401
|
-
Z.append(r, I), await fetch(d, { method: a, body: Z }).then(async (
|
402
|
-
|
403
|
-
}).catch((
|
404
|
-
console.error(
|
406
|
+
Z.append(r, I), await fetch(d, { method: a, body: Z }).then(async (E) => await E.json()).then((E) => {
|
407
|
+
E != null && E.error ? w(E.error) : x(E == null ? void 0 : E[o]), s && s(E == null ? void 0 : E[o]);
|
408
|
+
}).catch((E) => {
|
409
|
+
console.error(E), w("Erro ao enviar audio");
|
405
410
|
}).finally(() => b(!1));
|
406
411
|
}
|
407
412
|
function M(I) {
|
@@ -410,39 +415,39 @@ function xc(e) {
|
|
410
415
|
w("O arquivo selecionado não é um arquivo de áudio");
|
411
416
|
return;
|
412
417
|
}
|
413
|
-
|
418
|
+
G(URL.createObjectURL(I)), O(I);
|
414
419
|
}
|
415
420
|
}
|
416
|
-
const
|
421
|
+
const P = y || v;
|
417
422
|
return /* @__PURE__ */ k(ye, { children: [
|
418
423
|
n && /* @__PURE__ */ f(me, { showAsterisk: h, children: n }),
|
419
|
-
/* @__PURE__ */ k("div", { className: `arkynAudioUpload ${
|
424
|
+
/* @__PURE__ */ k("div", { className: `arkynAudioUpload ${P ? "hasError" : "noHasError"} ${T ? "hasAudio" : "noHasAudio"}`, children: [
|
420
425
|
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: C || "" }),
|
421
|
-
!
|
426
|
+
!T && /* @__PURE__ */ f(
|
422
427
|
ns,
|
423
428
|
{
|
424
429
|
disabled: m,
|
425
|
-
isLoading:
|
430
|
+
isLoading: S,
|
426
431
|
acceptAudio: u,
|
427
432
|
dropAudioText: c,
|
428
433
|
handleSelectFile: M,
|
429
434
|
selectAudioButtonText: i
|
430
435
|
}
|
431
436
|
),
|
432
|
-
|
437
|
+
T && /* @__PURE__ */ f(
|
433
438
|
ts,
|
434
439
|
{
|
435
|
-
filePath:
|
440
|
+
filePath: T,
|
436
441
|
acceptAudio: u,
|
437
442
|
changeAudioButtonText: l,
|
438
443
|
disabled: m,
|
439
444
|
handleSelectFile: M,
|
440
|
-
isLoading:
|
441
|
-
reSendAudio:
|
445
|
+
isLoading: S,
|
446
|
+
reSendAudio: P && H ? () => O(H) : void 0
|
442
447
|
}
|
443
448
|
)
|
444
449
|
] }),
|
445
|
-
|
450
|
+
P && /* @__PURE__ */ f(Fe, { children: P })
|
446
451
|
] });
|
447
452
|
}
|
448
453
|
function Ec(e) {
|
@@ -526,38 +531,39 @@ function Fc(e) {
|
|
526
531
|
label: i,
|
527
532
|
checked: c = null,
|
528
533
|
onCheck: l,
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
534
|
+
orientation: u,
|
535
|
+
value: d,
|
536
|
+
..._
|
537
|
+
} = e, { fieldErrors: h } = be(), m = oe(null), g = t || Ie(), y = s || (h == null ? void 0 : h[n]), C = !!y, [x, v] = F(o || !1), w = typeof c == "boolean" ? c : x, T = `arkynCheckbox ${a} ${C ? "errorTrue" : "errorFalse"} ${w ? "checkedTrue" : "checkedFalse"} ${r}`;
|
538
|
+
function G() {
|
539
|
+
const S = x;
|
540
|
+
v(!S), l && l(S ? "" : d || "checked");
|
541
|
+
}
|
542
|
+
return /* @__PURE__ */ k(ye, { orientation: u, children: [
|
537
543
|
i && /* @__PURE__ */ f(me, { children: i }),
|
538
544
|
/* @__PURE__ */ k(
|
539
545
|
"button",
|
540
546
|
{
|
541
|
-
id:
|
547
|
+
id: g,
|
542
548
|
type: "button",
|
543
|
-
className:
|
544
|
-
onClick:
|
545
|
-
...
|
549
|
+
className: T,
|
550
|
+
onClick: G,
|
551
|
+
..._,
|
546
552
|
children: [
|
547
553
|
/* @__PURE__ */ f(
|
548
554
|
"input",
|
549
555
|
{
|
550
556
|
type: "hidden",
|
551
557
|
name: n,
|
552
|
-
ref:
|
553
|
-
value:
|
558
|
+
ref: m,
|
559
|
+
value: w ? d || "checked" : ""
|
554
560
|
}
|
555
561
|
),
|
556
562
|
/* @__PURE__ */ f(pn, {})
|
557
563
|
]
|
558
564
|
}
|
559
565
|
),
|
560
|
-
|
566
|
+
y && /* @__PURE__ */ f(Fe, { children: y })
|
561
567
|
] });
|
562
568
|
}
|
563
569
|
function ss() {
|
@@ -2591,20 +2597,20 @@ function Tc(e) {
|
|
2591
2597
|
isLoading: g = !1,
|
2592
2598
|
leftIcon: y,
|
2593
2599
|
readOnly: C,
|
2594
|
-
onFocus:
|
2600
|
+
onFocus: x,
|
2595
2601
|
onBlur: v,
|
2596
2602
|
errorMessage: w,
|
2597
|
-
showAsterisk:
|
2603
|
+
showAsterisk: H,
|
2598
2604
|
rightIcon: L,
|
2599
|
-
size:
|
2600
|
-
id:
|
2601
|
-
...
|
2602
|
-
} = e, { fieldErrors: b } = be(), [
|
2605
|
+
size: T = "md",
|
2606
|
+
id: G,
|
2607
|
+
...S
|
2608
|
+
} = e, { fieldErrors: b } = be(), [O, M] = F(!1), [P, j] = F("0"), D = oe(null), B = G || Ie(), I = w || (b == null ? void 0 : b[t]), Z = !!I, E = n || g, te = { md: 20, lg: 20 }[T], J = L ? "right" : "left", ve = J === "left" && g, ce = J === "right" && g;
|
2603
2609
|
function re() {
|
2604
|
-
|
2610
|
+
E || !(D != null && D.current) || (M(!0), D.current.focus());
|
2605
2611
|
}
|
2606
2612
|
function ae(fe) {
|
2607
|
-
M(!0),
|
2613
|
+
M(!0), x && x(fe);
|
2608
2614
|
}
|
2609
2615
|
function $(fe) {
|
2610
2616
|
M(!1), v && v(fe);
|
@@ -2624,9 +2630,9 @@ function Tc(e) {
|
|
2624
2630
|
const fe = c || +l || void 0, [, De] = Yt(fe, d);
|
2625
2631
|
j(De);
|
2626
2632
|
}, [d, l, c]);
|
2627
|
-
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${
|
2633
|
+
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${T} ${E || C || g ? "opacity" : ""} ${Z ? "errored" : ""} ${O ? "focused" : ""} ${i}`;
|
2628
2634
|
return /* @__PURE__ */ k(ye, { children: [
|
2629
|
-
o && /* @__PURE__ */ f(me, { showAsterisk:
|
2635
|
+
o && /* @__PURE__ */ f(me, { showAsterisk: H, htmlFor: B, children: o }),
|
2630
2636
|
/* @__PURE__ */ k(
|
2631
2637
|
"section",
|
2632
2638
|
{
|
@@ -2649,8 +2655,8 @@ function Tc(e) {
|
|
2649
2655
|
/* @__PURE__ */ f(
|
2650
2656
|
"input",
|
2651
2657
|
{
|
2652
|
-
value:
|
2653
|
-
disabled:
|
2658
|
+
value: P,
|
2659
|
+
disabled: E,
|
2654
2660
|
readOnly: C,
|
2655
2661
|
ref: D,
|
2656
2662
|
onFocus: ae,
|
@@ -2658,7 +2664,7 @@ function Tc(e) {
|
|
2658
2664
|
onChange: Re,
|
2659
2665
|
id: B,
|
2660
2666
|
name: t,
|
2661
|
-
...
|
2667
|
+
...S
|
2662
2668
|
}
|
2663
2669
|
),
|
2664
2670
|
/* @__PURE__ */ f(K, { show: !g, icon: L, iconSize: te }),
|
@@ -2872,21 +2878,21 @@ function Ac(e) {
|
|
2872
2878
|
dropFileText: d = "Ou arraste e solte o arquivo aqui",
|
2873
2879
|
onChange: _,
|
2874
2880
|
disabled: h = !1
|
2875
|
-
} = e, { fieldErrors: m } = be(), g = m == null ? void 0 : m[t], [y, C] = F(""), [
|
2876
|
-
async function
|
2881
|
+
} = e, { fieldErrors: m } = be(), g = m == null ? void 0 : m[t], [y, C] = F(""), [x, v] = F(""), [w, H] = F(null), [L, T] = F(!1);
|
2882
|
+
async function G(j) {
|
2877
2883
|
if (h) return;
|
2878
|
-
|
2884
|
+
T(!0), H(j), v("");
|
2879
2885
|
const D = new FormData();
|
2880
2886
|
D.append(s, j), await fetch(a, { method: o, body: D }).then(async (B) => await B.json()).then((B) => {
|
2881
2887
|
B != null && B.error ? v(B.error) : C(B == null ? void 0 : B[c]), _ && _(B == null ? void 0 : B[c]);
|
2882
2888
|
}).catch((B) => {
|
2883
2889
|
console.error(B), v("Erro ao enviar o arquivo");
|
2884
|
-
}).finally(() =>
|
2890
|
+
}).finally(() => T(!1));
|
2885
2891
|
}
|
2886
|
-
function
|
2887
|
-
h ||
|
2892
|
+
function S(j) {
|
2893
|
+
h || G(j);
|
2888
2894
|
}
|
2889
|
-
const b = g ||
|
2895
|
+
const b = g || x;
|
2890
2896
|
return /* @__PURE__ */ k(ye, { children: [
|
2891
2897
|
n && /* @__PURE__ */ f(me, { showAsterisk: r, children: n }),
|
2892
2898
|
/* @__PURE__ */ k("div", { className: `arkynFileUpload ${b ? "hasError" : "noHasError"} ${w ? "hasFile" : "noHasFile"}`, children: [
|
@@ -2898,7 +2904,7 @@ function Ac(e) {
|
|
2898
2904
|
isLoading: L,
|
2899
2905
|
acceptFile: i,
|
2900
2906
|
dropFileText: d,
|
2901
|
-
handleSelectFile:
|
2907
|
+
handleSelectFile: S,
|
2902
2908
|
selectFileButtonText: u
|
2903
2909
|
}
|
2904
2910
|
),
|
@@ -2909,9 +2915,9 @@ function Ac(e) {
|
|
2909
2915
|
isLoading: L,
|
2910
2916
|
acceptFile: i,
|
2911
2917
|
file: w,
|
2912
|
-
handleSelectFile:
|
2918
|
+
handleSelectFile: S,
|
2913
2919
|
changeFileButtonText: l,
|
2914
|
-
reSendFile: b && w ? () =>
|
2920
|
+
reSendFile: b && w ? () => G(w) : void 0
|
2915
2921
|
}
|
2916
2922
|
)
|
2917
2923
|
] }),
|
@@ -3029,50 +3035,50 @@ function Ic(e) {
|
|
3029
3035
|
dropImageText: _ = "Ou arraste e solte a imagem aqui",
|
3030
3036
|
onChange: h,
|
3031
3037
|
disabled: m = !1
|
3032
|
-
} = e, { fieldErrors: g } = be(), y = g == null ? void 0 : g[t], [C,
|
3033
|
-
async function
|
3038
|
+
} = e, { fieldErrors: g } = be(), y = g == null ? void 0 : g[t], [C, x] = F(n), [v, w] = F(""), [H, L] = F(null), [T, G] = F(n), [S, b] = F(!1);
|
3039
|
+
async function O(I) {
|
3034
3040
|
if (m) return;
|
3035
3041
|
b(!0), L(I), w("");
|
3036
3042
|
const Z = new FormData();
|
3037
|
-
Z.append(o, I), await fetch(s, { method: i, body: Z }).then(async (
|
3038
|
-
|
3039
|
-
}).catch((
|
3040
|
-
console.error(
|
3043
|
+
Z.append(o, I), await fetch(s, { method: i, body: Z }).then(async (E) => await E.json()).then((E) => {
|
3044
|
+
E != null && E.error ? w(E.error) : x(E == null ? void 0 : E[l]), h && h(E == null ? void 0 : E[l]);
|
3045
|
+
}).catch((E) => {
|
3046
|
+
console.error(E), w("Erro ao enviar imagem");
|
3041
3047
|
}).finally(() => b(!1));
|
3042
3048
|
}
|
3043
3049
|
function M(I) {
|
3044
|
-
m || (
|
3050
|
+
m || (G(URL.createObjectURL(I)), O(I));
|
3045
3051
|
}
|
3046
|
-
const
|
3052
|
+
const P = y || v;
|
3047
3053
|
return /* @__PURE__ */ k(ye, { children: [
|
3048
3054
|
r && /* @__PURE__ */ f(me, { showAsterisk: a, children: r }),
|
3049
|
-
/* @__PURE__ */ k("div", { className: `arkynImageUpload ${
|
3055
|
+
/* @__PURE__ */ k("div", { className: `arkynImageUpload ${P ? "hasError" : "noHasError"} ${T ? "hasImage" : "noHasImage"}`, children: [
|
3050
3056
|
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: C || "" }),
|
3051
|
-
!
|
3057
|
+
!T && /* @__PURE__ */ f(
|
3052
3058
|
hs,
|
3053
3059
|
{
|
3054
3060
|
disabled: m,
|
3055
|
-
isLoading:
|
3061
|
+
isLoading: S,
|
3056
3062
|
acceptImage: c,
|
3057
3063
|
dropImageText: _,
|
3058
3064
|
handleSelectFile: M,
|
3059
3065
|
selectImageButtonText: d
|
3060
3066
|
}
|
3061
3067
|
),
|
3062
|
-
|
3068
|
+
T && /* @__PURE__ */ f(
|
3063
3069
|
gs,
|
3064
3070
|
{
|
3065
3071
|
disabled: m,
|
3066
|
-
isLoading:
|
3072
|
+
isLoading: S,
|
3067
3073
|
acceptImage: c,
|
3068
|
-
filePath:
|
3074
|
+
filePath: T,
|
3069
3075
|
handleSelectFile: M,
|
3070
3076
|
changeImageButtonText: u,
|
3071
|
-
reSendImage:
|
3077
|
+
reSendImage: P && H ? () => O(H) : void 0
|
3072
3078
|
}
|
3073
3079
|
)
|
3074
3080
|
] }),
|
3075
|
-
|
3081
|
+
P && /* @__PURE__ */ f(Fe, { children: P })
|
3076
3082
|
] });
|
3077
3083
|
}
|
3078
3084
|
function ps(e) {
|
@@ -3094,32 +3100,32 @@ function ps(e) {
|
|
3094
3100
|
errorMessage: g,
|
3095
3101
|
showAsterisk: y,
|
3096
3102
|
rightIcon: C,
|
3097
|
-
type:
|
3103
|
+
type: x = "text",
|
3098
3104
|
size: v = "md",
|
3099
3105
|
id: w,
|
3100
|
-
...
|
3101
|
-
} = e, { fieldErrors: L } = be(), [
|
3102
|
-
function
|
3103
|
-
|
3106
|
+
...H
|
3107
|
+
} = e, { fieldErrors: L } = be(), [T, G] = F(!1), S = oe(null), b = w || Ie(), O = g || (L == null ? void 0 : L[t]), M = !!O, P = n || u, D = { md: 20, lg: 20 }[v], B = C ? "right" : "left", I = B === "left" && u, Z = B === "right" && u;
|
3108
|
+
function E() {
|
3109
|
+
P || !(S != null && S.current) || (G(!0), S.current.focus());
|
3104
3110
|
}
|
3105
3111
|
function ie(X) {
|
3106
|
-
|
3112
|
+
G(!0), h && h(X);
|
3107
3113
|
}
|
3108
3114
|
function te(X) {
|
3109
|
-
|
3115
|
+
G(!1), m && m(X);
|
3110
3116
|
}
|
3111
|
-
if (
|
3117
|
+
if (x === "hidden")
|
3112
3118
|
return /* @__PURE__ */ f(
|
3113
3119
|
"input",
|
3114
3120
|
{
|
3115
3121
|
style: { display: "none" },
|
3116
3122
|
readOnly: !0,
|
3117
3123
|
type: "text",
|
3118
|
-
ref:
|
3119
|
-
...
|
3124
|
+
ref: S,
|
3125
|
+
...H
|
3120
3126
|
}
|
3121
3127
|
);
|
3122
|
-
const $ = `arkynInput ${c ? "hasPrefix" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${
|
3128
|
+
const $ = `arkynInput ${c ? "hasPrefix" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${P || _ || u ? "opacity" : ""} ${M ? "errored" : ""} ${T ? "focused" : ""} ${i}`;
|
3123
3129
|
return /* @__PURE__ */ k(ye, { children: [
|
3124
3130
|
o && /* @__PURE__ */ f(me, { showAsterisk: y, htmlFor: b, children: o }),
|
3125
3131
|
/* @__PURE__ */ k(
|
@@ -3127,7 +3133,7 @@ function ps(e) {
|
|
3127
3133
|
{
|
3128
3134
|
title: r,
|
3129
3135
|
style: a,
|
3130
|
-
onClick:
|
3136
|
+
onClick: E,
|
3131
3137
|
className: $,
|
3132
3138
|
children: [
|
3133
3139
|
/* @__PURE__ */ f(K, { iconSize: D, icon: c, className: "prefix" }),
|
@@ -3144,15 +3150,15 @@ function ps(e) {
|
|
3144
3150
|
/* @__PURE__ */ f(
|
3145
3151
|
"input",
|
3146
3152
|
{
|
3147
|
-
disabled:
|
3153
|
+
disabled: P,
|
3148
3154
|
readOnly: _,
|
3149
|
-
ref:
|
3155
|
+
ref: S,
|
3150
3156
|
onFocus: ie,
|
3151
3157
|
onBlur: te,
|
3152
|
-
type:
|
3158
|
+
type: x,
|
3153
3159
|
id: b,
|
3154
3160
|
name: t,
|
3155
|
-
...
|
3161
|
+
...H
|
3156
3162
|
}
|
3157
3163
|
),
|
3158
3164
|
/* @__PURE__ */ f(K, { show: !u, icon: C, iconSize: D }),
|
@@ -3169,7 +3175,7 @@ function ps(e) {
|
|
3169
3175
|
]
|
3170
3176
|
}
|
3171
3177
|
),
|
3172
|
-
|
3178
|
+
O && /* @__PURE__ */ f(Fe, { children: O })
|
3173
3179
|
] });
|
3174
3180
|
}
|
3175
3181
|
const ys = gn((e, t) => /* @__PURE__ */ f("input", { ref: t, ...e }));
|
@@ -3192,27 +3198,27 @@ function Rc(e) {
|
|
3192
3198
|
leftIcon: g,
|
3193
3199
|
readOnly: y,
|
3194
3200
|
onFocus: C,
|
3195
|
-
onBlur:
|
3201
|
+
onBlur: x,
|
3196
3202
|
errorMessage: v,
|
3197
3203
|
defaultValue: w,
|
3198
|
-
showAsterisk:
|
3204
|
+
showAsterisk: H,
|
3199
3205
|
rightIcon: L,
|
3200
|
-
size:
|
3201
|
-
id:
|
3202
|
-
...
|
3203
|
-
} = e, { fieldErrors: b } = be(), [
|
3206
|
+
size: T = "md",
|
3207
|
+
id: G,
|
3208
|
+
...S
|
3209
|
+
} = e, { fieldErrors: b } = be(), [O, M] = F(!1), P = oe(null), j = G || Ie(), D = v || (b == null ? void 0 : b[t]), B = !!D, I = n || m, E = { md: 20, lg: 20 }[T], ie = L ? "right" : "left", te = ie === "left" && m, J = ie === "right" && m;
|
3204
3210
|
function ve() {
|
3205
|
-
I || !(
|
3211
|
+
I || !(P != null && P.current) || (M(!0), P.current.focus());
|
3206
3212
|
}
|
3207
|
-
function ce(
|
3208
|
-
M(!0), C && C(
|
3213
|
+
function ce(z) {
|
3214
|
+
M(!0), C && C(z);
|
3209
3215
|
}
|
3210
|
-
function re(
|
3211
|
-
M(!1),
|
3216
|
+
function re(z) {
|
3217
|
+
M(!1), x && x(z);
|
3212
3218
|
}
|
3213
|
-
const Me = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${
|
3219
|
+
const Me = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${T} ${I || y || m ? "opacity" : ""} ${B ? "errored" : ""} ${O ? "focused" : ""} ${d}`;
|
3214
3220
|
return /* @__PURE__ */ k(ye, { children: [
|
3215
|
-
u && /* @__PURE__ */ f(me, { showAsterisk:
|
3221
|
+
u && /* @__PURE__ */ f(me, { showAsterisk: H, htmlFor: j, children: u }),
|
3216
3222
|
/* @__PURE__ */ k(
|
3217
3223
|
"section",
|
3218
3224
|
{
|
@@ -3221,17 +3227,17 @@ function Rc(e) {
|
|
3221
3227
|
onClick: ve,
|
3222
3228
|
className: Me,
|
3223
3229
|
children: [
|
3224
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3230
|
+
/* @__PURE__ */ f(K, { iconSize: E, icon: _, className: "prefix" }),
|
3225
3231
|
/* @__PURE__ */ f(
|
3226
3232
|
K,
|
3227
3233
|
{
|
3228
3234
|
show: te,
|
3229
|
-
iconSize:
|
3235
|
+
iconSize: E,
|
3230
3236
|
className: "spinner",
|
3231
3237
|
icon: Oe
|
3232
3238
|
}
|
3233
3239
|
),
|
3234
|
-
/* @__PURE__ */ f(K, { show: !m, icon: g, iconSize:
|
3240
|
+
/* @__PURE__ */ f(K, { show: !m, icon: g, iconSize: E }),
|
3235
3241
|
/* @__PURE__ */ f(
|
3236
3242
|
Ar,
|
3237
3243
|
{
|
@@ -3240,27 +3246,27 @@ function Rc(e) {
|
|
3240
3246
|
replacement: l,
|
3241
3247
|
separate: o,
|
3242
3248
|
showMask: c,
|
3243
|
-
ref:
|
3249
|
+
ref: P,
|
3244
3250
|
onFocus: ce,
|
3245
3251
|
onBlur: re,
|
3246
3252
|
disabled: I,
|
3247
3253
|
readOnly: y,
|
3248
3254
|
id: j,
|
3249
3255
|
name: t,
|
3250
|
-
...
|
3256
|
+
...S
|
3251
3257
|
}
|
3252
3258
|
),
|
3253
|
-
/* @__PURE__ */ f(K, { show: !m, icon: L, iconSize:
|
3259
|
+
/* @__PURE__ */ f(K, { show: !m, icon: L, iconSize: E }),
|
3254
3260
|
/* @__PURE__ */ f(
|
3255
3261
|
K,
|
3256
3262
|
{
|
3257
3263
|
show: J,
|
3258
|
-
iconSize:
|
3264
|
+
iconSize: E,
|
3259
3265
|
className: "spinner",
|
3260
3266
|
icon: Oe
|
3261
3267
|
}
|
3262
3268
|
),
|
3263
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3269
|
+
/* @__PURE__ */ f(K, { iconSize: E, icon: h, className: "suffix" })
|
3264
3270
|
]
|
3265
3271
|
}
|
3266
3272
|
),
|
@@ -3463,35 +3469,35 @@ function Lc(e) {
|
|
3463
3469
|
leftIcon: g,
|
3464
3470
|
onSearch: y,
|
3465
3471
|
onChange: C,
|
3466
|
-
onBlur:
|
3472
|
+
onBlur: x,
|
3467
3473
|
notFoundText: v = "Sem opções disponíveis",
|
3468
3474
|
onFocus: w,
|
3469
|
-
disabled:
|
3475
|
+
disabled: H = !1,
|
3470
3476
|
prefix: L,
|
3471
|
-
size:
|
3472
|
-
value:
|
3473
|
-
variant:
|
3474
|
-
} = e, { fieldErrors: b } = be(),
|
3475
|
-
function re(
|
3476
|
-
return ce.includes(
|
3477
|
-
}
|
3478
|
-
function ae(
|
3479
|
-
const le = n.find((vt) => vt.value ===
|
3477
|
+
size: T = "md",
|
3478
|
+
value: G,
|
3479
|
+
variant: S = "solid"
|
3480
|
+
} = e, { fieldErrors: b } = be(), O = oe(null), M = d || Ie(), P = i || (b == null ? void 0 : b[t]), j = !!P, D = H || c || l, I = { md: 20, lg: 20 }[T], [Z, E] = F(""), [ie, te] = F(!1), [J, ve] = F(o), ce = G || J;
|
3481
|
+
function re(z) {
|
3482
|
+
return ce.includes(z);
|
3483
|
+
}
|
3484
|
+
function ae(z) {
|
3485
|
+
const le = n.find((vt) => vt.value === z);
|
3480
3486
|
return (le == null ? void 0 : le.label) || "";
|
3481
3487
|
}
|
3482
3488
|
function $() {
|
3483
|
-
D || !(
|
3489
|
+
D || !(O != null && O.current) || ie || (te(!0), O.current.focus(), w && w());
|
3484
3490
|
}
|
3485
3491
|
function X() {
|
3486
|
-
te(!1),
|
3492
|
+
te(!1), x && O.current && O.current.blur();
|
3487
3493
|
}
|
3488
|
-
function Re(
|
3489
|
-
|
3494
|
+
function Re(z) {
|
3495
|
+
E(z), y && y(z);
|
3490
3496
|
}
|
3491
|
-
function Ze(
|
3492
|
-
re(
|
3497
|
+
function Ze(z) {
|
3498
|
+
re(z) ? (ve(J.filter((le) => le !== z)), C && C(J.filter((le) => le !== z))) : (ve([...J, z]), C && C([...J, z])), s && X();
|
3493
3499
|
}
|
3494
|
-
const Me = n.filter((
|
3500
|
+
const Me = n.filter((z) => !!(e.onSearch || !e.isSearchable || z.label.toLowerCase().includes(Z.toLowerCase())));
|
3495
3501
|
return /* @__PURE__ */ k(ye, { children: [
|
3496
3502
|
_ && /* @__PURE__ */ f(me, { showAsterisk: m, children: _ }),
|
3497
3503
|
/* @__PURE__ */ k(
|
@@ -3503,8 +3509,8 @@ function Lc(e) {
|
|
3503
3509
|
isFocused: ie,
|
3504
3510
|
isLoading: c,
|
3505
3511
|
readOnly: l,
|
3506
|
-
size:
|
3507
|
-
variant:
|
3512
|
+
size: T,
|
3513
|
+
variant: S,
|
3508
3514
|
className: r,
|
3509
3515
|
prefixExists: !!L,
|
3510
3516
|
id: M,
|
@@ -3512,7 +3518,7 @@ function Lc(e) {
|
|
3512
3518
|
/* @__PURE__ */ f(
|
3513
3519
|
"input",
|
3514
3520
|
{
|
3515
|
-
ref:
|
3521
|
+
ref: O,
|
3516
3522
|
name: t,
|
3517
3523
|
value: JSON.stringify(ce),
|
3518
3524
|
type: "hidden"
|
@@ -3520,16 +3526,16 @@ function Lc(e) {
|
|
3520
3526
|
),
|
3521
3527
|
/* @__PURE__ */ f(K, { iconSize: I, icon: L, className: "prefix" }),
|
3522
3528
|
g && /* @__PURE__ */ f(g, { size: I, strokeWidth: 2.5 }),
|
3523
|
-
/* @__PURE__ */ k(xs, { size:
|
3524
|
-
ce.map((
|
3529
|
+
/* @__PURE__ */ k(xs, { size: T, children: [
|
3530
|
+
ce.map((z) => /* @__PURE__ */ f(
|
3525
3531
|
Es,
|
3526
3532
|
{
|
3527
|
-
label: ae(
|
3528
|
-
value:
|
3533
|
+
label: ae(z),
|
3534
|
+
value: z,
|
3529
3535
|
handleChangeValue: Ze,
|
3530
3536
|
disabled: D
|
3531
3537
|
},
|
3532
|
-
|
3538
|
+
z
|
3533
3539
|
)),
|
3534
3540
|
ce.length <= 0 && /* @__PURE__ */ f("p", { children: a })
|
3535
3541
|
] }),
|
@@ -3541,12 +3547,12 @@ function Lc(e) {
|
|
3541
3547
|
search: Z,
|
3542
3548
|
onSearch: Re,
|
3543
3549
|
children: [
|
3544
|
-
Me.map(({ label:
|
3550
|
+
Me.map(({ label: z, value: le }) => /* @__PURE__ */ f(
|
3545
3551
|
ws,
|
3546
3552
|
{
|
3547
|
-
label:
|
3553
|
+
label: z,
|
3548
3554
|
value: le,
|
3549
|
-
size:
|
3555
|
+
size: T,
|
3550
3556
|
handleChangeValue: Ze,
|
3551
3557
|
optionHasSelected: re
|
3552
3558
|
},
|
@@ -3571,7 +3577,7 @@ function Lc(e) {
|
|
3571
3577
|
]
|
3572
3578
|
}
|
3573
3579
|
),
|
3574
|
-
|
3580
|
+
P && /* @__PURE__ */ f(Fe, { children: P })
|
3575
3581
|
] });
|
3576
3582
|
}
|
3577
3583
|
function bn(e) {
|
@@ -3790,19 +3796,19 @@ function jc(e) {
|
|
3790
3796
|
searchCountryPlaceholder: m = "Pesquisar país",
|
3791
3797
|
notFoundCountryText: g = "Nenhum país encontrado",
|
3792
3798
|
id: y
|
3793
|
-
} = e, C = Ps(l), [
|
3799
|
+
} = e, C = Ps(l), [x, v] = F(!1), [w, H] = F(""), [L, T] = F(!1), [G, S] = F(C.formattedNumber || ""), [b, O] = F(() => {
|
3794
3800
|
if (C.country) return C.country;
|
3795
3801
|
const $ = nt.find((X) => X.iso === t);
|
3796
3802
|
return $ || nt[30];
|
3797
|
-
}), { fieldErrors: M } = be(),
|
3798
|
-
function
|
3799
|
-
I ||
|
3803
|
+
}), { fieldErrors: M } = be(), P = oe(null), j = y || Ie(), D = s || (M == null ? void 0 : M[_]), B = !!D, I = a || o, Z = oe(null);
|
3804
|
+
function E() {
|
3805
|
+
I || x || L || (v(!0), Z.current && Z.current.focus());
|
3800
3806
|
}
|
3801
3807
|
function ie() {
|
3802
|
-
|
3808
|
+
T(!0), v(!0);
|
3803
3809
|
}
|
3804
3810
|
function te() {
|
3805
|
-
|
3811
|
+
T(!1), v(!1);
|
3806
3812
|
}
|
3807
3813
|
function J() {
|
3808
3814
|
v(!0);
|
@@ -3818,7 +3824,7 @@ function jc(e) {
|
|
3818
3824
|
}
|
3819
3825
|
function ae($) {
|
3820
3826
|
let X = b.code;
|
3821
|
-
return b.prefix && (X += `-${b.prefix}`), X += " ", X += re($ ||
|
3827
|
+
return b.prefix && (X += `-${b.prefix}`), X += " ", X += re($ || G), X;
|
3822
3828
|
}
|
3823
3829
|
return /* @__PURE__ */ k(ye, { children: [
|
3824
3830
|
n && /* @__PURE__ */ f(me, { showAsterisk: d, children: n }),
|
@@ -3829,12 +3835,12 @@ function jc(e) {
|
|
3829
3835
|
disabled: I,
|
3830
3836
|
isError: B,
|
3831
3837
|
isLoading: o,
|
3832
|
-
isFocused:
|
3838
|
+
isFocused: x,
|
3833
3839
|
readOnly: i,
|
3834
3840
|
size: c,
|
3835
3841
|
variant: u,
|
3836
3842
|
className: r,
|
3837
|
-
onFocus:
|
3843
|
+
onFocus: E,
|
3838
3844
|
children: [
|
3839
3845
|
/* @__PURE__ */ f(
|
3840
3846
|
Ds,
|
@@ -3850,14 +3856,14 @@ function jc(e) {
|
|
3850
3856
|
isOpen: I || i ? !1 : L,
|
3851
3857
|
search: w,
|
3852
3858
|
placeholder: m,
|
3853
|
-
onSearch:
|
3859
|
+
onSearch: H,
|
3854
3860
|
children: [
|
3855
3861
|
nt.filter(($) => ce($)).map(($) => /* @__PURE__ */ f(
|
3856
3862
|
Rs,
|
3857
3863
|
{
|
3858
3864
|
country: $,
|
3859
3865
|
handleChangeValue: () => {
|
3860
|
-
|
3866
|
+
O($), T(!1), S($.mask);
|
3861
3867
|
},
|
3862
3868
|
isActive: $.iso === b.iso,
|
3863
3869
|
size: c
|
@@ -3881,20 +3887,20 @@ function jc(e) {
|
|
3881
3887
|
ref: Z,
|
3882
3888
|
readonly: i,
|
3883
3889
|
currentCountry: b,
|
3884
|
-
value:
|
3890
|
+
value: G,
|
3885
3891
|
disabled: I,
|
3886
3892
|
onBlur: ve,
|
3887
3893
|
onFocus: J,
|
3888
3894
|
size: c,
|
3889
3895
|
onChange: ($) => {
|
3890
|
-
|
3896
|
+
S($), h && h(ae($));
|
3891
3897
|
}
|
3892
3898
|
}
|
3893
3899
|
),
|
3894
3900
|
/* @__PURE__ */ f(
|
3895
3901
|
"input",
|
3896
3902
|
{
|
3897
|
-
ref:
|
3903
|
+
ref: P,
|
3898
3904
|
type: "hidden",
|
3899
3905
|
name: _,
|
3900
3906
|
value: ae()
|
@@ -3979,8 +3985,8 @@ function Hc(e) {
|
|
3979
3985
|
className: l = "",
|
3980
3986
|
...u
|
3981
3987
|
} = e, [d, _] = F(t), { fieldErrors: h } = be();
|
3982
|
-
function m(
|
3983
|
-
_(
|
3988
|
+
function m(x) {
|
3989
|
+
_(x), i && i(x);
|
3984
3990
|
}
|
3985
3991
|
const g = s || (h == null ? void 0 : h[n]), y = !!g, C = `arkynRadioGroup ${c} ${l}`;
|
3986
3992
|
return /* @__PURE__ */ k(ye, { children: [
|
@@ -4022,30 +4028,31 @@ function Gc(e) {
|
|
4022
4028
|
className: c = "",
|
4023
4029
|
onCheck: l,
|
4024
4030
|
id: u,
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4031
|
+
orientation: d,
|
4032
|
+
..._
|
4033
|
+
} = e, h = oe(null), m = u || Ie(), [g, y] = F(r), C = typeof a == "boolean" ? a : g;
|
4034
|
+
function x() {
|
4035
|
+
y(!g), l && l(C ? o : s || "checked");
|
4029
4036
|
}
|
4030
|
-
const
|
4031
|
-
return /* @__PURE__ */ k(ye, { children: [
|
4037
|
+
const w = `arkynSwitch ${C ? "checkedTrue" : "checkedFalse"} ${n} ${c}`;
|
4038
|
+
return /* @__PURE__ */ k(ye, { orientation: d, children: [
|
4032
4039
|
t && /* @__PURE__ */ f(me, { children: t }),
|
4033
4040
|
/* @__PURE__ */ f(
|
4034
4041
|
"button",
|
4035
4042
|
{
|
4036
4043
|
type: "button",
|
4037
|
-
onClick:
|
4038
|
-
className:
|
4039
|
-
...
|
4044
|
+
onClick: x,
|
4045
|
+
className: w,
|
4046
|
+
..._,
|
4040
4047
|
children: /* @__PURE__ */ f(
|
4041
4048
|
"input",
|
4042
4049
|
{
|
4043
|
-
id:
|
4050
|
+
id: m,
|
4044
4051
|
type: "hidden",
|
4045
4052
|
name: i,
|
4046
|
-
ref:
|
4047
|
-
onClick:
|
4048
|
-
value:
|
4053
|
+
ref: h,
|
4054
|
+
onClick: x,
|
4055
|
+
value: C ? s || "checked" : o
|
4049
4056
|
}
|
4050
4057
|
)
|
4051
4058
|
}
|
@@ -4153,15 +4160,15 @@ function Zc(e) {
|
|
4153
4160
|
style: h,
|
4154
4161
|
id: m,
|
4155
4162
|
...g
|
4156
|
-
} = e, { fieldErrors: y } = be(), [C,
|
4157
|
-
function
|
4158
|
-
s || !(v != null && v.current) || (
|
4163
|
+
} = e, { fieldErrors: y } = be(), [C, x] = F(!1), v = oe(null), w = m || Ie(), H = a || (y == null ? void 0 : y[l]), b = `arkynTextarea ${t} ${n} ${s || o ? "opacityTrue" : "opacityFalse"} ${!!H ? "errorTrue" : "errorFalse"} ${C ? "focusedTrue" : "focusedFalse"} ${r}`;
|
4164
|
+
function O() {
|
4165
|
+
s || !(v != null && v.current) || (x(!0), v.current.focus());
|
4159
4166
|
}
|
4160
4167
|
function M(j) {
|
4161
|
-
|
4168
|
+
x(!0), u && u(j);
|
4162
4169
|
}
|
4163
|
-
function
|
4164
|
-
|
4170
|
+
function P(j) {
|
4171
|
+
x(!1), d && d(j);
|
4165
4172
|
}
|
4166
4173
|
return /* @__PURE__ */ k(ye, { children: [
|
4167
4174
|
i && /* @__PURE__ */ f(me, { showAsterisk: c, children: i }),
|
@@ -4170,7 +4177,7 @@ function Zc(e) {
|
|
4170
4177
|
{
|
4171
4178
|
title: _,
|
4172
4179
|
style: h,
|
4173
|
-
onClick:
|
4180
|
+
onClick: O,
|
4174
4181
|
className: b,
|
4175
4182
|
children: /* @__PURE__ */ f(
|
4176
4183
|
"textarea",
|
@@ -4180,13 +4187,13 @@ function Zc(e) {
|
|
4180
4187
|
readOnly: o,
|
4181
4188
|
ref: v,
|
4182
4189
|
onFocus: M,
|
4183
|
-
onBlur:
|
4190
|
+
onBlur: P,
|
4184
4191
|
...g
|
4185
4192
|
}
|
4186
4193
|
)
|
4187
4194
|
}
|
4188
4195
|
),
|
4189
|
-
|
4196
|
+
H && /* @__PURE__ */ f(me, { children: H })
|
4190
4197
|
] });
|
4191
4198
|
}
|
4192
4199
|
const Gr = Ne({});
|
@@ -4458,8 +4465,8 @@ var ro = 1e3, ao = (e, t = "default") => {
|
|
4458
4465
|
}, [o]), l = tt(() => {
|
4459
4466
|
r && o({ type: 6, time: Date.now() });
|
4460
4467
|
}, [r, o]), u = tt((d, _) => {
|
4461
|
-
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height), C = y.findIndex((v) => v.id === d.id),
|
4462
|
-
return y.filter((v) => v.visible).slice(...h ? [
|
4468
|
+
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height), C = y.findIndex((v) => v.id === d.id), x = y.filter((v, w) => w < C && v.visible).length;
|
4469
|
+
return y.filter((v) => v.visible).slice(...h ? [x + 1] : [0, x]).reduce((v, w) => v + (w.height || 0) + m, 0);
|
4463
4470
|
}, [n]);
|
4464
4471
|
return Ce(() => {
|
4465
4472
|
n.forEach((d) => {
|
@@ -5453,37 +5460,37 @@ var qo = (e, t, n) => {
|
|
5453
5460
|
case "merge_node": {
|
5454
5461
|
var {
|
5455
5462
|
path: C
|
5456
|
-
} = n,
|
5457
|
-
if (W.isText(
|
5458
|
-
w.text +=
|
5459
|
-
else if (!W.isText(
|
5460
|
-
w.children.push(...
|
5463
|
+
} = n, x = N.get(e, C), v = p.previous(C), w = N.get(e, v), H = N.parent(e, C), L = C[C.length - 1];
|
5464
|
+
if (W.isText(x) && W.isText(w))
|
5465
|
+
w.text += x.text;
|
5466
|
+
else if (!W.isText(x) && !W.isText(w))
|
5467
|
+
w.children.push(...x.children);
|
5461
5468
|
else
|
5462
|
-
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(C, "] to nodes of different interfaces: ").concat(Ee.stringify(
|
5463
|
-
if (
|
5464
|
-
for (var [
|
5465
|
-
t[
|
5469
|
+
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(C, "] to nodes of different interfaces: ").concat(Ee.stringify(x), " ").concat(Ee.stringify(w)));
|
5470
|
+
if (H.children.splice(L, 1), t)
|
5471
|
+
for (var [T, G] of R.points(t))
|
5472
|
+
t[G] = U.transform(T, n);
|
5466
5473
|
break;
|
5467
5474
|
}
|
5468
5475
|
case "move_node": {
|
5469
5476
|
var {
|
5470
|
-
path:
|
5477
|
+
path: S,
|
5471
5478
|
newPath: b
|
5472
5479
|
} = n;
|
5473
|
-
if (p.isAncestor(
|
5474
|
-
throw new Error("Cannot move a path [".concat(
|
5475
|
-
var
|
5476
|
-
M.children.splice(
|
5477
|
-
var j = p.transform(
|
5478
|
-
if (D.children.splice(B, 0,
|
5480
|
+
if (p.isAncestor(S, b))
|
5481
|
+
throw new Error("Cannot move a path [".concat(S, "] to new path [").concat(b, "] because the destination is inside itself."));
|
5482
|
+
var O = N.get(e, S), M = N.parent(e, S), P = S[S.length - 1];
|
5483
|
+
M.children.splice(P, 1);
|
5484
|
+
var j = p.transform(S, n), D = N.get(e, p.parent(j)), B = j[j.length - 1];
|
5485
|
+
if (D.children.splice(B, 0, O), t)
|
5479
5486
|
for (var [I, Z] of R.points(t))
|
5480
5487
|
t[Z] = U.transform(I, n);
|
5481
5488
|
break;
|
5482
5489
|
}
|
5483
5490
|
case "remove_node": {
|
5484
5491
|
var {
|
5485
|
-
path:
|
5486
|
-
} = n, ie =
|
5492
|
+
path: E
|
5493
|
+
} = n, ie = E[E.length - 1], te = N.parent(e, E);
|
5487
5494
|
if (te.children.splice(ie, 1), t)
|
5488
5495
|
for (var [J, ve] of R.points(t)) {
|
5489
5496
|
var ce = U.transform(J, n);
|
@@ -5492,14 +5499,14 @@ var qo = (e, t, n) => {
|
|
5492
5499
|
else {
|
5493
5500
|
var re = void 0, ae = void 0;
|
5494
5501
|
for (var [$, X] of N.texts(e))
|
5495
|
-
if (p.compare(X,
|
5502
|
+
if (p.compare(X, E) === -1)
|
5496
5503
|
re = [$, X];
|
5497
5504
|
else {
|
5498
5505
|
ae = [$, X];
|
5499
5506
|
break;
|
5500
5507
|
}
|
5501
5508
|
var Re = !1;
|
5502
|
-
re && ae && (p.equals(ae[1],
|
5509
|
+
re && ae && (p.equals(ae[1], E) ? Re = !p.hasPrevious(ae[1]) : Re = p.common(re[1], E).length < p.common(ae[1], E).length), re && !Re ? (J.path = re[1], J.offset = re[0].text.length) : ae ? (J.path = ae[1], J.offset = 0) : t = null;
|
5503
5510
|
}
|
5504
5511
|
}
|
5505
5512
|
break;
|
@@ -5508,10 +5515,10 @@ var qo = (e, t, n) => {
|
|
5508
5515
|
var {
|
5509
5516
|
path: Ze,
|
5510
5517
|
offset: Me,
|
5511
|
-
text:
|
5518
|
+
text: z
|
5512
5519
|
} = n;
|
5513
|
-
if (
|
5514
|
-
var le = N.leaf(e, Ze), vt = le.text.slice(0, Me), qt = le.text.slice(Me +
|
5520
|
+
if (z.length === 0) break;
|
5521
|
+
var le = N.leaf(e, Ze), vt = le.text.slice(0, Me), qt = le.text.slice(Me + z.length);
|
5515
5522
|
if (le.text = vt + qt, t)
|
5516
5523
|
for (var [fe, De] of R.points(t))
|
5517
5524
|
t[De] = U.transform(fe, n);
|
@@ -6519,11 +6526,11 @@ var W = {
|
|
6519
6526
|
});
|
6520
6527
|
}
|
6521
6528
|
if (l > h) {
|
6522
|
-
var
|
6529
|
+
var x = l - h;
|
6523
6530
|
g = Te(Te({}, m), {}, {
|
6524
|
-
text: m.text.slice(0,
|
6531
|
+
text: m.text.slice(0, x)
|
6525
6532
|
}), m = Te(Te({}, m), {}, {
|
6526
|
-
text: m.text.slice(
|
6533
|
+
text: m.text.slice(x)
|
6527
6534
|
});
|
6528
6535
|
}
|
6529
6536
|
Object.assign(m, a), g && i.push(g), i.push(m), y && i.push(y);
|
@@ -6701,7 +6708,7 @@ var oa = {}, Sn = {}, Tn = {}, Ye = {}, On = {}, Pn = {};
|
|
6701
6708
|
}
|
6702
6709
|
e.isTag = n, e.Root = t.Root, e.Text = t.Text, e.Directive = t.Directive, e.Comment = t.Comment, e.Script = t.Script, e.Style = t.Style, e.Tag = t.Tag, e.CDATA = t.CDATA, e.Doctype = t.Doctype;
|
6703
6710
|
})(Pn);
|
6704
|
-
var
|
6711
|
+
var A = {}, Be = Y && Y.__extends || /* @__PURE__ */ function() {
|
6705
6712
|
var e = function(t, n) {
|
6706
6713
|
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, a) {
|
6707
6714
|
r.__proto__ = a;
|
@@ -6727,8 +6734,8 @@ var P = {}, Be = Y && Y.__extends || /* @__PURE__ */ function() {
|
|
6727
6734
|
return e;
|
6728
6735
|
}, lt.apply(this, arguments);
|
6729
6736
|
};
|
6730
|
-
Object.defineProperty(
|
6731
|
-
|
6737
|
+
Object.defineProperty(A, "__esModule", { value: !0 });
|
6738
|
+
A.cloneNode = A.hasChildren = A.isDocument = A.isDirective = A.isComment = A.isText = A.isCDATA = A.isTag = A.Element = A.Document = A.CDATA = A.NodeWithChildren = A.ProcessingInstruction = A.Comment = A.Text = A.DataNode = A.Node = void 0;
|
6732
6739
|
var _e = Pn, An = (
|
6733
6740
|
/** @class */
|
6734
6741
|
function() {
|
@@ -6780,7 +6787,7 @@ var _e = Pn, An = (
|
|
6780
6787
|
}, e;
|
6781
6788
|
}()
|
6782
6789
|
);
|
6783
|
-
|
6790
|
+
A.Node = An;
|
6784
6791
|
var jt = (
|
6785
6792
|
/** @class */
|
6786
6793
|
function(e) {
|
@@ -6805,7 +6812,7 @@ var jt = (
|
|
6805
6812
|
}), t;
|
6806
6813
|
}(An)
|
6807
6814
|
);
|
6808
|
-
|
6815
|
+
A.DataNode = jt;
|
6809
6816
|
var ia = (
|
6810
6817
|
/** @class */
|
6811
6818
|
function(e) {
|
@@ -6823,7 +6830,7 @@ var ia = (
|
|
6823
6830
|
}), t;
|
6824
6831
|
}(jt)
|
6825
6832
|
);
|
6826
|
-
|
6833
|
+
A.Text = ia;
|
6827
6834
|
var ca = (
|
6828
6835
|
/** @class */
|
6829
6836
|
function(e) {
|
@@ -6841,7 +6848,7 @@ var ca = (
|
|
6841
6848
|
}), t;
|
6842
6849
|
}(jt)
|
6843
6850
|
);
|
6844
|
-
|
6851
|
+
A.Comment = ca;
|
6845
6852
|
var la = (
|
6846
6853
|
/** @class */
|
6847
6854
|
function(e) {
|
@@ -6859,7 +6866,7 @@ var la = (
|
|
6859
6866
|
}), t;
|
6860
6867
|
}(jt)
|
6861
6868
|
);
|
6862
|
-
|
6869
|
+
A.ProcessingInstruction = la;
|
6863
6870
|
var Bt = (
|
6864
6871
|
/** @class */
|
6865
6872
|
function(e) {
|
@@ -6900,7 +6907,7 @@ var Bt = (
|
|
6900
6907
|
}), t;
|
6901
6908
|
}(An)
|
6902
6909
|
);
|
6903
|
-
|
6910
|
+
A.NodeWithChildren = Bt;
|
6904
6911
|
var ua = (
|
6905
6912
|
/** @class */
|
6906
6913
|
function(e) {
|
@@ -6918,7 +6925,7 @@ var ua = (
|
|
6918
6925
|
}), t;
|
6919
6926
|
}(Bt)
|
6920
6927
|
);
|
6921
|
-
|
6928
|
+
A.CDATA = ua;
|
6922
6929
|
var fa = (
|
6923
6930
|
/** @class */
|
6924
6931
|
function(e) {
|
@@ -6936,7 +6943,7 @@ var fa = (
|
|
6936
6943
|
}), t;
|
6937
6944
|
}(Bt)
|
6938
6945
|
);
|
6939
|
-
|
6946
|
+
A.Document = fa;
|
6940
6947
|
var da = (
|
6941
6948
|
/** @class */
|
6942
6949
|
function(e) {
|
@@ -6984,35 +6991,35 @@ var da = (
|
|
6984
6991
|
}), t;
|
6985
6992
|
}(Bt)
|
6986
6993
|
);
|
6987
|
-
|
6994
|
+
A.Element = da;
|
6988
6995
|
function _a(e) {
|
6989
6996
|
return (0, _e.isTag)(e);
|
6990
6997
|
}
|
6991
|
-
|
6998
|
+
A.isTag = _a;
|
6992
6999
|
function ma(e) {
|
6993
7000
|
return e.type === _e.ElementType.CDATA;
|
6994
7001
|
}
|
6995
|
-
|
7002
|
+
A.isCDATA = ma;
|
6996
7003
|
function ga(e) {
|
6997
7004
|
return e.type === _e.ElementType.Text;
|
6998
7005
|
}
|
6999
|
-
|
7006
|
+
A.isText = ga;
|
7000
7007
|
function ha(e) {
|
7001
7008
|
return e.type === _e.ElementType.Comment;
|
7002
7009
|
}
|
7003
|
-
|
7010
|
+
A.isComment = ha;
|
7004
7011
|
function pa(e) {
|
7005
7012
|
return e.type === _e.ElementType.Directive;
|
7006
7013
|
}
|
7007
|
-
|
7014
|
+
A.isDirective = pa;
|
7008
7015
|
function ya(e) {
|
7009
7016
|
return e.type === _e.ElementType.Root;
|
7010
7017
|
}
|
7011
|
-
|
7018
|
+
A.isDocument = ya;
|
7012
7019
|
function ii(e) {
|
7013
7020
|
return Object.prototype.hasOwnProperty.call(e, "children");
|
7014
7021
|
}
|
7015
|
-
|
7022
|
+
A.hasChildren = ii;
|
7016
7023
|
function In(e, t) {
|
7017
7024
|
t === void 0 && (t = !1);
|
7018
7025
|
var n;
|
@@ -7042,7 +7049,7 @@ function In(e, t) {
|
|
7042
7049
|
throw new Error("Not implemented yet: ".concat(e.type));
|
7043
7050
|
return n.startIndex = e.startIndex, n.endIndex = e.endIndex, e.sourceCodeLocation != null && (n.sourceCodeLocation = e.sourceCodeLocation), n;
|
7044
7051
|
}
|
7045
|
-
|
7052
|
+
A.cloneNode = In;
|
7046
7053
|
function Qt(e) {
|
7047
7054
|
for (var t = e.map(function(r) {
|
7048
7055
|
return In(r, !0);
|
@@ -7063,8 +7070,8 @@ function Qt(e) {
|
|
7063
7070
|
for (var l in i) l !== "default" && !Object.prototype.hasOwnProperty.call(c, l) && t(c, i, l);
|
7064
7071
|
};
|
7065
7072
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.DomHandler = void 0;
|
7066
|
-
var r = Pn, a =
|
7067
|
-
n(
|
7073
|
+
var r = Pn, a = A;
|
7074
|
+
n(A, e);
|
7068
7075
|
var s = {
|
7069
7076
|
withStartIndices: !1,
|
7070
7077
|
withEndIndices: !1,
|