asma-ui-core 3.127.0 → 3.127.2

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,77 +1,81 @@
1
- import { cn as m } from "../../../../helpers/cn.js";
2
- import y from "../icons/ChevronDownIcon.js";
3
- import { StyledButton as N } from "../../../inputs/button/StyledButton.js";
4
- import { StyledEmptyPage as v } from "../../../feedback/empty-page/StyledEmptyPage.js";
5
- import { StyledLoading as C } from "../../../feedback/loading/StyledLoading.js";
6
- import { StyledLink as b } from "../../../navigation/link/StyledLink.js";
7
- import { StyledWidgetTitle as I } from "../widget-title/StyledWidgetTitle.js";
1
+ import { cn as s } from "../../../../helpers/cn.js";
2
+ import N from "../icons/ChevronDownIcon.js";
3
+ import { StyledButton as b } from "../../../inputs/button/StyledButton.js";
4
+ import { StyledEmptyPage as C } from "../../../feedback/empty-page/StyledEmptyPage.js";
5
+ import { StyledLoading as I } from "../../../feedback/loading/StyledLoading.js";
6
+ import { StyledLink as v } from "../../../navigation/link/StyledLink.js";
7
+ import { StyledWidgetTitle as T } from "../widget-title/StyledWidgetTitle.js";
8
8
  import a from "./StyledWidget.module.js";
9
- import T from "../icons/ChevronUpIcon.js";
10
- import { useState as k } from "react";
11
- import { Fragment as L, jsx as e, jsxs as o } from "react/jsx-runtime";
12
- var U = ({ children: s, title: c, titleNode: h, icon: n, link: d, viewMore: t, persistKey: i, isLoading: g, isEmpty: l, emptyText: f, headerRight: x, headerRightClassName: p }) => {
13
- const [r, w] = k(() => i ? localStorage.getItem(i) === "true" : !1), u = !!d && !d.hide, S = !!t && !t.hide;
14
- return /* @__PURE__ */ o("div", {
15
- className: `${a["asma-ui-core-styled-widget"]} ${l ? a["empty-state"] : ""}`,
9
+ import k from "../icons/ChevronUpIcon.js";
10
+ import { useState as L } from "react";
11
+ import { Fragment as R, jsx as e, jsxs as i } from "react/jsx-runtime";
12
+ var V = ({ children: m, title: c, titleNode: h, icon: n, link: l, viewMore: t, persistKey: o, isLoading: g, isEmpty: r, emptyText: f, headerRight: x, headerRightClassName: p }) => {
13
+ const [d, w] = L(() => o ? localStorage.getItem(o) === "true" : !1), u = !!l && !l.hide, S = !!t && !t.hide, y = !!t?.disabled && !d && t?.disabledReason != null;
14
+ return /* @__PURE__ */ i("div", {
15
+ className: `${a["asma-ui-core-styled-widget"]} ${r ? a["empty-state"] : ""}`,
16
16
  children: [
17
- /* @__PURE__ */ o("div", {
18
- className: m(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
17
+ /* @__PURE__ */ i("div", {
18
+ className: s(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
19
19
  children: [
20
20
  n && /* @__PURE__ */ e("span", {
21
21
  className: "flex shrink-0",
22
22
  children: n
23
23
  }),
24
- h ?? /* @__PURE__ */ e(I, {
24
+ h ?? /* @__PURE__ */ e(T, {
25
25
  className: "min-w-min",
26
26
  children: c
27
27
  }),
28
28
  /* @__PURE__ */ e("div", {
29
- className: m(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
29
+ className: s(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
30
30
  children: x
31
31
  })
32
32
  ]
33
33
  }),
34
34
  /* @__PURE__ */ e("div", {
35
35
  className: a["widget-content"],
36
- children: /* @__PURE__ */ o(L, { children: [
37
- s,
38
- /* @__PURE__ */ e(C, { isLoading: g }),
39
- /* @__PURE__ */ e(v, {
40
- isEmpty: l,
36
+ children: /* @__PURE__ */ i(R, { children: [
37
+ m,
38
+ /* @__PURE__ */ e(I, { isLoading: g }),
39
+ /* @__PURE__ */ e(C, {
40
+ isEmpty: r,
41
41
  emptyText: f
42
42
  })
43
43
  ] })
44
44
  }),
45
- S && /* @__PURE__ */ o("div", {
46
- className: m(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
47
- children: [t.hide ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e(N, {
48
- disabled: t.disabled,
49
- disabledReason: t.disabledReason,
45
+ S && /* @__PURE__ */ i("div", {
46
+ className: s(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
47
+ children: [y ? /* @__PURE__ */ e("p", {
48
+ className: a["widget-all-shown"],
49
+ "data-testid": "all-items-shown",
50
+ children: t.disabledReason
51
+ }) : /* @__PURE__ */ e(b, {
50
52
  dataTest: "view-more",
51
53
  variant: "text",
52
- endIcon: r ? /* @__PURE__ */ e(T, {
54
+ disabled: !!t.disabled && !d,
55
+ disabledReason: d ? void 0 : t.disabledReason,
56
+ endIcon: d ? /* @__PURE__ */ e(k, {
53
57
  width: 20,
54
58
  height: 20
55
- }) : /* @__PURE__ */ e(y, {
59
+ }) : /* @__PURE__ */ e(N, {
56
60
  width: 20,
57
61
  height: 20
58
62
  }),
59
63
  onClick: () => {
60
- w(!r), i && localStorage.setItem(i, String(!r)), t.onClick?.();
64
+ w(!d), o && localStorage.setItem(o, String(!d)), t.onClick?.();
61
65
  },
62
- children: r ? t.viewLessText : t.viewMoreText
63
- }), u ? /* @__PURE__ */ e(b, {
66
+ children: d ? t.viewLessText : t.viewMoreText
67
+ }), u ? /* @__PURE__ */ e(v, {
64
68
  dataTest: "go-to-button",
65
69
  className: a["widget-link"],
66
70
  size: "large",
67
- href: d.href,
68
- onClick: d.onClick,
69
- content: d.content
71
+ href: l.href,
72
+ onClick: l.onClick,
73
+ content: l.content
70
74
  }) : /* @__PURE__ */ e("div", {})]
71
75
  })
72
76
  ]
73
77
  });
74
78
  };
75
79
  export {
76
- U as StyledWidget
80
+ V as StyledWidget
77
81
  };
@@ -1,12 +1,13 @@
1
1
  var e = {
2
- "asma-ui-core-styled-widget": "_asma-ui-core-styled-widget_1oj8h_1",
3
- "empty-state": "_empty-state_1oj8h_13",
4
- "widget-header": "_widget-header_1oj8h_16",
5
- "widget-header-left": "_widget-header-left_1oj8h_22",
6
- "widget-header-right": "_widget-header-right_1oj8h_28",
7
- "widget-content": "_widget-content_1oj8h_34",
8
- "widget-footer": "_widget-footer_1oj8h_44",
9
- "widget-link": "_widget-link_1oj8h_49"
2
+ "asma-ui-core-styled-widget": "_asma-ui-core-styled-widget_ehofp_1",
3
+ "empty-state": "_empty-state_ehofp_13",
4
+ "widget-header": "_widget-header_ehofp_16",
5
+ "widget-header-left": "_widget-header-left_ehofp_22",
6
+ "widget-header-right": "_widget-header-right_ehofp_28",
7
+ "widget-content": "_widget-content_ehofp_34",
8
+ "widget-footer": "_widget-footer_ehofp_44",
9
+ "widget-all-shown": "_widget-all-shown_ehofp_49",
10
+ "widget-link": "_widget-link_ehofp_59"
10
11
  };
11
12
  export {
12
13
  e as default
@@ -26,8 +26,9 @@ export interface StyledWidgetProps {
26
26
  hide?: boolean;
27
27
  disabled?: boolean;
28
28
  /**
29
- * @figmaProp none — behavioral. Why "view more" is unavailable. With `disabled` the button stays
30
- * focusable and shows the reason on hover, focus and tap (disabled-states DIS-1…DIS-4).
29
+ * Read-only helper text shown in place of View more when `disabled` is set and the list is
30
+ * collapsed (ASMA-8699). Not a control: no click, focus, hover, or tooltip. View less stays
31
+ * a button so an expanded list can still collapse.
31
32
  */
32
33
  disabledReason?: ReactNode;
33
34
  };
@@ -1,13 +1,25 @@
1
+ import { SortDirection, SortPreview } from '../../helpers/sortPreview';
1
2
  /**
2
3
  * The sort indicator slot of a sortable header (Figma "Header with sorting", the 20 × 28 `Sorting` frame).
3
- * It is decorative: `aria-sort` on the header cell carries the state. A sorted column always shows the
4
- * glyph in the primary colour; an unsorted one shows it, grey and pointing the way the next click will
5
- * sort, only while the header is hovered or keyboard-focused. The glyph is in the DOM either way; the
6
- * stylesheet gives the slot its 20px only while the column is sorted, hovered or keyboard-focused (UX, ASMA-8597,
7
- * comments 94750 and 94751), and collapses it to nothing otherwise.
4
+ * It is decorative: `aria-sort` on the header cell carries the state.
5
+ *
6
+ * It holds two glyphs, and the stylesheet shows one of them (ASMA-8597, UX round 3, 2026-11-02):
7
+ * - the **current** glyph, at rest, only while the column is sorted: its direction, in `gama-500`;
8
+ * - the **preview** glyph, while the header is hovered or keyboard-focused (`:hover`, `:focus-visible`): what the
9
+ * header will look like right after a plain click, worked out by `getSortPreview` (which mirrors TanStack's
10
+ * `toggleSorting`, multi-sort included). A sorted column whose click sorts again shows that direction, still in
11
+ * `gama-500`. One whose click removes the sort, and an unsorted one, show the grey glyph pointing the way the
12
+ * first click sorts (`getFirstSortDir()`). With Shift held the click multi-sorts instead; the preview still shows
13
+ * the plain click (a known limitation).
14
+ *
15
+ * CSS cannot know the next direction, so it comes in as a prop and is written to the DOM: both glyphs are always
16
+ * there and a data attribute says what each one is. The slot gets its 20px only while the column is sorted, hovered
17
+ * or keyboard-focused (UX, ASMA-8597, comments 94750 and 94751), and collapses to nothing otherwise.
8
18
  */
9
- export declare function SortIndicator({ sorted, nextDirection, }: {
10
- sorted: false | 'asc' | 'desc';
11
- /** Where a click sorts next: `column.getFirstSortDir()` for an unsorted column. */
12
- nextDirection: 'asc' | 'desc';
19
+ export declare function SortIndicator({ sorted, firstDirection, preview, }: {
20
+ sorted: false | SortDirection;
21
+ /** Where a first click sorts: `column.getFirstSortDir()`. */
22
+ firstDirection: SortDirection;
23
+ /** What the header looks like after a plain click: `getSortPreview(...)`. */
24
+ preview: SortPreview;
13
25
  }): JSX.Element;
@@ -0,0 +1,37 @@
1
+ export type SortDirection = 'asc' | 'desc';
2
+ /** What a sortable header previews while it is hovered or keyboard-focused. */
3
+ export interface SortPreview {
4
+ /** The way the previewed triangle points. */
5
+ direction: SortDirection;
6
+ /** `true`: the primary colour, the header will be sorted this way. `false`: grey, the unsorted look. */
7
+ primary: boolean;
8
+ }
9
+ interface SortPreviewInput {
10
+ /** `column.getIsSorted()`. */
11
+ sorted: false | SortDirection;
12
+ /** `column.getFirstSortDir()`. */
13
+ firstDirection: SortDirection;
14
+ /** `column.getNextSortingOrder()`: what a sort toggle does to this column; `false` removes it. */
15
+ nextOrder: false | SortDirection;
16
+ /** Whether this column is the last entry of the sorting state (`sorting.at(-1)`). */
17
+ isLastSortEntry: boolean;
18
+ }
19
+ /**
20
+ * What the header will look like right after a plain click (no Shift), for the hover and focus preview
21
+ * (ASMA-8597, UX round 3, 2026-11-02). It mirrors `column.toggleSorting(undefined, false)` of TanStack Table 8.21,
22
+ * which `getToggleSortingHandler` calls for a click:
23
+ *
24
+ * - A column that is not sorted previews the way its first click sorts, in grey: UX keeps the unsorted look
25
+ * (the click then sorts it that way, or replaces a sort on other columns by it).
26
+ * - A sorted column that is **not the last** entry of the sorting takes the `'replace'` branch (a plain click on
27
+ * one column of a multi-sort drops the others): the whole sorting becomes this column alone with
28
+ * `desc: nextSortingOrder === 'desc'`. It is **never removed**, so a `false` next order (the removal) becomes
29
+ * ascending, in the primary colour.
30
+ * - A sorted column that is the last (or only) entry takes the `'toggle'` branch: it flips to
31
+ * `getNextSortingOrder()`, or is removed when that is `false`, which previews as the grey first direction.
32
+ *
33
+ * Known limitation: with Shift held the click multi-sorts instead (`'add'` or `'toggle'` in place). The preview
34
+ * still shows the plain click, because a key held while hovering is not tracked.
35
+ */
36
+ export declare function getSortPreview({ sorted, firstDirection, nextOrder, isLastSortEntry }: SortPreviewInput): SortPreview;
37
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,63 +1,66 @@
1
- var e = "_tbody_zh7v2_125", _ = "_expanded_row_zh7v2_178", l = "_selected_zh7v2_203", t = "_shadowed_zh7v2_228", a = "_resizer_zh7v2_285", o = "_isResizing_zh7v2_305", r = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_zh7v2_1",
3
- "table-wrapper": "_table-wrapper_zh7v2_27",
4
- "table-shell": "_table-shell_zh7v2_34",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_zh7v2_40",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_zh7v2_43",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_zh7v2_44",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_zh7v2_54",
9
- "table-scroll": "_table-scroll_zh7v2_57",
10
- "table-x--fill-height": "_table-x--fill-height_zh7v2_66",
11
- "table-x": "_table-x_zh7v2_66",
12
- "table-content": "_table-content_zh7v2_81",
13
- "table-header--sticky": "_table-header--sticky_zh7v2_86",
14
- "table-hscroll": "_table-hscroll_zh7v2_91",
15
- "table-hscroll__content": "_table-hscroll__content_zh7v2_101",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_zh7v2_104",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_zh7v2_112",
18
- "styled-table": "_styled-table_zh7v2_116",
19
- tbody: e,
20
- "loading-icon": "_loading-icon_zh7v2_130",
21
- "t-row": "_t-row_zh7v2_137",
22
- "t-cell": "_t-cell_zh7v2_137",
23
- "action-cell": "_action-cell_zh7v2_150",
24
- "fixed-cell": "_fixed-cell_zh7v2_154",
25
- "fixed-right-cell": "_fixed-right-cell_zh7v2_157",
26
- expanded_row: _,
27
- "data-cell": "_data-cell_zh7v2_190",
28
- "select-cell": "_select-cell_zh7v2_200",
29
- selected: l,
30
- "single-selection": "_single-selection_zh7v2_206",
31
- "action-cell--no-shadow": "_action-cell--no-shadow_zh7v2_224",
32
- shadowed: t,
33
- "shadowed-right": "_shadowed-right_zh7v2_264",
34
- "is-loading": "_is-loading_zh7v2_269",
35
- "action-cell-default-background": "_action-cell-default-background_zh7v2_272",
36
- "fixed-cell-default-background": "_fixed-cell-default-background_zh7v2_275",
37
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_zh7v2_278",
38
- "sortable-column": "_sortable-column_zh7v2_281",
39
- resizer: a,
40
- isResizing: o,
41
- "hide-table-header": "_hide-table-header_zh7v2_319",
42
- "show-table-header": "_show-table-header_zh7v2_323",
43
- "table-header": "_table-header_zh7v2_86",
44
- "has-resize-zone": "_has-resize-zone_zh7v2_366",
45
- "hide-header": "_hide-header_zh7v2_369",
46
- "t-cell__actions": "_t-cell__actions_zh7v2_372",
47
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_zh7v2_381",
48
- "t-cell__fixed": "_t-cell__fixed_zh7v2_386",
49
- "t-cell__fixed-right": "_t-cell__fixed-right_zh7v2_394",
50
- "sort-indicator": "_sort-indicator_zh7v2_402",
51
- "sort-glyph": "_sort-glyph_zh7v2_412",
52
- "sort-indicator--sorted": "_sort-indicator--sorted_zh7v2_416",
53
- "header-content": "_header-content_zh7v2_447",
54
- "table-footer--sticky": "_table-footer--sticky_zh7v2_491",
55
- "table-footer--inline": "_table-footer--inline_zh7v2_502",
56
- "table-bottom": "_table-bottom_zh7v2_513",
57
- "table-bottom--sticky": "_table-bottom--sticky_zh7v2_527",
58
- "cursor-not-allowed": "_cursor-not-allowed_zh7v2_531",
59
- "select-control": "_select-control_zh7v2_535"
1
+ var l = "_tbody_romlq_125", e = "_expanded_row_romlq_178", _ = "_selected_romlq_203", o = "_shadowed_romlq_228", r = "_resizer_romlq_285", t = "_isResizing_romlq_306", a = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_romlq_1",
3
+ "table-wrapper": "_table-wrapper_romlq_27",
4
+ "table-shell": "_table-shell_romlq_34",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_romlq_40",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_romlq_43",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_romlq_44",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_romlq_54",
9
+ "table-scroll": "_table-scroll_romlq_57",
10
+ "table-x--fill-height": "_table-x--fill-height_romlq_66",
11
+ "table-x": "_table-x_romlq_66",
12
+ "table-content": "_table-content_romlq_81",
13
+ "table-header--sticky": "_table-header--sticky_romlq_86",
14
+ "table-hscroll": "_table-hscroll_romlq_91",
15
+ "table-hscroll__content": "_table-hscroll__content_romlq_101",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_romlq_104",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_romlq_112",
18
+ "styled-table": "_styled-table_romlq_116",
19
+ tbody: l,
20
+ "loading-icon": "_loading-icon_romlq_130",
21
+ "t-row": "_t-row_romlq_137",
22
+ "t-cell": "_t-cell_romlq_137",
23
+ "action-cell": "_action-cell_romlq_150",
24
+ "fixed-cell": "_fixed-cell_romlq_154",
25
+ "fixed-right-cell": "_fixed-right-cell_romlq_157",
26
+ expanded_row: e,
27
+ "data-cell": "_data-cell_romlq_190",
28
+ "select-cell": "_select-cell_romlq_200",
29
+ selected: _,
30
+ "single-selection": "_single-selection_romlq_206",
31
+ "action-cell--no-shadow": "_action-cell--no-shadow_romlq_224",
32
+ shadowed: o,
33
+ "shadowed-right": "_shadowed-right_romlq_264",
34
+ "is-loading": "_is-loading_romlq_269",
35
+ "action-cell-default-background": "_action-cell-default-background_romlq_272",
36
+ "fixed-cell-default-background": "_fixed-cell-default-background_romlq_275",
37
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_romlq_278",
38
+ "sortable-column": "_sortable-column_romlq_281",
39
+ resizer: r,
40
+ isResizing: t,
41
+ "hide-table-header": "_hide-table-header_romlq_327",
42
+ "show-table-header": "_show-table-header_romlq_331",
43
+ "table-header": "_table-header_romlq_86",
44
+ "has-resize-zone": "_has-resize-zone_romlq_374",
45
+ "hide-header": "_hide-header_romlq_377",
46
+ "t-cell__actions": "_t-cell__actions_romlq_380",
47
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_romlq_389",
48
+ "t-cell__fixed": "_t-cell__fixed_romlq_394",
49
+ "t-cell__fixed-right": "_t-cell__fixed-right_romlq_402",
50
+ "sort-indicator": "_sort-indicator_romlq_410",
51
+ "sort-glyph": "_sort-glyph_romlq_420",
52
+ "sort-indicator--sorted": "_sort-indicator--sorted_romlq_425",
53
+ "sort-glyph--current": "_sort-glyph--current_romlq_434",
54
+ "sort-indicator--preview-primary": "_sort-indicator--preview-primary_romlq_440",
55
+ "sort-glyph--preview": "_sort-glyph--preview_romlq_446",
56
+ "header-content": "_header-content_romlq_466",
57
+ "table-footer--sticky": "_table-footer--sticky_romlq_510",
58
+ "table-footer--inline": "_table-footer--inline_romlq_521",
59
+ "table-bottom": "_table-bottom_romlq_532",
60
+ "table-bottom--sticky": "_table-bottom--sticky_romlq_546",
61
+ "cursor-not-allowed": "_cursor-not-allowed_romlq_550",
62
+ "select-control": "_select-control_romlq_554"
60
63
  };
61
64
  export {
62
- r as default
65
+ a as default
63
66
  };
@@ -1,23 +1,30 @@
1
- import t from "../StyledTable.module.js";
2
- import { DropUpIcon as e } from "../../shared-components/DropUpIcon.js";
3
- import { DropDownIcon as s } from "../../shared-components/DropDownIcon.js";
4
- import c from "clsx";
5
- import { jsx as a } from "react/jsx-runtime";
6
- function h({ sorted: o, nextDirection: i }) {
7
- const r = o || i, n = r === "asc" ? e : s;
8
- return /* @__PURE__ */ a("span", {
1
+ import r from "../StyledTable.module.js";
2
+ import { DropUpIcon as s } from "../../shared-components/DropUpIcon.js";
3
+ import { DropDownIcon as n } from "../../shared-components/DropDownIcon.js";
4
+ import e from "clsx";
5
+ import { jsx as c, jsxs as m } from "react/jsx-runtime";
6
+ function g({ sorted: t, firstDirection: p, preview: o }) {
7
+ const i = t || p, a = o.primary, l = i === "asc" ? s : n, d = o.direction === "asc" ? s : n;
8
+ return /* @__PURE__ */ m("span", {
9
9
  "aria-hidden": "true",
10
- className: c(t["sort-indicator"], o && t["sort-indicator--sorted"]),
11
- "data-sort-direction": r,
12
- "data-sort-state": o || "none",
13
- children: /* @__PURE__ */ a(n, {
14
- className: t["sort-glyph"],
10
+ className: e(r["sort-indicator"], t && r["sort-indicator--sorted"], a && r["sort-indicator--preview-primary"]),
11
+ "data-sort-direction": i,
12
+ "data-sort-state": t || "none",
13
+ "data-preview-direction": o.direction,
14
+ "data-preview-tone": a ? "primary" : "neutral",
15
+ children: [/* @__PURE__ */ c(l, {
16
+ className: e(r["sort-glyph"], r["sort-glyph--current"]),
15
17
  focusable: "false",
16
18
  height: 28,
17
19
  width: 28
18
- })
20
+ }), /* @__PURE__ */ c(d, {
21
+ className: e(r["sort-glyph"], r["sort-glyph--preview"]),
22
+ focusable: "false",
23
+ height: 28,
24
+ width: 28
25
+ })]
19
26
  });
20
27
  }
21
28
  export {
22
- h as SortIndicator
29
+ g as SortIndicator
23
30
  };
@@ -1,64 +1,71 @@
1
- import { ACTIONS_COLUMN_ID as C, INTERNAL_COLUMN_IDS as R } from "../../types.js";
2
- import { useRootContext as A } from "../../context/RootContext.js";
3
- import n from "../StyledTable.module.js";
4
- import { SortIndicator as F } from "./SortIndicator.js";
5
- import { getTableHeaderStyle as L } from "../../helpers/getTableHeaderStyle.js";
1
+ import { ACTIONS_COLUMN_ID as D, INTERNAL_COLUMN_IDS as R } from "../../types.js";
2
+ import { useRootContext as L } from "../../context/RootContext.js";
3
+ import e from "../StyledTable.module.js";
4
+ import { SortIndicator as A } from "./SortIndicator.js";
5
+ import { getTableHeaderStyle as O } from "../../helpers/getTableHeaderStyle.js";
6
+ import { getSortPreview as E } from "../../helpers/sortPreview.js";
6
7
  import _ from "clsx";
7
8
  import { useMemo as c } from "react";
8
- import { jsx as l, jsxs as w } from "react/jsx-runtime";
9
- import { flexRender as M } from "@tanstack/react-table";
10
- function J({ styledTableProps: z, header: o, tableCanResize: D = !1, left: b, right: N, tableWidth: h }) {
11
- const { hideHeader: r = !1, enableResizing: a = !1, actions: H, customActionsNode: I } = z, { isResizing: m, enableResizingFlag: u, disableResizingFlag: d } = A(), g = o.column.columnDef.fixedLeft, f = !!o.column.columnDef.fixedRight, p = o.column.id === C, T = !!H || !!I, x = c(() => o.headerGroup.headers.some((e) => e.id === C), [o.headerGroup.headers]), v = c(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), y = c(() => o.headerGroup.headers[o.headerGroup.headers.length - (x ? 2 : 1)], [o.headerGroup.headers, x]), t = o.column.getCanSort(), s = o.column.getIsSorted(), G = t ? s === "asc" ? "ascending" : s === "desc" ? "descending" : "none" : void 0, S = D && (a ? !0 : o.id !== y?.id) && o.column.getCanResize() && !R.includes(o.column.id);
9
+ import { jsx as l, jsxs as M } from "react/jsx-runtime";
10
+ import { flexRender as k } from "@tanstack/react-table";
11
+ function X({ styledTableProps: z, header: o, tableCanResize: b = !1, left: N, right: v, tableWidth: H }) {
12
+ const { hideHeader: r = !1, enableResizing: m = !1, actions: I, customActionsNode: T } = z, { isResizing: a, enableResizingFlag: u, disableResizingFlag: d } = L(), g = o.column.columnDef.fixedLeft, f = !!o.column.columnDef.fixedRight, p = o.column.id === D, w = !!I || !!T, S = c(() => o.headerGroup.headers.some((t) => t.id === D), [o.headerGroup.headers]), y = c(() => o.headerGroup.headers.some((t) => !!t.column.columnDef.fixedRight), [o.headerGroup.headers]), h = c(() => o.headerGroup.headers[o.headerGroup.headers.length - (S ? 2 : 1)], [o.headerGroup.headers, S]), n = o.column.getCanSort(), s = o.column.getIsSorted(), x = o.getContext().table.getState().sorting, F = E({
13
+ sorted: s,
14
+ firstDirection: o.column.getFirstSortDir(),
15
+ nextOrder: o.column.getNextSortingOrder(),
16
+ isLastSortEntry: x[x.length - 1]?.id === o.column.id
17
+ }), G = n ? s === "asc" ? "ascending" : s === "desc" ? "descending" : "none" : void 0, C = b && (m ? !0 : o.id !== h?.id) && o.column.getCanResize() && !R.includes(o.column.id);
12
18
  return /* @__PURE__ */ l("th", {
13
19
  colSpan: o.colSpan,
14
20
  "aria-sort": G,
15
- className: _(n["t-cell"], !R.includes(o.column.id) && o.column.getSize() > 64 && n["data-cell"], o.column.id === "select" && n["select-cell"], r && n["hide-header"], p && n["t-cell__actions"], p && (!T || v) && n["t-cell__actions--no-shadow"], g && n["t-cell__fixed"], f && n["t-cell__fixed-right"]),
21
+ className: _(e["t-cell"], !R.includes(o.column.id) && o.column.getSize() > 64 && e["data-cell"], o.column.id === "select" && e["select-cell"], r && e["hide-header"], p && e["t-cell__actions"], p && (!w || y) && e["t-cell__actions--no-shadow"], g && e["t-cell__fixed"], f && e["t-cell__fixed-right"]),
16
22
  style: {
17
- ...L({
18
- enableResizing: a,
23
+ ...O({
24
+ enableResizing: m,
19
25
  header: o,
20
- tableWidth: h
26
+ tableWidth: H
21
27
  }),
22
- ...g && { left: b },
23
- ...f && { right: N }
28
+ ...g && { left: N },
29
+ ...f && { right: v }
24
30
  },
25
- children: /* @__PURE__ */ w("div", {
26
- className: _("flex items-center justify-start", r ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], S && n["has-resize-zone"], o.column.columnDef.className),
27
- role: t ? "button" : void 0,
28
- tabIndex: t ? 0 : void 0,
29
- onClick: (e) => {
31
+ children: /* @__PURE__ */ M("div", {
32
+ className: _("flex items-center justify-start", r ? e["hide-table-header"] : e["show-table-header"], n && e["sortable-column"], C && e["has-resize-zone"], o.column.columnDef.className),
33
+ role: n ? "button" : void 0,
34
+ tabIndex: n ? 0 : void 0,
35
+ onClick: (t) => {
30
36
  const i = o.column.getToggleSortingHandler();
31
- !m && i && i(e), d();
37
+ !a && i && i(t), d();
32
38
  },
33
- onKeyDown: t ? (e) => {
34
- if (e.key !== "Enter" && e.key !== " ") return;
35
- e.preventDefault();
39
+ onKeyDown: n ? (t) => {
40
+ if (t.key !== "Enter" && t.key !== " ") return;
41
+ t.preventDefault();
36
42
  const i = o.column.getToggleSortingHandler();
37
- !m && i && i(e), d();
43
+ !a && i && i(t), d();
38
44
  } : void 0,
39
45
  children: [
40
46
  /* @__PURE__ */ l("div", {
41
- className: n["header-content"],
42
- children: M(o.column.columnDef.header, o.getContext())
47
+ className: e["header-content"],
48
+ children: k(o.column.columnDef.header, o.getContext())
43
49
  }),
44
- t && /* @__PURE__ */ l(F, {
50
+ n && /* @__PURE__ */ l(A, {
45
51
  sorted: s,
46
- nextDirection: s || o.column.getFirstSortDir()
52
+ firstDirection: o.column.getFirstSortDir(),
53
+ preview: F
47
54
  }),
48
- S && /* @__PURE__ */ l("div", {
55
+ C && /* @__PURE__ */ l("div", {
49
56
  onDoubleClick: () => o.column.resetSize(),
50
- onMouseDown: (e) => {
51
- e.stopPropagation(), u(), o.getResizeHandler()(e);
57
+ onMouseDown: (t) => {
58
+ t.stopPropagation(), u(), o.getResizeHandler()(t);
52
59
  },
53
- onTouchStart: (e) => {
54
- e.stopPropagation(), u(), o.getResizeHandler()(e);
60
+ onTouchStart: (t) => {
61
+ t.stopPropagation(), u(), o.getResizeHandler()(t);
55
62
  },
56
- className: `${n.resizer} ${o.column.getIsResizing() ? n.isResizing : ""}`
63
+ className: `${e.resizer} ${o.column.getIsResizing() ? e.isResizing : ""}`
57
64
  })
58
65
  ]
59
66
  })
60
67
  }, o.id);
61
68
  }
62
69
  export {
63
- J as TableHeaderCell
70
+ X as TableHeaderCell
64
71
  };
@@ -0,0 +1,18 @@
1
+ function a({ sorted: e, firstDirection: i, nextOrder: r, isLastSortEntry: t }) {
2
+ return e ? t ? r ? {
3
+ direction: r,
4
+ primary: !0
5
+ } : {
6
+ direction: i,
7
+ primary: !1
8
+ } : {
9
+ direction: r === "desc" ? "desc" : "asc",
10
+ primary: !0
11
+ } : {
12
+ direction: i,
13
+ primary: !1
14
+ };
15
+ }
16
+ export {
17
+ a as getSortPreview
18
+ };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.127.0",
6
+ "version": "3.127.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",