@starasia/admin 3.22.0 → 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
|
|
@@ -2566,35 +2566,36 @@ const sn = te(
|
|
|
2566
2566
|
action: t,
|
|
2567
2567
|
rightContent: r,
|
|
2568
2568
|
leftContent: n,
|
|
2569
|
-
|
|
2570
|
-
|
|
2569
|
+
headerSlot: l,
|
|
2570
|
+
advanceFilter: i,
|
|
2571
|
+
showFilter: o = !0
|
|
2571
2572
|
}) => {
|
|
2572
|
-
const
|
|
2573
|
+
const s = ee("md"), a = () => t ? rt(t) ? t : /* @__PURE__ */ e(
|
|
2573
2574
|
u,
|
|
2574
2575
|
{
|
|
2575
2576
|
style: {
|
|
2576
2577
|
display: "flex",
|
|
2577
|
-
flexDirection:
|
|
2578
|
+
flexDirection: s ? "row" : "column",
|
|
2578
2579
|
gap: "8px",
|
|
2579
|
-
width:
|
|
2580
|
+
width: s ? "auto" : "100%",
|
|
2580
2581
|
textWrap: "nowrap"
|
|
2581
2582
|
},
|
|
2582
2583
|
children: t.map(
|
|
2583
|
-
({ title:
|
|
2584
|
+
({ title: h, icon: f, buttonProps: g, onClick: p }, y) => !h && !f ? null : /* @__PURE__ */ e(
|
|
2584
2585
|
B,
|
|
2585
2586
|
{
|
|
2586
|
-
fullWidth: !
|
|
2587
|
-
iconLeft:
|
|
2588
|
-
onClick:
|
|
2589
|
-
...
|
|
2590
|
-
children:
|
|
2587
|
+
fullWidth: !s,
|
|
2588
|
+
iconLeft: f ? /* @__PURE__ */ e(k, { name: f }) : void 0,
|
|
2589
|
+
onClick: p,
|
|
2590
|
+
...g,
|
|
2591
|
+
children: h
|
|
2591
2592
|
},
|
|
2592
|
-
`action-${
|
|
2593
|
+
`action-${y}`
|
|
2593
2594
|
)
|
|
2594
2595
|
)
|
|
2595
2596
|
}
|
|
2596
2597
|
) : null;
|
|
2597
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ e(
|
|
2598
2599
|
u,
|
|
2599
2600
|
{
|
|
2600
2601
|
style: {
|
|
@@ -2610,19 +2611,19 @@ const sn = te(
|
|
|
2610
2611
|
flexShrink: 0,
|
|
2611
2612
|
position: "relative",
|
|
2612
2613
|
zIndex: 10,
|
|
2613
|
-
flexDirection:
|
|
2614
|
+
flexDirection: s ? "row" : "column-reverse",
|
|
2614
2615
|
gap: "16px"
|
|
2615
2616
|
},
|
|
2616
|
-
children: [
|
|
2617
|
+
children: l || /* @__PURE__ */ d(J, { children: [
|
|
2617
2618
|
/* @__PURE__ */ d(u, { style: { display: "flex", gap: "8px", flexDirection: "row", alignItems: "center", flex: 1, minWidth: 0 }, children: [
|
|
2618
|
-
|
|
2619
|
+
o && /* @__PURE__ */ e(jr, { ...i }),
|
|
2619
2620
|
n
|
|
2620
2621
|
] }),
|
|
2621
2622
|
/* @__PURE__ */ d(u, { style: { display: "flex", gap: "8px", flexDirection: "row", alignItems: "center", flexShrink: 0 }, children: [
|
|
2622
2623
|
r,
|
|
2623
|
-
|
|
2624
|
+
a()
|
|
2624
2625
|
] })
|
|
2625
|
-
]
|
|
2626
|
+
] })
|
|
2626
2627
|
}
|
|
2627
2628
|
);
|
|
2628
2629
|
}, Ur = ({
|
|
@@ -2689,7 +2690,7 @@ const sn = te(
|
|
|
2689
2690
|
borderTop: "1px solid var(--sa-border-subtle, #0b120e24)",
|
|
2690
2691
|
flexShrink: 0
|
|
2691
2692
|
},
|
|
2692
|
-
children: i ? /* @__PURE__ */ d(
|
|
2693
|
+
children: i ? /* @__PURE__ */ d(J, { children: [
|
|
2693
2694
|
/* @__PURE__ */ d(u, { style: { display: "flex", flexDirection: "row", gap: "8px", alignItems: "center", textWrap: "nowrap" }, children: [
|
|
2694
2695
|
/* @__PURE__ */ e(C, { children: "Rows Per Page: " }),
|
|
2695
2696
|
/* @__PURE__ */ e(
|
|
@@ -3097,10 +3098,10 @@ const sn = te(
|
|
|
3097
3098
|
enableColumnResize: T = !1,
|
|
3098
3099
|
defaultColumnWidths: Z,
|
|
3099
3100
|
onColumnWidthsChange: j,
|
|
3100
|
-
defaultMinColumnWidth:
|
|
3101
|
+
defaultMinColumnWidth: G = 60,
|
|
3101
3102
|
sort: M,
|
|
3102
3103
|
defaultSort: fe,
|
|
3103
|
-
onSortChange:
|
|
3104
|
+
onSortChange: Q,
|
|
3104
3105
|
showActionDivider: V = !1
|
|
3105
3106
|
}) => {
|
|
3106
3107
|
const K = M !== void 0, [oe, ce] = A(
|
|
@@ -3112,8 +3113,8 @@ const sn = te(
|
|
|
3112
3113
|
const w = ae(x);
|
|
3113
3114
|
if (!w) return;
|
|
3114
3115
|
let v;
|
|
3115
|
-
!_ || _.key !== w ? v = { key: w, direction: "asc" } : _.direction === "asc" ? v = { key: w, direction: "desc" } : v = null, K || ce(v),
|
|
3116
|
-
},
|
|
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) => {
|
|
3117
3118
|
if (!w) return x;
|
|
3118
3119
|
if (typeof w == "function") return w(x);
|
|
3119
3120
|
if (typeof w == "string") return x[w];
|
|
@@ -3160,7 +3161,7 @@ const sn = te(
|
|
|
3160
3161
|
var Fe;
|
|
3161
3162
|
const ye = ke.current;
|
|
3162
3163
|
if (!ye) return;
|
|
3163
|
-
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));
|
|
3164
3165
|
Be(
|
|
3165
3166
|
(Qe) => Qe[ye.colIndex] === Ae ? Qe : { ...Qe, [ye.colIndex]: Ae }
|
|
3166
3167
|
);
|
|
@@ -3190,8 +3191,8 @@ const sn = te(
|
|
|
3190
3191
|
left: v ? L : void 0,
|
|
3191
3192
|
zIndex: v ? 4 : 2,
|
|
3192
3193
|
paddingLeft: w === 0 ? "12px" : "",
|
|
3193
|
-
borderRight: f && !pe && !v ?
|
|
3194
|
-
borderBottom: f ?
|
|
3194
|
+
borderRight: f && !pe && !v ? X : void 0,
|
|
3195
|
+
borderBottom: f ? X : void 0,
|
|
3195
3196
|
boxShadow: f && v ? he : void 0,
|
|
3196
3197
|
backgroundColor: "var(--sa-background-primary-inverse, #f8f8f8)",
|
|
3197
3198
|
textAlign: x.textAlign === "text-right" ? "right" : x.textAlign === "text-center" ? "center" : "left",
|
|
@@ -3325,7 +3326,7 @@ const sn = te(
|
|
|
3325
3326
|
top: 0,
|
|
3326
3327
|
right: 0,
|
|
3327
3328
|
zIndex: 3,
|
|
3328
|
-
borderBottom: f ?
|
|
3329
|
+
borderBottom: f ? X : void 0,
|
|
3329
3330
|
boxShadow: f && V ? de : void 0
|
|
3330
3331
|
}
|
|
3331
3332
|
}
|
|
@@ -3374,8 +3375,8 @@ const sn = te(
|
|
|
3374
3375
|
paddingLeft: L === 0 ? "12px" : "",
|
|
3375
3376
|
whiteSpace: "nowrap",
|
|
3376
3377
|
overflow: be ? "hidden" : void 0,
|
|
3377
|
-
borderLeft: v.showBorderLeft ?
|
|
3378
|
-
borderRight: v.showBorderRight ?
|
|
3378
|
+
borderLeft: v.showBorderLeft ? X : void 0,
|
|
3379
|
+
borderRight: v.showBorderRight ? X : void 0,
|
|
3379
3380
|
boxShadow: xe ? he : void 0,
|
|
3380
3381
|
textAlign: v.textAlign === "text-right" ? "right" : v.textAlign === "text-center" ? "center" : "left",
|
|
3381
3382
|
...m(L, v.width)
|
|
@@ -3501,7 +3502,7 @@ const Dn = Xr(Yr), st = ({
|
|
|
3501
3502
|
children: n,
|
|
3502
3503
|
loading: l,
|
|
3503
3504
|
isLoading: i
|
|
3504
|
-
}) => /* @__PURE__ */ e(
|
|
3505
|
+
}) => /* @__PURE__ */ e(J, { children: i ? l : t ? n : r }), N = (t) => /* @__PURE__ */ e(
|
|
3505
3506
|
C,
|
|
3506
3507
|
{
|
|
3507
3508
|
...t,
|
|
@@ -4025,7 +4026,7 @@ const di = (t) => {
|
|
|
4025
4026
|
}
|
|
4026
4027
|
n.current && n.current.click();
|
|
4027
4028
|
}, i = ee("md");
|
|
4028
|
-
return /* @__PURE__ */ d(
|
|
4029
|
+
return /* @__PURE__ */ d(J, { children: [
|
|
4029
4030
|
/* @__PURE__ */ e(
|
|
4030
4031
|
"input",
|
|
4031
4032
|
{
|
|
@@ -4718,7 +4719,7 @@ const Ct = {
|
|
|
4718
4719
|
maxFileSize: h = 2,
|
|
4719
4720
|
onError: f
|
|
4720
4721
|
}, g) => {
|
|
4721
|
-
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);
|
|
4722
4723
|
U(() => {
|
|
4723
4724
|
r === null && i(null);
|
|
4724
4725
|
}, [r]);
|
|
@@ -4731,14 +4732,14 @@ const Ct = {
|
|
|
4731
4732
|
var de;
|
|
4732
4733
|
const I = (de = z.target.files) == null ? void 0 : de[0];
|
|
4733
4734
|
if (!I) return;
|
|
4734
|
-
const
|
|
4735
|
-
|
|
4736
|
-
D(
|
|
4737
|
-
},
|
|
4735
|
+
const X = new FileReader();
|
|
4736
|
+
X.onload = () => {
|
|
4737
|
+
D(X.result), Z(!0);
|
|
4738
|
+
}, X.readAsDataURL(I);
|
|
4738
4739
|
}, ce = async () => {
|
|
4739
|
-
if (!(!H || !
|
|
4740
|
+
if (!(!H || !Q))
|
|
4740
4741
|
try {
|
|
4741
|
-
const z = await Di(H,
|
|
4742
|
+
const z = await Di(H, Q);
|
|
4742
4743
|
if (h && z.size > h * 1024 * 1024) {
|
|
4743
4744
|
f == null || f(`Ukuran file maksimal ${h}MB`);
|
|
4744
4745
|
return;
|
|
@@ -4759,8 +4760,8 @@ const Ct = {
|
|
|
4759
4760
|
}
|
|
4760
4761
|
}));
|
|
4761
4762
|
const se = parseInt(o, 10), re = Ct[s];
|
|
4762
|
-
let
|
|
4763
|
-
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(
|
|
4764
4765
|
u,
|
|
4765
4766
|
{
|
|
4766
4767
|
display: "flex",
|
|
@@ -4774,7 +4775,7 @@ const Ct = {
|
|
|
4774
4775
|
align: "center",
|
|
4775
4776
|
justify: "center",
|
|
4776
4777
|
style: {
|
|
4777
|
-
width: a != null && a.fullWidth ? "100%" : `${
|
|
4778
|
+
width: a != null && a.fullWidth ? "100%" : `${Y}px`,
|
|
4778
4779
|
height: a != null && a.fullWidth ? "auto" : `${q}px`,
|
|
4779
4780
|
aspectRatio: re,
|
|
4780
4781
|
flexShrink: 0
|
|
@@ -4911,7 +4912,7 @@ const Ct = {
|
|
|
4911
4912
|
borderRadius: "var(--sa-radii-md)",
|
|
4912
4913
|
boxShadow: "0 20px 60px rgba(0,0,0,0.3)",
|
|
4913
4914
|
overflow: "hidden",
|
|
4914
|
-
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)",
|
|
4915
4916
|
display: "flex",
|
|
4916
4917
|
flexDirection: "column"
|
|
4917
4918
|
},
|
|
@@ -4933,7 +4934,7 @@ const Ct = {
|
|
|
4933
4934
|
crop: j,
|
|
4934
4935
|
zoom: M,
|
|
4935
4936
|
aspect: s ? Ct[s] : void 0,
|
|
4936
|
-
onCropChange:
|
|
4937
|
+
onCropChange: G,
|
|
4937
4938
|
onZoomChange: fe,
|
|
4938
4939
|
onCropComplete: K,
|
|
4939
4940
|
objectFit: "contain",
|
|
@@ -5310,7 +5311,7 @@ const Ct = {
|
|
|
5310
5311
|
accent: "#78867F"
|
|
5311
5312
|
};
|
|
5312
5313
|
function Si({ width: t, height: r }) {
|
|
5313
|
-
return /* @__PURE__ */ e(
|
|
5314
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5314
5315
|
"svg",
|
|
5315
5316
|
{
|
|
5316
5317
|
width: t || "100",
|
|
@@ -5467,9 +5468,9 @@ const _n = ({
|
|
|
5467
5468
|
const g = () => {
|
|
5468
5469
|
switch (l) {
|
|
5469
5470
|
case "primary":
|
|
5470
|
-
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 }) });
|
|
5471
5472
|
case "secondary":
|
|
5472
|
-
return /* @__PURE__ */ e(
|
|
5473
|
+
return /* @__PURE__ */ e(J, { children: o ? /* @__PURE__ */ e(B, { secondary: !0, iconLeft: o, onClick: n, children: i ? /* @__PURE__ */ e(
|
|
5473
5474
|
C,
|
|
5474
5475
|
{
|
|
5475
5476
|
fontFamily: "Poppins",
|
|
@@ -5480,9 +5481,9 @@ const _n = ({
|
|
|
5480
5481
|
}
|
|
5481
5482
|
) : t }) : /* @__PURE__ */ e(B, { secondary: !0, onClick: n, children: h || t }) });
|
|
5482
5483
|
case "success":
|
|
5483
|
-
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 }) });
|
|
5484
5485
|
default:
|
|
5485
|
-
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 }) });
|
|
5486
5487
|
}
|
|
5487
5488
|
};
|
|
5488
5489
|
return /* @__PURE__ */ d(
|
|
@@ -5524,7 +5525,7 @@ const _n = ({
|
|
|
5524
5525
|
cFFFFFF: "#FFFFFF"
|
|
5525
5526
|
};
|
|
5526
5527
|
function Ei({ width: t, height: r }) {
|
|
5527
|
-
return /* @__PURE__ */ e(
|
|
5528
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5528
5529
|
"svg",
|
|
5529
5530
|
{
|
|
5530
5531
|
width: t,
|
|
@@ -5784,7 +5785,7 @@ const W = {
|
|
|
5784
5785
|
cFFFFFF: "#FFFFFF"
|
|
5785
5786
|
};
|
|
5786
5787
|
function Mi({ width: t, height: r }) {
|
|
5787
|
-
return /* @__PURE__ */ e(
|
|
5788
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
5788
5789
|
"svg",
|
|
5789
5790
|
{
|
|
5790
5791
|
width: t,
|
|
@@ -6035,7 +6036,7 @@ const c = {
|
|
|
6035
6036
|
cFFFFFF: "#FFFFFF"
|
|
6036
6037
|
};
|
|
6037
6038
|
function Li({ width: t, height: r }) {
|
|
6038
|
-
return /* @__PURE__ */ e(
|
|
6039
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ d(
|
|
6039
6040
|
"svg",
|
|
6040
6041
|
{
|
|
6041
6042
|
width: t,
|
|
@@ -6826,12 +6827,12 @@ const Jn = (t) => {
|
|
|
6826
6827
|
footerProps: D = { borderTop: !0 },
|
|
6827
6828
|
variantTag: T = "info"
|
|
6828
6829
|
}) => {
|
|
6829
|
-
const Z = le(null), [j,
|
|
6830
|
+
const Z = le(null), [j, G] = A("100vh");
|
|
6830
6831
|
U(() => {
|
|
6831
6832
|
const V = () => {
|
|
6832
6833
|
if (Z.current) {
|
|
6833
6834
|
const K = Z.current.getBoundingClientRect().top;
|
|
6834
|
-
|
|
6835
|
+
G(`calc(100vh - ${K}px)`);
|
|
6835
6836
|
}
|
|
6836
6837
|
};
|
|
6837
6838
|
return V(), window.addEventListener("resize", V), () => window.removeEventListener("resize", V);
|
|
@@ -6851,7 +6852,7 @@ const Jn = (t) => {
|
|
|
6851
6852
|
/* @__PURE__ */ e(u, { ...p, children: g ?? null })
|
|
6852
6853
|
]
|
|
6853
6854
|
}
|
|
6854
|
-
),
|
|
6855
|
+
), Q = !!(s || h || g);
|
|
6855
6856
|
return /* @__PURE__ */ d(
|
|
6856
6857
|
u,
|
|
6857
6858
|
{
|
|
@@ -6871,7 +6872,7 @@ const Jn = (t) => {
|
|
|
6871
6872
|
...(y == null ? void 0 : y.style) ?? {}
|
|
6872
6873
|
},
|
|
6873
6874
|
children: [
|
|
6874
|
-
s !== null &&
|
|
6875
|
+
s !== null && Q ? /* @__PURE__ */ e(zt, { ...H, children: fe() }) : null,
|
|
6875
6876
|
/* @__PURE__ */ e(
|
|
6876
6877
|
u,
|
|
6877
6878
|
{
|