@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.
package/dist/cjs/index.js CHANGED
@@ -961,7 +961,7 @@ const a$f = /* @__PURE__ */ new Map([
961
961
  ]
962
962
  ]);
963
963
 
964
- const H = /* @__PURE__ */ new Map([
964
+ const H$1 = /* @__PURE__ */ new Map([
965
965
  [
966
966
  "bold",
967
967
  /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
@@ -1573,6 +1573,33 @@ const e$j = /* @__PURE__ */ new Map([
1573
1573
  ]
1574
1574
  ]);
1575
1575
 
1576
+ const H = /* @__PURE__ */ new Map([
1577
+ [
1578
+ "bold",
1579
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
1580
+ ],
1581
+ [
1582
+ "duotone",
1583
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.createElement("path", { d: "M88,104v96H32V104Z", opacity: "0.2" }), /* @__PURE__ */ a__namespace.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" }))
1584
+ ],
1585
+ [
1586
+ "fill",
1587
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
1588
+ ],
1589
+ [
1590
+ "light",
1591
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
1592
+ ],
1593
+ [
1594
+ "regular",
1595
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
1596
+ ],
1597
+ [
1598
+ "thin",
1599
+ /* @__PURE__ */ a__namespace.createElement(a__namespace.Fragment, null, /* @__PURE__ */ a__namespace.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" }))
1600
+ ]
1601
+ ]);
1602
+
1576
1603
  const e$i = /* @__PURE__ */ new Map([
1577
1604
  [
1578
1605
  "bold",
@@ -1846,7 +1873,7 @@ const a$5 = /* @__PURE__ */ new Map([
1846
1873
  ]
1847
1874
  ]);
1848
1875
 
1849
- const o$m = a$n.createContext({
1876
+ const o$n = a$n.createContext({
1850
1877
  color: "currentColor",
1851
1878
  size: "1em",
1852
1879
  weight: "regular",
@@ -1870,7 +1897,7 @@ const p$2 = a__namespace.forwardRef(
1870
1897
  weight: f = "regular",
1871
1898
  mirrored: g = false,
1872
1899
  ...w
1873
- } = a__namespace.useContext(o$m);
1900
+ } = a__namespace.useContext(o$n);
1874
1901
  return /* @__PURE__ */ a__namespace.createElement(
1875
1902
  "svg",
1876
1903
  {
@@ -1892,9 +1919,9 @@ const p$2 = a__namespace.forwardRef(
1892
1919
  );
1893
1920
  p$2.displayName = "IconBase";
1894
1921
 
1895
- const o$l = a__namespace.forwardRef((e, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...e, weights: a$m }));
1896
- o$l.displayName = "ArrowCircleUpIcon";
1897
- const p$1 = o$l;
1922
+ const o$m = a__namespace.forwardRef((e, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...e, weights: a$m }));
1923
+ o$m.displayName = "ArrowCircleUpIcon";
1924
+ const p$1 = o$m;
1898
1925
 
1899
1926
  const r$7 = a__namespace.forwardRef((e, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...e, weights: a$l }));
1900
1927
  r$7.displayName = "ArrowUpIcon";
@@ -1911,9 +1938,9 @@ const e$d = a__namespace.forwardRef((o, t) => /* @__PURE__ */ a__namespace.creat
1911
1938
  e$d.displayName = "ArrowsOutLineVerticalIcon";
1912
1939
  const n$c = e$d;
1913
1940
 
1914
- const o$k = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: e$E }));
1915
- o$k.displayName = "AsteriskIcon";
1916
- const c$9 = o$k;
1941
+ const o$l = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: e$E }));
1942
+ o$l.displayName = "AsteriskIcon";
1943
+ const c$9 = o$l;
1917
1944
 
1918
1945
  const a$4 = a__namespace.forwardRef((e, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...e, weights: e$D }));
1919
1946
  a$4.displayName = "BankIcon";
@@ -1949,16 +1976,16 @@ const c$6 = a__namespace.forwardRef((o, r) => /* @__PURE__ */ a__namespace.creat
1949
1976
  c$6.displayName = "CheckCircleIcon";
1950
1977
  const s$2 = c$6;
1951
1978
 
1952
- const o$j = a__namespace.forwardRef((t, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...t, weights: l$6 }));
1953
- o$j.displayName = "CheckFatIcon";
1954
- const n$b = o$j;
1979
+ const o$k = a__namespace.forwardRef((t, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...t, weights: l$6 }));
1980
+ o$k.displayName = "CheckFatIcon";
1981
+ const n$b = o$k;
1955
1982
 
1956
- const o$i = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$y }));
1957
- o$i.displayName = "CheckSquareIcon";
1983
+ const o$j = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$y }));
1984
+ o$j.displayName = "CheckSquareIcon";
1958
1985
 
1959
- const o$h = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: a$i }));
1960
- o$h.displayName = "CircleHalfIcon";
1961
- const l = o$h;
1986
+ const o$i = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: a$i }));
1987
+ o$i.displayName = "CircleHalfIcon";
1988
+ const l = o$i;
1962
1989
 
1963
1990
  const e$9 = a__namespace.forwardRef((o, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...o, weights: e$x }));
1964
1991
  e$9.displayName = "CurrencyCircleDollarIcon";
@@ -1974,21 +2001,21 @@ const n$a = t$3;
1974
2001
  const t$2 = a__namespace.forwardRef((m, e) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: e, ...m, weights: a$h }));
1975
2002
  t$2.displayName = "EmptyIcon";
1976
2003
 
1977
- const o$g = a__namespace.forwardRef((r, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...r, weights: a$g }));
1978
- o$g.displayName = "EyeIcon";
1979
- const n$9 = o$g;
2004
+ const o$h = a__namespace.forwardRef((r, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...r, weights: a$g }));
2005
+ o$h.displayName = "EyeIcon";
2006
+ const n$9 = o$h;
1980
2007
 
1981
- const o$f = a__namespace.forwardRef((a, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...a, weights: e$u }));
1982
- o$f.displayName = "EyeSlashIcon";
1983
- const n$8 = o$f;
2008
+ const o$g = a__namespace.forwardRef((a, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...a, weights: e$u }));
2009
+ o$g.displayName = "EyeSlashIcon";
2010
+ const n$8 = o$g;
1984
2011
 
1985
- const o$e = a__namespace.forwardRef((n, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...n, weights: l$5 }));
1986
- o$e.displayName = "FunnelIcon";
1987
- const s$1 = o$e;
2012
+ const o$f = a__namespace.forwardRef((n, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...n, weights: l$5 }));
2013
+ o$f.displayName = "FunnelIcon";
2014
+ const s$1 = o$f;
1988
2015
 
1989
- const o$d = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: l$4 }));
1990
- o$d.displayName = "GearIcon";
1991
- const n$7 = o$d;
2016
+ const o$e = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: l$4 }));
2017
+ o$e.displayName = "GearIcon";
2018
+ const n$7 = o$e;
1992
2019
 
1993
2020
  const e$8 = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: l$3 }));
1994
2021
  e$8.displayName = "HourglassSimpleLowIcon";
@@ -1997,41 +2024,41 @@ const e$7 = a__namespace.forwardRef((r, t) => /* @__PURE__ */ a__namespace.creat
1997
2024
  e$7.displayName = "InfoIcon";
1998
2025
  const c$4 = e$7;
1999
2026
 
2000
- const e$6 = a__namespace.forwardRef((c, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...c, weights: H }));
2027
+ const e$6 = a__namespace.forwardRef((c, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...c, weights: H$1 }));
2001
2028
  e$6.displayName = "InvoiceIcon";
2002
2029
  const m$8 = e$6;
2003
2030
 
2004
- const o$c = a__namespace.forwardRef((r, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...r, weights: a$e }));
2005
- o$c.displayName = "KeyholeIcon";
2006
- const n$6 = o$c;
2031
+ const o$d = a__namespace.forwardRef((r, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...r, weights: a$e }));
2032
+ o$d.displayName = "KeyholeIcon";
2033
+ const n$6 = o$d;
2007
2034
 
2008
- const o$b = a__namespace.forwardRef((s, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...s, weights: l$2 }));
2009
- o$b.displayName = "ListChecksIcon";
2035
+ const o$c = a__namespace.forwardRef((s, t) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: t, ...s, weights: l$2 }));
2036
+ o$c.displayName = "ListChecksIcon";
2010
2037
 
2011
- const o$a = a__namespace.forwardRef((m, p) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: p, ...m, weights: e$t }));
2012
- o$a.displayName = "LockSimpleOpenIcon";
2013
- const a = o$a;
2038
+ const o$b = a__namespace.forwardRef((m, p) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: p, ...m, weights: e$t }));
2039
+ o$b.displayName = "LockSimpleOpenIcon";
2040
+ const a = o$b;
2014
2041
 
2015
- const o$9 = a__namespace.forwardRef((s, n) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: n, ...s, weights: a$d }));
2016
- o$9.displayName = "MagnifyingGlassIcon";
2017
- const f = o$9;
2042
+ const o$a = a__namespace.forwardRef((s, n) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: n, ...s, weights: a$d }));
2043
+ o$a.displayName = "MagnifyingGlassIcon";
2044
+ const f = o$a;
2018
2045
 
2019
- const o$8 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$s }));
2020
- o$8.displayName = "MinusSquareIcon";
2046
+ const o$9 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$s }));
2047
+ o$9.displayName = "MinusSquareIcon";
2021
2048
 
2022
2049
  const e$5 = a__namespace.forwardRef((a, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...a, weights: e$r }));
2023
2050
  e$5.displayName = "MoneyWavyIcon";
2024
2051
 
2025
- const o$7 = a__namespace.forwardRef((t, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...t, weights: e$q }));
2026
- o$7.displayName = "NotePencilIcon";
2052
+ const o$8 = a__namespace.forwardRef((t, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...t, weights: e$q }));
2053
+ o$8.displayName = "NotePencilIcon";
2027
2054
 
2028
2055
  const t$1 = a__namespace.forwardRef((o, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...o, weights: e$p }));
2029
2056
  t$1.displayName = "PaletteIcon";
2030
2057
  const n$5 = t$1;
2031
2058
 
2032
- const o$6 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$o }));
2033
- o$6.displayName = "PaperclipIcon";
2034
- const m$7 = o$6;
2059
+ const o$7 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: e$o }));
2060
+ o$7.displayName = "PaperclipIcon";
2061
+ const m$7 = o$7;
2035
2062
 
2036
2063
  const e$4 = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: a$c }));
2037
2064
  e$4.displayName = "PlusIcon";
@@ -2041,24 +2068,24 @@ const e$3 = a__namespace.forwardRef((t, r) => /* @__PURE__ */ a__namespace.creat
2041
2068
  e$3.displayName = "QuestionIcon";
2042
2069
  const m$6 = e$3;
2043
2070
 
2044
- const o$5 = a__namespace.forwardRef((c, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...c, weights: e$n }));
2045
- o$5.displayName = "ShieldCheckIcon";
2046
- const h = o$5;
2071
+ const o$6 = a__namespace.forwardRef((c, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...c, weights: e$n }));
2072
+ o$6.displayName = "ShieldCheckIcon";
2073
+ const h = o$6;
2047
2074
 
2048
2075
  const p = a__namespace.forwardRef((e, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...e, weights: e$m }));
2049
2076
  p.displayName = "ShoppingCartSimpleIcon";
2050
2077
  const n$3 = p;
2051
2078
 
2052
- const o$4 = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: e$l }));
2053
- o$4.displayName = "SlidersIcon";
2054
- const c$3 = o$4;
2079
+ const o$5 = a__namespace.forwardRef((r, s) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: s, ...r, weights: e$l }));
2080
+ o$5.displayName = "SlidersIcon";
2081
+ const c$3 = o$5;
2055
2082
 
2056
- const o$3 = a__namespace.forwardRef((r, n) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: n, ...r, weights: e$k }));
2057
- o$3.displayName = "SpinnerGapIcon";
2058
- const m$5 = o$3;
2083
+ const o$4 = a__namespace.forwardRef((r, n) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: n, ...r, weights: e$k }));
2084
+ o$4.displayName = "SpinnerGapIcon";
2085
+ const m$5 = o$4;
2059
2086
 
2060
- const o$2 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: a$a }));
2061
- o$2.displayName = "SquareIcon";
2087
+ const o$3 = a__namespace.forwardRef((r, a) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: a, ...r, weights: a$a }));
2088
+ o$3.displayName = "SquareIcon";
2062
2089
 
2063
2090
  const t = a__namespace.forwardRef((a, c) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: c, ...a, weights: a$9 }));
2064
2091
  t.displayName = "StackIcon";
@@ -2072,6 +2099,9 @@ const e$2 = a__namespace.forwardRef((o, r) => /* @__PURE__ */ a__namespace.creat
2072
2099
  e$2.displayName = "StudentIcon";
2073
2100
  const s = e$2;
2074
2101
 
2102
+ const o$2 = a__namespace.forwardRef((a, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...a, weights: H }));
2103
+ o$2.displayName = "TableIcon";
2104
+
2075
2105
  const m$4 = a__namespace.forwardRef((e, r) => /* @__PURE__ */ a__namespace.createElement(p$2, { ref: r, ...e, weights: e$i }));
2076
2106
  m$4.displayName = "ThumbsDownIcon";
2077
2107
  const c$2 = m$4;
@@ -2215,7 +2245,7 @@ const selectIcon = (iconName) => {
2215
2245
  case "sync":
2216
2246
  return { icon: r$6, color: Styles.color.blue.primary };
2217
2247
  case "check-square":
2218
- return { icon: o$i, color: Styles.color.blue.primary };
2248
+ return { icon: o$j, color: Styles.color.blue.primary };
2219
2249
  case "empty":
2220
2250
  return { icon: t$2, color: Styles.color.states.error };
2221
2251
  case "money":
@@ -2234,9 +2264,11 @@ const selectIcon = (iconName) => {
2234
2264
  case "truck":
2235
2265
  return { icon: r$2, color: Styles.color.grey.shadow };
2236
2266
  case "list-checks":
2237
- return { icon: o$b, color: Styles.color.blue.primary };
2267
+ return { icon: o$c, color: Styles.color.blue.primary };
2238
2268
  case "note-pencil":
2239
- return { icon: o$7, color: Styles.color.grey.charcoal };
2269
+ return { icon: o$8, color: Styles.color.grey.charcoal };
2270
+ case "table":
2271
+ return { icon: o$2, color: Styles.color.grey.charcoal };
2240
2272
  default:
2241
2273
  return {
2242
2274
  icon: ({ size, color, id, className, dataTestId }) => (a$n.createElement(StellaIcon$1, { size: size, color: color, id: id, className: className, "data-testid": dataTestId })),
@@ -2281,6 +2313,7 @@ const getFill = (iconName) => {
2281
2313
  "list-checks",
2282
2314
  "broadcast",
2283
2315
  "eye",
2316
+ "table",
2284
2317
  ];
2285
2318
  if (boldIcons.includes(iconName)) {
2286
2319
  return "bold";
@@ -21788,6 +21821,54 @@ function useReactTable(options) {
21788
21821
  return tableRef.current;
21789
21822
  }
21790
21823
 
21824
+ const TABLE_STORAGE_PREFIX = "ds-table-state";
21825
+ function loadTableState(tableId) {
21826
+ try {
21827
+ const raw = localStorage.getItem(`${TABLE_STORAGE_PREFIX}:${tableId}`);
21828
+ return raw ? JSON.parse(raw) : {};
21829
+ }
21830
+ catch {
21831
+ return {};
21832
+ }
21833
+ }
21834
+ function saveTableState(tableId, state) {
21835
+ try {
21836
+ localStorage.setItem(`${TABLE_STORAGE_PREFIX}:${tableId}`, JSON.stringify(state));
21837
+ }
21838
+ catch { }
21839
+ }
21840
+ function usePersistTableState(tableId, state, sizingDebounceMs = 300) {
21841
+ const debounceTimer = a$n.useRef(null);
21842
+ const latestSizing = a$n.useRef(state.columnSizing);
21843
+ a$n.useEffect(() => {
21844
+ latestSizing.current = state.columnSizing;
21845
+ }, [state.columnSizing]);
21846
+ // Persist visibility and sorting immediately
21847
+ a$n.useEffect(() => {
21848
+ saveTableState(tableId, {
21849
+ columnVisibility: state.columnVisibility,
21850
+ columnSizing: latestSizing.current,
21851
+ sorting: state.sorting,
21852
+ });
21853
+ }, [tableId, state.columnVisibility, state.sorting]);
21854
+ // Persist sizing debounced
21855
+ a$n.useEffect(() => {
21856
+ if (debounceTimer.current)
21857
+ clearTimeout(debounceTimer.current);
21858
+ debounceTimer.current = setTimeout(() => {
21859
+ saveTableState(tableId, {
21860
+ columnVisibility: state.columnVisibility,
21861
+ columnSizing: latestSizing.current,
21862
+ sorting: state.sorting,
21863
+ });
21864
+ }, sizingDebounceMs);
21865
+ return () => {
21866
+ if (debounceTimer.current)
21867
+ clearTimeout(debounceTimer.current);
21868
+ };
21869
+ }, [tableId, state.columnSizing]);
21870
+ }
21871
+
21791
21872
  const getSelectWidth = (digits) => {
21792
21873
  if (digits >= 10 && digits <= 99)
21793
21874
  return "36px";
@@ -22297,6 +22378,18 @@ const ClearFilterButtonRow = styled.div `
22297
22378
  align-items: "center";
22298
22379
  text-align: "center";
22299
22380
  `;
22381
+ const ActionBar = styled.div `
22382
+ display: flex;
22383
+ justify-content: space-between;
22384
+ height: fit-content;
22385
+ width: 100%;
22386
+ `;
22387
+ const GlobalActionWrapper = styled.div `
22388
+ display: flex;
22389
+ gap: 10px;
22390
+ width: fit-content;
22391
+ padding-bottom: 5px;
22392
+ `;
22300
22393
 
22301
22394
  const IndeterminateCheckbox = ({ isIndeterminate, isChecked, onChange, }) => {
22302
22395
  const ref = a$n.useRef(null);
@@ -22339,6 +22432,40 @@ function useDebounceCallback(callback, delay) {
22339
22432
  return [debounced, { flush, cancel }];
22340
22433
  }
22341
22434
 
22435
+ const CheckboxDropdownMenu = ({ options, selected, mode = "multiSelect", coords, menuRef, onApply, onClear, showSelectAll = true, showClear = false, searchInputId = "search", searchInputLabel = "Search", onSearch, onSearchBlur, serverSide = false, }) => {
22436
+ const [tempSelected, setTempSelected] = a$n.useState(selected);
22437
+ const toggleItem = (key) => {
22438
+ setTempSelected((prev) => prev.includes(key) ? prev.filter((i) => i !== key) : [...prev, key]);
22439
+ };
22440
+ const toggleAll = () => {
22441
+ setTempSelected((prev) => prev.length === options.length ? [] : options.map((o) => o.key));
22442
+ };
22443
+ const showApplyButton = mode === "multiSelect" || (mode === "search" && serverSide);
22444
+ return ReactDOM.createPortal(a$n.createElement(FilterMenu, { style: { top: coords.top, left: coords.left, position: "absolute" }, ref: menuRef },
22445
+ a$n.createElement(MenuItemGroup, null,
22446
+ mode === "search" && (a$n.createElement("div", { style: { padding: "4px 10px" } },
22447
+ a$n.createElement(TextInput, { id: searchInputId, label: searchInputLabel, placeholder: "Search", hideLabel: true, onChange: (value) => {
22448
+ setTempSelected(value === "" ? [] : [value]);
22449
+ if (!serverSide)
22450
+ onSearch?.(value);
22451
+ }, onBlur: () => !serverSide && onSearchBlur?.(), endIcon: "search", value: tempSelected?.[0] }))),
22452
+ mode === "multiSelect" && showSelectAll && (a$n.createElement(MenuItem, { key: "select-all" },
22453
+ a$n.createElement(Checkbox, { id: "all-checkbox", name: "all-checkbox", checked: options.every((opt) => tempSelected.includes(opt.key)), onChange: toggleAll }),
22454
+ a$n.createElement(FilterBoxLabel, { htmlFor: "all-checkbox" }, "Select All"))),
22455
+ mode !== "search" &&
22456
+ options.map(({ key, value }, index) => {
22457
+ if (mode === "singleSelect") {
22458
+ return (a$n.createElement(MenuItemOption, { key: `${key}-${index}`, id: `${key}-button`, onClick: () => onApply([key]), "$applied": selected.includes(key) }, value));
22459
+ }
22460
+ return (a$n.createElement(MenuItem, { key: key },
22461
+ a$n.createElement(Checkbox, { id: `${key}-checkbox`, name: `${key}-checkbox`, checked: tempSelected.includes(key), onChange: () => toggleItem(key) }),
22462
+ a$n.createElement(FilterLabelTransparent, null, value),
22463
+ a$n.createElement(FilterBoxLabel, { htmlFor: `${key}-checkbox` }, value)));
22464
+ })),
22465
+ showApplyButton && (a$n.createElement(MenuButton, { onClick: () => onApply(tempSelected) }, "Apply Selection")),
22466
+ showClear && a$n.createElement(MenuButton, { onClick: onClear }, "Clear Filter")), document.body);
22467
+ };
22468
+
22342
22469
  const normalizeOptions = (raw) => {
22343
22470
  return raw
22344
22471
  .map((item) => {
@@ -22355,27 +22482,29 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22355
22482
  const column = header.column;
22356
22483
  const columnDef = column.columnDef;
22357
22484
  const meta = columnDef.meta;
22358
- // Filter dropdown logic
22359
22485
  const menuRef = a$n.useRef(null);
22360
22486
  const buttonRef = a$n.useRef(null);
22361
22487
  const [showFilter, setShowFilter] = a$n.useState(false);
22362
22488
  const [coords, setCoords] = a$n.useState({ top: 0, left: 0 });
22363
- const [tempFilters, setTempFilters] = a$n.useState([]);
22364
- const [currentAppliedFilters, setCurrentAppliedFilters] = a$n.useState([]);
22365
22489
  const [filterOptions, setFilterOptions] = a$n.useState([]);
22366
- const displayOptions = serverSide
22367
- ? filterOptions
22368
- : normalizeOptions(Array.from(header.column.getFacetedUniqueValues().keys()));
22369
22490
  const [textAlign, setTextAlign] = a$n.useState("left");
22370
22491
  const [handleSave, { flush }] = useDebounceCallback((value) => {
22371
- column?.setFilterValue([value]);
22372
- if (value === "")
22373
- column?.setFilterValue([]);
22492
+ column?.setFilterValue(value === "" ? [] : [value]);
22374
22493
  onFilterApply?.();
22375
22494
  }, 300);
22495
+ const displayOptions = serverSide
22496
+ ? filterOptions
22497
+ : normalizeOptions(Array.from(header.column.getFacetedUniqueValues().keys()));
22376
22498
  a$n.useEffect(() => {
22377
22499
  setFilterOptions(normalizeOptions(meta?.filterOptions || []));
22378
22500
  }, [meta]);
22501
+ a$n.useEffect(() => {
22502
+ setTextAlign(meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"));
22503
+ }, [meta]);
22504
+ a$n.useEffect(() => {
22505
+ if (meta?.pin)
22506
+ column.pin(meta.pin);
22507
+ }, []);
22379
22508
  const toggleMenu = (e) => {
22380
22509
  e.stopPropagation();
22381
22510
  if (buttonRef.current) {
@@ -22385,11 +22514,13 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22385
22514
  left: rect.right + window.scrollX - 25,
22386
22515
  });
22387
22516
  }
22388
- showFilterMenu(!showFilter);
22517
+ const next = !showFilter;
22518
+ onFilterMenuInteraction?.(column.id, next);
22519
+ setShowFilter(next);
22389
22520
  };
22390
- const showFilterMenu = (active) => {
22391
- onFilterMenuInteraction?.(column.id, active);
22392
- setShowFilter(active);
22521
+ const closeMenu = () => {
22522
+ onFilterMenuInteraction?.(column.id, false);
22523
+ setShowFilter(false);
22393
22524
  };
22394
22525
  // Close on outside click
22395
22526
  a$n.useEffect(() => {
@@ -22397,28 +22528,14 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22397
22528
  return;
22398
22529
  const handleClickOutside = (e) => {
22399
22530
  const target = e.target;
22400
- const insideButton = !!buttonRef.current?.contains(target);
22401
- const insideMenu = !!menuRef.current?.contains(target);
22402
- if (!insideButton && !insideMenu) {
22403
- setTempFilters(filters?.[header.id] || currentAppliedFilters);
22404
- showFilterMenu(false);
22531
+ if (!buttonRef.current?.contains(target) && !menuRef.current?.contains(target)) {
22532
+ closeMenu();
22405
22533
  }
22406
22534
  };
22407
22535
  document.addEventListener("click", handleClickOutside, true);
22408
22536
  return () => document.removeEventListener("click", handleClickOutside, true);
22409
22537
  }, [showFilter]);
22410
- a$n.useEffect(() => {
22411
- setTextAlign(meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"));
22412
- }, [meta]);
22413
- a$n.useEffect(() => {
22414
- const currentFilters = filters?.[header.id];
22415
- setTempFilters(currentFilters ? currentFilters : []);
22416
- }, [filters]);
22417
- a$n.useEffect(() => {
22418
- if (meta?.pin) {
22419
- column.pin(meta?.pin);
22420
- }
22421
- }, []);
22538
+ const appliedFilters = filters?.[header.id] ?? [];
22422
22539
  return (a$n.createElement(HeaderCell, { "$isPinnedLeft": column.getIsPinned() === "left", "$isPinnedRight": column.getIsPinned() === "right", "$columnInfo": column, "$filterMenuOpen": showFilter, style: {
22423
22540
  textAlign: meta?.headerAlign || (meta?.dataType === "number" ? "right" : "left"),
22424
22541
  width: header.getSize(),
@@ -22429,82 +22546,19 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
22429
22546
  ? "none"
22430
22547
  : undefined,
22431
22548
  } },
22432
- a$n.createElement(HeaderCellPosition, { style: {
22433
- justifyContent: textAlign === "left" ? "start" : "end",
22434
- } },
22549
+ a$n.createElement(HeaderCellPosition, { style: { justifyContent: textAlign === "left" ? "start" : "end" } },
22435
22550
  textAlign === "left" && (a$n.createElement("span", { style: { fontWeight: 600 } }, flexRender(columnDef.header, header.getContext()))),
22436
- header.column.getCanFilter() && (a$n.createElement("div", { style: {
22437
- display: "flex",
22438
- alignItems: "center",
22439
- position: "relative",
22440
- } },
22441
- a$n.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 }),
22442
- showFilter &&
22443
- ReactDOM.createPortal(a$n.createElement(FilterMenu, { style: {
22444
- top: coords.top,
22445
- left: coords.left,
22446
- position: "absolute",
22447
- }, ref: menuRef },
22448
- a$n.createElement(MenuItemGroup, null,
22449
- meta?.filterMode === "search" && (a$n.createElement("div", { style: { padding: "4px 10px" } },
22450
- a$n.createElement(TextInput, { id: `${columnDef.header}-search`, label: `${columnDef.header} search`, placeholder: "Search", hideLabel: true, onChange: (value) => {
22451
- value === ""
22452
- ? setTempFilters([])
22453
- : setTempFilters([value]);
22454
- !serverSide && handleSave(value);
22455
- }, onBlur: () => !serverSide && flush(), endIcon: "search", value: tempFilters?.[0] }))),
22456
- (meta?.filterMode === "multiSelect" ||
22457
- !meta?.filterMode) && (a$n.createElement(MenuItem, { key: "select-all" },
22458
- a$n.createElement(Checkbox, { id: "all-checkbox", name: "all-checkbox", checked: displayOptions?.every((opt) => tempFilters?.includes(opt.key)), onChange: () => {
22459
- setTempFilters((prev) => {
22460
- if (prev?.length === displayOptions?.length) {
22461
- return [];
22462
- }
22463
- else {
22464
- return displayOptions.map((opt) => opt.key);
22465
- }
22466
- });
22467
- } }),
22468
- a$n.createElement(FilterBoxLabel, { htmlFor: "all-checkbox" }, "Select All"))),
22469
- displayOptions?.map(({ key, value }, index) => {
22470
- if (meta?.filterMode === "singleSelect") {
22471
- return (a$n.createElement(MenuItemOption, { key: `${key}-${index}`, id: `${key}-button`, onClick: () => {
22472
- setCurrentAppliedFilters([key]);
22473
- column?.setFilterValue([key]);
22474
- showFilterMenu(false);
22475
- onFilterApply?.();
22476
- }, "$applied": tempFilters?.includes(key) }, value));
22477
- }
22478
- if (meta?.filterMode === "multiSelect" ||
22479
- !meta?.filterMode) {
22480
- return (a$n.createElement(MenuItem, { key: key },
22481
- a$n.createElement(Checkbox, { id: `${key}-checkbox`, name: `${key}-checkbox`, checked: tempFilters?.includes(key), onChange: () => {
22482
- setTempFilters((prev) => {
22483
- if (prev?.includes(key))
22484
- return prev.filter((i) => i !== key);
22485
- else
22486
- return [...prev, key];
22487
- });
22488
- } }),
22489
- a$n.createElement(FilterLabelTransparent, null, value),
22490
- a$n.createElement(FilterBoxLabel, { htmlFor: `${key}-checkbox` }, value)));
22491
- }
22492
- })),
22493
- (meta?.filterMode === "multiSelect" ||
22494
- (meta?.filterMode === "search" && serverSide) ||
22495
- !meta?.filterMode) && (a$n.createElement(MenuButton, { key: "apply", onClick: () => {
22496
- setCurrentAppliedFilters(tempFilters);
22497
- column?.setFilterValue(tempFilters?.length > 0 ? tempFilters : []);
22498
- showFilterMenu(false);
22499
- onFilterApply?.();
22500
- } }, "Apply Selection")),
22501
- filters?.[header.id]?.length > 0 && (a$n.createElement(MenuButton, { key: "clear", onClick: () => {
22502
- column?.setFilterValue([]);
22503
- showFilterMenu(false);
22504
- setTempFilters([]);
22505
- setCurrentAppliedFilters([]);
22506
- onFilterApply?.();
22507
- } }, "Clear Filter"))), document.body))),
22551
+ header.column.getCanFilter() && (a$n.createElement("div", { style: { display: "flex", alignItems: "center", position: "relative" } },
22552
+ a$n.createElement(CustomIconButton$1, { className: "icon", iconName: "filter", ariaLabel: "Filter Button", variant: "tertiary", "$active": appliedFilters.length > 0 || showFilter, onClick: (e) => toggleMenu(e), ref: buttonRef }),
22553
+ showFilter && (a$n.createElement(CheckboxDropdownMenu, { options: displayOptions, selected: appliedFilters, mode: meta?.filterMode ?? "multiSelect", coords: coords, menuRef: menuRef, showSelectAll: meta?.filterMode !== "singleSelect", showClear: appliedFilters.length > 0, onApply: (selected) => {
22554
+ column?.setFilterValue(selected.length > 0 ? selected : []);
22555
+ closeMenu();
22556
+ onFilterApply?.();
22557
+ }, onClear: () => {
22558
+ column?.setFilterValue([]);
22559
+ closeMenu();
22560
+ onFilterApply?.();
22561
+ }, serverSide: serverSide, onSearch: handleSave, onSearchBlur: flush, searchInputId: `${String(columnDef.header)}-search`, searchInputLabel: `${String(columnDef.header)} search` })))),
22508
22562
  header.column.getCanSort() && (a$n.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) })),
22509
22563
  textAlign === "right" && (a$n.createElement("span", { style: { fontWeight: 600 } }, flexRender(columnDef.header, header.getContext()))))));
22510
22564
  };
@@ -22564,7 +22618,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22564
22618
  startingPage: 1,
22565
22619
  rowsPerPage: 10,
22566
22620
  totalRows: data.length,
22567
- }, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, }) {
22621
+ }, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, enableShowHide, globalActions, }) {
22568
22622
  const [rowSelection, setRowSelection] = a$n.useState({});
22569
22623
  const [selectedRows] = a$n.useState({});
22570
22624
  const [pageIndex, setPageIndex] = a$n.useState(paginationDetails?.startingPage);
@@ -22575,9 +22629,20 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22575
22629
  const [localData, setLocalData] = a$n.useState(data);
22576
22630
  const [localColumns, setLocalColumns] = a$n.useState(columns);
22577
22631
  const [totalData, setTotalData] = a$n.useState(paginationDetails?.totalRows);
22578
- const [sorting, setSorting] = a$n.useState([]);
22632
+ const [sorting, setSorting] = a$n.useState(() => loadTableState(id).sorting ?? []);
22579
22633
  const [filters, setFilters] = a$n.useState({});
22580
22634
  const [rowState, setRowState] = a$n.useState({});
22635
+ const [columnVisibility, setColumnVisibility] = a$n.useState(() => {
22636
+ const persisted = loadTableState(id);
22637
+ if (persisted.columnVisibility)
22638
+ return persisted.columnVisibility;
22639
+ return Object.fromEntries(columns
22640
+ .filter((col) => col.meta?.defaultHidden)
22641
+ .map((col) => [
22642
+ "accessorKey" in col ? col.accessorKey : col.id,
22643
+ false,
22644
+ ]));
22645
+ });
22581
22646
  const [columnFilters, setColumnFilters] = a$n.useState(() => {
22582
22647
  const base = defaultFilters ?? [];
22583
22648
  if (!staticFilters?.length)
@@ -22600,6 +22665,13 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22600
22665
  });
22601
22666
  const [columnPinning, setColumnPinning] = a$n.useState({ left: ["select"], right: ["options"] });
22602
22667
  const scrollRef = a$n.useRef(null);
22668
+ const visibilityButtonRef = a$n.useRef(null);
22669
+ const visibilityMenuRef = a$n.useRef(null);
22670
+ const [showVisibilityMenu, setShowVisibilityMenu] = a$n.useState(false);
22671
+ const [visibilityMenuCoords, setVisibilityMenuCoords] = a$n.useState({
22672
+ top: 0,
22673
+ left: 0,
22674
+ });
22603
22675
  const [scrollState, setScrollState] = a$n.useState({
22604
22676
  atLeft: true,
22605
22677
  atRight: false,
@@ -22620,6 +22692,19 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22620
22692
  if (paginationDetails && paginationDetails.startingPage !== pageIndex)
22621
22693
  setPageIndex(paginationDetails?.startingPage);
22622
22694
  }, [paginationDetails, data, columns]);
22695
+ a$n.useEffect(() => {
22696
+ if (!showVisibilityMenu)
22697
+ return;
22698
+ const handleClickOutside = (e) => {
22699
+ const target = e.target;
22700
+ if (!visibilityButtonRef.current?.contains(target) &&
22701
+ !visibilityMenuRef.current?.contains(target)) {
22702
+ setShowVisibilityMenu(false);
22703
+ }
22704
+ };
22705
+ document.addEventListener("click", handleClickOutside, true);
22706
+ return () => document.removeEventListener("click", handleClickOutside, true);
22707
+ }, [showVisibilityMenu]);
22623
22708
  a$n.useLayoutEffect(() => {
22624
22709
  const el = scrollRef.current;
22625
22710
  if (!el)
@@ -22702,6 +22787,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22702
22787
  data: localData,
22703
22788
  columns: enhancedColumns,
22704
22789
  state: {
22790
+ columnVisibility,
22705
22791
  pagination,
22706
22792
  sorting,
22707
22793
  columnFilters,
@@ -22717,6 +22803,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22717
22803
  enableRowSelection: showSelection,
22718
22804
  rowCount: serverSide ? paginationDetails?.totalRows : undefined,
22719
22805
  enableColumnPinning: true,
22806
+ onColumnVisibilityChange: setColumnVisibility,
22720
22807
  getCoreRowModel: getCoreRowModel(),
22721
22808
  getFacetedRowModel: !serverSide ? getFacetedRowModel() : undefined,
22722
22809
  getFacetedUniqueValues: !serverSide ? getFacetedUniqueValues() : undefined,
@@ -22770,6 +22857,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22770
22857
  },
22771
22858
  },
22772
22859
  });
22860
+ usePersistTableState(id, { columnVisibility, sorting });
22773
22861
  a$n.useEffect(() => {
22774
22862
  if (onRowSelect) {
22775
22863
  const selectedData = table
@@ -22797,95 +22885,133 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
22797
22885
  });
22798
22886
  table.toggleAllRowsSelected(false);
22799
22887
  };
22800
- return (a$n.createElement(TableWrapper, { className: className, id: id, "data-testid": dataTestId, "data-auto": dataAuto },
22801
- a$n.createElement(TableWrapperScroll, { "$stopScroll": Object.values(filterMenuOpen).some((value) => value), ref: scrollRef }, isLoading ? (a$n.createElement("div", null,
22802
- a$n.createElement("div", { style: {
22803
- width: "100%",
22804
- maxWidth: "100%",
22805
- height: "100%",
22806
- marginBottom: "4px",
22807
- backgroundColor: "#f9f9f9",
22808
- display: "flex",
22809
- flexDirection: "column",
22810
- overflow: "hidden",
22811
- boxSizing: "border-box",
22812
- } }, Array.from({
22813
- length: pagination?.pageSize,
22814
- }).map((_, index) => (a$n.createElement("div", { style: {
22815
- position: "relative",
22816
- display: "flex",
22817
- flexDirection: "row",
22818
- gap: "90px",
22819
- padding: "10px 25px",
22820
- backgroundColor: index === 0 ? "#ededed" : "transparent",
22821
- borderBottom: "1px solid #e0e0e0",
22822
- alignItems: "center",
22823
- height: "50px",
22824
- minHeight: "50px",
22825
- }, key: index + "loading-row" }, Array.from({
22826
- length: 10,
22827
- }).map((_, i) => (a$n.createElement(LoadingShimmer, { key: `${i}-loading`, "$width": "110px", "$height": "25px" }))))))))) : (a$n.createElement(StyledTable, { id: `${id}-table`, ...htmlProps },
22828
- a$n.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a$n.createElement(HeaderRow, { key: headerGroup.id }, headerGroup.headers.map((header, i) => {
22829
- return (a$n.createElement(TableHeaderCell, { key: header.id, serverSide: serverSide, header: header, filters: filters, sorting: sorting, scrollPosition: scrollState, onFilterMenuInteraction: (id, active) => {
22830
- setFilterMenuOpen((prev) => ({
22831
- ...prev,
22832
- [id]: active,
22833
- }));
22834
- }, onFilterApply: () => {
22835
- setPageIndex(1);
22836
- setPagination((prev) => ({
22837
- ...prev,
22838
- pageIndex: 0,
22839
- }));
22840
- } }));
22841
- }))))),
22842
- a$n.createElement("tbody", null,
22843
- table.getRowModel().rows.length === 0 && (a$n.createElement(EmptyTableState, { header: emptyTableState?.header || "No data available.", subHeader: emptyTableState?.subHeader, showClearFilterButton: emptyTableState?.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
22844
- table.getRowModel().rows.map((row) => (a$n.createElement(CellRow, { key: row.id, onClick: () => onRowClick?.(row.original), "$isClickable": !!onRowClick }, row.getVisibleCells().map((cell) => {
22845
- const value = flexRender(cell.column.columnDef.cell, {
22846
- ...cell.getContext(),
22847
- localValue: rowState[row.id]?.[cell.column.id],
22848
- onLocalChange: (val) => handleInputChange(row.id, cell.column.id, val),
22849
- });
22850
- const meta = cell.column.columnDef.meta;
22851
- return (a$n.createElement(BodyCell, { key: cell.id, style: {
22852
- width: cell.column.getSize(),
22853
- textAlign: meta?.cellAlign ||
22854
- (typeof cell.getValue() === "number" ||
22855
- meta?.dataType === "number"
22856
- ? "right"
22857
- : "left"),
22858
- boxShadow: scrollState.atLeft &&
22859
- cell.column.getIsPinned() === "left"
22860
- ? "none"
22861
- : scrollState.atRight &&
22862
- cell.column.getIsPinned() === "right"
22888
+ return (a$n.createElement(a$n.Fragment, null,
22889
+ !isLoading && (a$n.createElement(ActionBar, null,
22890
+ a$n.createElement(GlobalActionWrapper, null, globalActions?.map((action) => action.element)),
22891
+ a$n.createElement(GlobalActionWrapper, null, enableShowHide && (a$n.createElement(a$n.Fragment, null,
22892
+ a$n.createElement(IconButton, { ref: visibilityButtonRef, ariaLabel: "Column show hide button", variant: "tertiary", iconName: "table", onClick: () => {
22893
+ const rect = visibilityButtonRef.current?.getBoundingClientRect();
22894
+ if (rect) {
22895
+ setVisibilityMenuCoords({
22896
+ top: rect.bottom + window.scrollY + 4,
22897
+ left: rect.right + window.scrollX - 140,
22898
+ });
22899
+ }
22900
+ setShowVisibilityMenu((prev) => !prev);
22901
+ } }),
22902
+ showVisibilityMenu && (a$n.createElement(CheckboxDropdownMenu, { options: table
22903
+ .getAllLeafColumns()
22904
+ .filter((col) => col.id !== "select" && col.id !== "options")
22905
+ .map((col) => ({
22906
+ key: col.id,
22907
+ value: typeof col.columnDef.header === "string"
22908
+ ? col.columnDef.header
22909
+ : col.id,
22910
+ })), selected: table
22911
+ .getAllLeafColumns()
22912
+ .filter((col) => col.getIsVisible())
22913
+ .map((col) => col.id), mode: "multiSelect", coords: visibilityMenuCoords, menuRef: visibilityMenuRef, showSelectAll: true, showClear: false, onApply: (selected) => {
22914
+ const next = {};
22915
+ table
22916
+ .getAllLeafColumns()
22917
+ .filter((col) => col.id !== "select" && col.id !== "options")
22918
+ .forEach((col) => {
22919
+ next[col.id] = selected.includes(col.id);
22920
+ });
22921
+ setColumnVisibility(next);
22922
+ setShowVisibilityMenu(false);
22923
+ }, onClear: () => { } }))))))),
22924
+ a$n.createElement(TableWrapper, { className: className, id: id, "data-testid": dataTestId, "data-auto": dataAuto },
22925
+ a$n.createElement(TableWrapperScroll, { "$stopScroll": Object.values(filterMenuOpen).some((value) => value), ref: scrollRef }, isLoading ? (a$n.createElement("div", null,
22926
+ a$n.createElement("div", { style: {
22927
+ width: "100%",
22928
+ maxWidth: "100%",
22929
+ height: "100%",
22930
+ marginBottom: "4px",
22931
+ backgroundColor: "#f9f9f9",
22932
+ display: "flex",
22933
+ flexDirection: "column",
22934
+ overflow: "hidden",
22935
+ boxSizing: "border-box",
22936
+ } }, Array.from({
22937
+ length: pagination?.pageSize,
22938
+ }).map((_, index) => (a$n.createElement("div", { style: {
22939
+ position: "relative",
22940
+ display: "flex",
22941
+ flexDirection: "row",
22942
+ gap: "90px",
22943
+ padding: "10px 25px",
22944
+ backgroundColor: index === 0 ? "#ededed" : "transparent",
22945
+ borderBottom: "1px solid #e0e0e0",
22946
+ alignItems: "center",
22947
+ height: "50px",
22948
+ minHeight: "50px",
22949
+ }, key: index + "loading-row" }, Array.from({
22950
+ length: 10,
22951
+ }).map((_, i) => (a$n.createElement(LoadingShimmer, { key: `${i}-loading`, "$width": "110px", "$height": "25px" }))))))))) : (a$n.createElement(StyledTable, { id: `${id}-table`, ...htmlProps },
22952
+ a$n.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a$n.createElement(HeaderRow, { key: headerGroup.id }, headerGroup.headers.map((header, i) => {
22953
+ return (a$n.createElement(TableHeaderCell, { key: header.id, serverSide: serverSide, header: header, filters: filters, sorting: sorting, scrollPosition: scrollState, onFilterMenuInteraction: (id, active) => {
22954
+ setFilterMenuOpen((prev) => ({
22955
+ ...prev,
22956
+ [id]: active,
22957
+ }));
22958
+ }, onFilterApply: () => {
22959
+ setPageIndex(1);
22960
+ setPagination((prev) => ({
22961
+ ...prev,
22962
+ pageIndex: 0,
22963
+ }));
22964
+ } }));
22965
+ }))))),
22966
+ a$n.createElement("tbody", null,
22967
+ table.getRowModel().rows.length === 0 && (a$n.createElement(EmptyTableState, { header: emptyTableState?.header || "No data available.", subHeader: emptyTableState?.subHeader, showClearFilterButton: emptyTableState?.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
22968
+ table.getRowModel().rows.map((row) => (a$n.createElement(CellRow, { key: row.id, onClick: () => onRowClick?.(row.original), "$isClickable": !!onRowClick }, row.getVisibleCells().map((cell) => {
22969
+ const value = flexRender(cell.column.columnDef.cell, {
22970
+ ...cell.getContext(),
22971
+ localValue: rowState[row.id]?.[cell.column.id],
22972
+ onLocalChange: (val) => handleInputChange(row.id, cell.column.id, val),
22973
+ });
22974
+ const meta = cell.column.columnDef
22975
+ .meta;
22976
+ return (a$n.createElement(BodyCell, { key: cell.id, style: {
22977
+ width: cell.column.getSize(),
22978
+ textAlign: meta?.cellAlign ||
22979
+ (typeof cell.getValue() === "number" ||
22980
+ meta?.dataType === "number"
22981
+ ? "right"
22982
+ : "left"),
22983
+ boxShadow: scrollState.atLeft &&
22984
+ cell.column.getIsPinned() === "left"
22863
22985
  ? "none"
22864
- : undefined,
22865
- backgroundColor: table
22866
- .getSelectedRowModel()
22867
- .rows.find((r) => r.id === row.id)
22868
- ? "#EBF0FA"
22869
- : rowStatusesState?.[row.id] === "action-pending"
22870
- ? "#FFFDEB"
22871
- : rowStatusesState?.[row.id] === "completed"
22872
- ? "#F5F5F5"
22873
- : "",
22874
- }, "$isPinnedLeft": cell.column.getIsPinned() === "left", "$isPinnedRight": cell.column.getIsPinned() === "right", "$columnInfo": cell.column, "$isLastRow": serverSide
22875
- ? row.index === table.getRowModel().rows.length - 1
22876
- : row.index -
22877
- pagination.pageSize * pagination.pageIndex ===
22878
- table.getRowModel().rows.length - 1 }, value));
22879
- })))))))),
22880
- showPagination && paginationDetails?.totalRows > 0 && (a$n.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) => {
22881
- table.toggleAllRowsSelected(false);
22882
- setPageIndex(page);
22883
- setPagination((prev) => ({
22884
- ...prev,
22885
- pageIndex: page - 1,
22886
- }));
22887
- onPageChange?.(page, pageSize);
22888
- }, resetTrigger: resetTrigger }))));
22986
+ : scrollState.atRight &&
22987
+ cell.column.getIsPinned() === "right"
22988
+ ? "none"
22989
+ : undefined,
22990
+ backgroundColor: table
22991
+ .getSelectedRowModel()
22992
+ .rows.find((r) => r.id === row.id)
22993
+ ? "#EBF0FA"
22994
+ : rowStatusesState?.[row.id] === "action-pending"
22995
+ ? "#FFFDEB"
22996
+ : rowStatusesState?.[row.id] === "completed"
22997
+ ? "#F5F5F5"
22998
+ : "",
22999
+ }, "$isPinnedLeft": cell.column.getIsPinned() === "left", "$isPinnedRight": cell.column.getIsPinned() === "right", "$columnInfo": cell.column, "$isLastRow": serverSide
23000
+ ? row.index ===
23001
+ table.getRowModel().rows.length - 1
23002
+ : row.index -
23003
+ pagination.pageSize * pagination.pageIndex ===
23004
+ table.getRowModel().rows.length - 1 }, value));
23005
+ })))))))),
23006
+ showPagination && paginationDetails?.totalRows > 0 && (a$n.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) => {
23007
+ table.toggleAllRowsSelected(false);
23008
+ setPageIndex(page);
23009
+ setPagination((prev) => ({
23010
+ ...prev,
23011
+ pageIndex: page - 1,
23012
+ }));
23013
+ onPageChange?.(page, pageSize);
23014
+ }, resetTrigger: resetTrigger })))));
22889
23015
  }
22890
23016
 
22891
23017
  const SyncContainer = styled.div `
@@ -22966,7 +23092,7 @@ const HeaderText = styled.span `
22966
23092
  color: #4d4d4d;
22967
23093
  text-align: right;
22968
23094
  font-family: Inter;
22969
- font-size: 16px;
23095
+ font-size: 14px;
22970
23096
  font-style: normal;
22971
23097
  font-weight: 500;
22972
23098
  line-height: normal;
@@ -22975,7 +23101,7 @@ const SubHeaderText = styled.span `
22975
23101
  color: #9f9f9f;
22976
23102
  text-align: right;
22977
23103
  font-family: Inter;
22978
- font-size: 12px;
23104
+ font-size: 11px;
22979
23105
  font-style: normal;
22980
23106
  font-weight: 500;
22981
23107
  line-height: normal;
@@ -23435,10 +23561,10 @@ const CheckBox = ({ id, className, label, checked, indeterminate = false, disabl
23435
23561
  ? Styles.color.grey.medium
23436
23562
  : Styles.color.core.primary;
23437
23563
  if (isIndeterminate)
23438
- return (a$n.createElement(o$8, { "data-testid": "indeterminate-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23564
+ return (a$n.createElement(o$9, { "data-testid": "indeterminate-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23439
23565
  if (isChecked)
23440
- return (a$n.createElement(o$i, { "data-testid": "check-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23441
- return (a$n.createElement(o$2, { "data-testid": "square-icon", className: "checkbox-icon", size: 18, weight: "regular", color: color }));
23566
+ return (a$n.createElement(o$j, { "data-testid": "check-icon", className: "checkbox-icon", size: 18, weight: "fill", color: color }));
23567
+ return (a$n.createElement(o$3, { "data-testid": "square-icon", className: "checkbox-icon", size: 18, weight: "regular", color: color }));
23442
23568
  };
23443
23569
  return (a$n.createElement(CheckBoxWrapper, { id: `${id}-label`, className: className, "$disabled": disabled, "$align": align, "$fontSize": fontSize },
23444
23570
  a$n.createElement(HiddenInput, { id: id, ref: inputRef, checked: isChecked, disabled: disabled, onChange: handleChange, ...htmlProps }),