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