@solcre-org/core-ui 2.15.18 → 2.15.20

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.
@@ -3061,6 +3061,13 @@ class PhoneFieldComponent extends BaseFieldComponent {
3061
3061
  this.phoneControl.valueChanges
3062
3062
  .pipe(takeUntilDestroyed(), debounceTime(300), distinctUntilChanged())
3063
3063
  .subscribe((phoneNumber) => {
3064
+ if (phoneNumber) {
3065
+ const sanitized = phoneNumber.replace(/[^\d\s\-\(\)]/g, '');
3066
+ if (sanitized !== phoneNumber) {
3067
+ this.phoneControl.setValue(sanitized, { emitEvent: false });
3068
+ return;
3069
+ }
3070
+ }
3064
3071
  if (!this.isUpdatingValue) {
3065
3072
  this.updatePhoneValue();
3066
3073
  }
@@ -3321,12 +3328,20 @@ class PhoneFieldComponent extends BaseFieldComponent {
3321
3328
  this.toggleDropdown();
3322
3329
  }
3323
3330
  }
3331
+ onPhoneKeyPress(event) {
3332
+ const charCode = event.which || event.keyCode;
3333
+ const char = String.fromCharCode(charCode);
3334
+ const allowedChars = /[\d\s\-\(\)]/;
3335
+ if (!allowedChars.test(char)) {
3336
+ event.preventDefault();
3337
+ }
3338
+ }
3324
3339
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: PhoneFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3325
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: PhoneFieldComponent, isStandalone: true, selector: "core-phone-field", host: { listeners: { "document:click": "onDocumentClick($event)" } }, usesInheritance: true, ngImport: i0, template: "<label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n\n <div class=\"c-entry-phone\" [class.is-disabled]=\"isDisabled()\">\n <div\n class=\"c-entry-input c-entry-input--phone c-area-code js-area-code c-phone-field__custom-select\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-readonly]=\"isReadonly()\"\n (click)=\"onAreaCodeClick($event)\"\n (keydown.enter)=\"onAreaCodeKeydown($any($event))\"\n (keydown.space)=\"onAreaCodeKeydown($any($event))\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isDropdownOpen()\"\n [attr.aria-haspopup]=\"true\"\n >\n <input type=\"hidden\" class=\"js-area-value\" [value]=\"selectedCountry()?.phone || ''\" />\n <div class=\"c-area-code__selected js-area-code-selected\">\n @if (phoneConfig().showFlags && selectedCountry()?.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(selectedCountry()!)\"\n [alt]=\"selectedCountry()?.name || ''\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span class=\"c-area-code__num\">{{ getSelectedCountryDisplay() }}</span>\n <span class=\"c-area-code__arrow icon-arrow-down\"></span>\n </div>\n <div class=\"c-area-code__options js-area-code-options\" [class.show]=\"isDropdownOpen()\">\n @for (country of availableCountries(); track country.code + '-' + country.name) {\n <div class=\"c-area-code__option\" (click)=\"selectCountry(country, $event)\">\n @if (phoneConfig().showFlags && country.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(country)\"\n [alt]=\"country.name\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span>{{ getCountryLabel(country) }}</span>\n </div>\n }\n </div>\n </div>\n\n <span\n class=\"c-entry-input\"\n [class.is-readonly]=\"isReadonly() || field().blocked\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-invalid]=\"hasError()\"\n >\n <input\n type=\"tel\"\n [id]=\"field().key.toString()\"\n [name]=\"field().key.toString()\"\n [formControl]=\"phoneControl\"\n [placeholder]=\"getPhonePlaceholder() | translate\"\n [readonly]=\"isReadonly() || field().blocked\"\n [class.has-error]=\"hasError()\"\n [class.is-invalid]=\"hasError()\"\n inputmode=\"tel\"\n autocomplete=\"tel\"\n (blur)=\"onBlurInput()\"\n (keydown.enter)=\"onEnterInput($any($event))\"\n />\n </span>\n </div>\n\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "component", type: FieldErrorsComponent, selector: "core-field-errors", inputs: ["errors"] }] });
3340
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: PhoneFieldComponent, isStandalone: true, selector: "core-phone-field", host: { listeners: { "document:click": "onDocumentClick($event)" } }, usesInheritance: true, ngImport: i0, template: "<label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n\n <div class=\"c-entry-phone\" [class.is-disabled]=\"isDisabled()\">\n <div\n class=\"c-entry-input c-entry-input--phone c-area-code js-area-code c-phone-field__custom-select\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-readonly]=\"isReadonly()\"\n (click)=\"onAreaCodeClick($event)\"\n (keydown.enter)=\"onAreaCodeKeydown($any($event))\"\n (keydown.space)=\"onAreaCodeKeydown($any($event))\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isDropdownOpen()\"\n [attr.aria-haspopup]=\"true\"\n >\n <input type=\"hidden\" class=\"js-area-value\" [value]=\"selectedCountry()?.phone || ''\" />\n <div class=\"c-area-code__selected js-area-code-selected\">\n @if (phoneConfig().showFlags && selectedCountry()?.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(selectedCountry()!)\"\n [alt]=\"selectedCountry()?.name || ''\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span class=\"c-area-code__num\">{{ getSelectedCountryDisplay() }}</span>\n <span class=\"c-area-code__arrow icon-arrow-down\"></span>\n </div>\n <div class=\"c-area-code__options js-area-code-options\" [class.show]=\"isDropdownOpen()\">\n @for (country of availableCountries(); track country.code + '-' + country.name) {\n <div class=\"c-area-code__option\" (click)=\"selectCountry(country, $event)\">\n @if (phoneConfig().showFlags && country.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(country)\"\n [alt]=\"country.name\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span>{{ getCountryLabel(country) }}</span>\n </div>\n }\n </div>\n </div>\n\n <span\n class=\"c-entry-input\"\n [class.is-readonly]=\"isReadonly() || field().blocked\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-invalid]=\"hasError()\"\n >\n <input\n type=\"tel\"\n [id]=\"field().key.toString()\"\n [name]=\"field().key.toString()\"\n [formControl]=\"phoneControl\"\n [placeholder]=\"getPhonePlaceholder() | translate\"\n [readonly]=\"isReadonly() || field().blocked\"\n [class.has-error]=\"hasError()\"\n [class.is-invalid]=\"hasError()\"\n inputmode=\"numeric\"\n autocomplete=\"tel\"\n (blur)=\"onBlurInput()\"\n (keydown.enter)=\"onEnterInput($any($event))\"\n (keypress)=\"onPhoneKeyPress($event)\"\n />\n </span>\n </div>\n\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "component", type: FieldErrorsComponent, selector: "core-field-errors", inputs: ["errors"] }] });
3326
3341
  }
3327
3342
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: PhoneFieldComponent, decorators: [{
3328
3343
  type: Component,
3329
- args: [{ selector: 'core-phone-field', standalone: true, imports: [CommonModule, ReactiveFormsModule, TranslateModule, FieldErrorsComponent], template: "<label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n\n <div class=\"c-entry-phone\" [class.is-disabled]=\"isDisabled()\">\n <div\n class=\"c-entry-input c-entry-input--phone c-area-code js-area-code c-phone-field__custom-select\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-readonly]=\"isReadonly()\"\n (click)=\"onAreaCodeClick($event)\"\n (keydown.enter)=\"onAreaCodeKeydown($any($event))\"\n (keydown.space)=\"onAreaCodeKeydown($any($event))\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isDropdownOpen()\"\n [attr.aria-haspopup]=\"true\"\n >\n <input type=\"hidden\" class=\"js-area-value\" [value]=\"selectedCountry()?.phone || ''\" />\n <div class=\"c-area-code__selected js-area-code-selected\">\n @if (phoneConfig().showFlags && selectedCountry()?.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(selectedCountry()!)\"\n [alt]=\"selectedCountry()?.name || ''\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span class=\"c-area-code__num\">{{ getSelectedCountryDisplay() }}</span>\n <span class=\"c-area-code__arrow icon-arrow-down\"></span>\n </div>\n <div class=\"c-area-code__options js-area-code-options\" [class.show]=\"isDropdownOpen()\">\n @for (country of availableCountries(); track country.code + '-' + country.name) {\n <div class=\"c-area-code__option\" (click)=\"selectCountry(country, $event)\">\n @if (phoneConfig().showFlags && country.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(country)\"\n [alt]=\"country.name\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span>{{ getCountryLabel(country) }}</span>\n </div>\n }\n </div>\n </div>\n\n <span\n class=\"c-entry-input\"\n [class.is-readonly]=\"isReadonly() || field().blocked\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-invalid]=\"hasError()\"\n >\n <input\n type=\"tel\"\n [id]=\"field().key.toString()\"\n [name]=\"field().key.toString()\"\n [formControl]=\"phoneControl\"\n [placeholder]=\"getPhonePlaceholder() | translate\"\n [readonly]=\"isReadonly() || field().blocked\"\n [class.has-error]=\"hasError()\"\n [class.is-invalid]=\"hasError()\"\n inputmode=\"tel\"\n autocomplete=\"tel\"\n (blur)=\"onBlurInput()\"\n (keydown.enter)=\"onEnterInput($any($event))\"\n />\n </span>\n </div>\n\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n</label>\n" }]
3344
+ args: [{ selector: 'core-phone-field', standalone: true, imports: [CommonModule, ReactiveFormsModule, TranslateModule, FieldErrorsComponent], template: "<label class=\"c-entry-item\" [class.c-entry-item--inline]=\"field().inline\">\n <span class=\"c-entry-text\" *ngIf=\"field().label\">\n {{ field().label | translate }}\n @if (hasRequiredValidators()) {\n <span class=\"c-required\">*</span>\n }\n </span>\n\n <div class=\"c-entry-phone\" [class.is-disabled]=\"isDisabled()\">\n <div\n class=\"c-entry-input c-entry-input--phone c-area-code js-area-code c-phone-field__custom-select\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-readonly]=\"isReadonly()\"\n (click)=\"onAreaCodeClick($event)\"\n (keydown.enter)=\"onAreaCodeKeydown($any($event))\"\n (keydown.space)=\"onAreaCodeKeydown($any($event))\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isDropdownOpen()\"\n [attr.aria-haspopup]=\"true\"\n >\n <input type=\"hidden\" class=\"js-area-value\" [value]=\"selectedCountry()?.phone || ''\" />\n <div class=\"c-area-code__selected js-area-code-selected\">\n @if (phoneConfig().showFlags && selectedCountry()?.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(selectedCountry()!)\"\n [alt]=\"selectedCountry()?.name || ''\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span class=\"c-area-code__num\">{{ getSelectedCountryDisplay() }}</span>\n <span class=\"c-area-code__arrow icon-arrow-down\"></span>\n </div>\n <div class=\"c-area-code__options js-area-code-options\" [class.show]=\"isDropdownOpen()\">\n @for (country of availableCountries(); track country.code + '-' + country.name) {\n <div class=\"c-area-code__option\" (click)=\"selectCountry(country, $event)\">\n @if (phoneConfig().showFlags && country.flag) {\n <img\n class=\"c-area-code__flag\"\n [src]=\"getFlagUrl(country)\"\n [alt]=\"country.name\"\n (error)=\"onFlagError($event)\"\n />\n }\n <span>{{ getCountryLabel(country) }}</span>\n </div>\n }\n </div>\n </div>\n\n <span\n class=\"c-entry-input\"\n [class.is-readonly]=\"isReadonly() || field().blocked\"\n [class.is-disabled]=\"isDisabled()\"\n [class.is-invalid]=\"hasError()\"\n >\n <input\n type=\"tel\"\n [id]=\"field().key.toString()\"\n [name]=\"field().key.toString()\"\n [formControl]=\"phoneControl\"\n [placeholder]=\"getPhonePlaceholder() | translate\"\n [readonly]=\"isReadonly() || field().blocked\"\n [class.has-error]=\"hasError()\"\n [class.is-invalid]=\"hasError()\"\n inputmode=\"numeric\"\n autocomplete=\"tel\"\n (blur)=\"onBlurInput()\"\n (keydown.enter)=\"onEnterInput($any($event))\"\n (keypress)=\"onPhoneKeyPress($event)\"\n />\n </span>\n </div>\n\n <core-field-errors [errors]=\"errors()\"></core-field-errors>\n</label>\n" }]
3330
3345
  }], ctorParameters: () => [], propDecorators: { onDocumentClick: [{
3331
3346
  type: HostListener,
3332
3347
  args: ['document:click', ['$event']]
@@ -9024,7 +9039,7 @@ class ModelApiService {
9024
9039
  }
9025
9040
  const apiCall = config.isSingleObject
9026
9041
  ? this.apiService.getObj(config.endpoint, config.id)
9027
- : this.apiService.fetchData(config.endpoint);
9042
+ : this.apiService.fetchData(config.endpoint, config.customParams || {});
9028
9043
  return apiCall.pipe(map((res) => {
9029
9044
  if (!res || !res.data) {
9030
9045
  return { key: config.key, data: config.isSingleObject ? null : [] };
@@ -15809,12 +15824,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
15809
15824
  // Este archivo es generado automáticamente por scripts/update-version.js
15810
15825
  // No edites manualmente este archivo
15811
15826
  const VERSION = {
15812
- full: '2.15.18',
15827
+ full: '2.15.20',
15813
15828
  major: 2,
15814
15829
  minor: 15,
15815
- patch: 18,
15816
- timestamp: '2025-10-16T16:54:17.921Z',
15817
- buildDate: '16/10/2025'
15830
+ patch: 20,
15831
+ timestamp: '2025-10-17T11:19:18.243Z',
15832
+ buildDate: '17/10/2025'
15818
15833
  };
15819
15834
 
15820
15835
  class MainNavComponent {