@esfaenza/forms-and-validations 19.2.86 → 19.2.88

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.
@@ -95,8 +95,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
95
95
  * ngControl è il componente esterno (form-roba)
96
96
  */
97
97
  class BaseFormControl {
98
+ innerElementReceived() { }
98
99
  registerOnChange(fn) { this.onChange = fn; }
99
100
  registerOnTouched(fn) { this.onTouched = fn; }
101
+ set innerElement(v) {
102
+ this._innerElement = v;
103
+ if (this._innerElement)
104
+ this.innerElementReceived();
105
+ }
106
+ get innerElement() {
107
+ return this._innerElement;
108
+ }
100
109
  set LabelInputRatio(input) {
101
110
  if (!input)
102
111
  return;
@@ -118,6 +127,8 @@ class BaseFormControl {
118
127
  this.onSuffixAction = new EventEmitter();
119
128
  /** Delegato per l'esecuzione di un'operazione al click del prefisso */
120
129
  this.onPrefixAction = new EventEmitter();
130
+ // Per collegare l'oggetto interno al volo....
131
+ this._innerElement = null;
121
132
  this.inputChange = new EventEmitter();
122
133
  this.inputFocus = new EventEmitter();
123
134
  this.inputFinalized = new EventEmitter();
@@ -453,11 +464,11 @@ class InputSkeletonComponent {
453
464
  /** @ignore Costruttore */
454
465
  constructor() { }
455
466
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InputSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
456
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: InputSkeletonComponent, isStandalone: true, selector: "input-skeleton", inputs: { For: "For", Control: "Control" }, ngImport: i0, template: "<ng-container *ngIf=\"!For.FormLayout && (!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">\r\n <ng-container *ngIf=\"For.DisplayLayout == 'form'\">{{ For.EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"For.DisplayLayout == 'inline'\" class=\"app-inline\">{{ For.EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"For.FormLayout && (!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\" class=\"{{For.FormGroupClass + (For.Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (For.DisplayLayout == 'inline' && For.DisplayMode ? (' app-inline-block ' + (!For.Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : For.LabelColWidth) + (For.DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{For.Label}}{{For.required !== undefined && For.required !== false && !For.DisplayMode ? '*' : ''}}{{For.Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"For.DisplayMode && For.DisplayLayout == 'inline' && For.InlineSeparator != ''\">{{For.InlineSeparator}}</span>\r\n <div class=\"col-md-{{For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-inline-block' : For.InputColWidth}}\">\r\n\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">{{ For.EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
467
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: InputSkeletonComponent, isStandalone: true, selector: "input-skeleton", inputs: { For: "For", Control: "Control" }, ngImport: i0, template: "<ng-container *ngIf=\"!For.FormLayout\">\r\n <ng-container *ngIf=\"!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition)\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">\r\n <ng-container *ngIf=\"For.DisplayLayout == 'form'\">{{ For.EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"For.DisplayLayout == 'inline'\" class=\"app-inline\">{{ For.EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n </ng-container>\r\n <div [hidden]=\"For.DisplayMode || (For.DisplayLayout == 'hidden' || !For.DisplayCondition)\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n</ng-container>\r\n\r\n\r\n<ng-container *ngIf=\"For.FormLayout\">\r\n <div [hidden]=\"!(!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\" class=\"{{For.FormGroupClass + (For.Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (For.DisplayLayout == 'inline' && For.DisplayMode ? (' app-inline-block ' + (!For.Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : For.LabelColWidth) + (For.DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{For.Label}}{{For.required !== undefined && For.required !== false && !For.DisplayMode ? '*' : ''}}{{For.Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"For.DisplayMode && For.DisplayLayout == 'inline' && For.InlineSeparator != ''\">{{For.InlineSeparator}}</span>\r\n <div class=\"col-md-{{For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-inline-block' : For.InputColWidth}}\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">{{ For.EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode || (For.DisplayLayout == 'hidden' || !For.DisplayCondition)\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n</ng-container>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
457
468
  }
458
469
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InputSkeletonComponent, decorators: [{
459
470
  type: Component,
460
- args: [{ selector: "input-skeleton", encapsulation: ViewEncapsulation.None, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-container *ngIf=\"!For.FormLayout && (!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">\r\n <ng-container *ngIf=\"For.DisplayLayout == 'form'\">{{ For.EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"For.DisplayLayout == 'inline'\" class=\"app-inline\">{{ For.EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"For.FormLayout && (!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\" class=\"{{For.FormGroupClass + (For.Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (For.DisplayLayout == 'inline' && For.DisplayMode ? (' app-inline-block ' + (!For.Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : For.LabelColWidth) + (For.DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{For.Label}}{{For.required !== undefined && For.required !== false && !For.DisplayMode ? '*' : ''}}{{For.Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"For.DisplayMode && For.DisplayLayout == 'inline' && For.InlineSeparator != ''\">{{For.InlineSeparator}}</span>\r\n <div class=\"col-md-{{For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-inline-block' : For.InputColWidth}}\">\r\n\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">{{ For.EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>" }]
471
+ args: [{ selector: "input-skeleton", encapsulation: ViewEncapsulation.None, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-container *ngIf=\"!For.FormLayout\">\r\n <ng-container *ngIf=\"!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition)\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">\r\n <ng-container *ngIf=\"For.DisplayLayout == 'form'\">{{ For.EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"For.DisplayLayout == 'inline'\" class=\"app-inline\">{{ For.EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n </ng-container>\r\n <div [hidden]=\"For.DisplayMode || (For.DisplayLayout == 'hidden' || !For.DisplayCondition)\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n</ng-container>\r\n\r\n\r\n<ng-container *ngIf=\"For.FormLayout\">\r\n <div [hidden]=\"!(!For.DisplayMode || (For.DisplayLayout != 'hidden' && For.DisplayCondition))\" class=\"{{For.FormGroupClass + (For.Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (For.DisplayLayout == 'inline' && For.DisplayMode ? (' app-inline-block ' + (!For.Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : For.LabelColWidth) + (For.DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{For.Label}}{{For.required !== undefined && For.required !== false && !For.DisplayMode ? '*' : ''}}{{For.Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"For.DisplayMode && For.DisplayLayout == 'inline' && For.InlineSeparator != ''\">{{For.InlineSeparator}}</span>\r\n <div class=\"col-md-{{For.DisplayMode && For.DisplayLayout == 'inline' ? 'none app-inline-block' : For.InputColWidth}}\">\r\n <ng-container *ngIf=\"For.DisplayMode && !For.DisplayModeTemplate\">{{ For.EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"For.DisplayMode && For.DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"For.DisplayModeTemplate, context: { $implicit: For.EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"For.DisplayMode || (For.DisplayLayout == 'hidden' || !For.DisplayCondition)\"><ng-container *ngTemplateOutlet=\"Control\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n</ng-container>" }]
461
472
  }], ctorParameters: () => [], propDecorators: { For: [{
462
473
  type: Input
463
474
  }], Control: [{
@@ -509,13 +520,15 @@ class EsFormSelectComponent extends BaseFormControl {
509
520
  }
510
521
  ngAfterViewInit() {
511
522
  super.ngAfterViewInit();
512
- // Eh... checcedevofa
513
- this.innerElement = this.innerElement.el;
514
523
  if (!this.Placeholder && this.required) {
515
524
  this.RequiredPlaceholder = "Seleziona un valore...";
516
525
  this.Placeholder = "";
517
526
  }
518
527
  }
528
+ innerElementReceived() {
529
+ this._innerElement = this.innerElement.el;
530
+ }
531
+ ;
519
532
  async getEvaluatedModel(value) {
520
533
  if (value === null || value === undefined || value === "")
521
534
  return "";
@@ -564,9 +577,11 @@ class EsFormDateComponent extends BaseFormControl {
564
577
  this.adjustInputModeVisuals();
565
578
  this.datesExts = this.inj.get(DateService);
566
579
  this.shouldReemitAdjustedInput = true;
567
- // Eh... checcedevofa
568
- this.innerElement = this.innerElement.el;
569
580
  }
581
+ innerElementReceived() {
582
+ this._innerElement = this.innerElement.el;
583
+ }
584
+ ;
570
585
  setInputMode() {
571
586
  this.mode = "date";
572
587
  }
@@ -1099,11 +1114,13 @@ class EsFormMultiselectComponent extends BaseFormControl {
1099
1114
  }
1100
1115
  ngAfterViewInit() {
1101
1116
  super.ngAfterViewInit();
1102
- // Eh... checcedevofa
1103
- this.innerElement = this.innerElement.el;
1104
1117
  if (!this.Placeholder && this.required)
1105
1118
  this.Placeholder = "Seleziona uno o più valori...";
1106
1119
  }
1120
+ innerElementReceived() {
1121
+ this._innerElement = this.innerElement.el;
1122
+ }
1123
+ ;
1107
1124
  async getValueIn(value) {
1108
1125
  if (!value)
1109
1126
  return [];
@@ -1196,9 +1213,11 @@ class EsFormAutocompleteComponent extends BaseFormControl {
1196
1213
  ngAfterViewInit() {
1197
1214
  super.ngAfterViewInit();
1198
1215
  this.setInputMode();
1199
- // Eh... checcedevofa
1200
- this.innerElement = this.innerElement.el;
1201
1216
  }
1217
+ innerElementReceived() {
1218
+ this._innerElement = this.innerElement.el;
1219
+ }
1220
+ ;
1202
1221
  setInputMode() {
1203
1222
  this.mode.set("autocomplete");
1204
1223
  }
@@ -1340,9 +1359,11 @@ class EsFormCurrencyComponent extends BaseFormControl {
1340
1359
  }
1341
1360
  ngAfterViewInit() {
1342
1361
  super.ngAfterViewInit();
1343
- // Eh... checcedevofa
1344
- this.innerElement = this.innerElement.el;
1345
1362
  }
1363
+ innerElementReceived() {
1364
+ this._innerElement = this.innerElement.el;
1365
+ }
1366
+ ;
1346
1367
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EsFormCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1347
1368
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EsFormCurrencyComponent, isStandalone: true, selector: "form-currency", inputs: { mode: "mode", Precision: "Precision" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => EsFormCurrencyComponent), multi: true }], usesInheritance: true, ngImport: i0, template: "<input-skeleton [Control]=\"controlTemplate\" [For]=\"this\"></input-skeleton>\r\n\r\n<ng-template #controlTemplate>\r\n <p-floatlabel variant=\"on\">\r\n\r\n <p-inputnumber \r\n size=\"small\"\r\n #innerInput=\"ngModel\"\r\n #innerElement\r\n autocomplete=\"off\"\r\n style=\"width: 100%;\"\r\n [attr.name]=\"InternalName\"\r\n [attr.id]=\"InternalName\"\r\n [disabled]=\"disabled\" \r\n [required]=\"required\"\r\n [readonly]=\"readonly\"\r\n [pattern]=\"pattern\"\r\n [minFractionDigits]=\"Precision\"\r\n [maxFractionDigits]=\"Precision\"\r\n [mode]=\"mode\"\r\n [currency]=\"mode === 'currency' ? 'EUR' : undefined\"\r\n locale=\"it-IT\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"changed($event)\" \r\n (click)=\"focused($event);\"\r\n (onBlur)=\"onTouched(); finalized()\"\r\n />\r\n\r\n <label>{{Placeholder}}</label>\r\n </p-floatlabel>\r\n\r\n</ng-template>\r\n\r\n<p-popover appendTo=\"body\" styleClass='validation-tooltip' #tooltip>{{TooltipText}}</p-popover>", styles: [".validation-tooltip.p-popover:before,.validation-tooltip.p-popover:after{border-bottom-color:var(--p-form-field-invalid-placeholder-color)}.validation-tooltip .p-popover-content{padding:5px;color:#fff;background:var(--p-form-field-invalid-placeholder-color);border-radius:5px}p-datepicker{display:flex}.p-datepicker{flex-grow:1}.p-datepicker-panel{min-width:400px!important}.p-inputgroupaddon{padding:0!important}p-autocomplete input.p-autocomplete-input{width:100%}input.p-select-filter{width:100%!important}textarea{resize:none}.p-select-clear-icon{margin-top:-.5rem!important}\n"], dependencies: [{ kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i1$7.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i4.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: InputSkeletonComponent, selector: "input-skeleton", inputs: ["For", "Control"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1348
1369
  }