@sumaris-net/ngx-components 2.4.38 → 2.4.39

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.
@@ -10196,6 +10196,8 @@ class AppFormField {
10196
10196
  * @param value
10197
10197
  */
10198
10198
  reloadItems(value) {
10199
+ if (!this._definition)
10200
+ return;
10199
10201
  this._onDefinitionChanged(this._definition);
10200
10202
  if (this.autocompleteField) {
10201
10203
  setTimeout(() => this.autocompleteField?.reloadItems(value));
@@ -10249,7 +10251,7 @@ class AppFormField {
10249
10251
  if (!this.type)
10250
10252
  throw new Error('Invalid attribute \'definition\' in <app-form-field>. Missing type !');
10251
10253
  this.placeholder = this.placeholder || (this._definition.label && this.translate.instant(this._definition.label));
10252
- this.required = isNotNilBoolean(this.required) ? this.required : (this._definition.required || this.formControl.validator === Validators.required || isBlankString(this.required));
10254
+ this.required = isNotNilBoolean(this.required) ? this.required : (this._definition.required || this.formControl?.validator === Validators.required || isBlankString(this.required));
10253
10255
  this.disabled = toBoolean(this.disabled, toBoolean(this._definition.disabled, false));
10254
10256
  if (this.type === 'double') {
10255
10257
  this.numberInputStep = this.computeNumberInputStep(definition);