@aurodesignsystem/auro-formkit 5.9.0 → 5.9.2

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 (136) hide show
  1. package/CHANGELOG.md +13 -4
  2. package/README.md +4 -4
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +2 -2
  5. package/components/bibtemplate/dist/registered.js +2 -2
  6. package/components/checkbox/README.md +62 -62
  7. package/components/checkbox/demo/api.js +1 -1
  8. package/components/checkbox/demo/api.md +127 -84
  9. package/components/checkbox/demo/api.min.js +125 -42
  10. package/components/checkbox/demo/index.md +9 -281
  11. package/components/checkbox/demo/index.min.js +125 -42
  12. package/components/checkbox/demo/readme.html +3 -4
  13. package/components/checkbox/demo/readme.md +62 -62
  14. package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
  15. package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
  16. package/components/checkbox/dist/index.js +125 -42
  17. package/components/checkbox/dist/registered.js +125 -42
  18. package/components/combobox/README.md +76 -74
  19. package/components/combobox/demo/api.html +1 -0
  20. package/components/combobox/demo/api.js +11 -12
  21. package/components/combobox/demo/api.md +1302 -875
  22. package/components/combobox/demo/api.min.js +416 -492
  23. package/components/combobox/demo/index.html +1 -7
  24. package/components/combobox/demo/index.js +0 -19
  25. package/components/combobox/demo/index.md +43 -723
  26. package/components/combobox/demo/index.min.js +369 -302
  27. package/components/combobox/demo/readme.html +3 -4
  28. package/components/combobox/demo/readme.md +76 -74
  29. package/components/combobox/dist/auro-combobox.d.ts +42 -42
  30. package/components/combobox/dist/index.js +204 -210
  31. package/components/combobox/dist/registered.js +204 -210
  32. package/components/counter/README.md +81 -66
  33. package/components/counter/demo/api.html +1 -2
  34. package/components/counter/demo/api.js +2 -2
  35. package/components/counter/demo/api.md +777 -259
  36. package/components/counter/demo/api.min.js +119 -171
  37. package/components/counter/demo/index.html +0 -2
  38. package/components/counter/demo/index.md +20 -329
  39. package/components/counter/demo/index.min.js +117 -152
  40. package/components/counter/demo/readme.html +3 -4
  41. package/components/counter/demo/readme.md +81 -66
  42. package/components/counter/dist/auro-counter-group.d.ts +21 -36
  43. package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
  44. package/components/counter/dist/auro-counter.d.ts +5 -8
  45. package/components/counter/dist/index.js +117 -152
  46. package/components/counter/dist/registered.js +117 -152
  47. package/components/datepicker/README.md +57 -61
  48. package/components/datepicker/demo/api.js +8 -8
  49. package/components/datepicker/demo/api.md +720 -561
  50. package/components/datepicker/demo/api.min.js +678 -2769
  51. package/components/datepicker/demo/index.md +65 -117
  52. package/components/datepicker/demo/index.min.js +678 -2769
  53. package/components/datepicker/demo/readme.html +3 -4
  54. package/components/datepicker/demo/readme.md +57 -61
  55. package/components/datepicker/dist/auro-calendar.d.ts +60 -34
  56. package/components/datepicker/dist/auro-datepicker.d.ts +32 -32
  57. package/components/datepicker/dist/iconVersion.d.ts +1 -1
  58. package/components/datepicker/dist/index.js +505 -2596
  59. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  60. package/components/datepicker/dist/registered.js +505 -2596
  61. package/components/dropdown/README.md +78 -62
  62. package/components/dropdown/demo/api.js +4 -4
  63. package/components/dropdown/demo/api.md +520 -478
  64. package/components/dropdown/demo/api.min.js +80 -95
  65. package/components/dropdown/demo/index.md +65 -119
  66. package/components/dropdown/demo/index.min.js +70 -85
  67. package/components/dropdown/demo/readme.html +3 -4
  68. package/components/dropdown/demo/readme.md +78 -62
  69. package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
  70. package/components/dropdown/dist/iconVersion.d.ts +1 -1
  71. package/components/dropdown/dist/index.js +70 -85
  72. package/components/dropdown/dist/registered.js +70 -85
  73. package/components/form/README.md +16 -58
  74. package/components/form/demo/api.md +16 -21
  75. package/components/form/demo/api.min.js +13 -8
  76. package/components/form/demo/index.md +38 -39
  77. package/components/form/demo/index.min.js +13 -8
  78. package/components/form/demo/readme.md +16 -58
  79. package/components/form/demo/working.html +1 -1
  80. package/components/form/dist/auro-form.d.ts +15 -3
  81. package/components/form/dist/index.js +13 -8
  82. package/components/form/dist/registered.js +13 -8
  83. package/components/input/README.md +55 -60
  84. package/components/input/demo/api.js +3 -5
  85. package/components/input/demo/api.md +558 -537
  86. package/components/input/demo/api.min.js +102 -115
  87. package/components/input/demo/index.js +0 -1
  88. package/components/input/demo/index.md +90 -203
  89. package/components/input/demo/index.min.js +87 -99
  90. package/components/input/demo/readme.html +3 -4
  91. package/components/input/demo/readme.md +55 -60
  92. package/components/input/dist/auro-input.d.ts +6 -5
  93. package/components/input/dist/base-input.d.ts +68 -69
  94. package/components/input/dist/iconVersion.d.ts +1 -1
  95. package/components/input/dist/index.js +87 -82
  96. package/components/input/dist/registered.js +87 -82
  97. package/components/menu/README.md +61 -61
  98. package/components/menu/demo/api.js +6 -8
  99. package/components/menu/demo/api.md +520 -577
  100. package/components/menu/demo/api.min.js +199 -97
  101. package/components/menu/demo/index.js +0 -5
  102. package/components/menu/demo/index.md +36 -119
  103. package/components/menu/demo/index.min.js +164 -101
  104. package/components/menu/demo/readme.html +3 -4
  105. package/components/menu/demo/readme.md +61 -61
  106. package/components/menu/dist/auro-menu.context.d.ts +5 -0
  107. package/components/menu/dist/auro-menu.d.ts +75 -37
  108. package/components/menu/dist/auro-menuoption.d.ts +38 -13
  109. package/components/menu/dist/index.js +164 -50
  110. package/components/menu/dist/registered.js +164 -50
  111. package/components/radio/README.md +61 -57
  112. package/components/radio/demo/api.js +2 -2
  113. package/components/radio/demo/api.md +241 -170
  114. package/components/radio/demo/api.min.js +154 -77
  115. package/components/radio/demo/index.md +22 -99
  116. package/components/radio/demo/index.min.js +145 -68
  117. package/components/radio/demo/readme.html +3 -4
  118. package/components/radio/demo/readme.md +61 -57
  119. package/components/radio/dist/auro-radio-group.d.ts +67 -35
  120. package/components/radio/dist/auro-radio.d.ts +56 -33
  121. package/components/radio/dist/index.js +145 -68
  122. package/components/radio/dist/registered.js +145 -68
  123. package/components/select/README.md +68 -65
  124. package/components/select/demo/api.html +1 -0
  125. package/components/select/demo/api.js +7 -7
  126. package/components/select/demo/api.md +1305 -625
  127. package/components/select/demo/api.min.js +357 -262
  128. package/components/select/demo/index.html +0 -2
  129. package/components/select/demo/index.md +25 -833
  130. package/components/select/demo/index.min.js +356 -230
  131. package/components/select/demo/readme.html +3 -4
  132. package/components/select/demo/readme.md +68 -65
  133. package/components/select/dist/auro-select.d.ts +99 -90
  134. package/components/select/dist/index.js +192 -180
  135. package/components/select/dist/registered.js +192 -180
  136. package/package.json +9 -4
@@ -241,7 +241,7 @@ class AuroDependencyVersioning {
241
241
  }
242
242
  }
243
243
 
244
- class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends LitElement{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=css`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, .25rem);line-height:1.8}
244
+ class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends LitElement{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=css`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
245
245
  `;class z extends m{constructor(){super(),this.onDark=false,this.appearance="default";}static get properties(){return {...m.properties,onDark:{type:Boolean,reflect:true},appearance:{type:String,reflect:true},svg:{attribute:false,reflect:true}}}static get styles(){return w}async fetchIcon(t,a){let e="";e="logos"===t?await f(`${this.uri}/${t}/${a}.svg`):await f(`${this.uri}/icons/${t}/${a}.svg`);return (new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString(u,"text/html");this.svg=t.body.firstChild;}}}catch(t){this.svg=void 0;}}}css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
246
246
  `;var y=css`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
247
247
  `;var k=css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
@@ -351,12 +351,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
351
351
 
352
352
 
353
353
  /**
354
- * The auro-menu element provides users a way to define a menu option.
354
+ * The `auro-menuoption` element provides users a way to define a menu option.
355
+ * @customElement auro-menuoption
355
356
  *
356
- * @attr {String} value - Specifies the value to be sent to a server.
357
- * @attr {String} noCheckmark - When true, selected option will not show the checkmark.
358
- * @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
359
- * @attr {Boolean} selected - Specifies that an option is selected.
360
357
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
361
358
  * @slot - Specifies text for an option, but is not the value.
362
359
  */
@@ -364,7 +361,7 @@ class AuroMenuOption extends AuroElement {
364
361
 
365
362
  /**
366
363
  * This will register this element with the browser.
367
- * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
364
+ * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
368
365
  *
369
366
  * @example
370
367
  * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
@@ -407,7 +404,7 @@ class AuroMenuOption extends AuroElement {
407
404
  this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
408
405
 
409
406
  this.selected = false;
410
- this.nocheckmark = false;
407
+ this.noCheckmark = false;
411
408
  this.disabled = false;
412
409
 
413
410
  /**
@@ -428,38 +425,81 @@ class AuroMenuOption extends AuroElement {
428
425
  static get properties() {
429
426
  return {
430
427
  ...super.properties,
428
+
429
+ /**
430
+ * When true, disables the menu option.
431
+ */
431
432
  disabled: {
432
433
  type: Boolean,
433
434
  reflect: true
434
435
  },
436
+
437
+ /**
438
+ * @private
439
+ */
435
440
  event: {
436
441
  type: String,
437
442
  reflect: true
438
443
  },
444
+
445
+ /**
446
+ * @private
447
+ */
448
+ layout: {
449
+ type: String
450
+ },
451
+
452
+ /**
453
+ * 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.
454
+ */
439
455
  key: {
440
456
  type: String,
441
457
  reflect: true
442
458
  },
459
+
460
+ /**
461
+ * @private
462
+ */
443
463
  menuService: {
444
464
  type: Object,
445
465
  state: true
446
466
  },
467
+
468
+ /**
469
+ * @private
470
+ */
447
471
  matchWord: {
448
472
  type: String,
449
473
  state: true
450
474
  },
451
- nocheckmark: {
475
+
476
+ /**
477
+ * @private
478
+ */
479
+ noCheckmark: {
452
480
  type: Boolean,
453
481
  reflect: true
454
482
  },
483
+
484
+ /**
485
+ * Specifies that an option is selected.
486
+ */
455
487
  selected: {
456
488
  type: Boolean,
457
489
  reflect: true
458
490
  },
491
+
492
+ /**
493
+ * Specifies the tab index of the menu option.
494
+ */
459
495
  tabIndex: {
460
496
  type: Number,
461
497
  reflect: true
462
498
  },
499
+
500
+ /**
501
+ * Specifies the value to be sent to a server.
502
+ */
463
503
  value: {
464
504
  type: String,
465
505
  reflect: true
@@ -783,7 +823,7 @@ class AuroMenuOption extends AuroElement {
783
823
 
784
824
  return html$1`
785
825
  <div class="${classes}">
786
- ${this.selected && !this.nocheckmark
826
+ ${this.selected && !this.noCheckmark
787
827
  ? this.generateIconHtml(checkmarkIcon.svg)
788
828
  : undefined}
789
829
  <slot></slot>
@@ -825,6 +865,15 @@ class MenuService {
825
865
  return this.multiSelect ? values : values[0];
826
866
  }
827
867
 
868
+ /**
869
+ * Gets the label(s) of the currently selected option(s).
870
+ * @returns {string}
871
+ */
872
+ get currentLabel() {
873
+ const labels = (this.selectedOptions || []).map(option => option.textContent);
874
+ return this.multiSelect ? labels.join(", ") : labels[0] || '';
875
+ }
876
+
828
877
  /**
829
878
  * Gets the string representation of the current value(s).
830
879
  * For multi-select, this is a JSON stringified array.
@@ -1256,7 +1305,8 @@ class MenuService {
1256
1305
  value: this.currentValue,
1257
1306
  stringValue: this.stringValue,
1258
1307
  keys: this.currentKeys,
1259
- options: this.selectedOptions
1308
+ options: this.selectedOptions,
1309
+ label: this.currentLabel
1260
1310
  };
1261
1311
 
1262
1312
  // If only one option is selected, include its index
@@ -1400,19 +1450,9 @@ const MenuContext = createContext('menu-context');
1400
1450
 
1401
1451
 
1402
1452
  /**
1403
- * The auro-menu element provides users a way to select from a list of options.
1404
- * @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1405
- * @attr {object} optionactive - Specifies the current active menuOption.
1406
- * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
1407
- * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
1408
- * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
1409
- * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1410
- * @attr {boolean} multiselect - When true, the selected option can be multiple options.
1411
- * @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1412
- * @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1413
- * @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
1414
- * @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
1415
- * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1453
+ * The `auro-menu` element provides users a way to select from a list of options.
1454
+ * @customElement auro-menu
1455
+ *
1416
1456
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
1417
1457
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
1418
1458
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
@@ -1503,58 +1543,87 @@ class AuroMenu extends AuroElement {
1503
1543
  type: Boolean,
1504
1544
  reflect: true,
1505
1545
  },
1506
- noCheckmark: {
1507
- type: Boolean,
1508
- reflect: true,
1509
- attribute: 'nocheckmark'
1510
- },
1546
+
1547
+ /**
1548
+ * When true, the entire menu and all options are disabled.
1549
+ */
1511
1550
  disabled: {
1512
1551
  type: Boolean,
1513
1552
  reflect: true
1514
1553
  },
1554
+
1555
+ /**
1556
+ * Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1557
+ */
1558
+ hasLoadingPlaceholder: {
1559
+ type: Boolean
1560
+ },
1561
+
1562
+ /**
1563
+ * @private
1564
+ */
1565
+ layout: {
1566
+ type: String
1567
+ },
1568
+
1569
+ /**
1570
+ * Indent level for submenus.
1571
+ * @private
1572
+ */
1573
+ level: {
1574
+ type: Number,
1575
+ reflect: false,
1576
+ attribute: false
1577
+ },
1578
+
1579
+ /**
1580
+ * When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1581
+ */
1515
1582
  loading: {
1516
1583
  type: Boolean,
1517
1584
  reflect: true
1518
1585
  },
1519
- optionSelected: {
1520
- // Allow HTMLElement, HTMLElement[] arrays and undefined
1521
- type: Object
1522
- },
1523
- optionActive: {
1524
- type: Object,
1525
- attribute: 'optionactive'
1526
- },
1586
+
1587
+ /**
1588
+ * Specifies a string used to highlight matched string parts in options.
1589
+ */
1527
1590
  matchWord: {
1528
1591
  type: String,
1529
1592
  attribute: 'matchword'
1530
1593
  },
1594
+
1595
+ /**
1596
+ * When true, the selected option can be multiple options.
1597
+ */
1531
1598
  multiSelect: {
1532
1599
  type: Boolean,
1533
1600
  reflect: true,
1534
1601
  attribute: 'multiselect'
1535
1602
  },
1536
- selectAllMatchingOptions: {
1603
+
1604
+ /**
1605
+ * When true, selected option will not show the checkmark.
1606
+ */
1607
+ noCheckmark: {
1537
1608
  type: Boolean,
1538
1609
  reflect: true,
1610
+ attribute: 'nocheckmark'
1539
1611
  },
1540
1612
 
1541
1613
  /**
1542
- * Value selected for the component.
1614
+ * Specifies the current active menuOption.
1543
1615
  */
1544
- value: {
1545
- type: String,
1546
- reflect: true,
1547
- attribute: 'value'
1616
+ optionActive: {
1617
+ type: Object,
1618
+ attribute: 'optionactive'
1548
1619
  },
1549
1620
 
1550
1621
  /**
1551
- * Indent level for submenus.
1552
- * @private
1622
+ * An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1553
1623
  */
1554
- level: {
1555
- type: Number,
1556
- reflect: false,
1557
- attribute: false
1624
+ optionSelected: {
1625
+ // Allow HTMLElement, HTMLElement[] arrays and undefined
1626
+ type: Object
1558
1627
  },
1559
1628
 
1560
1629
  /**
@@ -1565,6 +1634,43 @@ class AuroMenu extends AuroElement {
1565
1634
  type: Array,
1566
1635
  reflect: false,
1567
1636
  attribute: false
1637
+ },
1638
+
1639
+ /**
1640
+ * Sets the size of the menu.
1641
+ * @type {'sm' | 'md'}
1642
+ * @default 'sm'
1643
+ */
1644
+ size: {
1645
+ type: String,
1646
+ reflect: true
1647
+ },
1648
+
1649
+ /**
1650
+ * When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1651
+ */
1652
+ selectAllMatchingOptions: {
1653
+ type: Boolean,
1654
+ reflect: true,
1655
+ },
1656
+
1657
+ /**
1658
+ * Sets the shape of the menu.
1659
+ * @type {'box' | 'round'}
1660
+ * @default 'box'
1661
+ */
1662
+ shape: {
1663
+ type: String,
1664
+ reflect: true
1665
+ },
1666
+
1667
+ /**
1668
+ * The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1669
+ */
1670
+ value: {
1671
+ type: String,
1672
+ reflect: true,
1673
+ attribute: 'value'
1568
1674
  }
1569
1675
  };
1570
1676
  }
@@ -1577,6 +1683,14 @@ class AuroMenu extends AuroElement {
1577
1683
  ];
1578
1684
  }
1579
1685
 
1686
+ /**
1687
+ * @readonly
1688
+ * @returns {string} - Returns the label of the currently selected option(s).
1689
+ */
1690
+ get currentLabel() {
1691
+ return this.menuService.currentLabel;
1692
+ };
1693
+
1580
1694
  /**
1581
1695
  * @readonly
1582
1696
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
@@ -1602,7 +1716,7 @@ class AuroMenu extends AuroElement {
1602
1716
 
1603
1717
  /**
1604
1718
  * This will register this element with the browser.
1605
- * @param {string} [name="auro-menu"] - The name of element that you want to register to.
1719
+ * @param {string} [name="auro-menu"] - The name of the element that you want to register.
1606
1720
  *
1607
1721
  * @example
1608
1722
  * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>