@aurodesignsystem-dev/auro-formkit 0.0.0-pr1505.0 → 0.0.0-pr1506.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 (55) 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 +120 -139
  7. package/components/combobox/demo/getting-started.min.js +120 -139
  8. package/components/combobox/demo/index.min.js +120 -139
  9. package/components/combobox/dist/auro-combobox.d.ts +9 -0
  10. package/components/combobox/dist/index.js +120 -139
  11. package/components/combobox/dist/registered.js +120 -139
  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/api.md +0 -2
  17. package/components/datepicker/demo/customize.md +33 -195
  18. package/components/datepicker/demo/customize.min.js +37 -43
  19. package/components/datepicker/demo/index.min.js +36 -35
  20. package/components/datepicker/dist/index.js +36 -35
  21. package/components/datepicker/dist/registered.js +36 -35
  22. package/components/datepicker/dist/src/auro-datepicker.d.ts +0 -2
  23. package/components/dropdown/demo/customize.min.js +1 -1
  24. package/components/dropdown/demo/getting-started.min.js +1 -1
  25. package/components/dropdown/demo/index.min.js +1 -1
  26. package/components/dropdown/dist/index.js +1 -1
  27. package/components/dropdown/dist/registered.js +1 -1
  28. package/components/form/demo/customize.min.js +325 -230
  29. package/components/form/demo/getting-started.min.js +325 -230
  30. package/components/form/demo/index.min.js +325 -230
  31. package/components/form/demo/registerDemoDeps.min.js +325 -230
  32. package/components/input/demo/customize.md +55 -56
  33. package/components/input/demo/customize.min.js +32 -26
  34. package/components/input/demo/getting-started.min.js +32 -26
  35. package/components/input/demo/index.md +2 -2
  36. package/components/input/demo/index.min.js +32 -26
  37. package/components/input/dist/index.js +32 -26
  38. package/components/input/dist/registered.js +32 -26
  39. package/components/radio/demo/customize.min.js +1 -1
  40. package/components/radio/demo/getting-started.min.js +1 -1
  41. package/components/radio/demo/index.min.js +1 -1
  42. package/components/radio/dist/index.js +1 -1
  43. package/components/radio/dist/registered.js +1 -1
  44. package/components/select/demo/api.md +1 -0
  45. package/components/select/demo/customize.md +71 -0
  46. package/components/select/demo/customize.min.js +133 -26
  47. package/components/select/demo/getting-started.min.js +133 -26
  48. package/components/select/demo/index.min.js +133 -26
  49. package/components/select/demo/keyboard-behavior.md +18 -0
  50. package/components/select/dist/auro-select.d.ts +38 -2
  51. package/components/select/dist/index.js +133 -26
  52. package/components/select/dist/registered.js +133 -26
  53. package/components/select/dist/selectUtils.d.ts +12 -0
  54. package/custom-elements.json +114 -10
  55. package/package.json +1 -1
@@ -232,19 +232,21 @@
232
232
  <auro-header level="3" id="localization">Localization</auro-header>
233
233
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customize/localization.md) -->
234
234
  <!-- The below content is automatically added from ./../docs/partials/customize/localization.md -->
235
- <p>The component supports complete localization, including visible strings, screen reader announcements, and locale-based date formatting.</p>
236
- <auro-header level="4" id="localizationVisibleStrings">Visible Strings</auro-header>
235
+ <p>The component supports complete localization, including visible strings, screen reader announcements and locale based date formatting.</p>
236
+ <auro-header level="4" id="localizationVisibleStrings">Visible strings</auro-header>
237
237
  <p>The visible strings rendered in the input are not derived from <code>locale</code> — they are projected through named slots so each language can supply its own translation. Pass a <code>&lt;span&gt;</code> with the matching <code>slot</code> attribute for every string you need to localize.</p>
238
238
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-visible-strings.html) -->
239
- <!-- The below content is automatically added from ./../apiExamples/localization-visible-strings.html -->
240
-
241
- <pre class="language-diff"><code class="language-diff"> &lt;auro-input&gt;
242
- + &lt;span slot="label"&gt;出発日&lt;/span&gt;
243
- + &lt;span slot="helpText"&gt;日付を選択してください&lt;/span&gt;
244
- + &lt;span slot="optionalLabel"&gt;(任意)&lt;/span&gt;
245
- &lt;/auro-input&gt;</code></pre>
239
+ <!-- The below content is automatically added from ./../apiExamples/localization-visible-strings.html -->
240
+ <auro-input locale="ja-JP">
241
+ <span slot="label">出発日</span>
242
+ <span slot="helpText">日付を選択してください</span>
243
+ <span slot="optionalLabel">(任意)</span>
244
+ <span slot="ariaLabel.clear">入力をクリア</span>
245
+ <span slot="ariaLabel.password.show">パスワードを表示</span>
246
+ <span slot="ariaLabel.password.hide">パスワードを非表示</span>
247
+ </auro-input>
246
248
  <!-- AURO-GENERATED-CONTENT:END -->
247
- <auro-header level="4" id="localizationA11yStrings">Screen Reader Strings</auro-header>
249
+ <auro-header level="4" id="localizationA11yStrings">Screen reader strings</auro-header>
248
250
  <p>Assistive-technology announcements that are not visible in the UI are also exposed as named slots so they can be translated independently. These strings are not derived from <code>locale</code>; supply translated values for every language you support.</p>
249
251
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-screenreader-strings.html) -->
250
252
  <!-- The below content is automatically added from ./../apiExamples/localization-screenreader-strings.html -->
@@ -259,7 +261,7 @@
259
261
  &lt;/auro-input&gt;</code></pre>
260
262
  <!-- AURO-GENERATED-CONTENT:END -->
261
263
  <p class="note"><strong>Note:</strong> Custom validation messages set via <code>setCustomValidity*</code> attributes are also not localized — supply translated strings yourself when using those properties.</p>
262
- <auro-header level="4" id="localizationDateFormatting">Date Formatting</auro-header>
264
+ <auro-header level="4" id="localizationDateFormatting">Date formatting</auro-header>
263
265
  <p>When <code>type="date"</code> is set, the <code>locale</code> attribute drives the date format used by the input mask. Setting <code>locale</code> automatically selects the regional format (for example <code>en-US</code> → <code>mm/dd/yyyy</code>, <code>de-DE</code> → <code>dd.mm.yyyy</code>, <code>ja-JP</code> → <code>yyyy/mm/dd</code>), derived from the browser's <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank">Intl</auro-hyperlink> API, so <code>format</code> does not need to be set manually.</p>
264
266
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-locale.html) -->
265
267
  <!-- The below content is automatically added from ./../apiExamples/localization-locale.html -->
@@ -296,43 +298,41 @@
296
298
  &lt;span slot="optionalLabel"&gt;(freiwillig)&lt;/span&gt;
297
299
  &lt;/auro-input&gt;</code></pre>
298
300
  <!-- AURO-GENERATED-CONTENT:END -->
299
- <p>The following live example shows several locale configurations in action:</p>
300
301
  <div class="exampleWrapper">
301
302
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/locale.html) -->
302
303
  <!-- The below content is automatically added from ./../apiExamples/locale.html -->
303
- <p class="body-sm"><strong>en-GB</strong></p>
304
+ <div data-locale="de-DE">
305
+ <auro-header level="4">en-GB Example</auro-header>
304
306
  <auro-input type="date" locale="en-GB">
305
307
  <span slot="ariaLabel.clear">Clear All</span>
306
308
  <span slot="label">en-GB Date</span>
307
309
  <span slot="helpText">Help Text</span>
308
310
  </auro-input>
309
- <p class="body-sm"><strong>en-US</strong></p>
311
+ <auro-header level="4">en-US Example</auro-header>
310
312
  <auro-input type="date" locale="en-US">
311
313
  <span slot="ariaLabel.clear">Clear All</span>
312
314
  <span slot="label">en-US Date</span>
313
315
  <span slot="helpText">Help Text</span>
314
316
  </auro-input>
315
- <p class="body-sm"><strong>zh-CN</strong></p>
317
+ <auro-header level="4">zh-CN Example</auro-header>
316
318
  <auro-input type="date" locale="zh-CN">
317
319
  <span slot="ariaLabel.clear">全部清除</span>
318
320
  <span slot="label">中文日期</span>
319
321
  <span slot="helpText">帮助文本</span>
320
322
  <span slot="optionalLabel">(可选)</span>
321
323
  </auro-input>
322
- <p class="body-sm"><strong>en-US with explicit <code>format="yyyy.mm.dd"</code></strong></p>
323
- <auro-input type="date" locale="en-US" format="yyyy.mm.dd">
324
- <span slot="ariaLabel.clear">Clear All</span>
325
- <span slot="label">en-US with yyyy.mm.dd format</span>
326
- <span slot="helpText">Help Text</span>
327
- </auro-input>
328
- <p class="body-sm"><strong>Inherited de-DE (via <code>data-locale</code>)</strong></p>
329
- <div data-locale="de-DE">
324
+ <auro-header level="4">Inherited de-DE date-locale Example</auro-header>
330
325
  <auro-input type="date">
331
326
  <span slot="ariaLabel.clear">Alles löschen</span>
332
- <span slot="label">Abreisedatum (geerbt aus `data-locale="de-DE"`)</span>
327
+ <span slot="label">Nächstes `data-locale`-Attributformat (`de-DE` in diesem Fall)</span>
333
328
  <span slot="helpText">Hilfetext</span>
334
329
  <span slot="optionalLabel">(freiwillig)</span>
335
- </auro-input>
330
+ </auro-input>
331
+ <auro-header level="4">en-US with `yyyy.mm.dd` format Example</auro-header>
332
+ <auro-input type="date" locale="en-US" format="yyyy.mm.dd">
333
+ <span slot="ariaLabel.clear">Clear All</span>
334
+ <span slot="label">en-US with yyyy.mm.dd format</span>
335
+ <span slot="helpText">Help Text</span>
336
336
  </div>
337
337
  <!-- AURO-GENERATED-CONTENT:END -->
338
338
  </div>
@@ -340,43 +340,42 @@
340
340
  <span slot="trigger">See code</span>
341
341
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/locale.html) -->
342
342
  <!-- The below code snippet is automatically added from ./../apiExamples/locale.html -->
343
- <pre class="language-html"><code class="language-html">&lt;p class="body-sm"&gt;&lt;strong&gt;en-GB&lt;/strong&gt;&lt;/p&gt;
344
- &lt;auro-input type="date" locale="en-GB"&gt;
345
- &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
346
- &lt;span slot="label"&gt;en-GB Date&lt;/span&gt;
347
- &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
348
- &lt;/auro-input&gt;
349
-
350
- &lt;p class="body-sm"&gt;&lt;strong&gt;en-US&lt;/strong&gt;&lt;/p&gt;
351
- &lt;auro-input type="date" locale="en-US"&gt;
352
- &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
353
- &lt;span slot="label"&gt;en-US Date&lt;/span&gt;
354
- &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
355
- &lt;/auro-input&gt;
343
+ <pre class="language-html"><code class="language-html">&lt;div data-locale="de-DE"&gt;
344
+ &lt;auro-header level="4"&gt;en-GB Example&lt;/auro-header&gt;
345
+ &lt;auro-input type="date" locale="en-GB"&gt;
346
+ &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
347
+ &lt;span slot="label"&gt;en-GB Date&lt;/span&gt;
348
+ &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
349
+ &lt;/auro-input&gt;
356
350
 
357
- &lt;p class="body-sm"&gt;&lt;strong&gt;zh-CN&lt;/strong&gt;&lt;/p&gt;
358
- &lt;auro-input type="date" locale="zh-CN"&gt;
359
- &lt;span slot="ariaLabel.clear"&gt;全部清除&lt;/span&gt;
360
- &lt;span slot="label"&gt;中文日期&lt;/span&gt;
361
- &lt;span slot="helpText"&gt;帮助文本&lt;/span&gt;
362
- &lt;span slot="optionalLabel"&gt;(可选)&lt;/span&gt;
363
- &lt;/auro-input&gt;
351
+ &lt;auro-header level="4"&gt;en-US Example&lt;/auro-header&gt;
352
+ &lt;auro-input type="date" locale="en-US"&gt;
353
+ &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
354
+ &lt;span slot="label"&gt;en-US Date&lt;/span&gt;
355
+ &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
356
+ &lt;/auro-input&gt;
364
357
 
365
- &lt;p class="body-sm"&gt;&lt;strong&gt;en-US with explicit &lt;code&gt;format="yyyy.mm.dd"&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
366
- &lt;auro-input type="date" locale="en-US" format="yyyy.mm.dd"&gt;
367
- &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
368
- &lt;span slot="label"&gt;en-US with yyyy.mm.dd format&lt;/span&gt;
369
- &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
370
- &lt;/auro-input&gt;
358
+ &lt;auro-header level="4"&gt;zh-CN Example&lt;/auro-header&gt;
359
+ &lt;auro-input type="date" locale="zh-CN"&gt;
360
+ &lt;span slot="ariaLabel.clear"&gt;全部清除&lt;/span&gt;
361
+ &lt;span slot="label"&gt;中文日期&lt;/span&gt;
362
+ &lt;span slot="helpText"&gt;帮助文本&lt;/span&gt;
363
+ &lt;span slot="optionalLabel"&gt;(可选)&lt;/span&gt;
364
+ &lt;/auro-input&gt;
371
365
 
372
- &lt;p class="body-sm"&gt;&lt;strong&gt;Inherited de-DE (via &lt;code&gt;data-locale&lt;/code&gt;)&lt;/strong&gt;&lt;/p&gt;
373
- &lt;div data-locale="de-DE"&gt;
366
+ &lt;auro-header level="4"&gt;Inherited de-DE date-locale Example&lt;/auro-header&gt;
374
367
  &lt;auro-input type="date"&gt;
375
368
  &lt;span slot="ariaLabel.clear"&gt;Alles löschen&lt;/span&gt;
376
- &lt;span slot="label"&gt;Abreisedatum (geerbt aus `data-locale="de-DE"`)&lt;/span&gt;
369
+ &lt;span slot="label"&gt;Nächstes `data-locale`-Attributformat (`de-DE` in diesem Fall)&lt;/span&gt;
377
370
  &lt;span slot="helpText"&gt;Hilfetext&lt;/span&gt;
378
371
  &lt;span slot="optionalLabel"&gt;(freiwillig)&lt;/span&gt;
379
372
  &lt;/auro-input&gt;
373
+
374
+ &lt;auro-header level="4"&gt;en-US with `yyyy.mm.dd` format Example&lt;/auro-header&gt;
375
+ &lt;auro-input type="date" locale="en-US" format="yyyy.mm.dd"&gt;
376
+ &lt;span slot="ariaLabel.clear"&gt;Clear All&lt;/span&gt;
377
+ &lt;span slot="label"&gt;en-US with yyyy.mm.dd format&lt;/span&gt;
378
+ &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
380
379
  &lt;/div&gt;</code></pre>
381
380
  <!-- AURO-GENERATED-CONTENT:END -->
382
381
  </auro-accordion>
@@ -1198,7 +1197,7 @@
1198
1197
  <div class="exampleWrapper">
1199
1198
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/month-day-year.html) -->
1200
1199
  <!-- The below content is automatically added from ../apiExamples/month-day-year.html -->
1201
- <auro-input type="date" locale="badsads">
1200
+ <auro-input type="date">
1202
1201
  <span slot="label">Arrival date</span>
1203
1202
  <span slot="helpText">Help Text</span>
1204
1203
  </auro-input>
@@ -1208,7 +1207,7 @@
1208
1207
  <span slot="trigger">See code</span>
1209
1208
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/month-day-year.html) -->
1210
1209
  <!-- The below code snippet is automatically added from ../apiExamples/month-day-year.html -->
1211
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" locale="badsads"&gt;
1210
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date"&gt;
1212
1211
  &lt;span slot="label"&gt;Arrival date&lt;/span&gt;
1213
1212
  &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
1214
1213
  &lt;/auro-input&gt;</code></pre>
@@ -10389,6 +10389,7 @@ 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
10392
10393
  return undefined;
10393
10394
  }
10394
10395
 
@@ -11199,10 +11200,6 @@ class BaseInput extends AuroElement {
11199
11200
  this.wrapperElement.addEventListener('click', this.handleClick);
11200
11201
  }
11201
11202
 
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
- }
11206
11203
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11207
11204
 
11208
11205
  // use validity message override if declared when initializing the component
@@ -11373,14 +11370,14 @@ class BaseInput extends AuroElement {
11373
11370
 
11374
11371
  if (formattedValue !== this.inputElement.value) {
11375
11372
  this.skipNextProgrammaticInputEvent = true;
11376
- if (this.maskInstance && this.type === 'credit-card') {
11373
+ if (this.maskInstance && this.type !== 'date') {
11377
11374
  // Route through the mask so its _value and el.value stay in lock-step
11378
11375
  // (set value calls updateControl which writes el.value = displayValue).
11379
11376
  // Writing el.value directly leaves the mask thinking displayValue is
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.
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.
11384
11381
  this.maskInstance.value = formattedValue || '';
11385
11382
  } else if (formattedValue) {
11386
11383
  this.inputElement.value = formattedValue;
@@ -11491,31 +11488,33 @@ class BaseInput extends AuroElement {
11491
11488
  * @returns {void}
11492
11489
  */
11493
11490
  configureAutoFormatting() {
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.
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.
11498
11495
  if (this._configuringMask) return;
11499
11496
  this._configuringMask = true;
11500
11497
  try {
11498
+ // Destroy any prior mask so IMask can attach fresh under the new format.
11501
11499
  if (this.maskInstance) {
11502
11500
  this.maskInstance.destroy();
11503
11501
  }
11504
11502
 
11505
- // Pass new format to util
11506
11503
  this.util.updateFormat(this.format);
11507
11504
 
11508
11505
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11509
11506
 
11510
11507
  if (this.inputElement && maskOptions.mask) {
11511
-
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.
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.
11518
11512
  let existingValue = this.inputElement.value;
11513
+
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.
11519
11518
  if (
11520
11519
  this.util.isFullDateFormat(this.type, this.format) &&
11521
11520
  this.value &&
@@ -11527,15 +11526,18 @@ class BaseInput extends AuroElement {
11527
11526
  existingValue = maskOptions.format(this.valueObject);
11528
11527
  }
11529
11528
 
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.
11530
11532
  this.skipNextProgrammaticInputEvent = true;
11531
11533
  this.inputElement.value = '';
11532
11534
 
11533
11535
  this.maskInstance = IMask(this.inputElement, maskOptions);
11534
11536
 
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.
11535
11540
  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.
11539
11541
  if (this._configuringMask) return;
11540
11542
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11541
11543
  if (this.type === "date") {
@@ -11543,6 +11545,8 @@ class BaseInput extends AuroElement {
11543
11545
  }
11544
11546
  });
11545
11547
 
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'.
11546
11550
  this.maskInstance.on('complete', () => {
11547
11551
  if (this._configuringMask) return;
11548
11552
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11551,7 +11555,9 @@ class BaseInput extends AuroElement {
11551
11555
  }
11552
11556
  });
11553
11557
 
11554
- // Restore the stashed value through IMask so it's properly masked
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.
11555
11561
  if (existingValue) {
11556
11562
  this.maskInstance.value = existingValue;
11557
11563
  }
@@ -12257,7 +12263,7 @@ class AuroHelpText extends i$3 {
12257
12263
  }
12258
12264
  }
12259
12265
 
12260
- var formkitVersion = '202606171946';
12266
+ var formkitVersion = '202606190840';
12261
12267
 
12262
12268
  /**
12263
12269
  * @license
@@ -10389,6 +10389,7 @@ 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
10392
10393
  return undefined;
10393
10394
  }
10394
10395
 
@@ -11199,10 +11200,6 @@ class BaseInput extends AuroElement {
11199
11200
  this.wrapperElement.addEventListener('click', this.handleClick);
11200
11201
  }
11201
11202
 
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
- }
11206
11203
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11207
11204
 
11208
11205
  // use validity message override if declared when initializing the component
@@ -11373,14 +11370,14 @@ class BaseInput extends AuroElement {
11373
11370
 
11374
11371
  if (formattedValue !== this.inputElement.value) {
11375
11372
  this.skipNextProgrammaticInputEvent = true;
11376
- if (this.maskInstance && this.type === 'credit-card') {
11373
+ if (this.maskInstance && this.type !== 'date') {
11377
11374
  // Route through the mask so its _value and el.value stay in lock-step
11378
11375
  // (set value calls updateControl which writes el.value = displayValue).
11379
11376
  // Writing el.value directly leaves the mask thinking displayValue is
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.
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.
11384
11381
  this.maskInstance.value = formattedValue || '';
11385
11382
  } else if (formattedValue) {
11386
11383
  this.inputElement.value = formattedValue;
@@ -11491,31 +11488,33 @@ class BaseInput extends AuroElement {
11491
11488
  * @returns {void}
11492
11489
  */
11493
11490
  configureAutoFormatting() {
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.
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.
11498
11495
  if (this._configuringMask) return;
11499
11496
  this._configuringMask = true;
11500
11497
  try {
11498
+ // Destroy any prior mask so IMask can attach fresh under the new format.
11501
11499
  if (this.maskInstance) {
11502
11500
  this.maskInstance.destroy();
11503
11501
  }
11504
11502
 
11505
- // Pass new format to util
11506
11503
  this.util.updateFormat(this.format);
11507
11504
 
11508
11505
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11509
11506
 
11510
11507
  if (this.inputElement && maskOptions.mask) {
11511
-
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.
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.
11518
11512
  let existingValue = this.inputElement.value;
11513
+
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.
11519
11518
  if (
11520
11519
  this.util.isFullDateFormat(this.type, this.format) &&
11521
11520
  this.value &&
@@ -11527,15 +11526,18 @@ class BaseInput extends AuroElement {
11527
11526
  existingValue = maskOptions.format(this.valueObject);
11528
11527
  }
11529
11528
 
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.
11530
11532
  this.skipNextProgrammaticInputEvent = true;
11531
11533
  this.inputElement.value = '';
11532
11534
 
11533
11535
  this.maskInstance = IMask(this.inputElement, maskOptions);
11534
11536
 
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.
11535
11540
  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.
11539
11541
  if (this._configuringMask) return;
11540
11542
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11541
11543
  if (this.type === "date") {
@@ -11543,6 +11545,8 @@ class BaseInput extends AuroElement {
11543
11545
  }
11544
11546
  });
11545
11547
 
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'.
11546
11550
  this.maskInstance.on('complete', () => {
11547
11551
  if (this._configuringMask) return;
11548
11552
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11551,7 +11555,9 @@ class BaseInput extends AuroElement {
11551
11555
  }
11552
11556
  });
11553
11557
 
11554
- // Restore the stashed value through IMask so it's properly masked
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.
11555
11561
  if (existingValue) {
11556
11562
  this.maskInstance.value = existingValue;
11557
11563
  }
@@ -12257,7 +12263,7 @@ class AuroHelpText extends i$3 {
12257
12263
  }
12258
12264
  }
12259
12265
 
12260
- var formkitVersion = '202606171946';
12266
+ var formkitVersion = '202606190840';
12261
12267
 
12262
12268
  /**
12263
12269
  * @license
@@ -151,7 +151,7 @@
151
151
  <!-- AURO-GENERATED-CONTENT:END -->
152
152
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/month-day-year.html) -->
153
153
  <!-- The below content is automatically added from ./../apiExamples/month-day-year.html -->
154
- <auro-input type="date" locale="badsads">
154
+ <auro-input type="date">
155
155
  <span slot="label">Arrival date</span>
156
156
  <span slot="helpText">Help Text</span>
157
157
  </auro-input>
@@ -175,7 +175,7 @@
175
175
  <!-- AURO-GENERATED-CONTENT:END -->
176
176
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/month-day-year.html) -->
177
177
  <!-- The below code snippet is automatically added from ./../apiExamples/month-day-year.html -->
178
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" locale="badsads"&gt;
178
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date"&gt;
179
179
  &lt;span slot="label"&gt;Arrival date&lt;/span&gt;
180
180
  &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
181
181
  &lt;/auro-input&gt;</code></pre>
@@ -10389,6 +10389,7 @@ 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
10392
10393
  return undefined;
10393
10394
  }
10394
10395
 
@@ -11199,10 +11200,6 @@ class BaseInput extends AuroElement {
11199
11200
  this.wrapperElement.addEventListener('click', this.handleClick);
11200
11201
  }
11201
11202
 
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
- }
11206
11203
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11207
11204
 
11208
11205
  // use validity message override if declared when initializing the component
@@ -11373,14 +11370,14 @@ class BaseInput extends AuroElement {
11373
11370
 
11374
11371
  if (formattedValue !== this.inputElement.value) {
11375
11372
  this.skipNextProgrammaticInputEvent = true;
11376
- if (this.maskInstance && this.type === 'credit-card') {
11373
+ if (this.maskInstance && this.type !== 'date') {
11377
11374
  // Route through the mask so its _value and el.value stay in lock-step
11378
11375
  // (set value calls updateControl which writes el.value = displayValue).
11379
11376
  // Writing el.value directly leaves the mask thinking displayValue is
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.
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.
11384
11381
  this.maskInstance.value = formattedValue || '';
11385
11382
  } else if (formattedValue) {
11386
11383
  this.inputElement.value = formattedValue;
@@ -11491,31 +11488,33 @@ class BaseInput extends AuroElement {
11491
11488
  * @returns {void}
11492
11489
  */
11493
11490
  configureAutoFormatting() {
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.
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.
11498
11495
  if (this._configuringMask) return;
11499
11496
  this._configuringMask = true;
11500
11497
  try {
11498
+ // Destroy any prior mask so IMask can attach fresh under the new format.
11501
11499
  if (this.maskInstance) {
11502
11500
  this.maskInstance.destroy();
11503
11501
  }
11504
11502
 
11505
- // Pass new format to util
11506
11503
  this.util.updateFormat(this.format);
11507
11504
 
11508
11505
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
11509
11506
 
11510
11507
  if (this.inputElement && maskOptions.mask) {
11511
-
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.
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.
11518
11512
  let existingValue = this.inputElement.value;
11513
+
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.
11519
11518
  if (
11520
11519
  this.util.isFullDateFormat(this.type, this.format) &&
11521
11520
  this.value &&
@@ -11527,15 +11526,18 @@ class BaseInput extends AuroElement {
11527
11526
  existingValue = maskOptions.format(this.valueObject);
11528
11527
  }
11529
11528
 
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.
11530
11532
  this.skipNextProgrammaticInputEvent = true;
11531
11533
  this.inputElement.value = '';
11532
11534
 
11533
11535
  this.maskInstance = IMask(this.inputElement, maskOptions);
11534
11536
 
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.
11535
11540
  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.
11539
11541
  if (this._configuringMask) return;
11540
11542
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11541
11543
  if (this.type === "date") {
@@ -11543,6 +11545,8 @@ class BaseInput extends AuroElement {
11543
11545
  }
11544
11546
  });
11545
11547
 
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'.
11546
11550
  this.maskInstance.on('complete', () => {
11547
11551
  if (this._configuringMask) return;
11548
11552
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -11551,7 +11555,9 @@ class BaseInput extends AuroElement {
11551
11555
  }
11552
11556
  });
11553
11557
 
11554
- // Restore the stashed value through IMask so it's properly masked
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.
11555
11561
  if (existingValue) {
11556
11562
  this.maskInstance.value = existingValue;
11557
11563
  }
@@ -12257,7 +12263,7 @@ class AuroHelpText extends i$3 {
12257
12263
  }
12258
12264
  }
12259
12265
 
12260
- var formkitVersion = '202606171946';
12266
+ var formkitVersion = '202606190840';
12261
12267
 
12262
12268
  /**
12263
12269
  * @license