@env-hopper/frontend-core 2.0.1-alpha → 2.0.1-alpha.1
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/esm/App.d.ts +1 -1
- package/dist/esm/App.js.map +1 -1
- package/dist/esm/__tests__/integration/appQuickJumpBar.integration.test.d.ts +1 -0
- package/dist/esm/__tests__/integration/factories/BackendMagazine.d.ts +887 -0
- package/dist/esm/__tests__/integration/factories/DbMagazine.d.ts +7 -0
- package/dist/esm/__tests__/integration/factories/app.d.ts +2 -0
- package/dist/esm/__tests__/integration/factories/env.d.ts +2 -0
- package/dist/esm/__tests__/integration/factories/mapper.d.ts +39 -0
- package/dist/esm/__tests__/integration/factories/resourceJump.d.ts +2 -0
- package/dist/esm/__tests__/integration/factories/simpleDSL.d.ts +889 -0
- package/dist/esm/__tests__/integration/factories/types.d.ts +12 -0
- package/dist/esm/__tests__/integration/helpers/renderWithProviders.d.ts +35 -0
- package/dist/esm/__tests__/integration/helpers/testHelpers.d.ts +6 -0
- package/dist/esm/__tests__/integration/helpers/uiHelpers.d.ts +30 -0
- package/dist/esm/__tests__/integration/quickSlots.integration.test.d.ts +1 -0
- package/dist/esm/__tests__/integration/resourceJump.integration.test.d.ts +1 -0
- package/dist/esm/__tests__/integration/setup/svgMock.d.ts +3 -0
- package/dist/esm/__tests__/integration/setup/testSetup.d.ts +0 -0
- package/dist/esm/__tests__/modules/fuzzyMatchLogic/testUtils.d.ts +3 -1
- package/dist/esm/__tests__/modules/resouceJump/helpers.test.d.ts +1 -0
- package/dist/esm/__tests__/modules/resouceJump/utils/mapToFlagshipResourceJumps.test.d.ts +1 -0
- package/dist/esm/__tests__/util/TestMagazine.d.ts +3 -0
- package/dist/esm/api/ApiQueryMagazine.d.ts +4 -4
- package/dist/esm/api/data/useQueryBootstrapConfig.d.ts +1 -1
- package/dist/esm/api/infra/createQueryClient.d.ts +3 -1
- package/dist/esm/api/infra/createQueryClient.js +5 -3
- package/dist/esm/api/infra/createQueryClient.js.map +1 -1
- package/dist/esm/api/infra/trpc.d.ts +1236 -5
- package/dist/esm/api/unsorted/appCatalogFetcher.d.ts +10 -0
- package/dist/esm/api/unsorted/appCatalogFetcher.js +18 -0
- package/dist/esm/api/unsorted/appCatalogFetcher.js.map +1 -0
- package/dist/esm/api/unsorted/createCachingFetcher.d.ts +23 -0
- package/dist/esm/api/unsorted/createCachingFetcher.js +93 -0
- package/dist/esm/api/unsorted/createCachingFetcher.js.map +1 -0
- package/dist/esm/api/unsorted/indexDataFetcher.d.ts +3 -6
- package/dist/esm/api/unsorted/resourceJumpsExtendedFetcher.d.ts +9 -0
- package/dist/esm/api/unsorted/resourceJumpsExtendedFetcher.js +18 -0
- package/dist/esm/api/unsorted/resourceJumpsExtendedFetcher.js.map +1 -0
- package/dist/esm/api/unsorted/resourceJumpsFetcher.d.ts +10 -0
- package/dist/esm/api/unsorted/resourceJumpsFetcher.js +18 -0
- package/dist/esm/api/unsorted/resourceJumpsFetcher.js.map +1 -0
- package/dist/esm/appPropsFactory.js +8 -6
- package/dist/esm/appPropsFactory.js.map +1 -1
- package/dist/esm/assets/app-catalog.svg.js +6 -0
- package/dist/esm/assets/app-catalog.svg.js.map +1 -0
- package/dist/esm/components/IconPickerDialog.d.ts +8 -0
- package/dist/esm/components/IconPickerDialog.js +98 -0
- package/dist/esm/components/IconPickerDialog.js.map +1 -0
- package/dist/esm/components/IconPickerField.d.ts +9 -0
- package/dist/esm/components/IconPickerField.js +76 -0
- package/dist/esm/components/IconPickerField.js.map +1 -0
- package/dist/esm/components/ThemeSwitcher.js +1 -1
- package/dist/esm/components/ThemeSwitcher.js.map +1 -1
- package/dist/esm/lib/getAppMode.d.ts +2 -0
- package/dist/esm/modules/admin-base/components/AdminChat.d.ts +1 -0
- package/dist/esm/modules/admin-base/components/AdminChat.js +82 -0
- package/dist/esm/modules/admin-base/components/AdminChat.js.map +1 -0
- package/dist/esm/modules/admin-base/components/AdminLayout.d.ts +5 -0
- package/dist/esm/modules/admin-base/components/AdminLayout.js +78 -0
- package/dist/esm/modules/admin-base/components/AdminLayout.js.map +1 -0
- package/dist/esm/modules/admin-base/components/AdminWelcome.d.ts +1 -0
- package/dist/esm/modules/admin-base/components/AdminWelcome.js +37 -0
- package/dist/esm/modules/admin-base/components/AdminWelcome.js.map +1 -0
- package/dist/esm/modules/admin-base/context/AdminConfigContext.d.ts +8 -0
- package/dist/esm/modules/admin-base/context/AdminConfigContext.js +27 -0
- package/dist/esm/modules/admin-base/context/AdminConfigContext.js.map +1 -0
- package/dist/esm/modules/admin-base/index.d.ts +5 -0
- package/dist/esm/modules/admin-base/types/adminTypes.d.ts +10 -0
- package/dist/esm/modules/appCatalog/AppCatalogAdminPage.d.ts +1 -0
- package/dist/esm/modules/appCatalog/AppCatalogAdminPage.js +204 -0
- package/dist/esm/modules/appCatalog/AppCatalogAdminPage.js.map +1 -0
- package/dist/esm/modules/appCatalog/AppCatalogEditDialog.d.ts +17 -0
- package/dist/esm/modules/appCatalog/ScreenshotItem.d.ts +7 -0
- package/dist/esm/modules/appCatalog/ScreenshotItem.js +65 -0
- package/dist/esm/modules/appCatalog/ScreenshotItem.js.map +1 -0
- package/dist/esm/modules/appCatalog/ScreenshotManager.d.ts +15 -0
- package/dist/esm/modules/appCatalog/ScreenshotManager.js +155 -0
- package/dist/esm/modules/appCatalog/ScreenshotManager.js.map +1 -0
- package/dist/esm/modules/appCatalog/api/ApiQueryMagazineAppCatalog.d.ts +11 -0
- package/dist/esm/modules/appCatalog/api/ApiQueryMagazineAppCatalog.js +14 -0
- package/dist/esm/modules/appCatalog/api/ApiQueryMagazineAppCatalog.js.map +1 -0
- package/dist/esm/modules/appCatalog/catalogRouteLoader.d.ts +5 -0
- package/dist/esm/modules/appCatalog/catalogRouteLoader.js +20 -0
- package/dist/esm/modules/appCatalog/catalogRouteLoader.js.map +1 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.d.ts +14 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js +34 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js.map +1 -0
- package/dist/esm/modules/appCatalog/index.d.ts +10 -0
- package/dist/esm/modules/appCatalog/routeLoader.d.ts +3 -0
- package/dist/esm/modules/appCatalog/routeLoader.js +7 -0
- package/dist/esm/modules/appCatalog/routeLoader.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/components/AppDetailModal.d.ts +7 -0
- package/dist/esm/modules/appCatalog/ui/components/AppDetailModal.js +208 -0
- package/dist/esm/modules/appCatalog/ui/components/AppDetailModal.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/grid/AppCatalogFiltersCard.d.ts +9 -0
- package/dist/esm/modules/appCatalog/ui/grid/AppCatalogGrid.d.ts +6 -0
- package/dist/esm/modules/appCatalog/ui/grid/AppCatalogGrid.js +111 -0
- package/dist/esm/modules/appCatalog/ui/grid/AppCatalogGrid.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/grid/AppCatalogTable.d.ts +5 -0
- package/dist/esm/modules/appCatalog/ui/grid/appCatalogUtils.d.ts +3 -0
- package/dist/esm/modules/appCatalog/ui/layout/AppCatalogLayout.d.ts +9 -0
- package/dist/esm/modules/appCatalog/ui/layout/AppCatalogLayout.js +28 -0
- package/dist/esm/modules/appCatalog/ui/layout/AppCatalogLayout.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/pages/AppCatalogPage.d.ts +1 -0
- package/dist/esm/modules/appCatalog/ui/pages/AppCatalogPage.js +68 -0
- package/dist/esm/modules/appCatalog/ui/pages/AppCatalogPage.js.map +1 -0
- package/dist/esm/modules/auth/AuthContext.d.ts +38 -0
- package/dist/esm/modules/auth/AuthContext.js +80 -0
- package/dist/esm/modules/auth/AuthContext.js.map +1 -0
- package/dist/esm/modules/auth/AuthModalContext.d.ts +19 -0
- package/dist/esm/modules/auth/AuthModalContext.js +33 -0
- package/dist/esm/modules/auth/AuthModalContext.js.map +1 -0
- package/dist/esm/modules/auth/ProtectedContent.d.ts +19 -0
- package/dist/esm/modules/auth/authClient.d.ts +704 -0
- package/dist/esm/modules/auth/authClient.js +8 -0
- package/dist/esm/modules/auth/authClient.js.map +1 -0
- package/dist/esm/modules/auth/index.d.ts +5 -0
- package/dist/esm/modules/auth/ui/LoginModal.d.ts +6 -0
- package/dist/esm/modules/auth/ui/LoginModal.js +22 -0
- package/dist/esm/modules/auth/ui/LoginModal.js.map +1 -0
- package/dist/esm/modules/auth/ui/LoginPage.d.ts +5 -0
- package/dist/esm/modules/auth/ui/LoginPage.js +50 -0
- package/dist/esm/modules/auth/ui/LoginPage.js.map +1 -0
- package/dist/esm/modules/auth/useAuthActions.d.ts +17 -0
- package/dist/esm/modules/auth/useAuthActions.js +62 -0
- package/dist/esm/modules/auth/useAuthActions.js.map +1 -0
- package/dist/esm/modules/config/BootstrapConfigContext.d.ts +1 -1
- package/dist/esm/modules/config/BootstrapConfigContext.js +2 -12
- package/dist/esm/modules/config/BootstrapConfigContext.js.map +1 -1
- package/dist/esm/modules/config/HealthStateContext.d.ts +16 -0
- package/dist/esm/modules/crossCuttingParams/CrossCuttingParamsContext.d.ts +16 -0
- package/dist/esm/modules/crossCuttingParams/CrossCuttingParamsContext.js +44 -0
- package/dist/esm/modules/crossCuttingParams/CrossCuttingParamsContext.js.map +1 -0
- package/dist/esm/modules/crossCuttingParams/types.d.ts +13 -0
- package/dist/esm/modules/crossCuttingParams/utils/routeLoaderMapper.d.ts +2 -0
- package/dist/esm/modules/environment/{EnvironmentContext.d.ts → context/EnvironmentContext.d.ts} +7 -4
- package/dist/esm/modules/environment/context/EnvironmentContext.js +69 -0
- package/dist/esm/modules/environment/context/EnvironmentContext.js.map +1 -0
- package/dist/esm/modules/environment/context/useEnvironmentHistory.d.ts +5 -0
- package/dist/esm/modules/environment/context/useEnvironmentHistory.js +26 -0
- package/dist/esm/modules/environment/context/useEnvironmentHistory.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/autoCompleteFilter.js +48 -8
- package/dist/esm/modules/fuzzyMatchLogic/autoCompleteFilter.js.map +1 -1
- package/dist/esm/modules/fuzzyMatchLogic/features/positionBonus.d.ts +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/fixLayout.js +23 -0
- package/dist/esm/modules/fuzzyMatchLogic/fixLayout.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/postFiltration.d.ts +16 -0
- package/dist/esm/modules/fuzzyMatchLogic/tokenize.js +29 -0
- package/dist/esm/modules/fuzzyMatchLogic/tokenize.js.map +1 -0
- package/dist/esm/modules/fuzzyMatchLogic/types.d.ts +1 -0
- package/dist/esm/modules/icons/IconManagementPage.d.ts +1 -0
- package/dist/esm/modules/icons/IconManagementPage.js +178 -0
- package/dist/esm/modules/icons/IconManagementPage.js.map +1 -0
- package/dist/esm/modules/pluginCore/PluginManagerContext.d.ts +1 -6
- package/dist/esm/modules/pluginCore/PluginManagerContext.js +13 -46
- package/dist/esm/modules/pluginCore/PluginManagerContext.js.map +1 -1
- package/dist/esm/modules/pluginCore/makePluginManagerContext.d.ts +1 -4
- package/dist/esm/modules/pluginCore/makePluginManagerContext.js +2 -20
- package/dist/esm/modules/pluginCore/makePluginManagerContext.js.map +1 -1
- package/dist/esm/modules/pluginCore/types.d.ts +0 -12
- package/dist/esm/modules/resourceJump/api/ApiQueryMagazineResourceJump.d.ts +45 -0
- package/dist/esm/modules/resourceJump/api/ApiQueryMagazineResourceJump.js +42 -0
- package/dist/esm/modules/resourceJump/api/ApiQueryMagazineResourceJump.js.map +1 -0
- package/dist/esm/modules/resourceJump/context/ResourceJumpContext.d.ts +34 -0
- package/dist/esm/modules/resourceJump/context/ResourceJumpContext.js +280 -0
- package/dist/esm/modules/resourceJump/context/ResourceJumpContext.js.map +1 -0
- package/dist/esm/modules/resourceJump/context/useResouceJumpHistory.d.ts +8 -0
- package/dist/esm/modules/resourceJump/context/useResouceJumpHistory.js +86 -0
- package/dist/esm/modules/resourceJump/context/useResouceJumpHistory.js.map +1 -0
- package/dist/esm/modules/resourceJump/routeLoader.js +19 -31
- package/dist/esm/modules/resourceJump/routeLoader.js.map +1 -1
- package/dist/esm/modules/resourceJump/types.d.ts +22 -6
- package/dist/esm/modules/resourceJump/ui/AppSwitcher.d.ts +4 -0
- package/dist/esm/modules/resourceJump/ui/CredentialsWidget.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/EnvSwitcher.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/JumpALink.d.ts +2 -5
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.d.ts +3 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableSingleParam.d.ts +3 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableSingleParam.js +42 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableSingleParam.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableTopParam.d.ts +8 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableTopParam.js +26 -0
- package/dist/esm/modules/resourceJump/ui/LateResolvableTopParam.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/ResolvableParameterSelector.d.ts +7 -0
- package/dist/esm/modules/resourceJump/ui/ResolvableParameters.d.ts +5 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpBreadcrumbs.d.ts +4 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpBreadcrumbs.js +59 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpBreadcrumbs.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpButton.d.ts +13 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpButton.js +52 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpButton.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpMockTable.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpMockTable.js +180 -0
- package/dist/esm/modules/resourceJump/ui/ResourceJumpMockTable.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/ShareLinkButton.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/ShareLinkButton.js +84 -0
- package/dist/esm/modules/resourceJump/ui/ShareLinkButton.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/SmoothSwitcher.d.ts +10 -0
- package/dist/esm/modules/resourceJump/ui/TopQuickJump.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/appCatalog/AppCatalogFiltersCard.d.ts +9 -0
- package/dist/esm/modules/resourceJump/ui/appCatalog/AppCatalogGrid.d.ts +6 -0
- package/dist/esm/modules/resourceJump/ui/appCatalog/AppCatalogTable.d.ts +6 -0
- package/dist/esm/modules/resourceJump/ui/appCatalog/appCatalogUtils.d.ts +2 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/AppAutocomplete.d.ts +11 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/CmdKQuickSearchDialog.d.ts +5 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/CommandPalette.d.ts +18 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/CommandPalette.js +35 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/CommandPalette.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/EnvAutocomplete.d.ts +11 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/EnvAutocomplete.js +201 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/EnvAutocomplete.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearch.d.ts +3 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearch.js +101 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearch.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearchContext.d.ts +20 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearchContext.js +40 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/QuickSearchContext.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/highlightText.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/highlightText.js +13 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/highlightText.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/types.d.ts +6 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/useCmdkDriver.d.ts +8 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/useQuickSearchLogic.d.ts +6 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/useQuickSearchLogic.js +69 -0
- package/dist/esm/modules/resourceJump/ui/cmdk/useQuickSearchLogic.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/layout/CenterColumn.d.ts +3 -0
- package/dist/esm/modules/resourceJump/ui/layout/CenterColumn.js +8 -0
- package/dist/esm/modules/resourceJump/ui/layout/CenterColumn.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/layout/LeftColumn.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/layout/ResourceJumpLayout.d.ts +11 -0
- package/dist/esm/modules/resourceJump/ui/layout/ResourceJumpLayout.js +39 -0
- package/dist/esm/modules/resourceJump/ui/layout/ResourceJumpLayout.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/layout/RightColumn.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/miniEnvSelector/MiniEnvSelectorPopover.d.ts +7 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppCatalog.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppCatalog.js +64 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppCatalog.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPage.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPage.js +17 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPage.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageFlagship.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageFlagship.js +94 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageFlagship.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageRegular.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageRegular.js +16 -0
- package/dist/esm/modules/resourceJump/ui/pages/AppPageRegular.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/DashboardPage.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/DashboardPage.js +15 -0
- package/dist/esm/modules/resourceJump/ui/pages/DashboardPage.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvCatalog.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvCatalog.js +48 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvCatalog.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvPage.d.ts +10 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvPage.js +83 -0
- package/dist/esm/modules/resourceJump/ui/pages/EnvPage.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/HomePage.d.ts +1 -0
- package/dist/esm/modules/resourceJump/ui/pages/HomePage.js +36 -0
- package/dist/esm/modules/resourceJump/ui/pages/HomePage.js.map +1 -0
- package/dist/esm/modules/resourceJump/ui/widgets/VersionWidget.d.ts +5 -0
- package/dist/esm/modules/resourceJump/utils/buildJumpUrl.d.ts +2 -0
- package/dist/esm/modules/resourceJump/utils/buildJumpUrl.js +28 -0
- package/dist/esm/modules/resourceJump/utils/buildJumpUrl.js.map +1 -0
- package/dist/esm/modules/resourceJump/{findBestMatchByUrl.d.ts → utils/findBestMatchByUrl.d.ts} +4 -4
- package/dist/esm/modules/resourceJump/{helpers.d.ts → utils/helpers.d.ts} +8 -4
- package/dist/esm/modules/resourceJump/utils/helpers.js +30 -0
- package/dist/esm/modules/resourceJump/utils/helpers.js.map +1 -0
- package/dist/esm/modules/resourceJump/utils/mapToFlagshipResourceJumps.d.ts +12 -0
- package/dist/esm/modules/resourceJump/utils/mapToFlagshipResourceJumps.js +38 -0
- package/dist/esm/modules/resourceJump/utils/mapToFlagshipResourceJumps.js.map +1 -0
- package/dist/esm/modules/resourceJump/utils/mapToResouceJumpUis.d.ts +4 -0
- package/dist/esm/modules/resourceJump/utils/mapToResouceJumpUis.js +17 -0
- package/dist/esm/modules/resourceJump/utils/mapToResouceJumpUis.js.map +1 -0
- package/dist/esm/modules/resourceJump/utils/statistics/statisticsHelpers.d.ts +8 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useEnvStatistics.d.ts +2 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useEnvStatistics.js +25 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useEnvStatistics.js.map +1 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useMostRelevantLateParamSlug.d.ts +1 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useMostRelevantLateParamSlug.js +12 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useMostRelevantLateParamSlug.js.map +1 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useMostRelevantQuickEnvs.d.ts +2 -0
- package/dist/esm/modules/resourceJump/utils/statistics/useMostRelevantQuickFlagships.d.ts +2 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.1.2/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +60 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.1.2/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.1.2_react@19.1.2__react@19.1.2/node_modules/@dnd-kit/core/dist/core.esm.js +3055 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.1.2_react@19.1.2__react@19.1.2/node_modules/@dnd-kit/core/dist/core.esm.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.2_react@19.1.2__react@19.1.2__react@19.1.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +593 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.2_react@19.1.2__react@19.1.2__react@19.1.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.1.2/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +302 -0
- package/dist/esm/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.1.2/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@hookform_resolvers@5.2.2_react-hook-form@7.71.1_react@19.1.2_/node_modules/@hookform/resolvers/dist/resolvers.js +34 -0
- package/dist/esm/node_modules/.pnpm/@hookform_resolvers@5.2.2_react-hook-form@7.71.1_react@19.1.2_/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@hookform_resolvers@5.2.2_react-hook-form@7.71.1_react@19.1.2_/node_modules/@hookform/resolvers/zod/dist/zod.js +94 -0
- package/dist/esm/node_modules/.pnpm/@hookform_resolvers@5.2.2_react-hook-form@7.71.1_react@19.1.2_/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtools.js +72 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtools.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtoolsPanel.js +44 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/TanStackRouterDevtoolsPanel.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/index.js +12 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_react-router-devtools@1.151.6_@tanstack_react-router@1.151.6_react-dom@19.1.2_20b78d099e847743bc64b4d051c71d30/node_modules/@tanstack/react-router-devtools/dist/esm/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js +95 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/path.js +107 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/path.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/root.js +5 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-core@1.151.6/node_modules/@tanstack/router-core/dist/esm/root.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/BaseTanStackRouterDevtoolsPanel-DxaCaP75.js +1963 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/BaseTanStackRouterDevtoolsPanel-DxaCaP75.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/FloatingTanStackRouterDevtools-CaypUmOS.js +284 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/FloatingTanStackRouterDevtools-CaypUmOS.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/index-5jfj03XJ.js +1855 -0
- package/dist/esm/node_modules/.pnpm/@tanstack_router-devtools-core@1.151.6_@tanstack_router-core@1.151.6_csstype@3.2.3/node_modules/@tanstack/router-devtools-core/dist/index-5jfj03XJ.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js +56 -0
- package/dist/esm/node_modules/.pnpm/goober@2.1.18_csstype@3.2.3/node_modules/goober/dist/goober.modern.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/react-hook-form@7.71.1_react@19.1.2/node_modules/react-hook-form/dist/index.esm.js +1894 -0
- package/dist/esm/node_modules/.pnpm/react-hook-form@7.71.1_react@19.1.2/node_modules/react-hook-form/dist/index.esm.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +17 -0
- package/dist/esm/node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/errors.js +45 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/iso.js +44 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/parse.js +30 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js +622 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +492 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js +244 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js +75 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js +73 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js +270 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js +100 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js +78 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +1225 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js +363 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js +407 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js +9 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/esm/packages/shared-core/dist/esm/defaultWithOverridesAndTemplate.js +35 -0
- package/dist/esm/packages/shared-core/dist/esm/defaultWithOverridesAndTemplate.js.map +1 -0
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.d.ts +3 -5
- package/dist/esm/routeTree.gen.d.ts +250 -91
- package/dist/esm/routeTree.gen.js +122 -50
- package/dist/esm/routeTree.gen.js.map +1 -1
- package/dist/esm/routes/__root.d.ts +1 -1
- package/dist/esm/routes/__root.js +6 -5
- package/dist/esm/routes/__root.js.map +1 -1
- package/dist/esm/routes/_layout/app.$appSlug.index.d.ts +1 -0
- package/dist/esm/routes/_layout/app._appSlug.index.js +13 -0
- package/dist/esm/routes/_layout/app._appSlug.index.js.map +1 -0
- package/dist/esm/routes/_layout/app._appSlug.index2.js +16 -0
- package/dist/esm/routes/_layout/app._appSlug.index2.js.map +1 -0
- package/dist/esm/routes/_layout/apps.index.d.ts +1 -0
- package/dist/esm/routes/_layout/apps.index.js +13 -0
- package/dist/esm/routes/_layout/apps.index.js.map +1 -0
- package/dist/esm/routes/_layout/apps.index2.js +16 -0
- package/dist/esm/routes/_layout/apps.index2.js.map +1 -0
- package/dist/esm/routes/_layout/catalog.apps.index.d.ts +4 -0
- package/dist/esm/routes/_layout/catalog.apps.index.js +18 -0
- package/dist/esm/routes/_layout/catalog.apps.index.js.map +1 -0
- package/dist/esm/routes/_layout/catalog.apps.index2.js +15 -0
- package/dist/esm/routes/_layout/catalog.apps.index2.js.map +1 -0
- package/dist/esm/routes/_layout/catalog.index.d.ts +1 -0
- package/dist/esm/routes/_layout/catalog.index.js +15 -0
- package/dist/esm/routes/_layout/catalog.index.js.map +1 -0
- package/dist/esm/routes/_layout/catalog.index2.js +16 -0
- package/dist/esm/routes/_layout/catalog.index2.js.map +1 -0
- package/dist/esm/routes/_layout/dashboard.index.d.ts +1 -0
- package/dist/esm/routes/_layout/dashboard.index.js +13 -0
- package/dist/esm/routes/_layout/dashboard.index.js.map +1 -0
- package/dist/esm/routes/_layout/dashboard.index2.js +16 -0
- package/dist/esm/routes/_layout/dashboard.index2.js.map +1 -0
- package/dist/esm/routes/_layout/env.$envSlug.app.$appSlug.index.d.ts +1 -0
- package/dist/esm/routes/_layout/env.$envSlug.index.d.ts +1 -0
- package/dist/esm/routes/_layout/env._envSlug.app._appSlug.index.js +13 -0
- package/dist/esm/routes/_layout/env._envSlug.app._appSlug.index.js.map +1 -0
- package/dist/esm/routes/_layout/env._envSlug.app._appSlug.index2.js +16 -0
- package/dist/esm/routes/_layout/env._envSlug.app._appSlug.index2.js.map +1 -0
- package/dist/esm/routes/_layout/env._envSlug.index.js +13 -0
- package/dist/esm/routes/_layout/env._envSlug.index.js.map +1 -0
- package/dist/esm/routes/_layout/env._envSlug.index2.js +16 -0
- package/dist/esm/routes/_layout/env._envSlug.index2.js.map +1 -0
- package/dist/esm/routes/_layout/envs.index.d.ts +1 -0
- package/dist/esm/routes/_layout/envs.index.js +13 -0
- package/dist/esm/routes/_layout/envs.index.js.map +1 -0
- package/dist/esm/routes/_layout/envs.index2.js +16 -0
- package/dist/esm/routes/_layout/envs.index2.js.map +1 -0
- package/dist/esm/routes/_layout/index.d.ts +27 -1
- package/dist/esm/routes/_layout/index.js +14 -10
- package/dist/esm/routes/_layout/index.js.map +1 -1
- package/dist/esm/routes/_layout/index2.js +24 -0
- package/dist/esm/routes/_layout/index2.js.map +1 -0
- package/dist/esm/routes/_layout/login.d.ts +1 -0
- package/dist/esm/routes/_layout/login.js +9 -0
- package/dist/esm/routes/_layout/login.js.map +1 -0
- package/dist/esm/routes/_layout/login2.js +16 -0
- package/dist/esm/routes/_layout/login2.js.map +1 -0
- package/dist/esm/routes/_layout.d.ts +1 -1
- package/dist/esm/routes/_layout.js +3 -6
- package/dist/esm/routes/_layout.js.map +1 -1
- package/dist/esm/routes/_layout2.js +9 -0
- package/dist/esm/routes/_layout2.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog/$id.d.ts +5 -0
- package/dist/esm/routes/admin/app-for-catalog/_id.js +47 -0
- package/dist/esm/routes/admin/app-for-catalog/_id.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog/_id2.js +269 -0
- package/dist/esm/routes/admin/app-for-catalog/_id2.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog/index.d.ts +1 -0
- package/dist/esm/routes/admin/app-for-catalog/index.js +9 -0
- package/dist/esm/routes/admin/app-for-catalog/index.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog/index2.js +12 -0
- package/dist/esm/routes/admin/app-for-catalog/index2.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog.d.ts +1 -0
- package/dist/esm/routes/admin/app-for-catalog.js +14 -0
- package/dist/esm/routes/admin/app-for-catalog.js.map +1 -0
- package/dist/esm/routes/admin/app-for-catalog2.js +9 -0
- package/dist/esm/routes/admin/app-for-catalog2.js.map +1 -0
- package/dist/esm/routes/admin/chat.d.ts +1 -0
- package/dist/esm/routes/admin/chat.js +14 -0
- package/dist/esm/routes/admin/chat.js.map +1 -0
- package/dist/esm/routes/admin/chat2.js +9 -0
- package/dist/esm/routes/admin/chat2.js.map +1 -0
- package/dist/esm/routes/admin/icons.d.ts +1 -0
- package/dist/esm/routes/admin/icons.js +14 -0
- package/dist/esm/routes/admin/icons.js.map +1 -0
- package/dist/esm/routes/admin/icons2.js +12 -0
- package/dist/esm/routes/admin/icons2.js.map +1 -0
- package/dist/esm/routes/admin/index.d.ts +1 -0
- package/dist/esm/routes/admin/index.js +9 -0
- package/dist/esm/routes/admin/index.js.map +1 -0
- package/dist/esm/routes/admin/index2.js +9 -0
- package/dist/esm/routes/admin/index2.js.map +1 -0
- package/dist/esm/routes/admin.d.ts +1 -0
- package/dist/esm/routes/admin.js +14 -0
- package/dist/esm/routes/admin.js.map +1 -0
- package/dist/esm/routes/admin2.js +18 -0
- package/dist/esm/routes/admin2.js.map +1 -0
- package/dist/esm/routes/auth.callback.d.ts +4 -0
- package/dist/esm/routes/auth.callback.js +13 -0
- package/dist/esm/routes/auth.callback.js.map +1 -0
- package/dist/esm/routes/auth.callback2.js +49 -0
- package/dist/esm/routes/auth.callback2.js.map +1 -0
- package/dist/esm/types/ehTypes.d.ts +2 -5
- package/dist/esm/types/tanstackQuery.d.ts +2 -0
- package/dist/esm/types/types.d.ts +12 -3
- package/dist/esm/types/userBehaviourTypes.d.ts +1 -1
- package/dist/esm/ui/autocomplete.d.ts +29 -0
- package/dist/esm/ui/autocomplete.js +164 -0
- package/dist/esm/ui/autocomplete.js.map +1 -0
- package/dist/esm/ui/badge.js +27 -0
- package/dist/esm/ui/badge.js.map +1 -0
- package/dist/esm/ui/breadcrumb.d.ts +11 -0
- package/dist/esm/ui/breadcrumb.js +84 -0
- package/dist/esm/ui/breadcrumb.js.map +1 -0
- package/dist/esm/ui/button-group.d.ts +11 -0
- package/dist/esm/ui/button-group.js +40 -0
- package/dist/esm/ui/button-group.js.map +1 -0
- package/dist/esm/ui/button.d.ts +13 -0
- package/dist/esm/ui/button.js +53 -0
- package/dist/esm/ui/button.js.map +1 -0
- package/dist/esm/ui/card.d.ts +9 -0
- package/dist/esm/ui/card.js +66 -0
- package/dist/esm/ui/card.js.map +1 -0
- package/dist/esm/ui/checkbox.d.ts +4 -0
- package/dist/esm/ui/checkbox.js +32 -0
- package/dist/esm/ui/checkbox.js.map +1 -0
- package/dist/esm/{components/ui → ui}/collapsible.d.ts +1 -1
- package/dist/esm/ui/collapsible.js +47 -0
- package/dist/esm/ui/collapsible.js.map +1 -0
- package/dist/esm/ui/command.d.ts +20 -0
- package/dist/esm/ui/command.js +168 -0
- package/dist/esm/ui/command.js.map +1 -0
- package/dist/esm/ui/components/Breadcrumbs.d.ts +19 -0
- package/dist/esm/ui/components/Breadcrumbs.js +36 -0
- package/dist/esm/ui/components/Breadcrumbs.js.map +1 -0
- package/dist/esm/ui/components/commandInput/EhBaseSelector.d.ts +0 -4
- package/dist/esm/ui/components/contextDebug.js +54 -6
- package/dist/esm/ui/components/contextDebug.js.map +1 -1
- package/dist/esm/ui/components/error/DefaultErrorComponent.d.ts +2 -1
- package/dist/esm/ui/components/error/DefaultErrorComponent.js +75 -8
- package/dist/esm/ui/components/error/DefaultErrorComponent.js.map +1 -1
- package/dist/esm/ui/components/error/RootErrorPage.d.ts +2 -0
- package/dist/esm/ui/components/error/RootErrorPage.js +9 -0
- package/dist/esm/ui/components/error/RootErrorPage.js.map +1 -0
- package/dist/esm/ui/components/footer/Footer.js +33 -30
- package/dist/esm/ui/components/footer/Footer.js.map +1 -1
- package/dist/esm/ui/components/header/Header.d.ts +5 -0
- package/dist/esm/ui/components/header/Header.js +111 -0
- package/dist/esm/ui/components/header/Header.js.map +1 -0
- package/dist/esm/ui/components/quickBar/AppQuickJumpBar.d.ts +5 -0
- package/dist/esm/ui/components/quickBar/QuickJumpButton.d.ts +7 -0
- package/dist/esm/ui/components/quickBar/ResourceJumpGroupViewer.d.ts +5 -0
- package/dist/esm/ui/components/quickBar/arrangeGridItems.d.ts +16 -0
- package/dist/esm/{components/ui → ui}/dialog.d.ts +3 -9
- package/dist/esm/ui/dialog.js +137 -0
- package/dist/esm/ui/dialog.js.map +1 -0
- package/dist/esm/{components/ui → ui}/dropdown-menu.d.ts +2 -2
- package/dist/esm/ui/dropdown-menu.js +79 -0
- package/dist/esm/ui/dropdown-menu.js.map +1 -0
- package/dist/esm/ui/empty.d.ts +11 -0
- package/dist/esm/ui/empty.js +103 -0
- package/dist/esm/ui/empty.js.map +1 -0
- package/dist/esm/ui/error/NotFoundError.js +4 -3
- package/dist/esm/ui/error/NotFoundError.js.map +1 -1
- package/dist/esm/ui/form.d.ts +56 -0
- package/dist/esm/ui/form.js +134 -0
- package/dist/esm/ui/form.js.map +1 -0
- package/dist/esm/ui/input-group.d.ts +16 -0
- package/dist/esm/ui/input-group.js +125 -0
- package/dist/esm/ui/input-group.js.map +1 -0
- package/dist/esm/ui/input.d.ts +3 -0
- package/dist/esm/ui/input.js +22 -0
- package/dist/esm/ui/input.js.map +1 -0
- package/dist/esm/ui/label.d.ts +4 -0
- package/dist/esm/ui/label.js +23 -0
- package/dist/esm/ui/label.js.map +1 -0
- package/dist/esm/ui/layout/LoadingScreen.d.ts +3 -1
- package/dist/esm/ui/layout/LoadingScreen.js +47 -7
- package/dist/esm/ui/layout/LoadingScreen.js.map +1 -1
- package/dist/esm/ui/layout/MainLayout.d.ts +3 -1
- package/dist/esm/ui/layout/MainLayout.js +5 -6
- package/dist/esm/ui/layout/MainLayout.js.map +1 -1
- package/dist/esm/ui/layout/TopLevelProviders.d.ts +5 -0
- package/dist/esm/ui/layout/TopLevelProviders.js +39 -18
- package/dist/esm/ui/layout/TopLevelProviders.js.map +1 -1
- package/dist/esm/ui/layout/TopLevelProvidersForErrors.d.ts +10 -0
- package/dist/esm/ui/layout/TopLevelProvidersForErrors.js +24 -0
- package/dist/esm/ui/layout/TopLevelProvidersForErrors.js.map +1 -0
- package/dist/esm/ui/link.d.ts +10 -0
- package/dist/esm/ui/link.js +28 -0
- package/dist/esm/ui/link.js.map +1 -0
- package/dist/esm/ui/linkExternal.d.ts +8 -0
- package/dist/esm/ui/linkExternal.js +26 -0
- package/dist/esm/ui/linkExternal.js.map +1 -0
- package/dist/esm/ui/radio-group.d.ts +5 -0
- package/dist/esm/ui/scroll-area.js +62 -0
- package/dist/esm/ui/scroll-area.js.map +1 -0
- package/dist/esm/ui/search-input-with-shortcut.d.ts +25 -0
- package/dist/esm/ui/select.d.ts +15 -0
- package/dist/esm/ui/select.js +138 -0
- package/dist/esm/ui/select.js.map +1 -0
- package/dist/esm/{components/ui → ui}/separator.js +1 -1
- package/dist/esm/ui/separator.js.map +1 -0
- package/dist/esm/ui/shortcut-button.d.ts +24 -0
- package/dist/esm/ui/shortcut-button.js +57 -0
- package/dist/esm/ui/shortcut-button.js.map +1 -0
- package/dist/esm/ui/skeleton.d.ts +2 -0
- package/dist/esm/ui/skeleton.js +16 -0
- package/dist/esm/ui/skeleton.js.map +1 -0
- package/dist/esm/ui/spinner.d.ts +2 -0
- package/dist/esm/ui/spinner.js +18 -0
- package/dist/esm/ui/spinner.js.map +1 -0
- package/dist/esm/ui/table.d.ts +10 -0
- package/dist/esm/ui/table.js +87 -0
- package/dist/esm/ui/table.js.map +1 -0
- package/dist/esm/ui/textarea.d.ts +3 -0
- package/dist/esm/ui/textarea.js +19 -0
- package/dist/esm/ui/textarea.js.map +1 -0
- package/dist/esm/ui/tooltip.d.ts +7 -0
- package/dist/esm/userDb/EhDb.d.ts +16 -2
- package/dist/esm/userDb/EhDb.js +28 -2
- package/dist/esm/userDb/EhDb.js.map +1 -1
- package/dist/esm/util/availabilityMatrixUtils.d.ts +2 -2
- package/dist/esm/util/createEhRouter.d.ts +1 -1
- package/dist/esm/util/createEhRouter.js +4 -1
- package/dist/esm/util/createEhRouter.js.map +1 -1
- package/dist/esm/util/error-utils.d.ts +6 -0
- package/dist/esm/util/error-utils.js +28 -0
- package/dist/esm/util/error-utils.js.map +1 -0
- package/dist/esm/util/reactQueryUtils.d.ts +4 -0
- package/dist/esm/util/reactQueryUtils.js +7 -0
- package/dist/esm/util/reactQueryUtils.js.map +1 -1
- package/dist/esm/util/route-utils.d.ts +23 -2
- package/dist/esm/util/route-utils.js +11 -37
- package/dist/esm/util/route-utils.js.map +1 -1
- package/dist/esm/util/slug-utils.d.ts +12 -0
- package/dist/index.css +225 -0
- package/dist/public/app-catalog-16x16.png +0 -0
- package/dist/public/app-catalog-192x192.png +0 -0
- package/dist/public/app-catalog-32x32.png +0 -0
- package/dist/public/app-catalog-48x48.png +0 -0
- package/dist/public/app-catalog-512x512.png +0 -0
- package/dist/public/app-catalog-square.svg +160 -0
- package/dist/public/app-catalog.png +0 -0
- package/dist/public/app-catalog.svg +198 -0
- package/dist/public/favicon-app-catalog.ico +0 -0
- package/package.json +55 -16
- package/public/app-catalog-16x16.png +0 -0
- package/public/app-catalog-192x192.png +0 -0
- package/public/app-catalog-32x32.png +0 -0
- package/public/app-catalog-48x48.png +0 -0
- package/public/app-catalog-512x512.png +0 -0
- package/public/app-catalog-square.svg +160 -0
- package/public/app-catalog.png +0 -0
- package/public/app-catalog.svg +198 -0
- package/public/apple-touch-180x180.png +0 -0
- package/public/env-hopper-16x16.png +0 -0
- package/public/env-hopper-192x192.png +0 -0
- package/public/env-hopper-32x32.png +0 -0
- package/public/env-hopper-48x48.png +0 -0
- package/public/env-hopper-512x512.png +0 -0
- package/public/env-hopper-square.svg +114 -0
- package/public/favicon-app-catalog.ico +0 -0
- package/public/favicon.ico +0 -0
- package/public/robots.txt +2 -0
- package/src/App.tsx +1 -1
- package/src/__tests__/integration/appQuickJumpBar.integration.test.tsx +25 -0
- package/src/__tests__/integration/factories/BackendMagazine.ts +14 -0
- package/src/__tests__/integration/factories/DbMagazine.ts +13 -0
- package/src/__tests__/integration/factories/app.ts +14 -0
- package/src/__tests__/integration/factories/env.ts +14 -0
- package/src/__tests__/integration/factories/mapper.ts +253 -0
- package/src/__tests__/integration/factories/resourceJump.ts +15 -0
- package/src/__tests__/integration/factories/simpleDSL.ts +8 -0
- package/src/__tests__/integration/factories/types.ts +18 -0
- package/src/__tests__/integration/helpers/renderWithProviders.tsx +182 -0
- package/src/__tests__/integration/helpers/testHelpers.ts +24 -0
- package/src/__tests__/integration/helpers/uiHelpers.ts +166 -0
- package/src/__tests__/integration/quickSlots.integration.test.tsx +17 -0
- package/src/__tests__/integration/resourceJump.integration.test.tsx +184 -0
- package/src/__tests__/integration/setup/svgMock.tsx +10 -0
- package/src/__tests__/integration/setup/testSetup.ts +35 -0
- package/src/__tests__/modules/fuzzyMatchLogic/autoCompleteFilter.test.ts +64 -50
- package/src/__tests__/modules/fuzzyMatchLogic/testUtils.ts +10 -1
- package/src/__tests__/modules/resouceJump/findBestMatchByUrl.test.ts +15 -17
- package/src/__tests__/modules/resouceJump/helpers.test.ts +55 -0
- package/src/__tests__/modules/resouceJump/utils/mapToFlagshipResourceJumps.test.ts +58 -0
- package/src/__tests__/util/TestMagazine.ts +24 -0
- package/src/api/ApiQueryMagazine.ts +2 -2
- package/src/api/data/useQueryBootstrapConfig.ts +7 -6
- package/src/api/infra/createQueryClient.ts +5 -1
- package/src/api/unsorted/appCatalogFetcher.ts +32 -0
- package/src/api/unsorted/createCachingFetcher.ts +159 -0
- package/src/api/unsorted/indexDataFetcher.ts +13 -34
- package/src/api/unsorted/resourceJumpsExtendedFetcher.ts +33 -0
- package/src/api/unsorted/resourceJumpsFetcher.ts +32 -0
- package/src/appPropsFactory.ts +8 -6
- package/src/assets/app-catalog.svg +198 -0
- package/src/components/IconPickerDialog.tsx +136 -0
- package/src/components/IconPickerField.tsx +88 -0
- package/src/components/ThemeSwitcher.tsx +1 -1
- package/src/index.css +14 -0
- package/src/lib/getAppMode.ts +5 -0
- package/src/main.tsx +9 -5
- package/src/modules/admin-base/components/AdminChat.tsx +122 -0
- package/src/modules/admin-base/components/AdminLayout.tsx +105 -0
- package/src/modules/admin-base/components/AdminWelcome.tsx +52 -0
- package/src/modules/admin-base/context/AdminConfigContext.tsx +36 -0
- package/src/modules/admin-base/index.ts +16 -0
- package/src/modules/admin-base/types/adminTypes.ts +11 -0
- package/src/modules/appCatalog/AppCatalogAdminPage.tsx +281 -0
- package/src/modules/appCatalog/AppCatalogEditDialog.tsx +268 -0
- package/src/modules/appCatalog/ScreenshotItem.tsx +63 -0
- package/src/modules/appCatalog/ScreenshotManager.tsx +193 -0
- package/src/modules/appCatalog/api/ApiQueryMagazineAppCatalog.ts +12 -0
- package/src/modules/appCatalog/catalogRouteLoader.ts +28 -0
- package/src/modules/appCatalog/context/AppCatalogContext.tsx +46 -0
- package/src/modules/appCatalog/index.ts +16 -0
- package/src/modules/appCatalog/routeLoader.ts +9 -0
- package/src/modules/appCatalog/ui/components/AppDetailModal.tsx +283 -0
- package/src/modules/appCatalog/ui/grid/AppCatalogFiltersCard.tsx +79 -0
- package/src/modules/appCatalog/ui/grid/AppCatalogGrid.tsx +160 -0
- package/src/modules/appCatalog/ui/grid/AppCatalogTable.tsx +89 -0
- package/src/modules/appCatalog/ui/grid/appCatalogUtils.ts +30 -0
- package/src/modules/appCatalog/ui/layout/AppCatalogLayout.tsx +55 -0
- package/src/modules/appCatalog/ui/pages/AppCatalogPage.tsx +86 -0
- package/src/modules/auth/AuthContext.tsx +117 -0
- package/src/modules/auth/AuthModalContext.tsx +49 -0
- package/src/modules/auth/ProtectedContent.tsx +55 -0
- package/src/modules/auth/authClient.ts +9 -0
- package/src/modules/auth/index.ts +6 -0
- package/src/modules/auth/ui/LoginModal.tsx +36 -0
- package/src/modules/auth/ui/LoginPage.tsx +62 -0
- package/src/modules/auth/useAuthActions.ts +85 -0
- package/src/modules/config/BootstrapConfigContext.tsx +1 -1
- package/src/modules/config/HealthStateContext.tsx +47 -0
- package/src/modules/crossCuttingParams/CrossCuttingParamsContext.tsx +75 -0
- package/src/modules/crossCuttingParams/types.ts +18 -0
- package/src/modules/crossCuttingParams/utils/routeLoaderMapper.ts +7 -0
- package/src/modules/environment/{EnvironmentContext.tsx → context/EnvironmentContext.tsx} +37 -30
- package/src/modules/environment/context/useEnvironmentHistory.ts +30 -0
- package/src/modules/fuzzyMatchLogic/autoCompleteFilter.ts +86 -11
- package/src/modules/fuzzyMatchLogic/features/positionBonus.ts +29 -0
- package/src/modules/fuzzyMatchLogic/features/prefixFracTokenMiddles.ts +1 -1
- package/src/modules/fuzzyMatchLogic/postFiltration.ts +133 -0
- package/src/modules/fuzzyMatchLogic/scoring.ts +7 -1
- package/src/modules/fuzzyMatchLogic/tokenize.ts +12 -1
- package/src/modules/fuzzyMatchLogic/types.ts +1 -0
- package/src/modules/icons/IconManagementPage.tsx +237 -0
- package/src/modules/pluginCore/PluginManagerContext.tsx +14 -43
- package/src/modules/pluginCore/makePluginManagerContext.ts +3 -25
- package/src/modules/pluginCore/types.ts +0 -27
- package/src/modules/resourceJump/api/ApiQueryMagazineResourceJump.ts +52 -0
- package/src/modules/resourceJump/context/ResourceJumpContext.tsx +395 -0
- package/src/modules/resourceJump/context/useResouceJumpHistory.ts +117 -0
- package/src/modules/resourceJump/routeLoader.ts +28 -36
- package/src/modules/resourceJump/types.ts +25 -6
- package/src/modules/resourceJump/ui/AppSwitcher.tsx +22 -0
- package/src/modules/resourceJump/ui/CredentialsWidget.tsx +15 -0
- package/src/modules/resourceJump/ui/EnvSwitcher.tsx +17 -0
- package/src/modules/resourceJump/ui/JumpALink.tsx +3 -11
- package/src/modules/resourceJump/ui/JumpMainButton.tsx +85 -44
- package/src/modules/resourceJump/ui/LateResolvableSingleParam.tsx +47 -0
- package/src/modules/resourceJump/ui/LateResolvableTopParam.tsx +46 -0
- package/src/modules/resourceJump/ui/ResolvableParameterSelector.tsx +109 -0
- package/src/modules/resourceJump/ui/ResolvableParameters.tsx +26 -0
- package/src/modules/resourceJump/ui/ResourceJumpBreadcrumbs.tsx +89 -0
- package/src/modules/resourceJump/ui/ResourceJumpButton.tsx +75 -0
- package/src/modules/resourceJump/ui/ResourceJumpMockTable.tsx +249 -0
- package/src/modules/resourceJump/ui/ShareLinkButton.tsx +127 -0
- package/src/modules/resourceJump/ui/SmoothSwitcher.tsx +119 -0
- package/src/modules/resourceJump/ui/TopQuickJump.tsx +23 -0
- package/src/modules/resourceJump/ui/appCatalog/AppCatalogFiltersCard.tsx +79 -0
- package/src/modules/resourceJump/ui/appCatalog/AppCatalogGrid.tsx +30 -0
- package/src/modules/resourceJump/ui/appCatalog/AppCatalogTable.tsx +86 -0
- package/src/modules/resourceJump/ui/appCatalog/appCatalogUtils.ts +12 -0
- package/src/modules/resourceJump/ui/cmdk/AppAutocomplete.tsx +231 -0
- package/src/modules/resourceJump/ui/cmdk/CmdKQuickSearchDialog.scss +197 -0
- package/src/modules/resourceJump/ui/cmdk/CmdKQuickSearchDialog.tsx +297 -0
- package/src/modules/resourceJump/ui/cmdk/CommandPalette.tsx +51 -0
- package/src/modules/resourceJump/ui/cmdk/EnvAutocomplete.tsx +237 -0
- package/src/modules/resourceJump/ui/cmdk/QuickSearch.tsx +107 -0
- package/src/modules/resourceJump/ui/cmdk/QuickSearchContext.tsx +58 -0
- package/src/modules/resourceJump/ui/cmdk/highlightText.tsx +27 -0
- package/src/modules/resourceJump/ui/cmdk/types.ts +7 -0
- package/src/modules/resourceJump/ui/cmdk/useCmdkDriver.ts +40 -0
- package/src/modules/resourceJump/ui/cmdk/useQuickSearchLogic.ts +74 -0
- package/src/modules/resourceJump/ui/layout/CenterColumn.tsx +3 -0
- package/src/modules/resourceJump/ui/layout/LeftColumn.tsx +96 -0
- package/src/modules/resourceJump/ui/layout/ResourceJumpLayout.tsx +101 -0
- package/src/modules/resourceJump/ui/layout/RightColumn.tsx +14 -0
- package/src/modules/resourceJump/ui/miniEnvSelector/MiniEnvSelectorPopover.tsx +61 -0
- package/src/modules/resourceJump/ui/pages/AppCatalog.tsx +105 -0
- package/src/modules/resourceJump/ui/pages/AppPage.tsx +14 -0
- package/src/modules/resourceJump/ui/pages/AppPageFlagship.tsx +121 -0
- package/src/modules/resourceJump/ui/pages/AppPageRegular.tsx +16 -0
- package/src/modules/resourceJump/ui/pages/DashboardPage.tsx +13 -0
- package/src/modules/resourceJump/ui/pages/EnvCatalog.tsx +89 -0
- package/src/modules/resourceJump/ui/pages/EnvPage.tsx +195 -0
- package/src/modules/resourceJump/ui/pages/HomePage.tsx +35 -0
- package/src/modules/resourceJump/ui/widgets/VersionWidget.tsx +15 -0
- package/src/modules/resourceJump/utils/buildJumpUrl.ts +46 -0
- package/src/modules/resourceJump/{findBestMatchByUrl.ts → utils/findBestMatchByUrl.ts} +4 -4
- package/src/modules/resourceJump/{helpers.ts → utils/helpers.ts} +42 -9
- package/src/modules/resourceJump/utils/mapToFlagshipResourceJumps.ts +88 -0
- package/src/modules/resourceJump/utils/mapToResouceJumpUis.ts +20 -0
- package/src/modules/resourceJump/utils/statistics/statisticsHelpers.ts +24 -0
- package/src/modules/resourceJump/utils/statistics/useEnvStatistics.ts +32 -0
- package/src/modules/resourceJump/utils/statistics/useMostRelevantLateParamSlug.ts +10 -0
- package/src/modules/resourceJump/utils/statistics/useMostRelevantQuickEnvs.ts +21 -0
- package/src/modules/resourceJump/utils/statistics/useMostRelevantQuickFlagships.ts +36 -0
- package/src/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.ts +5 -34
- package/src/plugins/builtin/pageUrl/pageUrlTypes.ts +1 -2
- package/src/routeTree.gen.ts +353 -143
- package/src/routes/__root.tsx +10 -7
- package/src/routes/_layout/app.$appSlug.index.tsx +25 -0
- package/src/routes/_layout/apps.index.tsx +26 -0
- package/src/routes/_layout/catalog.apps.index.tsx +27 -0
- package/src/routes/_layout/catalog.index.tsx +29 -0
- package/src/routes/_layout/dashboard.index.tsx +26 -0
- package/src/routes/_layout/env.$envSlug.app.$appSlug.index.tsx +25 -0
- package/src/routes/_layout/env.$envSlug.index.tsx +25 -0
- package/src/routes/_layout/envs.index.tsx +26 -0
- package/src/routes/_layout/index.tsx +72 -5
- package/src/routes/_layout/login.tsx +20 -0
- package/src/routes/admin/app-for-catalog/$id.tsx +468 -0
- package/src/routes/admin/app-for-catalog/index.tsx +19 -0
- package/src/routes/admin/app-for-catalog.tsx +12 -0
- package/src/routes/admin/chat.tsx +13 -0
- package/src/routes/admin/icons.tsx +22 -0
- package/src/routes/admin/index.tsx +9 -0
- package/src/routes/admin.tsx +32 -0
- package/src/routes/auth.callback.tsx +74 -0
- package/src/types/ehTypes.ts +3 -5
- package/src/types/tanstackQuery.ts +2 -0
- package/src/types/types.ts +13 -3
- package/src/types/userBehaviourTypes.ts +1 -1
- package/src/types/vite-env.d.ts +1 -0
- package/src/ui/autocomplete.tsx +272 -0
- package/src/{components/ui → ui}/badge.tsx +2 -1
- package/src/ui/breadcrumb.tsx +106 -0
- package/src/ui/button-group.tsx +85 -0
- package/src/ui/button.tsx +66 -0
- package/src/ui/card.tsx +92 -0
- package/src/ui/checkbox.tsx +30 -0
- package/src/{components/ui → ui}/collapsible.tsx +17 -3
- package/src/ui/command.tsx +196 -0
- package/src/ui/components/ActionCard.tsx +2 -2
- package/src/ui/components/AppIcon.tsx +5 -5
- package/src/ui/components/Breadcrumbs.tsx +97 -0
- package/src/ui/components/commandInput/EhBaseSelector.tsx +0 -34
- package/src/ui/components/contextDebug.tsx +54 -5
- package/src/ui/components/error/DefaultErrorComponent.tsx +107 -31
- package/src/ui/components/error/{RooutErrorPage.tsx → RootErrorPage.tsx} +2 -2
- package/src/ui/components/footer/Footer.tsx +19 -0
- package/src/ui/components/header/Header.tsx +172 -0
- package/src/ui/components/quickBar/AppQuickJumpBar.tsx +176 -0
- package/src/ui/components/quickBar/QuickJumpButton.tsx +21 -0
- package/src/ui/components/quickBar/ResourceJumpGroupViewer.tsx +80 -0
- package/src/ui/components/quickBar/arrangeGridItems.ts +61 -0
- package/src/ui/components/widgets/CredentialsWidget.tsx +3 -3
- package/src/ui/components/widgets/VersionWidget.tsx +1 -1
- package/src/{components/ui → ui}/dialog.tsx +10 -51
- package/src/{components/ui → ui}/dropdown-menu.tsx +13 -15
- package/src/ui/empty.tsx +105 -0
- package/src/ui/error/NotFoundError.tsx +10 -7
- package/src/ui/form.tsx +188 -0
- package/src/ui/input-group.tsx +167 -0
- package/src/ui/input.tsx +21 -0
- package/src/ui/label.tsx +22 -0
- package/src/ui/layout/LoadingScreen.tsx +58 -8
- package/src/ui/layout/MainLayout.tsx +7 -7
- package/src/ui/layout/TopLevelProviders.tsx +51 -25
- package/src/ui/layout/TopLevelProvidersForErrors.tsx +34 -0
- package/src/ui/link.tsx +31 -0
- package/src/ui/linkExternal.tsx +26 -0
- package/src/ui/main/JumpTabContent.tsx +1 -1
- package/src/ui/radio-group.tsx +43 -0
- package/src/ui/search-input-with-shortcut.tsx +54 -0
- package/src/ui/select.tsx +185 -0
- package/src/ui/shortcut-button.tsx +84 -0
- package/src/ui/skeleton.tsx +13 -0
- package/src/ui/spinner.tsx +16 -0
- package/src/ui/table.tsx +114 -0
- package/src/{components/ui → ui}/tabs.tsx +2 -3
- package/src/ui/textarea.tsx +18 -0
- package/src/ui/tooltip.tsx +60 -0
- package/src/userDb/EhDb.ts +48 -5
- package/src/util/availabilityMatrixUtils.ts +2 -2
- package/src/util/{createEhRouter.ts → createEhRouter.tsx} +2 -0
- package/src/util/error-utils.ts +31 -0
- package/src/util/reactQueryUtils.ts +8 -0
- package/src/util/route-utils.ts +11 -34
- package/src/util/slug-utils.ts +17 -0
- package/dist/disable.well-known/appspecific/com.chrome.devtools.json +0 -6
- package/dist/esm/api/ApiQueryMagazine.js +0 -16
- package/dist/esm/api/ApiQueryMagazine.js.map +0 -1
- package/dist/esm/api/data/useQueryBootstrapConfig.js +0 -14
- package/dist/esm/api/data/useQueryBootstrapConfig.js.map +0 -1
- package/dist/esm/api/unsorted/indexDataFetcher.js +0 -35
- package/dist/esm/api/unsorted/indexDataFetcher.js.map +0 -1
- package/dist/esm/assets/env-hopper-logo.svg.js +0 -16
- package/dist/esm/assets/env-hopper-logo.svg.js.map +0 -1
- package/dist/esm/components/ui/breadcrumb.d.ts +0 -46
- package/dist/esm/components/ui/button.d.ts +0 -16
- package/dist/esm/components/ui/button.js +0 -52
- package/dist/esm/components/ui/button.js.map +0 -1
- package/dist/esm/components/ui/card.d.ts +0 -38
- package/dist/esm/components/ui/input.d.ts +0 -10
- package/dist/esm/components/ui/popover.js +0 -14
- package/dist/esm/components/ui/popover.js.map +0 -1
- package/dist/esm/components/ui/separator.js.map +0 -1
- package/dist/esm/modules/environment/ApiQueryMagazineEnvironment.js +0 -13
- package/dist/esm/modules/environment/ApiQueryMagazineEnvironment.js.map +0 -1
- package/dist/esm/modules/environment/EnvironmentContext.js +0 -67
- package/dist/esm/modules/environment/EnvironmentContext.js.map +0 -1
- package/dist/esm/modules/environment/ui/EhEnvSelector.d.ts +0 -9
- package/dist/esm/modules/environment/ui/EhEnvSelector.js +0 -167
- package/dist/esm/modules/environment/ui/EhEnvSelector.js.map +0 -1
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFrac.js +0 -12
- package/dist/esm/modules/fuzzyMatchLogic/features/prefixFrac.js.map +0 -1
- package/dist/esm/modules/fuzzyMatchLogic/scoring.js +0 -23
- package/dist/esm/modules/fuzzyMatchLogic/scoring.js.map +0 -1
- package/dist/esm/modules/fuzzyMatchLogic/utils.js +0 -12
- package/dist/esm/modules/fuzzyMatchLogic/utils.js.map +0 -1
- package/dist/esm/modules/pluginCore/types.js +0 -7
- package/dist/esm/modules/pluginCore/types.js.map +0 -1
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.d.ts +0 -27
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.js +0 -26
- package/dist/esm/modules/resourceJump/ApiQueryMagazineResourceJump.js.map +0 -1
- package/dist/esm/modules/resourceJump/ResourceJumpContext.d.ts +0 -17
- package/dist/esm/modules/resourceJump/ResourceJumpContext.js +0 -88
- package/dist/esm/modules/resourceJump/ResourceJumpContext.js.map +0 -1
- package/dist/esm/modules/resourceJump/buildJumpUrl.d.ts +0 -2
- package/dist/esm/modules/resourceJump/buildJumpUrl.js +0 -32
- package/dist/esm/modules/resourceJump/buildJumpUrl.js.map +0 -1
- package/dist/esm/modules/resourceJump/findBestMatchByUrl.js +0 -85
- package/dist/esm/modules/resourceJump/findBestMatchByUrl.js.map +0 -1
- package/dist/esm/modules/resourceJump/helpers.js +0 -19
- package/dist/esm/modules/resourceJump/helpers.js.map +0 -1
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.d.ts +0 -20
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.js +0 -209
- package/dist/esm/modules/resourceJump/ui/EhJumpResourceSelector.js.map +0 -1
- package/dist/esm/modules/resourceJump/ui/JumpALink.js +0 -38
- package/dist/esm/modules/resourceJump/ui/JumpALink.js.map +0 -1
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.js +0 -66
- package/dist/esm/modules/resourceJump/ui/JumpMainButton.js.map +0 -1
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.d.ts +0 -5
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.js +0 -42
- package/dist/esm/modules/resourceJump/ui/ResouceJumpLayout.js.map +0 -1
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.d.ts +0 -9
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.js +0 -36
- package/dist/esm/plugins/builtin/pageUrl/PageUrlPluginContext.js.map +0 -1
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js +0 -44
- package/dist/esm/plugins/builtin/pageUrl/pageUrlAutoCompletePlugin.js.map +0 -1
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.d.ts +0 -7
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.js +0 -29
- package/dist/esm/plugins/builtin/pageUrl/pageUrlJumpPlugin.js.map +0 -1
- package/dist/esm/routes/_layout/app/$appSlug/sub/$subValue.d.ts +0 -1
- package/dist/esm/routes/_layout/app/$appSlug.d.ts +0 -1
- package/dist/esm/routes/_layout/app/_appSlug/sub/_subValue.js +0 -18
- package/dist/esm/routes/_layout/app/_appSlug/sub/_subValue.js.map +0 -1
- package/dist/esm/routes/_layout/app/_appSlug.js +0 -18
- package/dist/esm/routes/_layout/app/_appSlug.js.map +0 -1
- package/dist/esm/routes/_layout/env/$envSlug/app/$appSlug/sub/$subValue.d.ts +0 -1
- package/dist/esm/routes/_layout/env/$envSlug/app/$appSlug.d.ts +0 -1
- package/dist/esm/routes/_layout/env/$envSlug/sub/$subValue.d.ts +0 -1
- package/dist/esm/routes/_layout/env/$envSlug.d.ts +0 -1
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug/sub/_subValue.js +0 -20
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug/sub/_subValue.js.map +0 -1
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug.js +0 -18
- package/dist/esm/routes/_layout/env/_envSlug/app/_appSlug.js.map +0 -1
- package/dist/esm/routes/_layout/env/_envSlug/sub/_subValue.js +0 -18
- package/dist/esm/routes/_layout/env/_envSlug/sub/_subValue.js.map +0 -1
- package/dist/esm/routes/_layout/env/_envSlug.js +0 -18
- package/dist/esm/routes/_layout/env/_envSlug.js.map +0 -1
- package/dist/esm/ui/components/commandInput/EhBaseSelector.js +0 -22
- package/dist/esm/ui/components/commandInput/EhBaseSelector.js.map +0 -1
- package/dist/esm/ui/components/controlPanel/BaseDropdownSelector.d.ts +0 -11
- package/dist/esm/ui/components/controlPanel/env/EnvDropdownContent.d.ts +0 -5
- package/dist/esm/ui/components/controlPanel/env/EnvDropdownSelector.d.ts +0 -1
- package/dist/esm/ui/components/error/RooutErrorPage.d.ts +0 -2
- package/dist/esm/ui/components/error/RooutErrorPage.js +0 -12
- package/dist/esm/ui/components/error/RooutErrorPage.js.map +0 -1
- package/dist/esm/ui/components/header/PlaygroundHeader.d.ts +0 -1
- package/dist/esm/ui/components/header/PlaygroundHeader.js +0 -23
- package/dist/esm/ui/components/header/PlaygroundHeader.js.map +0 -1
- package/dist/esm/ui/components/leftPanel/LeftPanel.d.ts +0 -5
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.d.ts +0 -5
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.js +0 -52
- package/dist/esm/ui/components/quickBar/EnvQuickJumpBar.js.map +0 -1
- package/dist/esm/ui/layout/Header.d.ts +0 -1
- package/dist/esm/util/availabilityMatrixUtils.js +0 -57
- package/dist/esm/util/availabilityMatrixUtils.js.map +0 -1
- package/dist/esm/util/highlightMatches.js +0 -19
- package/dist/esm/util/highlightMatches.js.map +0 -1
- package/src/components/ui/breadcrumb.tsx +0 -128
- package/src/components/ui/button.tsx +0 -60
- package/src/components/ui/card.tsx +0 -95
- package/src/components/ui/input.tsx +0 -28
- package/src/modules/environment/ui/EhEnvSelector.tsx +0 -191
- package/src/modules/resourceJump/ApiQueryMagazineResourceJump.ts +0 -31
- package/src/modules/resourceJump/ResourceJumpContext.tsx +0 -142
- package/src/modules/resourceJump/buildJumpUrl.ts +0 -40
- package/src/modules/resourceJump/ui/EhJumpResourceSelector.tsx +0 -259
- package/src/modules/resourceJump/ui/ResouceJumpLayout.tsx +0 -73
- package/src/plugins/builtin/pageUrl/PageUrlPluginContext.tsx +0 -55
- package/src/plugins/builtin/pageUrl/pageUrlJumpPlugin.ts +0 -36
- package/src/routes/_layout/app/$appSlug/sub/$subValue.tsx +0 -15
- package/src/routes/_layout/app/$appSlug.tsx +0 -15
- package/src/routes/_layout/env/$envSlug/app/$appSlug/sub/$subValue.tsx +0 -17
- package/src/routes/_layout/env/$envSlug/app/$appSlug.tsx +0 -15
- package/src/routes/_layout/env/$envSlug/sub/$subValue.tsx +0 -15
- package/src/routes/_layout/env/$envSlug.tsx +0 -15
- package/src/ui/components/controlPanel/BaseDropdownSelector.tsx +0 -163
- package/src/ui/components/controlPanel/env/EnvDropdownContent.tsx +0 -114
- package/src/ui/components/controlPanel/env/EnvDropdownSelector.tsx +0 -21
- package/src/ui/components/header/PlaygroundHeader.tsx +0 -26
- package/src/ui/components/leftPanel/LeftPanel.tsx +0 -194
- package/src/ui/components/quickBar/EnvQuickJumpBar.tsx +0 -65
- package/src/ui/layout/Header.tsx +0 -14
- /package/dist/esm/{components/ui → ui}/badge.d.ts +0 -0
- /package/dist/esm/{components/ui → ui}/popover.d.ts +0 -0
- /package/dist/esm/{components/ui → ui}/scroll-area.d.ts +0 -0
- /package/dist/esm/{components/ui → ui}/separator.d.ts +0 -0
- /package/dist/esm/{components/ui → ui}/tabs.d.ts +0 -0
- /package/dist/{apple-touch-180x180.png → public/apple-touch-180x180.png} +0 -0
- /package/dist/{env-hopper-16x16.png → public/env-hopper-16x16.png} +0 -0
- /package/dist/{env-hopper-192x192.png → public/env-hopper-192x192.png} +0 -0
- /package/dist/{env-hopper-32x32.png → public/env-hopper-32x32.png} +0 -0
- /package/dist/{env-hopper-48x48.png → public/env-hopper-48x48.png} +0 -0
- /package/dist/{env-hopper-512x512.png → public/env-hopper-512x512.png} +0 -0
- /package/dist/{env-hopper-square.svg → public/env-hopper-square.svg} +0 -0
- /package/dist/{favicon.ico → public/favicon.ico} +0 -0
- /package/dist/{robots.txt → public/robots.txt} +0 -0
- /package/src/{components/ui → ui}/popover.tsx +0 -0
- /package/src/{components/ui → ui}/scroll-area.tsx +0 -0
- /package/src/{components/ui → ui}/separator.tsx +0 -0
|
@@ -0,0 +1,1894 @@
|
|
|
1
|
+
import React__default from "react";
|
|
2
|
+
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
3
|
+
var isDateObject = (value) => value instanceof Date;
|
|
4
|
+
var isNullOrUndefined = (value) => value == null;
|
|
5
|
+
const isObjectType = (value) => typeof value === "object";
|
|
6
|
+
var isObject = (value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value);
|
|
7
|
+
var getEventValue = (event) => isObject(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event;
|
|
8
|
+
var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name;
|
|
9
|
+
var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));
|
|
10
|
+
var isPlainObject = (tempObject) => {
|
|
11
|
+
const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
|
|
12
|
+
return isObject(prototypeCopy) && prototypeCopy.hasOwnProperty("isPrototypeOf");
|
|
13
|
+
};
|
|
14
|
+
var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
|
|
15
|
+
function cloneObject(data) {
|
|
16
|
+
if (data instanceof Date) {
|
|
17
|
+
return new Date(data);
|
|
18
|
+
}
|
|
19
|
+
const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
|
|
20
|
+
if (isWeb && (data instanceof Blob || isFileListInstance)) {
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
const isArray = Array.isArray(data);
|
|
24
|
+
if (!isArray && !(isObject(data) && isPlainObject(data))) {
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
|
|
28
|
+
for (const key in data) {
|
|
29
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
30
|
+
copy[key] = cloneObject(data[key]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return copy;
|
|
34
|
+
}
|
|
35
|
+
var isKey = (value) => /^\w*$/.test(value);
|
|
36
|
+
var isUndefined = (val) => val === void 0;
|
|
37
|
+
var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];
|
|
38
|
+
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
39
|
+
var get = (object, path, defaultValue) => {
|
|
40
|
+
if (!path || !isObject(object)) {
|
|
41
|
+
return defaultValue;
|
|
42
|
+
}
|
|
43
|
+
const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result2, key) => isNullOrUndefined(result2) ? result2 : result2[key], object);
|
|
44
|
+
return isUndefined(result) || result === object ? isUndefined(object[path]) ? defaultValue : object[path] : result;
|
|
45
|
+
};
|
|
46
|
+
var isBoolean = (value) => typeof value === "boolean";
|
|
47
|
+
var isFunction = (value) => typeof value === "function";
|
|
48
|
+
var set = (object, path, value) => {
|
|
49
|
+
let index = -1;
|
|
50
|
+
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
51
|
+
const length = tempPath.length;
|
|
52
|
+
const lastIndex = length - 1;
|
|
53
|
+
while (++index < length) {
|
|
54
|
+
const key = tempPath[index];
|
|
55
|
+
let newValue = value;
|
|
56
|
+
if (index !== lastIndex) {
|
|
57
|
+
const objValue = object[key];
|
|
58
|
+
newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
|
|
59
|
+
}
|
|
60
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
object[key] = newValue;
|
|
64
|
+
object = object[key];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const EVENTS = {
|
|
68
|
+
BLUR: "blur",
|
|
69
|
+
FOCUS_OUT: "focusout",
|
|
70
|
+
CHANGE: "change"
|
|
71
|
+
};
|
|
72
|
+
const VALIDATION_MODE = {
|
|
73
|
+
onBlur: "onBlur",
|
|
74
|
+
onChange: "onChange",
|
|
75
|
+
onSubmit: "onSubmit",
|
|
76
|
+
onTouched: "onTouched",
|
|
77
|
+
all: "all"
|
|
78
|
+
};
|
|
79
|
+
const INPUT_VALIDATION_RULES = {
|
|
80
|
+
max: "max",
|
|
81
|
+
min: "min",
|
|
82
|
+
maxLength: "maxLength",
|
|
83
|
+
minLength: "minLength",
|
|
84
|
+
pattern: "pattern",
|
|
85
|
+
required: "required",
|
|
86
|
+
validate: "validate"
|
|
87
|
+
};
|
|
88
|
+
const HookFormControlContext = React__default.createContext(null);
|
|
89
|
+
HookFormControlContext.displayName = "HookFormControlContext";
|
|
90
|
+
const useFormControlContext = () => React__default.useContext(HookFormControlContext);
|
|
91
|
+
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
92
|
+
const result = {
|
|
93
|
+
defaultValues: control._defaultValues
|
|
94
|
+
};
|
|
95
|
+
for (const key in formState) {
|
|
96
|
+
Object.defineProperty(result, key, {
|
|
97
|
+
get: () => {
|
|
98
|
+
const _key = key;
|
|
99
|
+
if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
|
|
100
|
+
control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
|
|
101
|
+
}
|
|
102
|
+
localProxyFormState && (localProxyFormState[_key] = true);
|
|
103
|
+
return formState[_key];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
};
|
|
109
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React__default.useLayoutEffect : React__default.useEffect;
|
|
110
|
+
function useFormState(props) {
|
|
111
|
+
const formControl = useFormControlContext();
|
|
112
|
+
const { control = formControl, disabled, name, exact } = props || {};
|
|
113
|
+
const [formState, updateFormState] = React__default.useState(control._formState);
|
|
114
|
+
const _localProxyFormState = React__default.useRef({
|
|
115
|
+
isDirty: false,
|
|
116
|
+
isLoading: false,
|
|
117
|
+
dirtyFields: false,
|
|
118
|
+
touchedFields: false,
|
|
119
|
+
validatingFields: false,
|
|
120
|
+
isValidating: false,
|
|
121
|
+
isValid: false,
|
|
122
|
+
errors: false
|
|
123
|
+
});
|
|
124
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
125
|
+
name,
|
|
126
|
+
formState: _localProxyFormState.current,
|
|
127
|
+
exact,
|
|
128
|
+
callback: (formState2) => {
|
|
129
|
+
!disabled && updateFormState({
|
|
130
|
+
...control._formState,
|
|
131
|
+
...formState2
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}), [name, disabled, exact]);
|
|
135
|
+
React__default.useEffect(() => {
|
|
136
|
+
_localProxyFormState.current.isValid && control._setValid(true);
|
|
137
|
+
}, [control]);
|
|
138
|
+
return React__default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
|
|
139
|
+
}
|
|
140
|
+
var isString = (value) => typeof value === "string";
|
|
141
|
+
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
142
|
+
if (isString(names)) {
|
|
143
|
+
isGlobal && _names.watch.add(names);
|
|
144
|
+
return get(formValues, names, defaultValue);
|
|
145
|
+
}
|
|
146
|
+
if (Array.isArray(names)) {
|
|
147
|
+
return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));
|
|
148
|
+
}
|
|
149
|
+
isGlobal && (_names.watchAll = true);
|
|
150
|
+
return formValues;
|
|
151
|
+
};
|
|
152
|
+
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
153
|
+
function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new WeakSet()) {
|
|
154
|
+
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
155
|
+
return Object.is(object1, object2);
|
|
156
|
+
}
|
|
157
|
+
if (isDateObject(object1) && isDateObject(object2)) {
|
|
158
|
+
return Object.is(object1.getTime(), object2.getTime());
|
|
159
|
+
}
|
|
160
|
+
const keys1 = Object.keys(object1);
|
|
161
|
+
const keys2 = Object.keys(object2);
|
|
162
|
+
if (keys1.length !== keys2.length) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
if (_internal_visited.has(object1) || _internal_visited.has(object2)) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
_internal_visited.add(object1);
|
|
169
|
+
_internal_visited.add(object2);
|
|
170
|
+
for (const key of keys1) {
|
|
171
|
+
const val1 = object1[key];
|
|
172
|
+
if (!keys2.includes(key)) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
if (key !== "ref") {
|
|
176
|
+
const val2 = object2[key];
|
|
177
|
+
if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
function useWatch(props) {
|
|
185
|
+
const formControl = useFormControlContext();
|
|
186
|
+
const { control = formControl, name, defaultValue, disabled, exact, compute } = props || {};
|
|
187
|
+
const _defaultValue = React__default.useRef(defaultValue);
|
|
188
|
+
const _compute = React__default.useRef(compute);
|
|
189
|
+
const _computeFormValues = React__default.useRef(void 0);
|
|
190
|
+
const _prevControl = React__default.useRef(control);
|
|
191
|
+
const _prevName = React__default.useRef(name);
|
|
192
|
+
_compute.current = compute;
|
|
193
|
+
const [value, updateValue] = React__default.useState(() => {
|
|
194
|
+
const defaultValue2 = control._getWatch(name, _defaultValue.current);
|
|
195
|
+
return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
|
|
196
|
+
});
|
|
197
|
+
const getCurrentOutput = React__default.useCallback((values) => {
|
|
198
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
199
|
+
return _compute.current ? _compute.current(formValues) : formValues;
|
|
200
|
+
}, [control._formValues, control._names, name]);
|
|
201
|
+
const refreshValue = React__default.useCallback((values) => {
|
|
202
|
+
if (!disabled) {
|
|
203
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
204
|
+
if (_compute.current) {
|
|
205
|
+
const computedFormValues = _compute.current(formValues);
|
|
206
|
+
if (!deepEqual(computedFormValues, _computeFormValues.current)) {
|
|
207
|
+
updateValue(computedFormValues);
|
|
208
|
+
_computeFormValues.current = computedFormValues;
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
updateValue(formValues);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}, [control._formValues, control._names, disabled, name]);
|
|
215
|
+
useIsomorphicLayoutEffect(() => {
|
|
216
|
+
if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
|
|
217
|
+
_prevControl.current = control;
|
|
218
|
+
_prevName.current = name;
|
|
219
|
+
refreshValue();
|
|
220
|
+
}
|
|
221
|
+
return control._subscribe({
|
|
222
|
+
name,
|
|
223
|
+
formState: {
|
|
224
|
+
values: true
|
|
225
|
+
},
|
|
226
|
+
exact,
|
|
227
|
+
callback: (formState) => {
|
|
228
|
+
refreshValue(formState.values);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}, [control, exact, name, refreshValue]);
|
|
232
|
+
React__default.useEffect(() => control._removeUnmounted());
|
|
233
|
+
const controlChanged = _prevControl.current !== control;
|
|
234
|
+
const prevName = _prevName.current;
|
|
235
|
+
const computedOutput = React__default.useMemo(() => {
|
|
236
|
+
if (disabled) {
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
const nameChanged = !controlChanged && !deepEqual(prevName, name);
|
|
240
|
+
const shouldReturnImmediate = controlChanged || nameChanged;
|
|
241
|
+
return shouldReturnImmediate ? getCurrentOutput() : null;
|
|
242
|
+
}, [disabled, controlChanged, name, prevName, getCurrentOutput]);
|
|
243
|
+
return computedOutput !== null ? computedOutput : value;
|
|
244
|
+
}
|
|
245
|
+
function useController(props) {
|
|
246
|
+
const formControl = useFormControlContext();
|
|
247
|
+
const { name, disabled, control = formControl, shouldUnregister, defaultValue, exact = true } = props;
|
|
248
|
+
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
249
|
+
const defaultValueMemo = React__default.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
250
|
+
const value = useWatch({
|
|
251
|
+
control,
|
|
252
|
+
name,
|
|
253
|
+
defaultValue: defaultValueMemo,
|
|
254
|
+
exact
|
|
255
|
+
});
|
|
256
|
+
const formState = useFormState({
|
|
257
|
+
control,
|
|
258
|
+
name,
|
|
259
|
+
exact
|
|
260
|
+
});
|
|
261
|
+
const _props = React__default.useRef(props);
|
|
262
|
+
const _previousNameRef = React__default.useRef(void 0);
|
|
263
|
+
const _registerProps = React__default.useRef(control.register(name, {
|
|
264
|
+
...props.rules,
|
|
265
|
+
value,
|
|
266
|
+
...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
|
|
267
|
+
}));
|
|
268
|
+
_props.current = props;
|
|
269
|
+
const fieldState = React__default.useMemo(() => Object.defineProperties({}, {
|
|
270
|
+
invalid: {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: () => !!get(formState.errors, name)
|
|
273
|
+
},
|
|
274
|
+
isDirty: {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
get: () => !!get(formState.dirtyFields, name)
|
|
277
|
+
},
|
|
278
|
+
isTouched: {
|
|
279
|
+
enumerable: true,
|
|
280
|
+
get: () => !!get(formState.touchedFields, name)
|
|
281
|
+
},
|
|
282
|
+
isValidating: {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: () => !!get(formState.validatingFields, name)
|
|
285
|
+
},
|
|
286
|
+
error: {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
get: () => get(formState.errors, name)
|
|
289
|
+
}
|
|
290
|
+
}), [formState, name]);
|
|
291
|
+
const onChange = React__default.useCallback((event) => _registerProps.current.onChange({
|
|
292
|
+
target: {
|
|
293
|
+
value: getEventValue(event),
|
|
294
|
+
name
|
|
295
|
+
},
|
|
296
|
+
type: EVENTS.CHANGE
|
|
297
|
+
}), [name]);
|
|
298
|
+
const onBlur = React__default.useCallback(() => _registerProps.current.onBlur({
|
|
299
|
+
target: {
|
|
300
|
+
value: get(control._formValues, name),
|
|
301
|
+
name
|
|
302
|
+
},
|
|
303
|
+
type: EVENTS.BLUR
|
|
304
|
+
}), [name, control._formValues]);
|
|
305
|
+
const ref = React__default.useCallback((elm) => {
|
|
306
|
+
const field2 = get(control._fields, name);
|
|
307
|
+
if (field2 && field2._f && elm) {
|
|
308
|
+
field2._f.ref = {
|
|
309
|
+
focus: () => isFunction(elm.focus) && elm.focus(),
|
|
310
|
+
select: () => isFunction(elm.select) && elm.select(),
|
|
311
|
+
setCustomValidity: (message) => isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
|
|
312
|
+
reportValidity: () => isFunction(elm.reportValidity) && elm.reportValidity()
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}, [control._fields, name]);
|
|
316
|
+
const field = React__default.useMemo(() => ({
|
|
317
|
+
name,
|
|
318
|
+
value,
|
|
319
|
+
...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
|
|
320
|
+
onChange,
|
|
321
|
+
onBlur,
|
|
322
|
+
ref
|
|
323
|
+
}), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
|
|
324
|
+
React__default.useEffect(() => {
|
|
325
|
+
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
326
|
+
const previousName = _previousNameRef.current;
|
|
327
|
+
if (previousName && previousName !== name && !isArrayField) {
|
|
328
|
+
control.unregister(previousName);
|
|
329
|
+
}
|
|
330
|
+
control.register(name, {
|
|
331
|
+
..._props.current.rules,
|
|
332
|
+
...isBoolean(_props.current.disabled) ? { disabled: _props.current.disabled } : {}
|
|
333
|
+
});
|
|
334
|
+
const updateMounted = (name2, value2) => {
|
|
335
|
+
const field2 = get(control._fields, name2);
|
|
336
|
+
if (field2 && field2._f) {
|
|
337
|
+
field2._f.mount = value2;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
updateMounted(name, true);
|
|
341
|
+
if (_shouldUnregisterField) {
|
|
342
|
+
const value2 = cloneObject(get(control._options.defaultValues, name, _props.current.defaultValue));
|
|
343
|
+
set(control._defaultValues, name, value2);
|
|
344
|
+
if (isUndefined(get(control._formValues, name))) {
|
|
345
|
+
set(control._formValues, name, value2);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
!isArrayField && control.register(name);
|
|
349
|
+
_previousNameRef.current = name;
|
|
350
|
+
return () => {
|
|
351
|
+
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
352
|
+
};
|
|
353
|
+
}, [name, control, isArrayField, shouldUnregister]);
|
|
354
|
+
React__default.useEffect(() => {
|
|
355
|
+
control._setDisabledField({
|
|
356
|
+
disabled,
|
|
357
|
+
name
|
|
358
|
+
});
|
|
359
|
+
}, [disabled, name, control]);
|
|
360
|
+
return React__default.useMemo(() => ({
|
|
361
|
+
field,
|
|
362
|
+
formState,
|
|
363
|
+
fieldState
|
|
364
|
+
}), [field, formState, fieldState]);
|
|
365
|
+
}
|
|
366
|
+
const Controller = (props) => props.render(useController(props));
|
|
367
|
+
const HookFormContext = React__default.createContext(null);
|
|
368
|
+
HookFormContext.displayName = "HookFormContext";
|
|
369
|
+
const useFormContext = () => React__default.useContext(HookFormContext);
|
|
370
|
+
const FormProvider = (props) => {
|
|
371
|
+
const { children, watch, getValues, getFieldState, setError, clearErrors, setValue, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe } = props;
|
|
372
|
+
return React__default.createElement(
|
|
373
|
+
HookFormContext.Provider,
|
|
374
|
+
{ value: React__default.useMemo(() => ({
|
|
375
|
+
watch,
|
|
376
|
+
getValues,
|
|
377
|
+
getFieldState,
|
|
378
|
+
setError,
|
|
379
|
+
clearErrors,
|
|
380
|
+
setValue,
|
|
381
|
+
trigger,
|
|
382
|
+
formState,
|
|
383
|
+
resetField,
|
|
384
|
+
reset,
|
|
385
|
+
handleSubmit,
|
|
386
|
+
unregister,
|
|
387
|
+
control,
|
|
388
|
+
register,
|
|
389
|
+
setFocus,
|
|
390
|
+
subscribe
|
|
391
|
+
}), [
|
|
392
|
+
clearErrors,
|
|
393
|
+
control,
|
|
394
|
+
formState,
|
|
395
|
+
getFieldState,
|
|
396
|
+
getValues,
|
|
397
|
+
handleSubmit,
|
|
398
|
+
register,
|
|
399
|
+
reset,
|
|
400
|
+
resetField,
|
|
401
|
+
setError,
|
|
402
|
+
setFocus,
|
|
403
|
+
setValue,
|
|
404
|
+
subscribe,
|
|
405
|
+
trigger,
|
|
406
|
+
unregister,
|
|
407
|
+
watch
|
|
408
|
+
]) },
|
|
409
|
+
React__default.createElement(HookFormControlContext.Provider, { value: control }, children)
|
|
410
|
+
);
|
|
411
|
+
};
|
|
412
|
+
var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria ? {
|
|
413
|
+
...errors[name],
|
|
414
|
+
types: {
|
|
415
|
+
...errors[name] && errors[name].types ? errors[name].types : {},
|
|
416
|
+
[type]: message || true
|
|
417
|
+
}
|
|
418
|
+
} : {};
|
|
419
|
+
var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
|
|
420
|
+
var createSubject = () => {
|
|
421
|
+
let _observers = [];
|
|
422
|
+
const next = (value) => {
|
|
423
|
+
for (const observer of _observers) {
|
|
424
|
+
observer.next && observer.next(value);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
const subscribe = (observer) => {
|
|
428
|
+
_observers.push(observer);
|
|
429
|
+
return {
|
|
430
|
+
unsubscribe: () => {
|
|
431
|
+
_observers = _observers.filter((o) => o !== observer);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
const unsubscribe = () => {
|
|
436
|
+
_observers = [];
|
|
437
|
+
};
|
|
438
|
+
return {
|
|
439
|
+
get observers() {
|
|
440
|
+
return _observers;
|
|
441
|
+
},
|
|
442
|
+
next,
|
|
443
|
+
subscribe,
|
|
444
|
+
unsubscribe
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
function extractFormValues(fieldsState, formValues) {
|
|
448
|
+
const values = {};
|
|
449
|
+
for (const key in fieldsState) {
|
|
450
|
+
if (fieldsState.hasOwnProperty(key)) {
|
|
451
|
+
const fieldState = fieldsState[key];
|
|
452
|
+
const fieldValue = formValues[key];
|
|
453
|
+
if (fieldState && isObject(fieldState) && fieldValue) {
|
|
454
|
+
const nestedFieldsState = extractFormValues(fieldState, fieldValue);
|
|
455
|
+
if (isObject(nestedFieldsState)) {
|
|
456
|
+
values[key] = nestedFieldsState;
|
|
457
|
+
}
|
|
458
|
+
} else if (fieldsState[key]) {
|
|
459
|
+
values[key] = fieldValue;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return values;
|
|
464
|
+
}
|
|
465
|
+
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
466
|
+
var isFileInput = (element) => element.type === "file";
|
|
467
|
+
var isHTMLElement = (value) => {
|
|
468
|
+
if (!isWeb) {
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
const owner = value ? value.ownerDocument : 0;
|
|
472
|
+
return value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement);
|
|
473
|
+
};
|
|
474
|
+
var isMultipleSelect = (element) => element.type === `select-multiple`;
|
|
475
|
+
var isRadioInput = (element) => element.type === "radio";
|
|
476
|
+
var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
|
|
477
|
+
var live = (ref) => isHTMLElement(ref) && ref.isConnected;
|
|
478
|
+
function baseGet(object, updatePath) {
|
|
479
|
+
const length = updatePath.slice(0, -1).length;
|
|
480
|
+
let index = 0;
|
|
481
|
+
while (index < length) {
|
|
482
|
+
object = isUndefined(object) ? index++ : object[updatePath[index++]];
|
|
483
|
+
}
|
|
484
|
+
return object;
|
|
485
|
+
}
|
|
486
|
+
function isEmptyArray(obj) {
|
|
487
|
+
for (const key in obj) {
|
|
488
|
+
if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
function unset(object, path) {
|
|
495
|
+
const paths = Array.isArray(path) ? path : isKey(path) ? [path] : stringToPath(path);
|
|
496
|
+
const childObject = paths.length === 1 ? object : baseGet(object, paths);
|
|
497
|
+
const index = paths.length - 1;
|
|
498
|
+
const key = paths[index];
|
|
499
|
+
if (childObject) {
|
|
500
|
+
delete childObject[key];
|
|
501
|
+
}
|
|
502
|
+
if (index !== 0 && (isObject(childObject) && isEmptyObject(childObject) || Array.isArray(childObject) && isEmptyArray(childObject))) {
|
|
503
|
+
unset(object, paths.slice(0, -1));
|
|
504
|
+
}
|
|
505
|
+
return object;
|
|
506
|
+
}
|
|
507
|
+
var objectHasFunction = (data) => {
|
|
508
|
+
for (const key in data) {
|
|
509
|
+
if (isFunction(data[key])) {
|
|
510
|
+
return true;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return false;
|
|
514
|
+
};
|
|
515
|
+
function isTraversable(value) {
|
|
516
|
+
return Array.isArray(value) || isObject(value) && !objectHasFunction(value);
|
|
517
|
+
}
|
|
518
|
+
function markFieldsDirty(data, fields = {}) {
|
|
519
|
+
for (const key in data) {
|
|
520
|
+
const value = data[key];
|
|
521
|
+
if (isTraversable(value)) {
|
|
522
|
+
fields[key] = Array.isArray(value) ? [] : {};
|
|
523
|
+
markFieldsDirty(value, fields[key]);
|
|
524
|
+
} else if (!isUndefined(value)) {
|
|
525
|
+
fields[key] = true;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return fields;
|
|
529
|
+
}
|
|
530
|
+
function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
|
|
531
|
+
if (!dirtyFieldsFromValues) {
|
|
532
|
+
dirtyFieldsFromValues = markFieldsDirty(formValues);
|
|
533
|
+
}
|
|
534
|
+
for (const key in data) {
|
|
535
|
+
const value = data[key];
|
|
536
|
+
if (isTraversable(value)) {
|
|
537
|
+
if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
|
|
538
|
+
dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
|
|
539
|
+
} else {
|
|
540
|
+
getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
|
|
541
|
+
}
|
|
542
|
+
} else {
|
|
543
|
+
const formValue = formValues[key];
|
|
544
|
+
dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return dirtyFieldsFromValues;
|
|
548
|
+
}
|
|
549
|
+
const defaultResult = {
|
|
550
|
+
value: false,
|
|
551
|
+
isValid: false
|
|
552
|
+
};
|
|
553
|
+
const validResult = { value: true, isValid: true };
|
|
554
|
+
var getCheckboxValue = (options) => {
|
|
555
|
+
if (Array.isArray(options)) {
|
|
556
|
+
if (options.length > 1) {
|
|
557
|
+
const values = options.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
|
|
558
|
+
return { value: values, isValid: !!values.length };
|
|
559
|
+
}
|
|
560
|
+
return options[0].checked && !options[0].disabled ? (
|
|
561
|
+
// @ts-expect-error expected to work in the browser
|
|
562
|
+
options[0].attributes && !isUndefined(options[0].attributes.value) ? isUndefined(options[0].value) || options[0].value === "" ? validResult : { value: options[0].value, isValid: true } : validResult
|
|
563
|
+
) : defaultResult;
|
|
564
|
+
}
|
|
565
|
+
return defaultResult;
|
|
566
|
+
};
|
|
567
|
+
var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value) ? value : valueAsNumber ? value === "" ? NaN : value ? +value : value : valueAsDate && isString(value) ? new Date(value) : setValueAs ? setValueAs(value) : value;
|
|
568
|
+
const defaultReturn = {
|
|
569
|
+
isValid: false,
|
|
570
|
+
value: null
|
|
571
|
+
};
|
|
572
|
+
var getRadioValue = (options) => Array.isArray(options) ? options.reduce((previous, option) => option && option.checked && !option.disabled ? {
|
|
573
|
+
isValid: true,
|
|
574
|
+
value: option.value
|
|
575
|
+
} : previous, defaultReturn) : defaultReturn;
|
|
576
|
+
function getFieldValue(_f) {
|
|
577
|
+
const ref = _f.ref;
|
|
578
|
+
if (isFileInput(ref)) {
|
|
579
|
+
return ref.files;
|
|
580
|
+
}
|
|
581
|
+
if (isRadioInput(ref)) {
|
|
582
|
+
return getRadioValue(_f.refs).value;
|
|
583
|
+
}
|
|
584
|
+
if (isMultipleSelect(ref)) {
|
|
585
|
+
return [...ref.selectedOptions].map(({ value }) => value);
|
|
586
|
+
}
|
|
587
|
+
if (isCheckBoxInput(ref)) {
|
|
588
|
+
return getCheckboxValue(_f.refs).value;
|
|
589
|
+
}
|
|
590
|
+
return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
|
|
591
|
+
}
|
|
592
|
+
var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
|
|
593
|
+
const fields = {};
|
|
594
|
+
for (const name of fieldsNames) {
|
|
595
|
+
const field = get(_fields, name);
|
|
596
|
+
field && set(fields, name, field._f);
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
criteriaMode,
|
|
600
|
+
names: [...fieldsNames],
|
|
601
|
+
fields,
|
|
602
|
+
shouldUseNativeValidation
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
var isRegex = (value) => value instanceof RegExp;
|
|
606
|
+
var getRuleValue = (rule) => isUndefined(rule) ? rule : isRegex(rule) ? rule.source : isObject(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule;
|
|
607
|
+
var getValidationModes = (mode) => ({
|
|
608
|
+
isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
|
|
609
|
+
isOnBlur: mode === VALIDATION_MODE.onBlur,
|
|
610
|
+
isOnChange: mode === VALIDATION_MODE.onChange,
|
|
611
|
+
isOnAll: mode === VALIDATION_MODE.all,
|
|
612
|
+
isOnTouch: mode === VALIDATION_MODE.onTouched
|
|
613
|
+
});
|
|
614
|
+
const ASYNC_FUNCTION = "AsyncFunction";
|
|
615
|
+
var hasPromiseValidation = (fieldReference) => !!fieldReference && !!fieldReference.validate && !!(isFunction(fieldReference.validate) && fieldReference.validate.constructor.name === ASYNC_FUNCTION || isObject(fieldReference.validate) && Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION));
|
|
616
|
+
var hasValidation = (options) => options.mount && (options.required || options.min || options.max || options.maxLength || options.minLength || options.pattern || options.validate);
|
|
617
|
+
var isWatched = (name, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name) || [..._names.watch].some((watchName) => name.startsWith(watchName) && /^\.\w+/.test(name.slice(watchName.length))));
|
|
618
|
+
const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
|
|
619
|
+
for (const key of fieldsNames || Object.keys(fields)) {
|
|
620
|
+
const field = get(fields, key);
|
|
621
|
+
if (field) {
|
|
622
|
+
const { _f, ...currentField } = field;
|
|
623
|
+
if (_f) {
|
|
624
|
+
if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {
|
|
625
|
+
return true;
|
|
626
|
+
} else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {
|
|
627
|
+
return true;
|
|
628
|
+
} else {
|
|
629
|
+
if (iterateFieldsByAction(currentField, action)) {
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
} else if (isObject(currentField)) {
|
|
634
|
+
if (iterateFieldsByAction(currentField, action)) {
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return;
|
|
641
|
+
};
|
|
642
|
+
function schemaErrorLookup(errors, _fields, name) {
|
|
643
|
+
const error = get(errors, name);
|
|
644
|
+
if (error || isKey(name)) {
|
|
645
|
+
return {
|
|
646
|
+
error,
|
|
647
|
+
name
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
const names = name.split(".");
|
|
651
|
+
while (names.length) {
|
|
652
|
+
const fieldName = names.join(".");
|
|
653
|
+
const field = get(_fields, fieldName);
|
|
654
|
+
const foundError = get(errors, fieldName);
|
|
655
|
+
if (field && !Array.isArray(field) && name !== fieldName) {
|
|
656
|
+
return { name };
|
|
657
|
+
}
|
|
658
|
+
if (foundError && foundError.type) {
|
|
659
|
+
return {
|
|
660
|
+
name: fieldName,
|
|
661
|
+
error: foundError
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
if (foundError && foundError.root && foundError.root.type) {
|
|
665
|
+
return {
|
|
666
|
+
name: `${fieldName}.root`,
|
|
667
|
+
error: foundError.root
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
names.pop();
|
|
671
|
+
}
|
|
672
|
+
return {
|
|
673
|
+
name
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
|
|
677
|
+
updateFormState(formStateData);
|
|
678
|
+
const { name, ...formState } = formStateData;
|
|
679
|
+
return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
|
|
680
|
+
};
|
|
681
|
+
var shouldSubscribeByName = (name, signalName, exact) => !name || !signalName || name === signalName || convertToArrayPayload(name).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName)));
|
|
682
|
+
var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
|
|
683
|
+
if (mode.isOnAll) {
|
|
684
|
+
return false;
|
|
685
|
+
} else if (!isSubmitted && mode.isOnTouch) {
|
|
686
|
+
return !(isTouched || isBlurEvent);
|
|
687
|
+
} else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
|
|
688
|
+
return !isBlurEvent;
|
|
689
|
+
} else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
|
|
690
|
+
return isBlurEvent;
|
|
691
|
+
}
|
|
692
|
+
return true;
|
|
693
|
+
};
|
|
694
|
+
var unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);
|
|
695
|
+
var updateFieldArrayRootError = (errors, error, name) => {
|
|
696
|
+
const fieldArrayErrors = convertToArrayPayload(get(errors, name));
|
|
697
|
+
set(fieldArrayErrors, "root", error[name]);
|
|
698
|
+
set(errors, name, fieldArrayErrors);
|
|
699
|
+
return errors;
|
|
700
|
+
};
|
|
701
|
+
function getValidateError(result, ref, type = "validate") {
|
|
702
|
+
if (isString(result) || Array.isArray(result) && result.every(isString) || isBoolean(result) && !result) {
|
|
703
|
+
return {
|
|
704
|
+
type,
|
|
705
|
+
message: isString(result) ? result : "",
|
|
706
|
+
ref
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData) ? validationData : {
|
|
711
|
+
value: validationData,
|
|
712
|
+
message: ""
|
|
713
|
+
};
|
|
714
|
+
var validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
|
|
715
|
+
const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount } = field._f;
|
|
716
|
+
const inputValue = get(formValues, name);
|
|
717
|
+
if (!mount || disabledFieldNames.has(name)) {
|
|
718
|
+
return {};
|
|
719
|
+
}
|
|
720
|
+
const inputRef = refs ? refs[0] : ref;
|
|
721
|
+
const setCustomValidity = (message) => {
|
|
722
|
+
if (shouldUseNativeValidation && inputRef.reportValidity) {
|
|
723
|
+
inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
|
|
724
|
+
inputRef.reportValidity();
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
const error = {};
|
|
728
|
+
const isRadio = isRadioInput(ref);
|
|
729
|
+
const isCheckBox = isCheckBoxInput(ref);
|
|
730
|
+
const isRadioOrCheckbox2 = isRadio || isCheckBox;
|
|
731
|
+
const isEmpty = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
|
|
732
|
+
const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
|
|
733
|
+
const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
|
|
734
|
+
const message = exceedMax ? maxLengthMessage : minLengthMessage;
|
|
735
|
+
error[name] = {
|
|
736
|
+
type: exceedMax ? maxType : minType,
|
|
737
|
+
message,
|
|
738
|
+
ref,
|
|
739
|
+
...appendErrorsCurry(exceedMax ? maxType : minType, message)
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
|
|
743
|
+
const { value, message } = isString(required) ? { value: !!required, message: required } : getValueAndMessage(required);
|
|
744
|
+
if (value) {
|
|
745
|
+
error[name] = {
|
|
746
|
+
type: INPUT_VALIDATION_RULES.required,
|
|
747
|
+
message,
|
|
748
|
+
ref: inputRef,
|
|
749
|
+
...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message)
|
|
750
|
+
};
|
|
751
|
+
if (!validateAllFieldCriteria) {
|
|
752
|
+
setCustomValidity(message);
|
|
753
|
+
return error;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {
|
|
758
|
+
let exceedMax;
|
|
759
|
+
let exceedMin;
|
|
760
|
+
const maxOutput = getValueAndMessage(max);
|
|
761
|
+
const minOutput = getValueAndMessage(min);
|
|
762
|
+
if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
|
|
763
|
+
const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
|
|
764
|
+
if (!isNullOrUndefined(maxOutput.value)) {
|
|
765
|
+
exceedMax = valueNumber > maxOutput.value;
|
|
766
|
+
}
|
|
767
|
+
if (!isNullOrUndefined(minOutput.value)) {
|
|
768
|
+
exceedMin = valueNumber < minOutput.value;
|
|
769
|
+
}
|
|
770
|
+
} else {
|
|
771
|
+
const valueDate = ref.valueAsDate || new Date(inputValue);
|
|
772
|
+
const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
|
|
773
|
+
const isTime = ref.type == "time";
|
|
774
|
+
const isWeek = ref.type == "week";
|
|
775
|
+
if (isString(maxOutput.value) && inputValue) {
|
|
776
|
+
exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
|
|
777
|
+
}
|
|
778
|
+
if (isString(minOutput.value) && inputValue) {
|
|
779
|
+
exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
if (exceedMax || exceedMin) {
|
|
783
|
+
getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
|
|
784
|
+
if (!validateAllFieldCriteria) {
|
|
785
|
+
setCustomValidity(error[name].message);
|
|
786
|
+
return error;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if ((maxLength || minLength) && !isEmpty && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
|
|
791
|
+
const maxLengthOutput = getValueAndMessage(maxLength);
|
|
792
|
+
const minLengthOutput = getValueAndMessage(minLength);
|
|
793
|
+
const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
|
|
794
|
+
const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
|
|
795
|
+
if (exceedMax || exceedMin) {
|
|
796
|
+
getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
|
|
797
|
+
if (!validateAllFieldCriteria) {
|
|
798
|
+
setCustomValidity(error[name].message);
|
|
799
|
+
return error;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (pattern && !isEmpty && isString(inputValue)) {
|
|
804
|
+
const { value: patternValue, message } = getValueAndMessage(pattern);
|
|
805
|
+
if (isRegex(patternValue) && !inputValue.match(patternValue)) {
|
|
806
|
+
error[name] = {
|
|
807
|
+
type: INPUT_VALIDATION_RULES.pattern,
|
|
808
|
+
message,
|
|
809
|
+
ref,
|
|
810
|
+
...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message)
|
|
811
|
+
};
|
|
812
|
+
if (!validateAllFieldCriteria) {
|
|
813
|
+
setCustomValidity(message);
|
|
814
|
+
return error;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
if (validate) {
|
|
819
|
+
if (isFunction(validate)) {
|
|
820
|
+
const result = await validate(inputValue, formValues);
|
|
821
|
+
const validateError = getValidateError(result, inputRef);
|
|
822
|
+
if (validateError) {
|
|
823
|
+
error[name] = {
|
|
824
|
+
...validateError,
|
|
825
|
+
...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message)
|
|
826
|
+
};
|
|
827
|
+
if (!validateAllFieldCriteria) {
|
|
828
|
+
setCustomValidity(validateError.message);
|
|
829
|
+
return error;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
} else if (isObject(validate)) {
|
|
833
|
+
let validationResult = {};
|
|
834
|
+
for (const key in validate) {
|
|
835
|
+
if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
|
|
836
|
+
break;
|
|
837
|
+
}
|
|
838
|
+
const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);
|
|
839
|
+
if (validateError) {
|
|
840
|
+
validationResult = {
|
|
841
|
+
...validateError,
|
|
842
|
+
...appendErrorsCurry(key, validateError.message)
|
|
843
|
+
};
|
|
844
|
+
setCustomValidity(validateError.message);
|
|
845
|
+
if (validateAllFieldCriteria) {
|
|
846
|
+
error[name] = validationResult;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (!isEmptyObject(validationResult)) {
|
|
851
|
+
error[name] = {
|
|
852
|
+
ref: inputRef,
|
|
853
|
+
...validationResult
|
|
854
|
+
};
|
|
855
|
+
if (!validateAllFieldCriteria) {
|
|
856
|
+
return error;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
setCustomValidity(true);
|
|
862
|
+
return error;
|
|
863
|
+
};
|
|
864
|
+
const defaultOptions = {
|
|
865
|
+
mode: VALIDATION_MODE.onSubmit,
|
|
866
|
+
reValidateMode: VALIDATION_MODE.onChange,
|
|
867
|
+
shouldFocusError: true
|
|
868
|
+
};
|
|
869
|
+
function createFormControl(props = {}) {
|
|
870
|
+
let _options = {
|
|
871
|
+
...defaultOptions,
|
|
872
|
+
...props
|
|
873
|
+
};
|
|
874
|
+
let _formState = {
|
|
875
|
+
submitCount: 0,
|
|
876
|
+
isDirty: false,
|
|
877
|
+
isReady: false,
|
|
878
|
+
isLoading: isFunction(_options.defaultValues),
|
|
879
|
+
isValidating: false,
|
|
880
|
+
isSubmitted: false,
|
|
881
|
+
isSubmitting: false,
|
|
882
|
+
isSubmitSuccessful: false,
|
|
883
|
+
isValid: false,
|
|
884
|
+
touchedFields: {},
|
|
885
|
+
dirtyFields: {},
|
|
886
|
+
validatingFields: {},
|
|
887
|
+
errors: _options.errors || {},
|
|
888
|
+
disabled: _options.disabled || false
|
|
889
|
+
};
|
|
890
|
+
let _fields = {};
|
|
891
|
+
let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {};
|
|
892
|
+
let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues);
|
|
893
|
+
let _state = {
|
|
894
|
+
action: false,
|
|
895
|
+
mount: false,
|
|
896
|
+
watch: false,
|
|
897
|
+
keepIsValid: false
|
|
898
|
+
};
|
|
899
|
+
let _names = {
|
|
900
|
+
mount: /* @__PURE__ */ new Set(),
|
|
901
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
902
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
903
|
+
array: /* @__PURE__ */ new Set(),
|
|
904
|
+
watch: /* @__PURE__ */ new Set()
|
|
905
|
+
};
|
|
906
|
+
let delayErrorCallback;
|
|
907
|
+
let timer = 0;
|
|
908
|
+
const defaultProxyFormState = {
|
|
909
|
+
isDirty: false,
|
|
910
|
+
dirtyFields: false,
|
|
911
|
+
validatingFields: false,
|
|
912
|
+
touchedFields: false,
|
|
913
|
+
isValidating: false,
|
|
914
|
+
isValid: false,
|
|
915
|
+
errors: false
|
|
916
|
+
};
|
|
917
|
+
const _proxyFormState = {
|
|
918
|
+
...defaultProxyFormState
|
|
919
|
+
};
|
|
920
|
+
let _proxySubscribeFormState = {
|
|
921
|
+
..._proxyFormState
|
|
922
|
+
};
|
|
923
|
+
const _subjects = {
|
|
924
|
+
array: createSubject(),
|
|
925
|
+
state: createSubject()
|
|
926
|
+
};
|
|
927
|
+
const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
|
|
928
|
+
const debounce = (callback) => (wait) => {
|
|
929
|
+
clearTimeout(timer);
|
|
930
|
+
timer = setTimeout(callback, wait);
|
|
931
|
+
};
|
|
932
|
+
const _setValid = async (shouldUpdateValid) => {
|
|
933
|
+
if (_state.keepIsValid) {
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
|
|
937
|
+
let isValid;
|
|
938
|
+
if (_options.resolver) {
|
|
939
|
+
isValid = isEmptyObject((await _runSchema()).errors);
|
|
940
|
+
_updateIsValidating();
|
|
941
|
+
} else {
|
|
942
|
+
isValid = await executeBuiltInValidation(_fields, true);
|
|
943
|
+
}
|
|
944
|
+
if (isValid !== _formState.isValid) {
|
|
945
|
+
_subjects.state.next({
|
|
946
|
+
isValid
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
const _updateIsValidating = (names, isValidating) => {
|
|
952
|
+
if (!_options.disabled && (_proxyFormState.isValidating || _proxyFormState.validatingFields || _proxySubscribeFormState.isValidating || _proxySubscribeFormState.validatingFields)) {
|
|
953
|
+
(names || Array.from(_names.mount)).forEach((name) => {
|
|
954
|
+
if (name) {
|
|
955
|
+
isValidating ? set(_formState.validatingFields, name, isValidating) : unset(_formState.validatingFields, name);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
_subjects.state.next({
|
|
959
|
+
validatingFields: _formState.validatingFields,
|
|
960
|
+
isValidating: !isEmptyObject(_formState.validatingFields)
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
const _setFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
|
|
965
|
+
if (args && method && !_options.disabled) {
|
|
966
|
+
_state.action = true;
|
|
967
|
+
if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
|
|
968
|
+
const fieldValues = method(get(_fields, name), args.argA, args.argB);
|
|
969
|
+
shouldSetValues && set(_fields, name, fieldValues);
|
|
970
|
+
}
|
|
971
|
+
if (shouldUpdateFieldsAndState && Array.isArray(get(_formState.errors, name))) {
|
|
972
|
+
const errors = method(get(_formState.errors, name), args.argA, args.argB);
|
|
973
|
+
shouldSetValues && set(_formState.errors, name, errors);
|
|
974
|
+
unsetEmptyArray(_formState.errors, name);
|
|
975
|
+
}
|
|
976
|
+
if ((_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && shouldUpdateFieldsAndState && Array.isArray(get(_formState.touchedFields, name))) {
|
|
977
|
+
const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);
|
|
978
|
+
shouldSetValues && set(_formState.touchedFields, name, touchedFields);
|
|
979
|
+
}
|
|
980
|
+
if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {
|
|
981
|
+
_formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
|
|
982
|
+
}
|
|
983
|
+
_subjects.state.next({
|
|
984
|
+
name,
|
|
985
|
+
isDirty: _getDirty(name, values),
|
|
986
|
+
dirtyFields: _formState.dirtyFields,
|
|
987
|
+
errors: _formState.errors,
|
|
988
|
+
isValid: _formState.isValid
|
|
989
|
+
});
|
|
990
|
+
} else {
|
|
991
|
+
set(_formValues, name, values);
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
const updateErrors = (name, error) => {
|
|
995
|
+
set(_formState.errors, name, error);
|
|
996
|
+
_subjects.state.next({
|
|
997
|
+
errors: _formState.errors
|
|
998
|
+
});
|
|
999
|
+
};
|
|
1000
|
+
const _setErrors = (errors) => {
|
|
1001
|
+
_formState.errors = errors;
|
|
1002
|
+
_subjects.state.next({
|
|
1003
|
+
errors: _formState.errors,
|
|
1004
|
+
isValid: false
|
|
1005
|
+
});
|
|
1006
|
+
};
|
|
1007
|
+
const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {
|
|
1008
|
+
const field = get(_fields, name);
|
|
1009
|
+
if (field) {
|
|
1010
|
+
const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
|
|
1011
|
+
isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
|
|
1012
|
+
_state.mount && !_state.action && _setValid();
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
|
|
1016
|
+
let shouldUpdateField = false;
|
|
1017
|
+
let isPreviousDirty = false;
|
|
1018
|
+
const output = {
|
|
1019
|
+
name
|
|
1020
|
+
};
|
|
1021
|
+
if (!_options.disabled) {
|
|
1022
|
+
if (!isBlurEvent || shouldDirty) {
|
|
1023
|
+
if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {
|
|
1024
|
+
isPreviousDirty = _formState.isDirty;
|
|
1025
|
+
_formState.isDirty = output.isDirty = _getDirty();
|
|
1026
|
+
shouldUpdateField = isPreviousDirty !== output.isDirty;
|
|
1027
|
+
}
|
|
1028
|
+
const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);
|
|
1029
|
+
isPreviousDirty = !!get(_formState.dirtyFields, name);
|
|
1030
|
+
isCurrentFieldPristine ? unset(_formState.dirtyFields, name) : set(_formState.dirtyFields, name, true);
|
|
1031
|
+
output.dirtyFields = _formState.dirtyFields;
|
|
1032
|
+
shouldUpdateField = shouldUpdateField || (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) && isPreviousDirty !== !isCurrentFieldPristine;
|
|
1033
|
+
}
|
|
1034
|
+
if (isBlurEvent) {
|
|
1035
|
+
const isPreviousFieldTouched = get(_formState.touchedFields, name);
|
|
1036
|
+
if (!isPreviousFieldTouched) {
|
|
1037
|
+
set(_formState.touchedFields, name, isBlurEvent);
|
|
1038
|
+
output.touchedFields = _formState.touchedFields;
|
|
1039
|
+
shouldUpdateField = shouldUpdateField || (_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && isPreviousFieldTouched !== isBlurEvent;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
shouldUpdateField && shouldRender && _subjects.state.next(output);
|
|
1043
|
+
}
|
|
1044
|
+
return shouldUpdateField ? output : {};
|
|
1045
|
+
};
|
|
1046
|
+
const shouldRenderByError = (name, isValid, error, fieldState) => {
|
|
1047
|
+
const previousFieldError = get(_formState.errors, name);
|
|
1048
|
+
const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid) && _formState.isValid !== isValid;
|
|
1049
|
+
if (_options.delayError && error) {
|
|
1050
|
+
delayErrorCallback = debounce(() => updateErrors(name, error));
|
|
1051
|
+
delayErrorCallback(_options.delayError);
|
|
1052
|
+
} else {
|
|
1053
|
+
clearTimeout(timer);
|
|
1054
|
+
delayErrorCallback = null;
|
|
1055
|
+
error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
|
|
1056
|
+
}
|
|
1057
|
+
if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) || !isEmptyObject(fieldState) || shouldUpdateValid) {
|
|
1058
|
+
const updatedFormState = {
|
|
1059
|
+
...fieldState,
|
|
1060
|
+
...shouldUpdateValid && isBoolean(isValid) ? { isValid } : {},
|
|
1061
|
+
errors: _formState.errors,
|
|
1062
|
+
name
|
|
1063
|
+
};
|
|
1064
|
+
_formState = {
|
|
1065
|
+
..._formState,
|
|
1066
|
+
...updatedFormState
|
|
1067
|
+
};
|
|
1068
|
+
_subjects.state.next(updatedFormState);
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
const _runSchema = async (name) => {
|
|
1072
|
+
_updateIsValidating(name, true);
|
|
1073
|
+
const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
|
|
1074
|
+
return result;
|
|
1075
|
+
};
|
|
1076
|
+
const executeSchemaAndUpdateState = async (names) => {
|
|
1077
|
+
const { errors } = await _runSchema(names);
|
|
1078
|
+
_updateIsValidating(names);
|
|
1079
|
+
if (names) {
|
|
1080
|
+
for (const name of names) {
|
|
1081
|
+
const error = get(errors, name);
|
|
1082
|
+
error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
|
|
1083
|
+
}
|
|
1084
|
+
} else {
|
|
1085
|
+
_formState.errors = errors;
|
|
1086
|
+
}
|
|
1087
|
+
return errors;
|
|
1088
|
+
};
|
|
1089
|
+
const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {
|
|
1090
|
+
valid: true
|
|
1091
|
+
}) => {
|
|
1092
|
+
for (const name in fields) {
|
|
1093
|
+
const field = fields[name];
|
|
1094
|
+
if (field) {
|
|
1095
|
+
const { _f, ...fieldValue } = field;
|
|
1096
|
+
if (_f) {
|
|
1097
|
+
const isFieldArrayRoot = _names.array.has(_f.name);
|
|
1098
|
+
const isPromiseFunction = field._f && hasPromiseValidation(field._f);
|
|
1099
|
+
if (isPromiseFunction && _proxyFormState.validatingFields) {
|
|
1100
|
+
_updateIsValidating([_f.name], true);
|
|
1101
|
+
}
|
|
1102
|
+
const fieldError = await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);
|
|
1103
|
+
if (isPromiseFunction && _proxyFormState.validatingFields) {
|
|
1104
|
+
_updateIsValidating([_f.name]);
|
|
1105
|
+
}
|
|
1106
|
+
if (fieldError[_f.name]) {
|
|
1107
|
+
context.valid = false;
|
|
1108
|
+
if (shouldOnlyCheckValid || props.shouldUseNativeValidation) {
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
!shouldOnlyCheckValid && (get(fieldError, _f.name) ? isFieldArrayRoot ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name) : set(_formState.errors, _f.name, fieldError[_f.name]) : unset(_formState.errors, _f.name));
|
|
1113
|
+
}
|
|
1114
|
+
!isEmptyObject(fieldValue) && await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
return context.valid;
|
|
1118
|
+
};
|
|
1119
|
+
const _removeUnmounted = () => {
|
|
1120
|
+
for (const name of _names.unMount) {
|
|
1121
|
+
const field = get(_fields, name);
|
|
1122
|
+
field && (field._f.refs ? field._f.refs.every((ref) => !live(ref)) : !live(field._f.ref)) && unregister(name);
|
|
1123
|
+
}
|
|
1124
|
+
_names.unMount = /* @__PURE__ */ new Set();
|
|
1125
|
+
};
|
|
1126
|
+
const _getDirty = (name, data) => !_options.disabled && (name && data && set(_formValues, name, data), !deepEqual(getValues(), _defaultValues));
|
|
1127
|
+
const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
|
|
1128
|
+
..._state.mount ? _formValues : isUndefined(defaultValue) ? _defaultValues : isString(names) ? { [names]: defaultValue } : defaultValue
|
|
1129
|
+
}, isGlobal, defaultValue);
|
|
1130
|
+
const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : []));
|
|
1131
|
+
const setFieldValue = (name, value, options = {}) => {
|
|
1132
|
+
const field = get(_fields, name);
|
|
1133
|
+
let fieldValue = value;
|
|
1134
|
+
if (field) {
|
|
1135
|
+
const fieldReference = field._f;
|
|
1136
|
+
if (fieldReference) {
|
|
1137
|
+
!fieldReference.disabled && set(_formValues, name, getFieldValueAs(value, fieldReference));
|
|
1138
|
+
fieldValue = isHTMLElement(fieldReference.ref) && isNullOrUndefined(value) ? "" : value;
|
|
1139
|
+
if (isMultipleSelect(fieldReference.ref)) {
|
|
1140
|
+
[...fieldReference.ref.options].forEach((optionRef) => optionRef.selected = fieldValue.includes(optionRef.value));
|
|
1141
|
+
} else if (fieldReference.refs) {
|
|
1142
|
+
if (isCheckBoxInput(fieldReference.ref)) {
|
|
1143
|
+
fieldReference.refs.forEach((checkboxRef) => {
|
|
1144
|
+
if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
|
|
1145
|
+
if (Array.isArray(fieldValue)) {
|
|
1146
|
+
checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
|
|
1147
|
+
} else {
|
|
1148
|
+
checkboxRef.checked = fieldValue === checkboxRef.value || !!fieldValue;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
} else {
|
|
1153
|
+
fieldReference.refs.forEach((radioRef) => radioRef.checked = radioRef.value === fieldValue);
|
|
1154
|
+
}
|
|
1155
|
+
} else if (isFileInput(fieldReference.ref)) {
|
|
1156
|
+
fieldReference.ref.value = "";
|
|
1157
|
+
} else {
|
|
1158
|
+
fieldReference.ref.value = fieldValue;
|
|
1159
|
+
if (!fieldReference.ref.type) {
|
|
1160
|
+
_subjects.state.next({
|
|
1161
|
+
name,
|
|
1162
|
+
values: cloneObject(_formValues)
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
(options.shouldDirty || options.shouldTouch) && updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);
|
|
1169
|
+
options.shouldValidate && trigger(name);
|
|
1170
|
+
};
|
|
1171
|
+
const setValues = (name, value, options) => {
|
|
1172
|
+
for (const fieldKey in value) {
|
|
1173
|
+
if (!value.hasOwnProperty(fieldKey)) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
const fieldValue = value[fieldKey];
|
|
1177
|
+
const fieldName = name + "." + fieldKey;
|
|
1178
|
+
const field = get(_fields, fieldName);
|
|
1179
|
+
(_names.array.has(name) || isObject(fieldValue) || field && !field._f) && !isDateObject(fieldValue) ? setValues(fieldName, fieldValue, options) : setFieldValue(fieldName, fieldValue, options);
|
|
1180
|
+
}
|
|
1181
|
+
};
|
|
1182
|
+
const setValue = (name, value, options = {}) => {
|
|
1183
|
+
const field = get(_fields, name);
|
|
1184
|
+
const isFieldArray = _names.array.has(name);
|
|
1185
|
+
const cloneValue = cloneObject(value);
|
|
1186
|
+
set(_formValues, name, cloneValue);
|
|
1187
|
+
if (isFieldArray) {
|
|
1188
|
+
_subjects.array.next({
|
|
1189
|
+
name,
|
|
1190
|
+
values: cloneObject(_formValues)
|
|
1191
|
+
});
|
|
1192
|
+
if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields || _proxySubscribeFormState.isDirty || _proxySubscribeFormState.dirtyFields) && options.shouldDirty) {
|
|
1193
|
+
_subjects.state.next({
|
|
1194
|
+
name,
|
|
1195
|
+
dirtyFields: getDirtyFields(_defaultValues, _formValues),
|
|
1196
|
+
isDirty: _getDirty(name, cloneValue)
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
} else {
|
|
1200
|
+
field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name, cloneValue, options) : setFieldValue(name, cloneValue, options);
|
|
1201
|
+
}
|
|
1202
|
+
if (isWatched(name, _names)) {
|
|
1203
|
+
_subjects.state.next({
|
|
1204
|
+
..._formState,
|
|
1205
|
+
name,
|
|
1206
|
+
values: cloneObject(_formValues)
|
|
1207
|
+
});
|
|
1208
|
+
} else {
|
|
1209
|
+
_subjects.state.next({
|
|
1210
|
+
name: _state.mount ? name : void 0,
|
|
1211
|
+
values: cloneObject(_formValues)
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
const onChange = async (event) => {
|
|
1216
|
+
_state.mount = true;
|
|
1217
|
+
const target = event.target;
|
|
1218
|
+
let name = target.name;
|
|
1219
|
+
let isFieldValueUpdated = true;
|
|
1220
|
+
const field = get(_fields, name);
|
|
1221
|
+
const _updateIsFieldValueUpdated = (fieldValue) => {
|
|
1222
|
+
isFieldValueUpdated = Number.isNaN(fieldValue) || isDateObject(fieldValue) && isNaN(fieldValue.getTime()) || deepEqual(fieldValue, get(_formValues, name, fieldValue));
|
|
1223
|
+
};
|
|
1224
|
+
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
|
1225
|
+
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
|
1226
|
+
if (field) {
|
|
1227
|
+
let error;
|
|
1228
|
+
let isValid;
|
|
1229
|
+
const fieldValue = target.type ? getFieldValue(field._f) : getEventValue(event);
|
|
1230
|
+
const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
|
|
1231
|
+
const shouldSkipValidation = !hasValidation(field._f) && !_options.resolver && !get(_formState.errors, name) && !field._f.deps || skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
|
|
1232
|
+
const watched = isWatched(name, _names, isBlurEvent);
|
|
1233
|
+
set(_formValues, name, fieldValue);
|
|
1234
|
+
if (isBlurEvent) {
|
|
1235
|
+
if (!target || !target.readOnly) {
|
|
1236
|
+
field._f.onBlur && field._f.onBlur(event);
|
|
1237
|
+
delayErrorCallback && delayErrorCallback(0);
|
|
1238
|
+
}
|
|
1239
|
+
} else if (field._f.onChange) {
|
|
1240
|
+
field._f.onChange(event);
|
|
1241
|
+
}
|
|
1242
|
+
const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);
|
|
1243
|
+
const shouldRender = !isEmptyObject(fieldState) || watched;
|
|
1244
|
+
!isBlurEvent && _subjects.state.next({
|
|
1245
|
+
name,
|
|
1246
|
+
type: event.type,
|
|
1247
|
+
values: cloneObject(_formValues)
|
|
1248
|
+
});
|
|
1249
|
+
if (shouldSkipValidation) {
|
|
1250
|
+
if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
|
|
1251
|
+
if (_options.mode === "onBlur") {
|
|
1252
|
+
if (isBlurEvent) {
|
|
1253
|
+
_setValid();
|
|
1254
|
+
}
|
|
1255
|
+
} else if (!isBlurEvent) {
|
|
1256
|
+
_setValid();
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
return shouldRender && _subjects.state.next({ name, ...watched ? {} : fieldState });
|
|
1260
|
+
}
|
|
1261
|
+
!isBlurEvent && watched && _subjects.state.next({ ..._formState });
|
|
1262
|
+
if (_options.resolver) {
|
|
1263
|
+
const { errors } = await _runSchema([name]);
|
|
1264
|
+
_updateIsValidating([name]);
|
|
1265
|
+
_updateIsFieldValueUpdated(fieldValue);
|
|
1266
|
+
if (isFieldValueUpdated) {
|
|
1267
|
+
const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
|
|
1268
|
+
const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
|
|
1269
|
+
error = errorLookupResult.error;
|
|
1270
|
+
name = errorLookupResult.name;
|
|
1271
|
+
isValid = isEmptyObject(errors);
|
|
1272
|
+
}
|
|
1273
|
+
} else {
|
|
1274
|
+
_updateIsValidating([name], true);
|
|
1275
|
+
error = (await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
|
|
1276
|
+
_updateIsValidating([name]);
|
|
1277
|
+
_updateIsFieldValueUpdated(fieldValue);
|
|
1278
|
+
if (isFieldValueUpdated) {
|
|
1279
|
+
if (error) {
|
|
1280
|
+
isValid = false;
|
|
1281
|
+
} else if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
|
|
1282
|
+
isValid = await executeBuiltInValidation(_fields, true);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
if (isFieldValueUpdated) {
|
|
1287
|
+
field._f.deps && (!Array.isArray(field._f.deps) || field._f.deps.length > 0) && trigger(field._f.deps);
|
|
1288
|
+
shouldRenderByError(name, isValid, error, fieldState);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
const _focusInput = (ref, key) => {
|
|
1293
|
+
if (get(_formState.errors, key) && ref.focus) {
|
|
1294
|
+
ref.focus();
|
|
1295
|
+
return 1;
|
|
1296
|
+
}
|
|
1297
|
+
return;
|
|
1298
|
+
};
|
|
1299
|
+
const trigger = async (name, options = {}) => {
|
|
1300
|
+
let isValid;
|
|
1301
|
+
let validationResult;
|
|
1302
|
+
const fieldNames = convertToArrayPayload(name);
|
|
1303
|
+
if (_options.resolver) {
|
|
1304
|
+
const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);
|
|
1305
|
+
isValid = isEmptyObject(errors);
|
|
1306
|
+
validationResult = name ? !fieldNames.some((name2) => get(errors, name2)) : isValid;
|
|
1307
|
+
} else if (name) {
|
|
1308
|
+
validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {
|
|
1309
|
+
const field = get(_fields, fieldName);
|
|
1310
|
+
return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
|
|
1311
|
+
}))).every(Boolean);
|
|
1312
|
+
!(!validationResult && !_formState.isValid) && _setValid();
|
|
1313
|
+
} else {
|
|
1314
|
+
validationResult = isValid = await executeBuiltInValidation(_fields);
|
|
1315
|
+
}
|
|
1316
|
+
_subjects.state.next({
|
|
1317
|
+
...!isString(name) || (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isValid !== _formState.isValid ? {} : { name },
|
|
1318
|
+
..._options.resolver || !name ? { isValid } : {},
|
|
1319
|
+
errors: _formState.errors
|
|
1320
|
+
});
|
|
1321
|
+
options.shouldFocus && !validationResult && iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);
|
|
1322
|
+
return validationResult;
|
|
1323
|
+
};
|
|
1324
|
+
const getValues = (fieldNames, config) => {
|
|
1325
|
+
let values = {
|
|
1326
|
+
..._state.mount ? _formValues : _defaultValues
|
|
1327
|
+
};
|
|
1328
|
+
if (config) {
|
|
1329
|
+
values = extractFormValues(config.dirtyFields ? _formState.dirtyFields : _formState.touchedFields, values);
|
|
1330
|
+
}
|
|
1331
|
+
return isUndefined(fieldNames) ? values : isString(fieldNames) ? get(values, fieldNames) : fieldNames.map((name) => get(values, name));
|
|
1332
|
+
};
|
|
1333
|
+
const getFieldState = (name, formState) => ({
|
|
1334
|
+
invalid: !!get((formState || _formState).errors, name),
|
|
1335
|
+
isDirty: !!get((formState || _formState).dirtyFields, name),
|
|
1336
|
+
error: get((formState || _formState).errors, name),
|
|
1337
|
+
isValidating: !!get(_formState.validatingFields, name),
|
|
1338
|
+
isTouched: !!get((formState || _formState).touchedFields, name)
|
|
1339
|
+
});
|
|
1340
|
+
const clearErrors = (name) => {
|
|
1341
|
+
name && convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));
|
|
1342
|
+
_subjects.state.next({
|
|
1343
|
+
errors: name ? _formState.errors : {}
|
|
1344
|
+
});
|
|
1345
|
+
};
|
|
1346
|
+
const setError = (name, error, options) => {
|
|
1347
|
+
const ref = (get(_fields, name, { _f: {} })._f || {}).ref;
|
|
1348
|
+
const currentError = get(_formState.errors, name) || {};
|
|
1349
|
+
const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;
|
|
1350
|
+
set(_formState.errors, name, {
|
|
1351
|
+
...restOfErrorTree,
|
|
1352
|
+
...error,
|
|
1353
|
+
ref
|
|
1354
|
+
});
|
|
1355
|
+
_subjects.state.next({
|
|
1356
|
+
name,
|
|
1357
|
+
errors: _formState.errors,
|
|
1358
|
+
isValid: false
|
|
1359
|
+
});
|
|
1360
|
+
options && options.shouldFocus && ref && ref.focus && ref.focus();
|
|
1361
|
+
};
|
|
1362
|
+
const watch = (name, defaultValue) => isFunction(name) ? _subjects.state.subscribe({
|
|
1363
|
+
next: (payload) => "values" in payload && name(_getWatch(void 0, defaultValue), payload)
|
|
1364
|
+
}) : _getWatch(name, defaultValue, true);
|
|
1365
|
+
const _subscribe = (props2) => _subjects.state.subscribe({
|
|
1366
|
+
next: (formState) => {
|
|
1367
|
+
if (shouldSubscribeByName(props2.name, formState.name, props2.exact) && shouldRenderFormState(formState, props2.formState || _proxyFormState, _setFormState, props2.reRenderRoot)) {
|
|
1368
|
+
props2.callback({
|
|
1369
|
+
values: { ..._formValues },
|
|
1370
|
+
..._formState,
|
|
1371
|
+
...formState,
|
|
1372
|
+
defaultValues: _defaultValues
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
}).unsubscribe;
|
|
1377
|
+
const subscribe = (props2) => {
|
|
1378
|
+
_state.mount = true;
|
|
1379
|
+
_proxySubscribeFormState = {
|
|
1380
|
+
..._proxySubscribeFormState,
|
|
1381
|
+
...props2.formState
|
|
1382
|
+
};
|
|
1383
|
+
return _subscribe({
|
|
1384
|
+
...props2,
|
|
1385
|
+
formState: {
|
|
1386
|
+
...defaultProxyFormState,
|
|
1387
|
+
...props2.formState
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
const unregister = (name, options = {}) => {
|
|
1392
|
+
for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {
|
|
1393
|
+
_names.mount.delete(fieldName);
|
|
1394
|
+
_names.array.delete(fieldName);
|
|
1395
|
+
if (!options.keepValue) {
|
|
1396
|
+
unset(_fields, fieldName);
|
|
1397
|
+
unset(_formValues, fieldName);
|
|
1398
|
+
}
|
|
1399
|
+
!options.keepError && unset(_formState.errors, fieldName);
|
|
1400
|
+
!options.keepDirty && unset(_formState.dirtyFields, fieldName);
|
|
1401
|
+
!options.keepTouched && unset(_formState.touchedFields, fieldName);
|
|
1402
|
+
!options.keepIsValidating && unset(_formState.validatingFields, fieldName);
|
|
1403
|
+
!_options.shouldUnregister && !options.keepDefaultValue && unset(_defaultValues, fieldName);
|
|
1404
|
+
}
|
|
1405
|
+
_subjects.state.next({
|
|
1406
|
+
values: cloneObject(_formValues)
|
|
1407
|
+
});
|
|
1408
|
+
_subjects.state.next({
|
|
1409
|
+
..._formState,
|
|
1410
|
+
...!options.keepDirty ? {} : { isDirty: _getDirty() }
|
|
1411
|
+
});
|
|
1412
|
+
!options.keepIsValid && _setValid();
|
|
1413
|
+
};
|
|
1414
|
+
const _setDisabledField = ({ disabled, name }) => {
|
|
1415
|
+
if (isBoolean(disabled) && _state.mount || !!disabled || _names.disabled.has(name)) {
|
|
1416
|
+
const wasDisabled = _names.disabled.has(name);
|
|
1417
|
+
const isDisabled = !!disabled;
|
|
1418
|
+
const disabledStateChanged = wasDisabled !== isDisabled;
|
|
1419
|
+
disabled ? _names.disabled.add(name) : _names.disabled.delete(name);
|
|
1420
|
+
disabledStateChanged && _state.mount && !_state.action && _setValid();
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const register = (name, options = {}) => {
|
|
1424
|
+
let field = get(_fields, name);
|
|
1425
|
+
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);
|
|
1426
|
+
set(_fields, name, {
|
|
1427
|
+
...field || {},
|
|
1428
|
+
_f: {
|
|
1429
|
+
...field && field._f ? field._f : { ref: { name } },
|
|
1430
|
+
name,
|
|
1431
|
+
mount: true,
|
|
1432
|
+
...options
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
_names.mount.add(name);
|
|
1436
|
+
if (field) {
|
|
1437
|
+
_setDisabledField({
|
|
1438
|
+
disabled: isBoolean(options.disabled) ? options.disabled : _options.disabled,
|
|
1439
|
+
name
|
|
1440
|
+
});
|
|
1441
|
+
} else {
|
|
1442
|
+
updateValidAndValue(name, true, options.value);
|
|
1443
|
+
}
|
|
1444
|
+
return {
|
|
1445
|
+
...disabledIsDefined ? { disabled: options.disabled || _options.disabled } : {},
|
|
1446
|
+
..._options.progressive ? {
|
|
1447
|
+
required: !!options.required,
|
|
1448
|
+
min: getRuleValue(options.min),
|
|
1449
|
+
max: getRuleValue(options.max),
|
|
1450
|
+
minLength: getRuleValue(options.minLength),
|
|
1451
|
+
maxLength: getRuleValue(options.maxLength),
|
|
1452
|
+
pattern: getRuleValue(options.pattern)
|
|
1453
|
+
} : {},
|
|
1454
|
+
name,
|
|
1455
|
+
onChange,
|
|
1456
|
+
onBlur: onChange,
|
|
1457
|
+
ref: (ref) => {
|
|
1458
|
+
if (ref) {
|
|
1459
|
+
register(name, options);
|
|
1460
|
+
field = get(_fields, name);
|
|
1461
|
+
const fieldRef = isUndefined(ref.value) ? ref.querySelectorAll ? ref.querySelectorAll("input,select,textarea")[0] || ref : ref : ref;
|
|
1462
|
+
const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
|
|
1463
|
+
const refs = field._f.refs || [];
|
|
1464
|
+
if (radioOrCheckbox ? refs.find((option) => option === fieldRef) : fieldRef === field._f.ref) {
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
set(_fields, name, {
|
|
1468
|
+
_f: {
|
|
1469
|
+
...field._f,
|
|
1470
|
+
...radioOrCheckbox ? {
|
|
1471
|
+
refs: [
|
|
1472
|
+
...refs.filter(live),
|
|
1473
|
+
fieldRef,
|
|
1474
|
+
...Array.isArray(get(_defaultValues, name)) ? [{}] : []
|
|
1475
|
+
],
|
|
1476
|
+
ref: { type: fieldRef.type, name }
|
|
1477
|
+
} : { ref: fieldRef }
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
updateValidAndValue(name, false, void 0, fieldRef);
|
|
1481
|
+
} else {
|
|
1482
|
+
field = get(_fields, name, {});
|
|
1483
|
+
if (field._f) {
|
|
1484
|
+
field._f.mount = false;
|
|
1485
|
+
}
|
|
1486
|
+
(_options.shouldUnregister || options.shouldUnregister) && !(isNameInFieldArray(_names.array, name) && _state.action) && _names.unMount.add(name);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
};
|
|
1491
|
+
const _focusError = () => _options.shouldFocusError && iterateFieldsByAction(_fields, _focusInput, _names.mount);
|
|
1492
|
+
const _disableForm = (disabled) => {
|
|
1493
|
+
if (isBoolean(disabled)) {
|
|
1494
|
+
_subjects.state.next({ disabled });
|
|
1495
|
+
iterateFieldsByAction(_fields, (ref, name) => {
|
|
1496
|
+
const currentField = get(_fields, name);
|
|
1497
|
+
if (currentField) {
|
|
1498
|
+
ref.disabled = currentField._f.disabled || disabled;
|
|
1499
|
+
if (Array.isArray(currentField._f.refs)) {
|
|
1500
|
+
currentField._f.refs.forEach((inputRef) => {
|
|
1501
|
+
inputRef.disabled = currentField._f.disabled || disabled;
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
}, 0, false);
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
const handleSubmit = (onValid, onInvalid) => async (e) => {
|
|
1509
|
+
let onValidError = void 0;
|
|
1510
|
+
if (e) {
|
|
1511
|
+
e.preventDefault && e.preventDefault();
|
|
1512
|
+
e.persist && e.persist();
|
|
1513
|
+
}
|
|
1514
|
+
let fieldValues = cloneObject(_formValues);
|
|
1515
|
+
_subjects.state.next({
|
|
1516
|
+
isSubmitting: true
|
|
1517
|
+
});
|
|
1518
|
+
if (_options.resolver) {
|
|
1519
|
+
const { errors, values } = await _runSchema();
|
|
1520
|
+
_updateIsValidating();
|
|
1521
|
+
_formState.errors = errors;
|
|
1522
|
+
fieldValues = cloneObject(values);
|
|
1523
|
+
} else {
|
|
1524
|
+
await executeBuiltInValidation(_fields);
|
|
1525
|
+
}
|
|
1526
|
+
if (_names.disabled.size) {
|
|
1527
|
+
for (const name of _names.disabled) {
|
|
1528
|
+
unset(fieldValues, name);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
unset(_formState.errors, "root");
|
|
1532
|
+
if (isEmptyObject(_formState.errors)) {
|
|
1533
|
+
_subjects.state.next({
|
|
1534
|
+
errors: {}
|
|
1535
|
+
});
|
|
1536
|
+
try {
|
|
1537
|
+
await onValid(fieldValues, e);
|
|
1538
|
+
} catch (error) {
|
|
1539
|
+
onValidError = error;
|
|
1540
|
+
}
|
|
1541
|
+
} else {
|
|
1542
|
+
if (onInvalid) {
|
|
1543
|
+
await onInvalid({ ..._formState.errors }, e);
|
|
1544
|
+
}
|
|
1545
|
+
_focusError();
|
|
1546
|
+
setTimeout(_focusError);
|
|
1547
|
+
}
|
|
1548
|
+
_subjects.state.next({
|
|
1549
|
+
isSubmitted: true,
|
|
1550
|
+
isSubmitting: false,
|
|
1551
|
+
isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,
|
|
1552
|
+
submitCount: _formState.submitCount + 1,
|
|
1553
|
+
errors: _formState.errors
|
|
1554
|
+
});
|
|
1555
|
+
if (onValidError) {
|
|
1556
|
+
throw onValidError;
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
const resetField = (name, options = {}) => {
|
|
1560
|
+
if (get(_fields, name)) {
|
|
1561
|
+
if (isUndefined(options.defaultValue)) {
|
|
1562
|
+
setValue(name, cloneObject(get(_defaultValues, name)));
|
|
1563
|
+
} else {
|
|
1564
|
+
setValue(name, options.defaultValue);
|
|
1565
|
+
set(_defaultValues, name, cloneObject(options.defaultValue));
|
|
1566
|
+
}
|
|
1567
|
+
if (!options.keepTouched) {
|
|
1568
|
+
unset(_formState.touchedFields, name);
|
|
1569
|
+
}
|
|
1570
|
+
if (!options.keepDirty) {
|
|
1571
|
+
unset(_formState.dirtyFields, name);
|
|
1572
|
+
_formState.isDirty = options.defaultValue ? _getDirty(name, cloneObject(get(_defaultValues, name))) : _getDirty();
|
|
1573
|
+
}
|
|
1574
|
+
if (!options.keepError) {
|
|
1575
|
+
unset(_formState.errors, name);
|
|
1576
|
+
_proxyFormState.isValid && _setValid();
|
|
1577
|
+
}
|
|
1578
|
+
_subjects.state.next({ ..._formState });
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
const _reset = (formValues, keepStateOptions = {}) => {
|
|
1582
|
+
const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
|
|
1583
|
+
const cloneUpdatedValues = cloneObject(updatedValues);
|
|
1584
|
+
const isEmptyResetValues = isEmptyObject(formValues);
|
|
1585
|
+
const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;
|
|
1586
|
+
if (!keepStateOptions.keepDefaultValues) {
|
|
1587
|
+
_defaultValues = updatedValues;
|
|
1588
|
+
}
|
|
1589
|
+
if (!keepStateOptions.keepValues) {
|
|
1590
|
+
if (keepStateOptions.keepDirtyValues) {
|
|
1591
|
+
const fieldsToCheck = /* @__PURE__ */ new Set([
|
|
1592
|
+
..._names.mount,
|
|
1593
|
+
...Object.keys(getDirtyFields(_defaultValues, _formValues))
|
|
1594
|
+
]);
|
|
1595
|
+
for (const fieldName of Array.from(fieldsToCheck)) {
|
|
1596
|
+
const isDirty = get(_formState.dirtyFields, fieldName);
|
|
1597
|
+
const existingValue = get(_formValues, fieldName);
|
|
1598
|
+
const newValue = get(values, fieldName);
|
|
1599
|
+
if (isDirty && !isUndefined(existingValue)) {
|
|
1600
|
+
set(values, fieldName, existingValue);
|
|
1601
|
+
} else if (!isDirty && !isUndefined(newValue)) {
|
|
1602
|
+
setValue(fieldName, newValue);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
} else {
|
|
1606
|
+
if (isWeb && isUndefined(formValues)) {
|
|
1607
|
+
for (const name of _names.mount) {
|
|
1608
|
+
const field = get(_fields, name);
|
|
1609
|
+
if (field && field._f) {
|
|
1610
|
+
const fieldReference = Array.isArray(field._f.refs) ? field._f.refs[0] : field._f.ref;
|
|
1611
|
+
if (isHTMLElement(fieldReference)) {
|
|
1612
|
+
const form = fieldReference.closest("form");
|
|
1613
|
+
if (form) {
|
|
1614
|
+
form.reset();
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
if (keepStateOptions.keepFieldsRef) {
|
|
1622
|
+
for (const fieldName of _names.mount) {
|
|
1623
|
+
setValue(fieldName, get(values, fieldName));
|
|
1624
|
+
}
|
|
1625
|
+
} else {
|
|
1626
|
+
_fields = {};
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
_formValues = _options.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values);
|
|
1630
|
+
_subjects.array.next({
|
|
1631
|
+
values: { ...values }
|
|
1632
|
+
});
|
|
1633
|
+
_subjects.state.next({
|
|
1634
|
+
values: { ...values }
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
_names = {
|
|
1638
|
+
mount: keepStateOptions.keepDirtyValues ? _names.mount : /* @__PURE__ */ new Set(),
|
|
1639
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
1640
|
+
array: /* @__PURE__ */ new Set(),
|
|
1641
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
1642
|
+
watch: /* @__PURE__ */ new Set(),
|
|
1643
|
+
watchAll: false,
|
|
1644
|
+
focus: ""
|
|
1645
|
+
};
|
|
1646
|
+
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
|
|
1647
|
+
_state.watch = !!_options.shouldUnregister;
|
|
1648
|
+
_state.keepIsValid = !!keepStateOptions.keepIsValid;
|
|
1649
|
+
_state.action = false;
|
|
1650
|
+
if (!keepStateOptions.keepErrors) {
|
|
1651
|
+
_formState.errors = {};
|
|
1652
|
+
}
|
|
1653
|
+
_subjects.state.next({
|
|
1654
|
+
submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
|
|
1655
|
+
isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
|
|
1656
|
+
isSubmitted: keepStateOptions.keepIsSubmitted ? _formState.isSubmitted : false,
|
|
1657
|
+
dirtyFields: isEmptyResetValues ? {} : keepStateOptions.keepDirtyValues ? keepStateOptions.keepDefaultValues && _formValues ? getDirtyFields(_defaultValues, _formValues) : _formState.dirtyFields : keepStateOptions.keepDefaultValues && formValues ? getDirtyFields(_defaultValues, formValues) : keepStateOptions.keepDirty ? _formState.dirtyFields : {},
|
|
1658
|
+
touchedFields: keepStateOptions.keepTouched ? _formState.touchedFields : {},
|
|
1659
|
+
errors: keepStateOptions.keepErrors ? _formState.errors : {},
|
|
1660
|
+
isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful ? _formState.isSubmitSuccessful : false,
|
|
1661
|
+
isSubmitting: false,
|
|
1662
|
+
defaultValues: _defaultValues
|
|
1663
|
+
});
|
|
1664
|
+
};
|
|
1665
|
+
const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, { ..._options.resetOptions, ...keepStateOptions });
|
|
1666
|
+
const setFocus = (name, options = {}) => {
|
|
1667
|
+
const field = get(_fields, name);
|
|
1668
|
+
const fieldReference = field && field._f;
|
|
1669
|
+
if (fieldReference) {
|
|
1670
|
+
const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
|
|
1671
|
+
if (fieldRef.focus) {
|
|
1672
|
+
setTimeout(() => {
|
|
1673
|
+
fieldRef.focus();
|
|
1674
|
+
options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
const _setFormState = (updatedFormState) => {
|
|
1680
|
+
_formState = {
|
|
1681
|
+
..._formState,
|
|
1682
|
+
...updatedFormState
|
|
1683
|
+
};
|
|
1684
|
+
};
|
|
1685
|
+
const _resetDefaultValues = () => isFunction(_options.defaultValues) && _options.defaultValues().then((values) => {
|
|
1686
|
+
reset(values, _options.resetOptions);
|
|
1687
|
+
_subjects.state.next({
|
|
1688
|
+
isLoading: false
|
|
1689
|
+
});
|
|
1690
|
+
});
|
|
1691
|
+
const methods = {
|
|
1692
|
+
control: {
|
|
1693
|
+
register,
|
|
1694
|
+
unregister,
|
|
1695
|
+
getFieldState,
|
|
1696
|
+
handleSubmit,
|
|
1697
|
+
setError,
|
|
1698
|
+
_subscribe,
|
|
1699
|
+
_runSchema,
|
|
1700
|
+
_updateIsValidating,
|
|
1701
|
+
_focusError,
|
|
1702
|
+
_getWatch,
|
|
1703
|
+
_getDirty,
|
|
1704
|
+
_setValid,
|
|
1705
|
+
_setFieldArray,
|
|
1706
|
+
_setDisabledField,
|
|
1707
|
+
_setErrors,
|
|
1708
|
+
_getFieldArray,
|
|
1709
|
+
_reset,
|
|
1710
|
+
_resetDefaultValues,
|
|
1711
|
+
_removeUnmounted,
|
|
1712
|
+
_disableForm,
|
|
1713
|
+
_subjects,
|
|
1714
|
+
_proxyFormState,
|
|
1715
|
+
get _fields() {
|
|
1716
|
+
return _fields;
|
|
1717
|
+
},
|
|
1718
|
+
get _formValues() {
|
|
1719
|
+
return _formValues;
|
|
1720
|
+
},
|
|
1721
|
+
get _state() {
|
|
1722
|
+
return _state;
|
|
1723
|
+
},
|
|
1724
|
+
set _state(value) {
|
|
1725
|
+
_state = value;
|
|
1726
|
+
},
|
|
1727
|
+
get _defaultValues() {
|
|
1728
|
+
return _defaultValues;
|
|
1729
|
+
},
|
|
1730
|
+
get _names() {
|
|
1731
|
+
return _names;
|
|
1732
|
+
},
|
|
1733
|
+
set _names(value) {
|
|
1734
|
+
_names = value;
|
|
1735
|
+
},
|
|
1736
|
+
get _formState() {
|
|
1737
|
+
return _formState;
|
|
1738
|
+
},
|
|
1739
|
+
get _options() {
|
|
1740
|
+
return _options;
|
|
1741
|
+
},
|
|
1742
|
+
set _options(value) {
|
|
1743
|
+
_options = {
|
|
1744
|
+
..._options,
|
|
1745
|
+
...value
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
subscribe,
|
|
1750
|
+
trigger,
|
|
1751
|
+
register,
|
|
1752
|
+
handleSubmit,
|
|
1753
|
+
watch,
|
|
1754
|
+
setValue,
|
|
1755
|
+
getValues,
|
|
1756
|
+
reset,
|
|
1757
|
+
resetField,
|
|
1758
|
+
clearErrors,
|
|
1759
|
+
unregister,
|
|
1760
|
+
setError,
|
|
1761
|
+
setFocus,
|
|
1762
|
+
getFieldState
|
|
1763
|
+
};
|
|
1764
|
+
return {
|
|
1765
|
+
...methods,
|
|
1766
|
+
formControl: methods
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
function useForm(props = {}) {
|
|
1770
|
+
const _formControl = React__default.useRef(void 0);
|
|
1771
|
+
const _values = React__default.useRef(void 0);
|
|
1772
|
+
const [formState, updateFormState] = React__default.useState({
|
|
1773
|
+
isDirty: false,
|
|
1774
|
+
isValidating: false,
|
|
1775
|
+
isLoading: isFunction(props.defaultValues),
|
|
1776
|
+
isSubmitted: false,
|
|
1777
|
+
isSubmitting: false,
|
|
1778
|
+
isSubmitSuccessful: false,
|
|
1779
|
+
isValid: false,
|
|
1780
|
+
submitCount: 0,
|
|
1781
|
+
dirtyFields: {},
|
|
1782
|
+
touchedFields: {},
|
|
1783
|
+
validatingFields: {},
|
|
1784
|
+
errors: props.errors || {},
|
|
1785
|
+
disabled: props.disabled || false,
|
|
1786
|
+
isReady: false,
|
|
1787
|
+
defaultValues: isFunction(props.defaultValues) ? void 0 : props.defaultValues
|
|
1788
|
+
});
|
|
1789
|
+
if (!_formControl.current) {
|
|
1790
|
+
if (props.formControl) {
|
|
1791
|
+
_formControl.current = {
|
|
1792
|
+
...props.formControl,
|
|
1793
|
+
formState
|
|
1794
|
+
};
|
|
1795
|
+
if (props.defaultValues && !isFunction(props.defaultValues)) {
|
|
1796
|
+
props.formControl.reset(props.defaultValues, props.resetOptions);
|
|
1797
|
+
}
|
|
1798
|
+
} else {
|
|
1799
|
+
const { formControl, ...rest } = createFormControl(props);
|
|
1800
|
+
_formControl.current = {
|
|
1801
|
+
...rest,
|
|
1802
|
+
formState
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
const control = _formControl.current.control;
|
|
1807
|
+
control._options = props;
|
|
1808
|
+
useIsomorphicLayoutEffect(() => {
|
|
1809
|
+
const sub = control._subscribe({
|
|
1810
|
+
formState: control._proxyFormState,
|
|
1811
|
+
callback: () => updateFormState({ ...control._formState }),
|
|
1812
|
+
reRenderRoot: true
|
|
1813
|
+
});
|
|
1814
|
+
updateFormState((data) => ({
|
|
1815
|
+
...data,
|
|
1816
|
+
isReady: true
|
|
1817
|
+
}));
|
|
1818
|
+
control._formState.isReady = true;
|
|
1819
|
+
return sub;
|
|
1820
|
+
}, [control]);
|
|
1821
|
+
React__default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
|
1822
|
+
React__default.useEffect(() => {
|
|
1823
|
+
if (props.mode) {
|
|
1824
|
+
control._options.mode = props.mode;
|
|
1825
|
+
}
|
|
1826
|
+
if (props.reValidateMode) {
|
|
1827
|
+
control._options.reValidateMode = props.reValidateMode;
|
|
1828
|
+
}
|
|
1829
|
+
}, [control, props.mode, props.reValidateMode]);
|
|
1830
|
+
React__default.useEffect(() => {
|
|
1831
|
+
if (props.errors) {
|
|
1832
|
+
control._setErrors(props.errors);
|
|
1833
|
+
control._focusError();
|
|
1834
|
+
}
|
|
1835
|
+
}, [control, props.errors]);
|
|
1836
|
+
React__default.useEffect(() => {
|
|
1837
|
+
props.shouldUnregister && control._subjects.state.next({
|
|
1838
|
+
values: control._getWatch()
|
|
1839
|
+
});
|
|
1840
|
+
}, [control, props.shouldUnregister]);
|
|
1841
|
+
React__default.useEffect(() => {
|
|
1842
|
+
if (control._proxyFormState.isDirty) {
|
|
1843
|
+
const isDirty = control._getDirty();
|
|
1844
|
+
if (isDirty !== formState.isDirty) {
|
|
1845
|
+
control._subjects.state.next({
|
|
1846
|
+
isDirty
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
}, [control, formState.isDirty]);
|
|
1851
|
+
React__default.useEffect(() => {
|
|
1852
|
+
var _a;
|
|
1853
|
+
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
1854
|
+
control._reset(props.values, {
|
|
1855
|
+
keepFieldsRef: true,
|
|
1856
|
+
...control._options.resetOptions
|
|
1857
|
+
});
|
|
1858
|
+
if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
|
|
1859
|
+
control._setValid();
|
|
1860
|
+
}
|
|
1861
|
+
_values.current = props.values;
|
|
1862
|
+
updateFormState((state) => ({ ...state }));
|
|
1863
|
+
} else {
|
|
1864
|
+
control._resetDefaultValues();
|
|
1865
|
+
}
|
|
1866
|
+
}, [control, props.values]);
|
|
1867
|
+
React__default.useEffect(() => {
|
|
1868
|
+
if (!control._state.mount) {
|
|
1869
|
+
control._setValid();
|
|
1870
|
+
control._state.mount = true;
|
|
1871
|
+
}
|
|
1872
|
+
if (control._state.watch) {
|
|
1873
|
+
control._state.watch = false;
|
|
1874
|
+
control._subjects.state.next({ ...control._formState });
|
|
1875
|
+
}
|
|
1876
|
+
control._removeUnmounted();
|
|
1877
|
+
});
|
|
1878
|
+
_formControl.current.formState = React__default.useMemo(() => getProxyFormState(formState, control), [control, formState]);
|
|
1879
|
+
return _formControl.current;
|
|
1880
|
+
}
|
|
1881
|
+
export {
|
|
1882
|
+
Controller,
|
|
1883
|
+
FormProvider,
|
|
1884
|
+
appendErrors,
|
|
1885
|
+
createFormControl,
|
|
1886
|
+
get,
|
|
1887
|
+
set,
|
|
1888
|
+
useController,
|
|
1889
|
+
useForm,
|
|
1890
|
+
useFormContext,
|
|
1891
|
+
useFormState,
|
|
1892
|
+
useWatch
|
|
1893
|
+
};
|
|
1894
|
+
//# sourceMappingURL=index.esm.js.map
|