ngx-form-designer 0.0.23

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.
Files changed (123) hide show
  1. package/README.md +279 -0
  2. package/convert-legacy-rem-to-sass-function.mjs +198 -0
  3. package/fesm2022/ngx-form-designer.mjs +33548 -0
  4. package/fesm2022/ngx-form-designer.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/data/data-catalog.d.ts +46 -0
  7. package/lib/data/data-provider.d.ts +69 -0
  8. package/lib/data/data-source-client.d.ts +59 -0
  9. package/lib/data/data-source-parsers.d.ts +7 -0
  10. package/lib/data/external-data-source.d.ts +29 -0
  11. package/lib/data/file-upload-client.d.ts +19 -0
  12. package/lib/data/http-data-source-client.d.ts +31 -0
  13. package/lib/data/in-memory-data-catalog.service.d.ts +12 -0
  14. package/lib/data/runtime-field-data-access-registry.service.d.ts +29 -0
  15. package/lib/data/runtime-field-data-access.d.ts +32 -0
  16. package/lib/data/tree-utils.d.ts +28 -0
  17. package/lib/email-renderer/email-renderer.component.d.ts +21 -0
  18. package/lib/form-core/event-api-reference.d.ts +8 -0
  19. package/lib/form-core/form-engine.d.ts +55 -0
  20. package/lib/form-core/form-event-runner.d.ts +28 -0
  21. package/lib/form-core/models.d.ts +358 -0
  22. package/lib/form-core/plugin-metadata.d.ts +10 -0
  23. package/lib/form-core/rule-evaluation.service.d.ts +18 -0
  24. package/lib/form-core/schema-factory.d.ts +11 -0
  25. package/lib/form-core/schema-guard.d.ts +18 -0
  26. package/lib/form-core/schema-utils.d.ts +9 -0
  27. package/lib/form-designer/data-panel/data-panel.component.d.ts +101 -0
  28. package/lib/form-designer/designer-context.service.d.ts +29 -0
  29. package/lib/form-designer/designer-state.service.d.ts +167 -0
  30. package/lib/form-designer/dynamic-properties/dynamic-properties.component.d.ts +92 -0
  31. package/lib/form-designer/events-panel/events-panel.component.d.ts +21 -0
  32. package/lib/form-designer/events-workspace.component.d.ts +125 -0
  33. package/lib/form-designer/field-palette.component.d.ts +99 -0
  34. package/lib/form-designer/form-designer-shell.component.d.ts +81 -0
  35. package/lib/form-designer/form-preview.component.d.ts +36 -0
  36. package/lib/form-designer/form-settings-inspector.component.d.ts +15 -0
  37. package/lib/form-designer/global-data-manager.component.d.ts +32 -0
  38. package/lib/form-designer/inspector-sections/inspector-advanced-section.component.d.ts +17 -0
  39. package/lib/form-designer/inspector-sections/inspector-backgrounds-section.component.d.ts +14 -0
  40. package/lib/form-designer/inspector-sections/inspector-borders-section.component.d.ts +45 -0
  41. package/lib/form-designer/inspector-sections/inspector-effects-section.component.d.ts +22 -0
  42. package/lib/form-designer/inspector-sections/inspector-layout-section.component.d.ts +33 -0
  43. package/lib/form-designer/inspector-sections/inspector-position-section.component.d.ts +28 -0
  44. package/lib/form-designer/inspector-sections/inspector-size-section.component.d.ts +12 -0
  45. package/lib/form-designer/inspector-sections/inspector-spacing-section.component.d.ts +13 -0
  46. package/lib/form-designer/inspector-sections/inspector-typography-section.component.d.ts +31 -0
  47. package/lib/form-designer/json-form-designer.component.d.ts +17 -0
  48. package/lib/form-designer/layer-tree/layer-tree.component.d.ts +24 -0
  49. package/lib/form-designer/layout-canvas.component.d.ts +69 -0
  50. package/lib/form-designer/page-style.d.ts +2 -0
  51. package/lib/form-designer/properties-panel.component.d.ts +65 -0
  52. package/lib/form-designer/rules-editor/query-builder/query-builder.component.d.ts +23 -0
  53. package/lib/form-designer/rules-editor/rules-panel/rules-panel.component.d.ts +15 -0
  54. package/lib/form-designer/services/widget-definition-resolver.service.d.ts +38 -0
  55. package/lib/form-designer/template-library.d.ts +9 -0
  56. package/lib/form-designer/widget-inspector.component.d.ts +30 -0
  57. package/lib/form-renderer/form-viewer/form-viewer-readonly.component.d.ts +56 -0
  58. package/lib/form-renderer/form-viewer/form-viewer.component.d.ts +55 -0
  59. package/lib/form-renderer/json-form-renderer.component.d.ts +98 -0
  60. package/lib/form-renderer/layout-node.component.d.ts +94 -0
  61. package/lib/plugins/core-plugins.d.ts +5 -0
  62. package/lib/plugins/designer-plugin.d.ts +15 -0
  63. package/lib/plugins/plugin-context.d.ts +18 -0
  64. package/lib/plugins/plugin-providers.d.ts +3 -0
  65. package/lib/plugins/section-definition.d.ts +16 -0
  66. package/lib/theme/theme.service.d.ts +15 -0
  67. package/lib/ui/json-schema-editor.component.d.ts +27 -0
  68. package/lib/ui/monaco-editor.component.d.ts +24 -0
  69. package/lib/ui/ui-accordion.component.d.ts +11 -0
  70. package/lib/ui/ui-box-model.component.d.ts +55 -0
  71. package/lib/ui/ui-color-swatch.component.d.ts +12 -0
  72. package/lib/ui/ui-dimension.component.d.ts +21 -0
  73. package/lib/ui/ui-edge-box.component.d.ts +20 -0
  74. package/lib/ui/ui-field-wrapper.component.d.ts +8 -0
  75. package/lib/ui/ui-icon.module.d.ts +7 -0
  76. package/lib/ui/ui-input.component.d.ts +17 -0
  77. package/lib/ui/ui-range-number.component.d.ts +16 -0
  78. package/lib/ui/ui-select-icon.component.d.ts +18 -0
  79. package/lib/ui/ui-tabs.component.d.ts +25 -0
  80. package/lib/website/website-brick-studio.component.d.ts +67 -0
  81. package/lib/website/website-designer-shell.component.d.ts +53 -0
  82. package/lib/website/website-preview-shell.component.d.ts +25 -0
  83. package/lib/website/website-project.models.d.ts +78 -0
  84. package/lib/website/website-project.service.d.ts +50 -0
  85. package/lib/website/website-section-library.d.ts +6 -0
  86. package/lib/widgets/email-widgets/email-button-widget.component.d.ts +15 -0
  87. package/lib/widgets/email-widgets/email-heading-widget.component.d.ts +15 -0
  88. package/lib/widgets/email-widgets/email-text-widget.component.d.ts +13 -0
  89. package/lib/widgets/email-widgets.d.ts +2 -0
  90. package/lib/widgets/field-widgets/checkbox/checkbox-widget.component.d.ts +28 -0
  91. package/lib/widgets/field-widgets/checkbox-group/checkbox-group-widget.component.d.ts +40 -0
  92. package/lib/widgets/field-widgets/file-upload/file-upload-widget.component.d.ts +45 -0
  93. package/lib/widgets/field-widgets/radio/radio-widget.component.d.ts +39 -0
  94. package/lib/widgets/field-widgets/repeatable-group/repeatable-group-widget.component.d.ts +69 -0
  95. package/lib/widgets/field-widgets/rich-text/rich-text-widget.component.d.ts +17 -0
  96. package/lib/widgets/field-widgets/search/search-widget.component.d.ts +56 -0
  97. package/lib/widgets/field-widgets/select/select-widget.component.d.ts +53 -0
  98. package/lib/widgets/field-widgets/text-field/text-field.component.d.ts +39 -0
  99. package/lib/widgets/field-widgets/tree-select/tree-select-widget.component.d.ts +47 -0
  100. package/lib/widgets/page-link-context.d.ts +8 -0
  101. package/lib/widgets/page-widgets/brick-settings.component.d.ts +23 -0
  102. package/lib/widgets/page-widgets/brick-widget.component.d.ts +47 -0
  103. package/lib/widgets/page-widgets/button-link-settings.component.d.ts +23 -0
  104. package/lib/widgets/page-widgets/button-widget.component.d.ts +21 -0
  105. package/lib/widgets/page-widgets/heading-widget.component.d.ts +22 -0
  106. package/lib/widgets/page-widgets/inline-quill-editor.component.d.ts +35 -0
  107. package/lib/widgets/page-widgets/table-inspector.component.d.ts +17 -0
  108. package/lib/widgets/page-widgets/table-widget.component.d.ts +36 -0
  109. package/lib/widgets/page-widgets/text-block-widget.component.d.ts +22 -0
  110. package/lib/widgets/page-widgets.d.ts +2 -0
  111. package/lib/widgets/static-widgets/image/image-widget.component.d.ts +20 -0
  112. package/lib/widgets/style-helpers.d.ts +8 -0
  113. package/lib/widgets/style-properties.d.ts +28 -0
  114. package/lib/widgets/style-sections.d.ts +1 -0
  115. package/lib/widgets/table-widget.d.ts +2 -0
  116. package/lib/widgets/widget-definition.d.ts +81 -0
  117. package/lib/widgets/widget-editor-context.d.ts +8 -0
  118. package/lib/widgets/widget-packs.d.ts +4 -0
  119. package/lib/widgets/widgets.d.ts +2 -0
  120. package/package.json +47 -0
  121. package/public-api.d.ts +73 -0
  122. package/style-test-bug.scss +2562 -0
  123. package/tailwind.preset.js +62 -0
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="ngx-form-designer" />
5
+ export * from './public-api';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Defines a global data source available in the application.
3
+ */
4
+ export interface DataSourceDefinition {
5
+ id: string;
6
+ label: string;
7
+ type: 'csv' | 'excel' | 'json' | 'api';
8
+ version?: string;
9
+ description?: string;
10
+ tags?: string[];
11
+ schema?: Record<string, 'string' | 'number' | 'boolean' | 'date' | 'any'>;
12
+ url?: string;
13
+ fileId?: string;
14
+ resultPath?: string;
15
+ labelKey?: string;
16
+ valueKey?: string;
17
+ eventId?: string;
18
+ eventAccess?: boolean;
19
+ }
20
+ /**
21
+ * Abstract contract for a global data catalog.
22
+ * Implementation will live in the host app or a future adapter.
23
+ */
24
+ export declare abstract class DataCatalog {
25
+ /**
26
+ * Return all registered data sources available to the designer/runtime.
27
+ */
28
+ abstract listSources(): DataSourceDefinition[];
29
+ /**
30
+ * Look up a single data source by its ID.
31
+ */
32
+ abstract getSourceById(id: string): DataSourceDefinition | undefined;
33
+ /**
34
+ * Return all rows for a given source ID.
35
+ * Implementation can fetch from memory, storage, or a backend in the host app.
36
+ */
37
+ abstract getRows(id: string): any[];
38
+ /**
39
+ * Optional: Add or update a data source.
40
+ */
41
+ abstract upsert?(def: DataSourceDefinition, rows: any[]): void;
42
+ /**
43
+ * Optional: Remove a data source.
44
+ */
45
+ abstract remove?(id: string): void;
46
+ }
@@ -0,0 +1,69 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { FieldSchema, DataSourceConfig, OptionSchema } from '../form-core/models';
3
+ import { FormEngine } from '../form-core/form-engine';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Central abstraction for resolving data for widgets.
7
+ * Implementations can be overridden by host apps if needed.
8
+ */
9
+ export interface OptionsQuery {
10
+ term?: string;
11
+ limit?: number;
12
+ columns?: string[];
13
+ }
14
+ type DataRow = Record<string, unknown>;
15
+ export declare abstract class DataProvider {
16
+ abstract getOptions(field: FieldSchema, engine?: FormEngine): Promise<OptionSchema[]>;
17
+ abstract getList(field: FieldSchema, engine?: FormEngine): Promise<DataRow[]>;
18
+ abstract getValue(field: FieldSchema, engine?: FormEngine): Promise<unknown>;
19
+ abstract resolveValue(field: FieldSchema, value: unknown): Promise<string>;
20
+ queryOptions(field: FieldSchema, query: {
21
+ term: string;
22
+ limit?: number;
23
+ }, engine?: FormEngine): Promise<OptionSchema[]>;
24
+ queryList(field: FieldSchema, query: ListQuery, engine?: FormEngine): Promise<ListResult>;
25
+ }
26
+ export interface ListQuery {
27
+ term?: string;
28
+ limit?: number;
29
+ offset?: number;
30
+ sort?: {
31
+ column: string;
32
+ dir: 'asc' | 'desc';
33
+ }[];
34
+ }
35
+ export interface ListResult {
36
+ rows: DataRow[];
37
+ total: number;
38
+ }
39
+ /**
40
+ * Helper to safely get the effective DataSourceConfig for a field.
41
+ */
42
+ export declare function getEffectiveDataConfig(field: FieldSchema): DataSourceConfig;
43
+ export declare const DATA_PROVIDER: InjectionToken<DataProvider>;
44
+ export declare class DefaultDataProvider extends DataProvider {
45
+ private client;
46
+ private runtimeFieldDataAccessRegistry;
47
+ getOptions(field: FieldSchema, engine?: FormEngine): Promise<OptionSchema[]>;
48
+ queryOptions(field: FieldSchema, query: OptionsQuery, engine?: FormEngine): Promise<OptionSchema[]>;
49
+ getList(field: FieldSchema, engine?: FormEngine): Promise<DataRow[]>;
50
+ queryList(field: FieldSchema, query: ListQuery, engine?: FormEngine): Promise<ListResult>;
51
+ getValue(field: FieldSchema, engine?: FormEngine): Promise<unknown>;
52
+ resolveValue(field: FieldSchema, value: unknown): Promise<string>;
53
+ private getRawRows;
54
+ private getGlobalRows;
55
+ private resolveCollectionRows;
56
+ private extractRows;
57
+ private selectScalarRow;
58
+ private applyRowFilters;
59
+ private resolveFilters;
60
+ private resolveFilterValue;
61
+ private toOptionValue;
62
+ private toRowRecord;
63
+ private mapRowToOption;
64
+ private getRuntimeOptions;
65
+ private shouldUseLocalResolution;
66
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultDataProvider, never>;
67
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultDataProvider>;
68
+ }
69
+ export {};
@@ -0,0 +1,59 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { DataSourceDefinition } from './data-catalog';
3
+ import * as i0 from "@angular/core";
4
+ export interface DataSourceColumn {
5
+ name: string;
6
+ type?: string;
7
+ }
8
+ export interface DataSourceQueryFilter {
9
+ column: string;
10
+ op: 'eq' | 'neq' | 'in' | 'contains' | 'startsWith' | 'endsWith' | 'gt' | 'gte' | 'lt' | 'lte' | 'like';
11
+ value: any;
12
+ }
13
+ export interface DataSourceQuery {
14
+ select?: string[];
15
+ filters?: DataSourceQueryFilter[];
16
+ search?: {
17
+ term: string;
18
+ columns?: string[];
19
+ };
20
+ sort?: {
21
+ column: string;
22
+ dir: 'asc' | 'desc';
23
+ }[];
24
+ page?: {
25
+ limit?: number;
26
+ offset?: number;
27
+ };
28
+ }
29
+ export interface DataSourceQueryResult {
30
+ rows: any[];
31
+ total: number;
32
+ }
33
+ export type UploadSourceType = 'json' | 'csv';
34
+ export interface CreateSourceRequest {
35
+ id?: string;
36
+ label?: string;
37
+ type: UploadSourceType;
38
+ rawData: string;
39
+ }
40
+ export interface DataSourceClient {
41
+ listSources(): Promise<DataSourceDefinition[]>;
42
+ getSourceById(id: string): Promise<DataSourceDefinition | undefined>;
43
+ getColumns(id: string): Promise<DataSourceColumn[]>;
44
+ query(id: string, q?: DataSourceQuery): Promise<DataSourceQueryResult>;
45
+ createSource?(req: CreateSourceRequest): Promise<DataSourceDefinition>;
46
+ deleteSource?(sourceId: string): Promise<void>;
47
+ }
48
+ export declare const DATA_SOURCE_CLIENT: InjectionToken<DataSourceClient>;
49
+ export declare class DefaultDataSourceClient implements DataSourceClient {
50
+ private catalog;
51
+ listSources(): Promise<DataSourceDefinition[]>;
52
+ getSourceById(id: string): Promise<DataSourceDefinition | undefined>;
53
+ getColumns(id: string): Promise<DataSourceColumn[]>;
54
+ query(id: string, q?: DataSourceQuery): Promise<DataSourceQueryResult>;
55
+ createSource(req: CreateSourceRequest): Promise<DataSourceDefinition>;
56
+ deleteSource(sourceId: string): Promise<void>;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultDataSourceClient, never>;
58
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultDataSourceClient>;
59
+ }
@@ -0,0 +1,7 @@
1
+ import { DataSourceDefinition } from './data-catalog';
2
+ type ParsedRow = Record<string, unknown>;
3
+ export declare function parseJsonArray(raw: string): ParsedRow[];
4
+ export declare function parseCsv(raw: string): ParsedRow[];
5
+ export declare function inferSchema(rows: ParsedRow[]): DataSourceDefinition['schema'];
6
+ export declare function slugifyId(input: string): string;
7
+ export {};
@@ -0,0 +1,29 @@
1
+ export interface ExternalDataSource {
2
+ datasourceId: number;
3
+ datasourceName?: string | null;
4
+ datasourceVersion?: number | null;
5
+ datasourceDescription?: string | null;
6
+ /**
7
+ * External datasource properties payload (often a JSON string).
8
+ * Expected shape: `{ headerList?: string[]; sampleDataMap?: Record<string, unknown> }`.
9
+ */
10
+ dsProperties?: string | Record<string, unknown> | null;
11
+ type?: string | null;
12
+ status?: string | null;
13
+ apiDetails?: unknown;
14
+ businessClassification?: string | null;
15
+ createdBy?: string | null;
16
+ createdTimeStamp?: string | null;
17
+ customerId?: string | null;
18
+ environmentList?: unknown;
19
+ environmentName?: string | null;
20
+ environmentType?: string | null;
21
+ jsonUrlProperties?: unknown;
22
+ searchKey?: string | null;
23
+ updatedBy?: string | null;
24
+ updatedTimeStamp?: string | null;
25
+ }
26
+ export interface ExternalDsProperties {
27
+ headerList?: string[];
28
+ sampleDataMap?: Record<string, unknown>;
29
+ }
@@ -0,0 +1,19 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { UploadedFileRef } from '../form-core/models';
3
+ import * as i0 from "@angular/core";
4
+ export interface FileUploadRequest {
5
+ endpoint: string;
6
+ fieldId: string;
7
+ fieldName: string;
8
+ fieldKey?: string;
9
+ headers?: Record<string, string>;
10
+ }
11
+ export interface FileUploadClient {
12
+ upload(files: File[], request: FileUploadRequest): Promise<UploadedFileRef[]>;
13
+ }
14
+ export declare const FILE_UPLOAD_CLIENT: InjectionToken<FileUploadClient>;
15
+ export declare class DefaultFileUploadClient implements FileUploadClient {
16
+ upload(files: File[], request: FileUploadRequest): Promise<UploadedFileRef[]>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultFileUploadClient, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultFileUploadClient>;
19
+ }
@@ -0,0 +1,31 @@
1
+ import { InjectionToken, Provider, EnvironmentProviders } from '@angular/core';
2
+ import { DataSourceClient, DataSourceColumn, DataSourceQuery, DataSourceQueryResult, CreateSourceRequest } from './data-source-client';
3
+ import { DataSourceDefinition } from './data-catalog';
4
+ import * as i0 from "@angular/core";
5
+ export interface HttpDataSourceClientConfig {
6
+ baseUrl: string;
7
+ headers?: Record<string, string>;
8
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
9
+ cacheTtlMs?: {
10
+ sources?: number;
11
+ columns?: number;
12
+ };
13
+ }
14
+ export declare const HTTP_DATA_SOURCE_CLIENT_CONFIG: InjectionToken<HttpDataSourceClientConfig>;
15
+ export declare class HttpDataSourceClient implements DataSourceClient {
16
+ private http;
17
+ private config;
18
+ private sourceCache;
19
+ private columnCache;
20
+ listSources(): Promise<DataSourceDefinition[]>;
21
+ getSourceById(id: string): Promise<DataSourceDefinition | undefined>;
22
+ getColumns(id: string): Promise<DataSourceColumn[]>;
23
+ query(id: string, q?: DataSourceQuery): Promise<DataSourceQueryResult>;
24
+ createSource(req: CreateSourceRequest): Promise<DataSourceDefinition>;
25
+ deleteSource(sourceId: string): Promise<void>;
26
+ private stripTrailingSlash;
27
+ private mergeHeaders;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpDataSourceClient, never>;
29
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpDataSourceClient>;
30
+ }
31
+ export declare function provideHttpDataSourceClient(config: HttpDataSourceClientConfig): (Provider | EnvironmentProviders)[];
@@ -0,0 +1,12 @@
1
+ import { DataCatalog, DataSourceDefinition } from './data-catalog';
2
+ import * as i0 from "@angular/core";
3
+ export declare class InMemoryDataCatalogService extends DataCatalog {
4
+ private sources;
5
+ listSources(): DataSourceDefinition[];
6
+ getSourceById(id: string): DataSourceDefinition | undefined;
7
+ getRows(id: string): any[];
8
+ upsert(def: DataSourceDefinition, rows: any[]): void;
9
+ remove(id: string): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<InMemoryDataCatalogService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<InMemoryDataCatalogService>;
12
+ }
@@ -0,0 +1,29 @@
1
+ import type { FormEngine } from '../form-core/form-engine';
2
+ import type { FieldSchema, FormSchema, OptionSchema } from '../form-core/models';
3
+ import { type RuntimeFieldDataAccessContextInput } from './runtime-field-data-access';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RuntimeFieldDataAccessRegistryService {
6
+ private readonly contexts;
7
+ register(engine: FormEngine, schema: FormSchema, input: RuntimeFieldDataAccessContextInput): void;
8
+ unregister(engine: FormEngine): void;
9
+ hasFieldAccess(field: FieldSchema, engine?: FormEngine): boolean;
10
+ getOptions(field: FieldSchema, engine?: FormEngine): Promise<OptionSchema[] | undefined>;
11
+ invalidateFieldAndDescendants(engine: FormEngine, fieldId: string): void;
12
+ private buildPayload;
13
+ private resolveExactPath;
14
+ private getChainTokens;
15
+ private resolveChainFieldIds;
16
+ private encodePathSegment;
17
+ private hasMeaningfulValue;
18
+ private buildFieldLookup;
19
+ private normalizeMap;
20
+ private normalizeDatasourceId;
21
+ private normalizeFieldList;
22
+ private normalizeType;
23
+ private normalizeContentValue;
24
+ private getCacheKey;
25
+ private buildDescendantMap;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeFieldDataAccessRegistryService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeFieldDataAccessRegistryService>;
28
+ }
29
+ export type { FieldDataAccessMap, FieldDataAccessMapEntry, RuntimeFieldDataAccessApi, RuntimeFieldDataAccessPayload, RuntimeFieldDataAccessContextInput, RuntimeFieldDataAccessApiOption } from './runtime-field-data-access';
@@ -0,0 +1,32 @@
1
+ import type { OptionSchema } from '../form-core/models';
2
+ export interface FieldDataAccessMapEntry {
3
+ chainName: string;
4
+ datasourceId: string | number;
5
+ hierarchyAccess: boolean;
6
+ type?: string;
7
+ fieldList?: string[];
8
+ dependentFields?: string[];
9
+ apiAccess?: boolean;
10
+ singularDataAccess?: boolean;
11
+ }
12
+ export type FieldDataAccessMap = Record<string, FieldDataAccessMapEntry>;
13
+ export interface RuntimeFieldDataAccessPayload {
14
+ datasourceId: string | number;
15
+ formContentId: string;
16
+ formContentVersion: string;
17
+ identifier: string;
18
+ fieldId: string;
19
+ exactPath?: string;
20
+ }
21
+ export interface RuntimeFieldDataAccessApiOption {
22
+ label: string;
23
+ key: string | number;
24
+ }
25
+ export type RuntimeFieldDataAccessApi = (payload: RuntimeFieldDataAccessPayload) => Promise<RuntimeFieldDataAccessApiOption[]>;
26
+ export interface RuntimeFieldDataAccessContextInput {
27
+ fieldDataAccessMap?: FieldDataAccessMap | null;
28
+ fieldDataAccessApi?: RuntimeFieldDataAccessApi | null;
29
+ formContentId?: string | null;
30
+ formContentVersion?: string | null;
31
+ }
32
+ export declare function normalizeRuntimeOptions(rows: unknown): OptionSchema[];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Utilities for handling tree data structures.
3
+ */
4
+ export interface TreeNode {
5
+ id: string;
6
+ label: string;
7
+ value: any;
8
+ data: any;
9
+ children?: TreeNode[];
10
+ parent?: TreeNode;
11
+ expanded?: boolean;
12
+ }
13
+ export interface TreeConfig {
14
+ idKey: string;
15
+ parentKey: string;
16
+ labelKey: string;
17
+ valueKey: string;
18
+ rootValue?: any;
19
+ }
20
+ /**
21
+ * Builds a hierarchical tree from a flat list of rows.
22
+ */
23
+ export declare function buildTree(rows: any[], config: TreeConfig): TreeNode[];
24
+ /**
25
+ * Filters a tree structure, returning a new tree with only matching nodes and their ancestors.
26
+ * Expand matching paths.
27
+ */
28
+ export declare function filterTree(nodes: TreeNode[], term: string): TreeNode[];
@@ -0,0 +1,21 @@
1
+ import { FormSchema, LayoutNode, WidgetNode, RowNode, ColumnNode } from '../form-core/models';
2
+ import { FormEngine } from '../form-core/form-engine';
3
+ import { WidgetDefinition } from '../widgets/widget-definition';
4
+ import * as i0 from "@angular/core";
5
+ export declare class EmailRendererComponent {
6
+ schema: FormSchema;
7
+ engine?: FormEngine;
8
+ private widgetDefs;
9
+ constructor(_widgetDefs: WidgetDefinition[][]);
10
+ isRowNode(node: LayoutNode): node is RowNode;
11
+ isWidgetNode(node: LayoutNode): node is WidgetNode;
12
+ get layoutNodes(): RowNode[];
13
+ getColumns(node: RowNode): ColumnNode[];
14
+ getColumnWidth(col: ColumnNode, totalColumns: number): number;
15
+ private renderWidgets;
16
+ private renderWidget;
17
+ private renderWidgetToHtml;
18
+ private getHeadingStyles;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmailRendererComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<EmailRendererComponent, "app-email-renderer", never, { "schema": { "alias": "schema"; "required": true; }; "engine": { "alias": "engine"; "required": false; }; }, {}, never, never, true, never>;
21
+ }
@@ -0,0 +1,8 @@
1
+ import type { DesignerEventApiDefinition, WidgetEventActionApi } from './models';
2
+ export declare function resolveDesignerEventApiName(api: DesignerEventApiDefinition): string | undefined;
3
+ export declare function resolveDesignerEventApiVersion(api: DesignerEventApiDefinition): string | undefined;
4
+ export declare function resolveActionApiName(action: WidgetEventActionApi): string | undefined;
5
+ export declare function resolveActionApiVersion(action: WidgetEventActionApi): string | undefined;
6
+ export declare function formatActionApiReference(action: WidgetEventActionApi): string;
7
+ export declare function formatDesignerEventApiReference(api: DesignerEventApiDefinition): string;
8
+ export declare function matchesActionToDesignerEventApi(action: WidgetEventActionApi, candidate: DesignerEventApiDefinition): boolean;
@@ -0,0 +1,55 @@
1
+ import { FormSchema } from './models';
2
+ /**
3
+ * A framework-agnostic engine to handle form state, validation, and visibility logic.
4
+ */
5
+ import { Observable } from 'rxjs';
6
+ export interface UiEvent {
7
+ fieldId: string;
8
+ fieldName?: string;
9
+ type: 'focus' | 'blur' | 'change' | 'click' | 'dirty' | 'touched';
10
+ value?: unknown;
11
+ ts: number;
12
+ }
13
+ export interface DataSourceUpdateEvent {
14
+ datasourceId: string;
15
+ ts: number;
16
+ }
17
+ export declare class FormEngine {
18
+ private schema;
19
+ private values;
20
+ private errors;
21
+ private ruleEvaluator;
22
+ private valueSubject;
23
+ valueChanges$: Observable<Record<string, unknown>>;
24
+ private eventSubject;
25
+ events$: Observable<UiEvent>;
26
+ private dataSourceUpdateSubject;
27
+ dataSourceUpdates$: Observable<DataSourceUpdateEvent>;
28
+ private submitSubject;
29
+ submitted$: Observable<void>;
30
+ get formGroup(): {
31
+ value: Record<string, unknown>;
32
+ valueChanges: Observable<Record<string, unknown>>;
33
+ };
34
+ constructor(schema: FormSchema, initialValues?: Record<string, unknown>);
35
+ getSchema(): FormSchema;
36
+ updateSchema(schema: FormSchema): void;
37
+ getValue(fieldName: string): unknown;
38
+ setValue(fieldName: string, value: unknown): void;
39
+ getValues(): Record<string, unknown>;
40
+ getErrors(): Record<string, string[]>;
41
+ getError(fieldName: string): string | null;
42
+ emitUiEvent(event: Omit<UiEvent, 'ts'>): void;
43
+ emitDataSourceUpdate(datasourceId: string): void;
44
+ submit(): void;
45
+ validate(): Record<string, string[]>;
46
+ isFieldVisible(fieldId: string): boolean;
47
+ isFieldEnabled(fieldId: string): boolean;
48
+ isFieldRequired(fieldId: string): boolean;
49
+ private getFieldById;
50
+ private getFieldByName;
51
+ private validateField;
52
+ private evaluateDependencyRules;
53
+ private evaluateEnterpriseRules;
54
+ }
55
+ export declare function createFormEngine(schema: FormSchema, initialValues?: Record<string, unknown>): FormEngine;
@@ -0,0 +1,28 @@
1
+ import { FormEngine } from './form-engine';
2
+ import { WidgetEventApiExecutor, WidgetEventDatasourceWriter } from './models';
3
+ export interface FormEventLogger {
4
+ log(message: string, data?: unknown): void;
5
+ warn(message: string, data?: unknown): void;
6
+ }
7
+ export interface FormEventRunnerOptions {
8
+ logger?: FormEventLogger;
9
+ apiExecutor?: WidgetEventApiExecutor;
10
+ dataSourceWriter?: WidgetEventDatasourceWriter;
11
+ }
12
+ export declare class FormEventRunner {
13
+ private engine;
14
+ private sub;
15
+ private processingDepth;
16
+ private readonly logger;
17
+ private readonly apiExecutor?;
18
+ private readonly dataSourceWriter?;
19
+ constructor(engine: FormEngine, loggerOrOptions?: FormEventLogger | FormEventRunnerOptions);
20
+ dispose(): void;
21
+ private handleEvent;
22
+ private executeAction;
23
+ private handleSetValue;
24
+ private handleApiAction;
25
+ private collectSourceValues;
26
+ private resolveDatasourceId;
27
+ private normalizeRowsForDatasource;
28
+ }