asma-ui-core 3.47.3 → 3.48.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.
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Renders only the rows in view, for lists long enough that mounting all of them is the bottleneck.
4
+ *
5
+ * Lives here rather than in each consumer because `@tanstack/react-virtual` is already a dependency
6
+ * of this package (the table's column virtualizer uses it), and because the mechanism is the part
7
+ * that gets copied wrong: the spacer must carry the *full* scroll height or the scrollbar lies, rows
8
+ * must be positioned rather than laid out, and each row needs `measureElement` or variable heights
9
+ * drift. Encapsulating it keeps the virtualizer an implementation detail of this package instead of a
10
+ * dependency every app adds for itself.
11
+ *
12
+ * **This virtualizes RENDERING, not loading.** Every item must already be in memory — `items` is the
13
+ * complete list. A consumer that also wants to fetch lazily needs its own windowing on top, and
14
+ * should think hard about whether partial data still satisfies its own invariants.
15
+ *
16
+ * Variable row heights work without configuration: `estimatedItemHeight` only seeds the first paint,
17
+ * after which real heights are measured.
18
+ */
19
+ export interface VirtualizedListProps<TItem> {
20
+ items: readonly TItem[];
21
+ /** Stable identity per row. Index-based keys would remount rows on reorder and lose focus. */
22
+ getItemKey: (item: TItem, index: number) => string;
23
+ renderItem: (item: TItem, index: number) => ReactNode;
24
+ /** First-paint estimate only; real heights are measured after mount. Defaults to 48. */
25
+ estimatedItemHeight?: number;
26
+ /** Rows kept mounted beyond the viewport, so scrolling does not reveal blank space. Defaults to 8. */
27
+ overscan?: number;
28
+ /** Applied to the scroll container — give it a bounded height, or nothing can scroll. */
29
+ className?: string;
30
+ dataTest?: string;
31
+ /** Rendered instead of the list when `items` is empty. */
32
+ emptyState?: ReactNode;
33
+ }
34
+ export declare function VirtualizedList<TItem>({ className, dataTest, emptyState, estimatedItemHeight, getItemKey, items, overscan, renderItem, }: VirtualizedListProps<TItem>): React.ReactElement | null;
@@ -0,0 +1 @@
1
+ export * from './VirtualizedList';
@@ -3,6 +3,7 @@ export * from './components/data-display/badge';
3
3
  export * from './components/data-display/chip';
4
4
  export * from './components/data-display/interactive-chip';
5
5
  export * from './components/data-display/tooltip';
6
+ export * from './components/data-display/virtualized-list';
6
7
  export * from './components/icons';
7
8
  export * from './components/data-display/typography';
8
9
  export * from './components/data-display/form-label';
@@ -1,59 +1,57 @@
1
- var e = "_tbody_1bgxx_124", _ = "_expanded_row_1bgxx_187", l = "_selected_1bgxx_205", t = "_shadowed_1bgxx_234", x = "_resizer_1bgxx_288", a = "_isResizing_1bgxx_300", o = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_1bgxx_1",
3
- "table-wrapper": "_table-wrapper_1bgxx_26",
4
- "table-shell": "_table-shell_1bgxx_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_1bgxx_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_1bgxx_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_1bgxx_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_1bgxx_53",
9
- "table-scroll": "_table-scroll_1bgxx_56",
10
- "table-x--fill-height": "_table-x--fill-height_1bgxx_65",
11
- "table-x": "_table-x_1bgxx_65",
12
- "table-content": "_table-content_1bgxx_80",
13
- "table-header--sticky": "_table-header--sticky_1bgxx_85",
14
- "table-hscroll": "_table-hscroll_1bgxx_90",
15
- "table-hscroll__content": "_table-hscroll__content_1bgxx_100",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_1bgxx_103",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_1bgxx_111",
18
- "styled-table": "_styled-table_1bgxx_115",
19
- tbody: e,
20
- "loading-icon": "_loading-icon_1bgxx_129",
21
- "t-row": "_t-row_1bgxx_136",
22
- "t-cell": "_t-cell_1bgxx_136",
23
- "action-cell": "_action-cell_1bgxx_146",
24
- "fixed-cell": "_fixed-cell_1bgxx_150",
25
- "fixed-right-cell": "_fixed-right-cell_1bgxx_153",
26
- expanded_row: _,
27
- selected: l,
28
- "single-selection": "_single-selection_1bgxx_208",
29
- "action-cell--no-shadow": "_action-cell--no-shadow_1bgxx_225",
30
- "action-cell--not-fixed": "_action-cell--not-fixed_1bgxx_228",
31
- shadowed: t,
32
- "shadowed-right": "_shadowed-right_1bgxx_268",
33
- "is-loading": "_is-loading_1bgxx_272",
34
- "action-cell-default-background": "_action-cell-default-background_1bgxx_275",
35
- "fixed-cell-default-background": "_fixed-cell-default-background_1bgxx_278",
36
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_1bgxx_281",
37
- "sortable-column": "_sortable-column_1bgxx_284",
38
- resizer: x,
39
- isResizing: a,
40
- "hide-table-header": "_hide-table-header_1bgxx_312",
41
- "show-table-header": "_show-table-header_1bgxx_316",
42
- "table-header": "_table-header_1bgxx_85",
43
- "hide-header": "_hide-header_1bgxx_352",
44
- "t-cell__actions": "_t-cell__actions_1bgxx_355",
45
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_1bgxx_363",
46
- "t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_1bgxx_366",
47
- "t-cell__fixed": "_t-cell__fixed_1bgxx_373",
48
- "t-cell__fixed-right": "_t-cell__fixed-right_1bgxx_380",
49
- "sort-icon": "_sort-icon_1bgxx_387",
50
- "header-content": "_header-content_1bgxx_391",
51
- "table-footer--sticky": "_table-footer--sticky_1bgxx_406",
52
- "table-footer--inline": "_table-footer--inline_1bgxx_417",
53
- "table-bottom": "_table-bottom_1bgxx_428",
54
- "table-bottom--sticky": "_table-bottom--sticky_1bgxx_442",
55
- "cursor-not-allowed": "_cursor-not-allowed_1bgxx_446"
1
+ var t = "_tbody_tst0a_124", e = "_expanded_row_tst0a_187", a = "_selected_tst0a_205", _ = "_shadowed_tst0a_228", l = "_resizer_tst0a_282", o = "_isResizing_tst0a_294", s = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_tst0a_1",
3
+ "table-wrapper": "_table-wrapper_tst0a_26",
4
+ "table-shell": "_table-shell_tst0a_33",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_tst0a_39",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_tst0a_42",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_tst0a_43",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_tst0a_53",
9
+ "table-scroll": "_table-scroll_tst0a_56",
10
+ "table-x--fill-height": "_table-x--fill-height_tst0a_65",
11
+ "table-x": "_table-x_tst0a_65",
12
+ "table-content": "_table-content_tst0a_80",
13
+ "table-header--sticky": "_table-header--sticky_tst0a_85",
14
+ "table-hscroll": "_table-hscroll_tst0a_90",
15
+ "table-hscroll__content": "_table-hscroll__content_tst0a_100",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_tst0a_103",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_tst0a_111",
18
+ "styled-table": "_styled-table_tst0a_115",
19
+ tbody: t,
20
+ "loading-icon": "_loading-icon_tst0a_129",
21
+ "t-row": "_t-row_tst0a_136",
22
+ "t-cell": "_t-cell_tst0a_136",
23
+ "action-cell": "_action-cell_tst0a_146",
24
+ "fixed-cell": "_fixed-cell_tst0a_150",
25
+ "fixed-right-cell": "_fixed-right-cell_tst0a_153",
26
+ expanded_row: e,
27
+ selected: a,
28
+ "single-selection": "_single-selection_tst0a_208",
29
+ "action-cell--no-shadow": "_action-cell--no-shadow_tst0a_225",
30
+ shadowed: _,
31
+ "shadowed-right": "_shadowed-right_tst0a_262",
32
+ "is-loading": "_is-loading_tst0a_266",
33
+ "action-cell-default-background": "_action-cell-default-background_tst0a_269",
34
+ "fixed-cell-default-background": "_fixed-cell-default-background_tst0a_272",
35
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_tst0a_275",
36
+ "sortable-column": "_sortable-column_tst0a_278",
37
+ resizer: l,
38
+ isResizing: o,
39
+ "hide-table-header": "_hide-table-header_tst0a_306",
40
+ "show-table-header": "_show-table-header_tst0a_310",
41
+ "table-header": "_table-header_tst0a_85",
42
+ "hide-header": "_hide-header_tst0a_346",
43
+ "t-cell__actions": "_t-cell__actions_tst0a_349",
44
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_tst0a_357",
45
+ "t-cell__fixed": "_t-cell__fixed_tst0a_361",
46
+ "t-cell__fixed-right": "_t-cell__fixed-right_tst0a_368",
47
+ "sort-icon": "_sort-icon_tst0a_375",
48
+ "header-content": "_header-content_tst0a_379",
49
+ "table-footer--sticky": "_table-footer--sticky_tst0a_394",
50
+ "table-footer--inline": "_table-footer--inline_tst0a_405",
51
+ "table-bottom": "_table-bottom_tst0a_416",
52
+ "table-bottom--sticky": "_table-bottom--sticky_tst0a_430",
53
+ "cursor-not-allowed": "_cursor-not-allowed_tst0a_434"
56
54
  };
57
55
  export {
58
- o as default
56
+ s as default
59
57
  };
@@ -1,62 +1,62 @@
1
- import { ACTIONS_COLUMN_ID as O } from "../types.js";
2
- import { useRootContext as ue } from "../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as _ } from "../types.js";
2
+ import { useRootContext as me } from "../context/RootContext.js";
3
3
  import n from "./StyledTable.module.js";
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({
4
+ import { compact as ge } from "../../helpers/arrays.js";
5
+ import O from "clsx";
6
+ import { Fragment as fe, useCallback as $, useEffect as ue, useLayoutEffect as he, useMemo as g, useRef as pe, useState as xe } from "react";
7
+ import { Fragment as Re, jsx as l, jsxs as x } from "react/jsx-runtime";
8
+ import { useSortable as Ce } from "@dnd-kit/sortable";
9
+ import { flexRender as Se } from "@tanstack/react-table";
10
+ import { CSS as be } from "@dnd-kit/utilities";
11
+ function Me({ styledTableProps: j, row: t, index: P, columnWindow: { paddingLeft: f, paddingRight: u, indexes: E } }) {
12
+ const { loading: K, getRowClassName: s, rowHeight: h, onRowClick: R, expandArrow: V, enableDnd: v, disableDndForRow: Y, tdClassName: I, customSubRowData: N, renderSubRows: q, defaultExpanded: G, actions: w, textExpandArrow: H, enableMultiRowSelection: J, enableRowSelection: Q, singleSelectionRow: X } = j, C = Y?.(t), { transform: Z, transition: ee, setNodeRef: L, isDragging: M } = Ce({
13
13
  id: t.original.id,
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,
14
+ disabled: !v || C
15
+ }), te = {
16
+ transform: be.Transform.toString(Z),
17
+ transition: ee,
18
+ opacity: M ? 0.8 : 1,
19
+ zIndex: M ? 1 : 0,
20
20
  position: "relative"
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();
21
+ }, { isResizing: ne, disableResizingFlag: ie } = me(), S = t.isExpanded(), p = pe(null), [oe, le] = xe(void 0);
22
+ he(() => {
23
+ !S && p.current && le(p.current.cells[0]?.clientHeight ?? p.current.offsetHeight);
24
+ }, [S]);
25
+ const se = $((e) => {
26
+ p.current = e, C || L(e);
27
+ }, [C, L]), T = S ? oe ?? h : h;
28
+ ue(() => {
29
+ G && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
30
30
  }, []);
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
+ const B = (e) => {
32
+ t.getCanExpand() && !V && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
33
+ const i = window.getSelection()?.type !== "Range" && !ne, o = R instanceof Function;
34
+ !o && H && i ? t.toggleExpand() : o && i && R(e, t), ie();
35
+ }, ae = (e) => {
36
+ e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || B(e);
37
37
  }, r = t.getVisibleCells().map((e, i, o) => ({
38
38
  ...e,
39
39
  left: o.slice(0, i).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
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) => ({
40
+ })), A = 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) => ({
41
41
  ...e,
42
42
  right: o.slice(i + 1).reduce((d, c) => d + (c.column.getSize() ?? 0), 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;
43
+ })), [r]), z = g(() => a.some((e) => e.column.id === _), [a]), U = g(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), m = g(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), b = !J && !Q && X, D = t.getIsSelected() && b, k = R instanceof Function, W = E.length > 0 ? ge(E.map((e) => A[e])) : A, y = $((e, i) => {
44
+ const o = e.column.id === _, d = e.column.columnDef.fixedLeft, c = !!e.column.columnDef.fixedRight, de = e.id === m.at(-1)?.id, ce = e.id === a.at(0)?.id && !o, re = t.isExpanded(), F = i === 0;
45
45
  return /* @__PURE__ */ l("td", {
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"]),
46
+ className: O(n["t-cell"], k && "cursor-pointer", I, o && n["action-cell"], o && U && n["action-cell--no-shadow"], o && !!w && m.length && n.shadowed, o && (s?.(t) ? s?.(t) : n["action-cell-default-background"]), d && n["fixed-cell"], c && n["fixed-right-cell"], de && n.shadowed, ce && 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"]), re && n.expanded_row, (!!D || t.isFocused()) && n["single-selection"]),
47
47
  style: {
48
48
  left: d ? e.left : void 0,
49
- right: c ? e.right + (U ? -1 : 0) : void 0
49
+ right: c ? e.right + (z ? -1 : 0) : void 0
50
50
  },
51
- children: /* @__PURE__ */ C("div", {
51
+ children: /* @__PURE__ */ x("div", {
52
52
  style: {
53
53
  display: "flex",
54
54
  alignItems: "center",
55
- minWidth: v ? 32 : void 0,
56
- minHeight: M,
55
+ minWidth: F ? 32 : void 0,
56
+ minHeight: T,
57
57
  position: "relative"
58
58
  },
59
- children: [v && y && /* @__PURE__ */ l("span", {
59
+ children: [F && D && /* @__PURE__ */ l("span", {
60
60
  style: {
61
61
  display: "inline-flex",
62
62
  alignItems: "center",
@@ -65,46 +65,45 @@ function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft
65
65
  top: "50%",
66
66
  transform: "translateY(-50%)"
67
67
  },
68
- children: /* @__PURE__ */ l(ye, {})
68
+ children: /* @__PURE__ */ l(De, {})
69
69
  }), /* @__PURE__ */ l("span", {
70
70
  style: {
71
- marginLeft: v && k ? 30 : 0,
71
+ marginLeft: F && b ? 30 : 0,
72
72
  width: "100%"
73
73
  },
74
- children: De(e.column.columnDef.cell, e.getContext())
74
+ children: Se(e.column.columnDef.cell, e.getContext())
75
75
  })]
76
76
  })
77
77
  }, e.id);
78
78
  }, [
79
- y,
80
- S,
81
- M,
79
+ D,
80
+ w,
81
+ T,
82
82
  s,
83
- F,
83
+ k,
84
+ z,
84
85
  U,
85
- W,
86
86
  m,
87
87
  a,
88
88
  t,
89
- x,
90
- k,
91
- w
89
+ b,
90
+ I
92
91
  ]);
93
- return /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ C("tr", {
92
+ return /* @__PURE__ */ x(fe, { children: [/* @__PURE__ */ x("tr", {
94
93
  "aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
95
94
  tabIndex: t.isFocused() ? 0 : -1,
96
- "data-index": K,
95
+ "data-index": P,
97
96
  "data-test": t.id,
98
97
  id: t.id,
99
- className: $(n["t-row"], V && n["is-loading"], s?.(t)),
98
+ className: O(n["t-row"], K && n["is-loading"], s?.(t)),
100
99
  style: {
101
100
  height: h ? `${h}px` : "inherit",
102
- ...I && ie
101
+ ...v && te
103
102
  },
104
- ref: de,
105
- onMouseUp: ce,
103
+ ref: se,
104
+ onMouseUp: ae,
106
105
  onMouseDown: (e) => {
107
- e.detail > 1 && !F && A && e.preventDefault();
106
+ e.detail > 1 && !k && H && e.preventDefault();
108
107
  },
109
108
  onKeyDown: (e) => {
110
109
  switch (e.key) {
@@ -116,43 +115,43 @@ function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft
116
115
  t.focusPrevRow(), e.preventDefault();
117
116
  break;
118
117
  case "Enter":
119
- T(e);
118
+ B(e);
120
119
  break;
121
120
  }
122
121
  },
123
122
  children: [
124
- m.map((e, i) => E(e, i)),
125
- u > 0 && /* @__PURE__ */ l("td", {
123
+ m.map((e, i) => y(e, i)),
124
+ f > 0 && /* @__PURE__ */ l("td", {
126
125
  "aria-hidden": !0,
127
126
  className: n["t-cell"],
128
127
  style: {
129
- width: String(u) + "px",
130
- minWidth: String(u) + "px",
131
- maxWidth: String(u) + "px",
128
+ width: String(f) + "px",
129
+ minWidth: String(f) + "px",
130
+ maxWidth: String(f) + "px",
132
131
  padding: 0,
133
132
  border: "none"
134
133
  }
135
134
  }),
136
- _.map((e, i) => E(e, m.length + i)),
137
- f > 0 && /* @__PURE__ */ l("td", {
135
+ W.map((e, i) => y(e, m.length + i)),
136
+ u > 0 && /* @__PURE__ */ l("td", {
138
137
  "aria-hidden": !0,
139
138
  className: n["t-cell"],
140
139
  style: {
141
- width: String(f) + "px",
142
- minWidth: String(f) + "px",
143
- maxWidth: String(f) + "px",
140
+ width: String(u) + "px",
141
+ minWidth: String(u) + "px",
142
+ maxWidth: String(u) + "px",
144
143
  padding: 0,
145
144
  border: "none"
146
145
  }
147
146
  }),
148
- a.map((e, i) => E(e, m.length + _.length + i))
147
+ a.map((e, i) => y(e, m.length + W.length + i))
149
148
  ]
150
- }), t.getIsExpanded() && /* @__PURE__ */ l(Se, { children: B && G?.({
151
- rows: B.get(t.original.id.toString()) ?? [],
149
+ }), t.getIsExpanded() && /* @__PURE__ */ l(Re, { children: N && q?.({
150
+ rows: N.get(t.original.id.toString()) ?? [],
152
151
  row: t.original
153
152
  }) })] }, t.id);
154
153
  }
155
- var ye = () => /* @__PURE__ */ C("svg", {
154
+ var De = () => /* @__PURE__ */ x("svg", {
156
155
  xmlns: "http://www.w3.org/2000/svg",
157
156
  width: "20",
158
157
  height: "20",
@@ -1,8 +1,8 @@
1
1
  var a = {
2
- "actions-header-wrapper": "_actions-header-wrapper_cb1o4_1",
3
- "actions-header": "_actions-header_cb1o4_1",
4
- "pin-indicator": "_pin-indicator_cb1o4_25",
5
- "pin-icon": "_pin-icon_cb1o4_35"
2
+ "actions-header-wrapper": "_actions-header-wrapper_18ql0_1",
3
+ "actions-header": "_actions-header_18ql0_1",
4
+ "pin-indicator": "_pin-indicator_18ql0_25",
5
+ "pin-icon": "_pin-icon_18ql0_35"
6
6
  };
7
7
  export {
8
8
  a as default
@@ -1,58 +1,58 @@
1
- import { ACTIONS_COLUMN_ID as S, INTERNAL_COLUMN_IDS as y } from "../../types.js";
2
- import { useRootContext as G } from "../../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as R, INTERNAL_COLUMN_IDS as H } from "../../types.js";
2
+ import { useRootContext as v } from "../../context/RootContext.js";
3
3
  import n from "../StyledTable.module.js";
4
- import { DropUpIcon as A } from "../../shared-components/DropUpIcon.js";
5
- import { DropDownIcon as k } from "../../shared-components/DropDownIcon.js";
6
- import { getTableHeaderStyle as w } from "../../helpers/getTableHeaderStyle.js";
7
- import _ from "clsx";
8
- import { useMemo as c } from "react";
9
- import { jsx as i, jsxs as F } from "react/jsx-runtime";
10
- import { flexRender as B } from "@tanstack/react-table";
11
- function J({ styledTableProps: C, header: o, tableCanResize: D = !1, left: N, right: b, tableWidth: h }) {
12
- const { hideHeader: r = !1, enableResizing: a = !1, actions: z, customActionsNode: I } = C, { isResizing: m, enableResizingFlag: u, disableResizingFlag: d } = G(), g = o.column.columnDef.fixedLeft, f = !!o.column.columnDef.fixedRight, l = o.column.id === S, p = !!z || !!I, x = c(() => o.headerGroup.headers.some((e) => e.id === S), [o.headerGroup.headers]), H = c(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), v = c(() => o.headerGroup.headers[o.headerGroup.headers.length - (x ? 2 : 1)], [o.headerGroup.headers, x]), t = o.column.getCanSort(), R = o.column.getIsSorted(), T = t ? R === "asc" ? "ascending" : R === "desc" ? "descending" : "none" : void 0;
4
+ import { DropUpIcon as T } from "../../shared-components/DropUpIcon.js";
5
+ import { DropDownIcon as y } from "../../shared-components/DropDownIcon.js";
6
+ import { getTableHeaderStyle as G } from "../../helpers/getTableHeaderStyle.js";
7
+ import D from "clsx";
8
+ import { useMemo as l } from "react";
9
+ import { jsx as i, jsxs as w } from "react/jsx-runtime";
10
+ import { flexRender as F } from "@tanstack/react-table";
11
+ function P({ styledTableProps: S, header: o, tableCanResize: C = !1, left: _, right: b, tableWidth: N }) {
12
+ const { hideHeader: c = !1, enableResizing: r = !1 } = S, { isResizing: a, enableResizingFlag: m, disableResizingFlag: u } = v(), d = o.column.columnDef.fixedLeft, g = !!o.column.columnDef.fixedRight, f = o.column.id === R, p = l(() => o.headerGroup.headers.some((e) => e.id === R), [o.headerGroup.headers]), z = l(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), h = l(() => o.headerGroup.headers[o.headerGroup.headers.length - (p ? 2 : 1)], [o.headerGroup.headers, p]), t = o.column.getCanSort(), x = o.column.getIsSorted(), I = t ? x === "asc" ? "ascending" : x === "desc" ? "descending" : "none" : void 0;
13
13
  return /* @__PURE__ */ i("th", {
14
14
  colSpan: o.colSpan,
15
- "aria-sort": T,
16
- className: _(n["t-cell"], r && n["hide-header"], l && n["t-cell__actions"], l && !p && n["t-cell__actions--not-fixed"], l && p && H && n["t-cell__actions--no-shadow"], g && n["t-cell__fixed"], f && n["t-cell__fixed-right"]),
15
+ "aria-sort": I,
16
+ className: D(n["t-cell"], c && n["hide-header"], f && n["t-cell__actions"], f && z && n["t-cell__actions--no-shadow"], d && n["t-cell__fixed"], g && n["t-cell__fixed-right"]),
17
17
  style: {
18
- ...w({
19
- enableResizing: a,
18
+ ...G({
19
+ enableResizing: r,
20
20
  header: o,
21
- tableWidth: h
21
+ tableWidth: N
22
22
  }),
23
- ...g && { left: N },
24
- ...f && { right: b }
23
+ ...d && { left: _ },
24
+ ...g && { right: b }
25
25
  },
26
- children: /* @__PURE__ */ F("div", {
27
- className: _("flex items-center justify-start", r ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], o.column.columnDef.className),
26
+ children: /* @__PURE__ */ w("div", {
27
+ className: D("flex items-center justify-start", c ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], o.column.columnDef.className),
28
28
  role: t ? "button" : void 0,
29
29
  tabIndex: t ? 0 : void 0,
30
30
  onClick: (e) => {
31
31
  const s = o.column.getToggleSortingHandler();
32
- !m && s && s(e), d();
32
+ !a && s && s(e), u();
33
33
  },
34
34
  onKeyDown: t ? (e) => {
35
35
  if (e.key !== "Enter" && e.key !== " ") return;
36
36
  e.preventDefault();
37
37
  const s = o.column.getToggleSortingHandler();
38
- !m && s && s(e), d();
38
+ !a && s && s(e), u();
39
39
  } : void 0,
40
40
  children: [
41
41
  /* @__PURE__ */ i("div", {
42
42
  className: n["header-content"],
43
- children: B(o.column.columnDef.header, o.getContext())
43
+ children: F(o.column.columnDef.header, o.getContext())
44
44
  }),
45
45
  {
46
- asc: /* @__PURE__ */ i(A, { className: n["sort-icon"] }),
47
- desc: /* @__PURE__ */ i(k, { className: n["sort-icon"] })
46
+ asc: /* @__PURE__ */ i(T, { className: n["sort-icon"] }),
47
+ desc: /* @__PURE__ */ i(y, { className: n["sort-icon"] })
48
48
  }[o.column.getIsSorted()] ?? null,
49
- D && (a ? !0 : o.id !== v?.id) && o.column.getCanResize() && !y.includes(o.column.id) && /* @__PURE__ */ i("div", {
49
+ C && (r ? !0 : o.id !== h?.id) && o.column.getCanResize() && !H.includes(o.column.id) && /* @__PURE__ */ i("div", {
50
50
  onDoubleClick: () => o.column.resetSize(),
51
51
  onMouseDown: (e) => {
52
- e.stopPropagation(), u(), o.getResizeHandler()(e);
52
+ e.stopPropagation(), m(), o.getResizeHandler()(e);
53
53
  },
54
54
  onTouchStart: (e) => {
55
- e.stopPropagation(), u(), o.getResizeHandler()(e);
55
+ e.stopPropagation(), m(), o.getResizeHandler()(e);
56
56
  },
57
57
  className: `${n.resizer} ${o.column.getIsResizing() ? n.isResizing : ""}`
58
58
  })
@@ -61,5 +61,5 @@ function J({ styledTableProps: C, header: o, tableCanResize: D = !1, left: N, ri
61
61
  }, o.id);
62
62
  }
63
63
  export {
64
- J as TableHeaderCell
64
+ P as TableHeaderCell
65
65
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.47.3",
6
+ "version": "3.48.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",