@aquera/nile-elements 0.1.60-beta-1.0 → 0.1.60-beta-1.1

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.60-beta-1.0",
6
+ "version": "0.1.60-beta-1.1",
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
  }
@@ -103,7 +103,15 @@ export class NileChip extends NileElement {
103
103
  protected updated(changedProperties: PropertyValues): void {
104
104
  super.updated(changedProperties);
105
105
  if (changedProperties.has('autoCompleteOptions')) {
106
- this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];
106
+ let options = this.autoCompleteOptions;
107
+ if (typeof options === 'string') {
108
+ try {
109
+ options = JSON.parse(options);
110
+ } catch (e) {
111
+ options = [];
112
+ }
113
+ }
114
+ this.filteredAutoCompleteOptions = Array.isArray(options) ? [...options] : [];
107
115
  if (this.noDuplicates) {
108
116
  this.filteredAutoCompleteOptions =
109
117
  this.filteredAutoCompleteOptions.filter(