@fuentis/phoenix-ui 0.0.9-alpha.319 → 0.0.9-alpha.321
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.
|
@@ -151,6 +151,7 @@ class SidebarItemComponent {
|
|
|
151
151
|
[style.pointer-events]="item?.disabled ? 'none' : 'auto'"
|
|
152
152
|
>
|
|
153
153
|
<div class="flex align-items-center ">
|
|
154
|
+
<img class="mr-2" width="28" [src]="item.icon" alt="" />
|
|
154
155
|
<span class="text-primary font-bold pr-3">{{
|
|
155
156
|
item.label | translate
|
|
156
157
|
}}</span>
|
|
@@ -275,6 +276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
275
276
|
[style.pointer-events]="item?.disabled ? 'none' : 'auto'"
|
|
276
277
|
>
|
|
277
278
|
<div class="flex align-items-center ">
|
|
279
|
+
<img class="mr-2" width="28" [src]="item.icon" alt="" />
|
|
278
280
|
<span class="text-primary font-bold pr-3">{{
|
|
279
281
|
item.label | translate
|
|
280
282
|
}}</span>
|
|
@@ -2934,6 +2936,19 @@ class WhiteSpaceValidator {
|
|
|
2934
2936
|
}
|
|
2935
2937
|
}
|
|
2936
2938
|
|
|
2939
|
+
function noDangerousCharsValidator() {
|
|
2940
|
+
// Matches > < " = and encoded forms
|
|
2941
|
+
const safeTextPattern = /^[a-zA-Z0-9\s.,!?-]+$/;
|
|
2942
|
+
return (control) => {
|
|
2943
|
+
const value = control.value;
|
|
2944
|
+
if (!value)
|
|
2945
|
+
return null;
|
|
2946
|
+
return !safeTextPattern.test(String(value))
|
|
2947
|
+
? { dangerousChars: true }
|
|
2948
|
+
: null;
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2937
2952
|
class MetaFormService {
|
|
2938
2953
|
router = inject(Router);
|
|
2939
2954
|
formEvent = new Subject();
|
|
@@ -3071,10 +3086,11 @@ class MetaFormAbstract {
|
|
|
3071
3086
|
control.configuration.type === ControlType.TEXT_AREA) {
|
|
3072
3087
|
validators.push(WhiteSpaceValidator.noWhiteSpaceValidator);
|
|
3073
3088
|
}
|
|
3089
|
+
if (control.configuration.type === ControlType.TEXT ||
|
|
3090
|
+
control.configuration.type === ControlType.TEXT_AREA) {
|
|
3091
|
+
validators.push(noDangerousCharsValidator());
|
|
3092
|
+
}
|
|
3074
3093
|
this.metaForm.get(control.configuration.key)?.setValidators(validators);
|
|
3075
|
-
// this.metaForm
|
|
3076
|
-
// .get(control.configuration.key)
|
|
3077
|
-
// ?.setAsyncValidators(asyncValidators);
|
|
3078
3094
|
}
|
|
3079
3095
|
onSubmit() {
|
|
3080
3096
|
this.onFormSubmit.emit(this.metaForm);
|
|
@@ -3585,6 +3601,7 @@ var ErrorType;
|
|
|
3585
3601
|
ErrorType["BOTH_DATES"] = "both_dates";
|
|
3586
3602
|
ErrorType["MAX"] = "max";
|
|
3587
3603
|
ErrorType["MIN"] = "min";
|
|
3604
|
+
ErrorType["DANGEROUS_CHARS"] = "dangerousChars";
|
|
3588
3605
|
})(ErrorType || (ErrorType = {}));
|
|
3589
3606
|
|
|
3590
3607
|
class InlineFieldError {
|
|
@@ -3645,6 +3662,8 @@ class InlineFieldError {
|
|
|
3645
3662
|
return this.translateService.instant('VALIDATION_MESSAGE.VALUE_NO_MORE', { maxlength: control.errors['maxlength'].requiredLength });
|
|
3646
3663
|
case ErrorType.EMAIL:
|
|
3647
3664
|
return this.translateService.instant('VALIDATION_MESSAGE.ENTER_VALID_EMAIL');
|
|
3665
|
+
case ErrorType.DANGEROUS_CHARS:
|
|
3666
|
+
return this.translateService.instant('VALIDATION_MESSAGE.NO_SPECIAL_CHARS_ALLOWED');
|
|
3648
3667
|
case ErrorType.CUSTOM:
|
|
3649
3668
|
return this.translateService.instant(control?.errors?.['custom']);
|
|
3650
3669
|
case ErrorType.UIQUE_ENTRY:
|