@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.
Files changed (113) hide show
  1. package/dist/BlockView.module-BPlNT5uh.js +15 -0
  2. package/dist/HashTabView.module-CJX4gxTu.js +13 -0
  3. package/dist/HeaderFilter.module-DiBmulr5.js +7 -0
  4. package/dist/Iconify-CY9lZjFd.js +95 -0
  5. package/dist/_baseToString-BNXOi2Mf.js +197 -0
  6. package/dist/_equalByTag-DJhSpgVG.js +157 -0
  7. package/dist/alertBanner.module-HneYdVzN.js +10 -0
  8. package/dist/assets/{main.css → Filter.css} +1 -1
  9. package/dist/assets/baseView.css +1 -0
  10. package/dist/assets/basicHeading.css +1 -0
  11. package/dist/assets/listArea.css +1 -0
  12. package/dist/baseView.module-ve87u_d0.js +12 -0
  13. package/dist/basicHeading.module-BYb8xvuk.js +16 -0
  14. package/dist/bigLoadingSpinner.module-GgbFol8k.js +11 -0
  15. package/dist/components/AlertBanner/AlertBanner.js +12 -17
  16. package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
  17. package/dist/components/BaseView/BaseView.js +42 -45
  18. package/dist/components/BaseView/BaseView.test.js +6 -4
  19. package/dist/components/BasicHeading/BasicHeading.js +39 -50
  20. package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
  21. package/dist/components/BlockView/BlockView.js +41 -51
  22. package/dist/components/BlockView/BlockView.test.js +1 -1
  23. package/dist/components/ContextMenu/ContextMenu.js +18 -20
  24. package/dist/components/ContextMenu/ContextMenu.test.js +1 -1
  25. package/dist/components/DeleteModal/DeleteModal.js +55 -60
  26. package/dist/components/DeleteModal/DeleteModal.test.js +1 -1
  27. package/dist/components/Disclaimer/Disclaimer.js +8 -11
  28. package/dist/components/Disclaimer/Disclaimer.test.js +1 -1
  29. package/dist/components/EmptyView/EmptyView.test.js +1 -1
  30. package/dist/components/Filter/Filter.d.ts +27 -0
  31. package/dist/components/Filter/Filter.js +149 -0
  32. package/dist/components/Filter/Filter.test.d.ts +1 -0
  33. package/dist/components/Filter/Filter.test.js +114 -0
  34. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +1 -1
  35. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +46 -52
  36. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +1 -1
  37. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +1 -1
  38. package/dist/components/FormComponents/FormSelect/FormSelect.js +68 -73
  39. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +2 -2
  40. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +1 -1
  41. package/dist/components/FormComponents/FormText/FormText.js +57 -62
  42. package/dist/components/FormComponents/FormText/FormText.test.js +1 -1
  43. package/dist/components/GenericTable/GenericTable.js +52 -58
  44. package/dist/components/GenericTable/GenericTable.test.js +1 -1
  45. package/dist/components/HashTabView/HashTabView.js +46 -54
  46. package/dist/components/HashTabView/HashTabView.test.js +1 -1
  47. package/dist/components/HeaderFilter/HeaderFilter.js +14 -16
  48. package/dist/components/HeaderFilter/HeaderFilter.test.js +1 -1
  49. package/dist/components/Iconify/Iconify.d.ts +3 -13
  50. package/dist/components/Iconify/Iconify.js +6 -163
  51. package/dist/components/Iconify/Iconify.test.js +2 -2
  52. package/dist/components/InfoGroup/InfoGroup.js +38 -47
  53. package/dist/components/InfoGroup/InfoGroup.test.js +1 -1
  54. package/dist/components/ListArea/ListArea.js +258 -490
  55. package/dist/components/ListArea/ListArea.test.js +2 -2
  56. package/dist/components/ListArea/ListAreaService.js +82 -8
  57. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +9 -5
  58. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -2
  59. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +13 -15
  60. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +1 -1
  61. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +2 -2
  62. package/dist/components/Scrollbar/scrollbar.test.js +1 -1
  63. package/dist/components/SearchBar/SearchBar.js +21 -23
  64. package/dist/components/SearchBar/SearchBar.test.js +1 -1
  65. package/dist/components/VerticalDivider/VerticalDivider.js +4 -6
  66. package/dist/components/VerticalDivider/VerticalDivider.test.js +1 -1
  67. package/dist/contextMenu.module-B7aUMFPe.js +7 -0
  68. package/dist/deleteModal.module-Ds3MDzdl.js +10 -0
  69. package/dist/disclaimer.module-BZydt-Q_.js +8 -0
  70. package/dist/formDatePicker.module-BV3ma_7y.js +11 -0
  71. package/dist/formSelect.module-C18N-SsT.js +11 -0
  72. package/dist/formText.module-Blt6Y-SR.js +10 -0
  73. package/dist/genericTable.module-BkU2VDKR.js +11 -0
  74. package/dist/get-UxX31Aph.js +47 -0
  75. package/dist/hooks/useBreakpoint.d.ts +8 -1
  76. package/dist/hooks/useBreakpoint.js +1 -1
  77. package/dist/hooks/useBreakpoints.test.js +2 -2
  78. package/dist/iconify.module-C89oaw5b.js +79 -0
  79. package/dist/{index-DP2ENnrX.js → index-BQnj-5Zt.js} +1 -1
  80. package/dist/infoGroup.module-B3E1gCGi.js +14 -0
  81. package/dist/isArray-Ca4KR8TK.js +91 -0
  82. package/dist/listArea.module-B-gPyfbE.js +19 -0
  83. package/dist/loadingSpinner.module-CLtqSMWA.js +7 -0
  84. package/dist/main.d.ts +3 -0
  85. package/dist/main.js +55 -52
  86. package/dist/{react.esm-DoZanrUz.js → react.esm-C3jDj5Fe.js} +1 -0
  87. package/dist/searchBar.module-9gKyrZRT.js +7 -0
  88. package/dist/types/Filter.d.ts +31 -0
  89. package/dist/types/Filter.js +1 -0
  90. package/dist/useBreakpoint-BNeVhjjZ.js +33 -0
  91. package/dist/verticalDivider.module-C3_GL-fH.js +7 -0
  92. package/package.json +1 -1
  93. package/dist/BigLoadingSpinner-Df2k3xOD.js +0 -18
  94. package/dist/ListAreaService-DDlsV9UD.js +0 -100
  95. package/dist/assets/BaseView.css +0 -1
  96. package/dist/assets/BasicHeading.css +0 -1
  97. package/dist/assets/ListAreaService.css +0 -1
  98. package/dist/get-BRDhkfK0.js +0 -324
  99. package/dist/useBreakpoint-2MH8ICuE.js +0 -28
  100. /package/dist/assets/{AlertBanner.css → alertBanner.css} +0 -0
  101. /package/dist/assets/{BigLoadingSpinner.css → bigLoadingSpinner.css} +0 -0
  102. /package/dist/assets/{ContextMenu.css → contextMenu.css} +0 -0
  103. /package/dist/assets/{DeleteModal.css → deleteModal.css} +0 -0
  104. /package/dist/assets/{Disclaimer.css → disclaimer.css} +0 -0
  105. /package/dist/assets/{FormDatePicker.css → formDatePicker.css} +0 -0
  106. /package/dist/assets/{FormSelect.css → formSelect.css} +0 -0
  107. /package/dist/assets/{FormText.css → formText.css} +0 -0
  108. /package/dist/assets/{GenericTable.css → genericTable.css} +0 -0
  109. /package/dist/assets/{Iconify.css → iconify.css} +0 -0
  110. /package/dist/assets/{InfoGroup.css → infoGroup.css} +0 -0
  111. /package/dist/assets/{LoadingSpinner.css → loadingSpinner.css} +0 -0
  112. /package/dist/assets/{SearchBar.css → searchBar.css} +0 -0
  113. /package/dist/assets/{VerticalDivider.css → verticalDivider.css} +0 -0
@@ -1,82 +1,77 @@
1
- import "../../assets/DeleteModal.css";
2
- import { jsx as o, jsxs as g, Fragment as i } from "react/jsx-runtime";
3
- import { Modal as C, Button as u, Group as s, Icon as D, TypoBody as t } from "@element/react-components";
4
- import { uniqueId as I } from "lodash";
5
- import { AvailableCustomIcons as O } from "../../enums/AvailableCustomIcons.js";
6
- import { Iconify as N } from "../Iconify/Iconify.js";
7
- const S = "_bulletPoint_1kyg0_1", x = "_modal_1kyg0_6", M = "_colorDanger_1kyg0_10", j = "_crossedOut_1kyg0_14", n = {
8
- bulletPoint: S,
9
- modal: x,
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: c,
18
- deleteText: p,
19
- icon: f,
12
+ deleteBody: i,
13
+ deleteText: f,
14
+ icon: g,
20
15
  isIconCrossedOut: h,
21
- impossibleDeleteHeader: y,
22
- open: b,
23
- setOpen: d,
24
- onDelete: v,
25
- isDeletePossible: m = !0
16
+ impossibleDeleteHeader: v,
17
+ open: y,
18
+ setOpen: m,
19
+ onDelete: b,
20
+ isDeletePossible: d = !0
26
21
  }) => {
27
- const _ = (k) => {
28
- k.detail.action === "close" && d(!1);
22
+ const C = (I) => {
23
+ I.detail.action === "close" && m(!1);
29
24
  };
30
- return /* @__PURE__ */ o(
31
- C,
25
+ return /* @__PURE__ */ r(
26
+ k,
32
27
  {
33
28
  className: n.modal,
34
29
  modalSize: "small",
35
- open: b,
36
- onClose: _,
37
- title: r,
38
- primaryButton: /* @__PURE__ */ o(
30
+ open: y,
31
+ onClose: C,
32
+ title: e,
33
+ primaryButton: /* @__PURE__ */ r(
39
34
  u,
40
35
  {
41
36
  variant: "danger",
42
- label: e,
43
- onClick: v,
44
- disabled: !m
37
+ label: o,
38
+ onClick: b,
39
+ disabled: !d
45
40
  }
46
41
  ),
47
- footerSupplemental: /* @__PURE__ */ o(u, { variant: "text", label: l, onClick: () => d(!1) }),
48
- children: /* @__PURE__ */ g(s, { direction: "vertical", secondaryAlign: "center", children: [
49
- /* @__PURE__ */ o(z, { element: /* @__PURE__ */ o(P, { icon: f }), isCrossedOut: h }),
50
- /* @__PURE__ */ o(s, { direction: "vertical", children: m ? /* @__PURE__ */ o(
51
- A,
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: p,
55
- deleteBody: c
49
+ deleteText: f,
50
+ deleteBody: i
56
51
  }
57
- ) : /* @__PURE__ */ o(B, { impossibleDeleteHeader: y }) })
52
+ ) : /* @__PURE__ */ r(O, { impossibleDeleteHeader: v }) })
58
53
  ] })
59
54
  }
60
55
  );
61
- }, z = ({
62
- element: r,
63
- isCrossedOut: e = !1
64
- }) => e ? /* @__PURE__ */ o("span", { className: n.crossedOut, children: r }) : r, P = ({ icon: r }) => r ? typeof r != "string" ? r : Object.values(O).includes(r) ? /* @__PURE__ */ o(
65
- N,
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: r,
62
+ icon: e,
68
63
  iconSize: "xlarge",
69
64
  className: n.colorDanger
70
65
  }
71
- ) : /* @__PURE__ */ o(D, { icon: r, iconSize: "xlarge", className: n.colorDanger }) : /* @__PURE__ */ o(i, {}), A = ({
72
- deleteHeader: r,
73
- deleteText: e,
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__ */ g(i, { children: [
76
- /* @__PURE__ */ o(t, { level: 1, themeColor: "text-primary-on-background", children: r }),
77
- e && typeof e == "string" && /* @__PURE__ */ o(t, { level: 2, themeColor: "text-secondary-on-background", children: e }),
78
- e && typeof e != "string" && /* @__PURE__ */ o(i, { children: e }),
79
- l && e === void 0 && /* @__PURE__ */ o(s, { direction: "vertical", gap: "none", children: l.map((a, c) => /* @__PURE__ */ o(
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
- I(c.toString())
82
+ N(i.toString())
88
83
  )) })
89
- ] }), B = ({
90
- impossibleDeleteHeader: r
91
- }) => /* @__PURE__ */ o(t, { level: 1, themeColor: "text-primary-on-background", children: r });
84
+ ] }), O = ({
85
+ impossibleDeleteHeader: e
86
+ }) => /* @__PURE__ */ r(t, { level: 1, themeColor: "text-primary-on-background", children: e });
92
87
  export {
93
- J as DeleteModal
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-DoZanrUz.js";
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 "../../assets/Disclaimer.css";
2
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
3
- import { Group as s, TypoSubtitle as t, TypoBody as m, Icon as d } from "@element/react-components";
4
- const p = "_disclaimer_1k38t_1", y = "_iconArea_1k38t_7", c = {
5
- disclaimer: p,
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(t, { className: c.disclaimer, level: l, bold: a, children: o }),
15
- e && /* @__PURE__ */ r(m, { level: 2, children: e }),
16
- i && /* @__PURE__ */ r("div", { className: c.iconArea, children: /* @__PURE__ */ r(d, { className: c.Icon, icon: i, iconSize: "large" }) })
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-DoZanrUz.js";
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-DoZanrUz.js";
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-DoZanrUz.js";
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 "../../../assets/FormDatePicker.css";
2
- import { jsx as n, jsxs as F } from "react/jsx-runtime";
3
- import { Datepicker as O, Divider as Y, Padding as b, Button as j } from "@element/react-components";
4
- import { g as H } from "../../../get-BRDhkfK0.js";
5
- import { useMemo as a, useState as M } from "react";
6
- import { useFormContext as Q, Controller as $ } from "react-hook-form";
7
- const w = "_datePickerContainer_73m8g_1", B = "_invalid_73m8g_5", E = "_fromPickerText_73m8g_9", I = "_datePickerCalendar_73m8g_13", L = "_trailingContent_73m8g_17", c = {
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: P,
16
- closeLabel: C,
17
- className: x,
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: p,
25
- formState: { errors: r, isValidating: g }
26
- } = Q(), k = a(
18
+ control: S,
19
+ formState: { errors: r, isValidating: u }
20
+ } = $(), g = s(
27
21
  () => o?.required?.value,
28
22
  [o]
29
- ), u = a(
23
+ ), x = s(
30
24
  () => o?.required?.message,
31
25
  [o]
32
- ), v = a(
26
+ ), h = s(
33
27
  () => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
34
28
  [m]
35
- ), T = a(
29
+ ), C = s(
36
30
  () => (/* @__PURE__ */ new Date()).getFullYear() + (f ?? 15),
37
31
  [f]
38
- ), l = a(
39
- () => !g && H(r, t) !== void 0,
40
- [r, t, g]
41
- ), D = a(() => ({
42
- valid: !l,
43
- helperTextPersistent: l || k,
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 u;
43
+ return x;
50
44
  })(),
51
- className: `${c.fromPickerText} ${l ? c.invalid : ""}`
52
- }), [r, u, t, k, l]), [S, d] = M(!1);
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: p,
59
- render: ({ field: { ref: h, onChange: i, value: s, ...q } }) => /* @__PURE__ */ n("div", { className: c.datePickerContainer, children: /* @__PURE__ */ n(
60
- O,
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
- ...q,
63
- className: x ?? "",
64
- value: s,
56
+ ...F,
57
+ className: P ?? "",
58
+ value: a,
65
59
  variant: "outlined",
66
- label: P,
67
- format: (e) => e ? e.toLocaleDateString(_ ?? "en") : "",
60
+ label: k,
61
+ format: (e) => e ? e.toLocaleDateString(D ?? "en") : "",
68
62
  disableClearing: !0,
69
- trailingContent: /* @__PURE__ */ F("div", { className: c.trailingContent, children: [
70
- /* @__PURE__ */ n(Y, {}),
71
- /* @__PURE__ */ n(b, { variant: "dense", children: /* @__PURE__ */ n(j, { label: C, variant: "text", onClick: () => d(!1) }) })
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
- s && (e.setDate(s.getDate()), i(e));
74
+ a && (e.setDate(a.getDate()), i(e));
81
75
  },
82
76
  onSelectYear: (e) => {
83
- s && (e.setDate(s.getDate()), i(e));
77
+ a && (e.setDate(a.getDate()), i(e));
84
78
  },
85
79
  hoisted: !0,
86
- calendarProps: { hoisted: !0, className: c.datePickerCalendar },
87
- minQuickSelectYear: v,
88
- maxQuickSelectYear: T,
80
+ calendarProps: { hoisted: !0, className: l.datePickerCalendar },
81
+ minQuickSelectYear: h,
82
+ maxQuickSelectYear: C,
89
83
  readOnly: !0,
90
- textfieldProps: D,
91
- alwaysOpen: S
84
+ textfieldProps: v,
85
+ alwaysOpen: T
92
86
  }
93
87
  ) })
94
88
  }
95
89
  );
96
90
  };
97
91
  export {
98
- N as FormDatePicker
92
+ A as FormDatePicker
99
93
  };