@yourself.create/ngx-form-designer 0.0.1 → 0.0.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/README.md +8 -8
- package/fesm2022/{notdefined-ngx-form-designer.mjs → uch-web-ngx-form-designer.mjs} +2867 -409
- package/fesm2022/uch-web-ngx-form-designer.mjs.map +1 -0
- package/index.d.ts +1 -1
- package/lib/ai/ai-tool-registry.service.d.ts +1 -1
- package/lib/ai/plugins/form-designer-tool-plugin.d.ts +1 -1
- package/lib/ai/provide-form-designer-angai-feature.d.ts +16 -0
- package/lib/ai/tools/designer-read-tools.d.ts +1 -1
- package/lib/ai/tools/designer-write-tools.d.ts +1 -1
- package/lib/ai/tools/schema-patch-tool.d.ts +1 -1
- package/lib/form-core/form-engine.d.ts +7 -3
- package/lib/form-core/form-event-runner.d.ts +14 -0
- package/lib/form-core/form-journey.models.d.ts +30 -0
- package/lib/form-core/models.d.ts +7 -1
- package/lib/form-designer/designer-state.service.d.ts +1 -1
- package/lib/form-designer/events-workspace.component.d.ts +28 -3
- package/lib/form-designer/form-designer-shell.component.d.ts +30 -5
- package/lib/form-designer/form-journey-state.service.d.ts +28 -0
- package/lib/form-designer/form-preview.component.d.ts +21 -2
- package/lib/form-designer/inspector-sections/inspector-backgrounds-section.component.d.ts +5 -0
- package/lib/form-designer/inspector-sections/inspector-typography-section.component.d.ts +1 -0
- package/lib/form-designer/json-form-designer.component.d.ts +21 -2
- package/lib/form-designer/layout-canvas.component.d.ts +4 -2
- package/lib/form-designer/template-library.d.ts +2 -0
- package/lib/form-designer/widget-inspector.component.d.ts +1 -1
- package/lib/form-renderer/form-journey-viewer.component.d.ts +51 -0
- package/lib/form-renderer/form-viewer/form-viewer.component.d.ts +16 -3
- package/lib/form-renderer/json-form-renderer.component.d.ts +10 -2
- package/lib/form-renderer/layout-node.component.d.ts +2 -1
- package/lib/ui/ui-color-swatch.component.d.ts +1 -0
- package/lib/website/website-designer-shell.component.d.ts +4 -4
- package/lib/website/website-preview-shell.component.d.ts +4 -4
- package/lib/widgets/field-widgets/checkbox-group/checkbox-group-widget.component.d.ts +5 -0
- package/lib/widgets/field-widgets/option-field-labels.d.ts +3 -0
- package/lib/widgets/field-widgets/radio/radio-widget.component.d.ts +5 -0
- package/lib/widgets/field-widgets/search/search-widget.component.d.ts +4 -0
- package/lib/widgets/field-widgets/select/select-widget.component.d.ts +9 -0
- package/lib/widgets/field-widgets/text-field/text-field.component.d.ts +3 -0
- package/lib/widgets/page-widgets/brick-settings.component.d.ts +1 -1
- package/package.json +6 -5
- package/public-api.d.ts +4 -0
- package/fesm2022/notdefined-ngx-form-designer.mjs.map +0 -1
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DesignerStateService } from '../form-designer/designer-state.service';
|
|
2
2
|
import { DesignerEventApiDefinition } from '../form-core/models';
|
|
3
3
|
import { WidgetDefinition } from '../widgets/widget-definition';
|
|
4
|
-
import type { AiToolRuntimeContext, AiToolPlugin, AiToolDescriptor, AiToolRegistry, AiToolResult } from '@
|
|
4
|
+
import type { AiToolRuntimeContext, AiToolPlugin, AiToolDescriptor, AiToolRegistry, AiToolResult } from '@uch-web/angai';
|
|
5
5
|
import { FormDesignerToolContext } from './plugins/form-designer-tool-plugin';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class AiToolRegistryService implements AiToolRegistry {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DesignerEventApiDefinition } from '../../form-core/models';
|
|
2
2
|
import type { DesignerStateService } from '../../form-designer/designer-state.service';
|
|
3
3
|
import type { WidgetDefinition } from '../../widgets/widget-definition';
|
|
4
|
-
import type { AiToolPlugin } from '@
|
|
4
|
+
import type { AiToolPlugin } from '@uch-web/angai';
|
|
5
5
|
export interface FormDesignerToolContext {
|
|
6
6
|
state: DesignerStateService;
|
|
7
7
|
eventApis: DesignerEventApiDefinition[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Provider } from '@angular/core';
|
|
2
|
+
import { type AiToolRuntimeContext } from '@uch-web/angai';
|
|
3
|
+
import type { DesignerEventApiDefinition } from '../form-core/models';
|
|
4
|
+
import { DesignerStateService } from '../form-designer/designer-state.service';
|
|
5
|
+
import { type FormDesignerToolContext } from './plugins/form-designer-tool-plugin';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class FormDesignerAiFeatureStateService {
|
|
8
|
+
private readonly widgetDefinitions;
|
|
9
|
+
private readonly eventApisSignal;
|
|
10
|
+
setEventApis(apis: DesignerEventApiDefinition[]): void;
|
|
11
|
+
createToolContext(state: DesignerStateService): FormDesignerToolContext;
|
|
12
|
+
createDiscoveryContext(state: DesignerStateService): AiToolRuntimeContext;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormDesignerAiFeatureStateService, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormDesignerAiFeatureStateService>;
|
|
15
|
+
}
|
|
16
|
+
export declare function provideFormDesignerAngaiFeature(): Provider[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DesignerStateService } from '../../form-designer/designer-state.service';
|
|
2
2
|
import { DesignerEventApiDefinition } from '../../form-core/models';
|
|
3
3
|
import type { WidgetDefinition } from '../../widgets/widget-definition';
|
|
4
|
-
import type { AiToolResult } from '@
|
|
4
|
+
import type { AiToolResult } from '@uch-web/angai';
|
|
5
5
|
export declare function getFormSummary(state: DesignerStateService): AiToolResult;
|
|
6
6
|
export declare function listFields(state: DesignerStateService): AiToolResult;
|
|
7
7
|
export declare function getFieldDetails(state: DesignerStateService, args: unknown): AiToolResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DesignerStateService } from '../../form-designer/designer-state.service';
|
|
2
2
|
import type { WidgetDefinition } from '../../widgets/widget-definition';
|
|
3
|
-
import type { AiToolResult } from '@
|
|
3
|
+
import type { AiToolResult } from '@uch-web/angai';
|
|
4
4
|
export declare function createFormFromIntent(state: DesignerStateService, args: unknown): Promise<AiToolResult>;
|
|
5
5
|
export declare function addField(state: DesignerStateService, args: unknown): Promise<AiToolResult>;
|
|
6
6
|
export declare function insertField(state: DesignerStateService, args: unknown): Promise<AiToolResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormSchema, WidgetEventType } from './models';
|
|
1
|
+
import { FieldDisplayLabel, FormSchema, WidgetEventType } from './models';
|
|
2
2
|
/**
|
|
3
3
|
* A framework-agnostic engine to handle form state, validation, and visibility logic.
|
|
4
4
|
*/
|
|
@@ -17,6 +17,7 @@ export interface DataSourceUpdateEvent {
|
|
|
17
17
|
export declare class FormEngine {
|
|
18
18
|
private schema;
|
|
19
19
|
private values;
|
|
20
|
+
private fieldLabels;
|
|
20
21
|
private errors;
|
|
21
22
|
private ruleEvaluator;
|
|
22
23
|
private valueSubject;
|
|
@@ -31,12 +32,15 @@ export declare class FormEngine {
|
|
|
31
32
|
value: Record<string, unknown>;
|
|
32
33
|
valueChanges: Observable<Record<string, unknown>>;
|
|
33
34
|
};
|
|
34
|
-
constructor(schema: FormSchema, initialValues?: Record<string, unknown>);
|
|
35
|
+
constructor(schema: FormSchema, initialValues?: Record<string, unknown>, initialFieldLabels?: Record<string, FieldDisplayLabel>);
|
|
35
36
|
getSchema(): FormSchema;
|
|
36
37
|
updateSchema(schema: FormSchema): void;
|
|
37
38
|
getValue(fieldName: string): unknown;
|
|
38
39
|
setValue(fieldName: string, value: unknown): void;
|
|
39
40
|
getValues(): Record<string, unknown>;
|
|
41
|
+
getFieldLabel(fieldName: string): FieldDisplayLabel | undefined;
|
|
42
|
+
getFieldLabels(): Record<string, FieldDisplayLabel>;
|
|
43
|
+
setFieldLabel(fieldName: string, label: FieldDisplayLabel | undefined): void;
|
|
40
44
|
getErrors(): Record<string, string[]>;
|
|
41
45
|
getError(fieldName: string): string | null;
|
|
42
46
|
emitUiEvent(event: Omit<UiEvent, 'ts'>): void;
|
|
@@ -53,4 +57,4 @@ export declare class FormEngine {
|
|
|
53
57
|
private evaluateEnterpriseRules;
|
|
54
58
|
private applyRuleAction;
|
|
55
59
|
}
|
|
56
|
-
export declare function createFormEngine(schema: FormSchema, initialValues?: Record<string, unknown>): FormEngine;
|
|
60
|
+
export declare function createFormEngine(schema: FormSchema, initialValues?: Record<string, unknown>, initialFieldLabels?: Record<string, FieldDisplayLabel>): FormEngine;
|
|
@@ -8,6 +8,10 @@ export interface FormEventRunnerOptions {
|
|
|
8
8
|
logger?: FormEventLogger;
|
|
9
9
|
apiExecutor?: WidgetEventApiExecutor;
|
|
10
10
|
dataSourceWriter?: WidgetEventDatasourceWriter;
|
|
11
|
+
navigateToPage?: (pageId: string) => Promise<{
|
|
12
|
+
ok: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
}>;
|
|
11
15
|
}
|
|
12
16
|
export declare class FormEventRunner {
|
|
13
17
|
private engine;
|
|
@@ -16,12 +20,22 @@ export declare class FormEventRunner {
|
|
|
16
20
|
private readonly logger;
|
|
17
21
|
private readonly apiExecutor?;
|
|
18
22
|
private readonly dataSourceWriter?;
|
|
23
|
+
private readonly navigateToPage?;
|
|
19
24
|
constructor(engine: FormEngine, loggerOrOptions?: FormEventLogger | FormEventRunnerOptions);
|
|
20
25
|
dispose(): void;
|
|
21
26
|
private handleEvent;
|
|
22
27
|
private executeAction;
|
|
23
28
|
private handleSetValue;
|
|
24
29
|
private handleApiAction;
|
|
30
|
+
private handleNavigateAction;
|
|
31
|
+
private evaluateNavigateCondition;
|
|
32
|
+
private evaluateLogicGroup;
|
|
33
|
+
private isLogicCondition;
|
|
34
|
+
private evaluateLogicCondition;
|
|
35
|
+
private compareValues;
|
|
36
|
+
private containsValue;
|
|
37
|
+
private isEmptyValue;
|
|
38
|
+
private getFieldValue;
|
|
25
39
|
private collectSourceValues;
|
|
26
40
|
private resolveDatasourceId;
|
|
27
41
|
private normalizeRowsForDatasource;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FormSchema } from './models';
|
|
2
|
+
export interface FormJourneyPage {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
route: string;
|
|
6
|
+
schema: FormSchema;
|
|
7
|
+
}
|
|
8
|
+
export interface FormJourneyProject {
|
|
9
|
+
id: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
pages: FormJourneyPage[];
|
|
12
|
+
startPageId: string;
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createFormJourneyPage(opts?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
route?: string;
|
|
19
|
+
schema?: FormSchema;
|
|
20
|
+
}): FormJourneyPage;
|
|
21
|
+
export declare function createFormJourneyProject(opts?: {
|
|
22
|
+
id?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
pages?: FormJourneyPage[];
|
|
25
|
+
startPageId?: string;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}): FormJourneyProject;
|
|
28
|
+
export declare function isFormJourneyProject(value: unknown): value is FormJourneyProject;
|
|
29
|
+
export declare function normalizeToJourney(value: FormSchema | FormJourneyProject): FormJourneyProject;
|
|
30
|
+
export declare function unwrapSinglePageJourney(value: FormJourneyProject): FormSchema | FormJourneyProject;
|
|
@@ -195,7 +195,12 @@ export interface WidgetEventActionApi {
|
|
|
195
195
|
inputTransformScript?: string;
|
|
196
196
|
outputTransformScript?: string;
|
|
197
197
|
}
|
|
198
|
-
export
|
|
198
|
+
export interface WidgetEventActionNavigate {
|
|
199
|
+
type: 'navigate';
|
|
200
|
+
targetPageId: string;
|
|
201
|
+
when?: LogicGroup;
|
|
202
|
+
}
|
|
203
|
+
export type WidgetEventAction = WidgetEventActionSetValue | WidgetEventActionLog | WidgetEventActionApi | WidgetEventActionNavigate;
|
|
199
204
|
export interface WidgetEventApiExecutionRequest {
|
|
200
205
|
eventId: string;
|
|
201
206
|
action: WidgetEventActionApi;
|
|
@@ -289,6 +294,7 @@ export interface OptionSchema {
|
|
|
289
294
|
label: string;
|
|
290
295
|
value: string | number;
|
|
291
296
|
}
|
|
297
|
+
export type FieldDisplayLabel = string | string[];
|
|
292
298
|
export interface DependencyRule {
|
|
293
299
|
effect: 'show' | 'hide' | 'enable' | 'disable' | 'require' | 'optional';
|
|
294
300
|
when: string;
|
|
@@ -61,7 +61,7 @@ export declare class DesignerStateService {
|
|
|
61
61
|
readonly activeBreakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
|
|
62
62
|
readonly isPreviewMode: import("@angular/core").WritableSignal<boolean>;
|
|
63
63
|
readonly isLeftPanelCollapsed: import("@angular/core").WritableSignal<boolean>;
|
|
64
|
-
readonly activeDevice: import("@angular/core").Signal<"
|
|
64
|
+
readonly activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
|
|
65
65
|
readonly activeThemeId: import("@angular/core").WritableSignal<string>;
|
|
66
66
|
readonly isReadOnly: import("@angular/core").WritableSignal<boolean>;
|
|
67
67
|
readonly clipboard: import("@angular/core").WritableSignal<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DesignerEventApiBrowser, DesignerEventApiDefinition, EventsWorkspaceSavePayload, FieldSchema, FormSchema, WidgetEventAction, WidgetEventActionApi, WidgetEventActionLog, WidgetEventActionSetValue, WidgetEventBinding, WidgetEventType } from '../form-core/models';
|
|
1
|
+
import { ConditionOperator, DesignerEventApiBrowser, DesignerEventApiDefinition, EventsWorkspaceSavePayload, FieldSchema, FormSchema, LogicGroup, WidgetEventAction, WidgetEventActionApi, WidgetEventActionLog, WidgetEventActionNavigate, WidgetEventActionSetValue, WidgetEventBinding, WidgetEventType } from '../form-core/models';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
type WorkspaceTab = 'fields' | 'input' | 'output';
|
|
4
4
|
interface WorkspaceFieldItem {
|
|
@@ -25,11 +25,16 @@ interface ApiSchemaState {
|
|
|
25
25
|
loading: boolean;
|
|
26
26
|
error: string | null;
|
|
27
27
|
}
|
|
28
|
+
interface WorkspacePageOption {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}
|
|
28
32
|
export declare class EventsWorkspaceComponent {
|
|
29
33
|
readonly schema: import("@angular/core").InputSignal<FormSchema>;
|
|
30
34
|
readonly readOnly: import("@angular/core").InputSignal<boolean>;
|
|
31
35
|
readonly eventApis: import("@angular/core").InputSignal<DesignerEventApiDefinition[]>;
|
|
32
36
|
readonly eventApiBrowser: import("@angular/core").InputSignal<DesignerEventApiBrowser | undefined>;
|
|
37
|
+
readonly pages: import("@angular/core").InputSignal<WorkspacePageOption[]>;
|
|
33
38
|
readonly schemaChange: import("@angular/core").OutputEmitterRef<FormSchema>;
|
|
34
39
|
readonly eventsSave: import("@angular/core").OutputEmitterRef<EventsWorkspaceSavePayload>;
|
|
35
40
|
readonly draftSchema: import("@angular/core").WritableSignal<FormSchema | null>;
|
|
@@ -45,6 +50,10 @@ export declare class EventsWorkspaceComponent {
|
|
|
45
50
|
label: string;
|
|
46
51
|
value: string;
|
|
47
52
|
}[];
|
|
53
|
+
readonly conditionOperatorOptions: Array<{
|
|
54
|
+
label: string;
|
|
55
|
+
value: ConditionOperator;
|
|
56
|
+
}>;
|
|
48
57
|
readonly currentSchema: import("@angular/core").Signal<FormSchema>;
|
|
49
58
|
readonly fields: import("@angular/core").Signal<WorkspaceFieldItem[]>;
|
|
50
59
|
readonly filteredFields: import("@angular/core").Signal<WorkspaceFieldItem[]>;
|
|
@@ -80,7 +89,7 @@ export declare class EventsWorkspaceComponent {
|
|
|
80
89
|
removeAction(bindingIndex: number, actionIndex: number): void;
|
|
81
90
|
setActionType(action: WidgetEventAction, type: WidgetEventAction['type']): void;
|
|
82
91
|
updateActionType(bindingIndex: number, actionIndex: number, type: WidgetEventAction['type']): void;
|
|
83
|
-
patchAction(bindingIndex: number, actionIndex: number, patch: Partial<WidgetEventActionSetValue> | Partial<WidgetEventActionLog> | Partial<WidgetEventActionApi>): void;
|
|
92
|
+
patchAction(bindingIndex: number, actionIndex: number, patch: Partial<WidgetEventActionSetValue> | Partial<WidgetEventActionLog> | Partial<WidgetEventActionApi> | Partial<WidgetEventActionNavigate>): void;
|
|
84
93
|
patchApiAction(action: WidgetEventAction, patch: Partial<WidgetEventActionApi>): void;
|
|
85
94
|
getSelectableActionFields(action: WidgetEventAction): WorkspaceFieldItem[];
|
|
86
95
|
actionFieldSearch(action: WidgetEventAction): string;
|
|
@@ -107,6 +116,19 @@ export declare class EventsWorkspaceComponent {
|
|
|
107
116
|
asSetValue(action: WidgetEventAction): WidgetEventActionSetValue;
|
|
108
117
|
asLog(action: WidgetEventAction): WidgetEventActionLog;
|
|
109
118
|
asApi(action: WidgetEventAction): WidgetEventActionApi;
|
|
119
|
+
asNavigate(action: WidgetEventAction): WidgetEventActionNavigate;
|
|
120
|
+
updateNavigateTarget(bindingIndex: number, actionIndex: number, targetPageId: string): void;
|
|
121
|
+
hasNavigateCondition(action: WidgetEventActionNavigate): boolean;
|
|
122
|
+
toggleNavigateCondition(bindingIndex: number, actionIndex: number, enabled: boolean): void;
|
|
123
|
+
updateNavigateConditionGroup(bindingIndex: number, actionIndex: number, group?: LogicGroup): void;
|
|
124
|
+
navigateConditionFieldId(action: WidgetEventActionNavigate): string;
|
|
125
|
+
navigateConditionOperator(action: WidgetEventActionNavigate): ConditionOperator;
|
|
126
|
+
navigateConditionValue(action: WidgetEventActionNavigate): string;
|
|
127
|
+
updateNavigateConditionField(bindingIndex: number, actionIndex: number, fieldId: string): void;
|
|
128
|
+
updateNavigateConditionOperator(bindingIndex: number, actionIndex: number, operator: ConditionOperator): void;
|
|
129
|
+
updateNavigateConditionValue(bindingIndex: number, actionIndex: number, value: string): void;
|
|
130
|
+
navigateOperatorNeedsValue(operator: ConditionOperator): boolean;
|
|
131
|
+
navigateConditionFields(): FieldSchema[];
|
|
110
132
|
trackFieldById(_: number, field: WorkspaceFieldItem): string;
|
|
111
133
|
trackBindingById(_: number, binding: WidgetEventBinding): string;
|
|
112
134
|
trackActionByIndex(index: number): number;
|
|
@@ -116,6 +138,9 @@ export declare class EventsWorkspaceComponent {
|
|
|
116
138
|
isEventExpanded(bindingId: string): boolean;
|
|
117
139
|
toggleEventExpansion(bindingId: string): void;
|
|
118
140
|
private getFieldsExcludingSelected;
|
|
141
|
+
private firstNavigateCondition;
|
|
142
|
+
private isLogicCondition;
|
|
143
|
+
private toNavigateLogicGroup;
|
|
119
144
|
private updateSelectedEvents;
|
|
120
145
|
private buildActionByType;
|
|
121
146
|
private flattenFields;
|
|
@@ -141,6 +166,6 @@ export declare class EventsWorkspaceComponent {
|
|
|
141
166
|
private clone;
|
|
142
167
|
private createEventDatasourceId;
|
|
143
168
|
static ɵfac: i0.ɵɵFactoryDeclaration<EventsWorkspaceComponent, never>;
|
|
144
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EventsWorkspaceComponent, "app-events-workspace", never, { "schema": { "alias": "schema"; "required": true; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "eventApis": { "alias": "eventApis"; "required": false; "isSignal": true; }; "eventApiBrowser": { "alias": "eventApiBrowser"; "required": false; "isSignal": true; }; }, { "schemaChange": "schemaChange"; "eventsSave": "eventsSave"; }, never, never, true, never>;
|
|
169
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EventsWorkspaceComponent, "app-events-workspace", never, { "schema": { "alias": "schema"; "required": true; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "eventApis": { "alias": "eventApis"; "required": false; "isSignal": true; }; "eventApiBrowser": { "alias": "eventApiBrowser"; "required": false; "isSignal": true; }; "pages": { "alias": "pages"; "required": false; "isSignal": true; }; }, { "schemaChange": "schemaChange"; "eventsSave": "eventsSave"; }, never, never, true, never>;
|
|
145
170
|
}
|
|
146
171
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { EventEmitter, SimpleChanges, OnChanges } from '@angular/core';
|
|
2
2
|
import { FormEngine } from '../form-core/form-engine';
|
|
3
3
|
import { FormSchema, DesignerEventApiBrowser, DesignerEventApiDefinition, DesignerFlavor, EventsWorkspaceSavePayload, WidgetEventApiExecutor } from '../form-core/models';
|
|
4
|
+
import type { FormJourneyProject } from '../form-core/form-journey.models';
|
|
4
5
|
import { DesignerStateService } from './designer-state.service';
|
|
5
6
|
import { DesignerTemplateDefinition } from './template-library';
|
|
6
7
|
import { ExternalDataSource } from '../data/external-data-source';
|
|
8
|
+
import { FormJourneyStateService } from './form-journey-state.service';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
export interface FormDesignerShellSchemaMetadata {
|
|
9
11
|
id?: string;
|
|
@@ -13,9 +15,11 @@ export interface FormDesignerShellSchemaMetadata {
|
|
|
13
15
|
}
|
|
14
16
|
export declare class FormDesignerShellComponent implements OnChanges {
|
|
15
17
|
protected readonly state: DesignerStateService;
|
|
18
|
+
protected readonly journeyState: FormJourneyStateService;
|
|
16
19
|
protected readonly aiAvailable: boolean;
|
|
17
|
-
private readonly
|
|
20
|
+
private readonly aiFeatureState;
|
|
18
21
|
schema?: FormSchema;
|
|
22
|
+
journey?: FormJourneyProject;
|
|
19
23
|
schemaMetadata?: FormDesignerShellSchemaMetadata;
|
|
20
24
|
flavor: DesignerFlavor;
|
|
21
25
|
flavors: DesignerFlavor[];
|
|
@@ -34,10 +38,13 @@ export declare class FormDesignerShellComponent implements OnChanges {
|
|
|
34
38
|
eventApiBrowser?: DesignerEventApiBrowser;
|
|
35
39
|
eventApiExecutor?: WidgetEventApiExecutor;
|
|
36
40
|
flavorChange: EventEmitter<DesignerFlavor>;
|
|
37
|
-
edit: EventEmitter<FormSchema>;
|
|
38
|
-
save: EventEmitter<FormSchema>;
|
|
39
|
-
push: EventEmitter<FormSchema>;
|
|
41
|
+
edit: EventEmitter<FormSchema | FormJourneyProject>;
|
|
42
|
+
save: EventEmitter<FormSchema | FormJourneyProject>;
|
|
43
|
+
push: EventEmitter<FormSchema | FormJourneyProject>;
|
|
40
44
|
eventsSave: EventEmitter<EventsWorkspaceSavePayload>;
|
|
45
|
+
saveDocument: EventEmitter<FormSchema | FormJourneyProject>;
|
|
46
|
+
pushDocument: EventEmitter<FormSchema | FormJourneyProject>;
|
|
47
|
+
editDocument: EventEmitter<FormSchema | FormJourneyProject>;
|
|
41
48
|
private catalog;
|
|
42
49
|
private managedSourceIds;
|
|
43
50
|
private managedEventSourceIds;
|
|
@@ -48,9 +55,17 @@ export declare class FormDesignerShellComponent implements OnChanges {
|
|
|
48
55
|
selectedTemplateId: string | null;
|
|
49
56
|
pendingTemplate: DesignerTemplateDefinition | null;
|
|
50
57
|
private lastSavedSchemaSnapshot;
|
|
58
|
+
readonly designerPages: import("@angular/core").Signal<{
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
route: string;
|
|
62
|
+
}[]>;
|
|
63
|
+
private readonly journeySyncEnabled;
|
|
64
|
+
private readonly schemaSync;
|
|
51
65
|
get engine(): FormEngine;
|
|
52
66
|
get filteredTemplates(): DesignerTemplateDefinition[];
|
|
53
67
|
get selectedTemplate(): DesignerTemplateDefinition | null;
|
|
68
|
+
constructor();
|
|
54
69
|
get resolvedHeaderLabel(): string;
|
|
55
70
|
ngOnChanges(changes: SimpleChanges): void;
|
|
56
71
|
private syncDataSources;
|
|
@@ -63,6 +78,11 @@ export declare class FormDesignerShellComponent implements OnChanges {
|
|
|
63
78
|
openEventsWorkspace(): void;
|
|
64
79
|
openAiWorkspace(): void;
|
|
65
80
|
closeAiWorkspace(): void;
|
|
81
|
+
addPage(): void;
|
|
82
|
+
selectPage(id: string): void;
|
|
83
|
+
removePage(id: string): void;
|
|
84
|
+
renamePage(id: string, name: string): void;
|
|
85
|
+
updatePageRoute(id: string, route: string): void;
|
|
66
86
|
onEventsSchemaChange(schema: FormSchema): void;
|
|
67
87
|
onEventsSave(payload: EventsWorkspaceSavePayload): void;
|
|
68
88
|
selectTemplate(template: DesignerTemplateDefinition): void;
|
|
@@ -78,10 +98,15 @@ export declare class FormDesignerShellComponent implements OnChanges {
|
|
|
78
98
|
private hasUnsavedChanges;
|
|
79
99
|
private serializeSchema;
|
|
80
100
|
private applyTemplate;
|
|
101
|
+
private parseTemplateJourney;
|
|
81
102
|
private syncTemplateSelection;
|
|
82
103
|
private createSchemaId;
|
|
104
|
+
private loadExternalDocument;
|
|
105
|
+
private loadActivePage;
|
|
106
|
+
private persistActivePage;
|
|
107
|
+
private getResolvedExternalDocument;
|
|
83
108
|
private getResolvedExternalSchema;
|
|
84
109
|
private applySchemaMetadata;
|
|
85
110
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormDesignerShellComponent, never>;
|
|
86
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormDesignerShellComponent, "app-form-designer-shell", never, { "schema": { "alias": "schema"; "required": false; }; "schemaMetadata": { "alias": "schemaMetadata"; "required": false; }; "flavor": { "alias": "flavor"; "required": false; }; "flavors": { "alias": "flavors"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; "headerLabel": { "alias": "headerLabel"; "required": false; }; "enableTemplateLibrary": { "alias": "enableTemplateLibrary"; "required": false; }; "enableGlobalDataManager": { "alias": "enableGlobalDataManager"; "required": false; }; "enableAiAssistant": { "alias": "enableAiAssistant"; "required": false; }; "showEditButton": { "alias": "showEditButton"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "showPushButton": { "alias": "showPushButton"; "required": false; }; "showEmailPreview": { "alias": "showEmailPreview"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "dataSources": { "alias": "dataSources"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiBrowser": { "alias": "eventApiBrowser"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; }, { "flavorChange": "flavorChange"; "edit": "edit"; "save": "save"; "push": "push"; "eventsSave": "eventsSave"; }, never, never, true, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormDesignerShellComponent, "app-form-designer-shell", never, { "schema": { "alias": "schema"; "required": false; }; "journey": { "alias": "journey"; "required": false; }; "schemaMetadata": { "alias": "schemaMetadata"; "required": false; }; "flavor": { "alias": "flavor"; "required": false; }; "flavors": { "alias": "flavors"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; "headerLabel": { "alias": "headerLabel"; "required": false; }; "enableTemplateLibrary": { "alias": "enableTemplateLibrary"; "required": false; }; "enableGlobalDataManager": { "alias": "enableGlobalDataManager"; "required": false; }; "enableAiAssistant": { "alias": "enableAiAssistant"; "required": false; }; "showEditButton": { "alias": "showEditButton"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "showPushButton": { "alias": "showPushButton"; "required": false; }; "showEmailPreview": { "alias": "showEmailPreview"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "dataSources": { "alias": "dataSources"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiBrowser": { "alias": "eventApiBrowser"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; }, { "flavorChange": "flavorChange"; "edit": "edit"; "save": "save"; "push": "push"; "eventsSave": "eventsSave"; "saveDocument": "saveDocument"; "pushDocument": "pushDocument"; "editDocument": "editDocument"; }, never, never, true, never>;
|
|
87
112
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormSchema } from '../form-core/models';
|
|
2
|
+
import type { FormJourneyPage, FormJourneyProject } from '../form-core/form-journey.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class FormJourneyStateService {
|
|
5
|
+
private readonly documentSignal;
|
|
6
|
+
private readonly sourceWasPlainSchema;
|
|
7
|
+
readonly document: import("@angular/core").Signal<FormJourneyProject>;
|
|
8
|
+
readonly pages: import("@angular/core").Signal<FormJourneyPage[]>;
|
|
9
|
+
readonly activePageId: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
readonly activePage: import("@angular/core").Signal<FormJourneyPage | null>;
|
|
11
|
+
readonly canRemovePage: import("@angular/core").Signal<boolean>;
|
|
12
|
+
readonly isJourneyMode: import("@angular/core").Signal<boolean>;
|
|
13
|
+
setDocument(input: FormSchema | FormJourneyProject): void;
|
|
14
|
+
setActivePage(id: string): void;
|
|
15
|
+
addPage(): FormJourneyPage;
|
|
16
|
+
removePage(id: string): void;
|
|
17
|
+
renamePage(id: string, name: string): void;
|
|
18
|
+
updateRoute(id: string, route: string): void;
|
|
19
|
+
updateActivePageSchema(schema: FormSchema): void;
|
|
20
|
+
updatePageSchema(id: string, schema: FormSchema): void;
|
|
21
|
+
compatibleOutput(): FormSchema | FormJourneyProject;
|
|
22
|
+
private isJourneyInput;
|
|
23
|
+
private nextPageName;
|
|
24
|
+
private ensureUniqueRoute;
|
|
25
|
+
private normalizeRoute;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormJourneyStateService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormJourneyStateService>;
|
|
28
|
+
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
1
2
|
import { DesignerStateService } from './designer-state.service';
|
|
2
3
|
import { type FieldDataAccessMap, type RuntimeFieldDataAccessApi } from '../data/runtime-field-data-access-registry.service';
|
|
3
4
|
import { DesignerEventApiDefinition, WidgetEventApiExecutor } from '../form-core/models';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
type PreviewPage = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
route: string;
|
|
10
|
+
};
|
|
5
11
|
export declare class FormPreviewComponent {
|
|
6
12
|
state: DesignerStateService;
|
|
7
13
|
eventApis: DesignerEventApiDefinition[];
|
|
@@ -10,13 +16,23 @@ export declare class FormPreviewComponent {
|
|
|
10
16
|
fieldDataAccessApi?: RuntimeFieldDataAccessApi;
|
|
11
17
|
formContentId?: string;
|
|
12
18
|
formContentVersion?: string;
|
|
19
|
+
pages: PreviewPage[];
|
|
20
|
+
activePageId: string | null;
|
|
21
|
+
pageSelect: EventEmitter<string>;
|
|
13
22
|
breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
14
23
|
breakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
|
|
15
|
-
activeDevice: import("@angular/core").Signal<"
|
|
24
|
+
activeDevice: import("@angular/core").Signal<"desktop" | "mobile">;
|
|
16
25
|
formData: any;
|
|
17
26
|
combinedFormData: any;
|
|
18
27
|
constructor(state: DesignerStateService);
|
|
19
28
|
setBreakpoint(bp: any): void;
|
|
29
|
+
hasJourneyPages(): boolean;
|
|
30
|
+
isPageActive(pageId: string): boolean;
|
|
31
|
+
requestPageSelect(pageId: string): void;
|
|
32
|
+
readonly navigateToPage: (pageId: string) => Promise<{
|
|
33
|
+
ok: boolean;
|
|
34
|
+
reason?: string;
|
|
35
|
+
}>;
|
|
20
36
|
getContainerWidth(): "100%" | "375px" | "576px" | "768px" | "992px" | "1200px" | "1400px";
|
|
21
37
|
getPageStyle(): Record<string, any>;
|
|
22
38
|
close(): void;
|
|
@@ -31,6 +47,9 @@ export declare class FormPreviewComponent {
|
|
|
31
47
|
private isBytePayload;
|
|
32
48
|
private isBase64Payload;
|
|
33
49
|
private isLikelyBase64;
|
|
50
|
+
trackPageById(_: number, page: PreviewPage): string;
|
|
51
|
+
private resolveActivePageId;
|
|
34
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormPreviewComponent, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormPreviewComponent, "app-form-preview", never, { "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, {}, never, never, true, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormPreviewComponent, "app-form-preview", never, { "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "activePageId": { "alias": "activePageId"; "required": false; }; }, { "pageSelect": "pageSelect"; }, never, never, true, never>;
|
|
36
54
|
}
|
|
55
|
+
export {};
|
|
@@ -15,8 +15,13 @@ export declare class InspectorBackgroundsSectionComponent {
|
|
|
15
15
|
value: string;
|
|
16
16
|
}[];
|
|
17
17
|
showImageUrl: boolean;
|
|
18
|
+
protected backgroundColorValue(): string;
|
|
18
19
|
getBackgroundPreview(): string;
|
|
20
|
+
protected onBackgroundPickerChange(value: string): void;
|
|
21
|
+
protected onBackgroundColorInputChange(value: string): void;
|
|
19
22
|
updateStyle(key: string, value: any): void;
|
|
23
|
+
private normalizeBackgroundColor;
|
|
24
|
+
private isTransparentColor;
|
|
20
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorBackgroundsSectionComponent, never>;
|
|
21
26
|
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorBackgroundsSectionComponent, "inspector-backgrounds-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
22
27
|
}
|
|
@@ -25,6 +25,7 @@ export declare class InspectorTypographySectionComponent {
|
|
|
25
25
|
isBoldActive(): boolean;
|
|
26
26
|
isItalicActive(): boolean;
|
|
27
27
|
isUnderlineActive(): boolean;
|
|
28
|
+
colorValue(): string;
|
|
28
29
|
updateStyle(key: string, value: any): void;
|
|
29
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorTypographySectionComponent, never>;
|
|
30
31
|
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorTypographySectionComponent, "inspector-typography-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
@@ -1,17 +1,36 @@
|
|
|
1
|
-
import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { DesignerStateService } from './designer-state.service';
|
|
3
3
|
import { DesignerEventApiDefinition, DesignerFlavor, WidgetEventApiExecutor } from '../form-core/models';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
type DesignerMode = 'edit' | 'view';
|
|
6
|
+
type DesignerPage = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
route: string;
|
|
10
|
+
};
|
|
6
11
|
export declare class JsonFormDesignerComponent implements OnInit, OnChanges {
|
|
7
12
|
flavor: DesignerFlavor;
|
|
8
13
|
mode: DesignerMode;
|
|
9
14
|
eventApis: DesignerEventApiDefinition[];
|
|
10
15
|
eventApiExecutor?: WidgetEventApiExecutor;
|
|
16
|
+
pages: DesignerPage[] | null;
|
|
17
|
+
activePageId: string | null;
|
|
18
|
+
canRemovePage: boolean;
|
|
19
|
+
readonly pageAdd: EventEmitter<void>;
|
|
20
|
+
readonly pageSelect: EventEmitter<string>;
|
|
21
|
+
readonly pageRemove: EventEmitter<string>;
|
|
22
|
+
readonly pageRename: EventEmitter<{
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
}>;
|
|
26
|
+
readonly pageRouteChange: EventEmitter<{
|
|
27
|
+
id: string;
|
|
28
|
+
route: string;
|
|
29
|
+
}>;
|
|
11
30
|
state: DesignerStateService;
|
|
12
31
|
ngOnInit(): void;
|
|
13
32
|
ngOnChanges(changes: SimpleChanges): void;
|
|
14
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormDesignerComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormDesignerComponent, "app-json-form-designer", never, { "flavor": { "alias": "flavor"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; }, {}, never, never, true, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormDesignerComponent, "app-json-form-designer", never, { "flavor": { "alias": "flavor"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "activePageId": { "alias": "activePageId"; "required": false; }; "canRemovePage": { "alias": "canRemovePage"; "required": false; }; }, { "pageAdd": "pageAdd"; "pageSelect": "pageSelect"; "pageRemove": "pageRemove"; "pageRename": "pageRename"; "pageRouteChange": "pageRouteChange"; }, never, never, true, never>;
|
|
16
35
|
}
|
|
17
36
|
export {};
|
|
@@ -12,10 +12,11 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
|
12
12
|
pageWrapper: ElementRef<HTMLDivElement>;
|
|
13
13
|
breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
14
14
|
constructor(state: DesignerStateService);
|
|
15
|
-
get schema(): import("@angular/core").WritableSignal<import("@
|
|
16
|
-
get device(): "
|
|
15
|
+
get schema(): import("@angular/core").WritableSignal<import("@uch-web/ngx-form-designer").FormSchema>;
|
|
16
|
+
get device(): "desktop" | "mobile";
|
|
17
17
|
get breakpoint(): "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
18
18
|
readonly zoom: import("@angular/core").WritableSignal<number>;
|
|
19
|
+
readonly showLayoutGuides: import("@angular/core").WritableSignal<boolean>;
|
|
19
20
|
readonly showLiveSchemaEditor: import("@angular/core").WritableSignal<boolean>;
|
|
20
21
|
readonly liveSchemaEditorText: import("@angular/core").WritableSignal<string>;
|
|
21
22
|
readonly liveSchemaEditorError: import("@angular/core").WritableSignal<string>;
|
|
@@ -41,6 +42,7 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
|
41
42
|
deleteSelected(): void;
|
|
42
43
|
setBreakpoint(bp: any): void;
|
|
43
44
|
preview(): void;
|
|
45
|
+
toggleLayoutGuides(): void;
|
|
44
46
|
toggleLiveSchemaEditor(): void;
|
|
45
47
|
closeLiveSchemaEditor(): void;
|
|
46
48
|
onLiveSchemaEditorTextChange(nextText: string): void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FormSchema } from '../form-core/models';
|
|
2
|
+
import type { FormJourneyProject } from '../form-core/form-journey.models';
|
|
2
3
|
export interface DesignerTemplateDefinition {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
description: string;
|
|
6
7
|
tags: readonly string[];
|
|
7
8
|
schema: FormSchema;
|
|
9
|
+
journey?: FormJourneyProject;
|
|
8
10
|
}
|
|
9
11
|
export declare const DEFAULT_TEMPLATE_LIBRARY: DesignerTemplateDefinition[];
|
|
@@ -18,7 +18,7 @@ export declare class WidgetInspectorComponent {
|
|
|
18
18
|
readonly inspectorField: import("@angular/core").Signal<FieldSchema>;
|
|
19
19
|
currentStyle: import("@angular/core").Signal<Partial<StyleTokenSet>>;
|
|
20
20
|
dataConsumer: import("@angular/core").Signal<"image" | "none" | "value" | "list">;
|
|
21
|
-
bindingShape: import("@angular/core").Signal<import("@
|
|
21
|
+
bindingShape: import("@angular/core").Signal<import("@uch-web/ngx-form-designer").DataShape | null>;
|
|
22
22
|
dataTargetPath: import("@angular/core").Signal<string>;
|
|
23
23
|
getWidgetIcon(): string;
|
|
24
24
|
onStyleChange(style: Partial<StyleTokenSet>): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EventEmitter, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { JsonFormRendererComponent, FormValidationResult, FormValueMap, FormSubmitResult } from './json-form-renderer.component';
|
|
3
|
+
import type { DesignerEventApiDefinition, FieldDisplayLabel, UploadedFileRef, WidgetEventApiExecutor } from '../form-core/models';
|
|
4
|
+
import type { FormJourneyProject } from '../form-core/form-journey.models';
|
|
5
|
+
import { type FieldDataAccessMap, type RuntimeFieldDataAccessApi } from '../data/runtime-field-data-access-registry.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export type JourneyFormDataByPage = Record<string, FormValueMap>;
|
|
8
|
+
export declare class FormJourneyViewerComponent {
|
|
9
|
+
journey: FormJourneyProject;
|
|
10
|
+
viewOnly: boolean;
|
|
11
|
+
eventApis: DesignerEventApiDefinition[];
|
|
12
|
+
eventApiExecutor?: WidgetEventApiExecutor;
|
|
13
|
+
initialValues?: Record<string, unknown>;
|
|
14
|
+
initialFieldLabels?: Record<string, FieldDisplayLabel>;
|
|
15
|
+
fieldDataAccessMap?: FieldDataAccessMap;
|
|
16
|
+
fieldDataAccessApi?: RuntimeFieldDataAccessApi;
|
|
17
|
+
formContentId?: string;
|
|
18
|
+
formContentVersion?: string;
|
|
19
|
+
formDataChange: EventEmitter<FormValueMap>;
|
|
20
|
+
formDataByPageChange: EventEmitter<JourneyFormDataByPage>;
|
|
21
|
+
formValidationChange: EventEmitter<FormValidationResult>;
|
|
22
|
+
uploadedFilesChange: EventEmitter<Record<string, UploadedFileRef[]>>;
|
|
23
|
+
submit: EventEmitter<FormSubmitResult>;
|
|
24
|
+
activePageIdChange: EventEmitter<string>;
|
|
25
|
+
renderer?: JsonFormRendererComponent;
|
|
26
|
+
readonly activePageId: import("@angular/core").WritableSignal<string>;
|
|
27
|
+
readonly values: import("@angular/core").WritableSignal<Record<string, unknown>>;
|
|
28
|
+
readonly fieldLabels: import("@angular/core").WritableSignal<Record<string, FieldDisplayLabel>>;
|
|
29
|
+
readonly activePage: import("@angular/core").Signal<import("@uch-web/ngx-form-designer").FormJourneyPage | null>;
|
|
30
|
+
readonly activePageIndex: import("@angular/core").Signal<number>;
|
|
31
|
+
ngOnInit(): void;
|
|
32
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
33
|
+
readonly navigateToPage: (pageId: string) => Promise<{
|
|
34
|
+
ok: boolean;
|
|
35
|
+
reason?: string;
|
|
36
|
+
}>;
|
|
37
|
+
onValueChange(values: FormValueMap): void;
|
|
38
|
+
onValidationChange(result: FormValidationResult): void;
|
|
39
|
+
onUploadedFilesChange(result: Record<string, UploadedFileRef[]>): void;
|
|
40
|
+
onSubmit(result: FormSubmitResult): void;
|
|
41
|
+
private normalizeInitialValues;
|
|
42
|
+
private normalizeInitialFieldLabels;
|
|
43
|
+
private toValueScope;
|
|
44
|
+
private toFieldLabelScope;
|
|
45
|
+
private mergeValueScope;
|
|
46
|
+
private mergeFieldLabelScope;
|
|
47
|
+
private toJourneyValueMapByPage;
|
|
48
|
+
private flattenJourneyValueMapByPage;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormJourneyViewerComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormJourneyViewerComponent, "app-form-journey-viewer", never, { "journey": { "alias": "journey"; "required": true; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
|
|
51
|
+
}
|