@praxisui/visual-builder 1.0.0-beta.8 → 3.0.0-beta.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/README.md +14 -2
- package/fesm2022/praxisui-visual-builder.mjs +20142 -17026
- package/fesm2022/praxisui-visual-builder.mjs.map +1 -1
- package/index.d.ts +256 -227
- package/package.json +9 -8
package/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, OnInit, OnDestroy, OnChanges,
|
|
3
|
-
import { ContextProvider, FunctionRegistry, ExportOptions as ExportOptions$1, ValidationIssue as ValidationIssue$1
|
|
2
|
+
import { EventEmitter, OnInit, OnDestroy, OnChanges, AfterViewInit, ElementRef, ChangeDetectorRef, SimpleChanges } from '@angular/core';
|
|
3
|
+
import { ContextProvider, FunctionRegistry, ExportOptions as ExportOptions$1, ContextualSpecification, ValidationIssue as ValidationIssue$1 } from '@praxisui/specification';
|
|
4
4
|
import { SpecificationMetadata, Specification } from '@praxisui/specification-core';
|
|
5
5
|
export { SpecificationMetadata } from '@praxisui/specification-core';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
|
-
import {
|
|
7
|
+
import { FormLayoutRule, RulePropertySchema } from '@praxisui/core';
|
|
8
|
+
import { DslParsingConfig, DslParsingResult, DslParsingService, AiResponseValidatorService, AiRuleResponse } from '@praxisui/ai';
|
|
8
9
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
9
|
-
import { MatButtonToggleChange } from '@angular/material/button-toggle';
|
|
10
10
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
11
|
-
import {
|
|
11
|
+
import { FormBuilder, FormGroup, FormControl, FormArray } from '@angular/forms';
|
|
12
12
|
import { MatSelectChange } from '@angular/material/select';
|
|
13
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
14
|
+
import { MatButtonToggleChange } from '@angular/material/button-toggle';
|
|
13
15
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
|
14
16
|
import { MatChipInputEvent } from '@angular/material/chips';
|
|
15
17
|
|
|
@@ -24,7 +26,7 @@ type ValueType = 'literal' | 'field' | 'context' | 'function';
|
|
|
24
26
|
/**
|
|
25
27
|
* Valid comparison operators (aligned with @praxisui/specification)
|
|
26
28
|
*/
|
|
27
|
-
type ValidComparisonOperator = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'startsWith' | 'endsWith' | 'in';
|
|
29
|
+
type ValidComparisonOperator = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'notIn' | 'matches' | 'notMatches' | 'isNull' | 'isNotNull' | 'isEmpty' | 'isNotEmpty';
|
|
28
30
|
interface RuleNode {
|
|
29
31
|
/** Unique identifier for this rule node */
|
|
30
32
|
id: string;
|
|
@@ -47,6 +49,7 @@ interface RuleNode {
|
|
|
47
49
|
}
|
|
48
50
|
declare enum RuleNodeType {
|
|
49
51
|
FIELD_CONDITION = "fieldCondition",
|
|
52
|
+
PROPERTY_RULE = "propertyRule",
|
|
50
53
|
AND_GROUP = "andGroup",
|
|
51
54
|
OR_GROUP = "orGroup",
|
|
52
55
|
NOT_GROUP = "notGroup",
|
|
@@ -76,8 +79,8 @@ declare enum RuleNodeType {
|
|
|
76
79
|
/**
|
|
77
80
|
* String literal type for rule node types (for flexibility)
|
|
78
81
|
*/
|
|
79
|
-
type RuleNodeTypeString = 'fieldCondition' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup' | 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf' | 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength' | 'ifDefined' | 'ifNotNull' | 'ifExists' | 'withDefault' | 'functionCall' | 'fieldToField' | 'contextual' | 'atLeast' | 'exactly' | 'expression' | 'contextualTemplate' | 'custom';
|
|
80
|
-
type RuleNodeConfig = FieldConditionConfig | BooleanGroupConfig | ConditionalValidatorConfig | CollectionValidationConfig | CollectionValidatorConfig | OptionalFieldConfig | FunctionCallConfig | FieldToFieldConfig | ContextualConfig$1 | CardinalityConfig | ExpressionConfig | ContextualTemplateConfig | CustomConfig;
|
|
82
|
+
type RuleNodeTypeString = 'fieldCondition' | 'propertyRule' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup' | 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf' | 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength' | 'ifDefined' | 'ifNotNull' | 'ifExists' | 'withDefault' | 'functionCall' | 'fieldToField' | 'contextual' | 'atLeast' | 'exactly' | 'expression' | 'contextualTemplate' | 'custom';
|
|
83
|
+
type RuleNodeConfig = FieldConditionConfig | PropertyRuleConfig | BooleanGroupConfig | ConditionalValidatorConfig | CollectionValidationConfig | CollectionValidatorConfig | OptionalFieldConfig | FunctionCallConfig | FieldToFieldConfig | ContextualConfig$1 | CardinalityConfig | ExpressionConfig | ContextualTemplateConfig | CustomConfig;
|
|
81
84
|
interface FieldConditionConfig {
|
|
82
85
|
type: 'fieldCondition';
|
|
83
86
|
/** Primary field name */
|
|
@@ -85,7 +88,7 @@ interface FieldConditionConfig {
|
|
|
85
88
|
/** Comparison operator aligned with @praxisui/specification */
|
|
86
89
|
operator: ValidComparisonOperator | string;
|
|
87
90
|
/** Comparison value */
|
|
88
|
-
value
|
|
91
|
+
value?: unknown;
|
|
89
92
|
/** Type of value for proper handling */
|
|
90
93
|
valueType?: ValueType;
|
|
91
94
|
/** Field to compare against (for field-to-field comparisons) */
|
|
@@ -97,6 +100,22 @@ interface FieldConditionConfig {
|
|
|
97
100
|
/** Legacy field alias for backward compatibility */
|
|
98
101
|
field?: string;
|
|
99
102
|
}
|
|
103
|
+
interface PropertyRuleConfig {
|
|
104
|
+
type: 'propertyRule';
|
|
105
|
+
targetType: 'field' | 'section' | 'action' | 'row' | 'column';
|
|
106
|
+
/** Target IDs without prefix (namespace is defined by targetType) */
|
|
107
|
+
targets: string[];
|
|
108
|
+
/** Properties applied when condition is true */
|
|
109
|
+
properties?: Record<string, any>;
|
|
110
|
+
/** Properties applied when condition is false */
|
|
111
|
+
propertiesWhenFalse?: Record<string, any>;
|
|
112
|
+
/** Optional condition node or inline DSL string */
|
|
113
|
+
condition?: RuleNode | string;
|
|
114
|
+
/** Optional reference to a condition node inside the graph */
|
|
115
|
+
conditionNodeId?: string;
|
|
116
|
+
/** Metadata for UI/description */
|
|
117
|
+
metadata?: SpecificationMetadata;
|
|
118
|
+
}
|
|
100
119
|
interface BooleanGroupConfig {
|
|
101
120
|
type: 'booleanGroup' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup';
|
|
102
121
|
/** Boolean operator type */
|
|
@@ -370,6 +389,11 @@ interface RuleBuilderSnapshot {
|
|
|
370
389
|
nodes: Record<string, RuleNode>;
|
|
371
390
|
rootNodes: string[];
|
|
372
391
|
selectedNodeId?: string;
|
|
392
|
+
currentDSL?: string;
|
|
393
|
+
currentJSON?: any;
|
|
394
|
+
validationErrors?: ValidationError$1[];
|
|
395
|
+
mode?: 'visual' | 'dsl' | 'json';
|
|
396
|
+
isDirty?: boolean;
|
|
373
397
|
};
|
|
374
398
|
}
|
|
375
399
|
/**
|
|
@@ -470,6 +494,27 @@ interface ImportOptions {
|
|
|
470
494
|
interface RuleBuilderConfig {
|
|
471
495
|
/** Available field schemas */
|
|
472
496
|
fieldSchemas: Record<string, unknown>;
|
|
497
|
+
/** Optional map of available targets by type (fields, sections, actions) */
|
|
498
|
+
targetSchemas?: {
|
|
499
|
+
fields?: Record<string, unknown>;
|
|
500
|
+
sections?: Record<string, unknown>;
|
|
501
|
+
actions?: Record<string, unknown>;
|
|
502
|
+
rows?: Record<string, unknown>;
|
|
503
|
+
columns?: Record<string, unknown>;
|
|
504
|
+
};
|
|
505
|
+
/** Optional property schema per targetType for typed property editing */
|
|
506
|
+
targetPropertySchemas?: Record<'field' | 'section' | 'action' | 'row' | 'column', Array<{
|
|
507
|
+
name: string;
|
|
508
|
+
type: 'string' | 'boolean' | 'object' | 'enum' | 'number';
|
|
509
|
+
label?: string;
|
|
510
|
+
description?: string;
|
|
511
|
+
enumValues?: Array<{
|
|
512
|
+
value: string;
|
|
513
|
+
label?: string;
|
|
514
|
+
}>;
|
|
515
|
+
}>>;
|
|
516
|
+
/** Backward-compatible property schema key */
|
|
517
|
+
propertySchema?: Record<string, unknown>;
|
|
473
518
|
/** Context variables */
|
|
474
519
|
contextVariables?: unknown[];
|
|
475
520
|
/** Custom functions */
|
|
@@ -566,12 +611,12 @@ interface ContextualTemplateConfig {
|
|
|
566
611
|
declare class PraxisVisualBuilder {
|
|
567
612
|
config: RuleBuilderConfig | null;
|
|
568
613
|
initialRules: any;
|
|
569
|
-
rulesChanged: EventEmitter<
|
|
614
|
+
rulesChanged: EventEmitter<RuleBuilderState>;
|
|
570
615
|
exportRequested: EventEmitter<ExportOptions>;
|
|
571
616
|
importRequested: EventEmitter<ImportOptions>;
|
|
572
|
-
onRulesChanged(rules:
|
|
573
|
-
onExportRequested(options:
|
|
574
|
-
onImportRequested(options:
|
|
617
|
+
onRulesChanged(rules: RuleBuilderState): void;
|
|
618
|
+
onExportRequested(options: any): void;
|
|
619
|
+
onImportRequested(options: any): void;
|
|
575
620
|
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisVisualBuilder, never>;
|
|
576
621
|
static ɵcmp: i0.ɵɵComponentDeclaration<PraxisVisualBuilder, "praxis-visual-builder", never, { "config": { "alias": "config"; "required": false; }; "initialRules": { "alias": "initialRules"; "required": false; }; }, { "rulesChanged": "rulesChanged"; "exportRequested": "exportRequested"; "importRequested": "importRequested"; }, never, never, true, never>;
|
|
577
622
|
}
|
|
@@ -584,8 +629,10 @@ interface FieldSchema {
|
|
|
584
629
|
name: string;
|
|
585
630
|
/** Human-readable field label */
|
|
586
631
|
label: string;
|
|
632
|
+
/** Logical origin to help context-sensitive filtering (form field, section, row, column, table column, etc.) */
|
|
633
|
+
origin?: 'field' | 'section' | 'action' | 'row' | 'column' | 'tableField' | 'tableColumn';
|
|
587
634
|
/** Field data type */
|
|
588
|
-
type: FieldType;
|
|
635
|
+
type: FieldType | string;
|
|
589
636
|
/** Optional description or help text */
|
|
590
637
|
description?: string;
|
|
591
638
|
/** Whether this field is required */
|
|
@@ -661,7 +708,7 @@ declare enum FieldType {
|
|
|
661
708
|
/**
|
|
662
709
|
* Available comparison operators for each field type
|
|
663
710
|
*/
|
|
664
|
-
declare const FIELD_TYPE_OPERATORS: Record<
|
|
711
|
+
declare const FIELD_TYPE_OPERATORS: Record<string, string[]>;
|
|
665
712
|
/**
|
|
666
713
|
* Operator display labels for UI
|
|
667
714
|
*/
|
|
@@ -886,11 +933,11 @@ declare class FieldSchemaService {
|
|
|
886
933
|
/**
|
|
887
934
|
* Get available operators for a field type
|
|
888
935
|
*/
|
|
889
|
-
getAvailableOperators(fieldType: FieldType): string[];
|
|
936
|
+
getAvailableOperators(fieldType: FieldType | string): string[];
|
|
890
937
|
/**
|
|
891
938
|
* Get operator labels for a field type
|
|
892
939
|
*/
|
|
893
|
-
getOperatorLabels(fieldType: FieldType): Record<string, string>;
|
|
940
|
+
getOperatorLabels(fieldType: FieldType | string): Record<string, string>;
|
|
894
941
|
/**
|
|
895
942
|
* Validate field value against schema
|
|
896
943
|
*/
|
|
@@ -937,13 +984,14 @@ interface ValidationResult {
|
|
|
937
984
|
errors: string[];
|
|
938
985
|
}
|
|
939
986
|
|
|
987
|
+
type DslContextScope = 'user' | 'session' | 'env' | 'global' | string;
|
|
940
988
|
interface DslContextVariable {
|
|
941
989
|
/** Variable name */
|
|
942
990
|
name: string;
|
|
943
991
|
/** Variable type */
|
|
944
992
|
type: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array';
|
|
945
993
|
/** Variable scope */
|
|
946
|
-
scope:
|
|
994
|
+
scope: DslContextScope;
|
|
947
995
|
/** Description */
|
|
948
996
|
description?: string;
|
|
949
997
|
/** Example value */
|
|
@@ -965,6 +1013,10 @@ declare class RuleNodeRegistryService {
|
|
|
965
1013
|
* Register a node in the registry
|
|
966
1014
|
*/
|
|
967
1015
|
register(node: RuleNode): void;
|
|
1016
|
+
/**
|
|
1017
|
+
* Backwards-compatible alias for register()
|
|
1018
|
+
*/
|
|
1019
|
+
registerNode(node: RuleNode): void;
|
|
968
1020
|
/**
|
|
969
1021
|
* Register multiple nodes at once
|
|
970
1022
|
*/
|
|
@@ -1210,6 +1262,9 @@ declare class FieldConditionConverter extends BaseRuleConverter {
|
|
|
1210
1262
|
private mapOperator;
|
|
1211
1263
|
private convertValue;
|
|
1212
1264
|
private inferAndConvertValue;
|
|
1265
|
+
private operatorRequiresValue;
|
|
1266
|
+
private defaultValueForOperator;
|
|
1267
|
+
private getImpliedValue;
|
|
1213
1268
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConditionConverter, never>;
|
|
1214
1269
|
static ɵprov: i0.ɵɵInjectableDeclaration<FieldConditionConverter>;
|
|
1215
1270
|
}
|
|
@@ -1307,37 +1362,6 @@ interface ConverterStatistics {
|
|
|
1307
1362
|
converterNames: string[];
|
|
1308
1363
|
}
|
|
1309
1364
|
|
|
1310
|
-
/**
|
|
1311
|
-
* Configuration for parsing DSL expressions
|
|
1312
|
-
*/
|
|
1313
|
-
interface DslParsingConfig$1 {
|
|
1314
|
-
/** Available function registry */
|
|
1315
|
-
functionRegistry?: FunctionRegistry<any>;
|
|
1316
|
-
/** Context provider for variable resolution */
|
|
1317
|
-
contextProvider?: ContextProvider;
|
|
1318
|
-
/** Known field names for validation */
|
|
1319
|
-
knownFields?: string[];
|
|
1320
|
-
/** Enable performance warnings */
|
|
1321
|
-
enablePerformanceWarnings?: boolean;
|
|
1322
|
-
/** Maximum expression complexity */
|
|
1323
|
-
maxComplexity?: number;
|
|
1324
|
-
}
|
|
1325
|
-
/**
|
|
1326
|
-
* Result of parsing a DSL expression
|
|
1327
|
-
*/
|
|
1328
|
-
interface DslParsingResult$1<T extends object = any> {
|
|
1329
|
-
/** Whether parsing was successful */
|
|
1330
|
-
success: boolean;
|
|
1331
|
-
/** Parsed specification (if successful) */
|
|
1332
|
-
specification?: Specification<T>;
|
|
1333
|
-
/** Validation issues found */
|
|
1334
|
-
issues: ValidationIssue$1[];
|
|
1335
|
-
/** Performance metrics */
|
|
1336
|
-
metrics?: {
|
|
1337
|
-
parseTime: number;
|
|
1338
|
-
complexity: number;
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
1365
|
/**
|
|
1342
1366
|
* Configuration for contextual specification support
|
|
1343
1367
|
*/
|
|
@@ -1361,6 +1385,7 @@ declare class SpecificationBridgeService {
|
|
|
1361
1385
|
* Converts a RuleNode tree to a Specification instance
|
|
1362
1386
|
*/
|
|
1363
1387
|
ruleNodeToSpecification<T extends object = any>(node: RuleNode): Specification<T>;
|
|
1388
|
+
private registerSubtree;
|
|
1364
1389
|
/**
|
|
1365
1390
|
* Converts a Specification instance to a RuleNode tree
|
|
1366
1391
|
*/
|
|
@@ -1396,7 +1421,7 @@ declare class SpecificationBridgeService {
|
|
|
1396
1421
|
/**
|
|
1397
1422
|
* Parses a DSL expression string into a Specification
|
|
1398
1423
|
*/
|
|
1399
|
-
parseDslExpression<T extends object = any>(expression: string, config?: DslParsingConfig
|
|
1424
|
+
parseDslExpression<T extends object = any>(expression: string, config?: DslParsingConfig): DslParsingResult<T>;
|
|
1400
1425
|
/**
|
|
1401
1426
|
* Creates a ContextualSpecification with token resolution
|
|
1402
1427
|
*/
|
|
@@ -1424,7 +1449,7 @@ declare class SpecificationBridgeService {
|
|
|
1424
1449
|
/**
|
|
1425
1450
|
* Performs round-trip validation for expression specifications
|
|
1426
1451
|
*/
|
|
1427
|
-
validateExpressionRoundTrip<T extends object = any>(originalExpression: string, config?: DslParsingConfig
|
|
1452
|
+
validateExpressionRoundTrip<T extends object = any>(originalExpression: string, config?: DslParsingConfig): {
|
|
1428
1453
|
success: boolean;
|
|
1429
1454
|
errors: string[];
|
|
1430
1455
|
warnings: string[];
|
|
@@ -1465,6 +1490,9 @@ declare class SpecificationBridgeService {
|
|
|
1465
1490
|
private createContextualSpecificationFromNode;
|
|
1466
1491
|
private convertToComparisonOperator;
|
|
1467
1492
|
private convertValue;
|
|
1493
|
+
private comparisonExpectsValue;
|
|
1494
|
+
private defaultValueForOperator;
|
|
1495
|
+
private getImpliedValueForOperator;
|
|
1468
1496
|
private jsonToRuleNode;
|
|
1469
1497
|
private mapSpecificationTypeToNodeType;
|
|
1470
1498
|
private mapComparisonOperator;
|
|
@@ -1497,7 +1525,7 @@ declare class SpecificationBridgeService {
|
|
|
1497
1525
|
*/
|
|
1498
1526
|
parseDslExpressionValue(expression: string | {
|
|
1499
1527
|
expr: string;
|
|
1500
|
-
} | null | undefined, _config?: DslParsingConfig
|
|
1528
|
+
} | null | undefined, _config?: DslParsingConfig): {
|
|
1501
1529
|
success: boolean;
|
|
1502
1530
|
issues: string[];
|
|
1503
1531
|
};
|
|
@@ -1559,15 +1587,17 @@ interface RoundTripTestCase {
|
|
|
1559
1587
|
expectedErrors?: string[];
|
|
1560
1588
|
expectedWarnings?: string[];
|
|
1561
1589
|
};
|
|
1590
|
+
relatedNodes?: RuleNode[];
|
|
1562
1591
|
}
|
|
1563
1592
|
declare class RoundTripValidatorService {
|
|
1564
1593
|
private specificationBridge;
|
|
1594
|
+
private nodeRegistry;
|
|
1565
1595
|
private dslParser;
|
|
1566
|
-
constructor(specificationBridge: SpecificationBridgeService);
|
|
1596
|
+
constructor(specificationBridge: SpecificationBridgeService, nodeRegistry: RuleNodeRegistryService);
|
|
1567
1597
|
/**
|
|
1568
1598
|
* Validates complete round-trip conversion: Visual → DSL → Visual
|
|
1569
1599
|
*/
|
|
1570
|
-
validateRoundTrip(visualRule: RuleNode): RoundTripValidationResult;
|
|
1600
|
+
validateRoundTrip(visualRule: RuleNode, relatedNodes?: RuleNode[]): RoundTripValidationResult;
|
|
1571
1601
|
/**
|
|
1572
1602
|
* Validates data integrity between original and reconstructed visual rules
|
|
1573
1603
|
*/
|
|
@@ -1616,6 +1646,7 @@ declare class RoundTripValidatorService {
|
|
|
1616
1646
|
declare class RuleBuilderService {
|
|
1617
1647
|
private specificationBridge;
|
|
1618
1648
|
private roundTripValidator;
|
|
1649
|
+
private nodeRegistry;
|
|
1619
1650
|
private readonly _state;
|
|
1620
1651
|
private readonly _validationErrors;
|
|
1621
1652
|
private readonly _nodeSelected;
|
|
@@ -1628,7 +1659,7 @@ declare class RuleBuilderService {
|
|
|
1628
1659
|
readonly validationErrors$: Observable<ValidationError$1[]>;
|
|
1629
1660
|
readonly nodeSelected$: Observable<string>;
|
|
1630
1661
|
readonly stateChanged$: Observable<void>;
|
|
1631
|
-
constructor(specificationBridge: SpecificationBridgeService, roundTripValidator: RoundTripValidatorService);
|
|
1662
|
+
constructor(specificationBridge: SpecificationBridgeService, roundTripValidator: RoundTripValidatorService, nodeRegistry: RuleNodeRegistryService);
|
|
1632
1663
|
/**
|
|
1633
1664
|
* Initialize the rule builder with configuration
|
|
1634
1665
|
*/
|
|
@@ -1637,6 +1668,18 @@ declare class RuleBuilderService {
|
|
|
1637
1668
|
* Get current state
|
|
1638
1669
|
*/
|
|
1639
1670
|
getCurrentState(): RuleBuilderState;
|
|
1671
|
+
/**
|
|
1672
|
+
* Initial empty builder state
|
|
1673
|
+
*/
|
|
1674
|
+
private getInitialState;
|
|
1675
|
+
/**
|
|
1676
|
+
* Add a high-level property rule (bridge method)
|
|
1677
|
+
*/
|
|
1678
|
+
addPropertyRule(rule: FormLayoutRule): string;
|
|
1679
|
+
/**
|
|
1680
|
+
* Update a high-level property rule (bridge method)
|
|
1681
|
+
*/
|
|
1682
|
+
updatePropertyRule(id: string, rule: Partial<FormLayoutRule>): void;
|
|
1640
1683
|
/**
|
|
1641
1684
|
* Add a new rule node
|
|
1642
1685
|
*/
|
|
@@ -1646,7 +1689,7 @@ declare class RuleBuilderService {
|
|
|
1646
1689
|
*/
|
|
1647
1690
|
updateNode(nodeId: string, updates: Partial<RuleNode>): void;
|
|
1648
1691
|
/**
|
|
1649
|
-
* Remove a rule node
|
|
1692
|
+
* Remove a rule node (and its descendants)
|
|
1650
1693
|
*/
|
|
1651
1694
|
removeNode(nodeId: string): void;
|
|
1652
1695
|
/**
|
|
@@ -1654,70 +1697,67 @@ declare class RuleBuilderService {
|
|
|
1654
1697
|
*/
|
|
1655
1698
|
selectNode(nodeId?: string): void;
|
|
1656
1699
|
/**
|
|
1657
|
-
*
|
|
1700
|
+
* Undo last change
|
|
1658
1701
|
*/
|
|
1659
|
-
|
|
1702
|
+
undo(): void;
|
|
1660
1703
|
/**
|
|
1661
|
-
*
|
|
1704
|
+
* Redo previously undone change
|
|
1662
1705
|
*/
|
|
1663
|
-
|
|
1706
|
+
redo(): void;
|
|
1664
1707
|
/**
|
|
1665
|
-
*
|
|
1708
|
+
* Clear all rules
|
|
1666
1709
|
*/
|
|
1667
|
-
|
|
1710
|
+
clear(): void;
|
|
1668
1711
|
/**
|
|
1669
|
-
* Import rules from
|
|
1670
|
-
*
|
|
1671
|
-
* Empty strings or structures with no data are ignored to preserve the
|
|
1672
|
-
* current state. When parsing JSON, the specification type must be
|
|
1673
|
-
* present otherwise an error is thrown, ensuring business rules are
|
|
1674
|
-
* explicit and valid.
|
|
1675
|
-
*
|
|
1676
|
-
* @throws Error when the specification type is missing or the format is
|
|
1677
|
-
* unsupported.
|
|
1712
|
+
* Import rules from supported formats
|
|
1678
1713
|
*/
|
|
1679
1714
|
import(content: string, options: ImportOptions): void;
|
|
1680
1715
|
/**
|
|
1681
|
-
*
|
|
1682
|
-
*/
|
|
1683
|
-
undo(): void;
|
|
1684
|
-
/**
|
|
1685
|
-
* Redo last undone action
|
|
1716
|
+
* Export rules to JSON payload
|
|
1686
1717
|
*/
|
|
1687
|
-
|
|
1718
|
+
export(options: ExportOptions): string;
|
|
1688
1719
|
/**
|
|
1689
|
-
*
|
|
1720
|
+
* Convert current builder state to Specification (best-effort)
|
|
1690
1721
|
*/
|
|
1691
|
-
|
|
1722
|
+
toSpecification(): Specification<any> | null;
|
|
1723
|
+
private updateState;
|
|
1692
1724
|
/**
|
|
1693
|
-
* Validate current rules
|
|
1725
|
+
* Validate current rules (lightweight placeholder)
|
|
1694
1726
|
*/
|
|
1695
1727
|
validateRules(): void;
|
|
1696
1728
|
/**
|
|
1697
|
-
*
|
|
1729
|
+
* Replace builder state with a parsed DSL graph without reinitializing the service.
|
|
1698
1730
|
*/
|
|
1699
|
-
|
|
1731
|
+
loadFromParsedDsl(nodes: Record<string, RuleNode>, rootNodes: string[], description?: string): void;
|
|
1700
1732
|
/**
|
|
1701
|
-
*
|
|
1733
|
+
* Update builder state with a parsed DSL graph while preserving history.
|
|
1702
1734
|
*/
|
|
1703
|
-
|
|
1704
|
-
success: boolean;
|
|
1705
|
-
results: Array<{
|
|
1706
|
-
nodeId: string;
|
|
1707
|
-
result: any;
|
|
1708
|
-
}>;
|
|
1709
|
-
summary: {
|
|
1710
|
-
totalNodes: number;
|
|
1711
|
-
successfulNodes: number;
|
|
1712
|
-
failedNodes: number;
|
|
1713
|
-
totalErrors: number;
|
|
1714
|
-
totalWarnings: number;
|
|
1715
|
-
};
|
|
1716
|
-
};
|
|
1717
|
-
private getInitialState;
|
|
1718
|
-
private updateState;
|
|
1735
|
+
updateFromParsedDsl(nodes: Record<string, RuleNode>, rootNodes: string[], description?: string): void;
|
|
1719
1736
|
private saveSnapshot;
|
|
1720
1737
|
private generateNodeLabel;
|
|
1738
|
+
private isPropertyRuleNode;
|
|
1739
|
+
private containsPropertyRule;
|
|
1740
|
+
/**
|
|
1741
|
+
* Constrói um array de FormLayoutRule a partir do estado atual do builder,
|
|
1742
|
+
* focando em nós propertyRule ou nós com propriedades/targets definidos.
|
|
1743
|
+
*/
|
|
1744
|
+
private exportFormRulesFromState;
|
|
1745
|
+
private toFormLayoutRule;
|
|
1746
|
+
private normalizeTargets;
|
|
1747
|
+
private buildDslFromCondition;
|
|
1748
|
+
private buildDslFromState;
|
|
1749
|
+
private applyBuilderState;
|
|
1750
|
+
private extractFormRules;
|
|
1751
|
+
private isFormRuleCandidate;
|
|
1752
|
+
private validateFormRulesPayload;
|
|
1753
|
+
private sanitizeRuleProperties;
|
|
1754
|
+
private coerceRulePropertyValue;
|
|
1755
|
+
private sanitizeStructuredValue;
|
|
1756
|
+
private formRulesToBuilderState;
|
|
1757
|
+
private inferRuleTypeFromFormRule;
|
|
1758
|
+
private parseSimpleCondition;
|
|
1759
|
+
private normalizeOperator;
|
|
1760
|
+
private prefixTarget;
|
|
1721
1761
|
private buildRuleNodeTree;
|
|
1722
1762
|
private flattenRuleNodeTree;
|
|
1723
1763
|
private validateNode;
|
|
@@ -2306,69 +2346,6 @@ declare class RuleValidationService {
|
|
|
2306
2346
|
static ɵprov: i0.ɵɵInjectableDeclaration<RuleValidationService>;
|
|
2307
2347
|
}
|
|
2308
2348
|
|
|
2309
|
-
/**
|
|
2310
|
-
* Configuration for parsing DSL expressions
|
|
2311
|
-
*/
|
|
2312
|
-
interface DslParsingConfig {
|
|
2313
|
-
/** Available function registry */
|
|
2314
|
-
functionRegistry?: FunctionRegistry<any>;
|
|
2315
|
-
/** Context provider for variable resolution */
|
|
2316
|
-
contextProvider?: ContextProvider;
|
|
2317
|
-
/** Known field names for validation */
|
|
2318
|
-
knownFields?: string[];
|
|
2319
|
-
/** Enable performance warnings */
|
|
2320
|
-
enablePerformanceWarnings?: boolean;
|
|
2321
|
-
/** Maximum expression complexity */
|
|
2322
|
-
maxComplexity?: number;
|
|
2323
|
-
}
|
|
2324
|
-
/**
|
|
2325
|
-
* Result of parsing a DSL expression
|
|
2326
|
-
*/
|
|
2327
|
-
interface DslParsingResult<T extends object = any> {
|
|
2328
|
-
/** Whether parsing was successful */
|
|
2329
|
-
success: boolean;
|
|
2330
|
-
/** Parsed specification (if successful) */
|
|
2331
|
-
specification?: any;
|
|
2332
|
-
/** Validation issues found */
|
|
2333
|
-
issues: ValidationIssue$1[];
|
|
2334
|
-
/** Performance metrics */
|
|
2335
|
-
metrics?: {
|
|
2336
|
-
parseTime: number;
|
|
2337
|
-
complexity: number;
|
|
2338
|
-
};
|
|
2339
|
-
}
|
|
2340
|
-
/**
|
|
2341
|
-
* Dedicated service for DSL parsing and validation
|
|
2342
|
-
* Extracted from SpecificationBridgeService to follow SRP
|
|
2343
|
-
*/
|
|
2344
|
-
declare class DslParsingService {
|
|
2345
|
-
constructor();
|
|
2346
|
-
/**
|
|
2347
|
-
* Parse a DSL expression into a specification
|
|
2348
|
-
*/
|
|
2349
|
-
parseDsl<T extends object = any>(dslExpression: string, config?: DslParsingConfig): DslParsingResult<T>;
|
|
2350
|
-
/**
|
|
2351
|
-
* Validate DSL syntax without parsing
|
|
2352
|
-
*/
|
|
2353
|
-
validateDsl(dslExpression: string, config?: DslParsingConfig): ValidationIssue$1[];
|
|
2354
|
-
/**
|
|
2355
|
-
* Get suggestions for DSL completion
|
|
2356
|
-
*/
|
|
2357
|
-
getDslSuggestions(partialExpression: string, cursorPosition: number, config?: DslParsingConfig): string[];
|
|
2358
|
-
/**
|
|
2359
|
-
* Format DSL expression for readability
|
|
2360
|
-
*/
|
|
2361
|
-
formatDsl(dslExpression: string): string;
|
|
2362
|
-
/**
|
|
2363
|
-
* Check if DSL expression is syntactically valid
|
|
2364
|
-
*/
|
|
2365
|
-
isValidDsl(dslExpression: string, config?: DslParsingConfig): boolean;
|
|
2366
|
-
private calculateComplexity;
|
|
2367
|
-
private getCurrentToken;
|
|
2368
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DslParsingService, never>;
|
|
2369
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DslParsingService>;
|
|
2370
|
-
}
|
|
2371
|
-
|
|
2372
2349
|
/**
|
|
2373
2350
|
* Context variable definition used by the context management service
|
|
2374
2351
|
* Renamed to avoid conflicts with other ContextVariable interfaces
|
|
@@ -2743,78 +2720,74 @@ declare const createError: {
|
|
|
2743
2720
|
internal: (message: string, cause?: Error) => InternalError;
|
|
2744
2721
|
};
|
|
2745
2722
|
|
|
2746
|
-
|
|
2723
|
+
type TargetType = 'field' | 'section' | 'action' | 'row' | 'column';
|
|
2724
|
+
type RuleNodeConfigExtended = RuleNodeConfig & {
|
|
2725
|
+
targetType?: TargetType;
|
|
2726
|
+
properties?: Record<string, any>;
|
|
2727
|
+
propertiesWhenFalse?: Record<string, any>;
|
|
2728
|
+
targets?: string[];
|
|
2729
|
+
condition?: RuleNode | string | null;
|
|
2730
|
+
};
|
|
2731
|
+
declare class RuleEditorComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
|
|
2747
2732
|
private ruleBuilderService;
|
|
2748
2733
|
private fieldSchemaService;
|
|
2734
|
+
private aiResponseValidator;
|
|
2749
2735
|
private snackBar;
|
|
2750
|
-
private fb;
|
|
2751
2736
|
private dialog;
|
|
2737
|
+
private cdr;
|
|
2738
|
+
embedded: boolean;
|
|
2752
2739
|
config: RuleBuilderConfig | null;
|
|
2753
2740
|
initialRules: any;
|
|
2754
|
-
|
|
2755
|
-
|
|
2741
|
+
stateChanged: EventEmitter<RuleBuilderState>;
|
|
2742
|
+
save: EventEmitter<RuleBuilderState>;
|
|
2743
|
+
rulesChanged: EventEmitter<RuleBuilderState>;
|
|
2756
2744
|
exportRequested: EventEmitter<ExportOptions>;
|
|
2757
2745
|
importRequested: EventEmitter<ImportOptions>;
|
|
2746
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
2758
2747
|
private destroy$;
|
|
2759
2748
|
currentState: RuleBuilderState | null;
|
|
2749
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
2750
|
+
showDebugPanel: boolean;
|
|
2760
2751
|
validationErrors: ValidationError$1[];
|
|
2752
|
+
isListPanelOpen: boolean;
|
|
2761
2753
|
selectedNode: RuleNode | null;
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
showValidationErrors: boolean;
|
|
2754
|
+
propertySchemaMap: RulePropertySchema;
|
|
2755
|
+
targetSchemas?: RuleBuilderConfig['targetSchemas'];
|
|
2756
|
+
private lastErrorCount;
|
|
2766
2757
|
get canUndo(): boolean;
|
|
2767
2758
|
get canRedo(): boolean;
|
|
2768
|
-
constructor(ruleBuilderService: RuleBuilderService, fieldSchemaService: FieldSchemaService, snackBar: MatSnackBar,
|
|
2759
|
+
constructor(ruleBuilderService: RuleBuilderService, fieldSchemaService: FieldSchemaService, aiResponseValidator: AiResponseValidatorService, snackBar: MatSnackBar, dialog: MatDialog, cdr: ChangeDetectorRef);
|
|
2769
2760
|
ngOnInit(): void;
|
|
2761
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
2762
|
+
ngAfterViewInit(): void;
|
|
2770
2763
|
ngOnDestroy(): void;
|
|
2771
2764
|
private setupSubscriptions;
|
|
2772
|
-
private initializeBuilder;
|
|
2773
|
-
private importInitialRules;
|
|
2774
|
-
private updateSelectedNode;
|
|
2775
|
-
trackByNodeId(index: number, nodeId: string): string;
|
|
2776
|
-
getNode(nodeId: string): RuleNode | null;
|
|
2777
|
-
getNodeLabel(nodeId: string): string;
|
|
2778
|
-
getNodeIcon(node: RuleNode | null): string;
|
|
2779
|
-
getFieldIcon(type: string): string;
|
|
2780
|
-
isNodeSelected(nodeId: string): boolean;
|
|
2781
|
-
hasChildren(nodeId: string): boolean;
|
|
2782
|
-
getChildren(nodeId: string): string[];
|
|
2783
|
-
getRuleCount(): number;
|
|
2784
|
-
getErrorIcon(severity: string): string;
|
|
2785
|
-
onModeChange(event: MatButtonToggleChange): void;
|
|
2786
|
-
selectNode(nodeId?: string): void;
|
|
2787
|
-
editNode(nodeId: string): void;
|
|
2788
|
-
removeNode(nodeId: string): void;
|
|
2789
|
-
onRuleDrop(event: CdkDragDrop<string[]>): void;
|
|
2790
|
-
onFieldDragStart(field: FieldSchema, event: DragEvent): void;
|
|
2791
|
-
showAddRuleDialog(): void;
|
|
2792
|
-
onNodeAdded(event: {
|
|
2793
|
-
type: RuleNodeType;
|
|
2794
|
-
parentId?: string;
|
|
2795
|
-
config?: RuleNodeConfig;
|
|
2796
|
-
}): void;
|
|
2797
|
-
onNodeUpdated(event: {
|
|
2798
|
-
nodeId: string;
|
|
2799
|
-
updates: Partial<RuleNode>;
|
|
2800
|
-
}): void;
|
|
2801
|
-
onMetadataUpdated(event: any): void;
|
|
2802
|
-
onDslChanged(dsl: string): void;
|
|
2803
|
-
onJsonChanged(json: any): void;
|
|
2804
2765
|
undo(): void;
|
|
2805
2766
|
redo(): void;
|
|
2806
2767
|
clearRules(): void;
|
|
2768
|
+
toggleListPanel(): void;
|
|
2769
|
+
openAiWizard(): void;
|
|
2770
|
+
createRuleFromAI(aiResponse: AiRuleResponse): Promise<void>;
|
|
2771
|
+
private validateAiResponse;
|
|
2772
|
+
addPropertyRule(): void;
|
|
2773
|
+
selectNode(nodeId: string): void;
|
|
2774
|
+
onRuleUpdated(config: RuleNodeConfigExtended): void;
|
|
2775
|
+
removeNode(nodeId: string): void;
|
|
2776
|
+
isPropertyRule(node: RuleNode | null): boolean;
|
|
2777
|
+
private buildPropertyRuleLabel;
|
|
2778
|
+
private stripTargetPrefix;
|
|
2779
|
+
private normalizeRuleConfig;
|
|
2807
2780
|
openExportDialog(): void;
|
|
2808
2781
|
importRules(): void;
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
onLinterRuleToggled(event: any): void;
|
|
2782
|
+
onFileSelected(event: Event): void;
|
|
2783
|
+
getRuleCount(): number;
|
|
2784
|
+
trackByNodeId(index: number, nodeId: string): string;
|
|
2813
2785
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleEditorComponent, never>;
|
|
2814
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RuleEditorComponent, "praxis-rule-editor", never, { "
|
|
2786
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RuleEditorComponent, "praxis-rule-editor", never, { "embedded": { "alias": "embedded"; "required": false; }; "config": { "alias": "config"; "required": false; }; "initialRules": { "alias": "initialRules"; "required": false; }; }, { "stateChanged": "stateChanged"; "save": "save"; "rulesChanged": "rulesChanged"; "exportRequested": "exportRequested"; "importRequested": "importRequested"; }, never, never, true, never>;
|
|
2815
2787
|
}
|
|
2816
2788
|
|
|
2817
2789
|
declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
2790
|
+
conditionOnly: boolean;
|
|
2818
2791
|
state: RuleBuilderState | null;
|
|
2819
2792
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2820
2793
|
nodeSelected: EventEmitter<string>;
|
|
@@ -2838,6 +2811,7 @@ declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
|
2838
2811
|
color: string;
|
|
2839
2812
|
}[];
|
|
2840
2813
|
get isEmpty(): boolean;
|
|
2814
|
+
get filteredAddMenuOptions(): typeof this.addMenuOptions;
|
|
2841
2815
|
constructor();
|
|
2842
2816
|
ngOnInit(): void;
|
|
2843
2817
|
ngOnDestroy(): void;
|
|
@@ -2862,13 +2836,15 @@ declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
|
2862
2836
|
toggleAddMenu(): void;
|
|
2863
2837
|
addFirstRule(): void;
|
|
2864
2838
|
addRule(type: RuleNodeType): void;
|
|
2839
|
+
private isAllowedConditionType;
|
|
2865
2840
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleCanvasComponent, never>;
|
|
2866
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RuleCanvasComponent, "praxis-rule-canvas", never, { "state": { "alias": "state"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; }, { "nodeSelected": "nodeSelected"; "nodeAdded": "nodeAdded"; "nodeUpdated": "nodeUpdated"; "nodeRemoved": "nodeRemoved"; }, never, never, true, never>;
|
|
2841
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RuleCanvasComponent, "praxis-rule-canvas", never, { "conditionOnly": { "alias": "conditionOnly"; "required": false; }; "state": { "alias": "state"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; }, { "nodeSelected": "nodeSelected"; "nodeAdded": "nodeAdded"; "nodeUpdated": "nodeUpdated"; "nodeRemoved": "nodeRemoved"; }, never, never, true, never>;
|
|
2867
2842
|
}
|
|
2868
2843
|
|
|
2869
2844
|
declare class RuleNodeComponent {
|
|
2870
2845
|
private fb;
|
|
2871
2846
|
node: RuleNode | null;
|
|
2847
|
+
nodes: Record<string, RuleNode>;
|
|
2872
2848
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2873
2849
|
level: number;
|
|
2874
2850
|
isSelected: boolean;
|
|
@@ -2929,7 +2905,7 @@ declare class RuleNodeComponent {
|
|
|
2929
2905
|
onChildDrop(event: CdkDragDrop<string[]>): void;
|
|
2930
2906
|
private formatNodeType;
|
|
2931
2907
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleNodeComponent, never>;
|
|
2932
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RuleNodeComponent, "praxis-rule-node", never, { "node": { "alias": "node"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; "level": { "alias": "level"; "required": false; }; "isSelected": { "alias": "isSelected"; "required": false; }; "validationErrors": { "alias": "validationErrors"; "required": false; }; }, { "nodeClicked": "nodeClicked"; "nodeUpdated": "nodeUpdated"; "nodeDeleted": "nodeDeleted"; "childAdded": "childAdded"; "childMoved": "childMoved"; }, never, never, true, never>;
|
|
2908
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RuleNodeComponent, "praxis-rule-node", never, { "node": { "alias": "node"; "required": false; }; "nodes": { "alias": "nodes"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; "level": { "alias": "level"; "required": false; }; "isSelected": { "alias": "isSelected"; "required": false; }; "validationErrors": { "alias": "validationErrors"; "required": false; }; }, { "nodeClicked": "nodeClicked"; "nodeUpdated": "nodeUpdated"; "nodeDeleted": "nodeDeleted"; "childAdded": "childAdded"; "childMoved": "childMoved"; }, never, never, true, never>;
|
|
2933
2909
|
}
|
|
2934
2910
|
|
|
2935
2911
|
declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
@@ -2937,12 +2913,18 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2937
2913
|
config: FieldConditionConfig | null;
|
|
2938
2914
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2939
2915
|
configChanged: EventEmitter<FieldConditionConfig>;
|
|
2916
|
+
searchInput?: ElementRef<HTMLInputElement>;
|
|
2940
2917
|
private destroy$;
|
|
2941
2918
|
conditionForm: FormGroup;
|
|
2919
|
+
searchControl: FormControl<string>;
|
|
2942
2920
|
fieldCategories: {
|
|
2943
2921
|
name: string;
|
|
2944
2922
|
fields: FieldSchema[];
|
|
2945
2923
|
}[];
|
|
2924
|
+
filteredFieldCategories: {
|
|
2925
|
+
name: string;
|
|
2926
|
+
fields: FieldSchema[];
|
|
2927
|
+
}[];
|
|
2946
2928
|
contextVariables: any[];
|
|
2947
2929
|
customFunctions: any[];
|
|
2948
2930
|
selectedField: FieldSchema | null;
|
|
@@ -2950,7 +2932,10 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2950
2932
|
valueType: string;
|
|
2951
2933
|
availableOperators: string[];
|
|
2952
2934
|
constructor(fb: FormBuilder);
|
|
2935
|
+
focusSearchInput(): void;
|
|
2936
|
+
clearSearch(event: Event): void;
|
|
2953
2937
|
ngOnInit(): void;
|
|
2938
|
+
filterCategories(): void;
|
|
2954
2939
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2955
2940
|
ngOnDestroy(): void;
|
|
2956
2941
|
private createForm;
|
|
@@ -2959,6 +2944,9 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2959
2944
|
private loadInitialConfig;
|
|
2960
2945
|
private emitConfigChange;
|
|
2961
2946
|
private processValue;
|
|
2947
|
+
private normalizeFieldName;
|
|
2948
|
+
private resolveFieldSchema;
|
|
2949
|
+
private normalizeOperatorForForm;
|
|
2962
2950
|
getFieldIcon(type: string): string;
|
|
2963
2951
|
getOperatorLabel(operator: string): string;
|
|
2964
2952
|
getValuePlaceholder(): string;
|
|
@@ -2980,6 +2968,7 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2980
2968
|
hasValidationErrors(): boolean;
|
|
2981
2969
|
getValidationErrors(): string[];
|
|
2982
2970
|
isValid(): boolean;
|
|
2971
|
+
hasFieldOptions(): boolean;
|
|
2983
2972
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConditionEditorComponent, never>;
|
|
2984
2973
|
static ɵcmp: i0.ɵɵComponentDeclaration<FieldConditionEditorComponent, "praxis-field-condition-editor", never, { "config": { "alias": "config"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; }, { "configChanged": "configChanged"; }, never, never, true, never>;
|
|
2985
2974
|
}
|
|
@@ -2999,6 +2988,10 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
2999
2988
|
validatorType: string;
|
|
3000
2989
|
targetField: string;
|
|
3001
2990
|
conditionMode: string;
|
|
2991
|
+
validatorTypeLabels: Record<string, {
|
|
2992
|
+
label: string;
|
|
2993
|
+
icon: string;
|
|
2994
|
+
}>;
|
|
3002
2995
|
get showDisabledMessage(): boolean;
|
|
3003
2996
|
constructor(fb: FormBuilder);
|
|
3004
2997
|
ngOnInit(): void;
|
|
@@ -3012,6 +3005,8 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
3012
3005
|
getFieldIcon(type: string): string;
|
|
3013
3006
|
trackByIndex(index: number): number;
|
|
3014
3007
|
getSimpleConditionConfig(): any;
|
|
3008
|
+
getFieldLabel(fieldName: string): string;
|
|
3009
|
+
private findFieldByNameFragment;
|
|
3015
3010
|
getPreviewText(): string;
|
|
3016
3011
|
getLogicPreview(): string;
|
|
3017
3012
|
onValidatorTypeChanged(event: MatSelectChange): void;
|
|
@@ -3025,6 +3020,7 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
3025
3020
|
getValidationErrors(): string[];
|
|
3026
3021
|
isValid(): boolean;
|
|
3027
3022
|
private createEmptyCondition;
|
|
3023
|
+
private isConditionIncomplete;
|
|
3028
3024
|
private mapRuleTypeToValidatorType;
|
|
3029
3025
|
private mapValidatorTypeToRuleType;
|
|
3030
3026
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConditionalValidatorEditorComponent, never>;
|
|
@@ -3088,6 +3084,7 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3088
3084
|
selectedNode: RuleNode | null;
|
|
3089
3085
|
metadataUpdated: EventEmitter<SpecificationMetadata>;
|
|
3090
3086
|
private destroy$;
|
|
3087
|
+
private lastSelectedNodeId;
|
|
3091
3088
|
metadataForm: FormGroup;
|
|
3092
3089
|
activeTabIndex: number;
|
|
3093
3090
|
hasUnsavedChanges: boolean;
|
|
@@ -3118,6 +3115,8 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3118
3115
|
private getDocumentationLinksValue;
|
|
3119
3116
|
private inferType;
|
|
3120
3117
|
private convertValueByType;
|
|
3118
|
+
private normalizePriority;
|
|
3119
|
+
getPriorityLabel(priority: string | null | undefined): string;
|
|
3121
3120
|
getNodeIcon(): string;
|
|
3122
3121
|
getNodeTitle(): string;
|
|
3123
3122
|
getNodeSubtitle(): string;
|
|
@@ -3131,7 +3130,7 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3131
3130
|
static ɵcmp: i0.ɵɵComponentDeclaration<MetadataEditorComponent, "praxis-metadata-editor", never, { "selectedNode": { "alias": "selectedNode"; "required": false; }; }, { "metadataUpdated": "metadataUpdated"; }, never, never, true, never>;
|
|
3132
3131
|
}
|
|
3133
3132
|
|
|
3134
|
-
declare class DslViewerComponent implements OnInit, OnChanges {
|
|
3133
|
+
declare class DslViewerComponent implements OnInit, OnChanges, AfterViewInit {
|
|
3135
3134
|
private snackBar;
|
|
3136
3135
|
dsl: string;
|
|
3137
3136
|
editable: boolean;
|
|
@@ -3143,11 +3142,11 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3143
3142
|
errors: any[];
|
|
3144
3143
|
warnings: any[];
|
|
3145
3144
|
}>;
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
private monacoEditor;
|
|
3145
|
+
editorTextarea?: ElementRef<HTMLTextAreaElement>;
|
|
3146
|
+
syntaxOverlay?: ElementRef<HTMLDivElement>;
|
|
3149
3147
|
private originalDsl;
|
|
3150
|
-
|
|
3148
|
+
private parser;
|
|
3149
|
+
private validator;
|
|
3151
3150
|
hasChanges: boolean;
|
|
3152
3151
|
showErrors: boolean;
|
|
3153
3152
|
syntaxErrors: any[];
|
|
@@ -3156,22 +3155,23 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3156
3155
|
line: number;
|
|
3157
3156
|
column: number;
|
|
3158
3157
|
} | null;
|
|
3158
|
+
currentDsl: string;
|
|
3159
3159
|
showLineNumbers: boolean;
|
|
3160
3160
|
wordWrap: boolean;
|
|
3161
3161
|
showMinimap: boolean;
|
|
3162
|
+
highlightedDsl: string;
|
|
3162
3163
|
constructor(snackBar: MatSnackBar);
|
|
3163
3164
|
ngOnInit(): void;
|
|
3165
|
+
ngAfterViewInit(): void;
|
|
3164
3166
|
ngOnChanges(changes: SimpleChanges): void;
|
|
3165
3167
|
ngOnDestroy(): void;
|
|
3166
|
-
|
|
3167
|
-
private
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
private setupEditorEvents;
|
|
3171
|
-
private updateEditorContent;
|
|
3168
|
+
get themeClass(): string;
|
|
3169
|
+
private setEditorValue;
|
|
3170
|
+
getEditorValue(): string;
|
|
3171
|
+
onEditorInput(event: Event): void;
|
|
3172
3172
|
private updateEditorOptions;
|
|
3173
|
-
|
|
3174
|
-
|
|
3173
|
+
syncScroll(): void;
|
|
3174
|
+
updateCursorPosition(): void;
|
|
3175
3175
|
private validateSyntaxDebounced;
|
|
3176
3176
|
private debounce;
|
|
3177
3177
|
getValidationStatusClass(): string;
|
|
@@ -3191,8 +3191,8 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3191
3191
|
hideErrorDetails(): void;
|
|
3192
3192
|
goToError(error: any): void;
|
|
3193
3193
|
private formatDslCode;
|
|
3194
|
-
private calculateIndentationDepth;
|
|
3195
3194
|
private validateDslSyntax;
|
|
3195
|
+
private updateSyntaxHighlighting;
|
|
3196
3196
|
static ɵfac: i0.ɵɵFactoryDeclaration<DslViewerComponent, never>;
|
|
3197
3197
|
static ɵcmp: i0.ɵɵComponentDeclaration<DslViewerComponent, "praxis-dsl-viewer", never, { "dsl": { "alias": "dsl"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "language": { "alias": "language"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, { "dslChanged": "dslChanged"; "validationChanged": "validationChanged"; }, never, never, true, never>;
|
|
3198
3198
|
}
|
|
@@ -3226,6 +3226,7 @@ declare class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
3226
3226
|
downloadJson(): void;
|
|
3227
3227
|
toggleLineNumbers(): void;
|
|
3228
3228
|
toggleWordWrap(): void;
|
|
3229
|
+
private syncWordWrapWithMode;
|
|
3229
3230
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonViewerComponent, never>;
|
|
3230
3231
|
static ɵcmp: i0.ɵɵComponentDeclaration<JsonViewerComponent, "praxis-json-viewer", never, { "json": { "alias": "json"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; }, { "jsonChanged": "jsonChanged"; }, never, never, true, never>;
|
|
3231
3232
|
}
|
|
@@ -3235,13 +3236,14 @@ declare class RoundTripTesterComponent implements OnInit {
|
|
|
3235
3236
|
private ruleBuilderService;
|
|
3236
3237
|
private snackBar;
|
|
3237
3238
|
private cdr;
|
|
3239
|
+
private nodeRegistry;
|
|
3238
3240
|
isRunning: boolean;
|
|
3239
3241
|
showTestCases: boolean;
|
|
3240
3242
|
lastTestResult: RoundTripValidationResult | null;
|
|
3241
3243
|
testSuiteResults: any;
|
|
3242
3244
|
defaultTestCases: RoundTripTestCase[];
|
|
3243
3245
|
hasCurrentRule: boolean;
|
|
3244
|
-
constructor(roundTripValidator: RoundTripValidatorService, ruleBuilderService: RuleBuilderService, snackBar: MatSnackBar, cdr: ChangeDetectorRef);
|
|
3246
|
+
constructor(roundTripValidator: RoundTripValidatorService, ruleBuilderService: RuleBuilderService, snackBar: MatSnackBar, cdr: ChangeDetectorRef, nodeRegistry: RuleNodeRegistryService);
|
|
3245
3247
|
ngOnInit(): void;
|
|
3246
3248
|
private loadDefaultTestCases;
|
|
3247
3249
|
private checkCurrentRule;
|
|
@@ -3269,6 +3271,7 @@ interface ExportDialogData {
|
|
|
3269
3271
|
preselectedFormat?: string;
|
|
3270
3272
|
showIntegrationTab?: boolean;
|
|
3271
3273
|
showSharingTab?: boolean;
|
|
3274
|
+
onExport?: (options: ExportOptions) => void;
|
|
3272
3275
|
}
|
|
3273
3276
|
declare class ExportDialogComponent implements OnInit {
|
|
3274
3277
|
dialogRef: MatDialogRef<ExportDialogComponent>;
|
|
@@ -3416,6 +3419,8 @@ declare class DslLinterComponent implements OnInit, OnDestroy {
|
|
|
3416
3419
|
private applyFilters;
|
|
3417
3420
|
trackByErrorId(index: number, error: DslLintError): string;
|
|
3418
3421
|
getSeverityIcon(severity: string): string;
|
|
3422
|
+
translateSeverity(severity: string): string;
|
|
3423
|
+
translateCategory(category: string): string;
|
|
3419
3424
|
getComplexityClass(complexity: number): string;
|
|
3420
3425
|
getMaintainabilityClass(maintainability: number): string;
|
|
3421
3426
|
getIssueDistribution(): any[];
|
|
@@ -3596,5 +3601,29 @@ declare class TemplatePreviewDialogComponent {
|
|
|
3596
3601
|
static ɵcmp: i0.ɵɵComponentDeclaration<TemplatePreviewDialogComponent, "praxis-template-preview-dialog", never, {}, {}, never, never, true, never>;
|
|
3597
3602
|
}
|
|
3598
3603
|
|
|
3599
|
-
|
|
3600
|
-
|
|
3604
|
+
type RuleListItem = string | RuleNode;
|
|
3605
|
+
declare class RuleListComponent {
|
|
3606
|
+
rules: RuleListItem[];
|
|
3607
|
+
selectedRuleId: string;
|
|
3608
|
+
nodeMap: Record<string, RuleNode>;
|
|
3609
|
+
ruleSelected: EventEmitter<string>;
|
|
3610
|
+
ruleDeleted: EventEmitter<string>;
|
|
3611
|
+
ruleAdded: EventEmitter<void>;
|
|
3612
|
+
searchTerm: string;
|
|
3613
|
+
get filteredRules(): RuleListItem[];
|
|
3614
|
+
trackById: (_index: number, item: RuleListItem) => string;
|
|
3615
|
+
isSelected(item: RuleListItem): boolean;
|
|
3616
|
+
getLabel(item: RuleListItem): string;
|
|
3617
|
+
getDescription(item: RuleListItem): string | undefined;
|
|
3618
|
+
getTooltip(item: RuleListItem): string;
|
|
3619
|
+
private getItemId;
|
|
3620
|
+
onSelect(item: RuleListItem): void;
|
|
3621
|
+
onDelete(item: RuleListItem, event: MouseEvent): void;
|
|
3622
|
+
onKeySelect(item: RuleListItem, event: Event): void;
|
|
3623
|
+
onAddRule(): void;
|
|
3624
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RuleListComponent, never>;
|
|
3625
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RuleListComponent, "praxis-rule-list", never, { "rules": { "alias": "rules"; "required": false; }; "selectedRuleId": { "alias": "selectedRuleId"; "required": false; }; "nodeMap": { "alias": "nodeMap"; "required": false; }; }, { "ruleSelected": "ruleSelected"; "ruleDeleted": "ruleDeleted"; "ruleAdded": "ruleAdded"; }, never, never, true, never>;
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ConverterFactoryService, DslError, DslLinterComponent, DslViewerComponent, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PraxisVisualBuilder, RegistryError, RoundTripTesterComponent, RoundTripValidatorService, RuleBuilderService, RuleCanvasComponent, RuleConversionService, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, SpecificationBridgeService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema };
|
|
3629
|
+
export type { ArrayCollectionValidationRule, ArrayFieldSchema, ArrayValidationContext, ArrayValidationError, BooleanGroupConfig, CardinalityConfig, CircularReference, CleanupResult, CollectionValidationConfig, CollectionValidatorConfig, ConditionalValidatorConfig, ConditionalValidatorPreview, ContextEntry, ContextScope, ContextValue, ContextVariable, ContextualConfig$1 as ContextualConfig, ContextualTemplateConfig, ConversionStatistics, ConversionValidationResult, ConverterStatistics, CustomConfig, CustomFunction, DslEdit, DslLintError, DslLintRule, DslLintStats, DslQuickFix, EnhancedFieldSchema, ErrorInfo, ErrorStatistics, ExportDialogData, ExportFormat, ExportOptions, ExportResult, ExpressionConfig, ExternalSystemConfig, FieldConditionConfig, FieldFormat, FieldOption, FieldSchema, FieldSchemaContext, FieldToFieldConfig, FieldUIConfig, FunctionCallConfig, FunctionParameter, ImportOptions, IntegrationEndpoint, IntegrationResult, MemoryStats, OptionalFieldConfig, PropertyRuleConfig, RegistryIntegrityResult, RegistryValidationResult, RoundTripTestCase, RoundTripValidationResult, RuleBuilderConfig, RuleBuilderSnapshot, RuleBuilderState, RuleNode, RuleNodeConfig, RuleNodeTree, RuleNodeTypeString, RuleTemplate, RuleValidationResult, SpecificationContextualConfig, TemplateApplicationResult, TemplateCategory, TemplateDisplayMode, TemplateEditorDialogData, TemplateEditorResult, TemplateMetadata, TemplatePreviewDialogData, TemplateSearchCriteria, TemplateSortOption, TemplateStats, TemplateValidationResult, ValidComparisonOperator, ValidationConfig, ValidationContext, ValidationError$1 as ValidationError, ValidationIssue, ValidationResult, ValidationRule, ValueType, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };
|