ngx-form-designer 0.0.6
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 +269 -0
- package/fesm2022/ngx-form-designer.mjs +26762 -0
- package/fesm2022/ngx-form-designer.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/data/data-catalog.d.ts +44 -0
- package/lib/data/data-provider.d.ts +58 -0
- package/lib/data/data-source-client.d.ts +59 -0
- package/lib/data/data-source-parsers.d.ts +5 -0
- package/lib/data/file-upload-client.d.ts +19 -0
- package/lib/data/http-data-source-client.d.ts +31 -0
- package/lib/data/in-memory-data-catalog.service.d.ts +12 -0
- package/lib/data/tree-utils.d.ts +28 -0
- package/lib/email-renderer/email-renderer.component.d.ts +21 -0
- package/lib/form-core/form-engine.d.ts +48 -0
- package/lib/form-core/form-event-runner.d.ts +15 -0
- package/lib/form-core/models.d.ts +255 -0
- package/lib/form-core/plugin-metadata.d.ts +10 -0
- package/lib/form-core/rule-evaluation.service.d.ts +18 -0
- package/lib/form-core/schema-factory.d.ts +11 -0
- package/lib/form-core/schema-guard.d.ts +18 -0
- package/lib/form-designer/data-panel/data-panel.component.d.ts +73 -0
- package/lib/form-designer/designer-context.service.d.ts +29 -0
- package/lib/form-designer/designer-state.service.d.ts +133 -0
- package/lib/form-designer/dynamic-properties/dynamic-properties.component.d.ts +89 -0
- package/lib/form-designer/events-panel/events-panel.component.d.ts +21 -0
- package/lib/form-designer/field-palette.component.d.ts +99 -0
- package/lib/form-designer/form-designer-shell.component.d.ts +46 -0
- package/lib/form-designer/form-preview.component.d.ts +21 -0
- package/lib/form-designer/form-settings-inspector.component.d.ts +14 -0
- package/lib/form-designer/global-data-manager.component.d.ts +32 -0
- package/lib/form-designer/inspector-sections/inspector-advanced-section.component.d.ts +17 -0
- package/lib/form-designer/inspector-sections/inspector-backgrounds-section.component.d.ts +14 -0
- package/lib/form-designer/inspector-sections/inspector-borders-section.component.d.ts +45 -0
- package/lib/form-designer/inspector-sections/inspector-effects-section.component.d.ts +22 -0
- package/lib/form-designer/inspector-sections/inspector-layout-section.component.d.ts +33 -0
- package/lib/form-designer/inspector-sections/inspector-position-section.component.d.ts +28 -0
- package/lib/form-designer/inspector-sections/inspector-size-section.component.d.ts +18 -0
- package/lib/form-designer/inspector-sections/inspector-spacing-section.component.d.ts +12 -0
- package/lib/form-designer/inspector-sections/inspector-typography-section.component.d.ts +21 -0
- package/lib/form-designer/json-form-designer.component.d.ts +12 -0
- package/lib/form-designer/layer-tree/layer-tree.component.d.ts +24 -0
- package/lib/form-designer/layout-canvas.component.d.ts +70 -0
- package/lib/form-designer/page-style.d.ts +2 -0
- package/lib/form-designer/properties-panel.component.d.ts +68 -0
- package/lib/form-designer/rules-editor/query-builder/query-builder.component.d.ts +23 -0
- package/lib/form-designer/rules-editor/rules-panel/rules-panel.component.d.ts +14 -0
- package/lib/form-designer/services/widget-definition-resolver.service.d.ts +38 -0
- package/lib/form-designer/template-library.d.ts +9 -0
- package/lib/form-designer/widget-inspector.component.d.ts +27 -0
- package/lib/form-renderer/json-form-renderer.component.d.ts +50 -0
- package/lib/form-renderer/layout-node.component.d.ts +85 -0
- package/lib/plugins/core-plugins.d.ts +5 -0
- package/lib/plugins/designer-plugin.d.ts +15 -0
- package/lib/plugins/plugin-context.d.ts +18 -0
- package/lib/plugins/plugin-providers.d.ts +3 -0
- package/lib/plugins/section-definition.d.ts +16 -0
- package/lib/theme/theme.service.d.ts +15 -0
- package/lib/ui/json-schema-editor.component.d.ts +27 -0
- package/lib/ui/monaco-editor.component.d.ts +24 -0
- package/lib/ui/ui-accordion.component.d.ts +11 -0
- package/lib/ui/ui-box-model.component.d.ts +55 -0
- package/lib/ui/ui-color-swatch.component.d.ts +12 -0
- package/lib/ui/ui-dimension.component.d.ts +21 -0
- package/lib/ui/ui-edge-box.component.d.ts +20 -0
- package/lib/ui/ui-field-wrapper.component.d.ts +8 -0
- package/lib/ui/ui-icon.module.d.ts +7 -0
- package/lib/ui/ui-input.component.d.ts +17 -0
- package/lib/ui/ui-range-number.component.d.ts +16 -0
- package/lib/ui/ui-select-icon.component.d.ts +18 -0
- package/lib/ui/ui-tabs.component.d.ts +25 -0
- package/lib/website/website-brick-studio.component.d.ts +67 -0
- package/lib/website/website-designer-shell.component.d.ts +53 -0
- package/lib/website/website-preview-shell.component.d.ts +25 -0
- package/lib/website/website-project.models.d.ts +78 -0
- package/lib/website/website-project.service.d.ts +50 -0
- package/lib/website/website-section-library.d.ts +6 -0
- package/lib/widgets/email-widgets/email-button-widget.component.d.ts +15 -0
- package/lib/widgets/email-widgets/email-heading-widget.component.d.ts +15 -0
- package/lib/widgets/email-widgets/email-text-widget.component.d.ts +13 -0
- package/lib/widgets/email-widgets.d.ts +2 -0
- package/lib/widgets/field-widgets/checkbox/checkbox-widget.component.d.ts +28 -0
- package/lib/widgets/field-widgets/checkbox-group/checkbox-group-widget.component.d.ts +40 -0
- package/lib/widgets/field-widgets/file-upload/file-upload-widget.component.d.ts +45 -0
- package/lib/widgets/field-widgets/radio/radio-widget.component.d.ts +39 -0
- package/lib/widgets/field-widgets/select/select-widget.component.d.ts +36 -0
- package/lib/widgets/field-widgets/text-field/text-field.component.d.ts +29 -0
- package/lib/widgets/field-widgets/tree-select/tree-select-widget.component.d.ts +47 -0
- package/lib/widgets/page-link-context.d.ts +8 -0
- package/lib/widgets/page-widgets/brick-settings.component.d.ts +23 -0
- package/lib/widgets/page-widgets/brick-widget.component.d.ts +47 -0
- package/lib/widgets/page-widgets/button-link-settings.component.d.ts +23 -0
- package/lib/widgets/page-widgets/button-widget.component.d.ts +21 -0
- package/lib/widgets/page-widgets/heading-widget.component.d.ts +22 -0
- package/lib/widgets/page-widgets/inline-quill-editor.component.d.ts +34 -0
- package/lib/widgets/page-widgets/table-inspector.component.d.ts +17 -0
- package/lib/widgets/page-widgets/table-widget.component.d.ts +35 -0
- package/lib/widgets/page-widgets/text-block-widget.component.d.ts +22 -0
- package/lib/widgets/page-widgets.d.ts +2 -0
- package/lib/widgets/static-widgets/image/image-widget.component.d.ts +18 -0
- package/lib/widgets/style-helpers.d.ts +8 -0
- package/lib/widgets/style-properties.d.ts +28 -0
- package/lib/widgets/style-sections.d.ts +1 -0
- package/lib/widgets/table-widget.d.ts +2 -0
- package/lib/widgets/widget-definition.d.ts +76 -0
- package/lib/widgets/widget-editor-context.d.ts +8 -0
- package/lib/widgets/widget-packs.d.ts +4 -0
- package/lib/widgets/widgets.d.ts +2 -0
- package/package.json +47 -0
- package/public-api.d.ts +68 -0
- package/tailwind.preset.js +51 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Effects section.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorEffectsSectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
readonly outlineOptions: {
|
|
10
|
+
value: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
}[];
|
|
13
|
+
readonly effectItems: {
|
|
14
|
+
label: string;
|
|
15
|
+
hasMore: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
parseOpacity(): number;
|
|
18
|
+
setOpacity(val: number): void;
|
|
19
|
+
updateStyle(key: string, value: any): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorEffectsSectionComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorEffectsSectionComponent, "inspector-effects-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Layout section with segmented controls.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorLayoutSectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
showMoreAlign: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
readonly displayOptions: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
readonly flexDirections: {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
}[];
|
|
19
|
+
readonly alignmentGrid: {
|
|
20
|
+
id: string;
|
|
21
|
+
align: string;
|
|
22
|
+
justify: string;
|
|
23
|
+
}[];
|
|
24
|
+
currentDisplay: import("@angular/core").Signal<any>;
|
|
25
|
+
setDisplay(value: string): void;
|
|
26
|
+
setAlignment(align: string, justify: string): void;
|
|
27
|
+
isAlignmentActive(align: string, justify: string): boolean;
|
|
28
|
+
toggleWrap(): void;
|
|
29
|
+
parseValue(val: string | number | undefined): number;
|
|
30
|
+
updateStyle(key: string, value: any): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorLayoutSectionComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorLayoutSectionComponent, "inspector-layout-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Position section.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorPositionSectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
showPositionDropdown: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
showFloatClear: import("@angular/core").WritableSignal<boolean>;
|
|
11
|
+
readonly positionOptions: {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
}[];
|
|
16
|
+
readonly floatOptions: {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
}[];
|
|
20
|
+
readonly clearOptions: {
|
|
21
|
+
value: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}[];
|
|
24
|
+
setPosition(value: string): void;
|
|
25
|
+
updateStyle(key: string, value: any): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorPositionSectionComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorPositionSectionComponent, "inspector-position-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Size section with grid layout.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorSizeSectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
showMore: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
readonly overflowOptions: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
}[];
|
|
15
|
+
updateStyle(key: string, value: any): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorSizeSectionComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorSizeSectionComponent, "inspector-size-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Spacing section with visual box model.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorSpacingSectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
updateStyle(key: string, value: any): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorSpacingSectionComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorSpacingSectionComponent, "inspector-spacing-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StyleTokenSet } from '../../form-core/models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Light theme Typography section.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InspectorTypographySectionComponent {
|
|
7
|
+
readonly style: import("@angular/core").InputSignal<Partial<StyleTokenSet>>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<Partial<StyleTokenSet>>;
|
|
9
|
+
showMore: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
readonly alignOptions: {
|
|
11
|
+
value: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
}[];
|
|
14
|
+
readonly decorOptions: {
|
|
15
|
+
value: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
}[];
|
|
18
|
+
updateStyle(key: string, value: any): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorTypographySectionComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InspectorTypographySectionComponent, "inspector-typography-section", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "styleChange": "styleChange"; }, never, never, true, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { DesignerStateService } from './designer-state.service';
|
|
3
|
+
import { DesignerFlavor } from '../form-core/models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class JsonFormDesignerComponent implements OnInit, OnChanges {
|
|
6
|
+
flavor: DesignerFlavor;
|
|
7
|
+
state: DesignerStateService;
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormDesignerComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormDesignerComponent, "app-json-form-designer", never, { "flavor": { "alias": "flavor"; "required": false; }; }, {}, never, never, true, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FormSchema, LayoutNode } from '../../form-core/models';
|
|
2
|
+
import { DesignerStateService } from '../designer-state.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class LayerTreeNodeComponent {
|
|
5
|
+
private designerState;
|
|
6
|
+
node: LayoutNode;
|
|
7
|
+
schema: FormSchema;
|
|
8
|
+
constructor(designerState: DesignerStateService);
|
|
9
|
+
get isSelected(): boolean;
|
|
10
|
+
selectNode(e: Event): void;
|
|
11
|
+
getIcon(): string;
|
|
12
|
+
getLabel(): string;
|
|
13
|
+
hasChildren(): boolean;
|
|
14
|
+
getChildren(): LayoutNode[];
|
|
15
|
+
shrinkId(id: string): string;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayerTreeNodeComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayerTreeNodeComponent, "app-layer-tree-node", never, { "node": { "alias": "node"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
19
|
+
export declare class LayerTreeComponent {
|
|
20
|
+
schema: FormSchema;
|
|
21
|
+
getRootNodes(): LayoutNode[];
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayerTreeComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayerTreeComponent, "app-layer-tree", never, { "schema": { "alias": "schema"; "required": false; }; }, {}, never, never, true, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
import { DesignerStateService } from './designer-state.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class LayoutCanvasComponent implements AfterViewInit {
|
|
5
|
+
state: DesignerStateService;
|
|
6
|
+
private readonly destroyRef;
|
|
7
|
+
readonly previewMode: import("@angular/core").InputSignal<"overlay" | "route">;
|
|
8
|
+
readonly previewRequested: import("@angular/core").OutputEmitterRef<void>;
|
|
9
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
10
|
+
root: ElementRef<HTMLDivElement>;
|
|
11
|
+
scrollContainer: ElementRef<HTMLDivElement>;
|
|
12
|
+
pageWrapper: ElementRef<HTMLDivElement>;
|
|
13
|
+
breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
14
|
+
constructor(state: DesignerStateService);
|
|
15
|
+
get schema(): import("@angular/core").WritableSignal<import("ngx-form-designer").FormSchema>;
|
|
16
|
+
get device(): "desktop" | "mobile";
|
|
17
|
+
get breakpoint(): "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
18
|
+
readonly zoom: import("@angular/core").WritableSignal<number>;
|
|
19
|
+
private readonly pageBaseSize;
|
|
20
|
+
private readonly minZoom;
|
|
21
|
+
private readonly maxZoom;
|
|
22
|
+
private wheelListener?;
|
|
23
|
+
private pendingScrollAdjust;
|
|
24
|
+
private resizeObserver?;
|
|
25
|
+
readonly pageLabel: import("@angular/core").Signal<string>;
|
|
26
|
+
readonly isWebFlavor: import("@angular/core").Signal<boolean>;
|
|
27
|
+
ngAfterViewInit(): void;
|
|
28
|
+
onEscape(): void;
|
|
29
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
30
|
+
deselect(): void;
|
|
31
|
+
closeContextMenu(): void;
|
|
32
|
+
groupSelected(): void;
|
|
33
|
+
ungroupSelected(): void;
|
|
34
|
+
onCanvasContextMenu(event: MouseEvent): void;
|
|
35
|
+
cut(): void;
|
|
36
|
+
copy(): void;
|
|
37
|
+
paste(): void;
|
|
38
|
+
deleteSelected(): void;
|
|
39
|
+
setBreakpoint(bp: any): void;
|
|
40
|
+
preview(): void;
|
|
41
|
+
getCanvasWidth(): "100%" | "375px" | "576px" | "768px" | "992px" | "1200px" | "1400px";
|
|
42
|
+
getCanvasHeight(): "667px" | "800px";
|
|
43
|
+
getPageStyle(): Record<string, any>;
|
|
44
|
+
pageTransform(): string;
|
|
45
|
+
zoomLabel(): string;
|
|
46
|
+
scaledPageWidth(): number;
|
|
47
|
+
scaledPageHeight(): number;
|
|
48
|
+
zoomIn(): void;
|
|
49
|
+
zoomOut(): void;
|
|
50
|
+
resetZoom(): void;
|
|
51
|
+
private clampZoom;
|
|
52
|
+
private updatePageBaseSize;
|
|
53
|
+
private isEditableTarget;
|
|
54
|
+
private getViewportCenter;
|
|
55
|
+
private setZoom;
|
|
56
|
+
private captureAnchor;
|
|
57
|
+
private restoreAnchor;
|
|
58
|
+
private getRenderedScale;
|
|
59
|
+
exportJson(): void;
|
|
60
|
+
importJson(): void;
|
|
61
|
+
onFileSelected(event: Event): void;
|
|
62
|
+
getNodePath(): {
|
|
63
|
+
id: string;
|
|
64
|
+
label: string;
|
|
65
|
+
type: string;
|
|
66
|
+
}[];
|
|
67
|
+
selectCrumb(nodeId: string): void;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutCanvasComponent, never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayoutCanvasComponent, "app-layout-canvas", never, { "previewMode": { "alias": "previewMode"; "required": false; "isSignal": true; }; }, { "previewRequested": "previewRequested"; }, never, never, true, never>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Injector, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { DesignerStateService } from './designer-state.service';
|
|
3
|
+
import { WidgetDefinition, DataBindingContract } from '../widgets/widget-definition';
|
|
4
|
+
import { WidgetNode, FieldSchema, FormRule, StyleTokenSet } from '../form-core/models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class PropertiesPanelComponent {
|
|
7
|
+
state: DesignerStateService;
|
|
8
|
+
private injector;
|
|
9
|
+
inspectorContainer: ViewContainerRef;
|
|
10
|
+
private widgetDefs;
|
|
11
|
+
constructor(state: DesignerStateService, _widgetDefs: WidgetDefinition[][], injector: Injector);
|
|
12
|
+
updateInspectorSettings(values: Record<string, any>): void;
|
|
13
|
+
updateInspectorStyle(values: Partial<StyleTokenSet>): void;
|
|
14
|
+
getWidgetLabel(node: any): string;
|
|
15
|
+
/**
|
|
16
|
+
* Accesses the style object of the LayoutNode itself.
|
|
17
|
+
* This affects the CONTAINER of the row/column/widget in the grid system.
|
|
18
|
+
* For widgets, this controls outer dimensions/positioning (flex item props).
|
|
19
|
+
*/
|
|
20
|
+
nodeStyle(node: any): any;
|
|
21
|
+
colResponsive(node: any): any;
|
|
22
|
+
/**
|
|
23
|
+
* Targeted style update - only updates the specific node in the tree.
|
|
24
|
+
* Preserves object references for unchanged nodes to avoid re-renders.
|
|
25
|
+
*/
|
|
26
|
+
onStyleChange(nodeId: string, key: string, value: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* Handle style changes from the widget inspector.
|
|
29
|
+
* The widget inspector emits { target: 'container' | 'widget', style: StyleTokenSet }
|
|
30
|
+
*/
|
|
31
|
+
onWidgetInspectorStyleChange(event: {
|
|
32
|
+
target: 'container' | 'widget';
|
|
33
|
+
style: Partial<StyleTokenSet>;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* Targeted responsive update - only updates the specific node in the tree.
|
|
37
|
+
*/
|
|
38
|
+
onResponsiveChange(nodeId: string, breakpoint: string, value: any): void;
|
|
39
|
+
/**
|
|
40
|
+
* Legacy method for backward compatibility with dynamic properties.
|
|
41
|
+
* TODO: Migrate dynamic properties to use targeted updates.
|
|
42
|
+
*/
|
|
43
|
+
refreshSchema(): void;
|
|
44
|
+
get pageStyle(): StyleTokenSet;
|
|
45
|
+
updatePageBoxModel(values: Partial<StyleTokenSet>): void;
|
|
46
|
+
updatePageStyleValue(key: keyof StyleTokenSet, value: any): void;
|
|
47
|
+
private updatePageStyle;
|
|
48
|
+
hasDynamicProperties(node: WidgetNode): boolean;
|
|
49
|
+
hasDynamicDataProperties(node: WidgetNode): boolean;
|
|
50
|
+
renderInspector(node: WidgetNode): void;
|
|
51
|
+
isBrickWidget(node: WidgetNode): boolean;
|
|
52
|
+
duplicateField(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Resolve a widget definition for the current field, preferring widgetId when present,
|
|
55
|
+
* otherwise falling back to kind/type for backward compatibility.
|
|
56
|
+
*/
|
|
57
|
+
private findDefinition;
|
|
58
|
+
deleteField(): void;
|
|
59
|
+
updateRules(rules: FormRule[]): void;
|
|
60
|
+
updateFieldConfig(field: FieldSchema): void;
|
|
61
|
+
getDataConsumer(node: WidgetNode): any;
|
|
62
|
+
getDataBinding(node: WidgetNode): DataBindingContract | null;
|
|
63
|
+
applyPreset(rowId: string, preset: number): void;
|
|
64
|
+
addColumn(rowId: string): void;
|
|
65
|
+
removeColumn(colId: string): void;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesPanelComponent, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesPanelComponent, "app-properties-panel", never, {}, {}, never, never, true, never>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { LogicGroup, LogicCondition } from '../../../form-core/models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class QueryBuilderComponent {
|
|
5
|
+
group: LogicGroup;
|
|
6
|
+
allFields: any[];
|
|
7
|
+
level: number;
|
|
8
|
+
groupChange: EventEmitter<LogicGroup>;
|
|
9
|
+
remove: EventEmitter<void>;
|
|
10
|
+
isCondition(item: any): boolean;
|
|
11
|
+
getAsCondition(item: any): LogicCondition;
|
|
12
|
+
getAsGroup(item: any): LogicGroup;
|
|
13
|
+
setOperator(op: 'AND' | 'OR'): void;
|
|
14
|
+
addCondition(): void;
|
|
15
|
+
addGroup(): void;
|
|
16
|
+
removeItem(index: number): void;
|
|
17
|
+
removeSelf(): void;
|
|
18
|
+
updateCondition(index: number, field: string, value: any): void;
|
|
19
|
+
onChildGroupChange(): void;
|
|
20
|
+
emitChange(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QueryBuilderComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QueryBuilderComponent, "app-query-builder", never, { "group": { "alias": "group"; "required": false; }; "allFields": { "alias": "allFields"; "required": false; }; "level": { "alias": "level"; "required": false; }; }, { "groupChange": "groupChange"; "remove": "remove"; }, never, never, true, never>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormRule } from '../../../form-core/models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RulesPanelComponent {
|
|
5
|
+
rules: FormRule[];
|
|
6
|
+
allFields: any[];
|
|
7
|
+
rulesChange: EventEmitter<FormRule[]>;
|
|
8
|
+
addRule(): void;
|
|
9
|
+
removeRule(index: number): void;
|
|
10
|
+
onChange(): void;
|
|
11
|
+
getActionColor(action: string): string;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RulesPanelComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RulesPanelComponent, "app-rules-panel", never, { "rules": { "alias": "rules"; "required": false; }; "allFields": { "alias": "allFields"; "required": false; }; }, { "rulesChange": "rulesChange"; }, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { WidgetDefinition, DataBindingContract } from '../../widgets/widget-definition';
|
|
2
|
+
import { FieldSchema, WidgetKind } from '../../form-core/models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Service responsible for resolving widget definitions.
|
|
6
|
+
* Handles lookup by widgetId (preferred) or by kind/type fallback for backward compatibility.
|
|
7
|
+
*/
|
|
8
|
+
export declare class WidgetDefinitionResolverService {
|
|
9
|
+
private readonly widgetDefs;
|
|
10
|
+
constructor(widgetDefs: WidgetDefinition[][]);
|
|
11
|
+
/**
|
|
12
|
+
* Finds a widget definition for the given field and widget kind.
|
|
13
|
+
* Prefers widgetId when present, falls back to kind/type matching.
|
|
14
|
+
*
|
|
15
|
+
* @param field - The field schema to find a definition for
|
|
16
|
+
* @param kind - The widget kind
|
|
17
|
+
* @returns The matching widget definition, or null if not found
|
|
18
|
+
*/
|
|
19
|
+
findDefinition(field: FieldSchema, kind: WidgetKind): WidgetDefinition | null;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the data consumer type for a field.
|
|
22
|
+
*
|
|
23
|
+
* @param field - The field schema
|
|
24
|
+
* @param kind - The widget kind
|
|
25
|
+
* @returns The data consumer type, or 'none' if not found
|
|
26
|
+
*/
|
|
27
|
+
getDataConsumer(field: FieldSchema, kind: WidgetKind): string;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the data binding contract for a field.
|
|
30
|
+
*
|
|
31
|
+
* @param field - The field schema
|
|
32
|
+
* @param kind - The widget kind
|
|
33
|
+
* @returns The data binding contract, or null if not found
|
|
34
|
+
*/
|
|
35
|
+
getDataBinding(field: FieldSchema, kind: WidgetKind): DataBindingContract | null;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetDefinitionResolverService, never>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WidgetDefinitionResolverService>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormSchema } from '../form-core/models';
|
|
2
|
+
export interface DesignerTemplateDefinition {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
tags: readonly string[];
|
|
7
|
+
schema: FormSchema;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_TEMPLATE_LIBRARY: DesignerTemplateDefinition[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WidgetNode, FieldSchema, StyleTokenSet, FormRule } from '../form-core/models';
|
|
2
|
+
import { DesignerStateService } from './designer-state.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class WidgetInspectorComponent {
|
|
5
|
+
readonly node: import("@angular/core").InputSignal<WidgetNode>;
|
|
6
|
+
readonly field: import("@angular/core").InputSignal<FieldSchema>;
|
|
7
|
+
readonly fieldChange: import("@angular/core").OutputEmitterRef<FieldSchema>;
|
|
8
|
+
readonly styleChange: import("@angular/core").OutputEmitterRef<{
|
|
9
|
+
target: "container" | "widget";
|
|
10
|
+
style: Partial<StyleTokenSet>;
|
|
11
|
+
}>;
|
|
12
|
+
readonly rulesChange: import("@angular/core").OutputEmitterRef<FormRule[]>;
|
|
13
|
+
readonly duplicate: import("@angular/core").OutputEmitterRef<void>;
|
|
14
|
+
readonly delete: import("@angular/core").OutputEmitterRef<void>;
|
|
15
|
+
protected readonly stateService: DesignerStateService;
|
|
16
|
+
private readonly widgetResolver;
|
|
17
|
+
readonly tabs: string[];
|
|
18
|
+
activeTab: import("@angular/core").WritableSignal<string>;
|
|
19
|
+
currentTarget: import("@angular/core").WritableSignal<"widget" | "container">;
|
|
20
|
+
currentStyle: import("@angular/core").Signal<StyleTokenSet>;
|
|
21
|
+
dataConsumer: import("@angular/core").Signal<"value" | "image" | "none" | "list">;
|
|
22
|
+
bindingShape: import("@angular/core").Signal<import("ngx-form-designer").DataShape | null>;
|
|
23
|
+
getWidgetIcon(): string;
|
|
24
|
+
onStyleChange(style: Partial<StyleTokenSet>): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetInspectorComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WidgetInspectorComponent, "widget-inspector", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; "field": { "alias": "field"; "required": true; "isSignal": true; }; }, { "fieldChange": "fieldChange"; "styleChange": "styleChange"; "rulesChange": "rulesChange"; "duplicate": "duplicate"; "delete": "delete"; }, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges, EventEmitter, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormSchema, UploadedFileRef } from '../form-core/models';
|
|
3
|
+
import { FormEngine } from '../form-core/form-engine';
|
|
4
|
+
import { DesignerStateService } from '../form-designer/designer-state.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export type GroupedFormValues = Record<string, Record<string, unknown>>;
|
|
7
|
+
export type CombinedFormValues = Record<string, unknown>;
|
|
8
|
+
export interface FormSubmitResult {
|
|
9
|
+
values: Record<string, unknown>;
|
|
10
|
+
groupedValues?: GroupedFormValues;
|
|
11
|
+
combinedValues?: CombinedFormValues;
|
|
12
|
+
uploadedFiles: Record<string, UploadedFileRef[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare class JsonFormRendererComponent implements OnInit, OnChanges, OnDestroy {
|
|
15
|
+
private designerState;
|
|
16
|
+
schema: FormSchema;
|
|
17
|
+
initialValues: Record<string, any>;
|
|
18
|
+
mode: 'live' | 'preview' | 'design';
|
|
19
|
+
device: 'desktop' | 'mobile';
|
|
20
|
+
breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
21
|
+
eventLogger?: {
|
|
22
|
+
log: (message: string, data?: unknown) => void;
|
|
23
|
+
warn: (message: string, data?: unknown) => void;
|
|
24
|
+
};
|
|
25
|
+
uploadOnSubmit: boolean;
|
|
26
|
+
valueChange: EventEmitter<any>;
|
|
27
|
+
groupedValueChange: EventEmitter<GroupedFormValues>;
|
|
28
|
+
combinedValueChange: EventEmitter<CombinedFormValues>;
|
|
29
|
+
formSubmit: EventEmitter<FormSubmitResult>;
|
|
30
|
+
engine: FormEngine;
|
|
31
|
+
private runner?;
|
|
32
|
+
private readonly uploadClient;
|
|
33
|
+
constructor(designerState: DesignerStateService);
|
|
34
|
+
ngOnInit(): void;
|
|
35
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
36
|
+
ngOnDestroy(): void;
|
|
37
|
+
private createEngine;
|
|
38
|
+
private disposeRunner;
|
|
39
|
+
onNodeSelect(nodeId: string): void;
|
|
40
|
+
onSubmit(event: Event): Promise<void>;
|
|
41
|
+
private uploadPendingFiles;
|
|
42
|
+
private getPendingFiles;
|
|
43
|
+
private isFile;
|
|
44
|
+
private isFileList;
|
|
45
|
+
private buildGroupedValues;
|
|
46
|
+
private buildCombinedValues;
|
|
47
|
+
private isGroupValue;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormRendererComponent, never>;
|
|
49
|
+
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; }; "uploadOnSubmit": { "alias": "uploadOnSubmit"; "required": false; }; }, { "valueChange": "valueChange"; "groupedValueChange": "groupedValueChange"; "combinedValueChange": "combinedValueChange"; "formSubmit": "formSubmit"; }, never, never, true, never>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ViewContainerRef, OnInit, OnChanges, SimpleChanges, EventEmitter, ChangeDetectorRef, ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { LayoutNode, ColumnNode, RowNode, FieldSchema } from '../form-core/models';
|
|
3
|
+
import { WidgetDefinition } from '../widgets/widget-definition';
|
|
4
|
+
import { FormEngine } from '../form-core/form-engine';
|
|
5
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
6
|
+
import { DesignerStateService } from '../form-designer/designer-state.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class LayoutNodeComponent implements OnInit, OnChanges, OnDestroy {
|
|
9
|
+
private _widgetDefs;
|
|
10
|
+
private designerState;
|
|
11
|
+
private cdr;
|
|
12
|
+
private el;
|
|
13
|
+
node: LayoutNode;
|
|
14
|
+
engine: FormEngine;
|
|
15
|
+
fields: FieldSchema[];
|
|
16
|
+
designMode: boolean;
|
|
17
|
+
device: 'desktop' | 'mobile';
|
|
18
|
+
breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
19
|
+
nodeDrop: EventEmitter<CdkDragDrop<any, any, any>>;
|
|
20
|
+
nodeSelect: EventEmitter<string>;
|
|
21
|
+
widgetContainer: ViewContainerRef;
|
|
22
|
+
connectedDropLists: string[];
|
|
23
|
+
private readonly allWidgetDefs;
|
|
24
|
+
private widgetDefs;
|
|
25
|
+
private widgetComponentRef?;
|
|
26
|
+
private widgetDefId?;
|
|
27
|
+
private widgetControl?;
|
|
28
|
+
private widgetControlName?;
|
|
29
|
+
private designEngineProxy?;
|
|
30
|
+
private designEngineSource?;
|
|
31
|
+
private resizeStartX;
|
|
32
|
+
private resizeStartSpan;
|
|
33
|
+
private readonly destroyRef;
|
|
34
|
+
constructor(_widgetDefs: WidgetDefinition[][], designerState: DesignerStateService, cdr: ChangeDetectorRef, el: ElementRef);
|
|
35
|
+
get isSelected(): boolean;
|
|
36
|
+
protected isNodeSelected(nodeId: string): boolean;
|
|
37
|
+
onWidgetClick(e: Event): void;
|
|
38
|
+
onWidgetContextMenu(e: MouseEvent): void;
|
|
39
|
+
onColumnClick(e: Event): void;
|
|
40
|
+
onRowClick(e: Event): void;
|
|
41
|
+
onRowContextMenu(e: MouseEvent): void;
|
|
42
|
+
onColumnContextMenu(e: MouseEvent): void;
|
|
43
|
+
onDrop(event: CdkDragDrop<any>): void;
|
|
44
|
+
moveNodeUp(): void;
|
|
45
|
+
moveNodeDown(): void;
|
|
46
|
+
deleteNode(): void;
|
|
47
|
+
duplicateNode(): void;
|
|
48
|
+
insertRowInColumn(): void;
|
|
49
|
+
wrapWidgetInRow(): void;
|
|
50
|
+
getNodeTypeLabel(): string;
|
|
51
|
+
private resizeStartY;
|
|
52
|
+
private resizeStartHeight;
|
|
53
|
+
private resizingNode;
|
|
54
|
+
private resizingCol;
|
|
55
|
+
private resizeMoveListener;
|
|
56
|
+
private resizeUpListener;
|
|
57
|
+
get isResizing(): boolean;
|
|
58
|
+
ngOnInit(): void;
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
onResizeStart(e: MouseEvent, node: LayoutNode): void;
|
|
61
|
+
onColResizeStart(e: MouseEvent, node: LayoutNode): void;
|
|
62
|
+
onResizeMove(e: MouseEvent): void;
|
|
63
|
+
onResizeEnd(): void;
|
|
64
|
+
onNodeDrop(event: CdkDragDrop<any>): void;
|
|
65
|
+
onNodeSelect(id: string): void;
|
|
66
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
67
|
+
renderWidget(forceRecreate?: boolean): void;
|
|
68
|
+
private updateWidgetDefinitions;
|
|
69
|
+
private resolveWidgetDefinition;
|
|
70
|
+
private createWidgetInjector;
|
|
71
|
+
private getWidgetControl;
|
|
72
|
+
/** TrackBy function for *ngFor to prevent unnecessary component destruction */
|
|
73
|
+
trackById(index: number, node: LayoutNode): string;
|
|
74
|
+
asRow(node: LayoutNode): RowNode;
|
|
75
|
+
asCol(node: LayoutNode): ColumnNode;
|
|
76
|
+
getColClasses(node: LayoutNode): string;
|
|
77
|
+
private getEffectiveSpan;
|
|
78
|
+
private getSpanClass;
|
|
79
|
+
getStyle(node: LayoutNode): Record<string, any>;
|
|
80
|
+
private getEngineForRender;
|
|
81
|
+
isNodeVisible(node: LayoutNode): boolean;
|
|
82
|
+
isRuleHidden(node: LayoutNode): boolean;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutNodeComponent, never>;
|
|
84
|
+
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; }; "device": { "alias": "device"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "connectedDropLists": { "alias": "connectedDropLists"; "required": false; }; }, { "nodeDrop": "nodeDrop"; "nodeSelect": "nodeSelect"; }, never, never, true, never>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DesignerFlavor } from '../form-core/models';
|
|
2
|
+
import { WidgetDefinition } from '../widgets/widget-definition';
|
|
3
|
+
import { DesignerPlugin } from './designer-plugin';
|
|
4
|
+
export declare const CORE_DESIGNER_PLUGINS: DesignerPlugin[];
|
|
5
|
+
export declare function flattenPluginWidgets(plugins: DesignerPlugin[], flavor?: DesignerFlavor): WidgetDefinition[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { DesignerFlavor } from '../form-core/models';
|
|
3
|
+
import { WidgetDefinition } from '../widgets/widget-definition';
|
|
4
|
+
import type { DesignerSectionDefinition } from './section-definition';
|
|
5
|
+
export interface DesignerPlugin {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
flavors: DesignerFlavor[];
|
|
10
|
+
widgets?: WidgetDefinition[];
|
|
11
|
+
sections?: DesignerSectionDefinition[];
|
|
12
|
+
metadata?: Record<string, unknown>;
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const DESIGNER_PLUGINS: InjectionToken<DesignerPlugin[]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DesignerContext } from '../form-designer/designer-context.service';
|
|
2
|
+
import { FieldSchema } from '../form-core/models';
|
|
3
|
+
export interface PluginContext {
|
|
4
|
+
readonly pluginId: string;
|
|
5
|
+
getSchema(): ReturnType<DesignerContext['getSchema']>;
|
|
6
|
+
updateSchema(mutator: (schema: ReturnType<DesignerContext['getSchema']>) => ReturnType<DesignerContext['getSchema']>): void;
|
|
7
|
+
getFields(): FieldSchema[];
|
|
8
|
+
getFieldById(id: string): FieldSchema | undefined;
|
|
9
|
+
getMySchemaMeta<T = unknown>(): T | undefined;
|
|
10
|
+
setMySchemaMeta<T = unknown>(value: T): void;
|
|
11
|
+
getMyFieldMeta<T = unknown>(fieldId: string): T | undefined;
|
|
12
|
+
setMyFieldMeta<T = unknown>(fieldId: string, value: T): void;
|
|
13
|
+
style: {
|
|
14
|
+
normalize: (style?: Record<string, any>) => Record<string, any>;
|
|
15
|
+
merge: (base?: Record<string, any>, override?: Record<string, any>) => Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function createPluginContext(pluginId: string): PluginContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import type { DesignerFlavor, FieldSchema, RowNode } from '../form-core/models';
|
|
3
|
+
export interface DesignerSectionDraft {
|
|
4
|
+
fields: FieldSchema[];
|
|
5
|
+
layout: RowNode;
|
|
6
|
+
}
|
|
7
|
+
export interface DesignerSectionDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
tags?: string[];
|
|
13
|
+
flavor?: DesignerFlavor;
|
|
14
|
+
build: () => DesignerSectionDraft;
|
|
15
|
+
}
|
|
16
|
+
export declare const DESIGNER_SECTIONS: InjectionToken<DesignerSectionDefinition[]>;
|