|
|
|
@ -423,7 +423,7 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni |
|
|
|
} |
|
|
|
break; |
|
|
|
case 'select': |
|
|
|
value = keyValue.toString(); |
|
|
|
value = keyValue !== null ? keyValue.toString() : null; |
|
|
|
break; |
|
|
|
default: |
|
|
|
value = keyValue; |
|
|
|
@ -565,21 +565,23 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni |
|
|
|
} |
|
|
|
|
|
|
|
public inputChanged(source: MultipleInputWidgetSource, key: MultipleInputWidgetDataKey) { |
|
|
|
if (!this.settings.showActionButtons && !this.isSavingInProgress) { |
|
|
|
if (!this.settings.showActionButtons && !this.isSavingInProgress && this.multipleInputFormGroup.get(key.formId).valid) { |
|
|
|
this.isSavingInProgress = true; |
|
|
|
const currentValue = this.multipleInputFormGroup.get(key.formId).value; |
|
|
|
if (!key.settings.required || |
|
|
|
(key.settings.required && isDefinedAndNotNull(currentValue) && isNotEmptyStr(currentValue.toString()))) { |
|
|
|
const dataToSave: MultipleInputWidgetSource = { |
|
|
|
datasource: source.datasource, |
|
|
|
keys: [key] |
|
|
|
}; |
|
|
|
this.save(dataToSave); |
|
|
|
} |
|
|
|
const dataToSave: MultipleInputWidgetSource = { |
|
|
|
datasource: source.datasource, |
|
|
|
keys: [key] |
|
|
|
}; |
|
|
|
this.save(dataToSave); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public saveForm() { |
|
|
|
if (this.settings.showActionButtons) { |
|
|
|
this.save(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public save(dataToSave?: MultipleInputWidgetSource) { |
|
|
|
private save(dataToSave?: MultipleInputWidgetSource) { |
|
|
|
if (document?.activeElement && !this.isSavingInProgress) { |
|
|
|
this.isSavingInProgress = true; |
|
|
|
(document.activeElement as HTMLElement).blur(); |
|
|
|
|