asma-ui-core 3.103.0 → 3.103.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.
@@ -1,40 +1,42 @@
1
- import { DND_HANDLE_COLUMN_ID as a } from "../../types.js";
2
- import { DotsHorizontalIcon as n } from "../../shared-components/DotsHorizontalIcon.js";
3
- import d from "clsx";
4
- import { jsx as o } from "react/jsx-runtime";
5
- import { useSortable as s } from "@dnd-kit/sortable";
6
- function D(r, t) {
1
+ import { DND_HANDLE_COLUMN_ID as n } from "../../types.js";
2
+ import { DotsHorizontalIcon as d } from "../../shared-components/DotsHorizontalIcon.js";
3
+ import s from "clsx";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ import { useSortable as m } from "@dnd-kit/sortable";
6
+ function p(r, t, l) {
7
7
  return {
8
8
  enableHiding: !1,
9
9
  enableSorting: !1,
10
10
  header: () => null,
11
- cell: ({ row: e }) => /* @__PURE__ */ o(m, {
11
+ cell: ({ row: e }) => /* @__PURE__ */ a(u, {
12
+ ariaLabel: l === "no" ? `Endre rekkefølge på rad ${e.index + 1}` : `Reorder row ${e.index + 1}`,
12
13
  rowId: e.id,
13
14
  rowHeight: t
14
15
  }),
15
16
  minSize: 50,
16
17
  size: 50,
17
18
  ...r,
18
- id: a
19
+ id: n
19
20
  };
20
21
  }
21
- var m = ({ rowId: r, rowHeight: t, ...e }) => {
22
- const { attributes: l, listeners: i } = s({
23
- id: r,
22
+ var u = ({ ariaLabel: r, rowId: t, rowHeight: l, ...e }) => {
23
+ const { attributes: i, listeners: o } = m({
24
+ id: t,
24
25
  ...e
25
26
  });
26
- return /* @__PURE__ */ o("div", {
27
- ...l,
27
+ return /* @__PURE__ */ a("div", {
28
28
  ...i,
29
- style: { height: t ?? "auto" },
30
- children: /* @__PURE__ */ o(n, {
29
+ ...o,
30
+ "aria-label": r,
31
+ style: { height: l ?? "auto" },
32
+ children: /* @__PURE__ */ a(d, {
31
33
  width: 24,
32
34
  height: 24,
33
- className: d(e.disabled ? "cursor-not-allowed text-delta-300" : "cursor-grab text-delta-800")
35
+ className: s(e.disabled ? "cursor-not-allowed text-delta-300" : "cursor-grab text-delta-800")
34
36
  })
35
37
  });
36
38
  };
37
39
  export {
38
- m as RowDragHandleCell,
39
- D as generateDndHandleColumn
40
+ u as RowDragHandleCell,
41
+ p as generateDndHandleColumn
40
42
  };
@@ -1,31 +1,31 @@
1
- import { EXPAND_COLUMN_ID as i } from "../../types.js";
2
- import { ChevronDownIcon as a } from "../../shared-components/ChevronDownIcon.js";
3
- import { jsx as t } from "react/jsx-runtime";
1
+ import { EXPAND_COLUMN_ID as a } from "../../types.js";
2
+ import { ChevronDownIcon as d } from "../../shared-components/ChevronDownIcon.js";
3
+ import { jsx as r } from "react/jsx-runtime";
4
4
  import "@tanstack/react-table";
5
- function f(r, o) {
5
+ function x(t, o, i) {
6
6
  return {
7
- id: i,
7
+ id: a,
8
8
  minSize: 50,
9
9
  maxSize: 50,
10
10
  size: 50,
11
11
  enableHiding: !1,
12
12
  enableSorting: !1,
13
13
  header: () => null,
14
- cell: ({ cell: e }) => {
15
- const n = e.row.getIsExpanded();
16
- return e.row.getCanExpand() ? /* @__PURE__ */ t("button", {
14
+ cell: ({ cell: n }) => {
15
+ const e = n.row.getIsExpanded();
16
+ return n.row.getCanExpand() ? /* @__PURE__ */ r("button", {
17
17
  type: "button",
18
- "aria-label": n ? "Collapse row" : "Expand row",
19
- "aria-expanded": n,
18
+ "aria-label": i === "no" ? e ? `Skjul rad ${n.row.index + 1}` : `Utvid rad ${n.row.index + 1}` : e ? `Collapse row ${n.row.index + 1}` : `Expand row ${n.row.index + 1}`,
19
+ "aria-expanded": e,
20
20
  className: "flex w-full items-center justify-center border-0 bg-transparent p-0 outline-none focus:outline-none",
21
- onClick: () => e.row.getToggleExpandedHandler()(),
21
+ onClick: () => n.row.getToggleExpandedHandler()(),
22
22
  style: { height: o ?? "auto" },
23
- children: /* @__PURE__ */ t(a, {
23
+ children: /* @__PURE__ */ r(d, {
24
24
  className: "block size-6 shrink-0",
25
25
  width: 24,
26
26
  height: 24,
27
27
  style: {
28
- transform: n ? "rotate(180deg)" : "rotate(0deg)",
28
+ transform: e ? "rotate(180deg)" : "rotate(0deg)",
29
29
  transformBox: "fill-box",
30
30
  transformOrigin: "center",
31
31
  transitionProperty: "transform",
@@ -35,9 +35,9 @@ function f(r, o) {
35
35
  })
36
36
  }) : null;
37
37
  },
38
- fixedLeft: r
38
+ fixedLeft: t
39
39
  };
40
40
  }
41
41
  export {
42
- f as generateExpandColumn
42
+ x as generateExpandColumn
43
43
  };
@@ -1,35 +1,36 @@
1
- import { SHOW_FULL_TEXT_ID as i } from "../../types.js";
2
- import { ChevronDownIcon as l } from "../../shared-components/ChevronDownIcon.js";
3
- import { StyledButton as s } from "../../shared-components/button/StyledButton.js";
4
- import { jsx as o } from "react/jsx-runtime";
5
- function f(e, r) {
1
+ import { SHOW_FULL_TEXT_ID as l } from "../../types.js";
2
+ import { ChevronDownIcon as s } from "../../shared-components/ChevronDownIcon.js";
3
+ import { StyledButton as d } from "../../shared-components/button/StyledButton.js";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ function c(e, o, n) {
6
6
  return {
7
- id: i,
7
+ id: l,
8
8
  minSize: 38,
9
9
  maxSize: 38,
10
10
  size: 38,
11
11
  enableHiding: !1,
12
12
  enableSorting: !1,
13
13
  header: () => null,
14
- cell: (n) => /* @__PURE__ */ o(u, {
15
- info: n,
16
- rowHeight: r
14
+ cell: (a) => /* @__PURE__ */ r(u, {
15
+ info: a,
16
+ locale: n,
17
+ rowHeight: o
17
18
  }),
18
19
  fixedLeft: e
19
20
  };
20
21
  }
21
- function u({ info: e, rowHeight: r }) {
22
- const n = e.row.getCanExpand(), a = e.row.isExpanded();
23
- return /* @__PURE__ */ o("div", {
22
+ function u({ info: e, locale: o, rowHeight: n }) {
23
+ const a = e.row.getCanExpand(), i = e.row.isExpanded();
24
+ return /* @__PURE__ */ r("div", {
24
25
  className: "flex w-full items-center justify-center",
25
- style: { height: r ?? "auto" },
26
- children: /* @__PURE__ */ o(s, {
26
+ style: { height: n ?? "auto" },
27
+ children: /* @__PURE__ */ r(d, {
27
28
  dataTest: "expand-text-button",
28
- "aria-label": a ? "Collapse text" : "Show full text",
29
+ "aria-label": o === "no" ? i ? `Skjul full tekst for rad ${e.row.index + 1}` : `Vis full tekst for rad ${e.row.index + 1}` : i ? `Collapse full text for row ${e.row.index + 1}` : `Show full text for row ${e.row.index + 1}`,
29
30
  size: "small",
30
31
  variant: "textGray",
31
32
  onClick: (t) => {
32
- t.stopPropagation(), n && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
33
+ t.stopPropagation(), a && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
33
34
  },
34
35
  onMouseDown: (t) => {
35
36
  t.preventDefault(), t.stopPropagation();
@@ -37,12 +38,12 @@ function u({ info: e, rowHeight: r }) {
37
38
  onMouseUp: (t) => {
38
39
  t.preventDefault(), t.stopPropagation();
39
40
  },
40
- startIcon: /* @__PURE__ */ o(l, {
41
+ startIcon: /* @__PURE__ */ r(s, {
41
42
  className: "block size-5 shrink-0",
42
43
  width: 20,
43
44
  height: 20,
44
45
  style: {
45
- transform: a ? "rotate(180deg)" : "rotate(0deg)",
46
+ transform: i ? "rotate(180deg)" : "rotate(0deg)",
46
47
  transformBox: "fill-box",
47
48
  transformOrigin: "center",
48
49
  transitionProperty: "transform",
@@ -55,5 +56,5 @@ function u({ info: e, rowHeight: r }) {
55
56
  });
56
57
  }
57
58
  export {
58
- f as generateShowFullTextColumn
59
+ c as generateShowFullTextColumn
59
60
  };
@@ -4,17 +4,17 @@ import { generateExpandColumn as h } from "../components/columns/expandColumn.js
4
4
  import { generateActionsColumn as x } from "../components/columns/action-column/actionColumn.js";
5
5
  import { generateDndHandleColumn as _ } from "../components/columns/dndHandleColumn.js";
6
6
  import { generateShowFullTextColumn as A } from "../components/columns/showTextColumn.js";
7
- var T = (i) => {
8
- const { actions: r, customActionsNode: m, headerPin: d = !0, enableRowSelection: u, expandArrow: f, enableDnd: c, customDndColumnProps: a, rowHeight: e, textExpandArrow: s, customActionsColumnProps: p, rowActionsState: C, locale: l } = i, n = [...i.columns], t = n.some((o) => o.fixedLeft === !0);
9
- return !n.find((o) => o.id === "actions") && (r || m || d) && n.push(x({
10
- headerPin: d,
11
- actions: r,
12
- customActionsNode: m,
7
+ var T = (r) => {
8
+ const { actions: m, customActionsNode: d, headerPin: s = !0, enableRowSelection: u, expandArrow: f, enableDnd: c, customDndColumnProps: a, rowHeight: e, textExpandArrow: l, customActionsColumnProps: p, rowActionsState: C, locale: t } = r, n = [...r.columns], i = n.some((o) => o.fixedLeft === !0);
9
+ return !n.find((o) => o.id === "actions") && (m || d || s) && n.push(x({
10
+ headerPin: s,
11
+ actions: m,
12
+ customActionsNode: d,
13
13
  rowHeight: e,
14
14
  customActionsColumnProps: p,
15
15
  rowActionsState: C,
16
- locale: l
17
- })), s && !n.find((o) => o.id === "show-full-text") && n.unshift(A(t, e)), f && !s && !n.find((o) => o.id === "expand-column-id") && n.unshift(h(t, e)), c && !n.find((o) => o.id === "dnd-handle") && n.unshift(_(a, e)), u && !n.find((o) => o.id === "select") && n.unshift(D(t, e, l)), n;
16
+ locale: t
17
+ })), l && !n.find((o) => o.id === "show-full-text") && n.unshift(A(i, e, t)), f && !l && !n.find((o) => o.id === "expand-column-id") && n.unshift(h(i, e, t)), c && !n.find((o) => o.id === "dnd-handle") && n.unshift(_(a, e, t)), u && !n.find((o) => o.id === "select") && n.unshift(D(i, e, t)), n;
18
18
  };
19
19
  export {
20
20
  T as injectColumns
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.103.0",
6
+ "version": "3.103.1",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",