@aurodesignsystem-dev/auro-formkit 0.0.0-pr1506.0 → 0.0.0-pr1507.0

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 (48) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +141 -122
  7. package/components/combobox/demo/getting-started.min.js +141 -122
  8. package/components/combobox/demo/index.min.js +141 -122
  9. package/components/combobox/dist/auro-combobox.d.ts +0 -9
  10. package/components/combobox/dist/index.js +139 -120
  11. package/components/combobox/dist/registered.js +139 -120
  12. package/components/counter/demo/customize.min.js +2 -2
  13. package/components/counter/demo/index.min.js +2 -2
  14. package/components/counter/dist/index.js +2 -2
  15. package/components/counter/dist/registered.js +2 -2
  16. package/components/datepicker/demo/customize.min.js +28 -35
  17. package/components/datepicker/demo/index.min.js +28 -35
  18. package/components/datepicker/dist/index.js +28 -35
  19. package/components/datepicker/dist/registered.js +28 -35
  20. package/components/dropdown/demo/customize.min.js +1 -1
  21. package/components/dropdown/demo/getting-started.min.js +1 -1
  22. package/components/dropdown/demo/index.min.js +1 -1
  23. package/components/dropdown/dist/index.js +1 -1
  24. package/components/dropdown/dist/registered.js +1 -1
  25. package/components/form/demo/customize.min.js +201 -195
  26. package/components/form/demo/getting-started.min.js +201 -195
  27. package/components/form/demo/index.min.js +201 -195
  28. package/components/form/demo/registerDemoDeps.min.js +201 -195
  29. package/components/input/demo/customize.min.js +26 -32
  30. package/components/input/demo/getting-started.min.js +26 -32
  31. package/components/input/demo/index.min.js +26 -32
  32. package/components/input/dist/index.js +26 -32
  33. package/components/input/dist/registered.js +26 -32
  34. package/components/menu/demo/index.min.js +2 -2
  35. package/components/menu/dist/index.js +2 -2
  36. package/components/menu/dist/registered.js +2 -2
  37. package/components/radio/demo/customize.min.js +1 -1
  38. package/components/radio/demo/getting-started.min.js +1 -1
  39. package/components/radio/demo/index.min.js +1 -1
  40. package/components/radio/dist/index.js +1 -1
  41. package/components/radio/dist/registered.js +1 -1
  42. package/components/select/demo/customize.min.js +4 -4
  43. package/components/select/demo/getting-started.min.js +4 -4
  44. package/components/select/demo/index.min.js +4 -4
  45. package/components/select/dist/index.js +2 -2
  46. package/components/select/dist/registered.js +2 -2
  47. package/custom-elements.json +0 -20
  48. package/package.json +1 -1
@@ -10389,7 +10389,6 @@ class AuroInputUtilities {
10389
10389
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10390
10390
 
10391
10391
  if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
10392
- console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
10393
10392
  return undefined;
10394
10393
  }
10395
10394
 
@@ -11200,6 +11199,10 @@ class BaseInput extends AuroElement {
11200
11199
  this.wrapperElement.addEventListener('click', this.handleClick);
11201
11200
  }
11202
11201
 
11202
+ // add attribute for query selectors when auro-input is registered under a custom name
11203
+ if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11204
+ this.setAttribute('auro-input', '');
11205
+ }
11203
11206
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11204
11207
 
11205
11208
  // use validity message override if declared when initializing the component
@@ -11370,14 +11373,14 @@ class BaseInput extends AuroElement {
11370
11373
 
11371
11374
  if (formattedValue !== this.inputElement.value) {
11372
11375
  this.skipNextProgrammaticInputEvent = true;
11373
- if (this.maskInstance && this.type !== 'date') {
11376
+ if (this.maskInstance && this.type === 'credit-card') {
11374
11377
  // Route through the mask so its _value and el.value stay in lock-step
11375
11378
  // (set value calls updateControl which writes el.value = displayValue).
11376
11379
  // Writing el.value directly leaves the mask thinking displayValue is
11377
- // stale; _saveSelection on the next focus/click then warns. Date is
11378
- // excluded because its formattedValue can be raw ISO when the calendar
11379
- // is invalid, and re-masking through mm/dd/yyyy would truncate it and
11380
- // flip validity from patternMismatch to tooShort.
11380
+ // stale; _saveSelection on the next focus/click then warns. Scoped to
11381
+ // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
11382
+ // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
11383
+ // and flip validity from patternMismatch to tooShort.
11381
11384
  this.maskInstance.value = formattedValue || '';
11382
11385
  } else if (formattedValue) {
11383
11386
  this.inputElement.value = formattedValue;
@@ -11488,33 +11491,31 @@ class BaseInput extends AuroElement {
11488
11491
  * @returns {void}
11489
11492
  */
11490
11493
  configureAutoFormatting() {
11491
- // _configuringMask gates two things: external re-entry into this method
11492
- // while setup is mid-flight (from property changes that call back here),
11493
- // and the accept/complete listeners below both need to ignore the mask
11494
- // events fired by our own value-restore step.
11494
+ // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
11495
+ // by _configuringMask above) could otherwise trigger handleInput
11496
+ // processCreditCard configureAutoFormatting before the outer call's
11497
+ // set value has finished its alignCursor pass.
11495
11498
  if (this._configuringMask) return;
11496
11499
  this._configuringMask = true;
11497
11500
  try {
11498
- // Destroy any prior mask so IMask can attach fresh under the new format.
11499
11501
  if (this.maskInstance) {
11500
11502
  this.maskInstance.destroy();
11501
11503
  }
11502
11504
 
11505
+ // Pass new format to util
11503
11506
  this.util.updateFormat(this.format);
11504
11507
 
11505
11508
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11506
11509
 
11507
11510
  if (this.inputElement && maskOptions.mask) {
11508
- // Capture the current display so it can be re-applied after IMask
11509
- // attaches. The restore at the bottom goes through maskInstance.value
11510
- // (not inputElement.value directly) so the mask's internal state and
11511
- // the input's displayed text stay in lock-step.
11512
- let existingValue = this.inputElement.value;
11513
11511
 
11514
- // Format-change case (e.g. locale switch): existingValue is the OLD
11515
- // mask's display string and may not parse under the new mask. When
11516
- // we have a valid date model, rebuild the display from valueObject
11517
- // (the canonical source) using the new mask's format function.
11512
+ // Stash and clear any existing value before IMask init.
11513
+ // IMask's constructor processes the current input value which requires
11514
+ // selection state clearing first avoids that scenario entirely.
11515
+ // When the format changes (e.g. locale switch) and we have a valid ISO
11516
+ // model value, compute the display string for the NEW format instead of
11517
+ // re-using the old display string, which may be invalid in the new mask.
11518
+ let existingValue = this.inputElement.value;
11518
11519
  if (
11519
11520
  this.util.isFullDateFormat(this.type, this.format) &&
11520
11521
  this.value &&
@@ -11526,18 +11527,15 @@ class BaseInput extends AuroElement {
11526
11527
  existingValue = maskOptions.format(this.valueObject);
11527
11528
  }
11528
11529
 
11529
- // Clear before IMask attaches so the constructor seeds an empty
11530
- // internal value. Otherwise IMask reads the stale unmasked string
11531
- // and emits a spurious 'accept' before the restore below runs.
11532
11530
  this.skipNextProgrammaticInputEvent = true;
11533
11531
  this.inputElement.value = '';
11534
11532
 
11535
11533
  this.maskInstance = IMask(this.inputElement, maskOptions);
11536
11534
 
11537
- // Mask fires 'accept' on every value change, including the restore
11538
- // step below. Skip events fired during configureAutoFormatting so
11539
- // we don't overwrite a value the parent just pushed.
11540
11535
  this.maskInstance.on('accept', () => {
11536
+ // Suppress propagation during configureAutoFormatting's own value-restoration
11537
+ // (line below) — the mask emits 'accept' on every value-set, including ours,
11538
+ // and we don't want to overwrite a value the parent just pushed.
11541
11539
  if (this._configuringMask) return;
11542
11540
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11543
11541
  if (this.type === "date") {
@@ -11545,8 +11543,6 @@ class BaseInput extends AuroElement {
11545
11543
  }
11546
11544
  });
11547
11545
 
11548
- // Mask fires 'complete' on the restore step below for any value that
11549
- // happens to be a complete match. Same setup-suppression as 'accept'.
11550
11546
  this.maskInstance.on('complete', () => {
11551
11547
  if (this._configuringMask) return;
11552
11548
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11555,9 +11551,7 @@ class BaseInput extends AuroElement {
11555
11551
  }
11556
11552
  });
11557
11553
 
11558
- // Write existingValue through the mask (not the input directly) so
11559
- // the mask reformats it under the new rules and keeps its internal
11560
- // _value aligned with the input's displayed text.
11554
+ // Restore the stashed value through IMask so it's properly masked
11561
11555
  if (existingValue) {
11562
11556
  this.maskInstance.value = existingValue;
11563
11557
  }
@@ -12263,7 +12257,7 @@ class AuroHelpText extends i$3 {
12263
12257
  }
12264
12258
  }
12265
12259
 
12266
- var formkitVersion = '202606190840';
12260
+ var formkitVersion = '202606192121';
12267
12261
 
12268
12262
  /**
12269
12263
  * @license
@@ -10389,7 +10389,6 @@ class AuroInputUtilities {
10389
10389
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10390
10390
 
10391
10391
  if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
10392
- console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
10393
10392
  return undefined;
10394
10393
  }
10395
10394
 
@@ -11200,6 +11199,10 @@ class BaseInput extends AuroElement {
11200
11199
  this.wrapperElement.addEventListener('click', this.handleClick);
11201
11200
  }
11202
11201
 
11202
+ // add attribute for query selectors when auro-input is registered under a custom name
11203
+ if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11204
+ this.setAttribute('auro-input', '');
11205
+ }
11203
11206
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11204
11207
 
11205
11208
  // use validity message override if declared when initializing the component
@@ -11370,14 +11373,14 @@ class BaseInput extends AuroElement {
11370
11373
 
11371
11374
  if (formattedValue !== this.inputElement.value) {
11372
11375
  this.skipNextProgrammaticInputEvent = true;
11373
- if (this.maskInstance && this.type !== 'date') {
11376
+ if (this.maskInstance && this.type === 'credit-card') {
11374
11377
  // Route through the mask so its _value and el.value stay in lock-step
11375
11378
  // (set value calls updateControl which writes el.value = displayValue).
11376
11379
  // Writing el.value directly leaves the mask thinking displayValue is
11377
- // stale; _saveSelection on the next focus/click then warns. Date is
11378
- // excluded because its formattedValue can be raw ISO when the calendar
11379
- // is invalid, and re-masking through mm/dd/yyyy would truncate it and
11380
- // flip validity from patternMismatch to tooShort.
11380
+ // stale; _saveSelection on the next focus/click then warns. Scoped to
11381
+ // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
11382
+ // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
11383
+ // and flip validity from patternMismatch to tooShort.
11381
11384
  this.maskInstance.value = formattedValue || '';
11382
11385
  } else if (formattedValue) {
11383
11386
  this.inputElement.value = formattedValue;
@@ -11488,33 +11491,31 @@ class BaseInput extends AuroElement {
11488
11491
  * @returns {void}
11489
11492
  */
11490
11493
  configureAutoFormatting() {
11491
- // _configuringMask gates two things: external re-entry into this method
11492
- // while setup is mid-flight (from property changes that call back here),
11493
- // and the accept/complete listeners below both need to ignore the mask
11494
- // events fired by our own value-restore step.
11494
+ // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
11495
+ // by _configuringMask above) could otherwise trigger handleInput
11496
+ // processCreditCard configureAutoFormatting before the outer call's
11497
+ // set value has finished its alignCursor pass.
11495
11498
  if (this._configuringMask) return;
11496
11499
  this._configuringMask = true;
11497
11500
  try {
11498
- // Destroy any prior mask so IMask can attach fresh under the new format.
11499
11501
  if (this.maskInstance) {
11500
11502
  this.maskInstance.destroy();
11501
11503
  }
11502
11504
 
11505
+ // Pass new format to util
11503
11506
  this.util.updateFormat(this.format);
11504
11507
 
11505
11508
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11506
11509
 
11507
11510
  if (this.inputElement && maskOptions.mask) {
11508
- // Capture the current display so it can be re-applied after IMask
11509
- // attaches. The restore at the bottom goes through maskInstance.value
11510
- // (not inputElement.value directly) so the mask's internal state and
11511
- // the input's displayed text stay in lock-step.
11512
- let existingValue = this.inputElement.value;
11513
11511
 
11514
- // Format-change case (e.g. locale switch): existingValue is the OLD
11515
- // mask's display string and may not parse under the new mask. When
11516
- // we have a valid date model, rebuild the display from valueObject
11517
- // (the canonical source) using the new mask's format function.
11512
+ // Stash and clear any existing value before IMask init.
11513
+ // IMask's constructor processes the current input value which requires
11514
+ // selection state clearing first avoids that scenario entirely.
11515
+ // When the format changes (e.g. locale switch) and we have a valid ISO
11516
+ // model value, compute the display string for the NEW format instead of
11517
+ // re-using the old display string, which may be invalid in the new mask.
11518
+ let existingValue = this.inputElement.value;
11518
11519
  if (
11519
11520
  this.util.isFullDateFormat(this.type, this.format) &&
11520
11521
  this.value &&
@@ -11526,18 +11527,15 @@ class BaseInput extends AuroElement {
11526
11527
  existingValue = maskOptions.format(this.valueObject);
11527
11528
  }
11528
11529
 
11529
- // Clear before IMask attaches so the constructor seeds an empty
11530
- // internal value. Otherwise IMask reads the stale unmasked string
11531
- // and emits a spurious 'accept' before the restore below runs.
11532
11530
  this.skipNextProgrammaticInputEvent = true;
11533
11531
  this.inputElement.value = '';
11534
11532
 
11535
11533
  this.maskInstance = IMask(this.inputElement, maskOptions);
11536
11534
 
11537
- // Mask fires 'accept' on every value change, including the restore
11538
- // step below. Skip events fired during configureAutoFormatting so
11539
- // we don't overwrite a value the parent just pushed.
11540
11535
  this.maskInstance.on('accept', () => {
11536
+ // Suppress propagation during configureAutoFormatting's own value-restoration
11537
+ // (line below) — the mask emits 'accept' on every value-set, including ours,
11538
+ // and we don't want to overwrite a value the parent just pushed.
11541
11539
  if (this._configuringMask) return;
11542
11540
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11543
11541
  if (this.type === "date") {
@@ -11545,8 +11543,6 @@ class BaseInput extends AuroElement {
11545
11543
  }
11546
11544
  });
11547
11545
 
11548
- // Mask fires 'complete' on the restore step below for any value that
11549
- // happens to be a complete match. Same setup-suppression as 'accept'.
11550
11546
  this.maskInstance.on('complete', () => {
11551
11547
  if (this._configuringMask) return;
11552
11548
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11555,9 +11551,7 @@ class BaseInput extends AuroElement {
11555
11551
  }
11556
11552
  });
11557
11553
 
11558
- // Write existingValue through the mask (not the input directly) so
11559
- // the mask reformats it under the new rules and keeps its internal
11560
- // _value aligned with the input's displayed text.
11554
+ // Restore the stashed value through IMask so it's properly masked
11561
11555
  if (existingValue) {
11562
11556
  this.maskInstance.value = existingValue;
11563
11557
  }
@@ -12263,7 +12257,7 @@ class AuroHelpText extends i$3 {
12263
12257
  }
12264
12258
  }
12265
12259
 
12266
- var formkitVersion = '202606190840';
12260
+ var formkitVersion = '202606192121';
12267
12261
 
12268
12262
  /**
12269
12263
  * @license
@@ -10389,7 +10389,6 @@ class AuroInputUtilities {
10389
10389
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10390
10390
 
10391
10391
  if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
10392
- console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
10393
10392
  return undefined;
10394
10393
  }
10395
10394
 
@@ -11200,6 +11199,10 @@ class BaseInput extends AuroElement {
11200
11199
  this.wrapperElement.addEventListener('click', this.handleClick);
11201
11200
  }
11202
11201
 
11202
+ // add attribute for query selectors when auro-input is registered under a custom name
11203
+ if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11204
+ this.setAttribute('auro-input', '');
11205
+ }
11203
11206
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11204
11207
 
11205
11208
  // use validity message override if declared when initializing the component
@@ -11370,14 +11373,14 @@ class BaseInput extends AuroElement {
11370
11373
 
11371
11374
  if (formattedValue !== this.inputElement.value) {
11372
11375
  this.skipNextProgrammaticInputEvent = true;
11373
- if (this.maskInstance && this.type !== 'date') {
11376
+ if (this.maskInstance && this.type === 'credit-card') {
11374
11377
  // Route through the mask so its _value and el.value stay in lock-step
11375
11378
  // (set value calls updateControl which writes el.value = displayValue).
11376
11379
  // Writing el.value directly leaves the mask thinking displayValue is
11377
- // stale; _saveSelection on the next focus/click then warns. Date is
11378
- // excluded because its formattedValue can be raw ISO when the calendar
11379
- // is invalid, and re-masking through mm/dd/yyyy would truncate it and
11380
- // flip validity from patternMismatch to tooShort.
11380
+ // stale; _saveSelection on the next focus/click then warns. Scoped to
11381
+ // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
11382
+ // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
11383
+ // and flip validity from patternMismatch to tooShort.
11381
11384
  this.maskInstance.value = formattedValue || '';
11382
11385
  } else if (formattedValue) {
11383
11386
  this.inputElement.value = formattedValue;
@@ -11488,33 +11491,31 @@ class BaseInput extends AuroElement {
11488
11491
  * @returns {void}
11489
11492
  */
11490
11493
  configureAutoFormatting() {
11491
- // _configuringMask gates two things: external re-entry into this method
11492
- // while setup is mid-flight (from property changes that call back here),
11493
- // and the accept/complete listeners below both need to ignore the mask
11494
- // events fired by our own value-restore step.
11494
+ // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
11495
+ // by _configuringMask above) could otherwise trigger handleInput
11496
+ // processCreditCard configureAutoFormatting before the outer call's
11497
+ // set value has finished its alignCursor pass.
11495
11498
  if (this._configuringMask) return;
11496
11499
  this._configuringMask = true;
11497
11500
  try {
11498
- // Destroy any prior mask so IMask can attach fresh under the new format.
11499
11501
  if (this.maskInstance) {
11500
11502
  this.maskInstance.destroy();
11501
11503
  }
11502
11504
 
11505
+ // Pass new format to util
11503
11506
  this.util.updateFormat(this.format);
11504
11507
 
11505
11508
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11506
11509
 
11507
11510
  if (this.inputElement && maskOptions.mask) {
11508
- // Capture the current display so it can be re-applied after IMask
11509
- // attaches. The restore at the bottom goes through maskInstance.value
11510
- // (not inputElement.value directly) so the mask's internal state and
11511
- // the input's displayed text stay in lock-step.
11512
- let existingValue = this.inputElement.value;
11513
11511
 
11514
- // Format-change case (e.g. locale switch): existingValue is the OLD
11515
- // mask's display string and may not parse under the new mask. When
11516
- // we have a valid date model, rebuild the display from valueObject
11517
- // (the canonical source) using the new mask's format function.
11512
+ // Stash and clear any existing value before IMask init.
11513
+ // IMask's constructor processes the current input value which requires
11514
+ // selection state clearing first avoids that scenario entirely.
11515
+ // When the format changes (e.g. locale switch) and we have a valid ISO
11516
+ // model value, compute the display string for the NEW format instead of
11517
+ // re-using the old display string, which may be invalid in the new mask.
11518
+ let existingValue = this.inputElement.value;
11518
11519
  if (
11519
11520
  this.util.isFullDateFormat(this.type, this.format) &&
11520
11521
  this.value &&
@@ -11526,18 +11527,15 @@ class BaseInput extends AuroElement {
11526
11527
  existingValue = maskOptions.format(this.valueObject);
11527
11528
  }
11528
11529
 
11529
- // Clear before IMask attaches so the constructor seeds an empty
11530
- // internal value. Otherwise IMask reads the stale unmasked string
11531
- // and emits a spurious 'accept' before the restore below runs.
11532
11530
  this.skipNextProgrammaticInputEvent = true;
11533
11531
  this.inputElement.value = '';
11534
11532
 
11535
11533
  this.maskInstance = IMask(this.inputElement, maskOptions);
11536
11534
 
11537
- // Mask fires 'accept' on every value change, including the restore
11538
- // step below. Skip events fired during configureAutoFormatting so
11539
- // we don't overwrite a value the parent just pushed.
11540
11535
  this.maskInstance.on('accept', () => {
11536
+ // Suppress propagation during configureAutoFormatting's own value-restoration
11537
+ // (line below) — the mask emits 'accept' on every value-set, including ours,
11538
+ // and we don't want to overwrite a value the parent just pushed.
11541
11539
  if (this._configuringMask) return;
11542
11540
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11543
11541
  if (this.type === "date") {
@@ -11545,8 +11543,6 @@ class BaseInput extends AuroElement {
11545
11543
  }
11546
11544
  });
11547
11545
 
11548
- // Mask fires 'complete' on the restore step below for any value that
11549
- // happens to be a complete match. Same setup-suppression as 'accept'.
11550
11546
  this.maskInstance.on('complete', () => {
11551
11547
  if (this._configuringMask) return;
11552
11548
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11555,9 +11551,7 @@ class BaseInput extends AuroElement {
11555
11551
  }
11556
11552
  });
11557
11553
 
11558
- // Write existingValue through the mask (not the input directly) so
11559
- // the mask reformats it under the new rules and keeps its internal
11560
- // _value aligned with the input's displayed text.
11554
+ // Restore the stashed value through IMask so it's properly masked
11561
11555
  if (existingValue) {
11562
11556
  this.maskInstance.value = existingValue;
11563
11557
  }
@@ -12263,7 +12257,7 @@ class AuroHelpText extends i$3 {
12263
12257
  }
12264
12258
  }
12265
12259
 
12266
- var formkitVersion = '202606190840';
12260
+ var formkitVersion = '202606192121';
12267
12261
 
12268
12262
  /**
12269
12263
  * @license
@@ -10331,7 +10331,6 @@ class AuroInputUtilities {
10331
10331
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10332
10332
 
10333
10333
  if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
10334
- console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
10335
10334
  return undefined;
10336
10335
  }
10337
10336
 
@@ -11142,6 +11141,10 @@ class BaseInput extends AuroElement {
11142
11141
  this.wrapperElement.addEventListener('click', this.handleClick);
11143
11142
  }
11144
11143
 
11144
+ // add attribute for query selectors when auro-input is registered under a custom name
11145
+ if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11146
+ this.setAttribute('auro-input', '');
11147
+ }
11145
11148
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11146
11149
 
11147
11150
  // use validity message override if declared when initializing the component
@@ -11312,14 +11315,14 @@ class BaseInput extends AuroElement {
11312
11315
 
11313
11316
  if (formattedValue !== this.inputElement.value) {
11314
11317
  this.skipNextProgrammaticInputEvent = true;
11315
- if (this.maskInstance && this.type !== 'date') {
11318
+ if (this.maskInstance && this.type === 'credit-card') {
11316
11319
  // Route through the mask so its _value and el.value stay in lock-step
11317
11320
  // (set value calls updateControl which writes el.value = displayValue).
11318
11321
  // Writing el.value directly leaves the mask thinking displayValue is
11319
- // stale; _saveSelection on the next focus/click then warns. Date is
11320
- // excluded because its formattedValue can be raw ISO when the calendar
11321
- // is invalid, and re-masking through mm/dd/yyyy would truncate it and
11322
- // flip validity from patternMismatch to tooShort.
11322
+ // stale; _saveSelection on the next focus/click then warns. Scoped to
11323
+ // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
11324
+ // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
11325
+ // and flip validity from patternMismatch to tooShort.
11323
11326
  this.maskInstance.value = formattedValue || '';
11324
11327
  } else if (formattedValue) {
11325
11328
  this.inputElement.value = formattedValue;
@@ -11430,33 +11433,31 @@ class BaseInput extends AuroElement {
11430
11433
  * @returns {void}
11431
11434
  */
11432
11435
  configureAutoFormatting() {
11433
- // _configuringMask gates two things: external re-entry into this method
11434
- // while setup is mid-flight (from property changes that call back here),
11435
- // and the accept/complete listeners below both need to ignore the mask
11436
- // events fired by our own value-restore step.
11436
+ // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
11437
+ // by _configuringMask above) could otherwise trigger handleInput
11438
+ // processCreditCard configureAutoFormatting before the outer call's
11439
+ // set value has finished its alignCursor pass.
11437
11440
  if (this._configuringMask) return;
11438
11441
  this._configuringMask = true;
11439
11442
  try {
11440
- // Destroy any prior mask so IMask can attach fresh under the new format.
11441
11443
  if (this.maskInstance) {
11442
11444
  this.maskInstance.destroy();
11443
11445
  }
11444
11446
 
11447
+ // Pass new format to util
11445
11448
  this.util.updateFormat(this.format);
11446
11449
 
11447
11450
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11448
11451
 
11449
11452
  if (this.inputElement && maskOptions.mask) {
11450
- // Capture the current display so it can be re-applied after IMask
11451
- // attaches. The restore at the bottom goes through maskInstance.value
11452
- // (not inputElement.value directly) so the mask's internal state and
11453
- // the input's displayed text stay in lock-step.
11454
- let existingValue = this.inputElement.value;
11455
11453
 
11456
- // Format-change case (e.g. locale switch): existingValue is the OLD
11457
- // mask's display string and may not parse under the new mask. When
11458
- // we have a valid date model, rebuild the display from valueObject
11459
- // (the canonical source) using the new mask's format function.
11454
+ // Stash and clear any existing value before IMask init.
11455
+ // IMask's constructor processes the current input value which requires
11456
+ // selection state clearing first avoids that scenario entirely.
11457
+ // When the format changes (e.g. locale switch) and we have a valid ISO
11458
+ // model value, compute the display string for the NEW format instead of
11459
+ // re-using the old display string, which may be invalid in the new mask.
11460
+ let existingValue = this.inputElement.value;
11460
11461
  if (
11461
11462
  this.util.isFullDateFormat(this.type, this.format) &&
11462
11463
  this.value &&
@@ -11468,18 +11469,15 @@ class BaseInput extends AuroElement {
11468
11469
  existingValue = maskOptions.format(this.valueObject);
11469
11470
  }
11470
11471
 
11471
- // Clear before IMask attaches so the constructor seeds an empty
11472
- // internal value. Otherwise IMask reads the stale unmasked string
11473
- // and emits a spurious 'accept' before the restore below runs.
11474
11472
  this.skipNextProgrammaticInputEvent = true;
11475
11473
  this.inputElement.value = '';
11476
11474
 
11477
11475
  this.maskInstance = IMask(this.inputElement, maskOptions);
11478
11476
 
11479
- // Mask fires 'accept' on every value change, including the restore
11480
- // step below. Skip events fired during configureAutoFormatting so
11481
- // we don't overwrite a value the parent just pushed.
11482
11477
  this.maskInstance.on('accept', () => {
11478
+ // Suppress propagation during configureAutoFormatting's own value-restoration
11479
+ // (line below) — the mask emits 'accept' on every value-set, including ours,
11480
+ // and we don't want to overwrite a value the parent just pushed.
11483
11481
  if (this._configuringMask) return;
11484
11482
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11485
11483
  if (this.type === "date") {
@@ -11487,8 +11485,6 @@ class BaseInput extends AuroElement {
11487
11485
  }
11488
11486
  });
11489
11487
 
11490
- // Mask fires 'complete' on the restore step below for any value that
11491
- // happens to be a complete match. Same setup-suppression as 'accept'.
11492
11488
  this.maskInstance.on('complete', () => {
11493
11489
  if (this._configuringMask) return;
11494
11490
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11497,9 +11493,7 @@ class BaseInput extends AuroElement {
11497
11493
  }
11498
11494
  });
11499
11495
 
11500
- // Write existingValue through the mask (not the input directly) so
11501
- // the mask reformats it under the new rules and keeps its internal
11502
- // _value aligned with the input's displayed text.
11496
+ // Restore the stashed value through IMask so it's properly masked
11503
11497
  if (existingValue) {
11504
11498
  this.maskInstance.value = existingValue;
11505
11499
  }
@@ -12205,7 +12199,7 @@ class AuroHelpText extends LitElement {
12205
12199
  }
12206
12200
  }
12207
12201
 
12208
- var formkitVersion = '202606190840';
12202
+ var formkitVersion = '202606192121';
12209
12203
 
12210
12204
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
12211
12205
  // See LICENSE in the project root for license information.