qaema-ui 0.0.72 → 0.0.73

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,126 +1,127 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
- import { useRef as g, useState as v, useCallback as oe, useEffect as D } from "react";
3
- import { createPortal as le } from "react-dom";
4
- import { FaTimes as R, FaAngleDown as ie } from "../../node_modules/react-icons/fa/index.js";
5
- import { useTheme as se } from "styled-components";
6
- import { HelperTextWrapper as ae } from "../PhoneInputField.js";
7
- import ce from "../SearchBar.js";
8
- import de from "../Spinner.js";
9
- import ue from "../Typography.js";
10
- import fe from "../../hooks/useZIndex.js";
11
- import { useQaemaCoreTranslation as me } from "../../i18n/i18n.js";
12
- import { StyledDropDownContainer as he, StyledlabelContainer as pe, StyledDropDown as xe, StyledDropDownToggle as Se, StyledDropDownTitle as je, IconsContainer as we, StyledDropDownMenu as ye, SearchContainer as ge, StyledOptionsContainer as ve, SpinnerRow as Ce, SelectedTagsContainer as be, SelectedTag as De } from "../../styles/Dropdown.styles.js";
13
- import Te from "./Table/Table.js";
14
- const Ne = (d) => {
2
+ import { useRef as y, useState as v, useCallback as le, useEffect as T } from "react";
3
+ import { createPortal as ie } from "react-dom";
4
+ import { FaTimes as P, FaAngleDown as se } from "../../node_modules/react-icons/fa/index.js";
5
+ import { useTheme as ae } from "styled-components";
6
+ import { HelperTextWrapper as ce } from "../PhoneInputField.js";
7
+ import de from "../SearchBar.js";
8
+ import ue from "../Spinner.js";
9
+ import fe from "../Typography.js";
10
+ import me from "../../hooks/useZIndex.js";
11
+ import { useQaemaCoreTranslation as he } from "../../i18n/i18n.js";
12
+ import { StyledDropDownContainer as pe, StyledlabelContainer as xe, StyledDropDown as Se, StyledDropDownToggle as je, StyledDropDownTitle as we, IconsContainer as ge, StyledDropDownMenu as ye, SearchContainer as ve, StyledOptionsContainer as Ce, SpinnerRow as be, SelectedTagsContainer as De, SelectedTag as Te } from "../../styles/Dropdown.styles.js";
13
+ import Ie from "./Table/Table.js";
14
+ const Be = (d) => {
15
15
  const {
16
- label: T,
17
- options: P,
18
- placeholder: W = "Select Something",
19
- optional: z = !1,
16
+ label: I,
17
+ options: W,
18
+ placeholder: z = "Select Something",
19
+ optional: F = !1,
20
20
  error: s = "",
21
21
  disabled: f = !1,
22
22
  selectIdentifier: j,
23
23
  keyIdentifier: r = "id",
24
24
  selectCallBack: w,
25
- showLeadIcon: F,
26
- icon: H,
27
- allowSearch: M,
28
- searchHandler: N,
29
- searchPlaceholder: B,
25
+ showLeadIcon: H,
26
+ icon: M,
27
+ allowSearch: N,
28
+ searchHandler: B,
29
+ searchPlaceholder: A,
30
30
  onToggle: i,
31
31
  multiSelect: m = !1,
32
- isLoading: A = !1,
32
+ isLoading: V = !1,
33
33
  currentSelectedOptions: p = [],
34
- isInteractive: I = !1,
34
+ isInteractive: L = !1,
35
35
  //Table related props
36
- columns: V,
37
- isTableHeadVisible: Q = !1,
38
- getDisplayValue: y,
39
- isRowDisabled: X,
40
- rowClassName: Y,
41
- endIcon: E
42
- } = d, x = se(), { t: L } = me(), C = g(null), a = g(null), Z = g(null), q = g(d.currentSelectedOptions !== void 0), [u, b] = v(!1), [G, J] = v(0), [$, K] = v({ top: 0, left: 0 }), [l, S] = v(p), O = H ?? /* @__PURE__ */ t.jsx(t.Fragment, {}), U = fe("dropdown"), h = oe(() => {
36
+ columns: Q,
37
+ isTableHeadVisible: X = !1,
38
+ getDisplayValue: g,
39
+ isRowDisabled: Y,
40
+ rowClassName: Z,
41
+ endIcon: E,
42
+ optionTooltipLabel: C
43
+ } = d, x = ae(), { t: $ } = he(), b = y(null), a = y(null), q = y(null), G = y(d.currentSelectedOptions !== void 0), [u, D] = v(!1), [J, K] = v(0), [O, U] = v({ top: 0, left: 0 }), [l, S] = v(p), k = M ?? /* @__PURE__ */ t.jsx(t.Fragment, {}), _ = me("dropdown"), h = le(() => {
43
44
  if (a != null && a.current) {
44
45
  const e = a.current.getBoundingClientRect();
45
- J(a.current.offsetWidth / 16), K({
46
+ K(a.current.offsetWidth / 16), U({
46
47
  top: e.bottom + window.scrollY,
47
48
  left: e.left + window.scrollX
48
49
  });
49
50
  }
50
51
  }, []);
51
- D(() => (u && (h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0)), () => {
52
+ T(() => (u && (h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0)), () => {
52
53
  window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
53
- }), [u, h]), D(() => {
54
- if (!q.current) return;
54
+ }), [u, h]), T(() => {
55
+ if (!G.current) return;
55
56
  (p.length !== l.length || p.some((n, o) => {
56
57
  var c;
57
58
  return n[r] !== ((c = l[o]) == null ? void 0 : c[r]);
58
59
  })) && S(p);
59
60
  }, [p]);
60
- const _ = (e, n, o, c = "default") => o ? x.colors.grey.n400 : e ? x.colors.state.error.n450 : n ? x.colors.primary.dark.n600 : c === "light-primary" ? x.colors.primary.purple.n450 : x.colors.grey.n300, k = (e) => l.some((n) => typeof n == "object" && typeof e == "object" ? n[r] === e[r] : n.value === e.value), ee = (e) => {
61
+ const ee = (e, n, o, c = "default") => o ? x.colors.grey.n400 : e ? x.colors.state.error.n450 : n ? x.colors.primary.dark.n600 : c === "light-primary" ? x.colors.primary.purple.n450 : x.colors.grey.n300, R = (e) => l.some((n) => typeof n == "object" && typeof e == "object" ? n[r] === e[r] : n.value === e.value), te = (e) => {
61
62
  if (m) {
62
- const n = k(e);
63
+ const n = R(e);
63
64
  let o;
64
65
  n ? o = l.filter((c) => typeof c == "object" && typeof e == "object" ? c[r] !== e[r] : c.value !== e.value) : o = [...l, e], S(o), w(o);
65
66
  } else
66
- S([e]), w(e), b(!1), i == null || i(!1);
67
- }, te = (e) => {
67
+ S([e]), w(e), D(!1), i == null || i(!1);
68
+ }, ne = (e) => {
68
69
  const n = l.filter((o) => typeof o == "object" && typeof e == "object" ? o[r] !== e[r] : o.value !== e.value);
69
70
  S(n), w(n);
70
- }, ne = (e) => {
71
- if (e.length === 0) return W;
71
+ }, re = (e) => {
72
+ if (e.length === 0) return z;
72
73
  if (!m) {
73
74
  const n = e[0];
74
- if (y)
75
- return y(n);
75
+ if (g)
76
+ return g(n);
76
77
  if (j)
77
78
  return String(n == null ? void 0 : n[j]);
78
79
  if (r)
79
80
  return String(n == null ? void 0 : n[r]);
80
81
  }
81
- return `${e.length} ${L("SELECTED")}`;
82
+ return `${e.length} ${$("SELECTED")}`;
82
83
  };
83
- D(() => {
84
+ T(() => {
84
85
  const e = (n) => {
85
- C.current && a.current && !C.current.contains(n.target) && !a.current.contains(n.target) && (b(!1), i == null || i(!1));
86
+ b.current && a.current && !b.current.contains(n.target) && !a.current.contains(n.target) && (D(!1), i == null || i(!1));
86
87
  };
87
88
  return u && document.addEventListener("mousedown", e), () => {
88
89
  document.removeEventListener("mousedown", e);
89
90
  };
90
91
  }, [u, i]);
91
- const re = () => I || (s == null ? void 0 : s.length) === 0 ? null : /* @__PURE__ */ t.jsx(ae, { error: s, children: s });
92
- return /* @__PURE__ */ t.jsxs(he, { children: [
93
- T && /* @__PURE__ */ t.jsxs(pe, { children: [
94
- /* @__PURE__ */ t.jsx("label", { children: T }),
95
- z && /* @__PURE__ */ t.jsx("span", { children: L("OPTIONAL") })
92
+ const oe = () => L || (s == null ? void 0 : s.length) === 0 ? null : /* @__PURE__ */ t.jsx(ce, { error: s, children: s });
93
+ return /* @__PURE__ */ t.jsxs(pe, { children: [
94
+ I && /* @__PURE__ */ t.jsxs(xe, { children: [
95
+ /* @__PURE__ */ t.jsx("label", { children: I }),
96
+ F && /* @__PURE__ */ t.jsx("span", { children: $("OPTIONAL") })
96
97
  ] }),
97
98
  /* @__PURE__ */ t.jsxs(
98
- xe,
99
+ Se,
99
100
  {
100
101
  show: u,
101
102
  onToggle: () => {
102
- i == null || i(!u), b((e) => !e);
103
+ i == null || i(!u), D((e) => !e);
103
104
  },
104
105
  placement: "bottom-start",
105
106
  autoClose: m ? "outside" : !0,
106
107
  children: [
107
- /* @__PURE__ */ t.jsx(Se, { disabled: f, ref: a, $valid: !s, $variant: d.variant || "default", children: /* @__PURE__ */ t.jsx(je, { $valid: !s, $isInteractive: I, $hasDyncWidth: !f, children: /* @__PURE__ */ t.jsxs("div", { className: "title-container", children: [
108
+ /* @__PURE__ */ t.jsx(je, { disabled: f, ref: a, $valid: !s, $variant: d.variant || "default", children: /* @__PURE__ */ t.jsx(we, { $valid: !s, $isInteractive: L, $hasDyncWidth: !f, children: /* @__PURE__ */ t.jsxs("div", { className: "title-container", children: [
108
109
  /* @__PURE__ */ t.jsxs("div", { className: "heading-container", children: [
109
- F && typeof O == "function" && /* @__PURE__ */ t.jsx(O, {}),
110
+ H && typeof k == "function" && /* @__PURE__ */ t.jsx(k, {}),
110
111
  /* @__PURE__ */ t.jsx(
111
- ue,
112
+ fe,
112
113
  {
113
114
  component: "span",
114
115
  variant: "mdText",
115
- color: _(s, l.length > 0, f, d.variant || "default"),
116
- children: ne(l)
116
+ color: ee(s, l.length > 0, f, d.variant || "default"),
117
+ children: re(l)
117
118
  }
118
119
  )
119
120
  ] }),
120
- (E || !f) && /* @__PURE__ */ t.jsxs(we, { children: [
121
+ (E || !f) && /* @__PURE__ */ t.jsxs(ge, { children: [
121
122
  E,
122
123
  !m && l.length > 0 && !f && /* @__PURE__ */ t.jsx(
123
- R,
124
+ P,
124
125
  {
125
126
  style: { cursor: "pointer", marginLeft: "0.5rem" },
126
127
  onClick: (e) => {
@@ -128,46 +129,47 @@ const Ne = (d) => {
128
129
  }
129
130
  }
130
131
  ),
131
- !f && /* @__PURE__ */ t.jsx(ie, {})
132
+ !f && /* @__PURE__ */ t.jsx(se, {})
132
133
  ] })
133
134
  ] }) }) }),
134
- u && le(
135
+ u && ie(
135
136
  /* @__PURE__ */ t.jsxs(
136
137
  ye,
137
138
  {
138
- ref: C,
139
- $menuWidth: G,
140
- $zIndex: U,
139
+ ref: b,
140
+ $menuWidth: J,
141
+ $zIndex: _,
141
142
  style: {
142
143
  position: "fixed",
143
- top: `${$.top}px`,
144
- left: `${$.left}px`
144
+ top: `${O.top}px`,
145
+ left: `${O.left}px`
145
146
  },
146
147
  children: [
147
- M && /* @__PURE__ */ t.jsx(ge, { children: /* @__PURE__ */ t.jsx(ce, { placeholder: B, onSearch: N }) }),
148
+ N && /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsx(de, { placeholder: A, onSearch: B }) }),
148
149
  /* @__PURE__ */ t.jsxs(
149
- ve,
150
+ Ce,
150
151
  {
151
- ref: Z,
152
+ ref: q,
152
153
  onScroll: (e) => {
153
154
  var n;
154
155
  (n = d.onScroll) == null || n.call(d, e);
155
156
  },
156
157
  children: [
157
158
  /* @__PURE__ */ t.jsx(
158
- Te,
159
+ Ie,
159
160
  {
160
161
  keyField: r,
161
- data: P,
162
- columns: V,
163
- onRowClick: (e) => ee(e),
164
- isRowSelected: (e) => k(e),
165
- isTableHeadVisible: Q,
166
- isRowDisabled: X,
167
- rowClassName: Y
162
+ data: W,
163
+ columns: Q,
164
+ onRowClick: (e) => te(e),
165
+ isRowSelected: (e) => R(e),
166
+ isTableHeadVisible: X,
167
+ isRowDisabled: Y,
168
+ rowClassName: Z,
169
+ getRowTooltip: C ? (e) => e[C] != null ? String(e[C]) : void 0 : void 0
168
170
  }
169
171
  ),
170
- A && /* @__PURE__ */ t.jsx(Ce, { children: /* @__PURE__ */ t.jsx(de, {}) })
172
+ V && /* @__PURE__ */ t.jsx(be, { children: /* @__PURE__ */ t.jsx(ue, {}) })
171
173
  ]
172
174
  }
173
175
  )
@@ -179,13 +181,13 @@ const Ne = (d) => {
179
181
  ]
180
182
  }
181
183
  ),
182
- m && l.length > 0 && /* @__PURE__ */ t.jsx(be, { children: l.map((e) => /* @__PURE__ */ t.jsxs(De, { children: [
183
- y ? y(e) : String(j ? e[j] : e[r]),
184
- /* @__PURE__ */ t.jsx(R, { onClick: () => te(e) })
184
+ m && l.length > 0 && /* @__PURE__ */ t.jsx(De, { children: l.map((e) => /* @__PURE__ */ t.jsxs(Te, { children: [
185
+ g ? g(e) : String(j ? e[j] : e[r]),
186
+ /* @__PURE__ */ t.jsx(P, { onClick: () => ne(e) })
185
187
  ] }, String(e[r]))) }),
186
- re()
188
+ oe()
187
189
  ] });
188
190
  };
189
191
  export {
190
- Ne as default
192
+ Be as default
191
193
  };
@@ -27,4 +27,5 @@ export interface DropDownWithTableProps<T extends Record<string, unknown>> {
27
27
  isRowDisabled?: (row: T) => boolean;
28
28
  rowClassName?: (row: T, index: number) => string;
29
29
  endIcon?: React.ReactNode;
30
+ optionTooltipLabel?: keyof T;
30
31
  }
@@ -1,3 +1,3 @@
1
1
  import type { TableProps } from './Table.types';
2
- declare function Table<T extends Record<string, unknown>>({ columns, data, keyField, selectable, onRowSelect, rowActions, stickyHeader, loading, emptyStateMessage, pagination, onRowClick, rowClassName, isRowDisabled, breakpoint, alignHeader, isTableHeadVisible, isRowSelected: externalIsRowSelected, }: Readonly<TableProps<T>>): import("react/jsx-runtime").JSX.Element;
2
+ declare function Table<T extends Record<string, unknown>>({ columns, data, keyField, selectable, onRowSelect, rowActions, stickyHeader, loading, emptyStateMessage, pagination, onRowClick, rowClassName, isRowDisabled, breakpoint, alignHeader, isTableHeadVisible, isRowSelected: externalIsRowSelected, getRowTooltip, }: Readonly<TableProps<T>>): import("react/jsx-runtime").JSX.Element;
3
3
  export default Table;
@@ -1,100 +1,103 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as v, useEffect as L, useMemo as Q } from "react";
3
- import { useTranslation as U } from "react-i18next";
4
- import X from "../../Spinner.js";
5
- import Y from "../../Pagination.js";
6
- import Z from "../../Typography.js";
7
- import O, { CheckboxCell as H } from "./components/CellComponents.js";
8
- import z from "./components/TableHead.js";
9
- import { TableContainer as D, LoadingOverlay as k, TablesWrapper as F, DataScrollBox as R, StyledTable as w, TableBody as W, EmptyState as ee, TableRow as y, TableCellContainer as b, ActionsTable as te, TableFooter as se } from "./Table.styles.js";
10
- function xe({
11
- columns: T,
12
- data: s,
13
- keyField: l,
14
- selectable: j = !1,
15
- onRowSelect: o,
16
- rowActions: x,
17
- stickyHeader: $ = !1,
2
+ import { useState as b, useId as X, useEffect as O, useMemo as Y } from "react";
3
+ import { useTranslation as H } from "react-i18next";
4
+ import { Tooltip as D } from "../../../node_modules/react-tooltip/dist/react-tooltip.min.js";
5
+ import k from "../../Spinner.js";
6
+ import F from "../../Pagination.js";
7
+ import R from "../../Typography.js";
8
+ import z, { CheckboxCell as w } from "./components/CellComponents.js";
9
+ import W from "./components/TableHead.js";
10
+ import { TableContainer as ee, LoadingOverlay as te, TablesWrapper as ne, DataScrollBox as se, StyledTable as re, TableBody as y, EmptyState as le, TableRow as N, TableCellContainer as C, ActionsTable as ie, TableFooter as ce } from "./Table.styles.js";
11
+ function ge({
12
+ columns: S,
13
+ data: n,
14
+ keyField: i,
15
+ selectable: p = !1,
16
+ onRowSelect: x,
17
+ rowActions: u,
18
+ stickyHeader: T = !1,
18
19
  loading: f = !1,
19
- emptyStateMessage: I,
20
- pagination: n,
21
- onRowClick: u,
22
- rowClassName: p,
23
- isRowDisabled: d,
24
- breakpoint: N = "md",
25
- alignHeader: C = "start",
20
+ emptyStateMessage: K,
21
+ pagination: l,
22
+ onRowClick: j,
23
+ rowClassName: a,
24
+ isRowDisabled: o,
25
+ breakpoint: _ = "md",
26
+ alignHeader: B = "start",
26
27
  // Dropdown related props
27
- isTableHeadVisible: _ = !1,
28
- isRowSelected: S
28
+ isTableHeadVisible: M = !1,
29
+ isRowSelected: A,
30
+ getRowTooltip: m
29
31
  }) {
30
- const [h, g] = v([]), [B, a] = v(N), [K, A] = v(null), { t: M } = U();
31
- L(() => {
32
+ const [h, $] = b([]), [E, g] = b(_), [V, I] = b(null), { t: Z } = H(), L = X();
33
+ O(() => {
32
34
  const e = () => {
33
- A(null);
35
+ I(null);
34
36
  };
35
37
  return document.addEventListener("click", e), () => {
36
38
  document.removeEventListener("click", e);
37
39
  };
38
- }, []), L(() => {
40
+ }, []), O(() => {
39
41
  const e = () => {
40
- const i = window.innerWidth;
41
- i < 576 ? a("sm") : i < 992 ? a("md") : a("lg");
42
+ const s = window.innerWidth;
43
+ s < 576 ? g("sm") : s < 992 ? g("md") : g("lg");
42
44
  };
43
45
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
44
46
  }, []);
45
- const P = Q(() => T.filter((e) => typeof e.hidden == "function" ? !e.hidden(B) : !e.hidden), [T, B]), V = () => {
46
- h.length === s.length ? g([]) : g([...s]), o && o(h.length === s.length ? [] : [...s]);
47
- }, q = (e) => {
48
- const i = h.filter((r) => e[l] === r[l]);
49
- return i && i.length > 0;
47
+ const v = Y(() => S.filter((e) => typeof e.hidden == "function" ? !e.hidden(E) : !e.hidden), [S, E]), q = () => {
48
+ h.length === n.length ? $([]) : $([...n]), x && x(h.length === n.length ? [] : [...n]);
50
49
  }, G = (e) => {
51
- const i = h.some((m) => m[l] === e[l]);
50
+ const s = h.filter((r) => e[i] === r[i]);
51
+ return s && s.length > 0;
52
+ }, J = (e) => {
53
+ const s = h.some((d) => d[i] === e[i]);
52
54
  let r;
53
- i ? r = h.filter((m) => m[l] !== e[l]) : r = [...h, e], g(r), o && o(r);
55
+ s ? r = h.filter((d) => d[i] !== e[i]) : r = [...h, e], $(r), x && x(r);
54
56
  };
55
- return /* @__PURE__ */ t.jsxs(D, { children: [
56
- f && /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(X, { size: "3rem" }) }),
57
- /* @__PURE__ */ t.jsxs(F, { children: [
58
- /* @__PURE__ */ t.jsx(R, { children: /* @__PURE__ */ t.jsxs(w, { children: [
59
- _ && /* @__PURE__ */ t.jsx(
60
- z,
57
+ return /* @__PURE__ */ t.jsxs(ee, { children: [
58
+ f && /* @__PURE__ */ t.jsx(te, { children: /* @__PURE__ */ t.jsx(k, { size: "3rem" }) }),
59
+ /* @__PURE__ */ t.jsxs(ne, { children: [
60
+ /* @__PURE__ */ t.jsx(se, { children: /* @__PURE__ */ t.jsxs(re, { children: [
61
+ M && /* @__PURE__ */ t.jsx(
62
+ W,
61
63
  {
62
- data: s,
63
- handleSelectAll: V,
64
+ data: n,
65
+ handleSelectAll: q,
64
66
  selectedRows: h,
65
- visibleColumns: P,
66
- alignHeader: C,
67
+ visibleColumns: v,
68
+ alignHeader: B,
67
69
  rowActions: void 0,
68
- stickyHeader: $,
69
- selectable: j,
70
+ stickyHeader: T,
71
+ selectable: p,
70
72
  loading: f
71
73
  }
72
74
  ),
73
- /* @__PURE__ */ t.jsx(W, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (j ? 1 : 0) + P.length, children: /* @__PURE__ */ t.jsx(ee, { children: /* @__PURE__ */ t.jsx(Z, { variant: "mdText", children: I ?? M("NO_DATA_AVAILABLE") }) }) }) }) : s == null ? void 0 : s.map((e, i) => {
74
- const r = (d == null ? void 0 : d(e)) ?? !1, m = S ? S(e) : h.some((c) => c[l] === e[l]), E = e[l], J = (p == null ? void 0 : p(e, i)) ?? "";
75
+ /* @__PURE__ */ t.jsx(y, { children: n.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (p ? 1 : 0) + v.length, children: /* @__PURE__ */ t.jsx(le, { children: /* @__PURE__ */ t.jsx(R, { variant: "mdText", children: K ?? Z("NO_DATA_AVAILABLE") }) }) }) }) : n == null ? void 0 : n.map((e, s) => {
76
+ const r = (o == null ? void 0 : o(e)) ?? !1, d = A ? A(e) : h.some((c) => c[i] === e[i]), P = e[i], Q = (a == null ? void 0 : a(e, s)) ?? "", U = (m == null ? void 0 : m(e)) ? `${L}-${String(P)}` : void 0;
75
77
  return /* @__PURE__ */ t.jsxs(
76
- y,
78
+ N,
77
79
  {
78
- $selected: m,
80
+ $selected: d,
79
81
  $disabled: r,
80
- $clickable: !!u && !r,
81
- onClick: () => !r && (u == null ? void 0 : u(e)),
82
- className: J,
82
+ $clickable: !!j && !r,
83
+ onClick: () => !r && (j == null ? void 0 : j(e)),
84
+ className: Q,
85
+ "data-tooltip-id": U,
83
86
  children: [
84
- j && /* @__PURE__ */ t.jsx(b, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
85
- H,
87
+ p && /* @__PURE__ */ t.jsx(C, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
88
+ w,
86
89
  {
87
90
  checkBoxOptions: {
88
- checked: q(e),
91
+ checked: G(e),
89
92
  $variant: "primary",
90
93
  $disabled: r,
91
94
  $size: "sm",
92
- onChange: () => !r && G(e)
95
+ onChange: () => !r && J(e)
93
96
  }
94
97
  }
95
98
  ) }),
96
- P.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
97
- O,
99
+ v.map((c) => /* @__PURE__ */ t.jsx(C, { $align: c.align, children: /* @__PURE__ */ t.jsx(
100
+ z,
98
101
  {
99
102
  column: c,
100
103
  row: e,
@@ -105,66 +108,72 @@ function xe({
105
108
  minWidth: c.minWidth ?? "",
106
109
  maxWidth: c.maxWidth ?? ""
107
110
  }
108
- ) }, `${E}-${c.id}`))
111
+ ) }, `${P}-${c.id}`))
109
112
  ]
110
113
  },
111
- E
114
+ P
112
115
  );
113
116
  }) })
114
117
  ] }) }),
115
- x && x.length > 0 && /* @__PURE__ */ t.jsxs(te, { children: [
118
+ u && u.length > 0 && /* @__PURE__ */ t.jsxs(ie, { children: [
116
119
  /* @__PURE__ */ t.jsx(
117
- z,
120
+ W,
118
121
  {
119
- data: s,
122
+ data: n,
120
123
  handleSelectAll: () => {
121
124
  },
122
125
  selectedRows: h,
123
126
  visibleColumns: [],
124
- alignHeader: C,
125
- rowActions: x,
126
- stickyHeader: $,
127
+ alignHeader: B,
128
+ rowActions: u,
129
+ stickyHeader: T,
127
130
  selectable: !1,
128
131
  loading: f
129
132
  }
130
133
  ),
131
- /* @__PURE__ */ t.jsx(W, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : s == null ? void 0 : s.map((e) => {
132
- const i = (d == null ? void 0 : d(e)) ?? !1;
133
- return /* @__PURE__ */ t.jsx(y, { $disabled: i, children: /* @__PURE__ */ t.jsx(b, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
134
- O,
134
+ /* @__PURE__ */ t.jsx(y, { children: n.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : n == null ? void 0 : n.map((e) => {
135
+ const s = (o == null ? void 0 : o(e)) ?? !1;
136
+ return /* @__PURE__ */ t.jsx(N, { $disabled: s, children: /* @__PURE__ */ t.jsx(C, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
137
+ z,
135
138
  {
136
139
  row: e,
137
140
  type: "icon",
138
141
  iconOptions: {
139
- keyField: l,
140
- rowActions: x,
141
- activeDropdown: K,
142
- setActiveDropdown: A
142
+ keyField: i,
143
+ rowActions: u,
144
+ activeDropdown: V,
145
+ setActiveDropdown: I
143
146
  }
144
147
  }
145
- ) }) }, `action-${e[l]}`);
148
+ ) }) }, `action-${e[i]}`);
146
149
  }) })
147
150
  ] })
148
151
  ] }),
149
- n && n.enabled && /* @__PURE__ */ t.jsx(se, { children: /* @__PURE__ */ t.jsx(
150
- Y,
152
+ m && n.map((e) => {
153
+ const s = m(e);
154
+ if (!s) return null;
155
+ const r = e[i], d = `${L}-${String(r)}`;
156
+ return /* @__PURE__ */ t.jsx(D, { id: d, content: s }, d);
157
+ }),
158
+ l && l.enabled && /* @__PURE__ */ t.jsx(ce, { children: /* @__PURE__ */ t.jsx(
159
+ F,
151
160
  {
152
- currentPage: n.currentPage,
153
- totalPages: n.totalPages,
154
- onChange: n.onPageChange,
161
+ currentPage: l.currentPage,
162
+ totalPages: l.totalPages,
163
+ onChange: l.onPageChange,
155
164
  disabled: f,
156
- hidePrevButton: n.hidePrevButton,
157
- hideNextButton: n.hideNextButton,
158
- siblingCount: n.siblingCount,
159
- boundaryCount: n.boundaryCount,
160
- itemsPerPage: n.pageSize,
161
- totalItems: n.totalItems,
162
- itemsPerPageOptions: n.itemsPerPageOptions,
163
- onItemsPerPageChange: n.onItemsPerPageChange
165
+ hidePrevButton: l.hidePrevButton,
166
+ hideNextButton: l.hideNextButton,
167
+ siblingCount: l.siblingCount,
168
+ boundaryCount: l.boundaryCount,
169
+ itemsPerPage: l.pageSize,
170
+ totalItems: l.totalItems,
171
+ itemsPerPageOptions: l.itemsPerPageOptions,
172
+ onItemsPerPageChange: l.onItemsPerPageChange
164
173
  }
165
174
  ) })
166
175
  ] });
167
176
  }
168
177
  export {
169
- xe as default
178
+ ge as default
170
179
  };
@@ -56,6 +56,7 @@ export type TableProps<T> = {
56
56
  alignHeader?: ColumnAlignment;
57
57
  isTableHeadVisible?: boolean;
58
58
  isRowSelected?: (row: T) => boolean;
59
+ getRowTooltip?: (row: T) => string | undefined;
59
60
  };
60
61
  export type CurrencyCode = 'SAR';
61
62
  export type CellType = 'user' | 'product' | 'flag' | 'text' | 'amount' | 'badge' | 'progress' | 'icon' | 'header' | 'checkbox' | 'radioButton' | 'custom' | 'transaction';