onshore-forms 0.0.46 → 0.0.47
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.
- package/esm2020/lib/components/form-dropdown-item/form-dropdown-item.component.mjs +6 -4
- package/esm2020/lib/models/form.models.mjs +1 -1
- package/fesm2015/onshore-forms.mjs +7 -5
- package/fesm2015/onshore-forms.mjs.map +1 -1
- package/fesm2020/onshore-forms.mjs +5 -3
- package/fesm2020/onshore-forms.mjs.map +1 -1
- package/lib/models/form.models.d.ts +1 -0
- package/package.json +1 -1
|
@@ -882,7 +882,6 @@ class OnshoreFormDropdownItemComponent {
|
|
|
882
882
|
this.optionGroupLabel = '';
|
|
883
883
|
this.dataKey = '';
|
|
884
884
|
this.actionButtonDisabled = false;
|
|
885
|
-
this.options = [];
|
|
886
885
|
this.valueChange = new EventEmitter();
|
|
887
886
|
this.actionButtonClick = new EventEmitter();
|
|
888
887
|
this.disabled = false;
|
|
@@ -918,8 +917,11 @@ class OnshoreFormDropdownItemComponent {
|
|
|
918
917
|
this.ngControl.control?.disable();
|
|
919
918
|
}
|
|
920
919
|
ngOnChanges(changes) {
|
|
921
|
-
const currentOptions = changes['options']?.currentValue;
|
|
922
|
-
const previousOptions = changes['options']?.previousValue;
|
|
920
|
+
const currentOptions = changes['options']?.currentValue ?? changes['formTemplate']?.currentValue?.options;
|
|
921
|
+
const previousOptions = changes['options']?.previousValue ?? changes['formTemplate']?.previousValue?.options;
|
|
922
|
+
if (!this.options && currentOptions) {
|
|
923
|
+
this.options = currentOptions;
|
|
924
|
+
}
|
|
923
925
|
if (currentOptions?.length > 0 && currentOptions != previousOptions && !this.multiple) {
|
|
924
926
|
this.ngControl.control?.setValue(this.options[0]?.value);
|
|
925
927
|
}
|