asma-ui-core 3.122.0 → 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 (41) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/index.js +66 -63
  3. package/dist/src/table/components/table-header/SortIndicator.d.ts +12 -0
  4. package/dist/src/table/custom-features/order-columns/columnLayout.d.ts +24 -0
  5. package/dist/src/table/custom-features/order-columns/columnLayout.test.d.ts +1 -0
  6. package/dist/src/table/custom-features/order-columns/types.d.ts +8 -0
  7. package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +5 -0
  8. package/dist/src/table/helpers/columnIds.d.ts +27 -0
  9. package/dist/src/table/helpers/columnIds.test.d.ts +1 -0
  10. package/dist/src/table/helpers/tableStorage.d.ts +12 -0
  11. package/dist/src/table/helpers/tableStorage.test.d.ts +1 -0
  12. package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +16 -3
  13. package/dist/src/table/hooks/useColumnSizingPersistence.test.d.ts +1 -0
  14. package/dist/src/table/hooks/usePersistedSorting.d.ts +54 -0
  15. package/dist/src/table/hooks/usePersistedSorting.test.d.ts +1 -0
  16. package/dist/src/table/hooks/usePersistedStateWriter.d.ts +30 -0
  17. package/dist/src/table/hooks/useTranslations.d.ts +6 -4
  18. package/dist/src/table/index.d.ts +1 -0
  19. package/dist/src/table/types.d.ts +9 -2
  20. package/dist/table/components/StyledTable.module.js +59 -56
  21. package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +61 -54
  22. package/dist/table/components/columns/action-column/components/TableActions.module.js +4 -4
  23. package/dist/table/components/table-header/SortIndicator.js +23 -0
  24. package/dist/table/components/table-header/TableHeader.js +30 -30
  25. package/dist/table/components/table-header/TableHeaderCell.js +30 -31
  26. package/dist/table/custom-features/order-columns/OrderColumnsFeature.js +7 -8
  27. package/dist/table/custom-features/order-columns/columnLayout.js +9 -0
  28. package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +12 -11
  29. package/dist/table/custom-features/order-columns/usePersistedColumnOrder.js +7 -12
  30. package/dist/table/helpers/columnIds.js +28 -0
  31. package/dist/table/helpers/tableStorage.js +33 -0
  32. package/dist/table/hooks/useColumnSizingPersistence.js +16 -34
  33. package/dist/table/hooks/usePersistedPageSize.js +11 -16
  34. package/dist/table/hooks/usePersistedSorting.js +58 -0
  35. package/dist/table/hooks/usePersistedStateWriter.js +36 -0
  36. package/dist/table/hooks/useStyledTable.js +90 -60
  37. package/dist/table/hooks/useTranslations.js +13 -11
  38. package/dist/table/index.js +3 -2
  39. package/dist/table/shared-components/DropDownIcon.js +4 -2
  40. package/dist/table/shared-components/DropUpIcon.js +5 -3
  41. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { INTERNAL_COLUMN_IDS as l } from "../../types.js";
2
+ var s = (e) => e.flatMap((r) => r.columns.length ? s(r.columns) : [r.id]), a = (e) => s(e.getAllColumns()), i = (e) => e.getAllLeafColumns().map((r) => r.id), o = (e, r) => e.length === r.length && e.every((n, d) => n === r[d]), f = (e) => o(i(e), a(e)), t = (e) => !l.includes(e.id) && !!e.columnDef.header, m = (e) => {
3
+ const r = new Set(e.getAllLeafColumns().filter(t).map((n) => n.id));
4
+ return !o(i(e).filter((n) => r.has(n)), a(e).filter((n) => r.has(n)));
5
+ }, u = (e) => e.getAllLeafColumns().some((r) => r.getCanHide() && !r.getIsVisible() && !l.includes(r.id)), v = (e) => u(e) || m(e);
6
+ export {
7
+ v as hasChangedColumnLayout,
8
+ f as isDefaultColumnOrder
9
+ };
@@ -1,15 +1,16 @@
1
- import { useEffect as c } from "react";
2
- function s(e, r) {
3
- const t = e.getState().columnOrder;
4
- c(() => {
5
- if (!(!r || !t))
6
- try {
7
- localStorage.setItem(r, JSON.stringify(t));
8
- } catch (o) {
9
- console.error(o);
10
- }
1
+ import { tableStorage as u } from "../../helpers/tableStorage.js";
2
+ import { isDefaultColumnOrder as i } from "./columnLayout.js";
3
+ import { useEffect as m, useRef as f } from "react";
4
+ function d(n, r) {
5
+ const o = n.getState().columnOrder, t = JSON.stringify(o ?? []), c = !o?.length || i(n), s = f(r), e = f(t);
6
+ m(() => {
7
+ if (s.current !== r) {
8
+ s.current = r, e.current = t;
9
+ return;
10
+ }
11
+ !r || t === e.current || (e.current = t, c ? u.remove(r) : u.set(r, t));
11
12
  }, [t, r]);
12
13
  }
13
14
  export {
14
- s as usePersistColumnOrder
15
+ d as usePersistColumnOrder
15
16
  };
@@ -1,15 +1,10 @@
1
- import { useMemo as o } from "react";
2
- var i = (r) => o(() => {
3
- if (r)
4
- try {
5
- const t = localStorage.getItem(r);
6
- if (!t) return;
7
- const e = JSON.parse(t);
8
- return Array.isArray(e) ? e : void 0;
9
- } catch {
10
- return;
11
- }
1
+ import { readJson as e } from "../../helpers/tableStorage.js";
2
+ import { useMemo as i } from "react";
3
+ var n = (r) => i(() => {
4
+ if (!r) return;
5
+ const o = e(r);
6
+ return Array.isArray(o) ? o.filter((t) => typeof t == "string") : void 0;
12
7
  }, [r]);
13
8
  export {
14
- i as usePersistedColumnOrder
9
+ n as usePersistedColumnOrder
15
10
  };
@@ -0,0 +1,28 @@
1
+ var i = (e) => {
2
+ const o = e.id ?? (typeof e.accessorKey == "string" && e.accessorKey ? e.accessorKey.replaceAll(".", "_") : void 0) ?? (typeof e.header == "string" ? e.header : void 0);
3
+ return o === void 0 || o === "" ? void 0 : o;
4
+ }, u = (e, o = {}) => {
5
+ const t = [], s = (l) => {
6
+ for (const r of l) {
7
+ if (r.columns?.length) {
8
+ s(r.columns);
9
+ continue;
10
+ }
11
+ const n = {
12
+ ...o.defaultColumn,
13
+ ...r
14
+ }, c = i(n);
15
+ if (c === void 0) continue;
16
+ const a = !!n.accessorFn || !!n.accessorKey;
17
+ t.push({
18
+ id: c,
19
+ canSort: (n.enableSorting ?? !0) && (o.enableSorting ?? !0) && a,
20
+ canMultiSort: n.enableMultiSort ?? o.enableMultiSort ?? a
21
+ });
22
+ }
23
+ };
24
+ return s(e), t;
25
+ };
26
+ export {
27
+ u as getLeafColumnInfos
28
+ };
@@ -0,0 +1,33 @@
1
+ var e = {
2
+ get(t) {
3
+ try {
4
+ return localStorage.getItem(t);
5
+ } catch {
6
+ return null;
7
+ }
8
+ },
9
+ set(t, r) {
10
+ try {
11
+ localStorage.setItem(t, r);
12
+ } catch {
13
+ }
14
+ },
15
+ remove(t) {
16
+ try {
17
+ localStorage.removeItem(t);
18
+ } catch {
19
+ }
20
+ }
21
+ }, a = (t) => {
22
+ const r = e.get(t);
23
+ if (r)
24
+ try {
25
+ return JSON.parse(r);
26
+ } catch {
27
+ return;
28
+ }
29
+ };
30
+ export {
31
+ a as readJson,
32
+ e as tableStorage
33
+ };
@@ -1,36 +1,18 @@
1
- import { useEffect as s, useMemo as c } from "react";
2
- var a = ":column-sizing", g = (t) => {
3
- if (t)
4
- try {
5
- const r = JSON.parse(t);
6
- return !r || typeof r != "object" || Array.isArray(r) ? void 0 : Object.fromEntries(Object.entries(r).filter((e) => typeof e[1] == "number" && Number.isFinite(e[1]) && e[1] > 0));
7
- } catch {
8
- return;
9
- }
10
- }, o = (t) => t ? `${t}${a}` : void 0, m = (t) => c(() => {
11
- const r = o(t);
12
- if (!(!r || !t))
13
- try {
14
- return g(localStorage.getItem(r));
15
- } catch {
16
- return;
17
- }
18
- }, [t]), S = (t, r) => {
19
- const e = o(r), i = t.getState().columnSizing, n = !!t.getState().columnSizingInfo.isResizingColumn;
20
- s(() => {
21
- if (!(!e || n))
22
- try {
23
- localStorage.setItem(e, JSON.stringify(i));
24
- } catch {
25
- return;
26
- }
27
- }, [
28
- i,
29
- n,
30
- e
31
- ]);
32
- };
1
+ import { readJson as n } from "../helpers/tableStorage.js";
2
+ import { useMemo as t } from "react";
3
+ var s = ":column-sizing", m = (i) => i ? `${i}${s}` : void 0, a = (i) => {
4
+ if (!(typeof i != "object" || i === null || Array.isArray(i)))
5
+ return Object.fromEntries(Object.entries(i).filter((r) => typeof r[1] == "number" && Number.isFinite(r[1]) && r[1] > 0));
6
+ }, S = (i, r) => t(() => {
7
+ const e = m(i), o = e ? a(n(e)) : void 0;
8
+ return o && {
9
+ ...r,
10
+ ...o
11
+ };
12
+ }, [i]), v = (i) => JSON.stringify(Object.entries(i).sort(([r], [e]) => r < e ? -1 : r > e ? 1 : 0)), l = (i) => JSON.stringify(i);
33
13
  export {
34
- S as usePersistColumnSizing,
35
- m as usePersistedColumnSizing
14
+ v as columnSizingSignature,
15
+ m as getColumnSizingStorageKey,
16
+ l as serializeColumnSizing,
17
+ S as usePersistedColumnSizing
36
18
  };
@@ -1,20 +1,15 @@
1
- import { useMemo as a } from "react";
2
- var i = ":page-size", s = (e) => {
1
+ import { readJson as o } from "../helpers/tableStorage.js";
2
+ import { useMemo as i } from "react";
3
+ var s = ":page-size", a = (e) => {
3
4
  if (e)
4
- return `${e}${i}`;
5
- }, n = (e) => a(() => {
6
- const t = s(e);
7
- if (t)
8
- try {
9
- const o = localStorage.getItem(t);
10
- if (!o) return;
11
- const r = JSON.parse(o);
12
- return typeof r == "number" && Number.isInteger(r) && r > 0 ? r : void 0;
13
- } catch {
14
- return;
15
- }
5
+ return `${e}${s}`;
6
+ }, d = (e) => i(() => {
7
+ const t = a(e);
8
+ if (!t) return;
9
+ const r = o(t);
10
+ return typeof r == "number" && Number.isInteger(r) && r > 0 ? r : void 0;
16
11
  }, [e]);
17
12
  export {
18
- s as getPersistedPageSizeKey,
19
- n as usePersistedPageSize
13
+ a as getPersistedPageSizeKey,
14
+ d as usePersistedPageSize
20
15
  };
@@ -0,0 +1,58 @@
1
+ import { readJson as l } from "../helpers/tableStorage.js";
2
+ import { useCallback as f, useState as m } from "react";
3
+ import { functionalUpdate as v } from "@tanstack/react-table";
4
+ var p = ":sorting", S = 1, u = [], y = (t) => t ? `${t}${p}` : void 0, d = (t) => typeof t == "object" && t !== null && !Array.isArray(t), O = (t, r) => {
5
+ if (!d(t) || t.v !== S || !Array.isArray(t.sorting)) return;
6
+ const o = t.sorting;
7
+ if (o.length === 0) return [];
8
+ const s = new Map(r.sortableColumns.map((n) => [n.id, n])), a = /* @__PURE__ */ new Set(), e = [];
9
+ for (const n of o) {
10
+ if (!d(n) || typeof n.id != "string" || typeof n.desc != "boolean") continue;
11
+ const g = s.get(n.id);
12
+ !g || a.has(n.id) || e.length > 0 && (r.enableMultiSort === !1 || !g.canMultiSort) || (a.add(n.id), e.push({
13
+ id: n.id,
14
+ desc: n.desc
15
+ }));
16
+ }
17
+ const i = r.maxMultiSortColCount, c = i !== void 0 && Number.isFinite(i) && i >= 1 ? e.slice(0, Math.floor(i)) : e;
18
+ return c.length > 0 ? c : void 0;
19
+ }, R = (t) => JSON.stringify({
20
+ v: S,
21
+ sorting: t.map(({ id: r, desc: o }) => ({
22
+ id: r,
23
+ desc: o
24
+ }))
25
+ }), A = (t) => JSON.stringify(t.map(({ id: r, desc: o }) => [r, o])), N = (t, r) => {
26
+ const o = y(t);
27
+ return o ? O(l(o), r) : void 0;
28
+ }, b = ({ sortableColumnIds: t, enableMultiSort: r, maxMultiSortColCount: o }) => ({
29
+ sortableColumns: t.map((s) => ({
30
+ id: s,
31
+ canMultiSort: !0
32
+ })),
33
+ enableMultiSort: r,
34
+ maxMultiSortColCount: o
35
+ }), h = (t, r) => N(t, b(r)), I = ({ uniqueKey: t, defaultSorting: r = u, ...o }) => {
36
+ const s = () => ({
37
+ key: t,
38
+ sorting: h(t, o) ?? r
39
+ }), [a, e] = m(s);
40
+ let i = a;
41
+ a.key !== t && (i = s(), e(i));
42
+ const c = f((n) => e((g) => ({
43
+ ...g,
44
+ sorting: v(n, g.sorting)
45
+ })), []);
46
+ return {
47
+ sorting: i.sorting,
48
+ onSortingChange: c
49
+ };
50
+ };
51
+ export {
52
+ y as getSortingStorageKey,
53
+ h as readPersistedSorting,
54
+ N as readSortingFromStorage,
55
+ R as serializeSorting,
56
+ A as sortingSignature,
57
+ I as usePersistedSorting
58
+ };
@@ -0,0 +1,36 @@
1
+ import { tableStorage as y } from "../helpers/tableStorage.js";
2
+ import { useEffect as b, useLayoutEffect as v, useRef as s } from "react";
3
+ var K = (a) => {
4
+ const { storageKey: t, state: l, defaultValue: c, saved: p, settled: f = !0, controlled: i = !1 } = a, { toSignature: o, toStorage: R, applyState: d } = a, e = o(l), g = o(c), S = s(t), u = s(e), n = s(null);
5
+ v(() => {
6
+ if (S.current === t) return;
7
+ if (S.current = t, n.current = null, u.current = e, !t) {
8
+ !i && e !== g && d(c);
9
+ return;
10
+ }
11
+ const r = p ?? c, m = o(r);
12
+ n.current = {
13
+ stale: e,
14
+ loaded: m
15
+ }, !i && m !== e && d(r);
16
+ }, [t]), b(() => {
17
+ if (!t || !f) return;
18
+ const r = n.current;
19
+ if (r) {
20
+ if (e === r.loaded) {
21
+ n.current = null, u.current = e;
22
+ return;
23
+ }
24
+ if (e === r.stale) return;
25
+ n.current = null;
26
+ }
27
+ e !== u.current && (u.current = e, e === g ? y.remove(t) : y.set(t, R(l)));
28
+ }, [
29
+ e,
30
+ t,
31
+ f
32
+ ]);
33
+ };
34
+ export {
35
+ K as usePersistedStateWriter
36
+ };
@@ -1,80 +1,110 @@
1
- import { SELECT_COLUMN_ID as y } from "../types.js";
2
- import { ExpandedRowsFeature as E } from "../custom-features/expand-rows/ExpandRowsFeature.js";
3
- import { FocusedRowsFeature as I } from "../custom-features/focus-rows/FocusRowsFeature.js";
4
- import { OrderColumnsFeature as b } from "../custom-features/order-columns/OrderColumnsFeature.js";
5
- import { usePersistColumnOrder as F } from "../custom-features/order-columns/usePersistColumnOrder.js";
6
- import { usePersistedColumnOrder as O } from "../custom-features/order-columns/usePersistedColumnOrder.js";
7
- import { getPersistedPageSizeKey as _, usePersistedPageSize as x } from "./usePersistedPageSize.js";
8
- import { usePersistColumnSizing as v, usePersistedColumnSizing as K } from "./useColumnSizingPersistence.js";
9
- import { RowSelectionTooltipFeature as L } from "../custom-features/row-selection-tooltip/RowSelectionTooltipFeature.js";
10
- import { useEffect as p, useRef as T } from "react";
11
- import { getCoreRowModel as N, getExpandedRowModel as U, getFilteredRowModel as h, getPaginationRowModel as A, getSortedRowModel as D, useReactTable as V } from "@tanstack/react-table";
12
- var Z = 100, ee = (n) => {
13
- const { columns: z, data: C, initialState: a, pageSize: w, enableRowSelection: M, tableInstanceRef: d, locale: P, persistColumnOrderKey: u, uniqueKey: l, defaultColumn: g, ...m } = n, S = O(u), c = n.enableColumnResizing ? l : void 0, f = K(c), t = x(l) ?? w ?? 50, e = V({
1
+ import { SELECT_COLUMN_ID as N } from "../types.js";
2
+ import { ExpandedRowsFeature as L } from "../custom-features/expand-rows/ExpandRowsFeature.js";
3
+ import { FocusedRowsFeature as T } from "../custom-features/focus-rows/FocusRowsFeature.js";
4
+ import { OrderColumnsFeature as U } from "../custom-features/order-columns/OrderColumnsFeature.js";
5
+ import { tableStorage as w } from "../helpers/tableStorage.js";
6
+ import { usePersistColumnOrder as V } from "../custom-features/order-columns/usePersistColumnOrder.js";
7
+ import { usePersistedColumnOrder as D } from "../custom-features/order-columns/usePersistedColumnOrder.js";
8
+ import { getPersistedPageSizeKey as Z, usePersistedPageSize as A } from "./usePersistedPageSize.js";
9
+ import { columnSizingSignature as G, getColumnSizingStorageKey as h, serializeColumnSizing as j, usePersistedColumnSizing as q } from "./useColumnSizingPersistence.js";
10
+ import { getSortingStorageKey as B, readSortingFromStorage as J, serializeSorting as W, sortingSignature as k } from "./usePersistedSorting.js";
11
+ import { usePersistedStateWriter as I } from "./usePersistedStateWriter.js";
12
+ import { RowSelectionTooltipFeature as H } from "../custom-features/row-selection-tooltip/RowSelectionTooltipFeature.js";
13
+ import { getLeafColumnInfos as Q } from "../helpers/columnIds.js";
14
+ import { useEffect as K, useMemo as X, useRef as Y } from "react";
15
+ import { getCoreRowModel as $, getExpandedRowModel as ee, getFilteredRowModel as te, getPaginationRowModel as oe, getSortedRowModel as ie, useReactTable as ne } from "@tanstack/react-table";
16
+ var re = 100, ae = [], le = {}, we = (g) => {
17
+ const { columns: c, data: O, initialState: l, pageSize: P, enableRowSelection: _, tableInstanceRef: C, locale: E, persistColumnOrderKey: u, uniqueKey: r, persistSorting: x, defaultColumn: p, ...o } = g, z = l?.sorting ?? ae, S = l?.columnSizing ?? le, R = g.enableColumnResizing ? {
18
+ minSize: re,
19
+ ...p
20
+ } : p, F = Q(c, {
21
+ defaultColumn: R,
22
+ enableSorting: o.enableSorting,
23
+ enableMultiSort: o.enableMultiSort
24
+ }), y = D(u), M = g.enableColumnResizing ? r : void 0, v = h(M), m = q(M, S), a = x ? B(r) : void 0, d = X(() => a ? J(r, {
25
+ sortableColumns: F.filter((t) => t.canSort),
26
+ maxMultiSortColCount: o.maxMultiSortColCount
27
+ }) : void 0, [a]), i = A(r) ?? P ?? 50, e = ne({
14
28
  _features: [
15
- E,
16
- I,
17
- b,
18
- L
29
+ L,
30
+ T,
31
+ U,
32
+ H
19
33
  ],
20
- columns: z,
21
- data: C,
22
- meta: { locale: P ?? "en" },
34
+ columns: c,
35
+ data: O,
36
+ meta: { locale: E ?? "en" },
23
37
  initialState: {
24
38
  pagination: {
25
39
  pageIndex: 0,
26
- pageSize: t
40
+ pageSize: i
27
41
  },
28
42
  columnVisibility: {
29
- ...a?.columnVisibility,
30
- [y]: !1
43
+ ...l?.columnVisibility,
44
+ [N]: !1
31
45
  },
32
- ...S && { columnOrder: S },
33
- ...a,
34
- ...f && { columnSizing: {
35
- ...a?.columnSizing,
36
- ...f
37
- } }
46
+ ...y && { columnOrder: y },
47
+ ...l,
48
+ ...m && { columnSizing: m },
49
+ ...d !== void 0 && { sorting: d }
38
50
  },
39
- enableRowSelection: M,
40
- getCoreRowModel: N(),
41
- getExpandedRowModel: U(),
42
- getFilteredRowModel: h(),
43
- getSortedRowModel: D(),
44
- getPaginationRowModel: A(),
45
- getRowId: m.getRowId ?? ((r, j, R) => R ? [R.id, r.id].join(".") : r.id.toString()),
46
- defaultColumn: n.enableColumnResizing ? {
47
- minSize: Z,
48
- ...g
49
- } : g,
50
- ...m
51
+ enableRowSelection: _,
52
+ getCoreRowModel: $(),
53
+ getExpandedRowModel: ee(),
54
+ getFilteredRowModel: te(),
55
+ getSortedRowModel: ie(),
56
+ getPaginationRowModel: oe(),
57
+ getRowId: o.getRowId ?? ((t, se, b) => b ? [b.id, t.id].join(".") : t.id.toString()),
58
+ defaultColumn: R,
59
+ ...o
51
60
  });
52
- d && (d.current = e), F(e, u), v(e, c);
53
- const o = _(l), i = e.getState().pagination?.pageSize, s = T(void 0);
54
- return p(() => {
55
- s.current = void 0, e.getState().pagination?.pageSize !== t && (e.setPageIndex(0), e.setPageSize(t));
61
+ C && (C.current = e), V(e, u), I({
62
+ storageKey: a,
63
+ state: e.getState().sorting,
64
+ defaultValue: z,
65
+ saved: d,
66
+ controlled: o.state?.sorting !== void 0,
67
+ toSignature: k,
68
+ toStorage: W,
69
+ applyState: (t) => e.setSorting(t)
70
+ }), I({
71
+ storageKey: v,
72
+ state: e.getState().columnSizing,
73
+ defaultValue: S,
74
+ saved: m,
75
+ settled: !e.getState().columnSizingInfo.isResizingColumn,
76
+ toSignature: G,
77
+ toStorage: j,
78
+ applyState: (t) => e.setColumnSizing(t)
79
+ }), e.resetColumnSettings = () => {
80
+ e.setColumnOrder([]), e.setColumnSizing(S), a && e.setSorting(z);
81
+ for (const t of [
82
+ a,
83
+ v,
84
+ u
85
+ ]) t && w.remove(t);
86
+ };
87
+ const n = Z(r), s = e.getState().pagination?.pageSize, f = Y(void 0);
88
+ return K(() => {
89
+ f.current = void 0, e.getState().pagination?.pageSize !== i && (e.setPageIndex(0), e.setPageSize(i));
56
90
  }, [
57
- t,
58
- o,
91
+ i,
92
+ n,
59
93
  e
60
- ]), p(() => {
61
- if (!(!o || i == null)) {
62
- if (s.current !== o) {
63
- if (i !== t) return;
64
- s.current = o;
65
- }
66
- try {
67
- localStorage.setItem(o, JSON.stringify(i));
68
- } catch (r) {
69
- console.error(r);
94
+ ]), K(() => {
95
+ if (!(!n || s == null)) {
96
+ if (f.current !== n) {
97
+ if (s !== i) return;
98
+ f.current = n;
70
99
  }
100
+ w.set(n, JSON.stringify(s));
71
101
  }
72
102
  }, [
103
+ s,
73
104
  i,
74
- t,
75
- o
105
+ n
76
106
  ]), { table: e };
77
107
  };
78
108
  export {
79
- ee as useStyledTable
109
+ we as useStyledTable
80
110
  };
@@ -1,25 +1,27 @@
1
- import { useMemo as r } from "react";
2
- var n = {
1
+ import { useMemo as o } from "react";
2
+ var e = {
3
3
  en: {
4
4
  column_reorder: "This column is fixed and can’t be reordered.",
5
5
  column_hidden: "This column is fixed and can’t be hidden.",
6
6
  column_reorder_and_hidden: "This column is fixed and can’t be reordered or hidden.",
7
- reset_order: "Reset order",
8
- column_order_reset: "Column order reset",
9
- column_settings: "Column settings"
7
+ reset_columns: "Reset columns",
8
+ columns_reset: "Columns reset",
9
+ column_settings: "Column settings",
10
+ column_settings_changed: "Column settings, changed"
10
11
  },
11
12
  no: {
12
13
  column_reorder: "Denne kolonnen er fast og kan ikke flyttes.",
13
14
  column_hidden: "Denne kolonnen er fast og kan ikke skjules.",
14
15
  column_reorder_and_hidden: "Denne kolonnen er fast og kan ikke flyttes eller skjules.",
15
- reset_order: "Tilbakestill rekkefølge",
16
- column_order_reset: "Kolonnerekkefølgen er tilbakestilt",
17
- column_settings: "Kolonneinnstillinger"
16
+ reset_columns: "Tilbakestill kolonner",
17
+ columns_reset: "Kolonnene er tilbakestilt",
18
+ column_settings: "Kolonneinnstillinger",
19
+ column_settings_changed: "Kolonneinnstillinger, endret"
18
20
  }
19
21
  };
20
- function s(e = "en") {
21
- return r(() => n[e] ?? n.en, [e]);
22
+ function l(n = "en") {
23
+ return o(() => e[n] ?? e.en, [n]);
22
24
  }
23
25
  export {
24
- s as useTranslations
26
+ l as useTranslations
25
27
  };
@@ -1,7 +1,8 @@
1
1
  import "./types.js";
2
+ import "./hooks/usePersistedSorting.js";
2
3
  import "./components/columns/dndHandleColumn.js";
3
4
  import "./components/StyledTableIndex.js";
4
- import { createColumnHelper as i } from "@tanstack/react-table";
5
+ import { createColumnHelper as S } from "@tanstack/react-table";
5
6
  export {
6
- i as createColumnHelper
7
+ S as createColumnHelper
7
8
  };
@@ -1,11 +1,13 @@
1
1
  import "react";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- function m(o) {
3
+ function l(o) {
4
4
  return /* @__PURE__ */ r("svg", {
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  width: "1rem",
7
7
  height: "1rem",
8
8
  viewBox: "0 0 24 24",
9
+ "aria-hidden": "true",
10
+ focusable: "false",
9
11
  ...o,
10
12
  children: /* @__PURE__ */ r("path", {
11
13
  fill: "currentColor",
@@ -14,5 +16,5 @@ function m(o) {
14
16
  });
15
17
  }
16
18
  export {
17
- m as DropDownIcon
19
+ l as DropDownIcon
18
20
  };
@@ -1,12 +1,14 @@
1
1
  import "react";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- function m(o) {
3
+ function l(e) {
4
4
  return /* @__PURE__ */ r("svg", {
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  width: "1rem",
7
7
  height: "1rem",
8
8
  viewBox: "0 0 24 24",
9
- ...o,
9
+ "aria-hidden": "true",
10
+ focusable: "false",
11
+ ...e,
10
12
  children: /* @__PURE__ */ r("path", {
11
13
  fill: "currentColor",
12
14
  d: "m7 14l5-5l5 5z"
@@ -14,5 +16,5 @@ function m(o) {
14
16
  });
15
17
  }
16
18
  export {
17
- m as DropUpIcon
19
+ l as DropUpIcon
18
20
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.122.0",
6
+ "version": "3.123.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",