@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
@@ -21,49 +21,6 @@ function auroMenuMatchWordExample() {
21
21
  matchWordInput.addEventListener('keyup', updateMatch);
22
22
  }
23
23
 
24
- function auroMenuCustomEventExample() {
25
- let menuCustomEventEl = document.querySelector('auro-menu#customEvent');
26
-
27
- if (menuCustomEventEl) {
28
- menuCustomEventEl.addEventListener('mycustomevent', () => {
29
- console.warn('My Custom Event Fired');
30
- alert(`My Custom Event Fired`);
31
- });
32
- }
33
- }
34
-
35
- function auroMenuLoadingExample() {
36
- document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
37
- document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
38
- });
39
- }
40
-
41
- const initSelectAllMatchingOptionsExample = () => {
42
-
43
- const selectAllBtn = document.getElementById('selectAllBtn');
44
- const selectAllMenu = document.getElementById('selectAllMenu');
45
- const selectFirstBtn = document.getElementById('selectFirstBtn');
46
- const selectFirstMenu = document.getElementById('selectFirstMenu');
47
- const resetAllBtn = document.getElementById('resetAllBtn');
48
- const resetFirstBtn = document.getElementById('resetFirstBtn');
49
-
50
- selectAllBtn.addEventListener('click', () => {
51
- selectAllMenu.value = 'stops';
52
- });
53
-
54
- resetAllBtn.addEventListener('click', () => {
55
- selectAllMenu.reset();
56
- });
57
-
58
- selectFirstBtn.addEventListener('click', () => {
59
- selectFirstMenu.value = 'stops';
60
- });
61
-
62
- resetFirstBtn.addEventListener('click', () => {
63
- selectFirstMenu.reset();
64
- });
65
- };
66
-
67
24
  function initKeysExample() {
68
25
  const menu = document.getElementById('keys-menu');
69
26
  const stopsButton = document.getElementById('stopsButton');
@@ -101,6 +58,38 @@ function initKeysExample() {
101
58
  });
102
59
  }
103
60
 
61
+ function auroMenuLoadingExample() {
62
+ document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
63
+ document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
64
+ });
65
+ }
66
+
67
+ const initSelectAllMatchingOptionsExample = () => {
68
+
69
+ const selectAllBtn = document.getElementById('selectAllBtn');
70
+ const selectAllMenu = document.getElementById('selectAllMenu');
71
+ const selectFirstBtn = document.getElementById('selectFirstBtn');
72
+ const selectFirstMenu = document.getElementById('selectFirstMenu');
73
+ const resetAllBtn = document.getElementById('resetAllBtn');
74
+ const resetFirstBtn = document.getElementById('resetFirstBtn');
75
+
76
+ selectAllBtn.addEventListener('click', () => {
77
+ selectAllMenu.value = 'stops';
78
+ });
79
+
80
+ resetAllBtn.addEventListener('click', () => {
81
+ selectAllMenu.reset();
82
+ });
83
+
84
+ selectFirstBtn.addEventListener('click', () => {
85
+ selectFirstMenu.value = 'stops';
86
+ });
87
+
88
+ resetFirstBtn.addEventListener('click', () => {
89
+ selectFirstMenu.reset();
90
+ });
91
+ };
92
+
104
93
  /**
105
94
  * @license
106
95
  * Copyright 2019 Google LLC
@@ -423,7 +412,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{cons
423
412
  * SPDX-License-Identifier: BSD-3-Clause
424
413
  */const o=o=>o??E;
425
414
 
426
- 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 i$3{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=i$6`: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}
415
+ 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 i$3{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=i$6`: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}
427
416
  `;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;}}}i$6`.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}
428
417
  `;var y=i$6`: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)}
429
418
  `;var k=i$6`: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)}
@@ -480,12 +469,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
480
469
 
481
470
 
482
471
  /**
483
- * The auro-menu element provides users a way to define a menu option.
472
+ * The `auro-menuoption` element provides users a way to define a menu option.
473
+ * @customElement auro-menuoption
484
474
  *
485
- * @attr {String} value - Specifies the value to be sent to a server.
486
- * @attr {String} noCheckmark - When true, selected option will not show the checkmark.
487
- * @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
488
- * @attr {Boolean} selected - Specifies that an option is selected.
489
475
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
490
476
  * @slot - Specifies text for an option, but is not the value.
491
477
  */
@@ -493,7 +479,7 @@ class AuroMenuOption extends AuroElement {
493
479
 
494
480
  /**
495
481
  * This will register this element with the browser.
496
- * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
482
+ * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
497
483
  *
498
484
  * @example
499
485
  * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
@@ -536,7 +522,7 @@ class AuroMenuOption extends AuroElement {
536
522
  this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
537
523
 
538
524
  this.selected = false;
539
- this.nocheckmark = false;
525
+ this.noCheckmark = false;
540
526
  this.disabled = false;
541
527
 
542
528
  /**
@@ -557,38 +543,81 @@ class AuroMenuOption extends AuroElement {
557
543
  static get properties() {
558
544
  return {
559
545
  ...super.properties,
546
+
547
+ /**
548
+ * When true, disables the menu option.
549
+ */
560
550
  disabled: {
561
551
  type: Boolean,
562
552
  reflect: true
563
553
  },
554
+
555
+ /**
556
+ * @private
557
+ */
564
558
  event: {
565
559
  type: String,
566
560
  reflect: true
567
561
  },
562
+
563
+ /**
564
+ * @private
565
+ */
566
+ layout: {
567
+ type: String
568
+ },
569
+
570
+ /**
571
+ * 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.
572
+ */
568
573
  key: {
569
574
  type: String,
570
575
  reflect: true
571
576
  },
577
+
578
+ /**
579
+ * @private
580
+ */
572
581
  menuService: {
573
582
  type: Object,
574
583
  state: true
575
584
  },
585
+
586
+ /**
587
+ * @private
588
+ */
576
589
  matchWord: {
577
590
  type: String,
578
591
  state: true
579
592
  },
580
- nocheckmark: {
593
+
594
+ /**
595
+ * @private
596
+ */
597
+ noCheckmark: {
581
598
  type: Boolean,
582
599
  reflect: true
583
600
  },
601
+
602
+ /**
603
+ * Specifies that an option is selected.
604
+ */
584
605
  selected: {
585
606
  type: Boolean,
586
607
  reflect: true
587
608
  },
609
+
610
+ /**
611
+ * Specifies the tab index of the menu option.
612
+ */
588
613
  tabIndex: {
589
614
  type: Number,
590
615
  reflect: true
591
616
  },
617
+
618
+ /**
619
+ * Specifies the value to be sent to a server.
620
+ */
592
621
  value: {
593
622
  type: String,
594
623
  reflect: true
@@ -912,7 +941,7 @@ class AuroMenuOption extends AuroElement {
912
941
 
913
942
  return u$1`
914
943
  <div class="${classes}">
915
- ${this.selected && !this.nocheckmark
944
+ ${this.selected && !this.noCheckmark
916
945
  ? this.generateIconHtml(checkmarkIcon.svg)
917
946
  : undefined}
918
947
  <slot></slot>
@@ -954,6 +983,15 @@ class MenuService {
954
983
  return this.multiSelect ? values : values[0];
955
984
  }
956
985
 
986
+ /**
987
+ * Gets the label(s) of the currently selected option(s).
988
+ * @returns {string}
989
+ */
990
+ get currentLabel() {
991
+ const labels = (this.selectedOptions || []).map(option => option.textContent);
992
+ return this.multiSelect ? labels.join(", ") : labels[0] || '';
993
+ }
994
+
957
995
  /**
958
996
  * Gets the string representation of the current value(s).
959
997
  * For multi-select, this is a JSON stringified array.
@@ -1385,7 +1423,8 @@ class MenuService {
1385
1423
  value: this.currentValue,
1386
1424
  stringValue: this.stringValue,
1387
1425
  keys: this.currentKeys,
1388
- options: this.selectedOptions
1426
+ options: this.selectedOptions,
1427
+ label: this.currentLabel
1389
1428
  };
1390
1429
 
1391
1430
  // If only one option is selected, include its index
@@ -1529,19 +1568,9 @@ const MenuContext = n$1('menu-context');
1529
1568
 
1530
1569
 
1531
1570
  /**
1532
- * The auro-menu element provides users a way to select from a list of options.
1533
- * @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.
1534
- * @attr {object} optionactive - Specifies the current active menuOption.
1535
- * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
1536
- * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
1537
- * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
1538
- * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1539
- * @attr {boolean} multiselect - When true, the selected option can be multiple options.
1540
- * @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1541
- * @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1542
- * @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
1543
- * @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
1544
- * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1571
+ * The `auro-menu` element provides users a way to select from a list of options.
1572
+ * @customElement auro-menu
1573
+ *
1545
1574
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
1546
1575
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
1547
1576
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
@@ -1632,58 +1661,87 @@ class AuroMenu extends AuroElement {
1632
1661
  type: Boolean,
1633
1662
  reflect: true,
1634
1663
  },
1635
- noCheckmark: {
1636
- type: Boolean,
1637
- reflect: true,
1638
- attribute: 'nocheckmark'
1639
- },
1664
+
1665
+ /**
1666
+ * When true, the entire menu and all options are disabled.
1667
+ */
1640
1668
  disabled: {
1641
1669
  type: Boolean,
1642
1670
  reflect: true
1643
1671
  },
1672
+
1673
+ /**
1674
+ * Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1675
+ */
1676
+ hasLoadingPlaceholder: {
1677
+ type: Boolean
1678
+ },
1679
+
1680
+ /**
1681
+ * @private
1682
+ */
1683
+ layout: {
1684
+ type: String
1685
+ },
1686
+
1687
+ /**
1688
+ * Indent level for submenus.
1689
+ * @private
1690
+ */
1691
+ level: {
1692
+ type: Number,
1693
+ reflect: false,
1694
+ attribute: false
1695
+ },
1696
+
1697
+ /**
1698
+ * When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1699
+ */
1644
1700
  loading: {
1645
1701
  type: Boolean,
1646
1702
  reflect: true
1647
1703
  },
1648
- optionSelected: {
1649
- // Allow HTMLElement, HTMLElement[] arrays and undefined
1650
- type: Object
1651
- },
1652
- optionActive: {
1653
- type: Object,
1654
- attribute: 'optionactive'
1655
- },
1704
+
1705
+ /**
1706
+ * Specifies a string used to highlight matched string parts in options.
1707
+ */
1656
1708
  matchWord: {
1657
1709
  type: String,
1658
1710
  attribute: 'matchword'
1659
1711
  },
1712
+
1713
+ /**
1714
+ * When true, the selected option can be multiple options.
1715
+ */
1660
1716
  multiSelect: {
1661
1717
  type: Boolean,
1662
1718
  reflect: true,
1663
1719
  attribute: 'multiselect'
1664
1720
  },
1665
- selectAllMatchingOptions: {
1721
+
1722
+ /**
1723
+ * When true, selected option will not show the checkmark.
1724
+ */
1725
+ noCheckmark: {
1666
1726
  type: Boolean,
1667
1727
  reflect: true,
1728
+ attribute: 'nocheckmark'
1668
1729
  },
1669
1730
 
1670
1731
  /**
1671
- * Value selected for the component.
1732
+ * Specifies the current active menuOption.
1672
1733
  */
1673
- value: {
1674
- type: String,
1675
- reflect: true,
1676
- attribute: 'value'
1734
+ optionActive: {
1735
+ type: Object,
1736
+ attribute: 'optionactive'
1677
1737
  },
1678
1738
 
1679
1739
  /**
1680
- * Indent level for submenus.
1681
- * @private
1740
+ * An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1682
1741
  */
1683
- level: {
1684
- type: Number,
1685
- reflect: false,
1686
- attribute: false
1742
+ optionSelected: {
1743
+ // Allow HTMLElement, HTMLElement[] arrays and undefined
1744
+ type: Object
1687
1745
  },
1688
1746
 
1689
1747
  /**
@@ -1694,6 +1752,43 @@ class AuroMenu extends AuroElement {
1694
1752
  type: Array,
1695
1753
  reflect: false,
1696
1754
  attribute: false
1755
+ },
1756
+
1757
+ /**
1758
+ * Sets the size of the menu.
1759
+ * @type {'sm' | 'md'}
1760
+ * @default 'sm'
1761
+ */
1762
+ size: {
1763
+ type: String,
1764
+ reflect: true
1765
+ },
1766
+
1767
+ /**
1768
+ * When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1769
+ */
1770
+ selectAllMatchingOptions: {
1771
+ type: Boolean,
1772
+ reflect: true,
1773
+ },
1774
+
1775
+ /**
1776
+ * Sets the shape of the menu.
1777
+ * @type {'box' | 'round'}
1778
+ * @default 'box'
1779
+ */
1780
+ shape: {
1781
+ type: String,
1782
+ reflect: true
1783
+ },
1784
+
1785
+ /**
1786
+ * The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1787
+ */
1788
+ value: {
1789
+ type: String,
1790
+ reflect: true,
1791
+ attribute: 'value'
1697
1792
  }
1698
1793
  };
1699
1794
  }
@@ -1706,6 +1801,14 @@ class AuroMenu extends AuroElement {
1706
1801
  ];
1707
1802
  }
1708
1803
 
1804
+ /**
1805
+ * @readonly
1806
+ * @returns {string} - Returns the label of the currently selected option(s).
1807
+ */
1808
+ get currentLabel() {
1809
+ return this.menuService.currentLabel;
1810
+ };
1811
+
1709
1812
  /**
1710
1813
  * @readonly
1711
1814
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
@@ -1731,7 +1834,7 @@ class AuroMenu extends AuroElement {
1731
1834
 
1732
1835
  /**
1733
1836
  * This will register this element with the browser.
1734
- * @param {string} [name="auro-menu"] - The name of element that you want to register to.
1837
+ * @param {string} [name="auro-menu"] - The name of the element that you want to register.
1735
1838
  *
1736
1839
  * @example
1737
1840
  * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
@@ -2149,12 +2252,11 @@ function initExamples(initCount) {
2149
2252
 
2150
2253
  try {
2151
2254
  // javascript example function calls to be added here upon creation to test examples
2152
- auroMenuResetExample();
2153
- auroMenuMatchWordExample();
2154
- auroMenuCustomEventExample();
2255
+ initKeysExample();
2155
2256
  auroMenuLoadingExample();
2257
+ auroMenuMatchWordExample();
2156
2258
  initSelectAllMatchingOptionsExample();
2157
- initKeysExample();
2259
+ auroMenuResetExample();
2158
2260
  } catch (err) {
2159
2261
  if (initCount <= 20) {
2160
2262
  // setTimeout handles issue where content is sometimes loaded after the functions get called
@@ -1,10 +1,7 @@
1
1
  /* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
2
2
 
3
- // import { auroMenuResetExample } from '../apiExamples/reset';
4
-
5
3
  import { AuroMenu } from '../src/auro-menu.js';
6
4
  import { AuroMenuOption } from '../src/auro-menuoption.js';
7
- import { initKeysExample } from '../apiExamples/keys.js';
8
5
 
9
6
  AuroMenu.register();
10
7
  AuroMenuOption.register();
@@ -16,8 +13,6 @@ export function initExamples(initCount) {
16
13
 
17
14
  try {
18
15
  // javascript example function calls to be added here upon creation to test examples
19
- // auroMenuResetExample();
20
- initKeysExample();
21
16
  } catch (err) {
22
17
  if (initCount <= 20) {
23
18
  // setTimeout handles issue where content is sometimes loaded after the functions get called