diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2f5257..a76c23a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - blur autocomplete when an option is clicked +- form element to display options as soon as possible instead of wait for all dynamic options to be loaded ## [4.2.0] - 2023-07-12 diff --git a/package-lock.json b/package-lock.json index a4a97405..7c69ceb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "@mui/lab": "^5.0.0-alpha.135", "@mui/material": "^5.10.1", "@mui/x-date-pickers": "^6.9.1", - "@oneblink/apps": "^5.2.0-beta.1", + "@oneblink/apps": "^6.0.0-beta.1", "@oneblink/release-cli": "^2.0.2", "@oneblink/types": "github:oneblink/types", "@types/blueimp-load-image": "^5.16.0", @@ -5222,13 +5222,14 @@ } }, "node_modules/@oneblink/apps": { - "version": "5.2.0-beta.1", + "version": "6.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@oneblink/apps/-/apps-6.0.0-beta.1.tgz", + "integrity": "sha512-40oftc2vfAYSUPSl5O5xwzepa4wkiaExGks3BMFE26vSIJkP+g8SkvXgGoT9SIi3+tSCEVSjDUkhnaMgiYQFXA==", "dev": true, - "license": "GPL-3.0-only", "dependencies": { "@aws-sdk/client-s3": "^3.363.0", "@aws-sdk/lib-storage": "^3.363.0", - "@oneblink/sdk-core": "^3.1.0-beta.4", + "@oneblink/sdk-core": "^4.0.0-beta.1", "@sentry/browser": "^6.19.7", "@sentry/tracing": "^6.19.7", "aws-sdk": "^2.1126.0", @@ -5250,6 +5251,16 @@ "npm": ">=8" } }, + "node_modules/@oneblink/apps/node_modules/@oneblink/sdk-core": { + "version": "4.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@oneblink/sdk-core/-/sdk-core-4.0.0-beta.1.tgz", + "integrity": "sha512-fvpHSVVvpRdHgWkVSt26jtQfKr1a0qkLM6qEldO0EWrz4M4vvDiJsVwc/NXwru6z63KY0ElClVq1ojHlIIr96w==", + "dev": true, + "engines": { + "node": ">=16", + "npm": ">=8" + } + }, "node_modules/@oneblink/apps/node_modules/nanoid": { "version": "4.0.1", "dev": true, diff --git a/package.json b/package.json index d28f01ec..bd705ab5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@mui/lab": "^5.0.0-alpha.135", "@mui/material": "^5.10.1", "@mui/x-date-pickers": "^6.9.1", - "@oneblink/apps": "^5.2.0-beta.1", + "@oneblink/apps": "^6.0.0-beta.1", "@oneblink/release-cli": "^2.0.2", "@oneblink/types": "github:oneblink/types", "@types/blueimp-load-image": "^5.16.0", @@ -136,4 +136,4 @@ "types": "npm i -D github:oneblink/types", "typescript": "tsc --noEmit" } -} +} \ No newline at end of file diff --git a/src/OneBlinkFormBase.tsx b/src/OneBlinkFormBase.tsx index a92c3748..41e60391 100644 --- a/src/OneBlinkFormBase.tsx +++ b/src/OneBlinkFormBase.tsx @@ -13,7 +13,6 @@ import { attachmentsService } from '@oneblink/apps' import * as H from 'history' import Modal from './components/renderer/Modal' -import OneBlinkAppsErrorOriginalMessage from './components/renderer/OneBlinkAppsErrorOriginalMessage' import cleanFormSubmissionModel from './services/cleanFormSubmissionModel' import PageFormElements from './components/renderer/PageFormElements' import useFormValidation from './hooks/useFormValidation' @@ -23,7 +22,7 @@ import useLookups from './hooks/useLookups' import { FormDefinitionContext } from './hooks/useFormDefinition' import { InjectPagesContext } from './hooks/useInjectPages' import { ExecutedLookupProvider } from './hooks/useExecutedLookupCallback' -import useDynamicOptionsLoaderState from './hooks/useDynamicOptionsLoaderState' +import { FormElementOptionsContextProvider } from './hooks/useDynamicOptionsLoaderState' import { GoogleMapsApiKeyContext } from './hooks/useGoogleMapsApiKey' import { AbnLookupAuthenticationGuidContext } from './hooks/useAbnLookupAuthenticationGuid' import { CaptchaSiteKeyContext } from './hooks/useCaptchaSiteKey' @@ -363,19 +362,6 @@ function OneBlinkFormBase({ // // - // - // - // #region Dynamic Options - - const loadDynamicOptionsState = useDynamicOptionsLoaderState( - definition, - setFormSubmission, - ) - - // #endregion - // - // - // // // #region Submissions @@ -760,438 +746,436 @@ function OneBlinkFormBase({ ) } - if (loadDynamicOptionsState) { - return ( - <> -
{loadDynamicOptionsState.error.message}
-- {localisationService.formatDatetimeLong(new Date())} -
-