@aurodesignsystem/auro-formkit 4.0.0 → 4.0.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +3 -23
  2. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +1 -0
  3. package/components/bibtemplate/dist/index.js +158 -6
  4. package/components/bibtemplate/dist/registered.js +158 -6
  5. package/components/checkbox/demo/api.min.js +4 -3
  6. package/components/checkbox/demo/index.min.js +4 -3
  7. package/components/checkbox/dist/index.js +4 -3
  8. package/components/checkbox/dist/registered.js +4 -3
  9. package/components/combobox/demo/api.min.js +707 -133
  10. package/components/combobox/demo/index.min.js +707 -133
  11. package/components/combobox/dist/auro-combobox.d.ts +0 -8
  12. package/components/combobox/dist/index.js +627 -123
  13. package/components/combobox/dist/registered.js +627 -123
  14. package/components/counter/demo/api.min.js +583 -43
  15. package/components/counter/demo/index.min.js +583 -43
  16. package/components/counter/dist/index.js +583 -43
  17. package/components/counter/dist/registered.js +583 -43
  18. package/components/datepicker/demo/api.min.js +866 -75
  19. package/components/datepicker/demo/index.min.js +866 -75
  20. package/components/datepicker/dist/index.js +866 -75
  21. package/components/datepicker/dist/registered.js +866 -75
  22. package/components/dropdown/demo/api.min.js +153 -16
  23. package/components/dropdown/demo/index.min.js +153 -16
  24. package/components/dropdown/dist/auro-dropdownBib.d.ts +8 -0
  25. package/components/dropdown/dist/index.js +153 -16
  26. package/components/dropdown/dist/registered.js +153 -16
  27. package/components/input/demo/api.min.js +263 -12
  28. package/components/input/demo/index.min.js +263 -12
  29. package/components/input/dist/index.js +263 -12
  30. package/components/input/dist/registered.js +263 -12
  31. package/components/menu/demo/api.min.js +76 -6
  32. package/components/menu/demo/index.min.js +76 -6
  33. package/components/menu/dist/index.js +76 -6
  34. package/components/menu/dist/registered.js +76 -6
  35. package/components/radio/demo/api.min.js +4 -3
  36. package/components/radio/demo/index.min.js +4 -3
  37. package/components/radio/dist/index.js +4 -3
  38. package/components/radio/dist/registered.js +4 -3
  39. package/components/select/demo/api.min.js +403 -49
  40. package/components/select/demo/index.min.js +403 -49
  41. package/components/select/dist/auro-select.d.ts +0 -1
  42. package/components/select/dist/index.js +325 -41
  43. package/components/select/dist/registered.js +325 -41
  44. package/package.json +3 -3
@@ -16,7 +16,7 @@ var tokensCss$1 = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-b
16
16
 
17
17
  /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
18
18
 
19
- class AuroLibraryRuntimeUtils {
19
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
20
20
 
21
21
  /* eslint-disable jsdoc/require-param */
22
22
 
@@ -77,7 +77,7 @@ class AuroLibraryRuntimeUtils {
77
77
 
78
78
  return elemTag === tag || elem.hasAttribute(tag);
79
79
  }
80
- }
80
+ };
81
81
 
82
82
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
83
83
  // See LICENSE in the project root for license information.
@@ -304,7 +304,7 @@ class AuroMenu extends LitElement {
304
304
  *
305
305
  */
306
306
  static register(name = "auro-menu") {
307
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
307
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
308
308
  }
309
309
 
310
310
  // Lifecycle Methods
@@ -328,7 +328,7 @@ class AuroMenu extends LitElement {
328
328
  }
329
329
 
330
330
  firstUpdated() {
331
- AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
331
+ AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-menu');
332
332
 
333
333
  this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
334
334
  this.initializeMenu();
@@ -1077,6 +1077,76 @@ var tokensCss = css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
1077
1077
 
1078
1078
  var colorCss = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
1079
1079
 
1080
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1081
+ // See LICENSE in the project root for license information.
1082
+
1083
+ // ---------------------------------------------------------------------
1084
+
1085
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1086
+
1087
+ class AuroLibraryRuntimeUtils {
1088
+
1089
+ /* eslint-disable jsdoc/require-param */
1090
+
1091
+ /**
1092
+ * This will register a new custom element with the browser.
1093
+ * @param {String} name - The name of the custom element.
1094
+ * @param {Object} componentClass - The class to register as a custom element.
1095
+ * @returns {void}
1096
+ */
1097
+ registerComponent(name, componentClass) {
1098
+ if (!customElements.get(name)) {
1099
+ customElements.define(name, class extends componentClass {});
1100
+ }
1101
+ }
1102
+
1103
+ /**
1104
+ * Finds and returns the closest HTML Element based on a selector.
1105
+ * @returns {void}
1106
+ */
1107
+ closestElement(
1108
+ selector, // selector like in .closest()
1109
+ base = this, // extra functionality to skip a parent
1110
+ __Closest = (el, found = el && el.closest(selector)) =>
1111
+ !el || el === document || el === window
1112
+ ? null // standard .closest() returns null for non-found selectors also
1113
+ : found
1114
+ ? found // found a selector INside this element
1115
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1116
+ ) {
1117
+ return __Closest(base);
1118
+ }
1119
+ /* eslint-enable jsdoc/require-param */
1120
+
1121
+ /**
1122
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
1123
+ * @param {Object} elem - The element to check.
1124
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1125
+ * @returns {void}
1126
+ */
1127
+ handleComponentTagRename(elem, tagName) {
1128
+ const tag = tagName.toLowerCase();
1129
+ const elemTag = elem.tagName.toLowerCase();
1130
+
1131
+ if (elemTag !== tag) {
1132
+ elem.setAttribute(tag, true);
1133
+ }
1134
+ }
1135
+
1136
+ /**
1137
+ * Validates if an element is a specific Auro component.
1138
+ * @param {Object} elem - The element to validate.
1139
+ * @param {String} tagName - The name of the Auro component to check against.
1140
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
1141
+ */
1142
+ elementMatch(elem, tagName) {
1143
+ const tag = tagName.toLowerCase();
1144
+ const elemTag = elem.tagName.toLowerCase();
1145
+
1146
+ return elemTag === tag || elem.hasAttribute(tag);
1147
+ }
1148
+ }
1149
+
1080
1150
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1081
1151
  // See LICENSE in the project root for license information.
1082
1152
 
@@ -1284,7 +1354,7 @@ class AuroMenuOption extends LitElement {
1284
1354
  /**
1285
1355
  * @private
1286
1356
  */
1287
- this.runtimeUtils = new AuroLibraryRuntimeUtils();
1357
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1288
1358
  }
1289
1359
 
1290
1360
  static get properties() {
@@ -1328,7 +1398,7 @@ class AuroMenuOption extends LitElement {
1328
1398
  *
1329
1399
  */
1330
1400
  static register(name = "auro-menuoption") {
1331
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1401
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenuOption);
1332
1402
  }
1333
1403
 
1334
1404
  firstUpdated() {
@@ -16,7 +16,7 @@ var tokensCss$1 = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-b
16
16
 
17
17
  /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
18
18
 
19
- class AuroLibraryRuntimeUtils {
19
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
20
20
 
21
21
  /* eslint-disable jsdoc/require-param */
22
22
 
@@ -77,7 +77,7 @@ class AuroLibraryRuntimeUtils {
77
77
 
78
78
  return elemTag === tag || elem.hasAttribute(tag);
79
79
  }
80
- }
80
+ };
81
81
 
82
82
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
83
83
  // See LICENSE in the project root for license information.
@@ -263,7 +263,7 @@ class AuroMenu extends LitElement {
263
263
  *
264
264
  */
265
265
  static register(name = "auro-menu") {
266
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
266
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
267
267
  }
268
268
 
269
269
  // Lifecycle Methods
@@ -287,7 +287,7 @@ class AuroMenu extends LitElement {
287
287
  }
288
288
 
289
289
  firstUpdated() {
290
- AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
290
+ AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-menu');
291
291
 
292
292
  this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
293
293
  this.initializeMenu();
@@ -1036,6 +1036,76 @@ var tokensCss = css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
1036
1036
 
1037
1037
  var colorCss = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
1038
1038
 
1039
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1040
+ // See LICENSE in the project root for license information.
1041
+
1042
+ // ---------------------------------------------------------------------
1043
+
1044
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1045
+
1046
+ class AuroLibraryRuntimeUtils {
1047
+
1048
+ /* eslint-disable jsdoc/require-param */
1049
+
1050
+ /**
1051
+ * This will register a new custom element with the browser.
1052
+ * @param {String} name - The name of the custom element.
1053
+ * @param {Object} componentClass - The class to register as a custom element.
1054
+ * @returns {void}
1055
+ */
1056
+ registerComponent(name, componentClass) {
1057
+ if (!customElements.get(name)) {
1058
+ customElements.define(name, class extends componentClass {});
1059
+ }
1060
+ }
1061
+
1062
+ /**
1063
+ * Finds and returns the closest HTML Element based on a selector.
1064
+ * @returns {void}
1065
+ */
1066
+ closestElement(
1067
+ selector, // selector like in .closest()
1068
+ base = this, // extra functionality to skip a parent
1069
+ __Closest = (el, found = el && el.closest(selector)) =>
1070
+ !el || el === document || el === window
1071
+ ? null // standard .closest() returns null for non-found selectors also
1072
+ : found
1073
+ ? found // found a selector INside this element
1074
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1075
+ ) {
1076
+ return __Closest(base);
1077
+ }
1078
+ /* eslint-enable jsdoc/require-param */
1079
+
1080
+ /**
1081
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
1082
+ * @param {Object} elem - The element to check.
1083
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1084
+ * @returns {void}
1085
+ */
1086
+ handleComponentTagRename(elem, tagName) {
1087
+ const tag = tagName.toLowerCase();
1088
+ const elemTag = elem.tagName.toLowerCase();
1089
+
1090
+ if (elemTag !== tag) {
1091
+ elem.setAttribute(tag, true);
1092
+ }
1093
+ }
1094
+
1095
+ /**
1096
+ * Validates if an element is a specific Auro component.
1097
+ * @param {Object} elem - The element to validate.
1098
+ * @param {String} tagName - The name of the Auro component to check against.
1099
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
1100
+ */
1101
+ elementMatch(elem, tagName) {
1102
+ const tag = tagName.toLowerCase();
1103
+ const elemTag = elem.tagName.toLowerCase();
1104
+
1105
+ return elemTag === tag || elem.hasAttribute(tag);
1106
+ }
1107
+ }
1108
+
1039
1109
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1040
1110
  // See LICENSE in the project root for license information.
1041
1111
 
@@ -1243,7 +1313,7 @@ class AuroMenuOption extends LitElement {
1243
1313
  /**
1244
1314
  * @private
1245
1315
  */
1246
- this.runtimeUtils = new AuroLibraryRuntimeUtils();
1316
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1247
1317
  }
1248
1318
 
1249
1319
  static get properties() {
@@ -1287,7 +1357,7 @@ class AuroMenuOption extends LitElement {
1287
1357
  *
1288
1358
  */
1289
1359
  static register(name = "auro-menuoption") {
1290
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1360
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenuOption);
1291
1361
  }
1292
1362
 
1293
1363
  firstUpdated() {
@@ -497,9 +497,10 @@ class DateFormatter {
497
497
  /**
498
498
  * Convert a date object to string format.
499
499
  * @param {Object} date - Date to convert to string.
500
- * @returns {Object} Returns the date as a string.
500
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
501
+ * @returns {String} Returns the date as a string.
501
502
  */
502
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
503
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
503
504
  year: "numeric",
504
505
  month: "2-digit",
505
506
  day: "2-digit",
@@ -691,7 +692,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
691
692
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
692
693
 
693
694
  // Get the date string of the date object we created from the string date
694
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
695
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
695
696
 
696
697
  // Guard Clause: Generated date matches date string input
697
698
  if (expectedDateStr !== actualDateStr) {
@@ -472,9 +472,10 @@ class DateFormatter {
472
472
  /**
473
473
  * Convert a date object to string format.
474
474
  * @param {Object} date - Date to convert to string.
475
- * @returns {Object} Returns the date as a string.
475
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
476
+ * @returns {String} Returns the date as a string.
476
477
  */
477
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
478
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
478
479
  year: "numeric",
479
480
  month: "2-digit",
480
481
  day: "2-digit",
@@ -666,7 +667,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
666
667
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
667
668
 
668
669
  // Get the date string of the date object we created from the string date
669
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
670
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
670
671
 
671
672
  // Guard Clause: Generated date matches date string input
672
673
  if (expectedDateStr !== actualDateStr) {
@@ -425,9 +425,10 @@ class DateFormatter {
425
425
  /**
426
426
  * Convert a date object to string format.
427
427
  * @param {Object} date - Date to convert to string.
428
- * @returns {Object} Returns the date as a string.
428
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
429
+ * @returns {String} Returns the date as a string.
429
430
  */
430
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
431
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
431
432
  year: "numeric",
432
433
  month: "2-digit",
433
434
  day: "2-digit",
@@ -619,7 +620,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
619
620
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
620
621
 
621
622
  // Get the date string of the date object we created from the string date
622
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
623
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
623
624
 
624
625
  // Guard Clause: Generated date matches date string input
625
626
  if (expectedDateStr !== actualDateStr) {
@@ -425,9 +425,10 @@ class DateFormatter {
425
425
  /**
426
426
  * Convert a date object to string format.
427
427
  * @param {Object} date - Date to convert to string.
428
- * @returns {Object} Returns the date as a string.
428
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
429
+ * @returns {String} Returns the date as a string.
429
430
  */
430
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
431
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
431
432
  year: "numeric",
432
433
  month: "2-digit",
433
434
  day: "2-digit",
@@ -619,7 +620,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
619
620
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
620
621
 
621
622
  // Get the date string of the date object we created from the string date
622
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
623
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
623
624
 
624
625
  // Guard Clause: Generated date matches date string input
625
626
  if (expectedDateStr !== actualDateStr) {