ngx-render-material-forms 1.4.6 → 1.4.7

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.
@@ -2631,7 +2631,7 @@ class MaterialSelectComponent extends MaterialComponent {
2631
2631
  return item ? item.value : null;
2632
2632
  }
2633
2633
  loadData(pageNumber, pageSize, searchQuery) {
2634
- const paramsData = JSON.parse(localStorage.getItem('productPicker'));
2634
+ const paramsData = JSON.parse(localStorage.getItem('productPickerParams'));
2635
2635
  const includeDescription = this.getValueByKey(paramsData, 'includeDescription');
2636
2636
  const vendorId = this.getValueByKey(paramsData, 'vendorId');
2637
2637
  const onlyActive = this.getValueByKey(paramsData, 'onlyActive');
@@ -2809,6 +2809,27 @@ class MaterialSelectComponent extends MaterialComponent {
2809
2809
  });
2810
2810
  this.filteredOptions = this.selectOptions;
2811
2811
  }
2812
+ isError() {
2813
+ this.control.setErrors(this.instance.component.validate);
2814
+ return true;
2815
+ }
2816
+ getErrorMessage() {
2817
+ if (this.instance.error && this.instance.error.messages) {
2818
+ const { messages } = this.instance.error;
2819
+ if (messages.length) {
2820
+ for (const msg of messages) {
2821
+ if (msg.context) {
2822
+ if (this.instance && this.instance.parent && this.instance.parent._data) {
2823
+ if (this.instance.parent._data.submit) {
2824
+ this.control.markAllAsTouched();
2825
+ }
2826
+ }
2827
+ return this.instance.error ? this.instance.error.message : '';
2828
+ }
2829
+ }
2830
+ }
2831
+ }
2832
+ }
2812
2833
  compareObjects(o1, o2) {
2813
2834
  return _.isEqual(o1, o2);
2814
2835
  }
@@ -2851,7 +2872,7 @@ MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
2851
2872
  <span *ngIf="instance.component.suffix" matSuffix>
2852
2873
  {{ instance.component.suffix }}
2853
2874
  </span>
2854
- <mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
2875
+ <mat-error *ngIf="isError()" >{{ getErrorMessage() }}</mat-error>
2855
2876
  </mat-form-field>
2856
2877
  </ng-template>
2857
2878
  `, isInline: true, styles: [".example-viewport{height:200px}.product-picker{overflow-x:hidden}.virtual-full-view{height:auto!important;white-space:normal!important;line-height:1.4!important;text-overflow:initial!important;min-height:48px!important;overflow:visible!important;overflow:initial!important;padding-top:10px!important;padding-bottom:10px!important}::ng-deep .product-picker .cdk-virtual-scroll-content-wrapper{width:100%!important}.virtual-full-view .mat-pseudo-checkbox{align-self:top!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "component", type: i9.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i9.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
@@ -2894,7 +2915,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
2894
2915
  <span *ngIf="instance.component.suffix" matSuffix>
2895
2916
  {{ instance.component.suffix }}
2896
2917
  </span>
2897
- <mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
2918
+ <mat-error *ngIf="isError()" >{{ getErrorMessage() }}</mat-error>
2898
2919
  </mat-form-field>
2899
2920
  </ng-template>
2900
2921
  `, styles: [".example-viewport{height:200px}.product-picker{overflow-x:hidden}.virtual-full-view{height:auto!important;white-space:normal!important;line-height:1.4!important;text-overflow:initial!important;min-height:48px!important;overflow:visible!important;overflow:initial!important;padding-top:10px!important;padding-bottom:10px!important}::ng-deep .product-picker .cdk-virtual-scroll-content-wrapper{width:100%!important}.virtual-full-view .mat-pseudo-checkbox{align-self:top!important}\n"] }]