@ekzo-dev/bootstrap-addons 5.3.7 → 5.3.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ekzo-dev/bootstrap-addons",
3
3
  "description": "Aurelia Bootstrap additional component",
4
- "version": "5.3.7",
4
+ "version": "5.3.8",
5
5
  "homepage": "https://github.com/ekzo-dev/aurelia-components/tree/main/packages/bootstrap-addons",
6
6
  "repository": {
7
7
  "type": "git",
@@ -49,6 +49,12 @@ export class BsSelect extends BaseBsSelect implements ICustomElementViewModel {
49
49
  this.setPopperConfig();
50
50
  }
51
51
 
52
+ valueChanged(value: unknown): void {
53
+ if (this.multiple && !Array.isArray(value)) {
54
+ this.value = [];
55
+ }
56
+ }
57
+
52
58
  setPopperConfig() {
53
59
  const { host } = this;
54
60
  const parentModal = host.closest('.modal-body,.popover-body,.offcanvas-body');
@@ -78,9 +84,9 @@ export class BsSelect extends BaseBsSelect implements ICustomElementViewModel {
78
84
  if (this.multiple) {
79
85
  const { options, value } = this;
80
86
 
81
- return (value as [])
82
- .map((val) => (options as ISelectOption[]).find((option) => option.value === val).text)
83
- .join(', ');
87
+ return Array.isArray(value)
88
+ ? value.map((val) => (options as ISelectOption[]).find((option) => option.value === val).text).join(', ')
89
+ : '';
84
90
  }
85
91
 
86
92
  const { selectedOption, emptyOption } = this;
@@ -96,7 +102,7 @@ export class BsSelect extends BaseBsSelect implements ICustomElementViewModel {
96
102
  return (
97
103
  !this.disabled &&
98
104
  ((this.emptyOption && this.selectedOption?.value !== this.emptyOption.value) ||
99
- (this.multiple && (this.value as unknown[]).length > 0))
105
+ (this.multiple && Array.isArray(this.value) && this.value.length > 0))
100
106
  );
101
107
  }
102
108