qaema-ui 0.0.24 → 0.0.26
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.
- package/dist/assets/icons/RiyalIcon.d.ts +6 -0
- package/dist/assets/icons/RiyalIcon.js +26 -0
- package/dist/assets/icons/index.d.ts +1 -0
- package/dist/components/DropDownWithTable/DropDownWithTable.d.ts +3 -0
- package/dist/components/DropDownWithTable/DropDownWithTable.js +184 -0
- package/dist/components/DropDownWithTable/DropDownWithTable.types.d.ts +28 -0
- package/dist/components/DropDownWithTable/Table/Table.d.ts +3 -0
- package/dist/components/DropDownWithTable/Table/Table.js +169 -0
- package/dist/components/DropDownWithTable/Table/Table.styles.d.ts +58 -0
- package/dist/components/DropDownWithTable/Table/Table.styles.js +285 -0
- package/dist/components/DropDownWithTable/Table/Table.types.d.ts +73 -0
- package/dist/components/DropDownWithTable/Table/components/CellComponents.d.ts +116 -0
- package/dist/components/DropDownWithTable/Table/components/CellComponents.js +118 -0
- package/dist/components/DropDownWithTable/Table/components/TableHead.d.ts +14 -0
- package/dist/components/DropDownWithTable/Table/components/TableHead.js +58 -0
- package/dist/components/NextActionBox.d.ts +13 -0
- package/dist/components/TotalsSummary.d.ts +13 -0
- package/dist/components/TotalsSummary.js +84 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.js +141 -137
- package/dist/node_modules/react-bootstrap/esm/Spinner.js +26 -0
- package/dist/styles/Dropdown.styles.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { j as i } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import "react";
|
|
3
|
+
function e({ color: t = "#6D798A", ...l }) {
|
|
4
|
+
return /* @__PURE__ */ i.jsxs("svg", { width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l, children: [
|
|
5
|
+
/* @__PURE__ */ i.jsxs("g", { clipPath: "url(#clip0_7331_7983)", children: [
|
|
6
|
+
/* @__PURE__ */ i.jsx(
|
|
7
|
+
"path",
|
|
8
|
+
{
|
|
9
|
+
d: "M11.2024 17.7177C10.8812 18.4258 10.6689 19.1942 10.5875 20L17.3849 18.5635C17.7061 17.8556 17.9182 17.0871 17.9998 16.2812L11.2024 17.7177Z",
|
|
10
|
+
fill: t
|
|
11
|
+
}
|
|
12
|
+
),
|
|
13
|
+
/* @__PURE__ */ i.jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M17.385 14.2599C17.7062 13.552 17.9185 12.7835 17.9999 11.9777L12.705 13.0972V10.945L17.3848 9.9563C17.7061 9.2484 17.9184 8.47985 17.9997 7.67405L12.7048 8.79265V1.0527C11.8934 1.50558 11.1729 2.10842 10.5872 2.81951V9.24028L8.46955 9.68776V0C7.65821 0.452726 6.93766 1.05572 6.35193 1.76681V10.1351L1.61375 11.136C1.29255 11.8439 1.08006 12.6125 0.998561 13.4183L6.35193 12.2873V14.9976L0.614748 16.2096C0.293542 16.9175 0.0812201 17.6861 -0.00012207 18.4919L6.00511 17.2232C6.49396 17.1221 6.91412 16.8347 7.18729 16.4393L8.28861 14.8161V14.8158C8.40294 14.6478 8.46955 14.4454 8.46955 14.2273V11.8398L10.5872 11.3923V15.6967L17.3848 14.2596L17.385 14.2599Z",
|
|
17
|
+
fill: t
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_7331_7983", children: /* @__PURE__ */ i.jsx("rect", { width: "18", height: "20", fill: "white" }) }) })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
e as default
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SaudiRiyalIcon } from './RiyalIcon';
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { j as t } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useRef as g, useState as v, useCallback as ne, useEffect as D } from "react";
|
|
3
|
+
import { createPortal as re } from "react-dom";
|
|
4
|
+
import { FaTimes as k, FaAngleDown as oe } from "../../node_modules/react-icons/fa/index.js";
|
|
5
|
+
import { useTheme as le } from "styled-components";
|
|
6
|
+
import { HelperTextWrapper as ie } from "../PhoneInputField.js";
|
|
7
|
+
import se from "../SearchBar.js";
|
|
8
|
+
import ae from "../Typography.js";
|
|
9
|
+
import ce from "../../hooks/useZIndex.js";
|
|
10
|
+
import { useQaemaCoreTranslation as de } from "../../i18n/i18n.js";
|
|
11
|
+
import { StyledDropDownContainer as ue, StyledlabelContainer as fe, StyledDropDown as me, StyledDropDownToggle as he, StyledDropDownTitle as pe, IconsContainer as xe, StyledDropDownMenu as Se, SearchContainer as je, StyledOptionsContainer as we, StyledDropItem as ye, SelectedTagsContainer as ge, SelectedTag as ve } from "../../styles/Dropdown.styles.js";
|
|
12
|
+
import Ce from "./Table/Table.js";
|
|
13
|
+
import be from "../../node_modules/react-bootstrap/esm/Spinner.js";
|
|
14
|
+
const He = (d) => {
|
|
15
|
+
const {
|
|
16
|
+
label: T,
|
|
17
|
+
options: P,
|
|
18
|
+
placeholder: R = "Select Something",
|
|
19
|
+
optional: W = !1,
|
|
20
|
+
error: s = "",
|
|
21
|
+
disabled: S = !1,
|
|
22
|
+
selectIdentifier: j,
|
|
23
|
+
keyIdentifier: r = "id",
|
|
24
|
+
selectCallBack: w,
|
|
25
|
+
showLeadIcon: z,
|
|
26
|
+
icon: F,
|
|
27
|
+
allowSearch: H,
|
|
28
|
+
searchHandler: M,
|
|
29
|
+
searchPlaceholder: B,
|
|
30
|
+
onToggle: i,
|
|
31
|
+
multiSelect: f = !1,
|
|
32
|
+
isLoading: N = !1,
|
|
33
|
+
currentSelectedOptions: h = [],
|
|
34
|
+
isInteractive: I = !1,
|
|
35
|
+
//Table related props
|
|
36
|
+
columns: A,
|
|
37
|
+
isTableHeadVisible: V = !1,
|
|
38
|
+
getDisplayValue: y,
|
|
39
|
+
isRowDisabled: Q
|
|
40
|
+
} = d, p = le(), { t: E } = de(), C = g(null), a = g(null), X = g(null), Y = g(d.currentSelectedOptions !== void 0), [u, b] = v(!1), [Z, q] = v(0), [L, G] = v({ top: 0, left: 0 }), [l, x] = v(h), $ = F ?? /* @__PURE__ */ t.jsx(t.Fragment, {}), J = ce("dropdown"), m = ne(() => {
|
|
41
|
+
if (a != null && a.current) {
|
|
42
|
+
const e = a.current.getBoundingClientRect();
|
|
43
|
+
q(a.current.offsetWidth / 16), G({
|
|
44
|
+
top: e.bottom + window.scrollY,
|
|
45
|
+
left: e.left + window.scrollX
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
D(() => (u && (m(), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0)), () => {
|
|
50
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
51
|
+
}), [u, m]), D(() => {
|
|
52
|
+
if (!Y.current) return;
|
|
53
|
+
(h.length !== l.length || h.some((n, o) => {
|
|
54
|
+
var c;
|
|
55
|
+
return n[r] !== ((c = l[o]) == null ? void 0 : c[r]);
|
|
56
|
+
})) && x(h);
|
|
57
|
+
}, [h]);
|
|
58
|
+
const K = (e, n, o, c = "default") => o ? p.colors.grey.n400 : e ? p.colors.state.error.n450 : n ? p.colors.primary.dark.n600 : c === "light-primary" ? p.colors.primary.purple.n450 : p.colors.grey.n300, O = (e) => l.some((n) => typeof n == "object" && typeof e == "object" ? n[r] === e[r] : n.value === e.value), U = (e) => {
|
|
59
|
+
if (f) {
|
|
60
|
+
const n = O(e);
|
|
61
|
+
let o;
|
|
62
|
+
n ? o = l.filter((c) => typeof c == "object" && typeof e == "object" ? c[r] !== e[r] : c.value !== e.value) : o = [...l, e], x(o), w(o);
|
|
63
|
+
} else
|
|
64
|
+
x([e]), w(e), b(!1), i == null || i(!1);
|
|
65
|
+
}, _ = (e) => {
|
|
66
|
+
const n = l.filter((o) => typeof o == "object" && typeof e == "object" ? o[r] !== e[r] : o.value !== e.value);
|
|
67
|
+
x(n), w(n);
|
|
68
|
+
}, ee = (e) => {
|
|
69
|
+
if (e.length === 0) return R;
|
|
70
|
+
if (!f) {
|
|
71
|
+
const n = e[0];
|
|
72
|
+
if (y)
|
|
73
|
+
return y(n);
|
|
74
|
+
if (j)
|
|
75
|
+
return String(n == null ? void 0 : n[j]);
|
|
76
|
+
if (r)
|
|
77
|
+
return String(n == null ? void 0 : n[r]);
|
|
78
|
+
}
|
|
79
|
+
return `${e.length} ${E("SELECTED")}`;
|
|
80
|
+
};
|
|
81
|
+
D(() => {
|
|
82
|
+
const e = (n) => {
|
|
83
|
+
C.current && a.current && !C.current.contains(n.target) && !a.current.contains(n.target) && (b(!1), i == null || i(!1));
|
|
84
|
+
};
|
|
85
|
+
return u && document.addEventListener("mousedown", e), () => {
|
|
86
|
+
document.removeEventListener("mousedown", e);
|
|
87
|
+
};
|
|
88
|
+
}, [u, i]);
|
|
89
|
+
const te = () => I || (s == null ? void 0 : s.length) === 0 ? null : /* @__PURE__ */ t.jsx(ie, { error: s, children: s });
|
|
90
|
+
return /* @__PURE__ */ t.jsxs(ue, { children: [
|
|
91
|
+
T && /* @__PURE__ */ t.jsxs(fe, { children: [
|
|
92
|
+
/* @__PURE__ */ t.jsx("label", { children: T }),
|
|
93
|
+
W && /* @__PURE__ */ t.jsx("span", { children: E("OPTIONAL") })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ t.jsxs(
|
|
96
|
+
me,
|
|
97
|
+
{
|
|
98
|
+
show: u,
|
|
99
|
+
onToggle: () => {
|
|
100
|
+
i == null || i(!u), b((e) => !e);
|
|
101
|
+
},
|
|
102
|
+
placement: "bottom-start",
|
|
103
|
+
autoClose: f ? "outside" : !0,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ t.jsx(he, { disabled: S, ref: a, $valid: !s, $variant: d.variant || "default", children: /* @__PURE__ */ t.jsx(pe, { $valid: !s, $isInteractive: I, children: /* @__PURE__ */ t.jsxs("div", { className: "title-container", children: [
|
|
106
|
+
/* @__PURE__ */ t.jsxs("div", { className: "heading-container", children: [
|
|
107
|
+
z && typeof $ == "function" && /* @__PURE__ */ t.jsx($, {}),
|
|
108
|
+
/* @__PURE__ */ t.jsx(
|
|
109
|
+
ae,
|
|
110
|
+
{
|
|
111
|
+
component: "span",
|
|
112
|
+
variant: "mdText",
|
|
113
|
+
color: K(s, l.length > 0, S, d.variant || "default"),
|
|
114
|
+
children: ee(l)
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ t.jsxs(xe, { children: [
|
|
119
|
+
!f && l.length > 0 && !S && /* @__PURE__ */ t.jsx(
|
|
120
|
+
k,
|
|
121
|
+
{
|
|
122
|
+
style: { cursor: "pointer", marginLeft: "0.5rem" },
|
|
123
|
+
onClick: (e) => {
|
|
124
|
+
e.stopPropagation(), x([]), w(f ? [] : null);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
!S && /* @__PURE__ */ t.jsx(oe, {})
|
|
129
|
+
] })
|
|
130
|
+
] }) }) }),
|
|
131
|
+
u && re(
|
|
132
|
+
/* @__PURE__ */ t.jsxs(
|
|
133
|
+
Se,
|
|
134
|
+
{
|
|
135
|
+
ref: C,
|
|
136
|
+
$menuWidth: Z,
|
|
137
|
+
$zIndex: J,
|
|
138
|
+
style: {
|
|
139
|
+
position: "fixed",
|
|
140
|
+
top: `${L.top}px`,
|
|
141
|
+
left: `${L.left}px`
|
|
142
|
+
},
|
|
143
|
+
children: [
|
|
144
|
+
H && /* @__PURE__ */ t.jsx(je, { children: /* @__PURE__ */ t.jsx(se, { placeholder: B, onSearch: M }) }),
|
|
145
|
+
/* @__PURE__ */ t.jsx(
|
|
146
|
+
we,
|
|
147
|
+
{
|
|
148
|
+
ref: X,
|
|
149
|
+
onScroll: (e) => {
|
|
150
|
+
var n;
|
|
151
|
+
(n = d.onScroll) == null || n.call(d, e);
|
|
152
|
+
},
|
|
153
|
+
children: N ? /* @__PURE__ */ t.jsx(ye, { $selected: !1, children: /* @__PURE__ */ t.jsx(be, {}) }) : /* @__PURE__ */ t.jsx(
|
|
154
|
+
Ce,
|
|
155
|
+
{
|
|
156
|
+
keyField: r,
|
|
157
|
+
data: P,
|
|
158
|
+
columns: A,
|
|
159
|
+
onRowClick: (e) => U(e),
|
|
160
|
+
isRowSelected: (e) => O(e),
|
|
161
|
+
isTableHeadVisible: V,
|
|
162
|
+
isRowDisabled: Q
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
document.body
|
|
171
|
+
)
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
f && l.length > 0 && /* @__PURE__ */ t.jsx(ge, { children: l.map((e) => /* @__PURE__ */ t.jsxs(ve, { children: [
|
|
176
|
+
y ? y(e) : String(j ? e[j] : e[r]),
|
|
177
|
+
/* @__PURE__ */ t.jsx(k, { onClick: () => _(e) })
|
|
178
|
+
] }, String(e[r]))) }),
|
|
179
|
+
te()
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
He as default
|
|
184
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TableColumn } from './Table/Table.types';
|
|
2
|
+
export interface DropDownWithTableProps<T extends Record<string, unknown>> {
|
|
3
|
+
label?: string;
|
|
4
|
+
options: T[];
|
|
5
|
+
placeholder: string;
|
|
6
|
+
optional?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
error?: string;
|
|
9
|
+
selectIdentifier?: string;
|
|
10
|
+
keyIdentifier?: string;
|
|
11
|
+
showLeadIcon: boolean;
|
|
12
|
+
icon?: React.FC;
|
|
13
|
+
selectCallBack: (value: T | T[] | null) => void;
|
|
14
|
+
allowSearch: boolean;
|
|
15
|
+
searchPlaceholder?: string;
|
|
16
|
+
searchHandler?: (value: string) => void;
|
|
17
|
+
onToggle?: (show: boolean) => void;
|
|
18
|
+
multiSelect?: boolean;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
currentSelectedOptions?: Array<T>;
|
|
21
|
+
isInteractive?: boolean;
|
|
22
|
+
onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
23
|
+
variant?: 'light-primary' | 'default';
|
|
24
|
+
columns: TableColumn<T>[];
|
|
25
|
+
isTableHeadVisible?: boolean;
|
|
26
|
+
getDisplayValue?: (option: T) => string;
|
|
27
|
+
isRowDisabled?: (row: T) => boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { 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;
|
|
3
|
+
export default Table;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as v, useEffect as L, useMemo as N } from "react";
|
|
3
|
+
import { useTranslation as Q } from "react-i18next";
|
|
4
|
+
import U from "../../Spinner.js";
|
|
5
|
+
import X from "../../Pagination.js";
|
|
6
|
+
import Y from "../../Typography.js";
|
|
7
|
+
import O, { CheckboxCell as Z } from "./components/CellComponents.js";
|
|
8
|
+
import z from "./components/TableHead.js";
|
|
9
|
+
import { TableContainer as H, LoadingOverlay as D, TablesWrapper as k, DataScrollBox as F, StyledTable as R, TableBody as W, EmptyState as w, TableRow as y, TableCellContainer as b, ActionsTable as ee, TableFooter as te } from "./Table.styles.js";
|
|
10
|
+
function me({
|
|
11
|
+
columns: T,
|
|
12
|
+
data: i,
|
|
13
|
+
keyField: r,
|
|
14
|
+
selectable: u = !1,
|
|
15
|
+
onRowSelect: m,
|
|
16
|
+
rowActions: x,
|
|
17
|
+
stickyHeader: $ = !1,
|
|
18
|
+
loading: f = !1,
|
|
19
|
+
emptyStateMessage: I,
|
|
20
|
+
pagination: n,
|
|
21
|
+
onRowClick: a,
|
|
22
|
+
rowClassName: j,
|
|
23
|
+
isRowDisabled: d,
|
|
24
|
+
breakpoint: _ = "md",
|
|
25
|
+
alignHeader: C = "start",
|
|
26
|
+
// Dropdown related props
|
|
27
|
+
isTableHeadVisible: K = !1,
|
|
28
|
+
isRowSelected: S
|
|
29
|
+
}) {
|
|
30
|
+
const [h, p] = v([]), [B, g] = v(_), [M, A] = v(null), { t: V } = Q();
|
|
31
|
+
L(() => {
|
|
32
|
+
const e = () => {
|
|
33
|
+
A(null);
|
|
34
|
+
};
|
|
35
|
+
return document.addEventListener("click", e), () => {
|
|
36
|
+
document.removeEventListener("click", e);
|
|
37
|
+
};
|
|
38
|
+
}, []), L(() => {
|
|
39
|
+
const e = () => {
|
|
40
|
+
const l = window.innerWidth;
|
|
41
|
+
l < 576 ? g("sm") : l < 992 ? g("md") : g("lg");
|
|
42
|
+
};
|
|
43
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
44
|
+
}, []);
|
|
45
|
+
const P = N(() => T.filter((e) => typeof e.hidden == "function" ? !e.hidden(B) : !e.hidden), [T, B]), q = () => {
|
|
46
|
+
h.length === i.length ? p([]) : p([...i]), m && m(h.length === i.length ? [] : [...i]);
|
|
47
|
+
}, G = (e) => {
|
|
48
|
+
const l = h.filter((s) => e[r] === s[r]);
|
|
49
|
+
return l && l.length > 0;
|
|
50
|
+
}, J = (e) => {
|
|
51
|
+
const l = h.some((o) => o[r] === e[r]);
|
|
52
|
+
let s;
|
|
53
|
+
l ? s = h.filter((o) => o[r] !== e[r]) : s = [...h, e], p(s), m && m(s);
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ t.jsxs(H, { children: [
|
|
56
|
+
f && /* @__PURE__ */ t.jsx(D, { children: /* @__PURE__ */ t.jsx(U, { size: "3rem" }) }),
|
|
57
|
+
/* @__PURE__ */ t.jsxs(k, { children: [
|
|
58
|
+
/* @__PURE__ */ t.jsx(F, { children: /* @__PURE__ */ t.jsxs(R, { children: [
|
|
59
|
+
K && /* @__PURE__ */ t.jsx(
|
|
60
|
+
z,
|
|
61
|
+
{
|
|
62
|
+
data: i,
|
|
63
|
+
handleSelectAll: q,
|
|
64
|
+
selectedRows: h,
|
|
65
|
+
visibleColumns: P,
|
|
66
|
+
alignHeader: C,
|
|
67
|
+
rowActions: void 0,
|
|
68
|
+
stickyHeader: $,
|
|
69
|
+
selectable: u,
|
|
70
|
+
loading: f
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ t.jsx(W, { children: i.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (u ? 1 : 0) + P.length, children: /* @__PURE__ */ t.jsx(w, { children: /* @__PURE__ */ t.jsx(Y, { variant: "mdText", children: I ?? V("NO_DATA_AVAILABLE") }) }) }) }) : i.map((e, l) => {
|
|
74
|
+
const s = (d == null ? void 0 : d(e)) ?? !1, o = S ? S(e) : h.some((c) => c[r] === e[r]), E = e[r];
|
|
75
|
+
return /* @__PURE__ */ t.jsxs(
|
|
76
|
+
y,
|
|
77
|
+
{
|
|
78
|
+
$selected: o,
|
|
79
|
+
$disabled: s,
|
|
80
|
+
$clickable: !!a && !s,
|
|
81
|
+
onClick: () => !s && (a == null ? void 0 : a(e)),
|
|
82
|
+
className: (j == null ? void 0 : j(e, l)) ?? "",
|
|
83
|
+
children: [
|
|
84
|
+
u && /* @__PURE__ */ t.jsx(b, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
|
|
85
|
+
Z,
|
|
86
|
+
{
|
|
87
|
+
checkBoxOptions: {
|
|
88
|
+
checked: G(e),
|
|
89
|
+
$variant: "primary",
|
|
90
|
+
$disabled: s,
|
|
91
|
+
$size: "sm",
|
|
92
|
+
onChange: () => !s && J(e)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
P.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
|
|
97
|
+
O,
|
|
98
|
+
{
|
|
99
|
+
column: c,
|
|
100
|
+
row: e,
|
|
101
|
+
type: c.cellType ?? "text",
|
|
102
|
+
align: c.align,
|
|
103
|
+
width: c.width ?? "",
|
|
104
|
+
minWidth: c.minWidth ?? "",
|
|
105
|
+
maxWidth: c.maxWidth ?? ""
|
|
106
|
+
}
|
|
107
|
+
) }, `${E}-${c.id}`))
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
E
|
|
111
|
+
);
|
|
112
|
+
}) })
|
|
113
|
+
] }) }),
|
|
114
|
+
x && x.length > 0 && /* @__PURE__ */ t.jsxs(ee, { children: [
|
|
115
|
+
/* @__PURE__ */ t.jsx(
|
|
116
|
+
z,
|
|
117
|
+
{
|
|
118
|
+
data: i,
|
|
119
|
+
handleSelectAll: () => {
|
|
120
|
+
},
|
|
121
|
+
selectedRows: h,
|
|
122
|
+
visibleColumns: [],
|
|
123
|
+
alignHeader: C,
|
|
124
|
+
rowActions: x,
|
|
125
|
+
stickyHeader: $,
|
|
126
|
+
selectable: !1,
|
|
127
|
+
loading: f
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ t.jsx(W, { children: i.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : i.map((e) => {
|
|
131
|
+
const l = (d == null ? void 0 : d(e)) ?? !1;
|
|
132
|
+
return /* @__PURE__ */ t.jsx(y, { $disabled: l, children: /* @__PURE__ */ t.jsx(b, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
|
|
133
|
+
O,
|
|
134
|
+
{
|
|
135
|
+
row: e,
|
|
136
|
+
type: "icon",
|
|
137
|
+
iconOptions: {
|
|
138
|
+
keyField: r,
|
|
139
|
+
rowActions: x,
|
|
140
|
+
activeDropdown: M,
|
|
141
|
+
setActiveDropdown: A
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
) }) }, `action-${e[r]}`);
|
|
145
|
+
}) })
|
|
146
|
+
] })
|
|
147
|
+
] }),
|
|
148
|
+
n && n.enabled && /* @__PURE__ */ t.jsx(te, { children: /* @__PURE__ */ t.jsx(
|
|
149
|
+
X,
|
|
150
|
+
{
|
|
151
|
+
currentPage: n.currentPage,
|
|
152
|
+
totalPages: n.totalPages,
|
|
153
|
+
onChange: n.onPageChange,
|
|
154
|
+
disabled: f,
|
|
155
|
+
hidePrevButton: n.hidePrevButton,
|
|
156
|
+
hideNextButton: n.hideNextButton,
|
|
157
|
+
siblingCount: n.siblingCount,
|
|
158
|
+
boundaryCount: n.boundaryCount,
|
|
159
|
+
itemsPerPage: n.pageSize,
|
|
160
|
+
totalItems: n.totalItems,
|
|
161
|
+
itemsPerPageOptions: n.itemsPerPageOptions,
|
|
162
|
+
onItemsPerPageChange: n.onItemsPerPageChange
|
|
163
|
+
}
|
|
164
|
+
) })
|
|
165
|
+
] });
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
me as default
|
|
169
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ColumnAlignment } from './Table.types';
|
|
2
|
+
export declare const ActionButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
3
|
+
export declare const DropdownContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const DropdownButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
5
|
+
export declare const DropdownMenu: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
+
$isOpen: boolean;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const DropdownItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
9
|
+
$disabled?: boolean;
|
|
10
|
+
}>> & string;
|
|
11
|
+
export declare const TableContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
export declare const StyledTable: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
|
|
13
|
+
export declare const TableScrollContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
|
|
14
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
15
|
+
}, never>> & string;
|
|
16
|
+
export declare const StyledTableHead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, {
|
|
17
|
+
$sticky?: boolean;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const TableHeaderRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, never>> & string;
|
|
20
|
+
export declare const TableHeaderCell: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {
|
|
21
|
+
$align?: ColumnAlignment;
|
|
22
|
+
$sortable?: boolean;
|
|
23
|
+
$width?: string;
|
|
24
|
+
$minWidth?: string;
|
|
25
|
+
$maxWidth?: string;
|
|
26
|
+
$isFirstColumn?: boolean;
|
|
27
|
+
$isLastColumn?: boolean;
|
|
28
|
+
$isActionCell?: boolean;
|
|
29
|
+
}>> & string;
|
|
30
|
+
export declare const TableBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
|
|
31
|
+
export declare const TableRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {
|
|
32
|
+
$selected?: boolean;
|
|
33
|
+
$disabled?: boolean;
|
|
34
|
+
$clickable?: boolean;
|
|
35
|
+
}>> & string;
|
|
36
|
+
export declare const TableCellContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {
|
|
37
|
+
$align?: ColumnAlignment;
|
|
38
|
+
$isFirstColumn?: boolean;
|
|
39
|
+
$isLastColumn?: boolean;
|
|
40
|
+
$isActionCell?: boolean;
|
|
41
|
+
}>> & string;
|
|
42
|
+
export declare const SortIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
43
|
+
export declare const TableFooter: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
44
|
+
export declare const EmptyState: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
45
|
+
export declare const LoadingOverlay: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
46
|
+
export declare const Badge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
47
|
+
$variant: "primary" | "success" | "warning" | "error" | "neutral";
|
|
48
|
+
}>> & string;
|
|
49
|
+
export declare const StatusIndicator: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
50
|
+
$status: "success" | "warning" | "error" | "neutral";
|
|
51
|
+
}>> & string;
|
|
52
|
+
export declare const TablesWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
53
|
+
export declare const DataScrollBox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
|
|
54
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
55
|
+
}, never>> & string;
|
|
56
|
+
export declare const ActionsTable: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>, "ref"> & {
|
|
57
|
+
ref?: ((instance: HTMLTableElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLTableElement> | null | undefined;
|
|
58
|
+
}, never>> & string;
|