@hortiview/shared-components 0.0.9183 → 0.0.9233
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/Iconify-B9ptjDuU.js +91 -0
- package/dist/_Map-2-rfNHMr.js +59 -0
- package/dist/{_baseToString-CW6fzR92.js → _baseToString-xTcv8tEN.js} +12 -12
- package/dist/{_equalByTag-D07t7TSb.js → _equalByTag-Bi6Uk01d.js} +13 -13
- package/dist/_overArg-BC4qXKbU.js +9 -0
- package/dist/components/BaseView/BaseView.js +45 -37
- package/dist/components/BasicHeading/BasicHeading.js +1 -1
- package/dist/components/BlockView/BlockView.js +15 -15
- package/dist/components/BlockView/BlockView.test.js +4 -4
- package/dist/components/ChipCard/ChipCard.js +11 -9
- package/dist/components/ContextMenu/ContextMenu.js +31 -31
- package/dist/components/ContextMenu/ContextMenu.test.js +17 -17
- package/dist/components/DeleteModal/DeleteModal.js +42 -33
- package/dist/components/EmptyView/EmptyView.js +21 -13
- package/dist/components/Filter/Filter.js +37 -36
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +13 -4
- package/dist/components/FormComponents/FormSelect/FormSelect.js +88 -79
- package/dist/components/FormComponents/FormSlider/FormSlider.js +14 -13
- package/dist/components/FormComponents/FormText/FormText.js +36 -33
- package/dist/components/GenericTable/GenericTable.js +16 -15
- package/dist/components/HashTabView/HashTabView.js +68 -57
- package/dist/components/Iconify/Iconify.js +2 -2
- package/dist/components/Iconify/Iconify.test.js +1 -1
- package/dist/components/ListArea/ListArea.js +208 -198
- package/dist/components/ListArea/ListAreaService.d.ts +2 -0
- package/dist/components/ListArea/ListAreaService.js +42 -32
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +1 -1
- package/dist/components/Modal/Modal.js +3 -2
- package/dist/components/SearchBar/SearchBar.js +16 -15
- package/dist/{get-BLA_8TrC.js → get-DAwLfiRB.js} +2 -2
- package/dist/{iconify.module-BX040Mko.js → iconify.module-D_I3-4iU.js} +11 -11
- package/dist/isArray-thIeLpc5.js +35 -0
- package/dist/isPlainObject-BlCDf1Kc.js +18 -0
- package/dist/main.js +1 -1
- package/dist/services/UtilService.js +6 -5
- package/dist/services/services.test.js +6 -3
- package/package.json +1 -1
- package/dist/Iconify-DV7QhHmp.js +0 -96
- package/dist/_Map-CMkK6TmZ.js +0 -54
- package/dist/isArray-D_4rqWbH.js +0 -43
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Card as e, Chips as
|
|
3
|
-
import { OverflowTooltip as
|
|
4
|
-
import { s as
|
|
5
|
-
const h = ({ label:
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Card as e, Chips as a } from "@element/react-components";
|
|
3
|
+
import { OverflowTooltip as d } from "../OverflowTooltip/OverflowTooltip.js";
|
|
4
|
+
import { s as n } from "../../chipCard.module-BjpKuf1b.js";
|
|
5
|
+
const h = ({ label: t, icon: i, className: o = "" }) => /* @__PURE__ */ r(
|
|
6
6
|
e,
|
|
7
7
|
{
|
|
8
|
+
"data-testid": "chip-card",
|
|
8
9
|
variant: "flat",
|
|
9
10
|
bodyAlignment: "centered",
|
|
10
11
|
themeColor: "primary-50",
|
|
11
|
-
className: `${
|
|
12
|
-
children: /* @__PURE__ */
|
|
13
|
-
|
|
12
|
+
className: `${n.entityContainer} ${o}`,
|
|
13
|
+
children: /* @__PURE__ */ r(d, { id: `chip_card_${t}`, text: t, children: /* @__PURE__ */ r(
|
|
14
|
+
a,
|
|
14
15
|
{
|
|
16
|
+
"data-testid": `${t}-chip`,
|
|
15
17
|
chips: [
|
|
16
18
|
{
|
|
17
|
-
label:
|
|
19
|
+
label: t,
|
|
18
20
|
leadingIcon: i
|
|
19
21
|
}
|
|
20
22
|
],
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Menu as u, IconButton as f, List as d, ListItem as p } from "@element/react-components";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { uniqueId as
|
|
5
|
-
import { s } from "../../contextMenu.module-vNQHb48g.js";
|
|
6
|
-
const
|
|
7
|
-
triggerOpen:
|
|
3
|
+
import { useState as y, useCallback as r, useEffect as C } from "react";
|
|
4
|
+
import { uniqueId as k } from "lodash";
|
|
5
|
+
import { s as i } from "../../contextMenu.module-vNQHb48g.js";
|
|
6
|
+
const T = ({
|
|
7
|
+
triggerOpen: n = null,
|
|
8
8
|
actions: a,
|
|
9
|
-
iconOrientation:
|
|
9
|
+
iconOrientation: m = "vertical"
|
|
10
10
|
}) => {
|
|
11
|
-
const [
|
|
12
|
-
|
|
13
|
-
}, [
|
|
14
|
-
|
|
11
|
+
const [t, o] = y(!1), c = r(() => {
|
|
12
|
+
o(!t);
|
|
13
|
+
}, [t]), s = r(() => {
|
|
14
|
+
o(!1);
|
|
15
15
|
}, []);
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
}, [
|
|
16
|
+
return C(() => {
|
|
17
|
+
o(n !== null ? n : !1);
|
|
18
|
+
}, [n]), /* @__PURE__ */ l(
|
|
19
19
|
u,
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
22
|
-
"data-testid": "
|
|
23
|
-
open:
|
|
21
|
+
className: i.menu,
|
|
22
|
+
"data-testid": "selection-menu",
|
|
23
|
+
open: t,
|
|
24
24
|
surfaceOnly: !0,
|
|
25
25
|
hoistToBody: !0,
|
|
26
|
-
onClose:
|
|
27
|
-
trigger: /* @__PURE__ */
|
|
26
|
+
onClose: s,
|
|
27
|
+
trigger: /* @__PURE__ */ l(
|
|
28
28
|
f,
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
31
|
-
variant:
|
|
32
|
-
"data-testid": "
|
|
33
|
-
icon:
|
|
34
|
-
onClick:
|
|
30
|
+
className: i.icon,
|
|
31
|
+
variant: t ? "filled-primary" : void 0,
|
|
32
|
+
"data-testid": "open-button",
|
|
33
|
+
icon: m === "vertical" ? "more_vert" : "more_horiz",
|
|
34
|
+
onClick: c
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ l(d, { children: a.map((e) => /* @__PURE__ */ l(
|
|
38
38
|
p,
|
|
39
39
|
{
|
|
40
|
-
className:
|
|
41
|
-
...
|
|
40
|
+
className: i.listItem,
|
|
41
|
+
...e,
|
|
42
42
|
leadingBlockType: "icon",
|
|
43
|
-
"data-testid":
|
|
43
|
+
"data-testid": `list-item-button-${e.primaryText}`,
|
|
44
44
|
onClick: () => {
|
|
45
|
-
|
|
45
|
+
e?.onClick?.(), e.closeOnClick !== !1 && s();
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
k(`LI_${e.primaryText?.toString()}_`)
|
|
49
49
|
)) })
|
|
50
50
|
},
|
|
51
51
|
"selectionmenu"
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
T as ContextMenu
|
|
56
56
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { a as
|
|
3
|
-
import { ContextMenu as
|
|
4
|
-
import { v as
|
|
5
|
-
const
|
|
6
|
-
{ primaryText: "Open", onClick:
|
|
2
|
+
import { a as B, s as t, f as o, w as s } from "../../react.esm-Dy4VzU4L.js";
|
|
3
|
+
import { ContextMenu as p } from "./ContextMenu.js";
|
|
4
|
+
import { v as l, d as k, t as T, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
const C = l.fn(), a = l.fn(), i = l.fn(), g = [
|
|
6
|
+
{ primaryText: "Open", onClick: C, leadingBlock: "add" },
|
|
7
7
|
{ primaryText: "Delete", onClick: i, leadingBlock: "delete_outline" },
|
|
8
|
-
{ primaryText: "Edit", onClick:
|
|
8
|
+
{ primaryText: "Edit", onClick: a, leadingBlock: "edit" }
|
|
9
9
|
];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const c =
|
|
14
|
-
e(
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
const c =
|
|
18
|
-
e(
|
|
19
|
-
const
|
|
20
|
-
e(
|
|
10
|
+
k("ContextMenu Test", () => {
|
|
11
|
+
T("render contextMenu and close it", () => {
|
|
12
|
+
B(/* @__PURE__ */ r(p, { actions: g }));
|
|
13
|
+
const c = t.getByTestId("open-button"), n = t.getByTestId("selection-menu");
|
|
14
|
+
e(n).toBeInTheDocument(), e(n).not.toHaveClass("mdc-menu-surface--open"), o.click(c), s(() => e(n).toHaveClass("mdc-menu-surface--open")), o.click(c), s(() => e(n).not.toHaveClass("mdc-menu-surface--open"));
|
|
15
|
+
}), T("render ContextMenu and open it", async () => {
|
|
16
|
+
B(/* @__PURE__ */ r(p, { actions: g, triggerOpen: !0 }));
|
|
17
|
+
const c = t.getByTestId("open-button"), n = t.getByTestId("selection-menu");
|
|
18
|
+
e(n).toBeInTheDocument(), e(n).not.toHaveClass("mdc-menu-surface--open"), o.click(c), s(() => e(n).toHaveClass("mdc-menu-surface--open")), e(t.getByText("Open")).toBeInTheDocument(), e(t.getByText("Delete")).toBeInTheDocument(), e(t.getByText("Edit")).toBeInTheDocument();
|
|
19
|
+
const m = t.getByTestId("list-item-button-Open"), u = t.getByTestId("list-item-button-Delete"), d = t.getByTestId("list-item-button-Edit");
|
|
20
|
+
e(m).toBeInTheDocument(), e(u).toBeInTheDocument(), e(d).toBeInTheDocument(), o.click(m), e(C).toHaveBeenCalled(), e(i).not.toHaveBeenCalled(), e(a).not.toHaveBeenCalled(), o.click(u), e(i).toHaveBeenCalled(), o.click(d), e(a).toHaveBeenCalled();
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import { Button as u, Group as c, Icon as D, TypoBody as
|
|
2
|
+
import { Button as u, Group as c, Icon as D, TypoBody as l } from "@element/react-components";
|
|
3
3
|
import { uniqueId as N } from "lodash";
|
|
4
4
|
import { AvailableCustomIcons as S } from "../../enums/AvailableCustomIcons.js";
|
|
5
5
|
import { u as x } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
|
-
import { I as M } from "../../Iconify-
|
|
6
|
+
import { I as M } from "../../Iconify-B9ptjDuU.js";
|
|
7
7
|
import { Modal as j } from "../Modal/Modal.js";
|
|
8
|
-
import { s as
|
|
8
|
+
import { s as t } from "../../deleteModal.module-Ds3MDzdl.js";
|
|
9
9
|
const L = ({
|
|
10
|
-
title:
|
|
11
|
-
confirmButtonLabel:
|
|
12
|
-
cancelButtonLabel:
|
|
10
|
+
title: e,
|
|
11
|
+
confirmButtonLabel: o,
|
|
12
|
+
cancelButtonLabel: n,
|
|
13
13
|
deleteHeader: a,
|
|
14
14
|
deleteBody: i,
|
|
15
15
|
deleteText: f,
|
|
16
16
|
icon: g,
|
|
17
17
|
isIconCrossedOut: h,
|
|
18
|
-
impossibleDeleteHeader:
|
|
19
|
-
open:
|
|
18
|
+
impossibleDeleteHeader: b,
|
|
19
|
+
open: v,
|
|
20
20
|
setOpen: m,
|
|
21
|
-
onDelete:
|
|
21
|
+
onDelete: y,
|
|
22
22
|
isDeletePossible: d = !0
|
|
23
23
|
}) => {
|
|
24
24
|
const { isDesktop: C } = x(), k = (I) => {
|
|
@@ -27,21 +27,30 @@ const L = ({
|
|
|
27
27
|
return /* @__PURE__ */ r(
|
|
28
28
|
j,
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
30
|
+
className: t.modal,
|
|
31
31
|
modalSize: C ? "small" : "fullscreen",
|
|
32
|
-
open:
|
|
32
|
+
open: v,
|
|
33
33
|
onClose: k,
|
|
34
|
-
title:
|
|
34
|
+
title: e,
|
|
35
35
|
primaryButton: /* @__PURE__ */ r(
|
|
36
36
|
u,
|
|
37
37
|
{
|
|
38
|
+
"data-testid": "delete-button",
|
|
38
39
|
variant: "danger",
|
|
39
|
-
label:
|
|
40
|
-
onClick:
|
|
40
|
+
label: o,
|
|
41
|
+
onClick: y,
|
|
41
42
|
disabled: !d
|
|
42
43
|
}
|
|
43
44
|
),
|
|
44
|
-
footerSupplemental: /* @__PURE__ */ r(
|
|
45
|
+
footerSupplemental: /* @__PURE__ */ r(
|
|
46
|
+
u,
|
|
47
|
+
{
|
|
48
|
+
"data-testid": "cancel-button",
|
|
49
|
+
variant: "text",
|
|
50
|
+
label: n,
|
|
51
|
+
onClick: () => m(!1)
|
|
52
|
+
}
|
|
53
|
+
),
|
|
45
54
|
children: /* @__PURE__ */ p(c, { direction: "vertical", secondaryAlign: "center", children: [
|
|
46
55
|
/* @__PURE__ */ r(z, { element: /* @__PURE__ */ r(B, { icon: g }), isCrossedOut: h }),
|
|
47
56
|
/* @__PURE__ */ r(c, { direction: "vertical", children: d ? /* @__PURE__ */ r(
|
|
@@ -51,41 +60,41 @@ const L = ({
|
|
|
51
60
|
deleteText: f,
|
|
52
61
|
deleteBody: i
|
|
53
62
|
}
|
|
54
|
-
) : /* @__PURE__ */ r(A, { impossibleDeleteHeader:
|
|
63
|
+
) : /* @__PURE__ */ r(A, { impossibleDeleteHeader: b }) })
|
|
55
64
|
] })
|
|
56
65
|
}
|
|
57
66
|
);
|
|
58
67
|
}, z = ({
|
|
59
|
-
element:
|
|
60
|
-
isCrossedOut:
|
|
61
|
-
}) =>
|
|
68
|
+
element: e,
|
|
69
|
+
isCrossedOut: o = !1
|
|
70
|
+
}) => o ? /* @__PURE__ */ r("span", { className: t.crossedOut, children: e }) : e, B = ({ icon: e }) => e ? typeof e != "string" ? e : Object.values(S).includes(e) ? /* @__PURE__ */ r(
|
|
62
71
|
M,
|
|
63
72
|
{
|
|
64
|
-
icon:
|
|
73
|
+
icon: e,
|
|
65
74
|
iconSize: "xlarge",
|
|
66
|
-
className:
|
|
75
|
+
className: t.colorDanger
|
|
67
76
|
}
|
|
68
|
-
) : /* @__PURE__ */ r(D, { icon:
|
|
69
|
-
deleteHeader:
|
|
70
|
-
deleteText:
|
|
71
|
-
deleteBody:
|
|
77
|
+
) : /* @__PURE__ */ r(D, { icon: e, iconSize: "xlarge", className: t.colorDanger }) : /* @__PURE__ */ r(s, {}), O = ({
|
|
78
|
+
deleteHeader: e,
|
|
79
|
+
deleteText: o,
|
|
80
|
+
deleteBody: n
|
|
72
81
|
}) => /* @__PURE__ */ p(s, { children: [
|
|
73
|
-
/* @__PURE__ */ r(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
/* @__PURE__ */ r(l, { level: 1, themeColor: "text-primary-on-background", children: e }),
|
|
83
|
+
o && typeof o == "string" && /* @__PURE__ */ r(l, { level: 2, themeColor: "text-secondary-on-background", children: o }),
|
|
84
|
+
o && typeof o != "string" && /* @__PURE__ */ r(s, { children: o }),
|
|
85
|
+
n && o === void 0 && /* @__PURE__ */ r(c, { direction: "vertical", gap: "none", children: n.map((a, i) => /* @__PURE__ */ r(
|
|
86
|
+
l,
|
|
78
87
|
{
|
|
79
88
|
level: 2,
|
|
80
|
-
className:
|
|
89
|
+
className: t.bulletPoint,
|
|
81
90
|
themeColor: "text-secondary-on-background",
|
|
82
91
|
children: a
|
|
83
92
|
},
|
|
84
93
|
N(i.toString())
|
|
85
94
|
)) })
|
|
86
95
|
] }), A = ({
|
|
87
|
-
impossibleDeleteHeader:
|
|
88
|
-
}) => /* @__PURE__ */ r(
|
|
96
|
+
impossibleDeleteHeader: e
|
|
97
|
+
}) => /* @__PURE__ */ r(l, { level: 1, themeColor: "text-primary-on-background", children: e });
|
|
89
98
|
export {
|
|
90
99
|
L as DeleteModal
|
|
91
100
|
};
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { Hero as
|
|
3
|
-
const
|
|
2
|
+
import { Hero as d, HeroContent as h, Icon as s, TypoBody as i, Group as m } from "@element/react-components";
|
|
3
|
+
const u = ({
|
|
4
4
|
title: r = "",
|
|
5
5
|
subtitle: o = "",
|
|
6
|
-
icon:
|
|
6
|
+
icon: n = "dashbord",
|
|
7
7
|
text: t = "",
|
|
8
8
|
action: l
|
|
9
|
-
}) => /* @__PURE__ */ e(
|
|
9
|
+
}) => /* @__PURE__ */ e(
|
|
10
10
|
d,
|
|
11
11
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
"data-testid": "empty-view-container",
|
|
13
|
+
style: { width: "100%", height: "25vh" },
|
|
14
|
+
themeColor: "surface",
|
|
15
|
+
children: /* @__PURE__ */ e(
|
|
16
|
+
h,
|
|
17
|
+
{
|
|
18
|
+
logo: /* @__PURE__ */ e(s, { iconSize: "large", icon: n }),
|
|
19
|
+
overline: "",
|
|
20
|
+
subtitle: o,
|
|
21
|
+
title: r,
|
|
22
|
+
heroBtn: /* @__PURE__ */ e(p, { action: l, text: t })
|
|
23
|
+
}
|
|
24
|
+
)
|
|
17
25
|
}
|
|
18
|
-
)
|
|
19
|
-
/* @__PURE__ */ e(
|
|
26
|
+
), p = ({ action: r, text: o }) => o ? r ? /* @__PURE__ */ c(m, { direction: "vertical", primaryAlign: "center", secondaryAlign: "center", children: [
|
|
27
|
+
/* @__PURE__ */ e(i, { level: 2, children: o }),
|
|
20
28
|
r
|
|
21
|
-
] }) : /* @__PURE__ */ e(
|
|
29
|
+
] }) : /* @__PURE__ */ e(i, { level: 2, children: o }) : r;
|
|
22
30
|
export {
|
|
23
|
-
|
|
31
|
+
u as EmptyView
|
|
24
32
|
};
|
|
@@ -4,14 +4,14 @@ import { useState as y } from "react";
|
|
|
4
4
|
import { s as c } from "../../genericTable.module-Dk3yy2S3.js";
|
|
5
5
|
import { u as A } from "../../useBreakpoints-MzTZ0tCT.js";
|
|
6
6
|
import "../../alertBanner.module-BPiKN0gh.js";
|
|
7
|
-
import { I as H } from "../../Iconify-
|
|
7
|
+
import { I as H } from "../../Iconify-B9ptjDuU.js";
|
|
8
8
|
import "../../react-tooltip.min-BzHiZW8k.js";
|
|
9
9
|
import "../../overflowTooltip.module-YyRN2MGc.js";
|
|
10
10
|
import "../../basicHeading.module-BYb8xvuk.js";
|
|
11
|
-
import "../../isArray-
|
|
12
|
-
import "../../_baseToString-
|
|
13
|
-
import "../../_equalByTag-
|
|
14
|
-
import "../../iconify.module-
|
|
11
|
+
import "../../isArray-thIeLpc5.js";
|
|
12
|
+
import "../../_baseToString-xTcv8tEN.js";
|
|
13
|
+
import "../../_equalByTag-Bi6Uk01d.js";
|
|
14
|
+
import "../../iconify.module-D_I3-4iU.js";
|
|
15
15
|
import { SearchBar as K } from "../SearchBar/SearchBar.js";
|
|
16
16
|
import "../../listArea.module-BhO_OJ1S.js";
|
|
17
17
|
import "../../verticalDivider.module-C3_GL-fH.js";
|
|
@@ -34,21 +34,22 @@ import "react-hook-form";
|
|
|
34
34
|
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
35
35
|
import "../../formSelect.module-DMHh1bp8.js";
|
|
36
36
|
import "../../formText.module-C0by6_DK.js";
|
|
37
|
-
|
|
37
|
+
import "../../isPlainObject-BlCDf1Kc.js";
|
|
38
|
+
const kt = ({
|
|
38
39
|
clearFilterText: f,
|
|
39
|
-
closeCallback:
|
|
40
|
-
currentFilter:
|
|
41
|
-
filterButtonAsIcon:
|
|
40
|
+
closeCallback: m,
|
|
41
|
+
currentFilter: i,
|
|
42
|
+
filterButtonAsIcon: s = !1,
|
|
42
43
|
filterButtonText: n,
|
|
43
|
-
filterModalTitle:
|
|
44
|
+
filterModalTitle: e,
|
|
44
45
|
filters: p,
|
|
45
46
|
modalCancelButtonText: g,
|
|
46
47
|
modalConfirmButtonText: u,
|
|
47
48
|
useModal: l = !0,
|
|
48
49
|
selectAllLabel: r
|
|
49
50
|
}) => {
|
|
50
|
-
const { isDesktop: w } = A(), [O, v] = y(!1), [d, x] = y(
|
|
51
|
-
v(!1),
|
|
51
|
+
const { isDesktop: w } = A(), [O, v] = y(!1), [d, x] = y(i), [_, S] = y(0), F = () => {
|
|
52
|
+
v(!1), m(d), S(
|
|
52
53
|
d.reduce((a, { filterValue: o }) => o === void 0 ? a : typeof o == "boolean" ? o ? a + 1 : a : Array.isArray(o) ? a + o.length : typeof o == "string" && o.length ? a + 1 : a, 0)
|
|
53
54
|
);
|
|
54
55
|
}, D = () => {
|
|
@@ -58,14 +59,14 @@ const Ft = ({
|
|
|
58
59
|
...d.filter((I) => I.id !== a.id),
|
|
59
60
|
a
|
|
60
61
|
];
|
|
61
|
-
x(o), l ||
|
|
62
|
+
x(o), l || m(o);
|
|
62
63
|
};
|
|
63
64
|
return l ? /* @__PURE__ */ C(T, { children: [
|
|
64
65
|
/* @__PURE__ */ t(
|
|
65
66
|
P,
|
|
66
67
|
{
|
|
67
68
|
filterButtonText: n,
|
|
68
|
-
filterButtonAsIcon:
|
|
69
|
+
filterButtonAsIcon: s,
|
|
69
70
|
count: _,
|
|
70
71
|
onClick: () => v(!0)
|
|
71
72
|
}
|
|
@@ -75,7 +76,7 @@ const Ft = ({
|
|
|
75
76
|
{
|
|
76
77
|
open: O,
|
|
77
78
|
onClose: F,
|
|
78
|
-
title:
|
|
79
|
+
title: e,
|
|
79
80
|
modalSize: w ? "small" : "fullscreen",
|
|
80
81
|
headerActions: /* @__PURE__ */ t(h, { variant: "text", onClick: D, children: f }),
|
|
81
82
|
dismissiveButton: /* @__PURE__ */ t(h, { variant: "outlined", onClick: () => v(!1), children: g }),
|
|
@@ -84,12 +85,12 @@ const Ft = ({
|
|
|
84
85
|
}
|
|
85
86
|
)
|
|
86
87
|
] }) : /* @__PURE__ */ t(B, { secondaryAlign: "center", fullWidth: !0, children: b(p, d, k, r, !1) });
|
|
87
|
-
}, b = (f,
|
|
88
|
+
}, b = (f, m, i, s, n = !0) => f.map(({ id: e, title: p, availableOptions: g, icon: u, type: l }) => /* @__PURE__ */ C(B, { fullWidth: !0, secondaryAlign: "center", children: [
|
|
88
89
|
u ? /* @__PURE__ */ t(H, { icon: u, iconSize: "medium" }) : null,
|
|
89
90
|
l === "select" && /* @__PURE__ */ t(
|
|
90
91
|
W,
|
|
91
92
|
{
|
|
92
|
-
selectAllLabel:
|
|
93
|
+
selectAllLabel: s,
|
|
93
94
|
className: n ? void 0 : c.dense,
|
|
94
95
|
variant: "outlined",
|
|
95
96
|
options: g,
|
|
@@ -97,11 +98,11 @@ const Ft = ({
|
|
|
97
98
|
multiSelect: !0,
|
|
98
99
|
textKey: "text",
|
|
99
100
|
valueKey: "id",
|
|
100
|
-
value:
|
|
101
|
-
onChange: (r) =>
|
|
101
|
+
value: m.find((r) => r.id === e)?.filterValue ?? [],
|
|
102
|
+
onChange: (r) => i({ id: e, type: l, filterValue: r }),
|
|
102
103
|
hoisted: !0,
|
|
103
104
|
menuMaxHeight: "300px",
|
|
104
|
-
disabled:
|
|
105
|
+
disabled: e === "location",
|
|
105
106
|
showOptionFilter: !1,
|
|
106
107
|
dense: !n,
|
|
107
108
|
fixedHeightInput: !n,
|
|
@@ -112,34 +113,34 @@ const Ft = ({
|
|
|
112
113
|
j,
|
|
113
114
|
{
|
|
114
115
|
label: p,
|
|
115
|
-
onChange: (r) =>
|
|
116
|
-
checked: !!
|
|
116
|
+
onChange: (r) => i({ id: e, type: l, filterValue: r }),
|
|
117
|
+
checked: !!m.find((r) => r.id === e)?.filterValue
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
120
|
l === "search" && /* @__PURE__ */ t(
|
|
120
121
|
K,
|
|
121
122
|
{
|
|
122
123
|
placeholder: p,
|
|
123
|
-
searchTerm:
|
|
124
|
-
setSearchTerm: (r) =>
|
|
124
|
+
searchTerm: m.find((r) => r.id === e)?.filterValue,
|
|
125
|
+
setSearchTerm: (r) => i({ id: e, type: l, filterValue: r })
|
|
125
126
|
}
|
|
126
127
|
)
|
|
127
|
-
] },
|
|
128
|
+
] }, e)), P = ({
|
|
128
129
|
filterButtonText: f,
|
|
129
|
-
filterButtonAsIcon:
|
|
130
|
-
count:
|
|
131
|
-
onClick:
|
|
130
|
+
filterButtonAsIcon: m,
|
|
131
|
+
count: i,
|
|
132
|
+
onClick: s
|
|
132
133
|
}) => {
|
|
133
134
|
const { isDesktop: n } = A();
|
|
134
|
-
return
|
|
135
|
+
return m ? /* @__PURE__ */ t(
|
|
135
136
|
z,
|
|
136
137
|
{
|
|
137
138
|
icon: "filter_list_alt",
|
|
138
|
-
onClick:
|
|
139
|
-
badge:
|
|
139
|
+
onClick: s,
|
|
140
|
+
badge: i !== 0 && /* @__PURE__ */ t(
|
|
140
141
|
N,
|
|
141
142
|
{
|
|
142
|
-
counter:
|
|
143
|
+
counter: i,
|
|
143
144
|
className: c.filterBadge,
|
|
144
145
|
themeColor: "secondary",
|
|
145
146
|
"data-testid": "filter-badge"
|
|
@@ -158,16 +159,16 @@ const Ft = ({
|
|
|
158
159
|
variant: "outlined",
|
|
159
160
|
themeColor: "primary",
|
|
160
161
|
leadingIcon: "filter_list_alt",
|
|
161
|
-
onClick:
|
|
162
|
+
onClick: s,
|
|
162
163
|
className: c.filterButton,
|
|
163
164
|
fullWidth: !n,
|
|
164
165
|
children: f
|
|
165
166
|
}
|
|
166
167
|
),
|
|
167
|
-
|
|
168
|
+
i !== 0 && /* @__PURE__ */ t(
|
|
168
169
|
N,
|
|
169
170
|
{
|
|
170
|
-
counter:
|
|
171
|
+
counter: i,
|
|
171
172
|
className: c.filterBadge,
|
|
172
173
|
themeColor: "secondary",
|
|
173
174
|
"data-testid": "filter-badge"
|
|
@@ -178,5 +179,5 @@ const Ft = ({
|
|
|
178
179
|
);
|
|
179
180
|
};
|
|
180
181
|
export {
|
|
181
|
-
|
|
182
|
+
kt as Filter
|
|
182
183
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as X, jsxs as va } from "react/jsx-runtime";
|
|
2
2
|
import { Datepicker as fa, Divider as ga, Padding as pa, Button as ba } from "@element/react-components";
|
|
3
|
-
import { g as wa } from "../../../get-
|
|
3
|
+
import { g as wa } from "../../../get-DAwLfiRB.js";
|
|
4
4
|
import { useMemo as S, useState as ya } from "react";
|
|
5
5
|
import { useFormContext as Pa, Controller as $a } from "react-hook-form";
|
|
6
6
|
import { s as L } from "../../../formDatePicker.module-BV3ma_7y.js";
|
|
@@ -30000,9 +30000,10 @@ const E7 = X7, F7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
30000
30000
|
name: r,
|
|
30001
30001
|
rules: l,
|
|
30002
30002
|
control: v,
|
|
30003
|
-
render: ({ field: { ref: ha, onChange: V, value: F, ...ca } }) => /* @__PURE__ */ X("div", { className: L.datePickerContainer, children: /* @__PURE__ */ X(
|
|
30003
|
+
render: ({ field: { ref: ha, onChange: V, value: F, ...ca } }) => /* @__PURE__ */ X("div", { "data-testid": "date-picker-container", className: L.datePickerContainer, children: /* @__PURE__ */ X(
|
|
30004
30004
|
fa,
|
|
30005
30005
|
{
|
|
30006
|
+
"data-testid": "date-picker",
|
|
30006
30007
|
...h,
|
|
30007
30008
|
...ca,
|
|
30008
30009
|
locale: C,
|
|
@@ -30012,9 +30013,17 @@ const E7 = X7, F7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
30012
30013
|
label: e,
|
|
30013
30014
|
format: (W) => W ? te(W.toISOString()).toLocaleDateString(m ?? "en") : "",
|
|
30014
30015
|
disableClearing: !0,
|
|
30015
|
-
trailingContent: /* @__PURE__ */ va("div", { className: L.trailingContent, children: [
|
|
30016
|
+
trailingContent: /* @__PURE__ */ va("div", { "data-testid": "trailing-content", className: L.trailingContent, children: [
|
|
30016
30017
|
/* @__PURE__ */ X(ga, {}),
|
|
30017
|
-
/* @__PURE__ */ X(pa, { variant: "dense", children: /* @__PURE__ */ X(
|
|
30018
|
+
/* @__PURE__ */ X(pa, { variant: "dense", children: /* @__PURE__ */ X(
|
|
30019
|
+
ba,
|
|
30020
|
+
{
|
|
30021
|
+
"data-testid": `button-${n}`,
|
|
30022
|
+
label: n,
|
|
30023
|
+
variant: "text",
|
|
30024
|
+
onClick: () => K(!1)
|
|
30025
|
+
}
|
|
30026
|
+
) })
|
|
30018
30027
|
] }),
|
|
30019
30028
|
onClick: () => {
|
|
30020
30029
|
K(!0);
|