@hortiview/shared-components 0.0.6890 → 0.0.7018
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/BlockView.module-BPlNT5uh.js +15 -0
- package/dist/HashTabView.module-CJX4gxTu.js +13 -0
- package/dist/HeaderFilter.module-DiBmulr5.js +7 -0
- package/dist/Iconify-CY9lZjFd.js +95 -0
- package/dist/_baseToString-BNXOi2Mf.js +197 -0
- package/dist/_equalByTag-DJhSpgVG.js +157 -0
- package/dist/alertBanner.module-HneYdVzN.js +10 -0
- package/dist/assets/{main.css → Filter.css} +1 -1
- package/dist/assets/baseView.css +1 -0
- package/dist/assets/basicHeading.css +1 -0
- package/dist/assets/listArea.css +1 -0
- package/dist/baseView.module-ve87u_d0.js +12 -0
- package/dist/basicHeading.module-BYb8xvuk.js +16 -0
- package/dist/bigLoadingSpinner.module-GgbFol8k.js +11 -0
- package/dist/components/AlertBanner/AlertBanner.js +12 -17
- package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
- package/dist/components/BaseView/BaseView.js +42 -45
- package/dist/components/BaseView/BaseView.test.js +6 -4
- package/dist/components/BasicHeading/BasicHeading.js +39 -50
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.js +41 -51
- package/dist/components/BlockView/BlockView.test.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +18 -20
- package/dist/components/ContextMenu/ContextMenu.test.js +1 -1
- package/dist/components/DeleteModal/DeleteModal.js +55 -60
- package/dist/components/DeleteModal/DeleteModal.test.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +8 -11
- package/dist/components/Disclaimer/Disclaimer.test.js +1 -1
- package/dist/components/EmptyView/EmptyView.test.js +1 -1
- package/dist/components/Filter/Filter.d.ts +27 -0
- package/dist/components/Filter/Filter.js +149 -0
- package/dist/components/Filter/Filter.test.d.ts +1 -0
- package/dist/components/Filter/Filter.test.js +114 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +46 -52
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +1 -1
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +68 -73
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +1 -1
- package/dist/components/FormComponents/FormText/FormText.js +57 -62
- package/dist/components/FormComponents/FormText/FormText.test.js +1 -1
- package/dist/components/GenericTable/GenericTable.js +52 -58
- package/dist/components/GenericTable/GenericTable.test.js +1 -1
- package/dist/components/HashTabView/HashTabView.js +46 -54
- package/dist/components/HashTabView/HashTabView.test.js +1 -1
- package/dist/components/HeaderFilter/HeaderFilter.js +14 -16
- package/dist/components/HeaderFilter/HeaderFilter.test.js +1 -1
- package/dist/components/Iconify/Iconify.d.ts +3 -13
- package/dist/components/Iconify/Iconify.js +6 -163
- package/dist/components/Iconify/Iconify.test.js +2 -2
- package/dist/components/InfoGroup/InfoGroup.js +38 -47
- package/dist/components/InfoGroup/InfoGroup.test.js +1 -1
- package/dist/components/ListArea/ListArea.js +258 -490
- package/dist/components/ListArea/ListArea.test.js +2 -2
- package/dist/components/ListArea/ListAreaService.js +82 -8
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +9 -5
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -2
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +13 -15
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +2 -2
- package/dist/components/Scrollbar/scrollbar.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +21 -23
- package/dist/components/SearchBar/SearchBar.test.js +1 -1
- package/dist/components/VerticalDivider/VerticalDivider.js +4 -6
- package/dist/components/VerticalDivider/VerticalDivider.test.js +1 -1
- package/dist/contextMenu.module-B7aUMFPe.js +7 -0
- package/dist/deleteModal.module-Ds3MDzdl.js +10 -0
- package/dist/disclaimer.module-BZydt-Q_.js +8 -0
- package/dist/formDatePicker.module-BV3ma_7y.js +11 -0
- package/dist/formSelect.module-C18N-SsT.js +11 -0
- package/dist/formText.module-Blt6Y-SR.js +10 -0
- package/dist/genericTable.module-BkU2VDKR.js +11 -0
- package/dist/get-UxX31Aph.js +47 -0
- package/dist/hooks/useBreakpoint.d.ts +8 -1
- package/dist/hooks/useBreakpoint.js +1 -1
- package/dist/hooks/useBreakpoints.test.js +2 -2
- package/dist/iconify.module-C89oaw5b.js +79 -0
- package/dist/{index-DP2ENnrX.js → index-BQnj-5Zt.js} +1 -1
- package/dist/infoGroup.module-B3E1gCGi.js +14 -0
- package/dist/isArray-Ca4KR8TK.js +91 -0
- package/dist/listArea.module-B-gPyfbE.js +19 -0
- package/dist/loadingSpinner.module-CLtqSMWA.js +7 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +55 -52
- package/dist/{react.esm-DoZanrUz.js → react.esm-C3jDj5Fe.js} +1 -0
- package/dist/searchBar.module-9gKyrZRT.js +7 -0
- package/dist/types/Filter.d.ts +31 -0
- package/dist/types/Filter.js +1 -0
- package/dist/useBreakpoint-BNeVhjjZ.js +33 -0
- package/dist/verticalDivider.module-C3_GL-fH.js +7 -0
- package/package.json +1 -1
- package/dist/BigLoadingSpinner-Df2k3xOD.js +0 -18
- package/dist/ListAreaService-DDlsV9UD.js +0 -100
- package/dist/assets/BaseView.css +0 -1
- package/dist/assets/BasicHeading.css +0 -1
- package/dist/assets/ListAreaService.css +0 -1
- package/dist/get-BRDhkfK0.js +0 -324
- package/dist/useBreakpoint-2MH8ICuE.js +0 -28
- /package/dist/assets/{AlertBanner.css → alertBanner.css} +0 -0
- /package/dist/assets/{BigLoadingSpinner.css → bigLoadingSpinner.css} +0 -0
- /package/dist/assets/{ContextMenu.css → contextMenu.css} +0 -0
- /package/dist/assets/{DeleteModal.css → deleteModal.css} +0 -0
- /package/dist/assets/{Disclaimer.css → disclaimer.css} +0 -0
- /package/dist/assets/{FormDatePicker.css → formDatePicker.css} +0 -0
- /package/dist/assets/{FormSelect.css → formSelect.css} +0 -0
- /package/dist/assets/{FormText.css → formText.css} +0 -0
- /package/dist/assets/{GenericTable.css → genericTable.css} +0 -0
- /package/dist/assets/{Iconify.css → iconify.css} +0 -0
- /package/dist/assets/{InfoGroup.css → infoGroup.css} +0 -0
- /package/dist/assets/{LoadingSpinner.css → loadingSpinner.css} +0 -0
- /package/dist/assets/{SearchBar.css → searchBar.css} +0 -0
- /package/dist/assets/{VerticalDivider.css → verticalDivider.css} +0 -0
|
@@ -1,82 +1,77 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
colorDanger: M,
|
|
11
|
-
crossedOut: j
|
|
12
|
-
}, J = ({
|
|
13
|
-
title: r,
|
|
14
|
-
confirmButtonLabel: e,
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as k, Button as u, Group as c, Icon as D, TypoBody as t } from "@element/react-components";
|
|
3
|
+
import { uniqueId as N } from "lodash";
|
|
4
|
+
import { AvailableCustomIcons as S } from "../../enums/AvailableCustomIcons.js";
|
|
5
|
+
import { I as x } from "../../Iconify-CY9lZjFd.js";
|
|
6
|
+
import { s as n } from "../../deleteModal.module-Ds3MDzdl.js";
|
|
7
|
+
const w = ({
|
|
8
|
+
title: e,
|
|
9
|
+
confirmButtonLabel: o,
|
|
15
10
|
cancelButtonLabel: l,
|
|
16
11
|
deleteHeader: a,
|
|
17
|
-
deleteBody:
|
|
18
|
-
deleteText:
|
|
19
|
-
icon:
|
|
12
|
+
deleteBody: i,
|
|
13
|
+
deleteText: f,
|
|
14
|
+
icon: g,
|
|
20
15
|
isIconCrossedOut: h,
|
|
21
|
-
impossibleDeleteHeader:
|
|
22
|
-
open:
|
|
23
|
-
setOpen:
|
|
24
|
-
onDelete:
|
|
25
|
-
isDeletePossible:
|
|
16
|
+
impossibleDeleteHeader: v,
|
|
17
|
+
open: y,
|
|
18
|
+
setOpen: m,
|
|
19
|
+
onDelete: b,
|
|
20
|
+
isDeletePossible: d = !0
|
|
26
21
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
22
|
+
const C = (I) => {
|
|
23
|
+
I.detail.action === "close" && m(!1);
|
|
29
24
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
25
|
+
return /* @__PURE__ */ r(
|
|
26
|
+
k,
|
|
32
27
|
{
|
|
33
28
|
className: n.modal,
|
|
34
29
|
modalSize: "small",
|
|
35
|
-
open:
|
|
36
|
-
onClose:
|
|
37
|
-
title:
|
|
38
|
-
primaryButton: /* @__PURE__ */
|
|
30
|
+
open: y,
|
|
31
|
+
onClose: C,
|
|
32
|
+
title: e,
|
|
33
|
+
primaryButton: /* @__PURE__ */ r(
|
|
39
34
|
u,
|
|
40
35
|
{
|
|
41
36
|
variant: "danger",
|
|
42
|
-
label:
|
|
43
|
-
onClick:
|
|
44
|
-
disabled: !
|
|
37
|
+
label: o,
|
|
38
|
+
onClick: b,
|
|
39
|
+
disabled: !d
|
|
45
40
|
}
|
|
46
41
|
),
|
|
47
|
-
footerSupplemental: /* @__PURE__ */
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
42
|
+
footerSupplemental: /* @__PURE__ */ r(u, { variant: "text", label: l, onClick: () => m(!1) }),
|
|
43
|
+
children: /* @__PURE__ */ p(c, { direction: "vertical", secondaryAlign: "center", children: [
|
|
44
|
+
/* @__PURE__ */ r(M, { element: /* @__PURE__ */ r(j, { icon: g }), isCrossedOut: h }),
|
|
45
|
+
/* @__PURE__ */ r(c, { direction: "vertical", children: d ? /* @__PURE__ */ r(
|
|
46
|
+
z,
|
|
52
47
|
{
|
|
53
48
|
deleteHeader: a,
|
|
54
|
-
deleteText:
|
|
55
|
-
deleteBody:
|
|
49
|
+
deleteText: f,
|
|
50
|
+
deleteBody: i
|
|
56
51
|
}
|
|
57
|
-
) : /* @__PURE__ */
|
|
52
|
+
) : /* @__PURE__ */ r(O, { impossibleDeleteHeader: v }) })
|
|
58
53
|
] })
|
|
59
54
|
}
|
|
60
55
|
);
|
|
61
|
-
},
|
|
62
|
-
element:
|
|
63
|
-
isCrossedOut:
|
|
64
|
-
}) =>
|
|
65
|
-
|
|
56
|
+
}, M = ({
|
|
57
|
+
element: e,
|
|
58
|
+
isCrossedOut: o = !1
|
|
59
|
+
}) => o ? /* @__PURE__ */ r("span", { className: n.crossedOut, children: e }) : e, j = ({ icon: e }) => e ? typeof e != "string" ? e : Object.values(S).includes(e) ? /* @__PURE__ */ r(
|
|
60
|
+
x,
|
|
66
61
|
{
|
|
67
|
-
icon:
|
|
62
|
+
icon: e,
|
|
68
63
|
iconSize: "xlarge",
|
|
69
64
|
className: n.colorDanger
|
|
70
65
|
}
|
|
71
|
-
) : /* @__PURE__ */
|
|
72
|
-
deleteHeader:
|
|
73
|
-
deleteText:
|
|
66
|
+
) : /* @__PURE__ */ r(D, { icon: e, iconSize: "xlarge", className: n.colorDanger }) : /* @__PURE__ */ r(s, {}), z = ({
|
|
67
|
+
deleteHeader: e,
|
|
68
|
+
deleteText: o,
|
|
74
69
|
deleteBody: l
|
|
75
|
-
}) => /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
l &&
|
|
70
|
+
}) => /* @__PURE__ */ p(s, { children: [
|
|
71
|
+
/* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: e }),
|
|
72
|
+
o && typeof o == "string" && /* @__PURE__ */ r(t, { level: 2, themeColor: "text-secondary-on-background", children: o }),
|
|
73
|
+
o && typeof o != "string" && /* @__PURE__ */ r(s, { children: o }),
|
|
74
|
+
l && o === void 0 && /* @__PURE__ */ r(c, { direction: "vertical", gap: "none", children: l.map((a, i) => /* @__PURE__ */ r(
|
|
80
75
|
t,
|
|
81
76
|
{
|
|
82
77
|
level: 2,
|
|
@@ -84,11 +79,11 @@ const S = "_bulletPoint_1kyg0_1", x = "_modal_1kyg0_6", M = "_colorDanger_1kyg0_
|
|
|
84
79
|
themeColor: "text-secondary-on-background",
|
|
85
80
|
children: a
|
|
86
81
|
},
|
|
87
|
-
|
|
82
|
+
N(i.toString())
|
|
88
83
|
)) })
|
|
89
|
-
] }),
|
|
90
|
-
impossibleDeleteHeader:
|
|
91
|
-
}) => /* @__PURE__ */
|
|
84
|
+
] }), O = ({
|
|
85
|
+
impossibleDeleteHeader: e
|
|
86
|
+
}) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: e });
|
|
92
87
|
export {
|
|
93
|
-
|
|
88
|
+
w as DeleteModal
|
|
94
89
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { a as c, s as e } from "../../react.esm-
|
|
2
|
+
import { a as c, s as e } from "../../react.esm-C3jDj5Fe.js";
|
|
3
3
|
import { DeleteModal as b } from "./DeleteModal.js";
|
|
4
4
|
import { d as B, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
B("DeleteModal Test", () => {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
iconArea: y
|
|
7
|
-
}, f = ({ text: o, subtext: e, icon: i, level: l = 2, bold: a = !1 }) => /* @__PURE__ */ n(
|
|
8
|
-
s,
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Group as n, TypoSubtitle as m, TypoBody as t, Icon as d } from "@element/react-components";
|
|
3
|
+
import { s as l } from "../../disclaimer.module-BZydt-Q_.js";
|
|
4
|
+
const f = ({ text: o, subtext: e, icon: i, level: c = 2, bold: a = !1 }) => /* @__PURE__ */ s(
|
|
5
|
+
n,
|
|
9
6
|
{
|
|
10
7
|
direction: i || e ? "vertical" : "horizontal",
|
|
11
8
|
secondaryAlign: "center",
|
|
12
9
|
primaryAlign: "center",
|
|
13
10
|
children: [
|
|
14
|
-
/* @__PURE__ */ r(
|
|
15
|
-
e && /* @__PURE__ */ r(
|
|
16
|
-
i && /* @__PURE__ */ r("div", { className:
|
|
11
|
+
/* @__PURE__ */ r(m, { className: l.disclaimer, level: c, bold: a, children: o }),
|
|
12
|
+
e && /* @__PURE__ */ r(t, { level: 2, children: e }),
|
|
13
|
+
i && /* @__PURE__ */ r("div", { className: l.iconArea, children: /* @__PURE__ */ r(d, { className: l.Icon, icon: i, iconSize: "large" }) })
|
|
17
14
|
]
|
|
18
15
|
}
|
|
19
16
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { a as r, s as t } from "../../react.esm-
|
|
2
|
+
import { a as r, s as t } from "../../react.esm-C3jDj5Fe.js";
|
|
3
3
|
import { Disclaimer as s } from "./Disclaimer.js";
|
|
4
4
|
import { d as i, t as m, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
i("Disclaimer test", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { a as s, s as o, w as r, f as l } from "../../react.esm-
|
|
2
|
+
import { a as s, s as o, w as r, f as l } from "../../react.esm-C3jDj5Fe.js";
|
|
3
3
|
import { EmptyView as c } from "./EmptyView.js";
|
|
4
4
|
import { d as h, t as T, g as e, v as d } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
h("EmptyView", () => {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FilterData, FilterSelection } from '../../types/Filter';
|
|
2
|
+
type FilterProps = {
|
|
3
|
+
modalCancelButtonText: string;
|
|
4
|
+
modalConfirmButtonText: string;
|
|
5
|
+
clearFilterText: string;
|
|
6
|
+
closeCallback: (filter: FilterSelection[]) => void;
|
|
7
|
+
currentFilter: FilterSelection[];
|
|
8
|
+
filterButtonAsIcon?: boolean;
|
|
9
|
+
filterButtonText: string;
|
|
10
|
+
filterModalTitle: string;
|
|
11
|
+
filters: FilterData[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Filter component that allows the user to filter the data provided
|
|
15
|
+
* @param clearFilterText - the text for the clear filter button
|
|
16
|
+
* @param closeCallback - the callback function when the filter modal is closed
|
|
17
|
+
* @param currentFilter - the current filter selection
|
|
18
|
+
* @param filterButtonAsIcon - if the filter button should be an icon
|
|
19
|
+
* @param filterButtonText - the text for the filter button
|
|
20
|
+
* @param filterModalTitle - the title for the filter modal
|
|
21
|
+
* @param filters - the filter data
|
|
22
|
+
* @param modalCancelButtonText - the text for the cancel button in the modal
|
|
23
|
+
* @param modalConfirmButtonText - the text for the confirm button in the modal
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const Filter: ({ clearFilterText, closeCallback, currentFilter, filterButtonAsIcon, filterButtonText, filterModalTitle, filters, modalCancelButtonText, modalConfirmButtonText, }: FilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import "../../assets/Filter.css";
|
|
2
|
+
import { jsxs as C, Fragment as I, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Modal as j, Button as a, Group as A, Select as D, IconButton as K, NotificationBadge as B } from "@element/react-components";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { u as v } from "../../useBreakpoint-BNeVhjjZ.js";
|
|
6
|
+
import "../../alertBanner.module-HneYdVzN.js";
|
|
7
|
+
import "../../iconify.module-C89oaw5b.js";
|
|
8
|
+
import "../../isArray-Ca4KR8TK.js";
|
|
9
|
+
import "../../react-tooltip.min-BzHiZW8k.js";
|
|
10
|
+
import "../../basicHeading.module-BYb8xvuk.js";
|
|
11
|
+
import "../../_baseToString-BNXOi2Mf.js";
|
|
12
|
+
import "../../_equalByTag-DJhSpgVG.js";
|
|
13
|
+
import "../../searchBar.module-9gKyrZRT.js";
|
|
14
|
+
import "../../listArea.module-B-gPyfbE.js";
|
|
15
|
+
import "../../verticalDivider.module-C3_GL-fH.js";
|
|
16
|
+
import "../../baseView.module-ve87u_d0.js";
|
|
17
|
+
import "../../BlockView.module-BPlNT5uh.js";
|
|
18
|
+
import "../../contextMenu.module-B7aUMFPe.js";
|
|
19
|
+
import "lodash";
|
|
20
|
+
import "../../deleteModal.module-Ds3MDzdl.js";
|
|
21
|
+
import "../../disclaimer.module-BZydt-Q_.js";
|
|
22
|
+
import "../../genericTable.module-BkU2VDKR.js";
|
|
23
|
+
import "../../HashTabView.module-CJX4gxTu.js";
|
|
24
|
+
import "../../HeaderFilter.module-DiBmulr5.js";
|
|
25
|
+
import "../../infoGroup.module-B3E1gCGi.js";
|
|
26
|
+
import "../../bigLoadingSpinner.module-GgbFol8k.js";
|
|
27
|
+
import "../../loadingSpinner.module-CLtqSMWA.js";
|
|
28
|
+
import "../Scrollbar/Scrollbar.js";
|
|
29
|
+
import "react-hook-form";
|
|
30
|
+
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
31
|
+
import "../../formSelect.module-C18N-SsT.js";
|
|
32
|
+
import "../../formText.module-Blt6Y-SR.js";
|
|
33
|
+
const M = "_filterButton_btr13_1", z = "_filterBadge_btr13_6", u = {
|
|
34
|
+
filterButton: M,
|
|
35
|
+
filterBadge: z
|
|
36
|
+
}, gt = ({
|
|
37
|
+
clearFilterText: m,
|
|
38
|
+
closeCallback: c,
|
|
39
|
+
currentFilter: i,
|
|
40
|
+
filterButtonAsIcon: r = !1,
|
|
41
|
+
filterButtonText: l,
|
|
42
|
+
filterModalTitle: _,
|
|
43
|
+
filters: F,
|
|
44
|
+
modalCancelButtonText: x,
|
|
45
|
+
modalConfirmButtonText: y
|
|
46
|
+
}) => {
|
|
47
|
+
const { isDesktop: b } = v(), [S, n] = f(!1), [s, h] = f(i), [k, g] = f(0), O = () => {
|
|
48
|
+
n(!1), c(s), g(
|
|
49
|
+
s.reduce((e, { selectedOptions: o }) => e + o.length, 0)
|
|
50
|
+
);
|
|
51
|
+
}, N = () => {
|
|
52
|
+
h([]), g(0);
|
|
53
|
+
}, w = (e) => {
|
|
54
|
+
const o = [
|
|
55
|
+
...s.filter((d) => d.id !== e.id),
|
|
56
|
+
e
|
|
57
|
+
];
|
|
58
|
+
h(o);
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ C(I, { children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
G,
|
|
63
|
+
{
|
|
64
|
+
filterButtonText: l,
|
|
65
|
+
filterButtonAsIcon: r,
|
|
66
|
+
count: k,
|
|
67
|
+
onClick: () => n(!0)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
j,
|
|
72
|
+
{
|
|
73
|
+
open: S,
|
|
74
|
+
onClose: () => n(!1),
|
|
75
|
+
title: _,
|
|
76
|
+
modalSize: b ? "small" : "fullscreen",
|
|
77
|
+
headerActions: /* @__PURE__ */ t(a, { variant: "text", onClick: N, children: m }),
|
|
78
|
+
dismissiveButton: /* @__PURE__ */ t(a, { variant: "outlined", onClick: () => n(!1), children: x }),
|
|
79
|
+
primaryButton: /* @__PURE__ */ t(a, { variant: "filled", onClick: O, children: y }),
|
|
80
|
+
children: /* @__PURE__ */ t(A, { direction: "vertical", children: F.map(({ id: e, title: o, availableOptions: d }) => /* @__PURE__ */ t(
|
|
81
|
+
D,
|
|
82
|
+
{
|
|
83
|
+
variant: "outlined",
|
|
84
|
+
options: d,
|
|
85
|
+
label: o,
|
|
86
|
+
multiSelect: !0,
|
|
87
|
+
textKey: "text",
|
|
88
|
+
valueKey: "id",
|
|
89
|
+
value: s.find((p) => p.id === e)?.selectedOptions ?? [],
|
|
90
|
+
onChange: (p) => w({ id: e, selectedOptions: p }),
|
|
91
|
+
hoisted: !0,
|
|
92
|
+
menuMaxHeight: "300px",
|
|
93
|
+
disabled: e === "location",
|
|
94
|
+
showOptionFilter: !1
|
|
95
|
+
},
|
|
96
|
+
e
|
|
97
|
+
)) })
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] });
|
|
101
|
+
}, G = ({
|
|
102
|
+
filterButtonText: m,
|
|
103
|
+
filterButtonAsIcon: c,
|
|
104
|
+
count: i,
|
|
105
|
+
onClick: r
|
|
106
|
+
}) => {
|
|
107
|
+
const { isDesktop: l } = v();
|
|
108
|
+
return c ? /* @__PURE__ */ t(
|
|
109
|
+
K,
|
|
110
|
+
{
|
|
111
|
+
icon: "filter_list_alt",
|
|
112
|
+
onClick: r,
|
|
113
|
+
badge: i !== 0 && /* @__PURE__ */ t(
|
|
114
|
+
B,
|
|
115
|
+
{
|
|
116
|
+
counter: i,
|
|
117
|
+
className: u.filterBadge,
|
|
118
|
+
themeColor: "secondary",
|
|
119
|
+
"data-testid": "filter-badge"
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
) : /* @__PURE__ */ C("div", { style: { height: "100%", width: l ? void 0 : "100%" }, children: [
|
|
124
|
+
/* @__PURE__ */ t(
|
|
125
|
+
a,
|
|
126
|
+
{
|
|
127
|
+
variant: "outlined",
|
|
128
|
+
themeColor: "primary",
|
|
129
|
+
leadingIcon: "filter_list_alt",
|
|
130
|
+
onClick: r,
|
|
131
|
+
className: u.filterButton,
|
|
132
|
+
fullWidth: !l,
|
|
133
|
+
children: m
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
i !== 0 && /* @__PURE__ */ t(
|
|
137
|
+
B,
|
|
138
|
+
{
|
|
139
|
+
counter: i,
|
|
140
|
+
className: u.filterBadge,
|
|
141
|
+
themeColor: "secondary",
|
|
142
|
+
"data-testid": "filter-badge"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] });
|
|
146
|
+
};
|
|
147
|
+
export {
|
|
148
|
+
gt as Filter
|
|
149
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { a, s as t, f as c, t as u, w as x } from "../../react.esm-C3jDj5Fe.js";
|
|
3
|
+
import { u as d } from "../../useBreakpoint-BNeVhjjZ.js";
|
|
4
|
+
import { Filter as T } from "./Filter.js";
|
|
5
|
+
import { v as m, b as s, d as f, t as B, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
6
|
+
const o = m.fn();
|
|
7
|
+
m.mock("../../hooks/useBreakpoint");
|
|
8
|
+
const y = d;
|
|
9
|
+
s(() => {
|
|
10
|
+
y.mockReturnValue({ isDesktop: !0 });
|
|
11
|
+
});
|
|
12
|
+
f("Filter", () => {
|
|
13
|
+
const n = [
|
|
14
|
+
{
|
|
15
|
+
id: "1",
|
|
16
|
+
title: "Filter 1",
|
|
17
|
+
availableOptions: [
|
|
18
|
+
{ id: "1", text: "Option 1" },
|
|
19
|
+
{ id: "2", text: "Option 2" }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "2",
|
|
24
|
+
title: "Filter 2",
|
|
25
|
+
availableOptions: [
|
|
26
|
+
{ id: "3", text: "Option 3" },
|
|
27
|
+
{ id: "4", text: "Option 4" }
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
], i = [
|
|
31
|
+
{ id: "1", selectedOptions: [{ id: "1", text: "Option 1" }] },
|
|
32
|
+
{ id: "2", selectedOptions: [{ id: "3", text: "Option 3" }] }
|
|
33
|
+
];
|
|
34
|
+
B("should render filter", () => {
|
|
35
|
+
a(
|
|
36
|
+
/* @__PURE__ */ r(
|
|
37
|
+
T,
|
|
38
|
+
{
|
|
39
|
+
filters: n,
|
|
40
|
+
currentFilter: i,
|
|
41
|
+
closeCallback: o,
|
|
42
|
+
filterButtonText: "filterButtonText",
|
|
43
|
+
filterModalTitle: "filterModalTitle",
|
|
44
|
+
modalCancelButtonText: "modalCancelButtonText",
|
|
45
|
+
modalConfirmButtonText: "modalConfirmButtonText",
|
|
46
|
+
clearFilterText: "clearFilterText"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
), e(t.getByText("filterButtonText")).toBeInTheDocument(), e(t.getByText("filterModalTitle")).toBeInTheDocument(), e(t.getByText("modalCancelButtonText")).toBeInTheDocument(), e(t.getByText("modalConfirmButtonText")).toBeInTheDocument(), e(t.getByText("clearFilterText")).toBeInTheDocument(), e(t.getByText("Filter 1")).toBeInTheDocument(), e(t.getByText("Filter 2")).toBeInTheDocument(), e(t.getByText("Option 1")).toBeInTheDocument(), e(t.getByText("Option 3")).toBeInTheDocument();
|
|
50
|
+
const l = t.getByRole("button", { name: "modalConfirmButtonText" });
|
|
51
|
+
c.click(l), u.act(() => {
|
|
52
|
+
e(o).toHaveBeenCalledTimes(1), e(t.getByText("2")).toBeInTheDocument();
|
|
53
|
+
});
|
|
54
|
+
}), B("should clear filter", () => {
|
|
55
|
+
a(
|
|
56
|
+
/* @__PURE__ */ r(
|
|
57
|
+
T,
|
|
58
|
+
{
|
|
59
|
+
filters: n,
|
|
60
|
+
currentFilter: i,
|
|
61
|
+
closeCallback: o,
|
|
62
|
+
filterButtonText: "filterButtonText",
|
|
63
|
+
filterModalTitle: "filterModalTitle",
|
|
64
|
+
modalCancelButtonText: "modalCancelButtonText",
|
|
65
|
+
modalConfirmButtonText: "modalConfirmButtonText",
|
|
66
|
+
clearFilterText: "clearFilterText"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
const l = t.getByText("clearFilterText");
|
|
71
|
+
c.click(l), u.act(() => {
|
|
72
|
+
e(o).toHaveBeenCalledTimes(1), e(t.queryByTestId("filter-badge")).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
}), B("should close filter", () => {
|
|
75
|
+
a(
|
|
76
|
+
/* @__PURE__ */ r(
|
|
77
|
+
T,
|
|
78
|
+
{
|
|
79
|
+
filters: n,
|
|
80
|
+
currentFilter: i,
|
|
81
|
+
closeCallback: o,
|
|
82
|
+
filterButtonText: "filterButtonText",
|
|
83
|
+
filterModalTitle: "filterModalTitle",
|
|
84
|
+
modalCancelButtonText: "modalCancelButtonText",
|
|
85
|
+
modalConfirmButtonText: "modalConfirmButtonText",
|
|
86
|
+
clearFilterText: "clearFilterText"
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
const l = t.getByRole("button", { name: "modalCancelButtonText" });
|
|
91
|
+
c.click(l), u.act(() => {
|
|
92
|
+
e(o).toHaveBeenCalledTimes(1), e(t.queryByTestId("filter-badge")).not.toBeInTheDocument();
|
|
93
|
+
}), x(() => {
|
|
94
|
+
e(t.queryByText("filterModalTitle")).not.toBeInTheDocument(), e(t.queryByText("modalCancelButtonText")).not.toBeInTheDocument(), e(t.queryByText("modalConfirmButtonText")).not.toBeInTheDocument(), e(t.queryByText("clearFilterText")).not.toBeInTheDocument();
|
|
95
|
+
});
|
|
96
|
+
}), B("should render as icon button ", () => {
|
|
97
|
+
a(
|
|
98
|
+
/* @__PURE__ */ r(
|
|
99
|
+
T,
|
|
100
|
+
{
|
|
101
|
+
filters: n,
|
|
102
|
+
currentFilter: i,
|
|
103
|
+
closeCallback: o,
|
|
104
|
+
filterButtonText: "filterButtonText",
|
|
105
|
+
filterModalTitle: "filterModalTitle",
|
|
106
|
+
modalCancelButtonText: "modalCancelButtonText",
|
|
107
|
+
modalConfirmButtonText: "modalConfirmButtonText",
|
|
108
|
+
clearFilterText: "clearFilterText",
|
|
109
|
+
filterButtonAsIcon: !0
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
), t.debug(void 0, 1 / 0), e(t.queryByText("filterButtonText")).not.toBeInTheDocument(), e(t.getByText("filter_list_alt")).toBeInTheDocument(), e(t.getByText("filter_list_alt").tagName).toBe("I");
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { a as n, s as t, f as m } from "../../../react.esm-
|
|
2
|
+
import { a as n, s as t, f as m } from "../../../react.esm-C3jDj5Fe.js";
|
|
3
3
|
import { FormCheckBox as c } from "./FormCheckBox.js";
|
|
4
4
|
import { v as e, d as h, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
const a = e.fn();
|
|
@@ -1,74 +1,68 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
datePickerContainer: w,
|
|
9
|
-
invalid: B,
|
|
10
|
-
fromPickerText: E,
|
|
11
|
-
datePickerCalendar: I,
|
|
12
|
-
trailingContent: L
|
|
13
|
-
}, N = ({
|
|
1
|
+
import { jsx as n, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { Datepicker as Y, Divider as b, Padding as j, Button as H } from "@element/react-components";
|
|
3
|
+
import { g as M } from "../../../get-UxX31Aph.js";
|
|
4
|
+
import { useMemo as s, useState as Q } from "react";
|
|
5
|
+
import { useFormContext as $, Controller as w } from "react-hook-form";
|
|
6
|
+
import { s as l } from "../../../formDatePicker.module-BV3ma_7y.js";
|
|
7
|
+
const A = ({
|
|
14
8
|
propertyName: t,
|
|
15
|
-
label:
|
|
16
|
-
closeLabel:
|
|
17
|
-
className:
|
|
9
|
+
label: k,
|
|
10
|
+
closeLabel: p,
|
|
11
|
+
className: P,
|
|
18
12
|
minRangeYear: m,
|
|
19
13
|
maxRangeYear: f,
|
|
20
|
-
locale:
|
|
14
|
+
locale: D,
|
|
21
15
|
rules: o
|
|
22
16
|
}) => {
|
|
23
17
|
const {
|
|
24
|
-
control:
|
|
25
|
-
formState: { errors: r, isValidating:
|
|
26
|
-
} =
|
|
18
|
+
control: S,
|
|
19
|
+
formState: { errors: r, isValidating: u }
|
|
20
|
+
} = $(), g = s(
|
|
27
21
|
() => o?.required?.value,
|
|
28
22
|
[o]
|
|
29
|
-
),
|
|
23
|
+
), x = s(
|
|
30
24
|
() => o?.required?.message,
|
|
31
25
|
[o]
|
|
32
|
-
),
|
|
26
|
+
), h = s(
|
|
33
27
|
() => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
|
|
34
28
|
[m]
|
|
35
|
-
),
|
|
29
|
+
), C = s(
|
|
36
30
|
() => (/* @__PURE__ */ new Date()).getFullYear() + (f ?? 15),
|
|
37
31
|
[f]
|
|
38
|
-
),
|
|
39
|
-
() => !
|
|
40
|
-
[r, t,
|
|
41
|
-
),
|
|
42
|
-
valid: !
|
|
43
|
-
helperTextPersistent:
|
|
32
|
+
), c = s(
|
|
33
|
+
() => !u && M(r, t) !== void 0,
|
|
34
|
+
[r, t, u]
|
|
35
|
+
), v = s(() => ({
|
|
36
|
+
valid: !c,
|
|
37
|
+
helperTextPersistent: c || g,
|
|
44
38
|
helperText: (() => {
|
|
45
39
|
if (r && r[t]) {
|
|
46
40
|
const i = r[t]?.message;
|
|
47
41
|
return i || "Invalid input";
|
|
48
42
|
}
|
|
49
|
-
return
|
|
43
|
+
return x;
|
|
50
44
|
})(),
|
|
51
|
-
className: `${
|
|
52
|
-
}), [r,
|
|
45
|
+
className: `${l.fromPickerText} ${c ? l.invalid : ""}`
|
|
46
|
+
}), [r, x, t, g, c]), [T, d] = Q(!1);
|
|
53
47
|
return /* @__PURE__ */ n(
|
|
54
|
-
|
|
48
|
+
w,
|
|
55
49
|
{
|
|
56
50
|
name: t,
|
|
57
51
|
rules: o,
|
|
58
|
-
control:
|
|
59
|
-
render: ({ field: { ref:
|
|
60
|
-
|
|
52
|
+
control: S,
|
|
53
|
+
render: ({ field: { ref: q, onChange: i, value: a, ...F } }) => /* @__PURE__ */ n("div", { className: l.datePickerContainer, children: /* @__PURE__ */ n(
|
|
54
|
+
Y,
|
|
61
55
|
{
|
|
62
|
-
...
|
|
63
|
-
className:
|
|
64
|
-
value:
|
|
56
|
+
...F,
|
|
57
|
+
className: P ?? "",
|
|
58
|
+
value: a,
|
|
65
59
|
variant: "outlined",
|
|
66
|
-
label:
|
|
67
|
-
format: (e) => e ? e.toLocaleDateString(
|
|
60
|
+
label: k,
|
|
61
|
+
format: (e) => e ? e.toLocaleDateString(D ?? "en") : "",
|
|
68
62
|
disableClearing: !0,
|
|
69
|
-
trailingContent: /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */ n(
|
|
71
|
-
/* @__PURE__ */ n(
|
|
63
|
+
trailingContent: /* @__PURE__ */ O("div", { className: l.trailingContent, children: [
|
|
64
|
+
/* @__PURE__ */ n(b, {}),
|
|
65
|
+
/* @__PURE__ */ n(j, { variant: "dense", children: /* @__PURE__ */ n(H, { label: p, variant: "text", onClick: () => d(!1) }) })
|
|
72
66
|
] }),
|
|
73
67
|
onClick: () => {
|
|
74
68
|
d(!0);
|
|
@@ -77,23 +71,23 @@ const w = "_datePickerContainer_73m8g_1", B = "_invalid_73m8g_5", E = "_fromPick
|
|
|
77
71
|
i(e), d(!1);
|
|
78
72
|
},
|
|
79
73
|
onSelectMonth: (e) => {
|
|
80
|
-
|
|
74
|
+
a && (e.setDate(a.getDate()), i(e));
|
|
81
75
|
},
|
|
82
76
|
onSelectYear: (e) => {
|
|
83
|
-
|
|
77
|
+
a && (e.setDate(a.getDate()), i(e));
|
|
84
78
|
},
|
|
85
79
|
hoisted: !0,
|
|
86
|
-
calendarProps: { hoisted: !0, className:
|
|
87
|
-
minQuickSelectYear:
|
|
88
|
-
maxQuickSelectYear:
|
|
80
|
+
calendarProps: { hoisted: !0, className: l.datePickerCalendar },
|
|
81
|
+
minQuickSelectYear: h,
|
|
82
|
+
maxQuickSelectYear: C,
|
|
89
83
|
readOnly: !0,
|
|
90
|
-
textfieldProps:
|
|
91
|
-
alwaysOpen:
|
|
84
|
+
textfieldProps: v,
|
|
85
|
+
alwaysOpen: T
|
|
92
86
|
}
|
|
93
87
|
) })
|
|
94
88
|
}
|
|
95
89
|
);
|
|
96
90
|
};
|
|
97
91
|
export {
|
|
98
|
-
|
|
92
|
+
A as FormDatePicker
|
|
99
93
|
};
|