@hortiview/shared-components 2.18.0 → 2.18.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 (219) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{AlertBanner-aW6joVUm.js → AlertBanner-BFzaGOer.js} +3 -3
  3. package/dist/{GenericCard-IWX-Bmb_.js → GenericCard-grpa3KJR.js} +3 -3
  4. package/dist/{ListAreaService-Fsm3-gDM.js → ListAreaService-DfxJ7jFs.js} +5 -5
  5. package/dist/{_Map-D8db_GOu.js → _Map-BYxTn6ob.js} +1 -1
  6. package/dist/{_commonjsHelpers-B4e78b8K.js → _commonjsHelpers-ByX85dGu.js} +18 -13
  7. package/dist/animationframe-CqXArbwZ.js +32 -0
  8. package/dist/component-By6nyiBU.js +70 -0
  9. package/dist/{component-DEJuY56h.js → component-DYpB_4EP.js} +1 -111
  10. package/dist/components/AlertBanner/AlertBanner.js +4 -4
  11. package/dist/components/AlertBanner/LinkBanner.js +3 -3
  12. package/dist/components/AllowedButton/AllowedButton.js +1 -1
  13. package/dist/components/AllowedIconButton/AllowedIconButton.js +1 -1
  14. package/dist/components/BaseView/BaseView.js +14 -14
  15. package/dist/components/BasicHeading/BasicHeading.js +5 -5
  16. package/dist/components/BlockView/BlockView.js +2 -2
  17. package/dist/components/ButtonCard/ButtonCard.js +6 -6
  18. package/dist/components/ChipCard/ChipCard.js +13 -255
  19. package/dist/components/ConfirmationModal/ConfirmationModal.js +8 -8
  20. package/dist/components/ContextMenu/ContextMenu.js +12 -12
  21. package/dist/components/DeleteModal/DeleteModal.js +25 -25
  22. package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
  23. package/dist/components/Disclaimer/Disclaimer.js +3 -3
  24. package/dist/components/EmptyView/EmptyView.js +3 -3
  25. package/dist/components/Filter/Filter.js +15 -15
  26. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
  27. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +7 -22
  28. package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
  29. package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
  30. package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
  31. package/dist/components/FormComponents/FormSelect/FormSelect.js +4 -4
  32. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
  33. package/dist/components/FormComponents/FormSlider/FormSlider.js +10 -98
  34. package/dist/components/FormComponents/FormText/FormText.js +2 -2
  35. package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
  36. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  37. package/dist/components/GenericTable/GenericTable.js +36 -172
  38. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
  39. package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
  40. package/dist/components/HashTabView/HashTabView.js +10 -428
  41. package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
  42. package/dist/components/Iconify/Iconify.js +2 -2
  43. package/dist/components/InfoCard/InfoCard.js +4 -4
  44. package/dist/components/InfoGroup/InfoGroup.js +4 -4
  45. package/dist/components/ListArea/ListArea.js +6 -6
  46. package/dist/components/ListArea/ListAreaService.js +6 -6
  47. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +13 -5
  48. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +8 -74
  49. package/dist/components/Modal/Modal.js +12 -122
  50. package/dist/components/ModulePadding/ModulePadding.js +11 -11
  51. package/dist/components/OfflineView/OfflineView.js +45 -7
  52. package/dist/components/OnboardingBanner/OnboardingBanner.js +8 -8
  53. package/dist/components/OverflowTooltip/OverflowTooltip.js +2 -2
  54. package/dist/components/SearchBar/SearchBar.js +2 -2
  55. package/dist/components/Select/Select.js +2 -2
  56. package/dist/components/Stepper/Stepper.js +1 -1
  57. package/dist/components/Stepper/components/StepperButton.js +1 -1
  58. package/dist/components/Stepper/components/StepperHeader.js +3 -3
  59. package/dist/components/Stepper/components/StepperItem.js +2 -2
  60. package/dist/{correct-is-regexp-logic-Y0ToWEjF.js → correct-is-regexp-logic-BJ-OWRrn.js} +1 -1
  61. package/dist/{defineProperty-BTsGZ3c1.js → defineProperty-B7N9EBBI.js} +3 -3
  62. package/dist/{es.string.iterator-UszlTFwY.js → es.string.iterator-DBx2A42F.js} +2 -2
  63. package/dist/{find-CHg-_ooq.js → find-eU9ab_u7.js} +4 -4
  64. package/dist/{get-DxjPG00Z.js → get-BLvvbtML.js} +3 -3
  65. package/dist/get-CBFiuc3f.js +7 -0
  66. package/dist/hooks/useBreakpoints.js +37 -3
  67. package/dist/hooks/useHelperText.js +1 -1
  68. package/dist/{identity-BVIVr9qu.js → identity-B0bbReND.js} +4 -4
  69. package/dist/{index-BcGujPyk.js → index-Df2FYN-K.js} +5 -26
  70. package/dist/{index.es-B8p8KCdj.js → index.es-B19PQgzU.js} +4 -4
  71. package/dist/{index.es-BYcQTTL8.js → index.es-B9BUXRQn.js} +9 -339
  72. package/dist/{index.es-BPv5dCFQ.js → index.es-BOG3_7IM.js} +12 -12
  73. package/dist/{index.es-DGoBge9W.js → index.es-BOvO8moE.js} +4 -4
  74. package/dist/{index.es-BoUnovl_.js → index.es-BcnmoCEg.js} +8 -74
  75. package/dist/{index.es-C32E1Lcb.js → index.es-BwafUoK3.js} +82 -147
  76. package/dist/{index.es-B1h6DPYp.js → index.es-C27R5Xae.js} +2 -2
  77. package/dist/{index.es-nwjKmW7-.js → index.es-C2IOpX7R.js} +34 -111
  78. package/dist/{index.es-Da7ok-B-.js → index.es-C6I3L4U4.js} +2 -2
  79. package/dist/{index.es-BHvm4m-B.js → index.es-Cg57snrN.js} +19 -261
  80. package/dist/{index.es-DUTChZks.js → index.es-Ci3O23C_.js} +6 -72
  81. package/dist/{index.es-t87yNd9Y.js → index.es-CkB4776y.js} +6 -72
  82. package/dist/{index.es-CeQB6igi.js → index.es-Cr1PSTyq.js} +3 -3
  83. package/dist/{index.es--C-VLspF.js → index.es-D1iB_QlE.js} +8 -140
  84. package/dist/{index.es-Dgxrk6xW.js → index.es-DEBGoIKX.js} +2 -2
  85. package/dist/{index.es-CWyjqoEE.js → index.es-DHnCVuQ8.js} +7 -73
  86. package/dist/{index.es-Bo-d_yTV.js → index.es-DHoIQ8lu.js} +2 -2
  87. package/dist/{index.es-SjZ_-d7U.js → index.es-DUrjyxNI.js} +5 -5
  88. package/dist/{index.es-Cfv794DG.js → index.es-DdeCB7LW.js} +1 -1
  89. package/dist/{index.es-BanVdXEd.js → index.es-DgncYOqO.js} +2 -2
  90. package/dist/{index.es-DOnQ26kT.js → index.es-DhlgTSuU.js} +3 -3
  91. package/dist/{index.es-oxil0uFe.js → index.es-Z0aF-7Cn.js} +3 -6
  92. package/dist/{index.es-DmRhbgqK.js → index.es-l_3PNohs.js} +2 -68
  93. package/dist/{isArray-B457bpaW.js → isArray-Ce1Q96lU.js} +1 -1
  94. package/dist/isArray-olhCpv2e.js +7 -0
  95. package/dist/{isEmpty-BnfHn4bl.js → isEmpty-l2xQKl4x.js} +3 -3
  96. package/dist/{isString-DVA49FEo.js → isString-BNdV0Jpg.js} +3 -3
  97. package/dist/{isTypedArray-DziahYkI.js → isTypedArray-D39qzPYE.js} +2 -2
  98. package/dist/{keyboard-DiKJoabs.js → keyboard-DbG3oyPU.js} +3 -25
  99. package/dist/main.js +15 -15
  100. package/dist/{map-BprzXv4m.js → map-ZSVweMI1.js} +5 -5
  101. package/dist/{omit-CYY_mIYv.js → omit-BWQrFyQ-.js} +7 -7
  102. package/dist/{orderBy-DLBJlgdL.js → orderBy-Ce85KqD6.js} +7 -7
  103. package/dist/{parse-int-D-3oah_F.js → parse-int-CGpIXMGa.js} +2 -2
  104. package/dist/{react-number-format.es-DzkMiF8j.js → react-number-format.es-pczkQ4lQ.js} +0 -1
  105. package/dist/{react-tooltip.min-CVsI--2Y.js → react-tooltip.min-Dkz5ltCC.js} +1 -12
  106. package/dist/{react.esm-Bm0cAgpZ.js → react.esm-DF7i80eN.js} +2471 -2582
  107. package/dist/services/UtilService.js +9 -9
  108. package/dist/{slicedToArray-ByMQIs5x.js → slicedToArray-DC6VAZtW.js} +4 -4
  109. package/dist/test-utils.js +1 -1
  110. package/dist/{toString-B7FIT8FE.js → toString-D5bEU-DN.js} +1 -1
  111. package/dist/{uniqueId-BNVTeImh.js → uniqueId-CJo-XRQb.js} +2 -2
  112. package/dist/{util-DA21pZXj.js → util-CBo-ipCE.js} +0 -22
  113. package/package.json +2 -2
  114. package/dist/BigLoadingSpinner-DGj9_Z5J.js +0 -16
  115. package/dist/OfflineView-CIwV08EQ.js +0 -48
  116. package/dist/animationframe-BVKDmEXe.js +0 -54
  117. package/dist/component-Bz_dtX1r.js +0 -114
  118. package/dist/components/AlertBanner/AlertBanner.test.d.ts +0 -1
  119. package/dist/components/AlertBanner/AlertBanner.test.js +0 -34
  120. package/dist/components/AlertBanner/LinkBanner.test.d.ts +0 -1
  121. package/dist/components/AlertBanner/LinkBanner.test.js +0 -17
  122. package/dist/components/Allowed/Allowed.test.d.ts +0 -1
  123. package/dist/components/Allowed/Allowed.test.js +0 -49
  124. package/dist/components/AllowedButton/AllowedButton.test.d.ts +0 -1
  125. package/dist/components/AllowedButton/AllowedButton.test.js +0 -126
  126. package/dist/components/AllowedIconButton/AllowedIconButton.test.d.ts +0 -1
  127. package/dist/components/AllowedIconButton/AllowedIconButton.test.js +0 -121
  128. package/dist/components/BaseView/BaseView.test.d.ts +0 -1
  129. package/dist/components/BaseView/BaseView.test.js +0 -180
  130. package/dist/components/BasicHeading/BasicHeading.test.d.ts +0 -1
  131. package/dist/components/BasicHeading/BasicHeading.test.js +0 -36
  132. package/dist/components/BlockView/BlockView.test.d.ts +0 -1
  133. package/dist/components/BlockView/BlockView.test.js +0 -47
  134. package/dist/components/ButtonCard/ButtonCard.test.d.ts +0 -1
  135. package/dist/components/ButtonCard/ButtonCard.test.js +0 -92
  136. package/dist/components/ChipCard/ChipCard.test.d.ts +0 -1
  137. package/dist/components/ChipCard/ChipCard.test.js +0 -25
  138. package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +0 -1
  139. package/dist/components/ConfirmationModal/ConfirmationModal.test.js +0 -221
  140. package/dist/components/ContextMenu/ContextMenu.test.d.ts +0 -1
  141. package/dist/components/ContextMenu/ContextMenu.test.js +0 -96
  142. package/dist/components/DeleteModal/DeleteModal.test.d.ts +0 -1
  143. package/dist/components/DeleteModal/DeleteModal.test.js +0 -132
  144. package/dist/components/Disclaimer/Disclaimer.test.d.ts +0 -1
  145. package/dist/components/Disclaimer/Disclaimer.test.js +0 -13
  146. package/dist/components/EmptyView/EmptyView.test.d.ts +0 -1
  147. package/dist/components/EmptyView/EmptyView.test.js +0 -50
  148. package/dist/components/Filter/Filter.test.d.ts +0 -1
  149. package/dist/components/Filter/Filter.test.js +0 -166
  150. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +0 -1
  151. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +0 -56
  152. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +0 -1
  153. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +0 -56
  154. package/dist/components/FormComponents/FormNumber/FormNumber.test.d.ts +0 -1
  155. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +0 -51
  156. package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +0 -1
  157. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +0 -73
  158. package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +0 -1
  159. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +0 -226
  160. package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +0 -1
  161. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +0 -49
  162. package/dist/components/FormComponents/FormText/FormText.test.d.ts +0 -1
  163. package/dist/components/FormComponents/FormText/FormText.test.js +0 -113
  164. package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +0 -1
  165. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +0 -54
  166. package/dist/components/GenericTable/GenericTable.test.d.ts +0 -1
  167. package/dist/components/GenericTable/GenericTable.test.js +0 -115
  168. package/dist/components/GenericTable/Mobile/GenericCard.test.d.ts +0 -1
  169. package/dist/components/GenericTable/Mobile/GenericCard.test.js +0 -76
  170. package/dist/components/GenericTable/Mobile/GenericCardList.test.d.ts +0 -1
  171. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +0 -75
  172. package/dist/components/HashTabView/HashTabView.test.d.ts +0 -1
  173. package/dist/components/HashTabView/HashTabView.test.js +0 -31
  174. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +0 -1
  175. package/dist/components/HeaderFilter/HeaderFilter.test.js +0 -46
  176. package/dist/components/Iconify/Iconify.test.d.ts +0 -1
  177. package/dist/components/Iconify/Iconify.test.js +0 -28
  178. package/dist/components/InfoCard/InfoCard.test.d.ts +0 -1
  179. package/dist/components/InfoCard/InfoCard.test.js +0 -48
  180. package/dist/components/InfoGroup/InfoGroup.test.d.ts +0 -1
  181. package/dist/components/InfoGroup/InfoGroup.test.js +0 -40
  182. package/dist/components/ListArea/ListArea.test.d.ts +0 -1
  183. package/dist/components/ListArea/ListArea.test.js +0 -110
  184. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.d.ts +0 -1
  185. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +0 -15
  186. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.d.ts +0 -1
  187. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +0 -20
  188. package/dist/components/ModulePadding/ModulePadding.test.d.ts +0 -1
  189. package/dist/components/ModulePadding/ModulePadding.test.js +0 -22
  190. package/dist/components/OfflineView/OfflineView.test.d.ts +0 -1
  191. package/dist/components/OfflineView/OfflineView.test.js +0 -24
  192. package/dist/components/OnboardingBanner/OnboardingBanner.test.d.ts +0 -1
  193. package/dist/components/OnboardingBanner/OnboardingBanner.test.js +0 -72
  194. package/dist/components/OverflowTooltip/OverflowTooltip.test.d.ts +0 -1
  195. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +0 -37
  196. package/dist/components/PermissionChecks/PermissionService.test.d.ts +0 -1
  197. package/dist/components/PermissionChecks/PermissionService.test.js +0 -91
  198. package/dist/components/SafeForm/SafeForm.test.d.ts +0 -1
  199. package/dist/components/SafeForm/SafeForm.test.js +0 -91
  200. package/dist/components/Scrollbar/scrollbar.test.d.ts +0 -1
  201. package/dist/components/Scrollbar/scrollbar.test.js +0 -15
  202. package/dist/components/SearchBar/SearchBar.test.d.ts +0 -1
  203. package/dist/components/SearchBar/SearchBar.test.js +0 -23
  204. package/dist/components/Select/Select.test.d.ts +0 -1
  205. package/dist/components/Select/Select.test.js +0 -28
  206. package/dist/components/Stepper/Stepper.test.d.ts +0 -1
  207. package/dist/components/Stepper/Stepper.test.js +0 -342
  208. package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +0 -1
  209. package/dist/components/VerticalDivider/VerticalDivider.test.js +0 -15
  210. package/dist/get-D8IXqiys.js +0 -7
  211. package/dist/hooks/useBreakpoints.test.d.ts +0 -1
  212. package/dist/hooks/useBreakpoints.test.js +0 -11
  213. package/dist/index-BLPBqbdx.js +0 -11025
  214. package/dist/isArray-BjSPDQ4v.js +0 -7
  215. package/dist/magic-string.es-uPKorP4O.js +0 -663
  216. package/dist/services/services.test.d.ts +0 -1
  217. package/dist/services/services.test.js +0 -106
  218. package/dist/useBreakpoints-MzTZ0tCT.js +0 -45
  219. package/dist/vi.bdSIJ99Y-B308Q-4w.js +0 -11963
@@ -1,49 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { a as s, s as n } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormSlider as l } from "./FormSlider.js";
4
- import { a as e, d as m, t as i, g as r } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const o = e.fn();
6
- e.mock("react-hook-form", () => ({
7
- ...e.importActual("react-hook-form"),
8
- Controller: ({
9
- render: t
10
- }) => t({
11
- field: {
12
- onChange: o
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
- setValue: o
41
- })
42
- }));
43
- m("FormSlider Test", () => {
44
- i("render FormSlider", () => {
45
- s(/* @__PURE__ */ a(l, { propertyName: "slide", label: "slide", maxValue: 10, minValue: 0, step: 2 }));
46
- const t = n.getByRole("slider");
47
- r(t).toBeInTheDocument(), r(t).toHaveAttribute("max", "10"), r(t).toHaveAttribute("min", "0"), r(t).toHaveAttribute("step", "2");
48
- });
49
- });
@@ -1,113 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as r, f as i } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormText as o } from "./FormText.js";
4
- import { a, d as u, t as l, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const d = a.fn();
6
- a.mock("react-hook-form", () => ({
7
- ...a.importActual("react-hook-form"),
8
- Controller: ({
9
- render: t
10
- }) => t({
11
- field: {
12
- ref: void 0,
13
- onChange: d,
14
- value: "test"
15
- },
16
- formState: { defaultValue: {} }
17
- }),
18
- useFormContext: () => ({
19
- watch: a.fn(),
20
- control: {
21
- register: a.fn(),
22
- unregister: a.fn(),
23
- getFieldState: a.fn(),
24
- _names: {
25
- array: new Set("test"),
26
- mount: new Set("test"),
27
- unMount: new Set("test"),
28
- watch: new Set("test"),
29
- focus: "test",
30
- watchAll: !1
31
- },
32
- _subjects: {
33
- watch: a.fn(),
34
- array: a.fn(),
35
- state: a.fn()
36
- },
37
- _getWatch: a.fn(),
38
- _formValues: ["test"],
39
- _defaultValues: ["test"]
40
- },
41
- formState: { errors: {} },
42
- getFieldState: () => ({ invalid: !1 })
43
- })
44
- }));
45
- u("FormText Test", () => {
46
- l("render FormText and return single line text field", () => {
47
- s(
48
- /* @__PURE__ */ n(
49
- o,
50
- {
51
- rules: {
52
- maxLength: {
53
- value: 100,
54
- message: "max length is 100"
55
- }
56
- },
57
- label: "address.line2",
58
- propertyName: "addressLine2"
59
- }
60
- )
61
- );
62
- const t = r.getByRole("textbox");
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", () => {
65
- s(/* @__PURE__ */ n(o, { label: "address.line2", propertyName: "addressLine2" }));
66
- const t = r.getByRole("textbox");
67
- e(t).toHaveValue("test"), i.change(t, { target: { value: "test-change" } }), e(d).toHaveBeenCalled();
68
- }), l("render FormText and return text area", () => {
69
- s(
70
- /* @__PURE__ */ n(
71
- o,
72
- {
73
- rules: {
74
- required: {
75
- value: !0,
76
- message: "required"
77
- },
78
- maxLength: {
79
- value: 200,
80
- message: "max length is 200"
81
- }
82
- },
83
- label: "address.line1",
84
- propertyName: "addressLine1",
85
- textarea: !0
86
- }
87
- )
88
- );
89
- const t = r.getByRole("textbox");
90
- e(t).toBeInTheDocument(), e(t).toBeInstanceOf(HTMLTextAreaElement), e(t).toHaveAttribute("maxlength", "200"), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.getByText("required")).toBeInTheDocument();
91
- }), l("render FormText with maxLength indicator", () => {
92
- s(/* @__PURE__ */ n(o, { maxlength: 200, label: "address.line1", propertyName: "addressLine1", textarea: !0 })), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.queryByText("required")).not.toBeInTheDocument(), e(r.getByText("4/200")).toBeInTheDocument();
93
- }), l("change value of text area", () => {
94
- s(
95
- /* @__PURE__ */ n(
96
- o,
97
- {
98
- rules: {
99
- required: {
100
- value: !0,
101
- message: "required"
102
- }
103
- },
104
- label: "address.line1",
105
- propertyName: "addressLine1",
106
- textarea: !0
107
- }
108
- )
109
- );
110
- const t = r.getByRole("textbox");
111
- i.change(t, { target: { value: "test-change" } }), e(d).toHaveBeenCalled();
112
- });
113
- });
@@ -1,54 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { a as s, s as t, f as m } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormToggle as n } from "./FormToggle.js";
4
- import { a as e, d as u, t as l, g as o } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const c = e.fn();
6
- e.mock("react-hook-form", () => ({
7
- ...e.importActual("react-hook-form"),
8
- Controller: ({
9
- render: r
10
- }) => r({
11
- field: {
12
- onChange: c
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
- u("FormToggle Test", () => {
43
- l("render FormToggle", () => {
44
- s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue" })), o(t.getByText("user.hasValue")).toBeInTheDocument(), o(t.getByText("error")).toBeInTheDocument(), o(t.getByRole("switch")).toBeInTheDocument();
45
- }), l("render FormToggle click", () => {
46
- s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue", onChange: c }));
47
- const r = t.getByRole("switch");
48
- m.click(r), o(c).toHaveBeenCalled();
49
- }), l("render FormToggle with custom data-testid", () => {
50
- s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue", "data-testid": "custom-test-id" })), o(t.getByTestId("custom-test-id")).toBeInTheDocument();
51
- const r = t.queryByTestId("toggle");
52
- o(r).not.toBeInTheDocument();
53
- });
54
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,115 +0,0 @@
1
- import { jsx as a, jsxs as B } from "react/jsx-runtime";
2
- import { a as o, s as e } from "../../react.esm-Bm0cAgpZ.js";
3
- import { a as m } from "../../useBreakpoints-MzTZ0tCT.js";
4
- import { GenericTable as s } from "./GenericTable.js";
5
- import { d as h, a as r, t as i, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
6
- h("GenericTable Test", () => {
7
- r.spyOn(m, "useBreakpoints").mockReturnValue({
8
- isDesktop: !0,
9
- isMobile: !1,
10
- isTablet: !1,
11
- isDesktopNavbar: !1
12
- });
13
- const T = [];
14
- i("render GenericTable with custom no content text", () => {
15
- o(/* @__PURE__ */ a(s, { data: T, noContentText: "noContent" })), t(e.getByText("noContent")).toBeInTheDocument();
16
- }), i("render GenericTable with data should render headers", () => {
17
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }] })), t(e.getByText("id")).toBeInTheDocument(), t(e.getByText("name")).toBeInTheDocument();
18
- }), i("render GenericTable with hidden headers", () => {
19
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], hiddenColumns: ["name"] })), t(e.getByText("id")).toBeInTheDocument(), t(e.queryByText("name")).not.toBeInTheDocument();
20
- }), i("render GenericTable with custom header translation", () => {
21
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], headerTranslation: (d) => d + ".translated" })), t(e.getByText("id.translated")).toBeInTheDocument(), t(e.getByText("name.translated")).toBeInTheDocument();
22
- }), i("render GenericTable with custom cell template", () => {
23
- o(
24
- /* @__PURE__ */ a(
25
- s,
26
- {
27
- data: [{ id: 1, name: "test" }],
28
- cellTemplates: { id: (d) => /* @__PURE__ */ B("div", { children: [
29
- "label: ",
30
- d.row.original.id
31
- ] }) }
32
- }
33
- )
34
- ), t(e.getByText("label: 1")).toBeInTheDocument();
35
- }), i("render GenericTable with custom table actions", () => {
36
- const n = r.fn();
37
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], tableActions: [
38
- /* @__PURE__ */ a("button", { "data-testid": "testButton", onClick: n, children: "testbutton" }, "test")
39
- ] })), t(e.getByText("testbutton")).toBeInTheDocument(), e.getByTestId("testButton").click(), t(n).toHaveBeenCalled();
40
- }), i("render GenericTable with custom pagination", () => {
41
- o(/* @__PURE__ */ a(s, { data: [
42
- { id: 1, name: "test" },
43
- { id: 2, name: "test2" },
44
- { id: 3, name: "test3" }
45
- ], pagination: !0 })), t(e.getByText("1 - 3 of 3")).toBeInTheDocument(), t(e.getByText("last_page")).toBeInTheDocument();
46
- }), i("render GenericTable with custom getRowActions", () => {
47
- const n = [{ id: 1, name: "test" }], d = r.fn();
48
- o(/* @__PURE__ */ a(s, { data: n, getRowActions: (u) => [
49
- {
50
- primaryText: "primText",
51
- secondaryText: "secText",
52
- onClick: () => d(u.id),
53
- leadingBlock: "edit"
54
- }
55
- ] })), t(e.getByText("primText")).toBeInTheDocument(), e.getByText("primText").click(), t(d).toHaveBeenCalledWith(1);
56
- }), i("render GenericTable with custom order", () => {
57
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test", age: 20 }], order: ["name", "age"] }));
58
- const d = e.getByText("id"), l = e.getByText("name"), c = e.getByText("age");
59
- t(l).toBeInTheDocument(), t(c).toBeInTheDocument(), t(d).toBeInTheDocument(), t(l.compareDocumentPosition(c)).toBe(4), t(c.compareDocumentPosition(d)).toBe(4);
60
- }), i("render GenericTable with custom columnWidth in pixel", () => {
61
- o(
62
- /* @__PURE__ */ a(s, { data: [{ id: 1, name: "test", age: 20 }], customColumnWidth: { id: 200, name: 200, age: 200 } })
63
- );
64
- const l = e.getAllByRole("cell")[0].getAttribute("width");
65
- t(l).toBe("200");
66
- }), i("render GenericTable with custom columnWidth in percent", () => {
67
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], customColumnWidth: { id: "50%", name: "50%" } }));
68
- const l = e.getAllByRole("cell")[0].getAttribute("width");
69
- t(l).toBe("50%");
70
- }), i("render GenericTable with title", () => {
71
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], title: "test-title" })), t(e.getByText("test-title")).toBeInTheDocument();
72
- }), i("render GenericTable with title and table actions", () => {
73
- const n = r.fn();
74
- o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test" }], title: "test-title", tableActions: [
75
- /* @__PURE__ */ a("button", { "data-testid": "testButton", onClick: n, children: "test-button" }, "test")
76
- ] })), t(e.getByText("test-title")).toBeInTheDocument(), t(e.getByText("test-button")).toBeInTheDocument(), e.getByTestId("testButton").click(), t(n).toHaveBeenCalled();
77
- }), i("render GenericCardList instead of Table when not is desktop", () => {
78
- r.spyOn(m, "useBreakpoints").mockReturnValue({
79
- isDesktop: !1,
80
- isMobile: !0,
81
- isTablet: !1,
82
- isDesktopNavbar: !1
83
- }), o(/* @__PURE__ */ a(s, { data: [{ id: 1, name: "test", age: 20 }], title: "test-title", cardTitleColumn: "name" })), t(e.getAllByTestId("card-title")).toHaveLength(1), t(e.getAllByTestId("card-body")).toHaveLength(1), t(e.getAllByTestId("row")).toHaveLength(2);
84
- }), i("render GenericTable with OfflineView", () => {
85
- o(
86
- /* @__PURE__ */ a(
87
- s,
88
- {
89
- data: [{ id: 1, name: "test" }],
90
- noContentText: "noContent",
91
- isOnline: !1,
92
- offlineViewProps: { "data-testid": "offline-test" }
93
- }
94
- )
95
- ), t(e.getByTestId("offline-test")).toBeInTheDocument();
96
- }), i("shows OfflineView on mobile when offline", () => {
97
- r.spyOn(m, "useBreakpoints").mockReturnValue({
98
- isDesktop: !1,
99
- isMobile: !0,
100
- isTablet: !1,
101
- isDesktopNavbar: !1
102
- }), o(
103
- /* @__PURE__ */ a(
104
- s,
105
- {
106
- data: [{ id: 1, name: "test", age: 20 }],
107
- title: "test-title",
108
- cardTitleColumn: "name",
109
- isOnline: !1,
110
- offlineViewProps: { "data-testid": "offline-test" }
111
- }
112
- )
113
- ), t(e.getByTestId("offline-test")).toBeInTheDocument();
114
- });
115
- });
@@ -1,76 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as c, s as o } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { G as i } from "../../../GenericCard-IWX-Bmb_.js";
4
- import { d as m, t as s, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- m("GenericCard", () => {
6
- const d = {
7
- id: 1,
8
- name: "John Doe",
9
- age: 30,
10
- gender: "male",
11
- actions: /* @__PURE__ */ n("button", { children: "View" })
12
- }, l = [
13
- { id: "name", header: "Name", accessor: "name", asCardTitle: !0 },
14
- { id: "age", header: "Age", accessor: "age", asCardSubtitle: !0 },
15
- { id: "id", header: "Id", accessor: "id" },
16
- { id: "gender", header: "Gender", accessor: "gender" }
17
- ];
18
- s("renders card title with correct primary text", () => {
19
- c(/* @__PURE__ */ n(i, { item: d, columns: l }));
20
- const t = o.getByTestId("card-title");
21
- e(t).toHaveTextContent("John Doe");
22
- }), s("renders card title with correct secondary text", () => {
23
- c(/* @__PURE__ */ n(i, { item: d, columns: l }));
24
- const r = o.getByTestId("card-title").querySelector(".lmnt-card-title__secondaryText");
25
- e(r).toHaveTextContent("30");
26
- }), s("renders actions in trailing block", () => {
27
- c(/* @__PURE__ */ n(i, { item: d, columns: l }));
28
- const r = o.getByTestId("card-title").querySelector(".lmnt-card-title__trailingBlock");
29
- e(r).toContainHTML("<button>View</button>");
30
- }), s("renders card body with correct number of rows", () => {
31
- c(/* @__PURE__ */ n(i, { item: d, columns: l }));
32
- const t = o.getAllByTestId("row");
33
- e(t).toHaveLength(2);
34
- }), s("renders correct header and value in each row", () => {
35
- c(/* @__PURE__ */ n(i, { item: d, columns: l })), e(o.getByText("Id:")).toBeInTheDocument(), e(o.getByText("1")).toBeInTheDocument(), e(o.getByText("Gender:")).toBeInTheDocument(), e(o.getByText("male")).toBeInTheDocument();
36
- }), s("does not render title, subtitle or actions columns in body", () => {
37
- c(/* @__PURE__ */ n(i, { item: d, columns: l }));
38
- const t = o.getByTestId("card-body");
39
- e(t).not.toHaveTextContent("Name:"), e(t).not.toHaveTextContent("John Doe"), e(t).not.toHaveTextContent("Age:"), e(t).not.toHaveTextContent("30"), e(t).not.toContainHTML("<button>View</button>");
40
- }), s("renders cell template if provided", () => {
41
- const t = [
42
- ...l.filter((a) => a.id !== "name"),
43
- {
44
- id: "name",
45
- header: "Name",
46
- accessor: "name",
47
- asCardTitle: !0,
48
- cellTemplate: ({ row: a }) => /* @__PURE__ */ n("div", { children: a.original.name.toUpperCase() })
49
- }
50
- ];
51
- c(/* @__PURE__ */ n(i, { item: d, columns: t }));
52
- const r = o.getByTestId("card-title");
53
- e(r).toHaveTextContent("JOHN DOE");
54
- }), s("renders no title cells if no title/subtitle column is provided, render them in body instead", () => {
55
- c(/* @__PURE__ */ n(i, { item: d, columns: [
56
- { id: "name", header: "Name", accessor: "name" },
57
- { id: "age", header: "Age", accessor: "age" },
58
- { id: "id", header: "Id", accessor: "id" },
59
- { id: "gender", header: "Gender", accessor: "gender" }
60
- ] }));
61
- const r = o.queryByTestId("card-title");
62
- e(r).not.toHaveTextContent("John Doe"), e(r).not.toHaveTextContent("30");
63
- const a = o.getByTestId("card-body");
64
- e(a).toHaveTextContent("Name:"), e(a).toHaveTextContent("John Doe"), e(a).toHaveTextContent("Age:"), e(a).toHaveTextContent("30");
65
- }), s("renders no card title cells if no title/subtitle/action column is provided", () => {
66
- const t = [
67
- { id: "name", header: "Name", accessor: "name" },
68
- { id: "age", header: "Age", accessor: "age" },
69
- { id: "id", header: "Id", accessor: "id" },
70
- { id: "gender", header: "Gender", accessor: "gender" }
71
- ], r = { ...d, actions: void 0 };
72
- c(/* @__PURE__ */ n(i, { item: r, columns: t }));
73
- const a = o.queryByTestId("card-title");
74
- e(a).not.toBeInTheDocument();
75
- });
76
- });
@@ -1,75 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as r, s as o, w as l } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { GenericCardList as s } from "./GenericCardList.js";
4
- import { d as m, t as i, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- m("GenericCardList", () => {
6
- const d = [
7
- { id: "name", header: "Name", accessor: "name", asCardTitle: !0 },
8
- { id: "age", header: "Age", accessor: "age" },
9
- { id: "id", header: "Id", accessor: "id" },
10
- { id: "gender", header: "Gender", accessor: "gender" }
11
- ], c = [
12
- {
13
- id: 1,
14
- name: "John Doe",
15
- age: 30,
16
- gender: "male",
17
- actions: /* @__PURE__ */ n("button", { children: "View" })
18
- },
19
- {
20
- id: 2,
21
- name: "Jane Smith",
22
- age: 25,
23
- gender: "female",
24
- actions: /* @__PURE__ */ n("button", { children: "Edit" })
25
- }
26
- ];
27
- i("renders noContentText when data is empty", () => {
28
- r(
29
- /* @__PURE__ */ n(
30
- s,
31
- {
32
- columns: d,
33
- data: [],
34
- hiddenColumns: [],
35
- noContentText: "No data available"
36
- }
37
- )
38
- );
39
- const a = o.getByText("No data available");
40
- e(a).toBeInTheDocument();
41
- }), i("renders cards with correct data", () => {
42
- r(
43
- /* @__PURE__ */ n(
44
- s,
45
- {
46
- columns: d,
47
- data: c,
48
- hiddenColumns: [],
49
- noContentText: "No data available"
50
- }
51
- )
52
- );
53
- const a = o.getAllByTestId("card-title");
54
- e(a).toHaveLength(2), e(a[0]).toHaveTextContent("John Doe"), e(a[1]).toHaveTextContent("Jane Smith");
55
- const t = o.getAllByTestId("card-body");
56
- e(t).toHaveLength(2), e(t[0]).toHaveTextContent("Age:"), e(t[0]).toHaveTextContent("30"), e(t[1]).toHaveTextContent("Age:"), e(t[1]).toHaveTextContent("25");
57
- }), i("renders columns in correct order", () => {
58
- r(
59
- /* @__PURE__ */ n(
60
- s,
61
- {
62
- columns: d,
63
- data: [c[1]],
64
- hiddenColumns: [],
65
- noContentText: "No data available"
66
- }
67
- )
68
- ), l(() => {
69
- const a = o.getAllByTestId("card-body");
70
- e(a).toHaveLength(1);
71
- const t = o.getAllByTestId("row");
72
- e(t).toHaveLength(3), e(t[0]).toHaveTextContent("Gender:"), e(t[1]).toHaveTextContent("Age:"), e(t[1]).toHaveTextContent("Id:");
73
- });
74
- });
75
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,31 +0,0 @@
1
- import { jsx as n, Fragment as o } from "react/jsx-runtime";
2
- import { a, s as e, f as r } from "../../react.esm-Bm0cAgpZ.js";
3
- import { HashTabView as c } from "./HashTabView.js";
4
- import { d as h, t as l, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const m = [
6
- {
7
- title: "Map",
8
- hash: "map",
9
- leadingIcon: "map",
10
- trailingIcon: /* @__PURE__ */ n(o, { children: "TrIcon1" }),
11
- component: /* @__PURE__ */ n(o, { children: "My map component" })
12
- },
13
- {
14
- title: "Manually",
15
- hash: "manually",
16
- leadingIcon: "list_alt",
17
- trailingIcon: /* @__PURE__ */ n(o, { children: "TrIcon2" }),
18
- component: /* @__PURE__ */ n(o, { children: "My manually component" })
19
- }
20
- ];
21
- h("HashTabView test", () => {
22
- l("should render HashTabView with all given tabs, icons and the initial component", () => {
23
- a(/* @__PURE__ */ n(c, { tabs: m })), t(e.getByText(/Map/)).toBeInTheDocument(), t(e.getByText("map")).toBeInTheDocument(), t(e.getByText(/TrIcon1/)).toBeInTheDocument(), t(e.getByText(/Manually/)).toBeInTheDocument(), t(e.getByText("list_alt")).toBeInTheDocument(), t(e.getByText(/TrIcon2/)).toBeInTheDocument(), t(e.getByText("My map component")).toBeInTheDocument();
24
- }), l("should change to component on tab-click", () => {
25
- a(/* @__PURE__ */ n(c, { tabs: m }));
26
- const i = e.getByText(/Manually/);
27
- r.click(i), t(e.getByText("My manually component")).toBeInTheDocument();
28
- }), l("should render the correct tab according to hash in route", () => {
29
- a(/* @__PURE__ */ n(c, { tabs: m, hash: "#manually" })), t(e.getByText("My manually component")).toBeInTheDocument();
30
- });
31
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as i, s as t, f as T } from "../../react.esm-Bm0cAgpZ.js";
3
- import { HeaderFilter as s } from "./HeaderFilter.js";
4
- import { d as c, t as o, a as l, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- c("HeaderFilter-Test", () => {
6
- o("render header filter", () => {
7
- i(
8
- /* @__PURE__ */ n(s, { heading: "Test", setFilter: l.fn(), filterValue: "", filterOptions: [] })
9
- ), e(t.getByTestId("HeaderContainer")).toBeInTheDocument(), e(t.getByText("Test")).toBeInTheDocument(), e(t.queryByText("filterBy")).not.toBeInTheDocument();
10
- }), o("render header filter with filterBy text", () => {
11
- i(
12
- /* @__PURE__ */ n(
13
- s,
14
- {
15
- heading: "Test",
16
- filterByText: "filterBy",
17
- setFilter: l.fn(),
18
- filterValue: "",
19
- filterOptions: []
20
- }
21
- )
22
- ), e(t.getByTestId("HeaderContainer")).toBeInTheDocument(), e(t.getByText("Test")).toBeInTheDocument(), e(t.getByText("filterBy")).toBeInTheDocument();
23
- }), o("render header filter with select options", () => {
24
- const f = l.fn();
25
- i(
26
- /* @__PURE__ */ n(
27
- s,
28
- {
29
- heading: "Test",
30
- setFilter: f,
31
- filterValue: "",
32
- filterOptions: [
33
- { value: "test", label: "Test" },
34
- { value: "different", label: "Different" }
35
- ]
36
- }
37
- )
38
- );
39
- const a = t.getByTestId("HeaderContainer");
40
- e(a).toBeDefined(), e(a).toHaveTextContent("Test");
41
- const r = t.getByTestId("Select");
42
- e(r).toBeDefined();
43
- const d = r.closest(".lmnt-select");
44
- e(d).toBeDefined(), T.click(r);
45
- });
46
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,28 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Iconify as c } from "./Iconify.js";
3
- import { AvailableCustomIcons as l } from "../../enums/AvailableCustomIcons.js";
4
- import { a as r, w as s, s as i } from "../../react.esm-Bm0cAgpZ.js";
5
- import { d as f, t as a, g as o } from "../../vi.bdSIJ99Y-B308Q-4w.js";
6
- f("Iconify Test", async () => {
7
- const m = Object.keys(l).filter((e) => isNaN(Number(e)));
8
- a.each(m)("render available custom icon (%s)", async (e) => {
9
- r(/* @__PURE__ */ n(c, { icon: e })), await s(() => {
10
- const t = document.querySelector("svg");
11
- o(t).toBeDefined();
12
- const d = i.getByTestId(e);
13
- o(d).toBeInTheDocument();
14
- });
15
- }), a("render empty wrapper as fallback", async () => {
16
- r(/* @__PURE__ */ n(c, { icon: "" })), await s(() => {
17
- const e = document.querySelector("svg");
18
- o(e).toBeDefined(), o(e?.textContent).toBeUndefined();
19
- });
20
- }), a("render pure icon", async () => {
21
- r(/* @__PURE__ */ n(c, { icon: "farm", pure: !0 })), await s(() => {
22
- const e = document.querySelector("svg");
23
- o(e).toBeDefined();
24
- const t = i.getByTestId("farm");
25
- o(t).toBeInTheDocument(), o(e?.closest(".lmnt-icon")).toBeNull();
26
- });
27
- });
28
- });
@@ -1 +0,0 @@
1
- export {};