@digiform/builder 0.1.7 → 0.2.4
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/FormBuilder.d.ts +24 -0
- package/client.cjs +1 -1
- package/client.d.ts +18 -0
- package/client.js +1 -1
- package/component-registry/components/alert.d.ts +4 -0
- package/component-registry/components/button.d.ts +4 -0
- package/component-registry/components/checkbox.d.ts +9 -0
- package/component-registry/components/code-input/code-input.d.ts +4 -0
- package/component-registry/components/dropdown.d.ts +1 -0
- package/component-registry/components/heading.d.ts +4 -0
- package/component-registry/components/index.d.ts +35 -0
- package/component-registry/components/paragraph.d.ts +4 -0
- package/component-registry/components/progress-loader.d.ts +4 -0
- package/component-registry/components/radioGroup.d.ts +1 -0
- package/component-registry/components/text.d.ts +2 -0
- package/component-registry/components/textarea.d.ts +2 -0
- package/component-registry/createFormFieldComponent.d.ts +52 -0
- package/component-registry/index.d.ts +3 -0
- package/component-registry/types.d.ts +42 -0
- package/component-registry/utils.d.ts +33 -0
- package/component-registry/validation.d.ts +141 -0
- package/component-registry/validationBridge.d.ts +10 -0
- package/components/ConnectionErrorScreen/ConnectionErrorScreen.d.ts +10 -0
- package/components/DatabaseStatusIndicator/DatabaseStatusIndicator.d.ts +24 -0
- package/config/SecureConfigLoader.d.ts +57 -0
- package/config/hooks.d.ts +2 -0
- package/config/index.d.ts +5 -0
- package/config/types.d.ts +94 -0
- package/{configReader-BkMPr3Ju.js → configReader-C49NagAF.js} +4936 -4988
- package/configReader-C49NagAF.js.map +1 -0
- package/{configReader-CbGTKRUP.cjs → configReader-CT1_bYSZ.cjs} +7 -7
- package/configReader-CT1_bYSZ.cjs.map +1 -0
- package/design-system/components/ComponentSourceBadge/ComponentSourceBadge.d.ts +15 -0
- package/design-system/components/FormFieldWrapper/FormFieldWrapper.d.ts +18 -0
- package/design-system/custom/config/date-preset.config.d.ts +7 -0
- package/design-system/custom/config/email-preset.config.d.ts +7 -0
- package/design-system/custom/config/index.d.ts +10 -0
- package/design-system/custom/config/number-preset.config.d.ts +7 -0
- package/design-system/custom/config/tel-preset.config.d.ts +7 -0
- package/design-system/custom/index.d.ts +17 -0
- package/design-system/custom/utils/create-preset-config.d.ts +74 -0
- package/design-system/generated/rhc-catalog.generated.d.ts +9360 -0
- package/design-system/index.d.ts +15 -0
- package/design-system/rhc/components.d.ts +12 -0
- package/design-system/rhc/config/alert.config.d.ts +5 -0
- package/design-system/rhc/config/button.config.d.ts +8 -0
- package/design-system/rhc/config/checkbox.config.d.ts +4 -0
- package/design-system/rhc/config/form-builder.config.d.ts +74 -0
- package/design-system/rhc/config/heading.config.d.ts +5 -0
- package/design-system/rhc/config/index.d.ts +9 -0
- package/design-system/rhc/config/paragraph.config.d.ts +8 -0
- package/design-system/rhc/config/radio-group.config.d.ts +5 -0
- package/design-system/rhc/config/select.config.d.ts +5 -0
- package/design-system/rhc/config/text-input.config.d.ts +5 -0
- package/design-system/rhc/config/textarea.config.d.ts +4 -0
- package/design-system/rhc/index.d.ts +1 -0
- package/design-system/rhc/utils/create-config.d.ts +76 -0
- package/design-system/rhc/utils/generate-schema.d.ts +20 -0
- package/design-system/types.d.ts +22 -0
- package/error-boundaries/BaseErrorBoundary/BaseErrorBoundary.d.ts +31 -0
- package/error-boundaries/ComponentErrorBoundary/ComponentErrorBoundary.d.ts +9 -0
- package/error-boundaries/ErrorBoundaryTest/ErrorBoundaryTest.d.ts +2 -0
- package/error-boundaries/FlowBuilderErrorBoundary/FlowBuilderErrorBoundary.d.ts +7 -0
- package/error-boundaries/index.d.ts +1 -0
- package/features/condition-editor/components/ConditionEditor/ConditionEditor.d.ts +17 -0
- package/features/condition-editor/components/ConditionItem/ConditionItem.d.ts +17 -0
- package/features/condition-editor/components/ConditionOperatorSelect/ConditionOperatorSelect.d.ts +8 -0
- package/features/condition-editor/components/ConditionRow/ConditionRow.d.ts +14 -0
- package/features/condition-editor/components/ConditionSummary/ConditionSummary.d.ts +7 -0
- package/features/condition-editor/components/ConditionTargetSelect/ConditionTargetSelect.d.ts +14 -0
- package/features/condition-editor/components/ConditionValueInput/ConditionValueInput.d.ts +10 -0
- package/features/condition-editor/components/EditConditionForm/EditConditionForm.d.ts +13 -0
- package/features/condition-editor/components/ExistingCondition/ExistingCondition.d.ts +13 -0
- package/features/condition-editor/components/LogicalConnector/LogicalConnector.d.ts +8 -0
- package/features/condition-editor/components/LogicalOperatorToggle/LogicalOperatorToggle.d.ts +13 -0
- package/features/condition-editor/components/NewConditionBuilder/NewConditionBuilder.d.ts +10 -0
- package/features/condition-editor/components/NewConditionRow/NewConditionRow.d.ts +15 -0
- package/features/condition-editor/components/VisibilityConditionBuilder/VisibilityConditionBuilder.d.ts +17 -0
- package/features/condition-editor/components/hooks/useTargetComponents.d.ts +6 -0
- package/features/condition-editor/components/utils/conditionUtils.d.ts +7 -0
- package/features/condition-editor/components/visibilityHelpers.d.ts +21 -0
- package/features/condition-editor/index.d.ts +17 -0
- package/features/dialog-system/components/ConfirmDialog.d.ts +12 -0
- package/features/dialog-system/components/DialogEditor/DialogEditor.d.ts +12 -0
- package/features/dialog-system/components/ModalDialog/ModalDialog.d.ts +12 -0
- package/features/dialog-system/components/VerifyEmailDialog/VerifyEmailDialog.d.ts +10 -0
- package/features/dialog-system/index.d.ts +4 -0
- package/features/form-builder/components/actions/ActionsPanel/ActionsPanel.d.ts +3 -0
- package/features/form-builder/components/actions/SortableActionItem/SortableActionItem.d.ts +9 -0
- package/features/form-builder/components/actions/index.d.ts +4 -0
- package/features/form-builder/components/actions-menu/FormBuilderActionsMenu/FormBuilderActionsMenu.d.ts +1 -0
- package/features/form-builder/components/actions-menu/index.d.ts +3 -0
- package/features/form-builder/components/actions-menu/items/CreateTemplateMenuItem/CreateTemplateMenuItem.d.ts +2 -0
- package/features/form-builder/components/actions-menu/items/ExampleMenuItem/ExampleMenuItem.d.ts +2 -0
- package/features/form-builder/components/actions-menu/items/index.d.ts +2 -0
- package/features/form-builder/components/actions-menu/registry.d.ts +9 -0
- package/features/form-builder/components/actions-menu/types.d.ts +44 -0
- package/features/form-builder/components/buttons/PreviewButton/PreviewButton.d.ts +74 -0
- package/features/form-builder/components/buttons/SaveDropdownButton/SaveDropdownButton.d.ts +8 -0
- package/features/form-builder/components/buttons/index.d.ts +6 -0
- package/features/form-builder/components/canvas/AdminRenderCanvasItems/AdminRenderCanvasItems.d.ts +15 -0
- package/features/form-builder/components/canvas/Canvas/Canvas.d.ts +3 -0
- package/features/form-builder/components/canvas/CanvasComponent/CanvasComponent.d.ts +16 -0
- package/features/form-builder/components/canvas/SortableComponent/SortableComponent.d.ts +13 -0
- package/features/form-builder/components/canvas/index.d.ts +8 -0
- package/features/form-builder/components/components-panel/FormWizardComponentItem/FormWizardComponentItem.d.ts +7 -0
- package/features/form-builder/components/components-panel/FormWizardComponentsPanel/FormWizardComponentsPanel.d.ts +6 -0
- package/features/form-builder/components/components-panel/SortableComponentItem/SortableComponentItem.d.ts +20 -0
- package/features/form-builder/components/components-panel/index.d.ts +6 -0
- package/features/form-builder/components/core/AdminFormContent/AdminFormContent.d.ts +5 -0
- package/features/form-builder/components/core/FormBuilder/FormBuilder.d.ts +23 -0
- package/features/form-builder/components/core/index.d.ts +4 -0
- package/features/form-builder/components/editors/AdminPropertiesPanel/AdminPropertiesPanel.d.ts +3 -0
- package/features/form-builder/components/editors/ConditionsTab/ConditionsTab.d.ts +10 -0
- package/features/form-builder/components/editors/NavigationEditor/NavigationEditor.d.ts +13 -0
- package/features/form-builder/components/editors/NavigationSettings/NavigationSettings.d.ts +2 -0
- package/features/form-builder/components/editors/SectionConfigEditor/SectionConfigEditor.d.ts +8 -0
- package/features/form-builder/components/editors/index.d.ts +10 -0
- package/features/form-builder/components/fields/FieldValueButton/FieldValueButton.d.ts +7 -0
- package/features/form-builder/components/fields/FormFieldSelector/FormFieldSelector.d.ts +19 -0
- package/features/form-builder/components/fields/index.d.ts +4 -0
- package/features/form-builder/components/index.d.ts +13 -0
- package/features/form-builder/components/layout/FormFooter.d.ts +11 -0
- package/features/form-builder/components/layout/FormFooterBase.d.ts +15 -0
- package/features/form-builder/components/layout/FormHeader/FormHeader.d.ts +35 -0
- package/features/form-builder/components/layout/index.d.ts +6 -0
- package/features/form-builder/components/panels/RightPanel/RightPanel.d.ts +1 -0
- package/features/form-builder/components/panels/index.d.ts +1 -0
- package/features/form-builder/components/sections/AdminFormSection/AdminFormSection.d.ts +14 -0
- package/features/form-builder/components/sections/SectionContainer/SectionContainer.d.ts +13 -0
- package/features/form-builder/components/sections/index.d.ts +4 -0
- package/features/form-builder/components/steps/AdminStepSettings/AdminStepSettings.d.ts +7 -0
- package/features/form-builder/components/steps/SortableStepItem/SortableStepItem.d.ts +18 -0
- package/features/form-builder/components/steps/StepLockIndicator/StepLockIndicator.d.ts +18 -0
- package/features/form-builder/components/steps/StepsList/StepsList.d.ts +3 -0
- package/features/form-builder/components/steps/index.d.ts +8 -0
- package/features/form-builder/context/FormBuilderContext.d.ts +30 -0
- package/features/form-builder/context/ResolvedStepContext.d.ts +9 -0
- package/features/form-builder/hooks/useCurrentStep.d.ts +18 -0
- package/features/form-builder/hooks/useDragAndDrop.d.ts +16 -0
- package/features/form-builder/hooks/useDragFeedback.d.ts +32 -0
- package/features/form-builder/hooks/useHoldToDrag.d.ts +18 -0
- package/features/form-builder/hooks/usePreviewConfig.d.ts +23 -0
- package/features/form-builder/hooks/useSectionOperations.d.ts +7 -0
- package/features/form-builder/index.d.ts +10 -0
- package/features/form-builder/providers/DragAndDropProvider/DragAndDropProvider.d.ts +8 -0
- package/features/form-builder/utils/PropertyLockIndicator/PropertyLockIndicator.d.ts +30 -0
- package/features/form-builder/utils/bodyConversionUtils.d.ts +35 -0
- package/features/form-builder/utils/collisionDetection.d.ts +6 -0
- package/features/form-management/components/FormBuilderView/FormBuilderView.d.ts +17 -0
- package/features/form-management/components/FormExplorer/FormExplorer.d.ts +38 -0
- package/features/form-management/components/FormExplorerCore/FormExplorerCore.d.ts +67 -0
- package/features/form-management/components/FormManager/FormManager.d.ts +43 -0
- package/features/form-management/components/FormSectionList/FormSectionList.d.ts +1 -0
- package/features/form-management/components/FormsView/FormsView.d.ts +40 -0
- package/features/form-management/components/NewFormDialog/NewFormDialog.d.ts +25 -0
- package/features/form-management/components/NewProjectDialog/NewProjectDialog.d.ts +23 -0
- package/features/form-management/components/ProjectCard/ProjectCard.d.ts +9 -0
- package/features/form-management/components/ProjectsView/ProjectsView.d.ts +20 -0
- package/features/form-management/components/SearchInput/SearchInput.d.ts +9 -0
- package/features/form-management/components/ViewCard/ViewCard.d.ts +40 -0
- package/features/form-management/components/pages/FormBuilderPage.d.ts +3 -0
- package/features/form-management/components/pages/FormsPage.d.ts +3 -0
- package/features/form-management/components/pages/ProjectsPage.d.ts +16 -0
- package/features/form-management/components/pages/index.d.ts +13 -0
- package/features/form-management/hooks/index.d.ts +9 -0
- package/features/form-management/hooks/useFormActions.d.ts +20 -0
- package/features/form-management/hooks/useFormData.d.ts +13 -0
- package/features/form-management/hooks/useFormExplorerState.d.ts +26 -0
- package/features/form-management/hooks/useFormOperations.d.ts +17 -0
- package/features/form-management/hooks/useFormsQuery.d.ts +50 -0
- package/features/form-management/hooks/useProjectActions.d.ts +25 -0
- package/features/form-management/hooks/useProjectOperations.d.ts +10 -0
- package/features/form-management/hooks/useProjectsData.d.ts +13 -0
- package/features/form-management/index.d.ts +29 -0
- package/features/form-management/layout/BaseHeader/BaseHeader.d.ts +1 -0
- package/features/form-management/layout/BaseLayout/BaseLayout.d.ts +25 -0
- package/features/form-management/providers/QueryProvider.d.ts +8 -0
- package/features/form-management/types/viewTypes.d.ts +53 -0
- package/features/form-management/utils/configInitializer.d.ts +4 -0
- package/features/index.d.ts +9 -0
- package/features/property-editors/components/ComponentValidationEditor/ComponentValidationEditor.d.ts +12 -0
- package/features/property-editors/components/GenericPropertyEditor/GenericPropertyEditor.d.ts +13 -0
- package/features/property-editors/components/ProgressLoaderEditor/ProgressLoaderEditor.d.ts +12 -0
- package/features/property-editors/components/RadioGroupEditor/RadioGroupEditor.d.ts +3 -0
- package/features/property-editors/components/SelectEditor/SelectEditor.d.ts +3 -0
- package/features/property-editors/components/ValidationRuleEditor/ValidationRuleEditor.d.ts +23 -0
- package/features/property-editors/components/ValidationRuleListItem/ValidationRuleListItem.d.ts +9 -0
- package/features/property-editors/components/ValidationRuleSheet/ValidationRuleSheet.d.ts +14 -0
- package/features/property-editors/index.d.ts +5 -0
- package/features/property-editors/types/schema.d.ts +66 -0
- package/features/property-editors/types/types.d.ts +23 -0
- package/features/template-system/components/CreateTemplateDialog/CreateTemplateDialog.d.ts +17 -0
- package/features/template-system/components/DeleteTemplateDialog/DeleteTemplateDialog.d.ts +11 -0
- package/features/template-system/components/DuplicateTemplateDialog/DuplicateTemplateDialog.d.ts +11 -0
- package/features/template-system/components/EditTemplateDialog/EditTemplateDialog.d.ts +10 -0
- package/features/template-system/components/EnhancedTemplateBrowser/EnhancedTemplateBrowser.d.ts +11 -0
- package/features/template-system/components/TemplateContextMenu/TemplateContextMenu.d.ts +12 -0
- package/features/template-system/hooks/useTemplateGovernance.d.ts +46 -0
- package/features/template-system/hooks/useTemplatePermissions.d.ts +104 -0
- package/features/template-system/hooks/useTemplateStepTitle.d.ts +5 -0
- package/features/template-system/index.d.ts +17 -0
- package/features/template-system/services/TemplateStorageService.d.ts +52 -0
- package/features/template-system/utils/templateApplication.d.ts +75 -0
- package/features/template-system/utils/templateCategories.d.ts +105 -0
- package/features/template-system/utils/templateConfig.d.ts +148 -0
- package/features/template-system/utils/templateDeletion.d.ts +44 -0
- package/features/template-system/utils/templateDuplication.d.ts +65 -0
- package/features/template-system/utils/templateGovernance.d.ts +54 -0
- package/features/template-system/utils/templateLoader.d.ts +25 -0
- package/features/template-system/utils/templateMetadataOperations.d.ts +40 -0
- package/features/template-system/utils/templateUtils.d.ts +12 -0
- package/features/trigger-action-system/components/ActionConfigurationSheet/ActionConfigurationSheet.d.ts +9 -0
- package/features/trigger-action-system/components/ActionEditor/ActionEditor.d.ts +15 -0
- package/features/trigger-action-system/components/ActionsList/ActionsList.d.ts +8 -0
- package/features/trigger-action-system/components/ComponentTriggerActionEditor/ComponentTriggerActionEditor.d.ts +8 -0
- package/features/trigger-action-system/components/TriggerContextSelector/TriggerContextSelector.d.ts +9 -0
- package/features/trigger-action-system/index.d.ts +5 -0
- package/features/visual-mapping/components/ApiCallEditor/ApiCallEditor.d.ts +15 -0
- package/features/visual-mapping/components/ApiResponsePreview/ApiResponsePreview.d.ts +8 -0
- package/features/visual-mapping/components/ApiStructureTree/ApiStructureTree.d.ts +10 -0
- package/features/visual-mapping/components/CompactApiTestButton/CompactApiTestButton.d.ts +11 -0
- package/features/visual-mapping/components/ConnectionCircle/ConnectionCircle.d.ts +8 -0
- package/features/visual-mapping/components/ConnectionLines/ConnectionLines.d.ts +8 -0
- package/features/visual-mapping/components/CurrentMappingsDisplay/CurrentMappingsDisplay.d.ts +5 -0
- package/features/visual-mapping/components/EmptyFormFieldsMessage/EmptyFormFieldsMessage.d.ts +1 -0
- package/features/visual-mapping/components/FormFieldItem/FormFieldItem.d.ts +9 -0
- package/features/visual-mapping/components/FormFieldsList/FormFieldsList.d.ts +9 -0
- package/features/visual-mapping/components/KeyValueEditor/KeyValueEditor.d.ts +39 -0
- package/features/visual-mapping/components/MappingActionsDropdownMenu/MappingActionsDropdownMenu.d.ts +9 -0
- package/features/visual-mapping/components/MappingConnections/MappingConnections.d.ts +10 -0
- package/features/visual-mapping/components/RequestBodyEditor/RequestBodyEditor.d.ts +10 -0
- package/features/visual-mapping/components/SearchBar/SearchBar.d.ts +25 -0
- package/features/visual-mapping/components/VisualApiMappingInterface/VisualApiMappingInterface.d.ts +9 -0
- package/features/visual-mapping/components/index.d.ts +2 -0
- package/features/visual-mapping/components/typeCompatibility.d.ts +4 -0
- package/features/visual-mapping/components/utils/getFormFieldDataType.d.ts +2 -0
- package/features/visual-mapping/index.d.ts +18 -0
- package/features/visual-mapping/utils/apiBodyUtils.d.ts +1 -0
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +35 -0
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/integrations/NextJSIntegration.d.ts +23 -0
- package/integrations/ReactRouterIntegration.d.ts +16 -0
- package/integrations/index.d.ts +12 -0
- package/integrations/react-router/FormBuilderPage/FormBuilderPage.d.ts +23 -0
- package/integrations/react-router/FormsPage.d.ts +18 -0
- package/integrations/react-router/index.d.ts +11 -0
- package/package.json +1 -1
- package/providers/FormSaveContext.d.ts +20 -0
- package/providers/FormSaveProvider.d.ts +93 -0
- package/providers/ThemeProvider.d.ts +2 -0
- package/providers/index.d.ts +9 -0
- package/server.d.ts +8 -0
- package/storage/FilesystemStorageProvider.d.ts +19 -0
- package/storage/NullStorageProvider.d.ts +15 -0
- package/storage/PgLiteSyncProvider.d.ts +41 -0
- package/storage/StorageProviderFactory.d.ts +77 -0
- package/storage/ZeroConfigFilesystemStorageProvider.d.ts +157 -0
- package/storage/database-schemas.d.ts +17901 -0
- package/storage/database-types.d.ts +194 -0
- package/storage/index.d.ts +17 -0
- package/storage/types.d.ts +195 -0
- package/store/formBuilderStore.d.ts +287 -0
- package/store/index.d.ts +7 -0
- package/store/initialState/templates.d.ts +22 -0
- package/styles/index.d.ts +0 -0
- package/utils/configInitializer.d.ts +11 -0
- package/utils/configReader.d.ts +13 -0
- package/utils/fieldChangeValidation.d.ts +127 -0
- package/utils/fileStorage.d.ts +253 -0
- package/utils/formSaver.d.ts +22 -0
- package/utils/formsExplorer.d.ts +128 -0
- package/utils/index.d.ts +2 -0
- package/utils/routeUtils.d.ts +85 -0
- package/configReader-BkMPr3Ju.js.map +0 -1
- package/configReader-CbGTKRUP.cjs.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design System Adapter - Form Builder Exports
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports the core design system adapter from @formbuilder/design-system
|
|
5
|
+
* (packages/shared-ui) and adds form-builder-specific config/preset utilities.
|
|
6
|
+
*
|
|
7
|
+
* Core adapter (types, RHC components, wrappers) lives in shared-ui.
|
|
8
|
+
* Config/preset layer (depends on generated catalog + property editors) stays here.
|
|
9
|
+
*/
|
|
10
|
+
export * from '../../../ui/src/design-system/index.ts';
|
|
11
|
+
export * from './custom/index';
|
|
12
|
+
export * from './rhc/config/index';
|
|
13
|
+
export type { ComponentPropsConfig, CreatePropsConfigInput, PropDisabledConfig, PropEditorConfig, } from './rhc/utils/create-config';
|
|
14
|
+
export { createPropsConfig } from './rhc/utils/create-config';
|
|
15
|
+
export { generatePropertyEditorSchema } from './rhc/utils/generate-schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RHC Component Re-exports
|
|
3
|
+
*
|
|
4
|
+
* This is the ONLY file that should import directly from @rijkshuisstijl-community packages.
|
|
5
|
+
* All other parts of the application should import from @fb/design-system instead.
|
|
6
|
+
*
|
|
7
|
+
* This abstraction layer enables:
|
|
8
|
+
* - Single point of control for design system imports
|
|
9
|
+
* - Easy migration between design systems
|
|
10
|
+
* - Type-safe component sourcing
|
|
11
|
+
*/
|
|
12
|
+
export { Alert, Button, type ButtonProps, FormFieldCheckboxGroup, FormFieldCheckboxOption, FormFieldRadioGroup, FormFieldSelect, FormFieldTextarea, FormFieldTextInput, Heading, HeadingGroup, Paragraph, PreHeading, } from '@rijkshuisstijl-community/components-react';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for Button component
|
|
3
|
+
* Based on existing buttonPropertySchema from components/button.tsx
|
|
4
|
+
*
|
|
5
|
+
* Note: Button has non-standard property structure - "text" is in component-level schema,
|
|
6
|
+
* not in properties. This config focuses on button-specific props.
|
|
7
|
+
*/
|
|
8
|
+
export declare const buttonConfig: import('../utils/create-config').ComponentPropsConfig;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const ComponentConfigSchema: z.ZodObject<{
|
|
3
|
+
/** Component name - must exist in generated catalog */
|
|
4
|
+
component: z.ZodEnum<[string, ...string[]]>;
|
|
5
|
+
/** Display name shown in form builder UI */
|
|
6
|
+
displayName: z.ZodString;
|
|
7
|
+
/** Props to expose in the form builder property editor */
|
|
8
|
+
exposedProps: z.ZodArray<z.ZodString, "many">;
|
|
9
|
+
/** Props that are managed internally by the form builder (not shown in editor) */
|
|
10
|
+
internalProps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
displayName: string;
|
|
13
|
+
component: string;
|
|
14
|
+
exposedProps: string[];
|
|
15
|
+
internalProps: string[];
|
|
16
|
+
}, {
|
|
17
|
+
displayName: string;
|
|
18
|
+
component: string;
|
|
19
|
+
exposedProps: string[];
|
|
20
|
+
internalProps?: string[] | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const FormBuilderConfigSchema: z.ZodObject<{
|
|
23
|
+
/** Config version for tracking */
|
|
24
|
+
version: z.ZodString;
|
|
25
|
+
/** Components available in the form builder */
|
|
26
|
+
components: z.ZodArray<z.ZodObject<{
|
|
27
|
+
/** Component name - must exist in generated catalog */
|
|
28
|
+
component: z.ZodEnum<[string, ...string[]]>;
|
|
29
|
+
/** Display name shown in form builder UI */
|
|
30
|
+
displayName: z.ZodString;
|
|
31
|
+
/** Props to expose in the form builder property editor */
|
|
32
|
+
exposedProps: z.ZodArray<z.ZodString, "many">;
|
|
33
|
+
/** Props that are managed internally by the form builder (not shown in editor) */
|
|
34
|
+
internalProps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
displayName: string;
|
|
37
|
+
component: string;
|
|
38
|
+
exposedProps: string[];
|
|
39
|
+
internalProps: string[];
|
|
40
|
+
}, {
|
|
41
|
+
displayName: string;
|
|
42
|
+
component: string;
|
|
43
|
+
exposedProps: string[];
|
|
44
|
+
internalProps?: string[] | undefined;
|
|
45
|
+
}>, "many">;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
components: {
|
|
48
|
+
displayName: string;
|
|
49
|
+
component: string;
|
|
50
|
+
exposedProps: string[];
|
|
51
|
+
internalProps: string[];
|
|
52
|
+
}[];
|
|
53
|
+
version: string;
|
|
54
|
+
}, {
|
|
55
|
+
components: {
|
|
56
|
+
displayName: string;
|
|
57
|
+
component: string;
|
|
58
|
+
exposedProps: string[];
|
|
59
|
+
internalProps?: string[] | undefined;
|
|
60
|
+
}[];
|
|
61
|
+
version: string;
|
|
62
|
+
}>;
|
|
63
|
+
export type FormBuilderConfig = z.infer<typeof FormBuilderConfigSchema>;
|
|
64
|
+
export type FormBuilderComponentConfig = z.infer<typeof ComponentConfigSchema>;
|
|
65
|
+
/**
|
|
66
|
+
* Form builder configuration - defines which components and props
|
|
67
|
+
* are available in the form builder UI.
|
|
68
|
+
*
|
|
69
|
+
* This config cherry-picks a curated subset from the complete RHC catalog.
|
|
70
|
+
* All component and prop names are validated against the generated catalog
|
|
71
|
+
* at import time.
|
|
72
|
+
*/
|
|
73
|
+
declare const formBuilderConfig: FormBuilderConfig;
|
|
74
|
+
export { formBuilderConfig };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { alertConfig } from './alert.config';
|
|
2
|
+
export { buttonConfig } from './button.config';
|
|
3
|
+
export { checkboxConfig } from './checkbox.config';
|
|
4
|
+
export { headingConfig } from './heading.config';
|
|
5
|
+
export { paragraphConfig } from './paragraph.config';
|
|
6
|
+
export { radioGroupConfig } from './radio-group.config';
|
|
7
|
+
export { selectConfig } from './select.config';
|
|
8
|
+
export { textInputConfig } from './text-input.config';
|
|
9
|
+
export { textareaConfig } from './textarea.config';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for Paragraph component
|
|
3
|
+
* Based on existing paragraphPropertySchema from components/paragraph.tsx
|
|
4
|
+
*
|
|
5
|
+
* Note: RHC Paragraph uses "purpose" prop instead of "appearance".
|
|
6
|
+
* Purpose values: undefined (default), "lead", "intro", "notice"
|
|
7
|
+
*/
|
|
8
|
+
export declare const paragraphConfig: import('../utils/create-config').ComponentPropsConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ComponentConfig } from '../../../../../core/src/index.ts';
|
|
2
|
+
import { PropertyFieldType } from '../../../features/property-editors/types/schema';
|
|
3
|
+
import { RHC_CATALOG, RHCComponentProp } from '../../generated/rhc-catalog.generated';
|
|
4
|
+
export type RHCComponentName = keyof typeof RHC_CATALOG;
|
|
5
|
+
export interface SelectOption {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for an enabled property editor
|
|
12
|
+
*/
|
|
13
|
+
export interface PropEditorConfig {
|
|
14
|
+
enabled: true;
|
|
15
|
+
editorType: PropertyFieldType;
|
|
16
|
+
editorLabel: string;
|
|
17
|
+
tab: "general" | "validation" | "advanced" | "triggers" | "conditions" | "styling";
|
|
18
|
+
required?: boolean;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
options?: SelectOption[];
|
|
21
|
+
defaultValue?: unknown;
|
|
22
|
+
description?: string;
|
|
23
|
+
rows?: number;
|
|
24
|
+
condition?: (component: ComponentConfig) => boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for a disabled property (internal or not exposed)
|
|
28
|
+
*/
|
|
29
|
+
export interface PropDisabledConfig {
|
|
30
|
+
enabled: false;
|
|
31
|
+
internal?: boolean;
|
|
32
|
+
reason: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Union of enabled and disabled prop configs
|
|
36
|
+
*/
|
|
37
|
+
export type PropConfig = PropEditorConfig | PropDisabledConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Complete configuration for a component's props
|
|
40
|
+
*/
|
|
41
|
+
export interface ComponentPropsConfig {
|
|
42
|
+
component: RHCComponentName;
|
|
43
|
+
props: Record<string, PropConfig>;
|
|
44
|
+
catalogProps: readonly RHCComponentProp[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Input for createPropsConfig factory
|
|
48
|
+
*/
|
|
49
|
+
export interface CreatePropsConfigInput {
|
|
50
|
+
enabled: Record<string, Omit<PropEditorConfig, "enabled">>;
|
|
51
|
+
internal?: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Factory function to create component props configuration with automatic prop validation
|
|
55
|
+
*
|
|
56
|
+
* @param componentName - RHC component name (validated against catalog)
|
|
57
|
+
* @param input - Configuration specifying enabled and internal props
|
|
58
|
+
* @returns Complete ComponentPropsConfig with all catalog props accounted for
|
|
59
|
+
* @throws Error if component not found in catalog or if prop names don't exist in catalog
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const config = createPropsConfig("FormFieldTextInput", {
|
|
64
|
+
* enabled: {
|
|
65
|
+
* label: {
|
|
66
|
+
* editorType: "text",
|
|
67
|
+
* editorLabel: "Label",
|
|
68
|
+
* tab: "general",
|
|
69
|
+
* required: true
|
|
70
|
+
* }
|
|
71
|
+
* },
|
|
72
|
+
* internal: ["value", "onChange"]
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function createPropsConfig(componentName: RHCComponentName, input: CreatePropsConfigInput): ComponentPropsConfig;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropertyEditorSchema } from '../../../features/property-editors/types/schema';
|
|
2
|
+
import { ComponentPropsConfig } from './create-config';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a PropertyEditorSchema from a ComponentPropsConfig
|
|
5
|
+
*
|
|
6
|
+
* This function converts the factory-based config into the schema format expected by the admin UI.
|
|
7
|
+
* It maps enabled props to PropertyFieldSchema objects and adds standard component-level editors.
|
|
8
|
+
*
|
|
9
|
+
* @param config - Component props configuration created by createPropsConfig()
|
|
10
|
+
* @returns PropertyEditorSchema compatible with existing admin property panel
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const config = createPropsConfig("FormFieldTextInput", { ... });
|
|
15
|
+
* const schema = generatePropertyEditorSchema(config);
|
|
16
|
+
* // schema.properties.label = { type: "text", label: "Label", ... }
|
|
17
|
+
* // schema.component.validation = { type: "validationRules", ... }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function generatePropertyEditorSchema(config: ComponentPropsConfig): PropertyEditorSchema;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design System Adapter Types
|
|
3
|
+
*
|
|
4
|
+
* This module defines types for the design system adapter layer that abstracts
|
|
5
|
+
* the underlying design system implementation (RHC or custom components).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* ComponentSource identifies the origin of a component.
|
|
9
|
+
*
|
|
10
|
+
* - 'rhc': Component from Rijkshuisstijl Community design system
|
|
11
|
+
* - 'custom': Custom-built component or preset
|
|
12
|
+
*/
|
|
13
|
+
export type ComponentSource = "rhc" | "custom";
|
|
14
|
+
/**
|
|
15
|
+
* Adapter interface for design system components.
|
|
16
|
+
* Components from different sources (RHC, custom) implement this interface
|
|
17
|
+
* to provide a consistent API to the form builder.
|
|
18
|
+
*/
|
|
19
|
+
export interface DesignSystemAdapter {
|
|
20
|
+
source: ComponentSource;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
export interface ErrorBoundaryState {
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
error: Error | null;
|
|
5
|
+
errorInfo: ErrorInfo | null;
|
|
6
|
+
errorId: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ErrorBoundaryProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
fallbackComponent?: React.ComponentType<ErrorFallbackProps>;
|
|
11
|
+
onError?: (error: Error, errorInfo: ErrorInfo, errorId: string) => void;
|
|
12
|
+
level?: "app" | "feature" | "component";
|
|
13
|
+
context?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ErrorFallbackProps {
|
|
16
|
+
error: Error;
|
|
17
|
+
errorInfo: ErrorInfo;
|
|
18
|
+
resetError: () => void;
|
|
19
|
+
level: string;
|
|
20
|
+
context?: string;
|
|
21
|
+
errorId: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class BaseErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
24
|
+
constructor(props: ErrorBoundaryProps);
|
|
25
|
+
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
26
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
27
|
+
private logErrorToService;
|
|
28
|
+
private resetError;
|
|
29
|
+
render(): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
30
|
+
}
|
|
31
|
+
export default BaseErrorBoundary;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorFallbackProps } from '../BaseErrorBoundary/BaseErrorBoundary';
|
|
2
|
+
interface ComponentErrorBoundaryProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
componentName?: string;
|
|
5
|
+
fallback?: React.ComponentType<ErrorFallbackProps>;
|
|
6
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo, errorId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ComponentErrorBoundary: React.FC<ComponentErrorBoundaryProps>;
|
|
9
|
+
export default ComponentErrorBoundary;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface FlowBuilderErrorBoundaryProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
flowId?: string;
|
|
4
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo, errorId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const FlowBuilderErrorBoundary: React.FC<FlowBuilderErrorBoundaryProps>;
|
|
7
|
+
export default FlowBuilderErrorBoundary;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FlowBuilderErrorBoundary } from './FlowBuilderErrorBoundary/FlowBuilderErrorBoundary';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
export interface ConditionGroup {
|
|
3
|
+
id: string;
|
|
4
|
+
conditions: ComponentCondition[];
|
|
5
|
+
logicalOperator: "and" | "OR";
|
|
6
|
+
}
|
|
7
|
+
export interface ConditionEditorProps {
|
|
8
|
+
componentId: string;
|
|
9
|
+
conditions: ComponentCondition[];
|
|
10
|
+
availableFields: Array<{
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}>;
|
|
14
|
+
onUpdateConditions: (conditions: ComponentCondition[]) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const ConditionEditor: React.FC<ConditionEditorProps>;
|
|
17
|
+
export default ConditionEditor;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ConditionItemProps {
|
|
3
|
+
condition: Partial<ComponentCondition>;
|
|
4
|
+
availableTargets: any[];
|
|
5
|
+
targetOptions: any[];
|
|
6
|
+
isTargetRadio?: boolean;
|
|
7
|
+
needsValueInput: boolean;
|
|
8
|
+
onUpdate: (updates: Partial<ComponentCondition>) => void;
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
canRemove?: boolean;
|
|
11
|
+
label?: string;
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
isIncomplete?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const ConditionItem: React.FC<ConditionItemProps>;
|
|
17
|
+
export default ConditionItem;
|
package/features/condition-editor/components/ConditionOperatorSelect/ConditionOperatorSelect.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConditionOperator } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ConditionOperatorSelectProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onValueChange: (value: ConditionOperator) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const ConditionOperatorSelect: React.FC<ConditionOperatorSelectProps>;
|
|
8
|
+
export default ConditionOperatorSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentCondition, LogicalOperator } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ConditionRowProps {
|
|
3
|
+
condition: Partial<ComponentCondition>;
|
|
4
|
+
availableTargets: any[];
|
|
5
|
+
isFirst: boolean;
|
|
6
|
+
onUpdate: (updates: Partial<ComponentCondition>) => void;
|
|
7
|
+
onRemove: () => void;
|
|
8
|
+
logicalOperator: LogicalOperator;
|
|
9
|
+
onLogicalOperatorChange: (value: LogicalOperator) => void;
|
|
10
|
+
getTargetComponentOptions: (stepId: string, componentId: string) => any[];
|
|
11
|
+
isIncomplete?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const ConditionRow: React.FC<ConditionRowProps>;
|
|
14
|
+
export default ConditionRow;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ConditionSummaryProps {
|
|
3
|
+
conditions: ComponentCondition[];
|
|
4
|
+
areConditionsMet: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const ConditionSummary: React.FC<ConditionSummaryProps>;
|
|
7
|
+
export default ConditionSummary;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentConfig } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface TargetOption {
|
|
3
|
+
stepId: string;
|
|
4
|
+
stepTitle: string;
|
|
5
|
+
component: ComponentConfig;
|
|
6
|
+
}
|
|
7
|
+
interface ConditionTargetSelectProps {
|
|
8
|
+
value: string;
|
|
9
|
+
availableTargets: TargetOption[];
|
|
10
|
+
onTargetSelect: (stepId: string, componentId: string) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const ConditionTargetSelect: React.FC<ConditionTargetSelectProps>;
|
|
14
|
+
export default ConditionTargetSelect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ConditionValueInputProps {
|
|
3
|
+
condition: Partial<ComponentCondition>;
|
|
4
|
+
targetOptions: any[];
|
|
5
|
+
isTargetRadio: boolean;
|
|
6
|
+
onUpdate: (updates: Partial<ComponentCondition>) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ConditionValueInput: React.FC<ConditionValueInputProps>;
|
|
10
|
+
export default ConditionValueInput;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface EditConditionFormProps {
|
|
3
|
+
condition: Partial<ComponentCondition>;
|
|
4
|
+
availableTargets: any[];
|
|
5
|
+
targetOptions: any[];
|
|
6
|
+
isTargetRadio: boolean;
|
|
7
|
+
needsValueInput: boolean;
|
|
8
|
+
onUpdate: (updates: Partial<ComponentCondition>) => void;
|
|
9
|
+
onSave: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const EditConditionForm: React.FC<EditConditionFormProps>;
|
|
13
|
+
export default EditConditionForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentCondition, RadioOption } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface ExistingConditionProps {
|
|
3
|
+
condition: ComponentCondition;
|
|
4
|
+
targetStepTitle: string;
|
|
5
|
+
targetComponentLabel: string;
|
|
6
|
+
isTargetRadio: boolean;
|
|
7
|
+
targetOptions: RadioOption[];
|
|
8
|
+
onEdit: () => void;
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ExistingCondition: React.FC<ExistingConditionProps>;
|
|
13
|
+
export default ExistingCondition;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LogicalOperator } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface LogicalConnectorProps {
|
|
3
|
+
onSelect: (operator: LogicalOperator) => void;
|
|
4
|
+
onAddCondition: () => void;
|
|
5
|
+
selectedOperator: LogicalOperator;
|
|
6
|
+
}
|
|
7
|
+
declare const LogicalConnector: React.FC<LogicalConnectorProps>;
|
|
8
|
+
export default LogicalConnector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LogicalOperator } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface LogicalOperatorToggleProps {
|
|
3
|
+
value: LogicalOperator;
|
|
4
|
+
onValueChange: (value: LogicalOperator) => void;
|
|
5
|
+
id?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
showAddCondition?: boolean;
|
|
9
|
+
onAddCondition?: () => void;
|
|
10
|
+
isBetweenGroups?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const LogicalOperatorToggle: React.FC<LogicalOperatorToggleProps>;
|
|
13
|
+
export default LogicalOperatorToggle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface NewConditionBuilderProps {
|
|
3
|
+
availableTargets: any[];
|
|
4
|
+
getTargetComponent: (stepId?: string, componentId?: string) => any;
|
|
5
|
+
getTargetComponentOptions: (stepId: string, componentId: string) => any[];
|
|
6
|
+
onAddConditions: (conditions: ComponentCondition[]) => void;
|
|
7
|
+
initialConditions?: ComponentCondition[];
|
|
8
|
+
}
|
|
9
|
+
declare const NewConditionBuilder: React.FC<NewConditionBuilderProps>;
|
|
10
|
+
export default NewConditionBuilder;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentCondition, LogicalOperator } from '../../../../../../core/src/index.ts';
|
|
2
|
+
interface NewConditionRowProps {
|
|
3
|
+
condition: Partial<ComponentCondition>;
|
|
4
|
+
conditionIndex: number;
|
|
5
|
+
availableTargets: any[];
|
|
6
|
+
targetOptions: any[];
|
|
7
|
+
isTargetRadio: boolean;
|
|
8
|
+
needsValueInput: boolean;
|
|
9
|
+
logicalOperator: LogicalOperator;
|
|
10
|
+
onUpdateCondition: (index: number, updates: Partial<ComponentCondition>) => void;
|
|
11
|
+
onRemoveCondition: (index: number) => void;
|
|
12
|
+
onUpdateLogicalOperator: (value: LogicalOperator) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const NewConditionRow: React.FC<NewConditionRowProps>;
|
|
15
|
+
export default NewConditionRow;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentConfig, VisibilityConditionConfig } from '../../../../../../core/src/index.ts';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface AvailableField {
|
|
4
|
+
stepId: string;
|
|
5
|
+
stepTitle: string;
|
|
6
|
+
component: ComponentConfig;
|
|
7
|
+
fieldId: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
interface VisibilityConditionBuilderProps {
|
|
11
|
+
config: VisibilityConditionConfig | undefined;
|
|
12
|
+
onChange: (config: VisibilityConditionConfig | undefined) => void;
|
|
13
|
+
availableFields: AvailableField[];
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const VisibilityConditionBuilder: React.FC<VisibilityConditionBuilderProps>;
|
|
17
|
+
export default VisibilityConditionBuilder;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FormWizardStep } from '../../../../../../core/src/index.ts';
|
|
2
|
+
export declare const useTargetComponents: (steps: FormWizardStep[], currentStepId: string, currentComponentId: string) => {
|
|
3
|
+
availableTargets: any[];
|
|
4
|
+
getTargetComponent: (stepId?: string, componentId?: string) => any;
|
|
5
|
+
getTargetComponentOptions: (stepId: string, componentId: string) => any;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentCondition } from '../../../../../../core/src/index.ts';
|
|
2
|
+
export declare const needsValueInput: (operator: string) => boolean;
|
|
3
|
+
export declare const isAddConditionEnabled: (conditions: Partial<ComponentCondition>[]) => boolean;
|
|
4
|
+
export declare const getOptionLabel: (value: string, options: any[]) => string;
|
|
5
|
+
export declare const conditionIsComplete: (condition: Partial<ComponentCondition>) => boolean;
|
|
6
|
+
export declare const areAllConditionsComplete: (conditions: Partial<ComponentCondition>[]) => boolean;
|
|
7
|
+
export declare const isConditionFieldsRequired: (existingConditions: ComponentCondition[]) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentConfig, FormWizardConfig, VisibilityConditionConfig } from '../../../../../core/src/index.ts';
|
|
2
|
+
export interface AvailableField {
|
|
3
|
+
stepId: string;
|
|
4
|
+
stepTitle: string;
|
|
5
|
+
component: ComponentConfig;
|
|
6
|
+
fieldId: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Extracts all available fields from the form configuration that can be used in visibility conditions
|
|
11
|
+
* Excludes the current component to prevent self-reference
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAvailableFields(config: FormWizardConfig, currentStepId: string, currentComponentId: string): AvailableField[];
|
|
14
|
+
/**
|
|
15
|
+
* Validates a visibility condition configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateVisibilityCondition(config: VisibilityConditionConfig, availableFields: AvailableField[]): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Creates a default visibility condition configuration
|
|
20
|
+
*/
|
|
21
|
+
export declare function createDefaultVisibilityConfig(): VisibilityConditionConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './components/ConditionEditor/ConditionEditor';
|
|
2
|
+
export * from './components/ConditionItem/ConditionItem';
|
|
3
|
+
export * from './components/ConditionOperatorSelect/ConditionOperatorSelect';
|
|
4
|
+
export * from './components/ConditionRow/ConditionRow';
|
|
5
|
+
export * from './components/ConditionSummary/ConditionSummary';
|
|
6
|
+
export * from './components/ConditionTargetSelect/ConditionTargetSelect';
|
|
7
|
+
export * from './components/ConditionValueInput/ConditionValueInput';
|
|
8
|
+
export * from './components/EditConditionForm/EditConditionForm';
|
|
9
|
+
export * from './components/ExistingCondition/ExistingCondition';
|
|
10
|
+
export * from './components/hooks/useTargetComponents';
|
|
11
|
+
export * from './components/LogicalConnector/LogicalConnector';
|
|
12
|
+
export * from './components/LogicalOperatorToggle/LogicalOperatorToggle';
|
|
13
|
+
export * from './components/NewConditionBuilder/NewConditionBuilder';
|
|
14
|
+
export * from './components/NewConditionRow/NewConditionRow';
|
|
15
|
+
export * from './components/utils/conditionUtils';
|
|
16
|
+
export * from './components/VisibilityConditionBuilder/VisibilityConditionBuilder';
|
|
17
|
+
export * from './components/visibilityHelpers';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ConfirmDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
confirmText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
variant?: "default" | "destructive";
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ConfirmDialog: import('react').NamedExoticComponent<ConfirmDialogProps>;
|
|
12
|
+
export { ConfirmDialog };
|