@proximus/lavender-input 2.0.0-alpha.23 → 2.0.0-alpha.26

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.
Files changed (2) hide show
  1. package/dist/index.es.js +20 -11
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -151,23 +151,33 @@ const y = class y extends n {
151
151
  super();
152
152
  }
153
153
  connectedCallback() {
154
- if (super.connectedCallback(), this.$lightSuggestions) {
155
- const e = document.createElement("datalist");
156
- e.id = "suggestions", this.$el.setAttribute("list", e.id), this.$container.appendChild(e), e.innerHTML = this.$lightSuggestions.innerHTML, this.observer = new MutationObserver(() => {
157
- this.syncDataList();
158
- }), this.observer.observe(this.$lightSuggestions, { childList: !0 });
159
- }
160
- this.type === "search" && navigator.userAgent.includes("Chrome") && (this.$el.style.setProperty("--search-icon-focus-width", "2.5rem"), this.$el.style.setProperty("--search-icon-datalist-width", "1rem"));
154
+ super.connectedCallback(), this.$el.type === "search" && (this.$el.setAttribute("list", "suggestions"), this.syncDataList(), this.observer = new MutationObserver(() => {
155
+ this.syncDataList();
156
+ }), this.observer.observe(this, {
157
+ childList: !0,
158
+ subtree: !0
159
+ })), this.type === "search" && navigator.userAgent.includes("Chrome") && (this.$el.style.setProperty("--search-icon-focus-width", "2.5rem"), this.$el.style.setProperty("--search-icon-datalist-width", "1rem"));
161
160
  }
162
161
  syncDataList() {
163
- this.$shadowSuggestions.innerHTML = this.$lightSuggestions.innerHTML;
162
+ var t, i;
163
+ const e = (t = this.$lightSuggestions) == null ? void 0 : t.cloneNode(
164
+ !0
165
+ );
166
+ if (e) {
167
+ if (e.id = "suggestions", this.$shadowSuggestions) {
168
+ this.$shadowSuggestions.replaceWith(e);
169
+ return;
170
+ }
171
+ this.$el.insertAdjacentElement("afterend", e);
172
+ } else
173
+ (i = this.$shadowSuggestions) == null || i.remove();
164
174
  }
165
175
  disconnectedCallback() {
166
176
  var e;
167
177
  (e = this.observer) == null || e.disconnect();
168
178
  }
169
179
  template() {
170
- return '<div><input type="text" /><slot name="suggestions"></slot></div>';
180
+ return '<div><input type="text" /></div>';
171
181
  }
172
182
  get $lightSuggestions() {
173
183
  return this.querySelector("datalist");
@@ -200,14 +210,13 @@ const f = class f extends n {
200
210
  g(this, a);
201
211
  }
202
212
  template() {
203
- return '<select><slot name="options"></slot></select>';
213
+ return "<select></select>";
204
214
  }
205
215
  connectedCallback() {
206
216
  super.connectedCallback(), c(this, a, u).call(this), this.observer = new MutationObserver(() => {
207
217
  c(this, a, u).call(this);
208
218
  }), this.observer.observe(this, {
209
219
  childList: !0,
210
- attributes: !0,
211
220
  subtree: !0
212
221
  });
213
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-input",
3
- "version": "2.0.0-alpha.23",
3
+ "version": "2.0.0-alpha.26",
4
4
  "description": "Input component for the Proximus Design System",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",