@aurodesignsystem-dev/auro-formkit 0.0.0-pr647.2 → 0.0.0-pr647.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.
Files changed (37) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +1 -0
  2. package/components/bibtemplate/dist/index.js +12 -0
  3. package/components/bibtemplate/dist/registered.js +12 -0
  4. package/components/checkbox/demo/api.min.js +4 -3
  5. package/components/checkbox/demo/index.min.js +4 -3
  6. package/components/checkbox/dist/index.js +4 -3
  7. package/components/checkbox/dist/registered.js +4 -3
  8. package/components/combobox/demo/api.min.js +92 -10
  9. package/components/combobox/demo/index.min.js +92 -10
  10. package/components/combobox/dist/index.js +92 -10
  11. package/components/combobox/dist/registered.js +92 -10
  12. package/components/counter/demo/api.min.js +88 -7
  13. package/components/counter/demo/index.min.js +88 -7
  14. package/components/counter/dist/index.js +88 -7
  15. package/components/counter/dist/registered.js +88 -7
  16. package/components/datepicker/demo/api.min.js +92 -10
  17. package/components/datepicker/demo/index.min.js +92 -10
  18. package/components/datepicker/dist/index.js +92 -10
  19. package/components/datepicker/dist/registered.js +92 -10
  20. package/components/dropdown/demo/api.min.js +72 -4
  21. package/components/dropdown/demo/index.min.js +72 -4
  22. package/components/dropdown/dist/auro-dropdownBib.d.ts +8 -0
  23. package/components/dropdown/dist/index.js +72 -4
  24. package/components/dropdown/dist/registered.js +72 -4
  25. package/components/input/demo/api.min.js +4 -3
  26. package/components/input/demo/index.min.js +4 -3
  27. package/components/input/dist/index.js +4 -3
  28. package/components/input/dist/registered.js +4 -3
  29. package/components/radio/demo/api.min.js +4 -3
  30. package/components/radio/demo/index.min.js +4 -3
  31. package/components/radio/dist/index.js +4 -3
  32. package/components/radio/dist/registered.js +4 -3
  33. package/components/select/demo/api.min.js +88 -7
  34. package/components/select/demo/index.min.js +88 -7
  35. package/components/select/dist/index.js +88 -7
  36. package/components/select/dist/registered.js +88 -7
  37. package/package.json +3 -3
@@ -34,6 +34,7 @@ export class AuroBibtemplate extends LitElement {
34
34
  * @returns {void}
35
35
  */
36
36
  exposeCssParts(): void;
37
+ firstUpdated(changedProperties: any): void;
37
38
  render(): import("lit-html").TemplateResult;
38
39
  }
39
40
  import { LitElement } from "lit";
@@ -816,6 +816,18 @@ class AuroBibtemplate extends LitElement {
816
816
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
817
817
  }
818
818
 
819
+ firstUpdated(changedProperties) {
820
+ super.firstUpdated(changedProperties);
821
+
822
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
823
+ bubbles: true,
824
+ composed: true,
825
+ detail: {
826
+ element: this
827
+ }
828
+ }));
829
+ }
830
+
819
831
  // function that renders the HTML and CSS into the scope of the component
820
832
  render() {
821
833
  return html$1`
@@ -816,6 +816,18 @@ class AuroBibtemplate extends LitElement {
816
816
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
817
817
  }
818
818
 
819
+ firstUpdated(changedProperties) {
820
+ super.firstUpdated(changedProperties);
821
+
822
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
823
+ bubbles: true,
824
+ composed: true,
825
+ detail: {
826
+ element: this
827
+ }
828
+ }));
829
+ }
830
+
819
831
  // function that renders the HTML and CSS into the scope of the component
820
832
  render() {
821
833
  return html$1`
@@ -449,9 +449,10 @@ class DateFormatter {
449
449
  /**
450
450
  * Convert a date object to string format.
451
451
  * @param {Object} date - Date to convert to string.
452
- * @returns {Object} Returns the date as a string.
452
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
453
+ * @returns {String} Returns the date as a string.
453
454
  */
454
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
455
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
455
456
  year: "numeric",
456
457
  month: "2-digit",
457
458
  day: "2-digit",
@@ -643,7 +644,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
643
644
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
644
645
 
645
646
  // Get the date string of the date object we created from the string date
646
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
647
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
647
648
 
648
649
  // Guard Clause: Generated date matches date string input
649
650
  if (expectedDateStr !== actualDateStr) {
@@ -441,9 +441,10 @@ class DateFormatter {
441
441
  /**
442
442
  * Convert a date object to string format.
443
443
  * @param {Object} date - Date to convert to string.
444
- * @returns {Object} Returns the date as a string.
444
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
445
+ * @returns {String} Returns the date as a string.
445
446
  */
446
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
447
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
447
448
  year: "numeric",
448
449
  month: "2-digit",
449
450
  day: "2-digit",
@@ -635,7 +636,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
635
636
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
636
637
 
637
638
  // Get the date string of the date object we created from the string date
638
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
639
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
639
640
 
640
641
  // Guard Clause: Generated date matches date string input
641
642
  if (expectedDateStr !== actualDateStr) {
@@ -394,9 +394,10 @@ class DateFormatter {
394
394
  /**
395
395
  * Convert a date object to string format.
396
396
  * @param {Object} date - Date to convert to string.
397
- * @returns {Object} Returns the date as a string.
397
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
398
+ * @returns {String} Returns the date as a string.
398
399
  */
399
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
400
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
400
401
  year: "numeric",
401
402
  month: "2-digit",
402
403
  day: "2-digit",
@@ -588,7 +589,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
588
589
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
589
590
 
590
591
  // Get the date string of the date object we created from the string date
591
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
592
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
592
593
 
593
594
  // Guard Clause: Generated date matches date string input
594
595
  if (expectedDateStr !== actualDateStr) {
@@ -394,9 +394,10 @@ class DateFormatter {
394
394
  /**
395
395
  * Convert a date object to string format.
396
396
  * @param {Object} date - Date to convert to string.
397
- * @returns {Object} Returns the date as a string.
397
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
398
+ * @returns {String} Returns the date as a string.
398
399
  */
399
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
400
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
400
401
  year: "numeric",
401
402
  month: "2-digit",
402
403
  day: "2-digit",
@@ -588,7 +589,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
588
589
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
589
590
 
590
591
  // Get the date string of the date object we created from the string date
591
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
592
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
592
593
 
593
594
  // Guard Clause: Generated date matches date string input
594
595
  if (expectedDateStr !== actualDateStr) {
@@ -362,9 +362,10 @@ let DateFormatter$1 = class DateFormatter {
362
362
  /**
363
363
  * Convert a date object to string format.
364
364
  * @param {Object} date - Date to convert to string.
365
- * @returns {Object} Returns the date as a string.
365
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
366
+ * @returns {String} Returns the date as a string.
366
367
  */
367
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
368
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
368
369
  year: "numeric",
369
370
  month: "2-digit",
370
371
  day: "2-digit",
@@ -556,7 +557,7 @@ let AuroDateUtilities$1 = class AuroDateUtilities extends AuroDateUtilitiesBase$
556
557
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
557
558
 
558
559
  // Get the date string of the date object we created from the string date
559
- const actualDateStr = dateFormatter$1.getDateAsString(dateObj);
560
+ const actualDateStr = dateFormatter$1.getDateAsString(dateObj, "en-US");
560
561
 
561
562
  // Guard Clause: Generated date matches date string input
562
563
  if (expectedDateStr !== actualDateStr) {
@@ -2701,8 +2702,28 @@ class AuroFloatingUI {
2701
2702
  if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
2702
2703
  AuroFloatingUI.isMousePressHandlerInitialized = true;
2703
2704
 
2705
+ // Track timeout for isMousePressed reset to avoid race conditions
2706
+ if (!AuroFloatingUI._mousePressedTimeout) {
2707
+ AuroFloatingUI._mousePressedTimeout = null;
2708
+ }
2704
2709
  const mouseEventGlobalHandler = (event) => {
2705
- AuroFloatingUI.isMousePressed = event.type === 'mousedown';
2710
+ const isPressed = event.type === 'mousedown';
2711
+ if (isPressed) {
2712
+ // Clear any pending timeout to prevent race condition
2713
+ if (AuroFloatingUI._mousePressedTimeout !== null) {
2714
+ clearTimeout(AuroFloatingUI._mousePressedTimeout);
2715
+ AuroFloatingUI._mousePressedTimeout = null;
2716
+ }
2717
+ if (!AuroFloatingUI.isMousePressed) {
2718
+ AuroFloatingUI.isMousePressed = true;
2719
+ }
2720
+ } else if (AuroFloatingUI.isMousePressed && !isPressed) {
2721
+ // Schedule reset and track timeout ID
2722
+ AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
2723
+ AuroFloatingUI.isMousePressed = false;
2724
+ AuroFloatingUI._mousePressedTimeout = null;
2725
+ }, 0);
2726
+ }
2706
2727
  };
2707
2728
 
2708
2729
  window.addEventListener('mousedown', mouseEventGlobalHandler);
@@ -2964,8 +2985,9 @@ class AuroFloatingUI {
2964
2985
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2965
2986
  return;
2966
2987
  }
2967
- // if fullscreen bib is still open and the focus is missing, do not close
2968
- if (this.element.bib.hasAttribute('isfullscreen') && activeElement === document.body) {
2988
+
2989
+ // if fullscreen bib is in fullscreen mode, do not close
2990
+ if (this.element.bib.hasAttribute('isfullscreen')) {
2969
2991
  return;
2970
2992
  }
2971
2993
 
@@ -3745,7 +3767,6 @@ var tokensCss$1$2 = i$5`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
3745
3767
  // See LICENSE in the project root for license information.
3746
3768
 
3747
3769
 
3748
-
3749
3770
  const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
3750
3771
  const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
3751
3772
  'xl',
@@ -3815,6 +3836,13 @@ class AuroDropdownBib extends i$2 {
3815
3836
  type: Boolean,
3816
3837
  reflect: true
3817
3838
  },
3839
+
3840
+ /**
3841
+ * A reference to the associated bib template element.
3842
+ */
3843
+ bibTemplate: {
3844
+ type: Object
3845
+ }
3818
3846
  };
3819
3847
  }
3820
3848
 
@@ -3847,9 +3875,50 @@ class AuroDropdownBib extends i$2 {
3847
3875
  }
3848
3876
  }
3849
3877
  });
3878
+
3879
+ if (this.bibTemplate) {
3880
+ // If the bib template is found, set the fullscreen attribute
3881
+ if (this.isFullscreen) {
3882
+ this.bibTemplate.setAttribute('isFullscreen', 'true');
3883
+ } else {
3884
+ this.bibTemplate.removeAttribute('isFullscreen');
3885
+ }
3886
+ }
3850
3887
  }
3851
3888
  }
3852
3889
 
3890
+ connectedCallback() {
3891
+ super.connectedCallback();
3892
+
3893
+ // Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
3894
+ this.addEventListener('auro-bibtemplate-connected', (event) => {
3895
+ const bibTemplate = event.detail.element;
3896
+ this.bibTemplate = bibTemplate;
3897
+
3898
+ if (bibTemplate) {
3899
+ // If the bib template is found, set the fullscreen attribute
3900
+ if (this.isFullscreen) {
3901
+ bibTemplate.setAttribute('isFullscreen', 'true');
3902
+ } else {
3903
+ bibTemplate.removeAttribute('isFullscreen');
3904
+ }
3905
+ }
3906
+ });
3907
+ }
3908
+
3909
+ firstUpdated(changedProperties) {
3910
+ super.firstUpdated(changedProperties);
3911
+
3912
+ // Dispatch a custom event when the component is connected
3913
+ this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
3914
+ bubbles: true,
3915
+ composed: true,
3916
+ detail: {
3917
+ element: this
3918
+ }
3919
+ }));
3920
+ }
3921
+
3853
3922
  // function that renders the HTML and CSS into the scope of the component
3854
3923
  render() {
3855
3924
  return u$2`
@@ -8936,9 +9005,10 @@ class DateFormatter {
8936
9005
  /**
8937
9006
  * Convert a date object to string format.
8938
9007
  * @param {Object} date - Date to convert to string.
8939
- * @returns {Object} Returns the date as a string.
9008
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
9009
+ * @returns {String} Returns the date as a string.
8940
9010
  */
8941
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
9011
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
8942
9012
  year: "numeric",
8943
9013
  month: "2-digit",
8944
9014
  day: "2-digit",
@@ -9130,7 +9200,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
9130
9200
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
9131
9201
 
9132
9202
  // Get the date string of the date object we created from the string date
9133
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
9203
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
9134
9204
 
9135
9205
  // Guard Clause: Generated date matches date string input
9136
9206
  if (expectedDateStr !== actualDateStr) {
@@ -13032,6 +13102,18 @@ class AuroBibtemplate extends i$2 {
13032
13102
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
13033
13103
  }
13034
13104
 
13105
+ firstUpdated(changedProperties) {
13106
+ super.firstUpdated(changedProperties);
13107
+
13108
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
13109
+ bubbles: true,
13110
+ composed: true,
13111
+ detail: {
13112
+ element: this
13113
+ }
13114
+ }));
13115
+ }
13116
+
13035
13117
  // function that renders the HTML and CSS into the scope of the component
13036
13118
  render() {
13037
13119
  return u$2`
@@ -220,9 +220,10 @@ let DateFormatter$1 = class DateFormatter {
220
220
  /**
221
221
  * Convert a date object to string format.
222
222
  * @param {Object} date - Date to convert to string.
223
- * @returns {Object} Returns the date as a string.
223
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
224
+ * @returns {String} Returns the date as a string.
224
225
  */
225
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
226
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
226
227
  year: "numeric",
227
228
  month: "2-digit",
228
229
  day: "2-digit",
@@ -414,7 +415,7 @@ let AuroDateUtilities$1 = class AuroDateUtilities extends AuroDateUtilitiesBase$
414
415
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
415
416
 
416
417
  // Get the date string of the date object we created from the string date
417
- const actualDateStr = dateFormatter$1.getDateAsString(dateObj);
418
+ const actualDateStr = dateFormatter$1.getDateAsString(dateObj, "en-US");
418
419
 
419
420
  // Guard Clause: Generated date matches date string input
420
421
  if (expectedDateStr !== actualDateStr) {
@@ -2559,8 +2560,28 @@ class AuroFloatingUI {
2559
2560
  if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
2560
2561
  AuroFloatingUI.isMousePressHandlerInitialized = true;
2561
2562
 
2563
+ // Track timeout for isMousePressed reset to avoid race conditions
2564
+ if (!AuroFloatingUI._mousePressedTimeout) {
2565
+ AuroFloatingUI._mousePressedTimeout = null;
2566
+ }
2562
2567
  const mouseEventGlobalHandler = (event) => {
2563
- AuroFloatingUI.isMousePressed = event.type === 'mousedown';
2568
+ const isPressed = event.type === 'mousedown';
2569
+ if (isPressed) {
2570
+ // Clear any pending timeout to prevent race condition
2571
+ if (AuroFloatingUI._mousePressedTimeout !== null) {
2572
+ clearTimeout(AuroFloatingUI._mousePressedTimeout);
2573
+ AuroFloatingUI._mousePressedTimeout = null;
2574
+ }
2575
+ if (!AuroFloatingUI.isMousePressed) {
2576
+ AuroFloatingUI.isMousePressed = true;
2577
+ }
2578
+ } else if (AuroFloatingUI.isMousePressed && !isPressed) {
2579
+ // Schedule reset and track timeout ID
2580
+ AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
2581
+ AuroFloatingUI.isMousePressed = false;
2582
+ AuroFloatingUI._mousePressedTimeout = null;
2583
+ }, 0);
2584
+ }
2564
2585
  };
2565
2586
 
2566
2587
  window.addEventListener('mousedown', mouseEventGlobalHandler);
@@ -2822,8 +2843,9 @@ class AuroFloatingUI {
2822
2843
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2823
2844
  return;
2824
2845
  }
2825
- // if fullscreen bib is still open and the focus is missing, do not close
2826
- if (this.element.bib.hasAttribute('isfullscreen') && activeElement === document.body) {
2846
+
2847
+ // if fullscreen bib is in fullscreen mode, do not close
2848
+ if (this.element.bib.hasAttribute('isfullscreen')) {
2827
2849
  return;
2828
2850
  }
2829
2851
 
@@ -3603,7 +3625,6 @@ var tokensCss$1$2 = i$5`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
3603
3625
  // See LICENSE in the project root for license information.
3604
3626
 
3605
3627
 
3606
-
3607
3628
  const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
3608
3629
  const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
3609
3630
  'xl',
@@ -3673,6 +3694,13 @@ class AuroDropdownBib extends i$2 {
3673
3694
  type: Boolean,
3674
3695
  reflect: true
3675
3696
  },
3697
+
3698
+ /**
3699
+ * A reference to the associated bib template element.
3700
+ */
3701
+ bibTemplate: {
3702
+ type: Object
3703
+ }
3676
3704
  };
3677
3705
  }
3678
3706
 
@@ -3705,9 +3733,50 @@ class AuroDropdownBib extends i$2 {
3705
3733
  }
3706
3734
  }
3707
3735
  });
3736
+
3737
+ if (this.bibTemplate) {
3738
+ // If the bib template is found, set the fullscreen attribute
3739
+ if (this.isFullscreen) {
3740
+ this.bibTemplate.setAttribute('isFullscreen', 'true');
3741
+ } else {
3742
+ this.bibTemplate.removeAttribute('isFullscreen');
3743
+ }
3744
+ }
3708
3745
  }
3709
3746
  }
3710
3747
 
3748
+ connectedCallback() {
3749
+ super.connectedCallback();
3750
+
3751
+ // Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
3752
+ this.addEventListener('auro-bibtemplate-connected', (event) => {
3753
+ const bibTemplate = event.detail.element;
3754
+ this.bibTemplate = bibTemplate;
3755
+
3756
+ if (bibTemplate) {
3757
+ // If the bib template is found, set the fullscreen attribute
3758
+ if (this.isFullscreen) {
3759
+ bibTemplate.setAttribute('isFullscreen', 'true');
3760
+ } else {
3761
+ bibTemplate.removeAttribute('isFullscreen');
3762
+ }
3763
+ }
3764
+ });
3765
+ }
3766
+
3767
+ firstUpdated(changedProperties) {
3768
+ super.firstUpdated(changedProperties);
3769
+
3770
+ // Dispatch a custom event when the component is connected
3771
+ this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
3772
+ bubbles: true,
3773
+ composed: true,
3774
+ detail: {
3775
+ element: this
3776
+ }
3777
+ }));
3778
+ }
3779
+
3711
3780
  // function that renders the HTML and CSS into the scope of the component
3712
3781
  render() {
3713
3782
  return u$2`
@@ -8794,9 +8863,10 @@ class DateFormatter {
8794
8863
  /**
8795
8864
  * Convert a date object to string format.
8796
8865
  * @param {Object} date - Date to convert to string.
8797
- * @returns {Object} Returns the date as a string.
8866
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
8867
+ * @returns {String} Returns the date as a string.
8798
8868
  */
8799
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
8869
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
8800
8870
  year: "numeric",
8801
8871
  month: "2-digit",
8802
8872
  day: "2-digit",
@@ -8988,7 +9058,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
8988
9058
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
8989
9059
 
8990
9060
  // Get the date string of the date object we created from the string date
8991
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
9061
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
8992
9062
 
8993
9063
  // Guard Clause: Generated date matches date string input
8994
9064
  if (expectedDateStr !== actualDateStr) {
@@ -12890,6 +12960,18 @@ class AuroBibtemplate extends i$2 {
12890
12960
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
12891
12961
  }
12892
12962
 
12963
+ firstUpdated(changedProperties) {
12964
+ super.firstUpdated(changedProperties);
12965
+
12966
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
12967
+ bubbles: true,
12968
+ composed: true,
12969
+ detail: {
12970
+ element: this
12971
+ }
12972
+ }));
12973
+ }
12974
+
12893
12975
  // function that renders the HTML and CSS into the scope of the component
12894
12976
  render() {
12895
12977
  return u$2`
@@ -170,9 +170,10 @@ let DateFormatter$1 = class DateFormatter {
170
170
  /**
171
171
  * Convert a date object to string format.
172
172
  * @param {Object} date - Date to convert to string.
173
- * @returns {Object} Returns the date as a string.
173
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
174
+ * @returns {String} Returns the date as a string.
174
175
  */
175
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
176
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
176
177
  year: "numeric",
177
178
  month: "2-digit",
178
179
  day: "2-digit",
@@ -364,7 +365,7 @@ let AuroDateUtilities$1 = class AuroDateUtilities extends AuroDateUtilitiesBase$
364
365
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
365
366
 
366
367
  // Get the date string of the date object we created from the string date
367
- const actualDateStr = dateFormatter$1.getDateAsString(dateObj);
368
+ const actualDateStr = dateFormatter$1.getDateAsString(dateObj, "en-US");
368
369
 
369
370
  // Guard Clause: Generated date matches date string input
370
371
  if (expectedDateStr !== actualDateStr) {
@@ -2490,8 +2491,28 @@ class AuroFloatingUI {
2490
2491
  if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
2491
2492
  AuroFloatingUI.isMousePressHandlerInitialized = true;
2492
2493
 
2494
+ // Track timeout for isMousePressed reset to avoid race conditions
2495
+ if (!AuroFloatingUI._mousePressedTimeout) {
2496
+ AuroFloatingUI._mousePressedTimeout = null;
2497
+ }
2493
2498
  const mouseEventGlobalHandler = (event) => {
2494
- AuroFloatingUI.isMousePressed = event.type === 'mousedown';
2499
+ const isPressed = event.type === 'mousedown';
2500
+ if (isPressed) {
2501
+ // Clear any pending timeout to prevent race condition
2502
+ if (AuroFloatingUI._mousePressedTimeout !== null) {
2503
+ clearTimeout(AuroFloatingUI._mousePressedTimeout);
2504
+ AuroFloatingUI._mousePressedTimeout = null;
2505
+ }
2506
+ if (!AuroFloatingUI.isMousePressed) {
2507
+ AuroFloatingUI.isMousePressed = true;
2508
+ }
2509
+ } else if (AuroFloatingUI.isMousePressed && !isPressed) {
2510
+ // Schedule reset and track timeout ID
2511
+ AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
2512
+ AuroFloatingUI.isMousePressed = false;
2513
+ AuroFloatingUI._mousePressedTimeout = null;
2514
+ }, 0);
2515
+ }
2495
2516
  };
2496
2517
 
2497
2518
  window.addEventListener('mousedown', mouseEventGlobalHandler);
@@ -2753,8 +2774,9 @@ class AuroFloatingUI {
2753
2774
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2754
2775
  return;
2755
2776
  }
2756
- // if fullscreen bib is still open and the focus is missing, do not close
2757
- if (this.element.bib.hasAttribute('isfullscreen') && activeElement === document.body) {
2777
+
2778
+ // if fullscreen bib is in fullscreen mode, do not close
2779
+ if (this.element.bib.hasAttribute('isfullscreen')) {
2758
2780
  return;
2759
2781
  }
2760
2782
 
@@ -3534,7 +3556,6 @@ var tokensCss$1$1 = css`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
3534
3556
  // See LICENSE in the project root for license information.
3535
3557
 
3536
3558
 
3537
-
3538
3559
  const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
3539
3560
  const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
3540
3561
  'xl',
@@ -3604,6 +3625,13 @@ class AuroDropdownBib extends LitElement {
3604
3625
  type: Boolean,
3605
3626
  reflect: true
3606
3627
  },
3628
+
3629
+ /**
3630
+ * A reference to the associated bib template element.
3631
+ */
3632
+ bibTemplate: {
3633
+ type: Object
3634
+ }
3607
3635
  };
3608
3636
  }
3609
3637
 
@@ -3636,9 +3664,50 @@ class AuroDropdownBib extends LitElement {
3636
3664
  }
3637
3665
  }
3638
3666
  });
3667
+
3668
+ if (this.bibTemplate) {
3669
+ // If the bib template is found, set the fullscreen attribute
3670
+ if (this.isFullscreen) {
3671
+ this.bibTemplate.setAttribute('isFullscreen', 'true');
3672
+ } else {
3673
+ this.bibTemplate.removeAttribute('isFullscreen');
3674
+ }
3675
+ }
3639
3676
  }
3640
3677
  }
3641
3678
 
3679
+ connectedCallback() {
3680
+ super.connectedCallback();
3681
+
3682
+ // Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
3683
+ this.addEventListener('auro-bibtemplate-connected', (event) => {
3684
+ const bibTemplate = event.detail.element;
3685
+ this.bibTemplate = bibTemplate;
3686
+
3687
+ if (bibTemplate) {
3688
+ // If the bib template is found, set the fullscreen attribute
3689
+ if (this.isFullscreen) {
3690
+ bibTemplate.setAttribute('isFullscreen', 'true');
3691
+ } else {
3692
+ bibTemplate.removeAttribute('isFullscreen');
3693
+ }
3694
+ }
3695
+ });
3696
+ }
3697
+
3698
+ firstUpdated(changedProperties) {
3699
+ super.firstUpdated(changedProperties);
3700
+
3701
+ // Dispatch a custom event when the component is connected
3702
+ this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
3703
+ bubbles: true,
3704
+ composed: true,
3705
+ detail: {
3706
+ element: this
3707
+ }
3708
+ }));
3709
+ }
3710
+
3642
3711
  // function that renders the HTML and CSS into the scope of the component
3643
3712
  render() {
3644
3713
  return html`
@@ -8712,9 +8781,10 @@ class DateFormatter {
8712
8781
  /**
8713
8782
  * Convert a date object to string format.
8714
8783
  * @param {Object} date - Date to convert to string.
8715
- * @returns {Object} Returns the date as a string.
8784
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
8785
+ * @returns {String} Returns the date as a string.
8716
8786
  */
8717
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
8787
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
8718
8788
  year: "numeric",
8719
8789
  month: "2-digit",
8720
8790
  day: "2-digit",
@@ -8906,7 +8976,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
8906
8976
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
8907
8977
 
8908
8978
  // Get the date string of the date object we created from the string date
8909
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
8979
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
8910
8980
 
8911
8981
  // Guard Clause: Generated date matches date string input
8912
8982
  if (expectedDateStr !== actualDateStr) {
@@ -12808,6 +12878,18 @@ class AuroBibtemplate extends LitElement {
12808
12878
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
12809
12879
  }
12810
12880
 
12881
+ firstUpdated(changedProperties) {
12882
+ super.firstUpdated(changedProperties);
12883
+
12884
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
12885
+ bubbles: true,
12886
+ composed: true,
12887
+ detail: {
12888
+ element: this
12889
+ }
12890
+ }));
12891
+ }
12892
+
12811
12893
  // function that renders the HTML and CSS into the scope of the component
12812
12894
  render() {
12813
12895
  return html`