@aquera/nile-elements 0.1.59 → 0.1.60

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
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.1.59",
6
+ "version": "0.1.60",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -89,7 +89,7 @@ export class FormControlController implements ReactiveController {
89
89
  }
90
90
 
91
91
  hostConnected() {
92
- const form = this.options.form(this.host);
92
+ const form = this.options?.form(this.host);
93
93
 
94
94
  if (form) {
95
95
  this.attachForm(form);
@@ -97,7 +97,7 @@ export class FormControlController implements ReactiveController {
97
97
 
98
98
  // Listen for interactions
99
99
  interactions.set(this.host, []);
100
- this.options.assumeInteractionOn.forEach(event => {
100
+ this.options?.assumeInteractionOn.forEach(event => {
101
101
  this.host.addEventListener(event, this.handleInteraction);
102
102
  });
103
103
  }
@@ -107,7 +107,7 @@ export class FormControlController implements ReactiveController {
107
107
 
108
108
  // Clean up interactions
109
109
  interactions.delete(this.host);
110
- this.options.assumeInteractionOn.forEach(event => {
110
+ this.options?.assumeInteractionOn.forEach(event => {
111
111
  this.host.removeEventListener(event, this.handleInteraction);
112
112
  });
113
113
  }
@@ -100,7 +100,15 @@ export class NileChip extends NileElement {
100
100
  protected updated(changedProperties: PropertyValues): void {
101
101
  super.updated(changedProperties);
102
102
  if (changedProperties.has('autoCompleteOptions')) {
103
- this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];
103
+ let options = this.autoCompleteOptions;
104
+ if (typeof options === 'string') {
105
+ try {
106
+ options = JSON.parse(options);
107
+ } catch (e) {
108
+ options = [];
109
+ }
110
+ }
111
+ this.filteredAutoCompleteOptions = Array.isArray(options) ? [...options] : [];
104
112
  if (this.noDuplicates) {
105
113
  this.filteredAutoCompleteOptions =
106
114
  this.filteredAutoCompleteOptions.filter(