@sbb-esta/lyne-elements-dev 5.0.0-next-dev.1776258948 → 5.0.0-next-dev.1776264581

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.
@@ -1,2 +1,2 @@
1
- import { t as e } from "../autocomplete-base-element-BysEZecQ.js";
1
+ import { t as e } from "../autocomplete-base-element-B7fDDO1F.js";
2
2
  export { e as SbbAutocompleteBaseElement };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../autocomplete-base-element-BysEZecQ.js";
1
+ import { t as e } from "../autocomplete-base-element-B7fDDO1F.js";
2
2
  import { getNextElementIndex as t, isSafari as n, setAriaComboBoxAttributes as r } from "../core.js";
3
3
  //#region src/elements/autocomplete/autocomplete.component.ts
4
4
  var i = 0, a = n, o = class extends e {
@@ -243,12 +243,15 @@ var S = ".sbb-gap-fix-wrapper{position:relative;overflow:hidden;width:var(--sbb-
243
243
  return this._triggerElement ?? null;
244
244
  }
245
245
  constructor() {
246
- super(), this.#e = t(this, T, null), this.#t = (t(this, E), t(this, O, null)), this.#n = (t(this, k), t(this, j, !1)), this.#r = (t(this, M), t(this, P, !1)), this.#i = (t(this, F), t(this, L, null)), this.#a = (t(this, R), t(this, B, h() ? "s" : "m")), this.#o = (t(this, V), t(this, U, !1)), this.#s = (t(this, W), t(this, K, !1)), this.#c = (t(this, q), t(this, Y, !1)), this.#l = (t(this, X), t(this, Q, "auto")), this._triggerElement = t(this, $), this.activeOption = null, this.pendingAutoSelectedOption = null, this._originResizeObserver = new b(this, {
246
+ super(), this.#e = t(this, T, null), this.#t = (t(this, E), t(this, O, null)), this.#n = (t(this, k), t(this, j, !1)), this.#r = (t(this, M), t(this, P, !1)), this.#i = (t(this, F), t(this, L, null)), this.#a = (t(this, R), t(this, B, h() ? "s" : "m")), this.#o = (t(this, V), t(this, U, !1)), this.#s = (t(this, W), t(this, K, !1)), this.#c = (t(this, q), t(this, Y, !1)), this.#l = (t(this, X), t(this, Q, "auto")), this._triggerElement = t(this, $), this.activeOption = null, this.pendingAutoSelectedOption = null, this._resizeObserver = new b(this, {
247
247
  target: null,
248
248
  skipInitial: !0,
249
- callback: () => {
250
- this.state === "opened" && this._setOverlayPosition();
251
- }
249
+ callback: (() => {
250
+ let e;
251
+ return () => {
252
+ clearTimeout(e), e = setTimeout(() => this._setOverlayPosition(), 10);
253
+ };
254
+ })()
252
255
  }), this._triggerAttributeObserver = r ? null : new MutationObserver((e) => {
253
256
  let t = e[0].target;
254
257
  (t.hasAttribute("disabled") || t.hasAttribute("readonly")) && this.close();
@@ -271,7 +274,7 @@ var S = ".sbb-gap-fix-wrapper{position:relative;overflow:hidden;width:var(--sbb-
271
274
  this._setOverlayPosition(e), this._setNextActiveOptionIfAutoActiveFirstOption(), this._attachOpenPanelEvents(), this._escapableOverlayController.connect(), this._isZeroAnimationDuration() && this._handleOpening();
272
275
  }
273
276
  close() {
274
- this.state === "closing" || this.state === "closed" || !this.dispatchBeforeCloseEvent() || (this.pendingAutoSelectedOption && (this.pendingAutoSelectedOption.selected = !0, this._setValueAndDispatchEvents(this.pendingAutoSelectedOption, !0)), this.state = "closing", this.triggerElement?.removeAttribute("data-expanded"), this._openPanelEventsController.abort(), this.originElement && this._originResizeObserver.unobserve(this.originElement), this._isZeroAnimationDuration() && this._handleClosing());
277
+ this.state === "closing" || this.state === "closed" || !this.dispatchBeforeCloseEvent() || (this.pendingAutoSelectedOption && (this.pendingAutoSelectedOption.selected = !0, this._setValueAndDispatchEvents(this.pendingAutoSelectedOption, !0)), this.state = "closing", this.triggerElement?.removeAttribute("data-expanded"), this._openPanelEventsController.abort(), this.originElement && this._resizeObserver.unobserve(this.originElement), this._isZeroAnimationDuration() && this._handleClosing());
275
278
  }
276
279
  _isZeroAnimationDuration() {
277
280
  return _(this, "--sbb-options-panel-animation-duration");
@@ -311,7 +314,9 @@ var S = ".sbb-gap-fix-wrapper{position:relative;overflow:hidden;width:var(--sbb-
311
314
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value").set.call(this.triggerElement, t);
312
315
  }
313
316
  _handleSlotchange() {
314
- this._highlightOptions(this.triggerElement?.value), this.isOpen ? (this._setOverlayPosition(), this._setNextActiveOptionIfAutoActiveFirstOption(), this._optionsCount > 0 && this.options.length === 0 && this.close()) : document?.activeElement === this.triggerElement && this._optionsCount === 0 && this.options.length > 0 && this.open(), this._optionsCount = this.options.length;
317
+ this._highlightOptions(this.triggerElement?.value);
318
+ let e = Array.from(this.querySelectorAll("*"));
319
+ this._previousElements?.forEach((e) => this._resizeObserver.unobserve(e)), this._previousElements = e, this._previousElements.forEach((e) => this._resizeObserver.observe(e)), this.isOpen ? (this._setOverlayPosition(), this._setNextActiveOptionIfAutoActiveFirstOption(), this._optionsCount > 0 && this.options.length === 0 && this.close()) : document?.activeElement === this.triggerElement && this._optionsCount === 0 && this.options.length > 0 && this.open(), this._optionsCount = this.options.length;
315
320
  }
316
321
  _setNextActiveOptionIfAutoActiveFirstOption() {
317
322
  this.autoActiveFirstOption && (this.resetActiveElement(), this.setNextActiveOption());
@@ -357,7 +362,7 @@ var S = ".sbb-gap-fix-wrapper{position:relative;overflow:hidden;width:var(--sbb-
357
362
  e.animationName === "open" && this.state === "opening" ? this._handleOpening() : e.animationName === "close" && this.state === "closing" && this._handleClosing();
358
363
  }
359
364
  _handleOpening() {
360
- this.state = "opened", this.originElement && this._originResizeObserver.observe(this.originElement), this.triggerElement?.setAttribute("aria-expanded", "true"), this.dispatchOpenEvent();
365
+ this.state = "opened", this.originElement && this._resizeObserver.observe(this.originElement), this.triggerElement?.setAttribute("aria-expanded", "true"), this.dispatchOpenEvent();
361
366
  }
362
367
  _handleClosing() {
363
368
  this.state = "closed", this.hidePopover?.(), this.triggerElement?.setAttribute("aria-expanded", "false"), this.resetActiveElement(), this._optionContainer.scrollTop = 0, this._escapableOverlayController.disconnect(), this.dispatchCloseEvent();
package/autocomplete.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./autocomplete-base-element-BysEZecQ.js";
1
+ import { t as e } from "./autocomplete-base-element-B7fDDO1F.js";
2
2
  import { SbbAutocompleteElement as t } from "./autocomplete/autocomplete.component.js";
3
3
  import "./autocomplete.pure.js";
4
4
  //#region src/elements/autocomplete.ts
@@ -1,3 +1,3 @@
1
- import { t as e } from "./autocomplete-base-element-BysEZecQ.js";
1
+ import { t as e } from "./autocomplete-base-element-B7fDDO1F.js";
2
2
  import { SbbAutocompleteElement as t } from "./autocomplete/autocomplete.component.js";
3
3
  export { e as SbbAutocompleteBaseElement, t as SbbAutocompleteElement };