@hortiview/shared-components 1.1.1 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # [1.2.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.1.2...v1.2.0) (2025-04-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * new props to handle default pagination strings added, changelog added to storybook ([491978e](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/491978e20c27183de69f18072b135bf4b438aa02))
7
+
8
+ ## [1.1.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.1.1...v1.1.2) (2025-03-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add MultiNoOptions story to showcase no options available message ([0e8f107](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/0e8f107bd70166534628dc78e0d51e54cfdec509))
14
+ * adjust comment ([175a23b](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/175a23b093cee6306945806ce64ac42fd11f8ecc))
15
+ * display no option message when component it multiselectable ([2b31b42](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/2b31b423bc42f14ddaced133a31336b8f02ab0d0)), closes [#14499](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/issues/14499)
16
+
1
17
  ## [1.1.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.1.0...v1.1.1) (2025-03-28)
2
18
 
3
19
 
@@ -1,10 +1,10 @@
1
- import { jsx as o, Fragment as g, jsxs as V } from "react/jsx-runtime";
1
+ import { jsx as l, Fragment as k, jsxs as z } from "react/jsx-runtime";
2
2
  import { g as _ } from "../../../get-DFv1gXfq.js";
3
- import { i as z } from "../../../isArray-Dub1wGJM.js";
4
- import { useMemo as k } from "react";
5
- import { useFormContext as G, Controller as C } from "react-hook-form";
6
- import { M as J } from "../../../react-tooltip.min-DSY6KDqS.js";
7
- import { useHelperText as L } from "../../../hooks/useHelperText.js";
3
+ import { i as G } from "../../../isArray-Dub1wGJM.js";
4
+ import { useMemo as C } from "react";
5
+ import { useFormContext as J, Controller as $ } from "react-hook-form";
6
+ import { M as L } from "../../../react-tooltip.min-DSY6KDqS.js";
7
+ import { useHelperText as O } from "../../../hooks/useHelperText.js";
8
8
  import { Select as Q } from "../../Select/Select.js";
9
9
  import { SelectTooltipText as R } from "./SelectTooltipText.js";
10
10
  import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1", W = "_invalidBorder_ht9kd_5", X = "_invalidPlaceholder_ht9kd_9", Y = "_invalidDropdownIcon_ht9kd_13", Z = "_formSelectContainer_ht9kd_18", N = "_formSelect_ht9kd_18", y = "_multiText_ht9kd_44", K = "_tooltip_ht9kd_53", tt = "_disabled_ht9kd_58", e = {
@@ -17,111 +17,111 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1",
17
17
  multiText: y,
18
18
  tooltip: K,
19
19
  disabled: tt
20
- }, mt = ({
20
+ }, ft = ({
21
21
  propertyName: i,
22
- label: c,
23
- options: n,
22
+ label: s,
23
+ options: o,
24
24
  multi: d = !1,
25
25
  disabled: x = !1,
26
- hoisted: $ = !1,
27
- hidden: H = !1,
28
- valueKey: l = "value",
26
+ hoisted: H = !1,
27
+ hidden: I = !1,
28
+ valueKey: r = "value",
29
29
  textKey: u = "text",
30
- clearable: I = !1,
31
- searchable: w = !0,
32
- noOptionsMessage: D = "",
33
- rules: m,
30
+ clearable: w = !1,
31
+ searchable: D = !0,
32
+ noOptionsMessage: T = "",
33
+ rules: f,
34
34
  menuPosition: P = "auto",
35
- ...r
35
+ ...n
36
36
  }) => {
37
37
  const {
38
- control: T,
38
+ control: v,
39
39
  getFieldState: B,
40
- formState: { errors: v, isValidating: S }
41
- } = G(), F = k(
42
- () => !S && _(v, i) !== void 0,
43
- [v, i, S]
44
- ), M = k(
45
- () => m?.required?.message,
46
- [m]
47
- ), { helperText: b, helperTextPersistent: j } = L({
40
+ formState: { errors: S, isValidating: p }
41
+ } = J(), F = C(
42
+ () => !p && _(S, i) !== void 0,
43
+ [S, i, p]
44
+ ), b = C(
45
+ () => f?.required?.message,
46
+ [f]
47
+ ), { helperText: M, helperTextPersistent: j } = O({
48
48
  propertyName: i,
49
- helperText: r.helperText,
50
- requiredText: M,
49
+ helperText: n.helperText,
50
+ requiredText: b,
51
51
  hasCharacterCount: !1
52
52
  });
53
- return H ? /* @__PURE__ */ o(C, { name: i, control: T, render: () => /* @__PURE__ */ o(g, {}) }) : /* @__PURE__ */ o(
53
+ return I ? /* @__PURE__ */ l($, { name: i, control: v, render: () => /* @__PURE__ */ l(k, {}) }) : /* @__PURE__ */ l(
54
54
  "div",
55
55
  {
56
56
  "data-testid": "form-select-container",
57
57
  className: e.formSelectContainer,
58
- "data-tooltip-id": c,
59
- children: /* @__PURE__ */ o(
60
- C,
58
+ "data-tooltip-id": s,
59
+ children: /* @__PURE__ */ l(
60
+ $,
61
61
  {
62
62
  name: i,
63
- rules: m,
64
- control: T,
65
- render: ({ field: { ref: et, onChange: f, value: p, ...q } }) => {
66
- let h = n;
67
- z(n) && _(n[0], "options") !== void 0 && (h = n.flatMap((t) => _(t, "options") ?? []));
63
+ rules: f,
64
+ control: v,
65
+ render: ({ field: { ref: et, onChange: m, value: g, ...q } }) => {
66
+ let h = o;
67
+ G(o) && _(o[0], "options") !== void 0 && (h = o.flatMap((t) => _(t, "options") ?? []));
68
68
  const a = d ? h?.filter(
69
- (t) => p?.includes(t[l])
70
- ) : h?.find((t) => t[l] === p), A = d && r.multiDisplayType === "text" && r.fixedHeightInput, s = B(i).invalid, E = `
69
+ (t) => g?.includes(t[r])
70
+ ) : h?.find((t) => t[r] === g), A = d && n.multiDisplayType === "text" && n.fixedHeightInput, c = B(i).invalid, E = `
71
71
  ${e.formSelect}
72
- ${s ? e.invalidHelperText : ""}
73
- ${s ? e.invalidDropdownIcon : ""}
74
- ${s ? e.invalidBorder : ""}
75
- ${s ? e.invalidPlaceholder : ""}
72
+ ${c ? e.invalidHelperText : ""}
73
+ ${c ? e.invalidDropdownIcon : ""}
74
+ ${c ? e.invalidBorder : ""}
75
+ ${c ? e.invalidPlaceholder : ""}
76
76
  ${A ? e.multiText : ""}
77
77
  ${x ? e.disabled : ""}`;
78
- return /* @__PURE__ */ V(g, { children: [
79
- /* @__PURE__ */ o(
78
+ return /* @__PURE__ */ z(k, { children: [
79
+ /* @__PURE__ */ l(
80
80
  Q,
81
81
  {
82
82
  ...q,
83
- ...r,
83
+ ...n,
84
84
  value: a ?? [],
85
- label: c,
85
+ label: s,
86
86
  variant: "outlined",
87
- helperText: b,
87
+ helperText: M,
88
88
  helperTextPersistent: j,
89
- options: n,
89
+ options: o,
90
90
  valid: !F,
91
91
  "data-testid": `select-${i}`,
92
- multiSelect: d,
92
+ multiSelect: !o?.length && T ? !1 : d,
93
93
  className: E,
94
94
  disabled: x,
95
- valueKey: l,
95
+ valueKey: r,
96
96
  textKey: u,
97
97
  onChange: (t) => {
98
98
  if (t == null) {
99
- f(t);
99
+ m(t);
100
100
  return;
101
101
  }
102
102
  if (d) {
103
- f(t.map((O) => O[l]));
103
+ m(t.map((V) => V[r]));
104
104
  return;
105
105
  }
106
- f(t[l]), r?.onChange?.(t);
106
+ m(t[r]), n?.onChange?.(t);
107
107
  },
108
- hoisted: $,
109
- noOptionsMessage: D,
110
- searchable: w,
111
- clearable: I,
108
+ hoisted: H,
109
+ noOptionsMessage: T,
110
+ searchable: D,
111
+ clearable: w,
112
112
  menuPosition: P
113
113
  }
114
114
  ),
115
- /* @__PURE__ */ o(
116
- J,
115
+ /* @__PURE__ */ l(
116
+ L,
117
117
  {
118
- id: c,
118
+ id: s,
119
119
  noArrow: !0,
120
120
  place: "bottom",
121
121
  delayShow: 420,
122
122
  className: e.tooltip,
123
- hidden: !a || a.length === 0 || !r.fixedHeightInput,
124
- children: /* @__PURE__ */ o(R, { value: a, textKey: u, valueKey: l })
123
+ hidden: !a || a.length === 0 || !n.fixedHeightInput,
124
+ children: /* @__PURE__ */ l(R, { value: a, textKey: u, valueKey: r })
125
125
  }
126
126
  )
127
127
  ] });
@@ -132,5 +132,5 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1",
132
132
  );
133
133
  };
134
134
  export {
135
- mt as FormSelect
135
+ ft as FormSelect
136
136
  };
@@ -54,6 +54,9 @@ import { TableLayoutProps } from '../../types/GenericTable';
54
54
  * @param title title of the table
55
55
  * @param cardTitleColumn column to be used as the title in the card layout
56
56
  * @param cardSubTitleColumn column to be used as the subtitle in the card layout
57
+ * @param pageTranslation translation for the pagination text 'Page'
58
+ * @param pageOfTranslation translation for the pagination text 'of'
59
+ * @param rowsPerPageTranslation translation for the pagination text 'Rows per page'
57
60
  * @returns a table based on a given type and data
58
61
  */
59
- export declare const GenericTable: <T>({ data, hiddenColumns, order, cellTemplates, tableActions, noContentText, headerTranslation, pagination, getRowActions, customColumnWidth, title, cardTitleColumn, cardSubTitleColumn, }: TableLayoutProps<T>) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const GenericTable: <T>({ data, hiddenColumns, order, cellTemplates, tableActions, noContentText, headerTranslation, pagination, getRowActions, customColumnWidth, title, cardTitleColumn, cardSubTitleColumn, pageTranslation, pageOfTranslation, rowsPerPageTranslation, }: TableLayoutProps<T>) => import("react/jsx-runtime").JSX.Element;