@hortiview/shared-components 2.18.0 → 2.19.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.
Files changed (229) hide show
  1. package/CHANGELOG.md +21 -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-Y8wR14Xq.js +126 -0
  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/assets/ListAreaService.css +1 -1
  9. package/dist/assets/LoadingSpinner.css +1 -1
  10. package/dist/component-By6nyiBU.js +70 -0
  11. package/dist/{component-DEJuY56h.js → component-DYpB_4EP.js} +1 -111
  12. package/dist/components/AlertBanner/AlertBanner.js +4 -4
  13. package/dist/components/AlertBanner/LinkBanner.js +3 -3
  14. package/dist/components/AllowedButton/AllowedButton.d.ts +1 -1
  15. package/dist/components/AllowedButton/AllowedButton.js +1 -1
  16. package/dist/components/AllowedIconButton/AllowedIconButton.d.ts +1 -1
  17. package/dist/components/AllowedIconButton/AllowedIconButton.js +1 -1
  18. package/dist/components/BaseView/BaseView.js +14 -14
  19. package/dist/components/BasicHeading/BasicHeading.js +5 -5
  20. package/dist/components/BlockView/BlockView.js +2 -2
  21. package/dist/components/ButtonCard/ButtonCard.js +6 -6
  22. package/dist/components/ChipCard/ChipCard.js +13 -255
  23. package/dist/components/ConfirmationModal/ConfirmationModal.js +8 -8
  24. package/dist/components/ContextMenu/ContextMenu.js +12 -12
  25. package/dist/components/DeleteModal/DeleteModal.js +25 -25
  26. package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
  27. package/dist/components/Disclaimer/Disclaimer.js +3 -3
  28. package/dist/components/EmptyView/EmptyView.d.ts +10 -1
  29. package/dist/components/EmptyView/EmptyView.js +50 -34
  30. package/dist/components/Filter/Filter.js +15 -15
  31. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
  32. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +7 -22
  33. package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
  34. package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
  35. package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
  36. package/dist/components/FormComponents/FormSelect/FormSelect.js +4 -4
  37. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
  38. package/dist/components/FormComponents/FormSlider/FormSlider.js +10 -98
  39. package/dist/components/FormComponents/FormText/FormText.js +2 -2
  40. package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
  41. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  42. package/dist/components/GenericTable/GenericTable.js +36 -172
  43. package/dist/components/GenericTable/GenericTableService.d.ts +4 -1
  44. package/dist/components/GenericTable/GenericTableService.js +24 -24
  45. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
  46. package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
  47. package/dist/components/HashTabView/HashTabView.js +10 -428
  48. package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
  49. package/dist/components/Iconify/Iconify.js +2 -2
  50. package/dist/components/InfoCard/InfoCard.js +4 -4
  51. package/dist/components/InfoGroup/InfoGroup.js +4 -4
  52. package/dist/components/ListArea/ListArea.d.ts +5 -1
  53. package/dist/components/ListArea/ListArea.js +39 -36
  54. package/dist/components/ListArea/ListAreaService.js +6 -6
  55. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +13 -5
  56. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +44 -108
  57. package/dist/components/Modal/Modal.js +12 -122
  58. package/dist/components/ModulePadding/ModulePadding.js +11 -11
  59. package/dist/components/OfflineView/OfflineView.js +45 -7
  60. package/dist/components/OnboardingBanner/OnboardingBanner.js +8 -8
  61. package/dist/components/OverflowTooltip/OverflowTooltip.js +2 -2
  62. package/dist/components/SearchBar/SearchBar.js +2 -2
  63. package/dist/components/Select/Select.js +2 -2
  64. package/dist/components/Stepper/Stepper.js +1 -1
  65. package/dist/components/Stepper/components/StepperButton.js +1 -1
  66. package/dist/components/Stepper/components/StepperHeader.js +3 -3
  67. package/dist/components/Stepper/components/StepperItem.js +2 -2
  68. package/dist/{correct-is-regexp-logic-Y0ToWEjF.js → correct-is-regexp-logic-BJ-OWRrn.js} +1 -1
  69. package/dist/{defineProperty-BTsGZ3c1.js → defineProperty-B7N9EBBI.js} +3 -3
  70. package/dist/{es.string.iterator-UszlTFwY.js → es.string.iterator-DBx2A42F.js} +2 -2
  71. package/dist/{find-CHg-_ooq.js → find-eU9ab_u7.js} +4 -4
  72. package/dist/{get-DxjPG00Z.js → get-BLvvbtML.js} +3 -3
  73. package/dist/get-CBFiuc3f.js +7 -0
  74. package/dist/hooks/useBreakpoints.js +37 -3
  75. package/dist/hooks/useHelperText.js +1 -1
  76. package/dist/{identity-BVIVr9qu.js → identity-B0bbReND.js} +4 -4
  77. package/dist/{index-BcGujPyk.js → index-Df2FYN-K.js} +5 -26
  78. package/dist/{index.es-B8p8KCdj.js → index.es-B19PQgzU.js} +4 -4
  79. package/dist/{index.es-BYcQTTL8.js → index.es-B9BUXRQn.js} +9 -339
  80. package/dist/{index.es-BPv5dCFQ.js → index.es-BOG3_7IM.js} +12 -12
  81. package/dist/{index.es-DGoBge9W.js → index.es-BOvO8moE.js} +4 -4
  82. package/dist/{index.es-BoUnovl_.js → index.es-BcnmoCEg.js} +8 -74
  83. package/dist/{index.es-C32E1Lcb.js → index.es-BwafUoK3.js} +82 -147
  84. package/dist/{index.es-B1h6DPYp.js → index.es-C27R5Xae.js} +2 -2
  85. package/dist/{index.es-nwjKmW7-.js → index.es-C2IOpX7R.js} +34 -111
  86. package/dist/{index.es-Da7ok-B-.js → index.es-C6I3L4U4.js} +2 -2
  87. package/dist/{index.es-BHvm4m-B.js → index.es-Cg57snrN.js} +19 -261
  88. package/dist/{index.es-DUTChZks.js → index.es-Ci3O23C_.js} +6 -72
  89. package/dist/{index.es-t87yNd9Y.js → index.es-CkB4776y.js} +6 -72
  90. package/dist/{index.es-CeQB6igi.js → index.es-Cr1PSTyq.js} +3 -3
  91. package/dist/{index.es--C-VLspF.js → index.es-D1iB_QlE.js} +8 -140
  92. package/dist/{index.es-Dgxrk6xW.js → index.es-DEBGoIKX.js} +2 -2
  93. package/dist/{index.es-CWyjqoEE.js → index.es-DHnCVuQ8.js} +7 -73
  94. package/dist/{index.es-Bo-d_yTV.js → index.es-DHoIQ8lu.js} +2 -2
  95. package/dist/{index.es-SjZ_-d7U.js → index.es-DUrjyxNI.js} +5 -5
  96. package/dist/{index.es-Cfv794DG.js → index.es-DdeCB7LW.js} +1 -1
  97. package/dist/{index.es-BanVdXEd.js → index.es-DgncYOqO.js} +2 -2
  98. package/dist/{index.es-DOnQ26kT.js → index.es-DhlgTSuU.js} +3 -3
  99. package/dist/{index.es-oxil0uFe.js → index.es-Z0aF-7Cn.js} +3 -6
  100. package/dist/{index.es-DmRhbgqK.js → index.es-l_3PNohs.js} +2 -68
  101. package/dist/{isArray-B457bpaW.js → isArray-Ce1Q96lU.js} +1 -1
  102. package/dist/isArray-olhCpv2e.js +7 -0
  103. package/dist/{isEmpty-BnfHn4bl.js → isEmpty-l2xQKl4x.js} +3 -3
  104. package/dist/{isString-DVA49FEo.js → isString-BNdV0Jpg.js} +3 -3
  105. package/dist/{isTypedArray-DziahYkI.js → isTypedArray-D39qzPYE.js} +2 -2
  106. package/dist/{keyboard-DiKJoabs.js → keyboard-DbG3oyPU.js} +3 -25
  107. package/dist/main.js +15 -15
  108. package/dist/{map-BprzXv4m.js → map-ZSVweMI1.js} +5 -5
  109. package/dist/{omit-CYY_mIYv.js → omit-BWQrFyQ-.js} +7 -7
  110. package/dist/{orderBy-DLBJlgdL.js → orderBy-Ce85KqD6.js} +7 -7
  111. package/dist/{parse-int-D-3oah_F.js → parse-int-CGpIXMGa.js} +2 -2
  112. package/dist/{react-number-format.es-DzkMiF8j.js → react-number-format.es-pczkQ4lQ.js} +0 -1
  113. package/dist/{react-tooltip.min-CVsI--2Y.js → react-tooltip.min-Dkz5ltCC.js} +1 -12
  114. package/dist/{react.esm-Bm0cAgpZ.js → react.esm-DF7i80eN.js} +2471 -2582
  115. package/dist/services/UtilService.js +9 -9
  116. package/dist/{slicedToArray-ByMQIs5x.js → slicedToArray-DC6VAZtW.js} +4 -4
  117. package/dist/test-utils.js +1 -1
  118. package/dist/{toString-B7FIT8FE.js → toString-D5bEU-DN.js} +1 -1
  119. package/dist/types/GenericTable.d.ts +3 -3
  120. package/dist/{uniqueId-BNVTeImh.js → uniqueId-CJo-XRQb.js} +2 -2
  121. package/dist/{util-DA21pZXj.js → util-CBo-ipCE.js} +0 -22
  122. package/package.json +2 -2
  123. package/dist/BigLoadingSpinner-DGj9_Z5J.js +0 -16
  124. package/dist/ListAreaService-Fsm3-gDM.js +0 -125
  125. package/dist/OfflineView-CIwV08EQ.js +0 -48
  126. package/dist/animationframe-BVKDmEXe.js +0 -54
  127. package/dist/component-Bz_dtX1r.js +0 -114
  128. package/dist/components/AlertBanner/AlertBanner.test.d.ts +0 -1
  129. package/dist/components/AlertBanner/AlertBanner.test.js +0 -34
  130. package/dist/components/AlertBanner/LinkBanner.test.d.ts +0 -1
  131. package/dist/components/AlertBanner/LinkBanner.test.js +0 -17
  132. package/dist/components/Allowed/Allowed.test.d.ts +0 -1
  133. package/dist/components/Allowed/Allowed.test.js +0 -49
  134. package/dist/components/AllowedButton/AllowedButton.test.d.ts +0 -1
  135. package/dist/components/AllowedButton/AllowedButton.test.js +0 -126
  136. package/dist/components/AllowedIconButton/AllowedIconButton.test.d.ts +0 -1
  137. package/dist/components/AllowedIconButton/AllowedIconButton.test.js +0 -121
  138. package/dist/components/BaseView/BaseView.test.d.ts +0 -1
  139. package/dist/components/BaseView/BaseView.test.js +0 -180
  140. package/dist/components/BasicHeading/BasicHeading.test.d.ts +0 -1
  141. package/dist/components/BasicHeading/BasicHeading.test.js +0 -36
  142. package/dist/components/BlockView/BlockView.test.d.ts +0 -1
  143. package/dist/components/BlockView/BlockView.test.js +0 -47
  144. package/dist/components/ButtonCard/ButtonCard.test.d.ts +0 -1
  145. package/dist/components/ButtonCard/ButtonCard.test.js +0 -92
  146. package/dist/components/ChipCard/ChipCard.test.d.ts +0 -1
  147. package/dist/components/ChipCard/ChipCard.test.js +0 -25
  148. package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +0 -1
  149. package/dist/components/ConfirmationModal/ConfirmationModal.test.js +0 -221
  150. package/dist/components/ContextMenu/ContextMenu.test.d.ts +0 -1
  151. package/dist/components/ContextMenu/ContextMenu.test.js +0 -96
  152. package/dist/components/DeleteModal/DeleteModal.test.d.ts +0 -1
  153. package/dist/components/DeleteModal/DeleteModal.test.js +0 -132
  154. package/dist/components/Disclaimer/Disclaimer.test.d.ts +0 -1
  155. package/dist/components/Disclaimer/Disclaimer.test.js +0 -13
  156. package/dist/components/EmptyView/EmptyView.test.d.ts +0 -1
  157. package/dist/components/EmptyView/EmptyView.test.js +0 -50
  158. package/dist/components/Filter/Filter.test.d.ts +0 -1
  159. package/dist/components/Filter/Filter.test.js +0 -166
  160. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +0 -1
  161. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +0 -56
  162. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +0 -1
  163. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +0 -56
  164. package/dist/components/FormComponents/FormNumber/FormNumber.test.d.ts +0 -1
  165. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +0 -51
  166. package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +0 -1
  167. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +0 -73
  168. package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +0 -1
  169. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +0 -226
  170. package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +0 -1
  171. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +0 -49
  172. package/dist/components/FormComponents/FormText/FormText.test.d.ts +0 -1
  173. package/dist/components/FormComponents/FormText/FormText.test.js +0 -113
  174. package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +0 -1
  175. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +0 -54
  176. package/dist/components/GenericTable/GenericTable.test.d.ts +0 -1
  177. package/dist/components/GenericTable/GenericTable.test.js +0 -115
  178. package/dist/components/GenericTable/Mobile/GenericCard.test.d.ts +0 -1
  179. package/dist/components/GenericTable/Mobile/GenericCard.test.js +0 -76
  180. package/dist/components/GenericTable/Mobile/GenericCardList.test.d.ts +0 -1
  181. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +0 -75
  182. package/dist/components/HashTabView/HashTabView.test.d.ts +0 -1
  183. package/dist/components/HashTabView/HashTabView.test.js +0 -31
  184. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +0 -1
  185. package/dist/components/HeaderFilter/HeaderFilter.test.js +0 -46
  186. package/dist/components/Iconify/Iconify.test.d.ts +0 -1
  187. package/dist/components/Iconify/Iconify.test.js +0 -28
  188. package/dist/components/InfoCard/InfoCard.test.d.ts +0 -1
  189. package/dist/components/InfoCard/InfoCard.test.js +0 -48
  190. package/dist/components/InfoGroup/InfoGroup.test.d.ts +0 -1
  191. package/dist/components/InfoGroup/InfoGroup.test.js +0 -40
  192. package/dist/components/ListArea/ListArea.test.d.ts +0 -1
  193. package/dist/components/ListArea/ListArea.test.js +0 -110
  194. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.d.ts +0 -1
  195. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +0 -15
  196. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.d.ts +0 -1
  197. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +0 -20
  198. package/dist/components/ModulePadding/ModulePadding.test.d.ts +0 -1
  199. package/dist/components/ModulePadding/ModulePadding.test.js +0 -22
  200. package/dist/components/OfflineView/OfflineView.test.d.ts +0 -1
  201. package/dist/components/OfflineView/OfflineView.test.js +0 -24
  202. package/dist/components/OnboardingBanner/OnboardingBanner.test.d.ts +0 -1
  203. package/dist/components/OnboardingBanner/OnboardingBanner.test.js +0 -72
  204. package/dist/components/OverflowTooltip/OverflowTooltip.test.d.ts +0 -1
  205. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +0 -37
  206. package/dist/components/PermissionChecks/PermissionService.test.d.ts +0 -1
  207. package/dist/components/PermissionChecks/PermissionService.test.js +0 -91
  208. package/dist/components/SafeForm/SafeForm.test.d.ts +0 -1
  209. package/dist/components/SafeForm/SafeForm.test.js +0 -91
  210. package/dist/components/Scrollbar/scrollbar.test.d.ts +0 -1
  211. package/dist/components/Scrollbar/scrollbar.test.js +0 -15
  212. package/dist/components/SearchBar/SearchBar.test.d.ts +0 -1
  213. package/dist/components/SearchBar/SearchBar.test.js +0 -23
  214. package/dist/components/Select/Select.test.d.ts +0 -1
  215. package/dist/components/Select/Select.test.js +0 -28
  216. package/dist/components/Stepper/Stepper.test.d.ts +0 -1
  217. package/dist/components/Stepper/Stepper.test.js +0 -342
  218. package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +0 -1
  219. package/dist/components/VerticalDivider/VerticalDivider.test.js +0 -15
  220. package/dist/get-D8IXqiys.js +0 -7
  221. package/dist/hooks/useBreakpoints.test.d.ts +0 -1
  222. package/dist/hooks/useBreakpoints.test.js +0 -11
  223. package/dist/index-BLPBqbdx.js +0 -11025
  224. package/dist/isArray-BjSPDQ4v.js +0 -7
  225. package/dist/magic-string.es-uPKorP4O.js +0 -663
  226. package/dist/services/services.test.d.ts +0 -1
  227. package/dist/services/services.test.js +0 -106
  228. package/dist/useBreakpoints-MzTZ0tCT.js +0 -45
  229. package/dist/vi.bdSIJ99Y-B308Q-4w.js +0 -11963
@@ -1,166 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { a, s as t, f as c, w as d } from "../../react.esm-Bm0cAgpZ.js";
3
- import { act as u } from "react";
4
- import { a as f } from "../../useBreakpoints-MzTZ0tCT.js";
5
- import { Filter as T } from "./Filter.js";
6
- import { a as m, b as s, d as y, t as B, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
7
- const o = m.fn();
8
- s(() => {
9
- o.mockClear(), m.spyOn(f, "useBreakpoints").mockReturnValue({
10
- isDesktop: !0,
11
- isMobile: !1,
12
- isTablet: !1,
13
- isDesktopNavbar: !1
14
- });
15
- });
16
- y("Filter", () => {
17
- const i = [
18
- {
19
- id: "1",
20
- title: "Filter 1",
21
- type: "select",
22
- icon: "farm",
23
- availableOptions: [
24
- { id: "1", text: "Option 1" },
25
- { id: "2", text: "Option 2" }
26
- ]
27
- },
28
- {
29
- id: "2",
30
- title: "Filter 2",
31
- type: "select",
32
- availableOptions: [
33
- { id: "3", text: "Option 3" },
34
- { id: "4", text: "Option 4" }
35
- ]
36
- },
37
- {
38
- id: "3",
39
- title: "Filter Toggle",
40
- type: "toggle"
41
- },
42
- {
43
- id: "4",
44
- title: "Filter Search",
45
- type: "search"
46
- }
47
- ], l = [
48
- { id: "1", filterValue: [{ id: "1", text: "Option 1" }], type: "select" },
49
- { id: "2", filterValue: [{ id: "3", text: "Option 3" }], type: "select" }
50
- ];
51
- B("should render filter", () => {
52
- a(
53
- /* @__PURE__ */ r(
54
- T,
55
- {
56
- filters: i,
57
- currentFilter: l,
58
- closeCallback: o,
59
- filterButtonText: "filterButtonText",
60
- filterModalTitle: "filterModalTitle",
61
- modalCancelButtonText: "modalCancelButtonText",
62
- modalConfirmButtonText: "modalConfirmButtonText",
63
- clearFilterText: "clearFilterText"
64
- }
65
- )
66
- ), e(t.getByText("filterButtonText")).toBeInTheDocument(), e(t.getByText("filterModalTitle")).toBeInTheDocument(), e(t.getByText("modalCancelButtonText")).toBeInTheDocument(), e(t.getByText("modalConfirmButtonText")).toBeInTheDocument(), e(t.getByText("clearFilterText")).toBeInTheDocument(), e(t.getByText("Filter 1")).toBeInTheDocument(), e(t.getByText("Filter 2")).toBeInTheDocument(), e(t.getByText("Option 1")).toBeInTheDocument(), e(t.getByText("Option 3")).toBeInTheDocument(), e(t.getByTestId("farm")).toBeInTheDocument(), e(t.getByText("Filter Toggle")).toBeInTheDocument(), e(t.getByTestId("search-bar-icon-button")).toBeInTheDocument(), e(t.getByTestId("search-bar-input")).toBeInTheDocument();
67
- const n = t.getByRole("button", { name: "modalConfirmButtonText" });
68
- c.click(n), u(() => {
69
- e(o).toHaveBeenCalledTimes(1), e(t.getByText("2")).toBeInTheDocument();
70
- });
71
- }), B("should clear filter", () => {
72
- a(
73
- /* @__PURE__ */ r(
74
- T,
75
- {
76
- filters: i,
77
- currentFilter: l,
78
- closeCallback: o,
79
- filterButtonText: "filterButtonText",
80
- filterModalTitle: "filterModalTitle",
81
- modalCancelButtonText: "modalCancelButtonText",
82
- modalConfirmButtonText: "modalConfirmButtonText",
83
- clearFilterText: "clearFilterText"
84
- }
85
- )
86
- );
87
- const n = t.getByText("clearFilterText");
88
- c.click(n);
89
- const x = t.getByRole("button", { name: "modalConfirmButtonText" });
90
- c.click(x), u(() => {
91
- e(o).toHaveBeenCalledTimes(1), e(t.queryByTestId("filter-badge")).not.toBeInTheDocument();
92
- });
93
- }), B("should close filter", () => {
94
- a(
95
- /* @__PURE__ */ r(
96
- T,
97
- {
98
- filters: i,
99
- currentFilter: l,
100
- closeCallback: o,
101
- filterButtonText: "filterButtonText",
102
- filterModalTitle: "filterModalTitle",
103
- modalCancelButtonText: "modalCancelButtonText",
104
- modalConfirmButtonText: "modalConfirmButtonText",
105
- clearFilterText: "clearFilterText"
106
- }
107
- )
108
- );
109
- const n = t.getByRole("button", { name: "modalCancelButtonText" });
110
- e(t.getByText("filterModalTitle")).toBeInTheDocument(), c.click(n), d(() => {
111
- e(t.queryByText("filterModalTitle")).not.toBeInTheDocument(), e(t.queryByText("modalCancelButtonText")).not.toBeInTheDocument(), e(t.queryByText("modalConfirmButtonText")).not.toBeInTheDocument(), e(t.queryByText("clearFilterText")).not.toBeInTheDocument();
112
- });
113
- }), B("should render as icon button ", () => {
114
- a(
115
- /* @__PURE__ */ r(
116
- T,
117
- {
118
- filters: i,
119
- currentFilter: l,
120
- closeCallback: o,
121
- filterButtonText: "filterButtonText",
122
- filterModalTitle: "filterModalTitle",
123
- modalCancelButtonText: "modalCancelButtonText",
124
- modalConfirmButtonText: "modalConfirmButtonText",
125
- clearFilterText: "clearFilterText",
126
- filterButtonAsIcon: !0
127
- }
128
- )
129
- ), e(t.queryByText("filterButtonText")).not.toBeInTheDocument(), e(t.getByText("filter_list_alt")).toBeInTheDocument(), e(t.getByText("filter_list_alt").tagName).toBe("I");
130
- }), B("should render filter without modal", () => {
131
- a(
132
- /* @__PURE__ */ r(
133
- T,
134
- {
135
- filters: i,
136
- currentFilter: l,
137
- closeCallback: o,
138
- filterButtonText: "filterButtonText",
139
- filterModalTitle: "filterModalTitle",
140
- modalCancelButtonText: "modalCancelButtonText",
141
- modalConfirmButtonText: "modalConfirmButtonText",
142
- clearFilterText: "clearFilterText",
143
- useModal: !1
144
- }
145
- )
146
- ), e(t.queryByText("filterButtonText")).not.toBeInTheDocument(), e(t.queryByText("clearFilterText")).not.toBeInTheDocument(), e(t.queryByText("modalCancelButtonText")).not.toBeInTheDocument(), e(t.queryByText("modalConfirmButtonText")).not.toBeInTheDocument(), e(t.queryByText("clearFilterText")).not.toBeInTheDocument(), e(t.getByTestId("farm")).toBeInTheDocument(), e(t.getByText("Filter 1")).toBeInTheDocument(), e(t.getByText("Filter 2")).toBeInTheDocument(), e(t.getByText("Option 1")).toBeInTheDocument(), e(t.getByText("Option 3")).toBeInTheDocument();
147
- }), B("should call closeCallback when confirm button is clicked", () => {
148
- a(
149
- /* @__PURE__ */ r(
150
- T,
151
- {
152
- filters: i,
153
- currentFilter: l,
154
- closeCallback: o,
155
- filterButtonText: "filterButtonText",
156
- filterModalTitle: "filterModalTitle",
157
- modalCancelButtonText: "modalCancelButtonText",
158
- modalConfirmButtonText: "modalConfirmButtonText",
159
- clearFilterText: "clearFilterText"
160
- }
161
- )
162
- );
163
- const n = t.getByRole("button", { name: "modalConfirmButtonText" });
164
- c.click(n), e(o).toHaveBeenCalledTimes(1), e(o).toHaveBeenCalledWith(l);
165
- });
166
- });
@@ -1,56 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { a as s, s as r, f as h } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormCheckBox as n } from "./FormCheckBox.js";
4
- import { a as e, d as m, t as c, g as o } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const l = 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: l
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
- m("FormCheckBox Test", () => {
43
- c("render FormCheckBox", () => {
44
- s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue" })), o(r.getByText("user.hasValue")).toBeInTheDocument(), o(r.getByRole("checkbox")).toBeInTheDocument();
45
- const t = document.querySelector('div[class*="invalid"]');
46
- o(t).toBeInTheDocument();
47
- }), c("render FormCheckBox click", () => {
48
- s(
49
- /* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue", onChange: l })
50
- );
51
- const t = r.getByRole("checkbox");
52
- h.click(t), o(l).toHaveBeenCalled();
53
- }), c("should render checkbox with correct data-testid", () => {
54
- s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue" })), o(r.getByTestId("checkbox-hasValue")).toBeInTheDocument();
55
- });
56
- });
@@ -1,56 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as r, f as m } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormDatePicker as c } from "./FormDatePicker.js";
4
- import { a as e, d as f, t as l, g as a } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const i = 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: i
13
- }
14
- }),
15
- useFormContext: () => ({
16
- control: {
17
- register: e.fn(),
18
- unregister: e.fn(),
19
- getFieldState: e.fn(),
20
- _names: {
21
- array: new Set("test"),
22
- mount: new Set("test"),
23
- unMount: new Set("test"),
24
- watch: new Set("test"),
25
- focus: "test",
26
- watchAll: !1
27
- },
28
- _subjects: {
29
- watch: e.fn(),
30
- array: e.fn(),
31
- state: e.fn()
32
- },
33
- _getWatch: e.fn(),
34
- _formValues: ["test"],
35
- _defaultValues: ["test"]
36
- },
37
- formState: { errors: {} },
38
- watch: () => "2024-08-07",
39
- getFieldState: e.fn().mockReturnValue({ invalid: !1 })
40
- })
41
- }));
42
- f("FormDatePicker Test", () => {
43
- l("render FormDatePicker", () => {
44
- s(
45
- /* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", closeLabel: "close", maxRangeYear: 0 })
46
- );
47
- const t = r.getByRole("textbox");
48
- a(t).toBeInTheDocument(), a(t).toBeInstanceOf(HTMLInputElement), a(r.getByText("user.date-of-birth")).toBeInTheDocument(), a(r.getByText("close")).toBeInTheDocument();
49
- }), l("change FormDatePicker value", () => {
50
- s(
51
- /* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", closeLabel: "close", maxRangeYear: 0 })
52
- );
53
- const t = r.getByRole("textbox"), o = /* @__PURE__ */ new Date();
54
- m.change(t, { target: { value: o } }), a(t.getAttribute("value")).toBe(o.toString());
55
- });
56
- });
@@ -1,51 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { a, s as n } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormNumber as s } from "./FormNumber.js";
4
- import { a as e, d as m, t as f, g as r } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const l = e.fn();
6
- e.mock("react-hook-form", () => ({
7
- ...e.importActual("react-hook-form"),
8
- Controller: ({
9
- render: t
10
- }) => t({
11
- field: {
12
- ref: void 0,
13
- onChange: l,
14
- value: 12345
15
- },
16
- formState: { defaultValue: { "de-DE": 234 } }
17
- }),
18
- useFormContext: () => ({
19
- watch: e.fn(),
20
- control: {
21
- register: e.fn(),
22
- unregister: e.fn(),
23
- getFieldState: e.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: e.fn(),
34
- array: e.fn(),
35
- state: e.fn()
36
- },
37
- _getWatch: e.fn(),
38
- _formValues: ["test"],
39
- _defaultValues: ["test"]
40
- },
41
- formState: { errors: {} },
42
- getFieldState: () => ({ invalid: !1 })
43
- })
44
- }));
45
- m("FormNumber Test", () => {
46
- f("render FormNumber with correct properties", () => {
47
- a(/* @__PURE__ */ o(s, { languageCode: "es-MX", propertyName: "es-MX" }));
48
- const t = n.getByRole("textbox");
49
- r(t).toBeInTheDocument(), r(t).toHaveAttribute("type", "text"), r(t).toHaveAttribute("inputmode", "decimal");
50
- });
51
- });
@@ -1,73 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as t, f as m } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { FormRadio as l } from "./FormRadio.js";
4
- import { a as e, d as c, t as i, g as o } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- const r = e.fn();
6
- e.mock("react-hook-form", () => ({
7
- ...e.importActual("react-hook-form"),
8
- Controller: ({
9
- render: a
10
- }) => a({
11
- field: {
12
- onChange: r
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: r
41
- })
42
- }));
43
- c("FormRadio Test", () => {
44
- i("render FormRadio", () => {
45
- s(
46
- /* @__PURE__ */ n(
47
- l,
48
- {
49
- propertyName: "hasValue",
50
- options: [
51
- { label: "option1", value: "1" },
52
- { label: "option2", value: "2" }
53
- ]
54
- }
55
- )
56
- ), o(t.getByText("option1")).toBeInTheDocument(), o(t.getByText("option2")).toBeInTheDocument(), o(t.getAllByRole("radio")).toHaveLength(2);
57
- }), i("render FormRadio click", () => {
58
- s(
59
- /* @__PURE__ */ n(
60
- l,
61
- {
62
- propertyName: "hasValue",
63
- options: [
64
- { label: "option1", value: "1" },
65
- { label: "option2", value: "2" }
66
- ]
67
- }
68
- )
69
- );
70
- const a = t.getAllByRole("radio");
71
- m.click(a[0]), o(r).toHaveBeenCalled();
72
- });
73
- });
@@ -1,226 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { a as s, s as t, f as B, w as f } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { u as y } from "../../../index-BLPBqbdx.js";
4
- import { FormSelect as c } from "./FormSelect.js";
5
- import { SelectTooltipText as d } from "./SelectTooltipText.js";
6
- import { a as m } from "../../../useBreakpoints-MzTZ0tCT.js";
7
- import { a as r, b as h, d as v, t as u, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
8
- const g = r.fn();
9
- r.mock("react-hook-form", () => ({
10
- ...r.importActual("react-hook-form"),
11
- Controller: ({
12
- render: l
13
- }) => l({
14
- field: {
15
- ref: void 0,
16
- onChange: g,
17
- value: "3"
18
- }
19
- }),
20
- useFormContext: () => ({
21
- control: {
22
- register: r.fn(),
23
- unregister: r.fn(),
24
- getFieldState: r.fn(),
25
- _names: {
26
- array: new Set("test"),
27
- mount: new Set("test"),
28
- unMount: new Set("test"),
29
- watch: new Set("test"),
30
- focus: "test",
31
- watchAll: !1
32
- },
33
- _subjects: {
34
- watch: r.fn(),
35
- array: r.fn(),
36
- state: r.fn()
37
- },
38
- _getWatch: r.fn(),
39
- _formValues: ["test"],
40
- _defaultValues: ["test"]
41
- },
42
- formState: { errors: {} },
43
- getFieldState: () => ({ invalid: !1 })
44
- })
45
- }));
46
- h(() => {
47
- r.spyOn(m, "useBreakpoints").mockReturnValue({
48
- isDesktop: !0,
49
- isMobile: !1,
50
- isTablet: !1,
51
- isDesktopNavbar: !1
52
- });
53
- });
54
- v("FormSelect Test", () => {
55
- const l = [
56
- { id: "1", value: "Germany", description: "" },
57
- { id: "2", value: "France", description: "" },
58
- { id: "3", value: "Afar", description: "" }
59
- ], p = [
60
- {
61
- groupValue: "Europe",
62
- groupName: "Europe",
63
- options: [
64
- { id: "1", value: "Germany", description: "" },
65
- { id: "2", value: "France", description: "" }
66
- ]
67
- },
68
- {
69
- groupValue: "Africa",
70
- groupName: "Africa",
71
- options: [{ id: "3", value: "Afar", description: "" }]
72
- }
73
- ];
74
- u("render FormSelect", () => {
75
- s(
76
- /* @__PURE__ */ a(
77
- c,
78
- {
79
- label: "address.country",
80
- rules: { required: { value: !0, message: "required" } },
81
- propertyName: "countryId",
82
- options: l,
83
- valueKey: "id",
84
- textKey: "value"
85
- }
86
- )
87
- );
88
- const o = t.getByRole("combobox");
89
- e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument();
90
- }), u("enables search by default when isDesktop is true", () => {
91
- r.spyOn(m, "useBreakpoints").mockReturnValue({
92
- isMobile: !1,
93
- isTablet: !1,
94
- isDesktop: !0,
95
- isDesktopNavbar: !1
96
- }), s(
97
- /* @__PURE__ */ a(
98
- c,
99
- {
100
- label: "address.country",
101
- propertyName: "countryId",
102
- options: l,
103
- valueKey: "id",
104
- textKey: "value"
105
- }
106
- )
107
- );
108
- const o = t.getByRole("combobox");
109
- e(o).not.toHaveAttribute("aria-readonly");
110
- }), u("searchable=false overrides isDesktop=true", async () => {
111
- const o = y.setup();
112
- r.spyOn(m, "useBreakpoints").mockReturnValue({
113
- isMobile: !1,
114
- isTablet: !1,
115
- isDesktop: !0,
116
- isDesktopNavbar: !1
117
- }), s(
118
- /* @__PURE__ */ a(
119
- c,
120
- {
121
- label: "address.country",
122
- propertyName: "countryId",
123
- options: l,
124
- valueKey: "id",
125
- textKey: "value",
126
- searchable: !1
127
- }
128
- )
129
- );
130
- const n = t.getByRole("combobox");
131
- e(n).toHaveAttribute("aria-readonly", "true"), await o.click(n), await o.type(n, "Ger"), e(n).toHaveValue("");
132
- }), u("cannot type when isDesktop=false and searchable is undefined", async () => {
133
- const o = y.setup();
134
- r.spyOn(m, "useBreakpoints").mockReturnValue({
135
- isMobile: !1,
136
- isTablet: !1,
137
- isDesktop: !1,
138
- isDesktopNavbar: !1
139
- }), s(
140
- /* @__PURE__ */ a(
141
- c,
142
- {
143
- label: "address.country",
144
- propertyName: "countryId",
145
- options: l,
146
- valueKey: "id",
147
- textKey: "value"
148
- }
149
- )
150
- );
151
- const n = t.getByRole("combobox");
152
- await o.click(n), await o.type(n, "Ger"), e(n).toHaveValue("");
153
- }), u("render grouped FormSelect and click on option", () => {
154
- s(
155
- /* @__PURE__ */ a(
156
- c,
157
- {
158
- label: "address.country",
159
- rules: { required: { value: !0, message: "required" } },
160
- propertyName: "countryId",
161
- options: p,
162
- valueKey: "id",
163
- textKey: "value"
164
- }
165
- )
166
- );
167
- const o = t.getByRole("combobox");
168
- e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(), B.mouseDown(o);
169
- const n = t.getByText("Africa");
170
- e(n).toBeInTheDocument(), e(n.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
171
- const i = t.getByText("Europe");
172
- e(i).toBeInTheDocument(), e(i.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
173
- const T = t.getByText("France");
174
- e(T).toBeInTheDocument(), e(T.parentElement?.parentElement).not.toBeInstanceOf(HTMLHeadingElement), e(t.getByText("Germany")).toBeInTheDocument(), e(t.getAllByText("Afar")).toHaveLength(2), B.click(T), e(g).toBeCalledWith("2");
175
- }), u("render grouped FormSelect and hover to see tooltip on fixedHeightInput", async () => {
176
- const o = y.setup();
177
- s(
178
- /* @__PURE__ */ a(
179
- c,
180
- {
181
- label: "address.country",
182
- rules: { required: { value: !0, message: "required" } },
183
- propertyName: "countryId",
184
- options: p,
185
- valueKey: "id",
186
- textKey: "value",
187
- fixedHeightInput: !0
188
- }
189
- )
190
- );
191
- const n = document.querySelector('div[data-tooltip-id="address.country"]');
192
- e(n).toBeInTheDocument();
193
- const i = t.getByRole("combobox");
194
- e(i).toBeInTheDocument(), e(i).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(), o.hover(t.getByText("Afar")), await f(() => {
195
- e(t.getByRole("tooltip")).toBeInTheDocument();
196
- });
197
- }), u("render grouped FormSelect and no tooltip on fixedHeightInput === false", async () => {
198
- const o = y.setup();
199
- s(
200
- /* @__PURE__ */ a(
201
- c,
202
- {
203
- label: "address.country",
204
- rules: { required: { value: !0, message: "required" } },
205
- propertyName: "countryId",
206
- options: p,
207
- valueKey: "id",
208
- textKey: "value",
209
- fixedHeightInput: !1
210
- }
211
- )
212
- );
213
- const n = document.querySelector('div[data-tooltip-id="address.country"]');
214
- e(n).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), o.hover(t.getByText("Afar")), await f(() => {
215
- e(t.queryByRole("tooltip")).not.toBeInTheDocument();
216
- });
217
- }), u("render ToolTipText", async () => {
218
- s(/* @__PURE__ */ a(d, { value: l[0], textKey: "value", valueKey: "id" })), e(t.getByText("Germany")).toBeInTheDocument();
219
- }), u("render ToolTipText with multiple entries", async () => {
220
- s(/* @__PURE__ */ a(d, { value: l, textKey: "value", valueKey: "id" })), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("France")).toBeInTheDocument(), e(t.getByText("Germany")).toBeInTheDocument();
221
- }), u("render ToolTipText with no entries", async () => {
222
- s(/* @__PURE__ */ a(d, { value: [], textKey: "value", valueKey: "id" })), e(t.queryByText("Afar")).not.toBeInTheDocument(), e(t.queryByText("France")).not.toBeInTheDocument(), e(t.queryByText("Germany")).not.toBeInTheDocument();
223
- }), u("render ToolTipText with no entries", async () => {
224
- s(/* @__PURE__ */ a(d, { value: void 0, textKey: "value", valueKey: "id" })), e(t.queryByText("Afar")).not.toBeInTheDocument(), e(t.queryByText("France")).not.toBeInTheDocument(), e(t.queryByText("Germany")).not.toBeInTheDocument();
225
- });
226
- });