@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.3.182",
3
+ "version": "1.3.184",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,8 +1,9 @@
1
- import { AdminUI, localStorageStore } from 'react-admin';
1
+ import { AdminUI, AdminUIProps, localStorageStore } from 'react-admin';
2
+ import AdminContext, { AdminContextProps } from './AdminContext';
2
3
 
3
- import AdminContext from './AdminContext';
4
+ export type AdminProps = AdminContextProps & AdminUIProps;
4
5
 
5
- const Admin = (props) => {
6
+ export function Admin(props: AdminProps): JSX.Element {
6
7
  const {
7
8
  authProvider,
8
9
  catchAll,
@@ -20,7 +21,7 @@ const Admin = (props) => {
20
21
  notification,
21
22
  queryClient,
22
23
  requireAuth,
23
- store,
24
+ store = localStorageStore(),
24
25
  ready,
25
26
  theme,
26
27
  title = 'React Admin'
@@ -53,15 +54,6 @@ const Admin = (props) => {
53
54
  </AdminUI>
54
55
  </AdminContext>
55
56
  );
56
- };
57
-
58
- Admin.defaultProps = {
59
- store: localStorageStore(),
60
- title: 'Applica Admin'
61
- };
62
-
63
- Admin.propTypes = {
64
- ...AdminUI.propTypes
65
- };
57
+ }
66
58
 
67
59
  export default Admin;
@@ -1,22 +1,20 @@
1
1
  import { CoreAdminContext, CoreAdminContextProps } from 'react-admin';
2
-
3
2
  import { ScrollTop } from './components';
4
3
  import { ThemeCustomization } from './themes';
5
4
 
6
5
  export type AdminContextProps = CoreAdminContextProps & {
7
6
  theme?: any;
8
7
  };
9
- const AdminContext = ({ children, theme, ...props }: AdminContextProps) => (
10
- <CoreAdminContext {...props}>
11
- <ThemeCustomization themeOverrides={theme}>
12
- <ScrollTop>
13
- {/** @ts-ignore */}
14
- {children}
15
- </ScrollTop>
16
- </ThemeCustomization>
17
- </CoreAdminContext>
18
- );
19
-
20
- AdminContext.displayName = 'ApplicaAdminContext';
21
-
8
+ export function AdminContext({ children, theme, ...props }: AdminContextProps): JSX.Element {
9
+ return (
10
+ <CoreAdminContext {...props}>
11
+ <ThemeCustomization themeOverrides={theme}>
12
+ <ScrollTop>
13
+ {/** @ts-ignore */}
14
+ {children}
15
+ </ScrollTop>
16
+ </ThemeCustomization>
17
+ </CoreAdminContext>
18
+ );
19
+ }
22
20
  export default AdminContext;
@@ -1,7 +1,7 @@
1
- import { AdminProps, AuthProvider, DataProvider } from 'react-admin';
1
+ import { AdminProps, AuthProvider, DataProvider, I18nProvider } from 'react-admin';
2
2
  import { AppConfigProvider, MenuConfigProvider, ThemeConfig, ThemeConfigProvider } from './contexts';
3
3
  import { CatchResult, useErrorEventCatcher } from './dev';
4
- import { GenericErrorPage, Layout, LoginPage, MainIcon, Notification, SmallIcon } from './components';
4
+ import { GenericErrorPage, Layout, LoginPage, MainIcon, Notification, SmallIcon, AuthBackground } from './components';
5
5
  import React, { useMemo } from 'react';
6
6
  import { useI18nProvider } from './i18n';
7
7
  import Admin from './Admin';
@@ -92,12 +92,13 @@ export type ApplicaAdminProps = AdminProps & {
92
92
  error: React.Component;
93
93
  /**
94
94
  * Indicates the name of the REST resource to use for notification management.
95
+ * The REST resource must be compatible with standard CRUD operations.
95
96
  * @default "entities/notification"
96
97
  * @example
97
98
  * // In this case, notifications will be managed through the "entities/notification" resource
98
- * <ApplicaAdmin notification="entities/notification" />
99
+ * <ApplicaAdmin notificationAPI="entities/notification" />
99
100
  */
100
- notification: string;
101
+ notificationAPI: string;
101
102
  /**
102
103
  * Indicates whether notifications should be disabled.
103
104
  * If notifications are enabled, an icon will automatically appear in the top right of the header.
@@ -147,37 +148,33 @@ export type ApplicaAdminProps = AdminProps & {
147
148
 
148
149
  /**
149
150
  * Define a basic super cool application based on React Admin, Mantis Theme and our style.
150
- *
151
- * @author A-Team - The Applica Software Guru
152
- * @param {ApplicaAdminProps}
153
- * @returns {React.ReactElement}
154
151
  */
155
- const ApplicaAdmin = ({
152
+ export function ApplicaAdmin({
156
153
  theme,
157
154
  themeConfig,
158
155
  apiUrl,
159
- defaultLocale,
160
- development,
156
+ defaultLocale = 'en',
157
+ development = false,
161
158
  logoMain,
162
159
  logoIcon,
163
- loginPage,
160
+ loginPage = <LoginPage version="0.0.0" name="Applica" redirectTo="/" background={<AuthBackground />} />,
164
161
  menu,
165
162
  name,
166
163
  copy,
167
- version,
164
+ version = '0.0.0',
168
165
  dataProvider,
169
166
  authProvider,
170
167
  errorHandler,
171
168
  error,
172
- notification,
173
- enableNotification,
174
- enableRegistration,
175
- enablePasswordRecover,
176
- queryClient,
169
+ enableNotification = false,
170
+ enableRegistration = false,
171
+ enablePasswordRecover = false,
172
+ enableThemeToggler = false,
173
+ queryClient = defaultQueryClient,
177
174
  background,
178
- enableThemeToggler,
175
+ notificationAPI = 'entities/notification',
179
176
  ...props
180
- }: ApplicaAdminProps) => {
177
+ }: ApplicaAdminProps): JSX.Element {
181
178
  useErrorEventCatcher({
182
179
  apiUrl,
183
180
  errorHandler,
@@ -188,6 +185,7 @@ const ApplicaAdmin = ({
188
185
  'Invalid prop `file` of type `string` supplied to `FileInputPreview`, expected `object`.',
189
186
  'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(Switch)`, expected `boolean`.',
190
187
  'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(SwitchBase)`, expected `boolean`.',
188
+ 'Support for defaultProps will be removed from function components in a future major release.',
191
189
  'validateDOMNesting(...): <form> cannot appear as a descendant of <form>.',
192
190
  'Missing translation for key:',
193
191
  'HttpError: '
@@ -230,20 +228,20 @@ const ApplicaAdmin = ({
230
228
  version={version}
231
229
  logoMain={_logoMain}
232
230
  logoIcon={_logoIcon}
233
- notification={notification}
231
+ notification={notificationAPI}
234
232
  enableNotification={enableNotification}
235
233
  error={error}
236
234
  />
237
235
  );
238
236
  },
239
- [logoMain, logoIcon, name, version, error, notification, enableNotification]
237
+ [logoMain, logoIcon, name, version, error, notificationAPI, enableNotification]
240
238
  );
241
239
  const i18nProvider = useI18nProvider({
242
240
  apiUrl: apiUrl,
243
241
  defaultLocale: defaultLocale,
244
242
  allowMissing: development,
245
243
  createMissing: development
246
- });
244
+ }) as I18nProvider;
247
245
 
248
246
  if (i18nProvider === undefined) {
249
247
  return <></>;
@@ -276,20 +274,6 @@ const ApplicaAdmin = ({
276
274
  </MenuConfigProvider>
277
275
  </AppConfigProvider>
278
276
  );
279
- };
277
+ }
280
278
 
281
- ApplicaAdmin.defaultProps = {
282
- ...Admin.defaultProps,
283
- fileFields: [],
284
- defaultLocale: 'en',
285
- development: false,
286
- version: '0.0.0',
287
- notification: 'entities/notification',
288
- enableNotification: false,
289
- enableRegistration: false,
290
- enableForgotPassword: false,
291
- loginPage: <LoginPage version="0.0.0" name="Applica" redirectTo="/" />,
292
- queryClient: defaultQueryClient,
293
- enableThemeToggler: false
294
- };
295
279
  export default ApplicaAdmin;
@@ -29,7 +29,7 @@ const renderBreadcrumb = ({ id, title, icon, url, last }) => {
29
29
  };
30
30
 
31
31
  const Breadcrumbs = ({
32
- home,
32
+ home = 'Home',
33
33
  card,
34
34
  divider = true,
35
35
  icon,
@@ -42,7 +42,7 @@ const Breadcrumbs = ({
42
42
  titleBottom,
43
43
  sx,
44
44
  breadcrumbs,
45
- mode,
45
+ mode = 'navigation',
46
46
  ...others
47
47
  }) => {
48
48
  const theme = useTheme();
@@ -277,8 +277,4 @@ const Breadcrumbs = ({
277
277
 
278
278
  return breadcrumbContent;
279
279
  };
280
- Breadcrumbs.defaultProps = {
281
- home: 'Home',
282
- mode: 'navigation'
283
- };
284
280
  export default Breadcrumbs;
@@ -1,7 +1,7 @@
1
1
  import { Box } from '@mui/material';
2
2
  import { useTheme } from '@emotion/react';
3
3
 
4
- const AuthBackground = () => {
4
+ export function AuthBackground(): JSX.Element {
5
5
  const theme = useTheme() as any;
6
6
  const isDark = theme.palette.mode === 'dark';
7
7
  const color = isDark ? theme.palette.primary.dark : theme.palette.primary.light;
@@ -96,6 +96,6 @@ const AuthBackground = () => {
96
96
  </svg>
97
97
  </Box>
98
98
  );
99
- };
99
+ }
100
100
 
101
101
  export default AuthBackground;
@@ -10,7 +10,7 @@ type IDrawerProps = React.PropsWithChildren<{
10
10
  sx?: SxProps;
11
11
  }>;
12
12
 
13
- function Drawer(props: IDrawerProps) {
13
+ export function Drawer(props: IDrawerProps): JSX.Element {
14
14
  const theme = useTheme(),
15
15
  sx = useSx(props, { flexShrink: { md: 0 }, zIndex: 1200 }),
16
16
  { downLg } = useLayoutMediaState(),
@@ -58,5 +58,4 @@ function Drawer(props: IDrawerProps) {
58
58
  </Box>
59
59
  );
60
60
  }
61
-
62
- export { Drawer };
61
+ export default Drawer;
@@ -8,7 +8,7 @@ type IDrawerHeaderType = React.PropsWithChildren<{
8
8
  sx?: SxProps;
9
9
  }>;
10
10
 
11
- function DrawerHeader(props: IDrawerHeaderType) {
11
+ export function DrawerHeader(props: IDrawerHeaderType): JSX.Element {
12
12
  const theme = useTheme(),
13
13
  { horizontal } = useLayoutMediaState(),
14
14
  { open } = useLayoutDrawerState(),
@@ -28,4 +28,4 @@ function DrawerHeader(props: IDrawerHeaderType) {
28
28
  );
29
29
  }
30
30
 
31
- export { DrawerHeader };
31
+ export default DrawerHeader;
@@ -1,8 +1,7 @@
1
1
  import { Box } from '@mui/material';
2
- import PropTypes from 'prop-types';
3
2
  import { styled } from '@mui/material/styles';
4
3
 
5
- const DrawerHeaderStyled = styled(Box, { shouldForwardProp: (prop) => prop !== 'open' })(({ theme, open }) => ({
4
+ export const DrawerHeaderStyled = styled(Box, { shouldForwardProp: (prop) => prop !== 'open' })(({ theme, open }) => ({
6
5
  ...theme.mixins.toolbar,
7
6
  display: 'flex',
8
7
  alignItems: 'center',
@@ -10,9 +9,4 @@ const DrawerHeaderStyled = styled(Box, { shouldForwardProp: (prop) => prop !== '
10
9
  paddingLeft: theme.spacing(open ? 3 : 0)
11
10
  }));
12
11
 
13
- DrawerHeaderStyled.propTypes = {
14
- theme: PropTypes.object,
15
- open: PropTypes.bool
16
- };
17
-
18
- export { DrawerHeaderStyled };
12
+ export default DrawerHeaderStyled;
@@ -1,7 +1,5 @@
1
1
  import { Stack, Typography } from '@mui/material';
2
2
 
3
- import PropTypes from 'prop-types';
4
-
5
3
  type IFooterProps = {
6
4
  name: string;
7
5
  version: string;
@@ -9,23 +7,14 @@ type IFooterProps = {
9
7
  };
10
8
 
11
9
  function Footer(props: IFooterProps) {
12
- const { name, version } = props;
10
+ const { name, version, copy = '&copy; Applica Software Guru for' } = props;
13
11
  return (
14
12
  <Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ p: '24px 16px 0px', mt: 'auto' }}>
15
13
  <Typography variant="caption">
16
- <span dangerouslySetInnerHTML={{ __html: props?.copy || '' }} /> {name} - {version}
14
+ <span dangerouslySetInnerHTML={{ __html: copy || '' }} /> {name} - {version}
17
15
  </Typography>
18
16
  </Stack>
19
17
  );
20
18
  }
21
19
 
22
- Footer.propTypes = {
23
- name: PropTypes.string.isRequired,
24
- version: PropTypes.string.isRequired,
25
- copy: PropTypes.string
26
- };
27
- Footer.defaultProps = {
28
- copy: '&copy; Applica Software Guru for'
29
- };
30
-
31
20
  export { Footer };
@@ -0,0 +1,29 @@
1
+ import AppBar from '@mui/material/AppBar';
2
+ import { styled } from '@mui/material/styles';
3
+ import { useThemeConfig } from '../../../hooks';
4
+
5
+ export const AppBarStyled = styled(AppBar, { shouldForwardProp: (prop) => prop !== 'open' })(
6
+ ({ theme, open }: { theme: any; open: boolean }) => {
7
+ const { drawerWidth } = useThemeConfig();
8
+ return {
9
+ zIndex: theme.zIndex.drawer + 1,
10
+ transition: theme.transitions.create(['width', 'margin'], {
11
+ easing: theme.transitions.easing.sharp,
12
+ duration: theme.transitions.duration.leavingScreen
13
+ }),
14
+ ...(!open && {
15
+ width: `calc(100% - ${theme.spacing(7.5)})`
16
+ }),
17
+ ...(open && {
18
+ marginLeft: drawerWidth,
19
+ width: `calc(100% - ${drawerWidth}px)`,
20
+ transition: theme.transitions.create(['width', 'margin'], {
21
+ easing: theme.transitions.easing.sharp,
22
+ duration: theme.transitions.duration.enteringScreen
23
+ })
24
+ })
25
+ };
26
+ }
27
+ );
28
+
29
+ export default AppBarStyled;
@@ -50,7 +50,6 @@ const Layout = withLayoutProvider(function Layout(props: ILayoutProps) {
50
50
  divider={false}
51
51
  icon
52
52
  icons
53
- home={false}
54
53
  />
55
54
  )}
56
55
  {props.children}
@@ -0,0 +1,15 @@
1
+ import { Notification as RaNotification, NotificationProps } from 'react-admin';
2
+ import { styled } from '@mui/material/styles';
3
+
4
+ const StyledNotification = styled(
5
+ RaNotification,
6
+ {}
7
+ )(({ theme }) => ({
8
+ '& *': {
9
+ fontSize: theme.typography.body1.fontSize
10
+ }
11
+ }));
12
+ export function Notification(props: NotificationProps) {
13
+ return <StyledNotification {...props} />;
14
+ }
15
+ export default Notification;
@@ -1,3 +1,4 @@
1
+ export * from './AuthBackground';
1
2
  import ActionsMenu from './ActionsMenu';
2
3
  import Layout from './Layout';
3
4
  import Loadable from './Loadable';
@@ -16,7 +16,6 @@ import React, { useCallback, useState } from 'react';
16
16
  import { SxProps, Theme, styled } from '@mui/material/styles';
17
17
 
18
18
  import { Add } from '@mui/icons-material';
19
- import PropTypes from 'prop-types';
20
19
  import { Toolbar } from '../ra-forms';
21
20
  import clsx from 'clsx';
22
21
  import { useAppConfig } from '../../hooks';
@@ -43,7 +42,7 @@ const setListQueryData = (res: any, data: any) =>
43
42
  export type CreateInDialogContentProps = {
44
43
  onClose: () => void;
45
44
  record?: any;
46
- redirect: RedirectionSideEffect;
45
+ redirect: RedirectionSideEffect | boolean | undefined;
47
46
  children: React.ReactElement;
48
47
  onSubmit?: (record: any, close: () => void) => void;
49
48
  onSuccess?: (data: any) => void;
@@ -54,7 +53,7 @@ const CreateInDialogContent = ({
54
53
  onClose,
55
54
  record,
56
55
  children,
57
- redirect: _redirect,
56
+ redirect: _redirect = false,
58
57
  onSubmit,
59
58
  onSuccess,
60
59
  onError
@@ -80,7 +79,7 @@ const CreateInDialogContent = ({
80
79
  onClose();
81
80
  notify('ra.notification.created');
82
81
  if (_redirect !== undefined) {
83
- redirect(_redirect, resource, data.id, data);
82
+ redirect(_redirect as RedirectionSideEffect, resource, data.id, data);
84
83
  }
85
84
  if (onSuccess) {
86
85
  onSuccess(data);
@@ -128,15 +127,6 @@ const CreateInDialogContent = ({
128
127
  );
129
128
  };
130
129
 
131
- CreateInDialogContent.propTypes = {
132
- children: PropTypes.node,
133
- onClose: PropTypes.func,
134
- record: PropTypes.object,
135
- redirect: PropTypes.oneOf(['list', 'edit', 'show', false])
136
- };
137
- CreateInDialogContent.defaultProps = {
138
- redirect: false
139
- };
140
130
  const scrollStates = {
141
131
  true: { _scrollToTop: true },
142
132
  false: {}
@@ -174,25 +164,22 @@ export type CreateInDialogButtonProps = {
174
164
  };
175
165
 
176
166
  /**
177
- * Consente di gestire la creazione di un record, per una specifica entità, o in modalità completamente personalizzata, all'interno di una dialog.
178
- *
179
- * @param {CreateInDialogButtonProps}
180
- * @returns {React.ReactElement}
167
+ * Allows you to handle the creation of a record, for a specific entity, or in completely custom mode, within a dialog.
181
168
  */
182
- const CreateInDialogButton = ({
183
- fullWidth,
184
- maxWidth,
185
- label,
169
+ export function CreateInDialogButton({
170
+ fullWidth = true,
171
+ maxWidth = 'md',
172
+ label = 'ra.action.create',
186
173
  record,
187
174
  redirect,
188
- scrollToTop,
175
+ scrollToTop = true,
189
176
  className,
190
177
  sx,
191
178
  onSubmit,
192
179
  onSuccess,
193
180
  onError,
194
181
  ...props
195
- }: CreateInDialogButtonProps): React.ReactElement => {
182
+ }: CreateInDialogButtonProps): JSX.Element {
196
183
  const [open, setOpen] = useState(false);
197
184
  const translate = useTranslate();
198
185
  const resource = useResourceContext();
@@ -244,29 +231,6 @@ const CreateInDialogButton = ({
244
231
  </Dialog>
245
232
  </>
246
233
  );
247
- };
248
-
249
- CreateInDialogButton.defaultProps = {
250
- fullWidth: true,
251
- maxWidth: 'md',
252
- label: 'ra.action.create',
253
- scrollToTop: true
254
- };
255
-
256
- CreateInDialogButton.propTypes = {
257
- ...Button.propTypes,
258
- redirect: PropTypes.oneOf(['list', 'edit', 'show', false]),
259
- fullWidth: PropTypes.bool,
260
- maxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]),
261
- label: PropTypes.string,
262
- record: PropTypes.object,
263
- scrollToTop: PropTypes.bool,
264
- className: PropTypes.string,
265
- sx: PropTypes.object,
266
- children: PropTypes.node,
267
- onSubmit: PropTypes.func,
268
- onSuccess: PropTypes.func,
269
- onError: PropTypes.func
270
- };
234
+ }
271
235
 
272
236
  export default CreateInDialogButton;
@@ -11,13 +11,16 @@ import {
11
11
  } from 'react-admin';
12
12
  import React, { useCallback, useState } from 'react';
13
13
 
14
- import { Dialog } from '@mui/material';
14
+ import { Breakpoint, Dialog } from '@mui/material';
15
15
  import { Edit } from '@mui/icons-material';
16
- import PropTypes from 'prop-types';
17
16
  import { Toolbar } from '../ra-forms';
18
17
  import { useAppConfig } from '../../hooks';
19
18
 
20
- const EditInDialogContent = ({ onClose, children }) => {
19
+ type EditInDialogContentProps = {
20
+ onClose: () => void;
21
+ children: React.ReactElement;
22
+ };
23
+ const EditInDialogContent = ({ onClose, children }: EditInDialogContentProps) => {
21
24
  const notify = useNotify();
22
25
  const record = useRecordContext();
23
26
  const resource = useResourceContext();
@@ -44,6 +47,7 @@ const EditInDialogContent = ({ onClose, children }) => {
44
47
 
45
48
  return (
46
49
  <EditContextProvider
50
+ // @ts-ignore
47
51
  value={{
48
52
  record: data,
49
53
  isLoading,
@@ -63,12 +67,19 @@ const EditInDialogContent = ({ onClose, children }) => {
63
67
  );
64
68
  };
65
69
 
66
- EditInDialogContent.propTypes = {
67
- children: PropTypes.node,
68
- onClose: PropTypes.func
70
+ export type EditInDialogButtonProps = {
71
+ fullWidth?: boolean;
72
+ maxWidth?: false | Breakpoint | undefined;
73
+ label?: string;
74
+ children: React.ReactElement;
69
75
  };
70
76
 
71
- const EditInDialogButton = ({ fullWidth, maxWidth, label, ...props }) => {
77
+ export function EditInDialogButton({
78
+ fullWidth = true,
79
+ maxWidth = 'md',
80
+ label = 'ra.action.edit',
81
+ ...props
82
+ }: EditInDialogButtonProps): JSX.Element {
72
83
  const [open, setOpen] = useState(false);
73
84
  const { openDialog, closeDialog } = useAppConfig();
74
85
  const resource = useResourceContext();
@@ -92,22 +103,10 @@ const EditInDialogButton = ({ fullWidth, maxWidth, label, ...props }) => {
92
103
  fullWidth={fullWidth}
93
104
  maxWidth={maxWidth}
94
105
  >
95
- <EditInDialogContent {...props} onClose={handleClose} />
106
+ <EditInDialogContent onClose={handleClose}>{props?.children}</EditInDialogContent>
96
107
  </Dialog>
97
108
  </>
98
109
  );
99
- };
100
-
101
- EditInDialogButton.defaultProps = {
102
- fullWidth: true,
103
- maxWidth: 'md',
104
- label: 'ra.action.edit'
105
- };
106
-
107
- EditInDialogButton.propTypes = {
108
- fullWidth: PropTypes.bool,
109
- maxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]),
110
- label: PropTypes.string
111
- };
110
+ }
112
111
 
113
112
  export default EditInDialogButton;
@@ -1,15 +1,17 @@
1
1
  import { Button, useAuthProvider, useRecordContext } from 'react-admin';
2
2
  import React, { useCallback, useState } from 'react';
3
-
4
- import PropTypes from 'prop-types';
5
3
  import { VpnKey } from '@mui/icons-material';
6
4
 
7
- const ImpersonateUserButton = ({ label = 'ra.auth.sign_in', ...props }) => {
5
+ export type ImpersonateUserButtonProps = {
6
+ label?: string;
7
+ };
8
+
9
+ export function ImpersonateUserButton({ label = 'ra.auth.sign_in', ...props }: ImpersonateUserButtonProps): JSX.Element {
8
10
  const record = useRecordContext();
9
11
  const [loading, setLoading] = useState(false);
10
12
  const authProvider = useAuthProvider();
11
13
  const handleClick = useCallback(
12
- (e) => {
14
+ (e: Event) => {
13
15
  e.stopPropagation();
14
16
  e.preventDefault();
15
17
  setLoading(true);
@@ -26,16 +28,13 @@ const ImpersonateUserButton = ({ label = 'ra.auth.sign_in', ...props }) => {
26
28
  color="primary"
27
29
  variant="text"
28
30
  label={label}
31
+ // @ts-ignore
29
32
  onClick={handleClick}
30
33
  {...props}
31
34
  >
32
35
  <VpnKey />
33
36
  </Button>
34
37
  );
35
- };
36
-
37
- ImpersonateUserButton.propTypes = {
38
- label: PropTypes.string
39
- };
38
+ }
40
39
 
41
40
  export default ImpersonateUserButton;
@@ -0,0 +1,3 @@
1
+ export * from './ImpersonateUserButton';
2
+ export * from './CreateInDialogButton';
3
+ export * from './EditInDialogButton';