@tetacom/ng-components 1.0.88 → 1.0.89
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/component/select/select/select.component.d.ts +3 -1
- package/esm2020/component/select/select/select.component.mjs +23 -13
- package/fesm2015/tetacom-ng-components.mjs +23 -13
- package/fesm2015/tetacom-ng-components.mjs.map +1 -1
- package/fesm2020/tetacom-ng-components.mjs +22 -12
- package/fesm2020/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4902,6 +4902,15 @@ class SelectComponent {
|
|
|
4902
4902
|
};
|
|
4903
4903
|
this.locale = this._config.locale;
|
|
4904
4904
|
}
|
|
4905
|
+
set options(options) {
|
|
4906
|
+
this._options = options;
|
|
4907
|
+
if (this.value) {
|
|
4908
|
+
this.getSelectedValue(this.getValue(this.value));
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
get options() {
|
|
4912
|
+
return this._options;
|
|
4913
|
+
}
|
|
4905
4914
|
get tabindex() {
|
|
4906
4915
|
return this.disabled ? null : 0;
|
|
4907
4916
|
}
|
|
@@ -5009,17 +5018,7 @@ class SelectComponent {
|
|
|
5009
5018
|
ngOnInit() {
|
|
5010
5019
|
}
|
|
5011
5020
|
writeValue(value) {
|
|
5012
|
-
|
|
5013
|
-
this.value =
|
|
5014
|
-
value && this.options
|
|
5015
|
-
? this.options.filter((option) => value.indexOf(this.getValue(option)) > -1)
|
|
5016
|
-
: [];
|
|
5017
|
-
}
|
|
5018
|
-
else {
|
|
5019
|
-
this.value =
|
|
5020
|
-
this.options &&
|
|
5021
|
-
this.options?.find((option) => this.getValue(option) === value);
|
|
5022
|
-
}
|
|
5021
|
+
this.getSelectedValue(value);
|
|
5023
5022
|
this._cdr.detectChanges();
|
|
5024
5023
|
}
|
|
5025
5024
|
registerOnChange(fn) {
|
|
@@ -5032,7 +5031,18 @@ class SelectComponent {
|
|
|
5032
5031
|
this.disabled = isDisabled;
|
|
5033
5032
|
this._cdr.markForCheck();
|
|
5034
5033
|
}
|
|
5035
|
-
getSelectedValue() {
|
|
5034
|
+
getSelectedValue(value) {
|
|
5035
|
+
if (this.multiple) {
|
|
5036
|
+
this.value =
|
|
5037
|
+
value && this.options
|
|
5038
|
+
? this.options.filter((option) => value.indexOf(this.getValue(option)) > -1)
|
|
5039
|
+
: [];
|
|
5040
|
+
}
|
|
5041
|
+
else {
|
|
5042
|
+
this.value =
|
|
5043
|
+
this.options &&
|
|
5044
|
+
this.options?.find((option) => this.getValue(option) === value);
|
|
5045
|
+
}
|
|
5036
5046
|
}
|
|
5037
5047
|
}
|
|
5038
5048
|
SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: TetaConfigService }], target: i0.ɵɵFactoryTarget.Component });
|