asma-ui-core 3.121.3 → 3.121.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- var e = "_CheckboxWrapper_svs38_1", _ = "_Checkbox_svs38_1", r = "_Indeterminate_svs38_33", s = "_ReadOnly_svs38_109", a = "_Indicator_svs38_118", v = "_HideWrapper_svs38_122", o = "_CheckboxHover_svs38_129", p = "_CheckboxRippleContainer_svs38_129", i = "_CheckboxRipple_svs38_129", l = "_ripple_svs38_1", d = {
2
- CheckboxWrapper: e,
3
- "size-small": "_size-small_svs38_16",
4
- "size-medium": "_size-medium_svs38_20",
5
- Checkbox: _,
6
- Indeterminate: r,
7
- Error: "_Error_svs38_60",
8
- ReadOnly: s,
9
- Indicator: a,
10
- HideWrapper: v,
11
- CheckboxHover: o,
12
- CheckboxRippleContainer: p,
13
- CheckboxRipple: i,
14
- ripple: l
1
+ var a = "_CheckboxWrapper_ajsar_1", r = "_Checkbox_ajsar_1", e = "_Indeterminate_ajsar_34", _ = "_ReadOnly_ajsar_110", o = "_Indicator_ajsar_119", p = "_HideWrapper_ajsar_123", i = "_CheckboxHover_ajsar_130", s = "_CheckboxRippleContainer_ajsar_130", l = "_CheckboxRipple_ajsar_130", d = "_ripple_ajsar_1", c = {
2
+ CheckboxWrapper: a,
3
+ "size-small": "_size-small_ajsar_17",
4
+ "size-medium": "_size-medium_ajsar_21",
5
+ Checkbox: r,
6
+ Indeterminate: e,
7
+ Error: "_Error_ajsar_61",
8
+ ReadOnly: _,
9
+ Indicator: o,
10
+ HideWrapper: p,
11
+ CheckboxHover: i,
12
+ CheckboxRippleContainer: s,
13
+ CheckboxRipple: l,
14
+ ripple: d
15
15
  };
16
16
  export {
17
- d as default
17
+ c as default
18
18
  };
@@ -9,33 +9,16 @@ var g = 40, j = "relative box-border flex flex-col overflow-hidden rounded-lg bg
9
9
  return /* @__PURE__ */ l(_, { children: [
10
10
  /* @__PURE__ */ l("div", {
11
11
  className: "relative flex min-h-0 flex-1 flex-col",
12
- children: [
13
- t && /* @__PURE__ */ e("div", {
14
- id: m,
15
- className: "shrink-0 truncate pb-1 pl-4 pr-10 pt-2 text-lg font-semibold leading-7 text-delta-800",
16
- children: t
17
- }),
18
- /* @__PURE__ */ e("div", {
19
- ref: n,
20
- className: d("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2 pl-4 [scrollbar-gutter:stable]", !t && s.overflows && "mt-10"),
21
- style: { paddingRight: Math.max(0, g - s.width) },
22
- children: p
23
- }),
24
- /* @__PURE__ */ e("div", {
25
- className: "absolute right-0 top-0",
26
- children: /* @__PURE__ */ e(h, {
27
- dataTest: `${a}-close`,
28
- variant: "textGray",
29
- type: "button",
30
- "aria-label": f,
31
- onClick: x,
32
- startIcon: /* @__PURE__ */ e(c, {
33
- width: 24,
34
- height: 24
35
- })
36
- })
37
- })
38
- ]
12
+ children: [t && /* @__PURE__ */ e("div", {
13
+ id: m,
14
+ className: "shrink-0 truncate pb-1 pl-4 pr-10 pt-2 text-lg font-semibold leading-7 text-delta-800",
15
+ children: t
16
+ }), /* @__PURE__ */ e("div", {
17
+ ref: n,
18
+ className: d("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2 pl-4 [scrollbar-gutter:stable]", !t && s.overflows && "mt-10"),
19
+ style: { paddingRight: Math.max(0, g - s.width) },
20
+ children: p
21
+ })]
39
22
  }),
40
23
  (r ?? o) && /* @__PURE__ */ l("div", {
41
24
  className: d("flex shrink-0 items-start p-1", r ? "justify-between" : "justify-end"),
@@ -45,6 +28,20 @@ var g = 40, j = "relative box-border flex flex-col overflow-hidden rounded-lg bg
45
28
  className: "flex shrink-0 flex-col items-end p-3",
46
29
  children: i
47
30
  }),
31
+ /* @__PURE__ */ e("div", {
32
+ className: "absolute right-0 top-0",
33
+ children: /* @__PURE__ */ e(h, {
34
+ dataTest: `${a}-close`,
35
+ variant: "textGray",
36
+ type: "button",
37
+ "aria-label": f,
38
+ onClick: x,
39
+ startIcon: /* @__PURE__ */ e(c, {
40
+ width: 24,
41
+ height: 24
42
+ })
43
+ })
44
+ }),
48
45
  /* @__PURE__ */ e("span", {
49
46
  "aria-hidden": !0,
50
47
  "data-test": `${a}-edge`,
@@ -1,57 +1,53 @@
1
- import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as pe } from "../types.js";
2
- import { useRootContext as xe } from "../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as xe } from "../types.js";
2
+ import { useRootContext as Ce } from "../context/RootContext.js";
3
3
  import n from "./StyledTable.module.js";
4
4
  import { compact as be } from "../../helpers/arrays.js";
5
- import K from "clsx";
6
- import { Fragment as Ce, useCallback as G, useEffect as Re, useLayoutEffect as Se, useMemo as m, useRef as De, useState as Ne } from "react";
7
- import { Fragment as ve, jsx as s, jsxs as C } from "react/jsx-runtime";
8
- import { useSortable as ye } from "@dnd-kit/sortable";
9
- import { flexRender as Ee } from "@tanstack/react-table";
10
- import { CSS as Ie } from "@dnd-kit/utilities";
11
- var Fe = (R) => {
12
- const t = R.closest("table");
13
- if (!t) return !1;
14
- const r = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).find((g) => !t.contains(g) && !!(t.compareDocumentPosition(g) & Node.DOCUMENT_POSITION_FOLLOWING));
15
- return r ? (r.focus(), document.activeElement === r) : !1;
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);
15
+ return l ? (l.focus(), document.activeElement === l) : !1;
16
16
  };
17
- function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWindow: { paddingLeft: h, paddingRight: p, indexes: T } }) {
18
- const { loading: V, getRowClassName: l, activeRowId: L, rowHeight: x, onRowClick: S, expandArrow: Y, enableDnd: w, disableDndForRow: J, tdClassName: A, customSubRowData: M, renderSubRows: Q, defaultExpanded: X, actions: D, customActionsNode: Z, textExpandArrow: B, enableMultiRowSelection: ee, enableRowSelection: te, singleSelectionRow: ne } = R, N = J?.(t), { transform: ie, transition: oe, setNodeRef: O, isDragging: _ } = ye({
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({
19
19
  id: t.original.id,
20
- disabled: !w || N
21
- }), se = {
22
- transform: Ie.Transform.toString(ie),
23
- transition: oe,
24
- opacity: _ ? 0.8 : 1,
25
- zIndex: _ ? 1 : 0,
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,
26
26
  position: "relative"
27
- }, { isResizing: le, disableResizingFlag: ae } = xe(), v = t.isExpanded(), b = De(null), [ce, de] = Ne(void 0);
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;
28
34
  Se(() => {
29
- !v && b.current && de(b.current.cells[0]?.clientHeight ?? b.current.offsetHeight);
30
- }, [v]);
31
- const re = G((e) => {
32
- b.current = e, N || O(e);
33
- }, [N, O]), H = v ? ce ?? x : x;
34
- Re(() => {
35
- X && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
35
+ Z && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
36
36
  }, []);
37
37
  const U = (e) => {
38
- t.getCanExpand() && !Y && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
39
- const i = window.getSelection()?.type !== "Range" && !le, o = S instanceof Function;
40
- !o && B && i ? t.toggleExpand() : o && i && S(e, t), ae();
41
- }, ue = (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);
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();
43
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) => {
44
44
  if (e.target === e.currentTarget)
45
45
  switch (e.key) {
46
46
  case "Tab":
47
47
  if (e.shiftKey) {
48
- if (t.focusPrevRow()) {
49
- e.preventDefault();
50
- break;
51
- }
52
48
  const i = e.currentTarget.closest("table")?.querySelector('thead tr[tabindex="0"]');
53
- i && (e.preventDefault(), i.focus());
54
- } else (t.focusNextRow() || Fe(e.currentTarget)) && e.preventDefault();
49
+ i ? (e.preventDefault(), i.focus()) : V(e.currentTarget, "prev") && e.preventDefault();
50
+ } else V(e.currentTarget, "next") && e.preventDefault();
55
51
  break;
56
52
  case "ArrowDown":
57
53
  t.focusNextRow() && e.preventDefault();
@@ -63,21 +59,21 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
63
59
  e.preventDefault(), U(e);
64
60
  break;
65
61
  }
66
- }, u = t.getVisibleCells().map((e, i, o) => ({
62
+ }, m = t.getVisibleCells().map((e, i, o) => ({
67
63
  ...e,
68
- left: o.slice(0, i).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
69
- })), z = m(() => u.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [u]), a = m(() => u.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
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) => ({
70
66
  ...e,
71
- right: o.slice(i + 1).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
72
- })), [u]), W = m(() => a.some((e) => e.column.id === q), [a]), P = !!D || !!Z, $ = m(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), f = m(() => u.filter((e) => e.column.columnDef.fixedLeft), [u]), y = !ee && !te && ne, E = t.getIsSelected() && y, I = S instanceof Function, j = T.length > 0 ? be(T.map((e) => z[e])) : z, F = G((e, i) => {
73
- const o = e.column.id === q, c = e.column.columnDef.fixedLeft, d = !!e.column.columnDef.fixedRight, me = e.id === f.at(-1)?.id, ge = e.id === a.at(0)?.id && !o, he = t.isExpanded(), k = i === 0;
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;
74
70
  return /* @__PURE__ */ s("td", {
75
- className: K(n["t-cell"], !pe.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], I && "cursor-pointer", A, o && n["action-cell"], o && (!P || $) && n["action-cell--no-shadow"], o && !!D && f.length && n.shadowed, o && (l?.(t) ? l?.(t) : n["action-cell-default-background"]), c && n["fixed-cell"], d && n["fixed-right-cell"], me && n.shadowed, ge && n["shadowed-right"], t.getIsSelected() && n.selected, c && (l?.(t) ? l?.(t) : n["fixed-cell-default-background"]), d && (l?.(t) ? l?.(t) : n["fixed-right-cell-default-background"]), he && n.expanded_row, !!E && n["single-selection"]),
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"]),
76
72
  style: {
77
- left: c ? e.left : void 0,
78
- right: d ? e.right + (W ? -1 : 0) : void 0
73
+ left: r ? e.left : void 0,
74
+ right: u ? e.right + (W ? -1 : 0) : void 0
79
75
  },
80
- children: /* @__PURE__ */ C("div", {
76
+ children: /* @__PURE__ */ b("div", {
81
77
  style: {
82
78
  display: "flex",
83
79
  alignItems: "center",
@@ -85,7 +81,7 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
85
81
  minHeight: H,
86
82
  position: "relative"
87
83
  },
88
- children: [k && E && /* @__PURE__ */ s("span", {
84
+ children: [k && y && /* @__PURE__ */ s("span", {
89
85
  style: {
90
86
  display: "inline-flex",
91
87
  alignItems: "center",
@@ -94,85 +90,85 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
94
90
  top: "50%",
95
91
  transform: "translateY(-50%)"
96
92
  },
97
- children: /* @__PURE__ */ s(ke, {})
93
+ children: /* @__PURE__ */ s(Fe, {})
98
94
  }), /* @__PURE__ */ s("span", {
99
95
  style: {
100
- marginLeft: k && y ? 30 : 0,
96
+ marginLeft: k && I ? 30 : 0,
101
97
  width: "100%"
102
98
  },
103
- children: Ee(e.column.columnDef.cell, e.getContext())
99
+ children: ye(e.column.columnDef.cell, e.getContext())
104
100
  })]
105
101
  })
106
102
  }, e.id);
107
103
  }, [
108
- E,
109
- D,
104
+ y,
105
+ N,
110
106
  H,
111
- l,
112
- I,
107
+ a,
108
+ T,
113
109
  W,
114
110
  $,
115
- f,
116
- a,
111
+ g,
112
+ d,
117
113
  t,
118
114
  P,
119
- y,
120
- A
115
+ I,
116
+ O
121
117
  ]);
122
- return /* @__PURE__ */ C(Ce, { children: [/* @__PURE__ */ C("tr", {
118
+ return /* @__PURE__ */ b(Re, { children: [/* @__PURE__ */ b("tr", {
123
119
  "aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
124
- tabIndex: t.isFocused() || r === 0 && !g ? 0 : -1,
125
- "data-index": r,
120
+ tabIndex: t.isFocused() || f === 0 && !S ? 0 : -1,
121
+ "data-index": f,
126
122
  "data-test": t.id,
127
123
  "data-active": L != null && t.id === L ? "true" : void 0,
128
124
  id: t.id,
129
- className: K(n["t-row"], V && n["is-loading"], l?.(t)),
125
+ className: G(n["t-row"], Y && n["is-loading"], a?.(t)),
130
126
  style: {
131
127
  height: x ? `${x}px` : "inherit",
132
- ...w && se
128
+ ...M && le
133
129
  },
134
- ref: re,
130
+ ref: ue,
135
131
  onFocus: (e) => {
136
132
  e.target === e.currentTarget && !t.isFocused() && t.onChangeFocused(!0);
137
133
  },
138
- onMouseUp: ue,
134
+ onMouseUp: fe,
139
135
  onMouseDown: (e) => {
140
- e.detail > 1 && !I && B && e.preventDefault();
136
+ e.detail > 1 && !T && A && e.preventDefault();
141
137
  },
142
- onKeyDownCapture: fe,
138
+ onKeyDownCapture: me,
143
139
  children: [
144
- f.map((e, i) => F(e, i)),
145
- h > 0 && /* @__PURE__ */ s("td", {
140
+ g.map((e, i) => F(e, i)),
141
+ c > 0 && /* @__PURE__ */ s("td", {
146
142
  "aria-hidden": !0,
147
143
  className: n["t-cell"],
148
144
  style: {
149
- width: String(h) + "px",
150
- minWidth: String(h) + "px",
151
- maxWidth: String(h) + "px",
145
+ width: String(c) + "px",
146
+ minWidth: String(c) + "px",
147
+ maxWidth: String(c) + "px",
152
148
  padding: 0,
153
149
  border: "none"
154
150
  }
155
151
  }),
156
- j.map((e, i) => F(e, f.length + i)),
157
- p > 0 && /* @__PURE__ */ s("td", {
152
+ j.map((e, i) => F(e, g.length + i)),
153
+ l > 0 && /* @__PURE__ */ s("td", {
158
154
  "aria-hidden": !0,
159
155
  className: n["t-cell"],
160
156
  style: {
161
- width: String(p) + "px",
162
- minWidth: String(p) + "px",
163
- maxWidth: String(p) + "px",
157
+ width: String(l) + "px",
158
+ minWidth: String(l) + "px",
159
+ maxWidth: String(l) + "px",
164
160
  padding: 0,
165
161
  border: "none"
166
162
  }
167
163
  }),
168
- a.map((e, i) => F(e, f.length + j.length + i))
164
+ d.map((e, i) => F(e, g.length + j.length + i))
169
165
  ]
170
- }), t.getIsExpanded() && /* @__PURE__ */ s(ve, { children: M && Q?.({
171
- rows: M.get(t.original.id.toString()) ?? [],
166
+ }), t.getIsExpanded() && /* @__PURE__ */ s(Ee, { children: w && X?.({
167
+ rows: w.get(t.original.id.toString()) ?? [],
172
168
  row: t.original
173
169
  }) })] }, t.id);
174
170
  }
175
- var ke = () => /* @__PURE__ */ C("svg", {
171
+ var Fe = () => /* @__PURE__ */ b("svg", {
176
172
  xmlns: "http://www.w3.org/2000/svg",
177
173
  width: "20",
178
174
  height: "20",
@@ -6,12 +6,12 @@ import "react";
6
6
  import { jsx as n, jsxs as O } from "react/jsx-runtime";
7
7
  import "@tanstack/react-table";
8
8
  function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, columnWindow: { paddingLeft: i, paddingRight: c, indexes: H } }) {
9
- const { stickyHeader: S = !1, tableHeaderRef: y, tableHeaderStyle: g = {} } = o, D = p.getHeaderGroups(), b = { ...g };
9
+ const { stickyHeader: S = !1, tableHeaderRef: y, tableHeaderStyle: g = {} } = o, b = p.getHeaderGroups(), D = { ...g };
10
10
  return /* @__PURE__ */ n("thead", {
11
11
  className: C(x["table-header"], S && x["table-header--sticky"], o.tableHeaderClassName),
12
- style: b,
12
+ style: D,
13
13
  ref: y,
14
- children: D.map((f) => {
14
+ children: b.map((f) => {
15
15
  const m = f.headers.map((e, t, r) => ({
16
16
  header: e,
17
17
  left: r.slice(0, t).reduce((d, a) => d + (a.column.getSize() ?? 0), 0)
@@ -26,7 +26,7 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
26
26
  tabIndex: 0,
27
27
  onKeyDown: (e) => {
28
28
  if (e.key !== "Tab" || e.shiftKey) return;
29
- const t = e.currentTarget.closest("table")?.querySelector('tbody tr[data-index="0"]');
29
+ const t = e.currentTarget.closest("table")?.querySelector('tbody tr[tabindex="0"]');
30
30
  t && (e.preventDefault(), t.focus());
31
31
  },
32
32
  children: [
@@ -1,51 +1,59 @@
1
- import { functionalUpdate as u, makeStateUpdater as i } from "@tanstack/react-table";
2
- var a = {
1
+ import { functionalUpdate as r, makeStateUpdater as u } from "@tanstack/react-table";
2
+ var d = (e) => getComputedStyle(e).position === "sticky", l = (e) => {
3
+ const s = e.closest("table"), t = s?.tHead;
4
+ let n = 0;
5
+ for (let o = s?.parentElement?.nextElementSibling; o; o = o.nextElementSibling) d(o) && (n += o.getBoundingClientRect().height);
6
+ e.style.scrollMarginTop = `${t && d(t) ? t.getBoundingClientRect().height : 0}px`, e.style.scrollMarginBottom = `${n}px`, e.scrollIntoView({
7
+ block: "nearest",
8
+ inline: "nearest"
9
+ });
10
+ }, g = {
3
11
  getInitialState: (e) => ({
4
12
  focusedRow: null,
5
13
  ...e
6
14
  }),
7
- getDefaultOptions: (e) => ({ onChangeFocusedRow: i("focusedRow", e) }),
15
+ getDefaultOptions: (e) => ({ onChangeFocusedRow: u("focusedRow", e) }),
8
16
  createTable: (e) => {
9
- e.setFocusedRow = (o) => {
10
- const t = (n) => u(o, n);
11
- return e.options.onChangeFocusedRow?.(t);
17
+ e.setFocusedRow = (t) => {
18
+ const n = (o) => r(t, o);
19
+ return e.options.onChangeFocusedRow?.(n);
12
20
  };
13
- const s = async (o) => {
14
- if (e.getRowModel().rows.findIndex((n) => n.id === o) === -1 && e.getState().pagination) {
15
- const n = e.getState().pagination.pageSize, c = e.getCoreRowModel().rows.findIndex((d) => d.id === o);
16
- if (c !== -1) {
17
- const d = Math.floor(c / n);
18
- e.setPageIndex?.(d);
21
+ const s = async (t) => {
22
+ if (e.getRowModel().rows.findIndex((o) => o.id === t) === -1 && e.getState().pagination) {
23
+ const o = e.getState().pagination.pageSize, i = e.getCoreRowModel().rows.findIndex((c) => c.id === t);
24
+ if (i !== -1) {
25
+ const c = Math.floor(i / o);
26
+ e.setPageIndex?.(c);
19
27
  }
20
28
  }
21
- if (await new Promise(requestAnimationFrame), !e.getRowModel().rows.find((n) => n.id === o)) return;
22
- e.setFocusedRow(() => o);
23
- const t = document.getElementById(o);
24
- t && (t.focus({ preventScroll: !1 }), t.scrollIntoView({
29
+ if (await new Promise(requestAnimationFrame), !e.getRowModel().rows.find((o) => o.id === t)) return;
30
+ e.setFocusedRow(() => t);
31
+ const n = document.getElementById(t);
32
+ n && (n.focus({ preventScroll: !1 }), n.scrollIntoView({
25
33
  behavior: "smooth",
26
34
  block: "center"
27
35
  }));
28
36
  };
29
- e.focusRowById = (o) => {
30
- s(o);
37
+ e.focusRowById = (t) => {
38
+ s(t);
31
39
  };
32
40
  },
33
41
  createRow: (e, s) => {
34
- e.isFocused = () => s.getState().focusedRow === e.id, e.onChangeFocused = (o, t) => {
35
- const n = t ?? e.id;
36
- if (s.setFocusedRow(() => o ? n : null), o) {
37
- const c = document.getElementById(n);
38
- c && c.focus({ preventScroll: !0 });
42
+ e.isFocused = () => s.getState().focusedRow === e.id, e.onChangeFocused = (t, n) => {
43
+ const o = n ?? e.id;
44
+ if (s.setFocusedRow(() => t ? o : null), t) {
45
+ const i = document.getElementById(o);
46
+ i && (i.focus({ preventScroll: !0 }), l(i));
39
47
  }
40
48
  }, e.toggleFocused = () => e.onChangeFocused(!e.isFocused()), e.focusNextRow = () => {
41
- const o = s.getRowModel().rows, t = o[o.findIndex((n) => n.id === s.getState().focusedRow) + 1];
42
- return t ? (t.onChangeFocused(!0, t.id), !0) : !1;
49
+ const t = s.getRowModel().rows, n = t[t.findIndex((o) => o.id === s.getState().focusedRow) + 1];
50
+ return n ? (n.onChangeFocused(!0, n.id), !0) : !1;
43
51
  }, e.focusPrevRow = () => {
44
- const o = s.getRowModel().rows, t = o[o.findIndex((n) => n.id === s.getState().focusedRow) - 1];
45
- return t ? (t.onChangeFocused(!0, t.id), !0) : !1;
52
+ const t = s.getRowModel().rows, n = t[t.findIndex((o) => o.id === s.getState().focusedRow) - 1];
53
+ return n ? (n.onChangeFocused(!0, n.id), !0) : !1;
46
54
  };
47
55
  }
48
56
  };
49
57
  export {
50
- a as FocusedRowsFeature
58
+ g as FocusedRowsFeature
51
59
  };
@@ -1,17 +1,17 @@
1
- var e = "_CheckboxWrapper_k9tu2_1", _ = "_Checkbox_k9tu2_1", r = "_Indeterminate_k9tu2_29", a = "_ReadOnly_k9tu2_56", t = "_Indicator_k9tu2_65", k = "_HideWrapper_k9tu2_69", p = "_CheckboxHover_k9tu2_76", i = "_CheckboxRippleContainer_k9tu2_76", o = "_CheckboxRipple_k9tu2_76", u = "_ripple_k9tu2_1", l = {
1
+ var e = "_CheckboxWrapper_b7zlc_1", _ = "_Checkbox_b7zlc_1", r = "_Indeterminate_b7zlc_30", a = "_ReadOnly_b7zlc_57", l = "_Indicator_b7zlc_66", c = "_HideWrapper_b7zlc_70", b = "_CheckboxHover_b7zlc_77", p = "_CheckboxRippleContainer_b7zlc_77", i = "_CheckboxRipple_b7zlc_77", o = "_ripple_b7zlc_1", z = {
2
2
  CheckboxWrapper: e,
3
- "size-small": "_size-small_k9tu2_12",
4
- "size-medium": "_size-medium_k9tu2_16",
3
+ "size-small": "_size-small_b7zlc_13",
4
+ "size-medium": "_size-medium_b7zlc_17",
5
5
  Checkbox: _,
6
6
  Indeterminate: r,
7
7
  ReadOnly: a,
8
- Indicator: t,
9
- HideWrapper: k,
10
- CheckboxHover: p,
11
- CheckboxRippleContainer: i,
12
- CheckboxRipple: o,
13
- ripple: u
8
+ Indicator: l,
9
+ HideWrapper: c,
10
+ CheckboxHover: b,
11
+ CheckboxRippleContainer: p,
12
+ CheckboxRipple: i,
13
+ ripple: o
14
14
  };
15
15
  export {
16
- l as default
16
+ z as default
17
17
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.121.3",
6
+ "version": "3.121.5",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",