@aurodesignsystem/auro-formkit 5.9.1 → 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 (127) hide show
  1. package/CHANGELOG.md +16 -4
  2. package/components/checkbox/README.md +62 -62
  3. package/components/checkbox/demo/api.js +1 -1
  4. package/components/checkbox/demo/api.md +127 -84
  5. package/components/checkbox/demo/api.min.js +125 -42
  6. package/components/checkbox/demo/index.md +9 -281
  7. package/components/checkbox/demo/index.min.js +125 -42
  8. package/components/checkbox/demo/readme.html +3 -4
  9. package/components/checkbox/demo/readme.md +62 -62
  10. package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
  11. package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
  12. package/components/checkbox/dist/index.js +125 -42
  13. package/components/checkbox/dist/registered.js +125 -42
  14. package/components/combobox/README.md +76 -74
  15. package/components/combobox/demo/api.html +1 -0
  16. package/components/combobox/demo/api.js +11 -12
  17. package/components/combobox/demo/api.md +1302 -875
  18. package/components/combobox/demo/api.min.js +348 -420
  19. package/components/combobox/demo/index.html +1 -7
  20. package/components/combobox/demo/index.js +0 -19
  21. package/components/combobox/demo/index.md +43 -723
  22. package/components/combobox/demo/index.min.js +301 -230
  23. package/components/combobox/demo/readme.html +3 -4
  24. package/components/combobox/demo/readme.md +76 -74
  25. package/components/combobox/dist/auro-combobox.d.ts +39 -40
  26. package/components/combobox/dist/index.js +159 -143
  27. package/components/combobox/dist/registered.js +159 -143
  28. package/components/counter/README.md +81 -66
  29. package/components/counter/demo/api.html +1 -2
  30. package/components/counter/demo/api.js +2 -2
  31. package/components/counter/demo/api.md +777 -259
  32. package/components/counter/demo/api.min.js +84 -112
  33. package/components/counter/demo/index.html +0 -2
  34. package/components/counter/demo/index.md +20 -329
  35. package/components/counter/demo/index.min.js +82 -93
  36. package/components/counter/demo/readme.html +3 -4
  37. package/components/counter/demo/readme.md +81 -66
  38. package/components/counter/dist/auro-counter-group.d.ts +21 -36
  39. package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
  40. package/components/counter/dist/auro-counter.d.ts +5 -8
  41. package/components/counter/dist/index.js +82 -93
  42. package/components/counter/dist/registered.js +82 -93
  43. package/components/datepicker/README.md +57 -61
  44. package/components/datepicker/demo/api.js +8 -8
  45. package/components/datepicker/demo/api.md +720 -561
  46. package/components/datepicker/demo/api.min.js +427 -2424
  47. package/components/datepicker/demo/index.md +65 -117
  48. package/components/datepicker/demo/index.min.js +427 -2424
  49. package/components/datepicker/demo/readme.html +3 -4
  50. package/components/datepicker/demo/readme.md +57 -61
  51. package/components/datepicker/dist/auro-calendar.d.ts +60 -34
  52. package/components/datepicker/dist/auro-datepicker.d.ts +31 -31
  53. package/components/datepicker/dist/index.js +256 -2253
  54. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  55. package/components/datepicker/dist/registered.js +256 -2253
  56. package/components/dropdown/README.md +78 -62
  57. package/components/dropdown/demo/api.js +4 -4
  58. package/components/dropdown/demo/api.md +520 -478
  59. package/components/dropdown/demo/api.min.js +48 -39
  60. package/components/dropdown/demo/index.md +65 -119
  61. package/components/dropdown/demo/index.min.js +38 -29
  62. package/components/dropdown/demo/readme.html +3 -4
  63. package/components/dropdown/demo/readme.md +78 -62
  64. package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
  65. package/components/dropdown/dist/index.js +38 -29
  66. package/components/dropdown/dist/registered.js +38 -29
  67. package/components/form/README.md +16 -58
  68. package/components/form/demo/api.md +16 -21
  69. package/components/form/demo/api.min.js +13 -8
  70. package/components/form/demo/index.md +38 -39
  71. package/components/form/demo/index.min.js +13 -8
  72. package/components/form/demo/readme.md +16 -58
  73. package/components/form/dist/auro-form.d.ts +15 -3
  74. package/components/form/dist/index.js +13 -8
  75. package/components/form/dist/registered.js +13 -8
  76. package/components/input/README.md +55 -60
  77. package/components/input/demo/api.js +3 -5
  78. package/components/input/demo/api.md +558 -537
  79. package/components/input/demo/api.min.js +100 -113
  80. package/components/input/demo/index.js +0 -1
  81. package/components/input/demo/index.md +90 -203
  82. package/components/input/demo/index.min.js +85 -97
  83. package/components/input/demo/readme.html +3 -4
  84. package/components/input/demo/readme.md +55 -60
  85. package/components/input/dist/auro-input.d.ts +6 -5
  86. package/components/input/dist/base-input.d.ts +67 -68
  87. package/components/input/dist/index.js +85 -80
  88. package/components/input/dist/registered.js +85 -80
  89. package/components/menu/README.md +61 -61
  90. package/components/menu/demo/api.js +6 -8
  91. package/components/menu/demo/api.md +520 -572
  92. package/components/menu/demo/api.min.js +176 -92
  93. package/components/menu/demo/index.js +0 -5
  94. package/components/menu/demo/index.md +36 -119
  95. package/components/menu/demo/index.min.js +141 -96
  96. package/components/menu/demo/readme.html +3 -4
  97. package/components/menu/demo/readme.md +61 -61
  98. package/components/menu/dist/auro-menu.d.ts +70 -37
  99. package/components/menu/dist/auro-menuoption.d.ts +36 -11
  100. package/components/menu/dist/index.js +141 -45
  101. package/components/menu/dist/registered.js +141 -45
  102. package/components/radio/README.md +61 -57
  103. package/components/radio/demo/api.js +2 -2
  104. package/components/radio/demo/api.md +241 -170
  105. package/components/radio/demo/api.min.js +154 -77
  106. package/components/radio/demo/index.md +22 -99
  107. package/components/radio/demo/index.min.js +145 -68
  108. package/components/radio/demo/readme.html +3 -4
  109. package/components/radio/demo/readme.md +61 -57
  110. package/components/radio/dist/auro-radio-group.d.ts +67 -35
  111. package/components/radio/dist/auro-radio.d.ts +56 -33
  112. package/components/radio/dist/index.js +145 -68
  113. package/components/radio/dist/registered.js +145 -68
  114. package/components/select/README.md +68 -65
  115. package/components/select/demo/api.html +1 -0
  116. package/components/select/demo/api.js +7 -7
  117. package/components/select/demo/api.md +1305 -625
  118. package/components/select/demo/api.min.js +300 -199
  119. package/components/select/demo/index.html +0 -2
  120. package/components/select/demo/index.md +25 -833
  121. package/components/select/demo/index.min.js +299 -167
  122. package/components/select/demo/readme.html +3 -4
  123. package/components/select/demo/readme.md +68 -65
  124. package/components/select/dist/auro-select.d.ts +99 -90
  125. package/components/select/dist/index.js +158 -122
  126. package/components/select/dist/registered.js +158 -122
  127. package/package.json +3 -3
@@ -3,30 +3,29 @@
3
3
 
4
4
  # auro-menu
5
5
 
6
- The auro-menu element provides users a way to select from a list of options.
6
+ 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
- | [allowDeselect](#allowDeselect) | `allowDeselect` | | `boolean` | false | Allows deselecting an already selected option when clicked again in single-select mode. |
13
- | [currentLabel](#currentLabel) | | readonly | `string` | | |
14
- | [disabled](#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](#index) | | | `number` | | |
17
- | [items](#items) | | readonly | `HTMLElement[]` | | |
18
- | [layout](#layout) | | | `string` | | |
19
- | [loading](#loading) | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
20
- | [matchWord](#matchWord) | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
21
- | [multiSelect](#multiSelect) | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
22
- | [noCheckmark](#noCheckmark) | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
23
- | [optionActive](#optionActive) | `optionactive` | | `object` | "undefined" | Specifies the current active menuOption. |
24
- | [optionSelected](#optionSelected) | `optionSelected` | | `HTMLElement\|Array<HTMLElement>` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
25
- | [options](#options) | | readonly | `array` | | Available menu options |
26
- | [selectAllMatchingOptions](#selectAllMatchingOptions) | `selectAllMatchingOptions` | | `boolean` | false | When true, selects all options that match the provided value/key when setting value and multiselect is enabled. |
27
- | [selectedOption](#selectedOption) | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
28
- | [selectedOptions](#selectedOptions) | | readonly | `HTMLElement[]` | | Gets the currently selected options. |
29
- | [value](#value) | `value` | | `string` | "undefined" | Value selected for the component. |
10
+ | Property | Attribute | Modifiers | Type | Default | Description |
11
+ |----------------------------|----------------------------|-----------|-----------------------|-------------|--------------------------------------------------|
12
+ | [allowDeselect](#allowDeselect) | `allowDeselect` | | `boolean` | false | Allows deselecting an already selected option when clicked again in single-select mode. |
13
+ | [currentLabel](#currentLabel) | | readonly | `string` | | |
14
+ | [disabled](#disabled) | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
15
+ | [hasLoadingPlaceholder](#hasLoadingPlaceholder) | `hasLoadingPlaceholder` | | `boolean` | | Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state. |
16
+ | [index](#index) | | | `number` | | |
17
+ | [items](#items) | | readonly | `HTMLElement[]` | | |
18
+ | [loading](#loading) | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
19
+ | [matchWord](#matchWord) | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
20
+ | [multiSelect](#multiSelect) | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
21
+ | [noCheckmark](#noCheckmark) | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
22
+ | [optionActive](#optionActive) | `optionactive` | | `object` | "undefined" | Specifies the current active menuOption. |
23
+ | [optionSelected](#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](#options) | | readonly | `array` | | Available menu options |
25
+ | [selectAllMatchingOptions](#selectAllMatchingOptions) | `selectAllMatchingOptions` | | `boolean` | false | When true, selects all options that match the provided value/key when setting value and multiselect is enabled. |
26
+ | [selectedOption](#selectedOption) | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
27
+ | [selectedOptions](#selectedOptions) | | readonly | `HTMLElement[]` | | Gets the currently selected options. |
28
+ | [value](#value) | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values. |
30
29
 
31
30
  ## Methods
32
31
 
@@ -57,25 +56,20 @@ The auro-menu element provides users a way to select from a list of options.
57
56
 
58
57
  # auro-menuoption
59
58
 
60
- The auro-menu element provides users a way to define a menu option.
59
+ The `auro-menuoption` element provides users a way to define a menu option.
61
60
 
62
61
  ## Properties
63
62
 
64
- | Property | Attribute | Modifiers | Type | Default | Description |
65
- |---------------|---------------|-----------|-----------|---------|--------------------------------------------------|
66
- | [disabled](#disabled) | `disabled` | | `Boolean` | false | When true specifies that the menuoption is disabled. |
67
- | [event](#event) | `event` | | `string` | | |
68
- | [iconTag](#iconTag) | | | `string` | | |
69
- | [isActive](#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. |
70
- | [key](#key) | `key` | | `string` | | |
71
- | [layout](#layout) | | | `string` | | |
72
- | [matchWord](#matchWord) | `matchWord` | | `string` | | |
73
- | [menuService](#menuService) | `menuService` | | `object` | null | |
74
- | [noCheckmark](#noCheckmark) | `noCheckmark` | | `String` | false | When true, selected option will not show the checkmark. |
75
- | [selected](#selected) | `selected` | | `Boolean` | false | Specifies that an option is selected. |
76
- | [tabIndex](#tabIndex) | `tabIndex` | | `number` | | |
77
- | [unsubscribe](#unsubscribe) | | | | null | |
78
- | [value](#value) | `value` | | `String` | | Specifies the value to be sent to a server. |
63
+ | Property | Attribute | Modifiers | Type | Default | Description |
64
+ |---------------|------------|-----------|-----------|---------|--------------------------------------------------|
65
+ | [disabled](#disabled) | `disabled` | | `boolean` | false | When true, disables the menu option. |
66
+ | [iconTag](#iconTag) | | | `string` | | |
67
+ | [isActive](#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. |
68
+ | [key](#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. |
69
+ | [selected](#selected) | `selected` | | `boolean` | false | Specifies that an option is selected. |
70
+ | [tabIndex](#tabIndex) | `tabIndex` | | `number` | | Specifies the tab index of the menu option. |
71
+ | [unsubscribe](#unsubscribe) | | | | null | |
72
+ | [value](#value) | `value` | | `string` | | Specifies the value to be sent to a server. |
79
73
 
80
74
  ## Methods
81
75
 
@@ -102,9 +96,7 @@ The auro-menu element provides users a way to define a menu option.
102
96
  | | Specifies text for an option, but is not the value. |
103
97
  <!-- AURO-GENERATED-CONTENT:END -->
104
98
 
105
- ## API Examples
106
-
107
- ### Basic
99
+ ## Basic
108
100
 
109
101
  <div class="exampleWrapper">
110
102
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
@@ -135,7 +127,138 @@ The auro-menu element provides users a way to define a menu option.
135
127
  <!-- AURO-GENERATED-CONTENT:END -->
136
128
  </auro-accordion>
137
129
 
138
- ### Using Keys
130
+ ## Property & Attribute Examples
131
+
132
+ ### Deselect Option
133
+
134
+ When set, the `allowDeselect` attribute allows the user to click on a selected menu option again to deselect it when the menu is not in multi-select mode.
135
+
136
+ When the menu is in multi-select mode, this attribute has no effect and the user will be able to deselect the last remaining selected option.
137
+
138
+ <div class="exampleWrapper">
139
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/allow-deselect.html) -->
140
+ <!-- The below content is automatically added from ./../apiExamples/allow-deselect.html -->
141
+ <auro-menu allowDeselect>
142
+ <auro-menuoption value="stops">Stops</auro-menuoption>
143
+ <auro-menuoption value="price">Price</auro-menuoption>
144
+ <auro-menuoption value="duration">Duration</auro-menuoption>
145
+ <auro-menuoption value="departure">Departure</auro-menuoption>
146
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
147
+ </auro-menu>
148
+ <!-- AURO-GENERATED-CONTENT:END -->
149
+ </div>
150
+ <auro-accordion alignRight>
151
+ <span slot="trigger">See code</span>
152
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/allow-deselect.html) -->
153
+ <!-- The below code snippet is automatically added from ./../apiExamples/allow-deselect.html -->
154
+
155
+ ```html
156
+ <auro-menu allowDeselect>
157
+ <auro-menuoption value="stops">Stops</auro-menuoption>
158
+ <auro-menuoption value="price">Price</auro-menuoption>
159
+ <auro-menuoption value="duration">Duration</auro-menuoption>
160
+ <auro-menuoption value="departure">Departure</auro-menuoption>
161
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
162
+ </auro-menu>
163
+ ```
164
+ <!-- AURO-GENERATED-CONTENT:END -->
165
+ </auro-accordion>
166
+
167
+ ### Disabled
168
+
169
+ The `auro-menu` element with `disabled` will mark all `auro-menuoption` elements as disabled.
170
+
171
+ <div class="exampleWrapper">
172
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled-menu.html) -->
173
+ <!-- The below content is automatically added from ./../apiExamples/disabled-menu.html -->
174
+ <auro-menu disabled>
175
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
176
+ <auro-menuoption value="new window">New window</auro-menuoption>
177
+ <auro-menuoption value="open file">Open file</auro-menuoption>
178
+ <auro-menuoption value="open location">Open location</auro-menuoption>
179
+ <hr>
180
+ <auro-menuoption value="close window">Close window</auro-menuoption>
181
+ <auro-menuoption value="close tab">Close tab</auro-menuoption>
182
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
183
+ <hr>
184
+ <auro-menuoption value="share">Share</auro-menuoption>
185
+ <hr>
186
+ <auro-menuoption value="print">Print</auro-menuoption>
187
+ </auro-menu>
188
+ <!-- AURO-GENERATED-CONTENT:END -->
189
+ </div>
190
+ <auro-accordion alignRight>
191
+ <span slot="trigger">See code</span>
192
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled-menu.html) -->
193
+ <!-- The below code snippet is automatically added from ./../apiExamples/disabled-menu.html -->
194
+
195
+ ```html
196
+ <auro-menu disabled>
197
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
198
+ <auro-menuoption value="new window">New window</auro-menuoption>
199
+ <auro-menuoption value="open file">Open file</auro-menuoption>
200
+ <auro-menuoption value="open location">Open location</auro-menuoption>
201
+ <hr>
202
+ <auro-menuoption value="close window">Close window</auro-menuoption>
203
+ <auro-menuoption value="close tab">Close tab</auro-menuoption>
204
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
205
+ <hr>
206
+ <auro-menuoption value="share">Share</auro-menuoption>
207
+ <hr>
208
+ <auro-menuoption value="print">Print</auro-menuoption>
209
+ </auro-menu>
210
+ ```
211
+ <!-- AURO-GENERATED-CONTENT:END -->
212
+ </auro-accordion>
213
+
214
+ #### Single Disabled Option
215
+
216
+ The `auro-menuoption` element supports the placement of the `disabled` attribute per option. A fully disabled list would be managed in an outer wrapping drop down menu element.
217
+
218
+ <div class="exampleWrapper">
219
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
220
+ <!-- The below content is automatically added from ./../apiExamples/disabled.html -->
221
+ <auro-menu>
222
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
223
+ <auro-menuoption value="new window">New window</auro-menuoption>
224
+ <auro-menuoption value="open file">Open file</auro-menuoption>
225
+ <auro-menuoption value="open location">Open location</auro-menuoption>
226
+ <hr>
227
+ <auro-menuoption value="close window">Close window</auro-menuoption>
228
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
229
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
230
+ <hr>
231
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
232
+ <hr>
233
+ <auro-menuoption value="print">Print</auro-menuoption>
234
+ </auro-menu>
235
+ <!-- AURO-GENERATED-CONTENT:END -->
236
+ </div>
237
+ <auro-accordion alignRight>
238
+ <span slot="trigger">See code</span>
239
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
240
+ <!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
241
+
242
+ ```html
243
+ <auro-menu>
244
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
245
+ <auro-menuoption value="new window">New window</auro-menuoption>
246
+ <auro-menuoption value="open file">Open file</auro-menuoption>
247
+ <auro-menuoption value="open location">Open location</auro-menuoption>
248
+ <hr>
249
+ <auro-menuoption value="close window">Close window</auro-menuoption>
250
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
251
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
252
+ <hr>
253
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
254
+ <hr>
255
+ <auro-menuoption value="print">Print</auro-menuoption>
256
+ </auro-menu>
257
+ ```
258
+ <!-- AURO-GENERATED-CONTENT:END -->
259
+ </auro-accordion>
260
+
261
+ ### Keys
139
262
 
140
263
  When setting the `value` property, matches are actually performed on the value of the `key` property of the `auro-menuoption` and not the `value` property. By default, the value of `key` is equal to the value of the `value` property. However, for advanced use cases, the `key` value can be overriden to allow for more specific matches.
141
264
 
@@ -145,25 +268,25 @@ In the below example, setting the value of the menu `'stops'` will select the bo
145
268
 
146
269
  Due to a limitation with Lit change detection to the `value` property, if multiple options with the same exist and one is selected, you must first clear the current value before attempting to select another option with the same value, even if the keys are unique. See code example below.
147
270
 
148
- _Note: Since the value passed to the `value` property when programmatically setting it is overwritten with the proper derived value once the menu has updated, note that it will take one lifecycle before the `value` property is updated to the value that represents the actual menu state._
149
-
271
+ _Note: Since the value passed to the `value` property when programmatically setting it is overwritten with the proper derived value once the menu has updated, note that it will take one lifecycle before the `value` property is updated to the value that represents the actual menu state._
272
+
150
273
  <div class="exampleWrapper">
151
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/keys.html) -->
152
- <!-- The below content is automatically added from ./../apiExamples/keys.html -->
153
- <auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
154
- <auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
155
- <auro-menu id="keys-menu">
156
- <auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
157
- <auro-menuoption value="price" key="price-top">Price</auro-menuoption>
158
- <hr>
159
- <auro-menuoption value="duration">Duration</auro-menuoption>
160
- <auro-menuoption value="departure">Departure</auro-menuoption>
161
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
162
- <auro-menuoption value="stops">Stops</auro-menuoption>
163
- <auro-menuoption value="price">Price</auro-menuoption>
164
- </auro-menu>
165
- <p id="output" class="body-sm"></p>
166
- <!-- AURO-GENERATED-CONTENT:END -->
274
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/keys.html) -->
275
+ <!-- The below content is automatically added from ./../apiExamples/keys.html -->
276
+ <auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
277
+ <auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
278
+ <auro-menu id="keys-menu">
279
+ <auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
280
+ <auro-menuoption value="price" key="price-top">Price</auro-menuoption>
281
+ <hr>
282
+ <auro-menuoption value="duration">Duration</auro-menuoption>
283
+ <auro-menuoption value="departure">Departure</auro-menuoption>
284
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
285
+ <auro-menuoption value="stops">Stops</auro-menuoption>
286
+ <auro-menuoption value="price">Price</auro-menuoption>
287
+ </auro-menu>
288
+ <p id="output" class="body-sm"></p>
289
+ <!-- AURO-GENERATED-CONTENT:END -->
167
290
  </div>
168
291
  <auro-accordion alignRight>
169
292
  <span slot="trigger">See code</span>
@@ -207,41 +330,248 @@ export function initKeysExample() {
207
330
  output.innerHTML = '';
208
331
  };
209
332
 
210
- const updateMenuValue = (value) => {
211
- resetConsole();
212
- createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
213
- menu.value = '';
214
- menu.value = value;
215
- createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
216
- setTimeout(() => {
217
- createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
218
- });
219
- };
333
+ const updateMenuValue = (value) => {
334
+ resetConsole();
335
+ createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
336
+ menu.value = '';
337
+ menu.value = value;
338
+ createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
339
+ setTimeout(() => {
340
+ createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
341
+ });
342
+ };
343
+
344
+ stopsButton.addEventListener('click', () => {
345
+ updateMenuValue('stops');
346
+ });
347
+
348
+ stopsTopButton.addEventListener('click', () => {
349
+ updateMenuValue('stops-top');
350
+ });
351
+ };
352
+ ```
353
+ <!-- AURO-GENERATED-CONTENT:END -->
354
+ </auro-accordion>
355
+
356
+ ### Loading
357
+
358
+ While content is loading, the menu can either remain empty or display a loading placeholder
359
+
360
+ <div class="exampleWrapper">
361
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/loading.html) -->
362
+ <!-- The below content is automatically added from ./../apiExamples/loading.html -->
363
+ <auro-button id="loadingExampleToggleButton">Toggle Loading</auro-button>
364
+ <table id="loadingExampleTable">
365
+ <thead>
366
+ <tr>
367
+ <td width="25%">Spinner + Text</td>
368
+ <td width="25%">Text Only</td>
369
+ <td width="25%">Spinner Only</td>
370
+ <td width="25%">None</td>
371
+ </tr>
372
+ </thead>
373
+ <tr>
374
+ <td>
375
+ <auro-menu>
376
+ <auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
377
+ <auro-menuoption value="stops">Stops</auro-menuoption>
378
+ <auro-menuoption value="price">Price</auro-menuoption>
379
+ <auro-menuoption value="duration">Duration</auro-menuoption>
380
+ <auro-menuoption value="departure">Departure</auro-menuoption>
381
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
382
+ </auro-menu>
383
+ </td>
384
+ <td>
385
+ <auro-menu>
386
+ <span slot="loadingText">Loading...</span>
387
+ <auro-menuoption value="stops">Stops</auro-menuoption>
388
+ <auro-menuoption value="price">Price</auro-menuoption>
389
+ <auro-menuoption value="duration">Duration</auro-menuoption>
390
+ <auro-menuoption value="departure">Departure</auro-menuoption>
391
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
392
+ </auro-menu>
393
+ </td>
394
+ <td>
395
+ <auro-menu>
396
+ <auro-loader slot="loadingIcon" orbit xs></auro-loader>
397
+ <auro-menuoption value="stops">Stops</auro-menuoption>
398
+ <auro-menuoption value="price">Price</auro-menuoption>
399
+ <auro-menuoption value="duration">Duration</auro-menuoption>
400
+ <auro-menuoption value="departure">Departure</auro-menuoption>
401
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
402
+ </auro-menu>
403
+ </td>
404
+ <td>
405
+ <auro-menu>
406
+ <auro-menuoption value="stops">Stops</auro-menuoption>
407
+ <auro-menuoption value="price">Price</auro-menuoption>
408
+ <auro-menuoption value="duration">Duration</auro-menuoption>
409
+ <auro-menuoption value="departure">Departure</auro-menuoption>
410
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
411
+ </auro-menu>
412
+ </td>
413
+ </tr>
414
+ </table>
415
+ <!-- AURO-GENERATED-CONTENT:END -->
416
+ </div>
417
+ <auro-accordion alignRight>
418
+ <span slot="trigger">See code</span>
419
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/loading.html) -->
420
+ <!-- The below code snippet is automatically added from ./../apiExamples/loading.html -->
421
+
422
+ ```html
423
+ <auro-button id="loadingExampleToggleButton">Toggle Loading</auro-button>
424
+ <table id="loadingExampleTable">
425
+ <thead>
426
+ <tr>
427
+ <td width="25%">Spinner + Text</td>
428
+ <td width="25%">Text Only</td>
429
+ <td width="25%">Spinner Only</td>
430
+ <td width="25%">None</td>
431
+ </tr>
432
+ </thead>
433
+ <tr>
434
+ <td>
435
+ <auro-menu>
436
+ <auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
437
+ <auro-menuoption value="stops">Stops</auro-menuoption>
438
+ <auro-menuoption value="price">Price</auro-menuoption>
439
+ <auro-menuoption value="duration">Duration</auro-menuoption>
440
+ <auro-menuoption value="departure">Departure</auro-menuoption>
441
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
442
+ </auro-menu>
443
+ </td>
444
+ <td>
445
+ <auro-menu>
446
+ <span slot="loadingText">Loading...</span>
447
+ <auro-menuoption value="stops">Stops</auro-menuoption>
448
+ <auro-menuoption value="price">Price</auro-menuoption>
449
+ <auro-menuoption value="duration">Duration</auro-menuoption>
450
+ <auro-menuoption value="departure">Departure</auro-menuoption>
451
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
452
+ </auro-menu>
453
+ </td>
454
+ <td>
455
+ <auro-menu>
456
+ <auro-loader slot="loadingIcon" orbit xs></auro-loader>
457
+ <auro-menuoption value="stops">Stops</auro-menuoption>
458
+ <auro-menuoption value="price">Price</auro-menuoption>
459
+ <auro-menuoption value="duration">Duration</auro-menuoption>
460
+ <auro-menuoption value="departure">Departure</auro-menuoption>
461
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
462
+ </auro-menu>
463
+ </td>
464
+ <td>
465
+ <auro-menu>
466
+ <auro-menuoption value="stops">Stops</auro-menuoption>
467
+ <auro-menuoption value="price">Price</auro-menuoption>
468
+ <auro-menuoption value="duration">Duration</auro-menuoption>
469
+ <auro-menuoption value="departure">Departure</auro-menuoption>
470
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
471
+ </auro-menu>
472
+ </td>
473
+ </tr>
474
+ </table>
475
+ ```
476
+ <!-- AURO-GENERATED-CONTENT:END -->
477
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/loading.js) -->
478
+ <!-- The below code snippet is automatically added from ./../apiExamples/loading.js -->
479
+
480
+ ```js
481
+ export function auroMenuLoadingExample() {
482
+ document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
483
+ document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
484
+ });
485
+ }
486
+ ```
487
+ <!-- AURO-GENERATED-CONTENT:END -->
488
+ </auro-accordion>
489
+
490
+ ### Match Word
491
+
492
+ Use the `matchWord` attribute to highlight string parts of each menuoption that are equal to `matchWord`. The matching algorithm is case insensitive (e.g., `n` matches `N`).
493
+
494
+ <div class="exampleWrapper">
495
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/match-word.html) -->
496
+ <!-- The below content is automatically added from ./../apiExamples/match-word.html -->
497
+ <auro-input id="matchWordInput" required>
498
+ <span slot="label">Enter a value to match in the menu</span>
499
+ </auro-input>
500
+ <br />
501
+ <auro-menu id="matchWordMenu">
502
+ <auro-menuoption value="stops">Stops</auro-menuoption>
503
+ <auro-menuoption value="price">Price</auro-menuoption>
504
+ <auro-menuoption value="duration">Duration</auro-menuoption>
505
+ <auro-menuoption value="departure">Departure</auro-menuoption>
506
+ <auro-menu>
507
+ <auro-menuoption value="apples">Apples</auro-menuoption>
508
+ <auro-menuoption value="oranges">Oranges</auro-menuoption>
509
+ <auro-menuoption value="peaches">Peaches</auro-menuoption>
510
+ </auro-menu>
511
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
512
+ </auro-menu>
513
+ <!-- AURO-GENERATED-CONTENT:END -->
514
+ </div>
515
+ <auro-accordion alignRight>
516
+ <span slot="trigger">See code</span>
517
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/match-word.html) -->
518
+ <!-- The below code snippet is automatically added from ./../apiExamples/match-word.html -->
519
+
520
+ ```html
521
+ <auro-input id="matchWordInput" required>
522
+ <span slot="label">Enter a value to match in the menu</span>
523
+ </auro-input>
524
+ <br />
525
+ <auro-menu id="matchWordMenu">
526
+ <auro-menuoption value="stops">Stops</auro-menuoption>
527
+ <auro-menuoption value="price">Price</auro-menuoption>
528
+ <auro-menuoption value="duration">Duration</auro-menuoption>
529
+ <auro-menuoption value="departure">Departure</auro-menuoption>
530
+ <auro-menu>
531
+ <auro-menuoption value="apples">Apples</auro-menuoption>
532
+ <auro-menuoption value="oranges">Oranges</auro-menuoption>
533
+ <auro-menuoption value="peaches">Peaches</auro-menuoption>
534
+ </auro-menu>
535
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
536
+ </auro-menu>
537
+ ```
538
+ <!-- AURO-GENERATED-CONTENT:END -->
539
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/match-word.js) -->
540
+ <!-- The below code snippet is automatically added from ./../apiExamples/match-word.js -->
541
+
542
+ ```js
543
+ function updateMatch() {
544
+ let matchWordMenu = document.querySelector('#matchWordMenu');
545
+
546
+ matchWordMenu.matchWord = matchWordInput.value;
547
+ }
220
548
 
221
- stopsButton.addEventListener('click', () => {
222
- updateMenuValue('stops');
223
- });
549
+ export function auroMenuMatchWordExample() {
550
+ let matchWordInput = document.querySelector('#matchWordInput');
224
551
 
225
- stopsTopButton.addEventListener('click', () => {
226
- updateMenuValue('stops-top');
227
- });
228
- };
552
+ matchWordInput.addEventListener('keyup', updateMatch);
553
+ }
229
554
  ```
230
555
  <!-- AURO-GENERATED-CONTENT:END -->
231
556
  </auro-accordion>
232
557
 
233
- ### Attribute Examples
234
-
235
- #### allowDeselect
558
+ ### Multi-Select
236
559
 
237
- When set, the `allowDeselect` attribute allows the user to click on a selected menu option again to deselect it when the menu is not in multi-select mode.
560
+ The `auro-menu` supports a multi-select option. To use, place the `multiselect` attribute on the `<auro-menu>` element tag or update the `multiselect` property programmatically.
238
561
 
239
- When the menu is in multi-select mode, this attribute has no effect and the user will be able to deselect the last remaining selected option.
562
+ In multi-select mode, the `value` property will always return a valid JSON string that contains an array of selected values, e.g. `'["stops","duration","arrival"]'`, when accessed.
563
+
564
+ The value of the menu may be set via multiple methods when in multi-select mode:
565
+ - Programmatically or via attribute by passing a valid JSON string that can be parsed using `JSON.parse`.
566
+ - Programmatically or via attribute by passing a single matching value in a string, e.g. `"stops"`.
567
+ - Programmatically by passing an array of string values, e.g. `["stops","duration","arrival"]`.
568
+
569
+ _Note: Other methods of setting the value may work but are not officially supported and may stop working unexpectedly._
240
570
 
241
571
  <div class="exampleWrapper">
242
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/allowDeselect.html) -->
243
- <!-- The below content is automatically added from ./../apiExamples/allowDeselect.html -->
244
- <auro-menu allowDeselect>
572
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/multi-select.html) -->
573
+ <!-- The below content is automatically added from ./../apiExamples/multi-select.html -->
574
+ <auro-menu multiselect>
245
575
  <auro-menuoption value="stops">Stops</auro-menuoption>
246
576
  <auro-menuoption value="price">Price</auro-menuoption>
247
577
  <auro-menuoption value="duration">Duration</auro-menuoption>
@@ -252,11 +582,11 @@ When the menu is in multi-select mode, this attribute has no effect and the user
252
582
  </div>
253
583
  <auro-accordion alignRight>
254
584
  <span slot="trigger">See code</span>
255
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/allowDeselect.html) -->
256
- <!-- The below code snippet is automatically added from ./../apiExamples/allowDeselect.html -->
585
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multi-select.html) -->
586
+ <!-- The below code snippet is automatically added from ./../apiExamples/multi-select.html -->
257
587
 
258
588
  ```html
259
- <auro-menu allowDeselect>
589
+ <auro-menu multiselect>
260
590
  <auro-menuoption value="stops">Stops</auro-menuoption>
261
591
  <auro-menuoption value="price">Price</auro-menuoption>
262
592
  <auro-menuoption value="duration">Duration</auro-menuoption>
@@ -267,7 +597,8 @@ When the menu is in multi-select mode, this attribute has no effect and the user
267
597
  <!-- AURO-GENERATED-CONTENT:END -->
268
598
  </auro-accordion>
269
599
 
270
- #### noCheckmark<a name="noCheckmark"></a>
600
+ ### No Checkmark
601
+
271
602
  Applying the `noCheckmark` attribute will prevent the check icon from being shown on the selected option. The left padding to reserve space for the checkmark is also removed.
272
603
 
273
604
  <div class="exampleWrapper">
@@ -349,169 +680,15 @@ Applying the `noCheckmark` attribute will prevent the check icon from being show
349
680
  <!-- AURO-GENERATED-CONTENT:END -->
350
681
  </auro-accordion>
351
682
 
352
- #### disabled<a name="disabled"></a>
353
- The `auro-menu` element with `disabled` will mark all `auro-menuoption` elements as disabled.
354
-
355
- <div class="exampleWrapper">
356
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabledMenu.html) -->
357
- <!-- The below content is automatically added from ./../apiExamples/disabledMenu.html -->
358
- <auro-menu disabled>
359
- <auro-menuoption value="new tab">New tab</auro-menuoption>
360
- <auro-menuoption value="new window">New window</auro-menuoption>
361
- <auro-menuoption value="open file">Open file</auro-menuoption>
362
- <auro-menuoption value="open location">Open location</auro-menuoption>
363
- <hr>
364
- <auro-menuoption value="close window">Close window</auro-menuoption>
365
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
366
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
367
- <hr>
368
- <auro-menuoption value="share">Share</auro-menuoption>
369
- <hr>
370
- <auro-menuoption value="print">Print</auro-menuoption>
371
- </auro-menu>
372
- <!-- AURO-GENERATED-CONTENT:END -->
373
- </div>
374
- <auro-accordion alignRight>
375
- <span slot="trigger">See code</span>
376
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabledMenu.html) -->
377
- <!-- The below code snippet is automatically added from ./../apiExamples/disabledMenu.html -->
378
-
379
- ```html
380
- <auro-menu disabled>
381
- <auro-menuoption value="new tab">New tab</auro-menuoption>
382
- <auro-menuoption value="new window">New window</auro-menuoption>
383
- <auro-menuoption value="open file">Open file</auro-menuoption>
384
- <auro-menuoption value="open location">Open location</auro-menuoption>
385
- <hr>
386
- <auro-menuoption value="close window">Close window</auro-menuoption>
387
- <auro-menuoption value="close tab">Close tab</auro-menuoption>
388
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
389
- <hr>
390
- <auro-menuoption value="share">Share</auro-menuoption>
391
- <hr>
392
- <auro-menuoption value="print">Print</auro-menuoption>
393
- </auro-menu>
394
- ```
395
- <!-- AURO-GENERATED-CONTENT:END -->
396
- </auro-accordion>
397
-
398
- #### matchWord<a name="matchWord"></a>
399
- The `auro-menu` component supports the use of the `matchWord` attribute to highlight string parts of each menuoption that are equal to `matchWord`. The matching algorithm is case insensitive (e.g., `n` matches `N`).
400
-
401
- <div class="exampleWrapper">
402
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/matchWord.html) -->
403
- <!-- The below content is automatically added from ./../apiExamples/matchWord.html -->
404
- <auro-input id="matchWordInput" required>
405
- <span slot="label">Enter a value to match in the menu</span>
406
- </auro-input>
407
- <br />
408
- <auro-menu id="matchWordMenu">
409
- <auro-menuoption value="stops">Stops</auro-menuoption>
410
- <auro-menuoption value="price">Price</auro-menuoption>
411
- <auro-menuoption value="duration">Duration</auro-menuoption>
412
- <auro-menuoption value="departure">Departure</auro-menuoption>
413
- <auro-menu>
414
- <auro-menuoption value="apples">Apples</auro-menuoption>
415
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
416
- <auro-menuoption value="peaches">Peaches</auro-menuoption>
417
- </auro-menu>
418
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
419
- </auro-menu>
420
- <!-- AURO-GENERATED-CONTENT:END -->
421
- </div>
422
- <auro-accordion alignRight>
423
- <span slot="trigger">See code</span>
424
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/matchWord.js) -->
425
- <!-- The below code snippet is automatically added from ./../apiExamples/matchWord.js -->
426
-
427
- ```js
428
- function updateMatch() {
429
- let matchWordMenu = document.querySelector('#matchWordMenu');
430
-
431
- matchWordMenu.matchWord = matchWordInput.value;
432
- }
433
-
434
- export function auroMenuMatchWordExample() {
435
- let matchWordInput = document.querySelector('#matchWordInput');
436
-
437
- matchWordInput.addEventListener('keyup', updateMatch);
438
- }
439
- ```
440
- <!-- AURO-GENERATED-CONTENT:END -->
441
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/matchWord.html) -->
442
- <!-- The below code snippet is automatically added from ./../apiExamples/matchWord.html -->
443
-
444
- ```html
445
- <auro-input id="matchWordInput" required>
446
- <span slot="label">Enter a value to match in the menu</span>
447
- </auro-input>
448
- <br />
449
- <auro-menu id="matchWordMenu">
450
- <auro-menuoption value="stops">Stops</auro-menuoption>
451
- <auro-menuoption value="price">Price</auro-menuoption>
452
- <auro-menuoption value="duration">Duration</auro-menuoption>
453
- <auro-menuoption value="departure">Departure</auro-menuoption>
454
- <auro-menu>
455
- <auro-menuoption value="apples">Apples</auro-menuoption>
456
- <auro-menuoption value="oranges">Oranges</auro-menuoption>
457
- <auro-menuoption value="peaches">Peaches</auro-menuoption>
458
- </auro-menu>
459
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
460
- </auro-menu>
461
- ```
462
- <!-- AURO-GENERATED-CONTENT:END -->
463
- </auro-accordion>
464
-
465
- ### Multi-Select<a name="multiSelect"></a>
466
- The `auro-menu` supports a multi-select option. To use, place the `multiselect` attribute on the `<auro-menu>` element tag or update the `multiselect` property programmatically.
467
-
468
- In multi-select mode, the `value` property will always return a valid JSON string that contains an array of selected values, e.g. `'["stops","duration","arrival"]'`, when accessed.
469
-
470
- The value of the menu may be set via multiple methods when in multi-select mode:
471
- - Programmatically or via attribute by passing a valid JSON string that can be parsed using `JSON.parse`.
472
- - Programmatically or via attribute by passing a single matching value in a string, e.g. `"stops"`.
473
- - Programmatically by passing an array of string values, e.g. `["stops","duration","arrival"]`.
474
-
475
- _Note: Other methods of setting the value may work but are not officially supported and may stop working unexpectedly._
476
-
477
- <div class="exampleWrapper">
478
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/multiSelect.html) -->
479
- <!-- The below content is automatically added from ./../apiExamples/multiSelect.html -->
480
- <auro-menu multiselect>
481
- <auro-menuoption value="stops">Stops</auro-menuoption>
482
- <auro-menuoption value="price">Price</auro-menuoption>
483
- <auro-menuoption value="duration">Duration</auro-menuoption>
484
- <auro-menuoption value="departure">Departure</auro-menuoption>
485
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
486
- </auro-menu>
487
- <!-- AURO-GENERATED-CONTENT:END -->
488
- </div>
489
- <auro-accordion alignRight>
490
- <span slot="trigger">See code</span>
491
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multiSelect.html) -->
492
- <!-- The below code snippet is automatically added from ./../apiExamples/multiSelect.html -->
493
-
494
- ```html
495
- <auro-menu multiselect>
496
- <auro-menuoption value="stops">Stops</auro-menuoption>
497
- <auro-menuoption value="price">Price</auro-menuoption>
498
- <auro-menuoption value="duration">Duration</auro-menuoption>
499
- <auro-menuoption value="departure">Departure</auro-menuoption>
500
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
501
- </auro-menu>
502
- ```
503
- <!-- AURO-GENERATED-CONTENT:END -->
504
- </auro-accordion>
505
-
506
- #### Optional Flag - `selectAllMatchingOptions`
683
+ ### Select All Matching Options
507
684
 
508
- When this flag is set on the `auro-menu` tag, when the value is set, any option with a matching key will be selected, even when multiple options with that key exist.
685
+ Use the `selectAllMatchingOptions` attribute to enable selecting all options with matching keys when `value` is set programmatically.
509
686
 
510
687
  If not set, only the first matching option will be selected.
511
688
 
512
689
  <div class="exampleWrapper">
513
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/selectAllMatchingOptions.html) -->
514
- <!-- The below content is automatically added from ./../apiExamples/selectAllMatchingOptions.html -->
690
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/select-all-matching-options.html) -->
691
+ <!-- The below content is automatically added from ./../apiExamples/select-all-matching-options.html -->
515
692
  <p>With <code>selectAllMatchingOptions</code> enabled:</p>
516
693
  <auro-button id="selectAllBtn">Set <code>menu.value</code> to <code>'stops'</code></auro-button>
517
694
  <auro-button id="resetAllBtn">Reset Menu</auro-button>
@@ -545,8 +722,8 @@ If not set, only the first matching option will be selected.
545
722
  </div>
546
723
  <auro-accordion alignRight>
547
724
  <span slot="trigger">See code</span>
548
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/selectAllMatchingOptions.html) -->
549
- <!-- The below code snippet is automatically added from ./../apiExamples/selectAllMatchingOptions.html -->
725
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/select-all-matching-options.html) -->
726
+ <!-- The below code snippet is automatically added from ./../apiExamples/select-all-matching-options.html -->
550
727
 
551
728
  ```html
552
729
  <p>With <code>selectAllMatchingOptions</code> enabled:</p>
@@ -580,148 +757,89 @@ If not set, only the first matching option will be selected.
580
757
  </auro-menu>
581
758
  ```
582
759
  <!-- AURO-GENERATED-CONTENT:END -->
583
- </auro-accordion>
584
-
585
- #### Loading<a name="loading"></a>
586
- While content is loading, the menu can either remain empty or display a loading placeholder
587
-
588
- <div class="exampleWrapper">
589
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/loading.html) -->
590
- <!-- The below content is automatically added from ./../apiExamples/loading.html -->
591
- <script>
592
- </script>
593
- <auro-button common id="loadingExampleToggleButton">Toggle Loading</auro-button>
594
- <table id="loadingExampleTable">
595
- <thead>
596
- <tr>
597
- <td width="25%">Spinner + Text</td>
598
- <td width="25%">Text Only</td>
599
- <td width="25%">Spinner Only</td>
600
- <td width="25%">None</td>
601
- </tr>
602
- </thead>
603
- <tr>
604
- <td>
605
- <auro-menu>
606
- <auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
607
- <auro-menuoption value="stops">Stops</auro-menuoption>
608
- <auro-menuoption value="price">Price</auro-menuoption>
609
- <auro-menuoption value="duration">Duration</auro-menuoption>
610
- <auro-menuoption value="departure">Departure</auro-menuoption>
611
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
612
- </auro-menu>
613
- </td>
614
- <td>
615
- <auro-menu>
616
- <span slot="loadingText">Loading...</span>
617
- <auro-menuoption value="stops">Stops</auro-menuoption>
618
- <auro-menuoption value="price">Price</auro-menuoption>
619
- <auro-menuoption value="duration">Duration</auro-menuoption>
620
- <auro-menuoption value="departure">Departure</auro-menuoption>
621
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
622
- </auro-menu>
623
- </td>
624
- <td>
625
- <auro-menu>
626
- <auro-loader slot="loadingIcon" orbit xs></auro-loader>
627
- <auro-menuoption value="stops">Stops</auro-menuoption>
628
- <auro-menuoption value="price">Price</auro-menuoption>
629
- <auro-menuoption value="duration">Duration</auro-menuoption>
630
- <auro-menuoption value="departure">Departure</auro-menuoption>
631
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
632
- </auro-menu>
633
- </td>
634
- <td>
635
- <auro-menu>
636
- <auro-menuoption value="stops">Stops</auro-menuoption>
637
- <auro-menuoption value="price">Price</auro-menuoption>
638
- <auro-menuoption value="duration">Duration</auro-menuoption>
639
- <auro-menuoption value="departure">Departure</auro-menuoption>
640
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
641
- </auro-menu>
642
- </td>
643
- </tr>
644
- </table>
645
- <!-- AURO-GENERATED-CONTENT:END -->
646
- </div>
647
- <auro-accordion alignRight>
648
- <span slot="trigger">See code</span>
649
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/loading.js) -->
650
- <!-- The below code snippet is automatically added from ./../apiExamples/loading.js -->
760
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/select-all-matching-options.js) -->
761
+ <!-- The below code snippet is automatically added from ./../apiExamples/select-all-matching-options.js -->
651
762
 
652
763
  ```js
653
- export function auroMenuLoadingExample() {
654
- document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
655
- document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
764
+ export const initSelectAllMatchingOptionsExample = () => {
765
+
766
+ const selectAllBtn = document.getElementById('selectAllBtn');
767
+ const selectAllMenu = document.getElementById('selectAllMenu');
768
+ const selectFirstBtn = document.getElementById('selectFirstBtn');
769
+ const selectFirstMenu = document.getElementById('selectFirstMenu');
770
+ const resetAllBtn = document.getElementById('resetAllBtn');
771
+ const resetFirstBtn = document.getElementById('resetFirstBtn');
772
+
773
+ selectAllBtn.addEventListener('click', () => {
774
+ selectAllMenu.value = 'stops';
656
775
  });
657
- }
776
+
777
+ resetAllBtn.addEventListener('click', () => {
778
+ selectAllMenu.reset();
779
+ });
780
+
781
+ selectFirstBtn.addEventListener('click', () => {
782
+ selectFirstMenu.value = 'stops';
783
+ });
784
+
785
+ resetFirstBtn.addEventListener('click', () => {
786
+ selectFirstMenu.reset();
787
+ });
788
+ };
658
789
  ```
659
790
  <!-- AURO-GENERATED-CONTENT:END -->
660
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/loading.html) -->
661
- <!-- The below code snippet is automatically added from ./../apiExamples/loading.html -->
791
+ </auro-accordion>
792
+
793
+ ### Preselect Option
794
+
795
+ The `auro-menu` element supports a pre-selected option via the `selected` attribute on the `auro-menuoption` element.
796
+
797
+ <div class="exampleWrapper">
798
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
799
+ <!-- The below content is automatically added from ./../apiExamples/preselect.html -->
800
+ <auro-menu>
801
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
802
+ <auro-menuoption value="new window" selected>New window</auro-menuoption>
803
+ <auro-menuoption value="open file">Open file</auro-menuoption>
804
+ <auro-menuoption value="open location">Open location</auro-menuoption>
805
+ <hr>
806
+ <auro-menuoption value="close window">Close window</auro-menuoption>
807
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
808
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
809
+ <hr>
810
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
811
+ <hr>
812
+ <auro-menuoption value="print">Print</auro-menuoption>
813
+ </auro-menu>
814
+ <!-- AURO-GENERATED-CONTENT:END -->
815
+ </div>
816
+ <auro-accordion alignRight>
817
+ <span slot="trigger">See code</span>
818
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
819
+ <!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
662
820
 
663
821
  ```html
664
- <script>
665
- </script>
666
- <auro-button common id="loadingExampleToggleButton">Toggle Loading</auro-button>
667
- <table id="loadingExampleTable">
668
- <thead>
669
- <tr>
670
- <td width="25%">Spinner + Text</td>
671
- <td width="25%">Text Only</td>
672
- <td width="25%">Spinner Only</td>
673
- <td width="25%">None</td>
674
- </tr>
675
- </thead>
676
- <tr>
677
- <td>
678
- <auro-menu>
679
- <auro-loader slot="loadingIcon" orbit xs></auro-loader><span slot="loadingText">Loading...</span>
680
- <auro-menuoption value="stops">Stops</auro-menuoption>
681
- <auro-menuoption value="price">Price</auro-menuoption>
682
- <auro-menuoption value="duration">Duration</auro-menuoption>
683
- <auro-menuoption value="departure">Departure</auro-menuoption>
684
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
685
- </auro-menu>
686
- </td>
687
- <td>
688
- <auro-menu>
689
- <span slot="loadingText">Loading...</span>
690
- <auro-menuoption value="stops">Stops</auro-menuoption>
691
- <auro-menuoption value="price">Price</auro-menuoption>
692
- <auro-menuoption value="duration">Duration</auro-menuoption>
693
- <auro-menuoption value="departure">Departure</auro-menuoption>
694
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
695
- </auro-menu>
696
- </td>
697
- <td>
698
- <auro-menu>
699
- <auro-loader slot="loadingIcon" orbit xs></auro-loader>
700
- <auro-menuoption value="stops">Stops</auro-menuoption>
701
- <auro-menuoption value="price">Price</auro-menuoption>
702
- <auro-menuoption value="duration">Duration</auro-menuoption>
703
- <auro-menuoption value="departure">Departure</auro-menuoption>
704
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
705
- </auro-menu>
706
- </td>
707
- <td>
708
- <auro-menu>
709
- <auro-menuoption value="stops">Stops</auro-menuoption>
710
- <auro-menuoption value="price">Price</auro-menuoption>
711
- <auro-menuoption value="duration">Duration</auro-menuoption>
712
- <auro-menuoption value="departure">Departure</auro-menuoption>
713
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
714
- </auro-menu>
715
- </td>
716
- </tr>
717
- </table>
822
+ <auro-menu>
823
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
824
+ <auro-menuoption value="new window" selected>New window</auro-menuoption>
825
+ <auro-menuoption value="open file">Open file</auro-menuoption>
826
+ <auro-menuoption value="open location">Open location</auro-menuoption>
827
+ <hr>
828
+ <auro-menuoption value="close window">Close window</auro-menuoption>
829
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
830
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
831
+ <hr>
832
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
833
+ <hr>
834
+ <auro-menuoption value="print">Print</auro-menuoption>
835
+ </auro-menu>
718
836
  ```
719
837
  <!-- AURO-GENERATED-CONTENT:END -->
720
838
  </auro-accordion>
721
839
 
722
- ### Common Use Cases
840
+ ## Common Usage Patterns & Functional Examples
723
841
 
724
- #### Scroll
842
+ ### Scroll
725
843
 
726
844
  When setting the `max-height` of `auro-menu`, all of the overflowing content can be accessed via a scrollbar.
727
845
 
@@ -804,7 +922,7 @@ When setting the `max-height` of `auro-menu`, all of the overflowing content can
804
922
  <!-- AURO-GENERATED-CONTENT:END -->
805
923
  </auro-accordion>
806
924
 
807
- #### Options with horizonal separator
925
+ ### Options with Horizontal Separator
808
926
 
809
927
  To create a natural separation between options, simply use a `<hr>` element.
810
928
 
@@ -851,13 +969,13 @@ To create a natural separation between options, simply use a `<hr>` element.
851
969
  <!-- AURO-GENERATED-CONTENT:END -->
852
970
  </auro-accordion>
853
971
 
854
- #### Nesting auro-menus to create sub-menus
972
+ ### Submenu / Nested Menu
855
973
 
856
974
  The `auro-menu` element supports the placement of an `auro-menu` inside of another `auro-menu`. There is no technical limit to the level of nesting.
857
975
 
858
976
  <div class="exampleWrapper">
859
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nestedMenu.html) -->
860
- <!-- The below content is automatically added from ./../apiExamples/nestedMenu.html -->
977
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested-menu.html) -->
978
+ <!-- The below content is automatically added from ./../apiExamples/nested-menu.html -->
861
979
  <auro-menu id="alpha">
862
980
  <auro-menuoption value="stops">Stops</auro-menuoption>
863
981
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -894,8 +1012,8 @@ The `auro-menu` element supports the placement of an `auro-menu` inside of anoth
894
1012
  </div>
895
1013
  <auro-accordion alignRight>
896
1014
  <span slot="trigger">See code</span>
897
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nestedMenu.html) -->
898
- <!-- The below code snippet is automatically added from ./../apiExamples/nestedMenu.html -->
1015
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested-menu.html) -->
1016
+ <!-- The below code snippet is automatically added from ./../apiExamples/nested-menu.html -->
899
1017
 
900
1018
  ```html
901
1019
  <auro-menu id="alpha">
@@ -934,107 +1052,13 @@ The `auro-menu` element supports the placement of an `auro-menu` inside of anoth
934
1052
  <!-- AURO-GENERATED-CONTENT:END -->
935
1053
  </auro-accordion>
936
1054
 
937
- #### An auro-menuoption element w/ disabled state
938
-
939
- The `auro-menuoption` element supports the placement of the `disabled` attribute per option. A fully disabled list would be managed in an outer wrapping drop down menu element.
940
-
941
- <div class="exampleWrapper">
942
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
943
- <!-- The below content is automatically added from ./../apiExamples/disabled.html -->
944
- <auro-menu>
945
- <auro-menuoption value="new tab">New tab</auro-menuoption>
946
- <auro-menuoption value="new window">New window</auro-menuoption>
947
- <auro-menuoption value="open file">Open file</auro-menuoption>
948
- <auro-menuoption value="open location">Open location</auro-menuoption>
949
- <hr>
950
- <auro-menuoption value="close window">Close window</auro-menuoption>
951
- <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
952
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
953
- <hr>
954
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
955
- <hr>
956
- <auro-menuoption value="print">Print</auro-menuoption>
957
- </auro-menu>
958
- <!-- AURO-GENERATED-CONTENT:END -->
959
- </div>
960
- <auro-accordion alignRight>
961
- <span slot="trigger">See code</span>
962
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
963
- <!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
964
-
965
- ```html
966
- <auro-menu>
967
- <auro-menuoption value="new tab">New tab</auro-menuoption>
968
- <auro-menuoption value="new window">New window</auro-menuoption>
969
- <auro-menuoption value="open file">Open file</auro-menuoption>
970
- <auro-menuoption value="open location">Open location</auro-menuoption>
971
- <hr>
972
- <auro-menuoption value="close window">Close window</auro-menuoption>
973
- <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
974
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
975
- <hr>
976
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
977
- <hr>
978
- <auro-menuoption value="print">Print</auro-menuoption>
979
- </auro-menu>
980
- ```
981
- <!-- AURO-GENERATED-CONTENT:END -->
982
- </auro-accordion>
983
-
984
- #### Menu with pre-selected menu option
985
-
986
- The `auro-menu` element supports a pre-selected option via the `selected` attribute on the `auro-menuoption` element.
987
-
988
- <div class="exampleWrapper">
989
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
990
- <!-- The below content is automatically added from ./../apiExamples/preselect.html -->
991
- <auro-menu>
992
- <auro-menuoption value="new tab">New tab</auro-menuoption>
993
- <auro-menuoption value="new window" selected>New window</auro-menuoption>
994
- <auro-menuoption value="open file">Open file</auro-menuoption>
995
- <auro-menuoption value="open location">Open location</auro-menuoption>
996
- <hr>
997
- <auro-menuoption value="close window">Close window</auro-menuoption>
998
- <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
999
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
1000
- <hr>
1001
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
1002
- <hr>
1003
- <auro-menuoption value="print">Print</auro-menuoption>
1004
- </auro-menu>
1005
- <!-- AURO-GENERATED-CONTENT:END -->
1006
- </div>
1007
- <auro-accordion alignRight>
1008
- <span slot="trigger">See code</span>
1009
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
1010
- <!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
1011
-
1012
- ```html
1013
- <auro-menu>
1014
- <auro-menuoption value="new tab">New tab</auro-menuoption>
1015
- <auro-menuoption value="new window" selected>New window</auro-menuoption>
1016
- <auro-menuoption value="open file">Open file</auro-menuoption>
1017
- <auro-menuoption value="open location">Open location</auro-menuoption>
1018
- <hr>
1019
- <auro-menuoption value="close window">Close window</auro-menuoption>
1020
- <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
1021
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
1022
- <hr>
1023
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
1024
- <hr>
1025
- <auro-menuoption value="print">Print</auro-menuoption>
1026
- </auro-menu>
1027
- ```
1028
- <!-- AURO-GENERATED-CONTENT:END -->
1029
- </auro-accordion>
1030
-
1031
- #### Menu with restricted width and long option
1055
+ ### Restricted Width and Long Option
1032
1056
 
1033
1057
  The `auro-menu` element supports scenarios where the outer parent element of the menu constrains its width and there are options with text longer than the pull down menu will support. Truncated content will be illustrated with an ellipsis.
1034
1058
 
1035
1059
  <div class="exampleWrapper">
1036
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/restrictedWidth.html) -->
1037
- <!-- The below content is automatically added from ./../apiExamples/restrictedWidth.html -->
1060
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/restricted-width.html) -->
1061
+ <!-- The below content is automatically added from ./../apiExamples/restricted-width.html -->
1038
1062
  <auro-menu style="width: 300px">
1039
1063
  <auro-menuoption value="new tab">New tab</auro-menuoption>
1040
1064
  <auro-menuoption value="new window">New window</auro-menuoption>
@@ -1053,8 +1077,8 @@ The `auro-menu` element supports scenarios where the outer parent element of the
1053
1077
  </div>
1054
1078
  <auro-accordion alignRight>
1055
1079
  <span slot="trigger">See code</span>
1056
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/restrictedWidth.html) -->
1057
- <!-- The below code snippet is automatically added from ./../apiExamples/restrictedWidth.html -->
1080
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/restricted-width.html) -->
1081
+ <!-- The below code snippet is automatically added from ./../apiExamples/restricted-width.html -->
1058
1082
 
1059
1083
  ```html
1060
1084
  <auro-menu style="width: 300px">
@@ -1075,7 +1099,7 @@ The `auro-menu` element supports scenarios where the outer parent element of the
1075
1099
  <!-- AURO-GENERATED-CONTENT:END -->
1076
1100
  </auro-accordion>
1077
1101
 
1078
- #### Menu with hidden options
1102
+ #### Hidden Options
1079
1103
 
1080
1104
  The `auro-menuoption` element supports scenarios where the menu option needs to be hidden. e.g. the only visible menu options contain the `matchWord`.
1081
1105
 
@@ -1122,7 +1146,7 @@ The `auro-menuoption` element supports scenarios where the menu option needs to
1122
1146
  <!-- AURO-GENERATED-CONTENT:END -->
1123
1147
  </auro-accordion>
1124
1148
 
1125
- #### Reset menu selection state
1149
+ ### Reset Menu Selection State
1126
1150
 
1127
1151
  The `auro-menu` may be reset to a state with no menuoption selected by setting the `value` to `undefined`.
1128
1152
 
@@ -1142,22 +1166,6 @@ The `auro-menu` may be reset to a state with no menuoption selected by setting t
1142
1166
  </div>
1143
1167
  <auro-accordion alignRight>
1144
1168
  <span slot="trigger">See code</span>
1145
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.js) -->
1146
- <!-- The below code snippet is automatically added from ./../apiExamples/reset.js -->
1147
-
1148
- ```js
1149
- export function auroMenuResetExample() {
1150
- const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
1151
- const resetExampleElem = document.querySelector('#resetExample');
1152
-
1153
- if (resetExampleElem && resetExampleBtnElem) {
1154
- resetExampleBtnElem.addEventListener('click', () => {
1155
- resetExampleElem.reset();
1156
- });
1157
- }
1158
- }
1159
- ```
1160
- <!-- AURO-GENERATED-CONTENT:END -->
1161
1169
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.html) -->
1162
1170
  <!-- The below code snippet is automatically added from ./../apiExamples/reset.html -->
1163
1171
 
@@ -1173,80 +1181,20 @@ export function auroMenuResetExample() {
1173
1181
  <auro-button id="resetExampleBtn">RESET</auro-button>
1174
1182
  ```
1175
1183
  <!-- AURO-GENERATED-CONTENT:END -->
1176
- </auro-accordion>
1184
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset.js) -->
1185
+ <!-- The below code snippet is automatically added from ./../apiExamples/reset.js -->
1177
1186
 
1178
- ### Theme Support
1179
-
1180
- The component may be restyled using the following code sample and changing the values of the following token(s).
1181
-
1182
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/default/tokens.scss) -->
1183
- <!-- The below code snippet is automatically added from ./../src/styles/default/tokens.scss -->
1187
+ ```js
1188
+ export function auroMenuResetExample() {
1189
+ const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
1190
+ const resetExampleElem = document.querySelector('#resetExample');
1184
1191
 
1185
- ```scss
1186
- @use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
1187
-
1188
- :host {
1189
- --ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
1190
- --ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
1191
- --ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1192
- --ds-auro-menuoption-container-color: transparent;
1193
- --ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);
1194
- --ds-auro-menuoption-icon-color: transparent;
1195
- --ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1192
+ if (resetExampleElem && resetExampleBtnElem) {
1193
+ resetExampleBtnElem.addEventListener('click', () => {
1194
+ resetExampleElem.reset();
1195
+ });
1196
+ }
1196
1197
  }
1197
1198
  ```
1198
1199
  <!-- AURO-GENERATED-CONTENT:END -->
1199
- <div class="exampleWrapper">
1200
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/customColor.html) -->
1201
- <!-- The below content is automatically added from ./../apiExamples/customColor.html -->
1202
- <style>
1203
- #customColorMenu auro-menuoption[selected] {
1204
- --ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle);
1205
- --ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default);
1206
- }
1207
- #customColorMenu auro-menuoption:hover {
1208
- --ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted);
1209
- }
1210
- #customColorMenu auro-menuoption:focus {
1211
- --ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand);
1212
- }
1213
-
1214
- </style>
1215
- <auro-menu id="customColorMenu">
1216
- <auro-menuoption value="stops">Stops</auro-menuoption>
1217
- <auro-menuoption value="price">Price</auro-menuoption>
1218
- <auro-menuoption value="duration">Duration</auro-menuoption>
1219
- <auro-menuoption value="departure">Departure</auro-menuoption>
1220
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1221
- </auro-menu>
1222
- <!-- AURO-GENERATED-CONTENT:END -->
1223
- </div>
1224
- <auro-accordion alignRight>
1225
- <span slot="trigger">See code</span>
1226
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/customColor.html) -->
1227
- <!-- The below code snippet is automatically added from ./../apiExamples/customColor.html -->
1228
-
1229
- ```html
1230
- <style>
1231
- #customColorMenu auro-menuoption[selected] {
1232
- --ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle);
1233
- --ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default);
1234
- }
1235
- #customColorMenu auro-menuoption:hover {
1236
- --ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted);
1237
- }
1238
- #customColorMenu auro-menuoption:focus {
1239
- --ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand);
1240
- }
1241
-
1242
- </style>
1243
- <auro-menu id="customColorMenu">
1244
- <auro-menuoption value="stops">Stops</auro-menuoption>
1245
- <auro-menuoption value="price">Price</auro-menuoption>
1246
- <auro-menuoption value="duration">Duration</auro-menuoption>
1247
- <auro-menuoption value="departure">Departure</auro-menuoption>
1248
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
1249
- </auro-menu>
1250
- ```
1251
- <!-- AURO-GENERATED-CONTENT:END -->
1252
1200
  </auro-accordion>