asma-ui-core 3.45.2 → 3.46.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.
@@ -1,4 +1,4 @@
1
1
  import { StyledTableProps } from '../types';
2
2
  export declare const injectColumns: <TData extends {
3
3
  id: string | number;
4
- }, TCustomData = Record<string, unknown>>(props: StyledTableProps<TData, TCustomData>) => void;
4
+ }, TCustomData = Record<string, unknown>>(props: StyledTableProps<TData, TCustomData>) => StyledTableProps<TData, TCustomData>["columns"];
@@ -0,0 +1,3 @@
1
+ import { ColumnSizingState, Table } from '@tanstack/react-table';
2
+ export declare const usePersistedColumnSizing: (uniqueKey?: string) => ColumnSizingState | undefined;
3
+ export declare const usePersistColumnSizing: <TData>(table: Table<TData>, uniqueKey?: string) => void;
@@ -1,57 +1,57 @@
1
- var e = "_tbody_v7jow_124", _ = "_expanded_row_v7jow_187", o = "_selected_v7jow_205", l = "_shadowed_v7jow_234", t = "_resizer_v7jow_288", a = "_isResizing_v7jow_300", r = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_v7jow_1",
3
- "table-wrapper": "_table-wrapper_v7jow_26",
4
- "table-shell": "_table-shell_v7jow_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_v7jow_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_v7jow_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_v7jow_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_v7jow_53",
9
- "table-scroll": "_table-scroll_v7jow_56",
10
- "table-x--fill-height": "_table-x--fill-height_v7jow_65",
11
- "table-x": "_table-x_v7jow_65",
12
- "table-content": "_table-content_v7jow_80",
13
- "table-header--sticky": "_table-header--sticky_v7jow_85",
14
- "table-hscroll": "_table-hscroll_v7jow_90",
15
- "table-hscroll__content": "_table-hscroll__content_v7jow_100",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_v7jow_103",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_v7jow_111",
18
- "styled-table": "_styled-table_v7jow_115",
1
+ var e = "_tbody_1g04u_124", _ = "_expanded_row_1g04u_187", l = "_selected_1g04u_205", t = "_shadowed_1g04u_234", a = "_resizer_1g04u_288", o = "_isResizing_1g04u_300", r = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_1g04u_1",
3
+ "table-wrapper": "_table-wrapper_1g04u_26",
4
+ "table-shell": "_table-shell_1g04u_33",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_1g04u_39",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_1g04u_42",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_1g04u_43",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_1g04u_53",
9
+ "table-scroll": "_table-scroll_1g04u_56",
10
+ "table-x--fill-height": "_table-x--fill-height_1g04u_65",
11
+ "table-x": "_table-x_1g04u_65",
12
+ "table-content": "_table-content_1g04u_80",
13
+ "table-header--sticky": "_table-header--sticky_1g04u_85",
14
+ "table-hscroll": "_table-hscroll_1g04u_90",
15
+ "table-hscroll__content": "_table-hscroll__content_1g04u_100",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_1g04u_103",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_1g04u_111",
18
+ "styled-table": "_styled-table_1g04u_115",
19
19
  tbody: e,
20
- "loading-icon": "_loading-icon_v7jow_129",
21
- "t-row": "_t-row_v7jow_136",
22
- "t-cell": "_t-cell_v7jow_136",
23
- "action-cell": "_action-cell_v7jow_146",
24
- "fixed-cell": "_fixed-cell_v7jow_150",
25
- "fixed-right-cell": "_fixed-right-cell_v7jow_153",
20
+ "loading-icon": "_loading-icon_1g04u_129",
21
+ "t-row": "_t-row_1g04u_136",
22
+ "t-cell": "_t-cell_1g04u_136",
23
+ "action-cell": "_action-cell_1g04u_146",
24
+ "fixed-cell": "_fixed-cell_1g04u_150",
25
+ "fixed-right-cell": "_fixed-right-cell_1g04u_153",
26
26
  expanded_row: _,
27
- selected: o,
28
- "single-selection": "_single-selection_v7jow_208",
29
- "action-cell--no-shadow": "_action-cell--no-shadow_v7jow_225",
30
- "action-cell--not-fixed": "_action-cell--not-fixed_v7jow_228",
31
- shadowed: l,
32
- "shadowed-right": "_shadowed-right_v7jow_268",
33
- "is-loading": "_is-loading_v7jow_272",
34
- "action-cell-default-background": "_action-cell-default-background_v7jow_275",
35
- "fixed-cell-default-background": "_fixed-cell-default-background_v7jow_278",
36
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_v7jow_281",
37
- "sortable-column": "_sortable-column_v7jow_284",
38
- resizer: t,
39
- isResizing: a,
40
- "hide-table-header": "_hide-table-header_v7jow_312",
41
- "show-table-header": "_show-table-header_v7jow_316",
42
- "table-header": "_table-header_v7jow_85",
43
- "hide-header": "_hide-header_v7jow_342",
44
- "t-cell__actions": "_t-cell__actions_v7jow_345",
45
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_v7jow_353",
46
- "t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_v7jow_356",
47
- "t-cell__fixed": "_t-cell__fixed_v7jow_363",
48
- "t-cell__fixed-right": "_t-cell__fixed-right_v7jow_370",
49
- "sort-icon": "_sort-icon_v7jow_377",
50
- "table-footer--sticky": "_table-footer--sticky_v7jow_380",
51
- "table-footer--inline": "_table-footer--inline_v7jow_391",
52
- "table-bottom": "_table-bottom_v7jow_402",
53
- "table-bottom--sticky": "_table-bottom--sticky_v7jow_416",
54
- "cursor-not-allowed": "_cursor-not-allowed_v7jow_420"
27
+ selected: l,
28
+ "single-selection": "_single-selection_1g04u_208",
29
+ "action-cell--no-shadow": "_action-cell--no-shadow_1g04u_225",
30
+ "action-cell--not-fixed": "_action-cell--not-fixed_1g04u_228",
31
+ shadowed: t,
32
+ "shadowed-right": "_shadowed-right_1g04u_268",
33
+ "is-loading": "_is-loading_1g04u_272",
34
+ "action-cell-default-background": "_action-cell-default-background_1g04u_275",
35
+ "fixed-cell-default-background": "_fixed-cell-default-background_1g04u_278",
36
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_1g04u_281",
37
+ "sortable-column": "_sortable-column_1g04u_284",
38
+ resizer: a,
39
+ isResizing: o,
40
+ "hide-table-header": "_hide-table-header_1g04u_312",
41
+ "show-table-header": "_show-table-header_1g04u_316",
42
+ "table-header": "_table-header_1g04u_85",
43
+ "hide-header": "_hide-header_1g04u_348",
44
+ "t-cell__actions": "_t-cell__actions_1g04u_351",
45
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_1g04u_359",
46
+ "t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_1g04u_362",
47
+ "t-cell__fixed": "_t-cell__fixed_1g04u_369",
48
+ "t-cell__fixed-right": "_t-cell__fixed-right_1g04u_376",
49
+ "sort-icon": "_sort-icon_1g04u_383",
50
+ "table-footer--sticky": "_table-footer--sticky_1g04u_386",
51
+ "table-footer--inline": "_table-footer--inline_1g04u_397",
52
+ "table-bottom": "_table-bottom_1g04u_408",
53
+ "table-bottom--sticky": "_table-bottom--sticky_1g04u_422",
54
+ "cursor-not-allowed": "_cursor-not-allowed_1g04u_426"
55
55
  };
56
56
  export {
57
57
  r as default
@@ -17,7 +17,7 @@ import { DndContext as fe, closestCenter as he } from "@dnd-kit/core";
17
17
  import { restrictToParentElement as be, restrictToVerticalAxis as ue } from "@dnd-kit/modifiers";
18
18
  import { arrayMove as pe } from "@dnd-kit/sortable";
19
19
  function we({ enabled: l, data: o, setData: i, children: v }) {
20
- const y = O(() => o.map((c) => c.id), [o]), S = (c) => {
20
+ const y = O(() => o.map((c) => c.id), [o]), P = (c) => {
21
21
  if (!l || !i) return;
22
22
  const { active: m, over: f } = c;
23
23
  !m || !f || m.id === f.id || i((g) => pe(g, y.indexOf(m.id), y.indexOf(f.id)));
@@ -25,7 +25,7 @@ function we({ enabled: l, data: o, setData: i, children: v }) {
25
25
  return l ? /* @__PURE__ */ t(fe, {
26
26
  collisionDetection: he,
27
27
  modifiers: [ue, be],
28
- onDragEnd: S,
28
+ onDragEnd: P,
29
29
  children: v
30
30
  }) : /* @__PURE__ */ t(X, { children: v });
31
31
  }
@@ -36,61 +36,65 @@ function ve({ enabled: l, className: o, children: i }) {
36
36
  }) : /* @__PURE__ */ t(X, { children: i });
37
37
  }
38
38
  var Ve = (l) => {
39
- const o = O(() => ({
40
- ...l,
41
- rowHeight: l.rowHeight ?? 48
42
- }), [l]), { className: i, tableClassName: v, height: y, noRowsOverlay: S, data: c, enableDnd: m, setData: f, loading: g } = o;
43
- le(o);
44
- const { table: a } = ne(o), C = c.length > 0, F = C && !!g, h = !C && !g, z = oe(re()), r = !!o.stickyFooter && !z, [G, M] = me(!1), x = L(null), W = L(null), P = o.hideHeader ? 0 : 32, { tableScrollRef: R, tableXRef: H, hScrollRef: J, hScrollContentRef: K } = ce(!r);
39
+ const o = O(() => {
40
+ const r = {
41
+ ...l,
42
+ rowHeight: l.rowHeight ?? 48
43
+ };
44
+ return {
45
+ ...r,
46
+ columns: le(r)
47
+ };
48
+ }, [l]), { className: i, tableClassName: v, height: y, noRowsOverlay: P, data: c, enableDnd: m, setData: f, loading: g } = o, { table: a } = ne(o), C = c.length > 0, F = C && !!g, h = !C && !g, z = oe(re()), n = !!o.stickyFooter && !z, [G, M] = me(!1), x = L(null), W = L(null), S = o.hideHeader ? 0 : 32, { tableScrollRef: R, tableXRef: H, hScrollRef: J, hScrollContentRef: K } = ce(!n);
45
49
  q(() => {
46
- const n = r ? x.current : H.current ?? R.current;
47
- if (!n) {
50
+ const r = n ? x.current : H.current ?? R.current;
51
+ if (!r) {
48
52
  M(!1);
49
53
  return;
50
54
  }
51
- const s = n.querySelector("table"), b = () => {
52
- const u = n.scrollWidth > n.clientWidth;
55
+ const s = r.querySelector("table"), b = () => {
56
+ const u = r.scrollWidth > r.clientWidth;
53
57
  M((I) => I === u ? I : u);
54
58
  };
55
59
  b();
56
60
  const d = new ResizeObserver(b);
57
- return d.observe(n), s && d.observe(s), () => {
61
+ return d.observe(r), s && d.observe(s), () => {
58
62
  d.disconnect();
59
63
  };
60
64
  }, [
61
- r,
65
+ n,
62
66
  H,
63
67
  R
64
68
  ]);
65
69
  const { ref: Q, heightPx: k } = $(), { ref: U, heightPx: D } = $(), N = o.rowHeight ?? 48, E = a.getRowModel().rows.length, V = o.hideHeader ? 0 : 32, _ = 12, Y = O(() => {
66
70
  if (N <= 0) return 0;
67
- const n = r ? 0 : V + D + _, s = Math.max(0, k - n);
71
+ const r = n ? 0 : V + D + _, s = Math.max(0, k - r);
68
72
  return Math.floor(s / N);
69
73
  }, [
70
- r,
74
+ n,
71
75
  D,
72
76
  V,
73
77
  _,
74
78
  N,
75
79
  k
76
- ]), T = !r && E > 0 && E <= Y, Z = p(r ? e["table-wrapper"] : T || !r && h ? e["table-wrapper--proxy-bottom"] : e["table-wrapper--proxy"], F && e["table-wrapper-fetching"], h && e["table-wrapper--no-rows"], i), { columnWindow: j } = de({
80
+ ]), T = !n && E > 0 && E <= Y, Z = p(n ? e["table-wrapper"] : T || !n && h ? e["table-wrapper--proxy-bottom"] : e["table-wrapper--proxy"], F && e["table-wrapper-fetching"], h && e["table-wrapper--no-rows"], i), { columnWindow: j } = de({
77
81
  table: a,
78
- scrollRef: r ? x : R,
82
+ scrollRef: n ? x : R,
79
83
  isMobileView: z
80
84
  });
81
85
  q(() => {
82
- const n = x.current, s = W.current, b = () => n?.style.removeProperty("--no-rows-content-height");
83
- if (!n || !h || !s) {
86
+ const r = x.current, s = W.current, b = () => r?.style.removeProperty("--no-rows-content-height");
87
+ if (!r || !h || !s) {
84
88
  b();
85
89
  return;
86
90
  }
87
- const d = () => n.style.setProperty("--no-rows-content-height", `${Math.ceil(s.getBoundingClientRect().height) + P}px`);
91
+ const d = () => r.style.setProperty("--no-rows-content-height", `${Math.ceil(s.getBoundingClientRect().height) + S}px`);
88
92
  d();
89
93
  const u = new ResizeObserver(d);
90
94
  return u.observe(s), () => {
91
95
  u.disconnect(), b();
92
96
  };
93
- }, [h, P]);
97
+ }, [h, S]);
94
98
  const A = /* @__PURE__ */ w("div", {
95
99
  className: e["table-content"],
96
100
  children: [/* @__PURE__ */ w("table", {
@@ -113,11 +117,11 @@ var Ve = (l) => {
113
117
  }), /* @__PURE__ */ t(ae, { fetching: !!F })]
114
118
  }), ee = h ? /* @__PURE__ */ t("div", {
115
119
  className: e["no-rows-overlay-container"],
116
- style: { top: P },
120
+ style: { top: S },
117
121
  children: /* @__PURE__ */ t("div", {
118
122
  ref: W,
119
123
  className: e["no-rows-overlay-content"],
120
- children: S
124
+ children: P
121
125
  })
122
126
  }) : null;
123
127
  return /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(we, {
@@ -130,12 +134,12 @@ var Ve = (l) => {
130
134
  "data-x-overflow": G ? "true" : "false",
131
135
  style: { height: y },
132
136
  children: [/* @__PURE__ */ t(ve, {
133
- enabled: r,
137
+ enabled: n,
134
138
  className: e["table-shell"],
135
139
  children: /* @__PURE__ */ w("div", {
136
140
  ref: x,
137
141
  className: Z,
138
- children: [r ? A : /* @__PURE__ */ w("div", {
142
+ children: [n ? A : /* @__PURE__ */ w("div", {
139
143
  ref: R,
140
144
  className: p(e["table-scroll"]),
141
145
  children: [
@@ -164,7 +168,7 @@ var Ve = (l) => {
164
168
  ]
165
169
  }), ee]
166
170
  })
167
- }), r && /* @__PURE__ */ t(B, {
171
+ }), n && /* @__PURE__ */ t(B, {
168
172
  table: a,
169
173
  styledTableProps: o,
170
174
  canShowStickyFooter: !0
@@ -1,55 +1,62 @@
1
- import { ACTIONS_COLUMN_ID as U } from "../types.js";
2
- import { useRootContext as se } from "../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as O } from "../types.js";
2
+ import { useRootContext as ue } from "../context/RootContext.js";
3
3
  import n from "./StyledTable.module.js";
4
- import { compact as ae } from "../../helpers/arrays.js";
5
- import W from "clsx";
6
- import { Fragment as de, useCallback as ce, useEffect as re, useMemo as g } from "react";
7
- import { Fragment as me, jsx as l, jsxs as p } from "react/jsx-runtime";
8
- import { useSortable as ge } from "@dnd-kit/sortable";
9
- import { flexRender as ue } from "@tanstack/react-table";
10
- import { CSS as fe } from "@dnd-kit/utilities";
11
- function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft: u, paddingRight: f, indexes: F } }) {
12
- const { loading: O, getRowClassName: s, rowHeight: y, onRowClick: x, expandArrow: $, enableDnd: v, disableDndForRow: j, tdClassName: N, customSubRowData: I, renderSubRows: P, defaultExpanded: K, actions: C, customActionsNode: V, textExpandArrow: E, enableMultiRowSelection: Y, enableRowSelection: q, singleSelectionRow: G } = _, w = j?.(t), { transform: J, transition: Q, setNodeRef: X, isDragging: A } = ge({
4
+ import { compact as fe } from "../../helpers/arrays.js";
5
+ import $ from "clsx";
6
+ import { Fragment as he, useCallback as j, useEffect as pe, useLayoutEffect as xe, useMemo as g, useRef as Ce, useState as Re } from "react";
7
+ import { Fragment as Se, jsx as l, jsxs as C } from "react/jsx-runtime";
8
+ import { useSortable as be } from "@dnd-kit/sortable";
9
+ import { flexRender as De } from "@tanstack/react-table";
10
+ import { CSS as ke } from "@dnd-kit/utilities";
11
+ function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft: u, paddingRight: f, indexes: N } }) {
12
+ const { loading: V, getRowClassName: s, rowHeight: h, onRowClick: R, expandArrow: Y, enableDnd: I, disableDndForRow: q, tdClassName: w, customSubRowData: B, renderSubRows: G, defaultExpanded: J, actions: S, customActionsNode: Q, textExpandArrow: A, enableMultiRowSelection: X, enableRowSelection: Z, singleSelectionRow: ee } = P, b = q?.(t), { transform: te, transition: ne, setNodeRef: H, isDragging: L } = be({
13
13
  id: t.original.id,
14
- disabled: !v || w
15
- }), Z = {
16
- transform: fe.Transform.toString(J),
17
- transition: Q,
18
- opacity: A ? 0.8 : 1,
19
- zIndex: A ? 1 : 0,
14
+ disabled: !I || b
15
+ }), ie = {
16
+ transform: ke.Transform.toString(te),
17
+ transition: ne,
18
+ opacity: L ? 0.8 : 1,
19
+ zIndex: L ? 1 : 0,
20
20
  position: "relative"
21
- }, { isResizing: ee, disableResizingFlag: te } = se();
22
- re(() => {
23
- K && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
21
+ }, { isResizing: oe, disableResizingFlag: le } = ue(), D = t.isExpanded(), p = Ce(null), [se, ae] = Re(void 0);
22
+ xe(() => {
23
+ !D && p.current && ae(p.current.cells[0]?.clientHeight ?? p.current.offsetHeight);
24
+ }, [D]);
25
+ const de = j((e) => {
26
+ p.current = e, b || H(e);
27
+ }, [b, H]), M = D ? se ?? h : h;
28
+ pe(() => {
29
+ J && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
24
30
  }, []);
25
- const B = (e) => {
26
- t.getCanExpand() && !$ && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
27
- const i = window.getSelection()?.type !== "Range" && !ee, o = x instanceof Function;
28
- !o && E && i ? t.toggleExpand() : o && i && x(e, t), te();
29
- }, ne = (e) => {
30
- e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || B(e);
31
+ const T = (e) => {
32
+ t.getCanExpand() && !Y && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
33
+ const i = window.getSelection()?.type !== "Range" && !oe, o = R instanceof Function;
34
+ !o && A && i ? t.toggleExpand() : o && i && R(e, t), le();
35
+ }, ce = (e) => {
36
+ e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || T(e);
31
37
  }, r = t.getVisibleCells().map((e, i, o) => ({
32
38
  ...e,
33
39
  left: o.slice(0, i).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
34
- })), T = g(() => r.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [r]), a = g(() => r.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
40
+ })), z = g(() => r.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [r]), a = g(() => r.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
35
41
  ...e,
36
42
  right: o.slice(i + 1).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
37
- })), [r]), L = g(() => a.some((e) => e.column.id === U), [a]), h = !!C || !!V, M = g(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), m = g(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), S = !Y && !q && G, b = t.getIsSelected() && S, R = x instanceof Function, z = F.length > 0 ? ae(F.map((e) => T[e])) : T, D = ce((e, i) => {
38
- const o = e.column.id === U, d = e.column.columnDef.fixedLeft, c = !!e.column.columnDef.fixedRight, ie = e.id === m.at(-1)?.id, oe = e.id === a.at(0)?.id && !o, le = t.isExpanded(), k = i === 0;
43
+ })), [r]), U = g(() => a.some((e) => e.column.id === O), [a]), x = !!S || !!Q, W = g(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), m = g(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), k = !X && !Z && ee, y = t.getIsSelected() && k, F = R instanceof Function, _ = N.length > 0 ? fe(N.map((e) => z[e])) : z, E = j((e, i) => {
44
+ const o = e.column.id === O, d = e.column.columnDef.fixedLeft, c = !!e.column.columnDef.fixedRight, re = e.id === m.at(-1)?.id, me = e.id === a.at(0)?.id && !o, ge = t.isExpanded(), v = i === 0;
39
45
  return /* @__PURE__ */ l("td", {
40
- className: W(n["t-cell"], R && "cursor-pointer", N, o && n["action-cell"], o && !h && n["action-cell--not-fixed"], o && h && M && n["action-cell--no-shadow"], o && h && !!C && m.length && n.shadowed, o && (s?.(t) ? s?.(t) : n["action-cell-default-background"]), d && n["fixed-cell"], c && n["fixed-right-cell"], ie && n.shadowed, oe && n["shadowed-right"], t.getIsSelected() && n.selected, d && (s?.(t) ? s?.(t) : n["fixed-cell-default-background"]), c && (s?.(t) ? s?.(t) : n["fixed-right-cell-default-background"]), le && n.expanded_row, (!!b || t.isFocused()) && n["single-selection"]),
46
+ className: $(n["t-cell"], F && "cursor-pointer", w, o && n["action-cell"], o && !x && n["action-cell--not-fixed"], o && x && W && n["action-cell--no-shadow"], o && x && !!S && m.length && n.shadowed, o && (s?.(t) ? s?.(t) : n["action-cell-default-background"]), d && n["fixed-cell"], c && n["fixed-right-cell"], re && n.shadowed, me && n["shadowed-right"], t.getIsSelected() && n.selected, d && (s?.(t) ? s?.(t) : n["fixed-cell-default-background"]), c && (s?.(t) ? s?.(t) : n["fixed-right-cell-default-background"]), ge && n.expanded_row, (!!y || t.isFocused()) && n["single-selection"]),
41
47
  style: {
42
48
  left: d ? e.left : void 0,
43
- right: c ? e.right + (L ? -1 : 0) : void 0
49
+ right: c ? e.right + (U ? -1 : 0) : void 0
44
50
  },
45
- children: /* @__PURE__ */ p("div", {
51
+ children: /* @__PURE__ */ C("div", {
46
52
  style: {
47
53
  display: "flex",
48
54
  alignItems: "center",
49
- minWidth: k ? 32 : void 0,
55
+ minWidth: v ? 32 : void 0,
56
+ minHeight: M,
50
57
  position: "relative"
51
58
  },
52
- children: [k && b && /* @__PURE__ */ l("span", {
59
+ children: [v && y && /* @__PURE__ */ l("span", {
53
60
  style: {
54
61
  display: "inline-flex",
55
62
  alignItems: "center",
@@ -58,45 +65,46 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
58
65
  top: "50%",
59
66
  transform: "translateY(-50%)"
60
67
  },
61
- children: /* @__PURE__ */ l(he, {})
68
+ children: /* @__PURE__ */ l(ye, {})
62
69
  }), /* @__PURE__ */ l("span", {
63
70
  style: {
64
- marginLeft: k && S ? 30 : 0,
71
+ marginLeft: v && k ? 30 : 0,
65
72
  width: "100%"
66
73
  },
67
- children: ue(e.column.columnDef.cell, e.getContext())
74
+ children: De(e.column.columnDef.cell, e.getContext())
68
75
  })]
69
76
  })
70
77
  }, e.id);
71
78
  }, [
72
- b,
73
- C,
74
- s,
75
- R,
76
- L,
79
+ y,
80
+ S,
77
81
  M,
82
+ s,
83
+ F,
84
+ U,
85
+ W,
78
86
  m,
79
87
  a,
80
88
  t,
81
- h,
82
- S,
83
- N
89
+ x,
90
+ k,
91
+ w
84
92
  ]);
85
- return /* @__PURE__ */ p(de, { children: [/* @__PURE__ */ p("tr", {
93
+ return /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ C("tr", {
86
94
  "aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
87
95
  tabIndex: t.isFocused() ? 0 : -1,
88
- "data-index": H,
96
+ "data-index": K,
89
97
  "data-test": t.id,
90
98
  id: t.id,
91
- className: W(n["t-row"], O && n["is-loading"], s?.(t)),
99
+ className: $(n["t-row"], V && n["is-loading"], s?.(t)),
92
100
  style: {
93
- height: y ? `${y}px` : "inherit",
94
- ...v && Z
101
+ height: h ? `${h}px` : "inherit",
102
+ ...I && ie
95
103
  },
96
- ref: w ? void 0 : X,
97
- onMouseUp: ne,
104
+ ref: de,
105
+ onMouseUp: ce,
98
106
  onMouseDown: (e) => {
99
- e.detail > 1 && !R && E && e.preventDefault();
107
+ e.detail > 1 && !F && A && e.preventDefault();
100
108
  },
101
109
  onKeyDown: (e) => {
102
110
  switch (e.key) {
@@ -108,12 +116,12 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
108
116
  t.focusPrevRow(), e.preventDefault();
109
117
  break;
110
118
  case "Enter":
111
- B(e);
119
+ T(e);
112
120
  break;
113
121
  }
114
122
  },
115
123
  children: [
116
- m.map((e, i) => D(e, i)),
124
+ m.map((e, i) => E(e, i)),
117
125
  u > 0 && /* @__PURE__ */ l("td", {
118
126
  "aria-hidden": !0,
119
127
  className: n["t-cell"],
@@ -125,7 +133,7 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
125
133
  border: "none"
126
134
  }
127
135
  }),
128
- z.map((e, i) => D(e, m.length + i)),
136
+ _.map((e, i) => E(e, m.length + i)),
129
137
  f > 0 && /* @__PURE__ */ l("td", {
130
138
  "aria-hidden": !0,
131
139
  className: n["t-cell"],
@@ -137,14 +145,14 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
137
145
  border: "none"
138
146
  }
139
147
  }),
140
- a.map((e, i) => D(e, m.length + z.length + i))
148
+ a.map((e, i) => E(e, m.length + _.length + i))
141
149
  ]
142
- }), t.getIsExpanded() && /* @__PURE__ */ l(me, { children: I && P?.({
143
- rows: I.get(t.original.id.toString()) ?? [],
150
+ }), t.getIsExpanded() && /* @__PURE__ */ l(Se, { children: B && G?.({
151
+ rows: B.get(t.original.id.toString()) ?? [],
144
152
  row: t.original
145
153
  }) })] }, t.id);
146
154
  }
147
- var he = () => /* @__PURE__ */ p("svg", {
155
+ var ye = () => /* @__PURE__ */ C("svg", {
148
156
  xmlns: "http://www.w3.org/2000/svg",
149
157
  width: "20",
150
158
  height: "20",
@@ -156,5 +164,5 @@ var he = () => /* @__PURE__ */ p("svg", {
156
164
  })]
157
165
  });
158
166
  export {
159
- ve as TableRow
167
+ Me as TableRow
160
168
  };
@@ -1,10 +1,10 @@
1
- import { EXPAND_COLUMN_ID as r } from "../../types.js";
1
+ import { EXPAND_COLUMN_ID as i } from "../../types.js";
2
2
  import { ChevronDownIcon as a } from "../../shared-components/ChevronDownIcon.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  import "@tanstack/react-table";
5
- function p(o, i) {
5
+ function f(r, o) {
6
6
  return {
7
- id: r,
7
+ id: i,
8
8
  minSize: 50,
9
9
  maxSize: 50,
10
10
  size: 50,
@@ -17,23 +17,27 @@ function p(o, i) {
17
17
  type: "button",
18
18
  "aria-label": n ? "Collapse row" : "Expand row",
19
19
  "aria-expanded": n,
20
- className: "flex w-full items-center justify-center border-0 bg-transparent outline-none focus:outline-none",
20
+ className: "flex w-full items-center justify-center border-0 bg-transparent p-0 outline-none focus:outline-none",
21
21
  onClick: () => e.row.getToggleExpandedHandler()(),
22
- style: { height: i ?? "auto" },
22
+ style: { height: o ?? "auto" },
23
23
  children: /* @__PURE__ */ t(a, {
24
+ className: "block size-6 shrink-0",
24
25
  width: 24,
25
26
  height: 24,
26
27
  style: {
27
- rotate: n ? "180deg" : "0deg",
28
- transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
29
- transitionDuration: "500ms"
28
+ transform: n ? "rotate(180deg)" : "rotate(0deg)",
29
+ transformBox: "fill-box",
30
+ transformOrigin: "center",
31
+ transitionProperty: "transform",
32
+ transitionDuration: "500ms",
33
+ transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)"
30
34
  }
31
35
  })
32
36
  }) : null;
33
37
  },
34
- fixedLeft: o
38
+ fixedLeft: r
35
39
  };
36
40
  }
37
41
  export {
38
- p as generateExpandColumn
42
+ f as generateExpandColumn
39
43
  };
@@ -1,8 +1,8 @@
1
1
  import { SHOW_FULL_TEXT_ID as i } from "../../types.js";
2
- import { ChevronDownIcon as a } from "../../shared-components/ChevronDownIcon.js";
2
+ import { ChevronDownIcon as s } from "../../shared-components/ChevronDownIcon.js";
3
3
  import { StyledButton as l } from "../../shared-components/button/StyledButton.js";
4
- import { jsx as n } from "react/jsx-runtime";
5
- function g(e, o) {
4
+ import { jsx as o } from "react/jsx-runtime";
5
+ function f(e, n) {
6
6
  return {
7
7
  id: i,
8
8
  minSize: 38,
@@ -11,24 +11,24 @@ function g(e, o) {
11
11
  enableHiding: !1,
12
12
  enableSorting: !1,
13
13
  header: () => null,
14
- cell: (r) => /* @__PURE__ */ n(s, {
14
+ cell: (r) => /* @__PURE__ */ o(u, {
15
15
  info: r,
16
- rowHeight: o
16
+ rowHeight: n
17
17
  }),
18
18
  fixedLeft: e
19
19
  };
20
20
  }
21
- function s({ info: e, rowHeight: o }) {
22
- const r = e.row.getCanExpand();
23
- return /* @__PURE__ */ n("div", {
21
+ function u({ info: e, rowHeight: n }) {
22
+ const r = e.row.getCanExpand(), a = e.row.isExpanded();
23
+ return /* @__PURE__ */ o("div", {
24
24
  className: "flex w-full items-center justify-center",
25
- style: { height: o ?? "auto" },
26
- children: /* @__PURE__ */ n(l, {
25
+ style: { height: n ?? "auto" },
26
+ children: /* @__PURE__ */ o(l, {
27
27
  dataTest: "expand-text-button",
28
28
  size: "small",
29
29
  variant: "textGray",
30
- onClick: () => {
31
- r && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
30
+ onClick: (t) => {
31
+ t.stopPropagation(), r && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
32
32
  },
33
33
  onMouseDown: (t) => {
34
34
  t.preventDefault(), t.stopPropagation();
@@ -36,13 +36,17 @@ function s({ info: e, rowHeight: o }) {
36
36
  onMouseUp: (t) => {
37
37
  t.preventDefault(), t.stopPropagation();
38
38
  },
39
- startIcon: /* @__PURE__ */ n(a, {
39
+ startIcon: /* @__PURE__ */ o(s, {
40
+ className: "block size-5 shrink-0",
40
41
  width: 20,
41
42
  height: 20,
42
43
  style: {
43
- rotate: e.row.isExpanded() ? "180deg" : "0deg",
44
- transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
44
+ transform: a ? "rotate(180deg)" : "rotate(0deg)",
45
+ transformBox: "fill-box",
46
+ transformOrigin: "center",
47
+ transitionProperty: "transform",
45
48
  transitionDuration: "500ms",
49
+ transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
46
50
  cursor: "pointer"
47
51
  }
48
52
  })
@@ -50,5 +54,5 @@ function s({ info: e, rowHeight: o }) {
50
54
  });
51
55
  }
52
56
  export {
53
- g as generateShowFullTextColumn
57
+ f as generateShowFullTextColumn
54
58
  };