qaema-ui 0.0.60 → 0.0.62
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/components/Badge.js +1 -1
- package/dist/components/DropDownWithTable/Table/Table.js +35 -34
- package/dist/components/DropDownWithTable/Table/Table.types.d.ts +1 -0
- package/dist/components/PageHeader.js +4 -4
- package/dist/components/SearchBar.js +10 -9
- package/dist/components/Sidemenu.js +58 -51
- package/dist/components/StatCard.js +9 -8
- package/dist/components/Table/Table.js +94 -89
- package/dist/components/Table/Table.styles.d.ts +4 -2
- package/dist/components/Table/Table.styles.js +49 -36
- package/dist/components/Table/Table.types.d.ts +2 -0
- package/dist/components/Table/components/CellComponents.js +1 -1
- package/dist/node_modules/react-icons/fi/index.js +5 -1
- package/package.json +1 -1
package/dist/components/Badge.js
CHANGED
|
@@ -38,7 +38,7 @@ const u = i.div`
|
|
|
38
38
|
const t = g(d ?? "default");
|
|
39
39
|
return /* @__PURE__ */ e.jsxs(u, { bgColor: r, $variantStyles: t, children: [
|
|
40
40
|
n && /* @__PURE__ */ e.jsx(f, { src: n, alt: "badge-image" }),
|
|
41
|
-
s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c, children: s }),
|
|
41
|
+
s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c ?? "semiBold", children: s }),
|
|
42
42
|
l,
|
|
43
43
|
a && /* @__PURE__ */ e.jsx(h, { onClick: a, $variantStyles: t, children: /* @__PURE__ */ e.jsx(p, { color: o ?? t.color, size: "0.75rem" }) })
|
|
44
44
|
] });
|
|
@@ -6,28 +6,28 @@ import Y from "../../Pagination.js";
|
|
|
6
6
|
import Z from "../../Typography.js";
|
|
7
7
|
import O, { CheckboxCell as H } from "./components/CellComponents.js";
|
|
8
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
|
|
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
10
|
function xe({
|
|
11
11
|
columns: T,
|
|
12
|
-
data:
|
|
12
|
+
data: s,
|
|
13
13
|
keyField: l,
|
|
14
14
|
selectable: j = !1,
|
|
15
|
-
onRowSelect:
|
|
15
|
+
onRowSelect: o,
|
|
16
16
|
rowActions: x,
|
|
17
17
|
stickyHeader: $ = !1,
|
|
18
18
|
loading: f = !1,
|
|
19
19
|
emptyStateMessage: I,
|
|
20
|
-
pagination:
|
|
20
|
+
pagination: n,
|
|
21
21
|
onRowClick: u,
|
|
22
22
|
rowClassName: p,
|
|
23
23
|
isRowDisabled: d,
|
|
24
|
-
breakpoint:
|
|
24
|
+
breakpoint: N = "md",
|
|
25
25
|
alignHeader: C = "start",
|
|
26
26
|
// Dropdown related props
|
|
27
|
-
isTableHeadVisible:
|
|
27
|
+
isTableHeadVisible: _ = !1,
|
|
28
28
|
isRowSelected: S
|
|
29
29
|
}) {
|
|
30
|
-
const [h, g] = v([]), [B,
|
|
30
|
+
const [h, g] = v([]), [B, a] = v(N), [K, A] = v(null), { t: M } = U();
|
|
31
31
|
L(() => {
|
|
32
32
|
const e = () => {
|
|
33
33
|
A(null);
|
|
@@ -38,31 +38,31 @@ function xe({
|
|
|
38
38
|
}, []), L(() => {
|
|
39
39
|
const e = () => {
|
|
40
40
|
const i = window.innerWidth;
|
|
41
|
-
i < 576 ?
|
|
41
|
+
i < 576 ? a("sm") : i < 992 ? a("md") : a("lg");
|
|
42
42
|
};
|
|
43
43
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
44
44
|
}, []);
|
|
45
|
-
const
|
|
46
|
-
h.length ===
|
|
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
47
|
}, q = (e) => {
|
|
48
48
|
const i = h.filter((r) => e[l] === r[l]);
|
|
49
49
|
return i && i.length > 0;
|
|
50
50
|
}, G = (e) => {
|
|
51
|
-
const i = h.some((
|
|
51
|
+
const i = h.some((m) => m[l] === e[l]);
|
|
52
52
|
let r;
|
|
53
|
-
i ? r = h.filter((
|
|
53
|
+
i ? r = h.filter((m) => m[l] !== e[l]) : r = [...h, e], g(r), o && o(r);
|
|
54
54
|
};
|
|
55
55
|
return /* @__PURE__ */ t.jsxs(D, { children: [
|
|
56
56
|
f && /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(X, { size: "3rem" }) }),
|
|
57
57
|
/* @__PURE__ */ t.jsxs(F, { children: [
|
|
58
58
|
/* @__PURE__ */ t.jsx(R, { children: /* @__PURE__ */ t.jsxs(w, { children: [
|
|
59
|
-
|
|
59
|
+
_ && /* @__PURE__ */ t.jsx(
|
|
60
60
|
z,
|
|
61
61
|
{
|
|
62
|
-
data:
|
|
62
|
+
data: s,
|
|
63
63
|
handleSelectAll: V,
|
|
64
64
|
selectedRows: h,
|
|
65
|
-
visibleColumns:
|
|
65
|
+
visibleColumns: P,
|
|
66
66
|
alignHeader: C,
|
|
67
67
|
rowActions: void 0,
|
|
68
68
|
stickyHeader: $,
|
|
@@ -70,12 +70,12 @@ function xe({
|
|
|
70
70
|
loading: f
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */ t.jsx(W, { children:
|
|
74
|
-
const r = (d == null ? void 0 : d(e)) ?? !1,
|
|
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
75
|
return /* @__PURE__ */ t.jsxs(
|
|
76
76
|
y,
|
|
77
77
|
{
|
|
78
|
-
$selected:
|
|
78
|
+
$selected: m,
|
|
79
79
|
$disabled: r,
|
|
80
80
|
$clickable: !!u && !r,
|
|
81
81
|
onClick: () => !r && (u == null ? void 0 : u(e)),
|
|
@@ -93,13 +93,14 @@ function xe({
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
) }),
|
|
96
|
-
|
|
96
|
+
P.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
|
|
97
97
|
O,
|
|
98
98
|
{
|
|
99
99
|
column: c,
|
|
100
100
|
row: e,
|
|
101
101
|
type: c.cellType ?? "text",
|
|
102
102
|
align: c.align,
|
|
103
|
+
className: c.className,
|
|
103
104
|
width: c.width ?? "",
|
|
104
105
|
minWidth: c.minWidth ?? "",
|
|
105
106
|
maxWidth: c.maxWidth ?? ""
|
|
@@ -115,7 +116,7 @@ function xe({
|
|
|
115
116
|
/* @__PURE__ */ t.jsx(
|
|
116
117
|
z,
|
|
117
118
|
{
|
|
118
|
-
data:
|
|
119
|
+
data: s,
|
|
119
120
|
handleSelectAll: () => {
|
|
120
121
|
},
|
|
121
122
|
selectedRows: h,
|
|
@@ -127,7 +128,7 @@ function xe({
|
|
|
127
128
|
loading: f
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
|
-
/* @__PURE__ */ t.jsx(W, { children:
|
|
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) => {
|
|
131
132
|
const i = (d == null ? void 0 : d(e)) ?? !1;
|
|
132
133
|
return /* @__PURE__ */ t.jsx(y, { $disabled: i, children: /* @__PURE__ */ t.jsx(b, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
|
|
133
134
|
O,
|
|
@@ -137,7 +138,7 @@ function xe({
|
|
|
137
138
|
iconOptions: {
|
|
138
139
|
keyField: l,
|
|
139
140
|
rowActions: x,
|
|
140
|
-
activeDropdown:
|
|
141
|
+
activeDropdown: K,
|
|
141
142
|
setActiveDropdown: A
|
|
142
143
|
}
|
|
143
144
|
}
|
|
@@ -145,21 +146,21 @@ function xe({
|
|
|
145
146
|
}) })
|
|
146
147
|
] })
|
|
147
148
|
] }),
|
|
148
|
-
|
|
149
|
+
n && n.enabled && /* @__PURE__ */ t.jsx(se, { children: /* @__PURE__ */ t.jsx(
|
|
149
150
|
Y,
|
|
150
151
|
{
|
|
151
|
-
currentPage:
|
|
152
|
-
totalPages:
|
|
153
|
-
onChange:
|
|
152
|
+
currentPage: n.currentPage,
|
|
153
|
+
totalPages: n.totalPages,
|
|
154
|
+
onChange: n.onPageChange,
|
|
154
155
|
disabled: f,
|
|
155
|
-
hidePrevButton:
|
|
156
|
-
hideNextButton:
|
|
157
|
-
siblingCount:
|
|
158
|
-
boundaryCount:
|
|
159
|
-
itemsPerPage:
|
|
160
|
-
totalItems:
|
|
161
|
-
itemsPerPageOptions:
|
|
162
|
-
onItemsPerPageChange:
|
|
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
|
|
163
164
|
}
|
|
164
165
|
) })
|
|
165
166
|
] });
|
|
@@ -18,21 +18,21 @@ const p = r.div`
|
|
|
18
18
|
`, d = r.div`
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
|
-
`, u = ({ onHeaderBack: e, headerTitle:
|
|
22
|
-
const a = c().dir === "rtl", i =
|
|
21
|
+
`, u = ({ onHeaderBack: e, headerTitle: s, withRightIcon: o }) => {
|
|
22
|
+
const a = c().dir === "rtl", i = o;
|
|
23
23
|
return /* @__PURE__ */ t.jsxs(p, { children: [
|
|
24
24
|
/* @__PURE__ */ t.jsxs(d, { children: [
|
|
25
25
|
e && /* @__PURE__ */ t.jsx(
|
|
26
26
|
n,
|
|
27
27
|
{
|
|
28
|
-
icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {} }),
|
|
28
|
+
icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {}, size: 20 }),
|
|
29
29
|
onClick: e,
|
|
30
30
|
onlyIcon: !0,
|
|
31
31
|
size: "md",
|
|
32
32
|
variant: "outline-primary"
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
/* @__PURE__ */ t.jsx(l, { variant: "h3", children:
|
|
35
|
+
/* @__PURE__ */ t.jsx(l, { variant: "h3", children: s })
|
|
36
36
|
] }),
|
|
37
37
|
i && /* @__PURE__ */ t.jsx(n, { icon: /* @__PURE__ */ t.jsx(i, {}), onClick: e, onlyIcon: !0, size: "md", variant: "outline-primary" })
|
|
38
38
|
] });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as n } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
|
-
import { FaSearch as
|
|
3
|
+
import { FaSearch as u } from "../node_modules/react-icons/fa/index.js";
|
|
4
4
|
import a, { useTheme as y } from "styled-components";
|
|
5
5
|
import { useQaemaCoreTranslation as x } from "../i18n/i18n.js";
|
|
6
6
|
import { a as h } from "../node_modules/@react-spring/web/dist/react-spring_web.modern.js";
|
|
7
7
|
import { useSpring as b } from "../node_modules/@react-spring/core/dist/react-spring_core.modern.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import $ from "../node_modules/react-bootstrap/esm/Button.js";
|
|
9
|
+
import w from "../node_modules/react-bootstrap/esm/Form.js";
|
|
10
10
|
const j = a(h.div)`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: row;
|
|
@@ -17,14 +17,14 @@ const j = a(h.div)`
|
|
|
17
17
|
background-color: ${({ theme: e }) => e.colors.grey.n50};
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
height: 2rem;
|
|
20
|
-
`, v = a(
|
|
20
|
+
`, v = a($)`
|
|
21
21
|
border: none;
|
|
22
22
|
padding: 0 0.5rem;
|
|
23
23
|
background-color: transparent;
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
justify-content: center;
|
|
27
|
-
`, E = a(
|
|
27
|
+
`, E = a(w.Control)`
|
|
28
28
|
border: none;
|
|
29
29
|
background-color: transparent;
|
|
30
30
|
height: 2rem;
|
|
@@ -38,7 +38,8 @@ const j = a(h.div)`
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&::placeholder {
|
|
41
|
-
color: ${({ theme: e }) => e.colors.grey.
|
|
41
|
+
color: ${({ theme: e }) => e.colors.grey.n350};
|
|
42
|
+
font-size: ${({ theme: e }) => e.typography.sizes.s3};
|
|
42
43
|
}
|
|
43
44
|
`, I = ({ placeholder: e, onSearch: r }) => {
|
|
44
45
|
const i = y(), { t: p } = x(), [m, l] = c(!1), [o, d] = c(""), t = m || !!o, g = b({
|
|
@@ -46,7 +47,7 @@ const j = a(h.div)`
|
|
|
46
47
|
paddingLeft: t ? i.spacing.s : "0rem",
|
|
47
48
|
paddingRight: t ? i.spacing.s : "0rem",
|
|
48
49
|
config: { tension: 250, friction: 20 }
|
|
49
|
-
}),
|
|
50
|
+
}), f = (s) => {
|
|
50
51
|
s.key === "Enter" && r && r(o);
|
|
51
52
|
};
|
|
52
53
|
return /* @__PURE__ */ n.jsxs(j, { style: g, onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
|
|
@@ -56,7 +57,7 @@ const j = a(h.div)`
|
|
|
56
57
|
onClick: () => {
|
|
57
58
|
(o == null ? void 0 : o.length) > 0 && r && r(o);
|
|
58
59
|
},
|
|
59
|
-
children: /* @__PURE__ */ n.jsx(
|
|
60
|
+
children: /* @__PURE__ */ n.jsx(u, { color: i.colors.grey.n400, size: "1rem" })
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
63
|
t && /* @__PURE__ */ n.jsx(
|
|
@@ -67,7 +68,7 @@ const j = a(h.div)`
|
|
|
67
68
|
onChange: (s) => {
|
|
68
69
|
s.target.value == "" && o ? (r == null || r(""), d("")) : d(s.target.value);
|
|
69
70
|
},
|
|
70
|
-
onKeyDown:
|
|
71
|
+
onKeyDown: f,
|
|
71
72
|
autoFocus: !0
|
|
72
73
|
}
|
|
73
74
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useState as m, useEffect as H } from "react";
|
|
3
|
-
import { FaTimesCircle as O
|
|
4
|
-
import
|
|
3
|
+
import { FaTimesCircle as O } from "../node_modules/react-icons/fa/index.js";
|
|
4
|
+
import { FiSearch as R } from "../node_modules/react-icons/fi/index.js";
|
|
5
|
+
import n, { useTheme as X } from "styled-components";
|
|
5
6
|
import { device as S } from "../constants/breakPoints.constant.js";
|
|
6
7
|
import K from "../hooks/useZIndex.js";
|
|
7
8
|
import { useQaemaCoreTranslation as M } from "../i18n/i18n.js";
|
|
@@ -12,7 +13,7 @@ import b from "./NavItem.js";
|
|
|
12
13
|
import w from "./Typography.js";
|
|
13
14
|
import Z from "../node_modules/react-bootstrap/esm/Button.js";
|
|
14
15
|
import _ from "../node_modules/react-bootstrap/esm/Form.js";
|
|
15
|
-
const v =
|
|
16
|
+
const v = n.div`
|
|
16
17
|
direction: ${({ theme: r }) => r == null ? void 0 : r.dir};
|
|
17
18
|
position: fixed;
|
|
18
19
|
top: 0;
|
|
@@ -43,16 +44,16 @@ const v = o.div`
|
|
|
43
44
|
${({ theme: r }) => {
|
|
44
45
|
if ((r == null ? void 0 : r.dir) === "rtl") return `padding-left: 0 !important;padding-right: ${r.spacing.xs};`;
|
|
45
46
|
}}
|
|
46
|
-
`, A =
|
|
47
|
+
`, A = n.div`
|
|
47
48
|
display: flex;
|
|
48
49
|
flex-direction: row;
|
|
49
50
|
width: 100%;
|
|
50
51
|
justify-content: space-between;
|
|
51
|
-
`, J =
|
|
52
|
+
`, J = n.div`
|
|
52
53
|
padding-right: ${({ theme: r }) => r.spacing.sm};
|
|
53
54
|
padding-left: ${({ theme: r }) => r.spacing.sm};
|
|
54
55
|
cursor: pointer;
|
|
55
|
-
`, Q =
|
|
56
|
+
`, Q = n.div`
|
|
56
57
|
display: none;
|
|
57
58
|
|
|
58
59
|
@media ${S.tablet} {
|
|
@@ -64,15 +65,15 @@ const v = o.div`
|
|
|
64
65
|
height: 1.5rem;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
`, q =
|
|
68
|
+
`, q = n.div`
|
|
68
69
|
padding-right: ${({ theme: r }) => r.spacing.s};
|
|
69
70
|
padding-left: ${({ theme: r }) => r.spacing.s};
|
|
70
|
-
`, G =
|
|
71
|
+
`, G = n.div`
|
|
71
72
|
justify-content: space-between;
|
|
72
73
|
display: flex;
|
|
73
74
|
flex-direction: column;
|
|
74
75
|
height: 100%;
|
|
75
|
-
`, Y =
|
|
76
|
+
`, Y = n.div`
|
|
76
77
|
display: flex;
|
|
77
78
|
flex-direction: row;
|
|
78
79
|
gap: ${({ theme: r }) => r.spacing.xxs};
|
|
@@ -80,7 +81,7 @@ const v = o.div`
|
|
|
80
81
|
background-color: ${({ theme: r }) => r.colors.grey.n150};
|
|
81
82
|
border: 1px solid transparent;
|
|
82
83
|
border-radius: ${({ theme: r }) => r.borderRadius.lg};
|
|
83
|
-
`, P =
|
|
84
|
+
`, P = n(Z)`
|
|
84
85
|
border: none;
|
|
85
86
|
padding: 0;
|
|
86
87
|
margin-top: ${({ theme: r }) => r.spacing.xxs};
|
|
@@ -90,16 +91,22 @@ const v = o.div`
|
|
|
90
91
|
svg {
|
|
91
92
|
background-color: ${({ theme: r }) => r.colors.grey.n150};
|
|
92
93
|
}
|
|
93
|
-
`, I =
|
|
94
|
+
`, I = n(_.Control)`
|
|
94
95
|
padding: ${({ theme: r }) => r.spacing.xxs};
|
|
95
96
|
border: none;
|
|
96
97
|
background-color: ${({ theme: r }) => r.colors.grey.n150};
|
|
97
98
|
color: ${({ theme: r }) => r.colors.grey.n350};
|
|
99
|
+
font-size: ${({ theme: r }) => r.typography.sizes.s4};
|
|
98
100
|
|
|
99
101
|
&:focus-visible {
|
|
100
102
|
outline: none;
|
|
101
103
|
}
|
|
102
|
-
|
|
104
|
+
|
|
105
|
+
&::placeholder {
|
|
106
|
+
font-size: ${({ theme: r }) => r.typography.sizes.s4} !important;
|
|
107
|
+
color: ${({ theme: r }) => r.colors.grey.n350} !important;
|
|
108
|
+
}
|
|
109
|
+
`, rr = n.div`
|
|
103
110
|
padding-right: ${({ theme: r }) => r.spacing.s};
|
|
104
111
|
button {
|
|
105
112
|
width: 100%;
|
|
@@ -108,89 +115,89 @@ const v = o.div`
|
|
|
108
115
|
${({ theme: r }) => {
|
|
109
116
|
if ((r == null ? void 0 : r.dir) === "rtl") return `padding-right: 0 !important;padding-left: ${r.spacing.s};`;
|
|
110
117
|
}}
|
|
111
|
-
`,
|
|
118
|
+
`, ir = n(w)`
|
|
112
119
|
padding-right: ${({ theme: r }) => r.spacing.s};
|
|
113
120
|
padding-left: ${({ theme: r }) => r.spacing.s};
|
|
114
121
|
margin-top: 0;
|
|
115
122
|
margin-bottom: ${({ theme: r }) => r.spacing.xs};
|
|
116
|
-
`,
|
|
123
|
+
`, or = n.div`
|
|
117
124
|
padding: ${({ theme: r }) => r.spacing.m};
|
|
118
125
|
text-align: center;
|
|
119
|
-
`,
|
|
126
|
+
`, nr = n.div`
|
|
120
127
|
button {
|
|
121
128
|
width: 100%;
|
|
122
129
|
border-radius: ${({ theme: r }) => r.spacing.xxs};
|
|
123
130
|
}
|
|
124
|
-
`, sr =
|
|
131
|
+
`, sr = n(U)`
|
|
125
132
|
margin-left: -${({ theme: r }) => r.spacing.xs};
|
|
126
133
|
width: calc(100% + ${({ theme: r }) => r.spacing.xs});
|
|
127
134
|
${({ theme: r }) => {
|
|
128
135
|
if ((r == null ? void 0 : r.dir) === "rtl") return `margin-left: 0; margin-right: -${r.spacing.xs}; width: calc(100% + ${r.spacing.xs});`;
|
|
129
136
|
}}
|
|
130
137
|
margin-bottom: ${({ theme: r }) => r.spacing.sm};
|
|
131
|
-
`,
|
|
132
|
-
const { logoSrc: C, searchPlaceHolder: k, categories:
|
|
138
|
+
`, jr = (r) => {
|
|
139
|
+
const { logoSrc: C, searchPlaceHolder: k, categories: p, linkComponent: f, open: z, setOpen: T, currentPath: u, extraSideMenuItems: l, onLogoClick: E } = r, a = X(), { t: D } = M(), L = K("sidemenu"), [c, B] = m(""), [t, F] = m(p), g = (i) => {
|
|
133
140
|
const e = [];
|
|
134
|
-
|
|
141
|
+
p == null || p.forEach((d) => {
|
|
135
142
|
var h;
|
|
136
|
-
const s = (h =
|
|
143
|
+
const s = (h = d == null ? void 0 : d.navItems) == null ? void 0 : h.filter((x) => {
|
|
137
144
|
var $, y;
|
|
138
|
-
return (y = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : y.includes(
|
|
145
|
+
return (y = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : y.includes(i == null ? void 0 : i.toLowerCase());
|
|
139
146
|
});
|
|
140
|
-
(s == null ? void 0 : s.length) > 0 && e.push({ ...
|
|
141
|
-
}),
|
|
142
|
-
},
|
|
143
|
-
|
|
147
|
+
(s == null ? void 0 : s.length) > 0 && e.push({ ...d, navItems: s });
|
|
148
|
+
}), F(e);
|
|
149
|
+
}, N = (i) => {
|
|
150
|
+
i.key === "Enter" && g(c);
|
|
144
151
|
};
|
|
145
152
|
H(() => {
|
|
146
153
|
c === "" && g(c);
|
|
147
154
|
}, [c]);
|
|
148
|
-
const
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
155
|
+
const W = (i, e) => i ? e === i || (e == null ? void 0 : e.startsWith(i + "/")) : !1;
|
|
156
|
+
return /* @__PURE__ */ o.jsxs(v, { className: z ? "active" : "", $zIndex: L, children: [
|
|
157
|
+
/* @__PURE__ */ o.jsxs(A, { children: [
|
|
158
|
+
/* @__PURE__ */ o.jsx(J, { onClick: E, children: /* @__PURE__ */ o.jsx(V, { src: C, width: "6.336rem", height: "2rem" }) }),
|
|
159
|
+
/* @__PURE__ */ o.jsx(Q, { onClick: () => T(!1), children: /* @__PURE__ */ o.jsx(O, { color: a.colors.primary.purple.n450 }) })
|
|
153
160
|
] }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ o.jsx(q, { children: /* @__PURE__ */ o.jsxs(Y, { children: [
|
|
162
|
+
/* @__PURE__ */ o.jsx(
|
|
156
163
|
P,
|
|
157
164
|
{
|
|
158
165
|
onClick: () => {
|
|
159
166
|
g(c);
|
|
160
167
|
},
|
|
161
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ o.jsx(R, { color: a.colors.grey.n350, size: 20 })
|
|
162
169
|
}
|
|
163
170
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ o.jsx(
|
|
165
172
|
I,
|
|
166
173
|
{
|
|
167
174
|
placeholder: k ?? "Search",
|
|
168
175
|
value: c,
|
|
169
|
-
onChange: (
|
|
170
|
-
|
|
176
|
+
onChange: (i) => {
|
|
177
|
+
B(i.target.value);
|
|
171
178
|
},
|
|
172
|
-
onKeyDown:
|
|
179
|
+
onKeyDown: N
|
|
173
180
|
}
|
|
174
181
|
)
|
|
175
182
|
] }) }),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
(
|
|
179
|
-
(
|
|
180
|
-
var e,
|
|
181
|
-
return ((e =
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
(
|
|
184
|
-
] },
|
|
183
|
+
/* @__PURE__ */ o.jsxs(G, { children: [
|
|
184
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
185
|
+
(t == null ? void 0 : t.length) === 0 && /* @__PURE__ */ o.jsx(or, { children: /* @__PURE__ */ o.jsx(w, { variant: "smText", children: D("NO_RESULTS_FOUND") }) }),
|
|
186
|
+
(t == null ? void 0 : t.length) > 0 && (t == null ? void 0 : t.map((i) => {
|
|
187
|
+
var e, d;
|
|
188
|
+
return ((e = i == null ? void 0 : i.navItems) == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ o.jsxs(rr, { className: i == null ? void 0 : i.code, children: [
|
|
189
|
+
/* @__PURE__ */ o.jsx(ir, { variant: "xsText", color: a.colors.grey.n300, children: i == null ? void 0 : i.title }),
|
|
190
|
+
(d = i == null ? void 0 : i.navItems) == null ? void 0 : d.map((s) => /* @__PURE__ */ o.jsx(j, { to: (s == null ? void 0 : s.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ o.jsx(b, { item: { variant: "normal", active: W(s.path, u), ...s } }) }, s == null ? void 0 : s.path))
|
|
191
|
+
] }, i == null ? void 0 : i.title);
|
|
185
192
|
}))
|
|
186
193
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
(l == null ? void 0 : l.length) > 0 && /* @__PURE__ */
|
|
189
|
-
l == null ? void 0 : l.map((
|
|
194
|
+
/* @__PURE__ */ o.jsxs(nr, { children: [
|
|
195
|
+
(l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ o.jsx(sr, { color: a.colors.grey.n150 }),
|
|
196
|
+
l == null ? void 0 : l.map((i) => /* @__PURE__ */ o.jsx(j, { to: (i == null ? void 0 : i.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ o.jsx(b, { item: { variant: "normal", active: u === i.path, ...i } }) }, i == null ? void 0 : i.path))
|
|
190
197
|
] })
|
|
191
198
|
] })
|
|
192
199
|
] });
|
|
193
200
|
};
|
|
194
201
|
export {
|
|
195
|
-
|
|
202
|
+
jr as default
|
|
196
203
|
};
|
|
@@ -7,10 +7,11 @@ import j from "../assets/svg/Riyal.svg.js";
|
|
|
7
7
|
const w = s.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
width: 100%;
|
|
10
|
-
height:
|
|
10
|
+
height: 5rem;
|
|
11
11
|
border-radius: ${({ theme: r }) => r.borderRadius.md};
|
|
12
12
|
border: 1px solid ${({ theme: r }) => r.colors.grey.n100};
|
|
13
|
-
overflow:
|
|
13
|
+
overflow-x: auto;
|
|
14
|
+
overflow-y: hidden;
|
|
14
15
|
background-color: ${({ theme: r }) => r.colors.grey.n50};
|
|
15
16
|
`, b = s.div`
|
|
16
17
|
/* border: 1px solid ${({ theme: r }) => r.colors.grey.n150}; */
|
|
@@ -19,7 +20,7 @@ const w = s.div`
|
|
|
19
20
|
flex-direction: column;
|
|
20
21
|
justify-content: center;
|
|
21
22
|
padding: 0.625rem ${({ theme: r }) => r.spacing.s};
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
background-color: ${({ theme: r }) => r.colors.grey.n50};
|
|
24
25
|
@media ${t.tablet} {
|
|
25
26
|
padding: ${({ theme: r }) => r.spacing.xxs} ${({ theme: r }) => r.spacing.xs};
|
|
@@ -48,7 +49,7 @@ const w = s.div`
|
|
|
48
49
|
justify-content: start;
|
|
49
50
|
font-family: 'Noto Sans Display', sans-serif;
|
|
50
51
|
font-weight: 600;
|
|
51
|
-
font-size: ${({ theme: r }) => r.typography.sizes.
|
|
52
|
+
font-size: ${({ theme: r }) => r.typography.sizes.s2};
|
|
52
53
|
line-height: 0.8125rem;
|
|
53
54
|
color: ${({ theme: r, state: e }) => e === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
|
|
54
55
|
svg {
|
|
@@ -108,11 +109,11 @@ const w = s.div`
|
|
|
108
109
|
state: n,
|
|
109
110
|
indicators: h,
|
|
110
111
|
variant: g = "currency",
|
|
111
|
-
icon:
|
|
112
|
-
$isLast:
|
|
112
|
+
icon: y,
|
|
113
|
+
$isLast: x
|
|
113
114
|
}) => {
|
|
114
115
|
const { arrow: c = !0, sign: l = !0, percentage: d = !0 } = h || {};
|
|
115
|
-
return /* @__PURE__ */ o.jsxs(b, { $isLast:
|
|
116
|
+
return /* @__PURE__ */ o.jsxs(b, { $isLast: x, children: [
|
|
116
117
|
/* @__PURE__ */ o.jsxs(v, { children: [
|
|
117
118
|
/* @__PURE__ */ o.jsx("span", { children: r }),
|
|
118
119
|
(c || l || d) && /* @__PURE__ */ o.jsx(z, { state: n, children: n === "positive" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
@@ -126,7 +127,7 @@ const w = s.div`
|
|
|
126
127
|
] }) })
|
|
127
128
|
] }),
|
|
128
129
|
/* @__PURE__ */ o.jsxs(I, { children: [
|
|
129
|
-
g === "icon" ? /* @__PURE__ */ o.jsx(C, { children:
|
|
130
|
+
g === "icon" ? /* @__PURE__ */ o.jsx(C, { children: y }) : /* @__PURE__ */ o.jsx(k, { src: j, alt: "Riyal" }),
|
|
130
131
|
/* @__PURE__ */ o.jsxs(A, { children: [
|
|
131
132
|
e,
|
|
132
133
|
g !== "icon" && i && /* @__PURE__ */ o.jsxs(R, { children: [
|
|
@@ -1,102 +1,107 @@
|
|
|
1
1
|
import { j as t } from "../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { useState as p, useRef as Q, useCallback as U, useEffect as T, useMemo as X } from "react";
|
|
3
|
+
import { useTranslation as Y } from "react-i18next";
|
|
4
|
+
import Z from "../Spinner.js";
|
|
5
|
+
import D from "../Pagination.js";
|
|
6
|
+
import k from "../Typography.js";
|
|
7
|
+
import W, { CheckboxCell as F } from "./components/CellComponents.js";
|
|
8
8
|
import O from "./components/TableHead.js";
|
|
9
|
-
import { TableContainer as
|
|
10
|
-
function
|
|
11
|
-
columns:
|
|
12
|
-
data:
|
|
13
|
-
keyField:
|
|
14
|
-
selectable:
|
|
15
|
-
onRowSelect:
|
|
9
|
+
import { TableContainer as R, LoadingOverlay as w, TablesWrapper as ee, DataScrollBox as te, StyledTable as re, TableBody as y, EmptyState as ne, TableRow as I, TableCellContainer as $, ActionsTable as se, TableFooter as le } from "./Table.styles.js";
|
|
10
|
+
function fe({
|
|
11
|
+
columns: C,
|
|
12
|
+
data: s,
|
|
13
|
+
keyField: l,
|
|
14
|
+
selectable: g = !1,
|
|
15
|
+
onRowSelect: a,
|
|
16
16
|
rowActions: m,
|
|
17
|
-
stickyHeader:
|
|
18
|
-
loading:
|
|
19
|
-
emptyStateMessage:
|
|
20
|
-
pagination:
|
|
21
|
-
onRowClick:
|
|
22
|
-
rowClassName:
|
|
17
|
+
stickyHeader: B = !1,
|
|
18
|
+
loading: x = !1,
|
|
19
|
+
emptyStateMessage: N,
|
|
20
|
+
pagination: r,
|
|
21
|
+
onRowClick: u,
|
|
22
|
+
rowClassName: b,
|
|
23
23
|
isRowDisabled: d,
|
|
24
|
-
breakpoint:
|
|
25
|
-
alignHeader:
|
|
24
|
+
breakpoint: _ = "md",
|
|
25
|
+
alignHeader: E = "start"
|
|
26
26
|
}) {
|
|
27
|
-
const [h,
|
|
28
|
-
|
|
27
|
+
const [h, v] = p([]), [L, P] = p(_), [K, z] = p(null), [M, V] = p(!1), f = Q(null), { t: q } = Y(), j = U(() => {
|
|
28
|
+
f.current && V(f.current.scrollWidth > f.current.clientWidth);
|
|
29
|
+
}, []);
|
|
30
|
+
T(() => (j(), window.addEventListener("resize", j), () => window.removeEventListener("resize", j)), [j, s]), T(() => {
|
|
29
31
|
const e = () => {
|
|
30
|
-
|
|
32
|
+
z(null);
|
|
31
33
|
};
|
|
32
34
|
return document.addEventListener("click", e), () => {
|
|
33
35
|
document.removeEventListener("click", e);
|
|
34
36
|
};
|
|
35
|
-
}, []),
|
|
37
|
+
}, []), T(() => {
|
|
36
38
|
const e = () => {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
+
const i = window.innerWidth;
|
|
40
|
+
i < 576 ? P("sm") : i < 992 ? P("md") : P("lg");
|
|
39
41
|
};
|
|
40
42
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
41
43
|
}, []);
|
|
42
|
-
const
|
|
43
|
-
h.length ===
|
|
44
|
-
},
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
|
|
44
|
+
const S = X(() => C.filter((e) => typeof e.hidden == "function" ? !e.hidden(L) : !e.hidden), [C, L]), G = () => {
|
|
45
|
+
h.length === s.length ? v([]) : v([...s]), a && a(h.length === s.length ? [] : [...s]);
|
|
46
|
+
}, H = (e) => {
|
|
47
|
+
const i = h.filter((n) => e[l] === n[l]);
|
|
48
|
+
return i && i.length > 0;
|
|
49
|
+
}, J = (e) => {
|
|
50
|
+
const i = h.some((o) => o[l] === e[l]);
|
|
51
|
+
let n;
|
|
52
|
+
i ? n = h.filter((o) => o[l] !== e[l]) : n = [...h, e], v(n), a && a(n);
|
|
51
53
|
};
|
|
52
|
-
return /* @__PURE__ */ t.jsxs(
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ t.jsxs(
|
|
55
|
-
/* @__PURE__ */ t.jsx(
|
|
54
|
+
return /* @__PURE__ */ t.jsxs(R, { children: [
|
|
55
|
+
x && /* @__PURE__ */ t.jsx(w, { children: /* @__PURE__ */ t.jsx(Z, { size: "3rem" }) }),
|
|
56
|
+
/* @__PURE__ */ t.jsxs(ee, { children: [
|
|
57
|
+
/* @__PURE__ */ t.jsx(te, { ref: f, children: /* @__PURE__ */ t.jsxs(re, { children: [
|
|
56
58
|
/* @__PURE__ */ t.jsx(
|
|
57
59
|
O,
|
|
58
60
|
{
|
|
59
|
-
data:
|
|
60
|
-
handleSelectAll:
|
|
61
|
+
data: s,
|
|
62
|
+
handleSelectAll: G,
|
|
61
63
|
selectedRows: h,
|
|
62
|
-
visibleColumns:
|
|
63
|
-
alignHeader:
|
|
64
|
+
visibleColumns: S,
|
|
65
|
+
alignHeader: E,
|
|
64
66
|
rowActions: void 0,
|
|
65
|
-
stickyHeader:
|
|
66
|
-
selectable:
|
|
67
|
-
loading:
|
|
67
|
+
stickyHeader: B,
|
|
68
|
+
selectable: g,
|
|
69
|
+
loading: x
|
|
68
70
|
}
|
|
69
71
|
),
|
|
70
|
-
/* @__PURE__ */ t.jsx(
|
|
71
|
-
const
|
|
72
|
+
/* @__PURE__ */ t.jsx(y, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (g ? 1 : 0) + S.length, children: /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx(k, { variant: "mdText", children: N ?? q("NO_DATA_AVAILABLE") }) }) }) }) : s.map((e, i) => {
|
|
73
|
+
const n = (d == null ? void 0 : d(e)) ?? !1, o = h.some((c) => c[l] === e[l]), A = e[l];
|
|
72
74
|
return /* @__PURE__ */ t.jsxs(
|
|
73
|
-
|
|
75
|
+
I,
|
|
74
76
|
{
|
|
75
77
|
$selected: o,
|
|
76
|
-
$disabled:
|
|
77
|
-
$clickable: !!
|
|
78
|
-
onClick: () =>
|
|
79
|
-
|
|
78
|
+
$disabled: n,
|
|
79
|
+
$clickable: !!u && !n,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
n || u == null || u(e);
|
|
82
|
+
},
|
|
83
|
+
className: (b == null ? void 0 : b(e, i)) ?? "",
|
|
80
84
|
children: [
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
g && /* @__PURE__ */ t.jsx($, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
|
|
86
|
+
F,
|
|
83
87
|
{
|
|
84
88
|
checkBoxOptions: {
|
|
85
|
-
checked:
|
|
89
|
+
checked: H(e),
|
|
86
90
|
$variant: "primary",
|
|
87
|
-
$disabled:
|
|
91
|
+
$disabled: n,
|
|
88
92
|
$size: "sm",
|
|
89
|
-
onChange: () => !
|
|
93
|
+
onChange: () => !n && J(e)
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
) }),
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
S.map((c) => /* @__PURE__ */ t.jsx($, { $align: c.align, children: /* @__PURE__ */ t.jsx(
|
|
98
|
+
W,
|
|
95
99
|
{
|
|
96
100
|
column: c,
|
|
97
101
|
row: e,
|
|
98
102
|
type: c.cellType ?? "text",
|
|
99
103
|
align: c.align,
|
|
104
|
+
className: c.className,
|
|
100
105
|
width: c.width ?? "",
|
|
101
106
|
minWidth: c.minWidth ?? "",
|
|
102
107
|
maxWidth: c.maxWidth ?? ""
|
|
@@ -108,59 +113,59 @@ function de({
|
|
|
108
113
|
);
|
|
109
114
|
}) })
|
|
110
115
|
] }) }),
|
|
111
|
-
m && m.length > 0 && /* @__PURE__ */ t.jsxs(
|
|
116
|
+
m && m.length > 0 && /* @__PURE__ */ t.jsxs(se, { $hasScrollbar: M, children: [
|
|
112
117
|
/* @__PURE__ */ t.jsx(
|
|
113
118
|
O,
|
|
114
119
|
{
|
|
115
|
-
data:
|
|
120
|
+
data: s,
|
|
116
121
|
handleSelectAll: () => {
|
|
117
122
|
},
|
|
118
123
|
selectedRows: h,
|
|
119
124
|
visibleColumns: [],
|
|
120
|
-
alignHeader:
|
|
125
|
+
alignHeader: E,
|
|
121
126
|
rowActions: m,
|
|
122
|
-
stickyHeader:
|
|
127
|
+
stickyHeader: B,
|
|
123
128
|
selectable: !1,
|
|
124
|
-
loading:
|
|
129
|
+
loading: x
|
|
125
130
|
}
|
|
126
131
|
),
|
|
127
|
-
/* @__PURE__ */ t.jsx(
|
|
128
|
-
const
|
|
129
|
-
return /* @__PURE__ */ t.jsx(
|
|
130
|
-
|
|
132
|
+
/* @__PURE__ */ t.jsx(y, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : s.map((e) => {
|
|
133
|
+
const i = (d == null ? void 0 : d(e)) ?? !1;
|
|
134
|
+
return /* @__PURE__ */ t.jsx(I, { $disabled: i, children: /* @__PURE__ */ t.jsx($, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
|
|
135
|
+
W,
|
|
131
136
|
{
|
|
132
137
|
row: e,
|
|
133
138
|
type: "icon",
|
|
134
139
|
iconOptions: {
|
|
135
|
-
keyField:
|
|
140
|
+
keyField: l,
|
|
136
141
|
rowActions: m,
|
|
137
|
-
activeDropdown:
|
|
138
|
-
setActiveDropdown:
|
|
142
|
+
activeDropdown: K,
|
|
143
|
+
setActiveDropdown: z
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
|
-
) }) }, `action-${e[
|
|
146
|
+
) }) }, `action-${e[l]}`);
|
|
142
147
|
}) })
|
|
143
148
|
] })
|
|
144
149
|
] }),
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
r && r.enabled && /* @__PURE__ */ t.jsx(le, { children: /* @__PURE__ */ t.jsx(
|
|
151
|
+
D,
|
|
147
152
|
{
|
|
148
|
-
currentPage:
|
|
149
|
-
totalPages:
|
|
150
|
-
onChange:
|
|
151
|
-
disabled:
|
|
152
|
-
hidePrevButton:
|
|
153
|
-
hideNextButton:
|
|
154
|
-
siblingCount:
|
|
155
|
-
boundaryCount:
|
|
156
|
-
itemsPerPage:
|
|
157
|
-
totalItems:
|
|
158
|
-
itemsPerPageOptions:
|
|
159
|
-
onItemsPerPageChange:
|
|
153
|
+
currentPage: r.currentPage,
|
|
154
|
+
totalPages: r.totalPages,
|
|
155
|
+
onChange: r.onPageChange,
|
|
156
|
+
disabled: x,
|
|
157
|
+
hidePrevButton: r.hidePrevButton,
|
|
158
|
+
hideNextButton: r.hideNextButton,
|
|
159
|
+
siblingCount: r.siblingCount,
|
|
160
|
+
boundaryCount: r.boundaryCount,
|
|
161
|
+
itemsPerPage: r.pageSize,
|
|
162
|
+
totalItems: r.totalItems,
|
|
163
|
+
itemsPerPageOptions: r.itemsPerPageOptions,
|
|
164
|
+
onItemsPerPageChange: r.onItemsPerPageChange
|
|
160
165
|
}
|
|
161
166
|
) })
|
|
162
167
|
] });
|
|
163
168
|
}
|
|
164
169
|
export {
|
|
165
|
-
|
|
170
|
+
fe as default
|
|
166
171
|
};
|
|
@@ -53,6 +53,8 @@ export declare const TablesWrapper: import("styled-components/dist/types").IStyl
|
|
|
53
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
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
55
|
}, never>> & string;
|
|
56
|
-
export declare const ActionsTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
56
|
+
export declare const ActionsTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>, "ref"> & {
|
|
57
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
|
-
},
|
|
58
|
+
}, {
|
|
59
|
+
$hasScrollbar?: boolean;
|
|
60
|
+
}>> & string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import r, { css as
|
|
1
|
+
import r, { css as e } from "styled-components";
|
|
2
2
|
import { Scrollbar as s } from "../../styles/Scrollbar.styles.js";
|
|
3
3
|
r.button`
|
|
4
4
|
background: none;
|
|
@@ -52,7 +52,7 @@ const a = r.div`
|
|
|
52
52
|
color: ${({ theme: o }) => o.colors.grey.n600};
|
|
53
53
|
|
|
54
54
|
&:hover {
|
|
55
|
-
background-color: ${({ theme: o, $disabled:
|
|
55
|
+
background-color: ${({ theme: o, $disabled: n }) => n ? "transparent" : o.colors.primary.purple.n100};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
svg {
|
|
@@ -62,7 +62,7 @@ const a = r.div`
|
|
|
62
62
|
width: 100%;
|
|
63
63
|
position: relative;
|
|
64
64
|
border-radius: ${({ theme: o }) => o.borderRadius.md};
|
|
65
|
-
box-shadow: ${({ theme: o }) => o.boxShadow.s2};
|
|
65
|
+
/* box-shadow: ${({ theme: o }) => o.boxShadow.s2}; */
|
|
66
66
|
background-color: ${({ theme: o }) => o.colors.grey.n50};
|
|
67
67
|
overflow-x: hidden;
|
|
68
68
|
overflow-y: auto;
|
|
@@ -79,7 +79,7 @@ r(s)`
|
|
|
79
79
|
-webkit-overflow-scrolling: touch;
|
|
80
80
|
`;
|
|
81
81
|
const u = r.thead`
|
|
82
|
-
${({ $sticky: o }) => o &&
|
|
82
|
+
${({ $sticky: o }) => o && e`
|
|
83
83
|
top: 0;
|
|
84
84
|
`}
|
|
85
85
|
`, $ = r.tr`
|
|
@@ -99,61 +99,73 @@ const u = r.thead`
|
|
|
99
99
|
height: 3.5rem;
|
|
100
100
|
|
|
101
101
|
/* Apply sticky positioning for first and last columns */
|
|
102
|
-
${({ $isFirstColumn: o }) => o &&
|
|
102
|
+
${({ $isFirstColumn: o }) => o && e`
|
|
103
103
|
left: 0;
|
|
104
104
|
/* z-index: 2; */
|
|
105
105
|
`}
|
|
106
106
|
|
|
107
|
-
${({ $isLastColumn: o }) => o &&
|
|
107
|
+
${({ $isLastColumn: o }) => o && e`
|
|
108
108
|
right: 0;
|
|
109
109
|
/* z-index: 2; */
|
|
110
110
|
text-align: end;
|
|
111
111
|
`}
|
|
112
|
-
${({ $isActionCell: o }) => o &&
|
|
113
|
-
padding: ${({ theme:
|
|
112
|
+
${({ $isActionCell: o }) => o && e`
|
|
113
|
+
padding: ${({ theme: n }) => n.spacing.sm} 0;
|
|
114
114
|
text-align: center;
|
|
115
115
|
`}
|
|
116
116
|
|
|
117
117
|
&:hover {
|
|
118
|
-
${({ $sortable: o }) => o &&
|
|
119
|
-
background-color: ${({ theme:
|
|
118
|
+
${({ $sortable: o }) => o && e`
|
|
119
|
+
background-color: ${({ theme: n }) => n.colors.grey.n150};
|
|
120
120
|
`}
|
|
121
121
|
}
|
|
122
|
-
`, y = r.tbody``,
|
|
123
|
-
background-color: ${({ theme: o, $selected:
|
|
122
|
+
`, y = r.tbody``, m = r.tr`
|
|
123
|
+
background-color: ${({ theme: o, $selected: n }) => n ? o.colors.primary.purple.n100 : o.colors.grey.n50};
|
|
124
124
|
height: 3.5rem;
|
|
125
|
-
|
|
125
|
+
transition: background-color 0.2s;
|
|
126
|
+
|
|
127
|
+
${({ $disabled: o }) => o && e`
|
|
126
128
|
opacity: 0.6;
|
|
127
129
|
pointer-events: none;
|
|
128
130
|
`}
|
|
129
131
|
|
|
130
|
-
${({ $clickable: o }) => o &&
|
|
132
|
+
${({ $clickable: o }) => o && e`
|
|
131
133
|
cursor: pointer;
|
|
132
134
|
`}
|
|
133
|
-
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
${({ $disabled: o }) => !o && e`
|
|
138
|
+
background-color: ${({ theme: n }) => n.colors.grey.n100};
|
|
139
|
+
|
|
140
|
+
td {
|
|
141
|
+
background-color: ${({ theme: n }) => n.colors.grey.n100};
|
|
142
|
+
}
|
|
143
|
+
`}
|
|
144
|
+
}
|
|
145
|
+
`, x = r.td`
|
|
134
146
|
padding: ${({ theme: o }) => o.spacing.s} ${({ theme: o }) => o.spacing.sm};
|
|
135
147
|
text-align: ${({ $align: o }) => o ?? "left"};
|
|
136
|
-
|
|
148
|
+
border-bottom: 1px solid ${({ theme: o }) => o.colors.grey.n150};
|
|
137
149
|
color: ${({ theme: o }) => o.colors.grey.n700};
|
|
138
150
|
/* min-height: 3.5rem;
|
|
139
151
|
max-height: 3.5rem; */
|
|
140
152
|
background-color: ${({ theme: o }) => o.colors.grey.n50};
|
|
141
153
|
/* height: 3.5rem; */
|
|
142
154
|
/* Apply sticky positioning for first and last columns */
|
|
143
|
-
${({ $isFirstColumn: o }) => o &&
|
|
155
|
+
${({ $isFirstColumn: o }) => o && e`
|
|
144
156
|
z-index: 1;
|
|
145
157
|
left: 0;
|
|
146
158
|
`}
|
|
147
159
|
|
|
148
|
-
${({ $isLastColumn: o }) => o &&
|
|
160
|
+
${({ $isLastColumn: o }) => o && e`
|
|
149
161
|
right: 0;
|
|
150
162
|
width: 0px;
|
|
151
163
|
z-index: 1;
|
|
152
164
|
background-color: transparent;
|
|
153
165
|
`}
|
|
154
166
|
|
|
155
|
-
${({ $isActionCell: o }) => o &&
|
|
156
|
-
padding: 0 ${({ theme:
|
|
167
|
+
${({ $isActionCell: o }) => o && e`
|
|
168
|
+
padding: 0 ${({ theme: n }) => n.spacing.sm};
|
|
157
169
|
`}
|
|
158
170
|
`;
|
|
159
171
|
r.span`
|
|
@@ -161,7 +173,7 @@ r.span`
|
|
|
161
173
|
align-items: center;
|
|
162
174
|
margin-left: ${({ theme: o }) => o.spacing.xxs};
|
|
163
175
|
`;
|
|
164
|
-
const
|
|
176
|
+
const h = r.div`
|
|
165
177
|
display: flex;
|
|
166
178
|
justify-content: center;
|
|
167
179
|
align-items: center;
|
|
@@ -192,30 +204,30 @@ r.span`
|
|
|
192
204
|
font-size: ${({ theme: o }) => o.typography.sizes.s2};
|
|
193
205
|
font-weight: ${({ theme: o }) => o.typography.weights.semiBold};
|
|
194
206
|
|
|
195
|
-
${({ theme: o, $variant:
|
|
196
|
-
switch (
|
|
207
|
+
${({ theme: o, $variant: n }) => {
|
|
208
|
+
switch (n) {
|
|
197
209
|
case "primary":
|
|
198
|
-
return
|
|
210
|
+
return e`
|
|
199
211
|
background-color: ${o.colors.primary.purple.n100};
|
|
200
212
|
color: ${o.colors.primary.purple.n500};
|
|
201
213
|
`;
|
|
202
214
|
case "success":
|
|
203
|
-
return
|
|
215
|
+
return e`
|
|
204
216
|
background-color: ${o.colors.state.success.n100};
|
|
205
217
|
color: ${o.colors.state.success.n500};
|
|
206
218
|
`;
|
|
207
219
|
case "warning":
|
|
208
|
-
return
|
|
220
|
+
return e`
|
|
209
221
|
background-color: ${o.colors.secondary.yellow.n200};
|
|
210
222
|
color: ${o.colors.secondary.yellow.n600};
|
|
211
223
|
`;
|
|
212
224
|
case "error":
|
|
213
|
-
return
|
|
225
|
+
return e`
|
|
214
226
|
background-color: ${o.colors.state.error.n100};
|
|
215
227
|
color: ${o.colors.state.error.n500};
|
|
216
228
|
`;
|
|
217
229
|
default:
|
|
218
|
-
return
|
|
230
|
+
return e`
|
|
219
231
|
background-color: ${o.colors.grey.n200};
|
|
220
232
|
color: ${o.colors.grey.n600};
|
|
221
233
|
`;
|
|
@@ -228,8 +240,8 @@ r.span`
|
|
|
228
240
|
height: 0.5rem;
|
|
229
241
|
border-radius: 50%;
|
|
230
242
|
margin-right: ${({ theme: o }) => o.spacing.xxs};
|
|
231
|
-
background-color: ${({ theme: o, $status:
|
|
232
|
-
switch (
|
|
243
|
+
background-color: ${({ theme: o, $status: n }) => {
|
|
244
|
+
switch (n) {
|
|
233
245
|
case "success":
|
|
234
246
|
return o.colors.state.success.n500;
|
|
235
247
|
case "warning":
|
|
@@ -245,9 +257,11 @@ const k = r.div`
|
|
|
245
257
|
display: flex;
|
|
246
258
|
position: relative;
|
|
247
259
|
width: 100%;
|
|
260
|
+
gap: 0;
|
|
248
261
|
`, v = r(s)`
|
|
249
262
|
flex: 1 1 auto;
|
|
250
263
|
overflow-x: auto;
|
|
264
|
+
overflow-y: hidden;
|
|
251
265
|
min-width: 0;
|
|
252
266
|
&::-webkit-scrollbar {
|
|
253
267
|
height: ${({ theme: o }) => o.spacing.s};
|
|
@@ -256,12 +270,11 @@ const k = r.div`
|
|
|
256
270
|
height: ${({ theme: o }) => o.spacing.s};
|
|
257
271
|
}
|
|
258
272
|
`, T = r(t)`
|
|
259
|
-
/* position: sticky;
|
|
260
|
-
right: 0; */
|
|
261
273
|
flex: 0 0 auto;
|
|
262
|
-
width:
|
|
274
|
+
width: auto;
|
|
263
275
|
table-layout: fixed;
|
|
264
276
|
background-color: ${({ theme: o }) => o.colors.grey.n50};
|
|
277
|
+
margin-bottom: ${({ theme: o, $hasScrollbar: n }) => n ? o.spacing.s : "0"};
|
|
265
278
|
`;
|
|
266
279
|
export {
|
|
267
280
|
T as ActionsTable,
|
|
@@ -275,11 +288,11 @@ export {
|
|
|
275
288
|
t as StyledTable,
|
|
276
289
|
u as StyledTableHead,
|
|
277
290
|
y as TableBody,
|
|
278
|
-
|
|
291
|
+
x as TableCellContainer,
|
|
279
292
|
g as TableContainer,
|
|
280
|
-
|
|
293
|
+
h as TableFooter,
|
|
281
294
|
b as TableHeaderCell,
|
|
282
295
|
$ as TableHeaderRow,
|
|
283
|
-
|
|
296
|
+
m as TableRow,
|
|
284
297
|
k as TablesWrapper
|
|
285
298
|
};
|
|
@@ -4,6 +4,7 @@ export type TableColumn<T> = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
header: string | React.ReactNode;
|
|
6
6
|
accessor: keyof T | ((row: T) => React.ReactNode);
|
|
7
|
+
className?: string;
|
|
7
8
|
width?: string;
|
|
8
9
|
minWidth?: string;
|
|
9
10
|
maxWidth?: string;
|
|
@@ -49,6 +50,7 @@ export type TableProps<T> = {
|
|
|
49
50
|
onItemsPerPageChange?: (itemsPerPage: number) => void;
|
|
50
51
|
};
|
|
51
52
|
onRowClick?: (row: T) => void;
|
|
53
|
+
onClickView?: (row: T) => void;
|
|
52
54
|
rowClassName?: (row: T, index: number) => string;
|
|
53
55
|
isRowDisabled?: (row: T) => boolean;
|
|
54
56
|
breakpoint?: string;
|
|
@@ -25,7 +25,7 @@ const i = g.div`
|
|
|
25
25
|
duplicate: /* @__PURE__ */ r.jsx(j, {}),
|
|
26
26
|
approve: /* @__PURE__ */ r.jsx(u, {}),
|
|
27
27
|
print: /* @__PURE__ */ r.jsx(u, {})
|
|
28
|
-
}, R = (e) => E[e.toLowerCase()] ?? null, D = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), L = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), M = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), S = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), V = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(b, { data: e, type: t, width: s }) }), H = ({ data: e, width: t, maxWidth: s, minWidth: n }) => /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx($, { value: e.value, direction: e.transactionType }) }), K = ({ checkBoxOptions: e, width: t, maxWidth: s, minWidth: n }) => {
|
|
28
|
+
}, R = (e) => E[e.toLowerCase()] ?? null, D = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), L = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), M = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), S = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o, className: c }) => /* @__PURE__ */ r.jsx(i, { className: c, width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), V = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(b, { data: e, type: t, width: s }) }), H = ({ data: e, width: t, maxWidth: s, minWidth: n }) => /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx($, { value: e.value, direction: e.transactionType }) }), K = ({ checkBoxOptions: e, width: t, maxWidth: s, minWidth: n }) => {
|
|
29
29
|
const o = e ? { ...e, name: e.name ?? "" } : void 0;
|
|
30
30
|
return /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx(F, { ...o }) });
|
|
31
31
|
}, P = ({ radioButtonOptions: e, width: t, maxWidth: s, minWidth: n }) => {
|
|
@@ -22,6 +22,9 @@ function u(t) {
|
|
|
22
22
|
return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "line", attr: { x1: "12", y1: "5", x2: "12", y2: "19" }, child: [] }, { tag: "line", attr: { x1: "5", y1: "12", x2: "19", y2: "12" }, child: [] }] })(t);
|
|
23
23
|
}
|
|
24
24
|
function s(t) {
|
|
25
|
+
return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "11", cy: "11", r: "8" }, child: [] }, { tag: "line", attr: { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }, child: [] }] })(t);
|
|
26
|
+
}
|
|
27
|
+
function h(t) {
|
|
25
28
|
return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "line", attr: { x1: "18", y1: "6", x2: "6", y2: "18" }, child: [] }, { tag: "line", attr: { x1: "6", y1: "6", x2: "18", y2: "18" }, child: [] }] })(t);
|
|
26
29
|
}
|
|
27
30
|
export {
|
|
@@ -32,5 +35,6 @@ export {
|
|
|
32
35
|
a as FiMinus,
|
|
33
36
|
d as FiMoreHorizontal,
|
|
34
37
|
u as FiPlus,
|
|
35
|
-
s as
|
|
38
|
+
s as FiSearch,
|
|
39
|
+
h as FiX
|
|
36
40
|
};
|