fastapi-rtk 0.1.18 → 0.1.19
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/.bundled/jsonforms/lib/index.d.ts +1 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +1 -1
- package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.cjs +2 -2
- package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.cjs +1 -1
- package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.mjs +1 -1
- package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.mjs +2 -2
- package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.mjs +1 -1
- package/dist/constants/lib/index.d.ts +24 -0
- package/dist/core/cjs/ActionIcons/Add/AddDialog.cjs +4 -3
- package/dist/core/cjs/ActionIcons/Edit/EditDialog.cjs +13 -6
- package/dist/core/cjs/ActionIcons/Modals/CommonModal.cjs +43 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +3 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderMultiSelectInput.cjs +2 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/useColumns.cjs +14 -3
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +21 -5
- package/dist/core/cjs/Wrappers/ApiProvider/Contexts/ApiContext.cjs +2 -2
- package/dist/core/cjs/Wrappers/ApiProvider/Contexts/FormContext.cjs +12 -0
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +2 -2
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideForm.cjs +5 -1
- package/dist/core/cjs/Wrappers/Provider/Contexts/AuthContext.cjs +1 -1
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +22 -7
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +1 -1
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideApi.cjs +307 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideBulk.cjs +30 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/createItem.cjs +14 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/deleteItem.cjs +10 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/downloadItems.cjs +41 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getInfo.cjs +13 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItem.cjs +10 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItems.cjs +10 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/updateItem.cjs +10 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/uploadItems.cjs +27 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/utils/parseResponse.cjs +19 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.cjs +26 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/convertId.cjs +12 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/convertInfo.cjs +20 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/createQueryParams.cjs +18 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/getDefaultValues.cjs +28 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/getValidationSchema.cjs +38 -0
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideAuth.cjs +58 -0
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideInfo.cjs +19 -0
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/authFetch.cjs +90 -0
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/userCRUD.cjs +32 -0
- package/dist/core/cjs/fab-react-toolkit-patch/utils/convertToFormInputs.cjs +24 -0
- package/dist/core/esm/ActionIcons/Add/AddDialog.mjs +4 -3
- package/dist/core/esm/ActionIcons/Edit/EditDialog.mjs +13 -6
- package/dist/core/esm/ActionIcons/Modals/CommonModal.mjs +44 -3
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +3 -2
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderMultiSelectInput.mjs +2 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/useColumns.mjs +16 -5
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +19 -3
- package/dist/core/esm/Wrappers/ApiProvider/Contexts/ApiContext.mjs +2 -2
- package/dist/core/esm/Wrappers/ApiProvider/Contexts/FormContext.mjs +12 -0
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +2 -2
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideForm.mjs +5 -1
- package/dist/core/esm/Wrappers/Provider/Contexts/AuthContext.mjs +1 -1
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +20 -5
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +1 -1
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideApi.mjs +307 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs +30 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/createItem.mjs +14 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/deleteItem.mjs +10 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/downloadItems.mjs +41 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getInfo.mjs +13 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItem.mjs +10 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItems.mjs +10 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/updateItem.mjs +10 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/uploadItems.mjs +27 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/utils/parseResponse.mjs +19 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.mjs +26 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/convertId.mjs +12 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/convertInfo.mjs +20 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/createQueryParams.mjs +18 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/getDefaultValues.mjs +28 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/getValidationSchema.mjs +39 -0
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideAuth.mjs +58 -0
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideInfo.mjs +19 -0
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/authFetch.mjs +90 -0
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/userCRUD.mjs +32 -0
- package/dist/core/esm/fab-react-toolkit-patch/utils/convertToFormInputs.mjs +24 -0
- package/dist/core/lib/ActionIcons/Actions.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Add/Add.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Add/AddDialog.d.ts +4 -0
- package/dist/core/lib/ActionIcons/Delete/Delete.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Download/Download.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Edit/Edit.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Edit/EditDialog.d.ts +4 -0
- package/dist/core/lib/ActionIcons/Modals/CommonModal.d.ts +15 -0
- package/dist/core/lib/ActionIcons/Modals/normalProps.d.ts +12 -0
- package/dist/core/lib/ActionIcons/Modals/overlayProps.d.ts +25 -0
- package/dist/core/lib/ActionIcons/Refresh/Refresh.d.ts +1 -0
- package/dist/core/lib/ActionIcons/Upload/Upload.d.ts +1 -0
- package/dist/core/lib/ActionIcons/View/RelationPanel.d.ts +6 -0
- package/dist/core/lib/ActionIcons/View/View.d.ts +1 -0
- package/dist/core/lib/ActionIcons/View/ViewDialog.d.ts +7 -0
- package/dist/core/lib/ActionIcons/utils/convertToFormInputs.d.ts +11 -0
- package/dist/core/lib/Dialogs/AlertDialog/AlertDialog.d.ts +6 -0
- package/dist/core/lib/Menu/UserMenu/UserMenu.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/DataGrid.d.ts +1 -0
- package/dist/core/lib/Tables/DataGrid/ErrorDialog.d.ts +1 -0
- package/dist/core/lib/Tables/DataGrid/FormField/FormField.d.ts +8 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormAutocomplete.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormDatePicker.d.ts +5 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormDateTimePicker.d.ts +5 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormGeometryField.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormJsonField.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormRelatedListSelect.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormRelatedSelect.d.ts +7 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormSelect.d.ts +6 -0
- package/dist/core/lib/Tables/DataGrid/FormField/Inputs/FormTextField.d.ts +5 -0
- package/dist/core/lib/Tables/DataGrid/Main/Body/Body.d.ts +11 -0
- package/dist/core/lib/Tables/DataGrid/Main/Body/Field/Field.d.ts +2 -0
- package/dist/core/lib/Tables/DataGrid/Main/Body/Row/Row.d.ts +5 -0
- package/dist/core/lib/Tables/DataGrid/Main/Header/FieldTitle/FieldTitle.d.ts +12 -0
- package/dist/core/lib/Tables/DataGrid/Main/Header/Header.d.ts +1 -0
- package/dist/core/lib/Tables/DataGrid/Main/Main.d.ts +13 -0
- package/dist/core/lib/Tables/DataGrid/Pagination/Pagination.d.ts +1 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Filter/Filter.d.ts +1 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Filter/FilterMenu.d.ts +4 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Filter/FormFilterField.d.ts +8 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Filter/FormFilterIn.d.ts +7 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Filter/FormOperatorField.d.ts +8 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Settings/Settings.d.ts +0 -0
- package/dist/core/lib/Tables/DataGrid/Toolbar/Toolbar.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/FallbackWrapper.d.ts +12 -0
- package/dist/core/lib/Tables/NextGenDataGrid/NextGenDataGrid.d.ts +133 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useActions.d.ts +8 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useCheckbox.d.ts +3 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/AdvancedFilters.d.ts +3 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/AdvancedFiltersMenu.d.ts +6 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/BasicFilters.d.ts +6 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/ColumnHeaderFilter.d.ts +15 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInput.d.ts +9 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderBetweenInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderBooleanInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderDateInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderMultiSelectInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderNumberInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderSelectInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderTagsInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderTagsNumberInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter/HeaderInputs/HeaderTextInput.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/FilterMenu.d.ts +9 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/MultiLineHighlight.d.ts +5 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/useColumns.d.ts +4 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useColumns/utils.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useData.d.ts +7 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useEvent.d.ts +10 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useFilters.d.ts +3 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useGlobalFilter.d.ts +7 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/usePagination.d.ts +14 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useQueryParams.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useSize.d.ts +17 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useSorting.d.ts +10 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.d.ts +17 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbar/useToolbar.d.ts +9 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.d.ts +5 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/useToolbarAlertBanner.d.ts +5 -0
- package/dist/core/lib/Tables/NextGenDataGrid/utils.d.ts +6 -0
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +14 -0
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/ApiContext.d.ts +131 -0
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/BulkActionsContext.d.ts +28 -0
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/FormContext.d.ts +30 -0
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideApi.d.ts +41 -0
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.d.ts +10 -0
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideForm.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/createItem.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/deleteItem.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/downloadItems.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/getInfo.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/getItem.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/getItems.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/updateItem.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/uploadItems.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/utils/parseResponse.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/convertId.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/convertInfo.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/createQueryParams.d.ts +10 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/getDefaultValues.d.ts +1 -0
- package/dist/core/lib/Wrappers/ApiProvider/utils/getValidationSchema.d.ts +6 -0
- package/dist/core/lib/Wrappers/LazyLoadWrapper/LazyLoadWrapper.d.ts +12 -0
- package/dist/core/lib/Wrappers/Provider/Contexts/AuthContext.d.ts +29 -0
- package/dist/core/lib/Wrappers/Provider/Contexts/InfoContext.d.ts +22 -0
- package/dist/core/lib/Wrappers/Provider/Provider.d.ts +6 -0
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideAuth.d.ts +14 -0
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideInfo.d.ts +6 -0
- package/dist/core/lib/Wrappers/Provider/utils/authFetch.d.ts +53 -0
- package/dist/core/lib/Wrappers/Provider/utils/userCRUD.d.ts +18 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideApi.d.ts +41 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideBulk.d.ts +10 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/createItem.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/deleteItem.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/downloadItems.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getInfo.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItem.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItems.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/updateItem.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/uploadItems.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/utils/parseResponse.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/convertId.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/convertInfo.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/createQueryParams.d.ts +10 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/getDefaultValues.d.ts +1 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/getValidationSchema.d.ts +6 -0
- package/dist/core/lib/fab-react-toolkit-patch/auth/hooks/useProvideAuth.d.ts +14 -0
- package/dist/core/lib/fab-react-toolkit-patch/auth/hooks/useProvideInfo.d.ts +7 -0
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/authFetch.d.ts +53 -0
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/userCRUD.d.ts +18 -0
- package/dist/core/lib/fab-react-toolkit-patch/utils/convertToFormInputs.d.ts +9 -0
- package/dist/core/lib/hooks/api/useApi.d.ts +66 -0
- package/dist/core/lib/hooks/api/useBulkActions.d.ts +11 -0
- package/dist/core/lib/hooks/api/useForms.d.ts +15 -0
- package/dist/core/lib/hooks/auth/useAuth.d.ts +23 -0
- package/dist/core/lib/hooks/auth/useInfo.d.ts +16 -0
- package/dist/core/lib/index.d.ts +21 -0
- package/dist/core/lib/sub-packages-exporter.d.ts +5 -0
- package/dist/hooks/lib/index.d.ts +3 -0
- package/dist/hooks/lib/useActionIcon/useActionIcon.d.ts +9 -0
- package/dist/hooks/lib/useCustomFetch/useCustomFetch.d.ts +11 -0
- package/dist/hooks/lib/useTrueOnce/useTrueOnce.d.ts +7 -0
- package/dist/jsonforms/lib/JsonFormsWithCustomizer/JsonFormsWithCustomizer.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineBooleanInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineDateInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineDateTimeInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineEnumArrayInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineEnumInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineJsonInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineNumberInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineObjectInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineOneOfEnumInput.d.ts +1 -0
- package/dist/jsonforms/lib/MantineInputs/MantineTextInput.d.ts +1 -0
- package/dist/jsonforms/lib/cells/MantineBooleanCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineDateCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineDateTimeCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineEnumArrayCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineEnumCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineIntegerCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineJsonCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineNumberCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineOneOfEnumCell.d.ts +2 -0
- package/dist/jsonforms/lib/cells/MantineTextCell.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineArrayControl/DeleteDialog.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineArrayControl/MantineArrayControl.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineEnumArrayControl.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineObjectControl.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/MantineTableControl.d.ts +3 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/NoBorderTableCell.d.ts +4 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/TableToolbar.d.ts +1 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/ValidationIcon.d.ts +4 -0
- package/dist/jsonforms/lib/controls/MantineBooleanControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineDateControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineDateTimeControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineEnumControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineIntegerControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineJsonControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineNumberControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineOneOfEnumControl.d.ts +2 -0
- package/dist/jsonforms/lib/controls/MantineTextControl.d.ts +2 -0
- package/dist/jsonforms/lib/hooks/useBooleanProps.d.ts +26 -0
- package/dist/jsonforms/lib/hooks/useCommonProps.d.ts +30 -0
- package/dist/jsonforms/lib/hooks/useContextProps.d.ts +11 -0
- package/dist/jsonforms/lib/hooks/useDateProps.d.ts +21 -0
- package/dist/jsonforms/lib/hooks/useJsonProps.d.ts +21 -0
- package/dist/jsonforms/lib/hooks/useMultiSelectProps.d.ts +20 -0
- package/dist/jsonforms/lib/hooks/useNumberProps.d.ts +18 -0
- package/dist/jsonforms/lib/hooks/useSelectProps.d.ts +23 -0
- package/dist/jsonforms/lib/hooks/useTextProps.d.ts +15 -0
- package/dist/jsonforms/lib/hooks/useThemeCustomizer.d.ts +141 -0
- package/dist/jsonforms/lib/index.d.ts +19 -0
- package/dist/jsonforms/lib/labels/MantineLabelRenderer.d.ts +2 -0
- package/dist/jsonforms/lib/layouts/MantineGroupLayoutRenderer.d.ts +2 -0
- package/dist/jsonforms/lib/layouts/MantineHotizontalLayoutRenderer.d.ts +2 -0
- package/dist/jsonforms/lib/layouts/MantineVerticalLayoutRenderer.d.ts +2 -0
- package/dist/jsonforms/lib/renderers/mantineCells.d.ts +7 -0
- package/dist/jsonforms/lib/renderers/mantineRenderers.d.ts +10 -0
- package/dist/jsonforms/lib/testers/isEnumArrayArrayControl.d.ts +13 -0
- package/dist/jsonforms/lib/testers/isEnumArrayControl.d.ts +13 -0
- package/dist/jsonforms/lib/testers/isJsonArrayControl.d.ts +13 -0
- package/dist/jsonforms/lib/testers/isJsonControl.d.ts +13 -0
- package/dist/jsonforms/lib/utils/debounce.d.ts +1 -0
- package/dist/jsonforms/lib/utils/isSchemaTypeInclude.d.ts +8 -0
- package/dist/jsonforms/lib/utils/layout.d.ts +10 -0
- package/dist/jsonforms/lib/utils/utcConverter.d.ts +25 -0
- package/dist/utils/cjs/parseValue/parseValue.cjs +1 -1
- package/dist/utils/esm/parseValue/parseValue.mjs +1 -1
- package/dist/utils/lib/createFetchParams/createFetchParams.d.ts +19 -0
- package/dist/utils/lib/deepMerge/deepMerge.d.ts +1 -0
- package/dist/utils/lib/getValue/getValue.d.ts +1 -0
- package/dist/utils/lib/getValueOrDefault/getValueOrDefault.d.ts +1 -0
- package/dist/utils/lib/index.d.ts +8 -0
- package/dist/utils/lib/isTruthy/isTruthy.d.ts +9 -0
- package/dist/utils/lib/parseFromValuesOrFunc/parseFromValuesOrFunc.d.ts +1 -0
- package/dist/utils/lib/parseValue/parseValue.d.ts +1 -0
- package/dist/utils/lib/urlJoin/urlJoin.d.ts +2 -0
- package/dist/zustand/lib/index.d.ts +3 -0
- package/dist/zustand/lib/useProxy/useProxy.d.ts +11 -0
- package/dist/zustand/lib/utils/compareStateWithStore.d.ts +1 -0
- package/dist/zustand/lib/utils/createProxy.d.ts +1 -0
- package/package.json +12 -2
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/focusManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/mutation.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/mutationCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/notifyManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/onlineManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/query.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryClient.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryObserver.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/removable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/retryer.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/subscribable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/thenable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/utils.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/suspense.cjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/focusManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/infiniteQueryBehavior.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/mutation.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/mutationCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/notifyManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/onlineManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/query.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryClient.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/queryObserver.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/removable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/retryer.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/subscribable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/thenable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.75.7 → @tanstack_query-core@5.76.0}/@tanstack/query-core/build/modern/utils.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.75.7_react@18.3.1 → @tanstack_react-query@5.76.1_react@18.3.1}/@tanstack/react-query/build/modern/suspense.mjs +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.76.1_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
|
+
const QueryClientProvider = require("../../../../../.external/cjs/@tanstack_react-query@5.76.1_react@18.3.1/@tanstack/react-query/build/modern/QueryClientProvider.cjs");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const authFetch = require("../utils/authFetch.cjs");
|
|
7
|
+
const userCRUD = require("../utils/userCRUD.cjs");
|
|
8
|
+
function useFabProvideAuth(baseURL, authQueryProps) {
|
|
9
|
+
const queryClient = QueryClientProvider.useQueryClient();
|
|
10
|
+
const query = useQuery.useQuery({
|
|
11
|
+
queryKey: ["user"],
|
|
12
|
+
queryFn: ({ signal }) => userCRUD.getUser(baseURL, signal),
|
|
13
|
+
retry: false,
|
|
14
|
+
...authQueryProps
|
|
15
|
+
});
|
|
16
|
+
const [error, setError] = React.useState(null);
|
|
17
|
+
const signin = React.useCallback(
|
|
18
|
+
({ username, password }) => {
|
|
19
|
+
setError(null);
|
|
20
|
+
authFetch.authSignin(baseURL, { username, password }).then(() => queryClient.invalidateQueries({ queryKey: ["user"] })).catch((err) => setError(err));
|
|
21
|
+
},
|
|
22
|
+
[baseURL, queryClient]
|
|
23
|
+
);
|
|
24
|
+
const signout = React.useCallback(() => {
|
|
25
|
+
setError(null);
|
|
26
|
+
authFetch.authSignout(baseURL).then(() => queryClient.resetQueries({ queryKey: ["user"] })).then(() => queryClient.resetQueries({ queryKey: ["info"] })).catch((err) => setError(err));
|
|
27
|
+
}, [baseURL, queryClient]);
|
|
28
|
+
const update = React.useCallback(
|
|
29
|
+
(data) => {
|
|
30
|
+
setError(null);
|
|
31
|
+
userCRUD.updateUser(baseURL, data).then(() => queryClient.invalidateQueries({ queryKey: ["user"] })).catch((err) => setError(err));
|
|
32
|
+
},
|
|
33
|
+
[baseURL, queryClient]
|
|
34
|
+
);
|
|
35
|
+
const resetPassword = React.useCallback(
|
|
36
|
+
(password) => {
|
|
37
|
+
setError(null);
|
|
38
|
+
authFetch.authResetPassword(baseURL, password, query.data).catch((err) => setError(err));
|
|
39
|
+
},
|
|
40
|
+
[baseURL, query.data]
|
|
41
|
+
);
|
|
42
|
+
const oauth_signin = React.useCallback(
|
|
43
|
+
(provider, popup) => authFetch.authOAuthSignin(baseURL, provider, popup, () => queryClient.invalidateQueries({ queryKey: ["user"] })),
|
|
44
|
+
[baseURL, queryClient]
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
user: query.isError ? null : query.data,
|
|
48
|
+
loading: query.isFetching,
|
|
49
|
+
error: error ? error.message : null,
|
|
50
|
+
signin,
|
|
51
|
+
signout,
|
|
52
|
+
update,
|
|
53
|
+
resetPassword,
|
|
54
|
+
oauth_signin,
|
|
55
|
+
refetch: query.refetch
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
exports.useFabProvideAuth = useFabProvideAuth;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.76.1_react@18.3.1/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const authFetch = require("../utils/authFetch.cjs");
|
|
6
|
+
function useFabProvideInfo(baseUrl, auth) {
|
|
7
|
+
const query = useQuery.useQuery({
|
|
8
|
+
queryKey: ["info"],
|
|
9
|
+
queryFn: ({ signal }) => authFetch.authInfo(baseUrl, signal),
|
|
10
|
+
enabled: false
|
|
11
|
+
});
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (auth.user && !query.data) {
|
|
14
|
+
query.refetch();
|
|
15
|
+
}
|
|
16
|
+
}, [auth.user, query]);
|
|
17
|
+
return { baseUrl, info: query.data, loading: query.isFetching, error: query.error, fab: true };
|
|
18
|
+
}
|
|
19
|
+
exports.useFabProvideInfo = useFabProvideInfo;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const utils = require("fastapi-rtk/utils");
|
|
4
|
+
async function authSignin(baseUrl, { username, password }) {
|
|
5
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
6
|
+
path: utils.urlJoin(baseUrl, "auth/login"),
|
|
7
|
+
method: "POST",
|
|
8
|
+
body: { username, password }
|
|
9
|
+
});
|
|
10
|
+
const res = await fetch(fetchPath, options);
|
|
11
|
+
if (!res.ok) {
|
|
12
|
+
if (res.status === 400) {
|
|
13
|
+
throw new Error("Username or password wrong.");
|
|
14
|
+
} else {
|
|
15
|
+
throw new Error("Failed to sign in.");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function authSignout(baseUrl) {
|
|
20
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
21
|
+
path: utils.urlJoin(baseUrl, "auth/logout"),
|
|
22
|
+
method: "GET"
|
|
23
|
+
});
|
|
24
|
+
const res = await fetch(fetchPath, options);
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
throw new Error("Failed to sign out.");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function authResetPassword(baseUrl, newPassword, { email }) {
|
|
30
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
31
|
+
path: utils.urlJoin(baseUrl, "auth/forgot-password"),
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: { email }
|
|
34
|
+
});
|
|
35
|
+
const forgotPasswordRes = await fetch(fetchPath, options);
|
|
36
|
+
if (!forgotPasswordRes.ok) {
|
|
37
|
+
throw new Error("Couldn't request token to reset password");
|
|
38
|
+
}
|
|
39
|
+
const jsonResponse = await forgotPasswordRes.json();
|
|
40
|
+
const { token } = jsonResponse;
|
|
41
|
+
const { fetchPath: fetchPath2, options: options2 } = utils.createFetchParams({
|
|
42
|
+
path: utils.urlJoin(baseUrl, "auth/reset-password"),
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: { token, password: newPassword }
|
|
45
|
+
});
|
|
46
|
+
const resetPasswordRes = await fetch(fetchPath2, options2);
|
|
47
|
+
if (!resetPasswordRes.ok) {
|
|
48
|
+
throw new Error("Couldn't reset password");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function authOAuthSignin(baseUrl, provider, popup, afterSigninPopup) {
|
|
52
|
+
const url = utils.urlJoin(baseUrl, "auth/login", provider);
|
|
53
|
+
if (!popup) {
|
|
54
|
+
window.location.href = utils.urlJoin(baseUrl, "auth/login", provider);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const width = 500;
|
|
58
|
+
const height = 500;
|
|
59
|
+
const left = window.screenLeft + window.outerWidth / 2 - width / 2;
|
|
60
|
+
const top = window.screenTop + window.outerHeight / 2 - height / 2;
|
|
61
|
+
const authWindow = window.open(
|
|
62
|
+
url + "?popup=true",
|
|
63
|
+
"auth",
|
|
64
|
+
`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${top}, left=${left}`
|
|
65
|
+
);
|
|
66
|
+
const pollTimer = window.setInterval(function() {
|
|
67
|
+
if (authWindow.closed !== false) {
|
|
68
|
+
window.clearInterval(pollTimer);
|
|
69
|
+
afterSigninPopup == null ? void 0 : afterSigninPopup();
|
|
70
|
+
}
|
|
71
|
+
}, 200);
|
|
72
|
+
}
|
|
73
|
+
async function authInfo(baseUrl, signal) {
|
|
74
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
75
|
+
path: utils.urlJoin(baseUrl, "info/"),
|
|
76
|
+
method: "GET"
|
|
77
|
+
});
|
|
78
|
+
const res = await fetch(fetchPath, { signal, ...options });
|
|
79
|
+
const data = await res.json();
|
|
80
|
+
if (!res.ok) {
|
|
81
|
+
const errorMessage = typeof data.message === "string" ? data.message : JSON.stringify(data.message, null, 2);
|
|
82
|
+
throw new Error(errorMessage);
|
|
83
|
+
}
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
exports.authInfo = authInfo;
|
|
87
|
+
exports.authOAuthSignin = authOAuthSignin;
|
|
88
|
+
exports.authResetPassword = authResetPassword;
|
|
89
|
+
exports.authSignin = authSignin;
|
|
90
|
+
exports.authSignout = authSignout;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const utils = require("fastapi-rtk/utils");
|
|
4
|
+
async function getUser(baseUrl, signal) {
|
|
5
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
6
|
+
path: utils.urlJoin(baseUrl, "auth/user"),
|
|
7
|
+
method: "GET"
|
|
8
|
+
});
|
|
9
|
+
const res = await fetch(fetchPath, { signal, ...options });
|
|
10
|
+
const data = await res.json();
|
|
11
|
+
if (!res.ok) {
|
|
12
|
+
const errorMessage = typeof data.message === "string" ? data.message : JSON.stringify(data.message, null, 2);
|
|
13
|
+
throw new Error(errorMessage);
|
|
14
|
+
}
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
async function updateUser(baseUrl, userData) {
|
|
18
|
+
const { fetchPath, options } = utils.createFetchParams({
|
|
19
|
+
path: utils.urlJoin(baseUrl, "auth/user"),
|
|
20
|
+
method: "PUT",
|
|
21
|
+
body: userData
|
|
22
|
+
});
|
|
23
|
+
const res = await fetch(fetchPath, options);
|
|
24
|
+
const data = await res.json();
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
const errorMessage = typeof data.message === "string" ? data.message : JSON.stringify(data.message, null, 2);
|
|
27
|
+
throw new Error(errorMessage);
|
|
28
|
+
}
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
exports.getUser = getUser;
|
|
32
|
+
exports.updateUser = updateUser;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function convertToFormInputs(item, columns) {
|
|
4
|
+
const result = {};
|
|
5
|
+
columns.forEach((column) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const { type, values } = column;
|
|
8
|
+
if (!values) {
|
|
9
|
+
result[column.name] = (((_a = item[column.name]) == null ? void 0 : _a.id) || item[column.name]) ?? void 0;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (type === "Related") {
|
|
13
|
+
result[column.name] = values.find((val) => {
|
|
14
|
+
var _a2;
|
|
15
|
+
return val.id === ((_a2 = item[column.name]) == null ? void 0 : _a2.id);
|
|
16
|
+
}) || item[column.name];
|
|
17
|
+
} else {
|
|
18
|
+
const existingValues = ((_b = item[column.name]) == null ? void 0 : _b.map((item2) => item2.id || item2)) || [];
|
|
19
|
+
result[column.name] = values.filter((val) => existingValues.includes(val.id)).map((val) => val.id);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
exports.convertToFormInputs = convertToFormInputs;
|
|
@@ -11,7 +11,7 @@ import { normalProps } from "../Modals/normalProps.mjs";
|
|
|
11
11
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
12
12
|
function AddDialog({ jsonForms: __jsonForms, ...props }) {
|
|
13
13
|
const { info, refetch, refetchInfo, addEntry } = useApi();
|
|
14
|
-
const { opened, setOpened, state, setState, reset, view, setView } = useForms("add");
|
|
14
|
+
const { opened, setOpened, state, getState, setState, reset, view, setView } = useForms("add");
|
|
15
15
|
const [loading, setLoading] = useDebouncedState(false, DEBOUNCE_LOADING_DELAY);
|
|
16
16
|
const { jsonForms: _jsonForms } = useProps("AddDialog", {}, {});
|
|
17
17
|
const jsonForms = useMemo(() => deepMerge(_jsonForms, __jsonForms), [_jsonForms, __jsonForms]);
|
|
@@ -19,7 +19,7 @@ function AddDialog({ jsonForms: __jsonForms, ...props }) {
|
|
|
19
19
|
(e) => {
|
|
20
20
|
e == null ? void 0 : e.preventDefault();
|
|
21
21
|
setLoading(true);
|
|
22
|
-
addEntry(
|
|
22
|
+
addEntry(getState().data).then((res) => {
|
|
23
23
|
if (res) {
|
|
24
24
|
refetch();
|
|
25
25
|
refetchInfo();
|
|
@@ -30,11 +30,12 @@ function AddDialog({ jsonForms: __jsonForms, ...props }) {
|
|
|
30
30
|
setOpened(false);
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
|
-
[addEntry, refetch, refetchInfo, setLoading, setOpened
|
|
33
|
+
[addEntry, getState, refetch, refetchInfo, setLoading, setOpened]
|
|
34
34
|
);
|
|
35
35
|
return /* @__PURE__ */ jsx(
|
|
36
36
|
CommonModal,
|
|
37
37
|
{
|
|
38
|
+
fabSchema: info.add,
|
|
38
39
|
schema: info.add_schema,
|
|
39
40
|
uischema: info.add_uischema,
|
|
40
41
|
state,
|
|
@@ -4,15 +4,17 @@ import { deepMerge } from "fastapi-rtk/utils";
|
|
|
4
4
|
import { useProps } from "@mantine/core";
|
|
5
5
|
import { useDebouncedState } from "@mantine/hooks";
|
|
6
6
|
import { useMemo, useCallback, useEffect } from "react";
|
|
7
|
+
import { convertToFormInputs } from "../../fab-react-toolkit-patch/utils/convertToFormInputs.mjs";
|
|
7
8
|
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
8
9
|
import { useForms } from "../../hooks/api/useForms.mjs";
|
|
10
|
+
import { useInfo } from "../../hooks/auth/useInfo.mjs";
|
|
9
11
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
10
12
|
import { normalProps } from "../Modals/normalProps.mjs";
|
|
11
13
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
12
|
-
import { convertToFormInputs } from "../utils/convertToFormInputs.mjs";
|
|
14
|
+
import { convertToFormInputs as convertToFormInputs$1 } from "../utils/convertToFormInputs.mjs";
|
|
13
15
|
function EditDialog({ jsonForms: __jsonForms, ...props }) {
|
|
14
16
|
const { info, refetch, refetchInfo, updateEntry } = useApi();
|
|
15
|
-
const { opened, setOpened, item, state, setState, reset, view, setView } = useForms("edit");
|
|
17
|
+
const { opened, setOpened, item, state, getState, setState, reset, view, setView } = useForms("edit");
|
|
16
18
|
const [loading, setLoading] = useDebouncedState(false, DEBOUNCE_LOADING_DELAY);
|
|
17
19
|
const { jsonForms: _jsonForms } = useProps("EditDialog", {}, {});
|
|
18
20
|
const jsonForms = useMemo(
|
|
@@ -23,7 +25,7 @@ function EditDialog({ jsonForms: __jsonForms, ...props }) {
|
|
|
23
25
|
(e) => {
|
|
24
26
|
e == null ? void 0 : e.preventDefault();
|
|
25
27
|
setLoading(true);
|
|
26
|
-
updateEntry(item == null ? void 0 : item.id,
|
|
28
|
+
updateEntry(item == null ? void 0 : item.id, getState().data).then((res) => {
|
|
27
29
|
if (res) {
|
|
28
30
|
refetch();
|
|
29
31
|
refetchInfo();
|
|
@@ -34,11 +36,15 @@ function EditDialog({ jsonForms: __jsonForms, ...props }) {
|
|
|
34
36
|
setOpened(false);
|
|
35
37
|
});
|
|
36
38
|
},
|
|
37
|
-
[setLoading, updateEntry, item == null ? void 0 : item.id,
|
|
39
|
+
[setLoading, updateEntry, item == null ? void 0 : item.id, getState, refetch, refetchInfo, setOpened]
|
|
38
40
|
);
|
|
41
|
+
const { fab } = useInfo();
|
|
39
42
|
const initialState$1 = useMemo(
|
|
40
|
-
() => ({
|
|
41
|
-
|
|
43
|
+
() => ({
|
|
44
|
+
...initialState,
|
|
45
|
+
data: fab ? convertToFormInputs((item == null ? void 0 : item.result) || {}, info.edit_columns) : convertToFormInputs$1((item == null ? void 0 : item.result) || {}, info.edit_schema)
|
|
46
|
+
}),
|
|
47
|
+
[fab, info.edit_columns, info.edit_schema, item == null ? void 0 : item.result]
|
|
42
48
|
);
|
|
43
49
|
useEffect(() => {
|
|
44
50
|
setState({ data: initialState$1.data });
|
|
@@ -46,6 +52,7 @@ function EditDialog({ jsonForms: __jsonForms, ...props }) {
|
|
|
46
52
|
return /* @__PURE__ */ jsx(
|
|
47
53
|
CommonModal,
|
|
48
54
|
{
|
|
55
|
+
fabSchema: info.edit,
|
|
49
56
|
schema: info.edit_schema,
|
|
50
57
|
uischema: info.edit_uischema,
|
|
51
58
|
state,
|
|
@@ -3,8 +3,14 @@ import { JsonFormsWithCustomizer } from "fastapi-rtk/.bundled-jsonforms";
|
|
|
3
3
|
import { VIEW_MODE } from "fastapi-rtk/constants";
|
|
4
4
|
import { deepMerge } from "fastapi-rtk/utils";
|
|
5
5
|
import { Icon } from "../../../../.external/esm/@iconify_react@6.0.0_react@18.3.1/@iconify/react/dist/iconify.mjs";
|
|
6
|
-
import { Modal, Box, Group, Button, CloseButton } from "@mantine/core";
|
|
6
|
+
import { Modal, Box, Stack, Group, Button, CloseButton } from "@mantine/core";
|
|
7
|
+
import { useForm, yupResolver } from "@mantine/form";
|
|
8
|
+
import { useRef, useEffect } from "react";
|
|
9
|
+
import { useInfo } from "../../hooks/auth/useInfo.mjs";
|
|
10
|
+
import { FormField } from "../../Tables/DataGrid/FormField/FormField.mjs";
|
|
7
11
|
function CommonModal({
|
|
12
|
+
fabSchema,
|
|
13
|
+
//* Backward compatibility to fab-react-toolkit
|
|
8
14
|
schema,
|
|
9
15
|
uischema,
|
|
10
16
|
state,
|
|
@@ -18,6 +24,26 @@ function CommonModal({
|
|
|
18
24
|
buttonLoading,
|
|
19
25
|
...props
|
|
20
26
|
}) {
|
|
27
|
+
var _a;
|
|
28
|
+
const { fab } = useInfo();
|
|
29
|
+
const form = useForm({
|
|
30
|
+
initialValues: fabSchema.defaultValues,
|
|
31
|
+
validate: yupResolver(fabSchema.schema)
|
|
32
|
+
});
|
|
33
|
+
const onFormSubmitRef = useRef(onSubmit);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (fab) {
|
|
36
|
+
onFormSubmitRef.current = form.onSubmit((values, e) => {
|
|
37
|
+
setState({ data: values });
|
|
38
|
+
onSubmit(e);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, [fab, onSubmit, setState]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (JSON.stringify(state.data) !== JSON.stringify(form.getValues())) {
|
|
44
|
+
form.setValues(state.data);
|
|
45
|
+
}
|
|
46
|
+
}, [state.data]);
|
|
21
47
|
return /* @__PURE__ */ jsx(
|
|
22
48
|
Modal,
|
|
23
49
|
{
|
|
@@ -29,6 +55,7 @@ function CommonModal({
|
|
|
29
55
|
...props,
|
|
30
56
|
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
57
|
props.title,
|
|
58
|
+
!fab && //* Backward compatibility to fab-react-toolkit
|
|
32
59
|
/* @__PURE__ */ jsx(Group, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", pr: "xs", children: [
|
|
33
60
|
/* @__PURE__ */ jsx(
|
|
34
61
|
CloseButton,
|
|
@@ -71,10 +98,24 @@ function CommonModal({
|
|
|
71
98
|
pos: "relative",
|
|
72
99
|
display: "flex",
|
|
73
100
|
style: { flexDirection: "column", justifyContent: "space-between" },
|
|
74
|
-
onSubmit,
|
|
101
|
+
onSubmit: onFormSubmitRef.current,
|
|
75
102
|
...boxProps,
|
|
76
103
|
children: [
|
|
77
|
-
|
|
104
|
+
fab ? (
|
|
105
|
+
//* Backward compatibility to fab-react-toolkit
|
|
106
|
+
/* @__PURE__ */ jsx(Stack, { gap: "xs", children: (_a = fabSchema.columns) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ jsx(
|
|
107
|
+
FormField,
|
|
108
|
+
{
|
|
109
|
+
form,
|
|
110
|
+
name: item.name,
|
|
111
|
+
label: item.label,
|
|
112
|
+
description: item.description,
|
|
113
|
+
schema: item,
|
|
114
|
+
withAsterisk: item.required
|
|
115
|
+
},
|
|
116
|
+
index
|
|
117
|
+
)) })
|
|
118
|
+
) : /* @__PURE__ */ jsx(
|
|
78
119
|
JsonFormsWithCustomizer,
|
|
79
120
|
{
|
|
80
121
|
schema,
|
|
@@ -52,6 +52,7 @@ const NextGenDataGrid = forwardRef((props, ref) => {
|
|
|
52
52
|
toolbar = {},
|
|
53
53
|
//! Temporary add {} until we remove deprecated props
|
|
54
54
|
textFilterSeparator = ";",
|
|
55
|
+
wrapperProps,
|
|
55
56
|
// Deprecated props
|
|
56
57
|
bodySeparator,
|
|
57
58
|
bodyTruncate,
|
|
@@ -200,13 +201,13 @@ const NextGenDataGrid = forwardRef((props, ref) => {
|
|
|
200
201
|
setViewEdit(form.edit.initialView);
|
|
201
202
|
}
|
|
202
203
|
}, []);
|
|
203
|
-
return /* @__PURE__ */ jsxs(Box, {
|
|
204
|
+
return /* @__PURE__ */ jsxs(Box, { pos: "relative", h: "100%", w: "100%", mih: 0, flex: 1, ...wrapperProps, children: [
|
|
204
205
|
/* @__PURE__ */ jsxs(LazyLoadWrapper, { cond: !!info, children: [
|
|
205
206
|
/* @__PURE__ */ jsx(AddDialog, { jsonForms: form == null ? void 0 : form.add, ...(_b = form == null ? void 0 : form.add) == null ? void 0 : _b.dialogProps }),
|
|
206
207
|
/* @__PURE__ */ jsx(EditDialog, { jsonForms: form == null ? void 0 : form.edit, ...(_c = form == null ? void 0 : form.edit) == null ? void 0 : _c.dialogProps })
|
|
207
208
|
] }),
|
|
208
209
|
/* @__PURE__ */ jsx(MantineReactTable, { table: mrtTable, ...rest }),
|
|
209
|
-
children == null ? void 0 : children(mrtTable),
|
|
210
|
+
children == null ? void 0 : children({ table: mrtTable }),
|
|
210
211
|
!hideError ? /* @__PURE__ */ jsx(ErrorDialog, {}) : null
|
|
211
212
|
] });
|
|
212
213
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getValue, parseFromValuesOrFunc } from "fastapi-rtk/utils";
|
|
3
|
-
import { useSetState } from "@mantine/hooks";
|
|
4
|
-
import {
|
|
3
|
+
import { useMap, useSetState } from "@mantine/hooks";
|
|
4
|
+
import { useEffect, useMemo } from "react";
|
|
5
5
|
import { useApi } from "../../../../hooks/api/useApi.mjs";
|
|
6
6
|
import { useAuth } from "../../../../hooks/auth/useAuth.mjs";
|
|
7
7
|
import { FallbackWrapper } from "../../FallbackWrapper.mjs";
|
|
@@ -12,6 +12,14 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
|
|
|
12
12
|
const { path, info, data, specialKey } = useApi();
|
|
13
13
|
const api = useApi();
|
|
14
14
|
const auth = useAuth();
|
|
15
|
+
const idValueMap = useMap();
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
Object.entries((info == null ? void 0 : info.filters) || {}).forEach(([key, value]) => {
|
|
18
|
+
for (const filter of value.schema.values || []) {
|
|
19
|
+
idValueMap.set(`${info == null ? void 0 : info.path}-${key}-${filter.id}`, filter.value);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}, [idValueMap, info == null ? void 0 : info.filters, info == null ? void 0 : info.path]);
|
|
15
23
|
const columns = useMemo(
|
|
16
24
|
() => (data == null ? void 0 : data.list_columns.map((col) => {
|
|
17
25
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -35,6 +43,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
|
|
|
35
43
|
accessorKey: col,
|
|
36
44
|
accessorFn: (row) => getValue(row, col),
|
|
37
45
|
header: (_g = data == null ? void 0 : data.label_columns) == null ? void 0 : _g[col],
|
|
46
|
+
filterTooltipValueFn: (value) => idValueMap.get(`${data == null ? void 0 : data.path}-${col}-${value}`) ?? value,
|
|
38
47
|
Filter: (props) => /* @__PURE__ */ jsx(
|
|
39
48
|
ColumnHeaderFilter,
|
|
40
49
|
{
|
|
@@ -111,12 +120,14 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
|
|
|
111
120
|
data == null ? void 0 : data.list_columns,
|
|
112
121
|
data == null ? void 0 : data.label_columns,
|
|
113
122
|
data == null ? void 0 : data.order_columns,
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
data == null ? void 0 : data.path,
|
|
124
|
+
info == null ? void 0 : info.filters,
|
|
125
|
+
header,
|
|
116
126
|
specialKey.all,
|
|
127
|
+
columnProps,
|
|
117
128
|
api,
|
|
118
129
|
auth,
|
|
119
|
-
|
|
130
|
+
idValueMap,
|
|
120
131
|
body,
|
|
121
132
|
textFilterSeparator
|
|
122
133
|
]
|
|
@@ -2,6 +2,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { urlJoin } from "fastapi-rtk/utils";
|
|
3
3
|
import { useProxy, createProxy } from "fastapi-rtk/zustand";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
+
import { useFabProvideApi } from "../../fab-react-toolkit-patch/api/hooks/useProvideApi.mjs";
|
|
6
|
+
import { useFabProvideBulk } from "../../fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs";
|
|
5
7
|
import { useInfo } from "../../hooks/auth/useInfo.mjs";
|
|
6
8
|
import { ApiContext } from "./Contexts/ApiContext.mjs";
|
|
7
9
|
import { BulkActionsContext } from "./Contexts/BulkActionsContext.mjs";
|
|
@@ -9,6 +11,18 @@ import { FormContextAdd, FormContextEdit } from "./Contexts/FormContext.mjs";
|
|
|
9
11
|
import { useProvideApi } from "./hooks/useProvideApi.mjs";
|
|
10
12
|
import { useProvideBulk } from "./hooks/useProvideBulk.mjs";
|
|
11
13
|
import { useProvideForm } from "./hooks/useProvideForm.mjs";
|
|
14
|
+
function useApi({ fab, ...props }) {
|
|
15
|
+
if (fab) {
|
|
16
|
+
return useFabProvideApi(props);
|
|
17
|
+
}
|
|
18
|
+
return useProvideApi(props);
|
|
19
|
+
}
|
|
20
|
+
function useBulkActions({ fab, ...props }) {
|
|
21
|
+
if (fab) {
|
|
22
|
+
return useFabProvideBulk(props);
|
|
23
|
+
}
|
|
24
|
+
return useProvideBulk(props);
|
|
25
|
+
}
|
|
12
26
|
function ApiProvider({
|
|
13
27
|
resource_name = "",
|
|
14
28
|
initialQueryParams,
|
|
@@ -23,8 +37,10 @@ function ApiProvider({
|
|
|
23
37
|
streaming,
|
|
24
38
|
children
|
|
25
39
|
}) {
|
|
26
|
-
const { baseUrl } = useInfo();
|
|
27
|
-
const api =
|
|
40
|
+
const { baseUrl, fab } = useInfo();
|
|
41
|
+
const api = useApi({
|
|
42
|
+
fab,
|
|
43
|
+
//* Backward compatibility to fab-react-toolkit
|
|
28
44
|
path: urlJoin(baseUrl, resource_name),
|
|
29
45
|
initialQueryParams,
|
|
30
46
|
relation,
|
|
@@ -38,7 +54,7 @@ function ApiProvider({
|
|
|
38
54
|
streaming
|
|
39
55
|
});
|
|
40
56
|
const apiProxy = useProxy(api);
|
|
41
|
-
const bulkActions =
|
|
57
|
+
const bulkActions = useBulkActions({ ...apiProxy, fab });
|
|
42
58
|
const bulkActionsProxy = useProxy(bulkActions);
|
|
43
59
|
const formAdd = useProvideForm();
|
|
44
60
|
const [formAddProxy] = useState(() => createProxy(formAdd));
|
|
@@ -2,7 +2,7 @@ import { createContext } from "react";
|
|
|
2
2
|
const ApiContext = createContext({
|
|
3
3
|
path: "",
|
|
4
4
|
/**
|
|
5
|
-
* @type {{count: number, description_columns: Record<string, string>, ids:
|
|
5
|
+
* @type {{count: number, description_columns: Record<string, string>, ids: number[] | string[], label_columns: Record<string, string>, list_columns: string[], list_title: string, order_columns: string[], result: Record<string, any>[], path: string} | null}
|
|
6
6
|
*/
|
|
7
7
|
data: null,
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ const ApiContext = createContext({
|
|
|
10
10
|
*/
|
|
11
11
|
info: null,
|
|
12
12
|
/**
|
|
13
|
-
* @type {{columns: string[], filters: {col: string, opr: string, value: Any}[], order_column: string | undefined, order_direction: string | undefined, page:
|
|
13
|
+
* @type {{columns: string[], filters: {col: string, opr: string, value: Any}[], order_column: string | undefined, order_direction: string | undefined, page: number, page_size: number, global_filter: string | undefined} | null}
|
|
14
14
|
*/
|
|
15
15
|
queryParams: null,
|
|
16
16
|
loading: false,
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
const stubContext = {
|
|
3
3
|
opened: false,
|
|
4
|
+
getOpened: () => {
|
|
5
|
+
throw new Error("getOpened must be defined in a provider");
|
|
6
|
+
},
|
|
4
7
|
setOpened: () => {
|
|
5
8
|
throw new Error("setOpened must be defined in a provider");
|
|
6
9
|
},
|
|
7
10
|
view: 0,
|
|
11
|
+
getView: () => {
|
|
12
|
+
throw new Error("getView must be defined in a provider");
|
|
13
|
+
},
|
|
8
14
|
setView: () => {
|
|
9
15
|
throw new Error("setView must be defined in a provider");
|
|
10
16
|
},
|
|
11
17
|
state: void 0,
|
|
18
|
+
getState: () => {
|
|
19
|
+
throw new Error("getState must be defined in a provider");
|
|
20
|
+
},
|
|
12
21
|
setState: () => {
|
|
13
22
|
throw new Error("setState must be defined in a provider");
|
|
14
23
|
},
|
|
@@ -16,6 +25,9 @@ const stubContext = {
|
|
|
16
25
|
throw new Error("reset must be defined in a provider");
|
|
17
26
|
},
|
|
18
27
|
item: void 0,
|
|
28
|
+
getItem: () => {
|
|
29
|
+
throw new Error("getItem must be defined in a provider");
|
|
30
|
+
},
|
|
19
31
|
setItem: () => {
|
|
20
32
|
throw new Error("setItem must be defined in a provider");
|
|
21
33
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useState, useRef, useEffect, useMemo, useCallback } from "react";
|
|
2
2
|
import { urlJoin } from "fastapi-rtk/utils";
|
|
3
3
|
import { useDidUpdate, useSetState } from "@mantine/hooks";
|
|
4
|
-
import {
|
|
5
|
-
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.75.7_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
4
|
+
import { useQuery } from "../../../../../.external/esm/@tanstack_react-query@5.76.1_react@18.3.1/@tanstack/react-query/build/modern/useQuery.mjs";
|
|
6
5
|
import { createItem } from "../utils/api/createItem.mjs";
|
|
7
6
|
import { deleteItem } from "../utils/api/deleteItem.mjs";
|
|
8
7
|
import { downloadItems } from "../utils/api/downloadItems.mjs";
|
|
@@ -14,6 +13,7 @@ import { uploadItems } from "../utils/api/uploadItems.mjs";
|
|
|
14
13
|
import { convertId } from "../utils/convertId.mjs";
|
|
15
14
|
import { convertInfo } from "../utils/convertInfo.mjs";
|
|
16
15
|
import { createQueryParams } from "../utils/createQueryParams.mjs";
|
|
16
|
+
import { keepPreviousData } from "../../../../../.external/esm/@tanstack_query-core@5.76.0/@tanstack/query-core/build/modern/utils.mjs";
|
|
17
17
|
function useProvideApi({
|
|
18
18
|
path,
|
|
19
19
|
initialQueryParams,
|
|
@@ -3,15 +3,19 @@ import { useState } from "react";
|
|
|
3
3
|
import { create } from "../../../../../.external/esm/zustand@5.0.4_@types_react@18.3.21_react@18.3.1/zustand/esm/react.mjs";
|
|
4
4
|
const useProvideForm = () => {
|
|
5
5
|
const [storeAdd] = useState(
|
|
6
|
-
() => create((set) => ({
|
|
6
|
+
() => create((set, get) => ({
|
|
7
7
|
opened: false,
|
|
8
|
+
getOpened: () => get().opened,
|
|
8
9
|
setOpened: (newOpened) => set({ opened: newOpened }),
|
|
9
10
|
view: VIEW_MODE.NORMAL,
|
|
11
|
+
getView: () => get().view,
|
|
10
12
|
setView: (newView) => set({ view: newView }),
|
|
11
13
|
state: initialState,
|
|
14
|
+
getState: () => get().state,
|
|
12
15
|
setState: (newState) => set({ state: newState }),
|
|
13
16
|
reset: () => set({ state: initialState }),
|
|
14
17
|
item: void 0,
|
|
18
|
+
getItem: () => get().item,
|
|
15
19
|
setItem: (newItem) => set({ item: newItem })
|
|
16
20
|
}))
|
|
17
21
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
const AuthContext = createContext({
|
|
3
3
|
/**
|
|
4
|
-
* @type {{email: string, first_name: string, id:
|
|
4
|
+
* @type {{email: string, first_name: string, id: number, is_active: boolean, last_name: string, permissions: string[], roles: string[], username: string} | null}
|
|
5
5
|
*/
|
|
6
6
|
user: null,
|
|
7
7
|
loading: false,
|