@sqrzro/admin 2.0.0-beta.0 → 2.0.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 (344) hide show
  1. package/.turbo/turbo-docs.log +0 -0
  2. package/.turbo/turbo-lint.log +112 -0
  3. package/.turbo/turbo-prettier.log +215 -0
  4. package/.turbo/turbo-test.log +6 -0
  5. package/dist/components/Alert/index.d.ts +4 -26
  6. package/dist/components/Alert/index.js +15 -54
  7. package/dist/components/Allow/index.d.ts +20 -20
  8. package/dist/components/Allow/index.js +29 -29
  9. package/dist/components/AppLayout/AppLayout.stories.d.ts +5 -5
  10. package/dist/components/AppLayout/AppLayout.stories.js +11 -11
  11. package/dist/components/AppLayout/index.d.ts +6 -6
  12. package/dist/components/AppLayout/index.js +18 -11
  13. package/dist/components/AutoSuggest/index.d.ts +74 -74
  14. package/dist/components/AutoSuggest/index.js +143 -143
  15. package/dist/components/Button/Button.stories.d.ts +11 -11
  16. package/dist/components/Button/Button.stories.js +41 -41
  17. package/dist/components/Button/index.d.ts +49 -50
  18. package/dist/components/Button/index.js +50 -50
  19. package/dist/components/CalendarInput/index.d.ts +24 -24
  20. package/dist/components/CalendarInput/index.js +54 -56
  21. package/dist/components/CheckboxList/index.d.ts +17 -17
  22. package/dist/components/CheckboxList/index.js +25 -25
  23. package/dist/components/CodeInput/index.d.ts +9 -9
  24. package/dist/components/CodeInput/index.js +51 -57
  25. package/dist/components/ConnectedDropdown/index.d.ts +14 -14
  26. package/dist/components/ConnectedDropdown/index.js +36 -36
  27. package/dist/components/ConnectedList/index.d.ts +5 -5
  28. package/dist/components/ConnectedList/index.js +7 -7
  29. package/dist/components/ConnectedTable/index.d.ts +5 -5
  30. package/dist/components/ConnectedTable/index.js +7 -7
  31. package/dist/components/ContentBlock/index.d.ts +16 -16
  32. package/dist/components/ContentBlock/index.js +13 -13
  33. package/dist/components/DataPanel/index.d.ts +8 -8
  34. package/dist/components/DataPanel/index.js +8 -8
  35. package/dist/components/DateInput/index.d.ts +18 -18
  36. package/dist/components/DateInput/index.js +81 -81
  37. package/dist/components/Dropdown/index.d.ts +36 -36
  38. package/dist/components/Dropdown/index.js +122 -122
  39. package/dist/components/ErrorMessage/index.d.ts +16 -16
  40. package/dist/components/ErrorMessage/index.js +17 -17
  41. package/dist/components/Fieldset/index.d.ts +18 -18
  42. package/dist/components/Fieldset/index.js +19 -19
  43. package/dist/components/FileInput/index.d.ts +10 -10
  44. package/dist/components/FileInput/index.js +26 -26
  45. package/dist/components/FilterLink/index.d.ts +14 -14
  46. package/dist/components/FilterLink/index.js +15 -15
  47. package/dist/components/Form/index.d.ts +14 -14
  48. package/dist/components/Form/index.js +15 -15
  49. package/dist/components/FormActions/index.d.ts +18 -18
  50. package/dist/components/FormActions/index.js +14 -14
  51. package/dist/components/FormField/index.d.ts +14 -14
  52. package/dist/components/FormField/index.js +40 -40
  53. package/dist/components/FormRepeater/index.d.ts +18 -18
  54. package/dist/components/FormRepeater/index.js +65 -65
  55. package/dist/components/ImageInput/index.d.ts +13 -13
  56. package/dist/components/ImageInput/index.js +45 -45
  57. package/dist/components/InfoPanel/index.d.ts +14 -14
  58. package/dist/components/InfoPanel/index.js +11 -11
  59. package/dist/components/Link/__mocks__/index.d.ts +6 -6
  60. package/dist/components/Link/__mocks__/index.js +12 -12
  61. package/dist/components/Link/index.d.ts +23 -23
  62. package/dist/components/Link/index.js +21 -21
  63. package/dist/components/List/index.d.ts +36 -36
  64. package/dist/components/List/index.js +46 -46
  65. package/dist/components/ListActions/index.d.ts +18 -18
  66. package/dist/components/ListActions/index.js +14 -14
  67. package/dist/components/LoginForm/index.d.ts +3 -3
  68. package/dist/components/LoginForm/index.js +47 -47
  69. package/dist/components/Message/index.d.ts +14 -14
  70. package/dist/components/Message/index.js +14 -14
  71. package/dist/components/Modal/index.d.ts +4 -4
  72. package/dist/components/Modal/index.js +18 -18
  73. package/dist/components/ModalActions/index.d.ts +21 -21
  74. package/dist/components/ModalActions/index.js +18 -18
  75. package/dist/components/MoneyInput/index.d.ts +10 -10
  76. package/dist/components/MoneyInput/index.js +13 -13
  77. package/dist/components/PasswordForm/index.d.ts +35 -35
  78. package/dist/components/PasswordForm/index.js +21 -21
  79. package/dist/components/PasswordInput/index.d.ts +4 -4
  80. package/dist/components/PasswordInput/index.js +12 -12
  81. package/dist/components/RadioList/index.d.ts +9 -9
  82. package/dist/components/RadioList/index.js +7 -7
  83. package/dist/components/RootLayout/index.d.ts +6 -8
  84. package/dist/components/RootLayout/index.js +7 -21
  85. package/dist/components/SummaryList/index.d.ts +18 -18
  86. package/dist/components/SummaryList/index.js +15 -15
  87. package/dist/components/Switch/index.d.ts +21 -21
  88. package/dist/components/Switch/index.js +31 -31
  89. package/dist/components/Table/index.d.ts +28 -28
  90. package/dist/components/Table/index.js +55 -55
  91. package/dist/components/Tag/index.d.ts +15 -15
  92. package/dist/components/Tag/index.js +13 -13
  93. package/dist/components/TextArea/index.d.ts +18 -18
  94. package/dist/components/TextArea/index.js +26 -26
  95. package/dist/components/TextInput/index.d.ts +14 -14
  96. package/dist/components/TextInput/index.js +27 -27
  97. package/dist/components/WebsiteInput/index.d.ts +10 -10
  98. package/dist/components/WebsiteInput/index.js +13 -13
  99. package/dist/components/WeekCalendar/index.d.ts +24 -24
  100. package/dist/components/WeekCalendar/index.js +48 -48
  101. package/dist/core/AlertComponent/index.d.ts +26 -26
  102. package/dist/core/AlertComponent/index.js +35 -45
  103. package/dist/core/AppHeader/index.d.ts +3 -3
  104. package/dist/core/AppHeader/index.js +17 -17
  105. package/dist/core/AppLogo/index.d.ts +12 -12
  106. package/dist/core/AppLogo/index.js +16 -17
  107. package/dist/core/AppLogoImage/index.d.ts +3 -3
  108. package/dist/core/AppLogoImage/index.js +11 -11
  109. package/dist/core/AppLogoPlaceholder/index.d.ts +3 -3
  110. package/dist/core/AppLogoPlaceholder/index.js +10 -10
  111. package/dist/core/Assistive/index.d.ts +12 -12
  112. package/dist/core/Assistive/index.js +9 -9
  113. package/dist/core/AuthForm/index.d.ts +10 -10
  114. package/dist/core/AuthForm/index.js +13 -26
  115. package/dist/core/Banner/index.d.ts +3 -3
  116. package/dist/core/Banner/index.js +14 -14
  117. package/dist/core/Calendar/index.d.ts +21 -21
  118. package/dist/core/Calendar/index.js +69 -69
  119. package/dist/core/CalendarDay/index.d.ts +30 -30
  120. package/dist/core/CalendarDay/index.js +30 -30
  121. package/dist/core/CalendarMonth/index.d.ts +23 -23
  122. package/dist/core/CalendarMonth/index.js +45 -45
  123. package/dist/core/CalendarNavigation/index.d.ts +17 -17
  124. package/dist/core/CalendarNavigation/index.js +24 -24
  125. package/dist/core/CalendarWeek/index.d.ts +28 -28
  126. package/dist/core/CalendarWeek/index.js +46 -46
  127. package/dist/core/ChkRad/index.d.ts +26 -26
  128. package/dist/core/ChkRad/index.js +33 -33
  129. package/dist/core/ChkRadIcon/index.d.ts +14 -14
  130. package/dist/core/ChkRadIcon/index.js +12 -12
  131. package/dist/core/ChkRadList/index.d.ts +32 -32
  132. package/dist/core/ChkRadList/index.js +37 -37
  133. package/dist/core/CloseButton/index.d.ts +17 -17
  134. package/dist/core/CloseButton/index.js +12 -12
  135. package/dist/core/ConfirmModal/index.d.ts +3 -3
  136. package/dist/core/ConfirmModal/index.js +38 -38
  137. package/dist/core/ConnectedRepeater/index.d.ts +50 -50
  138. package/dist/core/ConnectedRepeater/index.js +154 -154
  139. package/dist/core/ConnectedRepeaterComponent/index.d.ts +24 -24
  140. package/dist/core/ConnectedRepeaterComponent/index.js +25 -25
  141. package/dist/core/Container/index.d.ts +14 -14
  142. package/dist/core/Container/index.js +12 -12
  143. package/dist/core/DataPanelItem/index.d.ts +8 -8
  144. package/dist/core/DataPanelItem/index.js +7 -7
  145. package/dist/core/DropdownPanel/index.d.ts +31 -31
  146. package/dist/core/DropdownPanel/index.js +32 -32
  147. package/dist/core/EmptyMessage/index.d.ts +21 -21
  148. package/dist/core/EmptyMessage/index.js +21 -21
  149. package/dist/core/FilterItem/index.d.ts +25 -25
  150. package/dist/core/FilterItem/index.js +82 -84
  151. package/dist/core/Filters/index.d.ts +31 -31
  152. package/dist/core/Filters/index.js +85 -85
  153. package/dist/core/FixedActions/index.d.ts +24 -24
  154. package/dist/core/FixedActions/index.js +22 -22
  155. package/dist/core/FormError/index.d.ts +12 -12
  156. package/dist/core/FormError/index.js +9 -9
  157. package/dist/core/FormLabel/index.d.ts +16 -16
  158. package/dist/core/FormLabel/index.js +13 -13
  159. package/dist/core/FormLegend/index.d.ts +12 -12
  160. package/dist/core/FormLegend/index.js +9 -9
  161. package/dist/core/Header/Header.stories.d.ts +5 -5
  162. package/dist/core/Header/Header.stories.js +11 -11
  163. package/dist/core/Header/index.d.ts +14 -14
  164. package/dist/core/Header/index.js +12 -12
  165. package/dist/core/Icon/index.d.ts +14 -14
  166. package/dist/core/Icon/index.js +32 -32
  167. package/dist/core/IconButton/index.d.ts +22 -22
  168. package/dist/core/IconButton/index.js +20 -20
  169. package/dist/core/InputPanel/index.d.ts +16 -16
  170. package/dist/core/InputPanel/index.js +11 -11
  171. package/dist/core/ListItem/index.d.ts +39 -39
  172. package/dist/core/ListItem/index.js +44 -44
  173. package/dist/core/ListItemAction/index.d.ts +11 -11
  174. package/dist/core/ListItemAction/index.js +13 -13
  175. package/dist/core/ListItemActions/index.d.ts +8 -8
  176. package/dist/core/ListItemActions/index.js +16 -16
  177. package/dist/core/ListItemMetaItem/index.d.ts +19 -19
  178. package/dist/core/ListItemMetaItem/index.js +29 -29
  179. package/dist/core/ListItemTitle/index.d.ts +19 -19
  180. package/dist/core/ListItemTitle/index.js +44 -44
  181. package/dist/core/Loader/index.d.ts +15 -15
  182. package/dist/core/Loader/index.js +16 -16
  183. package/dist/core/MeActions/index.d.ts +3 -3
  184. package/dist/core/MeActions/index.js +48 -48
  185. package/dist/core/MePanel/index.d.ts +19 -19
  186. package/dist/core/MePanel/index.js +29 -29
  187. package/dist/core/ModalComponent/index.d.ts +22 -22
  188. package/dist/core/ModalComponent/index.js +29 -29
  189. package/dist/core/Navigation/index.d.ts +3 -3
  190. package/dist/core/Navigation/index.js +33 -33
  191. package/dist/core/NavigationDivider/index.d.ts +3 -3
  192. package/dist/core/NavigationDivider/index.js +8 -8
  193. package/dist/core/NavigationItem/index.d.ts +16 -16
  194. package/dist/core/NavigationItem/index.js +21 -21
  195. package/dist/core/Pagination/index.d.ts +15 -15
  196. package/dist/core/Pagination/index.js +64 -64
  197. package/dist/core/PaginationItem/index.d.ts +10 -10
  198. package/dist/core/PaginationItem/index.js +17 -17
  199. package/dist/core/Panel/index.d.ts +17 -17
  200. package/dist/core/Panel/index.js +13 -16
  201. package/dist/core/PasswordForgotForm/index.d.ts +7 -7
  202. package/dist/core/PasswordForgotForm/index.js +40 -40
  203. package/dist/core/PasswordResetForm/index.d.ts +7 -7
  204. package/dist/core/PasswordResetForm/index.js +34 -34
  205. package/dist/core/RadialProgress/index.d.ts +16 -16
  206. package/dist/core/RadialProgress/index.js +23 -23
  207. package/dist/core/SettingsForm/index.d.ts +3 -3
  208. package/dist/core/SettingsForm/index.js +14 -14
  209. package/dist/core/StaticTextInput/index.d.ts +29 -29
  210. package/dist/core/StaticTextInput/index.js +39 -39
  211. package/dist/core/Styled/index.d.ts +6 -6
  212. package/dist/core/Styled/index.js +39 -39
  213. package/dist/core/SummaryListItem/index.d.ts +23 -23
  214. package/dist/core/SummaryListItem/index.js +31 -31
  215. package/dist/core/TabItem/index.d.ts +4 -4
  216. package/dist/core/TabItem/index.js +13 -13
  217. package/dist/core/TableActionsCell/index.d.ts +8 -8
  218. package/dist/core/TableActionsCell/index.js +8 -8
  219. package/dist/core/TableCell/index.d.ts +15 -15
  220. package/dist/core/TableCell/index.js +20 -20
  221. package/dist/core/TableHead/index.d.ts +18 -18
  222. package/dist/core/TableHead/index.js +18 -18
  223. package/dist/core/TableRow/index.d.ts +13 -13
  224. package/dist/core/TableRow/index.js +18 -18
  225. package/dist/core/Tabs/index.d.ts +7 -7
  226. package/dist/core/Tabs/index.js +13 -13
  227. package/dist/core/TextInputAncillary/index.d.ts +29 -29
  228. package/dist/core/TextInputAncillary/index.js +31 -31
  229. package/dist/core/Toast/index.d.ts +3 -3
  230. package/dist/core/Toast/index.js +47 -47
  231. package/dist/core/TwoFactor/index.d.ts +13 -13
  232. package/dist/core/TwoFactor/index.js +49 -49
  233. package/dist/core/TwoFactorAuthenticator/index.d.ts +10 -10
  234. package/dist/core/TwoFactorAuthenticator/index.js +9 -9
  235. package/dist/core/TwoFactorMethodList/index.d.ts +10 -10
  236. package/dist/core/TwoFactorMethodList/index.js +22 -22
  237. package/dist/core/TwoFactorSetup/index.d.ts +12 -12
  238. package/dist/core/TwoFactorSetup/index.js +43 -43
  239. package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +20 -20
  240. package/dist/core/TwoFactorSetupAuthenticator/index.js +42 -42
  241. package/dist/core/TwoFactorSetupYubikey/index.d.ts +16 -16
  242. package/dist/core/TwoFactorSetupYubikey/index.js +14 -14
  243. package/dist/core/TwoFactorYubikey/index.d.ts +9 -9
  244. package/dist/core/TwoFactorYubikey/index.js +14 -14
  245. package/dist/core/WeekCalendarDay/index.d.ts +27 -27
  246. package/dist/core/WeekCalendarDay/index.js +35 -35
  247. package/dist/core/YubikeyInput/index.d.ts +4 -4
  248. package/dist/core/YubikeyInput/index.js +14 -39
  249. package/dist/filters/BooleanFilter/index.d.ts +14 -14
  250. package/dist/filters/BooleanFilter/index.js +35 -35
  251. package/dist/filters/DateFilter/index.d.ts +5 -5
  252. package/dist/filters/DateFilter/index.js +24 -24
  253. package/dist/filters/DropdownFilter/index.d.ts +17 -17
  254. package/dist/filters/DropdownFilter/index.js +32 -32
  255. package/dist/filters/QuickDateFilter/index.d.ts +13 -13
  256. package/dist/filters/QuickDateFilter/index.js +40 -40
  257. package/dist/filters/interfaces.d.ts +35 -35
  258. package/dist/filters/interfaces.js +1 -1
  259. package/dist/hooks/useAlert.d.ts +12 -12
  260. package/dist/hooks/useAlert.js +18 -18
  261. package/dist/hooks/useAppConfig.d.ts +3 -0
  262. package/dist/hooks/useAppConfig.js +5 -0
  263. package/dist/hooks/useConnectedList.d.ts +7 -7
  264. package/dist/hooks/useConnectedList.js +6 -6
  265. package/dist/hooks/useConnectedRepeater.d.ts +7 -7
  266. package/dist/hooks/useConnectedRepeater.js +14 -14
  267. package/dist/hooks/useConnectedTable.d.ts +7 -7
  268. package/dist/hooks/useConnectedTable.js +6 -6
  269. package/dist/hooks/useFilters.d.ts +9 -9
  270. package/dist/hooks/useFilters.js +24 -24
  271. package/dist/hooks/useLayout.d.ts +7 -7
  272. package/dist/hooks/useLayout.js +10 -10
  273. package/dist/hooks/useLayout.spec.d.ts +1 -1
  274. package/dist/hooks/useLayout.spec.js +24 -24
  275. package/dist/hooks/useModal.d.ts +12 -12
  276. package/dist/hooks/useModal.js +39 -39
  277. package/dist/hooks/useModalOffset.d.ts +2 -2
  278. package/dist/hooks/useModalOffset.js +16 -16
  279. package/dist/hooks/useModalOffset.spec.d.ts +1 -1
  280. package/dist/hooks/useModalOffset.spec.js +19 -19
  281. package/dist/hooks/useNavigation.d.ts +7 -7
  282. package/dist/hooks/useNavigation.js +113 -113
  283. package/dist/hooks/useRemote.d.ts +7 -7
  284. package/dist/hooks/useRemote.js +29 -29
  285. package/dist/hooks/useVariant.d.ts +9 -9
  286. package/dist/hooks/useVariant.js +14 -14
  287. package/dist/index.d.ts +209 -208
  288. package/dist/index.js +213 -212
  289. package/dist/scenes/Error404Scene.d.ts +3 -3
  290. package/dist/scenes/Error404Scene.js +5 -5
  291. package/dist/services/AppService.d.ts +5 -5
  292. package/dist/services/AppService.js +11 -11
  293. package/dist/services/ConfigService.d.ts +42 -42
  294. package/dist/services/ConfigService.js +52 -55
  295. package/dist/services/ConfirmService.d.ts +12 -12
  296. package/dist/services/ConfirmService.js +10 -10
  297. package/dist/services/DateService.d.ts +26 -26
  298. package/dist/services/DateService.js +132 -132
  299. package/dist/services/DateService.spec.d.ts +1 -1
  300. package/dist/services/DateService.spec.js +83 -83
  301. package/dist/services/DownloadService.d.ts +7 -7
  302. package/dist/services/DownloadService.js +16 -16
  303. package/dist/services/DownloadService.spec.d.ts +1 -1
  304. package/dist/services/DownloadService.spec.js +18 -18
  305. package/dist/services/FilterComponentService.d.ts +25 -25
  306. package/dist/services/FilterComponentService.js +54 -54
  307. package/dist/services/FilterService.d.ts +34 -34
  308. package/dist/services/FilterService.js +58 -58
  309. package/dist/services/FilterService.spec.d.ts +1 -1
  310. package/dist/services/FilterService.spec.js +67 -67
  311. package/dist/services/FormatService.d.ts +11 -11
  312. package/dist/services/FormatService.js +45 -45
  313. package/dist/services/FormatService.spec.d.ts +1 -1
  314. package/dist/services/FormatService.spec.js +66 -66
  315. package/dist/services/ToastService.d.ts +7 -7
  316. package/dist/services/ToastService.js +17 -17
  317. package/dist/services/ToastService.spec.d.ts +1 -1
  318. package/dist/services/ToastService.spec.js +34 -34
  319. package/dist/styles.css +125 -67
  320. package/dist/utility/MockRouter/index.d.ts +2 -2
  321. package/dist/utility/MockRouter/index.js +37 -37
  322. package/dist/utility/StorybookPanel/index.d.ts +14 -14
  323. package/dist/utility/StorybookPanel/index.js +12 -12
  324. package/dist/utility/TestChangeHandler/index.d.ts +15 -15
  325. package/dist/utility/TestChangeHandler/index.js +30 -30
  326. package/dist/utility/icons.d.ts +3 -3
  327. package/dist/utility/icons.js +12 -12
  328. package/dist/utility/interfaces.d.ts +79 -80
  329. package/dist/utility/interfaces.js +18 -18
  330. package/dist/utility/middleware.d.ts +4 -4
  331. package/dist/utility/middleware.js +9 -4
  332. package/dist/utility/prop-types.d.ts +57 -57
  333. package/dist/utility/prop-types.js +77 -77
  334. package/dist/utility/register.d.ts +3 -3
  335. package/dist/utility/register.js +9 -7
  336. package/package.json +5 -5
  337. package/src/components/LoginForm/index.tsx +1 -1
  338. package/src/core/TwoFactor/TwoFactor.spec.tsx +4 -4
  339. package/src/core/TwoFactor/index.tsx +5 -5
  340. package/src/core/TwoFactorAuthenticator/index.tsx +1 -1
  341. package/src/core/TwoFactorSetup/index.tsx +1 -1
  342. package/src/core/TwoFactorYubikey/index.tsx +1 -1
  343. package/dist/hooks/useConfig.d.ts +0 -9
  344. package/dist/hooks/useConfig.js +0 -13
@@ -1,50 +1,50 @@
1
- 'use client';
2
- import React from 'react';
3
- import clsx from 'clsx';
4
- import PropTypes from 'prop-types';
5
- import Link from '../Link';
6
- import Loader from '../../core/Loader';
7
- import useVariant from '../../hooks/useVariant';
8
- import { ButtonVariantPropType } from '../../utility/prop-types';
9
- /**
10
- * Either a `Link` component or a `button` element, depending on whether a `to` prop is specified.
11
- *
12
- * As a `Link`, it provides navigation between pages, and as a `button` it will handle the
13
- * `onClick` function when clicked (if one is specified).
14
- *
15
- * ## to & onClick
16
- *
17
- * Although it is possible to omit both the `to` and `onClick` props, there will
18
- * be nearly zero situations where this would be useful. It is also possible to include both props.
19
- * This will create a `Link` component, and handle the `onClick` function before navigation.
20
- *
21
- * ## Styles
22
- *
23
- * The `Button` will stretch to the full width of its parent element. If you wish to have a smaller
24
- * width, you can wrap it in a `div`, and then wrap that `div` in a component with a flex property.
25
- * Components like `ListActions` and `ModalActions` do this for you.
26
- */
27
- function Button({ to, children, type, variant, isDisabled, isFullWidth, isLoading, onClick, value, }) {
28
- const { applyVariantClassName } = useVariant(variant);
29
- const className = clsx('text-white bg-blue-500 focus:ring-4 focus:outline-none focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-md text-sm px-5 py-2.5 text-center mr-2 mb-2', {
30
- 'opacity-30 pointer-events-none': isDisabled || isLoading,
31
- 'w-full': isFullWidth,
32
- }, applyVariantClassName({ danger: 'bg-red-900' }));
33
- if (to) {
34
- return (React.createElement(Link, { className: className, onClick: onClick, to: to }, children));
35
- }
36
- return (React.createElement("button", { className: className, disabled: isDisabled || isLoading || false, onClick: onClick, type: type === 'submit' ? 'submit' : 'button', value: value },
37
- isLoading ? (React.createElement("div", { className: "absolute left-1/2 top-1/2 -translate-x-2/4 -translate-y-2/4" },
38
- React.createElement(Loader, { isMini: true }))) : null,
39
- children));
40
- }
41
- Button.propTypes = {
42
- children: PropTypes.node.isRequired,
43
- isDisabled: PropTypes.bool,
44
- isFullWidth: PropTypes.bool,
45
- to: PropTypes.string,
46
- type: PropTypes.oneOf(['button', 'submit']),
47
- variant: ButtonVariantPropType,
48
- onClick: PropTypes.func,
49
- };
50
- export default Button;
1
+ 'use client';
2
+ import React from 'react';
3
+ import clsx from 'clsx';
4
+ import PropTypes from 'prop-types';
5
+ import Link from '../../components/Link';
6
+ import Loader from '../../core/Loader';
7
+ import useVariant from '../../hooks/useVariant';
8
+ import { ButtonVariantPropType } from '../../utility/prop-types';
9
+ /**
10
+ * Either a `Link` component or a `button` element, depending on whether a `to` prop is specified.
11
+ *
12
+ * As a `Link`, it provides navigation between pages, and as a `button` it will handle the
13
+ * `onClick` function when clicked (if one is specified).
14
+ *
15
+ * ## to & onClick
16
+ *
17
+ * Although it is possible to omit both the `to` and `onClick` props, there will
18
+ * be nearly zero situations where this would be useful. It is also possible to include both props.
19
+ * This will create a `Link` component, and handle the `onClick` function before navigation.
20
+ *
21
+ * ## Styles
22
+ *
23
+ * The `Button` will stretch to the full width of its parent element. If you wish to have a smaller
24
+ * width, you can wrap it in a `div`, and then wrap that `div` in a component with a flex property.
25
+ * Components like `ListActions` and `ModalActions` do this for you.
26
+ */
27
+ function Button({ to, children, type, variant, isDisabled, isFullWidth, isLoading, onClick, }) {
28
+ const { applyVariantClassName } = useVariant(variant);
29
+ const className = clsx('text-white bg-blue-500 focus:ring-4 focus:outline-none focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-md text-sm px-5 py-2.5 text-center mr-2 mb-2', {
30
+ 'opacity-30 pointer-events-none': isDisabled || isLoading,
31
+ 'w-full': isFullWidth,
32
+ }, applyVariantClassName({ danger: 'bg-red-900' }));
33
+ if (to) {
34
+ return (React.createElement(Link, { className: className, onClick: onClick, to: to }, children));
35
+ }
36
+ return (React.createElement("button", { className: className, disabled: isDisabled || isLoading || false, onClick: onClick, type: type === 'submit' ? 'submit' : 'button' },
37
+ isLoading ? (React.createElement("div", { className: "absolute left-1/2 top-1/2 -translate-x-2/4 -translate-y-2/4" },
38
+ React.createElement(Loader, { isMini: true }))) : null,
39
+ children));
40
+ }
41
+ Button.propTypes = {
42
+ children: PropTypes.node.isRequired,
43
+ isDisabled: PropTypes.bool,
44
+ isFullWidth: PropTypes.bool,
45
+ to: PropTypes.string,
46
+ type: PropTypes.oneOf(['button', 'submit']),
47
+ variant: ButtonVariantPropType,
48
+ onClick: PropTypes.func,
49
+ };
50
+ export default Button;
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { InputProps } from '../../utility/interfaces';
4
- export interface CalendarInputProps extends InputProps<string> {
5
- disabledDates?: string[] | ((date: string) => boolean);
6
- isOptional?: boolean;
7
- isPanelOnly?: boolean;
8
- isRange?: boolean;
9
- }
10
- declare function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }: CalendarInputProps): React.ReactElement;
11
- declare namespace CalendarInput {
12
- var propTypes: {
13
- name: PropTypes.Validator<string>;
14
- disabledDates: PropTypes.Requireable<NonNullable<string[] | ((...args: any[]) => any) | null | undefined>>;
15
- hasError: PropTypes.Requireable<boolean>;
16
- isDisabled: PropTypes.Requireable<boolean>;
17
- isOptional: PropTypes.Requireable<boolean>;
18
- isPanelOnly: PropTypes.Requireable<boolean>;
19
- isRange: PropTypes.Requireable<boolean>;
20
- value: PropTypes.Requireable<string>;
21
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
22
- };
23
- }
24
- export default CalendarInput;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { InputProps } from '../../utility/interfaces';
4
+ export interface CalendarInputProps extends InputProps<string> {
5
+ disabledDates?: string[] | ((date: string) => boolean);
6
+ isOptional?: boolean;
7
+ isPanelOnly?: boolean;
8
+ isRange?: boolean;
9
+ }
10
+ declare function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }: CalendarInputProps): React.ReactElement;
11
+ declare namespace CalendarInput {
12
+ var propTypes: {
13
+ name: PropTypes.Validator<string>;
14
+ disabledDates: PropTypes.Requireable<NonNullable<string[] | ((...args: any[]) => any) | null | undefined>>;
15
+ hasError: PropTypes.Requireable<boolean>;
16
+ isDisabled: PropTypes.Requireable<boolean>;
17
+ isOptional: PropTypes.Requireable<boolean>;
18
+ isPanelOnly: PropTypes.Requireable<boolean>;
19
+ isRange: PropTypes.Requireable<boolean>;
20
+ value: PropTypes.Requireable<string>;
21
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
22
+ };
23
+ }
24
+ export default CalendarInput;
@@ -1,56 +1,54 @@
1
- 'use client';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import FormatService from '../../services/FormatService';
5
- import Calendar from '../../core/Calendar';
6
- import InputPanel from '../../core/InputPanel';
7
- import StaticTextInput from '../../core/StaticTextInput';
8
- import { useClickOutside } from '@sqrzro/hooks';
9
- function formatLabel(value, isRange) {
10
- if (!value || typeof value !== 'string') {
11
- return '';
12
- }
13
- if (!isRange) {
14
- return FormatService.date(value);
15
- }
16
- const splitValues = value.split(',');
17
- if (splitValues[0] === splitValues[1]) {
18
- return FormatService.date(splitValues[0]);
19
- }
20
- return splitValues.map((item) => FormatService.date(item)).join(' - ');
21
- }
22
- function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }) {
23
- const [isOpen, setIsOpen, node] = useClickOutside();
24
- function toggleIsOpen() {
25
- setIsOpen(!isOpen);
26
- }
27
- function handleChange(event) {
28
- if (onChange) {
29
- onChange(event);
30
- }
31
- setIsOpen(false);
32
- }
33
- const label = formatLabel(value, isRange);
34
- if (isPanelOnly) {
35
- return (React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }));
36
- }
37
- return (React.createElement("div", { ref: node, className: "/*clsx(styles.root, isOpen && styles.rootIsOpen)*/" },
38
- React.createElement(StaticTextInput, { hasError: hasError, icon: "calendar", isDisabled: isDisabled, isOptional: isOptional, label: label, name: name, onChange: handleChange, onClick: toggleIsOpen, value: value || '' }),
39
- isOpen && !isDisabled ? (React.createElement(InputPanel, null,
40
- React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }))) : null));
41
- }
42
- CalendarInput.propTypes = {
43
- name: PropTypes.string.isRequired,
44
- disabledDates: PropTypes.oneOfType([
45
- PropTypes.arrayOf(PropTypes.string.isRequired),
46
- PropTypes.func,
47
- ]),
48
- hasError: PropTypes.bool,
49
- isDisabled: PropTypes.bool,
50
- isOptional: PropTypes.bool,
51
- isPanelOnly: PropTypes.bool,
52
- isRange: PropTypes.bool,
53
- value: PropTypes.string,
54
- onChange: PropTypes.func,
55
- };
56
- export default CalendarInput;
1
+ 'use client';
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import FormatService from '../../services/FormatService';
5
+ import Calendar from '../../core/Calendar';
6
+ import InputPanel from '../../core/InputPanel';
7
+ import StaticTextInput from '../../core/StaticTextInput';
8
+ import { useClickOutside } from '@sqrzro/hooks';
9
+ const formatLabel = (value, isRange) => {
10
+ if (!value || typeof value !== 'string') {
11
+ return '';
12
+ }
13
+ if (!isRange) {
14
+ return FormatService.date(value);
15
+ }
16
+ const splitValues = value.split(',');
17
+ if (splitValues[0] === splitValues[1]) {
18
+ return FormatService.date(splitValues[0]);
19
+ }
20
+ return splitValues.map((item) => FormatService.date(item)).join(' - ');
21
+ };
22
+ function CalendarInput({ disabledDates, hasError, isDisabled, isOptional, isPanelOnly, isRange, name, value, onChange, }) {
23
+ const [isOpen, setIsOpen, node] = useClickOutside();
24
+ const toggleIsOpen = () => setIsOpen(!isOpen);
25
+ const handleChange = (event) => {
26
+ if (onChange) {
27
+ onChange(event);
28
+ }
29
+ setIsOpen(false);
30
+ };
31
+ const label = formatLabel(value, isRange);
32
+ if (isPanelOnly) {
33
+ return (React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }));
34
+ }
35
+ return (React.createElement("div", { ref: node, className: "/*clsx(styles.root, isOpen && styles.rootIsOpen)*/" },
36
+ React.createElement(StaticTextInput, { hasError: hasError, icon: "calendar", isDisabled: isDisabled, isOptional: isOptional, label: label, name: name, onChange: handleChange, onClick: toggleIsOpen, value: value || '' }),
37
+ isOpen && !isDisabled ? (React.createElement(InputPanel, null,
38
+ React.createElement(Calendar, { disabledDates: disabledDates, isRange: isRange, name: name, onChange: handleChange, value: value || '' }))) : null));
39
+ }
40
+ CalendarInput.propTypes = {
41
+ name: PropTypes.string.isRequired,
42
+ disabledDates: PropTypes.oneOfType([
43
+ PropTypes.arrayOf(PropTypes.string.isRequired),
44
+ PropTypes.func,
45
+ ]),
46
+ hasError: PropTypes.bool,
47
+ isDisabled: PropTypes.bool,
48
+ isOptional: PropTypes.bool,
49
+ isPanelOnly: PropTypes.bool,
50
+ isRange: PropTypes.bool,
51
+ value: PropTypes.string,
52
+ onChange: PropTypes.func,
53
+ };
54
+ export default CalendarInput;
@@ -1,17 +1,17 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { ChkRadDataItem } from '../../core/ChkRadList';
4
- import type { InputProps } from '../../utility/interfaces';
5
- interface CheckboxListProps extends InputProps<string[]> {
6
- columns?: number;
7
- data: ChkRadDataItem[];
8
- }
9
- declare function CheckboxList({ name, onChange, value, ...props }: CheckboxListProps): React.ReactElement;
10
- declare namespace CheckboxList {
11
- var propTypes: {
12
- name: PropTypes.Validator<string>;
13
- value: PropTypes.Requireable<string[]>;
14
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
- };
16
- }
17
- export default CheckboxList;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { ChkRadDataItem } from '../../core/ChkRadList';
4
+ import type { InputProps } from '../../utility/interfaces';
5
+ interface CheckboxListProps extends InputProps<string[]> {
6
+ columns?: number;
7
+ data: ChkRadDataItem[];
8
+ }
9
+ declare function CheckboxList({ name, onChange, value, ...props }: CheckboxListProps): React.ReactElement;
10
+ declare namespace CheckboxList {
11
+ var propTypes: {
12
+ name: PropTypes.Validator<string>;
13
+ value: PropTypes.Requireable<string[]>;
14
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
+ };
16
+ }
17
+ export default CheckboxList;
@@ -1,25 +1,25 @@
1
- 'use client';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import { toggleArrayItem } from '@sqrzro/utility';
5
- import ChkRadList from '../../core/ChkRadList';
6
- function CheckboxList({ name, onChange, value, ...props }) {
7
- function handleChange(event) {
8
- if (!onChange) {
9
- return;
10
- }
11
- const newArray = toggleArrayItem(value || [], event.target.value);
12
- const simpleEvent = {
13
- item: event.item,
14
- target: { name, value: newArray },
15
- };
16
- onChange(simpleEvent);
17
- }
18
- return (React.createElement(ChkRadList, { ...props, name: `${name}[]`, onChange: handleChange, type: "checkbox", value: value }));
19
- }
20
- CheckboxList.propTypes = {
21
- name: PropTypes.string.isRequired,
22
- value: PropTypes.arrayOf(PropTypes.string.isRequired),
23
- onChange: PropTypes.func,
24
- };
25
- export default CheckboxList;
1
+ 'use client';
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { toggleArrayItem } from '@sqrzro/utility';
5
+ import ChkRadList from '../../core/ChkRadList';
6
+ function CheckboxList({ name, onChange, value, ...props }) {
7
+ const handleChange = (event) => {
8
+ if (!onChange) {
9
+ return;
10
+ }
11
+ const newArray = toggleArrayItem(value || [], event.target.value);
12
+ const simpleEvent = {
13
+ item: event.item,
14
+ target: { name, value: newArray },
15
+ };
16
+ onChange(simpleEvent);
17
+ };
18
+ return (React.createElement(ChkRadList, { ...props, name: `${name}[]`, onChange: handleChange, type: "checkbox", value: value }));
19
+ }
20
+ CheckboxList.propTypes = {
21
+ name: PropTypes.string.isRequired,
22
+ value: PropTypes.arrayOf(PropTypes.string.isRequired),
23
+ onChange: PropTypes.func,
24
+ };
25
+ export default CheckboxList;
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
- import type { InputEventHandler, InputProps } from '../../utility/interfaces';
3
- interface CodeInputProps extends InputProps<string> {
4
- isAutoFocus?: boolean;
5
- onFinalChange?: InputEventHandler<string>;
6
- size?: number;
7
- }
8
- declare function CodeInput({ hasError, id, isAutoFocus, isDisabled, name, onChange, onFinalChange, size, value, }: CodeInputProps): React.ReactElement;
9
- export default CodeInput;
1
+ import React from 'react';
2
+ import type { InputProps } from '../../utility/interfaces';
3
+ interface CodeInputProps extends InputProps<string> {
4
+ isAutoFocus?: boolean;
5
+ onFinalChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ size?: number;
7
+ }
8
+ declare function CodeInput({ hasError, id, isAutoFocus, isDisabled, name, onChange, onFinalChange, size, value, }: CodeInputProps): React.ReactElement;
9
+ export default CodeInput;
@@ -1,57 +1,51 @@
1
- 'use client';
2
- import React, { useEffect, useRef } from 'react';
3
- // Import styles from './CodeInput.module.css';
4
- const DEFAULT_SIZE = 6;
5
- function CodeInput({ hasError, id, isAutoFocus, isDisabled, name, onChange, onFinalChange, size = DEFAULT_SIZE, value, }) {
6
- const inputs = useRef([]);
7
- const values = (value || '').split('');
8
- function handleChange(index) {
9
- return (event) => {
10
- const newValues = [...values];
11
- newValues[index] = event.target.value;
12
- if (onChange) {
13
- onChange({ target: { name, value: newValues.join('') } });
14
- }
15
- if (inputs.current[index] && inputs.current[index].value.length === 1) {
16
- inputs.current[index + 1]?.focus();
17
- }
18
- };
19
- }
20
- function handleKeyDown(index) {
21
- return (event) => {
22
- if (event.key === 'Backspace' && !event.target.value) {
23
- let prevInput = index - 1;
24
- while (prevInput >= 0 && !values[prevInput]) {
25
- prevInput -= 1;
26
- }
27
- if (inputs.current[prevInput]) {
28
- inputs.current[prevInput].focus();
29
- inputs.current[prevInput].value = '';
30
- }
31
- const newValues = [...values];
32
- newValues[prevInput] = '';
33
- if (onChange) {
34
- onChange({ target: { name, value: newValues.join('') } });
35
- }
36
- }
37
- };
38
- }
39
- function handlePaste(event) {
40
- event.clipboardData.items[0].getAsString((string) => {
41
- if (onChange) {
42
- onChange({ target: { name, value: string.substring(0, size) } });
43
- }
44
- });
45
- }
46
- useEffect(() => {
47
- if (value?.length === size) {
48
- onFinalChange?.({ target: { name, value } });
49
- }
50
- }, [value]);
51
- return (React.createElement("div", { className: "/*clsx(styles.root, { [styles.rootIsDisabled]: isDisabled)*/" }, Array.from({ length: size }, (item, index) => (React.createElement("input", { key: index, ref: (ref) => {
52
- if (ref) {
53
- inputs.current[index] = ref;
54
- }
55
- }, autoComplete: "off", autoFocus: Boolean(isAutoFocus && index === 0), className: "/*clsx(styles.input, { [styles.rootHasError]: hasError)*/", disabled: isDisabled, id: index === 0 ? id || name : `${id || name}-${index}`, maxLength: 1, name: `${name}_${index}`, onChange: handleChange(index), onKeyDown: handleKeyDown(index), onPaste: handlePaste, value: values[index] || '' })))));
56
- }
57
- export default CodeInput;
1
+ 'use client';
2
+ import React, { useRef } from 'react';
3
+ // Import styles from './CodeInput.module.css';
4
+ const DEFAULT_SIZE = 6;
5
+ function CodeInput({ hasError, id, isAutoFocus, isDisabled, name, onChange, onFinalChange, size = DEFAULT_SIZE, value, }) {
6
+ const inputs = useRef([]);
7
+ const values = (value || '').split('');
8
+ const handleChange = (index) => (event) => {
9
+ const newValues = [...values];
10
+ newValues[index] = event.target.value;
11
+ if (onChange) {
12
+ onChange({ target: { name, value: newValues.join('') } });
13
+ }
14
+ if (inputs.current[index] && inputs.current[index].value.length === 1) {
15
+ inputs.current[index + 1]?.focus();
16
+ }
17
+ if (newValues.length === size) {
18
+ onFinalChange?.(event);
19
+ }
20
+ };
21
+ const handleKeyDown = (index) => (event) => {
22
+ if (event.key === 'Backspace' && !event.target.value) {
23
+ let prevInput = index - 1;
24
+ while (prevInput >= 0 && !values[prevInput]) {
25
+ prevInput -= 1;
26
+ }
27
+ if (inputs.current[prevInput]) {
28
+ inputs.current[prevInput].focus();
29
+ inputs.current[prevInput].value = '';
30
+ }
31
+ const newValues = [...values];
32
+ newValues[prevInput] = '';
33
+ if (onChange) {
34
+ onChange({ target: { name, value: newValues.join('') } });
35
+ }
36
+ }
37
+ };
38
+ const handlePaste = (event) => {
39
+ event.clipboardData.items[0].getAsString((string) => {
40
+ if (onChange) {
41
+ onChange({ target: { name, value: string.substring(0, size) } });
42
+ }
43
+ });
44
+ };
45
+ return (React.createElement("div", { className: "/*clsx(styles.root, { [styles.rootIsDisabled]: isDisabled)*/" }, Array.from({ length: size }, (item, index) => (React.createElement("input", { key: index, ref: (ref) => {
46
+ if (ref) {
47
+ inputs.current[index] = ref;
48
+ }
49
+ }, autoComplete: "off", autoFocus: Boolean(isAutoFocus && index === 0), className: "/*clsx(styles.input, { [styles.rootHasError]: hasError)*/", disabled: isDisabled, id: index === 0 ? id || name : `${id || name}-${index}`, maxLength: 1, name: `${name}_${index}`, onChange: handleChange(index), onKeyDown: handleKeyDown(index), onPaste: handlePaste, value: values[index] || '' })))));
50
+ }
51
+ export default CodeInput;
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { InputProps, Remote } from '../../utility/interfaces';
4
- interface ConnnectedDropdownProps extends InputProps<string[] | string> {
5
- isPanelOnly?: boolean;
6
- remote: Remote;
7
- }
8
- declare function ConnectedDropdown({ remote, ...props }: ConnnectedDropdownProps): React.ReactElement;
9
- declare namespace ConnectedDropdown {
10
- var propTypes: {
11
- name: PropTypes.Validator<string>;
12
- };
13
- }
14
- export default ConnectedDropdown;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { InputProps, Remote } from '../../utility/interfaces';
4
+ interface ConnnectedDropdownProps extends InputProps<string[] | string> {
5
+ isPanelOnly?: boolean;
6
+ remote: Remote;
7
+ }
8
+ declare function ConnectedDropdown({ remote, ...props }: ConnnectedDropdownProps): React.ReactElement;
9
+ declare namespace ConnectedDropdown {
10
+ var propTypes: {
11
+ name: PropTypes.Validator<string>;
12
+ };
13
+ }
14
+ export default ConnectedDropdown;
@@ -1,36 +1,36 @@
1
- 'use client';
2
- import React, { useEffect, useState } from 'react';
3
- import PropTypes from 'prop-types';
4
- import { ApiService } from '@sqrzro/utility';
5
- import Dropdown from '../Dropdown';
6
- import ErrorMessage from '../ErrorMessage';
7
- const parseRemote = (remote) => {
8
- if (Array.isArray(remote)) {
9
- return [remote[0], { ...remote[1], simpleview: '1' }];
10
- }
11
- return [remote, { simpleview: '1' }];
12
- };
13
- function ConnectedDropdown({ remote, ...props }) {
14
- const [data, setData] = useState();
15
- const [isError, setIsError] = useState(false);
16
- const getData = async () => {
17
- try {
18
- const response = await ApiService.get(parseRemote(remote));
19
- setData(response.data);
20
- }
21
- catch (err) {
22
- setIsError(true);
23
- }
24
- };
25
- useEffect(() => {
26
- void getData();
27
- }, []);
28
- if (isError) {
29
- return React.createElement(ErrorMessage, { isMini: true });
30
- }
31
- return React.createElement(Dropdown, { data: data, isDisabled: !data, ...props });
32
- }
33
- ConnectedDropdown.propTypes = {
34
- name: PropTypes.string.isRequired,
35
- };
36
- export default ConnectedDropdown;
1
+ 'use client';
2
+ import React, { useEffect, useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { ApiService } from '@sqrzro/utility';
5
+ import Dropdown from '../../components/Dropdown';
6
+ import ErrorMessage from '../../components/ErrorMessage';
7
+ const parseRemote = (remote) => {
8
+ if (Array.isArray(remote)) {
9
+ return [remote[0], { ...remote[1], simpleview: '1' }];
10
+ }
11
+ return [remote, { simpleview: '1' }];
12
+ };
13
+ function ConnectedDropdown({ remote, ...props }) {
14
+ const [data, setData] = useState();
15
+ const [isError, setIsError] = useState(false);
16
+ const getData = async () => {
17
+ try {
18
+ const response = await ApiService.get(parseRemote(remote));
19
+ setData(response.data);
20
+ }
21
+ catch (err) {
22
+ setIsError(true);
23
+ }
24
+ };
25
+ useEffect(() => {
26
+ void getData();
27
+ }, []);
28
+ if (isError) {
29
+ return React.createElement(ErrorMessage, { isMini: true });
30
+ }
31
+ return React.createElement(Dropdown, { data: data, isDisabled: !data, ...props });
32
+ }
33
+ ConnectedDropdown.propTypes = {
34
+ name: PropTypes.string.isRequired,
35
+ };
36
+ export default ConnectedDropdown;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { ConnectedRepeaterElementProps } from '../../core/ConnectedRepeater';
3
- import type { SimpleObject } from '../../utility/interfaces';
4
- declare function ConnectedList<T extends SimpleObject>(props: ConnectedRepeaterElementProps<T>): React.ReactElement;
5
- export default ConnectedList;
1
+ import React from 'react';
2
+ import type { ConnectedRepeaterElementProps } from '../../core/ConnectedRepeater';
3
+ import type { SimpleObject } from '../../utility/interfaces';
4
+ declare function ConnectedList<T extends SimpleObject>(props: ConnectedRepeaterElementProps<T>): React.ReactElement;
5
+ export default ConnectedList;
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import ConnectedRepeater from '../../core/ConnectedRepeater';
3
- import List from '../List';
4
- function ConnectedList(props) {
5
- return (React.createElement(ConnectedRepeater, { ...props, render: (renderProps) => React.createElement(List, { ...renderProps }) }));
6
- }
7
- export default ConnectedList;
1
+ import React from 'react';
2
+ import ConnectedRepeater from '../../core/ConnectedRepeater';
3
+ import List from '../../components/List';
4
+ function ConnectedList(props) {
5
+ return (React.createElement(ConnectedRepeater, { ...props, render: (renderProps) => React.createElement(List, { ...renderProps }) }));
6
+ }
7
+ export default ConnectedList;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { ConnectedRepeaterElementProps } from '../../core/ConnectedRepeater';
3
- import type { SimpleObject } from '../../utility/interfaces';
4
- declare function ConnectedTable<T extends SimpleObject>(props: ConnectedRepeaterElementProps<T>): React.ReactElement;
5
- export default ConnectedTable;
1
+ import React from 'react';
2
+ import type { ConnectedRepeaterElementProps } from '../../core/ConnectedRepeater';
3
+ import type { SimpleObject } from '../../utility/interfaces';
4
+ declare function ConnectedTable<T extends SimpleObject>(props: ConnectedRepeaterElementProps<T>): React.ReactElement;
5
+ export default ConnectedTable;