@hortiview/shared-components 2.29.0-alpha.df46fcc5.1 → 2.30.0

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.
@@ -1,16 +1,16 @@
1
- import { jsx as e, jsxs as B, Fragment as D } from "react/jsx-runtime";
2
- import { N as z } from "../../index.es-BIgjyLDa.js";
3
- import { B as _ } from "../../index.es-B9C7vzr4.js";
1
+ import { jsx as e, jsxs as B, Fragment as W } from "react/jsx-runtime";
2
+ import { N as y } from "../../index.es-BIgjyLDa.js";
3
+ import { B as g } from "../../index.es-B9C7vzr4.js";
4
4
  import { G as v } from "../../index.es-BE1XL1dD.js";
5
- import { I as W } from "../../index.es-BwhRJBEH.js";
6
- import { S as j } from "../../index.es-DCWPAtXu.js";
7
- import { c as G } from "../../index-_-9ybP20.js";
5
+ import { I as j } from "../../index.es-BwhRJBEH.js";
6
+ import { S as z } from "../../index.es-DCWPAtXu.js";
7
+ import { c as N } from "../../index-_-9ybP20.js";
8
8
  import { useState as b } from "react";
9
- import { Iconify as H } from "../Iconify/Iconify.js";
10
- import { u as F } from "../../useBreakpoints-DDrM9Cfx.js";
9
+ import { Iconify as G } from "../Iconify/Iconify.js";
10
+ import { u as $ } from "../../useBreakpoints-DDrM9Cfx.js";
11
11
  import "../../react-tooltip.min-DKaGxvdz.js";
12
12
  import "../../orderBy-Ce85KqD6.js";
13
- import { SearchBar as I } from "../SearchBar/SearchBar.js";
13
+ import { SearchBar as H } from "../SearchBar/SearchBar.js";
14
14
  import "../../index-CuHybtft.js";
15
15
  import "../SharedComponentsPermissionProvider/PermissionContext.js";
16
16
  import { Modal as K } from "../Modal/Modal.js";
@@ -24,90 +24,91 @@ import "../../isString-LDbI4UeI.js";
24
24
  import "../../omit-DUqu4lDk.js";
25
25
  import "../../types/Time.js";
26
26
  import "../../react.esm-B3AK8zW1.js";
27
- import '../../assets/Filter.css';const T = "_filterButton_1qtzn_1", V = "_relativeParent_1qtzn_21", E = "_iconColor_1qtzn_25", J = "_filterBadge_1qtzn_29", Q = "_dense_1qtzn_36", U = "_filterModal_1qtzn_41", X = "_borderRadius_1qtzn_45", s = {
27
+ import '../../assets/Filter.css';const T = "_filterButton_1qsua_1", V = "_relativeParent_1qsua_21", E = "_iconColor_1qsua_25", J = "_largeIconFix_1qsua_29", Q = "_filterBadge_1qsua_33", U = "_dense_1qsua_40", X = "_filterModal_1qsua_45", Y = "_borderRadius_1qsua_49", l = {
28
28
  filterButton: T,
29
29
  relativeParent: V,
30
30
  iconColor: E,
31
- filterBadge: J,
32
- dense: Q,
33
- filterModal: U,
34
- borderRadius: X
31
+ largeIconFix: J,
32
+ filterBadge: Q,
33
+ dense: U,
34
+ filterModal: X,
35
+ borderRadius: Y
35
36
  }, yt = ({
36
37
  clearFilterText: u,
37
38
  closeCallback: d,
38
39
  currentFilter: i,
39
- filterButtonAsIcon: c = !1,
40
- filterButtonText: f,
40
+ filterButtonAsIcon: f = !1,
41
+ filterButtonText: c,
41
42
  filterModalTitle: t,
42
- filters: a,
43
+ filters: n,
43
44
  modalCancelButtonText: m,
44
45
  modalConfirmButtonText: h,
45
46
  useModal: o = !0,
46
47
  selectAllLabel: r,
47
- filterButtonSize: q = "medium",
48
- filterButtonClassName: $,
49
- "data-testid": k
48
+ filterButtonSize: k = "medium",
49
+ filterButtonClassName: I,
50
+ "data-testid": w
50
51
  }) => {
51
- const { isDesktop: w } = F(), [A, g] = b(!1), [p, C] = b(i), [R, S] = b(0), x = () => {
52
- g(!1), d(p), S(
53
- p.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)
52
+ const { isDesktop: A } = $(), [R, _] = b(!1), [p, x] = b(i), [O, C] = b(0), F = () => {
53
+ _(!1), d(p), C(
54
+ p.reduce((s, { filterValue: a }) => a === void 0 ? s : typeof a == "boolean" ? a ? s + 1 : s : Array.isArray(a) ? s + a.length : typeof a == "string" && a.length ? s + 1 : s, 0)
54
55
  );
55
- }, O = () => {
56
- C([]), S(0);
57
- }, y = (l) => {
58
- const n = [
59
- ...p.filter((P) => P.id !== l.id),
60
- l
56
+ }, P = () => {
57
+ x([]), C(0);
58
+ }, S = (s) => {
59
+ const a = [
60
+ ...p.filter((D) => D.id !== s.id),
61
+ s
61
62
  ];
62
- C(n), o || d(n);
63
+ x(a), o || d(a);
63
64
  };
64
- return o ? /* @__PURE__ */ B(D, { children: [
65
+ return o ? /* @__PURE__ */ B(W, { children: [
65
66
  /* @__PURE__ */ e(
66
- Y,
67
+ Z,
67
68
  {
68
- filterButtonText: f,
69
- filterButtonAsIcon: c,
70
- count: R,
71
- onClick: () => g(!0),
72
- "data-testid": k,
73
- filterButtonSize: q,
74
- filterButtonClassName: $
69
+ filterButtonText: c,
70
+ filterButtonAsIcon: f,
71
+ count: O,
72
+ onClick: () => _(!0),
73
+ "data-testid": w,
74
+ filterButtonSize: k,
75
+ filterButtonClassName: I
75
76
  }
76
77
  ),
77
78
  /* @__PURE__ */ e(
78
79
  K,
79
80
  {
80
- open: A,
81
- className: s.filterModal,
82
- onClose: x,
81
+ open: R,
82
+ className: l.filterModal,
83
+ onClose: F,
83
84
  title: t,
84
- modalSize: w ? "small" : "fullscreen",
85
- headerActions: /* @__PURE__ */ e(_, { "data-testid": "filter-clear-button", variant: "text", onClick: O, children: u }),
85
+ modalSize: A ? "small" : "fullscreen",
86
+ headerActions: /* @__PURE__ */ e(g, { "data-testid": "filter-clear-button", variant: "text", onClick: P, children: u }),
86
87
  footerSupplemental: /* @__PURE__ */ e(
87
- _,
88
+ g,
88
89
  {
89
90
  "data-testid": "filter-cancel-button",
90
91
  variant: "outlined",
91
- onClick: () => g(!1),
92
+ onClick: () => _(!1),
92
93
  children: m
93
94
  }
94
95
  ),
95
- actionButton: /* @__PURE__ */ e(_, { "data-testid": "filter-confirm-button", variant: "filled", onClick: x, children: h }),
96
- children: /* @__PURE__ */ e(v, { direction: "vertical", "data-testid": "filter-map-filters", children: N(a, p, y, r) })
96
+ actionButton: /* @__PURE__ */ e(g, { "data-testid": "filter-confirm-button", variant: "filled", onClick: F, children: h }),
97
+ children: /* @__PURE__ */ e(v, { direction: "vertical", "data-testid": "filter-map-filters", children: q(n, p, S, r) })
97
98
  }
98
99
  )
99
- ] }) : /* @__PURE__ */ e(v, { secondaryAlign: "center", fullWidth: !0, children: N(a, p, y, r, !1) });
100
- }, N = (u, d, i, c, f = !0) => u.map(({ id: t, title: a, availableOptions: m, icon: h, type: o }) => /* @__PURE__ */ B(v, { fullWidth: !0, secondaryAlign: "center", "data-testid": `filter-${o}-group-${t}`, children: [
101
- h ? /* @__PURE__ */ e(H, { icon: h, iconSize: "medium" }) : null,
100
+ ] }) : /* @__PURE__ */ e(v, { secondaryAlign: "center", fullWidth: !0, children: q(n, p, S, r, !1) });
101
+ }, q = (u, d, i, f, c = !0) => u.map(({ id: t, title: n, availableOptions: m, icon: h, type: o }) => /* @__PURE__ */ B(v, { fullWidth: !0, secondaryAlign: "center", "data-testid": `filter-${o}-group-${t}`, children: [
102
+ h ? /* @__PURE__ */ e(G, { icon: h, iconSize: "medium" }) : null,
102
103
  o === "select" && /* @__PURE__ */ e(
103
104
  M,
104
105
  {
105
106
  "data-testid": `filter-select-${t}`,
106
- selectAllLabel: c,
107
- className: `${f ? void 0 : s.dense} ${s.borderRadius}`,
107
+ selectAllLabel: f,
108
+ className: `${c ? void 0 : l.dense} ${l.borderRadius}`,
108
109
  variant: "outlined",
109
110
  options: m,
110
- label: a,
111
+ label: n,
111
112
  multiSelect: !0,
112
113
  textKey: "text",
113
114
  valueKey: "id",
@@ -117,53 +118,55 @@ import '../../assets/Filter.css';const T = "_filterButton_1qtzn_1", V = "_relati
117
118
  menuMaxHeight: "300px",
118
119
  disabled: t === "location",
119
120
  showOptionFilter: !1,
120
- dense: !f,
121
- fixedHeightInput: !f,
122
- multiDisplayType: f ? "pills" : "text"
121
+ dense: !c,
122
+ fixedHeightInput: !c,
123
+ multiDisplayType: c ? "pills" : "text"
123
124
  }
124
125
  ),
125
126
  o === "toggle" && /* @__PURE__ */ e(
126
- j,
127
+ z,
127
128
  {
128
129
  "data-testid": `filter-switch-${t}`,
129
- label: a,
130
+ label: n,
130
131
  onChange: (r) => i({ id: t, type: o, filterValue: r }),
131
132
  checked: !!d.find((r) => r.id === t)?.filterValue
132
133
  }
133
134
  ),
134
135
  o === "search" && /* @__PURE__ */ e(
135
- I,
136
+ H,
136
137
  {
137
138
  "data-testid": `filter-search-${t}`,
138
- placeholder: a,
139
+ placeholder: n,
139
140
  searchTerm: d.find((r) => r.id === t)?.filterValue,
140
- className: s.borderRadius,
141
+ className: l.borderRadius,
141
142
  setSearchTerm: (r) => i({ id: t, type: o, filterValue: r })
142
143
  }
143
144
  )
144
- ] }, t)), Y = ({
145
+ ] }, t)), Z = ({
145
146
  filterButtonText: u,
146
147
  filterButtonAsIcon: d,
147
148
  count: i,
148
- filterButtonSize: c,
149
- filterButtonClassName: f,
149
+ filterButtonSize: f,
150
+ filterButtonClassName: c,
150
151
  "data-testid": t,
151
- onClick: a
152
+ onClick: n
152
153
  }) => {
153
- const { isDesktop: m } = F();
154
+ const { isDesktop: m } = $();
154
155
  return d ? /* @__PURE__ */ e(
155
- W,
156
+ j,
156
157
  {
157
- className: s.iconColor,
158
+ className: N(l.iconColor, {
159
+ [l.largeIconFix]: f === "large"
160
+ }),
158
161
  "data-testid": t ?? "filter-icon-button",
159
- icon: "filter_list_alt",
160
- onClick: a,
161
- iconSize: c,
162
+ icon: "filter_list",
163
+ onClick: n,
164
+ iconSize: f,
162
165
  badge: i !== 0 && /* @__PURE__ */ e(
163
- z,
166
+ y,
164
167
  {
165
168
  counter: i,
166
- className: s.filterBadge,
169
+ className: l.filterBadge,
167
170
  themeColor: "secondary",
168
171
  "data-testid": "filter-badge"
169
172
  }
@@ -173,28 +176,28 @@ import '../../assets/Filter.css';const T = "_filterButton_1qtzn_1", V = "_relati
173
176
  "div",
174
177
  {
175
178
  "data-testid": t ?? "filter-button-container",
176
- className: s.relativeParent,
179
+ className: l.relativeParent,
177
180
  style: { height: "100%", width: m ? void 0 : "100%" },
178
181
  children: [
179
182
  /* @__PURE__ */ e(
180
- _,
183
+ g,
181
184
  {
182
185
  "data-testid": "filter-button",
183
186
  variant: "outlined",
184
187
  themeColor: "primary",
185
188
  leadingIcon: "filter_list_alt",
186
- onClick: a,
187
- className: G(f, s.filterButton),
189
+ onClick: n,
190
+ className: N(c, l.filterButton),
188
191
  fullWidth: !m,
189
- buttonSize: c,
192
+ buttonSize: f,
190
193
  children: u
191
194
  }
192
195
  ),
193
196
  i !== 0 && /* @__PURE__ */ e(
194
- z,
197
+ y,
195
198
  {
196
199
  counter: i,
197
- className: s.filterBadge,
200
+ className: l.filterBadge,
198
201
  themeColor: "secondary",
199
202
  "data-testid": "filter-badge"
200
203
  }
@@ -14,7 +14,7 @@ import '../../../assets/CustomTextField.css';const c = "_invalid_142hx_1", h = "
14
14
  trigger: i,
15
15
  watch: l
16
16
  } = s(), a = l(e.propertyName), d = v(() => {
17
- if (!(!a || e.value === null))
17
+ if (!(a == null || e.value == null))
18
18
  return e.value;
19
19
  }, [a, e.value]);
20
20
  return /* @__PURE__ */ m(
@@ -61,6 +61,11 @@ import { TableLayoutProps } from '../../types/GenericTable';
61
61
  * @param tableLayout layout of the table, can be 'standard' or 'flex'
62
62
  * @param isOnline Whether the user is online; shows OfflineView when false.
63
63
  * @param offlineViewProps Props forwarded to OfflineView when offline.
64
+ * @param resizableColumns Enables resizing handles for the specified columns. Be aware that sticky columns limit the resizable columns to the first column.
65
+ * @param stickyColumns pin the first and/or last column via CSS while scrolling horizontally; !! When combined with resizableColumns, only the first column can be resized, regardless of the resizableColumns keys. !!
66
+ * @param tableMaxHeight Set a max height in px that the table will be clamped to. Content rows will be scrollable if the whole table exceeds this height.
67
+ * @param noBorder Render the table without borders or the elevation
68
+ * @param disableRowsPerPageSelection Disable the rows per page selection dropdown
64
69
  * @returns a table based on a given type and data
65
70
  */
66
- export declare const GenericTable: <T>({ data, hiddenColumns, order, cellTemplates, tableActions, noContentText, headerTranslation, pagination, getRowActions, customColumnWidth, title, cardTitleColumn, cardSubTitleColumn, pageTranslation, pageOfTranslation, rowsPerPageTranslation, tableActionPosition, tableElevationLevel, tableLayout, isOnline, offlineViewProps, }: TableLayoutProps<T>) => import("react").JSX.Element;
71
+ export declare const GenericTable: <T>({ data, hiddenColumns, order, cellTemplates, tableActions, noContentText, headerTranslation, pagination, getRowActions, customColumnWidth, title, cardTitleColumn, cardSubTitleColumn, pageTranslation, pageOfTranslation, rowsPerPageTranslation, tableActionPosition, tableLayout, isOnline, offlineViewProps, resizableColumns, stickyColumns, tableMaxHeight, noBorder, disableRowsPerPageSelection, }: TableLayoutProps<T>) => import("react").JSX.Element;