@rebasepro/plugin-insights 0.0.1-canary.09e5ec5
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/LICENSE +6 -0
- package/dist/common/src/collections/CollectionRegistry.d.ts +56 -0
- package/dist/common/src/collections/index.d.ts +1 -0
- package/dist/common/src/data/buildRebaseData.d.ts +14 -0
- package/dist/common/src/index.d.ts +3 -0
- package/dist/common/src/util/builders.d.ts +57 -0
- package/dist/common/src/util/callbacks.d.ts +6 -0
- package/dist/common/src/util/collections.d.ts +11 -0
- package/dist/common/src/util/common.d.ts +2 -0
- package/dist/common/src/util/conditions.d.ts +26 -0
- package/dist/common/src/util/entities.d.ts +58 -0
- package/dist/common/src/util/enums.d.ts +3 -0
- package/dist/common/src/util/index.d.ts +16 -0
- package/dist/common/src/util/navigation_from_path.d.ts +34 -0
- package/dist/common/src/util/navigation_utils.d.ts +20 -0
- package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
- package/dist/common/src/util/paths.d.ts +14 -0
- package/dist/common/src/util/permissions.d.ts +5 -0
- package/dist/common/src/util/references.d.ts +2 -0
- package/dist/common/src/util/relations.d.ts +22 -0
- package/dist/common/src/util/resolutions.d.ts +72 -0
- package/dist/common/src/util/storage.d.ts +24 -0
- package/dist/core/src/components/AIIcon.d.ts +16 -0
- package/dist/core/src/components/ConfirmationDialog.d.ts +9 -0
- package/dist/core/src/components/Debug/UIReferenceView.d.ts +1 -0
- package/dist/core/src/components/Debug/UIStyleGuide.d.ts +1 -0
- package/dist/core/src/components/ErrorTooltip.d.ts +2 -0
- package/dist/core/src/components/ErrorView.d.ts +21 -0
- package/dist/core/src/components/LanguageToggle.d.ts +1 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +68 -0
- package/dist/core/src/components/LoginView/index.d.ts +2 -0
- package/dist/core/src/components/NotFoundPage.d.ts +1 -0
- package/dist/core/src/components/RebaseAuth.d.ts +10 -0
- package/dist/core/src/components/RebaseLogo.d.ts +7 -0
- package/dist/core/src/components/UnsavedChangesDialog.d.ts +9 -0
- package/dist/core/src/components/UserDisplay.d.ts +7 -0
- package/dist/core/src/components/UserSelectPopover.d.ts +62 -0
- package/dist/core/src/components/UserSettingsView.d.ts +1 -0
- package/dist/core/src/components/common/index.d.ts +6 -0
- package/dist/core/src/components/common/table_height.d.ts +5 -0
- package/dist/core/src/components/common/types.d.ts +63 -0
- package/dist/core/src/components/common/useColumnsIds.d.ts +9 -0
- package/dist/core/src/components/common/useDataTableController.d.ts +45 -0
- package/dist/core/src/components/common/useDebouncedData.d.ts +9 -0
- package/dist/core/src/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/core/src/components/index.d.ts +16 -0
- package/dist/core/src/contexts/AdminModeController.d.ts +4 -0
- package/dist/core/src/contexts/AnalyticsContext.d.ts +3 -0
- package/dist/core/src/contexts/AuthControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/CustomizationControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/DataDriverContext.d.ts +3 -0
- package/dist/core/src/contexts/DatabaseAdminContext.d.ts +3 -0
- package/dist/core/src/contexts/DialogsProvider.d.ts +4 -0
- package/dist/core/src/contexts/EffectiveRoleController.d.ts +4 -0
- package/dist/core/src/contexts/InternalUserManagementContext.d.ts +3 -0
- package/dist/core/src/contexts/ModeController.d.ts +4 -0
- package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +6 -0
- package/dist/core/src/contexts/RebaseDataContext.d.ts +3 -0
- package/dist/core/src/contexts/SnackbarProvider.d.ts +2 -0
- package/dist/core/src/contexts/StorageSourceContext.d.ts +3 -0
- package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
- package/dist/core/src/contexts/index.d.ts +13 -0
- package/dist/core/src/core/PluginLifecycleManager.d.ts +17 -0
- package/dist/core/src/core/PluginProviderStack.d.ts +21 -0
- package/dist/core/src/core/Rebase.d.ts +14 -0
- package/dist/core/src/core/RebaseProps.d.ts +136 -0
- package/dist/core/src/core/RebaseRouter.d.ts +4 -0
- package/dist/core/src/core/RebaseRoutes.d.ts +17 -0
- package/dist/core/src/core/index.d.ts +4 -0
- package/dist/core/src/hooks/ApiConfigContext.d.ts +24 -0
- package/dist/core/src/hooks/data/delete.d.ts +31 -0
- package/dist/core/src/hooks/data/save.d.ts +34 -0
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +51 -0
- package/dist/core/src/hooks/data/useData.d.ts +13 -0
- package/dist/core/src/hooks/data/useDataOrder.d.ts +12 -0
- package/dist/core/src/hooks/data/useEntityFetch.d.ts +38 -0
- package/dist/core/src/hooks/data/useRelationSelector.d.ts +52 -0
- package/dist/core/src/hooks/data/useUserSelector.d.ts +31 -0
- package/dist/core/src/hooks/index.d.ts +37 -0
- package/dist/core/src/hooks/useAdminModeController.d.ts +19 -0
- package/dist/core/src/hooks/useAnalyticsController.d.ts +5 -0
- package/dist/core/src/hooks/useAuthController.d.ts +11 -0
- package/dist/core/src/hooks/useAuthSubscription.d.ts +2 -0
- package/dist/core/src/hooks/useBackendStorageSource.d.ts +30 -0
- package/dist/core/src/hooks/useBridgeRegistration.d.ts +18 -0
- package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +6 -0
- package/dist/core/src/hooks/useBuildAdminModeController.d.ts +6 -0
- package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +8 -0
- package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
- package/dist/core/src/hooks/useBuildModeController.d.ts +6 -0
- package/dist/core/src/hooks/useClipboard.d.ts +57 -0
- package/dist/core/src/hooks/useCollapsedGroups.d.ts +12 -0
- package/dist/core/src/hooks/useCustomizationController.d.ts +11 -0
- package/dist/core/src/hooks/useDialogsController.d.ts +11 -0
- package/dist/core/src/hooks/useEffectiveRoleController.d.ts +7 -0
- package/dist/core/src/hooks/useInternalUserManagementController.d.ts +12 -0
- package/dist/core/src/hooks/useLargeLayout.d.ts +1 -0
- package/dist/core/src/hooks/useModeController.d.ts +19 -0
- package/dist/core/src/hooks/usePermissions.d.ts +12 -0
- package/dist/core/src/hooks/useRebaseClient.d.ts +5 -0
- package/dist/core/src/hooks/useRebaseContext.d.ts +11 -0
- package/dist/core/src/hooks/useRebaseRegistry.d.ts +34 -0
- package/dist/core/src/hooks/useSlot.d.ts +18 -0
- package/dist/core/src/hooks/useSnackbarController.d.ts +20 -0
- package/dist/core/src/hooks/useStorageSource.d.ts +7 -0
- package/dist/core/src/hooks/useStudioBridge.d.ts +91 -0
- package/dist/core/src/hooks/useTranslation.d.ts +17 -0
- package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +12 -0
- package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +8 -0
- package/dist/core/src/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/core/src/i18n/RebaseI18nProvider.d.ts +33 -0
- package/dist/core/src/index.d.ts +15 -0
- package/dist/core/src/internal/common.d.ts +3 -0
- package/dist/core/src/internal/useRestoreScroll.d.ts +6 -0
- package/dist/core/src/locales/de.d.ts +2 -0
- package/dist/core/src/locales/en.d.ts +10 -0
- package/dist/core/src/locales/es.d.ts +10 -0
- package/dist/core/src/locales/fr.d.ts +2 -0
- package/dist/core/src/locales/hi.d.ts +2 -0
- package/dist/core/src/locales/it.d.ts +2 -0
- package/dist/core/src/locales/pt.d.ts +7 -0
- package/dist/core/src/util/constants.d.ts +1 -0
- package/dist/core/src/util/createFormexStub.d.ts +2 -0
- package/dist/core/src/util/entity_cache.d.ts +27 -0
- package/dist/core/src/util/enums.d.ts +5 -0
- package/dist/core/src/util/icon_list.d.ts +5 -0
- package/dist/core/src/util/icon_synonyms.d.ts +1 -0
- package/dist/core/src/util/icons.d.ts +20 -0
- package/dist/core/src/util/index.d.ts +10 -0
- package/dist/core/src/util/previews.d.ts +4 -0
- package/dist/core/src/util/useStorageUploadController.d.ts +38 -0
- package/dist/core/src/util/useTraceUpdate.d.ts +2 -0
- package/dist/formex/src/Field.d.ts +52 -0
- package/dist/formex/src/Formex.d.ts +7 -0
- package/dist/formex/src/index.d.ts +5 -0
- package/dist/formex/src/types.d.ts +40 -0
- package/dist/formex/src/useCreateFormex.d.ts +14 -0
- package/dist/formex/src/utils.d.ts +16 -0
- package/dist/index.es.js +945 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +944 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/plugin-insights/src/components/CollectionInsightsInline.d.ts +16 -0
- package/dist/plugin-insights/src/components/HomeCardInsightSlot.d.ts +16 -0
- package/dist/plugin-insights/src/components/HomeInsightsSlot.d.ts +13 -0
- package/dist/plugin-insights/src/components/InsightWidget.d.ts +19 -0
- package/dist/plugin-insights/src/components/InsightWidgetSkeleton.d.ts +20 -0
- package/dist/plugin-insights/src/components/InsightsScorecardView.d.ts +19 -0
- package/dist/plugin-insights/src/engine/InsightsCache.d.ts +18 -0
- package/dist/plugin-insights/src/engine/InsightsProvider.d.ts +22 -0
- package/dist/plugin-insights/src/engine/useInsightsData.d.ts +17 -0
- package/dist/plugin-insights/src/index.d.ts +8 -0
- package/dist/plugin-insights/src/types/engine.d.ts +79 -0
- package/dist/plugin-insights/src/types/index.d.ts +2 -0
- package/dist/plugin-insights/src/types/widgets.d.ts +59 -0
- package/dist/plugin-insights/src/useInsightsPlugin.d.ts +37 -0
- package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
- package/dist/types/src/controllers/auth.d.ts +119 -0
- package/dist/types/src/controllers/client.d.ts +170 -0
- package/dist/types/src/controllers/collection_registry.d.ts +45 -0
- package/dist/types/src/controllers/customization_controller.d.ts +60 -0
- package/dist/types/src/controllers/data.d.ts +168 -0
- package/dist/types/src/controllers/data_driver.d.ts +160 -0
- package/dist/types/src/controllers/database_admin.d.ts +11 -0
- package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
- package/dist/types/src/controllers/effective_role.d.ts +4 -0
- package/dist/types/src/controllers/email.d.ts +34 -0
- package/dist/types/src/controllers/index.d.ts +18 -0
- package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
- package/dist/types/src/controllers/navigation.d.ts +213 -0
- package/dist/types/src/controllers/registry.d.ts +54 -0
- package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
- package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
- package/dist/types/src/controllers/snackbar.d.ts +24 -0
- package/dist/types/src/controllers/storage.d.ts +171 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/rebase_context.d.ts +105 -0
- package/dist/types/src/types/backend.d.ts +536 -0
- package/dist/types/src/types/builders.d.ts +15 -0
- package/dist/types/src/types/chips.d.ts +5 -0
- package/dist/types/src/types/collections.d.ts +856 -0
- package/dist/types/src/types/cron.d.ts +102 -0
- package/dist/types/src/types/data_source.d.ts +64 -0
- package/dist/types/src/types/entities.d.ts +145 -0
- package/dist/types/src/types/entity_actions.d.ts +98 -0
- package/dist/types/src/types/entity_callbacks.d.ts +173 -0
- package/dist/types/src/types/entity_link_builder.d.ts +7 -0
- package/dist/types/src/types/entity_overrides.d.ts +10 -0
- package/dist/types/src/types/entity_views.d.ts +61 -0
- package/dist/types/src/types/export_import.d.ts +21 -0
- package/dist/types/src/types/index.d.ts +23 -0
- package/dist/types/src/types/locales.d.ts +4 -0
- package/dist/types/src/types/modify_collections.d.ts +5 -0
- package/dist/types/src/types/plugins.d.ts +279 -0
- package/dist/types/src/types/properties.d.ts +1176 -0
- package/dist/types/src/types/property_config.d.ts +70 -0
- package/dist/types/src/types/relations.d.ts +336 -0
- package/dist/types/src/types/slots.d.ts +252 -0
- package/dist/types/src/types/translations.d.ts +870 -0
- package/dist/types/src/types/user_management_delegate.d.ts +121 -0
- package/dist/types/src/types/websockets.d.ts +78 -0
- package/dist/types/src/users/index.d.ts +2 -0
- package/dist/types/src/users/roles.d.ts +22 -0
- package/dist/types/src/users/user.d.ts +46 -0
- package/dist/ui/src/components/Alert.d.ts +12 -0
- package/dist/ui/src/components/Autocomplete.d.ts +21 -0
- package/dist/ui/src/components/Avatar.d.ts +11 -0
- package/dist/ui/src/components/Badge.d.ts +8 -0
- package/dist/ui/src/components/BooleanSwitch.d.ts +14 -0
- package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +17 -0
- package/dist/ui/src/components/Button.d.ts +14 -0
- package/dist/ui/src/components/Card.d.ts +9 -0
- package/dist/ui/src/components/CenteredView.d.ts +9 -0
- package/dist/ui/src/components/Checkbox.d.ts +13 -0
- package/dist/ui/src/components/Chip.d.ts +26 -0
- package/dist/ui/src/components/CircularProgress.d.ts +5 -0
- package/dist/ui/src/components/CircularProgressCenter.d.ts +11 -0
- package/dist/ui/src/components/Collapse.d.ts +9 -0
- package/dist/ui/src/components/ColorPicker.d.ts +30 -0
- package/dist/ui/src/components/Container.d.ts +8 -0
- package/dist/ui/src/components/DateTimeField.d.ts +24 -0
- package/dist/ui/src/components/DebouncedTextField.d.ts +2 -0
- package/dist/ui/src/components/Dialog.d.ts +39 -0
- package/dist/ui/src/components/DialogActions.d.ts +7 -0
- package/dist/ui/src/components/DialogContent.d.ts +7 -0
- package/dist/ui/src/components/DialogTitle.d.ts +10 -0
- package/dist/ui/src/components/ErrorBoundary.d.ts +11 -0
- package/dist/ui/src/components/ExpandablePanel.d.ts +12 -0
- package/dist/ui/src/components/FileUpload.d.ts +23 -0
- package/dist/ui/src/components/IconButton.d.ts +12 -0
- package/dist/ui/src/components/InfoLabel.d.ts +5 -0
- package/dist/ui/src/components/InputLabel.d.ts +11 -0
- package/dist/ui/src/components/Label.d.ts +7 -0
- package/dist/ui/src/components/LoadingButton.d.ts +7 -0
- package/dist/ui/src/components/Markdown.d.ts +10 -0
- package/dist/ui/src/components/Menu.d.ts +23 -0
- package/dist/ui/src/components/Menubar.d.ts +80 -0
- package/dist/ui/src/components/MultiSelect.d.ts +48 -0
- package/dist/ui/src/components/Paper.d.ts +6 -0
- package/dist/ui/src/components/Popover.d.ts +24 -0
- package/dist/ui/src/components/RadioGroup.d.ts +28 -0
- package/dist/ui/src/components/ResizablePanels.d.ts +18 -0
- package/dist/ui/src/components/SearchBar.d.ts +22 -0
- package/dist/ui/src/components/Select.d.ts +43 -0
- package/dist/ui/src/components/Separator.d.ts +5 -0
- package/dist/ui/src/components/Sheet.d.ts +22 -0
- package/dist/ui/src/components/Skeleton.d.ts +6 -0
- package/dist/ui/src/components/Slider.d.ts +21 -0
- package/dist/ui/src/components/Table.d.ts +34 -0
- package/dist/ui/src/components/Tabs.d.ts +19 -0
- package/dist/ui/src/components/TextField.d.ts +58 -0
- package/dist/ui/src/components/TextareaAutosize.d.ts +43 -0
- package/dist/ui/src/components/ToggleButtonGroup.d.ts +30 -0
- package/dist/ui/src/components/Tooltip.d.ts +19 -0
- package/dist/ui/src/components/Typography.d.ts +36 -0
- package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +11 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +21 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +29 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +243 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/index.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/types.d.ts +38 -0
- package/dist/ui/src/components/common/SelectInputLabel.d.ts +5 -0
- package/dist/ui/src/components/index.d.ts +53 -0
- package/dist/ui/src/hooks/PortalContainerContext.d.ts +31 -0
- package/dist/ui/src/hooks/index.d.ts +6 -0
- package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useDebounceValue.d.ts +1 -0
- package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useInjectStyles.d.ts +7 -0
- package/dist/ui/src/hooks/useOutsideAlerter.d.ts +5 -0
- package/dist/ui/src/icons/GitHubIcon.d.ts +2 -0
- package/dist/ui/src/icons/HandleIcon.d.ts +1 -0
- package/dist/ui/src/icons/Icon.d.ts +20 -0
- package/dist/ui/src/icons/cool_icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/index.d.ts +6 -0
- package/dist/ui/src/index.d.ts +5 -0
- package/dist/ui/src/styles.d.ts +12 -0
- package/dist/ui/src/util/chip_colors.d.ts +4 -0
- package/dist/ui/src/util/cls.d.ts +2 -0
- package/dist/ui/src/util/debounce.d.ts +10 -0
- package/dist/ui/src/util/hash.d.ts +1 -0
- package/dist/ui/src/util/index.d.ts +4 -0
- package/dist/ui/src/util/key_to_icon_component.d.ts +1 -0
- package/package.json +80 -0
- package/src/components/CollectionInsightsInline.tsx +30 -0
- package/src/components/HomeCardInsightSlot.tsx +36 -0
- package/src/components/HomeInsightsSlot.tsx +30 -0
- package/src/components/InsightWidget.tsx +65 -0
- package/src/components/InsightWidgetSkeleton.tsx +122 -0
- package/src/components/InsightsScorecardView.tsx +160 -0
- package/src/engine/InsightsCache.ts +52 -0
- package/src/engine/InsightsProvider.tsx +38 -0
- package/src/engine/useInsightsData.ts +100 -0
- package/src/index.ts +22 -0
- package/src/types/engine.ts +85 -0
- package/src/types/index.ts +5 -0
- package/src/types/widgets.ts +66 -0
- package/src/useInsightsPlugin.tsx +117 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { StorageSource } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* Use this hook to get the storage source being used
|
|
5
|
+
* @group Hooks and utilities
|
|
6
|
+
*/
|
|
7
|
+
export declare const useStorageSource: (collection?: EntityCollection) => StorageSource;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CollectionRegistryController, SideEntityController, UrlController, NavigationStateController } from "@rebasepro/types";
|
|
3
|
+
export interface BreadcrumbEntry {
|
|
4
|
+
title: string;
|
|
5
|
+
url: string;
|
|
6
|
+
count?: number | null;
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BreadcrumbsController {
|
|
10
|
+
breadcrumbs: BreadcrumbEntry[];
|
|
11
|
+
set: (props: {
|
|
12
|
+
breadcrumbs: BreadcrumbEntry[];
|
|
13
|
+
}) => void;
|
|
14
|
+
updateCount: (id: string, count: number | null | undefined) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* StudioBridge provides optional CMS capabilities to Studio components.
|
|
18
|
+
* When CMS is present, a bridge provider injects real implementations.
|
|
19
|
+
* When CMS is absent, noop defaults ensure Studio works standalone.
|
|
20
|
+
*/
|
|
21
|
+
export interface StudioBridge {
|
|
22
|
+
collectionRegistry: CollectionRegistryController;
|
|
23
|
+
sideEntityController: SideEntityController;
|
|
24
|
+
urlController: UrlController;
|
|
25
|
+
navigationState: NavigationStateController;
|
|
26
|
+
breadcrumbs: BreadcrumbsController;
|
|
27
|
+
}
|
|
28
|
+
export declare const StudioBridgeContext: React.Context<StudioBridge>;
|
|
29
|
+
/**
|
|
30
|
+
* Provider that injects CMS capabilities into Studio.
|
|
31
|
+
* Accepts partial overrides — any field not provided falls back to noop.
|
|
32
|
+
*
|
|
33
|
+
* Usage (in app wiring, when CMS is present):
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <StudioBridgeProvider value={{
|
|
36
|
+
* collectionRegistry: useCollectionRegistryController(),
|
|
37
|
+
* sideEntityController: useSideEntityController(),
|
|
38
|
+
* urlController: useUrlController(),
|
|
39
|
+
* navigationState: useNavigationStateController(),
|
|
40
|
+
* breadcrumbs: useBreadcrumbsController(),
|
|
41
|
+
* }}>
|
|
42
|
+
* <RebaseStudio ... />
|
|
43
|
+
* </StudioBridgeProvider>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function StudioBridgeProvider({ value, children }: {
|
|
47
|
+
value: Partial<StudioBridge>;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
/** Collection registry — returns noop if CMS is not present. */
|
|
51
|
+
export declare function useStudioCollectionRegistry(): CollectionRegistryController;
|
|
52
|
+
/** Side entity controller — returns noop if CMS is not present. */
|
|
53
|
+
export declare function useStudioSideEntityController(): SideEntityController;
|
|
54
|
+
/** URL controller — returns noop if CMS is not present. */
|
|
55
|
+
export declare function useStudioUrlController(): UrlController;
|
|
56
|
+
/** Navigation state — returns noop if CMS is not present. */
|
|
57
|
+
export declare function useStudioNavigationState(): NavigationStateController;
|
|
58
|
+
/** Breadcrumbs controller — returns noop if CMS is not present. */
|
|
59
|
+
export declare function useStudioBreadcrumbs(): BreadcrumbsController;
|
|
60
|
+
/**
|
|
61
|
+
* Registry that controllers use to self-register their implementations
|
|
62
|
+
* into the Studio bridge. Each controller calls `register(key, value)`
|
|
63
|
+
* on mount and `unregister(key)` on unmount.
|
|
64
|
+
*/
|
|
65
|
+
export interface StudioBridgeRegistry {
|
|
66
|
+
register: <K extends keyof StudioBridge>(key: K, value: StudioBridge[K]) => void;
|
|
67
|
+
unregister: (key: keyof StudioBridge) => void;
|
|
68
|
+
}
|
|
69
|
+
export declare const StudioBridgeRegistryContext: React.Context<StudioBridgeRegistry | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Provider that creates a self-assembling bridge.
|
|
72
|
+
*
|
|
73
|
+
* Mount this above the controller providers. Each controller calls
|
|
74
|
+
* `useBridgeRegistration(key, value)` to inject its implementation.
|
|
75
|
+
* The bridge context value is automatically kept in sync.
|
|
76
|
+
*
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <StudioBridgeRegistryProvider>
|
|
79
|
+
* <CollectionRegistryProvider> // auto-registers
|
|
80
|
+
* <SideEntityProvider> // auto-registers
|
|
81
|
+
* <UrlProvider> // auto-registers
|
|
82
|
+
* <RebaseStudio /> // consumes bridge
|
|
83
|
+
* </UrlProvider>
|
|
84
|
+
* </SideEntityProvider>
|
|
85
|
+
* </CollectionRegistryProvider>
|
|
86
|
+
* </StudioBridgeRegistryProvider>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function StudioBridgeRegistryProvider({ children }: {
|
|
90
|
+
children: React.ReactNode;
|
|
91
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal hook for translating Rebase UI strings.
|
|
3
|
+
*
|
|
4
|
+
* Uses the `rebase_core` i18next namespace that is initialised by
|
|
5
|
+
* `RebaseI18nProvider`. Do NOT use `react-i18next` directly in internal
|
|
6
|
+
* components — always go through this hook so the namespace is consistent.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { t } = useTranslation();
|
|
10
|
+
* <Button>{t("save")}</Button>
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTranslation(): {
|
|
15
|
+
t: (key: string, vars?: Record<string, string>) => string;
|
|
16
|
+
i18n: import("i18next").i18n;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UnsavedChangesDialogProps } from "../components/UnsavedChangesDialog";
|
|
2
|
+
/**
|
|
3
|
+
* A single, unified hook to prevent navigation when there are unsaved changes.
|
|
4
|
+
*
|
|
5
|
+
* It automatically handles:
|
|
6
|
+
* 1. Internal React Router navigation using `useBlocker`.
|
|
7
|
+
* 2. External browser navigation (page refresh, tab close) using `beforeunload`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useUnsavedChangesDialog(when: boolean, onOk: () => void): {
|
|
10
|
+
dialogProps: UnsavedChangesDialogProps;
|
|
11
|
+
triggerDialog: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UserConfigurationPersistence } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Use this controller to access the configuration that is stored externally,
|
|
4
|
+
* and not defined in code
|
|
5
|
+
*
|
|
6
|
+
* @group Hooks and utilities
|
|
7
|
+
*/
|
|
8
|
+
export declare const useUserConfigurationPersistence: () => UserConfigurationPersistence | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AuthController, Authenticator, RebaseData, StorageSource, User } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* This hook is used internally for validating an authenticator.
|
|
4
|
+
*
|
|
5
|
+
* @param authController
|
|
6
|
+
* @param authentication
|
|
7
|
+
* @param storageSource
|
|
8
|
+
* @param data
|
|
9
|
+
*/
|
|
10
|
+
export declare function useValidateAuthenticator<USER extends User = any>({ disabled, authController, authenticator, storageSource, data }: {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
authController: AuthController<USER>;
|
|
13
|
+
authenticator?: boolean | Authenticator<USER>;
|
|
14
|
+
data: RebaseData;
|
|
15
|
+
storageSource: StorageSource;
|
|
16
|
+
}): {
|
|
17
|
+
canAccessMainView: boolean;
|
|
18
|
+
authLoading: boolean;
|
|
19
|
+
notAllowedError: any;
|
|
20
|
+
authVerified: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { RebaseTranslations } from "@rebasepro/types";
|
|
3
|
+
export declare const REBASE_LOCALE_STORAGE_KEY = "rebase_locale";
|
|
4
|
+
/** DeepPartial helper — allows partial overrides at any nesting level */
|
|
5
|
+
type DeepPartial<T> = T extends object ? {
|
|
6
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
7
|
+
} : T;
|
|
8
|
+
export interface RebaseI18nProviderProps {
|
|
9
|
+
/** BCP-47 locale tag, e.g. "en", "es", "fr". Defaults to "en". */
|
|
10
|
+
locale?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Override or extend any Rebase UI string, keyed by locale.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* translations={{
|
|
16
|
+
* en: { save: "Publish" },
|
|
17
|
+
* es: { save: "Publicar", discard: "Descartar" }
|
|
18
|
+
* }}
|
|
19
|
+
*/
|
|
20
|
+
translations?: {
|
|
21
|
+
[locale: string]: DeepPartial<RebaseTranslations>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Initialises a dedicated i18next instance for Rebase's internal UI strings.
|
|
26
|
+
*
|
|
27
|
+
* This instance is isolated from any app-level i18next configuration the
|
|
28
|
+
* consumer may have. Mount this at the top of the Rebase component tree.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function RebaseI18nProvider({ locale, translations, children }: PropsWithChildren<RebaseI18nProviderProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./core";
|
|
2
|
+
export * from "./hooks";
|
|
3
|
+
export * from "./components";
|
|
4
|
+
export * from "./util";
|
|
5
|
+
export * from "./contexts";
|
|
6
|
+
export * from "./internal/common";
|
|
7
|
+
export * from "./internal/useRestoreScroll";
|
|
8
|
+
export { useUnsavedChangesDialog } from "./hooks/useUnsavedChangesDialog";
|
|
9
|
+
export type { UnsavedChangesDialogProps } from "./components/UnsavedChangesDialog";
|
|
10
|
+
export { UnsavedChangesDialog } from "./components/UnsavedChangesDialog";
|
|
11
|
+
export * from "./i18n/RebaseI18nProvider";
|
|
12
|
+
export * from "./locales/en";
|
|
13
|
+
export * from "./locales/es";
|
|
14
|
+
export * from "./hooks/useStudioBridge";
|
|
15
|
+
export { useBridgeRegistration } from "./hooks/useBridgeRegistration";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* English baseline translations for @rebasepro/core.
|
|
4
|
+
*
|
|
5
|
+
* This is the single source of truth for all default UI strings.
|
|
6
|
+
* Override any key via the `translations` prop on Rebase entry-point components.
|
|
7
|
+
*
|
|
8
|
+
* @group Core
|
|
9
|
+
*/
|
|
10
|
+
export declare const en: RebaseTranslations;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Spanish baseline translations for @rebasepro/core.
|
|
4
|
+
*
|
|
5
|
+
* This is the single source of truth for all default UI strings in Spanish.
|
|
6
|
+
* Override any key via the `translations` prop on Rebase entry-point components.
|
|
7
|
+
*
|
|
8
|
+
* @group Core
|
|
9
|
+
*/
|
|
10
|
+
export declare const es: RebaseTranslations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STUDIO_NAVIGATION_GROUPS: string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Saves data to the in-memory cache and persists it individually in `sessionStorage`.
|
|
3
|
+
* @param path - The unique path/key for the data.
|
|
4
|
+
* @param data - The data to cache and persist.
|
|
5
|
+
*/
|
|
6
|
+
export declare function saveEntityToCache(path: string, data: object): void;
|
|
7
|
+
export declare function removeEntityFromMemoryCache(path: string): void;
|
|
8
|
+
export declare function saveEntityToMemoryCache(path: string, data: object): void;
|
|
9
|
+
export declare function getEntityFromMemoryCache(path: string): object | undefined;
|
|
10
|
+
export declare function hasEntityInCache(path: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves an entity from the in-memory cache or `sessionStorage`.
|
|
13
|
+
* If the entity is not in the cache but exists in `sessionStorage`, it loads it into the cache.
|
|
14
|
+
* @param path - The unique path/key for the entity.
|
|
15
|
+
* @returns The cached entity or `undefined` if not found.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getEntityFromCache(path: string): object | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Removes an entity from both the in-memory cache and `sessionStorage`.
|
|
20
|
+
* @param path - The unique path/key for the entity to remove.
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeEntityFromCache(path: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Clears the entire in-memory cache and removes all related entities from `sessionStorage`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function clearEntityCache(): void;
|
|
27
|
+
export declare function flattenKeys(obj: Record<string, unknown> | unknown[], prefix?: string, result?: string[]): string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EnumValueConfig } from "@rebasepro/types";
|
|
2
|
+
import { ChipColorScheme } from "@rebasepro/ui";
|
|
3
|
+
export declare function getColorScheme(enumValues: EnumValueConfig[], key: string | number): ChipColorScheme | undefined;
|
|
4
|
+
export declare function isEnumValueDisabled(labelOrConfig?: string | EnumValueConfig): boolean | undefined;
|
|
5
|
+
export declare function buildEnumLabel(labelOrConfig?: string | EnumValueConfig): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const iconSynonyms: Record<string, string>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconColor } from "@rebasepro/ui";
|
|
3
|
+
/**
|
|
4
|
+
* Render an icon element from a string key or existing React element.
|
|
5
|
+
* This resolves the icon from the lucide-react icons map directly.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getIcon(iconKey?: string | React.ReactNode, className?: string, color?: IconColor, size?: "smallest" | "small" | "medium" | "large" | number): React.ReactElement | undefined;
|
|
8
|
+
export type IconViewProps = {
|
|
9
|
+
slug: string;
|
|
10
|
+
name: string;
|
|
11
|
+
singularName?: string;
|
|
12
|
+
group?: string;
|
|
13
|
+
icon?: string | React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export declare const IconForView: React.NamedExoticComponent<{
|
|
16
|
+
collectionOrView?: IconViewProps;
|
|
17
|
+
color?: IconColor;
|
|
18
|
+
className?: string;
|
|
19
|
+
size?: "smallest" | "small" | "medium" | "large" | number;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./icon_list";
|
|
2
|
+
export * from "./icon_synonyms";
|
|
3
|
+
export * from "./icons";
|
|
4
|
+
export * from "./createFormexStub";
|
|
5
|
+
export * from "./entity_cache";
|
|
6
|
+
export * from "./useStorageUploadController";
|
|
7
|
+
export * from "./useTraceUpdate";
|
|
8
|
+
export * from "./previews";
|
|
9
|
+
export * from "./enums";
|
|
10
|
+
export * from "./constants";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EntityCollection, PropertyConfig } from "@rebasepro/types";
|
|
2
|
+
import { AuthController } from "@rebasepro/types";
|
|
3
|
+
export declare function getEntityPreviewKeys(authController: AuthController, targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
|
|
4
|
+
export declare function getEntityTitlePropertyKey<M extends Record<string, any>>(collection: EntityCollection<M>, propertyConfigs: Record<string, PropertyConfig>): string | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ArrayProperty, StringProperty } from "@rebasepro/types";
|
|
2
|
+
import { EntityValues, StorageConfig, StorageSource } from "@rebasepro/types";
|
|
3
|
+
export type StorageFieldSize = "smallest" | "small" | "medium" | "large" | number;
|
|
4
|
+
/**
|
|
5
|
+
* Internal representation of an item in the storage
|
|
6
|
+
* It can have two states, having a storagePathOrDownloadUrl set,
|
|
7
|
+
* which means the file has been uploaded, and it is rendered as a preview
|
|
8
|
+
* Or have a pending file being uploaded.
|
|
9
|
+
*/
|
|
10
|
+
export interface StorageFieldItem {
|
|
11
|
+
id: number;
|
|
12
|
+
storagePathOrDownloadUrl?: string;
|
|
13
|
+
file?: File;
|
|
14
|
+
fileName?: string;
|
|
15
|
+
metadata?: any;
|
|
16
|
+
size: StorageFieldSize;
|
|
17
|
+
}
|
|
18
|
+
export declare function useStorageUploadController<M extends Record<string, unknown>>({ entityId, entityValues, path, value, property, propertyKey, storageSource, disabled, onChange }: {
|
|
19
|
+
entityId?: string | number;
|
|
20
|
+
entityValues: EntityValues<M>;
|
|
21
|
+
value: string | string[] | null;
|
|
22
|
+
path?: string;
|
|
23
|
+
propertyKey: string;
|
|
24
|
+
property: StringProperty | ArrayProperty | StringProperty | ArrayProperty;
|
|
25
|
+
storageSource: StorageSource;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
onChange: (value: string | string[] | null) => void;
|
|
28
|
+
}): {
|
|
29
|
+
internalValue: StorageFieldItem[];
|
|
30
|
+
setInternalValue: import("react").Dispatch<import("react").SetStateAction<StorageFieldItem[]>>;
|
|
31
|
+
storage: StorageConfig;
|
|
32
|
+
fileNameBuilder: (file: File) => Promise<string>;
|
|
33
|
+
storagePathBuilder: (file: File) => string;
|
|
34
|
+
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, metadata?: any, uploadedUrl?: string) => Promise<void>;
|
|
35
|
+
onFileUploadError: (entry: StorageFieldItem) => void;
|
|
36
|
+
onFilesAdded: (acceptedFiles: File[]) => Promise<void>;
|
|
37
|
+
multipleFilesSupported: boolean;
|
|
38
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormexController } from "./types";
|
|
3
|
+
export interface FieldInputProps<Value> {
|
|
4
|
+
/** Value of the field */
|
|
5
|
+
value: Value;
|
|
6
|
+
/** Name of the field */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Multiple select? */
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
/** Is the field checked? */
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
/** Change event handler */
|
|
13
|
+
onChange: (event: React.SyntheticEvent) => void;
|
|
14
|
+
/** Blur event handler */
|
|
15
|
+
onBlur: (event: React.FocusEvent) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface FormexFieldProps<Value = any, FormValues extends object = object> {
|
|
18
|
+
field: FieldInputProps<Value>;
|
|
19
|
+
form: FormexController<FormValues>;
|
|
20
|
+
}
|
|
21
|
+
export interface FieldConfig<Value, C extends React.ElementType | undefined = undefined> {
|
|
22
|
+
/**
|
|
23
|
+
* Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
|
|
24
|
+
*/
|
|
25
|
+
as?: C | string | React.ForwardRefExoticComponent<Record<string, unknown>>;
|
|
26
|
+
/**
|
|
27
|
+
* Children render function <Field name>{props => ...}</Field>)
|
|
28
|
+
*/
|
|
29
|
+
children?: ((props: FormexFieldProps<Value>) => React.ReactNode) | React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Validate a single field value independently
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Used for 'select' and related input types.
|
|
35
|
+
*/
|
|
36
|
+
multiple?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Field name
|
|
39
|
+
*/
|
|
40
|
+
name: string;
|
|
41
|
+
/** HTML input type */
|
|
42
|
+
type?: string;
|
|
43
|
+
/** Field value */
|
|
44
|
+
value?: unknown;
|
|
45
|
+
/** Inner ref */
|
|
46
|
+
innerRef?: (instance: unknown) => void;
|
|
47
|
+
}
|
|
48
|
+
export type FieldProps<T, C extends React.ElementType | undefined> = {
|
|
49
|
+
as?: C;
|
|
50
|
+
} & (C extends React.ElementType ? (React.ComponentProps<C> & FieldConfig<T, C>) : FieldConfig<T, C>);
|
|
51
|
+
export declare function Field<T, C extends React.ElementType | undefined = undefined>({ validate, name, children, as: is, // `as` is reserved in typescript lol
|
|
52
|
+
className, ...props }: FieldProps<T, C>): any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormexController } from "./types";
|
|
3
|
+
export declare const useFormex: <T = any>() => FormexController<T>;
|
|
4
|
+
export declare const Formex: <T = any>({ value, children }: {
|
|
5
|
+
value: FormexController<T>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { FormEvent } from "react";
|
|
2
|
+
export type FormexController<T = any> = {
|
|
3
|
+
values: T;
|
|
4
|
+
initialValues: T;
|
|
5
|
+
setValues: (values: T) => void;
|
|
6
|
+
setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
|
|
7
|
+
touched: Record<string, boolean>;
|
|
8
|
+
setFieldTouched: (key: string, touched: boolean, shouldValidate?: boolean) => void;
|
|
9
|
+
setTouched: (touched: Record<string, boolean>) => void;
|
|
10
|
+
dirty: boolean;
|
|
11
|
+
setDirty: (dirty: boolean) => void;
|
|
12
|
+
setSubmitCount: (submitCount: number) => void;
|
|
13
|
+
errors: Record<string, string>;
|
|
14
|
+
setFieldError: (key: string, error?: string) => void;
|
|
15
|
+
handleChange: (event: React.SyntheticEvent) => void;
|
|
16
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
17
|
+
handleSubmit: (event?: FormEvent<HTMLFormElement>) => void;
|
|
18
|
+
validate: () => void;
|
|
19
|
+
resetForm: (props?: FormexResetProps<T>) => void;
|
|
20
|
+
submitCount: number;
|
|
21
|
+
isSubmitting: boolean;
|
|
22
|
+
setSubmitting: (isSubmitting: boolean) => void;
|
|
23
|
+
isValidating: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The version of the form. This is incremented every time the form is reset
|
|
26
|
+
* or the form is submitted.
|
|
27
|
+
*/
|
|
28
|
+
version: number;
|
|
29
|
+
debugId?: string;
|
|
30
|
+
undo: () => void;
|
|
31
|
+
redo: () => void;
|
|
32
|
+
canUndo: boolean;
|
|
33
|
+
canRedo: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type FormexResetProps<T = any> = {
|
|
36
|
+
values?: T;
|
|
37
|
+
submitCount?: number;
|
|
38
|
+
errors?: Record<string, string>;
|
|
39
|
+
touched?: Record<string, boolean>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormexController } from "./types";
|
|
2
|
+
export declare function useCreateFormex<T = any>({ initialValues, initialErrors, initialDirty, initialTouched, validation, validateOnChange, validateOnInitialRender, onSubmit, onReset, onValuesChangeDeferred, debugId }: {
|
|
3
|
+
initialValues: T;
|
|
4
|
+
initialErrors?: Record<string, string>;
|
|
5
|
+
initialDirty?: boolean;
|
|
6
|
+
initialTouched?: Record<string, boolean>;
|
|
7
|
+
validateOnChange?: boolean;
|
|
8
|
+
validateOnInitialRender?: boolean;
|
|
9
|
+
validation?: (values: T) => Record<string, string> | Promise<Record<string, string>> | undefined | void;
|
|
10
|
+
onValuesChangeDeferred?: (values: T, controller: FormexController<T>) => void;
|
|
11
|
+
onSubmit?: (values: T, controller: FormexController<T>) => void | Promise<void>;
|
|
12
|
+
onReset?: (controller: FormexController<T>) => void | Promise<void>;
|
|
13
|
+
debugId?: string;
|
|
14
|
+
}): FormexController<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @private is the value an empty array? */
|
|
2
|
+
export declare const isEmptyArray: (value?: unknown) => boolean;
|
|
3
|
+
/** @private is the given object a Function? */
|
|
4
|
+
export declare const isFunction: (obj: unknown) => obj is Function;
|
|
5
|
+
/** @private is the given object an Object? */
|
|
6
|
+
export declare const isObject: (obj: unknown) => obj is Record<string, unknown>;
|
|
7
|
+
/** @private is the given object an integer? */
|
|
8
|
+
export declare const isInteger: (obj: unknown) => boolean;
|
|
9
|
+
/** @private is the given object a NaN? */
|
|
10
|
+
export declare const isNaN: (obj: unknown) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Deeply get a value from an object via its path.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getIn(obj: any, key: string | string[], def?: unknown, p?: number): any;
|
|
15
|
+
export declare function setIn(obj: any, path: string, value: unknown): any;
|
|
16
|
+
export declare function clone(value: unknown): unknown;
|