@starasia/admin 8.0.4 → 8.0.5
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.cjs.js +1 -1
- package/dist/index.es.js +102 -101
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -71,7 +71,7 @@ const Wr = {
|
|
|
71
71
|
userData: null,
|
|
72
72
|
setUserData: () => {
|
|
73
73
|
}
|
|
74
|
-
}, lr = nt(Wr), cr = () => We(lr),
|
|
74
|
+
}, lr = nt(Wr), cr = () => We(lr), zr = (t) => {
|
|
75
75
|
const [r, n] = B(
|
|
76
76
|
(t == null ? void 0 : t.initialUserData) || null
|
|
77
77
|
);
|
|
@@ -87,7 +87,7 @@ const Wr = {
|
|
|
87
87
|
},
|
|
88
88
|
clearBadge: () => {
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
90
|
+
}), Ar = ({ children: t }) => {
|
|
91
91
|
const [r, n] = B({}), o = G(
|
|
92
92
|
(c) => {
|
|
93
93
|
n(
|
|
@@ -126,7 +126,7 @@ const Wr = {
|
|
|
126
126
|
initialUserData: l,
|
|
127
127
|
theme: s
|
|
128
128
|
}) => {
|
|
129
|
-
const c =
|
|
129
|
+
const c = zr({ initialUserData: l }), { theme: h } = kr();
|
|
130
130
|
return /* @__PURE__ */ e(
|
|
131
131
|
lr.Provider,
|
|
132
132
|
{
|
|
@@ -138,7 +138,7 @@ const Wr = {
|
|
|
138
138
|
setUserData: c.setUserData,
|
|
139
139
|
menuBottom: n
|
|
140
140
|
},
|
|
141
|
-
children: /* @__PURE__ */ e(
|
|
141
|
+
children: /* @__PURE__ */ e(Ar, { children: s ? /* @__PURE__ */ e(Ht, { value: s, children: t }) : h ? /* @__PURE__ */ e(Ht, { value: h, children: t }) : t })
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
144
|
}, oo = Ce(Vr);
|
|
@@ -342,7 +342,7 @@ function so({
|
|
|
342
342
|
logoutButton: y
|
|
343
343
|
}) {
|
|
344
344
|
var Me, Je;
|
|
345
|
-
const [x] = it(), k = x.get("embed") === "true", p = cr(), { badges: E } = Ir(), M = St(), S = Ze(), C = !de("md"), [L,
|
|
345
|
+
const [x] = it(), k = x.get("embed") === "true", p = cr(), { badges: E } = Ir(), M = St(), S = Ze(), C = !de("md"), [L, z] = B(!1), [w, $] = B(!1), [K, X] = B(!1), [N, Y] = B(!1), [te, ue] = B(
|
|
346
346
|
() => new Set(Ot)
|
|
347
347
|
), [le, ie] = B(null), { selectedGroupId: P, setSelectedGroupId: q } = dr();
|
|
348
348
|
Z(() => {
|
|
@@ -379,7 +379,7 @@ function so({
|
|
|
379
379
|
}));
|
|
380
380
|
}, [p.menus]), Z(() => {
|
|
381
381
|
ke = !0, ye();
|
|
382
|
-
const b = setTimeout(ye, 0), V = setTimeout(ye, 50), R = setTimeout(ye, 100), D = setTimeout(ye, 200),
|
|
382
|
+
const b = setTimeout(ye, 0), V = setTimeout(ye, 50), R = setTimeout(ye, 100), D = setTimeout(ye, 200), A = setTimeout(() => {
|
|
383
383
|
ke = !1;
|
|
384
384
|
}, 300), W = setTimeout(() => {
|
|
385
385
|
const I = oe.current, O = I == null ? void 0 : I.querySelector("[data-menu-active='true']");
|
|
@@ -389,7 +389,7 @@ function so({
|
|
|
389
389
|
}
|
|
390
390
|
}, 250);
|
|
391
391
|
return () => {
|
|
392
|
-
clearTimeout(b), clearTimeout(V), clearTimeout(R), clearTimeout(D), clearTimeout(
|
|
392
|
+
clearTimeout(b), clearTimeout(V), clearTimeout(R), clearTimeout(D), clearTimeout(A), clearTimeout(W);
|
|
393
393
|
};
|
|
394
394
|
}, [S.pathname]), Z(() => {
|
|
395
395
|
ge.current && (ge.current.scrollTop = 0);
|
|
@@ -398,29 +398,29 @@ function so({
|
|
|
398
398
|
}, [S.pathname, C]), Z(() => {
|
|
399
399
|
C && $(!0);
|
|
400
400
|
}, [C]);
|
|
401
|
-
const
|
|
402
|
-
|
|
401
|
+
const ze = () => {
|
|
402
|
+
z(!0);
|
|
403
403
|
}, Pe = () => {
|
|
404
|
-
|
|
404
|
+
z(!1);
|
|
405
405
|
}, ct = () => {
|
|
406
|
-
|
|
406
|
+
z(!1), i();
|
|
407
407
|
}, qe = (b) => {
|
|
408
408
|
const V = [b.to];
|
|
409
409
|
return b.children && V.push(...b.children.map((R) => R.to)), V;
|
|
410
|
-
},
|
|
410
|
+
}, Ae = [
|
|
411
411
|
...p.menus.flatMap((b) => b.items.flatMap(qe)),
|
|
412
412
|
...((Me = p.menuBottom) == null ? void 0 : Me.flatMap(qe)) ?? []
|
|
413
413
|
], he = (b) => {
|
|
414
414
|
if (!S.pathname.startsWith(b)) return !1;
|
|
415
|
-
const V =
|
|
415
|
+
const V = Ae.filter((R) => S.pathname.startsWith(R)).sort((R, D) => D.length - R.length)[0];
|
|
416
416
|
return b === V;
|
|
417
417
|
};
|
|
418
418
|
Z(() => {
|
|
419
419
|
var V;
|
|
420
420
|
const b = (R) => {
|
|
421
421
|
var D;
|
|
422
|
-
(D = R.children) != null && D.some((
|
|
423
|
-
const W = new Set(
|
|
422
|
+
(D = R.children) != null && D.some((A) => S.pathname.startsWith(A.to)) && ue((A) => {
|
|
423
|
+
const W = new Set(A);
|
|
424
424
|
return W.add(R.id), W;
|
|
425
425
|
});
|
|
426
426
|
};
|
|
@@ -451,7 +451,7 @@ function so({
|
|
|
451
451
|
if (k)
|
|
452
452
|
return /* @__PURE__ */ e("main", { style: { height: "100vh", overflowY: "auto", backgroundColor: "var(--sa-background-primary-inverse, #f8f8f8)" }, children: t || /* @__PURE__ */ e(Tt, {}) });
|
|
453
453
|
const Le = (b) => {
|
|
454
|
-
const V = b.children && b.children.length > 0, R = te.has(b.id), D = V ? b.children.some((I) => he(I.to)) : he(b.to),
|
|
454
|
+
const V = b.children && b.children.length > 0, R = te.has(b.id), D = V ? b.children.some((I) => he(I.to)) : he(b.to), A = ut(b.badge, E[b.id]), W = !!A && w && !C;
|
|
455
455
|
return /* @__PURE__ */ u("div", { "data-menu-active": D || void 0, children: [
|
|
456
456
|
/* @__PURE__ */ u(
|
|
457
457
|
"button",
|
|
@@ -542,11 +542,11 @@ function so({
|
|
|
542
542
|
children: b.title
|
|
543
543
|
}
|
|
544
544
|
),
|
|
545
|
-
|
|
545
|
+
A && /* @__PURE__ */ e(
|
|
546
546
|
Ne,
|
|
547
547
|
{
|
|
548
|
-
text: String(
|
|
549
|
-
variant:
|
|
548
|
+
text: String(A.value),
|
|
549
|
+
variant: A.variant ?? "info",
|
|
550
550
|
size: "xs",
|
|
551
551
|
border: !0
|
|
552
552
|
}
|
|
@@ -1243,7 +1243,7 @@ function so({
|
|
|
1243
1243
|
"button",
|
|
1244
1244
|
{
|
|
1245
1245
|
type: "button",
|
|
1246
|
-
onClick:
|
|
1246
|
+
onClick: ze,
|
|
1247
1247
|
style: {
|
|
1248
1248
|
...jt,
|
|
1249
1249
|
color: "var(--sa-background-error, #c9184a)",
|
|
@@ -2018,7 +2018,7 @@ const $r = (t, r) => {
|
|
|
2018
2018
|
]
|
|
2019
2019
|
}
|
|
2020
2020
|
);
|
|
2021
|
-
},
|
|
2021
|
+
}, z = () => i;
|
|
2022
2022
|
return /* @__PURE__ */ u(
|
|
2023
2023
|
f,
|
|
2024
2024
|
{
|
|
@@ -2031,7 +2031,7 @@ const $r = (t, r) => {
|
|
|
2031
2031
|
},
|
|
2032
2032
|
children: [
|
|
2033
2033
|
L(),
|
|
2034
|
-
|
|
2034
|
+
z()
|
|
2035
2035
|
]
|
|
2036
2036
|
},
|
|
2037
2037
|
k.pathname
|
|
@@ -2403,7 +2403,7 @@ const $r = (t, r) => {
|
|
|
2403
2403
|
titleSearchLabel: k = "Work Order",
|
|
2404
2404
|
withTitleLabels: p = !1
|
|
2405
2405
|
}) => {
|
|
2406
|
-
const M = (y == null ? void 0 : y.isShowLabel) ?? !0, [S, T] = B(!1), [C, L] = B(0),
|
|
2406
|
+
const M = (y == null ? void 0 : y.isShowLabel) ?? !0, [S, T] = B(!1), [C, L] = B(0), z = () => {
|
|
2407
2407
|
L((q) => q + 1);
|
|
2408
2408
|
}, { searchParams: w, setSearchParams: $, getQueryParam: K } = Ee(), X = rt(w.toString()), N = fr(t, w, c) || "", [Y, te] = B(N), ue = K(c), ie = !!(ue && !(() => {
|
|
2409
2409
|
if (ue)
|
|
@@ -2456,14 +2456,14 @@ const $r = (t, r) => {
|
|
|
2456
2456
|
{
|
|
2457
2457
|
onClick: () => {
|
|
2458
2458
|
const q = new URLSearchParams(w);
|
|
2459
|
-
q.delete(c), $(q), te(""),
|
|
2459
|
+
q.delete(c), $(q), te(""), z(), m && m();
|
|
2460
2460
|
},
|
|
2461
2461
|
variant: "outline",
|
|
2462
2462
|
tone: "neutral",
|
|
2463
2463
|
children: /* @__PURE__ */ e(v, { color: "error", fontWeight: "semibold", children: "Reset" })
|
|
2464
2464
|
}
|
|
2465
2465
|
) }),
|
|
2466
|
-
i == null ? void 0 : i.map(({ minWidth: q, content: oe, title: ge, onClickContainer: ye },
|
|
2466
|
+
i == null ? void 0 : i.map(({ minWidth: q, content: oe, title: ge, onClickContainer: ye }, ze) => /* @__PURE__ */ u(
|
|
2467
2467
|
f,
|
|
2468
2468
|
{
|
|
2469
2469
|
direction: "column",
|
|
@@ -2477,7 +2477,7 @@ const $r = (t, r) => {
|
|
|
2477
2477
|
oe
|
|
2478
2478
|
]
|
|
2479
2479
|
},
|
|
2480
|
-
`extended-filter-${
|
|
2480
|
+
`extended-filter-${ze}-${C}`
|
|
2481
2481
|
)),
|
|
2482
2482
|
!!(g != null && g.length) && /* @__PURE__ */ e(
|
|
2483
2483
|
_,
|
|
@@ -2610,14 +2610,14 @@ function wn({
|
|
|
2610
2610
|
() => Object.fromEntries(t.map((C) => [C.key, C])),
|
|
2611
2611
|
[t]
|
|
2612
2612
|
), d = se(() => {
|
|
2613
|
-
const C = (l.get(n) || "").split(",").map((
|
|
2613
|
+
const C = (l.get(n) || "").split(",").map((z) => z.trim()).filter(Boolean);
|
|
2614
2614
|
let L = [];
|
|
2615
2615
|
try {
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2616
|
+
const z = l.get(r);
|
|
2617
|
+
z && (L = Object.keys(JSON.parse(z)).filter((w) => w !== i));
|
|
2618
2618
|
} catch {
|
|
2619
2619
|
}
|
|
2620
|
-
return t.map((
|
|
2620
|
+
return t.map((z) => z.key).filter((z) => C.includes(z) || L.includes(z));
|
|
2621
2621
|
}, [l, n, r, i, t]), m = G(
|
|
2622
2622
|
(C) => {
|
|
2623
2623
|
try {
|
|
@@ -2640,8 +2640,8 @@ function wn({
|
|
|
2640
2640
|
[d, g]
|
|
2641
2641
|
), x = G(
|
|
2642
2642
|
(C) => {
|
|
2643
|
-
const L = { ...c },
|
|
2644
|
-
|
|
2643
|
+
const L = { ...c }, z = d.filter(($) => $ !== C);
|
|
2644
|
+
z.length ? L[n] = z.join(",") : delete L[n];
|
|
2645
2645
|
const w = m(L);
|
|
2646
2646
|
C in w && (delete w[C], Object.keys(w).length ? L[r] = JSON.stringify(w) : delete L[r]), delete L[o], s(L);
|
|
2647
2647
|
},
|
|
@@ -2679,12 +2679,12 @@ function wn({
|
|
|
2679
2679
|
return L ? new Date(L) : void 0;
|
|
2680
2680
|
}
|
|
2681
2681
|
case "date-range": {
|
|
2682
|
-
const { start: L, end:
|
|
2682
|
+
const { start: L, end: z } = xn({
|
|
2683
2683
|
name: C.key,
|
|
2684
2684
|
searchParams: l,
|
|
2685
2685
|
filterKey: r
|
|
2686
2686
|
});
|
|
2687
|
-
return L &&
|
|
2687
|
+
return L && z ? { from: new Date(L), to: new Date(z) } : void 0;
|
|
2688
2688
|
}
|
|
2689
2689
|
default:
|
|
2690
2690
|
return;
|
|
@@ -2706,8 +2706,8 @@ function wn({
|
|
|
2706
2706
|
[c, s, r, o]
|
|
2707
2707
|
), M = G(
|
|
2708
2708
|
(C) => {
|
|
2709
|
-
const L = { ...c },
|
|
2710
|
-
C in
|
|
2709
|
+
const L = { ...c }, z = m(L);
|
|
2710
|
+
C in z && (delete z[C], Object.keys(z).length ? L[r] = JSON.stringify(z) : delete L[r]), delete L[o], s(L);
|
|
2711
2711
|
},
|
|
2712
2712
|
[c, r, o, m, s]
|
|
2713
2713
|
), S = G(() => {
|
|
@@ -3004,7 +3004,7 @@ const En = ({
|
|
|
3004
3004
|
{
|
|
3005
3005
|
variant: "outline",
|
|
3006
3006
|
tone: "neutral",
|
|
3007
|
-
size: "
|
|
3007
|
+
size: "xs",
|
|
3008
3008
|
iconRight: /* @__PURE__ */ e(F, { name: "ChevronSmallDown" }),
|
|
3009
3009
|
"aria-label": "Rows per page",
|
|
3010
3010
|
children: Jt(g)
|
|
@@ -3035,7 +3035,8 @@ const En = ({
|
|
|
3035
3035
|
rr,
|
|
3036
3036
|
{
|
|
3037
3037
|
size: "sm",
|
|
3038
|
-
variant: "
|
|
3038
|
+
variant: "neutral",
|
|
3039
|
+
siblingCount: 0,
|
|
3039
3040
|
currentPage: t != null && t.currentPage ? Number(t.currentPage) : 1,
|
|
3040
3041
|
totalCount: t != null && t.totalPage ? Number(t.totalPage) : 1,
|
|
3041
3042
|
onPageChange: y
|
|
@@ -3045,7 +3046,7 @@ const En = ({
|
|
|
3045
3046
|
)
|
|
3046
3047
|
] });
|
|
3047
3048
|
};
|
|
3048
|
-
function
|
|
3049
|
+
function zn(t, r, n = !0) {
|
|
3049
3050
|
Z(() => {
|
|
3050
3051
|
if (!n) return;
|
|
3051
3052
|
const o = (i) => {
|
|
@@ -3057,7 +3058,7 @@ function An(t, r, n = !0) {
|
|
|
3057
3058
|
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
3058
3059
|
}, [t, r, n]);
|
|
3059
3060
|
}
|
|
3060
|
-
const
|
|
3061
|
+
const An = 240, In = ({
|
|
3061
3062
|
searchKey: t = "q",
|
|
3062
3063
|
filterKey: r = "filter",
|
|
3063
3064
|
pageKey: n = "page",
|
|
@@ -3086,7 +3087,7 @@ const zn = 240, In = ({
|
|
|
3086
3087
|
return (L = E.current) == null ? void 0 : L.focus();
|
|
3087
3088
|
});
|
|
3088
3089
|
}, []);
|
|
3089
|
-
return
|
|
3090
|
+
return zn(i, M), // No internal gap: the trigger and the animated input are never visible at
|
|
3090
3091
|
// the same time, so spacing to neighbours is handled by the parent cluster.
|
|
3091
3092
|
/* @__PURE__ */ u(f, { display: "flex", direction: "row", align: "center", gap: "spacing-0", children: [
|
|
3092
3093
|
g && /* @__PURE__ */ e(
|
|
@@ -3095,7 +3096,7 @@ const zn = 240, In = ({
|
|
|
3095
3096
|
variant: "outline",
|
|
3096
3097
|
tone: "neutral",
|
|
3097
3098
|
size: "sm",
|
|
3098
|
-
iconLeft: /* @__PURE__ */ e(F, { name: "Search" }),
|
|
3099
|
+
iconLeft: /* @__PURE__ */ e(F, { name: "Search", size: "sm" }),
|
|
3099
3100
|
"aria-label": "Search",
|
|
3100
3101
|
"aria-expanded": !1,
|
|
3101
3102
|
onClick: M
|
|
@@ -3109,7 +3110,7 @@ const zn = 240, In = ({
|
|
|
3109
3110
|
},
|
|
3110
3111
|
style: {
|
|
3111
3112
|
position: "relative",
|
|
3112
|
-
width: d ?
|
|
3113
|
+
width: d ? An : 0,
|
|
3113
3114
|
overflow: "hidden",
|
|
3114
3115
|
transition: "width 220ms ease"
|
|
3115
3116
|
},
|
|
@@ -3125,8 +3126,8 @@ const zn = 240, In = ({
|
|
|
3125
3126
|
leftIcon: /* @__PURE__ */ e(F, { name: "Search", width: 16, height: 16 }),
|
|
3126
3127
|
onChange: (L) => k(L.target.value),
|
|
3127
3128
|
onKeyDown: (L) => {
|
|
3128
|
-
var
|
|
3129
|
-
L.key === "Escape" && !x && (m(!1), (
|
|
3129
|
+
var z;
|
|
3130
|
+
L.key === "Escape" && !x && (m(!1), (z = E.current) == null || z.blur());
|
|
3130
3131
|
},
|
|
3131
3132
|
onBlur: () => {
|
|
3132
3133
|
x || m(!1);
|
|
@@ -3182,7 +3183,7 @@ const zn = 240, In = ({
|
|
|
3182
3183
|
variant: "outline",
|
|
3183
3184
|
tone: "neutral",
|
|
3184
3185
|
size: "sm",
|
|
3185
|
-
iconLeft: /* @__PURE__ */ e(F, { name: "Grid" }),
|
|
3186
|
+
iconLeft: /* @__PURE__ */ e(F, { name: "Grid", size: "sm" }),
|
|
3186
3187
|
"aria-label": "Customize columns"
|
|
3187
3188
|
}
|
|
3188
3189
|
) }),
|
|
@@ -3311,7 +3312,7 @@ const zn = 240, In = ({
|
|
|
3311
3312
|
variant: t.length > 0 ? "secondary" : "outline",
|
|
3312
3313
|
tone: (t.length > 0, "neutral"),
|
|
3313
3314
|
size: "sm",
|
|
3314
|
-
iconLeft: /* @__PURE__ */ e(F, { name: "Bookmark" }),
|
|
3315
|
+
iconLeft: /* @__PURE__ */ e(F, { name: "Bookmark", size: "sm" }),
|
|
3315
3316
|
"aria-label": "Saved views"
|
|
3316
3317
|
}
|
|
3317
3318
|
) }),
|
|
@@ -3415,7 +3416,7 @@ const zn = 240, In = ({
|
|
|
3415
3416
|
configByKey: T,
|
|
3416
3417
|
hasActiveFilter: C,
|
|
3417
3418
|
toggleFilter: L,
|
|
3418
|
-
removeFilter:
|
|
3419
|
+
removeFilter: z,
|
|
3419
3420
|
getValue: w,
|
|
3420
3421
|
setValue: $,
|
|
3421
3422
|
clearValue: K,
|
|
@@ -3482,7 +3483,7 @@ const zn = 240, In = ({
|
|
|
3482
3483
|
getValue: w,
|
|
3483
3484
|
setValue: $,
|
|
3484
3485
|
clearValue: K,
|
|
3485
|
-
removeFilter:
|
|
3486
|
+
removeFilter: z
|
|
3486
3487
|
}
|
|
3487
3488
|
),
|
|
3488
3489
|
C && /* @__PURE__ */ e(_, { variant: "link", tone: "error", size: "sm", onClick: () => {
|
|
@@ -4107,7 +4108,7 @@ const zn = 240, In = ({
|
|
|
4107
4108
|
defaultMinColumnWidth: T = 60,
|
|
4108
4109
|
sort: C,
|
|
4109
4110
|
defaultSort: L,
|
|
4110
|
-
onSortChange:
|
|
4111
|
+
onSortChange: z,
|
|
4111
4112
|
showActionDivider: w = !1
|
|
4112
4113
|
}) => {
|
|
4113
4114
|
const $ = C !== void 0, [K, X] = B(
|
|
@@ -4116,51 +4117,51 @@ const zn = 240, In = ({
|
|
|
4116
4117
|
if (D.sortKey) return D.sortKey;
|
|
4117
4118
|
if (typeof D.accessor == "string") return D.accessor;
|
|
4118
4119
|
}, te = (D) => {
|
|
4119
|
-
const
|
|
4120
|
-
if (!
|
|
4120
|
+
const A = Y(D);
|
|
4121
|
+
if (!A) return;
|
|
4121
4122
|
let W;
|
|
4122
|
-
!N || N.key !==
|
|
4123
|
-
}, le = [n, o, i].filter((D) => D !== void 0).length, ie = !!x, P = !!n || !!o || !!i || ie, q = "var(--sa-border-subtle, #0b120e24)", oe = `1px solid ${q}`, ge = `inset 1px 0 0 ${q}`, ye = `inset -1px 0 0 ${q}`,
|
|
4124
|
-
if (!
|
|
4125
|
-
if (typeof
|
|
4126
|
-
if (typeof
|
|
4123
|
+
!N || N.key !== A ? W = { key: A, direction: "asc" } : N.direction === "asc" ? W = { key: A, direction: "desc" } : W = null, $ || X(W), z == null || z(W);
|
|
4124
|
+
}, le = [n, o, i].filter((D) => D !== void 0).length, ie = !!x, P = !!n || !!o || !!i || ie, q = "var(--sa-border-subtle, #0b120e24)", oe = `1px solid ${q}`, ge = `inset 1px 0 0 ${q}`, ye = `inset -1px 0 0 ${q}`, ze = le === 3 ? ie ? "178px" : "140px" : le === 2 ? ie ? "140px" : "102px" : le === 1 ? ie ? "112px" : "74px" : ie ? "74px" : "", Pe = (D, A) => {
|
|
4125
|
+
if (!A) return D;
|
|
4126
|
+
if (typeof A == "function") return A(D);
|
|
4127
|
+
if (typeof A == "string") return D[A];
|
|
4127
4128
|
}, [ct, qe] = B(!1);
|
|
4128
4129
|
Z(() => {
|
|
4129
4130
|
if (!(m != null && m.current)) return;
|
|
4130
4131
|
const D = m.current;
|
|
4131
4132
|
qe(D.scrollHeight > D.clientHeight);
|
|
4132
4133
|
}, [r, m]);
|
|
4133
|
-
const
|
|
4134
|
+
const Ae = ne(null), [he, Ge] = B([]), [Ie, Le] = B(
|
|
4134
4135
|
() => M ?? {}
|
|
4135
4136
|
), Me = ne(null);
|
|
4136
4137
|
xt(() => {
|
|
4137
|
-
if (!g || !
|
|
4138
|
+
if (!g || !Ae.current) {
|
|
4138
4139
|
Ge([]);
|
|
4139
4140
|
return;
|
|
4140
4141
|
}
|
|
4141
4142
|
const D = Array.from(
|
|
4142
|
-
|
|
4143
|
-
),
|
|
4143
|
+
Ae.current.querySelectorAll("thead tr th")
|
|
4144
|
+
), A = [];
|
|
4144
4145
|
let W = 0;
|
|
4145
4146
|
D.forEach((I, O) => {
|
|
4146
|
-
|
|
4147
|
-
}), Ge(
|
|
4147
|
+
A[O] = W, O < g && (W += I.offsetWidth);
|
|
4148
|
+
}), Ge(A);
|
|
4148
4149
|
}, [g, t, r, Ie]);
|
|
4149
4150
|
const Je = (D) => {
|
|
4150
4151
|
y && y(D < g ? D : D + 1);
|
|
4151
|
-
}, b = (D,
|
|
4152
|
+
}, b = (D, A) => {
|
|
4152
4153
|
const W = Ie[D];
|
|
4153
4154
|
if (W !== void 0) {
|
|
4154
4155
|
const I = `${W}px`;
|
|
4155
4156
|
return { width: I, minWidth: I, maxWidth: I };
|
|
4156
4157
|
}
|
|
4157
|
-
return
|
|
4158
|
-
}, V = (D) => E && (D.resizable ?? !0), R = (D,
|
|
4158
|
+
return A ? { width: A } : {};
|
|
4159
|
+
}, V = (D) => E && (D.resizable ?? !0), R = (D, A) => {
|
|
4159
4160
|
D.preventDefault(), D.stopPropagation();
|
|
4160
4161
|
const W = D.currentTarget.closest("th");
|
|
4161
4162
|
if (!W) return;
|
|
4162
4163
|
const I = Math.round(W.getBoundingClientRect().width);
|
|
4163
|
-
Me.current = { colIndex:
|
|
4164
|
+
Me.current = { colIndex: A, startX: D.clientX, startWidth: I };
|
|
4164
4165
|
const O = document.body.style.userSelect, ce = document.body.style.cursor;
|
|
4165
4166
|
document.body.style.userSelect = "none", document.body.style.cursor = "col-resize";
|
|
4166
4167
|
const fe = (ve) => {
|
|
@@ -4176,7 +4177,7 @@ const zn = 240, In = ({
|
|
|
4176
4177
|
};
|
|
4177
4178
|
document.addEventListener("mousemove", fe), document.addEventListener("mouseup", we);
|
|
4178
4179
|
};
|
|
4179
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
4180
|
+
return /* @__PURE__ */ e("div", { ref: Ae, children: /* @__PURE__ */ u(nr, { fullWidth: !0, children: [
|
|
4180
4181
|
/* @__PURE__ */ e(
|
|
4181
4182
|
vr,
|
|
4182
4183
|
{
|
|
@@ -4185,9 +4186,9 @@ const zn = 240, In = ({
|
|
|
4185
4186
|
whiteSpace: "nowrap"
|
|
4186
4187
|
},
|
|
4187
4188
|
children: /* @__PURE__ */ u(Te, { children: [
|
|
4188
|
-
t.map((D,
|
|
4189
|
-
var
|
|
4190
|
-
const W = g > 0 &&
|
|
4189
|
+
t.map((D, A) => {
|
|
4190
|
+
var At, It;
|
|
4191
|
+
const W = g > 0 && A < g, I = he[A] ?? 0, O = V(D), fe = A === t.length - 1 && P && w, we = Y(D), ve = !!D.sortable && !!we, be = ve && (N == null ? void 0 : N.key) === we ? N.direction : null, at = D.title || ((At = D.accessor) == null ? void 0 : At.toString()) || "", Ve = (It = D.headerTooltip) != null && It.showIcon ? /* @__PURE__ */ e(
|
|
4191
4192
|
F,
|
|
4192
4193
|
{
|
|
4193
4194
|
name: "InfoCircle",
|
|
@@ -4233,13 +4234,13 @@ const zn = 240, In = ({
|
|
|
4233
4234
|
top: 0,
|
|
4234
4235
|
left: W ? I : void 0,
|
|
4235
4236
|
zIndex: W ? 4 : 2,
|
|
4236
|
-
paddingLeft:
|
|
4237
|
+
paddingLeft: A === 0 ? "12px" : "",
|
|
4237
4238
|
borderRight: d && !fe && !W ? oe : void 0,
|
|
4238
4239
|
borderBottom: d ? oe : void 0,
|
|
4239
4240
|
boxShadow: d && W ? ye : void 0,
|
|
4240
4241
|
backgroundColor: "var(--sa-background-primary-inverse, #f8f8f8)",
|
|
4241
4242
|
textAlign: D.textAlign === "text-right" ? "right" : D.textAlign === "text-center" ? "center" : "left",
|
|
4242
|
-
...b(
|
|
4243
|
+
...b(A, D.width)
|
|
4243
4244
|
},
|
|
4244
4245
|
children: [
|
|
4245
4246
|
/* @__PURE__ */ u(
|
|
@@ -4264,7 +4265,7 @@ const zn = 240, In = ({
|
|
|
4264
4265
|
y && /* @__PURE__ */ e(
|
|
4265
4266
|
"button",
|
|
4266
4267
|
{
|
|
4267
|
-
onClick: () => Je(
|
|
4268
|
+
onClick: () => Je(A),
|
|
4268
4269
|
title: W ? "Unfreeze column" : "Freeze column",
|
|
4269
4270
|
style: {
|
|
4270
4271
|
background: "none",
|
|
@@ -4287,7 +4288,7 @@ const zn = 240, In = ({
|
|
|
4287
4288
|
O && /* @__PURE__ */ e(
|
|
4288
4289
|
"div",
|
|
4289
4290
|
{
|
|
4290
|
-
onMouseDown: (st) => R(st,
|
|
4291
|
+
onMouseDown: (st) => R(st, A),
|
|
4291
4292
|
onClick: (st) => st.stopPropagation(),
|
|
4292
4293
|
role: "separator",
|
|
4293
4294
|
"aria-orientation": "vertical",
|
|
@@ -4307,7 +4308,7 @@ const zn = 240, In = ({
|
|
|
4307
4308
|
)
|
|
4308
4309
|
]
|
|
4309
4310
|
},
|
|
4310
|
-
`table-head-${
|
|
4311
|
+
`table-head-${A}`
|
|
4311
4312
|
);
|
|
4312
4313
|
}),
|
|
4313
4314
|
P ? /* @__PURE__ */ e(
|
|
@@ -4333,13 +4334,13 @@ const zn = 240, In = ({
|
|
|
4333
4334
|
/* @__PURE__ */ e(He, { variant: "list" }),
|
|
4334
4335
|
/* @__PURE__ */ e(He, { variant: "list" }),
|
|
4335
4336
|
/* @__PURE__ */ e(He, { variant: "list" })
|
|
4336
|
-
] }) }) }) : !(r != null && r.length) && p ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(Se, { colSpan: t.length + 1, children: p }) }) : r == null ? void 0 : r.map((D,
|
|
4337
|
+
] }) }) }) : !(r != null && r.length) && p ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(Se, { colSpan: t.length + 1, children: p }) }) : r == null ? void 0 : r.map((D, A) => /* @__PURE__ */ u(
|
|
4337
4338
|
Te,
|
|
4338
4339
|
{
|
|
4339
4340
|
style: {
|
|
4340
4341
|
transition: "background-color 0.3s ease",
|
|
4341
4342
|
padding: 0,
|
|
4342
|
-
borderBottom:
|
|
4343
|
+
borderBottom: A === r.length - 1 && ct ? void 0 : "1px solid var(--sa-border-subtle, #0b120e24)"
|
|
4343
4344
|
},
|
|
4344
4345
|
onMouseEnter: (W) => {
|
|
4345
4346
|
const I = W.currentTarget;
|
|
@@ -4355,7 +4356,7 @@ const zn = 240, In = ({
|
|
|
4355
4356
|
},
|
|
4356
4357
|
children: [
|
|
4357
4358
|
t.map((W, I) => {
|
|
4358
|
-
const O = W.render ? W.render(D,
|
|
4359
|
+
const O = W.render ? W.render(D, A, r) : Pe(D, W.accessor), ce = g > 0 && I < g, fe = he[I] ?? 0, we = Ie[I] !== void 0, ve = ce && I === g - 1;
|
|
4359
4360
|
return /* @__PURE__ */ e(
|
|
4360
4361
|
Se,
|
|
4361
4362
|
{
|
|
@@ -4387,11 +4388,11 @@ const zn = 240, In = ({
|
|
|
4387
4388
|
}
|
|
4388
4389
|
) : O
|
|
4389
4390
|
},
|
|
4390
|
-
`row-${
|
|
4391
|
+
`row-${A}-col-${I}`
|
|
4391
4392
|
);
|
|
4392
4393
|
}),
|
|
4393
4394
|
P ? /* @__PURE__ */ e(Se, { style: {
|
|
4394
|
-
width:
|
|
4395
|
+
width: ze,
|
|
4395
4396
|
position: "sticky",
|
|
4396
4397
|
right: 0,
|
|
4397
4398
|
zIndex: 1,
|
|
@@ -4399,7 +4400,7 @@ const zn = 240, In = ({
|
|
|
4399
4400
|
boxShadow: w ? ge : void 0,
|
|
4400
4401
|
transition: "background-color 0.3s ease"
|
|
4401
4402
|
}, children: /* @__PURE__ */ e(U, { direction: "row", align: "center", justify: "center", gap: "sm", children: k.map((W) => {
|
|
4402
|
-
const I =
|
|
4403
|
+
const I = A === r.length - 1 ? "top" : "bottom";
|
|
4403
4404
|
return W === "detail" && n && (h == null ? void 0 : h(D)) !== !1 ? /* @__PURE__ */ e(me, { label: "Detail", position: I, children: /* @__PURE__ */ e(
|
|
4404
4405
|
_,
|
|
4405
4406
|
{
|
|
@@ -4431,7 +4432,7 @@ const zn = 240, In = ({
|
|
|
4431
4432
|
}) }) }) : null
|
|
4432
4433
|
]
|
|
4433
4434
|
},
|
|
4434
|
-
`${D}${
|
|
4435
|
+
`${D}${A}`
|
|
4435
4436
|
)) })
|
|
4436
4437
|
] }) });
|
|
4437
4438
|
}, Pn = ({
|
|
@@ -4854,7 +4855,7 @@ const Wo = (t) => {
|
|
|
4854
4855
|
"Tab"
|
|
4855
4856
|
];
|
|
4856
4857
|
(t.ctrlKey || t.metaKey) && (t.key === "a" || t.key === "c" || t.key === "v") || !r.test(t.key) && !n.includes(t.key) && t.preventDefault();
|
|
4857
|
-
},
|
|
4858
|
+
}, zo = (t) => {
|
|
4858
4859
|
const r = /^[0-9]$/, n = [
|
|
4859
4860
|
"ArrowLeft",
|
|
4860
4861
|
"ArrowRight",
|
|
@@ -4866,7 +4867,7 @@ const Wo = (t) => {
|
|
|
4866
4867
|
"Tab"
|
|
4867
4868
|
];
|
|
4868
4869
|
(t.ctrlKey || t.metaKey) && t.key === "v" || r.test(t.key) && !n.includes(t.key) && t.preventDefault();
|
|
4869
|
-
},
|
|
4870
|
+
}, Ao = (t) => {
|
|
4870
4871
|
const r = /^[0-9.]$/, n = [
|
|
4871
4872
|
"ArrowLeft",
|
|
4872
4873
|
"ArrowRight",
|
|
@@ -5734,7 +5735,7 @@ const Qt = {
|
|
|
5734
5735
|
maxFileSize: h = 2,
|
|
5735
5736
|
onError: d
|
|
5736
5737
|
}, m) => {
|
|
5737
|
-
const g = de("md"), [y, x] = B(!1), [k, p] = B(null), [E, M] = B(!1), [S, T] = B({ x: 0, y: 0 }), [C, L] = B(1), [
|
|
5738
|
+
const g = de("md"), [y, x] = B(!1), [k, p] = B(null), [E, M] = B(!1), [S, T] = B({ x: 0, y: 0 }), [C, L] = B(1), [z, w] = B(null);
|
|
5738
5739
|
Z(() => {
|
|
5739
5740
|
r === null && i(null);
|
|
5740
5741
|
}, [r]);
|
|
@@ -5752,9 +5753,9 @@ const Qt = {
|
|
|
5752
5753
|
p(oe.result), M(!0);
|
|
5753
5754
|
}, oe.readAsDataURL(q);
|
|
5754
5755
|
}, X = async () => {
|
|
5755
|
-
if (!(!k || !
|
|
5756
|
+
if (!(!k || !z))
|
|
5756
5757
|
try {
|
|
5757
|
-
const P = await mi(k,
|
|
5758
|
+
const P = await mi(k, z);
|
|
5758
5759
|
if (h && P.size > h * 1024 * 1024) {
|
|
5759
5760
|
d == null || d(`Ukuran file maksimal ${h}MB`);
|
|
5760
5761
|
return;
|
|
@@ -7878,7 +7879,7 @@ const Go = (t) => {
|
|
|
7878
7879
|
/* @__PURE__ */ e(f, { direction: "column", ...g, children: m ?? null })
|
|
7879
7880
|
]
|
|
7880
7881
|
}
|
|
7881
|
-
),
|
|
7882
|
+
), z = !!(s || h || m);
|
|
7882
7883
|
return /* @__PURE__ */ u(
|
|
7883
7884
|
f,
|
|
7884
7885
|
{
|
|
@@ -7898,7 +7899,7 @@ const Go = (t) => {
|
|
|
7898
7899
|
...(y == null ? void 0 : y.style) ?? {}
|
|
7899
7900
|
},
|
|
7900
7901
|
children: [
|
|
7901
|
-
s !== null &&
|
|
7902
|
+
s !== null && z ? /* @__PURE__ */ e(ur, { ...k, children: L() }) : null,
|
|
7902
7903
|
/* @__PURE__ */ e(
|
|
7903
7904
|
f,
|
|
7904
7905
|
{
|
|
@@ -7948,10 +7949,10 @@ function Wt(t) {
|
|
|
7948
7949
|
return null;
|
|
7949
7950
|
}
|
|
7950
7951
|
Wt.displayName = "LayoutDialog.Aside";
|
|
7951
|
-
function
|
|
7952
|
+
function zt(t) {
|
|
7952
7953
|
return null;
|
|
7953
7954
|
}
|
|
7954
|
-
|
|
7955
|
+
zt.displayName = "LayoutDialog.Footer";
|
|
7955
7956
|
const ae = {
|
|
7956
7957
|
"lyd-root": "_lyd-root_1e92c_1",
|
|
7957
7958
|
"lyd-backdrop": "_lyd-backdrop_1e92c_28",
|
|
@@ -8073,14 +8074,14 @@ function Li(t) {
|
|
|
8073
8074
|
const L = se(
|
|
8074
8075
|
() => Qe(x, Mt),
|
|
8075
8076
|
[x]
|
|
8076
|
-
),
|
|
8077
|
+
), z = se(
|
|
8077
8078
|
() => Qe(x, Bt),
|
|
8078
8079
|
[x]
|
|
8079
8080
|
), w = se(
|
|
8080
8081
|
() => Qe(x, Wt),
|
|
8081
8082
|
[x]
|
|
8082
8083
|
), $ = se(
|
|
8083
|
-
() => Qe(x,
|
|
8084
|
+
() => Qe(x, zt),
|
|
8084
8085
|
[x]
|
|
8085
8086
|
);
|
|
8086
8087
|
if (!r) return null;
|
|
@@ -8129,7 +8130,7 @@ function Li(t) {
|
|
|
8129
8130
|
] })
|
|
8130
8131
|
] }),
|
|
8131
8132
|
/* @__PURE__ */ u("div", { className: ae["lyd-main"], children: [
|
|
8132
|
-
/* @__PURE__ */ e("div", { className: ae["lyd-body"], children:
|
|
8133
|
+
/* @__PURE__ */ e("div", { className: ae["lyd-body"], children: z }),
|
|
8133
8134
|
w && /* @__PURE__ */ e("aside", { className: ae["lyd-aside"], children: w })
|
|
8134
8135
|
] }),
|
|
8135
8136
|
$ && /* @__PURE__ */ e("div", { className: ae["lyd-footer"], children: $ })
|
|
@@ -8142,7 +8143,7 @@ const lt = Li;
|
|
|
8142
8143
|
lt.Header = Mt;
|
|
8143
8144
|
lt.Body = Bt;
|
|
8144
8145
|
lt.Aside = Wt;
|
|
8145
|
-
lt.Footer =
|
|
8146
|
+
lt.Footer = zt;
|
|
8146
8147
|
function Qo({ url: t, filename: r, onClose: n }) {
|
|
8147
8148
|
return Z(() => {
|
|
8148
8149
|
const o = (i) => {
|
|
@@ -8349,7 +8350,7 @@ export {
|
|
|
8349
8350
|
lt as LayoutDialog,
|
|
8350
8351
|
Wt as LayoutDialogAside,
|
|
8351
8352
|
Bt as LayoutDialogBody,
|
|
8352
|
-
|
|
8353
|
+
zt as LayoutDialogFooter,
|
|
8353
8354
|
Mt as LayoutDialogHeader,
|
|
8354
8355
|
ho as ModuleSwitcher,
|
|
8355
8356
|
jr as ModuleSwitcherModal,
|
|
@@ -8363,7 +8364,7 @@ export {
|
|
|
8363
8364
|
ur as SectionHeader,
|
|
8364
8365
|
Uo as SelectButton,
|
|
8365
8366
|
qo as ServerErrorPage,
|
|
8366
|
-
|
|
8367
|
+
Ar as SidebarBadgesProvider,
|
|
8367
8368
|
co as SidebarGroupSlot,
|
|
8368
8369
|
Or as SidebarGroupSlotOutlet,
|
|
8369
8370
|
Nr as SidebarGroupSlotProvider,
|
|
@@ -8400,9 +8401,9 @@ export {
|
|
|
8400
8401
|
Fo as oneDayInMs,
|
|
8401
8402
|
vo as parseIndonesianDateToDate,
|
|
8402
8403
|
Ro as preventNonCoordinateInput,
|
|
8403
|
-
|
|
8404
|
+
Ao as preventNonNumberAndDecimalInput,
|
|
8404
8405
|
Wo as preventNonNumberInput,
|
|
8405
|
-
|
|
8406
|
+
zo as preventNumberInput,
|
|
8406
8407
|
fn as resolveDateRangeValueToString,
|
|
8407
8408
|
mn as resolveDateValueToString,
|
|
8408
8409
|
un as resolveDropdownValueToString,
|
|
@@ -8411,7 +8412,7 @@ export {
|
|
|
8411
8412
|
mr as storageKeys,
|
|
8412
8413
|
Eo as textWidth,
|
|
8413
8414
|
cr as useApp,
|
|
8414
|
-
|
|
8415
|
+
zr as useAppState,
|
|
8415
8416
|
el as useAuthRole,
|
|
8416
8417
|
Xo as useDynamicTitle,
|
|
8417
8418
|
dr as useModuleSelection,
|