@descope/web-components-ui 3.13.1 → 3.13.3

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.
@@ -10550,6 +10550,11 @@ class RawTooltip extends createBaseClass$1({
10550
10550
  componentName: componentName$_,
10551
10551
  baseSelector: 'vaadin-tooltip',
10552
10552
  }) {
10553
+ // Observes the inner descope-anchored's `class` attribute so runtime updates
10554
+ // (e.g. real-time conditional components toggling `.hidden`) keep this
10555
+ // tooltip's class in sync. Set up in connectedCallback so reconnects work.
10556
+ #anchoredClassObserver = null;
10557
+
10553
10558
  constructor() {
10554
10559
  super();
10555
10560
 
@@ -10665,9 +10670,31 @@ class RawTooltip extends createBaseClass$1({
10665
10670
  );
10666
10671
  this.#setTooltipTarget();
10667
10672
 
10673
+ setTimeout(() => this.#onOverlayReady());
10674
+ }
10675
+
10676
+ #observeAnchored() {
10677
+ this.#anchoredClassObserver?.disconnect();
10678
+ if (this.anchored) {
10679
+ this.#anchoredClassObserver = observeAttributes(
10680
+ this.anchored,
10681
+ () => this.#syncComponentState(),
10682
+ { includeAttrs: ['class'] },
10683
+ );
10684
+ }
10685
+ }
10686
+
10687
+ // createBaseClass gates init() to first-connect, so observing here is
10688
+ // required for the detach/reattach cycle to keep working.
10689
+ connectedCallback() {
10690
+ super.connectedCallback?.();
10668
10691
  this.#syncComponentState();
10692
+ this.#observeAnchored();
10693
+ }
10669
10694
 
10670
- setTimeout(() => this.#onOverlayReady());
10695
+ disconnectedCallback() {
10696
+ super.disconnectedCallback?.();
10697
+ this.#anchoredClassObserver?.disconnect();
10671
10698
  }
10672
10699
 
10673
10700
  #setTooltipTarget() {
@@ -11959,6 +11986,12 @@ class RawAttachment extends createBaseClass$1({
11959
11986
  componentName: componentName$X,
11960
11987
  baseSelector: 'descope-anchored',
11961
11988
  }) {
11989
+ // Observes the inner descope-anchored's `class` attribute so runtime
11990
+ // updates (e.g. real-time conditional components toggling `.hidden`) keep
11991
+ // this attachment host's class in sync. Set up in connectedCallback so
11992
+ // reconnects work (createBaseClass gates init() to first connect only).
11993
+ #anchoredClassObserver = null;
11994
+
11962
11995
  constructor() {
11963
11996
  super();
11964
11997
 
@@ -11997,8 +12030,6 @@ class RawAttachment extends createBaseClass$1({
11997
12030
  init() {
11998
12031
  super.init?.();
11999
12032
 
12000
- this.#syncComponentState();
12001
-
12002
12033
  injectStyle(
12003
12034
  `
12004
12035
  :host {
@@ -12049,6 +12080,30 @@ class RawAttachment extends createBaseClass$1({
12049
12080
  this.classList.toggle('hidden', hasHidden);
12050
12081
  }
12051
12082
 
12083
+ #observeAnchored() {
12084
+ this.#anchoredClassObserver?.disconnect();
12085
+ if (this.anchored) {
12086
+ this.#anchoredClassObserver = observeAttributes(
12087
+ this.anchored,
12088
+ () => this.#syncComponentState(),
12089
+ { includeAttrs: ['class'] },
12090
+ );
12091
+ }
12092
+ }
12093
+
12094
+ // createBaseClass gates init() to first-connect, so observing here is
12095
+ // required for the detach/reattach cycle to keep working.
12096
+ connectedCallback() {
12097
+ super.connectedCallback?.();
12098
+ this.#syncComponentState();
12099
+ this.#observeAnchored();
12100
+ }
12101
+
12102
+ disconnectedCallback() {
12103
+ super.disconnectedCallback?.();
12104
+ this.#anchoredClassObserver?.disconnect();
12105
+ }
12106
+
12052
12107
  #syncAvailableSizeAttr() {
12053
12108
  const anchor = this.defaultSlot?.assignedElements()?.[0];
12054
12109
 
@@ -19968,6 +20023,12 @@ const customMixin$6 = (superclass) =>
19968
20023
 
19969
20024
  this.baseElement.appendChild(template.content.cloneNode(true));
19970
20025
 
20026
+ // On every input, Vaadin writes its value back into the input element,
20027
+ // which re-runs the internal `value` setter and overwrites the combo box
20028
+ // and phone fields. PhoneFieldInternal manages those inputs itself, so
20029
+ // disable Vaadin's write-back.
20030
+ this.baseElement._forwardInputValue = () => {};
20031
+
19971
20032
  this.inputElement = this.shadowRoot.querySelector(componentName$B);
19972
20033
 
19973
20034
  forwardAttrs$1(this.shadowRoot.host, this.inputElement, {
@@ -29396,6 +29457,11 @@ class RawAnchored extends createBaseClass$1({
29396
29457
 
29397
29458
  #hostStretchSheet = null;
29398
29459
 
29460
+ // Observes the anchor's `class` attribute so runtime updates by the SDK
29461
+ // (e.g. real-time conditional components toggling `.hidden`) propagate to
29462
+ // this element. Without this, only the initial slotchange would sync.
29463
+ #anchorClassObserver = null;
29464
+
29399
29465
  get #anchor() {
29400
29466
  return this.defaultSlot.assignedElements({ flatten: true })[0];
29401
29467
  }
@@ -29498,6 +29564,28 @@ class RawAnchored extends createBaseClass$1({
29498
29564
  this.#anchored,
29499
29565
  'st-host-direction',
29500
29566
  );
29567
+
29568
+ this.#observeAnchorClass();
29569
+ }
29570
+
29571
+ #observeAnchorClass() {
29572
+ this.#anchorClassObserver?.disconnect();
29573
+ if (this.#anchor) {
29574
+ this.#anchorClassObserver = observeAttributes(
29575
+ this.#anchor,
29576
+ () => this.#syncComponentState(),
29577
+ { includeAttrs: ['class'] },
29578
+ );
29579
+ }
29580
+ }
29581
+
29582
+ // createBaseClass gates init() to first-connect (#isInit). Without
29583
+ // re-observing here, runtime `.hidden` toggles stop syncing after a
29584
+ // detach/reattach cycle.
29585
+ connectedCallback() {
29586
+ super.connectedCallback?.();
29587
+ this.#observeAnchorClass();
29588
+ this.#syncComponentState();
29501
29589
  }
29502
29590
 
29503
29591
  // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)
@@ -29539,6 +29627,7 @@ class RawAnchored extends createBaseClass$1({
29539
29627
  super.disconnectedCallback?.();
29540
29628
  this.#stretchObserver?.disconnect();
29541
29629
  this.#directionObserver?.disconnect();
29630
+ this.#anchorClassObserver?.disconnect();
29542
29631
  }
29543
29632
 
29544
29633
  // Track whether anything is slotted, so the host display rule can hide an