chrv-components 1.10.56 → 1.10.57
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.
|
Binary file
|
|
@@ -859,6 +859,7 @@ class ChrBaseInputComponent {
|
|
|
859
859
|
* Default is true to allow full JS manipulation of files et upload progress report.
|
|
860
860
|
*/
|
|
861
861
|
this.base64 = true;
|
|
862
|
+
// @Input() mask: string | null = null;
|
|
862
863
|
this._disabled = false;
|
|
863
864
|
/**
|
|
864
865
|
* Whether or not the input starts as disabled. This can then be changed through the form control.
|
|
@@ -929,6 +930,54 @@ class ChrBaseInputComponent {
|
|
|
929
930
|
this.hasError = () => {
|
|
930
931
|
return this.control?.errors !== undefined && this.control?.errors !== null;
|
|
931
932
|
};
|
|
933
|
+
// @HostListener('input', ['$event'])
|
|
934
|
+
// onInput(event: Event) {
|
|
935
|
+
// const input = event.target as HTMLInputElement;
|
|
936
|
+
// if (this.mask) {
|
|
937
|
+
// const maskedValue = this.applyMask(input.value, this.mask);
|
|
938
|
+
// input.value = maskedValue;
|
|
939
|
+
// this.onValueChange(maskedValue); // envoie avec debounce
|
|
940
|
+
// } else {
|
|
941
|
+
// this.onValueChange(input.value);
|
|
942
|
+
// }
|
|
943
|
+
// }
|
|
944
|
+
// private applyMask(value: string, mask: string): string {
|
|
945
|
+
// const raw = value.replace(/[^a-zA-Z0-9]/g, '');
|
|
946
|
+
// let result = '';
|
|
947
|
+
// let rawIndex = 0;
|
|
948
|
+
// for (let i = 0; i < mask.length && rawIndex < raw.length; i++) {
|
|
949
|
+
// const maskChar = mask[i];
|
|
950
|
+
// const rawChar = raw[rawIndex];
|
|
951
|
+
// if (maskChar === 'd') {
|
|
952
|
+
// if (/\d/.test(rawChar)) {
|
|
953
|
+
// result += rawChar;
|
|
954
|
+
// rawIndex++;
|
|
955
|
+
// } else {
|
|
956
|
+
// rawIndex++;
|
|
957
|
+
// i--;
|
|
958
|
+
// }
|
|
959
|
+
// } else if (maskChar === 'w') {
|
|
960
|
+
// if (/[a-z]/i.test(rawChar)) {
|
|
961
|
+
// result += rawChar.toLowerCase();
|
|
962
|
+
// rawIndex++;
|
|
963
|
+
// } else {
|
|
964
|
+
// rawIndex++;
|
|
965
|
+
// i--;
|
|
966
|
+
// }
|
|
967
|
+
// } else if (maskChar === 'W') {
|
|
968
|
+
// if (/[a-z]/i.test(rawChar)) {
|
|
969
|
+
// result += rawChar.toUpperCase();
|
|
970
|
+
// rawIndex++;
|
|
971
|
+
// } else {
|
|
972
|
+
// rawIndex++;
|
|
973
|
+
// i--;
|
|
974
|
+
// }
|
|
975
|
+
// } else {
|
|
976
|
+
// result += maskChar;
|
|
977
|
+
// }
|
|
978
|
+
// }
|
|
979
|
+
// return result;
|
|
980
|
+
// }
|
|
932
981
|
this.configureDebouncing = () => {
|
|
933
982
|
this.valueSubscription = this.valueSubject
|
|
934
983
|
.pipe(
|