@hortiview/shared-components 1.3.5 → 1.4.1

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 (27) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/{BigLoadingSpinner-iegTbDcD.js → BigLoadingSpinner-CqSGYzZA.js} +2 -2
  3. package/dist/components/AlertBanner/AlertBanner.js +14 -14
  4. package/dist/components/BlockView/BlockView.js +26 -24
  5. package/dist/components/ContextMenu/ContextMenu.js +29 -29
  6. package/dist/components/ContextMenu/ContextMenu.test.js +1 -1
  7. package/dist/components/Disclaimer/Disclaimer.js +7 -6
  8. package/dist/components/EmptyView/EmptyView.js +47 -37
  9. package/dist/components/Filter/Filter.d.ts +2 -1
  10. package/dist/components/Filter/Filter.js +107 -90
  11. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5156 -5154
  12. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
  13. package/dist/components/FormComponents/FormSelect/FormSelect.js +22 -22
  14. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -6
  15. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +3 -1
  16. package/dist/components/FormComponents/FormToggle/FormToggle.js +32 -26
  17. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +19 -15
  18. package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -10
  19. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +1 -1
  20. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
  21. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +1 -1
  22. package/dist/components/OverflowTooltip/OverflowTooltip.js +10 -9
  23. package/dist/components/SearchBar/SearchBar.js +3 -2
  24. package/dist/components/Select/Select.d.ts +1 -1
  25. package/dist/components/Select/Select.js +34 -27
  26. package/dist/components/VerticalDivider/VerticalDivider.js +12 -5
  27. package/package.json +3 -3
@@ -1,162 +1,179 @@
1
- import { jsx as t, jsxs as y, Fragment as D } from "react/jsx-runtime";
2
- import { N } from "../../index.es-d5xhUpJZ.js";
1
+ import { jsx as e, jsxs as b, Fragment as D } from "react/jsx-runtime";
2
+ import { N as F } from "../../index.es-d5xhUpJZ.js";
3
3
  import { B as h } from "../../index.es-CiqbARoC.js";
4
4
  import { G as _ } from "../../index.es-DntoATwO.js";
5
- import { I } from "../../index.es-0lQcz8m1.js";
6
- import { S as T } from "../../index.es-8GOVkuo-.js";
5
+ import { I as W } from "../../index.es-0lQcz8m1.js";
6
+ import { S as j } from "../../index.es-8GOVkuo-.js";
7
7
  import { useState as v } from "react";
8
8
  import '../../assets/main.css';import '../../assets/Filter.css';/* empty css */
9
- import { u as b } from "../../useBreakpoints-MzTZ0tCT.js";
10
- import { Iconify as W } from "../Iconify/Iconify.js";
9
+ import { u as k } from "../../useBreakpoints-MzTZ0tCT.js";
10
+ import { Iconify as z } from "../Iconify/Iconify.js";
11
11
  import "../../react-tooltip.min-DSY6KDqS.js";
12
12
  import "../../orderBy-Bd48bw88.js";
13
- import { SearchBar as j } from "../SearchBar/SearchBar.js";
13
+ import { SearchBar as G } from "../SearchBar/SearchBar.js";
14
14
  import "../../uniqueId-NU3-C36A.js";
15
- import { Modal as z } from "../Modal/Modal.js";
16
- import { Select as G } from "../Select/Select.js";
15
+ import { Modal as H } from "../Modal/Modal.js";
16
+ import { Select as I } from "../Select/Select.js";
17
17
  import "react-hook-form";
18
18
  import "../../get-DFv1gXfq.js";
19
19
  import "../../isArray-Dub1wGJM.js";
20
20
  import "../../isString-BW9UHONv.js";
21
- const H = "_filterButton_qtl7a_1", K = "_relativeParent_qtl7a_6", V = "_filterBadge_qtl7a_10", E = "_dense_qtl7a_17", u = {
22
- filterButton: H,
23
- relativeParent: K,
21
+ const K = "_filterButton_qtl7a_1", T = "_relativeParent_qtl7a_6", V = "_filterBadge_qtl7a_10", E = "_dense_qtl7a_17", u = {
22
+ filterButton: K,
23
+ relativeParent: T,
24
24
  filterBadge: V,
25
25
  dense: E
26
- }, dt = ({
27
- clearFilterText: d,
26
+ }, ct = ({
27
+ clearFilterText: m,
28
28
  closeCallback: s,
29
- currentFilter: r,
30
- filterButtonAsIcon: f = !1,
31
- filterButtonText: n,
32
- filterModalTitle: i,
33
- filters: m,
29
+ currentFilter: i,
30
+ filterButtonAsIcon: d = !1,
31
+ filterButtonText: a,
32
+ filterModalTitle: t,
33
+ filters: f,
34
34
  modalCancelButtonText: g,
35
35
  modalConfirmButtonText: p,
36
- useModal: l = !0,
37
- selectAllLabel: e
36
+ useModal: o = !0,
37
+ selectAllLabel: r,
38
+ "data-testid": w
38
39
  }) => {
39
- const { isDesktop: A } = b(), [q, B] = v(!1), [c, C] = v(r), [w, x] = v(0), S = () => {
40
- B(!1), s(c), x(
41
- c.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)
40
+ const { isDesktop: A } = k(), [$, B] = v(!1), [c, y] = v(i), [q, C] = v(0), x = () => {
41
+ B(!1), s(c), C(
42
+ c.reduce((l, { filterValue: n }) => n === void 0 ? l : typeof n == "boolean" ? n ? l + 1 : l : Array.isArray(n) ? l + n.length : typeof n == "string" && n.length ? l + 1 : l, 0)
42
43
  );
43
44
  }, O = () => {
44
- C([]), x(0);
45
- }, F = (a) => {
46
- const o = [
47
- ...c.filter((P) => P.id !== a.id),
48
- a
45
+ y([]), C(0);
46
+ }, S = (l) => {
47
+ const n = [
48
+ ...c.filter((P) => P.id !== l.id),
49
+ l
49
50
  ];
50
- C(o), l || s(o);
51
+ y(n), o || s(n);
51
52
  };
52
- return l ? /* @__PURE__ */ y(D, { children: [
53
- /* @__PURE__ */ t(
53
+ return o ? /* @__PURE__ */ b(D, { children: [
54
+ /* @__PURE__ */ e(
54
55
  J,
55
56
  {
56
- filterButtonText: n,
57
- filterButtonAsIcon: f,
58
- count: w,
59
- onClick: () => B(!0)
57
+ filterButtonText: a,
58
+ filterButtonAsIcon: d,
59
+ count: q,
60
+ onClick: () => B(!0),
61
+ "data-testid": w
60
62
  }
61
63
  ),
62
- /* @__PURE__ */ t(
63
- z,
64
+ /* @__PURE__ */ e(
65
+ H,
64
66
  {
65
- open: q,
66
- onClose: S,
67
- title: i,
67
+ open: $,
68
+ onClose: x,
69
+ title: t,
68
70
  modalSize: A ? "small" : "fullscreen",
69
- headerActions: /* @__PURE__ */ t(h, { variant: "text", onClick: O, children: d }),
70
- dismissiveButton: /* @__PURE__ */ t(h, { variant: "outlined", onClick: () => B(!1), children: g }),
71
- primaryButton: /* @__PURE__ */ t(h, { variant: "filled", onClick: S, children: p }),
72
- children: /* @__PURE__ */ t(_, { direction: "vertical", children: k(m, c, F, e) })
71
+ headerActions: /* @__PURE__ */ e(h, { "data-testid": "filter-clear-button", variant: "text", onClick: O, children: m }),
72
+ dismissiveButton: /* @__PURE__ */ e(
73
+ h,
74
+ {
75
+ "data-testid": "filter-cancel-button",
76
+ variant: "outlined",
77
+ onClick: () => B(!1),
78
+ children: g
79
+ }
80
+ ),
81
+ primaryButton: /* @__PURE__ */ e(h, { "data-testid": "filter-confirm-button", variant: "filled", onClick: x, children: p }),
82
+ children: /* @__PURE__ */ e(_, { direction: "vertical", "data-testid": "filter-map-filters", children: N(f, c, S, r) })
73
83
  }
74
84
  )
75
- ] }) : /* @__PURE__ */ t(_, { secondaryAlign: "center", fullWidth: !0, children: k(m, c, F, e, !1) });
76
- }, k = (d, s, r, f, n = !0) => d.map(({ id: i, title: m, availableOptions: g, icon: p, type: l }) => /* @__PURE__ */ y(_, { fullWidth: !0, secondaryAlign: "center", children: [
77
- p ? /* @__PURE__ */ t(W, { icon: p, iconSize: "medium" }) : null,
78
- l === "select" && /* @__PURE__ */ t(
79
- G,
85
+ ] }) : /* @__PURE__ */ e(_, { secondaryAlign: "center", fullWidth: !0, children: N(f, c, S, r, !1) });
86
+ }, N = (m, s, i, d, a = !0) => m.map(({ id: t, title: f, availableOptions: g, icon: p, type: o }) => /* @__PURE__ */ b(_, { fullWidth: !0, secondaryAlign: "center", "data-testid": `filter-${o}-group-${t}`, children: [
87
+ p ? /* @__PURE__ */ e(z, { icon: p, iconSize: "medium" }) : null,
88
+ o === "select" && /* @__PURE__ */ e(
89
+ I,
80
90
  {
81
- selectAllLabel: f,
82
- className: n ? void 0 : u.dense,
91
+ "data-testid": `filter-select-${t}`,
92
+ selectAllLabel: d,
93
+ className: a ? void 0 : u.dense,
83
94
  variant: "outlined",
84
95
  options: g,
85
- label: m,
96
+ label: f,
86
97
  multiSelect: !0,
87
98
  textKey: "text",
88
99
  valueKey: "id",
89
- value: s.find((e) => e.id === i)?.filterValue ?? [],
90
- onChange: (e) => r({ id: i, type: l, filterValue: e }),
100
+ value: s.find((r) => r.id === t)?.filterValue ?? [],
101
+ onChange: (r) => i({ id: t, type: o, filterValue: r }),
91
102
  hoisted: !0,
92
103
  menuMaxHeight: "300px",
93
- disabled: i === "location",
104
+ disabled: t === "location",
94
105
  showOptionFilter: !1,
95
- dense: !n,
96
- fixedHeightInput: !n,
97
- multiDisplayType: n ? "pills" : "text"
106
+ dense: !a,
107
+ fixedHeightInput: !a,
108
+ multiDisplayType: a ? "pills" : "text"
98
109
  }
99
110
  ),
100
- l === "toggle" && /* @__PURE__ */ t(
101
- T,
111
+ o === "toggle" && /* @__PURE__ */ e(
112
+ j,
102
113
  {
103
- label: m,
104
- onChange: (e) => r({ id: i, type: l, filterValue: e }),
105
- checked: !!s.find((e) => e.id === i)?.filterValue
114
+ "data-testid": `filter-switch-${t}`,
115
+ label: f,
116
+ onChange: (r) => i({ id: t, type: o, filterValue: r }),
117
+ checked: !!s.find((r) => r.id === t)?.filterValue
106
118
  }
107
119
  ),
108
- l === "search" && /* @__PURE__ */ t(
109
- j,
120
+ o === "search" && /* @__PURE__ */ e(
121
+ G,
110
122
  {
111
- placeholder: m,
112
- searchTerm: s.find((e) => e.id === i)?.filterValue,
113
- setSearchTerm: (e) => r({ id: i, type: l, filterValue: e })
123
+ "data-testid": `filter-search-${t}`,
124
+ placeholder: f,
125
+ searchTerm: s.find((r) => r.id === t)?.filterValue,
126
+ setSearchTerm: (r) => i({ id: t, type: o, filterValue: r })
114
127
  }
115
128
  )
116
- ] }, i)), J = ({
117
- filterButtonText: d,
129
+ ] }, t)), J = ({
130
+ filterButtonText: m,
118
131
  filterButtonAsIcon: s,
119
- count: r,
120
- onClick: f
132
+ count: i,
133
+ "data-testid": d,
134
+ onClick: a
121
135
  }) => {
122
- const { isDesktop: n } = b();
123
- return s ? /* @__PURE__ */ t(
124
- I,
136
+ const { isDesktop: t } = k();
137
+ return s ? /* @__PURE__ */ e(
138
+ W,
125
139
  {
140
+ "data-testid": d ?? "filter-icon-button",
126
141
  icon: "filter_list_alt",
127
- onClick: f,
128
- badge: r !== 0 && /* @__PURE__ */ t(
129
- N,
142
+ onClick: a,
143
+ badge: i !== 0 && /* @__PURE__ */ e(
144
+ F,
130
145
  {
131
- counter: r,
146
+ counter: i,
132
147
  className: u.filterBadge,
133
148
  themeColor: "secondary",
134
149
  "data-testid": "filter-badge"
135
150
  }
136
151
  )
137
152
  }
138
- ) : /* @__PURE__ */ y(
153
+ ) : /* @__PURE__ */ b(
139
154
  "div",
140
155
  {
156
+ "data-testid": d ?? "filter-button-container",
141
157
  className: u.relativeParent,
142
- style: { height: "100%", width: n ? void 0 : "100%" },
158
+ style: { height: "100%", width: t ? void 0 : "100%" },
143
159
  children: [
144
- /* @__PURE__ */ t(
160
+ /* @__PURE__ */ e(
145
161
  h,
146
162
  {
163
+ "data-testid": "filter-button",
147
164
  variant: "outlined",
148
165
  themeColor: "primary",
149
166
  leadingIcon: "filter_list_alt",
150
- onClick: f,
167
+ onClick: a,
151
168
  className: u.filterButton,
152
- fullWidth: !n,
153
- children: d
169
+ fullWidth: !t,
170
+ children: m
154
171
  }
155
172
  ),
156
- r !== 0 && /* @__PURE__ */ t(
157
- N,
173
+ i !== 0 && /* @__PURE__ */ e(
174
+ F,
158
175
  {
159
- counter: r,
176
+ counter: i,
160
177
  className: u.filterBadge,
161
178
  themeColor: "secondary",
162
179
  "data-testid": "filter-badge"
@@ -167,5 +184,5 @@ const H = "_filterButton_qtl7a_1", K = "_relativeParent_qtl7a_6", V = "_filterBa
167
184
  );
168
185
  };
169
186
  export {
170
- dt as Filter
187
+ ct as Filter
171
188
  };