@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.
- package/dist/Admin.d.ts +5 -8
- package/dist/Admin.d.ts.map +1 -1
- package/dist/AdminContext.d.ts +2 -4
- package/dist/AdminContext.d.ts.map +1 -1
- package/dist/ApplicaAdmin.d.ts +4 -24
- package/dist/ApplicaAdmin.d.ts.map +1 -1
- package/dist/components/@extended/Breadcrumbs.d.ts +2 -8
- package/dist/components/AuthBackground.d.ts +2 -1
- package/dist/components/AuthBackground.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/Drawer.d.ts +2 -2
- package/dist/components/Layout/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeader.d.ts +2 -2
- package/dist/components/Layout/Drawer/DrawerHeader.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeaderStyled.d.ts +1 -0
- package/dist/components/Layout/Drawer/DrawerHeaderStyled.d.ts.map +1 -1
- package/dist/components/Layout/Footer.d.ts +0 -11
- package/dist/components/Layout/Footer.d.ts.map +1 -1
- package/dist/components/Layout/Header/AppBarStyled.d.ts +7 -3
- package/dist/components/Layout/Header/AppBarStyled.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Notification.d.ts +3 -6
- package/dist/components/Notification.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts +3 -33
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-buttons/EditInDialogButton.d.ts +9 -22
- package/dist/components/ra-buttons/EditInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-buttons/ImpersonateUserButton.d.ts +5 -10
- package/dist/components/ra-buttons/ImpersonateUserButton.d.ts.map +1 -1
- package/dist/components/ra-buttons/index.d.ts +3 -4
- package/dist/components/ra-buttons/index.d.ts.map +1 -1
- package/dist/components/ra-custom/ListItem.d.ts +1 -20
- package/dist/components/ra-custom/ListItem.d.ts.map +1 -1
- package/dist/components/ra-custom/index.d.ts +1 -2
- package/dist/components/ra-custom/index.d.ts.map +1 -1
- package/dist/components/ra-fields/ActionsField.d.ts +7 -21
- package/dist/components/ra-fields/ActionsField.d.ts.map +1 -1
- package/dist/components/ra-fields/AttachmentField.d.ts +2 -25
- package/dist/components/ra-fields/AttachmentField.d.ts.map +1 -1
- package/dist/components/ra-fields/BaseAttachmentField.d.ts +1 -15
- package/dist/components/ra-fields/BaseAttachmentField.d.ts.map +1 -1
- package/dist/components/ra-fields/CoverField.d.ts +10 -31
- package/dist/components/ra-fields/CoverField.d.ts.map +1 -1
- package/dist/components/ra-fields/DateAgoField.d.ts +6 -8
- package/dist/components/ra-fields/DateAgoField.d.ts.map +1 -1
- package/dist/components/ra-fields/DateField.d.ts +3 -5
- package/dist/components/ra-fields/DateField.d.ts.map +1 -1
- package/dist/components/ra-fields/EmailField.d.ts +3 -16
- package/dist/components/ra-fields/EmailField.d.ts.map +1 -1
- package/dist/components/ra-fields/FileField.d.ts +8 -25
- package/dist/components/ra-fields/FileField.d.ts.map +1 -1
- package/dist/components/ra-fields/FunctionField.d.ts +3 -6
- package/dist/components/ra-fields/FunctionField.d.ts.map +1 -1
- package/dist/components/ra-fields/ImageField.d.ts +3 -18
- package/dist/components/ra-fields/ImageField.d.ts.map +1 -1
- package/dist/components/ra-fields/LocalizedTextField.d.ts +3 -2
- package/dist/components/ra-fields/LocalizedTextField.d.ts.map +1 -1
- package/dist/components/ra-fields/ReadonlyField.d.ts +1 -1
- package/dist/components/ra-fields/ReadonlyField.d.ts.map +1 -1
- package/dist/components/ra-fields/ReferenceManyField.d.ts +7 -16
- package/dist/components/ra-fields/ReferenceManyField.d.ts.map +1 -1
- package/dist/components/ra-fields/SizeField.d.ts +6 -11
- package/dist/components/ra-fields/SizeField.d.ts.map +1 -1
- package/dist/components/ra-fields/TextField.d.ts +3 -5
- package/dist/components/ra-fields/TextField.d.ts.map +1 -1
- package/dist/components/ra-fields/index.d.ts +14 -15
- package/dist/components/ra-fields/index.d.ts.map +1 -1
- package/dist/components/ra-forms/CardForm.d.ts +22 -26
- package/dist/components/ra-forms/CardForm.d.ts.map +1 -1
- package/dist/components/ra-forms/ChangePasswordForm.d.ts +2 -1
- package/dist/components/ra-forms/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/ra-forms/Create.d.ts +3 -4
- package/dist/components/ra-forms/Create.d.ts.map +1 -1
- package/dist/components/ra-forms/Edit.d.ts +3 -2
- package/dist/components/ra-forms/Edit.d.ts.map +1 -1
- package/dist/components/ra-forms/FormHeader.d.ts +4 -20
- package/dist/components/ra-forms/FormHeader.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Content.d.ts +1 -1
- package/dist/components/ra-forms/LongForm/Content.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Form.d.ts +1 -1
- package/dist/components/ra-forms/LongForm/Form.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/NavMenu.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Provider.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Sidebar.d.ts +1 -1
- package/dist/components/ra-forms/LongForm/Sidebar.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Tab.d.ts +2 -2
- package/dist/components/ra-forms/LongForm/Tab.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/hooks.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/index.d.ts +2 -2
- package/dist/components/ra-forms/LongForm/index.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/utils.d.ts +1 -1
- package/dist/components/ra-forms/LongForm/utils.d.ts.map +1 -1
- package/dist/components/ra-forms/Show.d.ts +3 -12
- package/dist/components/ra-forms/Show.d.ts.map +1 -1
- package/dist/components/ra-forms/SimpleForm.d.ts +1 -30
- package/dist/components/ra-forms/SimpleForm.d.ts.map +1 -1
- package/dist/components/ra-forms/SimpleFormIterator.d.ts +1 -3
- package/dist/components/ra-forms/SimpleFormIterator.d.ts.map +1 -1
- package/dist/components/ra-forms/TabbedForm.d.ts +5 -9
- package/dist/components/ra-forms/TabbedForm.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts +21 -22
- package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/TableFormIteratorItem.d.ts +1 -1
- package/dist/components/ra-forms/TableForm/TableFormIteratorItem.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/index.d.ts +1 -2
- package/dist/components/ra-forms/TableForm/index.d.ts.map +1 -1
- package/dist/components/ra-forms/Toolbar.d.ts +3 -9
- package/dist/components/ra-forms/Toolbar.d.ts.map +1 -1
- package/dist/components/ra-forms/index.d.ts +12 -14
- package/dist/components/ra-forms/index.d.ts.map +1 -1
- package/dist/components/ra-inputs/ArrayInput.d.ts +3 -2
- package/dist/components/ra-inputs/ArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/AttachmentInput.d.ts +2 -32
- package/dist/components/ra-inputs/AttachmentInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/AutocompleteArrayInput.d.ts +3 -7
- package/dist/components/ra-inputs/AutocompleteArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/AutocompleteInput.d.ts +3 -5
- package/dist/components/ra-inputs/AutocompleteInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/BooleanInput.d.ts +3 -22
- package/dist/components/ra-inputs/BooleanInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/DateInput.d.ts +3 -16
- package/dist/components/ra-inputs/DateInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/DateTimeInput.d.ts +2 -19
- package/dist/components/ra-inputs/DateTimeInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/FileInput.d.ts +9 -32
- package/dist/components/ra-inputs/FileInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ImageInput.d.ts +9 -12
- package/dist/components/ra-inputs/ImageInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/LabeledArrayInput.d.ts +2 -24
- package/dist/components/ra-inputs/LabeledArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/LabeledInput.d.ts +1 -20
- package/dist/components/ra-inputs/LabeledInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/LocalizedTextInput.d.ts +2 -2
- package/dist/components/ra-inputs/LocalizedTextInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/NumberInput.d.ts +3 -22
- package/dist/components/ra-inputs/NumberInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/RecordInput.d.ts +7 -13
- package/dist/components/ra-inputs/RecordInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceArrayInput.d.ts +6 -22
- package/dist/components/ra-inputs/ReferenceArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceInput.d.ts +6 -23
- package/dist/components/ra-inputs/ReferenceInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceManyInput.d.ts +10 -12
- package/dist/components/ra-inputs/ReferenceManyInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SearchInput.d.ts +3 -1
- package/dist/components/ra-inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SelectArrayInput.d.ts +3 -26
- package/dist/components/ra-inputs/SelectArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SelectInput.d.ts +3 -2
- package/dist/components/ra-inputs/SelectInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SmartTextInput.d.ts +6 -26
- package/dist/components/ra-inputs/SmartTextInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/TextInput.d.ts +2 -16
- package/dist/components/ra-inputs/TextInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/TimeInput.d.ts +3 -16
- package/dist/components/ra-inputs/TimeInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/index.d.ts +23 -24
- package/dist/components/ra-inputs/index.d.ts.map +1 -1
- package/dist/components/ra-lists/BulkActionsToolbar.d.ts +1 -8
- package/dist/components/ra-lists/BulkActionsToolbar.d.ts.map +1 -1
- package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts +1 -7
- package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts.map +1 -1
- package/dist/components/ra-lists/Datagrid/Datagrid.d.ts +1 -1
- package/dist/components/ra-lists/Datagrid/Datagrid.d.ts.map +1 -1
- package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts +1 -1
- package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts.map +1 -1
- package/dist/components/ra-lists/Datagrid/index.d.ts +1 -4
- package/dist/components/ra-lists/Datagrid/index.d.ts.map +1 -1
- package/dist/components/ra-lists/Empty.d.ts +1 -11
- package/dist/components/ra-lists/Empty.d.ts.map +1 -1
- package/dist/components/ra-lists/List.d.ts +2 -26
- package/dist/components/ra-lists/List.d.ts.map +1 -1
- package/dist/components/ra-lists/ListView.d.ts +1 -16
- package/dist/components/ra-lists/ListView.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/NotificationList.d.ts +4 -3
- package/dist/components/ra-lists/NotificationList/NotificationList.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/buttons/MarkAsReadedButton.d.ts +4 -0
- package/dist/components/ra-lists/NotificationList/buttons/MarkAsReadedButton.d.ts.map +1 -0
- package/dist/components/ra-lists/NotificationList/buttons/MarkAsUnreadedButton.d.ts +4 -0
- package/dist/components/ra-lists/NotificationList/buttons/MarkAsUnreadedButton.d.ts.map +1 -0
- package/dist/components/ra-lists/NotificationList/buttons/index.d.ts +3 -0
- package/dist/components/ra-lists/NotificationList/buttons/index.d.ts.map +1 -0
- package/dist/components/ra-lists/NotificationList/fields/NotificationField.d.ts +4 -0
- package/dist/components/ra-lists/NotificationList/fields/NotificationField.d.ts.map +1 -0
- package/dist/components/ra-lists/NotificationList/fields/index.d.ts +2 -0
- package/dist/components/ra-lists/NotificationList/fields/index.d.ts.map +1 -0
- package/dist/components/ra-lists/NotificationList/index.d.ts +1 -2
- package/dist/components/ra-lists/NotificationList/index.d.ts.map +1 -1
- package/dist/components/ra-lists/SimpleList.d.ts +3 -3
- package/dist/components/ra-lists/SimpleList.d.ts.map +1 -1
- package/dist/components/ra-lists/index.d.ts +7 -7
- package/dist/components/ra-lists/index.d.ts.map +1 -1
- package/dist/components/ra-pages/LoginPage.d.ts +2 -16
- package/dist/components/ra-pages/LoginPage.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +67 -67
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +11554 -12406
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +67 -67
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/{Admin.jsx → Admin.tsx} +6 -14
- package/src/AdminContext.tsx +12 -14
- package/src/ApplicaAdmin.tsx +22 -38
- package/src/components/@extended/Breadcrumbs.jsx +2 -6
- package/src/components/AuthBackground.tsx +2 -2
- package/src/components/Layout/Drawer/Drawer.tsx +2 -3
- package/src/components/Layout/Drawer/DrawerHeader.tsx +2 -2
- package/src/components/Layout/Drawer/DrawerHeaderStyled.jsx +2 -8
- package/src/components/Layout/Footer.tsx +2 -13
- package/src/components/Layout/Header/AppBarStyled.tsx +29 -0
- package/src/components/Layout/Layout.tsx +0 -1
- package/src/components/Notification.tsx +15 -0
- package/src/components/index.jsx +1 -0
- package/src/components/ra-buttons/CreateInDialogButton.tsx +11 -47
- package/src/components/ra-buttons/{EditInDialogButton.jsx → EditInDialogButton.tsx} +20 -21
- package/src/components/ra-buttons/{ImpersonateUserButton.jsx → ImpersonateUserButton.tsx} +8 -9
- package/src/components/ra-buttons/index.ts +3 -0
- package/src/components/ra-custom/ListItem.tsx +4 -39
- package/src/components/ra-custom/index.ts +1 -0
- package/src/components/ra-fields/{ActionsField.jsx → ActionsField.tsx} +8 -16
- package/src/components/ra-fields/AttachmentField.tsx +4 -14
- package/src/components/ra-fields/BaseAttachmentField.tsx +2 -16
- package/src/components/ra-fields/{CoverField.jsx → CoverField.tsx} +17 -28
- package/src/components/ra-fields/{DateAgoField.jsx → DateAgoField.tsx} +8 -11
- package/src/components/ra-fields/DateField.tsx +14 -0
- package/src/components/ra-fields/EmailField.tsx +13 -0
- package/src/components/ra-fields/{FileField.jsx → FileField.tsx} +17 -13
- package/src/components/ra-fields/FunctionField.tsx +7 -0
- package/src/components/ra-fields/{ImageField.jsx → ImageField.tsx} +3 -9
- package/src/components/ra-fields/LocalizedTextField.tsx +3 -3
- package/src/components/ra-fields/ReadonlyField.tsx +4 -3
- package/src/components/ra-fields/ReferenceManyField.tsx +24 -35
- package/src/components/ra-fields/{SizeField.jsx → SizeField.tsx} +8 -9
- package/src/components/ra-fields/TextField.tsx +14 -0
- package/src/components/ra-fields/index.ts +14 -0
- package/src/components/ra-forms/CardForm.tsx +102 -0
- package/src/components/ra-forms/ChangePasswordForm.tsx +4 -6
- package/src/components/ra-forms/Create.tsx +6 -8
- package/src/components/ra-forms/{Edit.jsx → Edit.tsx} +5 -5
- package/src/components/ra-forms/FormHeader.tsx +5 -23
- package/src/components/ra-forms/LongForm/Content.tsx +1 -1
- package/src/components/ra-forms/LongForm/Form.tsx +3 -3
- package/src/components/ra-forms/LongForm/NavMenu.tsx +3 -3
- package/src/components/ra-forms/LongForm/Provider.tsx +3 -4
- package/src/components/ra-forms/LongForm/Sidebar.tsx +2 -2
- package/src/components/ra-forms/LongForm/Tab.tsx +5 -5
- package/src/components/ra-forms/LongForm/hooks.tsx +3 -3
- package/src/components/ra-forms/LongForm/index.ts +3 -13
- package/src/components/ra-forms/LongForm/utils.ts +1 -1
- package/src/components/ra-forms/Show.tsx +21 -19
- package/src/components/ra-forms/SimpleForm.tsx +23 -40
- package/src/components/ra-forms/SimpleFormIterator.tsx +26 -24
- package/src/components/ra-forms/TabbedForm.tsx +36 -27
- package/src/components/ra-forms/TableForm/TableFormIterator.tsx +6 -34
- package/src/components/ra-forms/TableForm/TableFormIteratorItem.tsx +3 -4
- package/src/components/ra-forms/TableForm/index.ts +1 -3
- package/src/components/ra-forms/{Toolbar.jsx → Toolbar.tsx} +6 -11
- package/src/components/ra-forms/index.ts +12 -0
- package/src/components/ra-inputs/ArrayInput.tsx +15 -15
- package/src/components/ra-inputs/AttachmentInput.tsx +17 -25
- package/src/components/ra-inputs/AutocompleteArrayInput.tsx +27 -0
- package/src/components/ra-inputs/{AutocompleteInput.jsx → AutocompleteInput.tsx} +8 -18
- package/src/components/ra-inputs/{BooleanInput.jsx → BooleanInput.tsx} +8 -15
- package/src/components/ra-inputs/DateInput.tsx +24 -0
- package/src/components/ra-inputs/DateTimeInput.tsx +10 -18
- package/src/components/ra-inputs/{FileInput.jsx → FileInput.tsx} +28 -29
- package/src/components/ra-inputs/ImageInput.tsx +44 -0
- package/src/components/ra-inputs/LabeledArrayInput.tsx +8 -31
- package/src/components/ra-inputs/LabeledInput.tsx +12 -24
- package/src/components/ra-inputs/LocalizedTextInput.tsx +7 -7
- package/src/components/ra-inputs/NumberInput.tsx +24 -0
- package/src/components/ra-inputs/{RecordInput.jsx → RecordInput.tsx} +20 -18
- package/src/components/ra-inputs/ReferenceArrayInput.tsx +19 -0
- package/src/components/ra-inputs/ReferenceInput.tsx +19 -0
- package/src/components/ra-inputs/ReferenceManyInput.tsx +26 -0
- package/src/components/ra-inputs/SearchInput.tsx +12 -0
- package/src/components/ra-inputs/SelectArrayInput.tsx +33 -0
- package/src/components/ra-inputs/SelectInput.tsx +8 -10
- package/src/components/ra-inputs/{SmartTextInput.jsx → SmartTextInput.tsx} +10 -20
- package/src/components/ra-inputs/TextInput.tsx +9 -12
- package/src/components/ra-inputs/TimeInput.tsx +39 -0
- package/src/components/ra-inputs/index.ts +23 -0
- package/src/components/ra-lists/BulkActionsToolbar.tsx +6 -15
- package/src/components/ra-lists/BulkFloatingActionsToolbar.tsx +5 -9
- package/src/components/ra-lists/Datagrid/Datagrid.tsx +5 -6
- package/src/components/ra-lists/Datagrid/DatagridContextProvider.tsx +1 -1
- package/src/components/ra-lists/Datagrid/index.tsx +2 -6
- package/src/components/ra-lists/Empty.tsx +5 -16
- package/src/components/ra-lists/List.tsx +11 -47
- package/src/components/ra-lists/ListView.tsx +4 -19
- package/src/components/ra-lists/NotificationList/{NotificationList.jsx → NotificationList.tsx} +7 -8
- package/src/components/ra-lists/NotificationList/{button/MarkAsReadedButton.jsx → buttons/MarkAsReadedButton.tsx} +9 -9
- package/src/components/ra-lists/NotificationList/{button/MarkAsUnreadedButton.jsx → buttons/MarkAsUnreadedButton.tsx} +7 -6
- package/src/components/ra-lists/NotificationList/buttons/index.ts +2 -0
- package/src/components/ra-lists/NotificationList/{field/NotificationField.jsx → fields/NotificationField.tsx} +5 -5
- package/src/components/ra-lists/NotificationList/fields/index.ts +1 -0
- package/src/components/ra-lists/NotificationList/index.ts +1 -0
- package/src/components/ra-lists/SimpleList.tsx +2 -2
- package/src/components/ra-lists/index.ts +7 -7
- package/src/components/ra-pages/LoginPage.tsx +11 -16
- package/vite.config.js +84 -71
- package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts +0 -3
- package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts.map +0 -1
- package/dist/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.d.ts +0 -3
- package/dist/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.d.ts.map +0 -1
- package/dist/components/ra-lists/NotificationList/button/index.d.ts +0 -3
- package/dist/components/ra-lists/NotificationList/button/index.d.ts.map +0 -1
- package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts +0 -3
- package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts.map +0 -1
- package/dist/components/ra-lists/NotificationList/field/index.d.ts +0 -2
- package/dist/components/ra-lists/NotificationList/field/index.d.ts.map +0 -1
- package/src/components/Layout/Header/AppBarStyled.jsx +0 -32
- package/src/components/Notification.jsx +0 -13
- package/src/components/ra-buttons/index.jsx +0 -4
- package/src/components/ra-custom/index.tsx +0 -2
- package/src/components/ra-fields/DateField.jsx +0 -27
- package/src/components/ra-fields/EmailField.jsx +0 -27
- package/src/components/ra-fields/FunctionField.jsx +0 -9
- package/src/components/ra-fields/TextField.jsx +0 -27
- package/src/components/ra-fields/index.jsx +0 -30
- package/src/components/ra-forms/CardForm.jsx +0 -107
- package/src/components/ra-forms/index.jsx +0 -29
- package/src/components/ra-inputs/AutocompleteArrayInput.jsx +0 -35
- package/src/components/ra-inputs/DateInput.jsx +0 -30
- package/src/components/ra-inputs/ImageInput.jsx +0 -45
- package/src/components/ra-inputs/NumberInput.jsx +0 -28
- package/src/components/ra-inputs/ReferenceArrayInput.jsx +0 -23
- package/src/components/ra-inputs/ReferenceInput.jsx +0 -23
- package/src/components/ra-inputs/ReferenceManyInput.jsx +0 -33
- package/src/components/ra-inputs/SearchInput.jsx +0 -14
- package/src/components/ra-inputs/SelectArrayInput.jsx +0 -47
- package/src/components/ra-inputs/TimeInput.jsx +0 -46
- package/src/components/ra-inputs/index.jsx +0 -48
- package/src/components/ra-lists/NotificationList/button/index.jsx +0 -2
- package/src/components/ra-lists/NotificationList/field/index.jsx +0 -1
- package/src/components/ra-lists/NotificationList/index.jsx +0 -2
package/package.json
CHANGED
|
@@ -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
|
-
|
|
4
|
+
export type AdminProps = AdminContextProps & AdminUIProps;
|
|
4
5
|
|
|
5
|
-
|
|
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;
|
package/src/AdminContext.tsx
CHANGED
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
package/src/ApplicaAdmin.tsx
CHANGED
|
@@ -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
|
|
99
|
+
* <ApplicaAdmin notificationAPI="entities/notification" />
|
|
99
100
|
*/
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
queryClient,
|
|
169
|
+
enableNotification = false,
|
|
170
|
+
enableRegistration = false,
|
|
171
|
+
enablePasswordRecover = false,
|
|
172
|
+
enableThemeToggler = false,
|
|
173
|
+
queryClient = defaultQueryClient,
|
|
177
174
|
background,
|
|
178
|
-
|
|
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={
|
|
231
|
+
notification={notificationAPI}
|
|
234
232
|
enableNotification={enableNotification}
|
|
235
233
|
error={error}
|
|
236
234
|
/>
|
|
237
235
|
);
|
|
238
236
|
},
|
|
239
|
-
[logoMain, logoIcon, name, version, error,
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 = '© 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:
|
|
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: '© 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;
|
|
@@ -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;
|
package/src/components/index.jsx
CHANGED
|
@@ -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
|
-
*
|
|
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
|
-
|
|
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):
|
|
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
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
export type EditInDialogButtonProps = {
|
|
71
|
+
fullWidth?: boolean;
|
|
72
|
+
maxWidth?: false | Breakpoint | undefined;
|
|
73
|
+
label?: string;
|
|
74
|
+
children: React.ReactElement;
|
|
69
75
|
};
|
|
70
76
|
|
|
71
|
-
|
|
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
|
|
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
|
-
|
|
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;
|