@yourself.create/ngx-form-designer 0.0.3 → 0.0.5
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/fesm2022/uch-web-ngx-form-designer.mjs +4359 -1414
- package/fesm2022/uch-web-ngx-form-designer.mjs.map +1 -1
- package/lib/ai/provide-form-designer-angai-feature.d.ts +16 -0
- 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 -12
- package/lib/form-designer/designer-state.service.d.ts +34 -0
- package/lib/form-designer/dynamic-properties/dynamic-properties.component.d.ts +3 -5
- 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 +20 -1
- package/lib/form-designer/inspector-sections/inspector-backgrounds-section.component.d.ts +5 -0
- package/lib/form-designer/inspector-sections/inspector-transform-section.component.d.ts +12 -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 +13 -1
- package/lib/form-designer/properties-panel.component.d.ts +4 -0
- package/lib/form-designer/template-library.d.ts +2 -0
- 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 +34 -3
- package/lib/form-renderer/layout-node.component.d.ts +12 -1
- package/lib/ui/ui-color-swatch.component.d.ts +1 -0
- 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/widget-definition.d.ts +1 -1
- package/package.json +3 -2
- package/public-api.d.ts +4 -0
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
5
5
|
state: DesignerStateService;
|
|
6
6
|
private readonly destroyRef;
|
|
7
|
-
readonly previewMode: import("@angular/core").InputSignal<"
|
|
7
|
+
readonly previewMode: import("@angular/core").InputSignal<"route" | "overlay">;
|
|
8
8
|
readonly previewRequested: import("@angular/core").OutputEmitterRef<void>;
|
|
9
9
|
fileInput: ElementRef<HTMLInputElement>;
|
|
10
10
|
root: ElementRef<HTMLDivElement>;
|
|
@@ -16,9 +16,11 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
|
16
16
|
get device(): "mobile" | "desktop";
|
|
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>;
|
|
23
|
+
readonly openContextSubmenu: import("@angular/core").WritableSignal<"insert" | null>;
|
|
22
24
|
readonly liveSchemaEditorOptions: Record<string, unknown>;
|
|
23
25
|
private readonly pageBaseSize;
|
|
24
26
|
private readonly minZoom;
|
|
@@ -34,6 +36,15 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
|
34
36
|
closeContextMenu(): void;
|
|
35
37
|
groupSelected(): void;
|
|
36
38
|
ungroupSelected(): void;
|
|
39
|
+
hasStructuralInsertActions(): boolean;
|
|
40
|
+
toggleInsertSubmenu(): void;
|
|
41
|
+
insertColumnBeforeSelection(): void;
|
|
42
|
+
insertColumnAfterSelection(): void;
|
|
43
|
+
insertRowInSelectedColumn(): void;
|
|
44
|
+
insertRowBeforeSelection(): void;
|
|
45
|
+
insertRowAfterSelection(): void;
|
|
46
|
+
armFieldInsertBeforeSelection(): void;
|
|
47
|
+
armFieldInsertAfterSelection(): void;
|
|
37
48
|
onCanvasContextMenu(event: MouseEvent): void;
|
|
38
49
|
cut(): void;
|
|
39
50
|
copy(): void;
|
|
@@ -41,6 +52,7 @@ export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
|
41
52
|
deleteSelected(): void;
|
|
42
53
|
setBreakpoint(bp: any): void;
|
|
43
54
|
preview(): void;
|
|
55
|
+
toggleLayoutGuides(): void;
|
|
44
56
|
toggleLiveSchemaEditor(): void;
|
|
45
57
|
closeLiveSchemaEditor(): void;
|
|
46
58
|
onLiveSchemaEditorTextChange(nextText: string): void;
|
|
@@ -3,9 +3,12 @@ import { DesignerStateService } from './designer-state.service';
|
|
|
3
3
|
import { WidgetDefinition, DataBindingContract } from '../widgets/widget-definition';
|
|
4
4
|
import { WidgetNode, FieldSchema, FormRule, StyleTokenSet } from '../form-core/models';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
type LayoutInspectorTab = 'Style' | 'Settings';
|
|
6
7
|
export declare class PropertiesPanelComponent {
|
|
7
8
|
state: DesignerStateService;
|
|
8
9
|
private injector;
|
|
10
|
+
protected readonly layoutInspectorTabs: readonly LayoutInspectorTab[];
|
|
11
|
+
protected readonly activeLayoutInspectorTab: import("@angular/core").WritableSignal<LayoutInspectorTab>;
|
|
9
12
|
protected readonly spacingOptions: {
|
|
10
13
|
label: string;
|
|
11
14
|
value: string;
|
|
@@ -79,3 +82,4 @@ export declare class PropertiesPanelComponent {
|
|
|
79
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesPanelComponent, never>;
|
|
80
83
|
static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesPanelComponent, "app-properties-panel", never, {}, {}, never, never, true, never>;
|
|
81
84
|
}
|
|
85
|
+
export {};
|
|
@@ -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[];
|
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { DesignerEventApiDefinition, FormSchema, UploadedFileRef, WidgetEventApiExecutor } from '../../form-core/models';
|
|
2
|
+
import { DesignerEventApiDefinition, FieldDisplayLabel, FormSchema, UploadedFileRef, WidgetEventApiExecutor } from '../../form-core/models';
|
|
3
3
|
import { JsonFormRendererComponent, FormSubmitResult, FormValidationResult, FormValueMap, GroupedFormValues, CombinedFormValues } from '../json-form-renderer.component';
|
|
4
|
+
import { FormJourneyViewerComponent, type JourneyFormDataByPage } from '../form-journey-viewer.component';
|
|
4
5
|
import { type FieldDataAccessMap, type RuntimeFieldDataAccessApi } from '../../data/runtime-field-data-access-registry.service';
|
|
6
|
+
import type { FormJourneyProject } from '../../form-core/form-journey.models';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
export interface FormViewerOptions {
|
|
7
9
|
showSubmitButton?: boolean;
|
|
@@ -10,7 +12,8 @@ export interface FormViewerOptions {
|
|
|
10
12
|
}
|
|
11
13
|
export type FormViewerDataInput = Record<string, unknown> | FormValueMap | GroupedFormValues | CombinedFormValues | FormSubmitResult;
|
|
12
14
|
export declare class FormViewerComponent implements OnInit, OnDestroy {
|
|
13
|
-
schema
|
|
15
|
+
schema?: FormSchema;
|
|
16
|
+
journey?: FormJourneyProject | null;
|
|
14
17
|
set data(value: FormViewerDataInput);
|
|
15
18
|
get data(): FormViewerDataInput;
|
|
16
19
|
set dataUsesFieldNameKeys(value: boolean);
|
|
@@ -24,10 +27,13 @@ export declare class FormViewerComponent implements OnInit, OnDestroy {
|
|
|
24
27
|
formContentId?: string;
|
|
25
28
|
formContentVersion?: string;
|
|
26
29
|
formDataChange: EventEmitter<FormValueMap>;
|
|
30
|
+
formDataByPageChange: EventEmitter<JourneyFormDataByPage>;
|
|
27
31
|
formValidationChange: EventEmitter<FormValidationResult>;
|
|
28
32
|
uploadedFilesChange: EventEmitter<Record<string, UploadedFileRef[]>>;
|
|
29
33
|
submit: EventEmitter<FormSubmitResult>;
|
|
34
|
+
activePageIdChange: EventEmitter<string>;
|
|
30
35
|
renderer: JsonFormRendererComponent;
|
|
36
|
+
journeyViewer?: FormJourneyViewerComponent;
|
|
31
37
|
breakpoint: import("@angular/core").WritableSignal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
|
|
32
38
|
private el;
|
|
33
39
|
private zone;
|
|
@@ -36,18 +42,25 @@ export declare class FormViewerComponent implements OnInit, OnDestroy {
|
|
|
36
42
|
private _data;
|
|
37
43
|
private _dataUsesFieldNameKeys;
|
|
38
44
|
protected normalizedInitialValues: Record<string, unknown>;
|
|
45
|
+
protected normalizedInitialFieldLabels: Record<string, FieldDisplayLabel>;
|
|
39
46
|
ngOnInit(): void;
|
|
40
47
|
ngOnDestroy(): void;
|
|
41
48
|
private setupResizeObserver;
|
|
42
49
|
private updateBreakpoint;
|
|
43
50
|
onValueChange(values: FormValueMap): void;
|
|
44
51
|
onValidationChange(result: FormValidationResult): void;
|
|
52
|
+
onJourneyValueByPageChange(valuesByPage: JourneyFormDataByPage): void;
|
|
45
53
|
onUploadedFilesChange(result: Record<string, UploadedFileRef[]>): void;
|
|
46
54
|
triggerSubmit(): void;
|
|
47
55
|
onRendererSubmit(result: FormSubmitResult): void;
|
|
56
|
+
onActivePageIdChange(pageId: string): void;
|
|
57
|
+
hasJourney(): boolean;
|
|
58
|
+
resolvedSchema(): FormSchema | null;
|
|
48
59
|
private refreshNormalizedInitialValues;
|
|
49
60
|
private normalizeInitialValues;
|
|
61
|
+
private normalizeInitialFieldLabels;
|
|
50
62
|
private normalizeFieldNameKeyedValues;
|
|
63
|
+
private normalizeFieldNameKeyedLabels;
|
|
51
64
|
private collectOutputShapeFields;
|
|
52
65
|
private deserializeFieldValue;
|
|
53
66
|
private deserializeFieldNameKeyedFieldValue;
|
|
@@ -61,5 +74,5 @@ export declare class FormViewerComponent implements OnInit, OnDestroy {
|
|
|
61
74
|
private isFieldIdValue;
|
|
62
75
|
private isRecord;
|
|
63
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormViewerComponent, never>;
|
|
64
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormViewerComponent, "app-form-viewer", never, { "schema": { "alias": "schema"; "required":
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormViewerComponent, "app-form-viewer", never, { "schema": { "alias": "schema"; "required": false; }; "journey": { "alias": "journey"; "required": false; }; "data": { "alias": "data"; "required": false; }; "dataUsesFieldNameKeys": { "alias": "dataUsesFieldNameKeys"; "required": false; }; "options": { "alias": "options"; "required": false; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "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; }; }, { "formDataChange": "formDataChange"; "formDataByPageChange": "formDataByPageChange"; "formValidationChange": "formValidationChange"; "uploadedFilesChange": "uploadedFilesChange"; "submit": "submit"; "activePageIdChange": "activePageIdChange"; }, never, never, true, never>;
|
|
65
78
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnInit, OnChanges, SimpleChanges, EventEmitter, OnDestroy } from '@angular/core';
|
|
2
|
-
import { DesignerEventApiDefinition, FormSchema, UploadedFileRef, WidgetEventApiExecutor } from '../form-core/models';
|
|
2
|
+
import { DesignerEventApiDefinition, FieldDisplayLabel, FormSchema, UploadedFileRef, WidgetEventApiExecutor } from '../form-core/models';
|
|
3
3
|
import { FormEngine } from '../form-core/form-engine';
|
|
4
4
|
import { DesignerStateService } from '../form-designer/designer-state.service';
|
|
5
5
|
import { type FieldDataAccessMap, type RuntimeFieldDataAccessApi } from '../data/runtime-field-data-access-registry.service';
|
|
@@ -7,6 +7,7 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export interface FormFieldValue {
|
|
8
8
|
fieldName: string;
|
|
9
9
|
fieldValue: unknown;
|
|
10
|
+
fieldLabel?: FieldDisplayLabel;
|
|
10
11
|
fileType?: string | string[];
|
|
11
12
|
data?: string | string[];
|
|
12
13
|
}
|
|
@@ -16,6 +17,24 @@ export type CombinedFormValues = Record<string, FormFieldValue | FormValueMap>;
|
|
|
16
17
|
export interface FormValidationResult {
|
|
17
18
|
errors: Record<string, string[]>;
|
|
18
19
|
isValid: boolean;
|
|
20
|
+
fields?: Record<string, FormFieldValidationState>;
|
|
21
|
+
}
|
|
22
|
+
export interface FormFieldValidationState {
|
|
23
|
+
fieldId: string;
|
|
24
|
+
fieldName: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
visible: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
valid: boolean;
|
|
29
|
+
errors: string[];
|
|
30
|
+
validators: FormFieldValidatorState[];
|
|
31
|
+
}
|
|
32
|
+
export interface FormFieldValidatorState {
|
|
33
|
+
name: string;
|
|
34
|
+
source: 'required' | 'html5' | 'custom';
|
|
35
|
+
active: boolean;
|
|
36
|
+
value?: unknown;
|
|
37
|
+
message?: string;
|
|
19
38
|
}
|
|
20
39
|
export interface FormSubmitResult {
|
|
21
40
|
values: FormValueMap;
|
|
@@ -28,8 +47,10 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
|
|
|
28
47
|
private designerState;
|
|
29
48
|
schema: FormSchema;
|
|
30
49
|
initialValues: Record<string, any>;
|
|
50
|
+
initialFieldLabels: Record<string, FieldDisplayLabel>;
|
|
31
51
|
mode: 'live' | 'preview' | 'design';
|
|
32
52
|
device: 'desktop' | 'mobile';
|
|
53
|
+
showLayoutGuides: boolean;
|
|
33
54
|
breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
34
55
|
eventLogger?: {
|
|
35
56
|
log: (message: string, data?: unknown) => void;
|
|
@@ -37,6 +58,10 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
|
|
|
37
58
|
};
|
|
38
59
|
eventApis: DesignerEventApiDefinition[];
|
|
39
60
|
eventApiExecutor?: WidgetEventApiExecutor;
|
|
61
|
+
navigateToPage?: (pageId: string) => Promise<{
|
|
62
|
+
ok: boolean;
|
|
63
|
+
reason?: string;
|
|
64
|
+
}>;
|
|
40
65
|
uploadOnSubmit: boolean;
|
|
41
66
|
fieldDataAccessMap?: FieldDataAccessMap;
|
|
42
67
|
fieldDataAccessApi?: RuntimeFieldDataAccessApi;
|
|
@@ -72,7 +97,12 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
|
|
|
72
97
|
private inferDatasourceValueType;
|
|
73
98
|
onNodeSelect(nodeId: string): void;
|
|
74
99
|
onSubmit(event: Event): Promise<void>;
|
|
75
|
-
|
|
100
|
+
getValidationResult(revalidate?: boolean): FormValidationResult;
|
|
101
|
+
private buildFieldValidationState;
|
|
102
|
+
private describeFieldValidators;
|
|
103
|
+
private hasRequiredValidation;
|
|
104
|
+
private isValidationRuleActive;
|
|
105
|
+
private isValidationEmpty;
|
|
76
106
|
private uploadPendingFiles;
|
|
77
107
|
private uploadPendingFilesInSchema;
|
|
78
108
|
private getPendingFiles;
|
|
@@ -87,6 +117,7 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
|
|
|
87
117
|
private encodeBytesToBase64;
|
|
88
118
|
private toSingleOrList;
|
|
89
119
|
private getUploadedFileRefs;
|
|
120
|
+
private buildFieldLabelMetadata;
|
|
90
121
|
private mergeFileMetadata;
|
|
91
122
|
private buildGroupedValues;
|
|
92
123
|
private buildCombinedValues;
|
|
@@ -94,5 +125,5 @@ export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnD
|
|
|
94
125
|
private isGroupValue;
|
|
95
126
|
private isUploadedFileRef;
|
|
96
127
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormRendererComponent, never>;
|
|
97
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormRendererComponent, "app-json-form-renderer", never, { "schema": { "alias": "schema"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "device": { "alias": "device"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "eventLogger": { "alias": "eventLogger"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "uploadOnSubmit": { "alias": "uploadOnSubmit"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "valueChange": "valueChange"; "groupedValueChange": "groupedValueChange"; "combinedValueChange": "combinedValueChange"; "validationChange": "validationChange"; "uploadedFilesChange": "uploadedFilesChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
|
|
128
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormRendererComponent, "app-json-form-renderer", never, { "schema": { "alias": "schema"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "initialFieldLabels": { "alias": "initialFieldLabels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "device": { "alias": "device"; "required": false; }; "showLayoutGuides": { "alias": "showLayoutGuides"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "eventLogger": { "alias": "eventLogger"; "required": false; }; "eventApis": { "alias": "eventApis"; "required": false; }; "eventApiExecutor": { "alias": "eventApiExecutor"; "required": false; }; "navigateToPage": { "alias": "navigateToPage"; "required": false; }; "uploadOnSubmit": { "alias": "uploadOnSubmit"; "required": false; }; "fieldDataAccessMap": { "alias": "fieldDataAccessMap"; "required": false; }; "fieldDataAccessApi": { "alias": "fieldDataAccessApi"; "required": false; }; "formContentId": { "alias": "formContentId"; "required": false; }; "formContentVersion": { "alias": "formContentVersion"; "required": false; }; }, { "valueChange": "valueChange"; "groupedValueChange": "groupedValueChange"; "combinedValueChange": "combinedValueChange"; "validationChange": "validationChange"; "uploadedFilesChange": "uploadedFilesChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
|
|
98
129
|
}
|
|
@@ -15,6 +15,7 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
|
|
|
15
15
|
engine: FormEngine;
|
|
16
16
|
fields: FieldSchema[];
|
|
17
17
|
designMode: boolean;
|
|
18
|
+
showLayoutGuides: boolean;
|
|
18
19
|
readOnlyMode: boolean;
|
|
19
20
|
scopePath: string[];
|
|
20
21
|
device: 'desktop' | 'mobile';
|
|
@@ -49,6 +50,8 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
|
|
|
49
50
|
private static readonly MAX_COLUMN_SPAN;
|
|
50
51
|
constructor(_widgetDefs: WidgetDefinition[][], designerState: DesignerStateService, cdr: ChangeDetectorRef, el: ElementRef);
|
|
51
52
|
get isSelected(): boolean;
|
|
53
|
+
get isRowSelectionAncestor(): boolean;
|
|
54
|
+
get isColumnSelectionAncestor(): boolean;
|
|
52
55
|
get isResizing(): boolean;
|
|
53
56
|
protected isNodeSelected(nodeId: string): boolean;
|
|
54
57
|
onWidgetClick(e: Event): void;
|
|
@@ -64,6 +67,11 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
|
|
|
64
67
|
duplicateNode(): void;
|
|
65
68
|
insertRowInColumn(): void;
|
|
66
69
|
wrapWidgetInRow(): void;
|
|
70
|
+
decreaseSelectedColumnSpan(): void;
|
|
71
|
+
increaseSelectedColumnSpan(): void;
|
|
72
|
+
canDecreaseSelectedColumnSpan(): boolean;
|
|
73
|
+
canIncreaseSelectedColumnSpan(): boolean;
|
|
74
|
+
getSelectedColumnSpanLabel(): string;
|
|
67
75
|
getNodeTypeLabel(): string;
|
|
68
76
|
ngOnInit(): void;
|
|
69
77
|
ngOnDestroy(): void;
|
|
@@ -93,6 +101,9 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
|
|
|
93
101
|
asCol(node: LayoutNode): ColumnNode;
|
|
94
102
|
private applyVerticalResize;
|
|
95
103
|
private applyColumnResize;
|
|
104
|
+
private adjustSelectedColumnSpan;
|
|
105
|
+
private getSelectedColumnSpan;
|
|
106
|
+
private getSelectedColumnEntry;
|
|
96
107
|
getColClasses(node: LayoutNode): string;
|
|
97
108
|
getColContainerClasses(node: LayoutNode): string;
|
|
98
109
|
private getEffectiveSpan;
|
|
@@ -107,5 +118,5 @@ export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy
|
|
|
107
118
|
isRuleControlled(node: LayoutNode): boolean;
|
|
108
119
|
private getFieldForWidgetNode;
|
|
109
120
|
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutNodeComponent, never>;
|
|
110
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LayoutNodeComponent, "app-layout-node", never, { "node": { "alias": "node"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "designMode": { "alias": "designMode"; "required": false; }; "readOnlyMode": { "alias": "readOnlyMode"; "required": false; }; "scopePath": { "alias": "scopePath"; "required": false; }; "device": { "alias": "device"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "connectedDropLists": { "alias": "connectedDropLists"; "required": false; }; }, { "nodeDrop": "nodeDrop"; "nodeSelect": "nodeSelect"; }, never, never, true, never>;
|
|
121
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayoutNodeComponent, "app-layout-node", never, { "node": { "alias": "node"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "designMode": { "alias": "designMode"; "required": false; }; "showLayoutGuides": { "alias": "showLayoutGuides"; "required": false; }; "readOnlyMode": { "alias": "readOnlyMode"; "required": false; }; "scopePath": { "alias": "scopePath"; "required": false; }; "device": { "alias": "device"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "connectedDropLists": { "alias": "connectedDropLists"; "required": false; }; }, { "nodeDrop": "nodeDrop"; "nodeSelect": "nodeSelect"; }, never, never, true, never>;
|
|
111
122
|
}
|
|
@@ -7,6 +7,7 @@ export declare class UiColorSwatchComponent {
|
|
|
7
7
|
value: string;
|
|
8
8
|
valueChange: EventEmitter<string>;
|
|
9
9
|
blur: EventEmitter<void>;
|
|
10
|
+
onPickerChange(color: string): void;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiColorSwatchComponent, never>;
|
|
11
12
|
static ɵcmp: i0.ɵɵComponentDeclaration<UiColorSwatchComponent, "ui-color-swatch", never, { "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "helpText": { "alias": "helpText"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; "blur": "blur"; }, never, never, true, never>;
|
|
12
13
|
}
|
|
@@ -40,6 +40,11 @@ export declare class CheckboxGroupWidgetComponent implements OnInit, OnChanges,
|
|
|
40
40
|
onFocus(): void;
|
|
41
41
|
onClick(): void;
|
|
42
42
|
onBlur(): void;
|
|
43
|
+
private areApiCallsSuppressed;
|
|
44
|
+
private hasSelectedValue;
|
|
45
|
+
private withSelectedValueFallbackOptions;
|
|
46
|
+
private getStoredFieldLabel;
|
|
47
|
+
private setStoredFieldLabel;
|
|
43
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxGroupWidgetComponent, never>;
|
|
44
49
|
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxGroupWidgetComponent, "app-checkbox-group-widget", never, { "config": { "alias": "config"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
45
50
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FieldDisplayLabel, OptionSchema } from '../../form-core/models';
|
|
2
|
+
export declare function resolveOptionFieldLabel(value: unknown, options: OptionSchema[], existingLabel?: FieldDisplayLabel): FieldDisplayLabel | undefined;
|
|
3
|
+
export declare function buildFallbackOptions(value: unknown, label?: FieldDisplayLabel): OptionSchema[];
|
|
@@ -40,6 +40,11 @@ export declare class RadioWidgetComponent implements OnInit, OnChanges, OnDestro
|
|
|
40
40
|
onClick(): void;
|
|
41
41
|
onBlur(): void;
|
|
42
42
|
private syncEnabledState;
|
|
43
|
+
private areApiCallsSuppressed;
|
|
44
|
+
private hasSelectedValue;
|
|
45
|
+
private withSelectedValueFallbackOptions;
|
|
46
|
+
private getStoredFieldLabel;
|
|
47
|
+
private setStoredFieldLabel;
|
|
43
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<RadioWidgetComponent, never>;
|
|
44
49
|
static ɵcmp: i0.ɵɵComponentDeclaration<RadioWidgetComponent, "app-radio-widget", never, { "config": { "alias": "config"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
45
50
|
}
|
|
@@ -26,6 +26,7 @@ export declare class SearchWidgetComponent implements OnInit, OnDestroy {
|
|
|
26
26
|
private requestId;
|
|
27
27
|
private syncingFromQuery;
|
|
28
28
|
private selectingOption;
|
|
29
|
+
private pendingSelectedLabel?;
|
|
29
30
|
private focused;
|
|
30
31
|
private hovered;
|
|
31
32
|
private blurCloseTimeout;
|
|
@@ -67,6 +68,9 @@ export declare class SearchWidgetComponent implements OnInit, OnDestroy {
|
|
|
67
68
|
private getResultLimit;
|
|
68
69
|
private toSafeNonNegativeInt;
|
|
69
70
|
private asQueryString;
|
|
71
|
+
private getDisplayValue;
|
|
72
|
+
private getStoredFieldLabel;
|
|
73
|
+
private setStoredFieldLabel;
|
|
70
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchWidgetComponent, never>;
|
|
71
75
|
static ɵcmp: i0.ɵɵComponentDeclaration<SearchWidgetComponent, "app-search-widget", never, { "config": { "alias": "config"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
72
76
|
}
|
|
@@ -79,6 +79,15 @@ export declare class SelectWidgetComponent implements OnInit, OnDestroy {
|
|
|
79
79
|
private getAccessibleLabel;
|
|
80
80
|
private syncTemplateBindingCaches;
|
|
81
81
|
private toSafeNonNegativeInt;
|
|
82
|
+
private areApiCallsSuppressed;
|
|
83
|
+
private withSelectedValueFallbackOptions;
|
|
84
|
+
private getSelectedFallbackOptions;
|
|
85
|
+
private hasOptionValue;
|
|
86
|
+
private resolveSelectedValueForFallback;
|
|
87
|
+
private hasMeaningfulValue;
|
|
88
|
+
private syncStoredFieldLabel;
|
|
89
|
+
private getStoredFieldLabel;
|
|
90
|
+
private setStoredFieldLabel;
|
|
82
91
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectWidgetComponent, never>;
|
|
83
92
|
static ɵcmp: i0.ɵɵComponentDeclaration<SelectWidgetComponent, "app-select-widget", never, { "config": { "alias": "config"; "required": false; }; "engine": { "alias": "engine"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
84
93
|
}
|
|
@@ -22,6 +22,7 @@ export declare class TextFieldWidgetComponent implements OnInit, OnDestroy {
|
|
|
22
22
|
protected readonly fieldRequiredClass = "text-red-500";
|
|
23
23
|
get fieldId(): string;
|
|
24
24
|
protected isTextarea(): boolean;
|
|
25
|
+
protected isColorField(): boolean;
|
|
25
26
|
protected getControlClass(multiline?: boolean): string;
|
|
26
27
|
protected getAccessibleLabel(): string;
|
|
27
28
|
protected nativeLabel(): string;
|
|
@@ -35,6 +36,8 @@ export declare class TextFieldWidgetComponent implements OnInit, OnDestroy {
|
|
|
35
36
|
onBlur(): void;
|
|
36
37
|
onMouseEnter(): void;
|
|
37
38
|
onMouseLeave(): void;
|
|
39
|
+
protected getColorPickerValue(): string;
|
|
40
|
+
protected onColorPickerChange(color: string): void;
|
|
38
41
|
ngOnDestroy(): void;
|
|
39
42
|
getWrapperStyles(): Record<string, any>;
|
|
40
43
|
getControlStyles(): Record<string, any>;
|
|
@@ -8,7 +8,7 @@ export interface WidgetConfig {
|
|
|
8
8
|
required?: boolean;
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
}
|
|
11
|
-
export type PropertyFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'slide-toggle' | 'color' | 'color-swatch' | '
|
|
11
|
+
export type PropertyFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'slide-toggle' | 'color' | 'color-swatch' | 'padding' | 'margin' | 'shadow' | 'border' | 'options-editor' | 'validators-editor' | 'custom' | 'field-reference' | 'dimension' | 'edge-box' | 'box-model' | 'range-number' | 'select-icon';
|
|
12
12
|
export interface PropertyField {
|
|
13
13
|
key: string;
|
|
14
14
|
type: PropertyFieldType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yourself.create/ngx-form-designer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.0.0",
|
|
6
6
|
"@angular/core": "^19.0.0",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"react": "^18.2.0",
|
|
14
14
|
"react-dom": "^18.2.0",
|
|
15
15
|
"@babel/standalone": "^7.25.0",
|
|
16
|
-
"@json-editor/json-editor": "^2.15.2"
|
|
16
|
+
"@json-editor/json-editor": "^2.15.2",
|
|
17
|
+
"ngx-color-picker": "^20.1.1"
|
|
17
18
|
},
|
|
18
19
|
"peerDependenciesMeta": {
|
|
19
20
|
"react": {
|
package/public-api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './lib/form-core/models';
|
|
2
|
+
export * from './lib/form-core/form-journey.models';
|
|
2
3
|
export * from './lib/form-core/form-engine';
|
|
3
4
|
export * from './lib/form-core/schema-factory';
|
|
4
5
|
export * from './lib/form-core/schema-guard';
|
|
@@ -6,8 +7,10 @@ export * from './lib/form-renderer/json-form-renderer.component';
|
|
|
6
7
|
export * from './lib/form-renderer/layout-node.component';
|
|
7
8
|
export * from './lib/email-renderer/email-renderer.component';
|
|
8
9
|
export * from './lib/form-renderer/form-viewer/form-viewer.component';
|
|
10
|
+
export * from './lib/form-renderer/form-journey-viewer.component';
|
|
9
11
|
export * from './lib/form-designer/json-form-designer.component';
|
|
10
12
|
export * from './lib/form-designer/form-designer-shell.component';
|
|
13
|
+
export * from './lib/form-designer/form-journey-state.service';
|
|
11
14
|
export * from './lib/form-designer/events-workspace.component';
|
|
12
15
|
export * from './lib/form-designer/designer-state.service';
|
|
13
16
|
export * from './lib/form-designer/designer-context.service';
|
|
@@ -63,6 +66,7 @@ export * from './lib/widgets/style-helpers';
|
|
|
63
66
|
export * from './lib/widgets/widget-theme';
|
|
64
67
|
export * from './lib/ai/ai-tool-registry.service';
|
|
65
68
|
export * from './lib/ai/plugins/form-designer-tool-plugin';
|
|
69
|
+
export * from './lib/ai/provide-form-designer-angai-feature';
|
|
66
70
|
export * from './lib/data/data-catalog';
|
|
67
71
|
export * from './lib/data/data-provider';
|
|
68
72
|
export * from './lib/data/in-memory-data-catalog.service';
|