@hortiview/shared-components 0.0.11114 → 0.0.11146

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 (165) hide show
  1. package/dist/BigLoadingSpinner-C3wTbTD0.js +17 -0
  2. package/dist/GenericCard-B8x1DMa8.js +81 -0
  3. package/dist/ListAreaService-CRX4eEUJ.js +108 -0
  4. package/dist/_Map-Dtlps7IZ.js +113 -0
  5. package/dist/{_commonjsHelpers-CT_km90n.js → _commonjsHelpers-BkfeUUK-.js} +2 -4
  6. package/dist/_overArg-_0pUmCsX.js +14 -0
  7. package/dist/assets/Filter.css +1 -0
  8. package/dist/assets/GenericTable.css +1 -0
  9. package/dist/assets/main.css +1 -0
  10. package/dist/components/AlertBanner/AlertBanner.js +22 -16
  11. package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
  12. package/dist/components/BaseView/BaseView.js +33 -26
  13. package/dist/components/BaseView/BaseView.test.js +25 -25
  14. package/dist/components/BasicHeading/BasicHeading.js +50 -41
  15. package/dist/components/BasicHeading/BasicHeading.test.js +2 -2
  16. package/dist/components/BlockView/BlockView.js +51 -42
  17. package/dist/components/BlockView/BlockView.test.js +2 -2
  18. package/dist/components/ChipCard/ChipCard.js +12 -10
  19. package/dist/components/ChipCard/ChipCard.test.js +2 -2
  20. package/dist/components/ContextMenu/ContextMenu.js +29 -25
  21. package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
  22. package/dist/components/DeleteModal/DeleteModal.js +58 -53
  23. package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
  24. package/dist/components/Disclaimer/Disclaimer.js +11 -8
  25. package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
  26. package/dist/components/EmptyView/EmptyView.test.js +2 -2
  27. package/dist/components/Filter/Filter.js +107 -125
  28. package/dist/components/Filter/Filter.test.js +2 -2
  29. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +19 -19
  30. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +2 -2
  31. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +3 -0
  32. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +6081 -7102
  33. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +2 -2
  34. package/dist/components/FormComponents/FormNumber/CustomTextField.js +16 -14
  35. package/dist/components/FormComponents/FormNumber/FormNumber.js +2 -2
  36. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +4 -4
  37. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +2 -2
  38. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
  39. package/dist/components/FormComponents/FormSelect/FormSelect.js +109 -102
  40. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +3 -3
  41. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +5 -5
  42. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +2 -2
  43. package/dist/components/FormComponents/FormText/FormText.js +95 -96
  44. package/dist/components/FormComponents/FormText/FormText.test.js +13 -13
  45. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +31 -0
  46. package/dist/components/FormComponents/FormToggle/FormToggle.js +43 -0
  47. package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +1 -0
  48. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +50 -0
  49. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  50. package/dist/components/GenericTable/GenericTable.js +64 -81
  51. package/dist/components/GenericTable/GenericTable.test.js +2 -2
  52. package/dist/components/GenericTable/GenericTableService.js +41 -43
  53. package/dist/components/GenericTable/Mobile/GenericCard.js +6 -68
  54. package/dist/components/GenericTable/Mobile/GenericCard.test.js +3 -3
  55. package/dist/components/GenericTable/Mobile/GenericCardList.js +8 -9
  56. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +2 -2
  57. package/dist/components/HashTabView/HashTabView.js +62 -52
  58. package/dist/components/HashTabView/HashTabView.test.js +2 -2
  59. package/dist/components/HeaderFilter/HeaderFilter.js +16 -14
  60. package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
  61. package/dist/components/HealthCheckFailed/HealthCheckFailed.js +27 -20
  62. package/dist/components/HealthCheckFailed/HealthCheckFailed.test.js +2 -2
  63. package/dist/components/Iconify/Iconify.js +56 -6
  64. package/dist/components/Iconify/Iconify.test.js +3 -3
  65. package/dist/components/InfoGroup/InfoGroup.js +36 -30
  66. package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
  67. package/dist/components/ListArea/ListArea.js +45 -357
  68. package/dist/components/ListArea/ListArea.test.js +4 -4
  69. package/dist/components/ListArea/ListAreaService.js +8 -92
  70. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +5 -9
  71. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -4
  72. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +28 -26
  73. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +2 -2
  74. package/dist/components/Modal/Modal.js +6 -4
  75. package/dist/components/OverflowTooltip/OverflowTooltip.js +21 -19
  76. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +3 -3
  77. package/dist/components/OverflowTooltip/OverflowTooltipService.js +1 -2
  78. package/dist/components/Scrollbar/scrollbar.test.js +2 -2
  79. package/dist/components/SearchBar/SearchBar.js +22 -20
  80. package/dist/components/SearchBar/SearchBar.test.js +2 -2
  81. package/dist/components/VerticalDivider/VerticalDivider.js +6 -4
  82. package/dist/components/VerticalDivider/VerticalDivider.test.js +2 -2
  83. package/dist/get-BiqanC9_.js +7 -0
  84. package/dist/get-P-5PYZOE.js +426 -0
  85. package/dist/hooks/useBreakpoints.test.js +2 -2
  86. package/dist/hooks/useHelperText.d.ts +13 -0
  87. package/dist/hooks/useHelperText.js +25 -0
  88. package/dist/index-DzM8o582.js +10881 -0
  89. package/dist/isArray-2zMxXFEr.js +83 -0
  90. package/dist/isArray-C_5XvIlE.js +7 -0
  91. package/dist/isEmpty-BimaZd5G.js +225 -0
  92. package/dist/isString-BOHPtrlm.js +44 -0
  93. package/dist/magic-string.es-D4UQQyt0.js +859 -0
  94. package/dist/main.d.ts +1 -0
  95. package/dist/main.js +33 -31
  96. package/dist/orderBy-BVQIswlJ.js +765 -0
  97. package/dist/{react-number-format.es-BeIT_PM7.js → react-number-format.es-BD3_OvMU.js} +156 -159
  98. package/dist/react-tooltip.min-c2wVkjF2.js +1354 -0
  99. package/dist/react.esm-FR1-H8iU.js +13471 -0
  100. package/dist/services/UtilService.js +12 -19
  101. package/dist/services/services.test.js +1 -1
  102. package/dist/vi.CjhMlMwf-DWv7vrn7.js +12192 -0
  103. package/package.json +8 -6
  104. package/dist/BlockView.module-BPlNT5uh.js +0 -15
  105. package/dist/HashTabView.module-ZhwSfDeQ.js +0 -16
  106. package/dist/HeaderFilter.module-DiBmulr5.js +0 -7
  107. package/dist/Iconify-DoU6pP1o.js +0 -97
  108. package/dist/_Map-DKsHX-kc.js +0 -59
  109. package/dist/_baseToString-dkhmFwqS.js +0 -198
  110. package/dist/_equalByTag-BZEJl6ST.js +0 -158
  111. package/dist/_overArg-BC4qXKbU.js +0 -9
  112. package/dist/alertBanner.module-BPiKN0gh.js +0 -11
  113. package/dist/assets/genericTable.css +0 -1
  114. package/dist/baseView.module-uWbm_a5f.js +0 -12
  115. package/dist/basicHeading.module-BYb8xvuk.js +0 -16
  116. package/dist/bigLoadingSpinner.module-GgbFol8k.js +0 -11
  117. package/dist/chipCard.module-BjpKuf1b.js +0 -7
  118. package/dist/contextMenu.module-vNQHb48g.js +0 -9
  119. package/dist/deleteModal.module-Ds3MDzdl.js +0 -10
  120. package/dist/disclaimer.module-BZydt-Q_.js +0 -8
  121. package/dist/formDatePicker.module-BV3ma_7y.js +0 -11
  122. package/dist/formNumber.module-BA05Gi6_.js +0 -7
  123. package/dist/formSelect.module-PUiLDSD4.js +0 -15
  124. package/dist/formText.module-C0by6_DK.js +0 -12
  125. package/dist/genericCard.module-DrQu86jX.js +0 -15
  126. package/dist/genericTable.module-Dk3yy2S3.js +0 -17
  127. package/dist/get-BJn2Enx7.js +0 -47
  128. package/dist/healthCheckFailed.module-B5P1ogjs.js +0 -12
  129. package/dist/iconify.module-Cru5NS2X.js +0 -80
  130. package/dist/index-IMXII42b.js +0 -11708
  131. package/dist/infoGroup.module-Cxw88dfC.js +0 -12
  132. package/dist/isArray-thIeLpc5.js +0 -35
  133. package/dist/isPlainObject-BlCDf1Kc.js +0 -18
  134. package/dist/listArea.module-BhO_OJ1S.js +0 -20
  135. package/dist/loadingSpinner.module-CLtqSMWA.js +0 -7
  136. package/dist/magic-string.es-irX7syie.js +0 -732
  137. package/dist/modal.module-BlDp1Wiq.js +0 -7
  138. package/dist/overflowTooltip.module-YyRN2MGc.js +0 -7
  139. package/dist/react-tooltip.min-BzHiZW8k.js +0 -1380
  140. package/dist/react.esm-CHvVvf3L.js +0 -12786
  141. package/dist/searchBar.module-9gKyrZRT.js +0 -7
  142. package/dist/verticalDivider.module-C3_GL-fH.js +0 -7
  143. package/dist/vi.JYQecGiw-BpOAB4v6.js +0 -9796
  144. /package/dist/assets/{alertBanner.css → AlertBanner.css} +0 -0
  145. /package/dist/assets/{baseView.css → BaseView.css} +0 -0
  146. /package/dist/assets/{basicHeading.css → BasicHeading.css} +0 -0
  147. /package/dist/assets/{bigLoadingSpinner.css → BigLoadingSpinner.css} +0 -0
  148. /package/dist/assets/{chipCard.css → ChipCard.css} +0 -0
  149. /package/dist/assets/{contextMenu.css → ContextMenu.css} +0 -0
  150. /package/dist/assets/{formNumber.css → CustomTextField.css} +0 -0
  151. /package/dist/assets/{deleteModal.css → DeleteModal.css} +0 -0
  152. /package/dist/assets/{disclaimer.css → Disclaimer.css} +0 -0
  153. /package/dist/assets/{formDatePicker.css → FormDatePicker.css} +0 -0
  154. /package/dist/assets/{formSelect.css → FormSelect.css} +0 -0
  155. /package/dist/assets/{formText.css → FormText.css} +0 -0
  156. /package/dist/assets/{genericCard.css → GenericCard.css} +0 -0
  157. /package/dist/assets/{healthCheckFailed.css → HealthCheckFailed.css} +0 -0
  158. /package/dist/assets/{iconify.css → Iconify.css} +0 -0
  159. /package/dist/assets/{infoGroup.css → InfoGroup.css} +0 -0
  160. /package/dist/assets/{listArea.css → ListAreaService.css} +0 -0
  161. /package/dist/assets/{loadingSpinner.css → LoadingSpinner.css} +0 -0
  162. /package/dist/assets/{modal.css → Modal.css} +0 -0
  163. /package/dist/assets/{overflowTooltip.css → OverflowTooltip.css} +0 -0
  164. /package/dist/assets/{searchBar.css → SearchBar.css} +0 -0
  165. /package/dist/assets/{verticalDivider.css → VerticalDivider.css} +0 -0
@@ -1,134 +1,133 @@
1
- import { jsx as t, Fragment as S, jsxs as J } from "react/jsx-runtime";
2
- import { Textfield as K, TypoCaption as O } from "@element/react-components";
3
- import { g as B } from "../../../get-BJn2Enx7.js";
4
- import { useState as A, useCallback as Q, useMemo as c, useEffect as U } from "react";
5
- import { useFormContext as X, Controller as j } from "react-hook-form";
6
- import { s as i } from "../../../formText.module-C0by6_DK.js";
7
- const Y = ({
1
+ import "../../../assets/FormText.css";
2
+ import { jsx as t, Fragment as F, jsxs as D } from "react/jsx-runtime";
3
+ import { Textfield as G, TypoCaption as I } from "@element/react-components";
4
+ import { g as J } from "../../../get-BiqanC9_.js";
5
+ import { useState as q, useCallback as K, useMemo as T, useEffect as O } from "react";
6
+ import { useFormContext as Q, Controller as H } from "react-hook-form";
7
+ import { useHelperText as U } from "../../../hooks/useHelperText.js";
8
+ const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_required_168p8_11", N = "_formTextArea_168p8_1", y = "_characterCount_168p8_25", p = "_withoutCharacterCount_168p8_31", r = {
9
+ formTextAreaHelperText: X,
10
+ invalid: Y,
11
+ required: Z,
12
+ formTextArea: N,
13
+ characterCount: y,
14
+ withoutCharacterCount: p
15
+ }, ee = ({
8
16
  count: e,
9
17
  maxCount: u,
10
- invalid: f = !1,
11
- hasRequiredText: r = !1
18
+ invalid: s = !1,
19
+ hasRequiredText: n = !1
12
20
  }) => /* @__PURE__ */ t(
13
21
  "div",
14
22
  {
15
23
  "data-testid": "character-counter-container",
16
- className: `${i.formTextAreaHelperText} ${f ? i.invalid : ""} ${r ? i.required : ""}`,
17
- children: /* @__PURE__ */ t(O, { children: `${e}/${u}` })
24
+ className: `${r.formTextAreaHelperText} ${s ? r.invalid : ""} ${n ? r.required : ""}`,
25
+ children: /* @__PURE__ */ t(I, { children: `${e}/${u}` })
18
26
  }
19
- ), re = (e) => e.textarea ? /* @__PURE__ */ t(Z, { ...e }) : /* @__PURE__ */ t(_, { ...e }), Z = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: i.formTextArea, children: /* @__PURE__ */ t(k, { ...e }) }), _ = (e) => /* @__PURE__ */ t(
27
+ ), se = (e) => e.textarea ? /* @__PURE__ */ t(te, { ...e }) : /* @__PURE__ */ t(ne, { ...e }), te = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: r.formTextArea, children: /* @__PURE__ */ t(L, { ...e }) }), ne = (e) => /* @__PURE__ */ t(
20
28
  "div",
21
29
  {
22
30
  "data-testid": "form-text-field",
23
- className: `${e.hasCharacterCount ? i.characterCount : i.withoutCharacterCount}`,
24
- children: /* @__PURE__ */ t(k, { ...e })
31
+ className: `${e.hasCharacterCount ? r.characterCount : r.withoutCharacterCount}`,
32
+ children: /* @__PURE__ */ t(L, { ...e })
25
33
  }
26
- ), k = ({
34
+ ), L = ({
27
35
  propertyName: e,
28
36
  label: u,
29
- disabled: f = !1,
30
- textarea: r = !1,
31
- hasCharacterCount: d = !1,
32
- hidden: H = !1,
33
- placeholder: R,
34
- type: b,
35
- prefixText: w,
36
- inputMode: z,
37
- trailingIcon: E,
38
- trigger: h = "likeForm",
39
- rules: n,
40
- ...v
37
+ disabled: s = !1,
38
+ textarea: n = !1,
39
+ hasCharacterCount: c = !1,
40
+ hidden: w = !1,
41
+ placeholder: B,
42
+ type: S,
43
+ prefixText: j,
44
+ inputMode: k,
45
+ trailingIcon: R,
46
+ trigger: C = "likeForm",
47
+ rules: a,
48
+ ...i
41
49
  }) => {
42
- const {
43
- control: T,
44
- getFieldState: m,
45
- formState: { errors: C },
46
- trigger: $
47
- } = X(), [I, x] = A(0), [o, M] = A(), g = Q(
48
- (l) => {
50
+ const { control: g, getFieldState: d, trigger: v } = Q(), [b, f] = q(0), [o, z] = q(), m = K(
51
+ (h) => {
49
52
  if (o != null) {
50
- x(o.length);
53
+ f(o.length);
51
54
  return;
52
55
  }
53
- if (l) {
54
- x(l.length);
56
+ if (h) {
57
+ f(h.length);
55
58
  return;
56
59
  }
57
- x(0);
60
+ f(0);
58
61
  },
59
62
  [o]
60
- ), P = () => {
61
- const l = B(C, e);
62
- if (l) {
63
- const s = l.message;
64
- return s || "Invalid input";
65
- }
66
- return F;
67
- }, a = c(
68
- () => n?.maxLength?.value,
69
- [n]
70
- ), V = c(
71
- () => n?.minLength?.value,
72
- [n]
73
- ), W = c(
74
- () => n?.required?.value,
75
- [n]
76
- ), F = c(
77
- () => n?.required?.message,
78
- [n]
79
- );
80
- return U(() => {
81
- (r || d) && a !== void 0 && o != null && g();
82
- }, [o, r, d, a, g]), H ? /* @__PURE__ */ t(j, { name: e, control: T, render: () => /* @__PURE__ */ t(S, {}) }) : /* @__PURE__ */ t(
83
- j,
63
+ ), l = T(
64
+ () => i.maxlength ?? a?.maxLength?.value,
65
+ [a, i.maxlength]
66
+ ), E = T(
67
+ () => a?.minLength?.value,
68
+ [a]
69
+ ), _ = T(
70
+ () => a?.required?.message,
71
+ [a]
72
+ ), { helperText: M, helperTextPersistent: P } = U({
73
+ propertyName: e,
74
+ helperText: i.helperText,
75
+ requiredText: _,
76
+ maxLength: l,
77
+ hasCharacterCount: n || c
78
+ });
79
+ return O(() => {
80
+ (n || c) && l !== void 0 && o != null && m();
81
+ }, [o, n, c, l, m]), w ? /* @__PURE__ */ t(H, { name: e, control: g, render: () => /* @__PURE__ */ t(F, {}) }) : /* @__PURE__ */ t(
82
+ H,
84
83
  {
85
84
  name: e,
86
- rules: n,
87
- control: T,
88
- render: ({ field: { ref: l, ...s }, formState: { defaultValues: D } }) => {
89
- const q = B(D, e);
90
- return !o && q && (d || r) && g(q), /* @__PURE__ */ J(S, { children: [
85
+ rules: a,
86
+ control: g,
87
+ render: ({ field: { ref: h, ...x }, formState: { defaultValues: V } }) => {
88
+ const A = J(V, e);
89
+ return !o && A && (c || n) && m(A), /* @__PURE__ */ D(F, { children: [
91
90
  /* @__PURE__ */ t(
92
- K,
91
+ G,
93
92
  {
94
- ...v,
95
- ...s,
96
- value: s.value ?? "",
97
- type: b,
93
+ ...i,
94
+ ...x,
95
+ value: x.value ?? "",
96
+ type: S,
98
97
  fullWidth: !0,
99
98
  "data-testid": `textfield-${e}`,
100
- inputMode: z,
101
- placeholder: R,
102
- prefixText: w,
103
- disabled: f,
104
- helperText: P(),
105
- helperTextPersistent: C !== void 0 || W || a !== void 0 && (r || d),
99
+ inputMode: k,
100
+ placeholder: B,
101
+ prefixText: j,
102
+ disabled: s,
103
+ helperText: M,
104
+ helperTextPersistent: P,
106
105
  label: u,
107
106
  variant: "outlined",
108
- maxlength: a,
109
- minLength: V,
110
- textarea: r,
107
+ maxlength: l,
108
+ minLength: E,
109
+ textarea: n,
111
110
  noResize: !1,
112
111
  onBlur: () => {
113
- h === "onBlur" && $(e), v.onBlur?.();
112
+ C === "onBlur" && v(e), i.onBlur?.();
114
113
  },
115
- onChange: (L) => {
116
- s.onChange(L);
117
- const G = L?.target?.value;
118
- M(G), h === "onChange" && $(e);
114
+ onChange: ($) => {
115
+ x.onChange($);
116
+ const W = $?.target?.value;
117
+ z(W), C === "onChange" && v(e);
119
118
  },
120
- valid: !m(e).invalid,
121
- className: `${i.formText} ${m(e).invalid ? i.invalid : ""}`,
122
- trailingIcon: E
119
+ valid: !d(e).invalid,
120
+ className: `${r.formText} ${d(e).invalid ? r.invalid : ""}`,
121
+ trailingIcon: R
123
122
  }
124
123
  ),
125
- a !== void 0 && (d || r) && /* @__PURE__ */ t(
126
- Y,
124
+ l !== void 0 && (c || n) && /* @__PURE__ */ t(
125
+ ee,
127
126
  {
128
- count: I,
129
- maxCount: a,
130
- invalid: m(e).invalid,
131
- hasRequiredText: !!F
127
+ count: b,
128
+ maxCount: l,
129
+ invalid: d(e).invalid,
130
+ hasRequiredText: !!i.helperText || !!_
132
131
  }
133
132
  )
134
133
  ] });
@@ -137,5 +136,5 @@ const Y = ({
137
136
  );
138
137
  };
139
138
  export {
140
- re as FormText
139
+ se as FormText
141
140
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as r, f as d } from "../../../react.esm-CHvVvf3L.js";
3
- import { FormText as o } from "./FormText.js";
4
- import { v as a, d as u, t as l, g as e } from "../../../vi.JYQecGiw-BpOAB4v6.js";
2
+ import { a as s, s as r, f as d } from "../../../react.esm-FR1-H8iU.js";
3
+ import { FormText as l } from "./FormText.js";
4
+ import { v as a, d as u, t as o, g as e } from "../../../vi.CjhMlMwf-DWv7vrn7.js";
5
5
  const m = a.fn();
6
6
  a.mock("react-hook-form", () => ({
7
7
  ...a.importActual("react-hook-form"),
@@ -43,10 +43,10 @@ a.mock("react-hook-form", () => ({
43
43
  })
44
44
  }));
45
45
  u("FormText Test", () => {
46
- l("render FormText and return single line text field", () => {
46
+ o("render FormText and return single line text field", () => {
47
47
  s(
48
48
  /* @__PURE__ */ n(
49
- o,
49
+ l,
50
50
  {
51
51
  rules: {
52
52
  maxLength: {
@@ -61,10 +61,10 @@ u("FormText Test", () => {
61
61
  );
62
62
  const t = r.getByRole("textbox");
63
63
  e(t).toBeInTheDocument(), e(t).toBeInstanceOf(HTMLInputElement), e(t).toHaveAttribute("maxlength", "100"), e(r.getByText("address.line2")).toBeInTheDocument();
64
- }), l("change value of single line text field", () => {
64
+ }), o("change value of single line text field", () => {
65
65
  s(
66
66
  /* @__PURE__ */ n(
67
- o,
67
+ l,
68
68
  {
69
69
  rules: {
70
70
  maxLength: {
@@ -79,10 +79,10 @@ u("FormText Test", () => {
79
79
  );
80
80
  const t = r.getByRole("textbox");
81
81
  e(t).toHaveValue("test"), d.change(t, { target: { value: "test-change" } }), e(m).toHaveBeenCalled();
82
- }), l("render FormText and return text area", () => {
82
+ }), o("render FormText and return text area", () => {
83
83
  s(
84
84
  /* @__PURE__ */ n(
85
- o,
85
+ l,
86
86
  {
87
87
  rules: {
88
88
  required: {
@@ -102,10 +102,10 @@ u("FormText Test", () => {
102
102
  );
103
103
  const t = r.getByRole("textbox");
104
104
  e(t).toBeInTheDocument(), e(t).toBeInstanceOf(HTMLTextAreaElement), e(t).toHaveAttribute("maxlength", "200"), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.getByText("required")).toBeInTheDocument();
105
- }), l("render FormText with maxLength indicator", () => {
105
+ }), o("render FormText with maxLength indicator", () => {
106
106
  s(
107
107
  /* @__PURE__ */ n(
108
- o,
108
+ l,
109
109
  {
110
110
  rules: {
111
111
  maxLength: {
@@ -119,10 +119,10 @@ u("FormText Test", () => {
119
119
  }
120
120
  )
121
121
  ), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.queryByText("required")).not.toBeInTheDocument(), e(r.getByText("0/200")).toBeInTheDocument();
122
- }), l("change value of text area", () => {
122
+ }), o("change value of text area", () => {
123
123
  s(
124
124
  /* @__PURE__ */ n(
125
- o,
125
+ l,
126
126
  {
127
127
  rules: {
128
128
  required: {
@@ -0,0 +1,31 @@
1
+ import { SwitchProps } from '@element/react-components';
2
+ import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ type FormToggleProps<T extends FieldValues> = {
4
+ /** The name of the property that this toggle represents. */
5
+ propertyName: Path<T>;
6
+ /** Label to be displayed with the toggle. */
7
+ label: SwitchProps['label'];
8
+ /** Validation rules for the toggle. */
9
+ validate?: RegisterOptions<T>['validate'];
10
+ /** Determines if this input is mandatory. */
11
+ required?: boolean;
12
+ /** Function to be called when the toggle value changes. */
13
+ onChange?: SwitchProps['onChange'];
14
+ /** Determines if this input is disabled. */
15
+ disabled?: SwitchProps['disabled'];
16
+ };
17
+ /**
18
+ * FormToggle is a custom form input component for selecting toggle.
19
+ * It is integrated with react-hook-form for form management.
20
+ *
21
+ * @param propertyName - the name of the property this toggle maps to in the form.
22
+ * @param label - label displayed along with the toggle.
23
+ * @param validate - validation rules for the toggle.
24
+ * @param required - determines if the toggle is required.
25
+ * @param onChange - function to be called when the toggle value changes.
26
+ * @param disabled - determines if the toggle is disabled.
27
+ *
28
+ * @returns A JSX element that renders a toggle form input.
29
+ */
30
+ export declare const FormToggle: <T extends FieldValues>({ propertyName, label, validate, required, onChange, disabled, }: FormToggleProps<T>) => import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,43 @@
1
+ import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
+ import { Group as l, Switch as p, TypoCaption as d } from "@element/react-components";
3
+ import { useFormContext as u, Controller as C } from "react-hook-form";
4
+ const v = ({
5
+ propertyName: t,
6
+ label: n,
7
+ validate: s,
8
+ required: c,
9
+ onChange: m,
10
+ disabled: a
11
+ }) => {
12
+ const { control: i } = u();
13
+ return /* @__PURE__ */ o(
14
+ C,
15
+ {
16
+ name: t,
17
+ control: i,
18
+ rules: {
19
+ required: c,
20
+ validate: s
21
+ },
22
+ render: ({ field: r, fieldState: e }) => /* @__PURE__ */ h(l, { direction: "vertical", children: [
23
+ /* @__PURE__ */ o(
24
+ p,
25
+ {
26
+ "data-testid": "checkbox",
27
+ ...r,
28
+ label: n,
29
+ onChange: (...g) => {
30
+ r.onChange(...g), m?.();
31
+ },
32
+ checked: r.value,
33
+ disabled: a
34
+ }
35
+ ),
36
+ e.error && /* @__PURE__ */ o(d, { "data-testid": "toggle-error-message", themeColor: "error", children: e.error.message })
37
+ ] })
38
+ }
39
+ );
40
+ };
41
+ export {
42
+ v as FormToggle
43
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { a as n, s as t, f as m } from "../../../react.esm-FR1-H8iU.js";
3
+ import { FormToggle as l } from "./FormToggle.js";
4
+ import { v as e, d as f, t as c, g as r } from "../../../vi.CjhMlMwf-DWv7vrn7.js";
5
+ const a = e.fn();
6
+ e.mock("react-hook-form", () => ({
7
+ ...e.importActual("react-hook-form"),
8
+ Controller: ({
9
+ render: o
10
+ }) => o({
11
+ field: {
12
+ onChange: a
13
+ },
14
+ fieldState: { error: { message: "error" } }
15
+ }),
16
+ useFormContext: () => ({
17
+ control: {
18
+ register: e.fn(),
19
+ unregister: e.fn(),
20
+ getFieldState: e.fn(),
21
+ _names: {
22
+ array: new Set("test"),
23
+ mount: new Set("test"),
24
+ unMount: new Set("test"),
25
+ watch: new Set("test"),
26
+ focus: "test",
27
+ watchAll: !1
28
+ },
29
+ _subjects: {
30
+ watch: e.fn(),
31
+ array: e.fn(),
32
+ state: e.fn()
33
+ },
34
+ _getWatch: e.fn(),
35
+ _formValues: ["test"],
36
+ _defaultValues: ["test"]
37
+ },
38
+ formState: { errors: {} },
39
+ watch: () => "2024-08-07"
40
+ })
41
+ }));
42
+ f("FormToggle Test", () => {
43
+ c("render FormToggle", () => {
44
+ n(/* @__PURE__ */ s(l, { propertyName: "hasValue", label: "user.hasValue" })), r(t.getByText("user.hasValue")).toBeInTheDocument(), r(t.getByText("error")).toBeInTheDocument(), r(t.getByRole("switch")).toBeInTheDocument();
45
+ }), c("render FormToggle click", () => {
46
+ n(/* @__PURE__ */ s(l, { propertyName: "hasValue", label: "user.hasValue", onChange: a }));
47
+ const o = t.getByRole("switch");
48
+ m.click(o), r(a).toHaveBeenCalled();
49
+ });
50
+ });
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { N as i } from "../../react-number-format.es-BeIT_PM7.js";
2
+ import { N as i } from "../../react-number-format.es-BD3_OvMU.js";
3
3
  import { useDecimalSeparator as d, useThousandSeparator as n } from "../../services/NumberService.js";
4
4
  const y = ({
5
5
  typographyComponent: a,
@@ -1,124 +1,107 @@
1
- import { jsx as r, jsxs as B } from "react/jsx-runtime";
2
- import { Elevation as D, Table as G, TableTopBar as u, Group as m, Padding as W, TypoDisplay as $, TypoSubtitle as k } from "@element/react-components";
3
- import { Fragment as C } from "react";
4
- import { a as t } from "../../genericTable.module-Dk3yy2S3.js";
5
- import { u as j } from "../../useBreakpoints-MzTZ0tCT.js";
6
- import "../../alertBanner.module-BPiKN0gh.js";
7
- import "../../iconify.module-Cru5NS2X.js";
8
- import "../../isArray-thIeLpc5.js";
9
- import "../../react-tooltip.min-BzHiZW8k.js";
10
- import "../../overflowTooltip.module-YyRN2MGc.js";
11
- import "../../basicHeading.module-BYb8xvuk.js";
12
- import "../../_baseToString-dkhmFwqS.js";
13
- import "../../_equalByTag-BZEJl6ST.js";
14
- import "../../searchBar.module-9gKyrZRT.js";
15
- import "../../listArea.module-BhO_OJ1S.js";
16
- import "../../verticalDivider.module-C3_GL-fH.js";
17
- import "../../baseView.module-uWbm_a5f.js";
18
- import "../../BlockView.module-BPlNT5uh.js";
19
- import "../../chipCard.module-BjpKuf1b.js";
1
+ import "../../assets/GenericTable.css";
2
+ import { jsx as e, jsxs as B } from "react/jsx-runtime";
3
+ import { Elevation as N, Table as D, Group as l, TypoSubtitle as G, TableTopBar as u, Padding as W, TypoDisplay as $ } from "@element/react-components";
4
+ import { Fragment as k } from "react";
5
+ /* empty css */
6
+ import { u as C } from "../../useBreakpoints-MzTZ0tCT.js";
7
+ import "../../isEmpty-BimaZd5G.js";
8
+ import "../../react-tooltip.min-c2wVkjF2.js";
9
+ import "../../orderBy-BVQIswlJ.js";
20
10
  import "lodash";
21
- import "../../contextMenu.module-vNQHb48g.js";
22
- import "../../modal.module-BlDp1Wiq.js";
23
- import "../../deleteModal.module-Ds3MDzdl.js";
24
- import "../../disclaimer.module-BZydt-Q_.js";
25
- import "../../HashTabView.module-ZhwSfDeQ.js";
26
- import "../../HeaderFilter.module-DiBmulr5.js";
27
- import "../../healthCheckFailed.module-B5P1ogjs.js";
28
- import "../../infoGroup.module-Cxw88dfC.js";
29
- import "../../bigLoadingSpinner.module-GgbFol8k.js";
30
- import "../../loadingSpinner.module-CLtqSMWA.js";
31
- import "../Scrollbar/Scrollbar.js";
32
11
  import "react-hook-form";
33
- import "../../formDatePicker.module-BV3ma_7y.js";
34
- import "../../formNumber.module-BA05Gi6_.js";
35
- import "../../formSelect.module-PUiLDSD4.js";
36
- import "../../formText.module-C0by6_DK.js";
37
- import "../../isPlainObject-BlCDf1Kc.js";
38
- import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
12
+ import "../../get-BiqanC9_.js";
13
+ import "../../isArray-C_5XvIlE.js";
14
+ import "../../isString-BOHPtrlm.js";
15
+ import { useGenerateColumns as j, useGenerateTableData as x } from "./GenericTableService.js";
39
16
  import { GenericCardList as A } from "./Mobile/GenericCardList.js";
40
- const br = ({
41
- data: p = [],
42
- hiddenColumns: l = [],
17
+ const E = "_topBar_1msoo_1", F = "_filterBar_1msoo_5", I = "_emptyTable_1msoo_9", L = "_elevation_1msoo_17", M = "_table_1msoo_22", t = {
18
+ topBar: E,
19
+ filterBar: F,
20
+ emptyTable: I,
21
+ elevation: L,
22
+ table: M
23
+ }, ee = ({
24
+ data: i = [],
25
+ hiddenColumns: s = [],
43
26
  order: f = [],
44
- cellTemplates: g = void 0,
45
- tableActions: i = [],
46
- noContentText: n = "No data available",
47
- headerTranslation: h = (a) => a,
48
- pagination: y = !1,
49
- getRowActions: s = void 0,
50
- customColumnWidth: b,
51
- title: e,
52
- cardTitleColumn: v,
53
- cardSubTitleColumn: T
27
+ cellTemplates: b = void 0,
28
+ tableActions: r = [],
29
+ noContentText: m = "No data available",
30
+ headerTranslation: _ = (o) => o,
31
+ pagination: g = !1,
32
+ getRowActions: c = void 0,
33
+ customColumnWidth: y,
34
+ title: a,
35
+ cardTitleColumn: h,
36
+ cardSubTitleColumn: v
54
37
  }) => {
55
- const { isDesktop: a } = j(), o = x({
56
- data: p,
38
+ const { isDesktop: o } = C(), n = j({
39
+ data: i,
57
40
  order: f,
58
- cellTemplates: g,
59
- headerTranslation: h,
60
- getRowActions: s,
61
- customColumnWidth: b,
62
- cardTitleColumn: v,
63
- cardSubTitleColumn: T
64
- }), d = _({
65
- data: p,
66
- getRowActions: s
41
+ cellTemplates: b,
42
+ headerTranslation: _,
43
+ getRowActions: c,
44
+ customColumnWidth: y,
45
+ cardTitleColumn: h,
46
+ cardSubTitleColumn: v
47
+ }), d = x({
48
+ data: i,
49
+ getRowActions: c
67
50
  });
68
- return a ? /* @__PURE__ */ r(D, { elevation: 1, className: t.elevation, "data-testid": "generic-table-elevation", children: /* @__PURE__ */ r(
69
- G,
51
+ return o ? /* @__PURE__ */ e(N, { elevation: 1, className: t.elevation, "data-testid": "generic-table-elevation", children: /* @__PURE__ */ e(
52
+ D,
70
53
  {
71
- "data-testid": `generic-table${e ? "-" + e : ""}`,
54
+ "data-testid": `generic-table${a ? "-" + a : ""}`,
72
55
  className: t.table,
73
56
  fullWidth: !0,
74
57
  alwaysUseDivTags: !0,
75
58
  layout: "standard",
76
- hiddenColumns: l,
59
+ hiddenColumns: s,
77
60
  data: d,
78
- columns: o,
79
- leadingContent: e && i?.length === 0 ? /* @__PURE__ */ r(u, { title: e }) : i?.length > 0 && /* @__PURE__ */ r(
61
+ columns: n,
62
+ leadingContent: a && r?.length === 0 ? /* @__PURE__ */ e(u, { title: a }) : r?.length > 0 && /* @__PURE__ */ e(
80
63
  u,
81
64
  {
82
65
  className: t.topBar,
83
- filterBar: /* @__PURE__ */ B(m, { fullWidth: !0, direction: "vertical", gap: "none", children: [
84
- e && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r($, { level: 6, children: e }) }),
85
- /* @__PURE__ */ r(
86
- m,
66
+ filterBar: /* @__PURE__ */ B(l, { fullWidth: !0, direction: "vertical", gap: "none", children: [
67
+ a && /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e($, { level: 6, children: a }) }),
68
+ /* @__PURE__ */ e(
69
+ l,
87
70
  {
88
71
  className: t.filterBar,
89
72
  fullWidth: !0,
90
73
  primaryAlign: "end",
91
74
  secondaryAlign: "center",
92
- children: i.map((c, N) => /* @__PURE__ */ r(C, { children: c }, `action_${N}_${c.key}`))
75
+ children: r.map((p, T) => /* @__PURE__ */ e(k, { children: p }, `action_${T}_${p.key}`))
93
76
  }
94
77
  )
95
78
  ] })
96
79
  }
97
80
  ),
98
- paginated: y,
81
+ paginated: g,
99
82
  sortable: !0,
100
- noContentIncludeTable: !!o,
101
- noContentMessage: /* @__PURE__ */ r(
102
- m,
83
+ noContentIncludeTable: !!n,
84
+ noContentMessage: /* @__PURE__ */ e(
85
+ l,
103
86
  {
104
87
  fullWidth: !0,
105
88
  primaryAlign: "center",
106
89
  secondaryAlign: "center",
107
90
  className: t.emptyTable,
108
- children: /* @__PURE__ */ r(k, { children: n })
91
+ children: /* @__PURE__ */ e(G, { children: m })
109
92
  }
110
93
  )
111
94
  }
112
- ) }) : /* @__PURE__ */ r("div", { "data-testid": `generic-card-list${e ? "-" + e : ""}`, children: /* @__PURE__ */ r(
95
+ ) }) : /* @__PURE__ */ e("div", { "data-testid": `generic-card-list${a ? "-" + a : ""}`, children: /* @__PURE__ */ e(
113
96
  A,
114
97
  {
115
98
  data: d,
116
- columns: o,
117
- hiddenColumns: l,
118
- noContentText: n
99
+ columns: n,
100
+ hiddenColumns: s,
101
+ noContentText: m
119
102
  }
120
103
  ) });
121
104
  };
122
105
  export {
123
- br as GenericTable
106
+ ee as GenericTable
124
107
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as a, jsxs as B } from "react/jsx-runtime";
2
- import { a as o, s as e } from "../../react.esm-CHvVvf3L.js";
2
+ import { a as o, s as e } from "../../react.esm-FR1-H8iU.js";
3
3
  import { a as m } from "../../useBreakpoints-MzTZ0tCT.js";
4
4
  import { GenericTable as s } from "./GenericTable.js";
5
- import { d as h, v as r, t as i, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
+ import { d as h, v as r, t as i, g as t } from "../../vi.CjhMlMwf-DWv7vrn7.js";
6
6
  h("GenericTable Test", () => {
7
7
  r.spyOn(m, "useBreakpoints").mockReturnValue({
8
8
  isDesktop: !0,