asma-ui-core 3.121.5 → 3.121.6

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.
@@ -1,16 +1,17 @@
1
- var e = "_root_wse1z_1", _ = "_shell_wse1z_5", a = "_shellCompact_wse1z_9", s = "_shellExpanded_wse1z_13", r = "_content_wse1z_17", t = "_compactItems_wse1z_21", o = "_compactItemsStacked_wse1z_25", m = "_expandedItems_wse1z_29", c = "_measureRow_wse1z_33", l = "_measureLayer_wse1z_37", d = "_chevron_wse1z_41", v = {
2
- root: e,
3
- shell: _,
4
- shellCompact: a,
5
- shellExpanded: s,
6
- content: r,
7
- compactItems: t,
8
- compactItemsStacked: o,
9
- expandedItems: m,
10
- measureRow: c,
11
- measureLayer: l,
12
- chevron: d
1
+ var t = "_root_6jgtc_2", e = "_shell_6jgtc_6", _ = "_shellCompact_6jgtc_10", a = "_shellExpanded_6jgtc_14", c = "_content_6jgtc_18", r = "_contentCompact_6jgtc_26", o = "_compactItems_6jgtc_30", m = "_compactItemsStacked_6jgtc_34", s = "_expandedItems_6jgtc_38", l = "_measureRow_6jgtc_42", n = "_measureLayer_6jgtc_46", v = "_chevron_6jgtc_50", d = {
2
+ root: t,
3
+ shell: e,
4
+ shellCompact: _,
5
+ shellExpanded: a,
6
+ content: c,
7
+ contentCompact: r,
8
+ compactItems: o,
9
+ compactItemsStacked: m,
10
+ expandedItems: s,
11
+ measureRow: l,
12
+ measureLayer: n,
13
+ chevron: v
13
14
  };
14
15
  export {
15
- v as default
16
+ d as default
16
17
  };
@@ -1,25 +1,25 @@
1
- import { cn as b } from "../../../helpers/cn.js";
1
+ import { cn as g } from "../../../helpers/cn.js";
2
2
  import { ChevronDownIcon as j } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
3
  import { ChevronUpIcon as z } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
4
- import h from "./Pathfinder.module.js";
5
- import { useCallback as R, useEffect as M, useLayoutEffect as O, useMemo as y, useRef as k, useState as x, useSyncExternalStore as P } from "react";
6
- import { Fragment as D, jsx as e, jsxs as I } from "react/jsx-runtime";
4
+ import o from "./Pathfinder.module.js";
5
+ import { useCallback as C, useEffect as M, useLayoutEffect as O, useMemo as y, useRef as I, useState as x, useSyncExternalStore as P } from "react";
6
+ import { Fragment as D, jsx as e, jsxs as R } from "react/jsx-runtime";
7
7
  var _ = typeof window < "u" ? O : M;
8
8
  function q() {
9
- const [i, n] = x(null), a = R((t) => {
9
+ const [i, n] = x(null), a = C((t) => {
10
10
  n(t);
11
- }, []), s = R(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
11
+ }, []), s = C(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
12
12
  return {
13
13
  ref: a,
14
- width: P(R((t) => {
14
+ width: P(C((t) => {
15
15
  if (!i || typeof ResizeObserver > "u") return () => {
16
16
  };
17
17
  let d = 0;
18
- const o = new ResizeObserver(() => {
18
+ const l = new ResizeObserver(() => {
19
19
  cancelAnimationFrame(d), d = requestAnimationFrame(t);
20
20
  });
21
- return o.observe(i), () => {
22
- cancelAnimationFrame(d), o.disconnect();
21
+ return l.observe(i), () => {
22
+ cancelAnimationFrame(d), l.disconnect();
23
23
  };
24
24
  }, [i]), s, () => 0)
25
25
  };
@@ -31,80 +31,80 @@ function A(i) {
31
31
  });
32
32
  }
33
33
  function K(i) {
34
- const { items: n, leadSlot: a, actionSlot: s } = i, t = k({}), d = k(null), o = k(null), [l, v] = x({
34
+ const { items: n, leadSlot: a, actionSlot: s } = i, t = I({}), d = I(null), l = I(null), [m, v] = x({
35
35
  itemWidths: {},
36
36
  leadWidth: 0,
37
37
  actionWidth: 0
38
- }), f = k(l);
38
+ }), p = I(m);
39
39
  M(() => {
40
- f.current = l;
41
- }, [l]);
42
- const p = R((r) => (m) => {
43
- t.current[r] = m;
40
+ p.current = m;
41
+ }, [m]);
42
+ const h = C((r) => (u) => {
43
+ t.current[r] = u;
44
44
  }, []);
45
45
  return _(() => {
46
46
  const r = {};
47
- for (const u of n) {
48
- const w = t.current[u.id], N = Math.ceil(w?.getBoundingClientRect().width ?? u.estimatedWidth ?? 0);
49
- r[u.id] = N;
47
+ for (const f of n) {
48
+ const k = t.current[f.id], w = Math.ceil(k?.getBoundingClientRect().width ?? f.estimatedWidth ?? 0);
49
+ r[f.id] = w;
50
50
  }
51
- const m = a ? Math.ceil(d.current?.getBoundingClientRect().width ?? 0) : 0, g = s ? Math.ceil(o.current?.getBoundingClientRect().width ?? 0) : 0, W = f.current;
52
- (!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((u) => W.itemWidths[u.id] === r[u.id])) || W.leadWidth !== m || W.actionWidth !== g) && v({
51
+ const u = a ? Math.ceil(d.current?.getBoundingClientRect().width ?? 0) : 0, N = s ? Math.ceil(l.current?.getBoundingClientRect().width ?? 0) : 0, W = p.current;
52
+ (!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((f) => W.itemWidths[f.id] === r[f.id])) || W.leadWidth !== u || W.actionWidth !== N) && v({
53
53
  itemWidths: r,
54
- leadWidth: m,
55
- actionWidth: g
54
+ leadWidth: u,
55
+ actionWidth: N
56
56
  });
57
57
  }, [
58
58
  n,
59
59
  a,
60
60
  s
61
61
  ]), {
62
- measurements: l,
63
- registerItemRef: p,
62
+ measurements: m,
63
+ registerItemRef: h,
64
64
  leadRef: d,
65
- actionRef: o
65
+ actionRef: l
66
66
  };
67
67
  }
68
68
  function U(i) {
69
69
  const { items: n, availableWidth: a, gapPx: s, itemWidths: t } = i, d = [];
70
- let o = 0;
71
- for (const l of A(n)) {
72
- const v = Math.max(0, t[l.id] ?? l.estimatedWidth ?? 0), f = d.length === 0 ? v : o + s + v;
73
- if (f > a) break;
74
- d.push(l), o = f;
70
+ let l = 0;
71
+ for (const m of A(n)) {
72
+ const v = Math.max(0, t[m.id] ?? m.estimatedWidth ?? 0), p = d.length === 0 ? v : l + s + v;
73
+ if (p > a) break;
74
+ d.push(m), l = p;
75
75
  }
76
76
  return d;
77
77
  }
78
- function C({ item: i, compact: n }) {
78
+ function b({ item: i, compact: n }) {
79
79
  return /* @__PURE__ */ e(D, { children: i.render({ compact: n }) });
80
80
  }
81
- function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx: o = 140, actionReservePx: l = 44 }) {
82
- const { ref: v, width: f } = q(), p = !n, r = y(() => A(i), [i]), { measurements: m, registerItemRef: g, leadRef: W, actionRef: u } = K({
81
+ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx: l = 140, actionReservePx: m = 44 }) {
82
+ const { ref: v, width: p } = q(), h = !n, r = y(() => A(i), [i]), { measurements: u, registerItemRef: N, leadRef: W, actionRef: f } = K({
83
83
  items: r,
84
84
  leadSlot: s,
85
85
  actionSlot: t
86
- }), w = y(() => {
86
+ }), k = y(() => {
87
87
  if (n) return r;
88
- const c = 24, L = 24, B = s ? Math.max(o, m.leadWidth + 12) : 0, F = t ? Math.max(l, m.actionWidth) : 0;
88
+ const c = 24, L = 48, B = s ? Math.max(l, u.leadWidth + 12) : 0, F = t ? Math.max(m, u.actionWidth) : 0;
89
89
  return U({
90
90
  items: r,
91
- availableWidth: Math.max(0, f - c - L - B - F - 24),
91
+ availableWidth: Math.max(0, p - c - L - B - F),
92
92
  gapPx: 12,
93
- itemWidths: m.itemWidths
93
+ itemWidths: u.itemWidths
94
94
  });
95
95
  }, [
96
96
  n,
97
97
  r,
98
- f,
98
+ p,
99
99
  s,
100
100
  t,
101
- o,
102
101
  l,
103
- m
104
- ]), N = p && w.length < Math.min(2, r.length), E = N ? r.slice(0, 2) : w;
105
- return /* @__PURE__ */ I("div", {
102
+ m,
103
+ u
104
+ ]), w = h && k.length < Math.min(2, r.length), E = w ? r.slice(0, 2) : k;
105
+ return /* @__PURE__ */ R("div", {
106
106
  ref: v,
107
- className: b(h.root, "asma-pressable", p ? "overflow-hidden" : "overflow-visible", d),
107
+ className: g(o.root, "asma-pressable", h ? "overflow-hidden" : "overflow-visible", d),
108
108
  "aria-expanded": n,
109
109
  role: "button",
110
110
  tabIndex: 0,
@@ -113,34 +113,34 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
113
113
  (c.key === "Enter" || c.key === " ") && (c.preventDefault(), a());
114
114
  },
115
115
  children: [
116
- /* @__PURE__ */ I("div", {
117
- className: b(h.shell, p ? h.shellCompact : h.shellExpanded),
116
+ /* @__PURE__ */ R("div", {
117
+ className: g(o.shell, h ? o.shellCompact : o.shellExpanded),
118
118
  children: [s ? /* @__PURE__ */ e("div", {
119
119
  className: "shrink-0",
120
120
  children: s
121
121
  }) : null, /* @__PURE__ */ e("div", {
122
- className: h.content,
123
- children: p ? /* @__PURE__ */ e("div", {
124
- className: b(h.compactItems, N && h.compactItemsStacked),
122
+ className: g(o.content, h && o.contentCompact),
123
+ children: h ? /* @__PURE__ */ e("div", {
124
+ className: g(o.compactItems, w && o.compactItemsStacked),
125
125
  children: E.map((c) => /* @__PURE__ */ e("div", {
126
- className: "shrink-0 whitespace-nowrap",
127
- children: /* @__PURE__ */ e(C, {
126
+ className: g("min-w-0 whitespace-nowrap", w ? "w-full" : "shrink"),
127
+ children: /* @__PURE__ */ e(b, {
128
128
  item: c,
129
- compact: p
129
+ compact: h
130
130
  })
131
131
  }, c.id))
132
- }) : /* @__PURE__ */ I("div", {
133
- className: h.expandedItems,
132
+ }) : /* @__PURE__ */ R("div", {
133
+ className: o.expandedItems,
134
134
  children: [r.map((c) => /* @__PURE__ */ e("div", {
135
135
  className: "shrink-0 whitespace-nowrap",
136
- children: /* @__PURE__ */ e(C, {
136
+ children: /* @__PURE__ */ e(b, {
137
137
  item: c,
138
- compact: p
138
+ compact: h
139
139
  })
140
140
  }, c.id)), t ? /* @__PURE__ */ e("div", {
141
141
  className: "shrink-0",
142
142
  children: /* @__PURE__ */ e("div", {
143
- ref: u,
143
+ ref: f,
144
144
  children: t
145
145
  })
146
146
  }) : null]
@@ -148,15 +148,15 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
148
148
  })]
149
149
  }),
150
150
  /* @__PURE__ */ e("div", {
151
- className: h.chevron,
151
+ className: o.chevron,
152
152
  children: n ? /* @__PURE__ */ e(z, { className: "size-6" }) : /* @__PURE__ */ e(j, { className: "size-6" })
153
153
  }),
154
154
  /* @__PURE__ */ e("div", {
155
155
  "aria-hidden": !0,
156
156
  inert: "true",
157
- className: h.measureLayer,
158
- children: /* @__PURE__ */ I("div", {
159
- className: h.measureRow,
157
+ className: o.measureLayer,
158
+ children: /* @__PURE__ */ R("div", {
159
+ className: o.measureRow,
160
160
  children: [
161
161
  s ? /* @__PURE__ */ e("div", {
162
162
  className: "shrink-0",
@@ -166,9 +166,9 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
166
166
  })
167
167
  }) : null,
168
168
  r.map((c) => /* @__PURE__ */ e("div", {
169
- ref: g(c.id),
169
+ ref: N(c.id),
170
170
  className: "shrink-0 whitespace-nowrap",
171
- children: /* @__PURE__ */ e(C, {
171
+ children: /* @__PURE__ */ e(b, {
172
172
  item: c,
173
173
  compact: !0
174
174
  })
@@ -176,7 +176,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
176
176
  t ? /* @__PURE__ */ e("div", {
177
177
  className: "shrink-0",
178
178
  children: /* @__PURE__ */ e("div", {
179
- ref: u,
179
+ ref: f,
180
180
  children: t
181
181
  })
182
182
  }) : null
@@ -77,6 +77,14 @@ export type StyledTableProps<TData, TCustomData> = {
77
77
  customActionsNode?: (row: CellContext<TData, unknown>) => ReactNode;
78
78
  customSubRowData?: Map<string, TCustomData[]>;
79
79
  headerPin?: boolean;
80
+ /**
81
+ * Pins the internal actions column's body cells to the right edge. By default they are pinned
82
+ * when the column renders actions (`actions` / `customActionsNode`) or the table has fixed-right
83
+ * columns; a column that only hosts the header pin menu scrolls with the data. The header cell
84
+ * with the pin menu stays pinned either way. Not supported as `false` together with fixed-right
85
+ * columns: their body and header offsets would no longer match.
86
+ */
87
+ stickyActions?: boolean;
80
88
  expandArrow?: boolean;
81
89
  defaultExpanded?: boolean;
82
90
  loading?: boolean;
@@ -1,53 +1,53 @@
1
- import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as xe } from "../types.js";
2
- import { useRootContext as Ce } from "../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as w, INTERNAL_COLUMN_IDS as Re } from "../types.js";
2
+ import { useRootContext as Se } from "../context/RootContext.js";
3
3
  import n from "./StyledTable.module.js";
4
- import { compact as be } from "../../helpers/arrays.js";
5
- import G from "clsx";
6
- import { Fragment as Re, useCallback as K, useEffect as Se, useLayoutEffect as De, useMemo as h, useRef as Ne, useState as ve } from "react";
7
- import { Fragment as Ee, jsx as s, jsxs as b } from "react/jsx-runtime";
8
- import { useSortable as Ie } from "@dnd-kit/sortable";
9
- import { flexRender as ye } from "@tanstack/react-table";
10
- import { CSS as Te } from "@dnd-kit/utilities";
11
- var V = (R, t) => {
12
- const f = R.closest("table");
13
- if (!f) return !1;
14
- const S = t === "next" ? Node.DOCUMENT_POSITION_FOLLOWING : Node.DOCUMENT_POSITION_PRECEDING, c = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter((p) => !f.contains(p) && !!(f.compareDocumentPosition(p) & S)), l = t === "next" ? c[0] : c.at(-1);
4
+ import { compact as De } from "../../helpers/arrays.js";
5
+ import V from "clsx";
6
+ import { Fragment as Ne, useCallback as Y, useEffect as ve, useLayoutEffect as Ee, useMemo as R, useRef as Ie, useState as ye } from "react";
7
+ import { Fragment as Te, jsx as s, jsxs as S } from "react/jsx-runtime";
8
+ import { useSortable as ke } from "@dnd-kit/sortable";
9
+ import { flexRender as Fe } from "@tanstack/react-table";
10
+ import { CSS as Ae } from "@dnd-kit/utilities";
11
+ var J = (D, t) => {
12
+ const g = D.closest("table");
13
+ if (!g) return !1;
14
+ const N = t === "next" ? Node.DOCUMENT_POSITION_FOLLOWING : Node.DOCUMENT_POSITION_PRECEDING, r = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter((p) => !g.contains(p) && !!(g.compareDocumentPosition(p) & N)), l = t === "next" ? r[0] : r.at(-1);
15
15
  return l ? (l.focus(), document.activeElement === l) : !1;
16
16
  };
17
- function We({ styledTableProps: R, row: t, index: f, hasFocusedRow: S, columnWindow: { paddingLeft: c, paddingRight: l, indexes: p } }) {
18
- const { loading: Y, getRowClassName: a, activeRowId: L, rowHeight: x, onRowClick: D, expandArrow: J, enableDnd: M, disableDndForRow: Q, tdClassName: O, customSubRowData: w, renderSubRows: X, defaultExpanded: Z, actions: N, customActionsNode: ee, textExpandArrow: A, enableMultiRowSelection: te, enableRowSelection: ne, singleSelectionRow: ie } = R, v = Q?.(t), { transform: oe, transition: se, setNodeRef: _, isDragging: B } = Ie({
17
+ function je({ styledTableProps: D, row: t, index: g, hasFocusedRow: N, columnWindow: { paddingLeft: r, paddingRight: l, indexes: p } }) {
18
+ const { loading: Q, getRowClassName: a, activeRowId: _, rowHeight: x, onRowClick: v, expandArrow: X, enableDnd: B, disableDndForRow: Z, tdClassName: H, customSubRowData: U, renderSubRows: ee, defaultExpanded: te, actions: E, customActionsNode: ne, stickyActions: ie, textExpandArrow: z, enableMultiRowSelection: oe, enableRowSelection: se, singleSelectionRow: le } = D, I = Z?.(t), { transform: ae, transition: ce, setNodeRef: W, isDragging: P } = ke({
19
19
  id: t.original.id,
20
- disabled: !M || v
21
- }), le = {
22
- transform: Te.Transform.toString(oe),
23
- transition: se,
24
- opacity: B ? 0.8 : 1,
25
- zIndex: B ? 1 : 0,
20
+ disabled: !B || I
21
+ }), de = {
22
+ transform: Ae.Transform.toString(ae),
23
+ transition: ce,
24
+ opacity: P ? 0.8 : 1,
25
+ zIndex: P ? 1 : 0,
26
26
  position: "relative"
27
- }, { isResizing: ae, disableResizingFlag: ce } = Ce(), E = t.isExpanded(), C = Ne(null), [de, re] = ve(void 0);
28
- De(() => {
29
- !E && C.current && re(C.current.cells[0]?.clientHeight ?? C.current.offsetHeight);
30
- }, [E]);
31
- const ue = K((e) => {
32
- C.current = e, v || _(e);
33
- }, [v, _]), H = E ? de ?? x : x;
34
- Se(() => {
35
- Z && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
27
+ }, { isResizing: re, disableResizingFlag: ue } = Se(), y = t.isExpanded(), C = Ie(null), [fe, me] = ye(void 0);
28
+ Ee(() => {
29
+ !y && C.current && me(C.current.cells[0]?.clientHeight ?? C.current.offsetHeight);
30
+ }, [y]);
31
+ const ge = Y((e) => {
32
+ C.current = e, I || W(e);
33
+ }, [I, W]), $ = y ? fe ?? x : x;
34
+ ve(() => {
35
+ te && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
36
36
  }, []);
37
- const U = (e) => {
38
- t.getCanExpand() && !J && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
39
- const i = window.getSelection()?.type !== "Range" && !ae, o = D instanceof Function;
40
- !o && A && i ? t.toggleExpand() : o && i && D(e, t), ce();
41
- }, fe = (e) => {
42
- e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || U(e);
43
- }, me = (e) => {
37
+ const j = (e) => {
38
+ t.getCanExpand() && !X && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
39
+ const i = window.getSelection()?.type !== "Range" && !re, o = v instanceof Function;
40
+ !o && z && i ? t.toggleExpand() : o && i && v(e, t), ue();
41
+ }, he = (e) => {
42
+ e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || j(e);
43
+ }, pe = (e) => {
44
44
  if (e.target === e.currentTarget)
45
45
  switch (e.key) {
46
46
  case "Tab":
47
47
  if (e.shiftKey) {
48
48
  const i = e.currentTarget.closest("table")?.querySelector('thead tr[tabindex="0"]');
49
- i ? (e.preventDefault(), i.focus()) : V(e.currentTarget, "prev") && e.preventDefault();
50
- } else V(e.currentTarget, "next") && e.preventDefault();
49
+ i ? (e.preventDefault(), i.focus()) : J(e.currentTarget, "prev") && e.preventDefault();
50
+ } else J(e.currentTarget, "next") && e.preventDefault();
51
51
  break;
52
52
  case "ArrowDown":
53
53
  t.focusNextRow() && e.preventDefault();
@@ -56,32 +56,32 @@ function We({ styledTableProps: R, row: t, index: f, hasFocusedRow: S, columnWin
56
56
  t.focusPrevRow() && e.preventDefault();
57
57
  break;
58
58
  case "Enter":
59
- e.preventDefault(), U(e);
59
+ e.preventDefault(), j(e);
60
60
  break;
61
61
  }
62
- }, m = t.getVisibleCells().map((e, i, o) => ({
62
+ }, c = t.getVisibleCells().map((e, i, o) => ({
63
63
  ...e,
64
- left: o.slice(0, i).reduce((r, u) => r + (u.column.getSize() ?? 0), 0)
65
- })), z = h(() => m.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [m]), d = h(() => m.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
64
+ left: o.slice(0, i).reduce((f, m) => f + (m.column.getSize() ?? 0), 0)
65
+ })), T = !!E || !!ne, k = c.some((e) => !!e.column.columnDef.fixedRight), d = ie ?? (T || k), q = R(() => c.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [c]), h = R(() => c.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions" && d).map((e, i, o) => ({
66
66
  ...e,
67
- right: o.slice(i + 1).reduce((r, u) => r + (u.column.getSize() ?? 0), 0)
68
- })), [m]), W = h(() => d.some((e) => e.column.id === q), [d]), P = !!N || !!ee, $ = h(() => d.some((e) => !!e.column.columnDef.fixedRight), [d]), g = h(() => m.filter((e) => e.column.columnDef.fixedLeft), [m]), I = !te && !ne && ie, y = t.getIsSelected() && I, T = D instanceof Function, j = p.length > 0 ? be(p.map((e) => z[e])) : z, F = K((e, i) => {
69
- const o = e.column.id === q, r = e.column.columnDef.fixedLeft, u = !!e.column.columnDef.fixedRight, ge = e.id === g.at(-1)?.id, pe = e.id === d.at(0)?.id && !o, he = t.isExpanded(), k = i === 0;
67
+ right: o.slice(i + 1).reduce((f, m) => f + (m.column.getSize() ?? 0), 0)
68
+ })), [c, d]), G = R(() => h.some((e) => e.column.id === w), [h]), K = d ? void 0 : c.find((e) => e.column.id === w), u = R(() => c.filter((e) => e.column.columnDef.fixedLeft), [c]), F = !oe && !se && le, A = t.getIsSelected() && F, L = v instanceof Function, M = p.length > 0 ? De(p.map((e) => q[e])) : q, b = Y((e, i) => {
69
+ const o = e.column.id === w, f = e.column.columnDef.fixedLeft, m = !!e.column.columnDef.fixedRight, xe = e.id === u.at(-1)?.id, Ce = e.id === h.at(0)?.id && !o, be = t.isExpanded(), O = i === 0;
70
70
  return /* @__PURE__ */ s("td", {
71
- className: G(n["t-cell"], !xe.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], T && "cursor-pointer", O, o && n["action-cell"], o && (!P || $) && n["action-cell--no-shadow"], o && !!N && g.length && n.shadowed, o && (a?.(t) ? a?.(t) : n["action-cell-default-background"]), r && n["fixed-cell"], u && n["fixed-right-cell"], ge && n.shadowed, pe && n["shadowed-right"], t.getIsSelected() && n.selected, r && (a?.(t) ? a?.(t) : n["fixed-cell-default-background"]), u && (a?.(t) ? a?.(t) : n["fixed-right-cell-default-background"]), he && n.expanded_row, !!y && n["single-selection"]),
71
+ className: V(n["t-cell"], !Re.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], L && "cursor-pointer", H, o && d && n["action-cell"], o && d && (!T || k) && n["action-cell--no-shadow"], o && d && !!E && u.length && n.shadowed, o && d && (a?.(t) ? a?.(t) : n["action-cell-default-background"]), f && n["fixed-cell"], m && n["fixed-right-cell"], xe && n.shadowed, Ce && n["shadowed-right"], t.getIsSelected() && n.selected, f && (a?.(t) ? a?.(t) : n["fixed-cell-default-background"]), m && (a?.(t) ? a?.(t) : n["fixed-right-cell-default-background"]), be && n.expanded_row, !!A && n["single-selection"]),
72
72
  style: {
73
- left: r ? e.left : void 0,
74
- right: u ? e.right + (W ? -1 : 0) : void 0
73
+ left: f ? e.left : void 0,
74
+ right: m ? e.right + (G ? -1 : 0) : void 0
75
75
  },
76
- children: /* @__PURE__ */ b("div", {
76
+ children: /* @__PURE__ */ S("div", {
77
77
  style: {
78
78
  display: "flex",
79
79
  alignItems: "center",
80
- minWidth: k ? 32 : void 0,
81
- minHeight: H,
80
+ minWidth: O ? 32 : void 0,
81
+ minHeight: $,
82
82
  position: "relative"
83
83
  },
84
- children: [k && y && /* @__PURE__ */ s("span", {
84
+ children: [O && A && /* @__PURE__ */ s("span", {
85
85
  style: {
86
86
  display: "inline-flex",
87
87
  alignItems: "center",
@@ -90,66 +90,67 @@ function We({ styledTableProps: R, row: t, index: f, hasFocusedRow: S, columnWin
90
90
  top: "50%",
91
91
  transform: "translateY(-50%)"
92
92
  },
93
- children: /* @__PURE__ */ s(Fe, {})
93
+ children: /* @__PURE__ */ s(Le, {})
94
94
  }), /* @__PURE__ */ s("span", {
95
95
  style: {
96
- marginLeft: k && I ? 30 : 0,
96
+ marginLeft: O && F ? 30 : 0,
97
97
  width: "100%"
98
98
  },
99
- children: ye(e.column.columnDef.cell, e.getContext())
99
+ children: Fe(e.column.columnDef.cell, e.getContext())
100
100
  })]
101
101
  })
102
102
  }, e.id);
103
103
  }, [
104
- y,
105
- N,
106
- H,
104
+ A,
105
+ E,
106
+ $,
107
107
  a,
108
+ L,
109
+ G,
110
+ k,
111
+ u,
112
+ h,
113
+ t,
108
114
  T,
109
- W,
110
- $,
111
- g,
112
115
  d,
113
- t,
114
- P,
115
- I,
116
- O
116
+ F,
117
+ H
117
118
  ]);
118
- return /* @__PURE__ */ b(Re, { children: [/* @__PURE__ */ b("tr", {
119
+ return /* @__PURE__ */ S(Ne, { children: [/* @__PURE__ */ S("tr", {
119
120
  "aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
120
- tabIndex: t.isFocused() || f === 0 && !S ? 0 : -1,
121
- "data-index": f,
121
+ tabIndex: t.isFocused() || g === 0 && !N ? 0 : -1,
122
+ "data-index": g,
122
123
  "data-test": t.id,
123
- "data-active": L != null && t.id === L ? "true" : void 0,
124
+ "data-active": _ != null && t.id === _ ? "true" : void 0,
124
125
  id: t.id,
125
- className: G(n["t-row"], Y && n["is-loading"], a?.(t)),
126
+ className: V(n["t-row"], Q && n["is-loading"], a?.(t)),
126
127
  style: {
127
128
  height: x ? `${x}px` : "inherit",
128
- ...M && le
129
+ ...B && de
129
130
  },
130
- ref: ue,
131
+ ref: ge,
131
132
  onFocus: (e) => {
132
133
  e.target === e.currentTarget && !t.isFocused() && t.onChangeFocused(!0);
133
134
  },
134
- onMouseUp: fe,
135
+ onMouseUp: he,
135
136
  onMouseDown: (e) => {
136
- e.detail > 1 && !T && A && e.preventDefault();
137
+ e.detail > 1 && !L && z && e.preventDefault();
137
138
  },
138
- onKeyDownCapture: me,
139
+ onKeyDownCapture: pe,
139
140
  children: [
140
- g.map((e, i) => F(e, i)),
141
- c > 0 && /* @__PURE__ */ s("td", {
141
+ u.map((e, i) => b(e, i)),
142
+ r > 0 && /* @__PURE__ */ s("td", {
142
143
  "aria-hidden": !0,
143
144
  className: n["t-cell"],
144
145
  style: {
145
- width: String(c) + "px",
146
- minWidth: String(c) + "px",
147
- maxWidth: String(c) + "px",
146
+ width: String(r) + "px",
147
+ minWidth: String(r) + "px",
148
+ maxWidth: String(r) + "px",
148
149
  padding: 0,
149
150
  border: "none"
150
151
  }
151
152
  }),
152
- j.map((e, i) => F(e, g.length + i)),
153
+ M.map((e, i) => b(e, u.length + i)),
153
154
  l > 0 && /* @__PURE__ */ s("td", {
154
155
  "aria-hidden": !0,
155
156
  className: n["t-cell"],
@@ -161,14 +162,15 @@ function We({ styledTableProps: R, row: t, index: f, hasFocusedRow: S, columnWin
161
162
  border: "none"
162
163
  }
163
164
  }),
164
- d.map((e, i) => F(e, g.length + j.length + i))
165
+ h.map((e, i) => b(e, u.length + M.length + i)),
166
+ K && b(K, u.length + M.length + h.length)
165
167
  ]
166
- }), t.getIsExpanded() && /* @__PURE__ */ s(Ee, { children: w && X?.({
167
- rows: w.get(t.original.id.toString()) ?? [],
168
+ }), t.getIsExpanded() && /* @__PURE__ */ s(Te, { children: U && ee?.({
169
+ rows: U.get(t.original.id.toString()) ?? [],
168
170
  row: t.original
169
171
  }) })] }, t.id);
170
172
  }
171
- var Fe = () => /* @__PURE__ */ b("svg", {
173
+ var Le = () => /* @__PURE__ */ S("svg", {
172
174
  xmlns: "http://www.w3.org/2000/svg",
173
175
  width: "20",
174
176
  height: "20",
@@ -180,5 +182,5 @@ var Fe = () => /* @__PURE__ */ b("svg", {
180
182
  })]
181
183
  });
182
184
  export {
183
- We as TableRow
185
+ je as TableRow
184
186
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.121.5",
6
+ "version": "3.121.6",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",