asma-ui-core 3.46.0 → 3.46.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.
@@ -33,14 +33,14 @@ var et = ({ dataTest: u, label: a, value: p, defaultValue: b, onChange: O, onBlu
33
33
  _.current = e instanceof HTMLTextAreaElement ? e : null;
34
34
  }, [])]), { style: E, ...Re } = c, f = !r && !d, Ee = f ? {
35
35
  boxSizing: "border-box",
36
- ...F,
37
36
  height: 40,
38
37
  minHeight: 40,
39
- maxHeight: 40
38
+ maxHeight: 40,
39
+ ...F
40
40
  } : d ? {
41
41
  boxSizing: "border-box",
42
- ...F,
43
- minHeight: 40
42
+ minHeight: 40,
43
+ ...F
44
44
  } : F, Me = f ? {
45
45
  ...E,
46
46
  height: void 0,
@@ -25,6 +25,7 @@ function x(r) {
25
25
  rowActionsState: l
26
26
  })]
27
27
  }) : null,
28
+ minSize: 50,
28
29
  size: 50,
29
30
  ...c
30
31
  };
@@ -37,7 +37,7 @@ function ce({ headerData: n, locale: p }) {
37
37
  const { anchorEl: u, open: d, handleClose: h, handleOpen: b } = L(), g = n.table.getAllLeafColumns().some((e) => e.getCanHide() && !e.getIsVisible() && !S.includes(e.id)), l = n.table.getAllLeafColumns(), y = (e) => {
38
38
  const { active: o, over: t } = e;
39
39
  !o || !t || o.id === t.id || l.find((r) => r.id === t.id)?.columnDef.fixedLeft || l.find((r) => r.id === t.id)?.columnDef.fixedRight || n.table.setColumnOrder((r) => {
40
- const s = O(r).length ? r : n.table.getAllLeafColumns().map((C) => C.id);
40
+ const s = O(r ?? []).length ? r : n.table.getAllLeafColumns().map((C) => C.id);
41
41
  return j(s, s.indexOf(o.id), s.indexOf(t.id));
42
42
  });
43
43
  }, v = P(M(V, { activationConstraint: { distance: 8 } })), c = I(p), x = l.filter((e) => !S.includes(e.id) && !!e.columnDef.header);
@@ -1,4 +1,4 @@
1
- import { DND_HANDLE_COLUMN_ID as i } from "../../types.js";
1
+ import { DND_HANDLE_COLUMN_ID as a } from "../../types.js";
2
2
  import { DotsHorizontalIcon as n } from "../../shared-components/DotsHorizontalIcon.js";
3
3
  import d from "clsx";
4
4
  import { jsx as o } from "react/jsx-runtime";
@@ -12,18 +12,20 @@ function D(r, t) {
12
12
  rowId: e.id,
13
13
  rowHeight: t
14
14
  }),
15
+ minSize: 50,
16
+ size: 50,
15
17
  ...r,
16
- id: i
18
+ id: a
17
19
  };
18
20
  }
19
21
  var m = ({ rowId: r, rowHeight: t, ...e }) => {
20
- const { attributes: l, listeners: a } = s({
22
+ const { attributes: l, listeners: i } = s({
21
23
  id: r,
22
24
  ...e
23
25
  });
24
26
  return /* @__PURE__ */ o("div", {
25
27
  ...l,
26
- ...a,
28
+ ...i,
27
29
  style: { height: t ?? "auto" },
28
30
  children: /* @__PURE__ */ o(n, {
29
31
  width: 24,
@@ -1,20 +1,20 @@
1
- import { functionalUpdate as u, makeStateUpdater as a } from "@tanstack/react-table";
2
- var m = {
3
- getInitialState: (e) => ({
4
- columnOrder: [],
5
- ...e
1
+ import { functionalUpdate as u, makeStateUpdater as d } from "@tanstack/react-table";
2
+ var a = {
3
+ getInitialState: (r) => ({
4
+ ...r,
5
+ columnOrder: r?.columnOrder ?? []
6
6
  }),
7
- getDefaultOptions: (e) => ({ onColumnOrderChange: a("columnOrder", e) }),
8
- createTable: (e) => {
9
- const n = e.getAllLeafColumns().map((r) => r.id);
10
- e.setColumnOrder = (r) => {
11
- const t = (o) => u(r, o);
12
- return e.options.onColumnOrderChange?.(t);
13
- }, e.resetColumnOrder = () => {
14
- e.setColumnOrder(n);
7
+ getDefaultOptions: (r) => ({ onColumnOrderChange: d("columnOrder", r) }),
8
+ createTable: (r) => {
9
+ const n = r.getAllLeafColumns().map((e) => e.id);
10
+ r.setColumnOrder = (e) => {
11
+ const o = (t) => u(e, t);
12
+ return r.options.onColumnOrderChange?.(o);
13
+ }, r.resetColumnOrder = () => {
14
+ r.setColumnOrder(n);
15
15
  };
16
16
  }
17
17
  };
18
18
  export {
19
- m as OrderColumnsFeature
19
+ a as OrderColumnsFeature
20
20
  };
@@ -1,5 +1,5 @@
1
- import { useEffect as a, useMemo as c } from "react";
2
- var g = ":column-sizing", n = (t) => {
1
+ import { useEffect as s, useMemo as c } from "react";
2
+ var a = ":column-sizing", g = (t) => {
3
3
  if (t)
4
4
  try {
5
5
  const r = JSON.parse(t);
@@ -7,18 +7,18 @@ var g = ":column-sizing", n = (t) => {
7
7
  } catch {
8
8
  return;
9
9
  }
10
- }, s = (t) => t ? `${t}${g}` : void 0, l = (t) => c(() => {
11
- const r = s(t);
10
+ }, o = (t) => t ? `${t}${a}` : void 0, m = (t) => c(() => {
11
+ const r = o(t);
12
12
  if (!(!r || !t))
13
13
  try {
14
- return n(localStorage.getItem(r)) ?? n(localStorage.getItem(t));
14
+ return g(localStorage.getItem(r));
15
15
  } catch {
16
16
  return;
17
17
  }
18
- }, [t]), u = (t, r) => {
19
- const e = s(r), i = t.getState().columnSizing, o = !!t.getState().columnSizingInfo.isResizingColumn;
20
- a(() => {
21
- if (!(!e || o))
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
22
  try {
23
23
  localStorage.setItem(e, JSON.stringify(i));
24
24
  } catch {
@@ -26,11 +26,11 @@ var g = ":column-sizing", n = (t) => {
26
26
  }
27
27
  }, [
28
28
  i,
29
- o,
29
+ n,
30
30
  e
31
31
  ]);
32
32
  };
33
33
  export {
34
- u as usePersistColumnSizing,
35
- l as usePersistedColumnSizing
34
+ S as usePersistColumnSizing,
35
+ m as usePersistedColumnSizing
36
36
  };
@@ -7,19 +7,19 @@ import { usePersistedColumnOrder as O } from "../custom-features/order-columns/u
7
7
  import { getPersistedPageSizeKey as _, usePersistedPageSize as x } from "./usePersistedPageSize.js";
8
8
  import { usePersistColumnSizing as v, usePersistedColumnSizing as K } from "./useColumnSizingPersistence.js";
9
9
  import { RowSelectionTooltipFeature as L } from "../custom-features/row-selection-tooltip/RowSelectionTooltipFeature.js";
10
- import { useEffect as R, useRef as T } from "react";
10
+ import { useEffect as p, useRef as T } from "react";
11
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
12
  var Z = 100, ee = (n) => {
13
- const { columns: p, data: z, initialState: a, pageSize: C, enableRowSelection: w, tableInstanceRef: d, locale: M, persistColumnOrderKey: u, uniqueKey: l, defaultColumn: g, ...m } = n, P = O(u), S = n.enableColumnResizing ? l : void 0, c = K(S), t = x(l) ?? C ?? 50, e = V({
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({
14
14
  _features: [
15
15
  E,
16
16
  I,
17
17
  b,
18
18
  L
19
19
  ],
20
- columns: p,
21
- data: z,
22
- meta: { locale: M ?? "en" },
20
+ columns: z,
21
+ data: C,
22
+ meta: { locale: P ?? "en" },
23
23
  initialState: {
24
24
  pagination: {
25
25
  pageIndex: 0,
@@ -29,35 +29,35 @@ var Z = 100, ee = (n) => {
29
29
  ...a?.columnVisibility,
30
30
  [y]: !1
31
31
  },
32
- columnOrder: P,
32
+ ...S && { columnOrder: S },
33
33
  ...a,
34
- ...c && { columnSizing: {
34
+ ...f && { columnSizing: {
35
35
  ...a?.columnSizing,
36
- ...c
36
+ ...f
37
37
  } }
38
38
  },
39
- enableRowSelection: w,
39
+ enableRowSelection: M,
40
40
  getCoreRowModel: N(),
41
41
  getExpandedRowModel: U(),
42
42
  getFilteredRowModel: h(),
43
43
  getSortedRowModel: D(),
44
44
  getPaginationRowModel: A(),
45
- getRowId: m.getRowId ?? ((r, j, f) => f ? [f.id, r.id].join(".") : r.id.toString()),
45
+ getRowId: m.getRowId ?? ((r, j, R) => R ? [R.id, r.id].join(".") : r.id.toString()),
46
46
  defaultColumn: n.enableColumnResizing ? {
47
47
  minSize: Z,
48
48
  ...g
49
49
  } : g,
50
50
  ...m
51
51
  });
52
- d && (d.current = e), F(e, u), v(e, S);
52
+ d && (d.current = e), F(e, u), v(e, c);
53
53
  const o = _(l), i = e.getState().pagination?.pageSize, s = T(void 0);
54
- return R(() => {
54
+ return p(() => {
55
55
  s.current = void 0, e.getState().pagination?.pageSize !== t && (e.setPageIndex(0), e.setPageSize(t));
56
56
  }, [
57
57
  t,
58
58
  o,
59
59
  e
60
- ]), R(() => {
60
+ ]), p(() => {
61
61
  if (!(!o || i == null)) {
62
62
  if (s.current !== o) {
63
63
  if (i !== t) return;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.46.0",
6
+ "version": "3.46.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",