asma-ui-core 3.122.0 → 3.123.1

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 (42) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/pathfinder-card/PathfinderCard.js +16 -16
  3. package/dist/index.js +66 -63
  4. package/dist/src/table/components/table-header/SortIndicator.d.ts +12 -0
  5. package/dist/src/table/custom-features/order-columns/columnLayout.d.ts +24 -0
  6. package/dist/src/table/custom-features/order-columns/columnLayout.test.d.ts +1 -0
  7. package/dist/src/table/custom-features/order-columns/types.d.ts +8 -0
  8. package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +5 -0
  9. package/dist/src/table/helpers/columnIds.d.ts +27 -0
  10. package/dist/src/table/helpers/columnIds.test.d.ts +1 -0
  11. package/dist/src/table/helpers/tableStorage.d.ts +12 -0
  12. package/dist/src/table/helpers/tableStorage.test.d.ts +1 -0
  13. package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +16 -3
  14. package/dist/src/table/hooks/useColumnSizingPersistence.test.d.ts +1 -0
  15. package/dist/src/table/hooks/usePersistedSorting.d.ts +54 -0
  16. package/dist/src/table/hooks/usePersistedSorting.test.d.ts +1 -0
  17. package/dist/src/table/hooks/usePersistedStateWriter.d.ts +30 -0
  18. package/dist/src/table/hooks/useTranslations.d.ts +6 -4
  19. package/dist/src/table/index.d.ts +1 -0
  20. package/dist/src/table/types.d.ts +9 -2
  21. package/dist/table/components/StyledTable.module.js +59 -56
  22. package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +61 -54
  23. package/dist/table/components/columns/action-column/components/TableActions.module.js +4 -4
  24. package/dist/table/components/table-header/SortIndicator.js +23 -0
  25. package/dist/table/components/table-header/TableHeader.js +30 -30
  26. package/dist/table/components/table-header/TableHeaderCell.js +30 -31
  27. package/dist/table/custom-features/order-columns/OrderColumnsFeature.js +7 -8
  28. package/dist/table/custom-features/order-columns/columnLayout.js +9 -0
  29. package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +12 -11
  30. package/dist/table/custom-features/order-columns/usePersistedColumnOrder.js +7 -12
  31. package/dist/table/helpers/columnIds.js +28 -0
  32. package/dist/table/helpers/tableStorage.js +33 -0
  33. package/dist/table/hooks/useColumnSizingPersistence.js +16 -34
  34. package/dist/table/hooks/usePersistedPageSize.js +11 -16
  35. package/dist/table/hooks/usePersistedSorting.js +58 -0
  36. package/dist/table/hooks/usePersistedStateWriter.js +36 -0
  37. package/dist/table/hooks/useStyledTable.js +90 -60
  38. package/dist/table/hooks/useTranslations.js +13 -11
  39. package/dist/table/index.js +3 -2
  40. package/dist/table/shared-components/DropDownIcon.js +4 -2
  41. package/dist/table/shared-components/DropUpIcon.js +5 -3
  42. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ interface PersistedStateWriterOptions<T> {
2
+ /** The entry this state is saved under; `undefined` means nothing is saved. */
3
+ storageKey: string | undefined;
4
+ /** The table's current value, controlled state included. */
5
+ state: T;
6
+ /** The app's default, taken from props on every render (never from `table.initialState`). */
7
+ defaultValue: T;
8
+ /** The current key's validated saved value; `undefined` when nothing valid is saved. */
9
+ saved: T | undefined;
10
+ /** `false` while the value is still being changed by a drag; nothing is written until it ends. */
11
+ settled?: boolean;
12
+ /** The app owns this state: a key change blocks writes but does not set the state itself. */
13
+ controlled?: boolean;
14
+ toSignature: (value: T) => string;
15
+ toStorage: (value: T) => string;
16
+ applyState: (value: T) => void;
17
+ }
18
+ /**
19
+ * The storage rule for one saved table setting (ASMA-8597, REQ-004 and REQ-005).
20
+ *
21
+ * - A value equal to the default removes the entry; any other value writes it.
22
+ * - Mounting, and loading a key, never write: only a change after that does.
23
+ * - When `storageKey` changes, the new key's values are loaded into the table state in a layout effect, and
24
+ * nothing is written or removed under the new key until the state equals what was loaded. The old key's
25
+ * entry is never touched, so the old value can't be copied over the new key.
26
+ * - When the key goes away (`undefined`), the table goes back to the app's defaults and writes nothing, so
27
+ * one user's values are not left on screen for whoever is shown next.
28
+ */
29
+ export declare const usePersistedStateWriter: <T>(options: PersistedStateWriterOptions<T>) => void;
30
+ export {};
@@ -3,17 +3,19 @@ declare const translations: {
3
3
  column_reorder: string;
4
4
  column_hidden: string;
5
5
  column_reorder_and_hidden: string;
6
- reset_order: string;
7
- column_order_reset: string;
6
+ reset_columns: string;
7
+ columns_reset: string;
8
8
  column_settings: string;
9
+ column_settings_changed: string;
9
10
  };
10
11
  no: {
11
12
  column_reorder: string;
12
13
  column_hidden: string;
13
14
  column_reorder_and_hidden: string;
14
- reset_order: string;
15
- column_order_reset: string;
15
+ reset_columns: string;
16
+ columns_reset: string;
16
17
  column_settings: string;
18
+ column_settings_changed: string;
17
19
  };
18
20
  };
19
21
  export declare function useTranslations(locale?: 'no' | 'en'): typeof translations.en;
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
2
  export * from './components/StyledTableIndex';
3
3
  export { RowDragHandleCell } from './components/columns/dndHandleColumn';
4
+ export { readPersistedSorting, usePersistedSorting, type PersistedSortingOptions, } from './hooks/usePersistedSorting';
4
5
  export { createColumnHelper, type Table, type Row, type ColumnDef, type CellContext } from '@tanstack/react-table';
@@ -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);