asma-ui-core 3.20.1 → 3.21.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,14 +1,14 @@
1
- import { CloseIcon as s } from "../../icons/close-icon/CloseIcon.js";
1
+ import { CloseIcon as d } from "../../icons/close-icon/CloseIcon.js";
2
2
  import { ErrorOutlineIcon as p } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
3
3
  import { TextField as c } from "@mui/material";
4
4
  import { jsx as o, jsxs as m } from "react/jsx-runtime";
5
- var h = ({ allowClear: l, onClear: n, readOnly: t, disabled: u, error: e, helperText: a, dataTest: d, ...r }) => /* @__PURE__ */ o(c, {
5
+ var h = ({ allowClear: l, onClear: n, readOnly: t, disabled: u, error: e, helperText: a, dataTest: s, ...r }) => /* @__PURE__ */ o(c, {
6
6
  ...r,
7
- "data-testid": d,
7
+ "data-testid": s,
8
8
  disabled: (u ?? !1) || (t ?? !1),
9
9
  error: e,
10
- helperText: t ? null : e ? /* @__PURE__ */ m("div", {
11
- className: "flex items-center gap-1",
10
+ helperText: t ? null : e ? /* @__PURE__ */ m("span", {
11
+ className: "inline-flex items-center gap-1",
12
12
  children: [/* @__PURE__ */ o(p, {
13
13
  width: 20,
14
14
  height: 20,
@@ -24,7 +24,7 @@ var h = ({ allowClear: l, onClear: n, readOnly: t, disabled: u, error: e, helper
24
24
  onClick: (i) => {
25
25
  i.stopPropagation(), i.preventDefault(), n?.();
26
26
  },
27
- children: /* @__PURE__ */ o(s, {
27
+ children: /* @__PURE__ */ o(d, {
28
28
  width: 18,
29
29
  height: 18
30
30
  })
@@ -1,4 +1,4 @@
1
- import { cn as C } from "../../../helpers/cn.js";
1
+ import { cn as v } from "../../../helpers/cn.js";
2
2
  import { ChevronDownIcon as re } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
3
  import { CloseIcon as le } from "../../icons/close-icon/CloseIcon.js";
4
4
  import { CheckIcon as oe } from "../../icons/check-icon/CheckIcon.js";
@@ -7,32 +7,32 @@ import { StyledChip as ne } from "../../data-display/chip/StyledChip.js";
7
7
  import { StyledCheckbox as H } from "../checkbox/base-ui/StyledCheckbox.js";
8
8
  import B from "./StyledSelectAutocomplete.module.js";
9
9
  import D from "clsx";
10
- import { createElement as v, useLayoutEffect as se, useRef as ce, useState as z } from "react";
10
+ import { createElement as C, useLayoutEffect as se, useRef as ce, useState as z } from "react";
11
11
  import { Autocomplete as ie, Paper as de } from "@mui/material";
12
12
  import { jsx as l, jsxs as T } from "react/jsx-runtime";
13
- function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W, multiple: n, allowSelectAll: _, selectAllLabel: N, className: F, defaultValue: w, isOptionEqualToValue: p, ListboxProps: M, onChange: G, options: f, popupIcon: K, readOnly: h, renderOption: L, renderTags: O, sx: U, value: x, ...V }) {
14
- const [k, E] = z("auto"), g = ce(null), o = n === !0 && _ === !0 && !h, A = x !== void 0, b = (e) => Array.isArray(e) ? e : [], [J, Q] = z(() => b(w));
13
+ function Me({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W, multiple: n, allowSelectAll: _, selectAllLabel: M, className: F, defaultValue: N, isOptionEqualToValue: p, ListboxProps: k, onChange: G, options: h, popupIcon: K, readOnly: f, renderOption: L, renderTags: O, sx: U, value: x, ...V }) {
14
+ const [A, E] = z("auto"), g = ce(null), o = n === !0 && _ === !0 && !f, w = x !== void 0, b = (e) => Array.isArray(e) ? e : [], [J, Q] = z(() => b(N));
15
15
  se(() => {
16
16
  if (!m) return;
17
17
  const e = g.current?.getBoundingClientRect().height ?? 0, t = g.current?.getBoundingClientRect().top ?? 0, r = window.innerHeight - t - e - 40;
18
18
  E(r > 0 ? r : "auto");
19
19
  }, [m]);
20
20
  const y = m ? {
21
- style: { maxHeight: k === "auto" ? "auto" : `${k}px` },
22
- ...M
23
- } : M, s = (e) => typeof e == "object" && e !== null && "label" in e ? e.label : String(e), X = (e) => typeof e == "object" && e !== null && "disabled" in e && !!e.disabled, I = {
21
+ style: { maxHeight: A === "auto" ? "auto" : `${A}px` },
22
+ ...k
23
+ } : k, s = (e) => typeof e == "object" && e !== null && "label" in e ? e.label : String(e), X = (e) => typeof e == "object" && e !== null && "disabled" in e && !!e.disabled, I = {
24
24
  padding: 0,
25
25
  "& .MuiAutocomplete-option": { paddingLeft: n ? "12px !important" : "6px !important" }
26
- }, Y = y?.sx ? [I, y.sx] : I, $ = o ? b(A ? x : J) : [], c = o ? f.filter((e) => !X(e)) : f, Z = (e, t) => {
26
+ }, Y = y?.sx ? [I, y.sx] : I, $ = o ? b(w ? x : J) : [], c = o ? h.filter((e) => !X(e)) : h, Z = (e, t) => {
27
27
  const r = typeof e == "object" && e !== null;
28
28
  return r !== (typeof t == "object" && t !== null) || !r && typeof e != typeof t ? !1 : p ? p(e, t) : e === t;
29
29
  }, j = o ? c.filter((e) => $.some((t) => Z(e, t))).length : 0, R = o && c.length > 0 && j === c.length, q = o && j > 0 && !R, P = (e, t, r, a) => {
30
- o && !A && Q(b(t)), G?.(e, t, r, a);
30
+ o && !w && Q(b(t)), G?.(e, t, r, a);
31
31
  }, ee = (e, t) => {
32
32
  P(e, t ? [...c] : [], t ? "selectOption" : "clear", void 0);
33
33
  }, te = (e, t) => e.map((r, a) => {
34
34
  const u = t({ index: a }), S = d?.(r) ?? s(r);
35
- return /* @__PURE__ */ v(ne, {
35
+ return /* @__PURE__ */ C(ne, {
36
36
  ...u,
37
37
  key: `selected-chip-${S}-${a}`,
38
38
  dataTest: `selected-chip-${S}`,
@@ -41,12 +41,12 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
41
41
  });
42
42
  });
43
43
  return /* @__PURE__ */ l("div", {
44
- className: C(B.styledSelectAutocompleteWrapper, W),
44
+ className: v(B.styledSelectAutocompleteWrapper, W),
45
45
  ref: g,
46
46
  children: /* @__PURE__ */ l(ie, {
47
47
  ...V,
48
48
  multiple: n,
49
- defaultValue: o ? void 0 : w,
49
+ defaultValue: o ? void 0 : N,
50
50
  getOptionLabel: d,
51
51
  isOptionEqualToValue: p,
52
52
  ListboxProps: {
@@ -55,9 +55,9 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
55
55
  },
56
56
  className: D("!text-sm", F),
57
57
  onChange: P,
58
- options: f,
58
+ options: h,
59
59
  renderTags: O ?? (n ? te : void 0),
60
- popupIcon: h ? null : K ?? n ? /* @__PURE__ */ l(ae, {
60
+ popupIcon: f ? null : K ?? n ? /* @__PURE__ */ l(ae, {
61
61
  width: 24,
62
62
  height: 24
63
63
  }) : /* @__PURE__ */ l(re, {
@@ -65,7 +65,7 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
65
65
  height: 24,
66
66
  className: D(B["select-custom-icon"])
67
67
  }),
68
- readOnly: h,
68
+ readOnly: f,
69
69
  "data-testid": i,
70
70
  value: o ? $ : x,
71
71
  PaperComponent: ({ children: e }) => /* @__PURE__ */ T(de, {
@@ -75,9 +75,12 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
75
75
  marginTop: "0px !important",
76
76
  "& .MuiAutocomplete-option.Mui-focused": { background: "var(--colors-delta-50) !important" },
77
77
  "& li[aria-selected=true]": { background: "var(--colors-gama-50) !important" },
78
- "& li[aria-selected=true].MuiAutocomplete-option.Mui-focused": { background: "var(--colors-gama-50) !important" }
78
+ "& li[aria-selected=true].MuiAutocomplete-option.Mui-focused": { background: "var(--colors-gama-50) !important" },
79
+ "&:has([data-select-all-header]:hover) .MuiAutocomplete-option.Mui-focused": { background: "transparent !important" },
80
+ "&:has([data-select-all-header]:hover) li[aria-selected=true].MuiAutocomplete-option.Mui-focused": { background: "var(--colors-gama-50) !important" }
79
81
  },
80
82
  children: [o && c.length > 0 && /* @__PURE__ */ T("div", {
83
+ "data-select-all-header": !0,
81
84
  className: "flex items-center gap-x-[10px] border-[1px] border-b border-solid border-delta-200 bg-delta-50 py-2 pl-3 text-xs",
82
85
  onMouseDown: (t) => t.preventDefault(),
83
86
  role: "presentation",
@@ -88,19 +91,19 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
88
91
  indeterminate: q,
89
92
  hideWrapper: !0,
90
93
  onChange: ee,
91
- "aria-label": N ?? "Select all"
94
+ "aria-label": M ?? "Select all"
92
95
  }), /* @__PURE__ */ l("span", {
93
96
  className: "truncate text-[10px] font-semibold uppercase text-delta-600",
94
- children: N ?? "Select all"
97
+ children: M ?? "Select all"
95
98
  })]
96
99
  }), e]
97
100
  }),
98
101
  renderOption: L ?? ((e, t, { selected: r }) => {
99
102
  const a = e, u = e.id ?? s(t);
100
- return n ? /* @__PURE__ */ v("li", {
103
+ return n ? /* @__PURE__ */ C("li", {
101
104
  ...a,
102
105
  key: u,
103
- className: C(e.className, "flex items-center gap-x-[10px] border-0 border-b border-solid border-delta-200")
106
+ className: v(e.className, "flex items-center gap-x-[10px] border-0 border-b border-solid border-delta-200")
104
107
  }, /* @__PURE__ */ l(H, {
105
108
  dataTest: `${i}-${s(t)}-checkbox`,
106
109
  checked: r,
@@ -109,10 +112,10 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
109
112
  }), /* @__PURE__ */ l("span", {
110
113
  className: "flex-1 truncate py-2 text-sm text-delta-700",
111
114
  children: d?.(t) ?? s(t)
112
- })) : /* @__PURE__ */ v("li", {
115
+ })) : /* @__PURE__ */ C("li", {
113
116
  ...a,
114
117
  key: u,
115
- className: C(e.className, "flex items-center gap-x-1")
118
+ className: v(e.className, "flex items-center gap-x-1")
116
119
  }, /* @__PURE__ */ l("span", {
117
120
  className: "w-5",
118
121
  children: r && /* @__PURE__ */ l(oe, {
@@ -147,5 +150,5 @@ function Ne({ dataTest: i, autoHeight: m, getOptionLabel: d, wrapperClassName: W
147
150
  });
148
151
  }
149
152
  export {
150
- Ne as StyledSelectAutocomplete
153
+ Me as StyledSelectAutocomplete
151
154
  };
@@ -1,27 +1,29 @@
1
1
  import { ChevronDownIcon as a } from "../../../icons/chevron-down-icon/ChevronDownIcon.js";
2
2
  import r from "./StyledAccordion.module.js";
3
- import t from "clsx";
3
+ import o from "clsx";
4
4
  import "react";
5
- import { Fragment as s, jsx as o, jsxs as c } from "react/jsx-runtime";
6
- import { Accordion as g } from "@base-ui/react/accordion";
7
- var S = ({ size: m = "large", expandChevronRight: n, className: l, headerClassName: d, sx: p, children: i, ...x }) => {
8
- const e = m === "small", h = {
9
- "--trigger-height": e ? "48px" : "72px",
10
- "--trigger-padding-x": e ? "8px" : "16px",
11
- "--trigger-font-size": e ? "14px" : "18px",
12
- "--chevron-size": e ? "20px" : "24px",
5
+ import { Fragment as n, jsx as e, jsxs as s } from "react/jsx-runtime";
6
+ import { Accordion as c } from "@base-ui/react/accordion";
7
+ var N = ({ size: g = "large", expandChevronRight: m, className: l, headerClassName: d, sx: p, children: i, ...x }) => {
8
+ const t = g === "small", f = {
9
+ "--trigger-height": t ? "48px" : "72px",
10
+ "--trigger-padding-x": t ? "8px" : "16px",
11
+ "--trigger-font-size": t ? "14px" : "18px",
12
+ "--chevron-size": t ? "20px" : "24px",
13
13
  ...p
14
14
  };
15
- return /* @__PURE__ */ o(g.Header, {
16
- className: t(r.Header, d),
17
- children: /* @__PURE__ */ o(g.Trigger, {
15
+ return /* @__PURE__ */ e(c.Header, {
16
+ className: o(r.Header, d),
17
+ children: /* @__PURE__ */ e(c.Trigger, {
18
18
  ...x,
19
- className: t(r.Trigger, l),
20
- style: h,
21
- children: n ? /* @__PURE__ */ c(s, { children: [i, /* @__PURE__ */ o(a, {
22
- className: t(r.TriggerIcon, r.TriggerIconRight),
19
+ nativeButton: !1,
20
+ render: /* @__PURE__ */ e("div", {}),
21
+ className: o(r.Trigger, l),
22
+ style: f,
23
+ children: m ? /* @__PURE__ */ s(n, { children: [i, /* @__PURE__ */ e(a, {
24
+ className: o(r.TriggerIcon, r.TriggerIconRight),
23
25
  "data-state-icon": !0
24
- })] }) : /* @__PURE__ */ c(s, { children: [/* @__PURE__ */ o(a, {
26
+ })] }) : /* @__PURE__ */ s(n, { children: [/* @__PURE__ */ e(a, {
25
27
  className: r.TriggerIcon,
26
28
  "data-state-icon": !0
27
29
  }), i] })
@@ -29,5 +31,5 @@ var S = ({ size: m = "large", expandChevronRight: n, className: l, headerClassNa
29
31
  });
30
32
  };
31
33
  export {
32
- S as StyledAccordionSummary
34
+ N as StyledAccordionSummary
33
35
  };
@@ -4,7 +4,7 @@ import { ColumnDef, IAction, ICustomAction, RowActionsState } from '../../../typ
4
4
  export declare function generateActionsColumn<TData>(options: {
5
5
  headerPin: boolean;
6
6
  actions?: (row: Row<TData>) => (IAction<TData> | ICustomAction<TData>)[];
7
- customActionsNode?: (row: CellContext<TData, TData>) => ReactNode;
7
+ customActionsNode?: (row: CellContext<TData, unknown>) => ReactNode;
8
8
  rowHeight?: number;
9
9
  customActionsColumnProps?: Partial<ColumnDef<TData, unknown>>;
10
10
  rowActionsState?: (row: Row<TData>) => RowActionsState | undefined;
@@ -1,5 +1,5 @@
1
1
  import { HeaderContext } from '@tanstack/react-table';
2
2
  export declare function HeaderActionMenu<TData>({ headerData, locale, }: {
3
- headerData: HeaderContext<TData, TData>;
3
+ headerData: HeaderContext<TData, unknown>;
4
4
  locale?: 'en' | 'no';
5
5
  }): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { CellContext, Row } from '@tanstack/react-table';
2
2
  import { IAction, ICustomAction, RowActionsState } from '../../../../types';
3
3
  export declare function RowActionMenu<TData>({ tableData, actions, rowActionsState, }: {
4
- tableData: CellContext<TData, TData>;
4
+ tableData: CellContext<TData, unknown>;
5
5
  actions: (row: Row<TData>) => (IAction<TData> | ICustomAction<TData>)[];
6
6
  rowActionsState?: (row: Row<TData>) => RowActionsState | undefined;
7
7
  }): JSX.Element;
@@ -1,2 +1,2 @@
1
- import { ColumnDef } from '../../types';
2
- export declare function selectColumn<TData>(isFixed: boolean, rowHeight?: number): ColumnDef<TData, unknown>;
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ export declare function selectColumn<TData>(isFixed: boolean, rowHeight?: number, locale?: 'en' | 'no'): ColumnDef<TData, unknown>;
@@ -70,7 +70,11 @@ export type StyledTableProps<TData, TCustomData> = {
70
70
  locale?: 'no' | 'en';
71
71
  height?: string | number;
72
72
  actions?: (row: Row<TData>) => (IAction<TData> | ICustomAction<TData>)[];
73
- customActionsNode?: (row: CellContext<TData, TData>) => ReactNode;
73
+ /**
74
+ * Receives the actions cell context for the internal actions column.
75
+ * Use row.original and the row APIs instead of getValue(), because this column stores an unknown accessor value.
76
+ */
77
+ customActionsNode?: (row: CellContext<TData, unknown>) => ReactNode;
74
78
  customSubRowData?: Map<string, TCustomData[]>;
75
79
  headerPin?: boolean;
76
80
  expandArrow?: boolean;
@@ -1,56 +1,57 @@
1
- var l = "_tbody_15l6x_119", e = "_expanded_row_15l6x_182", _ = "_selected_15l6x_200", t = "_shadowed_15l6x_229", a = "_resizer_15l6x_283", o = "_isResizing_15l6x_295", r = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_15l6x_1",
3
- "table-wrapper": "_table-wrapper_15l6x_26",
4
- "table-shell": "_table-shell_15l6x_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_15l6x_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_15l6x_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_15l6x_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_15l6x_53",
9
- "table-scroll": "_table-scroll_15l6x_56",
10
- "table-x--fill-height": "_table-x--fill-height_15l6x_65",
11
- "table-x": "_table-x_15l6x_65",
12
- "table-header--sticky": "_table-header--sticky_15l6x_80",
13
- "table-hscroll": "_table-hscroll_15l6x_85",
14
- "table-hscroll__content": "_table-hscroll__content_15l6x_95",
15
- "no-rows-overlay-container": "_no-rows-overlay-container_15l6x_98",
16
- "no-rows-overlay-content": "_no-rows-overlay-content_15l6x_106",
17
- "styled-table": "_styled-table_15l6x_110",
18
- tbody: l,
19
- "loading-icon": "_loading-icon_15l6x_124",
20
- "t-row": "_t-row_15l6x_131",
21
- "t-cell": "_t-cell_15l6x_131",
22
- "action-cell": "_action-cell_15l6x_141",
23
- "fixed-cell": "_fixed-cell_15l6x_145",
24
- "fixed-right-cell": "_fixed-right-cell_15l6x_148",
25
- expanded_row: e,
26
- selected: _,
27
- "single-selection": "_single-selection_15l6x_203",
28
- "action-cell--no-shadow": "_action-cell--no-shadow_15l6x_220",
29
- "action-cell--not-fixed": "_action-cell--not-fixed_15l6x_223",
1
+ var e = "_tbody_1u0xz_124", _ = "_expanded_row_1u0xz_187", l = "_selected_1u0xz_205", t = "_shadowed_1u0xz_234", a = "_resizer_1u0xz_288", o = "_isResizing_1u0xz_300", r = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_1u0xz_1",
3
+ "table-wrapper": "_table-wrapper_1u0xz_26",
4
+ "table-shell": "_table-shell_1u0xz_33",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_1u0xz_39",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_1u0xz_42",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_1u0xz_43",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_1u0xz_53",
9
+ "table-scroll": "_table-scroll_1u0xz_56",
10
+ "table-x--fill-height": "_table-x--fill-height_1u0xz_65",
11
+ "table-x": "_table-x_1u0xz_65",
12
+ "table-content": "_table-content_1u0xz_80",
13
+ "table-header--sticky": "_table-header--sticky_1u0xz_85",
14
+ "table-hscroll": "_table-hscroll_1u0xz_90",
15
+ "table-hscroll__content": "_table-hscroll__content_1u0xz_100",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_1u0xz_103",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_1u0xz_111",
18
+ "styled-table": "_styled-table_1u0xz_115",
19
+ tbody: e,
20
+ "loading-icon": "_loading-icon_1u0xz_129",
21
+ "t-row": "_t-row_1u0xz_136",
22
+ "t-cell": "_t-cell_1u0xz_136",
23
+ "action-cell": "_action-cell_1u0xz_146",
24
+ "fixed-cell": "_fixed-cell_1u0xz_150",
25
+ "fixed-right-cell": "_fixed-right-cell_1u0xz_153",
26
+ expanded_row: _,
27
+ selected: l,
28
+ "single-selection": "_single-selection_1u0xz_208",
29
+ "action-cell--no-shadow": "_action-cell--no-shadow_1u0xz_225",
30
+ "action-cell--not-fixed": "_action-cell--not-fixed_1u0xz_228",
30
31
  shadowed: t,
31
- "shadowed-right": "_shadowed-right_15l6x_263",
32
- "is-loading": "_is-loading_15l6x_267",
33
- "action-cell-default-background": "_action-cell-default-background_15l6x_270",
34
- "fixed-cell-default-background": "_fixed-cell-default-background_15l6x_273",
35
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_15l6x_276",
36
- "sortable-column": "_sortable-column_15l6x_279",
32
+ "shadowed-right": "_shadowed-right_1u0xz_268",
33
+ "is-loading": "_is-loading_1u0xz_272",
34
+ "action-cell-default-background": "_action-cell-default-background_1u0xz_275",
35
+ "fixed-cell-default-background": "_fixed-cell-default-background_1u0xz_278",
36
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_1u0xz_281",
37
+ "sortable-column": "_sortable-column_1u0xz_284",
37
38
  resizer: a,
38
39
  isResizing: o,
39
- "hide-table-header": "_hide-table-header_15l6x_307",
40
- "show-table-header": "_show-table-header_15l6x_311",
41
- "table-header": "_table-header_15l6x_80",
42
- "hide-header": "_hide-header_15l6x_336",
43
- "t-cell__actions": "_t-cell__actions_15l6x_339",
44
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_15l6x_347",
45
- "t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_15l6x_350",
46
- "t-cell__fixed": "_t-cell__fixed_15l6x_357",
47
- "t-cell__fixed-right": "_t-cell__fixed-right_15l6x_364",
48
- "sort-icon": "_sort-icon_15l6x_371",
49
- "table-footer--sticky": "_table-footer--sticky_15l6x_374",
50
- "table-footer--inline": "_table-footer--inline_15l6x_385",
51
- "table-bottom": "_table-bottom_15l6x_396",
52
- "table-bottom--sticky": "_table-bottom--sticky_15l6x_410",
53
- "cursor-not-allowed": "_cursor-not-allowed_15l6x_414"
40
+ "hide-table-header": "_hide-table-header_1u0xz_312",
41
+ "show-table-header": "_show-table-header_1u0xz_316",
42
+ "table-header": "_table-header_1u0xz_85",
43
+ "hide-header": "_hide-header_1u0xz_341",
44
+ "t-cell__actions": "_t-cell__actions_1u0xz_344",
45
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_1u0xz_352",
46
+ "t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_1u0xz_355",
47
+ "t-cell__fixed": "_t-cell__fixed_1u0xz_362",
48
+ "t-cell__fixed-right": "_t-cell__fixed-right_1u0xz_369",
49
+ "sort-icon": "_sort-icon_1u0xz_376",
50
+ "table-footer--sticky": "_table-footer--sticky_1u0xz_379",
51
+ "table-footer--inline": "_table-footer--inline_1u0xz_390",
52
+ "table-bottom": "_table-bottom_1u0xz_401",
53
+ "table-bottom--sticky": "_table-bottom--sticky_1u0xz_415",
54
+ "cursor-not-allowed": "_cursor-not-allowed_1u0xz_419"
54
55
  };
55
56
  export {
56
57
  r as default
@@ -2,7 +2,7 @@ import { cn as p } from "../helpers/cn.js";
2
2
  import { RootContextProvider as te } from "../context/RootContext.js";
3
3
  import { mobileView as oe, useWindowWidthSize as re } from "../hooks/useWindowWidthSize.hook.js";
4
4
  import { useStyledTable as ne } from "../hooks/useStyledTable.js";
5
- import o from "./StyledTable.module.js";
5
+ import e from "./StyledTable.module.js";
6
6
  import { injectColumns as le } from "../helpers/injectColumns.js";
7
7
  import { TableHeader as se } from "./table-header/TableHeader.js";
8
8
  import { TableBody as ie } from "./TableBody.js";
@@ -12,38 +12,38 @@ import { useProxyHorizontalScrollSync as ce } from "./columns/helpers/useProxyHo
12
12
  import { useElementHeightPx as $ } from "./columns/helpers/useElementHeightPx.js";
13
13
  import { useColumnVirtualizer as de } from "../hooks/useColumnVirtualizer.js";
14
14
  import { useLayoutEffect as q, useMemo as O, useRef as L, useState as me } from "react";
15
- import { Fragment as X, jsx as e, jsxs as R } from "react/jsx-runtime";
15
+ import { Fragment as X, jsx as t, jsxs as w } from "react/jsx-runtime";
16
16
  import { DndContext as fe, closestCenter as he } from "@dnd-kit/core";
17
17
  import { restrictToParentElement as be, restrictToVerticalAxis as ue } from "@dnd-kit/modifiers";
18
18
  import { arrayMove as pe } from "@dnd-kit/sortable";
19
- function we({ enabled: l, data: t, setData: i, children: w }) {
20
- const v = O(() => t.map((c) => c.id), [t]), S = (c) => {
19
+ function we({ enabled: l, data: o, setData: i, children: v }) {
20
+ const y = O(() => o.map((c) => c.id), [o]), S = (c) => {
21
21
  if (!l || !i) return;
22
22
  const { active: m, over: f } = c;
23
- !m || !f || m.id === f.id || i((y) => pe(y, v.indexOf(m.id), v.indexOf(f.id)));
23
+ !m || !f || m.id === f.id || i((g) => pe(g, y.indexOf(m.id), y.indexOf(f.id)));
24
24
  };
25
- return l ? /* @__PURE__ */ e(fe, {
25
+ return l ? /* @__PURE__ */ t(fe, {
26
26
  collisionDetection: he,
27
27
  modifiers: [ue, be],
28
28
  onDragEnd: S,
29
- children: w
30
- }) : /* @__PURE__ */ e(X, { children: w });
29
+ children: v
30
+ }) : /* @__PURE__ */ t(X, { children: v });
31
31
  }
32
- function ve({ enabled: l, className: t, children: i }) {
33
- return l ? /* @__PURE__ */ e("div", {
34
- className: t,
32
+ function ve({ enabled: l, className: o, children: i }) {
33
+ return l ? /* @__PURE__ */ t("div", {
34
+ className: o,
35
35
  children: i
36
- }) : /* @__PURE__ */ e(X, { children: i });
36
+ }) : /* @__PURE__ */ t(X, { children: i });
37
37
  }
38
38
  var Ve = (l) => {
39
- const t = O(() => ({
39
+ const o = O(() => ({
40
40
  ...l,
41
41
  rowHeight: l.rowHeight ?? 48
42
- }), [l]), { className: i, tableClassName: w, height: v, noRowsOverlay: S, data: c, enableDnd: m, setData: f, loading: y } = t;
43
- le(t);
44
- const { table: a } = ne(t), C = c.length > 0, F = C && !!y, h = !C && !y, z = oe(re()), r = !!t.stickyFooter && !z, [G, M] = me(!1), g = L(null), W = L(null), P = t.hideHeader ? 0 : 32, { tableScrollRef: x, tableXRef: H, hScrollRef: J, hScrollContentRef: K } = ce(!r);
42
+ }), [l]), { className: i, tableClassName: v, height: y, noRowsOverlay: S, data: c, enableDnd: m, setData: f, loading: g } = o;
43
+ le(o);
44
+ const { table: a } = ne(o), C = c.length > 0, F = C && !!g, h = !C && !g, z = oe(re()), r = !!o.stickyFooter && !z, [G, M] = me(!1), x = L(null), W = L(null), P = o.hideHeader ? 0 : 32, { tableScrollRef: R, tableXRef: H, hScrollRef: J, hScrollContentRef: K } = ce(!r);
45
45
  q(() => {
46
- const n = r ? g.current : H.current ?? x.current;
46
+ const n = r ? x.current : H.current ?? R.current;
47
47
  if (!n) {
48
48
  M(!1);
49
49
  return;
@@ -60,26 +60,26 @@ var Ve = (l) => {
60
60
  }, [
61
61
  r,
62
62
  H,
63
- x
63
+ R
64
64
  ]);
65
- const { ref: Q, heightPx: k } = $(), { ref: U, heightPx: D } = $(), T = t.rowHeight ?? 48, E = a.getRowModel().rows.length, V = t.hideHeader ? 0 : 32, _ = 12, Y = O(() => {
66
- if (T <= 0) return 0;
65
+ const { ref: Q, heightPx: k } = $(), { ref: U, heightPx: D } = $(), N = o.rowHeight ?? 48, E = a.getRowModel().rows.length, V = o.hideHeader ? 0 : 32, _ = 12, Y = O(() => {
66
+ if (N <= 0) return 0;
67
67
  const n = r ? 0 : V + D + _, s = Math.max(0, k - n);
68
- return Math.floor(s / T);
68
+ return Math.floor(s / N);
69
69
  }, [
70
70
  r,
71
71
  D,
72
72
  V,
73
73
  _,
74
- T,
74
+ N,
75
75
  k
76
- ]), N = !r && E > 0 && E <= Y, Z = p(r ? o["table-wrapper"] : N || !r && h ? o["table-wrapper--proxy-bottom"] : o["table-wrapper--proxy"], F && o["table-wrapper-fetching"], h && o["table-wrapper--no-rows"], i), { columnWindow: j } = de({
76
+ ]), T = !r && E > 0 && E <= Y, Z = p(r ? e["table-wrapper"] : T || !r && h ? e["table-wrapper--proxy-bottom"] : e["table-wrapper--proxy"], F && e["table-wrapper-fetching"], h && e["table-wrapper--no-rows"], i), { columnWindow: j } = de({
77
77
  table: a,
78
- scrollRef: r ? g : x,
78
+ scrollRef: r ? x : R,
79
79
  isMobileView: z
80
80
  });
81
81
  q(() => {
82
- const n = g.current, s = W.current, b = () => n?.style.removeProperty("--no-rows-content-height");
82
+ const n = x.current, s = W.current, b = () => n?.style.removeProperty("--no-rows-content-height");
83
83
  if (!n || !h || !s) {
84
84
  b();
85
85
  return;
@@ -91,83 +91,82 @@ var Ve = (l) => {
91
91
  u.disconnect(), b();
92
92
  };
93
93
  }, [h, P]);
94
- const A = /* @__PURE__ */ R("table", {
95
- className: o["styled-table"],
96
- style: {
97
- width: a.getTotalSize(),
98
- minWidth: "100%"
99
- },
100
- children: [
101
- /* @__PURE__ */ e(se, {
94
+ const A = /* @__PURE__ */ w("div", {
95
+ className: e["table-content"],
96
+ children: [/* @__PURE__ */ w("table", {
97
+ className: e["styled-table"],
98
+ style: {
99
+ width: a.getTotalSize(),
100
+ minWidth: "100%"
101
+ },
102
+ children: [/* @__PURE__ */ t(se, {
102
103
  table: a,
103
- styledTableProps: t,
104
- tableCanResize: !!t.enableColumnResizing,
104
+ styledTableProps: o,
105
+ tableCanResize: !!o.enableColumnResizing,
105
106
  tableWidth: null,
106
107
  columnWindow: j
107
- }),
108
- /* @__PURE__ */ e(ae, { fetching: !!F }),
109
- /* @__PURE__ */ e(ie, {
108
+ }), /* @__PURE__ */ t(ie, {
110
109
  table: a,
111
- styledTableProps: t,
110
+ styledTableProps: o,
112
111
  columnWindow: j
113
- })
114
- ]
115
- }), ee = h ? /* @__PURE__ */ e("div", {
116
- className: o["no-rows-overlay-container"],
112
+ })]
113
+ }), /* @__PURE__ */ t(ae, { fetching: !!F })]
114
+ }), ee = h ? /* @__PURE__ */ t("div", {
115
+ className: e["no-rows-overlay-container"],
117
116
  style: { top: P },
118
- children: /* @__PURE__ */ e("div", {
117
+ children: /* @__PURE__ */ t("div", {
119
118
  ref: W,
120
- className: o["no-rows-overlay-content"],
119
+ className: e["no-rows-overlay-content"],
121
120
  children: S
122
121
  })
123
122
  }) : null;
124
- return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(we, {
123
+ return /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(we, {
125
124
  enabled: !!m,
126
125
  data: c,
127
126
  setData: f,
128
- children: /* @__PURE__ */ R("div", {
127
+ children: /* @__PURE__ */ w("div", {
129
128
  ref: Q,
130
- className: p(o["asma-ui-table-styled-table"], w),
129
+ className: p(e["asma-ui-table-styled-table"], v),
131
130
  "data-x-overflow": G ? "true" : "false",
132
- style: { height: v },
133
- children: [/* @__PURE__ */ e(ve, {
131
+ style: { height: y },
132
+ children: [/* @__PURE__ */ t(ve, {
134
133
  enabled: r,
135
- className: o["table-shell"],
136
- children: /* @__PURE__ */ R("div", {
137
- ref: g,
134
+ className: e["table-shell"],
135
+ children: /* @__PURE__ */ w("div", {
136
+ ref: x,
138
137
  className: Z,
139
- children: [r ? A : /* @__PURE__ */ R("div", {
140
- ref: x,
141
- className: p(o["table-scroll"]),
138
+ children: [r ? A : /* @__PURE__ */ w("div", {
139
+ ref: R,
140
+ className: p(e["table-scroll"]),
142
141
  children: [
143
- /* @__PURE__ */ e("div", {
142
+ /* @__PURE__ */ t("div", {
144
143
  ref: H,
145
- className: p(o["table-x"], !N && o["table-x--fill-height"]),
144
+ className: p(e["table-x"], !T && e["table-x--fill-height"]),
146
145
  children: A
147
146
  }),
148
- /* @__PURE__ */ e("div", {
147
+ /* @__PURE__ */ t("div", {
149
148
  ref: J,
150
- className: o["table-hscroll"],
151
- children: /* @__PURE__ */ e("div", {
149
+ className: e["table-hscroll"],
150
+ children: /* @__PURE__ */ t("div", {
152
151
  ref: K,
153
- className: o["table-hscroll__content"]
152
+ className: e["table-hscroll__content"]
154
153
  })
155
154
  }),
156
- /* @__PURE__ */ e("div", {
155
+ /* @__PURE__ */ t("div", {
157
156
  ref: U,
158
- className: p(o["table-bottom"], N && o["table-bottom--sticky"]),
159
- children: /* @__PURE__ */ e(B, {
157
+ className: p(e["table-bottom"], T && e["table-bottom--sticky"]),
158
+ children: /* @__PURE__ */ t(B, {
160
159
  table: a,
161
- styledTableProps: t,
160
+ styledTableProps: o,
162
161
  canShowStickyFooter: !1
163
162
  })
164
163
  })
165
164
  ]
166
165
  }), ee]
167
166
  })
168
- }), r && /* @__PURE__ */ e(B, {
167
+ }), r && /* @__PURE__ */ t(B, {
169
168
  table: a,
170
- styledTableProps: t,
169
+ styledTableProps: o,
171
170
  canShowStickyFooter: !0
172
171
  })]
173
172
  })