@expeed/ngx-data-mapper 1.0.0 → 1.2.0
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/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { AfterViewInit, OnDestroy, EventEmitter, ElementRef, QueryList, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
3
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
3
4
|
|
|
4
5
|
interface SchemaField {
|
|
5
6
|
id: string;
|
|
@@ -12,11 +13,15 @@ interface SchemaField {
|
|
|
12
13
|
isArrayItem?: boolean;
|
|
13
14
|
parentArrayPath?: string;
|
|
14
15
|
}
|
|
15
|
-
interface
|
|
16
|
+
interface SchemaDefinition {
|
|
16
17
|
name: string;
|
|
17
18
|
fields: SchemaField[];
|
|
18
19
|
}
|
|
19
|
-
type TransformationType = 'direct' | 'concat' | 'substring' | 'replace' | 'uppercase' | 'lowercase' | 'dateFormat' | 'extractYear' | 'extractMonth' | 'extractDay' | 'extractHour' | 'extractMinute' | 'extractSecond' | 'numberFormat' | 'template'
|
|
20
|
+
type TransformationType = 'direct' | 'concat' | 'substring' | 'replace' | 'uppercase' | 'lowercase' | 'trim' | 'mask' | 'dateFormat' | 'extractYear' | 'extractMonth' | 'extractDay' | 'extractHour' | 'extractMinute' | 'extractSecond' | 'numberFormat' | 'template';
|
|
21
|
+
interface TransformationCondition {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
root: FilterGroup;
|
|
24
|
+
}
|
|
20
25
|
interface TransformationConfig {
|
|
21
26
|
type: TransformationType;
|
|
22
27
|
separator?: string;
|
|
@@ -30,13 +35,14 @@ interface TransformationConfig {
|
|
|
30
35
|
decimalPlaces?: number;
|
|
31
36
|
prefix?: string;
|
|
32
37
|
suffix?: string;
|
|
33
|
-
|
|
38
|
+
pattern?: string;
|
|
39
|
+
condition?: TransformationCondition;
|
|
34
40
|
}
|
|
35
41
|
interface FieldMapping {
|
|
36
42
|
id: string;
|
|
37
43
|
sourceFields: SchemaField[];
|
|
38
44
|
targetField: SchemaField;
|
|
39
|
-
|
|
45
|
+
transformations: TransformationConfig[];
|
|
40
46
|
isArrayMapping?: boolean;
|
|
41
47
|
arrayMappingId?: string;
|
|
42
48
|
isArrayToObjectMapping?: boolean;
|
|
@@ -93,7 +99,7 @@ interface Connection {
|
|
|
93
99
|
mappingId: string;
|
|
94
100
|
sourcePoints: ConnectionPoint[];
|
|
95
101
|
targetPoint: ConnectionPoint;
|
|
96
|
-
|
|
102
|
+
transformations: TransformationConfig[];
|
|
97
103
|
}
|
|
98
104
|
interface DragState {
|
|
99
105
|
isDragging: boolean;
|
|
@@ -106,25 +112,103 @@ interface DragState {
|
|
|
106
112
|
x: number;
|
|
107
113
|
y: number;
|
|
108
114
|
} | null;
|
|
115
|
+
dragMode: 'new' | 'move-source' | 'move-target';
|
|
116
|
+
mappingId?: string;
|
|
117
|
+
sourceFieldIndex?: number;
|
|
109
118
|
}
|
|
110
119
|
interface DefaultValue {
|
|
111
120
|
id: string;
|
|
112
121
|
targetField: SchemaField;
|
|
113
122
|
value: string | number | boolean | Date | null;
|
|
114
|
-
valueType: 'string' | 'number' | 'boolean' | 'date';
|
|
115
123
|
}
|
|
116
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Standard JSON Schema (draft-07) TypeScript interfaces
|
|
127
|
+
*/
|
|
128
|
+
interface JsonSchema {
|
|
129
|
+
$schema?: string;
|
|
130
|
+
$id?: string;
|
|
131
|
+
title?: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
type?: JsonSchemaType | JsonSchemaType[];
|
|
134
|
+
properties?: Record<string, JsonSchema>;
|
|
135
|
+
items?: JsonSchema;
|
|
136
|
+
required?: string[];
|
|
137
|
+
enum?: (string | number | boolean | null)[];
|
|
138
|
+
const?: unknown;
|
|
139
|
+
default?: unknown;
|
|
140
|
+
minLength?: number;
|
|
141
|
+
maxLength?: number;
|
|
142
|
+
pattern?: string;
|
|
143
|
+
format?: string;
|
|
144
|
+
minimum?: number;
|
|
145
|
+
maximum?: number;
|
|
146
|
+
exclusiveMinimum?: number;
|
|
147
|
+
exclusiveMaximum?: number;
|
|
148
|
+
multipleOf?: number;
|
|
149
|
+
minItems?: number;
|
|
150
|
+
maxItems?: number;
|
|
151
|
+
uniqueItems?: boolean;
|
|
152
|
+
minProperties?: number;
|
|
153
|
+
maxProperties?: number;
|
|
154
|
+
additionalProperties?: boolean | JsonSchema;
|
|
155
|
+
allOf?: JsonSchema[];
|
|
156
|
+
anyOf?: JsonSchema[];
|
|
157
|
+
oneOf?: JsonSchema[];
|
|
158
|
+
not?: JsonSchema;
|
|
159
|
+
$ref?: string;
|
|
160
|
+
definitions?: Record<string, JsonSchema>;
|
|
161
|
+
}
|
|
162
|
+
type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
163
|
+
/**
|
|
164
|
+
* Helper type for working with JSON schemas in the UI
|
|
165
|
+
*/
|
|
166
|
+
interface JsonSchemaField {
|
|
167
|
+
name: string;
|
|
168
|
+
path: string;
|
|
169
|
+
schema: JsonSchema;
|
|
170
|
+
children?: JsonSchemaField[];
|
|
171
|
+
expanded?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Convert JSON Schema to flat field list for UI rendering
|
|
175
|
+
*/
|
|
176
|
+
declare function schemaToFields(schema: JsonSchema, parentPath?: string): JsonSchemaField[];
|
|
177
|
+
/**
|
|
178
|
+
* Get the simple type for display purposes
|
|
179
|
+
*/
|
|
180
|
+
declare function getSchemaType(schema: JsonSchema): string;
|
|
181
|
+
/**
|
|
182
|
+
* Create an empty JSON Schema for a new schema definition
|
|
183
|
+
*/
|
|
184
|
+
declare function createEmptySchema(title?: string): JsonSchema;
|
|
185
|
+
/**
|
|
186
|
+
* Add a property to a schema
|
|
187
|
+
*/
|
|
188
|
+
declare function addProperty(schema: JsonSchema, name: string, type: JsonSchemaType, options?: {
|
|
189
|
+
description?: string;
|
|
190
|
+
required?: boolean;
|
|
191
|
+
}): JsonSchema;
|
|
192
|
+
/**
|
|
193
|
+
* Remove a property from a schema
|
|
194
|
+
*/
|
|
195
|
+
declare function removeProperty(schema: JsonSchema, name: string): JsonSchema;
|
|
196
|
+
|
|
117
197
|
declare class MappingService {
|
|
118
198
|
private mappings;
|
|
119
199
|
private arrayMappings;
|
|
120
200
|
private arrayToObjectMappings;
|
|
121
201
|
private defaultValues;
|
|
122
202
|
private selectedMappingId;
|
|
203
|
+
private _sourceSchemaRef;
|
|
204
|
+
private _targetSchemaRef;
|
|
123
205
|
private dragState;
|
|
124
206
|
readonly allMappings: _angular_core.Signal<FieldMapping[]>;
|
|
125
207
|
readonly allArrayMappings: _angular_core.Signal<ArrayMapping[]>;
|
|
126
208
|
readonly allArrayToObjectMappings: _angular_core.Signal<ArrayToObjectMapping[]>;
|
|
127
209
|
readonly allDefaultValues: _angular_core.Signal<DefaultValue[]>;
|
|
210
|
+
readonly sourceSchemaRef: _angular_core.Signal<string | null>;
|
|
211
|
+
readonly targetSchemaRef: _angular_core.Signal<string | null>;
|
|
128
212
|
readonly selectedMapping: _angular_core.Signal<FieldMapping | null>;
|
|
129
213
|
readonly currentDragState: _angular_core.Signal<DragState>;
|
|
130
214
|
private generateId;
|
|
@@ -132,11 +216,17 @@ declare class MappingService {
|
|
|
132
216
|
x: number;
|
|
133
217
|
y: number;
|
|
134
218
|
}): void;
|
|
219
|
+
startEndpointDrag(mappingId: string, endpointType: 'source' | 'target', startPoint: {
|
|
220
|
+
x: number;
|
|
221
|
+
y: number;
|
|
222
|
+
}, sourceFieldIndex?: number): void;
|
|
135
223
|
updateDragPosition(currentPoint: {
|
|
136
224
|
x: number;
|
|
137
225
|
y: number;
|
|
138
226
|
}): void;
|
|
139
227
|
endDrag(): void;
|
|
228
|
+
changeSourceField(mappingId: string, newSourceField: SchemaField, sourceFieldIndex?: number): void;
|
|
229
|
+
changeTargetField(mappingId: string, newTargetField: SchemaField): void;
|
|
140
230
|
createMapping(sourceFields: SchemaField[], targetField: SchemaField, transformation?: TransformationConfig): FieldMapping;
|
|
141
231
|
private createArrayMapping;
|
|
142
232
|
private createArrayToObjectMapping;
|
|
@@ -150,19 +240,24 @@ declare class MappingService {
|
|
|
150
240
|
updateArrayToObjectSelector(mappingId: string, selector: ArraySelectorConfig): void;
|
|
151
241
|
removeArrayToObjectMapping(mappingId: string): void;
|
|
152
242
|
updateMapping(mappingId: string, updates: Partial<FieldMapping>): void;
|
|
153
|
-
|
|
243
|
+
updateTransformations(mappingId: string, transformations: TransformationConfig[]): void;
|
|
154
244
|
removeMapping(mappingId: string): void;
|
|
155
245
|
removeSourceFromMapping(mappingId: string, sourceFieldId: string): void;
|
|
156
246
|
selectMapping(mappingId: string | null): void;
|
|
157
247
|
getMappingForTarget(targetFieldId: string): FieldMapping | undefined;
|
|
158
248
|
getMappingsForSource(sourceFieldId: string): FieldMapping[];
|
|
159
249
|
clearAllMappings(): void;
|
|
250
|
+
setSourceSchemaRef(ref: string | null): void;
|
|
251
|
+
setTargetSchemaRef(ref: string | null): void;
|
|
160
252
|
setDefaultValue(targetField: SchemaField, value: string | number | boolean | Date | null): DefaultValue;
|
|
161
253
|
getDefaultValue(targetFieldId: string): DefaultValue | undefined;
|
|
162
254
|
removeDefaultValue(targetFieldId: string): void;
|
|
163
255
|
hasDefaultValue(targetFieldId: string): boolean;
|
|
164
|
-
|
|
165
|
-
|
|
256
|
+
exportMappings(name?: string, description?: string): string;
|
|
257
|
+
/**
|
|
258
|
+
* Export mappings as a MappingDocument object (not stringified)
|
|
259
|
+
*/
|
|
260
|
+
exportMappingsAsObject(name?: string, description?: string): object;
|
|
166
261
|
importMappings(json: string): void;
|
|
167
262
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MappingService, never>;
|
|
168
263
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MappingService>;
|
|
@@ -170,18 +265,34 @@ declare class MappingService {
|
|
|
170
265
|
|
|
171
266
|
declare class TransformationService {
|
|
172
267
|
applyTransformation(sourceValues: Record<string, unknown>, sourceFields: SchemaField[], config: TransformationConfig): string;
|
|
268
|
+
/**
|
|
269
|
+
* Apply a transformation to a single value (for chained transformations)
|
|
270
|
+
*/
|
|
271
|
+
applyTransformationToValue(value: unknown, config: TransformationConfig): string;
|
|
272
|
+
/**
|
|
273
|
+
* Apply multiple transformations in sequence, respecting conditions
|
|
274
|
+
*/
|
|
275
|
+
applyTransformations(sourceValues: Record<string, unknown>, sourceFields: SchemaField[], transformations: TransformationConfig[]): string;
|
|
173
276
|
private getValueByPath;
|
|
174
277
|
private applyTemplate;
|
|
175
278
|
private formatDate;
|
|
176
279
|
private extractDatePart;
|
|
177
280
|
private formatNumber;
|
|
178
|
-
private
|
|
281
|
+
private applyMask;
|
|
179
282
|
getTransformationLabel(type: TransformationType): string;
|
|
180
283
|
getAvailableTransformations(): {
|
|
181
284
|
type: TransformationType;
|
|
182
285
|
label: string;
|
|
183
286
|
category?: string;
|
|
184
287
|
}[];
|
|
288
|
+
evaluateCondition(value: unknown, condition: FilterGroup): boolean;
|
|
289
|
+
private evaluateGroup;
|
|
290
|
+
private evaluateItem;
|
|
291
|
+
private evaluateConditionItem;
|
|
292
|
+
/**
|
|
293
|
+
* Check if a transformation's condition is met
|
|
294
|
+
*/
|
|
295
|
+
isConditionMet(value: unknown, config: TransformationConfig): boolean;
|
|
185
296
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TransformationService, never>;
|
|
186
297
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TransformationService>;
|
|
187
298
|
}
|
|
@@ -215,37 +326,21 @@ declare class SvgConnectorService {
|
|
|
215
326
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SvgConnectorService>;
|
|
216
327
|
}
|
|
217
328
|
|
|
218
|
-
interface
|
|
219
|
-
type?: string;
|
|
220
|
-
format?: string;
|
|
221
|
-
properties?: Record<string, JsonSchemaDefinition>;
|
|
222
|
-
items?: JsonSchemaDefinition;
|
|
329
|
+
interface SchemaDocument extends JsonSchema {
|
|
223
330
|
$ref?: string;
|
|
224
|
-
|
|
225
|
-
enum?: string[];
|
|
226
|
-
required?: string[];
|
|
227
|
-
additionalProperties?: boolean | JsonSchemaDefinition;
|
|
228
|
-
}
|
|
229
|
-
interface SchemaDocument {
|
|
230
|
-
$ref?: string;
|
|
231
|
-
$defs?: Record<string, JsonSchemaDefinition>;
|
|
232
|
-
definitions?: Record<string, JsonSchemaDefinition>;
|
|
331
|
+
$defs?: Record<string, JsonSchema>;
|
|
233
332
|
exclude?: string[];
|
|
234
333
|
include?: string[];
|
|
235
|
-
properties?: Record<string, JsonSchemaDefinition>;
|
|
236
|
-
type?: string;
|
|
237
|
-
title?: string;
|
|
238
|
-
description?: string;
|
|
239
334
|
}
|
|
240
335
|
interface ModelRegistry {
|
|
241
|
-
[modelName: string]:
|
|
336
|
+
[modelName: string]: JsonSchema;
|
|
242
337
|
}
|
|
243
338
|
declare class SchemaParserService {
|
|
244
339
|
private modelRegistry;
|
|
245
340
|
private idCounter;
|
|
246
341
|
registerModels(models: ModelRegistry): void;
|
|
247
342
|
clearRegistry(): void;
|
|
248
|
-
parseSchema(schemaJson: string | SchemaDocument, schemaName?: string):
|
|
343
|
+
parseSchema(schemaJson: string | SchemaDocument, schemaName?: string): SchemaDefinition;
|
|
249
344
|
private resolveRef;
|
|
250
345
|
private buildFields;
|
|
251
346
|
private buildField;
|
|
@@ -278,6 +373,7 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
278
373
|
fieldDragStart: EventEmitter<FieldPositionEvent>;
|
|
279
374
|
fieldDragEnd: EventEmitter<void>;
|
|
280
375
|
fieldDrop: EventEmitter<FieldPositionEvent>;
|
|
376
|
+
sourceDrop: EventEmitter<FieldPositionEvent>;
|
|
281
377
|
fieldPositionsChanged: EventEmitter<Map<string, DOMRect>>;
|
|
282
378
|
fieldDefaultValueClick: EventEmitter<FieldPositionEvent>;
|
|
283
379
|
schemaFieldsContainer: ElementRef<HTMLDivElement>;
|
|
@@ -291,6 +387,9 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
291
387
|
emitFieldPositions(): void;
|
|
292
388
|
toggleExpand(field: SchemaField, event: Event): void;
|
|
293
389
|
onDragStart(event: MouseEvent, field: SchemaField): void;
|
|
390
|
+
isEndpointDragMode(): boolean;
|
|
391
|
+
isSourceEndpointDragging(): boolean;
|
|
392
|
+
isTargetEndpointDragging(): boolean;
|
|
294
393
|
onDragOver(event: DragEvent): void;
|
|
295
394
|
onDrop(event: MouseEvent, field: SchemaField): void;
|
|
296
395
|
getTypeIcon(type: string): string;
|
|
@@ -301,13 +400,14 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
301
400
|
onFieldClick(event: MouseEvent, field: SchemaField): void;
|
|
302
401
|
trackByFieldId(index: number, field: SchemaField): string;
|
|
303
402
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaTreeComponent, never>;
|
|
304
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaTreeComponent, "schema-tree", never, { "schema": { "alias": "schema"; "required": false; }; "side": { "alias": "side"; "required": false; }; "mappings": { "alias": "mappings"; "required": false; }; "defaultValues": { "alias": "defaultValues"; "required": false; }; }, { "fieldDragStart": "fieldDragStart"; "fieldDragEnd": "fieldDragEnd"; "fieldDrop": "fieldDrop"; "fieldPositionsChanged": "fieldPositionsChanged"; "fieldDefaultValueClick": "fieldDefaultValueClick"; }, never, never, true, never>;
|
|
403
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaTreeComponent, "schema-tree", never, { "schema": { "alias": "schema"; "required": false; }; "side": { "alias": "side"; "required": false; }; "mappings": { "alias": "mappings"; "required": false; }; "defaultValues": { "alias": "defaultValues"; "required": false; }; }, { "fieldDragStart": "fieldDragStart"; "fieldDragEnd": "fieldDragEnd"; "fieldDrop": "fieldDrop"; "sourceDrop": "sourceDrop"; "fieldPositionsChanged": "fieldPositionsChanged"; "fieldDefaultValueClick": "fieldDefaultValueClick"; }, never, never, true, never>;
|
|
305
404
|
}
|
|
306
405
|
|
|
307
406
|
interface VisualConnection {
|
|
308
407
|
id: string;
|
|
309
408
|
mappingId: string;
|
|
310
409
|
paths: string[];
|
|
410
|
+
sourcePoints: Point[];
|
|
311
411
|
midPoint: Point;
|
|
312
412
|
targetPoint: Point;
|
|
313
413
|
hasTransformation: boolean;
|
|
@@ -315,10 +415,13 @@ interface VisualConnection {
|
|
|
315
415
|
isArrayMapping: boolean;
|
|
316
416
|
isArrayToObjectMapping: boolean;
|
|
317
417
|
hasFilter: boolean;
|
|
418
|
+
isBeingDragged: boolean;
|
|
318
419
|
}
|
|
319
420
|
declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
320
|
-
sourceSchema: JsonSchema;
|
|
321
|
-
targetSchema: JsonSchema;
|
|
421
|
+
set sourceSchema(value: JsonSchema | SchemaDocument);
|
|
422
|
+
set targetSchema(value: JsonSchema | SchemaDocument);
|
|
423
|
+
set sourceSchemaRef(value: string | null | undefined);
|
|
424
|
+
set targetSchemaRef(value: string | null | undefined);
|
|
322
425
|
sampleData: Record<string, unknown>;
|
|
323
426
|
mappingsChange: EventEmitter<FieldMapping[]>;
|
|
324
427
|
svgContainer: ElementRef<HTMLDivElement>;
|
|
@@ -326,6 +429,11 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
326
429
|
private mappingService;
|
|
327
430
|
private svgConnectorService;
|
|
328
431
|
private transformationService;
|
|
432
|
+
private schemaParserService;
|
|
433
|
+
private _sourceSchemaInput;
|
|
434
|
+
private _targetSchemaInput;
|
|
435
|
+
readonly sourceSchemaForTree: _angular_core.Signal<SchemaDefinition>;
|
|
436
|
+
readonly targetSchemaForTree: _angular_core.Signal<SchemaDefinition>;
|
|
329
437
|
private sourcePositions;
|
|
330
438
|
private targetPositions;
|
|
331
439
|
connections: _angular_core.WritableSignal<VisualConnection[]>;
|
|
@@ -354,6 +462,11 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
354
462
|
private dragSourceField;
|
|
355
463
|
private dragStartPoint;
|
|
356
464
|
private resizeObserver;
|
|
465
|
+
private isEndpointDragging;
|
|
466
|
+
private endpointDragMappingId;
|
|
467
|
+
private endpointDragType;
|
|
468
|
+
private endpointDragSourceIndex;
|
|
469
|
+
private endpointDragAnchorPoint;
|
|
357
470
|
ngAfterViewInit(): void;
|
|
358
471
|
ngOnDestroy(): void;
|
|
359
472
|
private setupResizeObserver;
|
|
@@ -362,7 +475,10 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
362
475
|
onFieldDragStart(event: FieldPositionEvent): void;
|
|
363
476
|
onMouseMove(event: MouseEvent): void;
|
|
364
477
|
onMouseUp(event: MouseEvent): void;
|
|
478
|
+
onEndpointDragStart(connection: VisualConnection, endpointType: 'source' | 'target', sourceIndex: number, event: MouseEvent): void;
|
|
479
|
+
private cancelEndpointDrag;
|
|
365
480
|
onFieldDrop(event: FieldPositionEvent): void;
|
|
481
|
+
onSourceFieldDrop(event: FieldPositionEvent): void;
|
|
366
482
|
onConnectionClick(connection: VisualConnection, event: MouseEvent): void;
|
|
367
483
|
onTransformationNodeClick(connection: VisualConnection, event: MouseEvent): void;
|
|
368
484
|
onArrayFilterSave(filter: ArrayFilterConfig | undefined): void;
|
|
@@ -374,7 +490,7 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
374
490
|
onDefaultValueDelete(): void;
|
|
375
491
|
closeDefaultValuePopover(): void;
|
|
376
492
|
getExistingDefaultValue(fieldId: string): DefaultValue | undefined;
|
|
377
|
-
onPopoverSave(
|
|
493
|
+
onPopoverSave(transformations: TransformationConfig[]): void;
|
|
378
494
|
onPopoverDelete(): void;
|
|
379
495
|
closePopover(): void;
|
|
380
496
|
private updateConnections;
|
|
@@ -384,7 +500,7 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
384
500
|
importMappings(json: string): void;
|
|
385
501
|
trackByConnectionId(index: number, connection: VisualConnection): string;
|
|
386
502
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DataMapperComponent, never>;
|
|
387
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataMapperComponent, "data-mapper", never, { "sourceSchema": { "alias": "sourceSchema"; "required": false; }; "targetSchema": { "alias": "targetSchema"; "required": false; }; "sampleData": { "alias": "sampleData"; "required": false; }; }, { "mappingsChange": "mappingsChange"; }, never, never, true, never>;
|
|
503
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataMapperComponent, "data-mapper", never, { "sourceSchema": { "alias": "sourceSchema"; "required": false; }; "targetSchema": { "alias": "targetSchema"; "required": false; }; "sourceSchemaRef": { "alias": "sourceSchemaRef"; "required": false; }; "targetSchemaRef": { "alias": "targetSchemaRef"; "required": false; }; "sampleData": { "alias": "sampleData"; "required": false; }; }, { "mappingsChange": "mappingsChange"; }, never, never, true, never>;
|
|
388
504
|
}
|
|
389
505
|
|
|
390
506
|
interface EditorField {
|
|
@@ -393,22 +509,25 @@ interface EditorField {
|
|
|
393
509
|
type: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array';
|
|
394
510
|
description?: string;
|
|
395
511
|
required?: boolean;
|
|
512
|
+
defaultValue?: string | number | boolean;
|
|
396
513
|
allowedValues?: string[];
|
|
397
514
|
children?: EditorField[];
|
|
398
515
|
expanded?: boolean;
|
|
399
516
|
isEditing?: boolean;
|
|
400
517
|
isEditingValues?: boolean;
|
|
401
|
-
|
|
402
|
-
interface SchemaDefinition {
|
|
403
|
-
name: string;
|
|
404
|
-
fields: EditorField[];
|
|
518
|
+
isEditingDefault?: boolean;
|
|
405
519
|
}
|
|
406
520
|
declare class SchemaEditorComponent {
|
|
407
|
-
set schema(value:
|
|
408
|
-
|
|
409
|
-
|
|
521
|
+
set schema(value: JsonSchema | null);
|
|
522
|
+
private hasUncommittedChildFields;
|
|
523
|
+
showJsonToggle: boolean;
|
|
524
|
+
schemaChange: EventEmitter<JsonSchema>;
|
|
525
|
+
save: EventEmitter<JsonSchema>;
|
|
410
526
|
schemaName: _angular_core.WritableSignal<string>;
|
|
411
527
|
fields: _angular_core.WritableSignal<EditorField[]>;
|
|
528
|
+
viewMode: _angular_core.WritableSignal<"visual" | "json">;
|
|
529
|
+
jsonText: _angular_core.WritableSignal<string>;
|
|
530
|
+
jsonError: _angular_core.WritableSignal<string | null>;
|
|
412
531
|
fieldTypes: Array<{
|
|
413
532
|
value: string;
|
|
414
533
|
label: string;
|
|
@@ -429,12 +548,17 @@ declare class SchemaEditorComponent {
|
|
|
429
548
|
toggleRequired(field: EditorField): void;
|
|
430
549
|
onDescriptionChange(field: EditorField, description: string): void;
|
|
431
550
|
toggleValuesEditor(field: EditorField): void;
|
|
432
|
-
addAllowedValue(field: EditorField, input: HTMLInputElement): void;
|
|
551
|
+
addAllowedValue(field: EditorField, input: HTMLInputElement | Event): void;
|
|
433
552
|
removeAllowedValue(field: EditorField, index: number): void;
|
|
434
553
|
onAllowedValueKeydown(event: KeyboardEvent, field: EditorField, input: HTMLInputElement): void;
|
|
554
|
+
toggleDefaultEditor(field: EditorField): void;
|
|
555
|
+
onDefaultValueChange(field: EditorField, value: string): void;
|
|
556
|
+
clearDefaultValue(field: EditorField): void;
|
|
557
|
+
onDefaultValueKeydown(event: KeyboardEvent, field: EditorField): void;
|
|
435
558
|
onFieldNameKeydown(event: KeyboardEvent, field: EditorField): void;
|
|
436
559
|
moveFieldUp(field: EditorField, parentList: EditorField[]): void;
|
|
437
560
|
moveFieldDown(field: EditorField, parentList: EditorField[]): void;
|
|
561
|
+
onFieldDrop(event: CdkDragDrop<EditorField[]>): void;
|
|
438
562
|
canIndent(field: EditorField, parentList: EditorField[]): boolean;
|
|
439
563
|
indentField(field: EditorField, parentList: EditorField[]): void;
|
|
440
564
|
outdentField(field: EditorField, parentList: EditorField[], level: number): void;
|
|
@@ -443,13 +567,20 @@ declare class SchemaEditorComponent {
|
|
|
443
567
|
onSchemaNameChange(name: string, input?: HTMLInputElement): void;
|
|
444
568
|
private emitChange;
|
|
445
569
|
onSave(): void;
|
|
570
|
+
private jsonSchemaToEditorFields;
|
|
571
|
+
private jsonSchemaPropertyToEditorField;
|
|
572
|
+
private jsonSchemaTypeToEditorType;
|
|
446
573
|
toJson(): string;
|
|
447
574
|
toJsonSchema(): object;
|
|
448
575
|
private fieldToJsonSchema;
|
|
449
576
|
private stripEditingState;
|
|
450
577
|
trackByFieldId(index: number, field: EditorField): string;
|
|
578
|
+
setViewMode(mode: 'visual' | 'json'): void;
|
|
579
|
+
onJsonTextChange(text: string): void;
|
|
580
|
+
applyJsonChanges(): void;
|
|
581
|
+
formatJson(): void;
|
|
451
582
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaEditorComponent, never>;
|
|
452
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaEditorComponent, "schema-editor", never, { "schema": { "alias": "schema"; "required": false; }; }, { "schemaChange": "schemaChange"; "save": "save"; }, never, never, true, never>;
|
|
583
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaEditorComponent, "schema-editor", never, { "schema": { "alias": "schema"; "required": false; }; "showJsonToggle": { "alias": "showJsonToggle"; "required": false; }; }, { "schemaChange": "schemaChange"; "save": "save"; }, never, never, true, never>;
|
|
453
584
|
}
|
|
454
585
|
|
|
455
586
|
declare class TransformationPopoverComponent implements OnInit, OnChanges {
|
|
@@ -459,13 +590,15 @@ declare class TransformationPopoverComponent implements OnInit, OnChanges {
|
|
|
459
590
|
y: number;
|
|
460
591
|
};
|
|
461
592
|
sampleData: Record<string, unknown>;
|
|
462
|
-
save: EventEmitter<TransformationConfig>;
|
|
593
|
+
save: EventEmitter<TransformationConfig[]>;
|
|
463
594
|
delete: EventEmitter<void>;
|
|
464
595
|
close: EventEmitter<void>;
|
|
465
596
|
private transformationService;
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
597
|
+
steps: TransformationConfig[];
|
|
598
|
+
stepPreviews: string[];
|
|
599
|
+
stepInputs: string[];
|
|
600
|
+
finalPreview: string;
|
|
601
|
+
expandedStepIndex: number;
|
|
469
602
|
availableTransformations: {
|
|
470
603
|
type: TransformationType;
|
|
471
604
|
label: string;
|
|
@@ -474,15 +607,30 @@ declare class TransformationPopoverComponent implements OnInit, OnChanges {
|
|
|
474
607
|
ngOnInit(): void;
|
|
475
608
|
ngOnChanges(changes: SimpleChanges): void;
|
|
476
609
|
private initFromMapping;
|
|
477
|
-
|
|
610
|
+
get isMultiStep(): boolean;
|
|
611
|
+
onStepTypeChange(index: number): void;
|
|
478
612
|
private getDefaultTemplate;
|
|
613
|
+
addStep(): void;
|
|
614
|
+
removeStep(index: number): void;
|
|
615
|
+
onStepDrop(event: CdkDragDrop<TransformationConfig[]>): void;
|
|
616
|
+
toggleStep(index: number): void;
|
|
617
|
+
isStepExpanded(index: number): boolean;
|
|
479
618
|
updatePreview(): void;
|
|
619
|
+
private getValueByPath;
|
|
480
620
|
onConfigChange(): void;
|
|
481
621
|
onSave(): void;
|
|
482
622
|
onDelete(): void;
|
|
483
623
|
onClose(): void;
|
|
484
624
|
getSourceFieldNames(): string;
|
|
485
625
|
getPopoverStyle(): Record<string, string>;
|
|
626
|
+
getStepTypeLabel(type: TransformationType): string;
|
|
627
|
+
hasCondition(step: TransformationConfig): boolean;
|
|
628
|
+
toggleCondition(step: TransformationConfig, enabled: boolean): void;
|
|
629
|
+
onConditionChange(step: TransformationConfig, group: FilterGroup): void;
|
|
630
|
+
private createEmptyConditionGroup;
|
|
631
|
+
getConditionSummary(step: TransformationConfig): string;
|
|
632
|
+
private summarizeConditionGroup;
|
|
633
|
+
private getOperatorLabel;
|
|
486
634
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TransformationPopoverComponent, never>;
|
|
487
635
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TransformationPopoverComponent, "transformation-popover", never, { "mapping": { "alias": "mapping"; "required": false; }; "position": { "alias": "position"; "required": false; }; "sampleData": { "alias": "sampleData"; "required": false; }; }, { "save": "save"; "delete": "delete"; "close": "close"; }, never, never, true, never>;
|
|
488
636
|
}
|
|
@@ -600,5 +748,5 @@ declare class DefaultValuePopoverComponent implements OnInit {
|
|
|
600
748
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DefaultValuePopoverComponent, "default-value-popover", never, { "field": { "alias": "field"; "required": false; }; "existingValue": { "alias": "existingValue"; "required": false; }; "position": { "alias": "position"; "required": false; }; }, { "save": "save"; "delete": "delete"; "close": "close"; }, never, never, true, never>;
|
|
601
749
|
}
|
|
602
750
|
|
|
603
|
-
export { ArrayFilterModalComponent, ArraySelectorModalComponent, DataMapperComponent, DefaultValuePopoverComponent, MappingService, SchemaEditorComponent, SchemaParserService, SchemaTreeComponent, SvgConnectorService, TransformationPopoverComponent, TransformationService };
|
|
604
|
-
export type { ArrayFilterConfig, ArrayMapping, ArraySelectionMode, ArraySelectorConfig, ArrayToObjectMapping, Connection, ConnectionPath, ConnectionPoint, DefaultValue, DragState,
|
|
751
|
+
export { ArrayFilterModalComponent, ArraySelectorModalComponent, DataMapperComponent, DefaultValuePopoverComponent, MappingService, SchemaEditorComponent, SchemaParserService, SchemaTreeComponent, SvgConnectorService, TransformationPopoverComponent, TransformationService, addProperty, createEmptySchema, getSchemaType, removeProperty, schemaToFields };
|
|
752
|
+
export type { ArrayFilterConfig, ArrayMapping, ArraySelectionMode, ArraySelectorConfig, ArrayToObjectMapping, Connection, ConnectionPath, ConnectionPoint, DefaultValue, DragState, FieldMapping, FieldPositionEvent, FilterCondition, FilterGroup, FilterItem, FilterOperator, JsonSchema, JsonSchemaField, JsonSchemaType, ModelRegistry, Point, SchemaDefinition, SchemaDocument, SchemaField, TransformationCondition, TransformationConfig, TransformationType };
|