@stella-source/stellasource-dsl 3.6.0 → 4.0.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.
@@ -941,7 +941,7 @@ const a$f = /* @__PURE__ */ new Map([
941
941
  ]
942
942
  ]);
943
943
 
944
- const H = /* @__PURE__ */ new Map([
944
+ const H$1 = /* @__PURE__ */ new Map([
945
945
  [
946
946
  "bold",
947
947
  /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M28,132a12,12,0,0,1,0-24H56a4,4,0,0,0,0-8H40a28,28,0,0,1-3.38-55.79A12,12,0,0,1,59.3,44H64a12,12,0,0,1,0,24H40a4,4,0,0,0,0,8H56a28,28,0,0,1,3.38,55.79A12,12,0,0,1,36.7,132ZM236,56V192a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V164a12,12,0,0,1,24,0v24H156V164H88a12,12,0,0,1,0-24h68V116H112a12,12,0,0,1,0-24H212V68H104a12,12,0,0,1,0-24H224A12,12,0,0,1,236,56Zm-56,84h32V116H180Zm32,48V164H180v24Z" }))
@@ -1553,6 +1553,33 @@ const e$j = /* @__PURE__ */ new Map([
1553
1553
  ]
1554
1554
  ]);
1555
1555
 
1556
+ const H = /* @__PURE__ */ new Map([
1557
+ [
1558
+ "bold",
1559
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM44,116H76v24H44Zm56,0H212v24H100ZM212,68V92H44V68ZM44,164H76v24H44Zm56,24V164H212v24Z" }))
1560
+ ],
1561
+ [
1562
+ "duotone",
1563
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M88,104v96H32V104Z", opacity: "0.2" }), /* @__PURE__ */ a$n.createElement("path", { d: "M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z" }))
1564
+ ],
1565
+ [
1566
+ "fill",
1567
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM40,160H80v32H40Zm176,32H96V160H216v32Z" }))
1568
+ ],
1569
+ [
1570
+ "light",
1571
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM38,110H82v36H38Zm56,0H218v36H94ZM218,62V98H38V62ZM38,192V158H82v36H40A2,2,0,0,1,38,192Zm178,2H94V158H218v34A2,2,0,0,1,216,194Z" }))
1572
+ ],
1573
+ [
1574
+ "regular",
1575
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z" }))
1576
+ ],
1577
+ [
1578
+ "thin",
1579
+ /* @__PURE__ */ a$n.createElement(a$n.Fragment, null, /* @__PURE__ */ a$n.createElement("path", { d: "M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z" }))
1580
+ ]
1581
+ ]);
1582
+
1556
1583
  const e$i = /* @__PURE__ */ new Map([
1557
1584
  [
1558
1585
  "bold",
@@ -1826,7 +1853,7 @@ const a$5 = /* @__PURE__ */ new Map([
1826
1853
  ]
1827
1854
  ]);
1828
1855
 
1829
- const o$m = createContext({
1856
+ const o$n = createContext({
1830
1857
  color: "currentColor",
1831
1858
  size: "1em",
1832
1859
  weight: "regular",
@@ -1850,7 +1877,7 @@ const p$2 = a$n.forwardRef(
1850
1877
  weight: f = "regular",
1851
1878
  mirrored: g = false,
1852
1879
  ...w
1853
- } = a$n.useContext(o$m);
1880
+ } = a$n.useContext(o$n);
1854
1881
  return /* @__PURE__ */ a$n.createElement(
1855
1882
  "svg",
1856
1883
  {
@@ -1872,9 +1899,9 @@ const p$2 = a$n.forwardRef(
1872
1899
  );
1873
1900
  p$2.displayName = "IconBase";
1874
1901
 
1875
- const o$l = a$n.forwardRef((e, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...e, weights: a$m }));
1876
- o$l.displayName = "ArrowCircleUpIcon";
1877
- const p$1 = o$l;
1902
+ const o$m = a$n.forwardRef((e, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...e, weights: a$m }));
1903
+ o$m.displayName = "ArrowCircleUpIcon";
1904
+ const p$1 = o$m;
1878
1905
 
1879
1906
  const r$7 = a$n.forwardRef((e, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...e, weights: a$l }));
1880
1907
  r$7.displayName = "ArrowUpIcon";
@@ -1891,9 +1918,9 @@ const e$d = a$n.forwardRef((o, t) => /* @__PURE__ */ a$n.createElement(p$2, { re
1891
1918
  e$d.displayName = "ArrowsOutLineVerticalIcon";
1892
1919
  const n$c = e$d;
1893
1920
 
1894
- const o$k = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: e$E }));
1895
- o$k.displayName = "AsteriskIcon";
1896
- const c$9 = o$k;
1921
+ const o$l = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: e$E }));
1922
+ o$l.displayName = "AsteriskIcon";
1923
+ const c$9 = o$l;
1897
1924
 
1898
1925
  const a$4 = a$n.forwardRef((e, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...e, weights: e$D }));
1899
1926
  a$4.displayName = "BankIcon";
@@ -1929,16 +1956,16 @@ const c$6 = a$n.forwardRef((o, r) => /* @__PURE__ */ a$n.createElement(p$2, { re
1929
1956
  c$6.displayName = "CheckCircleIcon";
1930
1957
  const s$2 = c$6;
1931
1958
 
1932
- const o$j = a$n.forwardRef((t, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...t, weights: l$6 }));
1933
- o$j.displayName = "CheckFatIcon";
1934
- const n$b = o$j;
1959
+ const o$k = a$n.forwardRef((t, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...t, weights: l$6 }));
1960
+ o$k.displayName = "CheckFatIcon";
1961
+ const n$b = o$k;
1935
1962
 
1936
- const o$i = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$y }));
1937
- o$i.displayName = "CheckSquareIcon";
1963
+ const o$j = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$y }));
1964
+ o$j.displayName = "CheckSquareIcon";
1938
1965
 
1939
- const o$h = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: a$i }));
1940
- o$h.displayName = "CircleHalfIcon";
1941
- const l = o$h;
1966
+ const o$i = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: a$i }));
1967
+ o$i.displayName = "CircleHalfIcon";
1968
+ const l = o$i;
1942
1969
 
1943
1970
  const e$9 = a$n.forwardRef((o, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...o, weights: e$x }));
1944
1971
  e$9.displayName = "CurrencyCircleDollarIcon";
@@ -1954,21 +1981,21 @@ const n$a = t$3;
1954
1981
  const t$2 = a$n.forwardRef((m, e) => /* @__PURE__ */ a$n.createElement(p$2, { ref: e, ...m, weights: a$h }));
1955
1982
  t$2.displayName = "EmptyIcon";
1956
1983
 
1957
- const o$g = a$n.forwardRef((r, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...r, weights: a$g }));
1958
- o$g.displayName = "EyeIcon";
1959
- const n$9 = o$g;
1984
+ const o$h = a$n.forwardRef((r, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...r, weights: a$g }));
1985
+ o$h.displayName = "EyeIcon";
1986
+ const n$9 = o$h;
1960
1987
 
1961
- const o$f = a$n.forwardRef((a, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...a, weights: e$u }));
1962
- o$f.displayName = "EyeSlashIcon";
1963
- const n$8 = o$f;
1988
+ const o$g = a$n.forwardRef((a, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...a, weights: e$u }));
1989
+ o$g.displayName = "EyeSlashIcon";
1990
+ const n$8 = o$g;
1964
1991
 
1965
- const o$e = a$n.forwardRef((n, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...n, weights: l$5 }));
1966
- o$e.displayName = "FunnelIcon";
1967
- const s$1 = o$e;
1992
+ const o$f = a$n.forwardRef((n, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...n, weights: l$5 }));
1993
+ o$f.displayName = "FunnelIcon";
1994
+ const s$1 = o$f;
1968
1995
 
1969
- const o$d = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: l$4 }));
1970
- o$d.displayName = "GearIcon";
1971
- const n$7 = o$d;
1996
+ const o$e = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: l$4 }));
1997
+ o$e.displayName = "GearIcon";
1998
+ const n$7 = o$e;
1972
1999
 
1973
2000
  const e$8 = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: l$3 }));
1974
2001
  e$8.displayName = "HourglassSimpleLowIcon";
@@ -1977,41 +2004,41 @@ const e$7 = a$n.forwardRef((r, t) => /* @__PURE__ */ a$n.createElement(p$2, { re
1977
2004
  e$7.displayName = "InfoIcon";
1978
2005
  const c$4 = e$7;
1979
2006
 
1980
- const e$6 = a$n.forwardRef((c, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...c, weights: H }));
2007
+ const e$6 = a$n.forwardRef((c, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...c, weights: H$1 }));
1981
2008
  e$6.displayName = "InvoiceIcon";
1982
2009
  const m$8 = e$6;
1983
2010
 
1984
- const o$c = a$n.forwardRef((r, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...r, weights: a$e }));
1985
- o$c.displayName = "KeyholeIcon";
1986
- const n$6 = o$c;
2011
+ const o$d = a$n.forwardRef((r, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...r, weights: a$e }));
2012
+ o$d.displayName = "KeyholeIcon";
2013
+ const n$6 = o$d;
1987
2014
 
1988
- const o$b = a$n.forwardRef((s, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...s, weights: l$2 }));
1989
- o$b.displayName = "ListChecksIcon";
2015
+ const o$c = a$n.forwardRef((s, t) => /* @__PURE__ */ a$n.createElement(p$2, { ref: t, ...s, weights: l$2 }));
2016
+ o$c.displayName = "ListChecksIcon";
1990
2017
 
1991
- const o$a = a$n.forwardRef((m, p) => /* @__PURE__ */ a$n.createElement(p$2, { ref: p, ...m, weights: e$t }));
1992
- o$a.displayName = "LockSimpleOpenIcon";
1993
- const a = o$a;
2018
+ const o$b = a$n.forwardRef((m, p) => /* @__PURE__ */ a$n.createElement(p$2, { ref: p, ...m, weights: e$t }));
2019
+ o$b.displayName = "LockSimpleOpenIcon";
2020
+ const a = o$b;
1994
2021
 
1995
- const o$9 = a$n.forwardRef((s, n) => /* @__PURE__ */ a$n.createElement(p$2, { ref: n, ...s, weights: a$d }));
1996
- o$9.displayName = "MagnifyingGlassIcon";
1997
- const f = o$9;
2022
+ const o$a = a$n.forwardRef((s, n) => /* @__PURE__ */ a$n.createElement(p$2, { ref: n, ...s, weights: a$d }));
2023
+ o$a.displayName = "MagnifyingGlassIcon";
2024
+ const f = o$a;
1998
2025
 
1999
- const o$8 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$s }));
2000
- o$8.displayName = "MinusSquareIcon";
2026
+ const o$9 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$s }));
2027
+ o$9.displayName = "MinusSquareIcon";
2001
2028
 
2002
2029
  const e$5 = a$n.forwardRef((a, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...a, weights: e$r }));
2003
2030
  e$5.displayName = "MoneyWavyIcon";
2004
2031
 
2005
- const o$7 = a$n.forwardRef((t, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...t, weights: e$q }));
2006
- o$7.displayName = "NotePencilIcon";
2032
+ const o$8 = a$n.forwardRef((t, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...t, weights: e$q }));
2033
+ o$8.displayName = "NotePencilIcon";
2007
2034
 
2008
2035
  const t$1 = a$n.forwardRef((o, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...o, weights: e$p }));
2009
2036
  t$1.displayName = "PaletteIcon";
2010
2037
  const n$5 = t$1;
2011
2038
 
2012
- const o$6 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$o }));
2013
- o$6.displayName = "PaperclipIcon";
2014
- const m$7 = o$6;
2039
+ const o$7 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: e$o }));
2040
+ o$7.displayName = "PaperclipIcon";
2041
+ const m$7 = o$7;
2015
2042
 
2016
2043
  const e$4 = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: a$c }));
2017
2044
  e$4.displayName = "PlusIcon";
@@ -2021,24 +2048,24 @@ const e$3 = a$n.forwardRef((t, r) => /* @__PURE__ */ a$n.createElement(p$2, { re
2021
2048
  e$3.displayName = "QuestionIcon";
2022
2049
  const m$6 = e$3;
2023
2050
 
2024
- const o$5 = a$n.forwardRef((c, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...c, weights: e$n }));
2025
- o$5.displayName = "ShieldCheckIcon";
2026
- const h = o$5;
2051
+ const o$6 = a$n.forwardRef((c, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...c, weights: e$n }));
2052
+ o$6.displayName = "ShieldCheckIcon";
2053
+ const h = o$6;
2027
2054
 
2028
2055
  const p = a$n.forwardRef((e, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...e, weights: e$m }));
2029
2056
  p.displayName = "ShoppingCartSimpleIcon";
2030
2057
  const n$3 = p;
2031
2058
 
2032
- const o$4 = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: e$l }));
2033
- o$4.displayName = "SlidersIcon";
2034
- const c$3 = o$4;
2059
+ const o$5 = a$n.forwardRef((r, s) => /* @__PURE__ */ a$n.createElement(p$2, { ref: s, ...r, weights: e$l }));
2060
+ o$5.displayName = "SlidersIcon";
2061
+ const c$3 = o$5;
2035
2062
 
2036
- const o$3 = a$n.forwardRef((r, n) => /* @__PURE__ */ a$n.createElement(p$2, { ref: n, ...r, weights: e$k }));
2037
- o$3.displayName = "SpinnerGapIcon";
2038
- const m$5 = o$3;
2063
+ const o$4 = a$n.forwardRef((r, n) => /* @__PURE__ */ a$n.createElement(p$2, { ref: n, ...r, weights: e$k }));
2064
+ o$4.displayName = "SpinnerGapIcon";
2065
+ const m$5 = o$4;
2039
2066
 
2040
- const o$2 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: a$a }));
2041
- o$2.displayName = "SquareIcon";
2067
+ const o$3 = a$n.forwardRef((r, a) => /* @__PURE__ */ a$n.createElement(p$2, { ref: a, ...r, weights: a$a }));
2068
+ o$3.displayName = "SquareIcon";
2042
2069
 
2043
2070
  const t = a$n.forwardRef((a, c) => /* @__PURE__ */ a$n.createElement(p$2, { ref: c, ...a, weights: a$9 }));
2044
2071
  t.displayName = "StackIcon";
@@ -2052,6 +2079,9 @@ const e$2 = a$n.forwardRef((o, r) => /* @__PURE__ */ a$n.createElement(p$2, { re
2052
2079
  e$2.displayName = "StudentIcon";
2053
2080
  const s = e$2;
2054
2081
 
2082
+ const o$2 = a$n.forwardRef((a, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...a, weights: H }));
2083
+ o$2.displayName = "TableIcon";
2084
+
2055
2085
  const m$4 = a$n.forwardRef((e, r) => /* @__PURE__ */ a$n.createElement(p$2, { ref: r, ...e, weights: e$i }));
2056
2086
  m$4.displayName = "ThumbsDownIcon";
2057
2087
  const c$2 = m$4;
@@ -2195,7 +2225,7 @@ const selectIcon = (iconName) => {
2195
2225
  case "sync":
2196
2226
  return { icon: r$6, color: Styles.color.blue.primary };
2197
2227
  case "check-square":
2198
- return { icon: o$i, color: Styles.color.blue.primary };
2228
+ return { icon: o$j, color: Styles.color.blue.primary };
2199
2229
  case "empty":
2200
2230
  return { icon: t$2, color: Styles.color.states.error };
2201
2231
  case "money":
@@ -2214,9 +2244,11 @@ const selectIcon = (iconName) => {
2214
2244
  case "truck":
2215
2245
  return { icon: r$2, color: Styles.color.grey.shadow };
2216
2246
  case "list-checks":
2217
- return { icon: o$b, color: Styles.color.blue.primary };
2247
+ return { icon: o$c, color: Styles.color.blue.primary };
2218
2248
  case "note-pencil":
2219
- return { icon: o$7, color: Styles.color.grey.charcoal };
2249
+ return { icon: o$8, color: Styles.color.grey.charcoal };
2250
+ case "table":
2251
+ return { icon: o$2, color: Styles.color.grey.charcoal };
2220
2252
  default:
2221
2253
  return {
2222
2254
  icon: ({ size, color, id, className, dataTestId }) => (a__default.createElement(StellaIcon$1, { size: size, color: color, id: id, className: className, "data-testid": dataTestId })),
@@ -2261,6 +2293,7 @@ const getFill = (iconName) => {
2261
2293
  "list-checks",
2262
2294
  "broadcast",
2263
2295
  "eye",
2296
+ "table",
2264
2297
  ];
2265
2298
  if (boldIcons.includes(iconName)) {
2266
2299
  return "bold";
@@ -21768,6 +21801,54 @@ function useReactTable(options) {
21768
21801
  return tableRef.current;
21769
21802
  }
21770
21803
 
21804
+ const TABLE_STORAGE_PREFIX = "ds-table-state";
21805
+ function loadTableState(tableId) {
21806
+ try {
21807
+ const raw = localStorage.getItem(`${TABLE_STORAGE_PREFIX}:${tableId}`);
21808
+ return raw ? JSON.parse(raw) : {};
21809
+ }
21810
+ catch {
21811
+ return {};
21812
+ }
21813
+ }
21814
+ function saveTableState(tableId, state) {
21815
+ try {
21816
+ localStorage.setItem(`${TABLE_STORAGE_PREFIX}:${tableId}`, JSON.stringify(state));
21817
+ }
21818
+ catch { }
21819
+ }
21820
+ function usePersistTableState(tableId, state, sizingDebounceMs = 300) {
21821
+ const debounceTimer = useRef(null);
21822
+ const latestSizing = useRef(state.columnSizing);
21823
+ useEffect(() => {
21824
+ latestSizing.current = state.columnSizing;
21825
+ }, [state.columnSizing]);
21826
+ // Persist visibility and sorting immediately
21827
+ useEffect(() => {
21828
+ saveTableState(tableId, {
21829
+ columnVisibility: state.columnVisibility,
21830
+ columnSizing: latestSizing.current,
21831
+ sorting: state.sorting,
21832
+ });
21833
+ }, [tableId, state.columnVisibility, state.sorting]);
21834
+ // Persist sizing debounced
21835
+ useEffect(() => {
21836
+ if (debounceTimer.current)
21837
+ clearTimeout(debounceTimer.current);
21838
+ debounceTimer.current = setTimeout(() => {
21839
+ saveTableState(tableId, {
21840
+ columnVisibility: state.columnVisibility,
21841
+ columnSizing: latestSizing.current,
21842
+ sorting: state.sorting,
21843
+ });
21844
+ }, sizingDebounceMs);
21845
+ return () => {
21846
+ if (debounceTimer.current)
21847
+ clearTimeout(debounceTimer.current);
21848
+ };
21849
+ }, [tableId, state.columnSizing]);
21850
+ }
21851
+
21771
21852
  const getSelectWidth = (digits) => {
21772
21853
  if (digits >= 10 && digits <= 99)
21773
21854
  return "36px";
@@ -22277,6 +22358,18 @@ const ClearFilterButtonRow = styled.div `
22277
22358
  align-items: "center";
22278
22359
  text-align: "center";
22279
22360
  `;
22361
+ const ActionBar = styled.div `
22362
+ display: flex;
22363
+ justify-content: space-between;
22364
+ height: fit-content;
22365
+ width: 100%;
22366
+ `;
22367
+ const GlobalActionWrapper = styled.div `
22368
+ display: flex;
22369
+ gap: 10px;
22370
+ width: fit-content;
22371
+ padding-bottom: 5px;
22372
+ `;
22280
22373
 
22281
22374
  const IndeterminateCheckbox = ({ isIndeterminate, isChecked, onChange, }) => {
22282
22375
  const ref = useRef(null);
@@ -22319,6 +22412,40 @@ function useDebounceCallback(callback, delay) {
22319
22412
  return [debounced, { flush, cancel }];
22320
22413
  }
22321
22414
 
22415
+ const CheckboxDropdownMenu = ({ options, selected, mode = "multiSelect", coords, menuRef, onApply, onClear, showSelectAll = true, showClear = false, searchInputId = "search", searchInputLabel = "Search", onSearch, onSearchBlur, serverSide = false, }) => {
22416
+ const [tempSelected, setTempSelected] = useState(selected);
22417
+ const toggleItem = (key) => {
22418
+ setTempSelected((prev) => prev.includes(key) ? prev.filter((i) => i !== key) : [...prev, key]);
22419
+ };
22420
+ const toggleAll = () => {
22421
+ setTempSelected((prev) => prev.length === options.length ? [] : options.map((o) => o.key));
22422
+ };
22423
+ const showApplyButton = mode === "multiSelect" || (mode === "search" && serverSide);
22424
+ return createPortal(a__default.createElement(FilterMenu, { style: { top: coords.top, left: coords.left, position: "absolute" }, ref: menuRef },
22425
+ a__default.createElement(MenuItemGroup, null,
22426
+ mode === "search" && (a__default.createElement("div", { style: { padding: "4px 10px" } },
22427
+ a__default.createElement(TextInput, { id: searchInputId, label: searchInputLabel, placeholder: "Search", hideLabel: true, onChange: (value) => {
22428
+ setTempSelected(value === "" ? [] : [value]);
22429
+ if (!serverSide)
22430
+ onSearch?.(value);
22431
+ }, onBlur: () => !serverSide && onSearchBlur?.(), endIcon: "search", value: tempSelected?.[0] }))),
22432
+ mode === "multiSelect" && showSelectAll && (a__default.createElement(MenuItem, { key: "select-all" },
22433
+ a__default.createElement(Checkbox, { id: "all-checkbox", name: "all-checkbox", checked: options.every((opt) => tempSelected.includes(opt.key)), onChange: toggleAll }),
22434
+ a__default.createElement(FilterBoxLabel, { htmlFor: "all-checkbox" }, "Select All"))),
22435
+ mode !== "search" &&
22436
+ options.map(({ key, value }, index) => {
22437
+ if (mode === "singleSelect") {
22438
+ return (a__default.createElement(MenuItemOption, { key: `${key}-${index}`, id: `${key}-button`, onClick: () => onApply([key]), "$applied": selected.includes(key) }, value));
22439
+ }
22440
+ return (a__default.createElement(MenuItem, { key: key },
22441
+ a__default.createElement(Checkbox, { id: `${key}-checkbox`, name: `${key}-checkbox`, checked: tempSelected.includes(key), onChange: () => toggleItem(key) }),
22442
+ a__default.createElement(FilterLabelTransparent, null, value),
22443
+ a__default.createElement(FilterBoxLabel, { htmlFor: `${key}-checkbox` }, value)));
22444
+ })),
22445
+ showApplyButton && (a__default.createElement(MenuButton, { onClick: () => onApply(tempSelected) }, "Apply Selection")),
22446
+ showClear && a__default.createElement(MenuButton, { onClick: onClear }, "Clear Filter")), document.body);
22447
+ };
22448
+
22322
22449
  const normalizeOptions = (raw) => {
22323
22450
  return raw
22324
22451
  .map((item) => {
@@ -22335,27 +22462,29 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22335
22462
  const column = header.column;
22336
22463
  const columnDef = column.columnDef;
22337
22464
  const meta = columnDef.meta;
22338
- // Filter dropdown logic
22339
22465
  const menuRef = useRef(null);
22340
22466
  const buttonRef = useRef(null);
22341
22467
  const [showFilter, setShowFilter] = useState(false);
22342
22468
  const [coords, setCoords] = useState({ top: 0, left: 0 });
22343
- const [tempFilters, setTempFilters] = useState([]);
22344
- const [currentAppliedFilters, setCurrentAppliedFilters] = useState([]);
22345
22469
  const [filterOptions, setFilterOptions] = useState([]);
22346
- const displayOptions = serverSide
22347
- ? filterOptions
22348
- : normalizeOptions(Array.from(header.column.getFacetedUniqueValues().keys()));
22349
22470
  const [textAlign, setTextAlign] = useState("left");
22350
22471
  const [handleSave, { flush }] = useDebounceCallback((value) => {
22351
- column?.setFilterValue([value]);
22352
- if (value === "")
22353
- column?.setFilterValue([]);
22472
+ column?.setFilterValue(value === "" ? [] : [value]);
22354
22473
  onFilterApply?.();
22355
22474
  }, 300);
22475
+ const displayOptions = serverSide
22476
+ ? filterOptions
22477
+ : normalizeOptions(Array.from(header.column.getFacetedUniqueValues().keys()));
22356
22478
  useEffect(() => {
22357
22479
  setFilterOptions(normalizeOptions(meta?.filterOptions || []));
22358
22480
  }, [meta]);
22481
+ useEffect(() => {
22482
+ setTextAlign(meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"));
22483
+ }, [meta]);
22484
+ useEffect(() => {
22485
+ if (meta?.pin)
22486
+ column.pin(meta.pin);
22487
+ }, []);
22359
22488
  const toggleMenu = (e) => {
22360
22489
  e.stopPropagation();
22361
22490
  if (buttonRef.current) {
@@ -22365,11 +22494,13 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22365
22494
  left: rect.right + window.scrollX - 25,
22366
22495
  });
22367
22496
  }
22368
- showFilterMenu(!showFilter);
22497
+ const next = !showFilter;
22498
+ onFilterMenuInteraction?.(column.id, next);
22499
+ setShowFilter(next);
22369
22500
  };
22370
- const showFilterMenu = (active) => {
22371
- onFilterMenuInteraction?.(column.id, active);
22372
- setShowFilter(active);
22501
+ const closeMenu = () => {
22502
+ onFilterMenuInteraction?.(column.id, false);
22503
+ setShowFilter(false);
22373
22504
  };
22374
22505
  // Close on outside click
22375
22506
  useEffect(() => {
@@ -22377,28 +22508,14 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22377
22508
  return;
22378
22509
  const handleClickOutside = (e) => {
22379
22510
  const target = e.target;
22380
- const insideButton = !!buttonRef.current?.contains(target);
22381
- const insideMenu = !!menuRef.current?.contains(target);
22382
- if (!insideButton && !insideMenu) {
22383
- setTempFilters(filters?.[header.id] || currentAppliedFilters);
22384
- showFilterMenu(false);
22511
+ if (!buttonRef.current?.contains(target) && !menuRef.current?.contains(target)) {
22512
+ closeMenu();
22385
22513
  }
22386
22514
  };
22387
22515
  document.addEventListener("click", handleClickOutside, true);
22388
22516
  return () => document.removeEventListener("click", handleClickOutside, true);
22389
22517
  }, [showFilter]);
22390
- useEffect(() => {
22391
- setTextAlign(meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"));
22392
- }, [meta]);
22393
- useEffect(() => {
22394
- const currentFilters = filters?.[header.id];
22395
- setTempFilters(currentFilters ? currentFilters : []);
22396
- }, [filters]);
22397
- useEffect(() => {
22398
- if (meta?.pin) {
22399
- column.pin(meta?.pin);
22400
- }
22401
- }, []);
22518
+ const appliedFilters = filters?.[header.id] ?? [];
22402
22519
  return (a__default.createElement(HeaderCell, { "$isPinnedLeft": column.getIsPinned() === "left", "$isPinnedRight": column.getIsPinned() === "right", "$columnInfo": column, "$filterMenuOpen": showFilter, style: {
22403
22520
  textAlign: meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"),
22404
22521
  width: header.getSize(),
@@ -22409,82 +22526,19 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22409
22526
  ? "none"
22410
22527
  : undefined,
22411
22528
  } },
22412
- a__default.createElement(HeaderCellPosition, { style: {
22413
- justifyContent: textAlign === "left" ? "start" : "end",
22414
- } },
22529
+ a__default.createElement(HeaderCellPosition, { style: { justifyContent: textAlign === "left" ? "start" : "end" } },
22415
22530
  textAlign === "left" && (a__default.createElement("span", { style: { fontWeight: 600 } }, flexRender(columnDef.header, header.getContext()))),
22416
- header.column.getCanFilter() && (a__default.createElement("div", { style: {
22417
- display: "flex",
22418
- alignItems: "center",
22419
- position: "relative",
22420
- } },
22421
- a__default.createElement(CustomIconButton$1, { className: "icon", iconName: "filter", ariaLabel: "Filter Button", variant: "tertiary", "$active": filters[header.id]?.length > 0 || showFilter, onClick: (e) => toggleMenu(e), ref: buttonRef }),
22422
- showFilter &&
22423
- createPortal(a__default.createElement(FilterMenu, { style: {
22424
- top: coords.top,
22425
- left: coords.left,
22426
- position: "absolute",
22427
- }, ref: menuRef },
22428
- a__default.createElement(MenuItemGroup, null,
22429
- meta?.filterMode === "search" && (a__default.createElement("div", { style: { padding: "4px 10px" } },
22430
- a__default.createElement(TextInput, { id: `${columnDef.header}-search`, label: `${columnDef.header} search`, placeholder: "Search", hideLabel: true, onChange: (value) => {
22431
- value === ""
22432
- ? setTempFilters([])
22433
- : setTempFilters([value]);
22434
- !serverSide && handleSave(value);
22435
- }, onBlur: () => !serverSide && flush(), endIcon: "search", value: tempFilters?.[0] }))),
22436
- (meta?.filterMode === "multiSelect" ||
22437
- !meta?.filterMode) && (a__default.createElement(MenuItem, { key: "select-all" },
22438
- a__default.createElement(Checkbox, { id: "all-checkbox", name: "all-checkbox", checked: displayOptions?.every((opt) => tempFilters?.includes(opt.key)), onChange: () => {
22439
- setTempFilters((prev) => {
22440
- if (prev?.length === displayOptions?.length) {
22441
- return [];
22442
- }
22443
- else {
22444
- return displayOptions.map((opt) => opt.key);
22445
- }
22446
- });
22447
- } }),
22448
- a__default.createElement(FilterBoxLabel, { htmlFor: "all-checkbox" }, "Select All"))),
22449
- displayOptions?.map(({ key, value }, index) => {
22450
- if (meta?.filterMode === "singleSelect") {
22451
- return (a__default.createElement(MenuItemOption, { key: `${key}-${index}`, id: `${key}-button`, onClick: () => {
22452
- setCurrentAppliedFilters([key]);
22453
- column?.setFilterValue([key]);
22454
- showFilterMenu(false);
22455
- onFilterApply?.();
22456
- }, "$applied": tempFilters?.includes(key) }, value));
22457
- }
22458
- if (meta?.filterMode === "multiSelect" ||
22459
- !meta?.filterMode) {
22460
- return (a__default.createElement(MenuItem, { key: key },
22461
- a__default.createElement(Checkbox, { id: `${key}-checkbox`, name: `${key}-checkbox`, checked: tempFilters?.includes(key), onChange: () => {
22462
- setTempFilters((prev) => {
22463
- if (prev?.includes(key))
22464
- return prev.filter((i) => i !== key);
22465
- else
22466
- return [...prev, key];
22467
- });
22468
- } }),
22469
- a__default.createElement(FilterLabelTransparent, null, value),
22470
- a__default.createElement(FilterBoxLabel, { htmlFor: `${key}-checkbox` }, value)));
22471
- }
22472
- })),
22473
- (meta?.filterMode === "multiSelect" ||
22474
- (meta?.filterMode === "search" && serverSide) ||
22475
- !meta?.filterMode) && (a__default.createElement(MenuButton, { key: "apply", onClick: () => {
22476
- setCurrentAppliedFilters(tempFilters);
22477
- column?.setFilterValue(tempFilters?.length > 0 ? tempFilters : []);
22478
- showFilterMenu(false);
22479
- onFilterApply?.();
22480
- } }, "Apply Selection")),
22481
- filters?.[header.id]?.length > 0 && (a__default.createElement(MenuButton, { key: "clear", onClick: () => {
22482
- column?.setFilterValue([]);
22483
- showFilterMenu(false);
22484
- setTempFilters([]);
22485
- setCurrentAppliedFilters([]);
22486
- onFilterApply?.();
22487
- } }, "Clear Filter"))), document.body))),
22531
+ header.column.getCanFilter() && (a__default.createElement("div", { style: { display: "flex", alignItems: "center", position: "relative" } },
22532
+ a__default.createElement(CustomIconButton$1, { className: "icon", iconName: "filter", ariaLabel: "Filter Button", variant: "tertiary", "$active": appliedFilters.length > 0 || showFilter, onClick: (e) => toggleMenu(e), ref: buttonRef }),
22533
+ showFilter && (a__default.createElement(CheckboxDropdownMenu, { options: displayOptions, selected: appliedFilters, mode: meta?.filterMode ?? "multiSelect", coords: coords, menuRef: menuRef, showSelectAll: meta?.filterMode !== "singleSelect", showClear: appliedFilters.length > 0, onApply: (selected) => {
22534
+ column?.setFilterValue(selected.length > 0 ? selected : []);
22535
+ closeMenu();
22536
+ onFilterApply?.();
22537
+ }, onClear: () => {
22538
+ column?.setFilterValue([]);
22539
+ closeMenu();
22540
+ onFilterApply?.();
22541
+ }, serverSide: serverSide, onSearch: handleSave, onSearchBlur: flush, searchInputId: `${String(columnDef.header)}-search`, searchInputLabel: `${String(columnDef.header)} search` })))),
22488
22542
  header.column.getCanSort() && (a__default.createElement(SortButton, { className: "icon", iconName: "sort", ariaLabel: "Sort Button", variant: "tertiary", "$active": sorting.some((s) => s.id === header.column.id), "$sort": column.getIsSorted(), onClick: (e) => header.column.getToggleSortingHandler()?.(e) })),
22489
22543
  textAlign === "right" && (a__default.createElement("span", { style: { fontWeight: 600 } }, flexRender(columnDef.header, header.getContext()))))));
22490
22544
  };
@@ -22544,7 +22598,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22544
22598
  startingPage: 1,
22545
22599
  rowsPerPage: 10,
22546
22600
  totalRows: data.length,
22547
- }, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, }) {
22601
+ }, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, enableShowHide, globalActions, }) {
22548
22602
  const [rowSelection, setRowSelection] = useState({});
22549
22603
  const [selectedRows] = useState({});
22550
22604
  const [pageIndex, setPageIndex] = useState(paginationDetails?.startingPage);
@@ -22555,9 +22609,20 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22555
22609
  const [localData, setLocalData] = useState(data);
22556
22610
  const [localColumns, setLocalColumns] = useState(columns);
22557
22611
  const [totalData, setTotalData] = useState(paginationDetails?.totalRows);
22558
- const [sorting, setSorting] = useState([]);
22612
+ const [sorting, setSorting] = useState(() => loadTableState(id).sorting ?? []);
22559
22613
  const [filters, setFilters] = useState({});
22560
22614
  const [rowState, setRowState] = useState({});
22615
+ const [columnVisibility, setColumnVisibility] = useState(() => {
22616
+ const persisted = loadTableState(id);
22617
+ if (persisted.columnVisibility)
22618
+ return persisted.columnVisibility;
22619
+ return Object.fromEntries(columns
22620
+ .filter((col) => col.meta?.defaultHidden)
22621
+ .map((col) => [
22622
+ "accessorKey" in col ? col.accessorKey : col.id,
22623
+ false,
22624
+ ]));
22625
+ });
22561
22626
  const [columnFilters, setColumnFilters] = useState(() => {
22562
22627
  const base = defaultFilters ?? [];
22563
22628
  if (!staticFilters?.length)
@@ -22580,6 +22645,13 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22580
22645
  });
22581
22646
  const [columnPinning, setColumnPinning] = useState({ left: ["select"], right: ["options"] });
22582
22647
  const scrollRef = useRef(null);
22648
+ const visibilityButtonRef = useRef(null);
22649
+ const visibilityMenuRef = useRef(null);
22650
+ const [showVisibilityMenu, setShowVisibilityMenu] = useState(false);
22651
+ const [visibilityMenuCoords, setVisibilityMenuCoords] = useState({
22652
+ top: 0,
22653
+ left: 0,
22654
+ });
22583
22655
  const [scrollState, setScrollState] = useState({
22584
22656
  atLeft: true,
22585
22657
  atRight: false,
@@ -22600,6 +22672,19 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22600
22672
  if (paginationDetails && paginationDetails.startingPage !== pageIndex)
22601
22673
  setPageIndex(paginationDetails?.startingPage);
22602
22674
  }, [paginationDetails, data, columns]);
22675
+ useEffect(() => {
22676
+ if (!showVisibilityMenu)
22677
+ return;
22678
+ const handleClickOutside = (e) => {
22679
+ const target = e.target;
22680
+ if (!visibilityButtonRef.current?.contains(target) &&
22681
+ !visibilityMenuRef.current?.contains(target)) {
22682
+ setShowVisibilityMenu(false);
22683
+ }
22684
+ };
22685
+ document.addEventListener("click", handleClickOutside, true);
22686
+ return () => document.removeEventListener("click", handleClickOutside, true);
22687
+ }, [showVisibilityMenu]);
22603
22688
  useLayoutEffect$1(() => {
22604
22689
  const el = scrollRef.current;
22605
22690
  if (!el)
@@ -22682,6 +22767,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22682
22767
  data: localData,
22683
22768
  columns: enhancedColumns,
22684
22769
  state: {
22770
+ columnVisibility,
22685
22771
  pagination,
22686
22772
  sorting,
22687
22773
  columnFilters,
@@ -22697,6 +22783,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22697
22783
  enableRowSelection: showSelection,
22698
22784
  rowCount: serverSide ? paginationDetails?.totalRows : undefined,
22699
22785
  enableColumnPinning: true,
22786
+ onColumnVisibilityChange: setColumnVisibility,
22700
22787
  getCoreRowModel: getCoreRowModel(),
22701
22788
  getFacetedRowModel: !serverSide ? getFacetedRowModel() : undefined,
22702
22789
  getFacetedUniqueValues: !serverSide ? getFacetedUniqueValues() : undefined,
@@ -22750,6 +22837,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22750
22837
  },
22751
22838
  },
22752
22839
  });
22840
+ usePersistTableState(id, { columnVisibility, sorting });
22753
22841
  useEffect(() => {
22754
22842
  if (onRowSelect) {
22755
22843
  const selectedData = table
@@ -22777,95 +22865,133 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22777
22865
  });
22778
22866
  table.toggleAllRowsSelected(false);
22779
22867
  };
22780
- return (a__default.createElement(TableWrapper, { className: className, id: id, "data-testid": dataTestId, "data-auto": dataAuto },
22781
- a__default.createElement(TableWrapperScroll, { "$stopScroll": Object.values(filterMenuOpen).some((value) => value), ref: scrollRef }, isLoading ? (a__default.createElement("div", null,
22782
- a__default.createElement("div", { style: {
22783
- width: "100%",
22784
- maxWidth: "100%",
22785
- height: "100%",
22786
- marginBottom: "4px",
22787
- backgroundColor: "#f9f9f9",
22788
- display: "flex",
22789
- flexDirection: "column",
22790
- overflow: "hidden",
22791
- boxSizing: "border-box",
22792
- } }, Array.from({
22793
- length: pagination?.pageSize,
22794
- }).map((_, index) => (a__default.createElement("div", { style: {
22795
- position: "relative",
22796
- display: "flex",
22797
- flexDirection: "row",
22798
- gap: "90px",
22799
- padding: "10px 25px",
22800
- backgroundColor: index === 0 ? "#ededed" : "transparent",
22801
- borderBottom: "1px solid #e0e0e0",
22802
- alignItems: "center",
22803
- height: "50px",
22804
- minHeight: "50px",
22805
- }, key: index + "loading-row" }, Array.from({
22806
- length: 10,
22807
- }).map((_, i) => (a__default.createElement(LoadingShimmer, { key: `${i}-loading`, "$width": "110px", "$height": "25px" }))))))))) : (a__default.createElement(StyledTable, { id: `${id}-table`, ...htmlProps },
22808
- a__default.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a__default.createElement(HeaderRow, { key: headerGroup.id }, headerGroup.headers.map((header, i) => {
22809
- return (a__default.createElement(TableHeaderCell, { key: header.id, serverSide: serverSide, header: header, filters: filters, sorting: sorting, scrollPosition: scrollState, onFilterMenuInteraction: (id, active) => {
22810
- setFilterMenuOpen((prev) => ({
22811
- ...prev,
22812
- [id]: active,
22813
- }));
22814
- }, onFilterApply: () => {
22815
- setPageIndex(1);
22816
- setPagination((prev) => ({
22817
- ...prev,
22818
- pageIndex: 0,
22819
- }));
22820
- } }));
22821
- }))))),
22822
- a__default.createElement("tbody", null,
22823
- table.getRowModel().rows.length === 0 && (a__default.createElement(EmptyTableState, { header: emptyTableState?.header || "No data available.", subHeader: emptyTableState?.subHeader, showClearFilterButton: emptyTableState?.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
22824
- table.getRowModel().rows.map((row) => (a__default.createElement(CellRow, { key: row.id, onClick: () => onRowClick?.(row.original), "$isClickable": !!onRowClick }, row.getVisibleCells().map((cell) => {
22825
- const value = flexRender(cell.column.columnDef.cell, {
22826
- ...cell.getContext(),
22827
- localValue: rowState[row.id]?.[cell.column.id],
22828
- onLocalChange: (val) => handleInputChange(row.id, cell.column.id, val),
22829
- });
22830
- const meta = cell.column.columnDef.meta;
22831
- return (a__default.createElement(BodyCell, { key: cell.id, style: {
22832
- width: cell.column.getSize(),
22833
- textAlign: meta?.cellAlign ||
22834
- (typeof cell.getValue() === "number" ||
22835
- meta?.dataType === "number"
22836
- ? "right"
22837
- : "left"),
22838
- boxShadow: scrollState.atLeft &&
22839
- cell.column.getIsPinned() === "left"
22840
- ? "none"
22841
- : scrollState.atRight &&
22842
- cell.column.getIsPinned() === "right"
22868
+ return (a__default.createElement(a__default.Fragment, null,
22869
+ !isLoading && (a__default.createElement(ActionBar, null,
22870
+ a__default.createElement(GlobalActionWrapper, null, globalActions?.map((action) => action.element)),
22871
+ a__default.createElement(GlobalActionWrapper, null, enableShowHide && (a__default.createElement(a__default.Fragment, null,
22872
+ a__default.createElement(IconButton, { ref: visibilityButtonRef, ariaLabel: "Column show hide button", variant: "tertiary", iconName: "table", onClick: () => {
22873
+ const rect = visibilityButtonRef.current?.getBoundingClientRect();
22874
+ if (rect) {
22875
+ setVisibilityMenuCoords({
22876
+ top: rect.bottom + window.scrollY + 4,
22877
+ left: rect.right + window.scrollX - 140,
22878
+ });
22879
+ }
22880
+ setShowVisibilityMenu((prev) => !prev);
22881
+ } }),
22882
+ showVisibilityMenu && (a__default.createElement(CheckboxDropdownMenu, { options: table
22883
+ .getAllLeafColumns()
22884
+ .filter((col) => col.id !== "select" && col.id !== "options")
22885
+ .map((col) => ({
22886
+ key: col.id,
22887
+ value: typeof col.columnDef.header === "string"
22888
+ ? col.columnDef.header
22889
+ : col.id,
22890
+ })), selected: table
22891
+ .getAllLeafColumns()
22892
+ .filter((col) => col.getIsVisible())
22893
+ .map((col) => col.id), mode: "multiSelect", coords: visibilityMenuCoords, menuRef: visibilityMenuRef, showSelectAll: true, showClear: false, onApply: (selected) => {
22894
+ const next = {};
22895
+ table
22896
+ .getAllLeafColumns()
22897
+ .filter((col) => col.id !== "select" && col.id !== "options")
22898
+ .forEach((col) => {
22899
+ next[col.id] = selected.includes(col.id);
22900
+ });
22901
+ setColumnVisibility(next);
22902
+ setShowVisibilityMenu(false);
22903
+ }, onClear: () => { } }))))))),
22904
+ a__default.createElement(TableWrapper, { className: className, id: id, "data-testid": dataTestId, "data-auto": dataAuto },
22905
+ a__default.createElement(TableWrapperScroll, { "$stopScroll": Object.values(filterMenuOpen).some((value) => value), ref: scrollRef }, isLoading ? (a__default.createElement("div", null,
22906
+ a__default.createElement("div", { style: {
22907
+ width: "100%",
22908
+ maxWidth: "100%",
22909
+ height: "100%",
22910
+ marginBottom: "4px",
22911
+ backgroundColor: "#f9f9f9",
22912
+ display: "flex",
22913
+ flexDirection: "column",
22914
+ overflow: "hidden",
22915
+ boxSizing: "border-box",
22916
+ } }, Array.from({
22917
+ length: pagination?.pageSize,
22918
+ }).map((_, index) => (a__default.createElement("div", { style: {
22919
+ position: "relative",
22920
+ display: "flex",
22921
+ flexDirection: "row",
22922
+ gap: "90px",
22923
+ padding: "10px 25px",
22924
+ backgroundColor: index === 0 ? "#ededed" : "transparent",
22925
+ borderBottom: "1px solid #e0e0e0",
22926
+ alignItems: "center",
22927
+ height: "50px",
22928
+ minHeight: "50px",
22929
+ }, key: index + "loading-row" }, Array.from({
22930
+ length: 10,
22931
+ }).map((_, i) => (a__default.createElement(LoadingShimmer, { key: `${i}-loading`, "$width": "110px", "$height": "25px" }))))))))) : (a__default.createElement(StyledTable, { id: `${id}-table`, ...htmlProps },
22932
+ a__default.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a__default.createElement(HeaderRow, { key: headerGroup.id }, headerGroup.headers.map((header, i) => {
22933
+ return (a__default.createElement(TableHeaderCell, { key: header.id, serverSide: serverSide, header: header, filters: filters, sorting: sorting, scrollPosition: scrollState, onFilterMenuInteraction: (id, active) => {
22934
+ setFilterMenuOpen((prev) => ({
22935
+ ...prev,
22936
+ [id]: active,
22937
+ }));
22938
+ }, onFilterApply: () => {
22939
+ setPageIndex(1);
22940
+ setPagination((prev) => ({
22941
+ ...prev,
22942
+ pageIndex: 0,
22943
+ }));
22944
+ } }));
22945
+ }))))),
22946
+ a__default.createElement("tbody", null,
22947
+ table.getRowModel().rows.length === 0 && (a__default.createElement(EmptyTableState, { header: emptyTableState?.header || "No data available.", subHeader: emptyTableState?.subHeader, showClearFilterButton: emptyTableState?.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
22948
+ table.getRowModel().rows.map((row) => (a__default.createElement(CellRow, { key: row.id, onClick: () => onRowClick?.(row.original), "$isClickable": !!onRowClick }, row.getVisibleCells().map((cell) => {
22949
+ const value = flexRender(cell.column.columnDef.cell, {
22950
+ ...cell.getContext(),
22951
+ localValue: rowState[row.id]?.[cell.column.id],
22952
+ onLocalChange: (val) => handleInputChange(row.id, cell.column.id, val),
22953
+ });
22954
+ const meta = cell.column.columnDef
22955
+ .meta;
22956
+ return (a__default.createElement(BodyCell, { key: cell.id, style: {
22957
+ width: cell.column.getSize(),
22958
+ textAlign: meta?.cellAlign ||
22959
+ (typeof cell.getValue() === "number" ||
22960
+ meta?.dataType === "number"
22961
+ ? "right"
22962
+ : "left"),
22963
+ boxShadow: scrollState.atLeft &&
22964
+ cell.column.getIsPinned() === "left"
22843
22965
  ? "none"
22844
- : undefined,
22845
- backgroundColor: table
22846
- .getSelectedRowModel()
22847
- .rows.find((r) => r.id === row.id)
22848
- ? "#EBF0FA"
22849
- : rowStatusesState?.[row.id] === "action-pending"
22850
- ? "#FFFDEB"
22851
- : rowStatusesState?.[row.id] === "completed"
22852
- ? "#F5F5F5"
22853
- : "",
22854
- }, "$isPinnedLeft": cell.column.getIsPinned() === "left", "$isPinnedRight": cell.column.getIsPinned() === "right", "$columnInfo": cell.column, "$isLastRow": serverSide
22855
- ? row.index === table.getRowModel().rows.length - 1
22856
- : row.index -
22857
- pagination.pageSize * pagination.pageIndex ===
22858
- table.getRowModel().rows.length - 1 }, value));
22859
- })))))))),
22860
- showPagination && paginationDetails?.totalRows > 0 && (a__default.createElement(CustomPagination, { "$hasData": table.getRowModel().rows.length > 0, totalRows: serverSide ? totalData : table.getFilteredRowModel().rows.length, isLoading: isLoading, rowsPerPage: paginationDetails?.rowsPerPage, startingPage: pageIndex, onPageChange: (page, pageSize) => {
22861
- table.toggleAllRowsSelected(false);
22862
- setPageIndex(page);
22863
- setPagination((prev) => ({
22864
- ...prev,
22865
- pageIndex: page - 1,
22866
- }));
22867
- onPageChange?.(page, pageSize);
22868
- }, resetTrigger: resetTrigger }))));
22966
+ : scrollState.atRight &&
22967
+ cell.column.getIsPinned() === "right"
22968
+ ? "none"
22969
+ : undefined,
22970
+ backgroundColor: table
22971
+ .getSelectedRowModel()
22972
+ .rows.find((r) => r.id === row.id)
22973
+ ? "#EBF0FA"
22974
+ : rowStatusesState?.[row.id] === "action-pending"
22975
+ ? "#FFFDEB"
22976
+ : rowStatusesState?.[row.id] === "completed"
22977
+ ? "#F5F5F5"
22978
+ : "",
22979
+ }, "$isPinnedLeft": cell.column.getIsPinned() === "left", "$isPinnedRight": cell.column.getIsPinned() === "right", "$columnInfo": cell.column, "$isLastRow": serverSide
22980
+ ? row.index ===
22981
+ table.getRowModel().rows.length - 1
22982
+ : row.index -
22983
+ pagination.pageSize * pagination.pageIndex ===
22984
+ table.getRowModel().rows.length - 1 }, value));
22985
+ })))))))),
22986
+ showPagination && paginationDetails?.totalRows > 0 && (a__default.createElement(CustomPagination, { "$hasData": table.getRowModel().rows.length > 0, totalRows: serverSide ? totalData : table.getFilteredRowModel().rows.length, isLoading: isLoading, rowsPerPage: paginationDetails?.rowsPerPage, startingPage: pageIndex, onPageChange: (page, pageSize) => {
22987
+ table.toggleAllRowsSelected(false);
22988
+ setPageIndex(page);
22989
+ setPagination((prev) => ({
22990
+ ...prev,
22991
+ pageIndex: page - 1,
22992
+ }));
22993
+ onPageChange?.(page, pageSize);
22994
+ }, resetTrigger: resetTrigger })))));
22869
22995
  }
22870
22996
 
22871
22997
  const SyncContainer = styled.div `
@@ -22946,7 +23072,7 @@ const HeaderText = styled.span `
22946
23072
  color: #4d4d4d;
22947
23073
  text-align: right;
22948
23074
  font-family: Inter;
22949
- font-size: 16px;
23075
+ font-size: 14px;
22950
23076
  font-style: normal;
22951
23077
  font-weight: 500;
22952
23078
  line-height: normal;
@@ -22955,7 +23081,7 @@ const SubHeaderText = styled.span `
22955
23081
  color: #9f9f9f;
22956
23082
  text-align: right;
22957
23083
  font-family: Inter;
22958
- font-size: 12px;
23084
+ font-size: 11px;
22959
23085
  font-style: normal;
22960
23086
  font-weight: 500;
22961
23087
  line-height: normal;
@@ -23415,10 +23541,10 @@ const CheckBox = ({ id, className, label, checked, indeterminate = false, disabl
23415
23541
  ? Styles.color.grey.medium
23416
23542
  : Styles.color.core.primary;
23417
23543
  if (isIndeterminate)
23418
- return (a__default.createElement(o$8, { "data-testid": "indeterminate-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23544
+ return (a__default.createElement(o$9, { "data-testid": "indeterminate-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23419
23545
  if (isChecked)
23420
- return (a__default.createElement(o$i, { "data-testid": "check-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23421
- return (a__default.createElement(o$2, { "data-testid": "square-icon", className: "checkbox-icon", size: 18, weight: "regular", color: color }));
23546
+ return (a__default.createElement(o$j, { "data-testid": "check-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23547
+ return (a__default.createElement(o$3, { "data-testid": "square-icon", className: "checkbox-icon", size: 18, weight: "regular", color: color }));
23422
23548
  };
23423
23549
  return (a__default.createElement(CheckBoxWrapper, { id: `${id}-label`, className: className, "$disabled": disabled, "$align": align, "$fontSize": fontSize },
23424
23550
  a__default.createElement(HiddenInput, { id: id, ref: inputRef, checked: isChecked, disabled: disabled, onChange: handleChange, ...htmlProps }),