@cqa-lib/cqa-ui 1.1.493 → 1.1.494
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/esm2020/lib/mixed-variable-input/mixed-variable-input.component.mjs +372 -98
- package/esm2020/lib/step-builder/template-variables-form/template-variables-form.component.mjs +31 -3
- package/fesm2015/cqa-lib-cqa-ui.mjs +410 -100
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +404 -102
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/mixed-variable-input/mixed-variable-input.component.d.ts +30 -3
- package/lib/step-builder/template-variables-form/template-variables-form.component.d.ts +7 -0
- package/package.json +1 -1
- package/styles.css +1 -1
|
@@ -4,6 +4,10 @@ export interface MixedSegment {
|
|
|
4
4
|
type: 'text' | 'variable';
|
|
5
5
|
value: string;
|
|
6
6
|
}
|
|
7
|
+
export interface MixedVariableValidity {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
}
|
|
7
11
|
export declare class MixedVariableInputComponent implements OnChanges, AfterViewInit {
|
|
8
12
|
private cdr;
|
|
9
13
|
private hostRef;
|
|
@@ -11,31 +15,54 @@ export declare class MixedVariableInputComponent implements OnChanges, AfterView
|
|
|
11
15
|
placeholder: string;
|
|
12
16
|
disabled: boolean;
|
|
13
17
|
valueChange: EventEmitter<string>;
|
|
18
|
+
validityChange: EventEmitter<MixedVariableValidity>;
|
|
14
19
|
editorRef: ElementRef<HTMLDivElement>;
|
|
15
20
|
showSuggestion: boolean;
|
|
16
21
|
pendingWord: string;
|
|
22
|
+
canAddAsVariable: boolean;
|
|
23
|
+
errorMessage: string | null;
|
|
24
|
+
private selectionRange;
|
|
25
|
+
private selectionMode;
|
|
17
26
|
private lastEmitted;
|
|
27
|
+
private lastValid;
|
|
18
28
|
constructor(cdr: ChangeDetectorRef, hostRef: ElementRef<HTMLElement>);
|
|
19
|
-
onDocumentMouseDown(event: MouseEvent): void;
|
|
20
29
|
ngOnChanges(changes: SimpleChanges): void;
|
|
21
30
|
ngAfterViewInit(): void;
|
|
22
31
|
onInput(): void;
|
|
23
|
-
|
|
32
|
+
onEditorFocus(): void;
|
|
24
33
|
onEditorBlur(): void;
|
|
34
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
35
|
+
onPaste(event: ClipboardEvent): void;
|
|
36
|
+
onDrop(event: DragEvent): void;
|
|
37
|
+
onDragStart(event: DragEvent): void;
|
|
38
|
+
onDocumentMouseDown(event: MouseEvent): void;
|
|
39
|
+
onDocumentSelectionChange(): void;
|
|
25
40
|
addAsText(): void;
|
|
26
41
|
addAsVariable(): void;
|
|
42
|
+
private emitValue;
|
|
43
|
+
private validate;
|
|
44
|
+
private findValidationError;
|
|
27
45
|
private refreshSuggestion;
|
|
28
46
|
private hideSuggestion;
|
|
47
|
+
private normalizeCandidate;
|
|
48
|
+
private flattenStructure;
|
|
49
|
+
private sanitizeChips;
|
|
29
50
|
private autoChipify;
|
|
51
|
+
private collectDescendantTextNodes;
|
|
30
52
|
private render;
|
|
31
53
|
private serialize;
|
|
32
54
|
private buildChip;
|
|
33
55
|
private getSelectionRange;
|
|
56
|
+
private getSelectedInfo;
|
|
57
|
+
private rangeCrossesChip;
|
|
34
58
|
private getNodeBeforeCaret;
|
|
35
59
|
private getCurrentWord;
|
|
60
|
+
private insertChipReplacingRange;
|
|
36
61
|
private insertChipReplacingCurrentWord;
|
|
62
|
+
private stripBracesAround;
|
|
63
|
+
private insertPlainTextAtCaret;
|
|
37
64
|
private placeCaretAfter;
|
|
38
65
|
private placeCaretAtEnd;
|
|
39
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<MixedVariableInputComponent, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MixedVariableInputComponent, "cqa-mixed-variable-input", never, { "value": "value"; "placeholder": "placeholder"; "disabled": "disabled"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MixedVariableInputComponent, "cqa-mixed-variable-input", never, { "value": "value"; "placeholder": "placeholder"; "disabled": "disabled"; }, { "valueChange": "valueChange"; "validityChange": "validityChange"; }, never, never>;
|
|
41
68
|
}
|
|
@@ -173,6 +173,13 @@ export declare class TemplateVariablesFormComponent implements OnChanges {
|
|
|
173
173
|
key: string;
|
|
174
174
|
query: string;
|
|
175
175
|
}): void;
|
|
176
|
+
private readonly variableSyntaxErrors;
|
|
177
|
+
private readonly controlsWithSyntaxValidator;
|
|
178
|
+
private makeSyntaxValidator;
|
|
179
|
+
onTestDataValidityChange(variableName: string, event: {
|
|
180
|
+
valid: boolean;
|
|
181
|
+
error: string | null;
|
|
182
|
+
}): void;
|
|
176
183
|
onTestDataValueChange(variableName: string, rawValue: string): void;
|
|
177
184
|
/**
|
|
178
185
|
* Get unique test data profiles from parameter options (raw TestData objects)
|