@sbcore/ng-absolute-validator 14.1.0 → 14.1.1
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/deprecation.util.d.ts +1 -0
- package/esm2020/deprecation.util.mjs +9 -0
- package/esm2020/i18n/de.mjs +1 -1
- package/esm2020/i18n/en.mjs +1 -1
- package/esm2020/i18n/es.mjs +1 -1
- package/esm2020/i18n/fr.mjs +1 -1
- package/esm2020/i18n/hi.mjs +1 -1
- package/esm2020/lib/pipe/replaceWith/replace-with.pipe.mjs +1 -1
- package/esm2020/lib/rule/rule.directive.mjs +14 -3
- package/fesm2015/sbcore-ng-absolute-validator.mjs +21 -2
- package/fesm2015/sbcore-ng-absolute-validator.mjs.map +1 -1
- package/fesm2020/sbcore-ng-absolute-validator.mjs +21 -2
- package/fesm2020/sbcore-ng-absolute-validator.mjs.map +1 -1
- package/lib/rule/rule.directive.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1044,6 +1044,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1044
1044
|
args: [{ providedIn: 'root' }]
|
|
1045
1045
|
}], ctorParameters: function () { return [{ type: MessageBuilderService }, { type: NgAbsoluteValidatorService }, { type: UtilService }]; } });
|
|
1046
1046
|
|
|
1047
|
+
const warnedRules = new Set();
|
|
1048
|
+
function warnDeprecatedRule(ruleName, replacement, reason) {
|
|
1049
|
+
if (warnedRules.has(ruleName))
|
|
1050
|
+
return;
|
|
1051
|
+
warnedRules.add(ruleName);
|
|
1052
|
+
const reasonText = reason ? ` (${reason})` : '';
|
|
1053
|
+
console.warn(`[ng-absolute-validator] The "${ruleName}" rule is deprecated and will be removed in a future version. Use "${replacement}" instead${reasonText}.`);
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1047
1056
|
class Rule {
|
|
1048
1057
|
constructor(ruleValidate, el) {
|
|
1049
1058
|
this.ruleValidate = ruleValidate;
|
|
@@ -1052,6 +1061,13 @@ class Rule {
|
|
|
1052
1061
|
this.fieldName = 'field';
|
|
1053
1062
|
this.fieldName = this.el.nativeElement.name;
|
|
1054
1063
|
}
|
|
1064
|
+
/**
|
|
1065
|
+
* @deprecated Use `rule` (lowercase) instead. Will be removed in 16.0.0.
|
|
1066
|
+
**/
|
|
1067
|
+
set legacyRule(value) {
|
|
1068
|
+
warnDeprecatedRule('rule-capital-r', '[Rule] (capital R) is deprecated and will be removed in 16.0.0. Use [rule] instead.');
|
|
1069
|
+
this.rule = value;
|
|
1070
|
+
}
|
|
1055
1071
|
set message(data) {
|
|
1056
1072
|
this.vmessage = data;
|
|
1057
1073
|
}
|
|
@@ -1060,14 +1076,17 @@ class Rule {
|
|
|
1060
1076
|
}
|
|
1061
1077
|
}
|
|
1062
1078
|
Rule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Rule, deps: [{ token: ValidateRuleService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1063
|
-
Rule.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: Rule, selector: "[
|
|
1079
|
+
Rule.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: Rule, selector: "[rule],[Rule]", inputs: { rule: "rule", legacyRule: ["Rule", "legacyRule"], message: "message" }, providers: [{ provide: NG_VALIDATORS, useExisting: Rule, multi: true }], ngImport: i0 });
|
|
1064
1080
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Rule, decorators: [{
|
|
1065
1081
|
type: Directive,
|
|
1066
1082
|
args: [{
|
|
1067
|
-
selector: '[
|
|
1083
|
+
selector: '[rule],[Rule]',
|
|
1068
1084
|
providers: [{ provide: NG_VALIDATORS, useExisting: Rule, multi: true }]
|
|
1069
1085
|
}]
|
|
1070
1086
|
}], ctorParameters: function () { return [{ type: ValidateRuleService }, { type: i0.ElementRef }]; }, propDecorators: { rule: [{
|
|
1087
|
+
type: Input,
|
|
1088
|
+
args: ['rule']
|
|
1089
|
+
}], legacyRule: [{
|
|
1071
1090
|
type: Input,
|
|
1072
1091
|
args: ['Rule']
|
|
1073
1092
|
}], message: [{
|