@starasia/admin 3.21.9 → 3.23.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.es.js
CHANGED
|
@@ -54,7 +54,7 @@ export * from "@starasia/story-record";
|
|
|
54
54
|
import { Skeleton as Re } from "@starasia/skeleton";
|
|
55
55
|
export * from "@starasia/skeleton";
|
|
56
56
|
export * from "@starasia/progress-stepper";
|
|
57
|
-
import { jsx as e, jsxs as d, Fragment as
|
|
57
|
+
import { jsx as e, jsxs as d, Fragment as J } from "react/jsx-runtime";
|
|
58
58
|
import Ft, { createContext as St, useState as A, useContext as Et, useCallback as Ve, useMemo as De, memo as te, useEffect as U, useRef as le, useLayoutEffect as tt, isValidElement as rt, forwardRef as Mt, Children as Qt, useImperativeHandle as Yt } from "react";
|
|
59
59
|
import { useSearchParams as Je, useNavigate as ct, useLocation as ze, Outlet as ut, Link as Xt, useParams as Lt } from "react-router";
|
|
60
60
|
import Kt from "react-dom";
|
|
@@ -257,9 +257,9 @@ function cn({
|
|
|
257
257
|
logoutButton: y
|
|
258
258
|
}) {
|
|
259
259
|
var ke, Ne;
|
|
260
|
-
const [b] = Je(), H = b.get("embed") === "true", D = Bt(), { badges: T } = nr(), Z = ct(), j = ze(), M = !ee("md"), [fe,
|
|
260
|
+
const [b] = Je(), H = b.get("embed") === "true", D = Bt(), { badges: T } = nr(), Z = ct(), j = ze(), M = !ee("md"), [fe, Q] = A(!1), [V, K] = A(!1), [oe, ce] = A(!1), [_, ae] = A(!1), [se, re] = A(/* @__PURE__ */ new Set()), [Y, q] = A(null), { selectedGroupId: z, setSelectedGroupId: I } = Ht(), X = le(null), de = le(null);
|
|
261
261
|
U(() => {
|
|
262
|
-
const m =
|
|
262
|
+
const m = X.current;
|
|
263
263
|
if (!m) return;
|
|
264
264
|
const F = () => {
|
|
265
265
|
ve || (je = m.scrollTop);
|
|
@@ -267,7 +267,7 @@ function cn({
|
|
|
267
267
|
return m.addEventListener("scroll", F), () => m.removeEventListener("scroll", F);
|
|
268
268
|
}, []);
|
|
269
269
|
const he = () => {
|
|
270
|
-
const m =
|
|
270
|
+
const m = X.current;
|
|
271
271
|
m && je > 0 && (ve = !0, m.scrollTop = je, requestAnimationFrame(() => {
|
|
272
272
|
ve = !1;
|
|
273
273
|
}));
|
|
@@ -281,7 +281,7 @@ function cn({
|
|
|
281
281
|
}, []), tt(() => {
|
|
282
282
|
D.menus.length > 0 && (je > 0 ? he() : requestAnimationFrame(() => {
|
|
283
283
|
var F;
|
|
284
|
-
const m = (F =
|
|
284
|
+
const m = (F = X.current) == null ? void 0 : F.querySelector(
|
|
285
285
|
"[data-menu-active='true']"
|
|
286
286
|
);
|
|
287
287
|
m && m.scrollIntoView({ block: "center", behavior: "instant" });
|
|
@@ -302,11 +302,11 @@ function cn({
|
|
|
302
302
|
M && K(!0);
|
|
303
303
|
}, [M]);
|
|
304
304
|
const Me = () => {
|
|
305
|
-
|
|
305
|
+
Q(!0);
|
|
306
306
|
}, Ie = () => {
|
|
307
|
-
|
|
307
|
+
Q(!1);
|
|
308
308
|
}, Ge = () => {
|
|
309
|
-
|
|
309
|
+
Q(!1), i();
|
|
310
310
|
}, Te = (m) => {
|
|
311
311
|
const F = [m.to];
|
|
312
312
|
return m.children && F.push(...m.children.map((S) => S.to)), F;
|
|
@@ -428,7 +428,7 @@ function cn({
|
|
|
428
428
|
]
|
|
429
429
|
}
|
|
430
430
|
),
|
|
431
|
-
(!V || M) && /* @__PURE__ */ d(
|
|
431
|
+
(!V || M) && /* @__PURE__ */ d(J, { children: [
|
|
432
432
|
/* @__PURE__ */ e(
|
|
433
433
|
"span",
|
|
434
434
|
{
|
|
@@ -608,7 +608,7 @@ function cn({
|
|
|
608
608
|
})()
|
|
609
609
|
] }, m.id);
|
|
610
610
|
};
|
|
611
|
-
return /* @__PURE__ */ d(
|
|
611
|
+
return /* @__PURE__ */ d(J, { children: [
|
|
612
612
|
/* @__PURE__ */ d(
|
|
613
613
|
"div",
|
|
614
614
|
{
|
|
@@ -672,7 +672,7 @@ function cn({
|
|
|
672
672
|
},
|
|
673
673
|
children: (() => {
|
|
674
674
|
const m = !M && V && !oe, F = m && _;
|
|
675
|
-
return /* @__PURE__ */ d(
|
|
675
|
+
return /* @__PURE__ */ d(J, { children: [
|
|
676
676
|
/* @__PURE__ */ d(
|
|
677
677
|
"div",
|
|
678
678
|
{
|
|
@@ -822,7 +822,7 @@ function cn({
|
|
|
822
822
|
/* @__PURE__ */ e(
|
|
823
823
|
"div",
|
|
824
824
|
{
|
|
825
|
-
ref:
|
|
825
|
+
ref: X,
|
|
826
826
|
style: {
|
|
827
827
|
flex: 1,
|
|
828
828
|
overflowY: "auto",
|
|
@@ -1213,7 +1213,7 @@ function cn({
|
|
|
1213
1213
|
/* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(B, { primary: !0, onClick: Ge, children: "Yes, Sure" }) })
|
|
1214
1214
|
] }) }) })
|
|
1215
1215
|
] }),
|
|
1216
|
-
|
|
1216
|
+
Y && /* @__PURE__ */ d(J, { children: [
|
|
1217
1217
|
/* @__PURE__ */ e(
|
|
1218
1218
|
"div",
|
|
1219
1219
|
{
|
|
@@ -1230,11 +1230,11 @@ function cn({
|
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
role: "dialog",
|
|
1233
|
-
"aria-label":
|
|
1233
|
+
"aria-label": Y.item.title,
|
|
1234
1234
|
style: {
|
|
1235
1235
|
position: "fixed",
|
|
1236
|
-
top:
|
|
1237
|
-
left:
|
|
1236
|
+
top: Y.top,
|
|
1237
|
+
left: Y.left,
|
|
1238
1238
|
zIndex: 61,
|
|
1239
1239
|
minWidth: "13rem",
|
|
1240
1240
|
maxWidth: "16rem",
|
|
@@ -1259,10 +1259,10 @@ function cn({
|
|
|
1259
1259
|
textTransform: "uppercase",
|
|
1260
1260
|
letterSpacing: "0.05em"
|
|
1261
1261
|
},
|
|
1262
|
-
children:
|
|
1262
|
+
children: Y.item.title
|
|
1263
1263
|
}
|
|
1264
1264
|
),
|
|
1265
|
-
(Ne =
|
|
1265
|
+
(Ne = Y.item.children) == null ? void 0 : Ne.map((m) => {
|
|
1266
1266
|
const F = ie(m.to), S = Ye(
|
|
1267
1267
|
m.badge,
|
|
1268
1268
|
T[m.id]
|
|
@@ -1481,7 +1481,7 @@ function an({
|
|
|
1481
1481
|
}
|
|
1482
1482
|
t == null || t(f);
|
|
1483
1483
|
};
|
|
1484
|
-
return /* @__PURE__ */ d(
|
|
1484
|
+
return /* @__PURE__ */ d(J, { children: [
|
|
1485
1485
|
/* @__PURE__ */ d("div", { style: { position: "relative" }, children: [
|
|
1486
1486
|
/* @__PURE__ */ e(
|
|
1487
1487
|
"button",
|
|
@@ -1841,16 +1841,16 @@ const sn = te(
|
|
|
1841
1841
|
}
|
|
1842
1842
|
g(-1, { replace: !0 });
|
|
1843
1843
|
}, H = () => o ? rt(o) ? o : /* @__PURE__ */ e(u, { direction: "row", gap: "lg", children: o.map(
|
|
1844
|
-
({ title: j, icon:
|
|
1844
|
+
({ title: j, icon: G, buttonProps: M, onClick: fe }, Q) => !j && !G ? null : /* @__PURE__ */ e(
|
|
1845
1845
|
B,
|
|
1846
1846
|
{
|
|
1847
1847
|
fullWidth: !f,
|
|
1848
|
-
iconLeft:
|
|
1848
|
+
iconLeft: G ? /* @__PURE__ */ e(k, { name: G, size: "md" }) : void 0,
|
|
1849
1849
|
onClick: fe,
|
|
1850
1850
|
...M,
|
|
1851
1851
|
children: j
|
|
1852
1852
|
},
|
|
1853
|
-
`action-${
|
|
1853
|
+
`action-${Q}`
|
|
1854
1854
|
)
|
|
1855
1855
|
) }) : null, D = () => {
|
|
1856
1856
|
const j = /* @__PURE__ */ e(ur, { backButton: t });
|
|
@@ -1864,8 +1864,8 @@ const sn = te(
|
|
|
1864
1864
|
}
|
|
1865
1865
|
) }) : /* @__PURE__ */ e(u, { direction: "row", children: /* @__PURE__ */ e(Vt, { onClick: b, children: j }) });
|
|
1866
1866
|
}, T = () => {
|
|
1867
|
-
const j = !!r,
|
|
1868
|
-
return !j && !
|
|
1867
|
+
const j = !!r, G = rt(o) ? !0 : Array.isArray(o) && o.length > 0;
|
|
1868
|
+
return !j && !G && !y ? null : /* @__PURE__ */ d(
|
|
1869
1869
|
u,
|
|
1870
1870
|
{
|
|
1871
1871
|
gap: "xs",
|
|
@@ -1874,7 +1874,7 @@ const sn = te(
|
|
|
1874
1874
|
...h,
|
|
1875
1875
|
children: [
|
|
1876
1876
|
y && D(),
|
|
1877
|
-
(j ||
|
|
1877
|
+
(j || G) && /* @__PURE__ */ d(
|
|
1878
1878
|
u,
|
|
1879
1879
|
{
|
|
1880
1880
|
direction: f ? "row" : "column",
|
|
@@ -2342,7 +2342,7 @@ const sn = te(
|
|
|
2342
2342
|
titleSearchLabel: H = "Work Order",
|
|
2343
2343
|
withTitleLabels: D = !1
|
|
2344
2344
|
}) => {
|
|
2345
|
-
const Z = (y == null ? void 0 : y.isShowLabel) ?? !0, [j,
|
|
2345
|
+
const Z = (y == null ? void 0 : y.isShowLabel) ?? !0, [j, G] = A(!1), [M, fe] = A(0), Q = () => {
|
|
2346
2346
|
fe((I) => I + 1);
|
|
2347
2347
|
}, { searchParams: V, setSearchParams: K, getQueryParam: oe } = at(), ce = qe(V.toString()), _ = Nr(t, V, a) || "", [ae, se] = A(_), re = oe(a), q = !!(re && !(() => {
|
|
2348
2348
|
if (re)
|
|
@@ -2395,14 +2395,14 @@ const sn = te(
|
|
|
2395
2395
|
{
|
|
2396
2396
|
onClick: () => {
|
|
2397
2397
|
const I = new URLSearchParams(V);
|
|
2398
|
-
I.delete(a), K(I), se(""),
|
|
2398
|
+
I.delete(a), K(I), se(""), Q(), g && g();
|
|
2399
2399
|
},
|
|
2400
2400
|
variant: "outline",
|
|
2401
2401
|
tone: "neutral",
|
|
2402
2402
|
children: /* @__PURE__ */ e(C, { color: "error", fontWeight: "semibold", children: "Reset" })
|
|
2403
2403
|
}
|
|
2404
2404
|
) }),
|
|
2405
|
-
i == null ? void 0 : i.map(({ minWidth: I, content:
|
|
2405
|
+
i == null ? void 0 : i.map(({ minWidth: I, content: X, title: de, onClickContainer: he }, Me) => /* @__PURE__ */ d(
|
|
2406
2406
|
u,
|
|
2407
2407
|
{
|
|
2408
2408
|
gap: "sm",
|
|
@@ -2412,7 +2412,7 @@ const sn = te(
|
|
|
2412
2412
|
},
|
|
2413
2413
|
children: [
|
|
2414
2414
|
de && /* @__PURE__ */ e(me.SubH3, { children: de }),
|
|
2415
|
-
|
|
2415
|
+
X
|
|
2416
2416
|
]
|
|
2417
2417
|
},
|
|
2418
2418
|
`extended-filter-${Me}-${M}`
|
|
@@ -2433,7 +2433,7 @@ const sn = te(
|
|
|
2433
2433
|
}
|
|
2434
2434
|
),
|
|
2435
2435
|
fullWidth: !z,
|
|
2436
|
-
onClick: () =>
|
|
2436
|
+
onClick: () => G(!0),
|
|
2437
2437
|
children: Z ? "Filter" : void 0
|
|
2438
2438
|
}
|
|
2439
2439
|
),
|
|
@@ -2525,7 +2525,7 @@ const sn = te(
|
|
|
2525
2525
|
Zr,
|
|
2526
2526
|
{
|
|
2527
2527
|
isOpen: j,
|
|
2528
|
-
onClose: () =>
|
|
2528
|
+
onClose: () => G(!1),
|
|
2529
2529
|
filterKey: a,
|
|
2530
2530
|
filters: p,
|
|
2531
2531
|
pageKey: h
|
|
@@ -2565,35 +2565,37 @@ const sn = te(
|
|
|
2565
2565
|
}, _r = ({
|
|
2566
2566
|
action: t,
|
|
2567
2567
|
rightContent: r,
|
|
2568
|
-
|
|
2569
|
-
|
|
2568
|
+
leftContent: n,
|
|
2569
|
+
headerSlot: l,
|
|
2570
|
+
advanceFilter: i,
|
|
2571
|
+
showFilter: o = !0
|
|
2570
2572
|
}) => {
|
|
2571
|
-
const
|
|
2573
|
+
const s = ee("md"), a = () => t ? rt(t) ? t : /* @__PURE__ */ e(
|
|
2572
2574
|
u,
|
|
2573
2575
|
{
|
|
2574
2576
|
style: {
|
|
2575
2577
|
display: "flex",
|
|
2576
|
-
flexDirection:
|
|
2578
|
+
flexDirection: s ? "row" : "column",
|
|
2577
2579
|
gap: "8px",
|
|
2578
|
-
width:
|
|
2580
|
+
width: s ? "auto" : "100%",
|
|
2579
2581
|
textWrap: "nowrap"
|
|
2580
2582
|
},
|
|
2581
2583
|
children: t.map(
|
|
2582
|
-
({ title:
|
|
2584
|
+
({ title: h, icon: f, buttonProps: g, onClick: p }, y) => !h && !f ? null : /* @__PURE__ */ e(
|
|
2583
2585
|
B,
|
|
2584
2586
|
{
|
|
2585
|
-
fullWidth: !
|
|
2586
|
-
iconLeft:
|
|
2587
|
-
onClick:
|
|
2588
|
-
...
|
|
2589
|
-
children:
|
|
2587
|
+
fullWidth: !s,
|
|
2588
|
+
iconLeft: f ? /* @__PURE__ */ e(k, { name: f }) : void 0,
|
|
2589
|
+
onClick: p,
|
|
2590
|
+
...g,
|
|
2591
|
+
children: h
|
|
2590
2592
|
},
|
|
2591
|
-
`action-${
|
|
2593
|
+
`action-${y}`
|
|
2592
2594
|
)
|
|
2593
2595
|
)
|
|
2594
2596
|
}
|
|
2595
2597
|
) : null;
|
|
2596
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ e(
|
|
2597
2599
|
u,
|
|
2598
2600
|
{
|
|
2599
2601
|
style: {
|
|
@@ -2609,16 +2611,19 @@ const sn = te(
|
|
|
2609
2611
|
flexShrink: 0,
|
|
2610
2612
|
position: "relative",
|
|
2611
2613
|
zIndex: 10,
|
|
2612
|
-
flexDirection:
|
|
2614
|
+
flexDirection: s ? "row" : "column-reverse",
|
|
2613
2615
|
gap: "16px"
|
|
2614
2616
|
},
|
|
2615
|
-
children: [
|
|
2616
|
-
|
|
2617
|
-
|
|
2617
|
+
children: l || /* @__PURE__ */ d(J, { children: [
|
|
2618
|
+
/* @__PURE__ */ d(u, { style: { display: "flex", gap: "8px", flexDirection: "row", alignItems: "center", flex: 1, minWidth: 0 }, children: [
|
|
2619
|
+
o && /* @__PURE__ */ e(jr, { ...i }),
|
|
2620
|
+
n
|
|
2621
|
+
] }),
|
|
2622
|
+
/* @__PURE__ */ d(u, { style: { display: "flex", gap: "8px", flexDirection: "row", alignItems: "center", flexShrink: 0 }, children: [
|
|
2618
2623
|
r,
|
|
2619
|
-
|
|
2624
|
+
a()
|
|
2620
2625
|
] })
|
|
2621
|
-
]
|
|
2626
|
+
] })
|
|
2622
2627
|
}
|
|
2623
2628
|
);
|
|
2624
2629
|
}, Ur = ({
|
|
@@ -2685,7 +2690,7 @@ const sn = te(
|
|
|
2685
2690
|
borderTop: "1px solid var(--sa-border-subtle, #0b120e24)",
|
|
2686
2691
|
flexShrink: 0
|
|
2687
2692
|
},
|
|
2688
|
-
children: i ? /* @__PURE__ */ d(
|
|
2693
|
+
children: i ? /* @__PURE__ */ d(J, { children: [
|
|
2689
2694
|
/* @__PURE__ */ d(u, { style: { display: "flex", flexDirection: "row", gap: "8px", alignItems: "center", textWrap: "nowrap" }, children: [
|
|
2690
2695
|
/* @__PURE__ */ e(C, { children: "Rows Per Page: " }),
|
|
2691
2696
|
/* @__PURE__ */ e(
|
|
@@ -3093,10 +3098,10 @@ const sn = te(
|
|
|
3093
3098
|
enableColumnResize: T = !1,
|
|
3094
3099
|
defaultColumnWidths: Z,
|
|
3095
3100
|
onColumnWidthsChange: j,
|
|
3096
|
-
defaultMinColumnWidth:
|
|
3101
|
+
defaultMinColumnWidth: G = 60,
|
|
3097
3102
|
sort: M,
|
|
3098
3103
|
defaultSort: fe,
|
|
3099
|
-
onSortChange:
|
|
3104
|
+
onSortChange: Q,
|
|
3100
3105
|
showActionDivider: V = !1
|
|
3101
3106
|
}) => {
|
|
3102
3107
|
const K = M !== void 0, [oe, ce] = A(
|
|
@@ -3108,8 +3113,8 @@ const sn = te(
|
|
|
3108
3113
|
const w = ae(x);
|
|
3109
3114
|
if (!w) return;
|
|
3110
3115
|
let v;
|
|
3111
|
-
!_ || _.key !== w ? v = { key: w, direction: "asc" } : _.direction === "asc" ? v = { key: w, direction: "desc" } : v = null, K || ce(v),
|
|
3112
|
-
},
|
|
3116
|
+
!_ || _.key !== w ? v = { key: w, direction: "asc" } : _.direction === "asc" ? v = { key: w, direction: "desc" } : v = null, K || ce(v), Q == null || Q(v);
|
|
3117
|
+
}, Y = [n, l, i].filter((x) => x !== void 0).length, q = !!b, z = !!n || !!l || !!i || q, I = "var(--sa-border-subtle, #0b120e24)", X = `1px solid ${I}`, de = `inset 1px 0 0 ${I}`, he = `inset -1px 0 0 ${I}`, Me = Y === 3 ? q ? "178px" : "140px" : Y === 2 ? q ? "140px" : "102px" : Y === 1 ? q ? "112px" : "74px" : q ? "74px" : "", Ie = (x, w) => {
|
|
3113
3118
|
if (!w) return x;
|
|
3114
3119
|
if (typeof w == "function") return w(x);
|
|
3115
3120
|
if (typeof w == "string") return x[w];
|
|
@@ -3156,7 +3161,7 @@ const sn = te(
|
|
|
3156
3161
|
var Fe;
|
|
3157
3162
|
const ye = ke.current;
|
|
3158
3163
|
if (!ye) return;
|
|
3159
|
-
const Ze = ((Fe = t[ye.colIndex]) == null ? void 0 : Fe.minWidth) ??
|
|
3164
|
+
const Ze = ((Fe = t[ye.colIndex]) == null ? void 0 : Fe.minWidth) ?? G, Ae = Math.max(Ze, ye.startWidth + (xe.clientX - ye.startX));
|
|
3160
3165
|
Be(
|
|
3161
3166
|
(Qe) => Qe[ye.colIndex] === Ae ? Qe : { ...Qe, [ye.colIndex]: Ae }
|
|
3162
3167
|
);
|
|
@@ -3186,8 +3191,8 @@ const sn = te(
|
|
|
3186
3191
|
left: v ? L : void 0,
|
|
3187
3192
|
zIndex: v ? 4 : 2,
|
|
3188
3193
|
paddingLeft: w === 0 ? "12px" : "",
|
|
3189
|
-
borderRight: f && !pe && !v ?
|
|
3190
|
-
borderBottom: f ?
|
|
3194
|
+
borderRight: f && !pe && !v ? X : void 0,
|
|
3195
|
+
borderBottom: f ? X : void 0,
|
|
3191
3196
|
boxShadow: f && v ? he : void 0,
|
|
3192
3197
|
backgroundColor: "var(--sa-background-primary-inverse, #f8f8f8)",
|
|
3193
3198
|
textAlign: x.textAlign === "text-right" ? "right" : x.textAlign === "text-center" ? "center" : "left",
|
|
@@ -3321,7 +3326,7 @@ const sn = te(
|
|
|
3321
3326
|
top: 0,
|
|
3322
3327
|
right: 0,
|
|
3323
3328
|
zIndex: 3,
|
|
3324
|
-
borderBottom: f ?
|
|
3329
|
+
borderBottom: f ? X : void 0,
|
|
3325
3330
|
boxShadow: f && V ? de : void 0
|
|
3326
3331
|
}
|
|
3327
3332
|
}
|
|
@@ -3370,8 +3375,8 @@ const sn = te(
|
|
|
3370
3375
|
paddingLeft: L === 0 ? "12px" : "",
|
|
3371
3376
|
whiteSpace: "nowrap",
|
|
3372
3377
|
overflow: be ? "hidden" : void 0,
|
|
3373
|
-
borderLeft: v.showBorderLeft ?
|
|
3374
|
-
borderRight: v.showBorderRight ?
|
|
3378
|
+
borderLeft: v.showBorderLeft ? X : void 0,
|
|
3379
|
+
borderRight: v.showBorderRight ? X : void 0,
|
|
3375
3380
|
boxShadow: xe ? he : void 0,
|
|
3376
3381
|
textAlign: v.textAlign === "text-right" ? "right" : v.textAlign === "text-center" ? "center" : "left",
|
|
3377
3382
|
...m(L, v.width)
|
|
@@ -3497,7 +3502,7 @@ const Dn = Xr(Yr), st = ({
|
|
|
3497
3502
|
children: n,
|
|
3498
3503
|
loading: l,
|
|
3499
3504
|
isLoading: i
|
|
3500
|
-
}) => /* @__PURE__ */ e(
|
|
3505
|
+
}) => /* @__PURE__ */ e(J, { children: i ? l : t ? n : r }), N = (t) => /* @__PURE__ */ e(
|
|
3501
3506
|
C,
|
|
3502
3507
|
{
|
|
3503
3508
|
...t,
|
|
@@ -4021,7 +4026,7 @@ const di = (t) => {
|
|
|
4021
4026
|
}
|
|
4022
4027
|
n.current && n.current.click();
|
|
4023
4028
|
}, i = ee("md");
|
|
4024
|
-
return /* @__PURE__ */ d(
|
|
4029
|
+
return /* @__PURE__ */ d(J, { children: [
|
|
4025
4030
|
/* @__PURE__ */ e(
|
|
4026
4031
|
"input",
|
|
4027
4032
|
{
|
|
@@ -4714,7 +4719,7 @@ const Ct = {
|
|
|
4714
4719
|
maxFileSize: h = 2,
|
|
4715
4720
|
onError: f
|
|
4716
4721
|
}, g) => {
|
|
4717
|
-
const p = ee("md"), [y, b] = A(!1), [H, D] = A(null), [T, Z] = A(!1), [j,
|
|
4722
|
+
const p = ee("md"), [y, b] = A(!1), [H, D] = A(null), [T, Z] = A(!1), [j, G] = A({ x: 0, y: 0 }), [M, fe] = A(1), [Q, V] = A(null);
|
|
4718
4723
|
U(() => {
|
|
4719
4724
|
r === null && i(null);
|
|
4720
4725
|
}, [r]);
|
|
@@ -4727,14 +4732,14 @@ const Ct = {
|
|
|
4727
4732
|
var de;
|
|
4728
4733
|
const I = (de = z.target.files) == null ? void 0 : de[0];
|
|
4729
4734
|
if (!I) return;
|
|
4730
|
-
const
|
|
4731
|
-
|
|
4732
|
-
D(
|
|
4733
|
-
},
|
|
4735
|
+
const X = new FileReader();
|
|
4736
|
+
X.onload = () => {
|
|
4737
|
+
D(X.result), Z(!0);
|
|
4738
|
+
}, X.readAsDataURL(I);
|
|
4734
4739
|
}, ce = async () => {
|
|
4735
|
-
if (!(!H || !
|
|
4740
|
+
if (!(!H || !Q))
|
|
4736
4741
|
try {
|
|
4737
|
-
const z = await Di(H,
|
|
4742
|
+
const z = await Di(H, Q);
|
|
4738
4743
|
if (h && z.size > h * 1024 * 1024) {
|
|
4739
4744
|
f == null || f(`Ukuran file maksimal ${h}MB`);
|
|
4740
4745
|
return;
|
|
@@ -4755,8 +4760,8 @@ const Ct = {
|
|
|
4755
4760
|
}
|
|
4756
4761
|
}));
|
|
4757
4762
|
const se = parseInt(o, 10), re = Ct[s];
|
|
4758
|
-
let
|
|
4759
|
-
return re >= 1 ? (q = se,
|
|
4763
|
+
let Y, q;
|
|
4764
|
+
return re >= 1 ? (q = se, Y = se * re) : (Y = se, q = se / re), /* @__PURE__ */ d(
|
|
4760
4765
|
u,
|
|
4761
4766
|
{
|
|
4762
4767
|
display: "flex",
|
|
@@ -4770,7 +4775,7 @@ const Ct = {
|
|
|
4770
4775
|
align: "center",
|
|
4771
4776
|
justify: "center",
|
|
4772
4777
|
style: {
|
|
4773
|
-
width: a != null && a.fullWidth ? "100%" : `${
|
|
4778
|
+
width: a != null && a.fullWidth ? "100%" : `${Y}px`,
|
|
4774
4779
|
height: a != null && a.fullWidth ? "auto" : `${q}px`,
|
|
4775
4780
|
aspectRatio: re,
|
|
4776
4781
|
flexShrink: 0
|
|
@@ -4907,7 +4912,7 @@ const Ct = {
|
|
|
4907
4912
|
borderRadius: "var(--sa-radii-md)",
|
|
4908
4913
|
boxShadow: "0 20px 60px rgba(0,0,0,0.3)",
|
|
4909
4914
|
overflow: "hidden",
|
|
4910
|
-
width: p ? s === "1:1" ? "min(90vw, 480px)" : `min(90vw, ${
|
|
4915
|
+
width: p ? s === "1:1" ? "min(90vw, 480px)" : `min(90vw, ${Y * 2}px)` : "calc(100vw - 2rem)",
|
|
4911
4916
|
display: "flex",
|
|
4912
4917
|
flexDirection: "column"
|
|
4913
4918
|
},
|
|
@@ -4929,7 +4934,7 @@ const Ct = {
|
|
|
4929
4934
|
crop: j,
|
|
4930
4935
|
zoom: M,
|
|
4931
4936
|
aspect: s ? Ct[s] : void 0,
|
|
4932
|
-
onCropChange:
|
|
4937
|
+
onCropChange: G,
|
|
4933
4938
|
onZoomChange: fe,
|
|
4934
4939
|
onCropComplete: K,
|
|
4935
4940
|
objectFit: "contain",
|
|
@@ -5306,7 +5311,7 @@ const Ct = {
|
|
|
5306
5311
|
accent: "#78867F"
|
|
5307
5312
|
};
|
|
5308
5313
|
function Si({ width: t, height: r }) {
|
|
5309
|
-
return /* @__PURE__ */ e(
|
|
5314
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5310
5315
|
"svg",
|
|
5311
5316
|
{
|
|
5312
5317
|
width: t || "100",
|
|
@@ -5463,9 +5468,9 @@ const _n = ({
|
|
|
5463
5468
|
const g = () => {
|
|
5464
5469
|
switch (l) {
|
|
5465
5470
|
case "primary":
|
|
5466
|
-
return /* @__PURE__ */ e(
|
|
5471
|
+
return /* @__PURE__ */ e(J, { children: o ? /* @__PURE__ */ e(B, { primary: !0, iconLeft: o, onClick: n, children: h || t }) : /* @__PURE__ */ e(B, { primary: !0, onClick: n, children: h || t }) });
|
|
5467
5472
|
case "secondary":
|
|
5468
|
-
return /* @__PURE__ */ e(
|
|
5473
|
+
return /* @__PURE__ */ e(J, { children: o ? /* @__PURE__ */ e(B, { secondary: !0, iconLeft: o, onClick: n, children: i ? /* @__PURE__ */ e(
|
|
5469
5474
|
C,
|
|
5470
5475
|
{
|
|
5471
5476
|
fontFamily: "Poppins",
|
|
@@ -5476,9 +5481,9 @@ const _n = ({
|
|
|
5476
5481
|
}
|
|
5477
5482
|
) : t }) : /* @__PURE__ */ e(B, { secondary: !0, onClick: n, children: h || t }) });
|
|
5478
5483
|
case "success":
|
|
5479
|
-
return /* @__PURE__ */ e(
|
|
5484
|
+
return /* @__PURE__ */ e(J, { children: o ? /* @__PURE__ */ e(B, { success: !0, iconLeft: o, onClick: n, children: h || t }) : /* @__PURE__ */ e(B, { success: !0, onClick: n, children: h || t }) });
|
|
5480
5485
|
default:
|
|
5481
|
-
return /* @__PURE__ */ e(
|
|
5486
|
+
return /* @__PURE__ */ e(J, { children: o ? /* @__PURE__ */ e(B, { primary: !0, iconLeft: o, onClick: n, children: h || t }) : /* @__PURE__ */ e(B, { primary: !0, onClick: n, children: h || t }) });
|
|
5482
5487
|
}
|
|
5483
5488
|
};
|
|
5484
5489
|
return /* @__PURE__ */ d(
|
|
@@ -5520,7 +5525,7 @@ const _n = ({
|
|
|
5520
5525
|
cFFFFFF: "#FFFFFF"
|
|
5521
5526
|
};
|
|
5522
5527
|
function Ei({ width: t, height: r }) {
|
|
5523
|
-
return /* @__PURE__ */ e(
|
|
5528
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5524
5529
|
"svg",
|
|
5525
5530
|
{
|
|
5526
5531
|
width: t,
|
|
@@ -5780,7 +5785,7 @@ const W = {
|
|
|
5780
5785
|
cFFFFFF: "#FFFFFF"
|
|
5781
5786
|
};
|
|
5782
5787
|
function Mi({ width: t, height: r }) {
|
|
5783
|
-
return /* @__PURE__ */ e(
|
|
5788
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5784
5789
|
"svg",
|
|
5785
5790
|
{
|
|
5786
5791
|
width: t,
|
|
@@ -6031,7 +6036,7 @@ const c = {
|
|
|
6031
6036
|
cFFFFFF: "#FFFFFF"
|
|
6032
6037
|
};
|
|
6033
6038
|
function Li({ width: t, height: r }) {
|
|
6034
|
-
return /* @__PURE__ */ e(
|
|
6039
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
6035
6040
|
"svg",
|
|
6036
6041
|
{
|
|
6037
6042
|
width: t,
|
|
@@ -6822,12 +6827,12 @@ const Jn = (t) => {
|
|
|
6822
6827
|
footerProps: D = { borderTop: !0 },
|
|
6823
6828
|
variantTag: T = "info"
|
|
6824
6829
|
}) => {
|
|
6825
|
-
const Z = le(null), [j,
|
|
6830
|
+
const Z = le(null), [j, G] = A("100vh");
|
|
6826
6831
|
U(() => {
|
|
6827
6832
|
const V = () => {
|
|
6828
6833
|
if (Z.current) {
|
|
6829
6834
|
const K = Z.current.getBoundingClientRect().top;
|
|
6830
|
-
|
|
6835
|
+
G(`calc(100vh - ${K}px)`);
|
|
6831
6836
|
}
|
|
6832
6837
|
};
|
|
6833
6838
|
return V(), window.addEventListener("resize", V), () => window.removeEventListener("resize", V);
|
|
@@ -6847,7 +6852,7 @@ const Jn = (t) => {
|
|
|
6847
6852
|
/* @__PURE__ */ e(u, { ...p, children: g ?? null })
|
|
6848
6853
|
]
|
|
6849
6854
|
}
|
|
6850
|
-
),
|
|
6855
|
+
), Q = !!(s || h || g);
|
|
6851
6856
|
return /* @__PURE__ */ d(
|
|
6852
6857
|
u,
|
|
6853
6858
|
{
|
|
@@ -6867,7 +6872,7 @@ const Jn = (t) => {
|
|
|
6867
6872
|
...(y == null ? void 0 : y.style) ?? {}
|
|
6868
6873
|
},
|
|
6869
6874
|
children: [
|
|
6870
|
-
s !== null &&
|
|
6875
|
+
s !== null && Q ? /* @__PURE__ */ e(zt, { ...H, children: fe() }) : null,
|
|
6871
6876
|
/* @__PURE__ */ e(
|
|
6872
6877
|
u,
|
|
6873
6878
|
{
|