@aurodesignsystem-dev/auro-formkit 0.0.0-pr692.0 → 0.0.0-pr692.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.
@@ -9391,6 +9391,11 @@ class AuroCounterGroup extends AuroElement {
9391
9391
  */
9392
9392
  this.validation = new AuroFormValidation();
9393
9393
 
9394
+ // Bind callback methods since we can't use arrow functions in class properties
9395
+
9396
+ /** @private */
9397
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
9398
+
9394
9399
  /**
9395
9400
  * Generate unique names for dependency components.
9396
9401
  * @private
@@ -9639,6 +9644,9 @@ class AuroCounterGroup extends AuroElement {
9639
9644
  return;
9640
9645
  }
9641
9646
 
9647
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
9648
+ if (!this.dropdownFocusTrap) return;
9649
+
9642
9650
  // If the dropdown is not open, disconnect the focus trap if it exists
9643
9651
  this.dropdownFocusTrap.disconnect();
9644
9652
  this.dropdownFocusTrap = undefined;
@@ -9654,7 +9662,7 @@ class AuroCounterGroup extends AuroElement {
9654
9662
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
9655
9663
  this.dropdown.requestUpdate();
9656
9664
 
9657
- this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle.bind(this));
9665
+ this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9658
9666
 
9659
9667
  const counterWrapper = this.shadowRoot.querySelector('auro-counter-wrapper');
9660
9668
  const counterSlot = counterWrapper.querySelector('slot');
@@ -9801,6 +9809,13 @@ class AuroCounterGroup extends AuroElement {
9801
9809
  this.updateValueText();
9802
9810
  }
9803
9811
 
9812
+ disconnectedCallback() {
9813
+ super.disconnectedCallback();
9814
+
9815
+ // Remove the event listener for dropdown toggling
9816
+ this.removeEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9817
+ }
9818
+
9804
9819
  /**
9805
9820
  * Registers the custom element with the browser.
9806
9821
  * @param {string} [name="auro-counter-group"] - Custom element name to register.
@@ -9391,6 +9391,11 @@ class AuroCounterGroup extends AuroElement {
9391
9391
  */
9392
9392
  this.validation = new AuroFormValidation();
9393
9393
 
9394
+ // Bind callback methods since we can't use arrow functions in class properties
9395
+
9396
+ /** @private */
9397
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
9398
+
9394
9399
  /**
9395
9400
  * Generate unique names for dependency components.
9396
9401
  * @private
@@ -9639,6 +9644,9 @@ class AuroCounterGroup extends AuroElement {
9639
9644
  return;
9640
9645
  }
9641
9646
 
9647
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
9648
+ if (!this.dropdownFocusTrap) return;
9649
+
9642
9650
  // If the dropdown is not open, disconnect the focus trap if it exists
9643
9651
  this.dropdownFocusTrap.disconnect();
9644
9652
  this.dropdownFocusTrap = undefined;
@@ -9654,7 +9662,7 @@ class AuroCounterGroup extends AuroElement {
9654
9662
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
9655
9663
  this.dropdown.requestUpdate();
9656
9664
 
9657
- this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle.bind(this));
9665
+ this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9658
9666
 
9659
9667
  const counterWrapper = this.shadowRoot.querySelector('auro-counter-wrapper');
9660
9668
  const counterSlot = counterWrapper.querySelector('slot');
@@ -9801,6 +9809,13 @@ class AuroCounterGroup extends AuroElement {
9801
9809
  this.updateValueText();
9802
9810
  }
9803
9811
 
9812
+ disconnectedCallback() {
9813
+ super.disconnectedCallback();
9814
+
9815
+ // Remove the event listener for dropdown toggling
9816
+ this.removeEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9817
+ }
9818
+
9804
9819
  /**
9805
9820
  * Registers the custom element with the browser.
9806
9821
  * @param {string} [name="auro-counter-group"] - Custom element name to register.
@@ -175,6 +175,12 @@ export class AuroCounterGroup extends LitElement {
175
175
  * @private
176
176
  */
177
177
  private validation;
178
+ /**
179
+ * Performs state updates that should happen when the dropdown is toggled.
180
+ * @returns {void}
181
+ * @private
182
+ */
183
+ private handleDropdownToggle;
178
184
  /**
179
185
  * Dynamically generated dropdown tag.
180
186
  * @private
@@ -209,12 +215,6 @@ export class AuroCounterGroup extends LitElement {
209
215
  * @private
210
216
  */
211
217
  private configureCounters;
212
- /**
213
- * Performs state updates that should happen when the dropdown is toggled.
214
- * @returns {void}
215
- * @private
216
- */
217
- private handleDropdownToggle;
218
218
  /**
219
219
  * Updates the focus trap based on whether the dropdown is open or closed.
220
220
  * If the dropdown is open, it creates a new focus trap and focuses the first element
@@ -9344,6 +9344,11 @@ class AuroCounterGroup extends AuroElement {
9344
9344
  */
9345
9345
  this.validation = new AuroFormValidation();
9346
9346
 
9347
+ // Bind callback methods since we can't use arrow functions in class properties
9348
+
9349
+ /** @private */
9350
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
9351
+
9347
9352
  /**
9348
9353
  * Generate unique names for dependency components.
9349
9354
  * @private
@@ -9592,6 +9597,9 @@ class AuroCounterGroup extends AuroElement {
9592
9597
  return;
9593
9598
  }
9594
9599
 
9600
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
9601
+ if (!this.dropdownFocusTrap) return;
9602
+
9595
9603
  // If the dropdown is not open, disconnect the focus trap if it exists
9596
9604
  this.dropdownFocusTrap.disconnect();
9597
9605
  this.dropdownFocusTrap = undefined;
@@ -9607,7 +9615,7 @@ class AuroCounterGroup extends AuroElement {
9607
9615
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
9608
9616
  this.dropdown.requestUpdate();
9609
9617
 
9610
- this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle.bind(this));
9618
+ this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9611
9619
 
9612
9620
  const counterWrapper = this.shadowRoot.querySelector('auro-counter-wrapper');
9613
9621
  const counterSlot = counterWrapper.querySelector('slot');
@@ -9754,6 +9762,13 @@ class AuroCounterGroup extends AuroElement {
9754
9762
  this.updateValueText();
9755
9763
  }
9756
9764
 
9765
+ disconnectedCallback() {
9766
+ super.disconnectedCallback();
9767
+
9768
+ // Remove the event listener for dropdown toggling
9769
+ this.removeEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9770
+ }
9771
+
9757
9772
  /**
9758
9773
  * Registers the custom element with the browser.
9759
9774
  * @param {string} [name="auro-counter-group"] - Custom element name to register.
@@ -9344,6 +9344,11 @@ class AuroCounterGroup extends AuroElement {
9344
9344
  */
9345
9345
  this.validation = new AuroFormValidation();
9346
9346
 
9347
+ // Bind callback methods since we can't use arrow functions in class properties
9348
+
9349
+ /** @private */
9350
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
9351
+
9347
9352
  /**
9348
9353
  * Generate unique names for dependency components.
9349
9354
  * @private
@@ -9592,6 +9597,9 @@ class AuroCounterGroup extends AuroElement {
9592
9597
  return;
9593
9598
  }
9594
9599
 
9600
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
9601
+ if (!this.dropdownFocusTrap) return;
9602
+
9595
9603
  // If the dropdown is not open, disconnect the focus trap if it exists
9596
9604
  this.dropdownFocusTrap.disconnect();
9597
9605
  this.dropdownFocusTrap = undefined;
@@ -9607,7 +9615,7 @@ class AuroCounterGroup extends AuroElement {
9607
9615
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
9608
9616
  this.dropdown.requestUpdate();
9609
9617
 
9610
- this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle.bind(this));
9618
+ this.dropdown.addEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9611
9619
 
9612
9620
  const counterWrapper = this.shadowRoot.querySelector('auro-counter-wrapper');
9613
9621
  const counterSlot = counterWrapper.querySelector('slot');
@@ -9754,6 +9762,13 @@ class AuroCounterGroup extends AuroElement {
9754
9762
  this.updateValueText();
9755
9763
  }
9756
9764
 
9765
+ disconnectedCallback() {
9766
+ super.disconnectedCallback();
9767
+
9768
+ // Remove the event listener for dropdown toggling
9769
+ this.removeEventListener("auroDropdown-toggled", this.handleDropdownToggle);
9770
+ }
9771
+
9757
9772
  /**
9758
9773
  * Registers the custom element with the browser.
9759
9774
  * @param {string} [name="auro-counter-group"] - Custom element name to register.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr692.0",
3
+ "version": "0.0.0-pr692.1",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {