@praxisui/visual-builder 1.0.0-beta.30 → 1.0.0-beta.40
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/fesm2022/praxisui-visual-builder.mjs +20584 -17541
- package/fesm2022/praxisui-visual-builder.mjs.map +1 -1
- package/index.d.ts +257 -232
- package/package.json +4 -4
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
|
-
*
|
|
1716
|
+
* Export rules to JSON payload
|
|
1682
1717
|
*/
|
|
1683
|
-
|
|
1684
|
-
/**
|
|
1685
|
-
* Redo last undone action
|
|
1686
|
-
*/
|
|
1687
|
-
redo(): void;
|
|
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,81 +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;
|
|
2760
|
-
|
|
2749
|
+
fieldSchemas: Record<string, FieldSchema>;
|
|
2750
|
+
showDebugPanel: boolean;
|
|
2761
2751
|
validationErrors: ValidationError$1[];
|
|
2752
|
+
isListPanelOpen: boolean;
|
|
2762
2753
|
selectedNode: RuleNode | null;
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
showValidationErrors: boolean;
|
|
2754
|
+
propertySchemaMap: RulePropertySchema;
|
|
2755
|
+
targetSchemas?: RuleBuilderConfig['targetSchemas'];
|
|
2756
|
+
private lastErrorCount;
|
|
2767
2757
|
get canUndo(): boolean;
|
|
2768
2758
|
get canRedo(): boolean;
|
|
2769
|
-
constructor(ruleBuilderService: RuleBuilderService, fieldSchemaService: FieldSchemaService, snackBar: MatSnackBar,
|
|
2759
|
+
constructor(ruleBuilderService: RuleBuilderService, fieldSchemaService: FieldSchemaService, aiResponseValidator: AiResponseValidatorService, snackBar: MatSnackBar, dialog: MatDialog, cdr: ChangeDetectorRef);
|
|
2770
2760
|
ngOnInit(): void;
|
|
2771
|
-
ngOnDestroy(): void;
|
|
2772
2761
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2762
|
+
ngAfterViewInit(): void;
|
|
2763
|
+
ngOnDestroy(): void;
|
|
2773
2764
|
private setupSubscriptions;
|
|
2774
|
-
private initializeBuilder;
|
|
2775
|
-
private updateBuilderStateJson;
|
|
2776
|
-
private importInitialRules;
|
|
2777
|
-
private updateSelectedNode;
|
|
2778
|
-
trackByNodeId(index: number, nodeId: string): string;
|
|
2779
|
-
getNode(nodeId: string): RuleNode | null;
|
|
2780
|
-
getNodeLabel(nodeId: string): string;
|
|
2781
|
-
getNodeIcon(node: RuleNode | null): string;
|
|
2782
|
-
getFieldIcon(type: string): string;
|
|
2783
|
-
isNodeSelected(nodeId: string): boolean;
|
|
2784
|
-
hasChildren(nodeId: string): boolean;
|
|
2785
|
-
getChildren(nodeId: string): string[];
|
|
2786
|
-
getRuleCount(): number;
|
|
2787
|
-
getErrorIcon(severity: string): string;
|
|
2788
|
-
onModeChange(event: MatButtonToggleChange): void;
|
|
2789
|
-
selectNode(nodeId?: string): void;
|
|
2790
|
-
editNode(nodeId: string): void;
|
|
2791
|
-
removeNode(nodeId: string): void;
|
|
2792
|
-
onRuleDrop(event: CdkDragDrop<string[]>): void;
|
|
2793
|
-
onFieldDragStart(field: FieldSchema, event: DragEvent): void;
|
|
2794
|
-
showAddRuleDialog(): void;
|
|
2795
|
-
onNodeAdded(event: {
|
|
2796
|
-
type: RuleNodeType;
|
|
2797
|
-
parentId?: string;
|
|
2798
|
-
config?: RuleNodeConfig;
|
|
2799
|
-
}): void;
|
|
2800
|
-
onNodeUpdated(event: {
|
|
2801
|
-
nodeId: string;
|
|
2802
|
-
updates: Partial<RuleNode>;
|
|
2803
|
-
}): void;
|
|
2804
|
-
onMetadataUpdated(event: any): void;
|
|
2805
|
-
onDslChanged(dsl: string): void;
|
|
2806
|
-
onJsonChanged(json: any): void;
|
|
2807
2765
|
undo(): void;
|
|
2808
2766
|
redo(): void;
|
|
2809
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;
|
|
2810
2780
|
openExportDialog(): void;
|
|
2811
2781
|
importRules(): void;
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
onLinterRuleToggled(event: any): void;
|
|
2782
|
+
onFileSelected(event: Event): void;
|
|
2783
|
+
getRuleCount(): number;
|
|
2784
|
+
trackByNodeId(index: number, nodeId: string): string;
|
|
2816
2785
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleEditorComponent, never>;
|
|
2817
|
-
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>;
|
|
2818
2787
|
}
|
|
2819
2788
|
|
|
2820
2789
|
declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
2790
|
+
conditionOnly: boolean;
|
|
2821
2791
|
state: RuleBuilderState | null;
|
|
2822
2792
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2823
2793
|
nodeSelected: EventEmitter<string>;
|
|
@@ -2841,6 +2811,7 @@ declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
|
2841
2811
|
color: string;
|
|
2842
2812
|
}[];
|
|
2843
2813
|
get isEmpty(): boolean;
|
|
2814
|
+
get filteredAddMenuOptions(): typeof this.addMenuOptions;
|
|
2844
2815
|
constructor();
|
|
2845
2816
|
ngOnInit(): void;
|
|
2846
2817
|
ngOnDestroy(): void;
|
|
@@ -2865,13 +2836,15 @@ declare class RuleCanvasComponent implements OnInit, OnDestroy {
|
|
|
2865
2836
|
toggleAddMenu(): void;
|
|
2866
2837
|
addFirstRule(): void;
|
|
2867
2838
|
addRule(type: RuleNodeType): void;
|
|
2839
|
+
private isAllowedConditionType;
|
|
2868
2840
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleCanvasComponent, never>;
|
|
2869
|
-
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>;
|
|
2870
2842
|
}
|
|
2871
2843
|
|
|
2872
2844
|
declare class RuleNodeComponent {
|
|
2873
2845
|
private fb;
|
|
2874
2846
|
node: RuleNode | null;
|
|
2847
|
+
nodes: Record<string, RuleNode>;
|
|
2875
2848
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2876
2849
|
level: number;
|
|
2877
2850
|
isSelected: boolean;
|
|
@@ -2932,7 +2905,7 @@ declare class RuleNodeComponent {
|
|
|
2932
2905
|
onChildDrop(event: CdkDragDrop<string[]>): void;
|
|
2933
2906
|
private formatNodeType;
|
|
2934
2907
|
static ɵfac: i0.ɵɵFactoryDeclaration<RuleNodeComponent, never>;
|
|
2935
|
-
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>;
|
|
2936
2909
|
}
|
|
2937
2910
|
|
|
2938
2911
|
declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
@@ -2940,12 +2913,18 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2940
2913
|
config: FieldConditionConfig | null;
|
|
2941
2914
|
fieldSchemas: Record<string, FieldSchema>;
|
|
2942
2915
|
configChanged: EventEmitter<FieldConditionConfig>;
|
|
2916
|
+
searchInput?: ElementRef<HTMLInputElement>;
|
|
2943
2917
|
private destroy$;
|
|
2944
2918
|
conditionForm: FormGroup;
|
|
2919
|
+
searchControl: FormControl<string>;
|
|
2945
2920
|
fieldCategories: {
|
|
2946
2921
|
name: string;
|
|
2947
2922
|
fields: FieldSchema[];
|
|
2948
2923
|
}[];
|
|
2924
|
+
filteredFieldCategories: {
|
|
2925
|
+
name: string;
|
|
2926
|
+
fields: FieldSchema[];
|
|
2927
|
+
}[];
|
|
2949
2928
|
contextVariables: any[];
|
|
2950
2929
|
customFunctions: any[];
|
|
2951
2930
|
selectedField: FieldSchema | null;
|
|
@@ -2953,7 +2932,10 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2953
2932
|
valueType: string;
|
|
2954
2933
|
availableOperators: string[];
|
|
2955
2934
|
constructor(fb: FormBuilder);
|
|
2935
|
+
focusSearchInput(): void;
|
|
2936
|
+
clearSearch(event: Event): void;
|
|
2956
2937
|
ngOnInit(): void;
|
|
2938
|
+
filterCategories(): void;
|
|
2957
2939
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2958
2940
|
ngOnDestroy(): void;
|
|
2959
2941
|
private createForm;
|
|
@@ -2962,6 +2944,9 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2962
2944
|
private loadInitialConfig;
|
|
2963
2945
|
private emitConfigChange;
|
|
2964
2946
|
private processValue;
|
|
2947
|
+
private normalizeFieldName;
|
|
2948
|
+
private resolveFieldSchema;
|
|
2949
|
+
private normalizeOperatorForForm;
|
|
2965
2950
|
getFieldIcon(type: string): string;
|
|
2966
2951
|
getOperatorLabel(operator: string): string;
|
|
2967
2952
|
getValuePlaceholder(): string;
|
|
@@ -2983,6 +2968,7 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
|
|
|
2983
2968
|
hasValidationErrors(): boolean;
|
|
2984
2969
|
getValidationErrors(): string[];
|
|
2985
2970
|
isValid(): boolean;
|
|
2971
|
+
hasFieldOptions(): boolean;
|
|
2986
2972
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConditionEditorComponent, never>;
|
|
2987
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>;
|
|
2988
2974
|
}
|
|
@@ -3002,6 +2988,10 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
3002
2988
|
validatorType: string;
|
|
3003
2989
|
targetField: string;
|
|
3004
2990
|
conditionMode: string;
|
|
2991
|
+
validatorTypeLabels: Record<string, {
|
|
2992
|
+
label: string;
|
|
2993
|
+
icon: string;
|
|
2994
|
+
}>;
|
|
3005
2995
|
get showDisabledMessage(): boolean;
|
|
3006
2996
|
constructor(fb: FormBuilder);
|
|
3007
2997
|
ngOnInit(): void;
|
|
@@ -3015,6 +3005,8 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
3015
3005
|
getFieldIcon(type: string): string;
|
|
3016
3006
|
trackByIndex(index: number): number;
|
|
3017
3007
|
getSimpleConditionConfig(): any;
|
|
3008
|
+
getFieldLabel(fieldName: string): string;
|
|
3009
|
+
private findFieldByNameFragment;
|
|
3018
3010
|
getPreviewText(): string;
|
|
3019
3011
|
getLogicPreview(): string;
|
|
3020
3012
|
onValidatorTypeChanged(event: MatSelectChange): void;
|
|
@@ -3028,6 +3020,7 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
|
|
|
3028
3020
|
getValidationErrors(): string[];
|
|
3029
3021
|
isValid(): boolean;
|
|
3030
3022
|
private createEmptyCondition;
|
|
3023
|
+
private isConditionIncomplete;
|
|
3031
3024
|
private mapRuleTypeToValidatorType;
|
|
3032
3025
|
private mapValidatorTypeToRuleType;
|
|
3033
3026
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConditionalValidatorEditorComponent, never>;
|
|
@@ -3091,6 +3084,7 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3091
3084
|
selectedNode: RuleNode | null;
|
|
3092
3085
|
metadataUpdated: EventEmitter<SpecificationMetadata>;
|
|
3093
3086
|
private destroy$;
|
|
3087
|
+
private lastSelectedNodeId;
|
|
3094
3088
|
metadataForm: FormGroup;
|
|
3095
3089
|
activeTabIndex: number;
|
|
3096
3090
|
hasUnsavedChanges: boolean;
|
|
@@ -3121,6 +3115,8 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3121
3115
|
private getDocumentationLinksValue;
|
|
3122
3116
|
private inferType;
|
|
3123
3117
|
private convertValueByType;
|
|
3118
|
+
private normalizePriority;
|
|
3119
|
+
getPriorityLabel(priority: string | null | undefined): string;
|
|
3124
3120
|
getNodeIcon(): string;
|
|
3125
3121
|
getNodeTitle(): string;
|
|
3126
3122
|
getNodeSubtitle(): string;
|
|
@@ -3134,9 +3130,8 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
|
|
|
3134
3130
|
static ɵcmp: i0.ɵɵComponentDeclaration<MetadataEditorComponent, "praxis-metadata-editor", never, { "selectedNode": { "alias": "selectedNode"; "required": false; }; }, { "metadataUpdated": "metadataUpdated"; }, never, never, true, never>;
|
|
3135
3131
|
}
|
|
3136
3132
|
|
|
3137
|
-
declare class DslViewerComponent implements OnInit, OnChanges {
|
|
3133
|
+
declare class DslViewerComponent implements OnInit, OnChanges, AfterViewInit {
|
|
3138
3134
|
private snackBar;
|
|
3139
|
-
private cdr;
|
|
3140
3135
|
dsl: string;
|
|
3141
3136
|
editable: boolean;
|
|
3142
3137
|
language: string;
|
|
@@ -3147,11 +3142,11 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3147
3142
|
errors: any[];
|
|
3148
3143
|
warnings: any[];
|
|
3149
3144
|
}>;
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
private monacoEditor;
|
|
3145
|
+
editorTextarea?: ElementRef<HTMLTextAreaElement>;
|
|
3146
|
+
syntaxOverlay?: ElementRef<HTMLDivElement>;
|
|
3153
3147
|
private originalDsl;
|
|
3154
|
-
|
|
3148
|
+
private parser;
|
|
3149
|
+
private validator;
|
|
3155
3150
|
hasChanges: boolean;
|
|
3156
3151
|
showErrors: boolean;
|
|
3157
3152
|
syntaxErrors: any[];
|
|
@@ -3160,22 +3155,23 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3160
3155
|
line: number;
|
|
3161
3156
|
column: number;
|
|
3162
3157
|
} | null;
|
|
3158
|
+
currentDsl: string;
|
|
3163
3159
|
showLineNumbers: boolean;
|
|
3164
3160
|
wordWrap: boolean;
|
|
3165
3161
|
showMinimap: boolean;
|
|
3166
|
-
|
|
3162
|
+
highlightedDsl: string;
|
|
3163
|
+
constructor(snackBar: MatSnackBar);
|
|
3167
3164
|
ngOnInit(): void;
|
|
3165
|
+
ngAfterViewInit(): void;
|
|
3168
3166
|
ngOnChanges(changes: SimpleChanges): void;
|
|
3169
3167
|
ngOnDestroy(): void;
|
|
3170
|
-
|
|
3171
|
-
private
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
private setupEditorEvents;
|
|
3175
|
-
private updateEditorContent;
|
|
3168
|
+
get themeClass(): string;
|
|
3169
|
+
private setEditorValue;
|
|
3170
|
+
getEditorValue(): string;
|
|
3171
|
+
onEditorInput(event: Event): void;
|
|
3176
3172
|
private updateEditorOptions;
|
|
3177
|
-
|
|
3178
|
-
|
|
3173
|
+
syncScroll(): void;
|
|
3174
|
+
updateCursorPosition(): void;
|
|
3179
3175
|
private validateSyntaxDebounced;
|
|
3180
3176
|
private debounce;
|
|
3181
3177
|
getValidationStatusClass(): string;
|
|
@@ -3195,8 +3191,8 @@ declare class DslViewerComponent implements OnInit, OnChanges {
|
|
|
3195
3191
|
hideErrorDetails(): void;
|
|
3196
3192
|
goToError(error: any): void;
|
|
3197
3193
|
private formatDslCode;
|
|
3198
|
-
private calculateIndentationDepth;
|
|
3199
3194
|
private validateDslSyntax;
|
|
3195
|
+
private updateSyntaxHighlighting;
|
|
3200
3196
|
static ɵfac: i0.ɵɵFactoryDeclaration<DslViewerComponent, never>;
|
|
3201
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>;
|
|
3202
3198
|
}
|
|
@@ -3230,6 +3226,7 @@ declare class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
3230
3226
|
downloadJson(): void;
|
|
3231
3227
|
toggleLineNumbers(): void;
|
|
3232
3228
|
toggleWordWrap(): void;
|
|
3229
|
+
private syncWordWrapWithMode;
|
|
3233
3230
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonViewerComponent, never>;
|
|
3234
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>;
|
|
3235
3232
|
}
|
|
@@ -3239,13 +3236,14 @@ declare class RoundTripTesterComponent implements OnInit {
|
|
|
3239
3236
|
private ruleBuilderService;
|
|
3240
3237
|
private snackBar;
|
|
3241
3238
|
private cdr;
|
|
3239
|
+
private nodeRegistry;
|
|
3242
3240
|
isRunning: boolean;
|
|
3243
3241
|
showTestCases: boolean;
|
|
3244
3242
|
lastTestResult: RoundTripValidationResult | null;
|
|
3245
3243
|
testSuiteResults: any;
|
|
3246
3244
|
defaultTestCases: RoundTripTestCase[];
|
|
3247
3245
|
hasCurrentRule: boolean;
|
|
3248
|
-
constructor(roundTripValidator: RoundTripValidatorService, ruleBuilderService: RuleBuilderService, snackBar: MatSnackBar, cdr: ChangeDetectorRef);
|
|
3246
|
+
constructor(roundTripValidator: RoundTripValidatorService, ruleBuilderService: RuleBuilderService, snackBar: MatSnackBar, cdr: ChangeDetectorRef, nodeRegistry: RuleNodeRegistryService);
|
|
3249
3247
|
ngOnInit(): void;
|
|
3250
3248
|
private loadDefaultTestCases;
|
|
3251
3249
|
private checkCurrentRule;
|
|
@@ -3273,6 +3271,7 @@ interface ExportDialogData {
|
|
|
3273
3271
|
preselectedFormat?: string;
|
|
3274
3272
|
showIntegrationTab?: boolean;
|
|
3275
3273
|
showSharingTab?: boolean;
|
|
3274
|
+
onExport?: (options: ExportOptions) => void;
|
|
3276
3275
|
}
|
|
3277
3276
|
declare class ExportDialogComponent implements OnInit {
|
|
3278
3277
|
dialogRef: MatDialogRef<ExportDialogComponent>;
|
|
@@ -3420,6 +3419,8 @@ declare class DslLinterComponent implements OnInit, OnDestroy {
|
|
|
3420
3419
|
private applyFilters;
|
|
3421
3420
|
trackByErrorId(index: number, error: DslLintError): string;
|
|
3422
3421
|
getSeverityIcon(severity: string): string;
|
|
3422
|
+
translateSeverity(severity: string): string;
|
|
3423
|
+
translateCategory(category: string): string;
|
|
3423
3424
|
getComplexityClass(complexity: number): string;
|
|
3424
3425
|
getMaintainabilityClass(maintainability: number): string;
|
|
3425
3426
|
getIssueDistribution(): any[];
|
|
@@ -3600,5 +3601,29 @@ declare class TemplatePreviewDialogComponent {
|
|
|
3600
3601
|
static ɵcmp: i0.ɵɵComponentDeclaration<TemplatePreviewDialogComponent, "praxis-template-preview-dialog", never, {}, {}, never, never, true, never>;
|
|
3601
3602
|
}
|
|
3602
3603
|
|
|
3603
|
-
|
|
3604
|
-
|
|
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 };
|