asma-ui-core 3.121.6 → 3.123.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.
Files changed (65) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/module/header-layout/ToolbarRows.js +64 -60
  3. package/dist/components/custom/widget/widget/StyledWidget.js +44 -37
  4. package/dist/components/custom/widget/widget-header/StyledWidgetHeader.js +7 -7
  5. package/dist/components/custom/widget/widget-title/StyledWidgetTitle.js +8 -8
  6. package/dist/components/data-display/chip/StyledChip.js +42 -42
  7. package/dist/components/data-display/form-label/components/StyledFormLabel.js +15 -15
  8. package/dist/components/feedback/dialog/StyledDialog.js +75 -75
  9. package/dist/components/feedback/dialog/StyledDialogActions.js +4 -4
  10. package/dist/components/feedback/dialog/StyledDialogTitle.js +13 -13
  11. package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +70 -69
  12. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +69 -69
  13. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +81 -81
  14. package/dist/components/feedback/snack-bar/StyledAlert.js +16 -16
  15. package/dist/components/inputs/button/StyledButton.js +36 -35
  16. package/dist/components/inputs/input-field/StyledInputField.js +38 -38
  17. package/dist/components/inputs/search-field/StyledSearchField.js +18 -17
  18. package/dist/components/miscellaneous/StyledFormControlLabel.js +13 -13
  19. package/dist/components/navigation/link/StyledLink.js +44 -44
  20. package/dist/components/navigation/title-chevron/StyledTitleChevron.js +13 -13
  21. package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +45 -45
  22. package/dist/components/utils/popover/PopoverAnatomy.js +23 -23
  23. package/dist/hooks/useMediaQuery.hook.js +3 -2
  24. package/dist/index.js +66 -63
  25. package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +3 -1
  26. package/dist/src/hooks/useMediaQuery.hook.d.ts +2 -0
  27. package/dist/src/table/components/table-header/SortIndicator.d.ts +12 -0
  28. package/dist/src/table/custom-features/order-columns/columnLayout.d.ts +24 -0
  29. package/dist/src/table/custom-features/order-columns/columnLayout.test.d.ts +1 -0
  30. package/dist/src/table/custom-features/order-columns/types.d.ts +8 -0
  31. package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +5 -0
  32. package/dist/src/table/helpers/columnIds.d.ts +27 -0
  33. package/dist/src/table/helpers/columnIds.test.d.ts +1 -0
  34. package/dist/src/table/helpers/tableStorage.d.ts +12 -0
  35. package/dist/src/table/helpers/tableStorage.test.d.ts +1 -0
  36. package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +16 -3
  37. package/dist/src/table/hooks/useColumnSizingPersistence.test.d.ts +1 -0
  38. package/dist/src/table/hooks/usePersistedSorting.d.ts +54 -0
  39. package/dist/src/table/hooks/usePersistedSorting.test.d.ts +1 -0
  40. package/dist/src/table/hooks/usePersistedStateWriter.d.ts +30 -0
  41. package/dist/src/table/hooks/useTranslations.d.ts +6 -4
  42. package/dist/src/table/index.d.ts +1 -0
  43. package/dist/src/table/types.d.ts +9 -2
  44. package/dist/table/components/StyledTable.module.js +59 -56
  45. package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +61 -54
  46. package/dist/table/components/columns/action-column/components/TableActions.module.js +4 -4
  47. package/dist/table/components/table-header/SortIndicator.js +23 -0
  48. package/dist/table/components/table-header/TableHeader.js +30 -30
  49. package/dist/table/components/table-header/TableHeaderCell.js +30 -31
  50. package/dist/table/custom-features/order-columns/OrderColumnsFeature.js +7 -8
  51. package/dist/table/custom-features/order-columns/columnLayout.js +9 -0
  52. package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +12 -11
  53. package/dist/table/custom-features/order-columns/usePersistedColumnOrder.js +7 -12
  54. package/dist/table/helpers/columnIds.js +28 -0
  55. package/dist/table/helpers/tableStorage.js +33 -0
  56. package/dist/table/hooks/useColumnSizingPersistence.js +16 -34
  57. package/dist/table/hooks/usePersistedPageSize.js +11 -16
  58. package/dist/table/hooks/usePersistedSorting.js +58 -0
  59. package/dist/table/hooks/usePersistedStateWriter.js +36 -0
  60. package/dist/table/hooks/useStyledTable.js +90 -60
  61. package/dist/table/hooks/useTranslations.js +13 -11
  62. package/dist/table/index.js +3 -2
  63. package/dist/table/shared-components/DropDownIcon.js +4 -2
  64. package/dist/table/shared-components/DropUpIcon.js +5 -3
  65. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { CSSProperties, MouseEvent, MutableRefObject, ReactElement, ReactNode }
3
3
  import { ExpandedRow, ExpandedRowsInstance, ExpandedRowsOptions, ExpandedRowsTableState } from './custom-features/expand-rows';
4
4
  import { TooltipProps } from '../components/data-display/tooltip/StyledTooltip';
5
5
  import { FocusedRowsOptions, FocusedRowsTableState, FocusedRow, FocusedRowsInstance } from './custom-features/focus-rows';
6
- import { OrderedColumnsOptions, OrderedColumnsTableState } from './custom-features/order-columns';
6
+ import { ColumnSettingsInstance, OrderedColumnsOptions, OrderedColumnsTableState } from './custom-features/order-columns';
7
7
  import { RowSelectionTooltipOptions, RowSelectionTooltipRow } from './custom-features/row-selection-tooltip';
8
8
  export type * from '@tanstack/react-table';
9
9
  declare module '@tanstack/react-table' {
@@ -13,7 +13,7 @@ declare module '@tanstack/react-table' {
13
13
  }
14
14
  interface Row<TData extends RowData> extends ExpandedRow, FocusedRow, RowSelectionTooltipRow<TData> {
15
15
  }
16
- interface Table<TData extends RowData> extends ExpandedRowsInstance, FocusedRowsInstance {
16
+ interface Table<TData extends RowData> extends ExpandedRowsInstance, FocusedRowsInstance, ColumnSettingsInstance {
17
17
  getCoreRowModel: () => RowModel<TData>;
18
18
  }
19
19
  interface ColumnDefExtensions<TData extends RowData, TValue = unknown> extends VisibilityColumnDef, ColumnPinningColumnDef, SortingColumnDef<TData>, GroupingColumnDef<TData, TValue>, ColumnSizingColumnDef {
@@ -132,6 +132,13 @@ export type StyledTableProps<TData, TCustomData> = {
132
132
  * ensuring that the table state is persisted across sessions for the specific table instance.
133
133
  */
134
134
  uniqueKey?: string;
135
+ /**
136
+ * Temporary opt-in (ASMA-8597, owner decision D1, 2026-10-27): save and restore this table's
137
+ * sorting under `${uniqueKey}:sorting`, and let Reset columns reset it. Needs `uniqueKey`;
138
+ * ignored without it. Off by default until UX and privacy approve the fleet rollout, which
139
+ * makes `uniqueKey` alone enough and retires this prop (follow-up ASMA-8698).
140
+ */
141
+ persistSorting?: boolean;
135
142
  } & Omit<TTableOptions<TData>, 'getCoreRowModel' | 'getExpandedRowModel' | 'getFilteredRowModel' | 'getSortedRowModel'> & TFooter<TData>;
136
143
  export declare const SELECT_COLUMN_ID = "select";
137
144
  export declare const EXPAND_COLUMN_ID = "expand-column-id";
@@ -1,60 +1,63 @@
1
- var l = "_tbody_shlur_124", e = "_expanded_row_shlur_177", _ = "_selected_shlur_202", t = "_shadowed_shlur_227", r = "_resizer_shlur_284", a = "_isResizing_shlur_296", o = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_shlur_1",
3
- "table-wrapper": "_table-wrapper_shlur_26",
4
- "table-shell": "_table-shell_shlur_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_shlur_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_shlur_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_shlur_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_shlur_53",
9
- "table-scroll": "_table-scroll_shlur_56",
10
- "table-x--fill-height": "_table-x--fill-height_shlur_65",
11
- "table-x": "_table-x_shlur_65",
12
- "table-content": "_table-content_shlur_80",
13
- "table-header--sticky": "_table-header--sticky_shlur_85",
14
- "table-hscroll": "_table-hscroll_shlur_90",
15
- "table-hscroll__content": "_table-hscroll__content_shlur_100",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_shlur_103",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_shlur_111",
18
- "styled-table": "_styled-table_shlur_115",
19
- tbody: l,
20
- "loading-icon": "_loading-icon_shlur_129",
21
- "t-row": "_t-row_shlur_136",
22
- "t-cell": "_t-cell_shlur_136",
23
- "action-cell": "_action-cell_shlur_149",
24
- "fixed-cell": "_fixed-cell_shlur_153",
25
- "fixed-right-cell": "_fixed-right-cell_shlur_156",
26
- expanded_row: e,
27
- "data-cell": "_data-cell_shlur_189",
28
- "select-cell": "_select-cell_shlur_199",
29
- selected: _,
30
- "single-selection": "_single-selection_shlur_205",
31
- "action-cell--no-shadow": "_action-cell--no-shadow_shlur_223",
1
+ var e = "_tbody_w4q8k_125", _ = "_expanded_row_w4q8k_178", l = "_selected_w4q8k_203", t = "_shadowed_w4q8k_228", a = "_resizer_w4q8k_285", o = "_isResizing_w4q8k_305", r = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_w4q8k_1",
3
+ "table-wrapper": "_table-wrapper_w4q8k_27",
4
+ "table-shell": "_table-shell_w4q8k_34",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_w4q8k_40",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_w4q8k_43",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_w4q8k_44",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_w4q8k_54",
9
+ "table-scroll": "_table-scroll_w4q8k_57",
10
+ "table-x--fill-height": "_table-x--fill-height_w4q8k_66",
11
+ "table-x": "_table-x_w4q8k_66",
12
+ "table-content": "_table-content_w4q8k_81",
13
+ "table-header--sticky": "_table-header--sticky_w4q8k_86",
14
+ "table-hscroll": "_table-hscroll_w4q8k_91",
15
+ "table-hscroll__content": "_table-hscroll__content_w4q8k_101",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_w4q8k_104",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_w4q8k_112",
18
+ "styled-table": "_styled-table_w4q8k_116",
19
+ tbody: e,
20
+ "loading-icon": "_loading-icon_w4q8k_130",
21
+ "t-row": "_t-row_w4q8k_137",
22
+ "t-cell": "_t-cell_w4q8k_137",
23
+ "action-cell": "_action-cell_w4q8k_150",
24
+ "fixed-cell": "_fixed-cell_w4q8k_154",
25
+ "fixed-right-cell": "_fixed-right-cell_w4q8k_157",
26
+ expanded_row: _,
27
+ "data-cell": "_data-cell_w4q8k_190",
28
+ "select-cell": "_select-cell_w4q8k_200",
29
+ selected: l,
30
+ "single-selection": "_single-selection_w4q8k_206",
31
+ "action-cell--no-shadow": "_action-cell--no-shadow_w4q8k_224",
32
32
  shadowed: t,
33
- "shadowed-right": "_shadowed-right_shlur_263",
34
- "is-loading": "_is-loading_shlur_268",
35
- "action-cell-default-background": "_action-cell-default-background_shlur_271",
36
- "fixed-cell-default-background": "_fixed-cell-default-background_shlur_274",
37
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_shlur_277",
38
- "sortable-column": "_sortable-column_shlur_280",
39
- resizer: r,
40
- isResizing: a,
41
- "hide-table-header": "_hide-table-header_shlur_308",
42
- "show-table-header": "_show-table-header_shlur_312",
43
- "table-header": "_table-header_shlur_85",
44
- "hide-header": "_hide-header_shlur_355",
45
- "t-cell__actions": "_t-cell__actions_shlur_358",
46
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_shlur_367",
47
- "t-cell__fixed": "_t-cell__fixed_shlur_372",
48
- "t-cell__fixed-right": "_t-cell__fixed-right_shlur_380",
49
- "sort-icon": "_sort-icon_shlur_388",
50
- "header-content": "_header-content_shlur_392",
51
- "table-footer--sticky": "_table-footer--sticky_shlur_433",
52
- "table-footer--inline": "_table-footer--inline_shlur_444",
53
- "table-bottom": "_table-bottom_shlur_455",
54
- "table-bottom--sticky": "_table-bottom--sticky_shlur_469",
55
- "cursor-not-allowed": "_cursor-not-allowed_shlur_473",
56
- "select-control": "_select-control_shlur_477"
33
+ "shadowed-right": "_shadowed-right_w4q8k_264",
34
+ "is-loading": "_is-loading_w4q8k_269",
35
+ "action-cell-default-background": "_action-cell-default-background_w4q8k_272",
36
+ "fixed-cell-default-background": "_fixed-cell-default-background_w4q8k_275",
37
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_w4q8k_278",
38
+ "sortable-column": "_sortable-column_w4q8k_281",
39
+ resizer: a,
40
+ isResizing: o,
41
+ "hide-table-header": "_hide-table-header_w4q8k_319",
42
+ "show-table-header": "_show-table-header_w4q8k_323",
43
+ "table-header": "_table-header_w4q8k_86",
44
+ "has-resize-zone": "_has-resize-zone_w4q8k_366",
45
+ "hide-header": "_hide-header_w4q8k_369",
46
+ "t-cell__actions": "_t-cell__actions_w4q8k_372",
47
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_w4q8k_381",
48
+ "t-cell__fixed": "_t-cell__fixed_w4q8k_386",
49
+ "t-cell__fixed-right": "_t-cell__fixed-right_w4q8k_394",
50
+ "sort-indicator": "_sort-indicator_w4q8k_402",
51
+ "sort-glyph": "_sort-glyph_w4q8k_411",
52
+ "sort-indicator--sorted": "_sort-indicator--sorted_w4q8k_415",
53
+ "header-content": "_header-content_w4q8k_429",
54
+ "table-footer--sticky": "_table-footer--sticky_w4q8k_473",
55
+ "table-footer--inline": "_table-footer--inline_w4q8k_484",
56
+ "table-bottom": "_table-bottom_w4q8k_495",
57
+ "table-bottom--sticky": "_table-bottom--sticky_w4q8k_509",
58
+ "cursor-not-allowed": "_cursor-not-allowed_w4q8k_513",
59
+ "select-control": "_select-control_w4q8k_517"
57
60
  };
58
61
  export {
59
- o as default
62
+ r as default
60
63
  };
@@ -1,99 +1,106 @@
1
- import { cn as v } from "../../../../../helpers/cn.js";
2
- import { PinIcon as D } from "../../../../../components/icons/pin-icon/PinIcon.js";
3
- import { StyledPopover as _ } from "../../../../../components/utils/popover/StyledPopover.js";
1
+ import { cn as N } from "../../../../../helpers/cn.js";
2
+ import { StyledBadge as _ } from "../../../../../components/data-display/badge/StyledBadge.js";
3
+ import { PinIcon as v } from "../../../../../components/icons/pin-icon/PinIcon.js";
4
+ import { StyledPopover as D } from "../../../../../components/utils/popover/StyledPopover.js";
4
5
  import { message as T } from "../../../../../components/feedback/snack-bar/message.js";
5
- import { INTERNAL_COLUMN_IDS as S } from "../../../../types.js";
6
+ import { INTERNAL_COLUMN_IDS as L } from "../../../../types.js";
7
+ import { hasChangedColumnLayout as k } from "../../../../custom-features/order-columns/columnLayout.js";
6
8
  import { StyledCheckbox as A } from "../../../../shared-components/StyledCheckbox.js";
7
- import { StyledTooltip as L } from "../../../../shared-components/tooltip/index.js";
8
- import { useToggleMenuVisibility as k } from "../../../../hooks/useToggleMenuVisibility.hook.js";
9
- import m from "./TableActions.module.js";
9
+ import { StyledTooltip as I } from "../../../../shared-components/tooltip/index.js";
10
+ import { useToggleMenuVisibility as H } from "../../../../hooks/useToggleMenuVisibility.hook.js";
11
+ import f from "./TableActions.module.js";
10
12
  import d from "./HeaderActionMenu.module.js";
11
- import { DotsHorizontalIcon as H } from "../../../../shared-components/DotsHorizontalIcon.js";
12
- import { useTranslations as I } from "../../../../hooks/useTranslations.js";
13
- import { StyledButton as O } from "../../../../shared-components/button/StyledButton.js";
14
- import { compact as R } from "../../../../../helpers/arrays.js";
15
- import { jsx as o, jsxs as f } from "react/jsx-runtime";
16
- import { DndContext as V, PointerSensor as E, closestCenter as M, useSensor as P, useSensors as w } from "@dnd-kit/core";
17
- import { restrictToParentElement as W, restrictToVerticalAxis as z } from "@dnd-kit/modifiers";
18
- import { SortableContext as j, arrayMove as B, useSortable as U, verticalListSortingStrategy as Y } from "@dnd-kit/sortable";
19
- import { CSS as $ } from "@dnd-kit/utilities";
20
- function q({ id: n, disabled: u, children: p }) {
21
- const { attributes: c, listeners: h, setNodeRef: b, transform: g, transition: l } = U({
13
+ import { DotsHorizontalIcon as O } from "../../../../shared-components/DotsHorizontalIcon.js";
14
+ import { useTranslations as R } from "../../../../hooks/useTranslations.js";
15
+ import { StyledButton as w } from "../../../../shared-components/button/StyledButton.js";
16
+ import { compact as E } from "../../../../../helpers/arrays.js";
17
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
18
+ import { DndContext as M, PointerSensor as P, closestCenter as V, useSensor as W, useSensors as z } from "@dnd-kit/core";
19
+ import { restrictToParentElement as B, restrictToVerticalAxis as j } from "@dnd-kit/modifiers";
20
+ import { SortableContext as U, arrayMove as Y, useSortable as $, verticalListSortingStrategy as q } from "@dnd-kit/sortable";
21
+ import { CSS as F } from "@dnd-kit/utilities";
22
+ function G({ id: n, disabled: p, children: h }) {
23
+ const { attributes: c, listeners: b, setNodeRef: g, transform: m, transition: l } = $({
22
24
  id: n,
23
- disabled: u
25
+ disabled: p
24
26
  });
25
27
  return /* @__PURE__ */ o("div", {
26
- ref: b,
28
+ ref: g,
27
29
  style: {
28
- transform: $.Transform.toString(g),
30
+ transform: F.Transform.toString(m),
29
31
  transition: l
30
32
  },
31
33
  className: d["drag-item"],
32
- children: p({
34
+ children: h({
33
35
  attributes: c,
34
- listeners: h
36
+ listeners: b
35
37
  })
36
38
  });
37
39
  }
38
- function fe({ headerData: n, locale: u }) {
39
- const { anchorEl: p, open: c, handleClose: h, handleOpen: b } = k(), g = n.table.getAllLeafColumns().some((e) => e.getCanHide() && !e.getIsVisible() && !S.includes(e.id)), l = n.table.getAllLeafColumns(), y = (e) => {
40
+ function be({ headerData: n, locale: p }) {
41
+ const { anchorEl: h, open: c, handleClose: b, handleOpen: g } = H(), m = k(n.table), l = n.table.getAllLeafColumns(), S = (e) => {
40
42
  const { active: r, over: t } = e;
41
43
  !r || !t || r.id === t.id || l.find((i) => i.id === t.id)?.columnDef.fixedLeft || l.find((i) => i.id === t.id)?.columnDef.fixedRight || n.table.setColumnOrder((i) => {
42
- const a = R(i ?? []).length ? i : n.table.getAllLeafColumns().map((C) => C.id);
43
- return B(a, a.indexOf(r.id), a.indexOf(t.id));
44
+ const a = E(i ?? []).length ? i : n.table.getAllLeafColumns().map((C) => C.id);
45
+ return Y(a, a.indexOf(r.id), a.indexOf(t.id));
44
46
  });
45
- }, N = w(P(E, { activationConstraint: { distance: 8 } })), s = I(u), x = l.filter((e) => !S.includes(e.id) && !!e.columnDef.header);
46
- return /* @__PURE__ */ f("div", {
47
- className: m["actions-header-wrapper"],
48
- children: [/* @__PURE__ */ f("button", {
47
+ }, y = z(W(P, { activationConstraint: { distance: 8 } })), s = R(p), x = l.filter((e) => !L.includes(e.id) && !!e.columnDef.header);
48
+ return /* @__PURE__ */ u("div", {
49
+ className: f["actions-header-wrapper"],
50
+ children: [/* @__PURE__ */ u("button", {
49
51
  type: "button",
50
- "aria-label": s.column_settings,
52
+ "aria-label": m ? s.column_settings_changed : s.column_settings,
51
53
  "aria-haspopup": "true",
52
54
  "aria-expanded": c,
53
- className: m["actions-header"],
54
- onClick: b,
55
- children: [/* @__PURE__ */ o(D, { className: m["pin-icon"] }), g && /* @__PURE__ */ o("div", { className: m["pin-indicator"] })]
56
- }), /* @__PURE__ */ f(_, {
57
- anchorEl: p,
55
+ className: f["actions-header"],
56
+ onClick: g,
57
+ children: [/* @__PURE__ */ o(v, { className: f["pin-icon"] }), m && /* @__PURE__ */ o(_, {
58
+ dataTest: "column-settings-dot",
59
+ variant: "dot",
60
+ purpose: "filter",
61
+ className: f["pin-dot"]
62
+ })]
63
+ }), /* @__PURE__ */ u(D, {
64
+ anchorEl: h,
58
65
  anchorOrigin: {
59
66
  horizontal: "left",
60
67
  vertical: "bottom"
61
68
  },
62
69
  open: c,
63
- onClose: h,
70
+ onClose: b,
64
71
  slotProps: { paper: { sx: {
65
72
  maxHeight: "calc(7 * 40px)",
66
73
  overflowY: "auto",
67
74
  scrollbarWidth: "thin"
68
75
  } } },
69
- children: [/* @__PURE__ */ o(V, {
70
- modifiers: [z, W],
71
- onDragEnd: y,
72
- collisionDetection: (e) => M(e).filter((r) => {
76
+ children: [/* @__PURE__ */ o(M, {
77
+ modifiers: [j, B],
78
+ onDragEnd: S,
79
+ collisionDetection: (e) => V(e).filter((r) => {
73
80
  const t = x.find((i) => i.id === r.id);
74
81
  return !t?.columnDef.fixedLeft && !t?.columnDef.fixedRight;
75
82
  }),
76
- sensors: N,
77
- children: /* @__PURE__ */ o(j, {
83
+ sensors: y,
84
+ children: /* @__PURE__ */ o(U, {
78
85
  items: x.map((e) => e.id),
79
- strategy: Y,
86
+ strategy: q,
80
87
  children: x.map((e) => {
81
88
  const r = !!e.columnDef.fixedLeft || !!e.columnDef.fixedRight, t = e.columnDef.enableHiding === !1;
82
89
  let i = null;
83
- return r && t ? i = s.column_reorder_and_hidden : r ? i = s.column_reorder : t && (i = s.column_hidden), /* @__PURE__ */ o(q, {
90
+ return r && t ? i = s.column_reorder_and_hidden : r ? i = s.column_reorder : t && (i = s.column_hidden), /* @__PURE__ */ o(G, {
84
91
  id: e.id,
85
92
  disabled: r,
86
- children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(L, {
93
+ children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(I, {
87
94
  title: i,
88
95
  arrow: !0,
89
- children: /* @__PURE__ */ f("button", {
96
+ children: /* @__PURE__ */ u("button", {
90
97
  type: "button",
91
98
  onClick: () => {
92
99
  t || e.toggleVisibility(!e.getIsVisible());
93
100
  },
94
101
  className: d["table-action-item"],
95
102
  children: [
96
- /* @__PURE__ */ o(H, {
103
+ /* @__PURE__ */ o(O, {
97
104
  width: 20,
98
105
  height: 20,
99
106
  ...C,
@@ -104,7 +111,7 @@ function fe({ headerData: n, locale: u }) {
104
111
  userSelect: "none",
105
112
  WebkitTouchCallout: "none"
106
113
  },
107
- className: v(d["drag-icon"], r ? d["drag-icon--disabled"] : d["drag-icon--enabled"])
114
+ className: N(d["drag-icon"], r ? d["drag-icon--disabled"] : d["drag-icon--enabled"])
108
115
  }),
109
116
  /* @__PURE__ */ o("span", {
110
117
  className: "px-2",
@@ -130,19 +137,19 @@ function fe({ headerData: n, locale: u }) {
130
137
  })
131
138
  }), /* @__PURE__ */ o("div", {
132
139
  className: "pb-2 pl-2",
133
- children: /* @__PURE__ */ o(O, {
140
+ children: /* @__PURE__ */ o(w, {
134
141
  dataTest: "reset-order-button",
135
142
  variant: "text",
136
143
  className: "h-10",
137
144
  onClick: () => {
138
- n.table.resetColumnOrder(), T.info(s.column_order_reset, { closeButton: !0 });
145
+ n.table.resetColumnSettings(), T.info(s.columns_reset, { closeButton: !0 });
139
146
  },
140
- children: s.reset_order
147
+ children: s.reset_columns
141
148
  })
142
149
  })]
143
150
  })]
144
151
  });
145
152
  }
146
153
  export {
147
- fe as HeaderActionMenu
154
+ be as HeaderActionMenu
148
155
  };
@@ -1,8 +1,8 @@
1
1
  var a = {
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"
2
+ "actions-header-wrapper": "_actions-header-wrapper_f3kwf_1",
3
+ "actions-header": "_actions-header_f3kwf_1",
4
+ "pin-dot": "_pin-dot_f3kwf_25",
5
+ "pin-icon": "_pin-icon_f3kwf_31"
6
6
  };
7
7
  export {
8
8
  a as default
@@ -0,0 +1,23 @@
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", {
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"],
15
+ focusable: "false",
16
+ height: 28,
17
+ width: 28
18
+ })
19
+ });
20
+ }
21
+ export {
22
+ h as SortIndicator
23
+ };
@@ -1,43 +1,43 @@
1
- import { cn as C } from "../../../helpers/cn.js";
2
- import { ACTIONS_COLUMN_ID as I } from "../../types.js";
1
+ import { cn as k } from "../../../helpers/cn.js";
2
+ import { ACTIONS_COLUMN_ID as C } from "../../types.js";
3
3
  import x from "../StyledTable.module.js";
4
4
  import { TableHeaderCell as u } from "./TableHeaderCell.js";
5
5
  import "react";
6
- import { jsx as n, jsxs as O } from "react/jsx-runtime";
6
+ import { jsx as o, jsxs as I } from "react/jsx-runtime";
7
7
  import "@tanstack/react-table";
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, b = p.getHeaderGroups(), D = { ...g };
10
- return /* @__PURE__ */ n("thead", {
11
- className: C(x["table-header"], S && x["table-header--sticky"], o.tableHeaderClassName),
8
+ function M({ table: p, styledTableProps: n, tableCanResize: l, tableWidth: s, columnWindow: { paddingLeft: i, paddingRight: c, indexes: H } }) {
9
+ const { stickyHeader: S = !1, tableHeaderRef: g, tableHeaderStyle: y = {} } = n, b = p.getHeaderGroups(), D = { ...y };
10
+ return /* @__PURE__ */ o("thead", {
11
+ className: k(x["table-header"], S && x["table-header--sticky"], n.tableHeaderClassName),
12
12
  style: D,
13
- ref: y,
13
+ ref: g,
14
14
  children: b.map((f) => {
15
- const m = f.headers.map((e, t, r) => ({
15
+ const a = f.headers.map((e, t, r) => ({
16
16
  header: e,
17
- left: r.slice(0, t).reduce((d, a) => d + (a.column.getSize() ?? 0), 0)
18
- })), w = m.filter(({ header: e }) => e.column.columnDef.fixedLeft), N = m.filter(({ header: e }) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), h = m.filter(({ header: e }) => !!e.column.columnDef.fixedRight || e.column.id === "actions"), W = h.some(({ header: e }) => e.column.id === I), _ = h.map((e, t, r) => ({
17
+ left: r.slice(0, t).reduce((d, m) => d + (m.column.getSize() ?? 0), 0)
18
+ })), w = a.filter(({ header: e }) => e.column.columnDef.fixedLeft), N = a.filter(({ header: e }) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), h = a.filter(({ header: e }) => !!e.column.columnDef.fixedRight || e.column.id === "actions"), T = h.some(({ header: e }) => e.column.id === C), W = h.map((e, t, r) => ({
19
19
  ...e,
20
- right: r.slice(t + 1).reduce((d, a) => d + (a.header.column.getSize() ?? 0), 0) + (W ? -1 : 0)
21
- })), k = H.reduce((e, t) => {
20
+ right: r.slice(t + 1).reduce((d, m) => d + (m.header.column.getSize() ?? 0), 0) + (T ? -1 : 0)
21
+ })), _ = H.reduce((e, t) => {
22
22
  const r = N[t];
23
23
  return r && e.push(r), e;
24
24
  }, []);
25
- return /* @__PURE__ */ O("tr", {
25
+ return /* @__PURE__ */ I("tr", {
26
26
  tabIndex: 0,
27
27
  onKeyDown: (e) => {
28
- if (e.key !== "Tab" || e.shiftKey) return;
28
+ if (e.key !== "Tab" || e.shiftKey || e.defaultPrevented || e.target !== e.currentTarget) return;
29
29
  const t = e.currentTarget.closest("table")?.querySelector('tbody tr[tabindex="0"]');
30
30
  t && (e.preventDefault(), t.focus());
31
31
  },
32
32
  children: [
33
- w.map(({ header: e, left: t }) => /* @__PURE__ */ n(u, {
34
- styledTableProps: o,
33
+ w.map(({ header: e, left: t }) => /* @__PURE__ */ o(u, {
34
+ styledTableProps: n,
35
35
  header: e,
36
- tableCanResize: s,
36
+ tableCanResize: l,
37
37
  left: t,
38
- tableWidth: l
38
+ tableWidth: s
39
39
  }, e.id)),
40
- i > 0 && /* @__PURE__ */ n("th", {
40
+ i > 0 && /* @__PURE__ */ o("th", {
41
41
  "aria-hidden": !0,
42
42
  style: {
43
43
  width: String(i) + "px",
@@ -47,18 +47,18 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
47
47
  border: "none"
48
48
  }
49
49
  }),
50
- k.map((e) => {
50
+ _.map((e) => {
51
51
  if (!e) return null;
52
52
  const { header: t, left: r } = e;
53
- return /* @__PURE__ */ n(u, {
54
- styledTableProps: o,
53
+ return /* @__PURE__ */ o(u, {
54
+ styledTableProps: n,
55
55
  header: t,
56
- tableCanResize: s,
56
+ tableCanResize: l,
57
57
  left: r,
58
- tableWidth: l
58
+ tableWidth: s
59
59
  }, t.id);
60
60
  }),
61
- c > 0 && /* @__PURE__ */ n("th", {
61
+ c > 0 && /* @__PURE__ */ o("th", {
62
62
  "aria-hidden": !0,
63
63
  style: {
64
64
  width: String(c) + "px",
@@ -68,13 +68,13 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
68
68
  border: "none"
69
69
  }
70
70
  }),
71
- _.map(({ header: e, left: t, right: r }) => /* @__PURE__ */ n(u, {
72
- styledTableProps: o,
71
+ W.map(({ header: e, left: t, right: r }) => /* @__PURE__ */ o(u, {
72
+ styledTableProps: n,
73
73
  header: e,
74
- tableCanResize: s,
74
+ tableCanResize: l,
75
75
  left: t,
76
76
  right: r,
77
- tableWidth: l
77
+ tableWidth: s
78
78
  }, e.id))
79
79
  ]
80
80
  }, f.id);
@@ -1,58 +1,57 @@
1
- import { ACTIONS_COLUMN_ID as C, INTERNAL_COLUMN_IDS as S } from "../../types.js";
2
- import { useRootContext as G } from "../../context/RootContext.js";
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
3
  import n from "../StyledTable.module.js";
4
- import { DropUpIcon as A } from "../../shared-components/DropUpIcon.js";
5
- import { DropDownIcon as L } from "../../shared-components/DropDownIcon.js";
6
- import { getTableHeaderStyle as w } from "../../helpers/getTableHeaderStyle.js";
7
- import D from "clsx";
8
- import { useMemo as i } from "react";
9
- import { jsx as l, jsxs as F } from "react/jsx-runtime";
4
+ import { SortIndicator as F } from "./SortIndicator.js";
5
+ import { getTableHeaderStyle as L } from "../../helpers/getTableHeaderStyle.js";
6
+ import _ from "clsx";
7
+ import { useMemo as c } from "react";
8
+ import { jsx as l, jsxs as w } from "react/jsx-runtime";
10
9
  import { flexRender as M } from "@tanstack/react-table";
11
- function Q({ styledTableProps: R, header: o, tableCanResize: _ = !1, left: N, right: b, tableWidth: z }) {
12
- const { hideHeader: c = !1, enableResizing: r = !1, actions: I, customActionsNode: H } = R, { isResizing: a, enableResizingFlag: m, disableResizingFlag: u } = G(), d = o.column.columnDef.fixedLeft, g = !!o.column.columnDef.fixedRight, f = o.column.id === C, T = !!I || !!H, p = i(() => o.headerGroup.headers.some((e) => e.id === C), [o.headerGroup.headers]), h = i(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), v = i(() => o.headerGroup.headers[o.headerGroup.headers.length - (p ? 2 : 1)], [o.headerGroup.headers, p]), t = o.column.getCanSort(), x = o.column.getIsSorted(), y = t ? x === "asc" ? "ascending" : x === "desc" ? "descending" : "none" : void 0;
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);
13
12
  return /* @__PURE__ */ l("th", {
14
13
  colSpan: o.colSpan,
15
- "aria-sort": y,
16
- className: D(n["t-cell"], !S.includes(o.column.id) && o.column.getSize() > 64 && n["data-cell"], o.column.id === "select" && n["select-cell"], c && n["hide-header"], f && n["t-cell__actions"], f && (!T || h) && n["t-cell__actions--no-shadow"], d && n["t-cell__fixed"], g && n["t-cell__fixed-right"]),
14
+ "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"]),
17
16
  style: {
18
- ...w({
19
- enableResizing: r,
17
+ ...L({
18
+ enableResizing: a,
20
19
  header: o,
21
- tableWidth: z
20
+ tableWidth: h
22
21
  }),
23
- ...d && { left: N },
24
- ...g && { right: b }
22
+ ...g && { left: b },
23
+ ...f && { right: N }
25
24
  },
26
- children: /* @__PURE__ */ F("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),
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),
28
27
  role: t ? "button" : void 0,
29
28
  tabIndex: t ? 0 : void 0,
30
29
  onClick: (e) => {
31
- const s = o.column.getToggleSortingHandler();
32
- !a && s && s(e), u();
30
+ const i = o.column.getToggleSortingHandler();
31
+ !m && i && i(e), d();
33
32
  },
34
33
  onKeyDown: t ? (e) => {
35
34
  if (e.key !== "Enter" && e.key !== " ") return;
36
35
  e.preventDefault();
37
- const s = o.column.getToggleSortingHandler();
38
- !a && s && s(e), u();
36
+ const i = o.column.getToggleSortingHandler();
37
+ !m && i && i(e), d();
39
38
  } : void 0,
40
39
  children: [
41
40
  /* @__PURE__ */ l("div", {
42
41
  className: n["header-content"],
43
42
  children: M(o.column.columnDef.header, o.getContext())
44
43
  }),
45
- {
46
- asc: /* @__PURE__ */ l(A, { className: n["sort-icon"] }),
47
- desc: /* @__PURE__ */ l(L, { className: n["sort-icon"] })
48
- }[o.column.getIsSorted()] ?? null,
49
- _ && (r ? !0 : o.id !== v?.id) && o.column.getCanResize() && !S.includes(o.column.id) && /* @__PURE__ */ l("div", {
44
+ t && /* @__PURE__ */ l(F, {
45
+ sorted: s,
46
+ nextDirection: s || o.column.getFirstSortDir()
47
+ }),
48
+ S && /* @__PURE__ */ l("div", {
50
49
  onDoubleClick: () => o.column.resetSize(),
51
50
  onMouseDown: (e) => {
52
- e.stopPropagation(), m(), o.getResizeHandler()(e);
51
+ e.stopPropagation(), u(), o.getResizeHandler()(e);
53
52
  },
54
53
  onTouchStart: (e) => {
55
- e.stopPropagation(), m(), o.getResizeHandler()(e);
54
+ e.stopPropagation(), u(), o.getResizeHandler()(e);
56
55
  },
57
56
  className: `${n.resizer} ${o.column.getIsResizing() ? n.isResizing : ""}`
58
57
  })
@@ -61,5 +60,5 @@ function Q({ styledTableProps: R, header: o, tableCanResize: _ = !1, left: N, ri
61
60
  }, o.id);
62
61
  }
63
62
  export {
64
- Q as TableHeaderCell
63
+ J as TableHeaderCell
65
64
  };
@@ -1,20 +1,19 @@
1
- import { functionalUpdate as u, makeStateUpdater as d } from "@tanstack/react-table";
2
- var a = {
1
+ import { functionalUpdate as o, makeStateUpdater as u } from "@tanstack/react-table";
2
+ var d = {
3
3
  getInitialState: (r) => ({
4
4
  ...r,
5
5
  columnOrder: r?.columnOrder ?? []
6
6
  }),
7
- getDefaultOptions: (r) => ({ onColumnOrderChange: d("columnOrder", r) }),
7
+ getDefaultOptions: (r) => ({ onColumnOrderChange: u("columnOrder", r) }),
8
8
  createTable: (r) => {
9
- const n = r.getAllLeafColumns().map((e) => e.id);
10
9
  r.setColumnOrder = (e) => {
11
- const o = (t) => u(e, t);
12
- return r.options.onColumnOrderChange?.(o);
10
+ const n = (t) => o(e, t);
11
+ return r.options.onColumnOrderChange?.(n);
13
12
  }, r.resetColumnOrder = () => {
14
- r.setColumnOrder(n);
13
+ r.setColumnOrder([]);
15
14
  };
16
15
  }
17
16
  };
18
17
  export {
19
- a as OrderColumnsFeature
18
+ d as OrderColumnsFeature
20
19
  };