@starasia/admin 14.0.3 → 14.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.es.js CHANGED
@@ -494,18 +494,18 @@ function As({
494
494
  bn = we;
495
495
  }, [we]);
496
496
  const pe = oe(null), He = oe(null), Je = oe(null), [ue, Ye] = H(!1), [ht, O] = H(null), K = b && !z && !_, q = (E) => Math.min(Math.max(E, T), V), he = ht ?? X, ae = (E) => {
497
- var Fe, Ae, _e;
497
+ var Fe, Ae, Pe;
498
498
  if (!K) return;
499
499
  E.preventDefault();
500
500
  const j = E.clientX, ee = ((Fe = Je.current) == null ? void 0 : Fe.getBoundingClientRect().width) ?? X;
501
- (_e = (Ae = E.currentTarget).setPointerCapture) == null || _e.call(Ae, E.pointerId), Ye(!0), document.body.style.userSelect = "none", document.body.style.cursor = "col-resize";
502
- let Se = 0, Be = ee;
501
+ (Pe = (Ae = E.currentTarget).setPointerCapture) == null || Pe.call(Ae, E.pointerId), Ye(!0), document.body.style.userSelect = "none", document.body.style.cursor = "col-resize";
502
+ let Ee = 0, Be = ee;
503
503
  const it = (Wt) => {
504
- Be = ee + (Wt.clientX - j), Se || (Se = requestAnimationFrame(() => {
505
- Se = 0, O(q(Be));
504
+ Be = ee + (Wt.clientX - j), Ee || (Ee = requestAnimationFrame(() => {
505
+ Ee = 0, O(q(Be));
506
506
  }));
507
507
  }, Te = () => {
508
- Se && cancelAnimationFrame(Se), window.removeEventListener("pointermove", it), window.removeEventListener("pointerup", Te), document.body.style.userSelect = "", document.body.style.cursor = "", O(null), Ye(!1), Be < vo ? P(!0) : re(q(Be));
508
+ Ee && cancelAnimationFrame(Ee), window.removeEventListener("pointermove", it), window.removeEventListener("pointerup", Te), document.body.style.userSelect = "", document.body.style.cursor = "", O(null), Ye(!1), Be < vo ? P(!0) : re(q(Be));
509
509
  };
510
510
  window.addEventListener("pointermove", it), window.addEventListener("pointerup", Te);
511
511
  }, Me = (E) => {
@@ -541,17 +541,17 @@ function As({
541
541
  }));
542
542
  }, [k.menus]), Y(() => {
543
543
  kt = !0, Oe();
544
- const E = setTimeout(Oe, 0), j = setTimeout(Oe, 50), ee = setTimeout(Oe, 100), Se = setTimeout(Oe, 200), Be = setTimeout(() => {
544
+ const E = setTimeout(Oe, 0), j = setTimeout(Oe, 50), ee = setTimeout(Oe, 100), Ee = setTimeout(Oe, 200), Be = setTimeout(() => {
545
545
  kt = !1;
546
546
  }, 300), it = setTimeout(() => {
547
547
  const Te = pe.current, Fe = Te == null ? void 0 : Te.querySelector("[data-menu-active='true']");
548
548
  if (Te && Fe) {
549
- const Ae = Te.getBoundingClientRect(), _e = Fe.getBoundingClientRect();
550
- _e.top >= Ae.top && _e.bottom <= Ae.bottom || Fe.scrollIntoView({ block: "center", behavior: "smooth" });
549
+ const Ae = Te.getBoundingClientRect(), Pe = Fe.getBoundingClientRect();
550
+ Pe.top >= Ae.top && Pe.bottom <= Ae.bottom || Fe.scrollIntoView({ block: "center", behavior: "smooth" });
551
551
  }
552
552
  }, 250);
553
553
  return () => {
554
- clearTimeout(E), clearTimeout(j), clearTimeout(ee), clearTimeout(Se), clearTimeout(Be), clearTimeout(it);
554
+ clearTimeout(E), clearTimeout(j), clearTimeout(ee), clearTimeout(Ee), clearTimeout(Be), clearTimeout(it);
555
555
  };
556
556
  }, [w.pathname]), Y(() => {
557
557
  He.current && (He.current.scrollTop = 0);
@@ -574,19 +574,19 @@ function As({
574
574
  }, nt = (E) => {
575
575
  const j = [E.to];
576
576
  return E.children && j.push(...E.children.map((ee) => ee.to)), j;
577
- }, Ee = [
577
+ }, Se = [
578
578
  ...k.menus.flatMap((E) => E.items.flatMap(nt)),
579
579
  ...((xt = k.menuBottom) == null ? void 0 : xt.flatMap(nt)) ?? []
580
580
  ], Ke = (E) => {
581
581
  if (!w.pathname.startsWith(E)) return !1;
582
- const j = Ee.filter((ee) => w.pathname.startsWith(ee)).sort((ee, Se) => Se.length - ee.length)[0];
582
+ const j = Se.filter((ee) => w.pathname.startsWith(ee)).sort((ee, Ee) => Ee.length - ee.length)[0];
583
583
  return E === j;
584
584
  };
585
585
  Y(() => {
586
586
  var j;
587
587
  const E = (ee) => {
588
- var Se;
589
- (Se = ee.children) != null && Se.some((Be) => w.pathname.startsWith(Be.to)) && De((Be) => {
588
+ var Ee;
589
+ (Ee = ee.children) != null && Ee.some((Be) => w.pathname.startsWith(Be.to)) && De((Be) => {
590
590
  const it = new Set(Be);
591
591
  return it.add(ee.id), it;
592
592
  });
@@ -627,12 +627,12 @@ function As({
627
627
  }
628
628
  );
629
629
  const bt = (E) => {
630
- const j = E.children && E.children.length > 0, ee = we.has(E.id), Se = j ? E.children.some((Te) => Ke(Te.to)) : Ke(E.to), Be = br(E.badge, I[E.id]), it = !!Be && _ && !z;
630
+ const j = E.children && E.children.length > 0, ee = we.has(E.id), Ee = j ? E.children.some((Te) => Ke(Te.to)) : Ke(E.to), Be = br(E.badge, I[E.id]), it = !!Be && _ && !z;
631
631
  return /* @__PURE__ */ d(
632
632
  h,
633
633
  {
634
634
  display: "block",
635
- "data-menu-active": Se || void 0,
635
+ "data-menu-active": Ee || void 0,
636
636
  children: [
637
637
  /* @__PURE__ */ d(
638
638
  h,
@@ -660,19 +660,22 @@ function As({
660
660
  paddingInline: _ && !z ? void 0 : "sm",
661
661
  paddingBlock: "xs",
662
662
  height: "height-32",
663
- borderRadius: Se ? "rounded-sm" : "rounded-md",
663
+ borderRadius: Ee ? "rounded-sm" : "rounded-md",
664
664
  borderWidth: "border",
665
665
  borderStyle: "border-solid",
666
- borderColor: Se ? "border-base" : void 0,
667
- bg: Se ? "white" : void 0,
668
- hover: Se ? void 0 : { bg: "neutral" },
666
+ bg: Ee ? "white" : void 0,
667
+ hover: Ee ? void 0 : { bg: "neutral" },
669
668
  title: _ && !z ? E.title : void 0,
670
669
  style: {
671
670
  textAlign: "left",
672
671
  color: "var(--sa-text-primary, #292a2e)",
673
672
  // Border tetap 1px walau tidak aktif supaya baris tidak bergeser
674
- // saat jadi aktif — belum ada token borderColor "transparent".
675
- ...Se ? null : { borderColor: "transparent" }
673
+ // saat jadi aktif. `borderColor` SELALU ditulis di sini — bukan
674
+ // separuh lewat prop, separuh lewat style — karena kalau properti
675
+ // ini hilang-muncul antar render, React memperingatkan "Removing a
676
+ // style property during rerender (borderColor) when a conflicting
677
+ // property is set (border)".
678
+ borderColor: Ee ? "var(--sa-border-subtle, #0b120e24)" : "transparent"
676
679
  },
677
680
  children: [
678
681
  /* @__PURE__ */ d(
@@ -793,7 +796,7 @@ function As({
793
796
  const Ae = br(
794
797
  Fe.badge,
795
798
  I[Fe.id]
796
- ), _e = Ke(Fe.to);
799
+ ), Pe = Ke(Fe.to);
797
800
  return /* @__PURE__ */ d(
798
801
  h,
799
802
  {
@@ -807,16 +810,16 @@ function As({
807
810
  paddingRight: "sm",
808
811
  paddingBlock: "xs",
809
812
  height: "height-32",
810
- borderRadius: _e ? "rounded-sm" : "rounded-md",
813
+ borderRadius: Pe ? "rounded-sm" : "rounded-md",
811
814
  borderWidth: "border",
812
815
  borderStyle: "border-solid",
813
- borderColor: _e ? "border-base" : void 0,
814
- bg: _e ? "white" : void 0,
815
- hover: _e ? void 0 : { bg: "neutral" },
816
+ bg: Pe ? "white" : void 0,
817
+ hover: Pe ? void 0 : { bg: "neutral" },
816
818
  style: {
817
819
  textAlign: "left",
818
- color: _e ? "var(--sa-text-primary, #292a2e)" : "var(--sa-text-subtle, #505258)",
819
- ..._e ? null : { borderColor: "transparent" }
820
+ color: Pe ? "var(--sa-text-primary, #292a2e)" : "var(--sa-text-subtle, #505258)",
821
+ // Selalu ditulis — lihat catatan di baris menu induk.
822
+ borderColor: Pe ? "var(--sa-border-subtle, #0b120e24)" : "transparent"
820
823
  },
821
824
  children: [
822
825
  /* @__PURE__ */ e(
@@ -5895,9 +5898,9 @@ const Fl = 240, pi = ({
5895
5898
  var Ke;
5896
5899
  const Re = He.current;
5897
5900
  if (!Re) return;
5898
- const nt = ((Ke = t[Re.colIndex]) == null ? void 0 : Ke.minWidth) ?? D, Ee = Math.max(nt, Re.startWidth + (Xe.clientX - Re.startX));
5901
+ const nt = ((Ke = t[Re.colIndex]) == null ? void 0 : Ke.minWidth) ?? D, Se = Math.max(nt, Re.startWidth + (Xe.clientX - Re.startX));
5899
5902
  pe(
5900
- (ft) => ft[Re.colIndex] === Ee ? ft : { ...ft, [Re.colIndex]: Ee }
5903
+ (ft) => ft[Re.colIndex] === Se ? ft : { ...ft, [Re.colIndex]: Se }
5901
5904
  );
5902
5905
  }, lt = () => {
5903
5906
  document.removeEventListener("mousemove", Oe), document.removeEventListener("mouseup", lt), document.body.style.userSelect = ae, document.body.style.cursor = Me, He.current = null, M && pe((Xe) => (M(Xe), Xe));
@@ -5915,7 +5918,7 @@ const Fl = 240, pi = ({
5915
5918
  children: /* @__PURE__ */ d(tt, { children: [
5916
5919
  t.map((O, K) => {
5917
5920
  var Dt, bt;
5918
- const q = p > 0 && K < p, he = ze[K] ?? 0, ae = Ye(O), Oe = K === t.length - 1 && T && w, lt = _(O), Xe = !!O.sortable && !!lt, Re = Xe && (Q == null ? void 0 : Q.key) === lt ? Q.direction : null, nt = O.title || ((Dt = O.accessor) == null ? void 0 : Dt.toString()) || "", Ee = (bt = O.headerTooltip) != null && bt.showIcon ? /* @__PURE__ */ e(
5921
+ const q = p > 0 && K < p, he = ze[K] ?? 0, ae = Ye(O), Oe = K === t.length - 1 && T && w, lt = _(O), Xe = !!O.sortable && !!lt, Re = Xe && (Q == null ? void 0 : Q.key) === lt ? Q.direction : null, nt = O.title || ((Dt = O.accessor) == null ? void 0 : Dt.toString()) || "", Se = (bt = O.headerTooltip) != null && bt.showIcon ? /* @__PURE__ */ e(
5919
5922
  L,
5920
5923
  {
5921
5924
  name: "InfoCircle",
@@ -5945,13 +5948,13 @@ const Fl = 240, pi = ({
5945
5948
  },
5946
5949
  children: [
5947
5950
  Ke,
5948
- Ee,
5951
+ Se,
5949
5952
  /* @__PURE__ */ e($l, { direction: Re })
5950
5953
  ]
5951
5954
  }
5952
5955
  ) : /* @__PURE__ */ d("span", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: 4 }, children: [
5953
5956
  Ke,
5954
- Ee
5957
+ Se
5955
5958
  ] });
5956
5959
  return /* @__PURE__ */ d(
5957
5960
  St,
@@ -6533,14 +6536,14 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
6533
6536
  return [...r].sort(
6534
6537
  (A, Z) => Xl(q(y.col, A), q(y.col, Z)) * x
6535
6538
  );
6536
- }, [r, pe, J, ue]), Me = !Ye && !O, Oe = !!s && Me, [lt, Xe] = qi(s ?? ""), Re = Oe ? lt : void 0, nt = oe(null), [Ee, Ke] = H();
6539
+ }, [r, pe, J, ue]), Me = !Ye && !O, Oe = !!s && Me, [lt, Xe] = qi(s ?? ""), Re = Oe ? lt : void 0, nt = oe(null), [Se, Ke] = H();
6537
6540
  at(() => {
6538
6541
  Ke(void 0);
6539
6542
  }, [K]), at(() => {
6540
- if (!Me || Ee || !nt.current) return;
6543
+ if (!Me || Se || !nt.current) return;
6541
6544
  const y = nt.current.querySelectorAll("th.sa-tl-leaf");
6542
6545
  Ke(Array.from(y).map((x) => x.offsetWidth));
6543
- }, [Ee, Me]);
6546
+ }, [Se, Me]);
6544
6547
  const [ft, Dt] = H(), [bt, xt] = H(0);
6545
6548
  at(() => {
6546
6549
  if (!Ye || !nt.current) return;
@@ -6550,11 +6553,11 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
6550
6553
  const Et = (y, x) => {
6551
6554
  if ((Re == null ? void 0 : Re[x]) != null) return Re[x];
6552
6555
  if (y.width != null) return y.width;
6553
- if ((Ee == null ? void 0 : Ee[x]) != null) return Ee[x];
6554
- }, E = (y, x) => typeof y.width == "number" ? y.width : Ee == null ? void 0 : Ee[x], j = De.frozenKey && !Ye && !O ? ue.findIndex((y) => y.key === De.frozenKey) : -1, ee = (y) => y <= j, Se = z ? It : 0, Be = (y) => {
6555
- const x = ft ?? Ee;
6556
- if (!x) return Se;
6557
- let A = Se;
6556
+ if ((Se == null ? void 0 : Se[x]) != null) return Se[x];
6557
+ }, E = (y, x) => typeof y.width == "number" ? y.width : Se == null ? void 0 : Se[x], j = De.frozenKey && !Ye && !O ? ue.findIndex((y) => y.key === De.frozenKey) : -1, ee = (y) => y <= j, Ee = z ? It : 0, Be = (y) => {
6558
+ const x = ft ?? Se;
6559
+ if (!x) return Ee;
6560
+ let A = Ee;
6558
6561
  for (let Z = 0; Z < y; Z++) A += x[Z] ?? 0;
6559
6562
  return A;
6560
6563
  };
@@ -6579,7 +6582,7 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
6579
6582
  return Z.observe(y), y.querySelectorAll("th.sa-tl-leaf").forEach((ne) => Z.observe(ne)), A(), () => {
6580
6583
  x && cancelAnimationFrame(x), Z.disconnect();
6581
6584
  };
6582
- }, [K, j, z, Ee, Re]);
6585
+ }, [K, j, z, Se, Re]);
6583
6586
  const it = oe(null), [Te, Fe] = H("100vh");
6584
6587
  at(() => {
6585
6588
  if (S !== void 0) return;
@@ -6593,11 +6596,11 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
6593
6596
  };
6594
6597
  return y(), window.addEventListener("resize", y), () => window.removeEventListener("resize", y);
6595
6598
  }, [S]);
6596
- const Ae = (y, x) => n ? n(y, x) : x, _e = U !== void 0, [Wt, Ci] = H(
6599
+ const Ae = (y, x) => n ? n(y, x) : x, Pe = U !== void 0, [Wt, Ci] = H(
6597
6600
  () => new Set(Q ?? [])
6598
6601
  ), gt = ve(
6599
- () => _e ? new Set(U) : Wt,
6600
- [_e, U, Wt]
6602
+ () => Pe ? new Set(U) : Wt,
6603
+ [Pe, U, Wt]
6601
6604
  );
6602
6605
  Y(() => {
6603
6606
  z && !n && process.env.NODE_ENV !== "production" && console.warn(
@@ -6605,7 +6608,7 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
6605
6608
  );
6606
6609
  }, [z, !n]);
6607
6610
  const tn = (y) => {
6608
- if (_e || Ci(y), _) {
6611
+ if (Pe || Ci(y), _) {
6609
6612
  const x = ae.filter((A, Z) => y.has(Ae(A, Z)));
6610
6613
  _(Array.from(y), x);
6611
6614
  }
@@ -7075,7 +7078,7 @@ const Ps = Zl(jl), Tn = 200, Fr = "1px solid var(--sa-border-subtle, #0b120e24)"
7075
7078
  );
7076
7079
  })
7077
7080
  }
7078
- ), Oi = l && Me && Ee !== void 0, dn = c === "fixed" && !l && (Me ? Ee !== void 0 : !0), Ti = dn && !Me, _t = D && D.length > 0 ? D.map((y, x) => /* @__PURE__ */ e(tt, { children: y.cells.map((A, Z) => /* @__PURE__ */ e(
7081
+ ), Oi = l && Me && Se !== void 0, dn = c === "fixed" && !l && (Me ? Se !== void 0 : !0), Ti = dn && !Me, _t = D && D.length > 0 ? D.map((y, x) => /* @__PURE__ */ e(tt, { children: y.cells.map((A, Z) => /* @__PURE__ */ e(
7079
7082
  Ve,
7080
7083
  {
7081
7084
  colSpan: A.colSpan,
@@ -11099,7 +11102,7 @@ function Kr(t) {
11099
11102
  return null;
11100
11103
  }
11101
11104
  Kr.displayName = "LayoutDialog.Footer";
11102
- const Pe = {
11105
+ const _e = {
11103
11106
  "lyd-root": "_lyd-root_1g78i_1",
11104
11107
  "lyd-backdrop": "_lyd-backdrop_1g78i_38",
11105
11108
  "lyd-panel": "_lyd-panel_1g78i_47",
@@ -11134,11 +11137,11 @@ const Pe = {
11134
11137
  }
11135
11138
  ];
11136
11139
  function Vc({ value: t, onChange: r }) {
11137
- return /* @__PURE__ */ e("div", { className: Pe["lyd-vm-group"], role: "group", "aria-label": "View mode", children: Tc.map((n) => /* @__PURE__ */ e(
11140
+ return /* @__PURE__ */ e("div", { className: _e["lyd-vm-group"], role: "group", "aria-label": "View mode", children: Tc.map((n) => /* @__PURE__ */ e(
11138
11141
  "button",
11139
11142
  {
11140
11143
  type: "button",
11141
- className: Pe["lyd-vm-btn"],
11144
+ className: _e["lyd-vm-btn"],
11142
11145
  "data-active": t === n.mode,
11143
11146
  "aria-label": `Switch to ${n.label} view`,
11144
11147
  "aria-pressed": t === n.mode,
@@ -11233,10 +11236,10 @@ function _c(t) {
11233
11236
  );
11234
11237
  if (!r) return null;
11235
11238
  const U = [
11236
- Pe["lyd-panel"],
11237
- M === "modal" && Pe["lyd-modal"],
11238
- M === "fullscreen" && Pe["lyd-fullscreen"],
11239
- M === "sidebar" && Pe["lyd-sidebar"]
11239
+ _e["lyd-panel"],
11240
+ M === "modal" && _e["lyd-modal"],
11241
+ M === "fullscreen" && _e["lyd-fullscreen"],
11242
+ M === "sidebar" && _e["lyd-sidebar"]
11240
11243
  ].filter(Boolean).join(" "), Q = {
11241
11244
  "--lyd-max-w": $c(a),
11242
11245
  ...u !== void 0 && { "--lyd-aside-w": u }
@@ -11247,7 +11250,7 @@ function _c(t) {
11247
11250
  /* @__PURE__ */ d(
11248
11251
  "div",
11249
11252
  {
11250
- className: Pe["lyd-root"],
11253
+ className: _e["lyd-root"],
11251
11254
  style: Q,
11252
11255
  role: "dialog",
11253
11256
  "aria-modal": "true",
@@ -11255,21 +11258,21 @@ function _c(t) {
11255
11258
  /* @__PURE__ */ e(
11256
11259
  "div",
11257
11260
  {
11258
- className: Pe["lyd-backdrop"],
11261
+ className: _e["lyd-backdrop"],
11259
11262
  onClick: _,
11260
11263
  "aria-hidden": "true"
11261
11264
  }
11262
11265
  ),
11263
11266
  /* @__PURE__ */ d("div", { className: U, children: [
11264
- /* @__PURE__ */ d("div", { className: Pe["lyd-header"], children: [
11265
- /* @__PURE__ */ e("div", { className: Pe["lyd-header-content"], children: B }),
11266
- /* @__PURE__ */ d("div", { className: Pe["lyd-header-actions"], children: [
11267
+ /* @__PURE__ */ d("div", { className: _e["lyd-header"], children: [
11268
+ /* @__PURE__ */ e("div", { className: _e["lyd-header-content"], children: B }),
11269
+ /* @__PURE__ */ d("div", { className: _e["lyd-header-actions"], children: [
11267
11270
  c && /* @__PURE__ */ e(Vc, { value: W, onChange: D }),
11268
11271
  s && /* @__PURE__ */ e(
11269
11272
  "button",
11270
11273
  {
11271
11274
  type: "button",
11272
- className: Pe["lyd-close-btn"],
11275
+ className: _e["lyd-close-btn"],
11273
11276
  onClick: n,
11274
11277
  "aria-label": "Close dialog",
11275
11278
  children: /* @__PURE__ */ e(L, { name: "Cross", size: "md" })
@@ -11277,11 +11280,11 @@ function _c(t) {
11277
11280
  )
11278
11281
  ] })
11279
11282
  ] }),
11280
- /* @__PURE__ */ d("div", { className: Pe["lyd-main"], children: [
11281
- /* @__PURE__ */ e("div", { className: Pe["lyd-body"], children: w }),
11282
- R && /* @__PURE__ */ e("aside", { className: Pe["lyd-aside"], children: R })
11283
+ /* @__PURE__ */ d("div", { className: _e["lyd-main"], children: [
11284
+ /* @__PURE__ */ e("div", { className: _e["lyd-body"], children: w }),
11285
+ R && /* @__PURE__ */ e("aside", { className: _e["lyd-aside"], children: R })
11283
11286
  ] }),
11284
- z && /* @__PURE__ */ e("div", { className: Pe["lyd-footer"], children: z })
11287
+ z && /* @__PURE__ */ e("div", { className: _e["lyd-footer"], children: z })
11285
11288
  ] })
11286
11289
  ]
11287
11290
  }