@aurodesignsystem-dev/auro-formkit 0.0.0-pr1498.0 → 0.0.0-pr1499.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 (62) hide show
  1. package/components/checkbox/demo/customize.min.js +2 -2
  2. package/components/checkbox/demo/getting-started.min.js +2 -2
  3. package/components/checkbox/demo/index.min.js +2 -2
  4. package/components/checkbox/dist/index.js +2 -2
  5. package/components/checkbox/dist/registered.js +2 -2
  6. package/components/combobox/demo/customize.md +3 -7
  7. package/components/combobox/demo/customize.min.js +1703 -1461
  8. package/components/combobox/demo/getting-started.min.js +1703 -1461
  9. package/components/combobox/demo/index.min.js +1703 -1461
  10. package/components/combobox/dist/auro-combobox.d.ts +0 -5
  11. package/components/combobox/dist/index.js +162 -495
  12. package/components/combobox/dist/registered.js +162 -495
  13. package/components/counter/demo/customize.min.js +19 -18
  14. package/components/counter/demo/index.min.js +19 -18
  15. package/components/counter/dist/index.js +160 -5811
  16. package/components/counter/dist/registered.js +187 -5442
  17. package/components/datepicker/demo/customize.md +477 -384
  18. package/components/datepicker/demo/customize.min.js +99 -171
  19. package/components/datepicker/demo/index.md +0 -1
  20. package/components/datepicker/demo/index.min.js +99 -171
  21. package/components/datepicker/dist/index.js +99 -171
  22. package/components/datepicker/dist/registered.js +99 -171
  23. package/components/datepicker/dist/src/auro-datepicker.d.ts +2 -2
  24. package/components/dropdown/demo/customize.min.js +17 -16
  25. package/components/dropdown/demo/getting-started.min.js +17 -16
  26. package/components/dropdown/demo/index.min.js +17 -16
  27. package/components/dropdown/dist/auro-dropdown.d.ts +2 -1
  28. package/components/dropdown/dist/index.js +17 -16
  29. package/components/dropdown/dist/registered.js +17 -16
  30. package/components/form/demo/customize.min.js +8494 -8428
  31. package/components/form/demo/getting-started.min.js +8494 -8428
  32. package/components/form/demo/index.min.js +8494 -8428
  33. package/components/form/demo/registerDemoDeps.min.js +8518 -8452
  34. package/components/input/demo/customize.md +539 -472
  35. package/components/input/demo/customize.min.js +61 -136
  36. package/components/input/demo/getting-started.min.js +61 -136
  37. package/components/input/demo/index.min.js +61 -136
  38. package/components/input/dist/base-input.d.ts +0 -16
  39. package/components/input/dist/index.js +61 -136
  40. package/components/input/dist/registered.js +61 -136
  41. package/components/menu/demo/api.md +45 -41
  42. package/components/menu/demo/customize.md +28 -0
  43. package/components/menu/demo/index.min.js +1358 -783
  44. package/components/menu/dist/auro-menu.context.d.ts +238 -0
  45. package/components/menu/dist/auro-menu.d.ts +110 -95
  46. package/components/menu/dist/auro-menuoption.d.ts +138 -32
  47. package/components/menu/dist/index.js +1312 -757
  48. package/components/menu/dist/registered.js +1312 -769
  49. package/components/radio/demo/customize.min.js +2 -2
  50. package/components/radio/demo/getting-started.min.js +2 -2
  51. package/components/radio/demo/index.min.js +2 -2
  52. package/components/radio/dist/index.js +2 -2
  53. package/components/radio/dist/registered.js +2 -2
  54. package/components/select/demo/customize.md +3 -7
  55. package/components/select/demo/customize.min.js +1634 -1089
  56. package/components/select/demo/getting-started.min.js +1634 -1089
  57. package/components/select/demo/index.min.js +1634 -1089
  58. package/components/select/dist/index.js +31 -61
  59. package/components/select/dist/registered.js +31 -61
  60. package/custom-elements.json +1024 -378
  61. package/package.json +1 -1
  62. package/components/select/dist/selectUtils.d.ts +0 -12
@@ -4490,7 +4490,7 @@ class AuroFormValidation {
4490
4490
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
4491
4491
  const input = elem.renderRoot.querySelector('input');
4492
4492
 
4493
- if (input && input.validationMessage.length > 0) {
4493
+ if (input.validationMessage.length > 0) {
4494
4494
  elem.errorMessage = input.validationMessage;
4495
4495
  }
4496
4496
  } else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
@@ -10162,7 +10162,11 @@ class AuroInputUtilities {
10162
10162
  return part.value;
10163
10163
  }
10164
10164
  })
10165
- .join("");
10165
+ .join("")
10166
+ // Remove whitespace and leading/trailing special characters for IMask compatibility
10167
+ // for example, ko-KR's format is `YYYY. MM. DD.` which causes issues with IMask if we don't remove the trailing period.
10168
+ .replace(/\s/gu, '')
10169
+ .replace(/^[^A-Z0-9]+|[^A-Z0-9]+$/gu, '');
10166
10170
  }
10167
10171
 
10168
10172
  /**
@@ -10327,6 +10331,7 @@ class AuroInputUtilities {
10327
10331
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10328
10332
 
10329
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
10330
10335
  return undefined;
10331
10336
  }
10332
10337
 
@@ -11029,7 +11034,7 @@ class BaseInput extends AuroElement {
11029
11034
  * @returns {Date|undefined}
11030
11035
  */
11031
11036
  get valueObject() {
11032
- return this._valueObject || this._computeDateObjectFallback(this.value);
11037
+ return this._valueObject;
11033
11038
  }
11034
11039
 
11035
11040
  /**
@@ -11037,7 +11042,7 @@ class BaseInput extends AuroElement {
11037
11042
  * @returns {Date|undefined}
11038
11043
  */
11039
11044
  get minObject() {
11040
- return this._minObject || this._computeDateObjectFallback(this.min);
11045
+ return this._minObject;
11041
11046
  }
11042
11047
 
11043
11048
  /**
@@ -11045,31 +11050,7 @@ class BaseInput extends AuroElement {
11045
11050
  * @returns {Date|undefined}
11046
11051
  */
11047
11052
  get maxObject() {
11048
- return this._maxObject || this._computeDateObjectFallback(this.max);
11049
- }
11050
-
11051
- /**
11052
- * Parses a date string into a Date object when the corresponding `_*Object`
11053
- * field hasn't been synced yet by `updated()`. Returns undefined when the
11054
- * input type/format isn't a full date or the string is not a valid date.
11055
- *
11056
- * Why this exists: a parent (datepicker) can call `inputN.validate()` from
11057
- * inside its own `updated()` before this input's `updated()` has run
11058
- * `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
11059
- * and range checks would otherwise silently no-op (flipping the result to
11060
- * `valid` or `patternMismatch`).
11061
- * @private
11062
- * @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
11063
- * @returns {Date|undefined}
11064
- */
11065
- _computeDateObjectFallback(dateStr) {
11066
- if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
11067
- return undefined;
11068
- }
11069
- if (!dateFormatter.isValidDate(dateStr)) {
11070
- return undefined;
11071
- }
11072
- return dateFormatter.stringToDateInstance(dateStr);
11053
+ return this._maxObject;
11073
11054
  }
11074
11055
 
11075
11056
  /**
@@ -11094,30 +11075,8 @@ class BaseInput extends AuroElement {
11094
11075
  connectedCallback() {
11095
11076
  super.connectedCallback();
11096
11077
 
11097
- // Mark for query selectors when registered under a versioned tag (e.g. inside
11098
- // a datepicker/combobox). Must run before parent components call validate() on
11099
- // their inner inputs — the validation framework matches via tag-or-attribute,
11100
- // and parents trigger validation during their own updated() cycle, which can
11101
- // precede this input's firstUpdated().
11102
- if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11103
- this.setAttribute('auro-input', '');
11104
- }
11105
-
11106
11078
  this.locale = this.domHandler.getLocale(this);
11107
11079
  notifyOnLangChange(this);
11108
-
11109
- // Pre-compute lengthForType and date-object fields so a parent (e.g. datepicker)
11110
- // calling our validate() synchronously during its own updated() cycle sees
11111
- // populated values. Without this, range validation silently no-ops because
11112
- // `max.length === lengthForType` fails when lengthForType is still undefined.
11113
- // Rebuild util here (constructor seeded with en-US default) so configureDataForType's
11114
- // locale-derived format lookup uses the actual locale just resolved above.
11115
- this.util = new AuroInputUtilities({
11116
- locale: this.locale,
11117
- format: this.format
11118
- });
11119
- this.configureDataForType();
11120
- this.syncDateValues();
11121
11080
  }
11122
11081
 
11123
11082
  disconnectedCallback() {
@@ -11138,8 +11097,8 @@ class BaseInput extends AuroElement {
11138
11097
  }
11139
11098
 
11140
11099
  // add attribute for query selectors when auro-input is registered under a custom name
11141
- if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
11142
- this.setAttribute('auro-input', '');
11100
+ if (this.tagName.toLowerCase() !== 'auro-input') {
11101
+ this.setAttribute('auro-input', true);
11143
11102
  }
11144
11103
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11145
11104
 
@@ -11187,12 +11146,6 @@ class BaseInput extends AuroElement {
11187
11146
  return;
11188
11147
  }
11189
11148
 
11190
- // While configureAutoFormatting is running, imask's internal updateControl
11191
- // writes el.value to align display with the masked value. A synthetic input
11192
- // event from that write would re-enter handleInput → processCreditCard mid-setup
11193
- // and clobber a Lit value that was just pushed by the parent combobox.
11194
- if (component._configuringMask) return;
11195
-
11196
11149
  // If all guard clauses are passed, dispatch the event
11197
11150
  const inputEvent = new InputEvent('input', {
11198
11151
  bubbles: true,
@@ -11311,16 +11264,7 @@ class BaseInput extends AuroElement {
11311
11264
 
11312
11265
  if (formattedValue !== this.inputElement.value) {
11313
11266
  this.skipNextProgrammaticInputEvent = true;
11314
- if (this.maskInstance && this.type === 'credit-card') {
11315
- // Route through the mask so its _value and el.value stay in lock-step
11316
- // (set value calls updateControl which writes el.value = displayValue).
11317
- // Writing el.value directly leaves the mask thinking displayValue is
11318
- // stale; _saveSelection on the next focus/click then warns. Scoped to
11319
- // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
11320
- // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
11321
- // and flip validity from patternMismatch to tooShort.
11322
- this.maskInstance.value = formattedValue || '';
11323
- } else if (formattedValue) {
11267
+ if (formattedValue) {
11324
11268
  this.inputElement.value = formattedValue;
11325
11269
  } else {
11326
11270
  this.inputElement.value = '';
@@ -11429,73 +11373,58 @@ class BaseInput extends AuroElement {
11429
11373
  * @returns {void}
11430
11374
  */
11431
11375
  configureAutoFormatting() {
11432
- // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
11433
- // by _configuringMask above) could otherwise trigger handleInput →
11434
- // processCreditCard → configureAutoFormatting before the outer call's
11435
- // set value has finished its alignCursor pass.
11436
- if (this._configuringMask) return;
11437
- this._configuringMask = true;
11438
- try {
11439
- if (this.maskInstance) {
11440
- this.maskInstance.destroy();
11441
- }
11376
+ if (this.maskInstance) {
11377
+ this.maskInstance.destroy();
11378
+ }
11442
11379
 
11443
- // Pass new format to util
11444
- this.util.updateFormat(this.format);
11380
+ // Pass new format to util
11381
+ this.util.updateFormat(this.format);
11445
11382
 
11446
- const maskOptions = this.util.getMaskOptions(this.type, this.format);
11447
-
11448
- if (this.inputElement && maskOptions.mask) {
11449
-
11450
- // Stash and clear any existing value before IMask init.
11451
- // IMask's constructor processes the current input value which requires
11452
- // selection state — clearing first avoids that scenario entirely.
11453
- // When the format changes (e.g. locale switch) and we have a valid ISO
11454
- // model value, compute the display string for the NEW format instead of
11455
- // re-using the old display string, which may be invalid in the new mask.
11456
- let existingValue = this.inputElement.value;
11457
- if (
11458
- this.util.isFullDateFormat(this.type, this.format) &&
11459
- this.value &&
11460
- dateFormatter.isValidDate(this.value) &&
11461
- this.valueObject instanceof Date &&
11462
- !Number.isNaN(this.valueObject.getTime()) &&
11463
- typeof maskOptions.format === 'function'
11464
- ) {
11465
- existingValue = maskOptions.format(this.valueObject);
11466
- }
11383
+ const maskOptions = this.util.getMaskOptions(this.type, this.format);
11467
11384
 
11468
- this.skipNextProgrammaticInputEvent = true;
11469
- this.inputElement.value = '';
11470
-
11471
- this.maskInstance = IMask(this.inputElement, maskOptions);
11472
-
11473
- this.maskInstance.on('accept', () => {
11474
- // Suppress propagation during configureAutoFormatting's own value-restoration
11475
- // (line below) — the mask emits 'accept' on every value-set, including ours,
11476
- // and we don't want to overwrite a value the parent just pushed.
11477
- if (this._configuringMask) return;
11478
- this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11479
- if (this.type === "date") {
11480
- this._rawMaskValue = this.maskInstance.value;
11481
- }
11482
- });
11385
+ if (this.inputElement && maskOptions.mask) {
11483
11386
 
11484
- this.maskInstance.on('complete', () => {
11485
- if (this._configuringMask) return;
11486
- this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11487
- if (this.type === "date") {
11488
- this._rawMaskValue = this.maskInstance.value;
11489
- }
11490
- });
11387
+ // Stash and clear any existing value before IMask init.
11388
+ // IMask's constructor processes the current input value which requires
11389
+ // selection state — clearing first avoids that scenario entirely.
11390
+ // When the format changes (e.g. locale switch) and we have a valid ISO
11391
+ // model value, compute the display string for the NEW format instead of
11392
+ // re-using the old display string, which may be invalid in the new mask.
11393
+ let existingValue = this.inputElement.value;
11394
+ if (
11395
+ this.util.isFullDateFormat(this.type, this.format) &&
11396
+ this.value &&
11397
+ dateFormatter.isValidDate(this.value) &&
11398
+ this.valueObject instanceof Date &&
11399
+ !Number.isNaN(this.valueObject.getTime()) &&
11400
+ typeof maskOptions.format === 'function'
11401
+ ) {
11402
+ existingValue = maskOptions.format(this.valueObject);
11403
+ }
11404
+
11405
+ this.skipNextProgrammaticInputEvent = true;
11406
+ this.inputElement.value = '';
11407
+
11408
+ this.maskInstance = IMask(this.inputElement, maskOptions);
11409
+
11410
+ this.maskInstance.on('accept', () => {
11411
+ this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11412
+ if (this.type === "date") {
11413
+ this._rawMaskValue = this.maskInstance.value;
11414
+ }
11415
+ });
11491
11416
 
11492
- // Restore the stashed value through IMask so it's properly masked
11493
- if (existingValue) {
11494
- this.maskInstance.value = existingValue;
11417
+ this.maskInstance.on('complete', () => {
11418
+ this.value = this.util.toModelValue(this.maskInstance.value, this.format);
11419
+ if (this.type === "date") {
11420
+ this._rawMaskValue = this.maskInstance.value;
11495
11421
  }
11422
+ });
11423
+
11424
+ // Restore the stashed value through IMask so it's properly masked
11425
+ if (existingValue) {
11426
+ this.maskInstance.value = existingValue;
11496
11427
  }
11497
- } finally {
11498
- this._configuringMask = false;
11499
11428
  }
11500
11429
  }
11501
11430
 
@@ -11782,10 +11711,10 @@ class BaseInput extends AuroElement {
11782
11711
  },
11783
11712
  {
11784
11713
  name: 'Diners club',
11785
- regex: /^(?<num>30[0-5]|36|38)\d{0}/u,
11714
+ regex: /^(?<num>36|38)\d{0}/u,
11786
11715
  formatLength: 16,
11787
11716
  errorMessage: CreditCardValidationMessage,
11788
- cardIcon: 'cc-dinersclub',
11717
+ cardIcon: 'credit-card',
11789
11718
  maskFormat: "0000 000000 0000"
11790
11719
  },
11791
11720
  {
@@ -12195,7 +12124,7 @@ class AuroHelpText extends LitElement {
12195
12124
  }
12196
12125
  }
12197
12126
 
12198
- var formkitVersion = '202606100232';
12127
+ var formkitVersion = '202606101934';
12199
12128
 
12200
12129
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
12201
12130
  // See LICENSE in the project root for license information.
@@ -12533,10 +12462,6 @@ class AuroInput extends BaseInput {
12533
12462
  return i18n(this.lang, this.type);
12534
12463
  }
12535
12464
 
12536
- if (this.type === 'date') {
12537
- return i18n(this.lang, this.dateFormatMap[this.format] || 'dateMMDDYYYY');
12538
- }
12539
-
12540
12465
  return '';
12541
12466
  }
12542
12467
 
@@ -7,32 +7,32 @@ The `auro-menu` element provides users a way to select from a list of options.
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Modifiers | Type | Default | Description |
11
- |-------------------------|------------------|-----------|-----------------------|-------------|--------------------------------------------------|
12
- | `currentLabel` | | readonly | `string` | | |
13
- | `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
14
- | `hasLoadingPlaceholder` | | readonly | `boolean` | | Getter for loading placeholder state. |
15
- | `index` | | | `number` | | |
16
- | `layout` | | | `string` | | |
17
- | `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
18
- | `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
19
- | `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
20
- | `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
21
- | `optionActive` | `optionactive` | | `object` | "undefined" | Specifies the current active menuOption. |
22
- | `optionSelected` | `optionSelected` | | `object` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
23
- | `options` | | readonly | `HTMLElement[]` | | |
24
- | `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
25
- | `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options as an array. |
26
- | `value` | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values. |
10
+ | Property | Attribute | Modifiers | Type | Default | Description |
11
+ |----------------------------|----------------------------|-----------|-----------------------|-------------|--------------------------------------------------|
12
+ | `allowDeselect` | `allowDeselect` | | `boolean` | false | Allows deselecting an already selected option when clicked again in single-select mode. |
13
+ | `currentLabel` | | readonly | `string` | | |
14
+ | `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
15
+ | `hasLoadingPlaceholder` | `hasLoadingPlaceholder` | | `boolean` | | Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state. |
16
+ | `index` | | | `number` | | |
17
+ | `items` | | readonly | `HTMLElement[]` | | |
18
+ | `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
19
+ | `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
20
+ | `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
21
+ | `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
22
+ | `optionActive` | `optionactive` | | `object` | "undefined" | Specifies the current active menuOption. |
23
+ | `optionSelected` | `optionSelected` | | `object` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
24
+ | `options` | | readonly | `array` | | Available menu options. |
25
+ | `selectAllMatchingOptions` | `selectAllMatchingOptions` | | `boolean` | false | When true, selects all options that match the provided value/key when setting value and multiselect is enabled. |
26
+ | `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
27
+ | `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options. |
28
+ | `value` | `value` | | `string` | | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values. |
27
29
 
28
30
  ## Methods
29
31
 
30
- | Method | Type | Description |
31
- |----------------------|--------------------------------------------------|--------------------------------------------------|
32
- | `navigateOptions` | `(direction: string): void` | Navigates through options using keyboard.<br /><br />**direction**: 'up' or 'down'. |
33
- | `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
34
- | `selectByValue` | `(value: string \| string[] \| null \| undefined): void` | Selects options by value.<br /><br />**value**: The value(s) to select. |
35
- | `updateActiveOption` | `(indexOrOption: number \| HTMLElement): void` | Updates the active option state and dispatches events.<br />Accepts either a numeric index or an HTMLElement option.<br /><br />**indexOrOption**: Index of the option or the option element to make active. |
32
+ | Method | Type | Description |
33
+ |----------------------|-------------------------------|--------------------------------------------------|
34
+ | `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
35
+ | `updateActiveOption` | `(option: HTMLElement): void` | Updates the currently active option in the menu.<br /><br />**option**: The option to set as active. |
36
36
 
37
37
  ## Events
38
38
 
@@ -40,8 +40,9 @@ The `auro-menu` element provides users a way to select from a list of options.
40
40
  |-------------------------------|--------------------------------------------------|--------------------------------------------------|
41
41
  | `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
42
42
  | `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
43
+ | `auroMenu-deselectPrevented` | `CustomEvent<{ values: HTMLElement[] }>` | Notifies that deselection was prevented and includes the affected options in `detail.values`. |
43
44
  | `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
44
- | `auroMenu-optionsChange` | `CustomEvent<{ options: Element[] \| undefined; }>` | |
45
+ | `auroMenu-optionsChange` | `CustomEvent<{ options: any; }>` | |
45
46
  | `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
46
47
  | `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
47
48
  | `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
@@ -60,31 +61,34 @@ The `auro-menuoption` element provides users a way to define a menu option.
60
61
 
61
62
  ## Properties
62
63
 
63
- | Property | Attribute | Modifiers | Type | Default | Description |
64
- |---------------|---------------|-----------|-----------|---------|--------------------------------------------------|
65
- | `disabled` | `disabled` | | `boolean` | false | |
66
- | `iconTag` | | | | | |
67
- | `isActive` | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable. |
68
- | `layout` | | | `string` | | |
69
- | `noCheckmark` | `noCheckmark` | | `boolean` | false | |
70
- | `noMatch` | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox<br />when the user's input does not match any available options. |
71
- | `selected` | `selected` | | `boolean` | false | |
72
- | `value` | `value` | | `string` | | |
64
+ | Property | Attribute | Modifiers | Type | Default | Description |
65
+ |---------------|------------|-----------|-----------|---------|--------------------------------------------------|
66
+ | `disabled` | `disabled` | | `boolean` | false | When true, disables the menu option. |
67
+ | `iconTag` | | | | | |
68
+ | `isActive` | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable.<br />An option is considered active if it is not hidden, not disabled, and not static. |
69
+ | `key` | `key` | | `string` | | Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used. |
70
+ | `noMatch` | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox when the user's input does not match any available options. Enables distinct styling and prevents the option from being treated as a selectable match. |
71
+ | `selected` | `selected` | | `boolean` | false | Specifies that an option is selected. |
72
+ | `tabIndex` | `tabIndex` | | `number` | | Specifies the tab index of the menu option. |
73
+ | `unsubscribe` | | | `number` | null | |
74
+ | `value` | `value` | | `string` | | Specifies the value to be sent to a server. |
73
75
 
74
76
  ## Methods
75
77
 
76
- | Method | Type |
77
- |--------------------|-----------------------|
78
- | `attachTo` | `(): void` |
79
- | `handleMenuChange` | `(): void` |
80
- | `setSelected` | `(value: any): void` |
81
- | `updateActive` | `(active: any): void` |
78
+ | Method | Type | Description |
79
+ |-----------------------|-------------------------------|--------------------------------------------------|
80
+ | `attachTo` | `(service: Object): void` | Attaches this menu option to a menu service and subscribes to its events.<br />This method enables the option to participate in menu selection and highlighting logic.<br /><br />**service**: The menu service instance to attach to. |
81
+ | `bindEvents` | `(): void` | Sets up event listeners for user interaction with the menu option.<br />This function enables click and mouse enter events to trigger selection and highlighting logic. |
82
+ | `handleMenuChange` | `(event: Object): void` | Handles changes from the menu service and updates the option's state.<br />This function synchronizes the option's properties and selection/highlight state with menu events.<br /><br />**event**: The event object from the menu service. |
83
+ | `setInternalSelected` | `(isSelected: boolean): void` | Updates the internal selected state of the menu option bypassing 'updated' and triggers custom events if selected.<br />This function ensures the option's selection state is synchronized with menu logic and notifies listeners.<br /><br />**isSelected**: Whether the option should be marked as selected. |
84
+ | `setSelected` | `(isSelected: boolean): void` | Sets the selected state of the menu option.<br />This function updates whether the option is currently selected.<br /><br />**isSelected**: Whether the option should be marked as selected. |
85
+ | `updateActive` | `(isActive: boolean): void` | Updates the active state and visual highlighting of the menu option.<br />This function toggles the option's active status and applies or removes the active CSS class.<br /><br />**isActive**: Whether the option should be marked as active. |
82
86
 
83
87
  ## Events
84
88
 
85
89
  | Event | Type | Description |
86
90
  |----------------------------|---------------------|--------------------------------------------------|
87
- | `auroMenuOption-click` | `CustomEvent<this>` | Notifies that this option has been clicked. |
91
+ | `auroMenuOption-click` | `CustomEvent<this>` | |
88
92
  | `auroMenuOption-mouseover` | `CustomEvent<this>` | Notifies that this option has been hovered over. |
89
93
 
90
94
  ## Slots
@@ -18,6 +18,7 @@
18
18
  <auro-anchorlink fluid href="#presetValue" class="level2 body-xs">Preset Value</auro-anchorlink>
19
19
  <auro-anchorlink fluid href="#presetValueMultiselect" class="level2 body-xs">Preset Value (Multi)</auro-anchorlink>
20
20
  <auro-anchorlink fluid href="#preselect" class="level2 body-xs">Pre-Selected</auro-anchorlink>
21
+ <auro-anchorlink fluid href="#allowDeselect" class="level2 body-xs">Allow Deselect</auro-anchorlink>
21
22
  </auro-nav>
22
23
  </nav>
23
24
  <div class="mainContent">
@@ -603,6 +604,33 @@
603
604
  &lt;/auro-menu&gt;</code></pre>
604
605
  <!-- AURO-GENERATED-CONTENT:END -->
605
606
  </auro-accordion>
607
+ <auro-header level="3" id="allowDeselect">Allow Deselect</auro-header>
608
+ <p>Use the <code>allowDeselect</code> attribute to allow users to click a selected option again to deselect it in single-select mode. In multi-select mode, deselection is always available regardless of this attribute.</p>
609
+ <div class="exampleWrapper">
610
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/allow-deselect.html) -->
611
+ <!-- The below content is automatically added from ./../apiExamples/allow-deselect.html -->
612
+ <auro-menu allowDeselect>
613
+ <auro-menuoption value="stops">Stops</auro-menuoption>
614
+ <auro-menuoption value="price">Price</auro-menuoption>
615
+ <auro-menuoption value="duration">Duration</auro-menuoption>
616
+ <auro-menuoption value="departure">Departure</auro-menuoption>
617
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
618
+ </auro-menu>
619
+ <!-- AURO-GENERATED-CONTENT:END -->
620
+ </div>
621
+ <auro-accordion alignRight>
622
+ <span slot="trigger">See code</span>
623
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/allow-deselect.html) -->
624
+ <!-- The below code snippet is automatically added from ./../apiExamples/allow-deselect.html -->
625
+ <pre class="language-html"><code class="language-html">&lt;auro-menu allowDeselect&gt;
626
+ &lt;auro-menuoption value="stops"&gt;Stops&lt;/auro-menuoption&gt;
627
+ &lt;auro-menuoption value="price"&gt;Price&lt;/auro-menuoption&gt;
628
+ &lt;auro-menuoption value="duration"&gt;Duration&lt;/auro-menuoption&gt;
629
+ &lt;auro-menuoption value="departure"&gt;Departure&lt;/auro-menuoption&gt;
630
+ &lt;auro-menuoption value="arrival"&gt;Arrival&lt;/auro-menuoption&gt;
631
+ &lt;/auro-menu&gt;</code></pre>
632
+ <!-- AURO-GENERATED-CONTENT:END -->
633
+ </auro-accordion>
606
634
  </section>
607
635
  </div>
608
636
  </div>