@expeed/ngx-data-mapper 1.1.0 → 1.2.1
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
|
@@ -112,12 +112,14 @@ interface DragState {
|
|
|
112
112
|
x: number;
|
|
113
113
|
y: number;
|
|
114
114
|
} | null;
|
|
115
|
+
dragMode: 'new' | 'move-source' | 'move-target';
|
|
116
|
+
mappingId?: string;
|
|
117
|
+
sourceFieldIndex?: number;
|
|
115
118
|
}
|
|
116
119
|
interface DefaultValue {
|
|
117
120
|
id: string;
|
|
118
121
|
targetField: SchemaField;
|
|
119
122
|
value: string | number | boolean | Date | null;
|
|
120
|
-
valueType: 'string' | 'number' | 'boolean' | 'date';
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
/**
|
|
@@ -198,11 +200,15 @@ declare class MappingService {
|
|
|
198
200
|
private arrayToObjectMappings;
|
|
199
201
|
private defaultValues;
|
|
200
202
|
private selectedMappingId;
|
|
203
|
+
private _sourceSchemaRef;
|
|
204
|
+
private _targetSchemaRef;
|
|
201
205
|
private dragState;
|
|
202
206
|
readonly allMappings: _angular_core.Signal<FieldMapping[]>;
|
|
203
207
|
readonly allArrayMappings: _angular_core.Signal<ArrayMapping[]>;
|
|
204
208
|
readonly allArrayToObjectMappings: _angular_core.Signal<ArrayToObjectMapping[]>;
|
|
205
209
|
readonly allDefaultValues: _angular_core.Signal<DefaultValue[]>;
|
|
210
|
+
readonly sourceSchemaRef: _angular_core.Signal<string | null>;
|
|
211
|
+
readonly targetSchemaRef: _angular_core.Signal<string | null>;
|
|
206
212
|
readonly selectedMapping: _angular_core.Signal<FieldMapping | null>;
|
|
207
213
|
readonly currentDragState: _angular_core.Signal<DragState>;
|
|
208
214
|
private generateId;
|
|
@@ -210,11 +216,17 @@ declare class MappingService {
|
|
|
210
216
|
x: number;
|
|
211
217
|
y: number;
|
|
212
218
|
}): void;
|
|
219
|
+
startEndpointDrag(mappingId: string, endpointType: 'source' | 'target', startPoint: {
|
|
220
|
+
x: number;
|
|
221
|
+
y: number;
|
|
222
|
+
}, sourceFieldIndex?: number): void;
|
|
213
223
|
updateDragPosition(currentPoint: {
|
|
214
224
|
x: number;
|
|
215
225
|
y: number;
|
|
216
226
|
}): void;
|
|
217
227
|
endDrag(): void;
|
|
228
|
+
changeSourceField(mappingId: string, newSourceField: SchemaField, sourceFieldIndex?: number): void;
|
|
229
|
+
changeTargetField(mappingId: string, newTargetField: SchemaField): void;
|
|
218
230
|
createMapping(sourceFields: SchemaField[], targetField: SchemaField, transformation?: TransformationConfig): FieldMapping;
|
|
219
231
|
private createArrayMapping;
|
|
220
232
|
private createArrayToObjectMapping;
|
|
@@ -235,11 +247,12 @@ declare class MappingService {
|
|
|
235
247
|
getMappingForTarget(targetFieldId: string): FieldMapping | undefined;
|
|
236
248
|
getMappingsForSource(sourceFieldId: string): FieldMapping[];
|
|
237
249
|
clearAllMappings(): void;
|
|
250
|
+
setSourceSchemaRef(ref: string | null): void;
|
|
251
|
+
setTargetSchemaRef(ref: string | null): void;
|
|
238
252
|
setDefaultValue(targetField: SchemaField, value: string | number | boolean | Date | null): DefaultValue;
|
|
239
253
|
getDefaultValue(targetFieldId: string): DefaultValue | undefined;
|
|
240
254
|
removeDefaultValue(targetFieldId: string): void;
|
|
241
255
|
hasDefaultValue(targetFieldId: string): boolean;
|
|
242
|
-
private getValueType;
|
|
243
256
|
exportMappings(name?: string, description?: string): string;
|
|
244
257
|
/**
|
|
245
258
|
* Export mappings as a MappingDocument object (not stringified)
|
|
@@ -360,6 +373,7 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
360
373
|
fieldDragStart: EventEmitter<FieldPositionEvent>;
|
|
361
374
|
fieldDragEnd: EventEmitter<void>;
|
|
362
375
|
fieldDrop: EventEmitter<FieldPositionEvent>;
|
|
376
|
+
sourceDrop: EventEmitter<FieldPositionEvent>;
|
|
363
377
|
fieldPositionsChanged: EventEmitter<Map<string, DOMRect>>;
|
|
364
378
|
fieldDefaultValueClick: EventEmitter<FieldPositionEvent>;
|
|
365
379
|
schemaFieldsContainer: ElementRef<HTMLDivElement>;
|
|
@@ -373,6 +387,9 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
373
387
|
emitFieldPositions(): void;
|
|
374
388
|
toggleExpand(field: SchemaField, event: Event): void;
|
|
375
389
|
onDragStart(event: MouseEvent, field: SchemaField): void;
|
|
390
|
+
isEndpointDragMode(): boolean;
|
|
391
|
+
isSourceEndpointDragging(): boolean;
|
|
392
|
+
isTargetEndpointDragging(): boolean;
|
|
376
393
|
onDragOver(event: DragEvent): void;
|
|
377
394
|
onDrop(event: MouseEvent, field: SchemaField): void;
|
|
378
395
|
getTypeIcon(type: string): string;
|
|
@@ -383,13 +400,14 @@ declare class SchemaTreeComponent implements AfterViewInit, OnDestroy {
|
|
|
383
400
|
onFieldClick(event: MouseEvent, field: SchemaField): void;
|
|
384
401
|
trackByFieldId(index: number, field: SchemaField): string;
|
|
385
402
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaTreeComponent, never>;
|
|
386
|
-
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>;
|
|
387
404
|
}
|
|
388
405
|
|
|
389
406
|
interface VisualConnection {
|
|
390
407
|
id: string;
|
|
391
408
|
mappingId: string;
|
|
392
409
|
paths: string[];
|
|
410
|
+
sourcePoints: Point[];
|
|
393
411
|
midPoint: Point;
|
|
394
412
|
targetPoint: Point;
|
|
395
413
|
hasTransformation: boolean;
|
|
@@ -397,10 +415,13 @@ interface VisualConnection {
|
|
|
397
415
|
isArrayMapping: boolean;
|
|
398
416
|
isArrayToObjectMapping: boolean;
|
|
399
417
|
hasFilter: boolean;
|
|
418
|
+
isBeingDragged: boolean;
|
|
400
419
|
}
|
|
401
420
|
declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
402
421
|
set sourceSchema(value: JsonSchema | SchemaDocument);
|
|
403
422
|
set targetSchema(value: JsonSchema | SchemaDocument);
|
|
423
|
+
set sourceSchemaRef(value: string | null | undefined);
|
|
424
|
+
set targetSchemaRef(value: string | null | undefined);
|
|
404
425
|
sampleData: Record<string, unknown>;
|
|
405
426
|
mappingsChange: EventEmitter<FieldMapping[]>;
|
|
406
427
|
svgContainer: ElementRef<HTMLDivElement>;
|
|
@@ -441,6 +462,11 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
441
462
|
private dragSourceField;
|
|
442
463
|
private dragStartPoint;
|
|
443
464
|
private resizeObserver;
|
|
465
|
+
private isEndpointDragging;
|
|
466
|
+
private endpointDragMappingId;
|
|
467
|
+
private endpointDragType;
|
|
468
|
+
private endpointDragSourceIndex;
|
|
469
|
+
private endpointDragAnchorPoint;
|
|
444
470
|
ngAfterViewInit(): void;
|
|
445
471
|
ngOnDestroy(): void;
|
|
446
472
|
private setupResizeObserver;
|
|
@@ -449,7 +475,10 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
449
475
|
onFieldDragStart(event: FieldPositionEvent): void;
|
|
450
476
|
onMouseMove(event: MouseEvent): void;
|
|
451
477
|
onMouseUp(event: MouseEvent): void;
|
|
478
|
+
onEndpointDragStart(connection: VisualConnection, endpointType: 'source' | 'target', sourceIndex: number, event: MouseEvent): void;
|
|
479
|
+
private cancelEndpointDrag;
|
|
452
480
|
onFieldDrop(event: FieldPositionEvent): void;
|
|
481
|
+
onSourceFieldDrop(event: FieldPositionEvent): void;
|
|
453
482
|
onConnectionClick(connection: VisualConnection, event: MouseEvent): void;
|
|
454
483
|
onTransformationNodeClick(connection: VisualConnection, event: MouseEvent): void;
|
|
455
484
|
onArrayFilterSave(filter: ArrayFilterConfig | undefined): void;
|
|
@@ -471,7 +500,7 @@ declare class DataMapperComponent implements AfterViewInit, OnDestroy {
|
|
|
471
500
|
importMappings(json: string): void;
|
|
472
501
|
trackByConnectionId(index: number, connection: VisualConnection): string;
|
|
473
502
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DataMapperComponent, never>;
|
|
474
|
-
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>;
|
|
475
504
|
}
|
|
476
505
|
|
|
477
506
|
interface EditorField {
|
|
@@ -480,18 +509,25 @@ interface EditorField {
|
|
|
480
509
|
type: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array';
|
|
481
510
|
description?: string;
|
|
482
511
|
required?: boolean;
|
|
512
|
+
defaultValue?: string | number | boolean;
|
|
483
513
|
allowedValues?: string[];
|
|
484
514
|
children?: EditorField[];
|
|
485
515
|
expanded?: boolean;
|
|
486
516
|
isEditing?: boolean;
|
|
487
517
|
isEditingValues?: boolean;
|
|
518
|
+
isEditingDefault?: boolean;
|
|
488
519
|
}
|
|
489
520
|
declare class SchemaEditorComponent {
|
|
490
521
|
set schema(value: JsonSchema | null);
|
|
522
|
+
private hasUncommittedChildFields;
|
|
523
|
+
showJsonToggle: boolean;
|
|
491
524
|
schemaChange: EventEmitter<JsonSchema>;
|
|
492
525
|
save: EventEmitter<JsonSchema>;
|
|
493
526
|
schemaName: _angular_core.WritableSignal<string>;
|
|
494
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>;
|
|
495
531
|
fieldTypes: Array<{
|
|
496
532
|
value: string;
|
|
497
533
|
label: string;
|
|
@@ -512,12 +548,17 @@ declare class SchemaEditorComponent {
|
|
|
512
548
|
toggleRequired(field: EditorField): void;
|
|
513
549
|
onDescriptionChange(field: EditorField, description: string): void;
|
|
514
550
|
toggleValuesEditor(field: EditorField): void;
|
|
515
|
-
addAllowedValue(field: EditorField, input: HTMLInputElement): void;
|
|
551
|
+
addAllowedValue(field: EditorField, input: HTMLInputElement | Event): void;
|
|
516
552
|
removeAllowedValue(field: EditorField, index: number): void;
|
|
517
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;
|
|
518
558
|
onFieldNameKeydown(event: KeyboardEvent, field: EditorField): void;
|
|
519
559
|
moveFieldUp(field: EditorField, parentList: EditorField[]): void;
|
|
520
560
|
moveFieldDown(field: EditorField, parentList: EditorField[]): void;
|
|
561
|
+
onFieldDrop(event: CdkDragDrop<EditorField[]>): void;
|
|
521
562
|
canIndent(field: EditorField, parentList: EditorField[]): boolean;
|
|
522
563
|
indentField(field: EditorField, parentList: EditorField[]): void;
|
|
523
564
|
outdentField(field: EditorField, parentList: EditorField[], level: number): void;
|
|
@@ -534,8 +575,13 @@ declare class SchemaEditorComponent {
|
|
|
534
575
|
private fieldToJsonSchema;
|
|
535
576
|
private stripEditingState;
|
|
536
577
|
trackByFieldId(index: number, field: EditorField): string;
|
|
578
|
+
setViewMode(mode: 'visual' | 'json'): void;
|
|
579
|
+
onJsonTextChange(text: string): void;
|
|
580
|
+
applyJsonChanges(): void;
|
|
581
|
+
formatJson(): void;
|
|
582
|
+
copyJson(): void;
|
|
537
583
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaEditorComponent, never>;
|
|
538
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaEditorComponent, "schema-editor", never, { "schema": { "alias": "schema"; "required": false; }; }, { "schemaChange": "schemaChange"; "save": "save"; }, never, never, true, never>;
|
|
584
|
+
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>;
|
|
539
585
|
}
|
|
540
586
|
|
|
541
587
|
declare class TransformationPopoverComponent implements OnInit, OnChanges {
|