@expeed/ngx-data-mapper
Advanced tools
+284
| # @expeed/ngx-data-mapper | ||
| A visual drag-and-drop data mapping component for Angular applications. Create field mappings between source and target JSON schemas with transformations, array mapping, and default values. | ||
| ## Features | ||
| - **Drag & Drop Mapping**: Visually connect source fields to target fields | ||
| - **Multi-Source Mapping**: Combine multiple source fields into one target (concatenation) | ||
| - **Transformations**: Apply data transformations (uppercase, lowercase, trim, date formatting, number formatting, substring, replace, mask, templating) | ||
| - **Array Mapping**: Map array fields with optional filtering | ||
| - **Array-to-Object**: Select single item from array using first, last, or conditional logic | ||
| - **Default Values**: Set defaults for unmapped target fields | ||
| - **Endpoint Dragging**: Reassign mappings by dragging connection endpoints | ||
| - **Real-time Preview**: View transformations with sample data | ||
| - **Import/Export**: Save and load mappings as JSON | ||
| ## Installation | ||
| ```bash | ||
| npm install @expeed/ngx-data-mapper | ||
| ``` | ||
| ### Peer Dependencies | ||
| ```bash | ||
| npm install @angular/cdk @angular/material | ||
| ``` | ||
| ## Usage | ||
| ### Basic Usage | ||
| ```typescript | ||
| import { Component } from '@angular/core'; | ||
| import { DataMapperComponent, JsonSchema, FieldMapping } from '@expeed/ngx-data-mapper'; | ||
| @Component({ | ||
| selector: 'app-mapper', | ||
| standalone: true, | ||
| imports: [DataMapperComponent], | ||
| template: ` | ||
| <data-mapper | ||
| [sourceSchema]="sourceSchema" | ||
| [targetSchema]="targetSchema" | ||
| [sampleData]="sampleData" | ||
| (mappingsChange)="onMappingsChange($event)" | ||
| /> | ||
| ` | ||
| }) | ||
| export class MapperComponent { | ||
| sourceSchema: JsonSchema = { | ||
| type: 'object', | ||
| title: 'Source', | ||
| properties: { | ||
| firstName: { type: 'string', title: 'First Name' }, | ||
| lastName: { type: 'string', title: 'Last Name' }, | ||
| birthDate: { type: 'string', format: 'date', title: 'Birth Date' } | ||
| } | ||
| }; | ||
| targetSchema: JsonSchema = { | ||
| type: 'object', | ||
| title: 'Target', | ||
| properties: { | ||
| fullName: { type: 'string', title: 'Full Name' }, | ||
| age: { type: 'integer', title: 'Age' } | ||
| } | ||
| }; | ||
| sampleData = { | ||
| firstName: 'John', | ||
| lastName: 'Doe', | ||
| birthDate: '1990-05-15' | ||
| }; | ||
| onMappingsChange(mappings: FieldMapping[]): void { | ||
| console.log('Mappings:', mappings); | ||
| } | ||
| } | ||
| ``` | ||
| ### With Schema Document (Multiple Definitions) | ||
| ```typescript | ||
| import { SchemaDocument } from '@expeed/ngx-data-mapper'; | ||
| sourceSchema: SchemaDocument = { | ||
| $defs: { | ||
| Customer: { | ||
| type: 'object', | ||
| properties: { | ||
| name: { type: 'string' }, | ||
| email: { type: 'string' } | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| // Reference specific definition | ||
| sourceSchemaRef = '#/$defs/Customer'; | ||
| ``` | ||
| ```html | ||
| <data-mapper | ||
| [sourceSchema]="sourceSchema" | ||
| [targetSchema]="targetSchema" | ||
| [sourceSchemaRef]="sourceSchemaRef" | ||
| [targetSchemaRef]="targetSchemaRef" | ||
| (mappingsChange)="onMappingsChange($event)" | ||
| /> | ||
| ``` | ||
| ### Import/Export Mappings | ||
| ```typescript | ||
| import { ViewChild } from '@angular/core'; | ||
| import { DataMapperComponent } from '@expeed/ngx-data-mapper'; | ||
| @ViewChild(DataMapperComponent) mapper!: DataMapperComponent; | ||
| exportMappings(): void { | ||
| const json = this.mapper.exportMappings(); | ||
| // Save to file or API | ||
| } | ||
| importMappings(json: string): void { | ||
| this.mapper.importMappings(json); | ||
| } | ||
| clearMappings(): void { | ||
| this.mapper.clearAllMappings(); | ||
| } | ||
| ``` | ||
| ## API Reference | ||
| ### DataMapperComponent | ||
| #### Inputs | ||
| | Input | Type | Default | Description | | ||
| |-------|------|---------|-------------| | ||
| | `sourceSchema` | `JsonSchema \| SchemaDocument` | - | Source schema definition | | ||
| | `targetSchema` | `JsonSchema \| SchemaDocument` | - | Target schema definition | | ||
| | `sourceSchemaRef` | `string` | - | JSON pointer to source definition (e.g., `#/$defs/Source`) | | ||
| | `targetSchemaRef` | `string` | - | JSON pointer to target definition (e.g., `#/$defs/Target`) | | ||
| | `sampleData` | `Record<string, unknown>` | `{}` | Sample data for transformation preview | | ||
| #### Outputs | ||
| | Output | Type | Description | | ||
| |--------|------|-------------| | ||
| | `mappingsChange` | `EventEmitter<FieldMapping[]>` | Emits when mappings change | | ||
| #### Public Methods | ||
| | Method | Returns | Description | | ||
| |--------|---------|-------------| | ||
| | `exportMappings()` | `string` | Export all mappings as JSON | | ||
| | `importMappings(json: string)` | `void` | Import mappings from JSON | | ||
| | `clearAllMappings()` | `void` | Remove all mappings | | ||
| ## Transformations | ||
| Available transformation types: | ||
| | Type | Description | Example | | ||
| |------|-------------|---------| | ||
| | `uppercase` | Convert to uppercase | "hello" → "HELLO" | | ||
| | `lowercase` | Convert to lowercase | "HELLO" → "hello" | | ||
| | `trim` | Remove whitespace | " hello " → "hello" | | ||
| | `concat` | Concatenate multiple fields | "John" + "Doe" → "John Doe" | | ||
| | `substring` | Extract part of string | "hello"[0:3] → "hel" | | ||
| | `replace` | Replace text | "hello" → "hi" | | ||
| | `mask` | Mask characters | "1234567890" → "******7890" | | ||
| | `dateFormat` | Format date | "2024-01-15" → "Jan 15, 2024" | | ||
| | `numberFormat` | Format number | 1234.5 → "1,234.50" | | ||
| | `template` | Template string | "${firstName} ${lastName}" | | ||
| | `datePart` | Extract date part | Extract year, month, day | | ||
| ## Array Mapping | ||
| ### Array to Array | ||
| Map arrays with optional filtering: | ||
| ```typescript | ||
| // Filter array items | ||
| { | ||
| type: 'array-mapping', | ||
| filter: { | ||
| conditions: [ | ||
| { field: 'status', operator: 'equals', value: 'active' } | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
| ### Array to Object | ||
| Select single item from array: | ||
| | Mode | Description | | ||
| |------|-------------| | ||
| | `first` | Select first item | | ||
| | `last` | Select last item | | ||
| | `condition` | Select item matching condition | | ||
| ## Default Values | ||
| Set default values for unmapped target fields: | ||
| | Type | Description | | ||
| |------|-------------| | ||
| | `static` | Fixed value | | ||
| | `null` | Null value | | ||
| | `empty-string` | Empty string | | ||
| | `empty-array` | Empty array [] | | ||
| | `empty-object` | Empty object {} | | ||
| | `current-date` | Current date | | ||
| | `current-datetime` | Current date and time | | ||
| | `uuid` | Generated UUID | | ||
| ## Styling | ||
| Customize appearance with CSS custom properties: | ||
| ```css | ||
| data-mapper { | ||
| --data-mapper-bg: #f8fafc; | ||
| --data-mapper-panel-bg: #ffffff; | ||
| --data-mapper-text-primary: #1e293b; | ||
| --data-mapper-text-secondary: #64748b; | ||
| --data-mapper-accent-primary: #6366f1; | ||
| --data-mapper-connector-color: #6366f1; | ||
| --data-mapper-border-color: #e2e8f0; | ||
| } | ||
| ``` | ||
| ### Dark Theme | ||
| ```css | ||
| data-mapper { | ||
| --data-mapper-bg: #1e293b; | ||
| --data-mapper-panel-bg: #334155; | ||
| --data-mapper-text-primary: #f1f5f9; | ||
| --data-mapper-text-secondary: #cbd5e1; | ||
| --data-mapper-accent-primary: #818cf8; | ||
| --data-mapper-connector-color: #818cf8; | ||
| --data-mapper-border-color: #475569; | ||
| } | ||
| ``` | ||
| ## Exports | ||
| ```typescript | ||
| // Components | ||
| export { DataMapperComponent } from './lib/components/data-mapper/data-mapper.component'; | ||
| export { SchemaTreeComponent } from './lib/components/schema-tree/schema-tree.component'; | ||
| // Services | ||
| export { MappingService } from './lib/services/mapping.service'; | ||
| export { TransformationService } from './lib/services/transformation.service'; | ||
| export { SchemaParserService } from './lib/services/schema-parser.service'; | ||
| export { SvgConnectorService } from './lib/services/svg-connector.service'; | ||
| // Types | ||
| export { JsonSchema, SchemaDocument } from './lib/models/json-schema.model'; | ||
| export { FieldMapping, FieldReference } from './lib/models/field-mapping.model'; | ||
| export { TransformationConfig, TransformationType } from './lib/models/transformation.model'; | ||
| export { ArrayMapping, ArrayToObjectMapping } from './lib/models/array-mapping.model'; | ||
| export { DefaultValue, DefaultValueType } from './lib/models/default-value.model'; | ||
| export { SchemaTreeNode, FieldType } from './lib/models/schema-tree.model'; | ||
| ``` | ||
| ## Requirements | ||
| - Angular 19+ | ||
| - Angular Material 19+ | ||
| - Angular CDK 19+ | ||
| ## License | ||
| Apache 2.0 |
+2
-3
| { | ||
| "name": "@expeed/ngx-data-mapper", | ||
| "version": "1.3.3", | ||
| "description": "Visual data mapping components for Angular - drag-and-drop field mapping with transformations, schema editor with JSON Schema export", | ||
| "version": "1.3.4", | ||
| "description": "Visual data mapping component for Angular - drag-and-drop field mapping with transformations", | ||
| "keywords": [ | ||
@@ -9,3 +9,2 @@ "angular", | ||
| "field-mapping", | ||
| "schema-editor", | ||
| "json-schema", | ||
@@ -12,0 +11,0 @@ "drag-drop", |
| import * as _angular_core from '@angular/core'; | ||
| import { AfterViewInit, OnDestroy, EventEmitter, ElementRef, QueryList, OnInit, OnChanges, SimpleChanges } from '@angular/core'; | ||
| import { CdkDragDrop } from '@angular/cdk/drag-drop'; | ||
| import { AfterViewInit, OnDestroy, EventEmitter, ElementRef } from '@angular/core'; | ||
| import { JSONSchema7 } from 'json-schema'; | ||
| interface SchemaField { | ||
| /** | ||
| * Field type enumeration matching Java's FieldType enum | ||
| */ | ||
| type FieldType = 'string' | 'number' | 'boolean' | 'object' | 'array' | 'date'; | ||
| /** | ||
| * Reference to a field - matches Java's FieldReference class. | ||
| * This is the public API type used in FieldMapping output. | ||
| */ | ||
| interface FieldReference { | ||
| id: string; | ||
| name: string; | ||
| type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'date'; | ||
| path: string; | ||
| children?: SchemaField[]; | ||
| type: FieldType; | ||
| description?: string; | ||
| } | ||
| /** | ||
| * Internal type for tree rendering with UI state. | ||
| * Extends FieldReference with tree-specific properties. | ||
| */ | ||
| interface SchemaTreeNode extends FieldReference { | ||
| children?: SchemaTreeNode[]; | ||
| expanded?: boolean; | ||
| description?: string; | ||
| isArrayItem?: boolean; | ||
| parentArrayPath?: string; | ||
| } | ||
| /** | ||
| * Internal schema definition for tree rendering | ||
| */ | ||
| interface SchemaDefinition { | ||
| name: string; | ||
| fields: SchemaField[]; | ||
| fields: SchemaTreeNode[]; | ||
| } | ||
@@ -43,4 +60,4 @@ type TransformationType = 'direct' | 'concat' | 'substring' | 'replace' | 'uppercase' | 'lowercase' | 'trim' | 'mask' | 'dateFormat' | 'extractYear' | 'extractMonth' | 'extractDay' | 'extractHour' | 'extractMinute' | 'extractSecond' | 'numberFormat' | 'template'; | ||
| id: string; | ||
| sourceFields: SchemaField[]; | ||
| targetField: SchemaField; | ||
| sourceFields: SchemaTreeNode[]; | ||
| targetField: SchemaTreeNode; | ||
| transformations: TransformationConfig[]; | ||
@@ -75,4 +92,4 @@ isArrayMapping?: boolean; | ||
| id: string; | ||
| sourceArray: SchemaField; | ||
| targetArray: SchemaField; | ||
| sourceArray: SchemaTreeNode; | ||
| targetArray: SchemaTreeNode; | ||
| itemMappings: FieldMapping[]; | ||
@@ -88,38 +105,10 @@ filter?: ArrayFilterConfig; | ||
| id: string; | ||
| sourceArray: SchemaField; | ||
| targetObject: SchemaField; | ||
| sourceArray: SchemaTreeNode; | ||
| targetObject: SchemaTreeNode; | ||
| selector: ArraySelectorConfig; | ||
| itemMappings: FieldMapping[]; | ||
| } | ||
| interface ConnectionPoint { | ||
| fieldId: string; | ||
| side: 'source' | 'target'; | ||
| x: number; | ||
| y: number; | ||
| } | ||
| interface Connection { | ||
| id: string; | ||
| mappingId: string; | ||
| sourcePoints: ConnectionPoint[]; | ||
| targetPoint: ConnectionPoint; | ||
| transformations: TransformationConfig[]; | ||
| } | ||
| interface DragState { | ||
| isDragging: boolean; | ||
| sourceField: SchemaField | null; | ||
| startPoint: { | ||
| x: number; | ||
| y: number; | ||
| } | null; | ||
| currentPoint: { | ||
| x: number; | ||
| y: number; | ||
| } | null; | ||
| dragMode: 'new' | 'move-source' | 'move-target'; | ||
| mappingId?: string; | ||
| sourceFieldIndex?: number; | ||
| } | ||
| interface DefaultValue { | ||
| id: string; | ||
| targetField: SchemaField; | ||
| targetField: SchemaTreeNode; | ||
| value: string | number | boolean | Date | null; | ||
@@ -129,176 +118,8 @@ } | ||
| /** | ||
| * Standard JSON Schema (draft-07) TypeScript interfaces | ||
| * JSON Schema (draft-07) types | ||
| * Re-exports from @types/json-schema | ||
| */ | ||
| interface JsonSchema { | ||
| $schema?: string; | ||
| $id?: string; | ||
| title?: string; | ||
| description?: string; | ||
| type?: JsonSchemaType | JsonSchemaType[]; | ||
| properties?: Record<string, JsonSchema>; | ||
| items?: JsonSchema; | ||
| required?: string[]; | ||
| enum?: (string | number | boolean | null)[]; | ||
| const?: unknown; | ||
| default?: unknown; | ||
| minLength?: number; | ||
| maxLength?: number; | ||
| pattern?: string; | ||
| format?: string; | ||
| minimum?: number; | ||
| maximum?: number; | ||
| exclusiveMinimum?: number; | ||
| exclusiveMaximum?: number; | ||
| multipleOf?: number; | ||
| minItems?: number; | ||
| maxItems?: number; | ||
| uniqueItems?: boolean; | ||
| minProperties?: number; | ||
| maxProperties?: number; | ||
| additionalProperties?: boolean | JsonSchema; | ||
| allOf?: JsonSchema[]; | ||
| anyOf?: JsonSchema[]; | ||
| oneOf?: JsonSchema[]; | ||
| not?: JsonSchema; | ||
| $ref?: string; | ||
| definitions?: Record<string, JsonSchema>; | ||
| } | ||
| type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null'; | ||
| /** | ||
| * Helper type for working with JSON schemas in the UI | ||
| */ | ||
| interface JsonSchemaField { | ||
| name: string; | ||
| path: string; | ||
| schema: JsonSchema; | ||
| children?: JsonSchemaField[]; | ||
| expanded?: boolean; | ||
| } | ||
| /** | ||
| * Convert JSON Schema to flat field list for UI rendering | ||
| */ | ||
| declare function schemaToFields(schema: JsonSchema, parentPath?: string): JsonSchemaField[]; | ||
| /** | ||
| * Get the simple type for display purposes | ||
| */ | ||
| declare function getSchemaType(schema: JsonSchema): string; | ||
| /** | ||
| * Create an empty JSON Schema for a new schema definition | ||
| */ | ||
| declare function createEmptySchema(title?: string): JsonSchema; | ||
| /** | ||
| * Add a property to a schema | ||
| */ | ||
| declare function addProperty(schema: JsonSchema, name: string, type: JsonSchemaType, options?: { | ||
| description?: string; | ||
| required?: boolean; | ||
| }): JsonSchema; | ||
| /** | ||
| * Remove a property from a schema | ||
| */ | ||
| declare function removeProperty(schema: JsonSchema, name: string): JsonSchema; | ||
| declare class MappingService { | ||
| private mappings; | ||
| private arrayMappings; | ||
| private arrayToObjectMappings; | ||
| private defaultValues; | ||
| private selectedMappingId; | ||
| private _sourceSchemaRef; | ||
| private _targetSchemaRef; | ||
| private dragState; | ||
| readonly allMappings: _angular_core.Signal<FieldMapping[]>; | ||
| readonly allArrayMappings: _angular_core.Signal<ArrayMapping[]>; | ||
| readonly allArrayToObjectMappings: _angular_core.Signal<ArrayToObjectMapping[]>; | ||
| readonly allDefaultValues: _angular_core.Signal<DefaultValue[]>; | ||
| readonly sourceSchemaRef: _angular_core.Signal<string | null>; | ||
| readonly targetSchemaRef: _angular_core.Signal<string | null>; | ||
| readonly selectedMapping: _angular_core.Signal<FieldMapping | null>; | ||
| readonly currentDragState: _angular_core.Signal<DragState>; | ||
| private generateId; | ||
| startDrag(field: SchemaField, startPoint: { | ||
| x: number; | ||
| y: number; | ||
| }): void; | ||
| startEndpointDrag(mappingId: string, endpointType: 'source' | 'target', startPoint: { | ||
| x: number; | ||
| y: number; | ||
| }, sourceFieldIndex?: number): void; | ||
| updateDragPosition(currentPoint: { | ||
| x: number; | ||
| y: number; | ||
| }): void; | ||
| endDrag(): void; | ||
| changeSourceField(mappingId: string, newSourceField: SchemaField, sourceFieldIndex?: number): void; | ||
| changeTargetField(mappingId: string, newTargetField: SchemaField): void; | ||
| createMapping(sourceFields: SchemaField[], targetField: SchemaField, transformation?: TransformationConfig): FieldMapping; | ||
| private createArrayMapping; | ||
| private createArrayToObjectMapping; | ||
| private findOrCreateArrayContext; | ||
| private findOrCreateArrayToObjectContext; | ||
| getArrayMapping(id: string): ArrayMapping | undefined; | ||
| getArrayMappingForField(field: SchemaField): ArrayMapping | undefined; | ||
| removeArrayMapping(arrayMappingId: string): void; | ||
| updateArrayFilter(arrayMappingId: string, filter: ArrayFilterConfig | undefined): void; | ||
| getArrayToObjectMapping(id: string): ArrayToObjectMapping | undefined; | ||
| updateArrayToObjectSelector(mappingId: string, selector: ArraySelectorConfig): void; | ||
| removeArrayToObjectMapping(mappingId: string): void; | ||
| updateMapping(mappingId: string, updates: Partial<FieldMapping>): void; | ||
| updateTransformations(mappingId: string, transformations: TransformationConfig[]): void; | ||
| removeMapping(mappingId: string): void; | ||
| removeSourceFromMapping(mappingId: string, sourceFieldId: string): void; | ||
| selectMapping(mappingId: string | null): void; | ||
| getMappingForTarget(targetFieldId: string): FieldMapping | undefined; | ||
| getMappingsForSource(sourceFieldId: string): FieldMapping[]; | ||
| clearAllMappings(): void; | ||
| setSourceSchemaRef(ref: string | null): void; | ||
| setTargetSchemaRef(ref: string | null): void; | ||
| setDefaultValue(targetField: SchemaField, value: string | number | boolean | Date | null): DefaultValue; | ||
| getDefaultValue(targetFieldId: string): DefaultValue | undefined; | ||
| removeDefaultValue(targetFieldId: string): void; | ||
| hasDefaultValue(targetFieldId: string): boolean; | ||
| exportMappings(name?: string, description?: string): string; | ||
| /** | ||
| * Export mappings as a MappingDocument object (not stringified) | ||
| */ | ||
| exportMappingsAsObject(name?: string, description?: string): object; | ||
| importMappings(json: string): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<MappingService, never>; | ||
| static ɵprov: _angular_core.ɵɵInjectableDeclaration<MappingService>; | ||
| } | ||
| type JsonSchema = JSONSchema7; | ||
| declare class TransformationService { | ||
| applyTransformation(sourceValues: Record<string, unknown>, sourceFields: SchemaField[], config: TransformationConfig): string; | ||
| /** | ||
| * Apply a transformation to a single value (for chained transformations) | ||
| */ | ||
| applyTransformationToValue(value: unknown, config: TransformationConfig): string; | ||
| /** | ||
| * Apply multiple transformations in sequence, respecting conditions | ||
| */ | ||
| applyTransformations(sourceValues: Record<string, unknown>, sourceFields: SchemaField[], transformations: TransformationConfig[]): string; | ||
| private getValueByPath; | ||
| private applyTemplate; | ||
| private formatDate; | ||
| private extractDatePart; | ||
| private formatNumber; | ||
| private applyMask; | ||
| getTransformationLabel(type: TransformationType): string; | ||
| getAvailableTransformations(): { | ||
| type: TransformationType; | ||
| label: string; | ||
| category?: string; | ||
| }[]; | ||
| evaluateCondition(value: unknown, condition: FilterGroup): boolean; | ||
| private evaluateGroup; | ||
| private evaluateItem; | ||
| private evaluateConditionItem; | ||
| /** | ||
| * Check if a transformation's condition is met | ||
| */ | ||
| isConditionMet(value: unknown, config: TransformationConfig): boolean; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<TransformationService, never>; | ||
| static ɵprov: _angular_core.ɵɵInjectableDeclaration<TransformationService>; | ||
| } | ||
| interface Point { | ||
@@ -308,104 +129,8 @@ x: number; | ||
| } | ||
| interface ConnectionPath { | ||
| id: string; | ||
| mappingId: string; | ||
| path: string; | ||
| sourcePoints: Point[]; | ||
| targetPoint: Point; | ||
| midPoint: Point; | ||
| isSelected: boolean; | ||
| hasTransformation: boolean; | ||
| } | ||
| declare class SvgConnectorService { | ||
| createBezierPath(start: Point, end: Point): string; | ||
| createMultiSourcePath(sources: Point[], target: Point): { | ||
| paths: string[]; | ||
| mergePoint: Point; | ||
| }; | ||
| getMidPoint(start: Point, end: Point): Point; | ||
| getMultiSourceMidPoint(sources: Point[], target: Point): Point; | ||
| calculateConnectionPoint(rect: DOMRect, side: 'source' | 'target', containerRect: DOMRect): Point; | ||
| isPointNearPath(point: Point, pathStart: Point, pathEnd: Point, threshold?: number): boolean; | ||
| createDragPath(start: Point, end: Point): string; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<SvgConnectorService, never>; | ||
| static ɵprov: _angular_core.ɵɵInjectableDeclaration<SvgConnectorService>; | ||
| } | ||
| interface SchemaDocument extends JsonSchema { | ||
| $ref?: string; | ||
| $defs?: Record<string, JsonSchema>; | ||
| exclude?: string[]; | ||
| include?: string[]; | ||
| } | ||
| interface ModelRegistry { | ||
| [modelName: string]: JsonSchema; | ||
| } | ||
| declare class SchemaParserService { | ||
| private modelRegistry; | ||
| private idCounter; | ||
| registerModels(models: ModelRegistry): void; | ||
| clearRegistry(): void; | ||
| parseSchema(schemaJson: string | SchemaDocument, schemaName?: string): SchemaDefinition; | ||
| private resolveRef; | ||
| private buildFields; | ||
| private buildField; | ||
| private mapType; | ||
| private applyExclude; | ||
| private applyInclude; | ||
| private hasIncludedChild; | ||
| createSchemaFromRef(modelRef: string, options?: { | ||
| exclude?: string[]; | ||
| include?: string[]; | ||
| title?: string; | ||
| }): SchemaDocument; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaParserService, never>; | ||
| static ɵprov: _angular_core.ɵɵInjectableDeclaration<SchemaParserService>; | ||
| } | ||
| interface FieldPositionEvent { | ||
| field: SchemaField; | ||
| field: SchemaTreeNode; | ||
| element: HTMLElement; | ||
| rect: DOMRect; | ||
| } | ||
| declare class SchemaTreeComponent implements AfterViewInit, OnDestroy { | ||
| schema: { | ||
| name: string; | ||
| fields: SchemaField[]; | ||
| }; | ||
| side: 'source' | 'target'; | ||
| mappings: FieldMapping[]; | ||
| defaultValues: DefaultValue[]; | ||
| showSchemaName: boolean; | ||
| fieldDragStart: EventEmitter<FieldPositionEvent>; | ||
| fieldDragEnd: EventEmitter<void>; | ||
| fieldDrop: EventEmitter<FieldPositionEvent>; | ||
| sourceDrop: EventEmitter<FieldPositionEvent>; | ||
| fieldPositionsChanged: EventEmitter<Map<string, DOMRect>>; | ||
| fieldDefaultValueClick: EventEmitter<FieldPositionEvent>; | ||
| schemaFieldsContainer: ElementRef<HTMLDivElement>; | ||
| fieldItems: QueryList<ElementRef>; | ||
| private mappingService; | ||
| private resizeObserver; | ||
| private scrollHandler; | ||
| ngAfterViewInit(): void; | ||
| ngOnDestroy(): void; | ||
| onScroll(): void; | ||
| emitFieldPositions(): void; | ||
| toggleExpand(field: SchemaField, event: Event): void; | ||
| onDragStart(event: MouseEvent, field: SchemaField): void; | ||
| isEndpointDragMode(): boolean; | ||
| isSourceEndpointDragging(): boolean; | ||
| isTargetEndpointDragging(): boolean; | ||
| onDragOver(event: DragEvent): void; | ||
| onDrop(event: MouseEvent, field: SchemaField): void; | ||
| getTypeIcon(type: string): string; | ||
| isFieldMapped(field: SchemaField): boolean; | ||
| getFieldMappingCount(field: SchemaField): number; | ||
| hasDefaultValue(field: SchemaField): boolean; | ||
| getDefaultValueDisplay(field: SchemaField): string; | ||
| onFieldClick(event: MouseEvent, field: SchemaField): void; | ||
| trackByFieldId(index: number, field: SchemaField): string; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaTreeComponent, never>; | ||
| 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; }; "showSchemaName": { "alias": "showSchemaName"; "required": false; }; }, { "fieldDragStart": "fieldDragStart"; "fieldDragEnd": "fieldDragEnd"; "fieldDrop": "fieldDrop"; "sourceDrop": "sourceDrop"; "fieldPositionsChanged": "fieldPositionsChanged"; "fieldDefaultValueClick": "fieldDefaultValueClick"; }, never, never, true, never>; | ||
| } | ||
@@ -427,4 +152,4 @@ interface VisualConnection { | ||
| declare class DataMapperComponent implements AfterViewInit, OnDestroy { | ||
| set sourceSchema(value: JsonSchema | SchemaDocument); | ||
| set targetSchema(value: JsonSchema | SchemaDocument); | ||
| set sourceSchema(value: JsonSchema); | ||
| set targetSchema(value: JsonSchema); | ||
| set sourceSchemaRef(value: string | null | undefined); | ||
@@ -458,3 +183,3 @@ set targetSchemaRef(value: string | null | undefined); | ||
| showDefaultValuePopover: _angular_core.WritableSignal<boolean>; | ||
| selectedDefaultValueField: _angular_core.WritableSignal<SchemaField | null>; | ||
| selectedDefaultValueField: _angular_core.WritableSignal<SchemaTreeNode | null>; | ||
| defaultValuePopoverPosition: _angular_core.WritableSignal<{ | ||
@@ -514,307 +239,3 @@ x: number; | ||
| type DisplayType$1 = 'textbox' | 'dropdown' | 'textarea' | 'richtext' | 'datepicker' | 'datetimepicker' | 'timepicker' | 'stepper' | 'checkbox' | 'toggle'; | ||
| interface EditorField { | ||
| id: string; | ||
| name: string; | ||
| type: 'string' | 'number' | 'boolean' | 'date' | 'time' | 'object' | 'array'; | ||
| format?: string; | ||
| displayType?: DisplayType$1; | ||
| label?: string; | ||
| required?: boolean; | ||
| defaultValue?: string | number | boolean; | ||
| allowedValues?: string[]; | ||
| minLength?: number; | ||
| maxLength?: number; | ||
| pattern?: string; | ||
| minimum?: number; | ||
| maximum?: number; | ||
| children?: EditorField[]; | ||
| expanded?: boolean; | ||
| isEditingValues?: boolean; | ||
| isEditingDefault?: boolean; | ||
| isEditingValidators?: boolean; | ||
| } | ||
| type DisplayType = 'textbox' | 'dropdown' | 'textarea' | 'richtext' | 'datepicker' | 'datetimepicker' | 'timepicker' | 'stepper' | 'checkbox' | 'toggle'; | ||
| declare class SchemaEditorComponent { | ||
| private appRef; | ||
| set schema(value: JsonSchema | null); | ||
| private hasUncommittedChildFields; | ||
| showJsonToggle: boolean; | ||
| showSchemaName: boolean; | ||
| showDisplayType: boolean; | ||
| schemaChange: EventEmitter<JsonSchema>; | ||
| save: EventEmitter<JsonSchema>; | ||
| schemaName: _angular_core.WritableSignal<string>; | ||
| fields: _angular_core.WritableSignal<EditorField[]>; | ||
| viewMode: _angular_core.WritableSignal<"visual" | "json">; | ||
| jsonText: _angular_core.WritableSignal<string>; | ||
| jsonError: _angular_core.WritableSignal<string | null>; | ||
| fieldTypes: Array<{ | ||
| value: string; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| stringDisplayTypes: Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| dateDisplayTypes: Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| timeDisplayTypes: Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| numberDisplayTypes: Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| booleanDisplayTypes: Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| stringFormats: Array<{ | ||
| value: string; | ||
| label: string; | ||
| }>; | ||
| getDisplayTypes(fieldType: string): Array<{ | ||
| value: DisplayType; | ||
| label: string; | ||
| icon: string; | ||
| }>; | ||
| private generateId; | ||
| private cloneFields; | ||
| getTypeIcon(type: string): string; | ||
| addField(): void; | ||
| addChildField(parent: EditorField): void; | ||
| onFieldChange(): void; | ||
| onFieldDelete(field: EditorField): void; | ||
| onFieldDuplicate(field: EditorField): void; | ||
| deleteField(field: EditorField, parentList: EditorField[]): void; | ||
| duplicateField(field: EditorField, parentList: EditorField[]): void; | ||
| toggleExpand(field: EditorField): void; | ||
| onFieldNameChange(field: EditorField, event: Event): void; | ||
| onFieldNameBlur(field: EditorField): void; | ||
| onFieldTypeChange(field: EditorField, type: string): void; | ||
| onDisplayTypeChange(field: EditorField, displayType: string): void; | ||
| toggleRequired(field: EditorField): void; | ||
| onLabelChange(field: EditorField, label: string): void; | ||
| onLabelBlur(): void; | ||
| toggleValuesEditor(field: EditorField): void; | ||
| addAllowedValue(field: EditorField, input: HTMLInputElement | Event): void; | ||
| removeAllowedValue(field: EditorField, index: number): void; | ||
| onAllowedValueKeydown(event: KeyboardEvent, field: EditorField, input: HTMLInputElement): void; | ||
| toggleDefaultEditor(field: EditorField): void; | ||
| onDefaultValueChange(field: EditorField, value: string): void; | ||
| clearDefaultValue(field: EditorField): void; | ||
| onDefaultValueKeydown(event: KeyboardEvent, field: EditorField): void; | ||
| toggleValidatorsEditor(field: EditorField): void; | ||
| hasValidators(field: EditorField): boolean; | ||
| onFormatChange(field: EditorField, format: string): void; | ||
| onMinLengthChange(field: EditorField, value: string): void; | ||
| onMaxLengthChange(field: EditorField, value: string): void; | ||
| onPatternChange(field: EditorField, value: string): void; | ||
| onMinimumChange(field: EditorField, value: string): void; | ||
| onMaximumChange(field: EditorField, value: string): void; | ||
| moveFieldUp(field: EditorField, parentList: EditorField[]): void; | ||
| moveFieldDown(field: EditorField, parentList: EditorField[]): void; | ||
| onFieldDrop(event: CdkDragDrop<EditorField[]>): void; | ||
| canIndent(field: EditorField, parentList: EditorField[]): boolean; | ||
| indentField(field: EditorField, parentList: EditorField[]): void; | ||
| outdentField(field: EditorField, parentList: EditorField[], level: number): void; | ||
| private findParentOfList; | ||
| private findParentList; | ||
| onSchemaNameChange(name: string, input?: HTMLInputElement): void; | ||
| private emitChange; | ||
| onSave(): void; | ||
| private jsonSchemaToEditorFields; | ||
| private jsonSchemaPropertyToEditorField; | ||
| private jsonSchemaTypeToEditorType; | ||
| toJson(): string; | ||
| toJsonSchema(): object; | ||
| private fieldToJsonSchema; | ||
| private stripEditingState; | ||
| trackByFieldId(index: number, field: EditorField): string; | ||
| setViewMode(mode: 'visual' | 'json'): void; | ||
| onJsonTextChange(text: string): void; | ||
| applyJsonChanges(): void; | ||
| formatJson(): void; | ||
| copyJson(): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaEditorComponent, never>; | ||
| static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaEditorComponent, "schema-editor", never, { "schema": { "alias": "schema"; "required": false; }; "showJsonToggle": { "alias": "showJsonToggle"; "required": false; }; "showSchemaName": { "alias": "showSchemaName"; "required": false; }; "showDisplayType": { "alias": "showDisplayType"; "required": false; }; }, { "schemaChange": "schemaChange"; "save": "save"; }, never, never, true, never>; | ||
| } | ||
| declare class TransformationPopoverComponent implements OnInit, OnChanges { | ||
| mapping: FieldMapping; | ||
| position: { | ||
| x: number; | ||
| y: number; | ||
| }; | ||
| sampleData: Record<string, unknown>; | ||
| save: EventEmitter<TransformationConfig[]>; | ||
| delete: EventEmitter<void>; | ||
| close: EventEmitter<void>; | ||
| private transformationService; | ||
| steps: TransformationConfig[]; | ||
| stepPreviews: string[]; | ||
| stepInputs: string[]; | ||
| finalPreview: string; | ||
| expandedStepIndex: number; | ||
| availableTransformations: { | ||
| type: TransformationType; | ||
| label: string; | ||
| category?: string; | ||
| }[]; | ||
| ngOnInit(): void; | ||
| ngOnChanges(changes: SimpleChanges): void; | ||
| private initFromMapping; | ||
| get isMultiStep(): boolean; | ||
| onStepTypeChange(index: number): void; | ||
| private getDefaultTemplate; | ||
| addStep(): void; | ||
| removeStep(index: number): void; | ||
| onStepDrop(event: CdkDragDrop<TransformationConfig[]>): void; | ||
| toggleStep(index: number): void; | ||
| isStepExpanded(index: number): boolean; | ||
| updatePreview(): void; | ||
| private getValueByPath; | ||
| onConfigChange(): void; | ||
| onSave(): void; | ||
| onDelete(): void; | ||
| onClose(): void; | ||
| getSourceFieldNames(): string; | ||
| getPopoverStyle(): Record<string, string>; | ||
| getStepTypeLabel(type: TransformationType): string; | ||
| hasCondition(step: TransformationConfig): boolean; | ||
| toggleCondition(step: TransformationConfig, enabled: boolean): void; | ||
| onConditionChange(step: TransformationConfig, group: FilterGroup): void; | ||
| private createEmptyConditionGroup; | ||
| getConditionSummary(step: TransformationConfig): string; | ||
| private summarizeConditionGroup; | ||
| private getOperatorLabel; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<TransformationPopoverComponent, never>; | ||
| 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>; | ||
| } | ||
| interface OperatorOption$1 { | ||
| value: FilterOperator; | ||
| label: string; | ||
| needsValue: boolean; | ||
| } | ||
| declare class ArrayFilterModalComponent implements OnInit { | ||
| arrayMapping: ArrayMapping; | ||
| save: EventEmitter<ArrayFilterConfig | undefined>; | ||
| close: EventEmitter<void>; | ||
| filterEnabled: _angular_core.WritableSignal<boolean>; | ||
| rootGroup: _angular_core.WritableSignal<FilterGroup>; | ||
| availableFields: _angular_core.Signal<{ | ||
| path: string; | ||
| name: string; | ||
| type: string; | ||
| }[]>; | ||
| stringOperators: OperatorOption$1[]; | ||
| numberOperators: OperatorOption$1[]; | ||
| booleanOperators: OperatorOption$1[]; | ||
| ngOnInit(): void; | ||
| private createEmptyGroup; | ||
| private generateId; | ||
| private cloneGroup; | ||
| private collectFields; | ||
| getOperatorsForField(fieldPath: string): OperatorOption$1[]; | ||
| getFieldType(fieldPath: string): string; | ||
| operatorNeedsValue(operator: FilterOperator): boolean; | ||
| isCondition(item: FilterItem): item is FilterCondition; | ||
| isGroup(item: FilterItem): item is FilterGroup; | ||
| addCondition(group: FilterGroup): void; | ||
| addGroup(parentGroup: FilterGroup): void; | ||
| removeItem(parentGroup: FilterGroup, itemId: string): void; | ||
| onFieldChange(condition: FilterCondition, fieldPath: string): void; | ||
| onOperatorChange(condition: FilterCondition, operator: FilterOperator): void; | ||
| onValueChange(condition: FilterCondition, value: string | boolean): void; | ||
| onLogicChange(group: FilterGroup, logic: 'and' | 'or'): void; | ||
| private triggerUpdate; | ||
| hasConditions(group: FilterGroup): boolean; | ||
| countConditions(group: FilterGroup): number; | ||
| onSave(): void; | ||
| onClose(): void; | ||
| onBackdropClick(event: MouseEvent): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<ArrayFilterModalComponent, never>; | ||
| static ɵcmp: _angular_core.ɵɵComponentDeclaration<ArrayFilterModalComponent, "array-filter-modal", never, { "arrayMapping": { "alias": "arrayMapping"; "required": true; }; }, { "save": "save"; "close": "close"; }, never, never, true, never>; | ||
| } | ||
| interface OperatorOption { | ||
| value: FilterOperator; | ||
| label: string; | ||
| needsValue: boolean; | ||
| } | ||
| declare class ArraySelectorModalComponent implements OnInit { | ||
| mapping: ArrayToObjectMapping; | ||
| save: EventEmitter<ArraySelectorConfig>; | ||
| close: EventEmitter<void>; | ||
| selectionMode: _angular_core.WritableSignal<ArraySelectionMode>; | ||
| conditionGroup: _angular_core.WritableSignal<FilterGroup>; | ||
| availableFields: _angular_core.Signal<{ | ||
| path: string; | ||
| name: string; | ||
| type: string; | ||
| }[]>; | ||
| stringOperators: OperatorOption[]; | ||
| numberOperators: OperatorOption[]; | ||
| booleanOperators: OperatorOption[]; | ||
| ngOnInit(): void; | ||
| private createEmptyGroup; | ||
| private generateId; | ||
| private cloneGroup; | ||
| private collectFields; | ||
| getOperatorsForField(fieldPath: string): OperatorOption[]; | ||
| operatorNeedsValue(operator: FilterOperator): boolean; | ||
| isCondition(item: FilterItem): item is FilterCondition; | ||
| isGroup(item: FilterItem): item is FilterGroup; | ||
| addCondition(group: FilterGroup): void; | ||
| addGroup(parentGroup: FilterGroup): void; | ||
| removeItem(parentGroup: FilterGroup, itemId: string): void; | ||
| onFieldChange(condition: FilterCondition, fieldPath: string): void; | ||
| onOperatorChange(condition: FilterCondition, operator: FilterOperator): void; | ||
| onValueChange(condition: FilterCondition, value: string | boolean): void; | ||
| onLogicChange(group: FilterGroup, logic: 'and' | 'or'): void; | ||
| private triggerUpdate; | ||
| onSave(): void; | ||
| onClose(): void; | ||
| onBackdropClick(event: MouseEvent): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<ArraySelectorModalComponent, never>; | ||
| static ɵcmp: _angular_core.ɵɵComponentDeclaration<ArraySelectorModalComponent, "array-selector-modal", never, { "mapping": { "alias": "mapping"; "required": true; }; }, { "save": "save"; "close": "close"; }, never, never, true, never>; | ||
| } | ||
| declare class DefaultValuePopoverComponent implements OnInit { | ||
| field: SchemaField; | ||
| existingValue?: DefaultValue; | ||
| position: { | ||
| x: number; | ||
| y: number; | ||
| }; | ||
| save: EventEmitter<string | number | boolean | Date | null>; | ||
| delete: EventEmitter<void>; | ||
| close: EventEmitter<void>; | ||
| stringValue: string; | ||
| numberValue: number | null; | ||
| booleanValue: boolean; | ||
| dateValue: Date | null; | ||
| ngOnInit(): void; | ||
| get fieldType(): string; | ||
| onSave(): void; | ||
| onDelete(): void; | ||
| onClose(): void; | ||
| onBackdropClick(event: MouseEvent): void; | ||
| static ɵfac: _angular_core.ɵɵFactoryDeclaration<DefaultValuePopoverComponent, never>; | ||
| 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>; | ||
| } | ||
| export { ArrayFilterModalComponent, ArraySelectorModalComponent, DataMapperComponent, DefaultValuePopoverComponent, MappingService, SchemaEditorComponent, SchemaParserService, SchemaTreeComponent, SvgConnectorService, TransformationPopoverComponent, TransformationService, addProperty, createEmptySchema, getSchemaType, removeProperty, schemaToFields }; | ||
| 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 }; | ||
| export { DataMapperComponent }; | ||
| export type { ArrayMapping, ArrayToObjectMapping, DefaultValue, FieldMapping, FieldReference, FieldType, JsonSchema, SchemaTreeNode, TransformationConfig, TransformationType }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
5
25%0
-100%285
Infinity%28
-24.32%585141
-33.6%3593
-39.73%