@singularsystems/neo-core 1.0.10 → 1.0.11
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/dist/Validation/ValidationState.d.ts +3 -0
- package/dist/Validation/ValidationState.js +12 -0
- package/dist/Validation/Validators/IModelValidator.d.ts +2 -0
- package/dist/Validation/Validators/ModelValidator.d.ts +1 -0
- package/dist/Validation/Validators/ModelValidator.js +7 -0
- package/dist/Validation/Validators/PropertyValidator.d.ts +1 -1
- package/dist/Validation/Validators/PropertyValidator.js +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,9 @@ export declare class ContainerValidationState extends ValidationState {
|
|
|
32
32
|
private displayInfoSome;
|
|
33
33
|
brokenRules: Array<RuleContextBase>;
|
|
34
34
|
get hasDetail(): boolean;
|
|
35
|
+
private _isBusy;
|
|
36
|
+
/** Indicates that an async rule is in progress. */
|
|
37
|
+
get isBusy(): boolean;
|
|
35
38
|
/**
|
|
36
39
|
* Gets the error display information.
|
|
37
40
|
* @param canDisplayAll True if the bound controls have de-focused, or the form attempted to submit.
|
|
@@ -37,6 +37,7 @@ var ContainerValidationState = /** @class */ (function (_super) {
|
|
|
37
37
|
function ContainerValidationState() {
|
|
38
38
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
39
39
|
_this.brokenRules = [];
|
|
40
|
+
_this._isBusy = false;
|
|
40
41
|
return _this;
|
|
41
42
|
}
|
|
42
43
|
Object.defineProperty(ContainerValidationState.prototype, "hasDetail", {
|
|
@@ -46,6 +47,14 @@ var ContainerValidationState = /** @class */ (function (_super) {
|
|
|
46
47
|
enumerable: false,
|
|
47
48
|
configurable: true
|
|
48
49
|
});
|
|
50
|
+
Object.defineProperty(ContainerValidationState.prototype, "isBusy", {
|
|
51
|
+
/** Indicates that an async rule is in progress. */
|
|
52
|
+
get: function () {
|
|
53
|
+
return this._isBusy;
|
|
54
|
+
},
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
49
58
|
/**
|
|
50
59
|
* Gets the error display information.
|
|
51
60
|
* @param canDisplayAll True if the bound controls have de-focused, or the form attempted to submit.
|
|
@@ -68,6 +77,9 @@ var ContainerValidationState = /** @class */ (function (_super) {
|
|
|
68
77
|
ContainerValidationState.prototype.update = function (ruleState) {
|
|
69
78
|
this.severity = Math.max(this.severity, ruleState.severity);
|
|
70
79
|
this.forceDisplaySeverity = Math.max(this.forceDisplaySeverity, ruleState.forceDisplaySeverity);
|
|
80
|
+
if (ruleState.severity === RuleSeverity.AsyncBusy || ruleState.forceDisplaySeverity === RuleSeverity.AsyncBusy) {
|
|
81
|
+
this._isBusy = true;
|
|
82
|
+
}
|
|
71
83
|
};
|
|
72
84
|
return ContainerValidationState;
|
|
73
85
|
}(ValidationState));
|
|
@@ -8,6 +8,8 @@ export default interface IModelValidator {
|
|
|
8
8
|
/** Causes all errors to be displayed regardless of ValidationDisplayMode. */
|
|
9
9
|
forceShowErrors: boolean;
|
|
10
10
|
readonly isValid: boolean;
|
|
11
|
+
/** Indicates that an async rule is in progress. */
|
|
12
|
+
readonly isBusy: boolean;
|
|
11
13
|
/** The max current severity of all rules in this object. */
|
|
12
14
|
readonly severity: RuleSeverity;
|
|
13
15
|
/**
|
|
@@ -23,6 +23,7 @@ export default class ModelValidator implements IModelValidator {
|
|
|
23
23
|
forceShowErrors: boolean;
|
|
24
24
|
get ruleState(): ContainerValidationState;
|
|
25
25
|
get isValid(): boolean;
|
|
26
|
+
get isBusy(): boolean;
|
|
26
27
|
get severity(): import("../ValidationState").RuleSeverity;
|
|
27
28
|
private checkRules;
|
|
28
29
|
/**
|
|
@@ -63,6 +63,13 @@ var ModelValidator = /** @class */ (function () {
|
|
|
63
63
|
enumerable: false,
|
|
64
64
|
configurable: true
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(ModelValidator.prototype, "isBusy", {
|
|
67
|
+
get: function () {
|
|
68
|
+
return this.ruleState.isBusy;
|
|
69
|
+
},
|
|
70
|
+
enumerable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
66
73
|
Object.defineProperty(ModelValidator.prototype, "severity", {
|
|
67
74
|
get: function () {
|
|
68
75
|
return this.ruleState.severity;
|
|
@@ -14,7 +14,7 @@ export default class PropertyValidator implements IPropertyValidator {
|
|
|
14
14
|
get ruleState(): ContainerValidationState;
|
|
15
15
|
get isValid(): boolean;
|
|
16
16
|
private checkRules;
|
|
17
|
-
/**
|
|
17
|
+
/** Information about the errors that must be shown on the UI. Independent from whether or not the property is valid. */
|
|
18
18
|
getDisplayState(validationMode: ValidationDisplayMode): ValidationDisplayInfo;
|
|
19
19
|
/** True if the validation state is final, e.g. the property has blurred, or validation display mode is always. */
|
|
20
20
|
canDisplayAll(validationMode: ValidationDisplayMode): boolean;
|
|
@@ -35,7 +35,7 @@ var PropertyValidator = /** @class */ (function () {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
/**
|
|
38
|
+
/** Information about the errors that must be shown on the UI. Independent from whether or not the property is valid. */
|
|
39
39
|
PropertyValidator.prototype.getDisplayState = function (validationMode) {
|
|
40
40
|
if (validationMode === ValidationDisplayMode.Never) {
|
|
41
41
|
return new ValidationDisplayInfo();
|