@applica-software-guru/react-admin 1.3.182 → 1.3.184

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 (338) hide show
  1. package/dist/Admin.d.ts +5 -8
  2. package/dist/Admin.d.ts.map +1 -1
  3. package/dist/AdminContext.d.ts +2 -4
  4. package/dist/AdminContext.d.ts.map +1 -1
  5. package/dist/ApplicaAdmin.d.ts +4 -24
  6. package/dist/ApplicaAdmin.d.ts.map +1 -1
  7. package/dist/components/@extended/Breadcrumbs.d.ts +2 -8
  8. package/dist/components/AuthBackground.d.ts +2 -1
  9. package/dist/components/AuthBackground.d.ts.map +1 -1
  10. package/dist/components/Layout/Drawer/Drawer.d.ts +2 -2
  11. package/dist/components/Layout/Drawer/Drawer.d.ts.map +1 -1
  12. package/dist/components/Layout/Drawer/DrawerHeader.d.ts +2 -2
  13. package/dist/components/Layout/Drawer/DrawerHeader.d.ts.map +1 -1
  14. package/dist/components/Layout/Drawer/DrawerHeaderStyled.d.ts +1 -0
  15. package/dist/components/Layout/Drawer/DrawerHeaderStyled.d.ts.map +1 -1
  16. package/dist/components/Layout/Footer.d.ts +0 -11
  17. package/dist/components/Layout/Footer.d.ts.map +1 -1
  18. package/dist/components/Layout/Header/AppBarStyled.d.ts +7 -3
  19. package/dist/components/Layout/Header/AppBarStyled.d.ts.map +1 -1
  20. package/dist/components/Layout/Layout.d.ts.map +1 -1
  21. package/dist/components/Notification.d.ts +3 -6
  22. package/dist/components/Notification.d.ts.map +1 -1
  23. package/dist/components/index.d.ts +1 -0
  24. package/dist/components/index.d.ts.map +1 -1
  25. package/dist/components/ra-buttons/CreateInDialogButton.d.ts +3 -33
  26. package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
  27. package/dist/components/ra-buttons/EditInDialogButton.d.ts +9 -22
  28. package/dist/components/ra-buttons/EditInDialogButton.d.ts.map +1 -1
  29. package/dist/components/ra-buttons/ImpersonateUserButton.d.ts +5 -10
  30. package/dist/components/ra-buttons/ImpersonateUserButton.d.ts.map +1 -1
  31. package/dist/components/ra-buttons/index.d.ts +3 -4
  32. package/dist/components/ra-buttons/index.d.ts.map +1 -1
  33. package/dist/components/ra-custom/ListItem.d.ts +1 -20
  34. package/dist/components/ra-custom/ListItem.d.ts.map +1 -1
  35. package/dist/components/ra-custom/index.d.ts +1 -2
  36. package/dist/components/ra-custom/index.d.ts.map +1 -1
  37. package/dist/components/ra-fields/ActionsField.d.ts +7 -21
  38. package/dist/components/ra-fields/ActionsField.d.ts.map +1 -1
  39. package/dist/components/ra-fields/AttachmentField.d.ts +2 -25
  40. package/dist/components/ra-fields/AttachmentField.d.ts.map +1 -1
  41. package/dist/components/ra-fields/BaseAttachmentField.d.ts +1 -15
  42. package/dist/components/ra-fields/BaseAttachmentField.d.ts.map +1 -1
  43. package/dist/components/ra-fields/CoverField.d.ts +10 -31
  44. package/dist/components/ra-fields/CoverField.d.ts.map +1 -1
  45. package/dist/components/ra-fields/DateAgoField.d.ts +6 -8
  46. package/dist/components/ra-fields/DateAgoField.d.ts.map +1 -1
  47. package/dist/components/ra-fields/DateField.d.ts +3 -5
  48. package/dist/components/ra-fields/DateField.d.ts.map +1 -1
  49. package/dist/components/ra-fields/EmailField.d.ts +3 -16
  50. package/dist/components/ra-fields/EmailField.d.ts.map +1 -1
  51. package/dist/components/ra-fields/FileField.d.ts +8 -25
  52. package/dist/components/ra-fields/FileField.d.ts.map +1 -1
  53. package/dist/components/ra-fields/FunctionField.d.ts +3 -6
  54. package/dist/components/ra-fields/FunctionField.d.ts.map +1 -1
  55. package/dist/components/ra-fields/ImageField.d.ts +3 -18
  56. package/dist/components/ra-fields/ImageField.d.ts.map +1 -1
  57. package/dist/components/ra-fields/LocalizedTextField.d.ts +3 -2
  58. package/dist/components/ra-fields/LocalizedTextField.d.ts.map +1 -1
  59. package/dist/components/ra-fields/ReadonlyField.d.ts +1 -1
  60. package/dist/components/ra-fields/ReadonlyField.d.ts.map +1 -1
  61. package/dist/components/ra-fields/ReferenceManyField.d.ts +7 -16
  62. package/dist/components/ra-fields/ReferenceManyField.d.ts.map +1 -1
  63. package/dist/components/ra-fields/SizeField.d.ts +6 -11
  64. package/dist/components/ra-fields/SizeField.d.ts.map +1 -1
  65. package/dist/components/ra-fields/TextField.d.ts +3 -5
  66. package/dist/components/ra-fields/TextField.d.ts.map +1 -1
  67. package/dist/components/ra-fields/index.d.ts +14 -15
  68. package/dist/components/ra-fields/index.d.ts.map +1 -1
  69. package/dist/components/ra-forms/CardForm.d.ts +22 -26
  70. package/dist/components/ra-forms/CardForm.d.ts.map +1 -1
  71. package/dist/components/ra-forms/ChangePasswordForm.d.ts +2 -1
  72. package/dist/components/ra-forms/ChangePasswordForm.d.ts.map +1 -1
  73. package/dist/components/ra-forms/Create.d.ts +3 -4
  74. package/dist/components/ra-forms/Create.d.ts.map +1 -1
  75. package/dist/components/ra-forms/Edit.d.ts +3 -2
  76. package/dist/components/ra-forms/Edit.d.ts.map +1 -1
  77. package/dist/components/ra-forms/FormHeader.d.ts +4 -20
  78. package/dist/components/ra-forms/FormHeader.d.ts.map +1 -1
  79. package/dist/components/ra-forms/LongForm/Content.d.ts +1 -1
  80. package/dist/components/ra-forms/LongForm/Content.d.ts.map +1 -1
  81. package/dist/components/ra-forms/LongForm/Form.d.ts +1 -1
  82. package/dist/components/ra-forms/LongForm/Form.d.ts.map +1 -1
  83. package/dist/components/ra-forms/LongForm/NavMenu.d.ts.map +1 -1
  84. package/dist/components/ra-forms/LongForm/Provider.d.ts.map +1 -1
  85. package/dist/components/ra-forms/LongForm/Sidebar.d.ts +1 -1
  86. package/dist/components/ra-forms/LongForm/Sidebar.d.ts.map +1 -1
  87. package/dist/components/ra-forms/LongForm/Tab.d.ts +2 -2
  88. package/dist/components/ra-forms/LongForm/Tab.d.ts.map +1 -1
  89. package/dist/components/ra-forms/LongForm/hooks.d.ts.map +1 -1
  90. package/dist/components/ra-forms/LongForm/index.d.ts +2 -2
  91. package/dist/components/ra-forms/LongForm/index.d.ts.map +1 -1
  92. package/dist/components/ra-forms/LongForm/utils.d.ts +1 -1
  93. package/dist/components/ra-forms/LongForm/utils.d.ts.map +1 -1
  94. package/dist/components/ra-forms/Show.d.ts +3 -12
  95. package/dist/components/ra-forms/Show.d.ts.map +1 -1
  96. package/dist/components/ra-forms/SimpleForm.d.ts +1 -30
  97. package/dist/components/ra-forms/SimpleForm.d.ts.map +1 -1
  98. package/dist/components/ra-forms/SimpleFormIterator.d.ts +1 -3
  99. package/dist/components/ra-forms/SimpleFormIterator.d.ts.map +1 -1
  100. package/dist/components/ra-forms/TabbedForm.d.ts +5 -9
  101. package/dist/components/ra-forms/TabbedForm.d.ts.map +1 -1
  102. package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts +21 -22
  103. package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts.map +1 -1
  104. package/dist/components/ra-forms/TableForm/TableFormIteratorItem.d.ts +1 -1
  105. package/dist/components/ra-forms/TableForm/TableFormIteratorItem.d.ts.map +1 -1
  106. package/dist/components/ra-forms/TableForm/index.d.ts +1 -2
  107. package/dist/components/ra-forms/TableForm/index.d.ts.map +1 -1
  108. package/dist/components/ra-forms/Toolbar.d.ts +3 -9
  109. package/dist/components/ra-forms/Toolbar.d.ts.map +1 -1
  110. package/dist/components/ra-forms/index.d.ts +12 -14
  111. package/dist/components/ra-forms/index.d.ts.map +1 -1
  112. package/dist/components/ra-inputs/ArrayInput.d.ts +3 -2
  113. package/dist/components/ra-inputs/ArrayInput.d.ts.map +1 -1
  114. package/dist/components/ra-inputs/AttachmentInput.d.ts +2 -32
  115. package/dist/components/ra-inputs/AttachmentInput.d.ts.map +1 -1
  116. package/dist/components/ra-inputs/AutocompleteArrayInput.d.ts +3 -7
  117. package/dist/components/ra-inputs/AutocompleteArrayInput.d.ts.map +1 -1
  118. package/dist/components/ra-inputs/AutocompleteInput.d.ts +3 -5
  119. package/dist/components/ra-inputs/AutocompleteInput.d.ts.map +1 -1
  120. package/dist/components/ra-inputs/BooleanInput.d.ts +3 -22
  121. package/dist/components/ra-inputs/BooleanInput.d.ts.map +1 -1
  122. package/dist/components/ra-inputs/DateInput.d.ts +3 -16
  123. package/dist/components/ra-inputs/DateInput.d.ts.map +1 -1
  124. package/dist/components/ra-inputs/DateTimeInput.d.ts +2 -19
  125. package/dist/components/ra-inputs/DateTimeInput.d.ts.map +1 -1
  126. package/dist/components/ra-inputs/FileInput.d.ts +9 -32
  127. package/dist/components/ra-inputs/FileInput.d.ts.map +1 -1
  128. package/dist/components/ra-inputs/ImageInput.d.ts +9 -12
  129. package/dist/components/ra-inputs/ImageInput.d.ts.map +1 -1
  130. package/dist/components/ra-inputs/LabeledArrayInput.d.ts +2 -24
  131. package/dist/components/ra-inputs/LabeledArrayInput.d.ts.map +1 -1
  132. package/dist/components/ra-inputs/LabeledInput.d.ts +1 -20
  133. package/dist/components/ra-inputs/LabeledInput.d.ts.map +1 -1
  134. package/dist/components/ra-inputs/LocalizedTextInput.d.ts +2 -2
  135. package/dist/components/ra-inputs/LocalizedTextInput.d.ts.map +1 -1
  136. package/dist/components/ra-inputs/NumberInput.d.ts +3 -22
  137. package/dist/components/ra-inputs/NumberInput.d.ts.map +1 -1
  138. package/dist/components/ra-inputs/RecordInput.d.ts +7 -13
  139. package/dist/components/ra-inputs/RecordInput.d.ts.map +1 -1
  140. package/dist/components/ra-inputs/ReferenceArrayInput.d.ts +6 -22
  141. package/dist/components/ra-inputs/ReferenceArrayInput.d.ts.map +1 -1
  142. package/dist/components/ra-inputs/ReferenceInput.d.ts +6 -23
  143. package/dist/components/ra-inputs/ReferenceInput.d.ts.map +1 -1
  144. package/dist/components/ra-inputs/ReferenceManyInput.d.ts +10 -12
  145. package/dist/components/ra-inputs/ReferenceManyInput.d.ts.map +1 -1
  146. package/dist/components/ra-inputs/SearchInput.d.ts +3 -1
  147. package/dist/components/ra-inputs/SearchInput.d.ts.map +1 -1
  148. package/dist/components/ra-inputs/SelectArrayInput.d.ts +3 -26
  149. package/dist/components/ra-inputs/SelectArrayInput.d.ts.map +1 -1
  150. package/dist/components/ra-inputs/SelectInput.d.ts +3 -2
  151. package/dist/components/ra-inputs/SelectInput.d.ts.map +1 -1
  152. package/dist/components/ra-inputs/SmartTextInput.d.ts +6 -26
  153. package/dist/components/ra-inputs/SmartTextInput.d.ts.map +1 -1
  154. package/dist/components/ra-inputs/TextInput.d.ts +2 -16
  155. package/dist/components/ra-inputs/TextInput.d.ts.map +1 -1
  156. package/dist/components/ra-inputs/TimeInput.d.ts +3 -16
  157. package/dist/components/ra-inputs/TimeInput.d.ts.map +1 -1
  158. package/dist/components/ra-inputs/index.d.ts +23 -24
  159. package/dist/components/ra-inputs/index.d.ts.map +1 -1
  160. package/dist/components/ra-lists/BulkActionsToolbar.d.ts +1 -8
  161. package/dist/components/ra-lists/BulkActionsToolbar.d.ts.map +1 -1
  162. package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts +1 -7
  163. package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts.map +1 -1
  164. package/dist/components/ra-lists/Datagrid/Datagrid.d.ts +1 -1
  165. package/dist/components/ra-lists/Datagrid/Datagrid.d.ts.map +1 -1
  166. package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts +1 -1
  167. package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts.map +1 -1
  168. package/dist/components/ra-lists/Datagrid/index.d.ts +1 -4
  169. package/dist/components/ra-lists/Datagrid/index.d.ts.map +1 -1
  170. package/dist/components/ra-lists/Empty.d.ts +1 -11
  171. package/dist/components/ra-lists/Empty.d.ts.map +1 -1
  172. package/dist/components/ra-lists/List.d.ts +2 -26
  173. package/dist/components/ra-lists/List.d.ts.map +1 -1
  174. package/dist/components/ra-lists/ListView.d.ts +1 -16
  175. package/dist/components/ra-lists/ListView.d.ts.map +1 -1
  176. package/dist/components/ra-lists/NotificationList/NotificationList.d.ts +4 -3
  177. package/dist/components/ra-lists/NotificationList/NotificationList.d.ts.map +1 -1
  178. package/dist/components/ra-lists/NotificationList/buttons/MarkAsReadedButton.d.ts +4 -0
  179. package/dist/components/ra-lists/NotificationList/buttons/MarkAsReadedButton.d.ts.map +1 -0
  180. package/dist/components/ra-lists/NotificationList/buttons/MarkAsUnreadedButton.d.ts +4 -0
  181. package/dist/components/ra-lists/NotificationList/buttons/MarkAsUnreadedButton.d.ts.map +1 -0
  182. package/dist/components/ra-lists/NotificationList/buttons/index.d.ts +3 -0
  183. package/dist/components/ra-lists/NotificationList/buttons/index.d.ts.map +1 -0
  184. package/dist/components/ra-lists/NotificationList/fields/NotificationField.d.ts +4 -0
  185. package/dist/components/ra-lists/NotificationList/fields/NotificationField.d.ts.map +1 -0
  186. package/dist/components/ra-lists/NotificationList/fields/index.d.ts +2 -0
  187. package/dist/components/ra-lists/NotificationList/fields/index.d.ts.map +1 -0
  188. package/dist/components/ra-lists/NotificationList/index.d.ts +1 -2
  189. package/dist/components/ra-lists/NotificationList/index.d.ts.map +1 -1
  190. package/dist/components/ra-lists/SimpleList.d.ts +3 -3
  191. package/dist/components/ra-lists/SimpleList.d.ts.map +1 -1
  192. package/dist/components/ra-lists/index.d.ts +7 -7
  193. package/dist/components/ra-lists/index.d.ts.map +1 -1
  194. package/dist/components/ra-pages/LoginPage.d.ts +2 -16
  195. package/dist/components/ra-pages/LoginPage.d.ts.map +1 -1
  196. package/dist/react-admin.cjs.js +67 -67
  197. package/dist/react-admin.cjs.js.map +1 -1
  198. package/dist/react-admin.es.js +11554 -12406
  199. package/dist/react-admin.es.js.map +1 -1
  200. package/dist/react-admin.umd.js +67 -67
  201. package/dist/react-admin.umd.js.map +1 -1
  202. package/package.json +1 -1
  203. package/src/{Admin.jsx → Admin.tsx} +6 -14
  204. package/src/AdminContext.tsx +12 -14
  205. package/src/ApplicaAdmin.tsx +22 -38
  206. package/src/components/@extended/Breadcrumbs.jsx +2 -6
  207. package/src/components/AuthBackground.tsx +2 -2
  208. package/src/components/Layout/Drawer/Drawer.tsx +2 -3
  209. package/src/components/Layout/Drawer/DrawerHeader.tsx +2 -2
  210. package/src/components/Layout/Drawer/DrawerHeaderStyled.jsx +2 -8
  211. package/src/components/Layout/Footer.tsx +2 -13
  212. package/src/components/Layout/Header/AppBarStyled.tsx +29 -0
  213. package/src/components/Layout/Layout.tsx +0 -1
  214. package/src/components/Notification.tsx +15 -0
  215. package/src/components/index.jsx +1 -0
  216. package/src/components/ra-buttons/CreateInDialogButton.tsx +11 -47
  217. package/src/components/ra-buttons/{EditInDialogButton.jsx → EditInDialogButton.tsx} +20 -21
  218. package/src/components/ra-buttons/{ImpersonateUserButton.jsx → ImpersonateUserButton.tsx} +8 -9
  219. package/src/components/ra-buttons/index.ts +3 -0
  220. package/src/components/ra-custom/ListItem.tsx +4 -39
  221. package/src/components/ra-custom/index.ts +1 -0
  222. package/src/components/ra-fields/{ActionsField.jsx → ActionsField.tsx} +8 -16
  223. package/src/components/ra-fields/AttachmentField.tsx +4 -14
  224. package/src/components/ra-fields/BaseAttachmentField.tsx +2 -16
  225. package/src/components/ra-fields/{CoverField.jsx → CoverField.tsx} +17 -28
  226. package/src/components/ra-fields/{DateAgoField.jsx → DateAgoField.tsx} +8 -11
  227. package/src/components/ra-fields/DateField.tsx +14 -0
  228. package/src/components/ra-fields/EmailField.tsx +13 -0
  229. package/src/components/ra-fields/{FileField.jsx → FileField.tsx} +17 -13
  230. package/src/components/ra-fields/FunctionField.tsx +7 -0
  231. package/src/components/ra-fields/{ImageField.jsx → ImageField.tsx} +3 -9
  232. package/src/components/ra-fields/LocalizedTextField.tsx +3 -3
  233. package/src/components/ra-fields/ReadonlyField.tsx +4 -3
  234. package/src/components/ra-fields/ReferenceManyField.tsx +24 -35
  235. package/src/components/ra-fields/{SizeField.jsx → SizeField.tsx} +8 -9
  236. package/src/components/ra-fields/TextField.tsx +14 -0
  237. package/src/components/ra-fields/index.ts +14 -0
  238. package/src/components/ra-forms/CardForm.tsx +102 -0
  239. package/src/components/ra-forms/ChangePasswordForm.tsx +4 -6
  240. package/src/components/ra-forms/Create.tsx +6 -8
  241. package/src/components/ra-forms/{Edit.jsx → Edit.tsx} +5 -5
  242. package/src/components/ra-forms/FormHeader.tsx +5 -23
  243. package/src/components/ra-forms/LongForm/Content.tsx +1 -1
  244. package/src/components/ra-forms/LongForm/Form.tsx +3 -3
  245. package/src/components/ra-forms/LongForm/NavMenu.tsx +3 -3
  246. package/src/components/ra-forms/LongForm/Provider.tsx +3 -4
  247. package/src/components/ra-forms/LongForm/Sidebar.tsx +2 -2
  248. package/src/components/ra-forms/LongForm/Tab.tsx +5 -5
  249. package/src/components/ra-forms/LongForm/hooks.tsx +3 -3
  250. package/src/components/ra-forms/LongForm/index.ts +3 -13
  251. package/src/components/ra-forms/LongForm/utils.ts +1 -1
  252. package/src/components/ra-forms/Show.tsx +21 -19
  253. package/src/components/ra-forms/SimpleForm.tsx +23 -40
  254. package/src/components/ra-forms/SimpleFormIterator.tsx +26 -24
  255. package/src/components/ra-forms/TabbedForm.tsx +36 -27
  256. package/src/components/ra-forms/TableForm/TableFormIterator.tsx +6 -34
  257. package/src/components/ra-forms/TableForm/TableFormIteratorItem.tsx +3 -4
  258. package/src/components/ra-forms/TableForm/index.ts +1 -3
  259. package/src/components/ra-forms/{Toolbar.jsx → Toolbar.tsx} +6 -11
  260. package/src/components/ra-forms/index.ts +12 -0
  261. package/src/components/ra-inputs/ArrayInput.tsx +15 -15
  262. package/src/components/ra-inputs/AttachmentInput.tsx +17 -25
  263. package/src/components/ra-inputs/AutocompleteArrayInput.tsx +27 -0
  264. package/src/components/ra-inputs/{AutocompleteInput.jsx → AutocompleteInput.tsx} +8 -18
  265. package/src/components/ra-inputs/{BooleanInput.jsx → BooleanInput.tsx} +8 -15
  266. package/src/components/ra-inputs/DateInput.tsx +24 -0
  267. package/src/components/ra-inputs/DateTimeInput.tsx +10 -18
  268. package/src/components/ra-inputs/{FileInput.jsx → FileInput.tsx} +28 -29
  269. package/src/components/ra-inputs/ImageInput.tsx +44 -0
  270. package/src/components/ra-inputs/LabeledArrayInput.tsx +8 -31
  271. package/src/components/ra-inputs/LabeledInput.tsx +12 -24
  272. package/src/components/ra-inputs/LocalizedTextInput.tsx +7 -7
  273. package/src/components/ra-inputs/NumberInput.tsx +24 -0
  274. package/src/components/ra-inputs/{RecordInput.jsx → RecordInput.tsx} +20 -18
  275. package/src/components/ra-inputs/ReferenceArrayInput.tsx +19 -0
  276. package/src/components/ra-inputs/ReferenceInput.tsx +19 -0
  277. package/src/components/ra-inputs/ReferenceManyInput.tsx +26 -0
  278. package/src/components/ra-inputs/SearchInput.tsx +12 -0
  279. package/src/components/ra-inputs/SelectArrayInput.tsx +33 -0
  280. package/src/components/ra-inputs/SelectInput.tsx +8 -10
  281. package/src/components/ra-inputs/{SmartTextInput.jsx → SmartTextInput.tsx} +10 -20
  282. package/src/components/ra-inputs/TextInput.tsx +9 -12
  283. package/src/components/ra-inputs/TimeInput.tsx +39 -0
  284. package/src/components/ra-inputs/index.ts +23 -0
  285. package/src/components/ra-lists/BulkActionsToolbar.tsx +6 -15
  286. package/src/components/ra-lists/BulkFloatingActionsToolbar.tsx +5 -9
  287. package/src/components/ra-lists/Datagrid/Datagrid.tsx +5 -6
  288. package/src/components/ra-lists/Datagrid/DatagridContextProvider.tsx +1 -1
  289. package/src/components/ra-lists/Datagrid/index.tsx +2 -6
  290. package/src/components/ra-lists/Empty.tsx +5 -16
  291. package/src/components/ra-lists/List.tsx +11 -47
  292. package/src/components/ra-lists/ListView.tsx +4 -19
  293. package/src/components/ra-lists/NotificationList/{NotificationList.jsx → NotificationList.tsx} +7 -8
  294. package/src/components/ra-lists/NotificationList/{button/MarkAsReadedButton.jsx → buttons/MarkAsReadedButton.tsx} +9 -9
  295. package/src/components/ra-lists/NotificationList/{button/MarkAsUnreadedButton.jsx → buttons/MarkAsUnreadedButton.tsx} +7 -6
  296. package/src/components/ra-lists/NotificationList/buttons/index.ts +2 -0
  297. package/src/components/ra-lists/NotificationList/{field/NotificationField.jsx → fields/NotificationField.tsx} +5 -5
  298. package/src/components/ra-lists/NotificationList/fields/index.ts +1 -0
  299. package/src/components/ra-lists/NotificationList/index.ts +1 -0
  300. package/src/components/ra-lists/SimpleList.tsx +2 -2
  301. package/src/components/ra-lists/index.ts +7 -7
  302. package/src/components/ra-pages/LoginPage.tsx +11 -16
  303. package/vite.config.js +84 -71
  304. package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts +0 -3
  305. package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts.map +0 -1
  306. package/dist/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.d.ts +0 -3
  307. package/dist/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.d.ts.map +0 -1
  308. package/dist/components/ra-lists/NotificationList/button/index.d.ts +0 -3
  309. package/dist/components/ra-lists/NotificationList/button/index.d.ts.map +0 -1
  310. package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts +0 -3
  311. package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts.map +0 -1
  312. package/dist/components/ra-lists/NotificationList/field/index.d.ts +0 -2
  313. package/dist/components/ra-lists/NotificationList/field/index.d.ts.map +0 -1
  314. package/src/components/Layout/Header/AppBarStyled.jsx +0 -32
  315. package/src/components/Notification.jsx +0 -13
  316. package/src/components/ra-buttons/index.jsx +0 -4
  317. package/src/components/ra-custom/index.tsx +0 -2
  318. package/src/components/ra-fields/DateField.jsx +0 -27
  319. package/src/components/ra-fields/EmailField.jsx +0 -27
  320. package/src/components/ra-fields/FunctionField.jsx +0 -9
  321. package/src/components/ra-fields/TextField.jsx +0 -27
  322. package/src/components/ra-fields/index.jsx +0 -30
  323. package/src/components/ra-forms/CardForm.jsx +0 -107
  324. package/src/components/ra-forms/index.jsx +0 -29
  325. package/src/components/ra-inputs/AutocompleteArrayInput.jsx +0 -35
  326. package/src/components/ra-inputs/DateInput.jsx +0 -30
  327. package/src/components/ra-inputs/ImageInput.jsx +0 -45
  328. package/src/components/ra-inputs/NumberInput.jsx +0 -28
  329. package/src/components/ra-inputs/ReferenceArrayInput.jsx +0 -23
  330. package/src/components/ra-inputs/ReferenceInput.jsx +0 -23
  331. package/src/components/ra-inputs/ReferenceManyInput.jsx +0 -33
  332. package/src/components/ra-inputs/SearchInput.jsx +0 -14
  333. package/src/components/ra-inputs/SelectArrayInput.jsx +0 -47
  334. package/src/components/ra-inputs/TimeInput.jsx +0 -46
  335. package/src/components/ra-inputs/index.jsx +0 -48
  336. package/src/components/ra-lists/NotificationList/button/index.jsx +0 -2
  337. package/src/components/ra-lists/NotificationList/field/index.jsx +0 -1
  338. package/src/components/ra-lists/NotificationList/index.jsx +0 -2
@@ -1,3 +1,5 @@
1
+ import { Box } from '@mui/material';
2
+ import { styled } from '@mui/system';
1
3
  import {
2
4
  TabbedForm as RaTabbedForm,
3
5
  TabbedFormProps as RaTabbedFormProps,
@@ -5,12 +7,10 @@ import {
5
7
  SaveButton,
6
8
  TabProps
7
9
  } from 'react-admin';
8
- import MainCard from '../MainCard';
9
10
  import { useResourceTitle } from '../../hooks';
10
- import Toolbar from './Toolbar';
11
- import { styled } from '@mui/system';
12
11
  import ActionsMenu from '../ActionsMenu';
13
- import { Box } from '@mui/material';
12
+ import MainCard from '../MainCard';
13
+ import Toolbar from './Toolbar';
14
14
 
15
15
  export type TabbedFormProps = RaTabbedFormProps & {
16
16
  modal?: boolean;
@@ -40,10 +40,30 @@ const StyledTabbedForm = styled(RaTabbedForm, {
40
40
  }
41
41
  }));
42
42
 
43
- const TabbedFormWithNoPadding = ({ children }: { children: React.ReactNode }) => <>{children}</>;
43
+ function TabbedFormWithNoPadding({ children }: { children: React.ReactNode }): JSX.Element {
44
+ return <>{children}</>;
45
+ }
44
46
 
45
- const TabbedForm = (props: TabbedFormProps) => {
46
- const { title: _title, modal, content, subheader, secondary, sx, noPadding, ...rest } = props;
47
+ export function TabbedForm(props: TabbedFormProps): JSX.Element {
48
+ const {
49
+ title: _title,
50
+ modal,
51
+ content,
52
+ subheader,
53
+ secondary = (
54
+ <ActionsMenu>
55
+ <DeleteWithConfirmButton />
56
+ </ActionsMenu>
57
+ ),
58
+ sx,
59
+ noPadding,
60
+ toolbar = (
61
+ <Toolbar>
62
+ <SaveButton type="button" />
63
+ </Toolbar>
64
+ ),
65
+ ...rest
66
+ } = props;
47
67
  const title = useResourceTitle(_title);
48
68
 
49
69
  return (
@@ -72,10 +92,10 @@ const TabbedForm = (props: TabbedFormProps) => {
72
92
  divider
73
93
  >
74
94
  {/** @ts-ignore */}
75
- <StyledTabbedForm toolbar={<Toolbar />} component={noPadding ? TabbedFormWithNoPadding : undefined} {...rest} />
95
+ <StyledTabbedForm toolbar={toolbar} component={noPadding ? TabbedFormWithNoPadding : undefined} {...rest} />
76
96
  </MainCard>
77
97
  );
78
- };
98
+ }
79
99
  export type StackTabProps = TabProps & {
80
100
  children: React.ReactNode;
81
101
  };
@@ -84,24 +104,13 @@ export type StackTabProps = TabProps & {
84
104
  * Useful when you have tabbed form with noPadding and you want to add padding to the tabs.
85
105
  * This component render inside a TabbedForm with noPadding and add padding to the tabs.
86
106
  */
87
- const TabStack = ({ children, ...props }: StackTabProps): JSX.Element => (
88
- <RaTabbedForm.Tab {...props}>
89
- <Box sx={{ width: '100%', p: 2.5 }}>{children}</Box>
90
- </RaTabbedForm.Tab>
91
- );
92
-
93
- TabbedForm.defaultProps = {
94
- toolbar: (
95
- <Toolbar>
96
- <SaveButton type="button" />
97
- </Toolbar>
98
- ),
99
- secondary: (
100
- <ActionsMenu>
101
- <DeleteWithConfirmButton />
102
- </ActionsMenu>
103
- )
104
- };
107
+ function TabStack({ children, ...props }: StackTabProps): JSX.Element {
108
+ return (
109
+ <RaTabbedForm.Tab {...props}>
110
+ <Box sx={{ width: '100%', p: 2.5 }}>{children}</Box>
111
+ </RaTabbedForm.Tab>
112
+ );
113
+ }
105
114
 
106
115
  TabbedForm.Tab = RaTabbedForm.Tab;
107
116
  TabbedForm.TabStack = TabStack;
@@ -19,7 +19,6 @@ import { FormDataConsumer, RaRecord, useRecordContext, useTranslate, useTranslat
19
19
  import { styled, useTheme } from '@mui/material/styles';
20
20
  import ActionsMenu from '../../ActionsMenu';
21
21
  import { PlusCircleOutlined } from '@ant-design/icons';
22
- import PropTypes from 'prop-types';
23
22
  import { TableFormIteratorContext } from '../../../contexts';
24
23
  import { TableFormIteratorItem } from './TableFormIteratorItem';
25
24
  import { UseFieldArrayReturn, useFormContext } from 'react-hook-form';
@@ -43,7 +42,7 @@ import get from 'lodash/get';
43
42
  * @param props
44
43
  * @returns
45
44
  */
46
- const TableFormIterator = (props: TableFormIteratorProps) => {
45
+ export function RawTableFormIterator(props: TableFormIteratorProps): ReactElement | null {
47
46
  const {
48
47
  children,
49
48
  resource,
@@ -252,9 +251,9 @@ const TableFormIterator = (props: TableFormIteratorProps) => {
252
251
  </div>
253
252
  </TableFormIteratorContext.Provider>
254
253
  ) : null;
255
- };
254
+ }
256
255
 
257
- const AddTableRow = (props: any) => {
256
+ function AddTableRow(props: any): JSX.Element {
258
257
  const { label, disableAdd, onClick, inset } = props;
259
258
  const theme = useTheme();
260
259
  // @ts-ignore
@@ -276,9 +275,9 @@ const AddTableRow = (props: any) => {
276
275
  ))}
277
276
  </Stack>
278
277
  );
279
- };
278
+ }
280
279
 
281
- const StyledTableFormIterator = styled(TableFormIterator, {
280
+ export const TableFormIterator = styled(RawTableFormIterator, {
282
281
  name: 'RaApplicaTableFormIterator',
283
282
  slot: 'Root'
284
283
  })(({ theme }) => ({
@@ -295,33 +294,6 @@ const StyledTableFormIterator = styled(TableFormIterator, {
295
294
  }
296
295
  }));
297
296
 
298
- AddTableRow.propTypes = {
299
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
300
- source: PropTypes.string,
301
- defaultValue: PropTypes.any
302
- };
303
-
304
- TableFormIterator.propTypes = {
305
- addButton: PropTypes.element,
306
- children: PropTypes.node,
307
- className: PropTypes.string,
308
- field: PropTypes.object,
309
- fields: PropTypes.array,
310
- fieldState: PropTypes.object,
311
- formState: PropTypes.object,
312
- record: PropTypes.object,
313
- source: PropTypes.string,
314
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
315
- resource: PropTypes.string,
316
- translate: PropTypes.func,
317
- disableAdd: PropTypes.bool,
318
- enableClearAll: PropTypes.bool,
319
- disableRemove: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
320
- TransitionProps: PropTypes.shape({}),
321
- empty: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
322
- template: PropTypes.object
323
- };
324
-
325
297
  export interface TableFormIteratorProps extends Partial<UseFieldArrayReturn> {
326
298
  addButton?: ReactElement;
327
299
  children?: ReactNode;
@@ -345,4 +317,4 @@ export interface TableFormIteratorProps extends Partial<UseFieldArrayReturn> {
345
317
  inset?: boolean;
346
318
  }
347
319
 
348
- export default StyledTableFormIterator;
320
+ export default TableFormIterator;
@@ -1,12 +1,11 @@
1
- import * as React from 'react';
2
-
3
1
  import { Children, ReactElement, ReactNode, cloneElement, isValidElement, useMemo } from 'react';
4
2
  import { Confirm, useTranslate } from 'react-admin';
3
+ import { RaRecord } from 'ra-core';
5
4
  import { Stack, TableCell, Typography } from '@mui/material';
6
5
  import { TableFormIteratorItemContext, TableFormIteratorItemContextValue } from '../../../contexts';
7
- import ActionsMenu from '../../ActionsMenu';
8
- import { RaRecord } from 'ra-core';
9
6
  import { useTableFormIterator } from '../../../hooks';
7
+ import * as React from 'react';
8
+ import ActionsMenu from '../../ActionsMenu';
10
9
 
11
10
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
11
  export const TableFormIteratorItem = React.forwardRef((props: TableFormIteratorItemProps, ref: any) => {
@@ -1,4 +1,2 @@
1
- import TableFormIterator from './TableFormIterator';
1
+ export * from './TableFormIterator';
2
2
  export * from './TableFormIteratorItem';
3
-
4
- export default TableFormIterator;
@@ -1,10 +1,10 @@
1
- import { Toolbar as RaToolbar } from 'react-admin';
2
1
  import { styled } from '@mui/system';
2
+ import { Toolbar as RaToolbar, ToolbarProps } from 'react-admin';
3
3
 
4
4
  const StyledToolbar = styled(RaToolbar, {
5
5
  name: 'RaApplicaToolbar',
6
6
  slot: 'Root'
7
- })(({ theme }) => ({
7
+ })(({ theme }: { theme: any }) => ({
8
8
  ...theme.mixins.toolbar,
9
9
  backgroundColor: theme.palette.background.paper,
10
10
  justifyContent: 'flex-end',
@@ -21,14 +21,9 @@ const StyledToolbar = styled(RaToolbar, {
21
21
  }
22
22
  }));
23
23
 
24
- const Toolbar = (props) => <StyledToolbar {...props} />;
25
-
26
- Toolbar.defaultProps = {
27
- ...RaToolbar.defaultProps
28
- };
29
-
30
- Toolbar.propTypes = {
31
- ...RaToolbar.propTypes
32
- };
24
+ export function Toolbar(props: ToolbarProps): JSX.Element {
25
+ // @ts-ignore
26
+ return <StyledToolbar {...props} />;
27
+ }
33
28
 
34
29
  export default Toolbar;
@@ -0,0 +1,12 @@
1
+ export * from './CardForm';
2
+ export * from './ChangePasswordForm';
3
+ export * from './Create';
4
+ export * from './Edit';
5
+ export * from './FormHeader';
6
+ export * from './LongForm';
7
+ export * from './Show';
8
+ export * from './SimpleForm';
9
+ export * from './SimpleFormIterator';
10
+ export * from './TabbedForm';
11
+ export * from './TableForm';
12
+ export * from './Toolbar';
@@ -1,7 +1,6 @@
1
- import LabeledArrayInput, { LabeledArrayInputProps } from './LabeledArrayInput';
2
1
  import { ArrayInput as RaArrayInput, ArrayInputProps as RaArrayInputProps } from 'react-admin';
3
-
4
2
  import { styled } from '@mui/material/styles';
3
+ import LabeledArrayInput, { LabeledArrayInputProps } from './LabeledArrayInput';
5
4
 
6
5
  const StyledArrayInput = styled(RaArrayInput, {
7
6
  name: 'ApplicaArrayInput',
@@ -34,17 +33,18 @@ export type ArrayInputProps = RaArrayInputProps &
34
33
  * @param {ArrayInputProps}
35
34
  * @returns {React.ReactElement}
36
35
  */
37
- const ArrayInput = ({ label, addLabel, source, helperText, divider = true, ...props }: ArrayInputProps): React.ReactElement => (
38
- <LabeledArrayInput
39
- label={label}
40
- addLabel={addLabel}
41
- source={source}
42
- helperText={helperText}
43
- divider={divider}
44
- fullWidth={props?.fullWidth}
45
- >
46
- <StyledArrayInput source={source} label={false} {...props} />
47
- </LabeledArrayInput>
48
- );
49
-
36
+ export function ArrayInput({ label, addLabel, source, helperText, divider = true, ...props }: ArrayInputProps): React.ReactElement {
37
+ return (
38
+ <LabeledArrayInput
39
+ label={label}
40
+ addLabel={addLabel}
41
+ source={source}
42
+ helperText={helperText}
43
+ divider={divider}
44
+ fullWidth={props?.fullWidth}
45
+ >
46
+ <StyledArrayInput source={source} label={false} {...props} />
47
+ </LabeledArrayInput>
48
+ );
49
+ }
50
50
  export default ArrayInput;
@@ -1,11 +1,8 @@
1
- /* eslint-disable no-console */
2
- import { FileInputProps, FileInput as RaFileInput, useInput, useRecordContext } from 'react-admin';
3
-
4
1
  import { AttachmentField } from '../ra-fields';
2
+ import { FileInputProps, FileInput as RaFileInput, useInput, useRecordContext } from 'react-admin';
3
+ import { styled } from '@mui/material/styles';
5
4
  import LabeledInput from './LabeledInput';
6
- import PropTypes from 'prop-types';
7
5
  import React from 'react';
8
- import { styled } from '@mui/material/styles';
9
6
 
10
7
  const removeDeleteIfNecessary = (disabled: boolean) => {
11
8
  if (disabled) {
@@ -56,7 +53,7 @@ export type AttachmentInputProps = FileInputProps & {
56
53
  };
57
54
 
58
55
  /**
59
- * Consente di definire un campo di tipo input all'interno del quale è possibile caricare uno o più file.
56
+ * Allows you to define an input field inside which you can upload one or more files.
60
57
  *
61
58
  * @example
62
59
  * <AttachmentInput source="attachments" title="name" accept="image/*" multiple>
@@ -64,33 +61,28 @@ export type AttachmentInputProps = FileInputProps & {
64
61
  * @param {AttachmentInputProps}
65
62
  * @returns
66
63
  */
67
- const AttachmentInput = ({ children, disabled, type, ...props }: AttachmentInputProps): JSX.Element => {
64
+ export function AttachmentInput({
65
+ // @ts-ignore
66
+ children = <AttachmentField title="name" source="path" />,
67
+ multiple = true,
68
+ disabled = false,
69
+ type = 'attachment',
70
+ ...props
71
+ }: AttachmentInputProps): JSX.Element {
68
72
  const record = useRecordContext(props);
69
73
  const property = props?.source;
70
74
  const entityId = record?.id;
71
75
  useInput({ source: `__${type}__${props?.source}`, defaultValue: props?.source });
72
76
  return (
73
77
  /** @ts-ignore */
74
- <LabeledInput {...props}>
78
+ <LabeledInput {...props} disabled={disabled}>
75
79
  {/** @ts-ignore */}
76
- <StyledFileInput disabled={disabled}>{React.cloneElement(children, { ...children.props, entityId, property })}</StyledFileInput>
80
+ <StyledFileInput type={type} multiple={multiple} disabled={disabled}>
81
+ {/* @ts-ignore */}
82
+ {React.cloneElement(children, { ...children.props, entityId, property })}
83
+ </StyledFileInput>
77
84
  </LabeledInput>
78
85
  );
79
- };
80
-
81
- AttachmentInput.propTypes = {
82
- ...RaFileInput.propTypes,
83
- children: PropTypes.node,
84
- multiple: PropTypes.bool,
85
- disabled: PropTypes.bool
86
- };
87
-
88
- AttachmentInput.defaultProps = {
89
- /** @ts-ignore */
90
- children: <AttachmentField title="name" source="path" />,
91
- multiple: true,
92
- disabled: false,
93
- type: 'attachment'
94
- };
86
+ }
95
87
 
96
88
  export default AttachmentInput;
@@ -0,0 +1,27 @@
1
+ import { AutocompleteArrayInputProps, AutocompleteArrayInput as RaAutocompleteArrayInput } from 'react-admin';
2
+ import { styled } from '@mui/material/styles';
3
+ import LabeledInput from './LabeledInput';
4
+
5
+ // @ts-ignore
6
+ const StyledAutocompleteArrayInput = styled(RaAutocompleteArrayInput, {
7
+ name: 'StyledAutocompleteInput',
8
+ root: 'root'
9
+ })(({ label }) => ({
10
+ '& legend': {
11
+ width: label === false ? 0 : 'auto'
12
+ },
13
+ '& .MuiAutocomplete-inputRoot': {
14
+ padding: `0px 9px`
15
+ }
16
+ }));
17
+
18
+ export function AutocompleteArrayInput({ size = 'small', ...props }: AutocompleteArrayInputProps): JSX.Element {
19
+ return (
20
+ // @ts-ignore
21
+ <LabeledInput {...props}>
22
+ <StyledAutocompleteArrayInput size={size} />
23
+ </LabeledInput>
24
+ );
25
+ }
26
+
27
+ export default AutocompleteArrayInput;
@@ -1,7 +1,8 @@
1
- import LabeledInput from './LabeledInput';
2
- import { AutocompleteInput as RaAutocompleteInput } from 'react-admin';
1
+ import { AutocompleteInputProps, AutocompleteInput as RaAutocompleteInput } from 'react-admin';
3
2
  import { styled } from '@mui/material/styles';
3
+ import LabeledInput from './LabeledInput';
4
4
 
5
+ // @ts-ignore
5
6
  const StyledAutocompleteInput = styled(RaAutocompleteInput, {
6
7
  name: 'StyledAutocompleteInput',
7
8
  root: 'root'
@@ -9,11 +10,7 @@ const StyledAutocompleteInput = styled(RaAutocompleteInput, {
9
10
  '& legend': {
10
11
  width: label === false ? 0 : 'auto'
11
12
  },
12
- // '& label.MuiFormLabel-root[data-shrink="false"]': {
13
- // minHeight: '18px'
14
- // },
15
13
  '& .MuiAutocomplete-inputRoot': {
16
- // Serve ad allineare l'altezza di un input di tipo Autocomplete a quella degli altri campi utilizzati.
17
14
  padding: `0px 9px`
18
15
  },
19
16
  '& .MuiOutlinedInput-root.MuiInputBase-sizeSmall': {
@@ -21,24 +18,17 @@ const StyledAutocompleteInput = styled(RaAutocompleteInput, {
21
18
  }
22
19
  }));
23
20
 
24
- const AutocompleteInput = (props) => {
21
+ export function AutocompleteInput({ size = 'small', ...props }: AutocompleteInputProps): JSX.Element {
25
22
  // Sanitize props removing "perPage":
23
+ // @ts-ignore
26
24
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
25
  const { perPage, ...rest } = props;
28
26
  return (
27
+ // @ts-ignore
29
28
  <LabeledInput {...rest}>
30
- <StyledAutocompleteInput />
29
+ <StyledAutocompleteInput size={size} />
31
30
  </LabeledInput>
32
31
  );
33
- };
34
- AutocompleteInput.propTypes = {
35
- ...RaAutocompleteInput.propTypes,
36
- ...LabeledInput.propTypes
37
- };
38
-
39
- AutocompleteInput.defaultProps = {
40
- ...RaAutocompleteInput.defaultProps,
41
- size: 'small'
42
- };
32
+ }
43
33
 
44
34
  export default AutocompleteInput;
@@ -1,21 +1,22 @@
1
+ import { BooleanInputProps, BooleanInput as RaBooleanInput } from 'react-admin';
1
2
  import { styled } from '@mui/material/styles';
2
3
  import { useTheme } from '@emotion/react';
3
4
  import LabeledInput from './LabeledInput';
4
- import PropTypes from 'prop-types';
5
- import { BooleanInput as RaBooleanInput } from 'react-admin';
6
5
 
7
- const ApplicaStyledBooleanInput = styled(RaBooleanInput, {
6
+ const StyledBooleanInput = styled(RaBooleanInput, {
8
7
  name: 'RaApplicaBooleanInput',
9
8
  slot: 'Root'
10
9
  })(() => ({
11
10
  marginTop: '0 !important'
12
11
  }));
13
12
 
14
- const BooleanInput = ({ ...props }) => {
13
+ export function BooleanInput({ ...props }: BooleanInputProps): JSX.Element {
15
14
  const theme = useTheme();
16
15
  return (
16
+ // @ts-ignore
17
17
  <LabeledInput {...props}>
18
- <ApplicaStyledBooleanInput
18
+ {/** @ts-ignore */}
19
+ <StyledBooleanInput
19
20
  sx={{
20
21
  '& .MuiFormControlLabel-root': {
21
22
  marginLeft: '0 !important',
@@ -23,21 +24,13 @@ const BooleanInput = ({ ...props }) => {
23
24
  },
24
25
  '& .MuiSwitch-root': {
25
26
  margin: '0 !important',
27
+ // @ts-ignore
26
28
  marginTop: props.display === 'legend' ? 0 : `${theme.spacing(1)} !important`
27
29
  }
28
30
  }}
29
31
  />
30
32
  </LabeledInput>
31
33
  );
32
- };
33
- BooleanInput.defaultProps = {
34
- ...RaBooleanInput.defaultProps,
35
- ...LabeledInput.defaultProps
36
- };
37
- BooleanInput.propTypes = {
38
- ...RaBooleanInput.propTypes,
39
- ...LabeledInput.propTypes,
40
- horizontal: PropTypes.bool
41
- };
34
+ }
42
35
 
43
36
  export default BooleanInput;
@@ -0,0 +1,24 @@
1
+ import { DateInputProps, DateInput as RaDateInput } from 'react-admin';
2
+ import { styled } from '@mui/material/styles';
3
+ import LabeledInput from './LabeledInput';
4
+
5
+ const StyledDateInput = styled(RaDateInput, {
6
+ name: 'RaApplicaDateInput',
7
+ slot: 'root'
8
+ })(({ label }) => ({
9
+ '& legend': {
10
+ width: label === false ? 0 : 'auto'
11
+ }
12
+ }));
13
+
14
+ export function DateInput(props: DateInputProps): JSX.Element {
15
+ return (
16
+ // @ts-ignore
17
+ <LabeledInput {...props}>
18
+ {/** @ts-ignore */}
19
+ <StyledDateInput />
20
+ </LabeledInput>
21
+ );
22
+ }
23
+
24
+ export default DateInput;
@@ -1,7 +1,6 @@
1
1
  import { DateTimeInputProps, DateTimeInput as RaDateTimeInput } from 'react-admin';
2
-
3
- import LabeledInput from './LabeledInput';
4
2
  import { styled } from '@mui/material/styles';
3
+ import LabeledInput from './LabeledInput';
5
4
 
6
5
  const StyledDateInput = styled(RaDateTimeInput, {
7
6
  name: 'RaApplicaDateTimeInput',
@@ -12,21 +11,14 @@ const StyledDateInput = styled(RaDateTimeInput, {
12
11
  }
13
12
  }));
14
13
 
15
- const DateTimeInput = (props: DateTimeInputProps) => (
16
- /** @ts-ignore */
17
- <LabeledInput {...props}>
18
- {/** @ts-ignore */}
19
- <StyledDateInput />
20
- </LabeledInput>
21
- );
22
-
23
- DateTimeInput.propTypes = {
24
- ...RaDateTimeInput.propTypes,
25
- ...LabeledInput.propTypes
26
- };
27
-
28
- DateTimeInput.defaultProps = {
29
- ...LabeledInput.defaultProps
30
- };
14
+ export function DateTimeInput(props: DateTimeInputProps): JSX.Element {
15
+ return (
16
+ /** @ts-ignore */
17
+ <LabeledInput {...props}>
18
+ {/** @ts-ignore */}
19
+ <StyledDateInput />
20
+ </LabeledInput>
21
+ );
22
+ }
31
23
 
32
24
  export default DateTimeInput;
@@ -1,12 +1,10 @@
1
- import { FileInput as RaFileInput, useRecordContext } from 'react-admin';
2
- import React, { useMemo } from 'react';
3
-
4
1
  import { FileField } from '../ra-fields';
5
- import LabeledInput from './LabeledInput';
6
- import PropTypes from 'prop-types';
2
+ import { FileInput as RaFileInput, FileInputProps as RaFileInputProps, useRecordContext } from 'react-admin';
7
3
  import { get } from 'lodash';
8
4
  import { styled } from '@mui/material/styles';
9
5
  import { useWatch } from 'react-hook-form';
6
+ import LabeledInput from './LabeledInput';
7
+ import React, { useMemo } from 'react';
10
8
 
11
9
  const StyledFileInput = styled(RaFileInput, {
12
10
  name: 'RaApplicaFileInput',
@@ -32,6 +30,12 @@ const StyledFileInput = styled(RaFileInput, {
32
30
  }
33
31
  }));
34
32
 
33
+ export type FileInputProps = {
34
+ source: string;
35
+ title?: string;
36
+ children?: React.ReactNode;
37
+ } & RaFileInputProps;
38
+
35
39
  /**
36
40
  * FileInput is designed to be used as single input. It does not support multiple files and
37
41
  * can be used only for base64 encoded files using applica framework.
@@ -46,7 +50,7 @@ const StyledFileInput = styled(RaFileInput, {
46
50
  * in conjuction with Applica Framework backend API services.
47
51
  *
48
52
  */
49
- const FileInput = ({ children, title, ...props }) => {
53
+ export function FileInput({ children = <FileField source="" title="" />, title, ...props }: FileInputProps): JSX.Element {
50
54
  const file = useWatch({ name: props.source });
51
55
  const record = useRecordContext(props);
52
56
  const { source } = props;
@@ -66,33 +70,28 @@ const FileInput = ({ children, title, ...props }) => {
66
70
  }, [record, source, file]);
67
71
 
68
72
  return (
73
+ // @ts-ignore
69
74
  <LabeledInput {...props}>
75
+ {/* @ts-ignore */}
70
76
  <StyledFileInput>
71
- {React.cloneElement(children, {
72
- ...children.props,
73
- title: title || source,
74
- source,
75
- record: {
76
- ...record,
77
- [source]: file?.title || get(record, source),
78
- [`_${source}`]: file?.src || get(record, `_${source}`),
79
- [title || source]: filename
80
- }
81
- })}
77
+ {
78
+ /** @ts-ignore */
79
+ React.cloneElement(children, {
80
+ // @ts-ignore
81
+ ...children.props,
82
+ title: title || source,
83
+ source,
84
+ record: {
85
+ ...record,
86
+ [source]: file?.title || get(record, source),
87
+ [`_${source}`]: file?.src || get(record, `_${source}`),
88
+ [title || source]: filename
89
+ }
90
+ })
91
+ }
82
92
  </StyledFileInput>
83
93
  </LabeledInput>
84
94
  );
85
- };
86
-
87
- FileInput.propTypes = {
88
- ...RaFileInput.propTypes,
89
- source: PropTypes.string,
90
- title: PropTypes.string,
91
- children: PropTypes.node
92
- };
93
-
94
- FileInput.defaultProps = {
95
- children: <FileField />
96
- };
95
+ }
97
96
 
98
97
  export default FileInput;